Systematic Benchmark of Visual Architectures, World Models, and Exploration in Procgen — A Study with 5 Seeds, 5 Games, and 100k Steps
Python 3.10.11 + Procgen 0.10.7 + Stable-Baselines3 2.9.0 + PyTorch 2.5.1+cu121 (RTX 4070) — py -3.10 (Python 3.10.11)
Abstract. Systematic evaluation of 16 architectures across 6 families (
CNNvsAttentionvsWorld ModelsvsAugmentvsNew ArchsvsExploration) with 5 seeds (42-46), 5 games (bossfight,starpilot,dodgeball,maze,heist+coinruncontrol), and two difficulty settings (easy 200/hard 200/eval 0) inProcgen(~120–170env steps/s oncudain the original single-env runs,570in the isolated paired benchmark of §15.3). The SB3 study usesframe_stack=1(3×64×64CHWuint8) andPPO(lr 3e-4,n_steps 256per env,batch 64,n_epochs 3,γ 0.99,λ 0.95,clip 0.2; one env in the published recipe,16in the responsive recipe of §5), andtensorboardfor training monitoring. Evaluation initially used10 episodesand was systematically hardened throughout the study up to the definitive protocol:100 epsstochastic + deterministic on unseen levels (seed+1000) — sections 3.10→3.12.
Eight Procgen games appear anywhere in this document. Each clip below is 60 frames of a uniform
random policy on the same easy / 200-training-level distribution the benchmark trains on, and
the label is burned into every frame — a clip that only names its game in the filename is a claim
nobody can check by watching it. They are here to show what the agent is looking at, not how well
it plays: for maze/heist a trained-agent clip would be misleading, since §3.6.2 measures those
policies as emitting the same action across five different games — which is why the dashboard
below is deliberately the one arm the audit shows reading its screen. Regenerate with
py -3.10 -m reporting.record_game_clips (provenance: results/games/clips_provenance.json).
coinrun |
starpilot |
dodgeball |
bossfight |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
jumper |
plunder |
maze |
heist |
| --- | --- | --- | --- |
![]() |
![]() |
![]() |
![]() |
The first four are the games of the main 16-architecture comparison;
jumper/plundercarry the hierarchical study (§15),maze/heistthe exploration study (§3.6).caveflyerappears in the temporal/POMDP benchmarks and is not clipped here.
And one agent, thought by thought. The clip below is the same game (coinrun) with a trained
policy, panel by panel: what it sees (the extractor's 512-D output), what it thinks (its six most
likely actions, with the button combination it actually presses), what it expects to earn (V(s)), and the step counter. It is deliberately the one arm of this study that §3.6.2 measures as reading its observation (cross-game TV 0.739958, carried on the clip's own caption
line) — the other arms would render the same clip with a frozen "what it thinks" panel, which is
how the defect was found. 48 steps, return 10.00 (level completed), V(s) rising to 9.66.
Reproduce:
py -3.10 -m diagnostics.diagnose_policy_saturation --game coinrun --timesteps 100000 --save-model logs_audit/models/coinrun_classic.zip, thenpy -3.10 -m reporting.record_dashboard_video --checkpoint logs_audit/models/coinrun_classic.zip --game coinrun --episodes 3 --max-steps 400 --stride 2.
What currently stands, as of 03/12/2026. The earlier wording of this section, with the dated corrections it accumulated, is kept verbatim in docs/conclusions-history.md; a "§0 item N" reference in older text points there.
- At this budget the architectures differ in whether they read the screen, not in what they score. Under the originally published recipe (one environment per update) the policies ignored their observation: every one of the
47audit cells that finished emits one argmax for five different games (§3.6.2). The cause is the single-stream rollout; the samemazerecipe with16environments and the same per-update batch keeps the response on101/101dense probes against21/101(§3.6.4–§3.6.5). Under the16×256recipe the sixteen front ends separate stably, fromcbam/classic/spatial/c_aug_colorreading on15/15cells toviton1/15(§0.1). - Return does not rank the architectures. Under the responsive recipe the two front ends that hardly read,
vit(1.907) andimpoola(1.707), top the return table (§3.6.7), and against a random policy only10of16arms are above it onstarpilot,4ondodgeballand none onbossfight. Raising the budget to500kdeepens the response of every reading arm while return stays seed noise (§3.6.13). With five seeds, differences between configurations are on the order of noise (§3.8). - Without a random-policy baseline a return table can be about nothing. Putting every table against one (
results/random_floor_audit.json) retracted or narrowed several earlier conclusions:
| Earlier conclusion | What the floor, or a fix, showed |
|---|---|
HRL: temporal abstraction gives 4× the return in jumper; only learned skills win in plunder (§11) |
The published conclusion is retracted: no jumper arm beats a random policy over its own actions, and in plunder only skip4 does |
Action repeat of 8 collapses the policy (§11.2) |
A software defect: an unwritten buffer row carried NaN into the weights; without it no run collapses |
Exploration bonuses on maze/heist, published and rescaled (§3.6, §3.6.1) |
All four published arms are below random on both games; the later gains are mostly climbs towards it |
Value-based QR-DQN leads bossfight; A2C collapses there (§12) |
No arm on bossfight is distinguishable from random. On starpilot ppo/a2c learn and dqn/qrdqn do not |
Temporal and memory architectures rank on heist/jumper; recurrent state helps on single-frame caveflyer (§15.4.6–§15.4.9) |
No arm beats random on heist/jumper; the caveflyer benefit is retracted |
| Decision Transformer finds positive trajectories offline (§6.1) | Two of twenty episodes; the interval includes the random policy's zero |
What did learn: the port's main grid on starpilot and dodgeball (all sixteen configurations above random on both), parts of the SB3 tables on those two games, and coinrun (§15.4.2, §3.12).
4. Nothing here tests the curiosity bonuses or shows a memory benefit. Procgen's exploration mode is a floor: every arm scores 0.0 and plain PPO still does at 5M steps (§15.8). In memory mode, no memory arm beats the stateless one where anything is learned (§15.7).
5. MARL: the old SMAX zeros were an evaluation defect. With it fixed, ippo/mappo/tarmac/cte win 35–60% of 3m episodes at 1M steps. QMIX with its original mixer diverges and the mapoca arm does not learn; both are open (§15.6).
6. Evaluate with at least 100 episodes on unseen levels, beside a random policy, and audit the response. 10-episode rankings reshuffled at every protocol upgrade (§3.10–§3.12), and a high return was observed from a policy that does not read its screen (vit on coinrun, 6.00 at TV
The ten-minute narrative of the diagnostic arc is REPORT.md.
The study's return tables rank by return; §3.6 established that at this budget return does not measure the visual front end. This is the table that does — every cell a full 16×256 training at the responsive recipe, the score the fraction of its 15 (game × seed) audit cells whose cross-game TV clears 0.1 (data: results/suite_validity_nenv16_grid.json, §3.6.7):
| architecture | responsive cells | cross-game TV mean |
|---|---|---|
cbam |
15/15 | 0.213354 |
classic |
15/15 | 0.226796 |
spatial |
15/15 | 0.261556 |
c_aug_color |
15/15 | 0.260682 |
ae ≡ recon |
13/15 | 0.257341 |
contrastive ≡ c_aug_noise |
13/15 | 0.216797 |
lstm_attention |
12/15 | 0.245429 |
resnet18 |
11/15 | 0.189925 |
c_aug_crop |
10/15 | 0.128228 |
vae |
9/14 | 0.136637 |
impala |
9/15 | 0.157166 |
mlp_vector |
3/15 | 0.072704 |
impoola |
3/15 | 0.088043 |
vit |
1/15 | 0.024790 |
mlp_scaled † |
7/15 | 0.135081 |
vit_tokens † |
9/15 | 0.144445 |
vae_clamped † |
8/15 | 0.113657 |
vae has 14, not 15 cells: its bossfight/seed-42 training diverged to NaN (§3.6.7) — a float32 overflow of its unbounded log-variance, named and fixed in §3.6.14. The cliff between 13/15 and 3/15 is the architecture result this study set out to produce and only obtained once the response measure existed; what the cells' returns did under the same recipe is in §3.6.7 — they did not track this table. The ten-minute narrative of the whole diagnostic arc (§3.6.2–§3.6.12) is REPORT.md — every number in it gated on the same artifacts as this document.
mlp_scaled († added 24/10/2026) is not one of the published sixteen: it is the §3.6.12 input-scale rescue run as a full audit arm — the same 256-D vector observation as mlp_vector, divided by 255 in the wrapper (procgen_wrapper.ProcgenVectorWrapper(scale=True); the raw path stays the factory default so every published cell remains reproducible). At the audit's own protocol it more than doubles the arm's responsive cells (7/15 against the raw arm's 3/15, TV mean 0.135081 against 0.072704) with the birth saturation gone (first Tanh 2–28% on every cell, against 91–98% at birth for the raw arm) — and it carries the arc's one caveat: on dodgeball it reads within the game but stays below the cross-game threshold on all five seeds (0/5), the §3.6.10 within-game-reader pattern. Data: results/suite_validity_nenv16_mlp_scaled.json (analysis/summarize_mlpscaled_grid.py --check gated; §3.6.12).
vit_tokens and vae_clamped († added 01/11/2026) are opt-in audit arms of the same kind. vit_tokens is vit with its whole token pipeline changed — 8×8 patches, pre-LN encoder layers without dropout, a CLS readout through a final LayerNorm — and lifts the arm from 1/15 to 9/15 responsive cells (starpilot 5/5, dodgeball 4/5, bossfight still 0/5; §3.6.15). vae_clamped is vae with logvar bounded to [−10, 10]: 0/15 cells diverge and its responsiveness stays where the published arm's was (8/15 against 9/14; §3.6.14). Data: results/vit_token_pipeline.json, results/vae_nan_fix.json.
The study is long; this page carries its conclusions, scorecard, methodology and reproduction steps. Everything else lives in docs/, one page per arc. Section numbers are unchanged, so a §x.y reference anywhere (code comments, tests, REPORT.md) names the same section it always did.
| Page | Sections | What it holds |
|---|---|---|
| REPORT.md | — | The ten-minute narrative of the diagnostic arc |
| docs/conclusions-history.md | §0 (record) | The main conclusions as first written, with their dated corrections |
| docs/diagnostic-arc.md | §3.6–§3.6.15 | Exploration arms, the blindness of the trained policies, its cause, the grid re-run, the anatomy, the budget tests |
| docs/results-archive.md | §2, §3.1–§3.5, §3.7–§3.14, §7 | The executed benchmarks and their return tables (published recipe — provenance, not architecture results) |
| docs/figures.md | §4, §8 | Figures and videos |
| docs/offline-rl-and-roadmap.md | §6 | Offline RL benchmark and the sixteen-item instrumentation roadmap |
| docs/independent-benchmarks.md | §11–§12 | HRL vs flat RL; value-based vs policy-based |
| docs/jax-port.md | §13–§16 | The JAX port: scope, trajectory, parity, full grid, temporal results, the port grid under the response measure (§15.5), MARL under a positive control (§15.6, which retracts the SMAX win-rates of §15.4.5), and the Procgen memory and exploration modes (§15.7–§15.8) with a random-policy floor that retracts or qualifies the temporal results of §15.4.6–§15.4.9 |
| docs/marl-and-rliable.md | §17–§18 | MARL buffer alignment; RLiable protocol and normalization |
| docs/verification.md | §19–§20 | Test suites; legacy continuous-control prototypes |
| docs/symbolic-regression.md | §21 | Symbolic regression as system identification, of the return and of the response (§21.9) |
- Wrapper
core/procgen_wrapper.py:6ProcgenGymWrapper(gymn.Env)— convertsgym 0.26.2legacy API (obs, done) →gymnasium 1.3.0(obs, terminated, truncated),HWC 64×64×3 → CHW 3×64×64(np.transpose),Discrete(15)(bossfight,starpilot,dodgeball,coinrun). Vision-free variantcore/procgen_wrapper.py:49ProcgenVectorWrapper(16×16grayscale→256DMLP) for control comparison:same game with/without computer vision. - Factory
core/procgen_wrapper.py:99make_procgen_env(game, num_levels, distribution_mode, seed, frame_stack, vector, vector_scale)—gym.make(f'procgen:procgen-{game}-v0', num_levels, distribution_mode, rand_seed). - Training:
num_levels=200,distribution_mode='easy'(Procgenstandard); Eval:num_levels=0(unlimited, never-before-seen levels) withseed+1000— measures generalization. - No Frame Stacking:
frame_stack=1,Box(3,64,64)uint8across the main benchmarks (core/procgen_wrapper.py:21). Frame stacking is supported (core/procgen_wrapper.py:19, e.g.12×64×64atframe_stack=4) and used only by the diagnostics (frame_stack=3, §3.6.3) and the port's temporal suites (§15.4.6–§15.4.9);Imitation-playeruses128×128×4.
- Classic CNN
models/sb3_extractors.py:9ClassicCNNExtractor—Conv 32 8×8 s4 → 64 4×4 s2 → 64 3×3 s1 → Flatten → FC 512(600kparams), auto-detectsHWC/CHW(is_hwc). - Attention CNN
models/sb3_extractors.py:60AttentionCNNExtractor(use_cbam)—CBAM(ChannelAttentionreduction 16+SpatialAttentionkernel 7)models/cnn_attention.py:82or purelySpatialAttentionModulemodels/cnn_attention.py:6(x * attention_map + xwith residual connectionmodels/cnn_attention.py:37to stabilize purespatialattention, which collapsed to0.00deterministically).FC 512. - World-model-style extractors
models/world_model_extractors.py—VAEExtractor(a stochastic128-D latent sampled with the reparameterization trick; opt-inlogvar_clamp, §3.6.14),AEExtractorandReconExtractor(a deterministicFC 512bottleneck each),ContrastiveExtractor(thecontrastivearm: Gaussian input noiseσ=0.01, applied with probability0.5per batch in training mode); each also carries adream()decoder. What they are, and are not: in the SB3 study PPO backpropagates only the policy and value losses throughforward(). No reconstruction, KL or contrastive (InfoNCE) loss was ever computed, so the decoders stayed at random initialization and these arms measure the inductive bias of a bottleneck, of latent sampling or of input noise — not generative or contrastive representation learning (module docstring;docs/results-archive.md§3.2).aeandreconare the same program (§3.6.7). Reconstruction/KL (jax_port/dream.py, trained standalone),InfoNCE(jax_port/contrast.py),SPR(jax_port/spr.py) and model-based imagination RL (jax_port/dreamer.py,jax_port/train_dreamer.py) exist only in the JAX port. - Contrastive Augmentations
experiments/compare_augment_contrastive.py:19ContrastiveCrop(pad 4 + random 64),ContrastiveColor(brightness 0.8-1.2),ContrastiveNoise(noise 0.01) — all subclasses ofContrastiveExtractorthat override only the train-time perturbation, drawn once per batch and applied with probability0.5; there is no contrastive loss, so these are input-augmentation arms (ContrastiveNoiseadds nothing and is thecontrastiveprogram, §3.6.7). - New Architectures
models/combined_extractors.py—ImpalaCNNExtractor(stack of convolutionalImpalaBlockmodules),ImpoolaCNNExtractor(GAP 64D),LSTMAttentionExtractor(CNN + BiLSTM 256 + attentionover a length-4 sequence made of the same feature repeated four times: stateless, no temporal information enters, so the LSTM and attention only add depth),ViTExtractor(16patches of16×16— a4×4grid of tokens,dim 128—+ 4-layer Transformer, mean-pooled),ResNet18Extractor— all withFC 512(benchmark #6). - Exploration (ICM/RND/NGU)
models/bonuses.py:126(experiments/compare_maze_heist.py:23imports them) —ICMWrapper(intrinsic bonus via forward dynamics prediction error),RNDWrapper(random network distillation),NGUWrapper(extendsRNDWrapperwith episodic novelty memory,reward += beta * bonus * episodic) — evaluated onmaze/heist(benchmark #7).
- Training:
5 seeds(42,43,44,45,46) with fixedPPOseed+procgen rand_seed—mean±stdacross seeds recorded instatistics.json. - Evaluation: the definitive protocol is
100 episodes, stochastic and deterministic, on unseen levels (eval 0,seed+1000; sections 3.10–3.12). The first runs used10 episodeswithdeterministic=False(stochastic, correctingspatialwhich gave0.00deterministic vs4.00stochastic in8ktests); tables that still carry10-episode numbers say so. - Monitoring:
tensorboard --logdir logs_*(events.out.tfevents.*).
Standard Procgen literature (original paper, IDAAC/PPG) reports 5M–25M steps for near-human performance — and data from this study corroborates this: at 100k, absolute scores remain low (starpilot ~2.6, bossfight ~0.4, heist ~0.7; only coinrun saturates early, reaching 8.0 at 50k). Against a random policy (five seeds, 100 episodes: starpilot 1.55, bossfight 0.04, heist 3.14, maze 3.94, dodgeball 0.60, coinrun 2.92; results/random_floor_sb3.json) those low scores mean different things: starpilot has arms well above the floor, bossfight none, and heist is far below it. These two statements do not conflict — they address distinct questions:
| Regime | Research Question | Typical Budget |
|---|---|---|
| Solving the game | "Can high absolute asymptotic performance be attained?" | 5M–25M |
| Comparing inductive biases (this study) | "Which architecture extracts the most learning per step under a constrained budget?" | 100k |
100k is not a defect — it is the formal definition of the experimental regime (low-data regime, as in sample-efficiency and data-augmentation literature): architectural inductive biases manifest early (see the ⚡ AUC axis in section 3.9 and the ICM trajectory in section 3.10), while computational cost remains tractable (~10 min/model on an RTX 4070 Laptop; a grid of 115+ models would be prohibitive across millions of steps).
Honest limitation: ranking order at 100k may not persist under larger budgets (a slower architecture with a higher asymptotic ceiling loses here but might win at 25M). Therefore, conclusions strictly hold for this budget, and roadmap item #6 in section 6.2 (scaling 100k→250k→500k on winners) was designed specifically to test advantage persistence.
Training recipe (since 30/10/2026). Every Procgen producer (experiments/compare_*.py) now trains on the responsive recipe by default — 16 parallel envs × 256 steps per update, each env on its own level stream (seed + rank), §3.6.7 — and runs the cross-game response guard (core/response_guard.py) after every cell. --published-recipe restores the archived 1 × 256 single-stream recipe that produced the tables in docs/results-archive.md (and that §3.6.2 showed trains blind policies); --n-envs/--n-steps set any other recipe, and --no-response-guard skips the guard. A non-published recipe never writes into a published artifact: results files and run directories get a _nenv16-style suffix. The commands below reproduce the archived runs, so add --published-recipe to match their numbers.
# Environment setup (Python 3.10 mandatory for Procgen wheels) — exact pinned versions in requirements.txt
pip install -r requirements.txt
# Or install manually with verified release pins:
py -3.10 -m pip install procgen==0.10.7 stable-baselines3==2.9.0 gymnasium==1.3.0 gym==0.26.2 torch==2.5.1+cu121 opencv-python==4.8.0.74 --extra-index-url https://download.pytorch.org/whl/cu121
# Execute 5-seed benchmarks
py -3.10 -u -m experiments.compare_world_models --timesteps 100000 --seeds 42 43 44 45 46 --num_levels 200 --log_dir ./logs_world_models --device cuda
py -3.10 -u -m experiments.compare_procgen --game coinrun --timesteps 50000 --seeds 42 43 44 45 46 --num_levels 200 --log_dir ./logs_procgen --device cuda
py -3.10 -u -m experiments.compare_suite --games bossfight starpilot dodgeball --timesteps 100000 --seeds 42 43 44 45 46 --log_dir ./logs_suite --device cuda
py -3.10 -u -m experiments.compare_bossfight_hard --timesteps 100000 --seeds 42 43 44 45 46 --log_dir ./logs_bossfight_hard --device cuda
py -3.10 -u -m experiments.compare_new_archs --timesteps 100000 --seeds 42 43 44 45 46 --games bossfight starpilot dodgeball --log_dir ./logs_new_archs --device cuda
py -3.10 -u -m experiments.compare_maze_heist --timesteps 100000 --seeds 42 43 44 45 46 --games maze heist --log_dir ./logs_maze_heist --device cuda
py -3.10 -u -m experiments.compare_combined # Aggregates logs_suite + logs_new_archs into global ranking
py -3.10 -u -m experiments.re_eval_scorecard --device cuda # Re-evaluates 30 eps stoch+det on 115 zips (no retraining)
py -3.10 -u -m experiments.compare_suite_retrain --device cuda # Retrains suite under new protocol (resume-safe)
py -3.10 -m analysis.scorecard_analysis # 95% CI + Cohen's d + AUC -> results/scorecard.json. Requires the logs_new_archs/ and logs_maze_heist/ run directories; without them it exits with an error rather than overwriting the published table with a reduced one (--logs_root / --force to override)
py -3.10 -m analysis.retrain_analysis # Retraining analysis + updated global ranking -> results/retrain_analysis.json
py -3.10 -u -m experiments.re_eval_100 --device cuda # Definitive protocol: 100 eps across all 275 zips
py -3.10 -m analysis.eval100_analysis # Comparative analysis 30 vs 100 -> results/eval100_analysis.json
py -3.10 -m experiments.random_baselines --episodes 50 # Empirical random anchors on unseen levels -> results/random_baselines.json (section 18.1)
py -3.10 -m experiments.random_floor_sb3 # The same random policy for seeds 42-46, 100 episodes, every SB3 protocol incl. the HRL wrappers -> results/random_floor_sb3.json (CPU, minutes); the port's side is python -m jax_port.random_floor_port in WSL
py -3.10 -m analysis.summarize_random_floor # Every published return table against its random floor -> results/random_floor_audit.json; --check re-verifies
py -3.10 -m analysis.run_rliable_eval # IQM / trimmed mean / stratified bootstrap CIs / profiles -> results/rliable_scorecard.json + rliable_profile.png (section 3.14)
py -3.10 -m analysis.symbolic_regression # system identification over the 825 committed port cells -> results/symbolic_regression.json + 3 figures (section 21)
py -3.10 -m analysis.response_identification # section 21 re-asked with the response as the target, on the SB3 16x256 grid and the port response grid -> results/response_identification.json (section 21.9); --check re-verifies
py -3.10 -m reporting.report_figures # Rebuilds figures 4.1/4.2 from results/legacy_records.json; prints which of the other 11 need a re-run
py -3.10 -m pytest tests -q # 432 tests: extractors, SB3 integration, bonuses, world models, aggregation, provenance, published-number gates, committed analysis files, the response/occlusion/mlp_scaled/exploration/vae_clamped/vit_tokens/port-response/response-identification/random-floor artifacts and the claims of section 0
py -3.10 -m experiments.probe_actions # Action space probing (basis for HRL skills)
py -3.10 -m diagnostics.audit_suite_validity --game starpilot # All 16 published arms x the cross-game response (section 3.6.2): 1.6M steps, ~2.9 h, ~10 min/arm; resume-safe, writes results/suite_validity_starpilot.json one arm at a time
bash scripts/run_suite_validity.sh starpilot bossfight dodgeball # The same audit over several games: one process per arm (the cffi deadlock note below), 3 workers, then fuses results/suite_validity_<game>.json -- the 48 cells of section 3.6.2 took 8.08 h
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game maze --timesteps 100000 --probe-every 2000 --cross-game --out results/policy_saturation_perlayer_repo.json # Section 3.6.3 timeline; add --extractor layernorm for the counterfactual, --frame-stack 3 for the input-variance intervention, --save-model <zip> to keep the policy for the dashboard
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game maze --timesteps 50000 --probe-every 500 --n-envs 16 --n-steps 16 --cross-game --out results/policy_saturation_dense_nenv16_nsteps16.json # Section 3.6.4 dense rollout probe; the other arms are --n-envs 1 --n-steps 256 / --n-envs 4 --n-steps 64 / --n-envs 16 --n-steps 256, and --game coinrun gives the surviving-arm reference (each ~1-2 GPU-minutes)
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game maze --timesteps 50000 --probe-every 500 --n-envs 16 --n-steps 256 --seed 43 --cross-game --out results/policy_saturation_dense_nenv16_nsteps256_seed43.json # one cell of the 3.6.5 replication (5 arms x seeds 43-46); the mechanism levers are --action-repeat 4 / --n-steps 1024 / --ent-coef 0.01, each at --n-envs 1, seeds 42+43
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game maze --timesteps 50000 --probe-every 500 --n-envs 2 --n-steps 128 --seed 42 --cross-game --out results/policy_saturation_dense_nenv2_nsteps128_seed42.json # one cell of the (iv) dose (section 3.6.5, seeds 42-46); the other arm is --n-envs 8 --n-steps 32 --out results/policy_saturation_dense_nenv8_nsteps32_seed42.json
py -3.10 -m analysis.summarize_dense_multiseed # folds the dense-probe runs (7 arms x 5 seeds + 3 levers x 2) into results/policy_saturation_dense_multiseed.json (sections 3.6.5); --check re-verifies the fold against the per-run files
py -3.10 -u -m diagnostics.audit_suite_validity --game starpilot --n-envs 16 --n-steps 256 --configs classic --out logs_audit/shards_nenv16/sh-classic.json # one cell of the 3.6.6 pilot (one arm per process -- the cffi deadlock note); the 16 shards are fused by --merge "logs_audit/shards_nenv16/sh-*.json" --out results/suite_validity_starpilot_nenv16.json, and the producers' train_one gained n_envs/n_steps (defaults were the published 1x256 until 30/10/2026; since then 16x256 -- this audit passes its recipe explicitly)
py -3.10 -m experiments.run_grid_nenv16 --workers 6 # the full 240-cell re-run of section 3.6.7 (16 arms x 3 games x seeds 42-46 at 16x256): resume-safe, one process per cell (concurrent processes must not share a JSON -- a violation cost two rows once), holds keep-awake, --status shows progress
py -3.10 -m experiments.run_grid_nenv16 --workers 4 --arms mlp_scaled --shards logs_audit/shards_mlpscaled # the 3.6.12 input-scale rescue as a full audit arm (15 cells, ~24 min); merge each game's shards with diagnostics/audit_suite_validity.py --merge ... --key-by-seed, then:
py -3.10 -m analysis.summarize_mlpscaled_grid # folds the three fusions into results/suite_validity_nenv16_mlp_scaled.json (3.6.12 follow-up, section 0.1 row); --check re-verifies
py -3.10 -u -m experiments.compare_maze_heist --normalize --n-envs 16 --eval_eps 100 --log_dir logs_maze_heist_norm16 # the 3.6.1 follow-up: the scaled-bonus arms AND a fresh ppo control at the responsive recipe (40 cells, ~40 GPU-h summed; split across processes with --arms/--seeds)
py -3.10 -m analysis.summarize_exploration_nenv16 # folds the nenv16 run dirs into results/exploration_nenv16.json (3.6.1 follow-up, roadmap item 8)
py -3.10 -m diagnostics.audit_suite_validity --merge "logs_audit/shards_nenv16_grid/sh-starpilot-s*-*.json" --key-by-seed --out results/suite_validity_nenv16_starpilot.json # one of the three per-game fusions (bossfight/dodgeball identical), then:
py -3.10 -m analysis.summarize_grid_nenv16 # folds the three fusions into results/suite_validity_nenv16_grid.json (section 3.6.7); --check re-verifies the fold against them
py -3.10 -m experiments.run_grid_nenv16 --workers 4 --timesteps 250000 --games starpilot dodgeball --arms classic cbam vit mlp_vector --shards logs_audit/shards_nenv16_250k # the 3.6.8 budget sweep: 40 cells paired with the 100k grid; merge each game's shards with --key-by-seed, then:
py -3.10 -m analysis.summarize_budget_nenv16 # folds the 250k sweep against the 100k grid into results/suite_validity_nenv16_budget250k.json (section 3.6.8); --check re-verifies
py -3.10 -m experiments.run_grid_nenv16 --workers 6 --timesteps 500000 --games starpilot dodgeball bossfight --arms classic cbam vit mlp_vector --shards logs_audit/shards_nenv16_500k # the 3.6.13 sweep (60 cells, ~23 GPU-hours summed); merge each game's shards with --key-by-seed, then:
py -3.10 -m analysis.summarize_budget500k # folds the 500k sweep against the 100k grid and the 250k artifact into results/suite_validity_nenv16_budget500k.json (section 3.6.13); --check re-verifies
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game bossfight --timesteps 100000 --probe-every 500 --n-envs 16 --n-steps 256 --arch vit --cross-game --out results/probe_nonreaders_vit_bossfight.json # one curve of section 3.6.9; the other probes are --arch {classic,mlp,impoola} x {bossfight,dodgeball,starpilot}, ~1.5 GPU-minutes each
py -3.10 -m diagnostics.diagnose_feature_vs_actor --game bossfight --arch vit # one cell of section 3.6.10 (feature response vs action response on the same held-out frames); the other six cells are --arch {classic,mlp,impoola} x the named games, ~1-4 GPU-minutes each
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game bossfight --timesteps 100000 --probe-every 500 --n-envs 16 --n-steps 256 --arch vit_ln --cross-game --out results/probe_vitlayernorm_bossfight.json # the 3.6.11 counterfactual (ViT + LayerNorm at its output); the head levers are the same command with --arch mlp --ent-coef 0.01 / --n-steps 64 on dodgeball
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game bossfight --timesteps 100000 --probe-every 500 --n-envs 16 --n-steps 256 --arch vit --seed 42 --cross-game --save-model results/models/vit_bossfight.zip --out results/models/vit_bossfight_repro.json # one key-cell checkpoint (the 8 of section 4's provenance table are the same command per cell; each repro.json reproduces the committed probe artifact's final row bitwise, so the zip is the model behind the published number)
py -3.10 -m reporting.report_diagnostics_figures # the five figures of the dense-probe arc (sections 3.6.4-3.6.10), drawn from committed artifacts -- no training, byte-comparable rebuilds
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game dodgeball --timesteps 100000 --probe-every 500 --n-envs 16 --n-steps 256 --arch mlp_scaled --cross-game --out results/probe_mlpscaled_dodgeball.json # the 3.6.12 input-scale lever (obs/255 on the vector arm); the pooling lever is --arch vit_maxpool on bossfight, and diagnostics/diagnose_feature_vs_actor.py takes the same --arch registry for the anatomy numbers
py -3.10 -m reporting.record_dashboard_video --checkpoint logs_audit/models/coinrun_classic.zip --game coinrun --episodes 3 --max-steps 400 --stride 2 # The panel-by-panel clip at the top; refuses an arm with no audit row unless --allow-unaudited is passed
py -3.10 -u -m experiments.compare_hrl --device cuda # Independent benchmark: HRL vs Flat RL (jumper/plunder)
py -3.10 -u -m experiments.compare_hrl_learned --device cuda # hrl_learned arm (RUN AFTER experiments/compare_hrl.py: both write to results/hrl_results.json)
py -3.10 -m analysis.hrl_analysis # Analysis of 4 HRL arms -> results/hrl_analysis.json
py -3.10 -u -m experiments.compare_budget_scaling --device cuda # Budget scaling 250k/500k (resume-safe)
py -3.10 -m analysis.budget_analysis # Curves 100k->250k->500k -> results/budget_analysis.json
py -3.10 -u -m experiments.compare_algo_families --device cuda # Value vs policy-based (section 12; requires sb3-contrib)
py -3.10 -m analysis.algo_analysis # Analysis per family/algorithm -> results/algo_families_analysis.json
py -3.10 -u -m experiments.lr_sensitivity --device cuda # Learning rate sensitivity test for value-based algorithms (section 12.2)
py -3.10 -u -m diagnostics.diagnose_vae_nan --game bossfight --seed 42 --out results/vae_nan_bossfight_s42.json # the vae NaN, named (section 3.6.14); add --logvar-clamp 10 --response --out results/vae_clamped_bossfight_s42.json for the fixed arm
bash scripts/run_vae_clamped_grid.sh # the vae_clamped audit arm: 3 games x seeds 42-46 at 16x256, one process per cell, merged per game (section 3.6.14)
py -3.10 -m analysis.summarize_vae_clamped # folds the diagnosis and the three fusions into results/vae_nan_fix.json; --check re-verifies
py -3.10 -u -m diagnostics.diagnose_policy_saturation --game bossfight --arch vit_tokens --timesteps 100000 --probe-every 500 --n-envs 16 --n-steps 256 --cross-game --seed 42 --out results/probe_vit_tokens_bossfight_seed42.json # the dense probe of the ViT token pipeline (section 3.6.15); --arch vit_patch8 / vit_prenorm / vit_cls are its single-stage ablations
bash scripts/run_vit_tokens_grid.sh # the vit_tokens audit arm: 3 games x seeds 42-46 at 16x256 (section 3.6.15)
py -3.10 -m analysis.summarize_vit_tokens # folds probes and grid into results/vit_token_pipeline.json; --check re-verifies
bash jax_port/scripts/marl_positive_control.sh && bash jax_port/scripts/marl_positive_control_ql.sh # in WSL: MPE `simple_spread` and Overcooked as positive controls for the MARL code (section 15.6); then bash jax_port/scripts/rerun_smax_flat.sh (SMAX `3m`, 7 algorithms x 3 seeds, CPU) and python jax_port/summarize_marl_control.py (--check re-verifies)
bash jax_port/scripts/run_memory_exploration.sh # in WSL: Procgen `memory`, matched `easy` control and `exploration` mode, 75+75+60 cells, ~3 h (sections 15.7-15.8); python jax_port/summarize_memory_exploration.py folds them (--check re-verifies)
bash jax_port/scripts/run_memory_followup.sh && bash jax_port/scripts/run_exploration_long.sh && bash jax_port/scripts/run_exploration_probe.sh # in WSL: the other three `memory` games at 200k, `classic` vs `recurrent_lstm` at 1M, PPO at 5M / 2M in `exploration` mode; then python -m jax_port.memory_random_check and -m jax_port.exploration_random_check (the random-policy floors) before the summarizer
bash jax_port/scripts/qmix_diagnose.sh; bash jax_port/scripts/qmix_gain_probe.sh; bash jax_port/scripts/mapoca_diagnose.sh # in WSL: the QMIX mixer-gain diagnosis (online and on frozen data) and the MAPOCA variants of section 15.6
bash jax_port/scripts/rerun_hrl_rows_fixed.sh # in WSL: every HRL and action-repeat cell again after the two port fixes of 03/12/2026 (section 15.4.2), ~40 min; then python -m analysis.summarize_random_floor --extract-followup; python -m jax_port.diagnose_unwritten_row shows what the unwritten row did to the k=8 runs (section 11.2)
bash jax_port/scripts/audit_port_response.sh # in WSL (the JAX venv): the port's main suite re-trained with the response attached, 240 cells, ~2.5 h (section 15.5); then python jax_port/summarize_port_response.py --raw /root/rg_response/mainProcgen runs and the WSL VM. Two long runs of this audit's WSL VM went wrong in ways unrelated to the code: a wsl.exe session that exits takes its background children with it (keep one session open with a sleep, and start the jobs with setsid nohup), and running three recurrent MARL processes next to three Procgen grids took the whole VM down (Wsl/Service/E_UNEXPECTED). The cffi deadlock below reappeared twice in the memory_easy grid; jax_port/scripts/run_with_watchdog.sh restarts a grid that stops writing cells, and run_grade resumes from the cells already on disk.
Scripts are modules: run them from the repository root as py -3.10 -m <folder>.<name> (a path such as analysis/summarize_grid_nenv16.py --check in the text names the file and its flag). Until 03/12/2026 they sat in the root; only their location and their imports changed.
| Folder | What is in it |
|---|---|
core/ |
Shared library code: the Procgen wrappers, the response guard, the statistics, the docs reader and keep_awake.py (holds the machine awake during long grids) |
experiments/ |
Producers: the compare_* benchmarks, grid runners, re-evaluations and random-policy floors. smoke_hrl.py is a two-game smoke test of compare_hrl.py; compare_fast.py / env_setup.py are a CartPole-pixels comparison outside the Procgen study that no table cites; compare_offline_rl.py builds on core/benchmark_lib.py |
diagnostics/ |
Instruments of the diagnostic arc: the response audit, dense probes, anatomy, occlusion, the vae NaN |
analysis/ |
Summarizers and statistics that turn committed results into committed artifacts (--check re-verifies most of them) |
reporting/ |
Figures, videos and plots |
models/ |
The feature extractors |
scripts/ |
Shell drivers of the long SB3 grids |
jax_port/ |
The JAX port (WSL): modules, scripts/ (shell drivers) and artifacts/ (committed records) |
results/ |
Committed results and figures of the SB3 study |
tests/, docs/ |
The test suite and the study's documentation |
cuda Runtime Estimates: coinrun 50k 5×50k ~35 min; bossfight 100k 5×100k ~67 min; suite 100k 3 games × 11 × 5 × 100k 16.5M steps ~15h (20:41→04:47); bossfight hard ~2.5h; new archs 100k 3 games × 5 × 5 × 100k 7.5M steps ~12h (13:45→01:39); maze+heist 100k 2 games × 4 × 5 × 100k 4M steps ~6.5h (01:48→08:23); combined immediate; re-eval 115 zips ~70 min; suite retrain 165 models ~28h (bossfight ~10 min/model, dodgeball ~3 min/model); re-eval 100 eps 275 zips ~5h.
Long-lived grid processes can deadlock in cffi. Measured on this audit's first full run (11/10/2026): two of three shards stopped making progress mid-grid at 0% CPU, py-spy dump showing gym3\libenv.py::__del__ → close → cffi api.make_accessor — a Libenv finalizer firing while the main thread already holds cffi's accessor-construction lock. Each train_one builds ~7 Procgen envs (1 train + 1 eval + 5 cross-game probes), so a 165-cell grid in one process is ~1200 env creations and ~20 per shard arm. audit_suite_validity.run_arm now forces a gc.collect() at every arm boundary, and shards of one arm are the safe shape; nothing was lost beyond the two in-flight cells, because the audit writes each finished cell before starting the next.
Continuous integration: .github/workflows/tests.yml runs on every push to main and on pull requests — the first job (study) installs the CPU build of the study stack and runs, in order, a compileall syntax gate over every module in the repository, python -m reporting.report_figures --check (every figure this README embeds must exist and must have a producer recorded in the section 4 table), and python -m pytest tests -q; a second job (lint) installs the pinned ruff and runs ruff check . (the pyflakes subset configured in pyproject.toml); a third job installs JAX/Flax/Optax on CPU and runs python -m jax_port.tests.run_tests, whose cases report SKIP when an environment-only dependency (procgen, jaxmarl) is absent but fail the build on any assertion error. The workflow also runs on workflow_dispatch and every Monday at 03:00 UTC, so dependency drift (the scikit-learn<1.6 cap for gplearn, §21.8) surfaces on a schedule. No job retrains anything or installs procgen: they protect the analysis, extractor and documentation-integrity code, not the benchmark numbers.
- Hardware:
NVIDIA GeForce RTX 4070 Laptop, driver556.29,CUDA 12.5,WDDM,8 GB VRAM,58°C,~30%GPU-UtilduringPPOexecution oncuda(nvidia-smisampled at20:41),Python 3.10.11,torch 2.5.1+cu121,gym 0.26.2,gymnasium 1.3.0,stable-baselines3 2.9.0. - Limitations (revised 30/10/2026):
- The archived return tables are not architecture results. Every table produced by the published single-stream recipe (§3.3–§3.13, §7) comes from policies that do not condition on the observation (§3.6.2). They are kept for provenance; the architecture result is the response scorecard (§0.1), and return does not track the front end under the responsive recipe either (§3.6.7).
- Budget. At most
500ksteps, and the widest within-game span is under one decade (§21.7). The response conclusion holds at100k,250kand500k(§3.6.13); nothing here speaks to25M-step asymptotes. - The response ranks sharply only where the recipe leaves room. On the port grid, trained at
64×128,208/240cells read and the response identifies the architecture at only1.6×chance, against2.4×on the SB316×256grid; its ordering does not transfer between the two stacks (ρ =0.30, §15.5, §21.9). The scorecard of §0.1 is a result about the SB3 implementations at the16×256recipe. - MARL results before 02/12/2026 are invalid. Every SMAX win-rate in §15.4.5 was
0.0because the evaluation adapter could not see a won battle, and every flat VDN/QMIX cell used a target that was not Q-learning (§15.6). With both fixed, IPPO/MAPPO/TARMAC/CTE win35–60%of3mepisodes at 1M steps. QMIX with the original monotonic mixer diverges, because the mixer's unconstrained gain amplifies its own bootstrapped target, and those cells (including every recurrent-QMIX cell) mean nothing; a bounded mixer with a VDN skip, a design change and not the published QMIX, is stable but like VDN does not learn3min 1M steps. Themapocaarm is defective: its counterfactual advantage is biased while the critic is untrained, and the unbiased variant stops the collapse without learning (one seed). The positive control itself missed its own pre-registered criterion for IPPO on MPE (+26% against +30% over random), and the criteria used to excuse that were chosen after the data (§15.6). - Many return comparisons are between policies at the random floor (§0 item 3;
results/random_floor_audit.jsonpairs each published table with a random policy under its own protocol and evaluation seed, 95% t-intervals over seeds, uncorrected). Nothing is above random onbossfightin the SB3 suite andhardrun or in the port's main andhardgrids (a few cells at larger budget or n=10 are), on any publishedmaze/heistarm of §3.6, in HRL onjumper, in the offline benchmark or for the value-based arms of §12. In the port's temporal grids no arm beats random onheistorjumper, and the single-framecaveflyerbenefit of recurrent state is retracted (§15.4.6–§15.4.9); wherememorymode is learned (maze,dodgeball,miner) no memory arm beats the stateless one (§15.7). The symbolic regression of §21, which uses return as a target, has not been audited against the floor. - The
explorationmode is a floor (§15.8): every arm scores exactly0.0, plain PPO still does at 5M steps, and a random policy collects reward in none of 8,685 episodes, so nothing here tests the curiosity bonuses. - Seeds.
5seeds per cell: return differences between configurations are on the order of noise (§3.8). - Distinct front ends.
ae≡reconandcontrastive≡c_aug_noiseare the same networks, so the "16 architectures" are14distinct front ends (§3.6.7). - Known defects of the published arms.
vaediverges toNaNonbossfight/seed42under both recipes and reaches a7.2e13latent ondodgeball(§3.6.2) — an unbounded log-variance overflowing float32, fixed by the opt-invae_clampedarm (§3.6.14).vitstays blind onbossfighteven with its whole token pipeline changed; the change lifts it on the other two games (§3.6.15). The published arms are kept unchanged so every archived cell stays reproducible. - Runtime.
ViTis~4×slower than standard CNNs (~4.6 min/runinbossfight,16-25 min/runinstarpilot); earlier estimates of~15×(Imitation-player:171) stemmed from imitation-learning loss computation rather thanPPOrollouts.
Procgen(Cobbe et al.),DreamerV3(Hafner et al.,SheepRL),CURL/SPR(mario-ds:121),CBAM(Woo et al.),PPO(Schulman et al.),Stable-Baselines3,Imitation-playercompare_models.pyNature 3.48vsResNet 2.90.








