Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
221 commits
Select commit Hold shift + click to select a range
5385837
Delete config files for unused envs
vcharraut Sep 8, 2025
25a8ff6
Delete unused envs
vcharraut Sep 8, 2025
6c2f913
Delete resources of unused envs
vcharraut Sep 8, 2025
21bfdb6
Remove unused import
vcharraut Sep 8, 2025
8aca283
Remove unused environment classes and functions from environment.py a…
vcharraut Sep 8, 2025
dc0fe97
Merge pull request #26 from vcharraut/dev/cleaning-repo
daphne-cornelisse Sep 8, 2025
c812a31
default drive.ini
vcharraut Sep 8, 2025
60808d2
Add ruff formatting and pre-commit
vcharraut Sep 9, 2025
83f9e27
Add back imports for compatibility
vcharraut Sep 9, 2025
26e890c
Revert config
vcharraut Sep 9, 2025
932360c
Merge pull request #27 from vcharraut/dev/ruff
vcharraut Sep 9, 2025
348e89d
Basic getting started docs
daphne-cornelisse Sep 9, 2025
4208808
Merge branch 'main' into docs/getting_started
daphne-cornelisse Sep 9, 2025
70a2da7
Merge branch 'main' of https://github.com/Emerge-Lab/PufferLib into d…
daphne-cornelisse Sep 9, 2025
5d3f69f
Merge branch 'docs/getting_started' of https://github.com/Emerge-Lab/…
daphne-cornelisse Sep 9, 2025
8afeb76
Minor improvements
daphne-cornelisse Sep 9, 2025
a7a5bf3
.gitignore data files
daphne-cornelisse Sep 9, 2025
ce43a67
Update readme
daphne-cornelisse Sep 9, 2025
b20a470
Ignore data files
daphne-cornelisse Sep 9, 2025
f550ba7
Merge pull request #29 from Emerge-Lab/docs/getting_started
daphne-cornelisse Sep 9, 2025
6b878e8
Prevent segfault for maps
daphne-cornelisse Sep 10, 2025
3aeb7ee
Merge pull request #31 from Emerge-Lab/fix/validate_maps
daphne-cornelisse Sep 11, 2025
96c5fb3
Add continuous space support for action
vcharraut Sep 11, 2025
8e6ae15
Update action_type configuration and improve error message for action…
vcharraut Sep 11, 2025
3989080
raylib_vis rollout and obs rollout
l1onh3art88 Sep 11, 2025
d999553
small change
l1onh3art88 Sep 11, 2025
7437468
removed trackign diamond in snapshot mode
l1onh3art88 Sep 11, 2025
aed9387
merge conflicts fixed and pulled in main
l1onh3art88 Sep 11, 2025
ca81ba8
Merge pull request #36 from Emerge-Lab/raylib_vis
daphne-cornelisse Sep 11, 2025
981b369
Add docs
daphne-cornelisse Sep 11, 2025
3274ea1
Merge pull request #37 from Emerge-Lab/docs/vis
daphne-cornelisse Sep 11, 2025
139f751
Integrate raylib visualization with wandb training
daphne-cornelisse Sep 11, 2025
28c9851
Remove unnessary env code.
daphne-cornelisse Sep 11, 2025
9d85786
Delete drive
daphne-cornelisse Sep 11, 2025
6407bbf
Reduce scale to 4.0 for faster rendering.
daphne-cornelisse Sep 11, 2025
fa1d075
Revert "Delete drive"
daphne-cornelisse Sep 11, 2025
9933432
Ensure drive binary is built at initialization.
daphne-cornelisse Sep 11, 2025
6b211ec
Update gitignore
daphne-cornelisse Sep 11, 2025
9c52d01
Delete puffer_drive_weights.bin
daphne-cornelisse Sep 11, 2025
16973ec
Delete drive
daphne-cornelisse Sep 11, 2025
ab5a6d7
Reset params to origin
daphne-cornelisse Sep 11, 2025
897cf0f
Minor
daphne-cornelisse Sep 11, 2025
6a5c500
Decrease default render freq.
daphne-cornelisse Sep 11, 2025
fccad66
Update gitignore
daphne-cornelisse Sep 11, 2025
ad5cdee
Add back example gif and weights
daphne-cornelisse Sep 11, 2025
1facf99
Merge pull request #38 from Emerge-Lab/feat/raylib_wandb
daphne-cornelisse Sep 11, 2025
26fad2f
log trajectories and rollout trajectories
l1onh3art88 Sep 11, 2025
fcec959
puleld in main
l1onh3art88 Sep 11, 2025
cea63a4
Refactor actions to use float pointer for continuous action represent…
vcharraut Sep 12, 2025
5046cf5
Merge pull request #33 from vcharraut/dev/continuous-action-space
vcharraut Sep 12, 2025
937b27f
Update rendering configuration to use values from the config file
vcharraut Sep 12, 2025
978c529
Merge pull request #40 from vcharraut/fix/render_params
vcharraut Sep 12, 2025
593f644
Add agent status array
vcharraut Sep 12, 2025
20e2183
Minor
daphne-cornelisse Sep 14, 2025
b0ed679
Linting
daphne-cornelisse Sep 14, 2025
e157c4d
Merge pull request #39 from Emerge-Lab/raylib_vis
daphne-cornelisse Sep 14, 2025
6b764ed
Enable rendering world state and agent view during training (#42)
daphne-cornelisse Sep 14, 2025
6906270
Merge branch 'main' into dev/agent_status
vcharraut Sep 15, 2025
5dfcb25
Rename agent_status -> metrics_array
vcharraut Sep 15, 2025
ebc5e86
Remove reached_goal field and update metrics_array usage
vcharraut Sep 15, 2025
c310ecc
Change move_expert function parameter type from int* to float*
vcharraut Sep 15, 2025
6838d4e
Add lane alignment metric to Entity and update related functions
vcharraut Sep 15, 2025
bdcbcb4
Fix M_PI definition to ensure consistency in global constants
vcharraut Sep 15, 2025
97000b2
Add changes from main
vcharraut Sep 15, 2025
e4778a2
Fix spacing
vcharraut Sep 15, 2025
7af16ba
Isolate collision_check
vcharraut Sep 15, 2025
af898cb
Remove collided_with_index from Entity and related functions to simpl…
vcharraut Sep 15, 2025
f22d3df
Remove unnecessary metrics assignment in compute_agent_metrics function
vcharraut Sep 15, 2025
54954a5
Replacing hardcoded indices with defined constants in drive.h
vcharraut Sep 15, 2025
2977af9
Add lane alignment rate to logging metrics
vcharraut Sep 15, 2025
0907b88
Refactor collision indicator in compute_observations to use collision…
vcharraut Sep 15, 2025
a01bb7c
Improve visualization aesthetics & flexibility (#43)
daphne-cornelisse Sep 15, 2025
21b3438
Remove redundant metrics assignment in compute_agent_metrics function
vcharraut Sep 15, 2025
1ddfa33
Remove lane alignment metric from reward
vcharraut Sep 15, 2025
2a9c9df
Remove comment
vcharraut Sep 15, 2025
08e6758
Merge pull request #41 from vcharraut/dev/agent_status
vcharraut Sep 15, 2025
2d15ac6
initial commit, added xodr processing scripts, map analysis notebook
mpragnay Sep 15, 2025
4601dec
strip jupyter notebook execution results
mpragnay Sep 16, 2025
5f18a9a
Merge pull request #45 from Emerge-Lab/carla_map_utils
mpragnay Sep 16, 2025
f69b316
Apply ruff formatting
vcharraut Sep 17, 2025
e9e28ba
Add pre-commit job to GitHub Actions workflow
vcharraut Sep 17, 2025
7460a0d
Merge pull request #48 from vcharraut/dev/app-pre-commit-workflow
vcharraut Sep 17, 2025
6d0d7cc
Add ADE to human logs as metric and configurable reward (#51)
daphne-cornelisse Sep 17, 2025
d4a7d7b
Temporarily disable lane check. (#53)
daphne-cornelisse Sep 17, 2025
4f60a4d
Update README.md with Render Dependencies (#55)
mpragnay Sep 18, 2025
97d1707
Fix lane_alignment metrics and add heading checks for the closest roa…
vcharraut Sep 19, 2025
bcd9e43
Add safe lane check (#57)
daphne-cornelisse Sep 20, 2025
759a439
Add CI rendering test (#58)
daphne-cornelisse Sep 21, 2025
8fd777e
Small rendering improvements (#60)
daphne-cornelisse Sep 21, 2025
9c05287
Let's actually pass in map_name via cmd line + frame_skip = 3 by defa…
daphne-cornelisse Sep 21, 2025
7c05d70
Feat/argument parsing (#56)
aje-valeo Sep 22, 2025
d2b116e
Fix missing ini_file arg that leads training runs to fail (#65)
daphne-cornelisse Sep 22, 2025
699f4fa
Add test that launches training job (#66)
daphne-cornelisse Sep 22, 2025
939900a
replaced deprecated dependency (#67)
nadarenator Sep 23, 2025
f82cf41
Visualize goal radius and make configurable (#70)
daphne-cornelisse Sep 24, 2025
7863d47
Error Handling support added
Sep 26, 2025
a954ecd
Fixed trailing whitespaces, newline
Sep 26, 2025
75a9636
Fixed end of file whitespaces
Sep 26, 2025
62f94bc
include quotes fixes
Sep 26, 2025
a29f46b
Merge pull request #71 from Emerge-Lab/Add-Error-Handling
mpragnay Sep 28, 2025
f9aea39
Fixed drive build issues in Linux (#73)
mpragnay Sep 30, 2025
27b647e
Speed up headless rendering (#72)
daphne-cornelisse Oct 2, 2025
77f7288
Added Town01 with no junction road edges (#81)
mpragnay Oct 14, 2025
1368495
Added performance test
Aditya-Gupta26 Oct 16, 2025
c72f97a
Adding performance test
Aditya-Gupta26 Oct 16, 2025
d619b13
Updated performance check criteria
Aditya-Gupta26 Oct 16, 2025
7e54dc8
Updates
Aditya-Gupta26 Oct 16, 2025
1dc1d45
Integrate agent selection flags with ini-driven drive binding
julianh65 Sep 24, 2025
a5a9fe3
Avoid applying selection flags in binding.shared scratch env
julianh65 Sep 24, 2025
c3ddc90
Visualize goal radius and make configurable (#70)
julianh65 Oct 4, 2025
4b7736a
Speed up headless rendering (#72)
daphne-cornelisse Oct 2, 2025
e9d2d27
Integrate agent selection flags with ini-driven drive binding
julianh65 Sep 24, 2025
c4225b6
ignore artifacts and .pt files
julianh65 Oct 4, 2025
0b71ec6
clean up
julianh65 Oct 4, 2025
b683976
clean up
julianh65 Oct 4, 2025
d49b681
fix merge
julianh65 Oct 4, 2025
4da310c
max agents safety
julianh65 Oct 6, 2025
c332324
fixes
julianh65 Oct 6, 2025
51d9b57
binding: keep shared() scratch env lightweight for n_policy=1
julianh65 Oct 18, 2025
d0f3d2a
PR cleanup: remove artifacts and drive outputs, restore weights
julianh65 Oct 18, 2025
14e66c6
revert artifacts and test logic
julianh65 Oct 18, 2025
a8df8dd
cleanup
julianh65 Oct 18, 2025
5ea4624
restore
julianh65 Oct 18, 2025
032beb9
Cleanup storage so that tests work again (#87)
daphne-cornelisse Oct 19, 2025
2b7def7
Merge branch 'main' into jhunt/human_replay_training
julianh65 Oct 19, 2025
8f30c64
update drive.ini
julianh65 Oct 19, 2025
d1e24fa
Spatial hashing (#77)
mpragnay Oct 19, 2025
709bf44
Add goal generation alternative (#76)
vcharraut Oct 20, 2025
fdfa227
Enable control of all kinds of agent types (#84)
daphne-cornelisse Oct 20, 2025
8597a6b
Add support for resetting agents to any time step on the log trajecto…
daphne-cornelisse Oct 20, 2025
973b39b
Updated for main PR push
Aditya-Gupta26 Oct 20, 2025
afff4e3
fix ini
julianh65 Oct 21, 2025
c7352b7
merge resolve conflicts, fix render selection
julianh65 Oct 21, 2025
c316bd6
revert ini
julianh65 Oct 21, 2025
5d60604
more cleaning
julianh65 Oct 21, 2025
16f3f45
cleaning
julianh65 Oct 21, 2025
9f843ef
remove trailing whitespace
julianh65 Oct 21, 2025
ee8996f
Merge pull request #62 from Emerge-Lab/jhunt/human_replay_training
julianh65 Oct 21, 2025
d6f8b2e
fix metrics not showing (#93)
julianh65 Oct 22, 2025
09f4561
Remove legacy code (#94)
vcharraut Oct 22, 2025
93b5c17
Updated to test for hardcoded baseline mean
Aditya-Gupta26 Oct 22, 2025
8248b75
Fix bugs
Aditya-Gupta26 Oct 22, 2025
502ba75
Fix bugs
Aditya-Gupta26 Oct 22, 2025
b3a8e23
Fix bugs
Aditya-Gupta26 Oct 22, 2025
e523a5b
Fix bugs
Aditya-Gupta26 Oct 22, 2025
15152f1
Fix bugs
Aditya-Gupta26 Oct 22, 2025
ad80ed8
Updated file
Aditya-Gupta26 Oct 23, 2025
b6d573c
Updated file
Aditya-Gupta26 Oct 23, 2025
a51587d
Updated files for Main PR only
Aditya-Gupta26 Oct 23, 2025
4026728
Further edits
Aditya-Gupta26 Oct 24, 2025
5ac6a5b
Visualization refactor (#95)
m2kulkarni Oct 24, 2025
fe20bf0
Add weights back (#99)
daphne-cornelisse Oct 26, 2025
3f68f70
Configurable Scenario Length (#102)
julianh65 Oct 26, 2025
19a5232
MAJOR: gelu in puffernet was slightly off, silently corrupting demo/e…
jsuarez5341 Oct 26, 2025
8d0f4ea
Drive demo (#101)
jsuarez5341 Oct 26, 2025
7c83b2b
Improve train perf metrics (#91)
daphne-cornelisse Oct 28, 2025
7a2509c
Merge branch 'main' into agupta/add-performance-tests
eugenevinitsky Oct 29, 2025
f38dfc9
Fix broken visualizer and add original weights back in (#105)
daphne-cornelisse Oct 29, 2025
f1724b5
Merge branch 'main' into agupta/add-performance-tests
Aditya-Gupta26 Oct 30, 2025
9eb2408
Add scenario_length parameter to Drive initialization
Aditya-Gupta26 Oct 30, 2025
f07fbb8
Fix formatting of scenario_length parameter
Aditya-Gupta26 Oct 30, 2025
2f4abfb
Merge pull request #92 from Emerge-Lab/agupta/add-performance-tests
eugenevinitsky Oct 30, 2025
e442fe3
Add comments to Entity struct
vcharraut Oct 30, 2025
41d5f80
Add DynamicAgent, RoadMapElement, and TrafficControlElement structs w…
vcharraut Oct 30, 2025
168138f
Refactor code structure for improved readability and maintainability
vcharraut Oct 30, 2025
c5e6b58
GigaFlow Dynamics (#83)
nadarenator Oct 30, 2025
7c14bd7
Fix memory management for dynamic agents and update loading function
vcharraut Oct 31, 2025
600f6c3
Add road and traffic control type definitions and utility functions
vcharraut Oct 31, 2025
12c6196
Refactor agent initialization and metrics handling in Drive struct
vcharraut Oct 31, 2025
8e4c085
Add test data
vcharraut Oct 31, 2025
3d1ae8b
Make the action parsing correctly catch discrete. Only catches "discr…
eugenevinitsky Nov 2, 2025
dc596c4
tiny default fix (#111)
daphne-cornelisse Nov 2, 2025
6433bea
Enhance DynamicAgent structure with additional logging and simulation…
vcharraut Nov 3, 2025
6577a9f
Refactor drawing logic for dynamic agents and improve road edge checks
vcharraut Nov 3, 2025
8f44bf4
Add unnormalize_road_type function to map normalized types to road types
vcharraut Nov 3, 2025
e6295dd
Add simulation dimensions to agent state in set_start_position function
vcharraut Nov 3, 2025
1244fbf
Add continuous scaling
Nov 3, 2025
9434b83
Fix condition checks for agent type in set_start_position and compute…
vcharraut Nov 3, 2025
d38827b
Improve grid map initialization and observation computation by adding…
vcharraut Nov 3, 2025
d257ffa
Remove goal_radius from DynamicAgent struct to streamline goal positi…
vcharraut Nov 3, 2025
91710e7
Update RoadMapElement and TrafficControlElement structures for clarit…
vcharraut Nov 3, 2025
2dbaa40
Merge pull request #113 from Victorbares/fix_scaling_continuous
eugenevinitsky Nov 3, 2025
48c3388
initial commit
julianh65 Nov 4, 2025
bdf4545
Merge pull request #115 from Emerge-Lab/jhunt/stop_vecenv_closing
eugenevinitsky Nov 4, 2025
b678599
Update traffic control type definitions for consistency
vcharraut Nov 5, 2025
96d5521
Add bounds check to skip out-of-bounds entities in grid map initializ…
vcharraut Nov 5, 2025
9adbb57
Fixing Issues with failing tests (#117)
Aditya-Gupta26 Nov 5, 2025
1278b9e
Add stop and remove collision behaviors (#97)
Aditya-Gupta26 Nov 5, 2025
ce5452f
Refactoring Goal Behaviour to add STOP condition (#108)
Aditya-Gupta26 Nov 6, 2025
d770388
Merge branch 'main' into vcha/new_puffer_data
vcharraut Nov 7, 2025
8f9f0b4
Delete test_data
vcharraut Nov 7, 2025
37ee27f
Waymo Open Sim Agent Challenge (WOSAC) evaluation (#80)
daphne-cornelisse Nov 8, 2025
740057c
Minor fixes and safeguard (#122)
daphne-cornelisse Nov 8, 2025
269e7a7
docs for vscode debugger setup (#123)
riccardosavorgnan Nov 10, 2025
a6ee4a4
Goal behavior fixes (#124)
daphne-cornelisse Nov 11, 2025
f5dcb8f
Refactor DynamicAgent structure and enhance Drive metadata handling
vcharraut Nov 13, 2025
c75b549
Update drive.h
eugenevinitsky Nov 13, 2025
d130cad
Add mode to only control the self-driving car (SDC) (#130)
daphne-cornelisse Nov 13, 2025
c26b245
Merge pull request #129 from Emerge-Lab/eugenevinitsky-patch-1
eugenevinitsky Nov 14, 2025
fecbb2d
Fix incorrect obs dim in draw_agent_obs (#109)
eugenevinitsky Nov 15, 2025
0439aa5
Replace product distribution action space with joint distribution (#104)
eugenevinitsky Nov 16, 2025
97dcb3d
Replace default ent_coef and learning_rate hparams (#134)
daphne-cornelisse Nov 16, 2025
4d290df
Add changes from main
vcharraut Nov 17, 2025
c91e910
Merge main
vcharraut Nov 17, 2025
53daa76
Merge remote-tracking branch 'emergelab/main' into vcha/new_puffer_data
vcharraut Nov 17, 2025
ce2682f
Refactor road type definitions and update Drive struct for log length
vcharraut Nov 18, 2025
1516af3
Add temporary skip for traffic_lights
vcharraut Nov 18, 2025
040d39d
Add new weights binary with joint action space. (#136)
daphne-cornelisse Nov 18, 2025
dfca469
Add misc changes
vcharraut Nov 18, 2025
058adff
Add support for logging optional evals during training (#133)
daphne-cornelisse Nov 18, 2025
ad386ea
Add freeing in c_reset
vcharraut Nov 18, 2025
4e7a60d
Comment out agent dimension assignments in move_expert function
vcharraut Nov 19, 2025
b4255c6
Add map_index to Drive struct and update load_map_binary function
vcharraut Nov 20, 2025
5c9e178
Merge branch 'main' into vcha/new_puffer_data
vcharraut Nov 20, 2025
fe425c1
Format commit
vcharraut Nov 20, 2025
d43ae55
Fix DRIVEWAY definition and add is_road function for road type checks
vcharraut Nov 20, 2025
aebb422
Remove unused classes from road encoder (CROSSWALK, SPEED_BUMP, DRIVE…
vcharraut Nov 20, 2025
50cb68c
Refactor DynamicAgent to Agent and update related functions for consi…
vcharraut Nov 20, 2025
e9e83a4
Fix one-hot encoding for road categories in Drive class
vcharraut Nov 20, 2025
e47a509
Merge PR #107 (Puffer Scenario v0) into 3.0
Jan 3, 2026
83d3f0a
Add AGENTS.md with git workflow instructions
Jan 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions .github/workflows/_cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: cleanup

on:
workflow_call:
inputs:
when:
description: "When to clean up (before/after)"
required: false
default: "before"
type: string

jobs:
free-disk:
runs-on: ubuntu-latest
steps:
- name: Free up disk space (${{ inputs.when }})
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost
sudo apt clean
sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/*
echo "After cleanup:"
df -h
55 changes: 45 additions & 10 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,34 @@ on:
pull_request:

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Run pre-commit on all files
uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --show-diff-on-failure

test:
name: test ${{ matrix.py }} - ${{ matrix.os }} - ${{ matrix.env }}
needs: pre-commit
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
py:
- "3.11"
- "3.10"
- "3.9"
env:
- pip
- conda
os: [ubuntu-latest, macos-latest]
py: ["3.11", "3.10"]
env: ["pip"]

steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -40,8 +52,31 @@ jobs:
with:
python-version: ${{ matrix.py }}

- name: Check disk space (before cleanup)
if: runner.os == 'Linux'
run: df -h

- name: Free up disk space (Linux only)
if: runner.os == 'Linux'
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get clean
sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/*
echo "After cleanup:"
df -h

- name: Upgrade pip
run: python -m pip install -U pip

- name: Check disk space (before install)
if: runner.os == 'Linux'
run: df -h

- name: Install pufferlib
run: pip install -e .

- name: Check disk space (after install)
if: runner.os == 'Linux'
run: df -h
43 changes: 43 additions & 0 deletions .github/workflows/perf-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: perf-ci

on:
pull_request:
branches: [ main ]

jobs:
test-performance:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Check disk space (before cleanup)
run: df -h

- name: Free up disk space
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get clean
sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/*
echo "After cleanup:"
df -h
- name: Install dependencies
run: |
sudo apt update && sudo apt install -y build-essential
python -m pip install -U pip
python -m pip install -e .
python setup.py build_ext --inplace --force
- name: Check disk space (after install)
run: df -h

- name: Test simulator performance
run: python tests/test_simulator_perf.py
timeout-minutes: 20
59 changes: 59 additions & 0 deletions .github/workflows/render-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: render-ci

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test-render:
name: test-render - ubuntu-latest
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Check disk space (before cleanup)
run: df -h

- name: Free up disk space
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get clean
sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/*
echo "After cleanup:"
df -h

- name: Install system dependencies for headless rendering
run: |
sudo apt update
sudo apt install -y ffmpeg xvfb build-essential

- name: Upgrade pip
run: python -m pip install -U pip

- name: Install pufferlib
run: |
pip install -e .[cpu] --no-cache-dir
env:
TMPDIR: ${{ runner.temp }}/build
PIP_NO_CACHE_DIR: 1

- name: Compile C extensions
run: python setup.py build_ext --inplace --force

- name: Check disk space (after install)
run: df -h

- name: Run render test
run: python tests/test_drive_render.py
timeout-minutes: 15
48 changes: 48 additions & 0 deletions .github/workflows/train-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: train-ci

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test-training:
name: test-training
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Check disk space (before cleanup)
run: df -h

- name: Free up disk space
run: |
echo "Before cleanup:"
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get clean
sudo rm -rf ~/.cache/pip /tmp/* /var/tmp/*
echo "After cleanup:"
df -h

- name: Install dependencies
run: |
sudo apt update && sudo apt install -y build-essential
python -m pip install -U pip
pip install -e .
python setup.py build_ext --inplace --force

- name: Check disk space (after install)
run: df -h

- name: Test training
run: python tests/test_drive_train.py
timeout-minutes: 20
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,35 @@ wandb/
.neptune/
raylib*/
box2d*/
inih*/

# Temp Impulse Wars files
pufferlib/ocean/impulse_wars/*-debug/
pufferlib/ocean/impulse_wars/*-release/
pufferlib/ocean/impulse_wars/debug-*/
pufferlib/ocean/impulse_wars/release-*/
pufferlib/ocean/impulse_wars/benchmark/


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

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

# Compiled drive binary in root
/drive
/visualize
# But allow drive directories
!*/drive/
*.exe
*.out
*.app
artifacts/
pufferlib/resources/drive/output_agent.gif pufferlib/resources/drive/output.gif pufferlib/resources/drive/output_topdown.gif

# Local artifacts and outputs
artifacts/
# Local drive renders
pufferlib/resources/drive/output*.gif
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Pre-commit hooks for Python and Jupyter notebooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# Ruff for Python linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.12
hooks:
# - id: ruff
# args: [ --fix ]
- id: ruff-format
# Cleaning Jupyter notebooks
- repo: https://github.com/srstevenson/nb-clean
rev: 4.0.1
hooks:
- id: nb-clean
args:
- --remove-empty-cells
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Agent Instructions

## Git Workflow

- **Never push directly to `main`, `2.0`, or `3.0` branches**
- Always create a feature branch and open a Pull Request for changes to these branches
- PRs allow for code review and CI checks before merging
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ include raylib-5.5_linux_amd64/lib/libraylib.a
include raylib-5.5_macos/lib/libraylib.a
include box2d-linux-amd64/libbox2d.a
recursive-exclude box2d-web *
recursive-exclude raylib-5.5_webassembly *
recursive-exclude raylib-5.5_webassembly *
recursive-exclude pufferlib/ocean/impulse_wars/debug* *
recursive-exclude pufferlib/ocean/impulse_wars/release* *
recursive-exclude box2d* *
Loading
Loading