Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
ff05159
Minor
daphne-cornelisse Nov 11, 2025
b08ad27
Add human log likelihood regularizer (#75)
daphne-cornelisse Nov 13, 2025
72e552e
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 13, 2025
922e909
Merge branch 'gsp_dev' of https://github.com/Emerge-Lab/PufferDrive i…
daphne-cornelisse Nov 13, 2025
2f7bdd4
WIP
daphne-cornelisse Nov 14, 2025
eba1a6e
Merge remote-tracking branch 'origin' into gsp_dev
daphne-cornelisse Nov 18, 2025
0f8578f
WIP
daphne-cornelisse Nov 18, 2025
3a95801
Guidance Reward (#121)
nadarenator Nov 18, 2025
d0b6778
skip human log reg if coef 0
nadarenator Nov 18, 2025
7e6d0c2
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 22, 2025
a37747d
Merge branch 'gsp_dev' of https://github.com/Emerge-Lab/PufferDrive i…
daphne-cornelisse Nov 22, 2025
1cc7cfa
Fix expert data function to fit with new joint discrete action space.
daphne-cornelisse Nov 22, 2025
4593bd1
Bug fix to enable human replay eval without overwriting human data.
daphne-cornelisse Nov 22, 2025
fc43805
Update settings.
daphne-cornelisse Nov 22, 2025
bc94769
Add weights_only arg.
daphne-cornelisse Nov 22, 2025
4044a22
Always log the log likelihood.
daphne-cornelisse Nov 24, 2025
e9f1e6c
Add mpl to dependencies.
daphne-cornelisse Nov 24, 2025
7317bcc
ini settings.
daphne-cornelisse Nov 24, 2025
574ed21
Merge branch 'gsp_dev' of https://github.com/Emerge-Lab/PufferDrive i…
daphne-cornelisse Nov 24, 2025
d3a4fc6
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 24, 2025
3843ece
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 24, 2025
74f2d45
Update settings.
daphne-cornelisse Nov 24, 2025
80f24a5
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 24, 2025
28bfbf3
Speed up
daphne-cornelisse Nov 24, 2025
ce12e5a
A few remaining WOSAC memory / other optimizations
daphne-cornelisse Nov 24, 2025
59e9838
Better settings.
daphne-cornelisse Nov 25, 2025
99ecf9d
Merge remote-tracking branch 'origin' into gsp_dev
daphne-cornelisse Nov 25, 2025
f1bf6aa
Replace neural network encoder layer with fused LinearMax cuda kernel…
daphne-cornelisse Nov 25, 2025
53c9ddb
WIP
daphne-cornelisse Nov 25, 2025
9d6a311
Data processing script that works decent. (#150)
daphne-cornelisse Nov 25, 2025
1a96cf9
WIP
daphne-cornelisse Nov 25, 2025
3664740
WIP
daphne-cornelisse Nov 25, 2025
99060ba
Pass `map_dir` to the env via `.ini` and enable evaluation on a diffe…
daphne-cornelisse Nov 25, 2025
96451dd
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 26, 2025
fae102a
Old net with 310K SPS. Stable performance.
daphne-cornelisse Nov 26, 2025
0d8de36
Ensure torch and c net are the same.
daphne-cornelisse Nov 26, 2025
d6bb733
Add human regularization back in. 295 SPS.
daphne-cornelisse Nov 26, 2025
6eaea31
Add sprites in headless rendering (#152)
daphne-cornelisse Nov 26, 2025
7d601fb
Merge branch 'main' of https://github.com/Emerge-Lab/PufferDrive into…
daphne-cornelisse Nov 26, 2025
c4c2e7c
sbatch
daphne-cornelisse Nov 26, 2025
a6af21c
Faster file processing (#153)
nadarenator Nov 27, 2025
6ce4879
Add link to small clean eval dataset
daphne-cornelisse Nov 27, 2025
0eab9bd
Fix link typo
daphne-cornelisse Nov 27, 2025
225ef99
Gif for readme (#155)
daphne-cornelisse Nov 27, 2025
f44573e
Fix link?
daphne-cornelisse Nov 27, 2025
b11d5e1
Fix vertical spaces.
daphne-cornelisse Nov 27, 2025
9c8b017
Update README.md
daphne-cornelisse Nov 27, 2025
f98760e
Merge branch 'gsp_dev' of https://github.com/Emerge-Lab/PufferDrive i…
daphne-cornelisse Nov 27, 2025
3c911fc
Undo bug
daphne-cornelisse Nov 27, 2025
eed2e39
Several small improvements for release (#159)
daphne-cornelisse Nov 30, 2025
95ceedd
WIP changes (#156)
nadarenator Dec 1, 2025
9d249b9
Releas note
daphne-cornelisse Dec 4, 2025
ff4f00c
Remove magic numbers in `drivenet.h`, set `MAX_AGENTS=32` by default …
daphne-cornelisse Dec 5, 2025
54affb0
Stable: Ensure all tests are passing (#168)
daphne-cornelisse Dec 6, 2025
a03e70a
Add option to zoom in on the map or show full map (#163)
Aditya-Gupta26 Dec 6, 2025
0cf5e3e
Add documentation (#170)
julianh65 Dec 8, 2025
1ce87a2
Add GitHub Actions workflow for docs deployment (#172)
julianh65 Dec 8, 2025
d03a69d
styling fixes (#173)
julianh65 Dec 9, 2025
217cd3b
Add clang format (#132)
aje-valeo Dec 12, 2025
9a4b09a
Add Sanity Command + Maps (#175)
julianh65 Dec 12, 2025
a8bce58
Documentation edits (#176)
daphne-cornelisse Dec 13, 2025
19b5eb6
Early environment resets based on agents' respawn status. (#167)
riccardosavorgnan Dec 13, 2025
43933b2
Speed up end-to-end training: 220K -> 320K on RTX 4080 by reducing # …
daphne-cornelisse Dec 14, 2025
0eeec10
Add pt. (#179)
daphne-cornelisse Dec 14, 2025
6fa0cbb
Docs edits (#178)
daphne-cornelisse Dec 15, 2025
712ac4f
There is a typo in torch.py
WaelDLZ Dec 15, 2025
76dcce1
Merge pull request #181 from Emerge-Lab/wbd/fix_a_typo_in_torchpy
eugenevinitsky Dec 15, 2025
57be883
Use num_maps for eval (#164)
WaelDLZ Dec 16, 2025
fae2b59
Fix small bug in `drive.c` and add binary weights cpt (#184)
daphne-cornelisse Dec 16, 2025
f349b24
Carla junction filter (#187)
mpragnay Dec 17, 2025
4900039
Working Carla Maps (#189)
mpragnay Dec 18, 2025
656d55a
collision fix (#192)
l1onh3art88 Dec 18, 2025
a033669
Fix Ego Speed Calculation (#166)
julianh65 Dec 19, 2025
273d8f2
Small bug fix that makes road edge not appear in agent view for jerk …
daphne-cornelisse Dec 19, 2025
685b3fd
add womd video (#195)
julianh65 Dec 20, 2025
6f0ca30
Add stop/remove collision behavior back (#169)
Aditya-Gupta26 Dec 20, 2025
61911a3
updated docs with multinode training cmd (#174)
mpragnay Dec 20, 2025
45588ca
Carla2d towns (#201)
mpragnay Dec 21, 2025
657281c
initial commit (#204)
julianh65 Dec 22, 2025
c0c5894
Fix goal resampling in Carla maps and make metrics suitable for resam…
daphne-cornelisse Dec 23, 2025
9a58142
Minor correction in resampling code (#183)
WaelDLZ Dec 23, 2025
b6ed82f
Allow human to drive with agents through classic and jerk dynamics mo…
daphne-cornelisse Dec 24, 2025
d4dabdb
Added WOSAC results on the 10k validation dataset (#185)
WaelDLZ Dec 25, 2025
459e875
Drive with agents in browser (#215)
daphne-cornelisse Dec 26, 2025
952069d
Fix demo (#217)
daphne-cornelisse Dec 26, 2025
7ca82c2
Do not randomly switch to another agent in FPV. (#219)
daphne-cornelisse Dec 27, 2025
38139bb
switch docs to mdbooks doc format (#218)
eugenevinitsky Dec 27, 2025
b89e157
Markdown edits and fix demo. (#221)
daphne-cornelisse Dec 28, 2025
bd20606
small fixes in the docs (#220)
eugenevinitsky Dec 28, 2025
07a7a1d
Release 2.0 (#214)
daphne-cornelisse Dec 30, 2025
cb12de1
Fix space and game files.
Dec 30, 2025
1d864db
Fix sup tags.
Dec 30, 2025
41fd809
Minor.
Dec 30, 2025
4cb277f
Switch docs branch.
Dec 30, 2025
6799ca1
Add unit tests badge to README (#238)
eugenevinitsky Jan 3, 2026
1a63440
Improve Carla train docs.
Jan 4, 2026
a6433a1
Merge remote-tracking branch 'origin/2.0' into gsp_dev
daphne-cornelisse Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Defines the code style for C/C++/CUDA section
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 4
TabWidth: 4
UseTab: Never
ColumnLimit: 120
SortIncludes: false
---
Language: Json
# Don't format .json files
DisableFormat: true
2 changes: 2 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Pufferlib extensions
pufferlib/extensions/**
30 changes: 30 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Docs

on:
push:
branches: [2.0]
paths: [docs/**]
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: 'latest'

- name: Build book
run: mdbook build docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/book
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,19 @@ pufferlib/ocean/impulse_wars/debug-*/
pufferlib/ocean/impulse_wars/release-*/
pufferlib/ocean/impulse_wars/benchmark/


# Ignore data files
data/
pufferlib/resources/drive/binaries/
pufferlib/resources/drive/binaries/training/
pufferlib/resources/drive/binaries/validation/

# But keep map_000.bin for the training test
!pufferlib/resources/drive/binaries/map_000.bin
!pufferlib/resources/drive/binaries/training/map_000.bin
pufferlib/resources/drive/sanity/sanity_binaries/

# Ignore human demonstration data
pufferlib/resources/drive/human_demonstrations/*

# Compiled drive binary in root
/drive
Expand All @@ -184,3 +190,6 @@ pufferlib/resources/drive/output_agent.gif pufferlib/resources/drive/output.gif
artifacts/
# Local drive renders
pufferlib/resources/drive/output*.gif
emsdk/
docs/book/*
!docs/book/assets/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/pyxodr"]
path = external/pyxodr
url = https://github.com/mpragnay/pyxodr.git
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ repos:
- id: nb-clean
args:
- --remove-empty-cells
# Apply clang format
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: 'v21.1.5'
hooks:
- id: clang-format
exclude: '\.(js|html)$|^build_web/|^docs/assets/'
87 changes: 84 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# PufferDrive

[![Unit Tests](https://github.com/Emerge-Lab/PufferDrive/actions/workflows/utest.yml/badge.svg)](https://github.com/Emerge-Lab/PufferDrive/actions/workflows/utest.yml)

<img align="left" style="width:260px" src="https://github.com/Emerge-Lab/PufferDrive/blob/main/pufferlib/resources/drive/pufferdrive_20fps_long.gif" width="288px">

**PufferDrive is a fast and friendly driving simulator to train and test RL-based models.**

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

---

**Docs**: https://emerge-lab.github.io/PufferDrive

---

### See our 2.0 release video

<a href="https://www.youtube.com/watch?v=LfQ324R-cbE">
<img src="https://img.youtube.com/vi/LfQ324R-cbE/0.jpg" alt="PufferDrive 2.0" width="300">
</a>

## Installation

Expand All @@ -22,6 +50,7 @@ Compile the C code
```
python setup.py build_ext --inplace --force
```
Run this while your virtual environment is active so the extension is built against the right interpreter.

To test your setup, you can run
```
Expand Down Expand Up @@ -54,8 +83,9 @@ python pufferlib/ocean/drive/drive.py

You can download the WOMD data from Hugging Face in two versions:

- **Mini Dataset**: [GPUDrive_mini](https://huggingface.co/datasets/EMERGE-lab/GPUDrive_mini) contains 1,000 training files and 300 test/validation files
- **Full Dataset**: [GPUDrive](https://huggingface.co/datasets/EMERGE-lab/GPUDrive) contains 100,000 unique scenes
- **Mini dataset**: [GPUDrive_mini](https://huggingface.co/datasets/EMERGE-lab/GPUDrive_mini) contains 1,000 training files and 300 test/validation files
- **Medium dataset**: [10,000 files from the training dataset](https://huggingface.co/datasets/daphne-cornelisse/pufferdrive_train)
- **Large dataset**: [GPUDrive](https://huggingface.co/datasets/EMERGE-lab/GPUDrive) contains 100,000 unique scenes

**Note**: Replace 'GPUDrive_mini' with 'GPUDrive' in your download commands if you want to use the full dataset.

Expand All @@ -70,6 +100,19 @@ For more training data compatible with PufferDrive, see [ScenarioMax](https://gi
<details>
<summary>Dependencies and usage</summary>

## Local rendering

To launch an interactive renderer, first build:
```
bash scripts/build_ocean.sh drive local
```

then launch:
```bash
./drive
```
this will run `demo()` with an existing model checkpoint.

## Headless server setup

Run the Raylib visualizer on a headless server and export as .mp4. This will rollout the pre-trained policy in the env.
Expand Down Expand Up @@ -117,7 +160,7 @@ The `-s` flag sets up a virtual screen at 1280x720 resolution with 24-bit color

### Distributional realism

We provide a PufferDrive implementation of the [Waymo Open Sim Agents Challenge (WOSAC)](https://waymo.com/open/challenges/2025/sim-agents/) for fast, easy evaluation of how well your trained agent matches distributional properties of human behavior. See details [here](https://github.com/Emerge-Lab/PufferDrive/tree/main/pufferlib/ocean/benchmark).
We provide a PufferDrive implementation of the [Waymo Open Sim Agents Challenge (WOSAC)](https://waymo.com/open/challenges/2025/sim-agents/) for fast, easy evaluation of how well your trained agent matches distributional properties of human behavior. See documentation [here](https://emerge-lab.github.io/PufferDrive/wosac/).

WOSAC evaluation with random policy:
```bash
Expand All @@ -135,3 +178,41 @@ You may be interested in how compatible your agent is with human partners. For t
```bash
puffer eval puffer_drive --eval.human-replay-eval True --load-model-path <your-trained-policy>.pt
```

## Development

<details><summary>Documentation and browser demo</summary>

**Docs**

A browsable documentation site now lives under `docs/` and is configured with mkbooks. To preview locally:
```
brew install mdbook
mdbook serve --open docs
```
Open the served URL to see a local version of the docs.

**Interactive demo**

To edit the browser demo, follow these steps:
- Download [emscripten](https://github.com/emscripten-core/emscripten)
- emscripten install latest
- Activate: `source emsdk/emsdk_env.sh`
- Run `bash scripts/build_ocean.sh drive web`
- This generates a number of `game*` files, move them to `assets/` to include them on the webpage

</details>


## Citation

If you use PufferDrive in your research, please cite:
```bibtex
@software{pufferdrive2025github,
author = {Daphne Cornelisse* and Spencer Cheng* and Pragnay Mandavilli and Julian Hunt and Kevin Joseph and Waël Doulazmi and Valentin Charraut and Aditya Gupta and Joseph Suarez and Eugene Vinitsky},
title = {{PufferDrive}: A Fast and Friendly Driving Simulator for Training and Evaluating {RL} Agents},
url = {https://github.com/Emerge-Lab/PufferDrive},
version = {2.0.0},
year = {2025},
}
```
Loading
Loading