rsm_rise code snapshot (HF_PUSH_ALL) (part 4)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+1
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/rsm_a1_g995.jsonAdded+32
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/rsm_a3_g99.jsonAdded+32
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/rsm_a3_g995.jsonAdded+32
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/snapshots_ei25k/rsm_a1_g995.jsonAdded+32
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/snapshots_ei25k/rsm_a3_g99.jsonAdded+32
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/snapshots_ei25k/rsm_a3_g995.jsonAdded+32
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gcbc.jsonAdded+47
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql.jsonAdded+66
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq.jsonAdded+55
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b09.jsonAdded+59
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b09.json.doneAdded
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b095.jsonAdded+59
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b095.json.doneAdded
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gcbc.jsonAdded+47
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql.jsonAdded+66
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq.jsonAdded+55
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b09.jsonAdded+59
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b09.json.doneAdded
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b095.jsonAdded+59
- gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b095.json.doneAdded
- gen_q_rsm/ogbench_genq/experiments/pack8_ogbench.shAdded+72
- gen_q_rsm/ogbench_genq/experiments/pack_combined_pxonly.shAdded+42
- gen_q_rsm/ogbench_genq/experiments/pack_eval_visual_rsm_empirical_20k.shAdded+86
- gen_q_rsm/ogbench_genq/experiments/pack_fair_px_awr.shAdded+106
- gen_q_rsm/ogbench_genq/experiments/pack_gate_visual_rsm_gamma_beta.shAdded+73
- gen_q_rsm/ogbench_genq/experiments/pack_goalcls_e2e.shAdded+44
- gen_q_rsm/ogbench_genq/experiments/pack_goalclsbin_e2e.shAdded+44
- gen_q_rsm/ogbench_genq/experiments/pack_goalpred_fair_px_awr.shAdded+100
- gen_q_rsm/ogbench_genq/experiments/pack_qfilter_fast.shAdded+41
- gen_q_rsm/ogbench_genq/experiments/pack_qfilter_recon.shAdded+49
- gen_q_rsm/ogbench_genq/experiments/pack_rdec_e2e.shAdded+35
- gen_q_rsm/ogbench_genq/experiments/pack_smooth_e2e.shAdded+60
- gen_q_rsm/ogbench_genq/experiments/pack_smooth_enc.shAdded+41
- gen_q_rsm/ogbench_genq/experiments/pack_valrew_enc.shAdded+49
- gen_q_rsm/ogbench_genq/experiments/pack_valrew_rsm.shAdded+67
- gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_coordfree.shAdded+38
- gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_recononly.shAdded+61
- gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_recononly_cal.shAdded+36
- gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_recursion.shAdded+94
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_fair_training.shAdded+298
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_occupancy_recipe_ablation.shAdded+222
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_onehop_30k_eval.shAdded+147
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_onehop_v2.shAdded+346
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_protected_endpoint_ablation.shAdded+95
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_recursion_continuation.shAdded+412
- gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_recursion_sweep.shAdded+353
- gen_q_rsm/ogbench_genq/experiments/pointmaze-giant-navigate-v0/results/0/rsm_newcov_g995.jsonAdded+195
- gen_q_rsm/ogbench_genq/experiments/pointmaze-large-navigate-v0/results/0/rsm_s1.jsonAdded+194
- gen_q_rsm/ogbench_genq/experiments/pointmaze-medium-navigate-v0/figures/suc.pngAdded
60 unmodified lines6162636460 unmodified linesgen_q_rsm/misc/lewm/fig_cost_heatmap.png filter=lfs diff=lfs merge=lfs -textgen_q_rsm/misc/lewm/fig_horizon.png filter=lfs diff=lfs merge=lfs -textgen_q_rsm/misc/lewm/fig_mechanism.png filter=lfs diff=lfs merge=lfs -textgen_q_rsm/ogbench_genq/experiments/puzzle-3x3-play-v0/figures/fix_sweep.png filter=lfs diff=lfs merge=lfs -text1234567891011121314151617181920212223242526272829303132{ "method": "rsm", "readout": "elbo", "env": "humanoidmaze-medium-navigate-v0", "seed": 0, "alpha": 1.0, "gamma": 0.995, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.21333333333333332, "best_sr": 0.21333333333333332, "per_task": [ 0.4, 0.4, 0.06666666666666667, 0.0, 0.2 ], "curve": [ [ 50000, 0.21333333333333332 ] ], "train_steps": 1000000, "wall_clock_sec": 10202.2, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/ije7uysp"}1234567891011121314151617181920212223242526272829303132{ "method": "rsm", "readout": "elbo", "env": "humanoidmaze-medium-navigate-v0", "seed": 0, "alpha": 3.0, "gamma": 0.99, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.05333333333333333, "best_sr": 0.05333333333333333, "per_task": [ 0.06666666666666667, 0.13333333333333333, 0.0, 0.0, 0.06666666666666667 ], "curve": [ [ 50000, 0.05333333333333333 ] ], "train_steps": 1000000, "wall_clock_sec": 10423.2, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/sd33nr9p"}1234567891011121314151617181920212223242526272829303132{ "method": "rsm", "readout": "elbo", "env": "humanoidmaze-medium-navigate-v0", "seed": 0, "alpha": 3.0, "gamma": 0.995, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.06666666666666668, "best_sr": 0.06666666666666668, "per_task": [ 0.0, 0.0, 0.2, 0.0, 0.13333333333333333 ], "curve": [ [ 50000, 0.06666666666666668 ] ], "train_steps": 1000000, "wall_clock_sec": 10527.5, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/xfdrqb5y"}1234567891011121314151617181920212223242526272829303132{ "method": "rsm", "readout": "elbo", "env": "humanoidmaze-medium-navigate-v0", "seed": 0, "alpha": 1.0, "gamma": 0.995, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.24000000000000005, "best_sr": 0.24000000000000005, "per_task": [ 0.3333333333333333, 0.2, 0.2, 0.0, 0.4666666666666667 ], "curve": [ [ 25000, 0.24000000000000005 ] ], "train_steps": 1000000, "wall_clock_sec": 10403.8, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/wtwg3iu0"}1234567891011121314151617181920212223242526272829303132{ "method": "rsm", "readout": "elbo", "env": "humanoidmaze-medium-navigate-v0", "seed": 0, "alpha": 3.0, "gamma": 0.99, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.08, "best_sr": 0.08, "per_task": [ 0.06666666666666667, 0.0, 0.13333333333333333, 0.0, 0.2 ], "curve": [ [ 25000, 0.08 ] ], "train_steps": 1000000, "wall_clock_sec": 11003.8, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/2k7urwdm"}1234567891011121314151617181920212223242526272829303132{ "method": "rsm", "readout": "elbo", "env": "humanoidmaze-medium-navigate-v0", "seed": 0, "alpha": 3.0, "gamma": 0.995, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.10666666666666666, "best_sr": 0.10666666666666666, "per_task": [ 0.13333333333333333, 0.0, 0.13333333333333333, 0.0, 0.26666666666666666 ], "curve": [ [ 25000, 0.10666666666666666 ] ], "train_steps": 1000000, "wall_clock_sec": 11113.8, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/qajff9cq"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647{ "method": "gcbc", "env": "humanoidmaze-medium-navigate-v0", "seed": 1, "success_rate": 0.048, "best_sr": 0.09333333333333334, "per_task": [ 0.02, 0.02, 0.06, 0.0, 0.14 ], "curve": [ [ 50000, 0.08 ], [ 100000, 0.08 ], [ 150000, 0.05333333333333333 ], [ 200000, 0.05333333333333333 ], [ 250000, 0.09333333333333334 ], [ 300000, 0.06666666666666667 ], [ 300000, 0.048 ] ], "train_steps": 300000, "wall_clock_sec": 4902.5, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/on41idk9"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566{ "method": "gciql", "env": "humanoidmaze-medium-navigate-v0", "seed": 1, "actor_loss": "ddpgbc", "alpha": 0.3, "expectile": 0.9, "success_rate": 0.096, "best_sr": 0.14666666666666667, "per_task": [ 0.06, 0.1, 0.18, 0.02, 0.12 ], "curve": [ [ 50000, 0.05333333333333333 ], [ 100000, 0.10666666666666666 ], [ 150000, 0.09333333333333334 ], [ 200000, 0.10666666666666669 ], [ 250000, 0.13333333333333336 ], [ 300000, 0.06666666666666667 ], [ 350000, 0.06666666666666667 ], [ 400000, 0.08 ], [ 450000, 0.08 ], [ 500000, 0.14666666666666667 ], [ 500000, 0.096 ] ], "train_steps": 500000, "wall_clock_sec": 6944.8, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/7p4kwtkr"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455{ "method": "gciql_genq", "env": "humanoidmaze-medium-navigate-v0", "seed": 1, "actor_loss": "awr", "alpha": 30.0, "expectile": 0.9, "n_occ": 64, "sigma": 5.0, "ensemble": true, "latent": false, "genq_npz": "m9_genq_humanoidmaze_medium_navigate_v0.genqjax.npz", "success_rate": 0.22400000000000003, "best_sr": 0.2533333333333333, "per_task": [ 0.22, 0.26, 0.14, 0.12, 0.38 ], "curve": [ [ 50000, 0.16 ], [ 100000, 0.17333333333333334 ], [ 150000, 0.12 ], [ 200000, 0.24 ], [ 250000, 0.18666666666666668 ], [ 300000, 0.2533333333333333 ], [ 300000, 0.22400000000000003 ] ], "train_steps": 300000, "wall_clock_sec": 16822.0, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/ikzc9zvk"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859{ "method": "gciql_genq_rec", "env": "humanoidmaze-medium-navigate-v0", "seed": 1, "actor_loss": "awr", "alpha": 30.0, "expectile": 0.9, "n_occ": 16, "sigma": 5.0, "beta": 0.9, "gamma": 0.99, "stop_prob": 0.09090909090909101, "max_depth": 33, "steps_per_jump": 10, "midpoint_bc_loss": 0.39999082684516907, "genq_npz": "m9_genq_rec_humanoidmaze_medium_navigate_v0_b09.genqjax.npz", "success_rate": 0.06, "best_sr": 0.10666666666666666, "per_task": [ 0.04, 0.04, 0.08, 0.02, 0.12 ], "curve": [ [ 50000, 0.05333333333333333 ], [ 100000, 0.05333333333333333 ], [ 150000, 0.05333333333333333 ], [ 200000, 0.10666666666666666 ], [ 250000, 0.07999999999999999 ], [ 300000, 0.06666666666666668 ], [ 300000, 0.06 ] ], "train_steps": 300000, "wall_clock_sec": 19820.3, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/3y392rbj"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859{ "method": "gciql_genq_rec", "env": "humanoidmaze-medium-navigate-v0", "seed": 1, "actor_loss": "awr", "alpha": 30.0, "expectile": 0.9, "n_occ": 16, "sigma": 5.0, "beta": 0.95, "gamma": 0.99, "stop_prob": 0.1919191919191919, "max_depth": 16, "steps_per_jump": 10, "midpoint_bc_loss": 0.40003451704978943, "genq_npz": "m9_genq_rec_humanoidmaze_medium_navigate_v0_b095.genqjax.npz", "success_rate": 0.088, "best_sr": 0.10666666666666666, "per_task": [ 0.08, 0.04, 0.26, 0.0, 0.06 ], "curve": [ [ 50000, 0.07999999999999999 ], [ 100000, 0.10666666666666666 ], [ 150000, 0.05333333333333333 ], [ 200000, 0.06666666666666667 ], [ 250000, 0.05333333333333333 ], [ 300000, 0.06666666666666668 ], [ 300000, 0.088 ] ], "train_steps": 300000, "wall_clock_sec": 11702.1, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/x4u7q8cy"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647{ "method": "gcbc", "env": "humanoidmaze-medium-navigate-v0", "seed": 2, "success_rate": 0.068, "best_sr": 0.08, "per_task": [ 0.04, 0.1, 0.08, 0.0, 0.12 ], "curve": [ [ 50000, 0.05333333333333333 ], [ 100000, 0.05333333333333333 ], [ 150000, 0.08 ], [ 200000, 0.05333333333333333 ], [ 250000, 0.08 ], [ 300000, 0.04 ], [ 300000, 0.068 ] ], "train_steps": 300000, "wall_clock_sec": 4765.9, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/oyoge1vd"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566{ "method": "gciql", "env": "humanoidmaze-medium-navigate-v0", "seed": 2, "actor_loss": "ddpgbc", "alpha": 0.3, "expectile": 0.9, "success_rate": 0.076, "best_sr": 0.10666666666666666, "per_task": [ 0.04, 0.04, 0.08, 0.0, 0.22 ], "curve": [ [ 50000, 0.09333333333333334 ], [ 100000, 0.06666666666666667 ], [ 150000, 0.10666666666666666 ], [ 200000, 0.05333333333333333 ], [ 250000, 0.04 ], [ 300000, 0.08 ], [ 350000, 0.06666666666666667 ], [ 400000, 0.05333333333333333 ], [ 450000, 0.06666666666666667 ], [ 500000, 0.04 ], [ 500000, 0.076 ] ], "train_steps": 500000, "wall_clock_sec": 6964.0, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/t6otc77q"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455{ "method": "gciql_genq", "env": "humanoidmaze-medium-navigate-v0", "seed": 2, "actor_loss": "awr", "alpha": 30.0, "expectile": 0.9, "n_occ": 64, "sigma": 5.0, "ensemble": true, "latent": false, "genq_npz": "m9_genq_humanoidmaze_medium_navigate_v0.genqjax.npz", "success_rate": 0.25200000000000006, "best_sr": 0.2533333333333333, "per_task": [ 0.2, 0.32, 0.3, 0.06, 0.38 ], "curve": [ [ 50000, 0.16 ], [ 100000, 0.2 ], [ 150000, 0.24 ], [ 200000, 0.18666666666666668 ], [ 250000, 0.2533333333333333 ], [ 300000, 0.2 ], [ 300000, 0.25200000000000006 ] ], "train_steps": 300000, "wall_clock_sec": 16264.8, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/kxwpsq7r"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859{ "method": "gciql_genq_rec", "env": "humanoidmaze-medium-navigate-v0", "seed": 2, "actor_loss": "awr", "alpha": 30.0, "expectile": 0.9, "n_occ": 16, "sigma": 5.0, "beta": 0.9, "gamma": 0.99, "stop_prob": 0.09090909090909101, "max_depth": 33, "steps_per_jump": 10, "midpoint_bc_loss": 0.40774068236351013, "genq_npz": "m9_genq_rec_humanoidmaze_medium_navigate_v0_b09.genqjax.npz", "success_rate": 0.044, "best_sr": 0.10666666666666666, "per_task": [ 0.02, 0.0, 0.12, 0.02, 0.06 ], "curve": [ [ 50000, 0.026666666666666665 ], [ 100000, 0.08 ], [ 150000, 0.08 ], [ 200000, 0.10666666666666666 ], [ 250000, 0.026666666666666665 ], [ 300000, 0.06666666666666668 ], [ 300000, 0.044 ] ], "train_steps": 300000, "wall_clock_sec": 19894.1, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/uaz7gkr3"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859{ "method": "gciql_genq_rec", "env": "humanoidmaze-medium-navigate-v0", "seed": 2, "actor_loss": "awr", "alpha": 30.0, "expectile": 0.9, "n_occ": 16, "sigma": 5.0, "beta": 0.95, "gamma": 0.99, "stop_prob": 0.1919191919191919, "max_depth": 16, "steps_per_jump": 10, "midpoint_bc_loss": 0.40774068236351013, "genq_npz": "m9_genq_rec_humanoidmaze_medium_navigate_v0_b095.genqjax.npz", "success_rate": 0.052000000000000005, "best_sr": 0.08, "per_task": [ 0.1, 0.02, 0.04, 0.0, 0.1 ], "curve": [ [ 50000, 0.06666666666666668 ], [ 100000, 0.06666666666666667 ], [ 150000, 0.06666666666666667 ], [ 200000, 0.04 ], [ 250000, 0.08 ], [ 300000, 0.026666666666666665 ], [ 300000, 0.052000000000000005 ] ], "train_steps": 300000, "wall_clock_sec": 11608.2, "wandb_url": "https://wandb.ai/dashora7/gen-q-policy-improvement/runs/1lscrkjb"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172#!/bin/bash# Consolidate the OGBench campaign onto EXACTLY 8 packed GPUs (user directive:# restrict to 8 GPUs, pack multiple cells/GPU where memory allows). All 8 existing# state cells RESUME from their resume_*.pkl (zero progress lost); new seed + scene# rec-ON arms start fresh. Per-bundle XLA mem fraction keeps cells from OOM-ing each# other (memory: over-packing caused OOM — so small cells 2-4/GPU, giants solo).set -uo pipefailcd /proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-ogbench-matrixmkdir -p ogbench_genq/experiments/sweeps/pack8 logsEXC="select[hname!='p4-r15-n2' && hname!='p6-r29-n1' && hname!='p3-r09-n3' && hname!='p2-r13-n4' && hname!='p2-r28-n4' && hname!='p3-r30-n4']"CE="--ckpt_every 25000"
# ---- kill the scattered single-cell my-branch jobs (all have resume ckpts) ----for J in 273670 257673 257674 275231; do bkill "$J" 2>/dev/null; donesleep 8
P=ogbench_genq/experiments/sweeps/pack8# each plan line: <env> <seed> <flags...> (run_sweep2.sh -> run_rsm.sh, flags forwarded to rsm.py)
# G1: humanoidmaze-large (giant, solo)cat > $P/b1.txt <<EOFhumanoidmaze-large-navigate-v0 0 --train_steps 1000000 --alpha 0.03 --gamma 0.995 --variant_tag newcov_g995 --ckpt ckpt/resume_hml.pkl $CEEOF# G2: humanoidmaze-giant (giant, solo)cat > $P/b2.txt <<EOFhumanoidmaze-giant-navigate-v0 0 --train_steps 1000000 --alpha 0.03 --gamma 0.995 --variant_tag newcov_g995 --ckpt ckpt/resume_hmg.pkl $CEEOF# G3: pointmaze-giant + antmaze-teleportcat > $P/b3.txt <<EOFpointmaze-giant-navigate-v0 0 --train_steps 1000000 --alpha 0.03 --gamma 0.995 --variant_tag newcov_g995 --ckpt ckpt/resume_pmg.pkl $CEantmaze-teleport-navigate-v0 0 --train_steps 1000000 --alpha 3.0 --variant_tag newcov_a3 --ckpt ckpt/resume_amt.pkl $CEEOF# G4: cube-triple + cube-quadruplecat > $P/b4.txt <<EOFcube-triple-play-v0 0 --train_steps 1000000 --alpha 3.0 --variant_tag newcov_a3 --ckpt ckpt/resume_ct.pkl $CEcube-quadruple-play-v0 0 --train_steps 1000000 --alpha 3.0 --variant_tag newcov_a3 --ckpt ckpt/resume_cq.pkl $CEEOF# G5: puzzle-4x5 + puzzle-4x6cat > $P/b5.txt <<EOFpuzzle-4x5-play-v0 0 --train_steps 1000000 --variant_tag newcov --ckpt ckpt/resume_p45.pkl $CEpuzzle-4x6-play-v0 0 --train_steps 1000000 --variant_tag newcov --ckpt ckpt/resume_p46.pkl $CEEOF# G6: scene rec-ON (continuous probe, untried lever) + puzzle-3x3 seeds 1,2cat > $P/b6.txt <<EOFscene-play-v0 0 --train_steps 1000000 --alpha 3.0 --recursion on --rec_guard tails --rec_beta 0.98 --rec_after 100000 --variant_tag reconA3 --ckpt ckpt/resume_scene_reconA3.pkl $CEpuzzle-3x3-play-v0 1 --train_steps 1000000 --variant_tag seed1 --ckpt ckpt/resume_puz3_s1.pkl $CEpuzzle-3x3-play-v0 2 --train_steps 1000000 --variant_tag seed2 --ckpt ckpt/resume_puz3_s2.pkl $CEEOF# G7: antmaze-medium a3 seeds 1,2 + antsoccer-a0.3 seed1cat > $P/b7.txt <<EOFantmaze-medium-navigate-v0 1 --train_steps 1000000 --alpha 3.0 --variant_tag a3_s1 --ckpt ckpt/resume_amed_s1.pkl $CEantmaze-medium-navigate-v0 2 --train_steps 1000000 --alpha 3.0 --variant_tag a3_s2 --ckpt ckpt/resume_amed_s2.pkl $CEantsoccer-arena-navigate-v0 1 --train_steps 1000000 --alpha 0.3 --variant_tag a03_s1 --ckpt ckpt/resume_asoc_s1.pkl $CEEOF# G8: antsoccer-a0.3 seed2 + pointmaze-teleport seeds 1,2 (all small)cat > $P/b8.txt <<EOFantsoccer-arena-navigate-v0 2 --train_steps 1000000 --alpha 0.3 --variant_tag a03_s2 --ckpt ckpt/resume_asoc_s2.pkl $CEpointmaze-teleport-navigate-v0 1 --train_steps 1000000 --alpha 0.03 --variant_tag s1 --ckpt ckpt/resume_pmt_s1.pkl $CEpointmaze-teleport-navigate-v0 2 --train_steps 1000000 --alpha 0.03 --variant_tag s2 --ckpt ckpt/resume_pmt_s2.pkl $CEEOF
# ---- submit 8 bundles; mem fraction ~ 0.85/(cells) with headroom ----declare -A MEM=( [b1]=0.85 [b2]=0.85 [b3]=0.42 [b4]=0.42 [b5]=0.42 [b6]=0.28 [b7]=0.28 [b8]=0.20 )for b in b1 b2 b3 b4 b5 b6 b7 b8; do mf=${MEM[$b]} bsub -q preemptable -G grp_preemptable -J "rsm_pack_$b" \ -gpu "num=1/task:mode=shared:j_exclusive=yes" -R "$EXC" \ -o "logs/pack8_${b}.log" \ bash -c "export XLA_PYTHON_CLIENT_MEM_FRACTION=$mf WANDB_MODE=disabled; bash ogbench_genq/experiments/run_sweep2.sh ogbench_genq/experiments/sweeps/pack8/$b.txt" echo "[pack8] submitted $b (mem_frac=$mf)"doneecho "[pack8] 8 bundles submitted (<=8 GPUs)."123456789101112131415161718192021222324252627282930313233343536373839404142#!/bin/bash# Ground-truth check: does strictly-pixels-only (--drop_proprio) work at all?# Uses the EXISTING combined encoder+latents (SR 0.592 WITH proprio). Two arms:# prop: concat(proprio,z) -- reproduces the 0.592 control# px: z alone (--drop_proprio) -- strictly pixels-only; tests the new code +# whether proprio was load-bearing for the combined win.# combined uses the cube COORDINATE (not fair) -- this is purely a plumbing + ablation# check, not the fair headline.set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.40export MUJOCO_GL=egl WANDB_MODE=disabledPY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0ENC=$REC/ckpt/pixel_enc_visual_cube_single_play_v0_combined.npzLAT=$REC/ckpt/visual_cube_single_combined_latents.npzMODE=${1:-full}mkdir -p bsub_out ckptif [ "$MODE" = "smoke" ]; then RSTEPS=800; REV=400; else RSTEPS=1000000; REV=25000; fi[ -f "$ENC" ] && [ -f "$LAT" ] || { echo "FATAL: combined enc/lat missing"; exit 1; }
$PY ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha 0.3 --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt ckpt/rsm_comb_prop.pkl --ckpt_every "$REV" \ --variant_tag combined_prop_recoff --wandb_mode disabled \ > bsub_out/rsm_comb_prop.log 2>&1 &A=$!$PY ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" --drop_proprio \ --recursion off --alpha 0.3 --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt ckpt/rsm_comb_px.pkl --ckpt_every "$REV" \ --variant_tag combined_px_recoff --wandb_mode disabled \ > bsub_out/rsm_comb_px.log 2>&1 &B=$!echo "[comb-pxonly] prop pid=$A px pid=$B ; waiting"wait "$A" || true; wait "$B" || trueecho "[comb-pxonly] DONE"grep -aoE "success_rate[^,]*|SR [0-9.]+" bsub_out/rsm_comb_prop.log 2>/dev/null | tail -1grep -aoE "success_rate[^,]*|SR [0-9.]+" bsub_out/rsm_comb_px.log 2>/dev/null | tail -11234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586#!/bin/bash# Strict 10-episode/task diagnostic rollouts for the immutable empirical-index# visual RSM step-20k checkpoints. The evaluator reconstructs only the raw-RGB# actor and independently validates the pixels-only, non-TD training contract.set -euo pipefail
ROOT=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-gate-9164a62cd "$ROOT"
PY=${PY:-/proj/inf-scaling/zwhong/projs/gen_q/.ogbench_venv/bin/python}OUT_ROOT=${OUT_ROOT:-/proj/inf-scaling/zwhong/visual_rsm_empirical_rollouts/step20000_diag10}EPISODES=${EPISODES:-10}REFERENCE_ROOT=${REFERENCE_ROOT:-/u/zwhong/ogbench_ref/impls}
case "$EPISODES" in ''|*[!0-9]*) echo "EPISODES must be a positive integer" >&2; exit 2 ;; 0) echo "EPISODES must be positive" >&2; exit 2 ;;esac
cells=( frozen_w1 frozen_w05 joint_w1)checkpoints=( /proj/inf-scaling/zwhong/visual_rsm_empirical_absorb_frozen_w1_s0/rsm_fair_visual_rsm_empirical_absorb_w1_protected_frozen_warm10k_jointtrain50k_a51b23d_s0_step20000.pkl /proj/inf-scaling/zwhong/visual_rsm_empirical_absorb_frozen_w05_s0/rsm_fair_visual_rsm_empirical_absorb_w05_protected_frozen_warm10k_jointtrain50k_a51b23d_s0_step20000.pkl /proj/inf-scaling/zwhong/visual_rsm_empirical_absorb_joint_w1_s0/rsm_fair_visual_rsm_empirical_absorb_w1_protected_joint_warm10k_jointtrain50k_a51b23d_s0_step20000.pkl)digests=( 20eae75d3c532530616fb5667dbc30e37a37ddcce8ea4157e8730d32ee459a54 1ee6cf7660a4519962fb5cbee403b1e9dabb91b1b1fff36b4be1c3bc6dca90e8 20a9002e5d0cd90a9edbcd3689180e1254d792f3ec2bad0092e3c37cb9997d71)
mkdir -p "$OUT_ROOT"declare -a pids=()
for index in "${!cells[@]}"; do cell=${cells[$index]} checkpoint=${checkpoints[$index]} digest=${digests[$index]} output="$OUT_ROOT/${cell}.json" log="$OUT_ROOT/${cell}.log"
actual=$(sha256sum "$checkpoint") actual=${actual%% *} [ "$actual" = "$digest" ] || { echo "[empirical-20k-eval] checkpoint checksum mismatch: $cell" >&2 exit 1 }
env \ JAX_PLATFORMS=cpu \ CUDA_VISIBLE_DEVICES= \ MUJOCO_GL=egl \ XLA_PYTHON_CLIENT_PREALLOCATE=false \ PYTHONUNBUFFERED=1 \ "$PY" -u ogbench_genq/genq/eval_visual_rsm_pixel_actor.py \ --checkpoint "$checkpoint" \ --out "$output" \ --actor ema \ --episodes "$EPISODES" \ --expected_checkpoint_sha256 "$digest" \ --ogbench_impls "$REFERENCE_ROOT" \ >"$log" 2>&1 & pids+=("$!") echo "[empirical-20k-eval] launched cell=$cell pid=${pids[-1]}"done
failed=()for index in "${!pids[@]}"; do if wait "${pids[$index]}"; then echo "[empirical-20k-eval] complete cell=${cells[$index]}" else status=$? failed+=("${cells[$index]}:$status") fidone
if [ "${#failed[@]}" -gt 0 ]; then printf '[empirical-20k-eval] failed:' >&2 printf ' %s' "${failed[@]}" >&2 printf '\n' >&2 exit 1fi123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106#!/bin/bash# Strictly pixels-only visual-cube retraining pipeline.## Training diet:# 1. reconstruction-only encoder from pixels (cube xyz is diagnostic-only);# 2. index/at-goal reward decoder from latent pairs and trajectory order;# 3. reward-free diffusion occupancy on z with --drop_proprio;# 4. advantage-weighted regression (AWR) actor from stop-gradient occupancy Q.## Recursion is OFF: the fair visual gate forbids the completion/forward-model# machinery used by recursive RSM. The full RSM checkpoint is resumable.set -euo pipefail
CF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"[ -f .env ] && set -a && . ./.env && set +a
export OGBENCH_IMPLS=${OGBENCH_IMPLS:-/u/zwhong/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=falseexport XLA_PYTHON_CLIENT_MEM_FRACTION=0.85export MUJOCO_GL=eglexport WANDB_MODE=disabledexport PYTHONUNBUFFERED=1
PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TAG=fair_px_recon_index_awr_s0ENC=ckpt/pixel_enc_${TAG}.npzLAT=ckpt/latents_${TAG}.npzRDEC=ckpt/rdec_${TAG}.npzSMOKE_CKPT=ckpt/rsm_${TAG}_smoke.pklFULL_CKPT=ckpt/rsm_${TAG}.pklmkdir -p bsub_out ckpt
echo "[fair-px-awr] host=$(hostname) cwd=$PWD"
# Stage 1: fresh coordinate-free encoder. This filename is unique to the# strict run, so no earlier proprioceptive RSM artifact can be reused.if [ ! -f "$ENC" ]; then echo "[fair-px-awr] stage1 reconstruction-only pixel encoder" "$PY" -u ogbench_genq/genq/train_latent_variants_jax.py \ --env "$ENV" --variant "$TAG" \ --w_reward 0 --w_recon 1 --w_consistency 0 \ --w_tempcon 0 --w_stepsto 0 --w_goalcls 0 --w_goalcls_bin 0 --w_smooth 0 \ --z_dim 8 --train_steps 100000 --eval_every 5000 --out "$ENC"fi[ -f "$ENC" ] || { echo "[fair-px-awr] FATAL encoder missing"; exit 1; }
# Stage 2: encode the entire offline pixel dataset once.if [ ! -f "$LAT" ]; then echo "[fair-px-awr] stage2 precompute frozen latents" "$PY" -u ogbench_genq/genq/precompute_pixel_latents.py \ --env "$ENV" --encoder "$ENC" --out "$LAT"fi[ -f "$LAT" ] || { echo "[fair-px-awr] FATAL latents missing"; exit 1; }
# Stage 3: coordinate-free at-goal decoder. Cube coordinates are not labels;# train_reward_decoder.py uses them only for the printed diagnostic.if [ ! -f "$RDEC" ]; then echo "[fair-px-awr] stage3 index/at-goal reward decoder" "$PY" -u ogbench_genq/genq/train_reward_decoder.py \ --latents "$LAT" --out "$RDEC" --target index --index_delta 8 \ --steps 20000 --seed 0fi[ -f "$RDEC" ] || { echo "[fair-px-awr] FATAL reward decoder missing"; exit 1; }
COMMON=( --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" --drop_proprio --reward_decoder "$RDEC" --actor_loss awr --alpha 30 --expectile 0.7 --recursion off --wandb_mode disabled)
# Stage 4a: compile and execute the exact pixels-only AWR training path before# the long run. Rendering is deliberately deferred to a separate verified-host# job because EGL failures are process aborts, not catchable Python errors.echo "[fair-px-awr] stage4a exact-path smoke""$PY" -u ogbench_genq/rsm.py "${COMMON[@]}" \ --rdec_samples 2 --actor_after 50 \ --batch_size 64 --occ_batch 64 \ --train_steps 100 --eval_interval 1000 \ --eval_episodes 1 --eval_episodes_periodic 1 \ --train_only \ --ckpt "$SMOKE_CKPT" --ckpt_every 100 \ --variant_tag "${TAG}_smoke"
# Stage 4b: full resumable, render-free fit. The official 50-episode-per-task# evaluation is a separate job pinned to a verified renderer host.echo "[fair-px-awr] stage4b full pixels-only occupancy + AWR retrain""$PY" -u ogbench_genq/rsm.py "${COMMON[@]}" \ --rdec_samples 4 --actor_after 100000 \ --batch_size 1024 --occ_batch 2048 \ --train_steps 1000000 --eval_interval 100000 \ --eval_episodes 50 --eval_episodes_periodic 3 \ --train_only \ --ckpt "$FULL_CKPT" --ckpt_every 10000 \ --variant_tag "$TAG"
echo "[fair-px-awr] DONE"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273#!/bin/bash# Sequential diagnostics for the six exact-step gamma/beta/depth calibration# checkpoints. This performs no training and deliberately omits# --fail_on_gate so every scientifically failed cell still writes its complete# diagnostic JSON.set -euo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
PY=${PY:-/proj/inf-scaling/zwhong/projs/gen_q/.ogbench_venv/bin/python}ARTIFACT_ROOT=${ARTIFACT_ROOT:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfree}OUT_ROOT=${OUT_ROOT:-/proj/inf-scaling/zwhong/visual_rsm_gamma_beta_gates}LATENTS=${LATENTS:-$ARTIFACT_ROOT/ckpt/latents_fair_px_gpred_gciql_z8_w003_gciqlret_stateh256.npz}READER=${READER:-$ARTIFACT_ROOT/ckpt/rdec_fair_px_gpred_gciql_z8_w003_gciqlret_indexd4_diagmetric.npz}
export OGBENCH_IMPLS=${OGBENCH_IMPLS:-/u/zwhong/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=falseexport XLA_PYTHON_CLIENT_MEM_FRACTION=${XLA_PYTHON_CLIENT_MEM_FRACTION:-0.85}export PYTHONUNBUFFERED=1
mkdir -p "$OUT_ROOT"
cells=( rec_g099_b0985_d08_bm025 rec_g099_b0980_d12_bm025 rec_g099_b0970_d20_bm025 rec_g098_b0960_d12_bm025 ctrl_g099_b0980_d12_bm025_nocomp abl_g099_b0980_d12_bm040)betas=(0.985 0.98 0.97 0.96 0.98 0.98)digests=( ffba1a9cc33eec16d395c302fcc5eb4ef3e1b97dc826ece77e4e2e8186ef1644 e3dede23014d23adfbf5837ec09e5712cc26a8e31d68c2be62d615e14ddd6994 a4d62e00d981d919456632262ff862109f4616b5fe69998d986c41b0a562dac5 ba62ed24accfcf49819e50fc5f63803cdddd7a607584e8c2136e05a810403641 20b19de7c82237b89529e2fe1555466ab2b29b8200d54be9e27b2c5e123441a7 08219197dc38c36abe58412fe4e87d039323afef6f3c5792d61e607f474fe789)
for index in "${!cells[@]}"; do cell=${cells[$index]} checkpoint=$ARTIFACT_ROOT/ckpt/rsm_fair_visual_rsm_hidden_onehop_gb_calib_v1_${cell}_s0_step50000.pkl output=$OUT_ROOT/${cell}_s0_step50000_occupancy_gate.json actual=$(sha256sum "$checkpoint") actual=${actual%% *} [ "$actual" = "${digests[$index]}" ] || { echo "[gamma-beta-gate] checkpoint checksum mismatch: $cell" >&2 exit 1 } echo "[gamma-beta-gate] start cell=$cell beta=${betas[$index]}" "$PY" -u ogbench_genq/genq/gate_visual_occupancy.py \ --ckpt "$checkpoint" \ --latents "$LATENTS" \ --reward_decoder "$READER" \ --out "$output" \ --rows 96 \ --samples 16 \ --loss_draws 4 \ --episodes 100 \ --actor ema \ --local_k 4 \ --local_sigma 0.3 \ --actor_local_k 2 \ --actor_local_sigma 0.3 \ --support_reference_rows 20000 \ --sample_steps 25 \ --rec_beta "${betas[$index]}" echo "[gamma-beta-gate] complete cell=$cell output=$output"done
echo "[gamma-beta-gate] complete all six cells"1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/bin/bash# recon + GOAL-REACHING CLASSIFIER encoder, then RSM -- test whether jointly shaping the# encoder with a goal classifier (GCIQL's mechanism, minus TD) makes the occupancy# read-out discriminative (q_self >> q_rand) and breaks the 0.000 wall on visual-cube.# Single-arm RSM (no GPU contention), on a good render node. Reads the CALIBRATION gap# directly (proxy spearman does NOT predict RSM success -- slow-feature proved that).# Usage: pack_goalcls_e2e.sh <TAG> <w_goalcls> <goalcls_tau>set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"; [ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.6export MUJOCO_GL=egl WANDB_MODE=disabled PYTHONUNBUFFERED=1PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TAG=${1:-goalcls_w1_t1}; WG=${2:-1.0}; TAU=${3:-1.0}ENC=ckpt/pixel_enc_visual_cube_single_play_v0_${TAG}.npzLAT=ckpt/valrew_${TAG}_latents.npzmkdir -p bsub_out ckptecho "[goalcls-e2e] host $(hostname); TAG=$TAG w_goalcls=$WG tau=$TAU"
# stage 1: encoder (recon + goal classifier, jointly), render-freeif [ ! -f "$ENC" ]; then $PY -u ogbench_genq/genq/train_latent_variants_jax.py --env "$ENV" \ --variant "$TAG" --w_reward 0 --w_recon 1 --w_goalcls "$WG" --goalcls_tau "$TAU" \ --z_dim 8 --train_steps 25000 --eval_every 5000 2>&1 | tee "bsub_out/enc_${TAG}.log"fi[ -f "$ENC" ] || { echo "[goalcls-e2e] FATAL encoder"; exit 1; }
# stage 2: precompute latentsif [ ! -f "$LAT" ]; then $PY -u ogbench_genq/genq/precompute_pixel_latents.py --env "$ENV" --encoder "$ENC" --out "$LAT" \ 2>&1 | tee "bsub_out/precompute_${TAG}.log"fi[ -f "$LAT" ] || { echo "[goalcls-e2e] FATAL latents"; exit 1; }
# stage 3: single-arm RSM (prop), 200k, eval@25k -> read q_self/q_rand gap + SRecho "[goalcls-e2e] RSM prop 200k eval@25k"$PY -u ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha 0.3 --train_steps 200000 --eval_interval 25000 \ --ckpt ckpt/rsm_${TAG}_prop.pkl --ckpt_every 25000 \ --variant_tag "${TAG}_prop_recoff" --wandb_mode disabledecho "[goalcls-e2e] EXIT $?"1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/bin/bash# recon + GOAL-REACHING CLASSIFIER encoder, then RSM -- test whether jointly shaping the# encoder with a goal classifier (GCIQL's mechanism, minus TD) makes the occupancy# read-out discriminative (q_self >> q_rand) and breaks the 0.000 wall on visual-cube.# Single-arm RSM (no GPU contention), on a good render node. Reads the CALIBRATION gap# directly (proxy spearman does NOT predict RSM success -- slow-feature proved that).# Usage: pack_goalcls_e2e.sh <TAG> <w_goalcls> <goalcls_tau>set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"; [ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.6export MUJOCO_GL=egl WANDB_MODE=disabled PYTHONUNBUFFERED=1PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TAG=${1:-goalcls_w1_t1}; WG=${2:-1.0}; TAU=${3:-1.0}ENC=ckpt/pixel_enc_visual_cube_single_play_v0_${TAG}.npzLAT=ckpt/valrew_${TAG}_latents.npzmkdir -p bsub_out ckptecho "[goalclsbin-e2e] host $(hostname); TAG=$TAG w_goalcls=$WG tau=$TAU"
# stage 1: encoder (recon + goal classifier, jointly), render-freeif [ ! -f "$ENC" ]; then $PY -u ogbench_genq/genq/train_latent_variants_jax.py --env "$ENV" \ --variant "$TAG" --w_reward 0 --w_recon 1 --w_goalcls_bin "$WG" \ --z_dim 8 --train_steps 25000 --eval_every 5000 2>&1 | tee "bsub_out/enc_${TAG}.log"fi[ -f "$ENC" ] || { echo "[goalclsbin-e2e] FATAL encoder"; exit 1; }
# stage 2: precompute latentsif [ ! -f "$LAT" ]; then $PY -u ogbench_genq/genq/precompute_pixel_latents.py --env "$ENV" --encoder "$ENC" --out "$LAT" \ 2>&1 | tee "bsub_out/precompute_${TAG}.log"fi[ -f "$LAT" ] || { echo "[goalclsbin-e2e] FATAL latents"; exit 1; }
# stage 3: single-arm RSM (prop), 200k, eval@25k -> read q_self/q_rand gap + SRecho "[goalclsbin-e2e] RSM prop 200k eval@25k"$PY -u ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha 0.3 --train_steps 200000 --eval_interval 25000 \ --ckpt ckpt/rsm_${TAG}_prop.pkl --ckpt_every 25000 \ --variant_tag "${TAG}_prop_recoff" --wandb_mode disabledecho "[goalclsbin-e2e] EXIT $?"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100#!/bin/bash# Train a strictly pixels-only RSM from one completed goal-prediction encoder.## Usage:# bash ogbench_genq/experiments/pack_goalpred_fair_px_awr.sh gpred_idx_z8_w003## The selected encoder is frozen. Cube coordinates and proprioception are never# inputs to reward-decoder, occupancy, value, or actor training.set -euo pipefail
CF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"[ -f .env ] && set -a && . ./.env && set +a
export OGBENCH_IMPLS=${OGBENCH_IMPLS:-/u/zwhong/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=falseexport XLA_PYTHON_CLIENT_MEM_FRACTION=0.85export MUJOCO_GL=eglexport WANDB_MODE=disabledexport PYTHONUNBUFFERED=1
if [ "$#" -ne 1 ]; then echo "usage: $0 ENCODER_TAG" >&2 exit 2fi
PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0ENC_TAG=$1TAG=fair_px_${ENC_TAG}_index_awr_s0ENC=ckpt/pixel_enc_visual_cube_single_play_v0_${ENC_TAG}.npzLAT=ckpt/latents_${TAG}.npzRDEC=ckpt/rdec_${TAG}.npzSMOKE_CKPT=ckpt/rsm_${TAG}_smoke.pklFULL_CKPT=ckpt/rsm_${TAG}.pklmkdir -p bsub_out ckpt
echo "[goalpred-fair-px-awr] host=$(hostname) encoder=$ENC_TAG tag=$TAG"[ -f "$ENC" ] || { echo "[goalpred-fair-px-awr] FATAL encoder missing: $ENC" >&2 exit 1}
if [ ! -f "$LAT" ]; then echo "[goalpred-fair-px-awr] stage1 precompute frozen image latents" "$PY" -u ogbench_genq/genq/precompute_pixel_latents.py \ --env "$ENV" --encoder "$ENC" --out "$LAT"fi[ -f "$LAT" ] || { echo "[goalpred-fair-px-awr] FATAL latents missing: $LAT" >&2 exit 1}
if [ ! -f "$RDEC" ]; then echo "[goalpred-fair-px-awr] stage2 coordinate-free index reward decoder" "$PY" -u ogbench_genq/genq/train_reward_decoder.py \ --latents "$LAT" --out "$RDEC" --target index --index_delta 8 \ --neg_gap 64 --cross_neg_frac 0.5 --features symmetric --activation relu \ --steps 20000 --seed 0fi[ -f "$RDEC" ] || { echo "[goalpred-fair-px-awr] FATAL reward decoder missing: $RDEC" >&2 exit 1}
COMMON=( --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" --drop_proprio --reward_decoder "$RDEC" --actor_loss awr --alpha 30 --expectile 0.7 --recursion off --wandb_mode disabled)
echo "[goalpred-fair-px-awr] stage3 exact-path smoke""$PY" -u ogbench_genq/rsm.py "${COMMON[@]}" \ --rdec_samples 2 --actor_after 50 \ --batch_size 64 --occ_batch 64 \ --train_steps 100 --eval_interval 1000 \ --eval_episodes 1 --eval_episodes_periodic 1 \ --train_only \ --ckpt "$SMOKE_CKPT" --ckpt_every 100 \ --variant_tag "${TAG}_smoke"
echo "[goalpred-fair-px-awr] stage4 full resumable occupancy + AWR fit""$PY" -u ogbench_genq/rsm.py "${COMMON[@]}" \ --rdec_samples 4 --actor_after 100000 \ --batch_size 1024 --occ_batch 2048 \ --train_steps 1000000 --eval_interval 100000 \ --eval_episodes 50 --eval_episodes_periodic 3 \ --train_only \ --ckpt "$FULL_CKPT" --ckpt_every 10000 \ --variant_tag "$TAG"
echo "[goalpred-fair-px-awr] DONE tag=$TAG"1234567891011121314151617181920212223242526272829303132333435363738394041#!/bin/bash# HISTORICAL DIAGNOSTIC ONLY. The saved recon occupancy was trained with# concat(proprio19,z), so this is NOT the strictly pixels-only fair test even# though its encoder is coordinate-free. Two read-outs:# (A) DENSITY q_elbo (cheap, no per-candidate sampling) -- fast, K sweep.# (B) CLASSIFIER R_psi with rdec_samples=2 (fast) -- the index-reward read-out.# Small eval (episodes) for a directional signal: does Q-filter (K>1) beat plain actor (K=1)?set -uo pipefailif [ "${ALLOW_PROPRIO_DIAG:-0}" != "1" ]; then echo "Refusing ineligible proprioceptive Q-filter. Set ALLOW_PROPRIO_DIAG=1 for diagnostics." exit 2fiCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"; [ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.6export MUJOCO_GL=egl WANDB_MODE=disabled PYTHONUNBUFFERED=1PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0LAT=$REC/ckpt/visual_cube_single_recononly_latents.npzENC=$REC/ckpt/pixel_enc_visual_cube_single_play_v0_recononly.npzCKPT=$REC/ckpt/rsm_cube_recononly_recoff.pklRDEC=ckpt/rdec_recon_index.npzEP=${1:-12}BASE="--env $ENV --latent_npz $LAT --pixel_encoder $ENC --ckpt $CKPT \ --recursion off --alpha 0.3 --gamma 0.99 --train_steps 1000000 --eval_only \ --wandb_mode disabled --elbo_K 8 --qfilter_sigma 0.3 --eval_episodes $EP"
echo "=== (A) DENSITY read-out Q-filter ==="for K in 1 8 32; do $PY -u ogbench_genq/rsm.py $BASE --qfilter $K --variant_tag qfd_recon_k${K} \ 2>&1 | grep -aE "Q-FILTER|FINAL sr|Traceback|Error" | tail -2doneecho "=== (B) CLASSIFIER read-out (index R_psi, rdec_samples=2) Q-filter ==="for K in 1 8 32; do $PY -u ogbench_genq/rsm.py $BASE --reward_decoder $RDEC --rdec_samples 2 \ --qfilter $K --variant_tag qfc_recon_k${K} \ 2>&1 | grep -aE "Q-FILTER|FINAL sr|Traceback|Error" | tail -2doneecho "[qf-fast] DONE"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#!/bin/bash# HISTORICAL DIAGNOSTIC ONLY: the saved coordinate-free RECON occupancy was# trained on concat(proprio19,z). It is therefore NOT eligible for the strictly# pixels-only comparison despite using no cube-coordinate encoder supervision.# The replacement is pack_fair_px_awr.sh, which retrains with --drop_proprio.set -uo pipefailif [ "${ALLOW_PROPRIO_DIAG:-0}" != "1" ]; then echo "Refusing ineligible proprioceptive Q-filter. Set ALLOW_PROPRIO_DIAG=1 for diagnostics." exit 2fiCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"; [ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.6export MUJOCO_GL=egl WANDB_MODE=disabled PYTHONUNBUFFERED=1PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0LAT=$REC/ckpt/visual_cube_single_recononly_latents.npzENC=$REC/ckpt/pixel_enc_visual_cube_single_play_v0_recononly.npzCKPT=$REC/ckpt/rsm_cube_recononly_recoff.pklRDEC=ckpt/rdec_recon_index.npzmkdir -p bsub_out ckptecho "[qf] host $(hostname)"
# stage 1: INDEX-reward goal classifier R_psi on the frozen recon latent (render-free)if [ ! -f "$RDEC" ]; then $PY -u ogbench_genq/genq/train_reward_decoder.py --latents "$LAT" --out "$RDEC" \ --target index --index_delta 8 --steps 20000 2>&1 | tee "bsub_out/rdec_recon_index.log"fi[ -f "$RDEC" ] || { echo "[qf] FATAL R_psi"; exit 1; }
QF_ARGS="--env $ENV --latent_npz $LAT --pixel_encoder $ENC --ckpt $CKPT \ --reward_decoder $RDEC --rdec_samples 8 --recursion off --alpha 0.3 --gamma 0.99 \ --train_steps 1000000 --eval_only --wandb_mode disabled"
# stage 2: SMOKE the eval-only Q-filter path (K=1, 3 episodes) before the real sweepecho "[qf] smoke (K=1, 3 ep)"$PY -u ogbench_genq/rsm.py $QF_ARGS --qfilter 1 --qfilter_sigma 0.3 --eval_episodes 3 \ --variant_tag qf_recon_smoke 2>&1 | tail -8echo "[qf] smoke rc=$?"
# stage 3: Q-filter K sweep, 50-ep official (K=1 ~ plain actor baseline; K>1 = search)for K in 1 8 32; do echo "[qf] === Q-filter K=$K, 50-ep ===" $PY -u ogbench_genq/rsm.py $QF_ARGS --qfilter $K --qfilter_sigma 0.3 --eval_episodes 50 \ --variant_tag qf_recon_k${K} 2>&1 | grep -aE "Q-FILTER|FINAL sr|Error|Traceback" | tail -4doneecho "[qf] DONE"1234567891011121314151617181920212223242526272829303132333435#!/bin/bash# Test the CLASSIFIER read-out (user's idea): Q=E_{z'~occ}[sigmoid(R_psi(z',g))] instead# of the mass-at-goal density (q_elbo). Train R_psi (goal classifier) on a frozen latent,# then RSM with --reward_decoder. Single-arm, good render node. Reads q_self/q_rand + SR.# Usage: pack_rdec_e2e.sh <LAT> <ENC> <TAG>set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"; [ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.6export MUJOCO_GL=egl WANDB_MODE=disabled PYTHONUNBUFFERED=1PY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0LAT=${1:?need LAT}; ENC=${2:?need ENC}; TAG=${3:?need TAG}RDEC=ckpt/rdec_${TAG}.npzmkdir -p bsub_out ckptecho "[rdec-e2e] host $(hostname); TAG=$TAG"echo "[rdec-e2e] LAT=$LAT"; echo "[rdec-e2e] ENC=$ENC"
# stage 1: train the goal classifier R_psi on the frozen latent (render-free)if [ ! -f "$RDEC" ]; then $PY -u ogbench_genq/genq/train_reward_decoder.py --latents "$LAT" --out "$RDEC" \ 2>&1 | tee "bsub_out/rdec_train_${TAG}.log"fi[ -f "$RDEC" ] || { echo "[rdec-e2e] FATAL: R_psi not produced"; exit 1; }
# stage 2: RSM with the CLASSIFIER read-out (single arm, 200k, eval@25k)echo "[rdec-e2e] RSM classifier read-out, 200k eval@25k"$PY -u ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --reward_decoder "$RDEC" --rdec_samples 8 \ --recursion off --alpha 0.3 --train_steps 200000 --eval_interval 25000 \ --ckpt ckpt/rsm_rdec_${TAG}.pkl --ckpt_every 25000 \ --variant_tag "rdec_${TAG}_recoff" --wandb_mode disabledecho "[rdec-e2e] EXIT $?"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#!/bin/bash# END-TO-END fast test of the slow-feature FAIR encoder -> RSM, on ONE good render node.# Encoder (25k, render-free) -> precompute latents -> RSM two arms (recursion OFF, 1M):# prop: concat(proprio,z) -- isolates the ENCODER vs combined 0.592 / recon 0.000# px: z alone (--drop_proprio) -- strictly pixels-only, headline vs GCIQL 0.30# All coordinate-free (latent never saw cube xyz). Slow-feature proxy at 25k ~0.69# (>> the 0.55 gate; combined=0.56). This job proves whether the fair encoder breaks# the 0.000 wall. Runs whole pipeline on a good node so EGL eval completes.set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreeREC=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursioncd "$CF"[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.40export MUJOCO_GL=egl WANDB_MODE=disabledPY=$REC/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TAG=smooth_s10_fastENC=ckpt/pixel_enc_visual_cube_single_play_v0_${TAG}.npzLAT=ckpt/valrew_${TAG}_latents.npz # (reuse the valrew_* latents naming the RSM pack expects)mkdir -p bsub_out ckpt
# ---- stage 1: slow-feature encoder (25k, render-free) ----if [ ! -f "$ENC" ]; then echo "[e2e] stage1: slow-feature encoder $TAG (w_smooth=10 w_recon=1 dt=1, 25k)" $PY ogbench_genq/genq/train_latent_variants_jax.py --env "$ENV" \ --variant "$TAG" --w_reward 0 --w_recon 1 --w_smooth 10 --smooth_dt 1 \ --z_dim 8 --train_steps 25000 --eval_every 5000 \ 2>&1 | tee "bsub_out/enc_${TAG}.log"fi[ -f "$ENC" ] || { echo "[e2e] FATAL: encoder not produced"; exit 1; }
# ---- stage 2: precompute frozen latents ----if [ ! -f "$LAT" ]; then echo "[e2e] stage2: precompute latents" $PY ogbench_genq/genq/precompute_pixel_latents.py --env "$ENV" --encoder "$ENC" --out "$LAT" \ 2>&1 | tee "bsub_out/precompute_${TAG}.log"fi[ -f "$LAT" ] || { echo "[e2e] FATAL: latents not produced"; exit 1; }
# ---- stage 3: RSM two arms (recursion OFF, 1M, --ckpt resumable) ----echo "[e2e] stage3: RSM prop + px (pixels-only), recursion OFF"$PY ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha 0.3 --train_steps 1000000 --eval_interval 100000 \ --ckpt ckpt/rsm_${TAG}_prop.pkl --ckpt_every 100000 \ --variant_tag "${TAG}_prop_recoff" --wandb_mode disabled \ > "bsub_out/rsm_${TAG}_prop.log" 2>&1 &A=$!$PY ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" --drop_proprio \ --recursion off --alpha 0.3 --train_steps 1000000 --eval_interval 100000 \ --ckpt ckpt/rsm_${TAG}_px.pkl --ckpt_every 100000 \ --variant_tag "${TAG}_px_recoff" --wandb_mode disabled \ > "bsub_out/rsm_${TAG}_px.log" 2>&1 &B=$!echo "[e2e] RSM prop pid=$A px pid=$B ; waiting"wait "$A" || true; wait "$B" || trueecho "[e2e] DONE"grep -aoE "success_rate[^,}]*" bsub_out/rsm_${TAG}_prop.log 2>/dev/null | tail -1grep -aoE "success_rate[^,}]*" bsub_out/rsm_${TAG}_px.log 2>/dev/null | tail -11234567891011121314151617181920212223242526272829303132333435363738394041#!/bin/bash# FAIR slow-feature (temporal-smoothness) encoder sweep for visual-cube-single.## Diagnosis: arm->cube R2=0.90 (cube info present) but recon spearman(z,xy)=0.47 --# the recon latent's metric follows the FAST 19-D arm, not the SLOW 3-D cube. Fix:# penalize latent velocity ||E(x_{t+dt})-E(x_t)||^2 (slow-feature) + recon (retain# info / prevent collapse) -> suppress fast arm variance, expose slow cube -> metric# cube-dominant. Fair: time-order only, no coordinate, no action, no dynamics model.## Sweep the w_smooth/w_recon tension (recon forces arm-encoding; smooth suppresses it).# Gate: proxy spearman(z-dist, xy-dist) >= 0.55 [DIAGNOSTIC ONLY -- xy never trains].set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreecd "$CF"[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.22export MUJOCO_GL=eglPY=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TR=100000mkdir -p bsub_out ckpt# tag w_smooth w_recon smooth_dtrun() { local tag=$1 ws=$2 wr=$3 dt=$4 echo "[smooth] launch $tag (w_smooth=$ws w_recon=$wr dt=$dt)" $PY ogbench_genq/genq/train_latent_variants_jax.py --env "$ENV" \ --variant "$tag" --w_reward 0 --w_recon "$wr" --w_smooth "$ws" --smooth_dt "$dt" \ --z_dim 8 --train_steps "$TR" --eval_every 5000 \ > "bsub_out/enc_$tag.log" 2>&1 &}run smooth_s10_r1_dt1 10 1 1run smooth_s3_r1_dt1 3 1 1run smooth_s3_r1_dt3 3 1 3run smooth_s30_r1_dt1 30 1 1waitecho "[smooth] ALL DONE — proxy spearman (bar: combined=0.56, recon=0.47):"for tag in smooth_s10_r1_dt1 smooth_s3_r1_dt1 smooth_s3_r1_dt3 smooth_s30_r1_dt1; do echo -n " $tag: " grep -aoE "FINAL proxy spearman=[0-9.]+ xy_R2=[0-9.]+" "bsub_out/enc_$tag.log" 2>/dev/null | tail -1done12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#!/bin/bash# FAIR value-reward encoder sweep for visual-cube-single (issue: fair image RSM > GCIQL 0.30).## Root cause (verified): the fair recon-only latent's variance is NOT cube-dominated,# so the RSM ELBO read-out Q=exp(-denoise_loss(z_g|s,a)) is action-non-discriminative# -> SR 0.000. The `combined` encoder fixes this by shaping the latent with the# cube-proximity reward kernel exp(-||z-z_g||^2/2sz^2) ~ reward -> SR 0.592 (but uses# the cube COORDINATE -> unfair).## value_reward is combined's FAIR analog: SAME kernel form, but the target is the# coordinate-free hindsight temporal value gamma_v^(steps-to-goal) (trajectory index# structure only, NO cube xyz). On EXPERT data temporal-distance ~ cube-progress, so# this shapes the latent onto the cube WITHOUT the coordinate.## Stage 1 only: train the sweep, report proxy spearman(z-dist, xy-dist) [DIAGNOSTIC# ONLY -- xy never enters training]. Gate: advance variants with spearman >= 0.55# (the combined bar) to precompute + RSM.set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreecd "$CF"[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.22export MUJOCO_GL=eglPY=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TR=100000mkdir -p bsub_outputs ckpt
# tag z_dim value_gammarun() { local tag=$1 zd=$2 gv=$3 echo "[valrew] launch $tag (z_dim=$zd value_gamma=$gv)" $PY ogbench_genq/genq/train_latent_variants_jax.py --env "$ENV" \ --variant "$tag" --w_reward 1 --w_recon 1 --reward_on both \ --value_reward --value_gamma "$gv" \ --z_dim "$zd" --train_steps "$TR" --eval_every 5000 \ > "bsub_outputs/enc_$tag.log" 2>&1 &}run valrew_z8_g98 8 0.98run valrew_z8_g95 8 0.95run valrew_z8_g90 8 0.90run valrew_z6_g95 6 0.95waitecho "[valrew] ALL DONE — proxy spearman per variant (bar: combined=0.56, recon=0.47):"for tag in valrew_z8_g98 valrew_z8_g95 valrew_z8_g90 valrew_z6_g95; do echo -n " $tag: " grep -aoE "FINAL proxy spearman=[0-9.]+ xy_R2=[0-9.]+" "bsub_outputs/enc_$tag.log" 2>/dev/null | tail -1done12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667#!/bin/bash# Stage 2+3 for a FAIR value_reward encoder: precompute latents, then RSM two arms.# Usage: pack_valrew_rsm.sh <ENC_TAG> [full|smoke]# ENC_TAG e.g. valrew_z8_g95 -> ckpt/pixel_enc_visual_cube_single_play_v0_<TAG>.npz## Arm A (prop): state = concat(proprio, z) -- isolates the ENCODER change vs the# combined result (0.592) and recon-only (0.000): same pipeline, only# the coordinate-free latent differs.# Arm B (px): state = E(pixels) alone (--drop_proprio) -- STRICTLY pixels-only, the# headline fair comparison vs GCIQL's 30% (matched input diet).# Both coordinate-free (the latent never saw cube xyz), both RSM (occupancy + ELBO# read-out, no TD/planner), recursion OFF (combined's headline setting), --ckpt resumable.set -uo pipefailCF=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreecd "$CF"[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.40export MUJOCO_GL=eglexport WANDB_MODE=disabledPY=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion/.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TAG=${1:?usage: pack_valrew_rsm.sh <ENC_TAG> [full|smoke]}MODE=${2:-full}mkdir -p bsub_out ckpt
ENC=ckpt/pixel_enc_visual_cube_single_play_v0_${TAG}.npzLAT=ckpt/valrew_${TAG}_latents.npz[ -f "$ENC" ] || { echo "[valrew-rsm] FATAL: encoder $ENC missing"; exit 1; }
if [ "$MODE" = "smoke" ]; then RSTEPS=800; REV=400; ALPHA=0.3; else RSTEPS=1000000; REV=25000; ALPHA=0.3; fi
# ---- stage 2: precompute frozen latents (encodes visual-cube pixels) --------if [ ! -f "$LAT" ]; then echo "[valrew-rsm] precompute latents for $TAG ..." $PY ogbench_genq/genq/precompute_pixel_latents.py \ --env "$ENV" --encoder "$ENC" --out "$LAT" \ 2>&1 | tee "bsub_out/precompute_${TAG}.log"fi[ -f "$LAT" ] || { echo "[valrew-rsm] FATAL: latents not produced"; exit 1; }
# ---- stage 3: RSM arm A (with proprio) + arm B (strictly pixels-only) -------echo "[valrew-rsm] RSM arm A (proprio) + arm B (pixels-only), recursion OFF"$PY ogbench_genq/rsm.py --env "$ENV" \ --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt "ckpt/rsm_valrew_${TAG}_prop.pkl" --ckpt_every "$REV" \ --variant_tag "valrew_${TAG}_prop_recoff" --wandb_mode disabled \ > "bsub_out/rsm_valrew_${TAG}_prop.log" 2>&1 &PID_A=$!
$PY ogbench_genq/rsm.py --env "$ENV" \ --latent_npz "$LAT" --pixel_encoder "$ENC" --drop_proprio \ --recursion off --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt "ckpt/rsm_valrew_${TAG}_px.pkl" --ckpt_every "$REV" \ --variant_tag "valrew_${TAG}_px_recoff" --wandb_mode disabled \ > "bsub_out/rsm_valrew_${TAG}_px.log" 2>&1 &PID_B=$!
echo "[valrew-rsm] arm A pid=$PID_A arm B pid=$PID_B ; waiting ..."wait "$PID_A" || truewait "$PID_B" || trueecho "[valrew-rsm] DONE. SR:"grep -aoE "SR [0-9.]+|success_rate.*[0-9.]+" "bsub_out/rsm_valrew_${TAG}_prop.log" 2>/dev/null | tail -2grep -aoE "SR [0-9.]+|success_rate.*[0-9.]+" "bsub_out/rsm_valrew_${TAG}_px.log" 2>/dev/null | tail -21234567891011121314151617181920212223242526272829303132333435363738#!/bin/bash# COORDINATE-FREE, DYNAMICS-FREE encoder sweep for visual-cube-single.# Goal: a pixels-only latent whose EUCLIDEAN metric tracks cube-distance (spearman# >= ~0.55, the bar the reward-coordinate 'combined' encoder hits at 0.56 -> RSM# SR 0.592), WITHOUT the cube coordinate and WITHOUT forward dynamics (no WM# machinery). Lever: recon (anchors + retains info) + temporal-contrastive (a# state's own geometric-horizon future is its nearest neighbour, in the read-out's# own euclidean metric). Proxy spearman(z-dist, xy-dist) is DIAGNOSTIC ONLY (xy# never enters training). Ranks variants before any GPU-heavy RSM run.set -uo pipefailcd /proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.22export MUJOCO_GL=eglPY=.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0TR=100000mkdir -p bsub_outputs# variant: tag z_dim w_tempcon tempcon_taurun() { local tag=$1 zd=$2 wt=$3 tau=$4 echo "[coordfree] launch $tag (z_dim=$zd w_tempcon=$wt tau=$tau)" $PY ogbench_genq/genq/train_latent_variants_jax.py --env "$ENV" \ --variant "$tag" --w_reward 0 --w_recon 1 --w_tempcon "$wt" --tempcon_tau "$tau" \ --z_dim "$zd" --train_steps "$TR" \ > "bsub_outputs/enc_$tag.log" 2>&1 &}# short-horizon IDENTITY contrastive (sn_u8 = t+delta, delta~[3,12]); sweep taurun shz8_t1 8 1.0 1.0run shz8_t4 8 1.0 4.0run shz16_t4 16 1.0 4.0run shz16_t16 16 3.0 16.0waitecho "[coordfree] ALL DONE — proxy spearman per variant:"for tag in shz8_t1 shz8_t4 shz16_t4 shz16_t16; do echo -n " $tag: "; grep -aoE "PROXY spearman=[0-9.]+ xy_R2=[0-9.]+" "bsub_outputs/enc_$tag.log" 2>/dev/null | tail -1done12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061#!/bin/bash# RECON-ONLY visual-cube arm = the supervision-fair counterpart to LeWM's diet:# the pixel encoder is trained on PIXELS ALONE (reconstruction, --w_reward 0), with# NO privileged reward coordinate (no cube xyz). This removes the encoder-supervision# asymmetry flagged in README §6.2. Then the SAME RSM occupancy (recursion off + on)# is fit on those recon-only latents and evaluated on visual-cube-single.# Both arms --ckpt resumable; wandb offline; render-node lottery -> exclude bad nodes at bsub.set -uo pipefailcd "$(dirname "$0")/../.."[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=falseexport XLA_PYTHON_CLIENT_MEM_FRACTION=${XLA_PYTHON_CLIENT_MEM_FRACTION:-0.45}export MUJOCO_GL=eglexport WANDB_MODE=disabledPY=.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0ESTEPS=100000; EEV=5000; RSTEPS=1000000; RAFTER=100000; REV=25000; ALPHA=0.3ENC=ckpt/pixel_enc_visual_cube_single_play_v0_recononly.npzLAT=ckpt/visual_cube_single_recononly_latents.npzmkdir -p ckpt bsub_outputs
if [ ! -f "$ENC" ]; then echo "[recononly] stage1: recon-ONLY encoder (w_reward 0, pixels only, NO reward coordinate)" $PY ogbench_genq/genq/train_latent_variants_jax.py \ --env "$ENV" --variant recon-only --w_reward 0 --w_recon 1 --w_consistency 0 \ --train_steps "$ESTEPS" --eval_every "$EEV" --out "$ENC" \ 2>&1 | tee "bsub_outputs/cube_enc_recononly.log"else echo "[recononly] stage1: encoder exists, skip"; fi[ -f "$ENC" ] || { echo "[recononly] FATAL: encoder not produced"; exit 1; }
if [ ! -f "$LAT" ]; then echo "[recononly] stage2: precompute recon-only latents" $PY ogbench_genq/genq/precompute_pixel_latents.py \ --env "$ENV" --encoder "$ENC" --out "$LAT" \ 2>&1 | tee "bsub_outputs/cube_precompute_recononly.log"else echo "[recononly] stage2: latents exist, skip"; fi[ -f "$LAT" ] || { echo "[recononly] FATAL: latents not produced"; exit 1; }
echo "[recononly] stage3: RSM recursion-OFF and recursion-ON on recon-only latents"$PY ogbench_genq/rsm.py --env "$ENV" \ --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt "ckpt/rsm_cube_recononly_recoff.pkl" --ckpt_every "$REV" \ --variant_tag "cubereconly_recoff" --wandb_mode offline \ > "bsub_outputs/rsm_cube_recononly_recoff.log" 2>&1 &PID_OFF=$!$PY ogbench_genq/rsm.py --env "$ENV" \ --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion on --rec_beta 0.98 --rec_after "$RAFTER" --rec_guard tails \ --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt "ckpt/rsm_cube_recononly_recon.pkl" --ckpt_every "$REV" \ --variant_tag "cubereconly_recon" --wandb_mode offline \ > "bsub_outputs/rsm_cube_recononly_recon.log" 2>&1 &PID_ON=$!echo "[recononly] off pid=$PID_OFF on pid=$PID_ON ; waiting ..."wait "$PID_OFF" || truewait "$PID_ON" || trueecho "[recononly] DONE."123456789101112131415161718192021222324252627282930313233343536#!/bin/bash# recon-only, σ_z-RECALIBRATED. The first recon-only run got 0.000 because the# read-out kernel bandwidth σ_z=1.0 (inherited from the reward-metric encoder) is# ~7x the recon-only latent's own scale (median pairwise ‖z-z'‖≈0.15) → the kernel# exp(-‖z-z_g‖²/2σ_z²) is FLAT (all pairs ≈0.99), no goal discrimination. Fix# (coordinate-free): σ_z set to median/3 ≈ 0.051 from the latent's OWN pairwise stats# (no reward coordinate used). Reuse the cached latents (z is independent of σ_z);# only the read-out changes. This is the true LeWM-diet apple-to-apple test.set -uo pipefailcd /proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=false XLA_PYTHON_CLIENT_MEM_FRACTION=0.45export MUJOCO_GL=egl WANDB_MODE=disabledPY=.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0ENC=ckpt/pixel_enc_visual_cube_single_play_v0_recononly_cal.npz # RECALIBRATED sigma_zLAT=ckpt/visual_cube_single_recononly_latents.npz # cached, sigma_z-independentRSTEPS=1000000; RAFTER=100000; REV=25000; ALPHA=0.3mkdir -p bsub_outputsecho "[recononly-cal] stage3 with recalibrated sigma_z; both arms"$PY ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha "$ALPHA" --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt ckpt/rsm_cube_reconlycal_recoff.pkl --ckpt_every "$REV" \ --variant_tag cubereconlycal_recoff --wandb_mode offline \ > bsub_outputs/rsm_cube_reconlycal_recoff.log 2>&1 &PID_OFF=$!$PY ogbench_genq/rsm.py --env "$ENV" --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion on --rec_beta 0.98 --rec_after "$RAFTER" --rec_guard tails --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt ckpt/rsm_cube_reconlycal_recon.pkl --ckpt_every "$REV" \ --variant_tag cubereconlycal_recon --wandb_mode offline \ > bsub_outputs/rsm_cube_reconlycal_recon.log 2>&1 &PID_ON=$!wait "$PID_OFF" || true; wait "$PID_ON" || trueecho "[recononly-cal] DONE"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394#!/bin/bash# Visual-cube-single RSM-image-latent WITH RECURSION (builds on #68 pixel path,# stacks on rsm-ogbench-matrix). This is the MODALITY-FAIR comparison against# the world-model baselines in the #65 head-to-head, which were tested on# visual-cube-single: LeWM 0.68 replay / 0.000 OGBench; DINO-WM 0.54 / 0.000.# Both are image-observation, both 0.000 OGBench success. Here we produce a# current-design RSM-image-latent number on the SAME env, recursion ON and OFF.## Pipeline on ONE GPU (small MLP occupancy + a CNN encoder; fits one H100):# stage 1: train the COMBINED (recon+reward) latent encoder (Dan's headline# latent objective) on visual-cube-single pixels.# stage 2: precompute frozen latents once (cube reads pixels from the h5).# stage 3: RSM on the latents, TWO arms packed on the GPU:# - recursion OFF (Dan's setup: the WM-fair baseline)# - recursion ON (beta=0.98, tails guard, lax.cond warmup gate)# both with --ckpt (resumable: preemptable jobs get SSUSP'd).## Usage (submitted via a single-GPU preemptable bsub — see the launcher):# bash ogbench_genq/experiments/pack_visual_cube_recursion.sh [smoke|full]set -uo pipefailcd "$(dirname "$0")/../.."[ -f .env ] && set -a && . ./.env && set +aexport OGBENCH_IMPLS=${OGBENCH_IMPLS:-$HOME/ogbench_ref/impls}export XLA_PYTHON_CLIENT_PREALLOCATE=falseexport XLA_PYTHON_CLIENT_MEM_FRACTION=${XLA_PYTHON_CLIENT_MEM_FRACTION:-0.45}export MUJOCO_GL=eglexport WANDB_MODE=${WANDB_MODE:-offline}PY=.ogbench_venv/bin/pythonENV=visual-cube-single-play-v0MODE=${1:-full}mkdir -p ckpt bsub_outputs
# encoder (combined = recon+reward) and its precomputed latentsENC=ckpt/pixel_enc_visual_cube_single_play_v0_combined.npzLAT=ckpt/visual_cube_single_combined_latents.npz
if [ "$MODE" = "smoke" ]; then ESTEPS=400; EEV=200; MF="--max_frames 40000"; RSTEPS=600; RAFTER=200; REV=200; ALPHA=0.3else ESTEPS=100000; EEV=5000; MF=""; RSTEPS=1000000; RAFTER=100000; REV=25000; ALPHA=0.3fi
# ---- stage 1: train the combined latent encoder ----------------------------if [ ! -f "$ENC" ]; then echo "[cube] stage1: training combined (recon+reward) latent encoder ..." $PY ogbench_genq/genq/train_latent_variants_jax.py \ --env "$ENV" --variant combined --w_reward 1 --w_recon 1 --w_consistency 0 \ --train_steps "$ESTEPS" --eval_every "$EEV" $MF \ 2>&1 | tee "bsub_outputs/cube_enc_combined.log"else echo "[cube] stage1: encoder exists ($ENC), skip"fi[ -f "$ENC" ] || { echo "[cube] FATAL: encoder not produced"; exit 1; }
# ---- stage 2: precompute frozen latents (cube pixels from the h5) ----------if [ ! -f "$LAT" ]; then echo "[cube] stage2: precomputing latents ..." $PY ogbench_genq/genq/precompute_pixel_latents.py \ --env "$ENV" --encoder "$ENC" --out "$LAT" \ 2>&1 | tee "bsub_outputs/cube_precompute_combined.log"else echo "[cube] stage2: latents exist ($LAT), skip"fi[ -f "$LAT" ] || { echo "[cube] FATAL: latents not produced"; exit 1; }
# ---- stage 3: two RSM arms on the GPU (recursion OFF and ON) ----------------# alpha 0.3 matches the non-visual cube-single RSM recipe.echo "[cube] stage3: RSM recursion-OFF and recursion-ON (both --ckpt resumable)"
$PY ogbench_genq/rsm.py --env "$ENV" \ --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion off --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt "ckpt/rsm_cube_combined_recoff.pkl" --ckpt_every "$REV" \ --variant_tag "cubecomb_recoff" \ --wandb_mode offline \ > "bsub_outputs/rsm_cube_combined_recoff.log" 2>&1 &PID_OFF=$!
$PY ogbench_genq/rsm.py --env "$ENV" \ --latent_npz "$LAT" --pixel_encoder "$ENC" \ --recursion on --rec_beta 0.98 --rec_after "$RAFTER" --rec_guard tails \ --alpha "$ALPHA" \ --train_steps "$RSTEPS" --eval_interval "$REV" \ --ckpt "ckpt/rsm_cube_combined_recon.pkl" --ckpt_every "$REV" \ --variant_tag "cubecomb_recon" \ --wandb_mode offline \ > "bsub_outputs/rsm_cube_combined_recon.log" 2>&1 &PID_ON=$!
echo "[cube] RSM off pid=$PID_OFF on pid=$PID_ON ; waiting ..."wait "$PID_OFF" || truewait "$PID_ON" || trueecho "[cube] DONE. results in ogbench_genq/experiments/$ENV/results/0/"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298#!/bin/bash# Pack one fair visual Recursive Successor Model (RSM) training tier into a# single GPU allocation. Every cell is a strictly pixels-only, non-TD,# discount-conditioned fit implemented by the canonical single-cell launchers.## Usage:# bash ogbench_genq/experiments/pack_visual_rsm_fair_training.sh \# {nonrec-primary|nonrec-secondary|recursion} [--dry-run]## Re-running the same tier resumes every cell from its stable full-state# checkpoint. Cells are independent background processes; the pack waits for# all of them and reports every failure before returning nonzero.set -uo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
usage() { echo "usage: $0 {nonrec-primary|nonrec-secondary|recursion} [--dry-run]" >&2 exit 2}
PACK=${1:-}case "$PACK" in nonrec-primary|nonrec-secondary|recursion) ;; *) usage ;;esacshift
DRY_RUN=${PACK_DRY_RUN:-0}while [ "$#" -gt 0 ]; do case "$1" in --dry-run) DRY_RUN=1 ;; *) usage ;; esac shiftdonecase "$DRY_RUN" in 0|1) ;; *) echo "PACK_DRY_RUN must be 0 or 1" >&2; exit 2 ;; esac
MANIFEST=${MANIFEST:-ogbench_genq/experiments/visual_rsm_fair_training_manifest.tsv}NONREC_SCRIPT=ogbench_genq/experiments/train_visual_rsm_index_distill.shRECURSION_SCRIPT=ogbench_genq/experiments/train_visual_rsm_occupancy_recursion.shfor required in "$MANIFEST" "$NONREC_SCRIPT" "$RECURSION_SCRIPT"; do [ -r "$required" ] || { echo "[visual-rsm-pack] missing required file: $required" >&2 exit 1 }done
SCREEN_ID=${SCREEN_ID:-fair_visual_rsm_prod_v1}case "$SCREEN_ID" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-pack] SCREEN_ID must use only A-Z, a-z, 0-9, dot, underscore, or hyphen" >&2 exit 2 ;;esac
SEED=${SEED:-0}TRAIN_STEPS=${TRAIN_STEPS:-150000}ARCHIVE_EVERY=${ARCHIVE_EVERY:-25000}ACTOR_AFTER=${ACTOR_AFTER:-50000}RDEC_SAMPLES=${RDEC_SAMPLES:-16}AUDIT_ARCHIVES=${AUDIT_ARCHIVES:-1}WANDB_MODE=${WANDB_MODE:-disabled}PY=${PY:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion/.ogbench_venv/bin/python}CELL_FILTER=${CELL_FILTER:-}
case "$PACK" in nonrec-primary) DEFAULT_MEM_FRACTION=0.10 ;; nonrec-secondary) DEFAULT_MEM_FRACTION=0.18 ;; recursion) DEFAULT_MEM_FRACTION=0.14 ;;esacCELL_MEM_FRACTION=${CELL_MEM_FRACTION:-$DEFAULT_MEM_FRACTION}LOG_ROOT=${LOG_ROOT:-bsub_out/visual_rsm_fair/${SCREEN_ID}/${PACK}}
is_selected() { local cell=$1 [ -z "$CELL_FILTER" ] && return 0 case ",$CELL_FILTER," in *",$cell,"*) return 0 ;; *) return 1 ;; esac}
declare -A SEEN_TAGS=()declare -A SEEN_CKPTS=()declare -A SEEN_LOGS=()PIDS=()NAMES=()COUNT=0
launch_cell() { local cell=$1 local script=$2 shift 2
is_selected "$cell" || return 0
local tag="${SCREEN_ID}_${cell}_s${SEED}" local ckpt="ckpt/rsm_${tag}.pkl" local log="${LOG_ROOT}/${cell}_s${SEED}.log"
if [ -n "${SEEN_TAGS[$tag]+x}" ] || [ -n "${SEEN_CKPTS[$ckpt]+x}" ] || [ -n "${SEEN_LOGS[$log]+x}" ]; then echo "[visual-rsm-pack] duplicate identity for cell=$cell" >&2 exit 2 fi SEEN_TAGS[$tag]=1 SEEN_CKPTS[$ckpt]=1 SEEN_LOGS[$log]=1 COUNT=$((COUNT + 1))
local cmd=( env "TAG=$tag" "CKPT=$ckpt" "PY=$PY" "SEED=$SEED" "TRAIN_STEPS=$TRAIN_STEPS" "ARCHIVE_EVERY=$ARCHIVE_EVERY" "ACTOR_AFTER=$ACTOR_AFTER" "RDEC_SAMPLES=$RDEC_SAMPLES" "WANDB_MODE=$WANDB_MODE" "XLA_PYTHON_CLIENT_PREALLOCATE=false" "XLA_PYTHON_CLIENT_MEM_FRACTION=$CELL_MEM_FRACTION" "OMP_NUM_THREADS=2" "OPENBLAS_NUM_THREADS=2" "MKL_NUM_THREADS=2" "$@" bash "$script" )
printf '[visual-rsm-pack] cell=%s tag=%s ckpt=%s log=%s\n' \ "$cell" "$tag" "$ckpt" "$log" if [ "$DRY_RUN" = 1 ]; then printf '[visual-rsm-pack] command=' printf ' %q' "${cmd[@]}" printf '\n' return 0 fi
mkdir -p "$(dirname "$log")" "$(dirname "$ckpt")" { printf '\n[visual-rsm-pack] attempt_utc=%s cell=%s tag=%s\n' \ "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$cell" "$tag" printf '[visual-rsm-pack] command=' printf ' %q' "${cmd[@]}" printf '\n' } >>"$log" "${cmd[@]}" >>"$log" 2>&1 & PIDS+=("$!") NAMES+=("$cell")}
while IFS=$'\t' read -r pack cell kind latent_update actor_loss alpha gamma beta \ recursion_state rec_after gamma_horizons gamma_lo actor_action_support \ occ_hidden beta_mass rationale; do [ "$pack" = "pack" ] && continue [ "$pack" = "$PACK" ] || continue
case "$kind" in nonrec) [ "$gamma" = "0.99" ] || { echo "[visual-rsm-pack] non-recursive launcher fixes gamma=0.99: $cell" >&2 exit 2 } case "$actor_loss" in ddpgbc_distill) expectile=0.9 ;; awr_distill) expectile=0.9 ;; *) echo "[visual-rsm-pack] invalid non-rec actor loss for $cell" >&2; exit 2 ;; esac case "$gamma_horizons" in 2,4,8,16,32,64) ;; *) echo "[visual-rsm-pack] invalid non-rec horizon support for $cell" >&2; exit 2 ;; esac sampler=$( case "$cell" in *strat*) echo stratified_bins ;; *legacyhmatch*) echo legacy_log_uniform ;; *) exit 2 ;; esac ) || { echo "[visual-rsm-pack] cannot infer sampler for $cell" >&2 exit 2 } launch_cell "$cell" "$NONREC_SCRIPT" \ "MODE=$actor_loss" \ "LATENT_UPDATE=$latent_update" \ "ALPHA=$alpha" \ "EXPECTILE=$expectile" \ "GAMMA_SAMPLER=$sampler" \ "GAMMA_HORIZONS=$gamma_horizons" \ "GAMMA_LO=$gamma_lo" \ "GAMMA_TASK_FRACTION=0.5" \ "DISTILL_ACTOR_GOALS=1" \ "DISTILL_ACTOR_ACTIONS=$actor_action_support" \ "DISTILL_ACTOR_ACTION_K=2" \ "DISTILL_ACTOR_ACTION_SIGMA=0.3" \ "DISTILL_ACTOR_ACTION_PAIRWISE_WEIGHT=1.0" \ "FLOW_STEPS=25" \ "OCC_HIDDEN=$occ_hidden" \ "OCC_LAYERS=4" \ "OCC_ACTION_CONTRAST_WEIGHT=0.5" \ "OCC_ACTION_CONTRAST_MARGIN=0.1" \ "OCC_ACTION_NEGATIVE=local" \ "OCC_ACTION_NEGATIVE_SIGMA=0.3" \ "LATENT_HIDDEN=64" \ "LATENT_LR=3e-5" \ "LATENT_GOAL_WEIGHT=0.1" \ "LATENT_ANCHOR_WEIGHT=0.01" \ "AUDIT_ARCHIVES=$AUDIT_ARCHIVES" ;; recursion) [ "$latent_update" = frozen ] || { echo "[visual-rsm-pack] recursion must freeze the latent: $cell" >&2 exit 2 } [ "$actor_loss" = ddpgbc_distill ] || { echo "[visual-rsm-pack] recursion requires distilled DDPG+BC: $cell" >&2 exit 2 } if [ "$rec_after" = TRAIN_STEPS ]; then resolved_rec_after=$TRAIN_STEPS else resolved_rec_after=$rec_after fi launch_cell "$cell" "$RECURSION_SCRIPT" \ "MODE=$actor_loss" \ "REC_STATE=$recursion_state" \ "ALPHA=$alpha" \ "EXPECTILE=0.9" \ "GAMMA=$gamma" \ "BETA=$beta" \ "REC_DEPTH=12" \ "REC_AFTER=$resolved_rec_after" \ "REC_GUARD=ema" \ "BETA_SAMPLE_PROB=$beta_mass" \ "GAMMA_SAMPLER=stratified_bins" \ "GAMMA_HORIZONS=$gamma_horizons" \ "GAMMA_LO=$gamma_lo" \ "GAMMA_TASK_FRACTION=0.5" \ "DISTILL_ACTOR_GOALS=1" \ "DISTILL_ACTOR_ACTIONS=$actor_action_support" \ "DISTILL_ACTOR_ACTION_K=2" \ "DISTILL_ACTOR_ACTION_SIGMA=0.3" \ "DISTILL_ACTOR_ACTION_PAIRWISE_WEIGHT=1.0" \ "FLOW_STEPS=25" \ "OCC_HIDDEN=$occ_hidden" \ "OCC_LAYERS=4" \ "OCC_ACTION_CONTRAST_WEIGHT=0.5" \ "OCC_ACTION_CONTRAST_MARGIN=0.1" \ "OCC_ACTION_NEGATIVE=local" \ "OCC_ACTION_NEGATIVE_SIGMA=0.3" ;; *) echo "[visual-rsm-pack] invalid kind=$kind for cell=$cell" >&2 exit 2 ;; esacdone <"$MANIFEST"
[ "$COUNT" -gt 0 ] || { echo "[visual-rsm-pack] no cells selected for pack=$PACK CELL_FILTER=$CELL_FILTER" >&2 exit 2}
if [ "$DRY_RUN" = 1 ]; then echo "[visual-rsm-pack] dry-run complete pack=$PACK cells=$COUNT" exit 0fi
terminate_children() { local pid for pid in "${PIDS[@]}"; do kill -TERM "$pid" 2>/dev/null || true done}trap terminate_children INT TERM
failures=()for i in "${!PIDS[@]}"; do if wait "${PIDS[$i]}"; then echo "[visual-rsm-pack] complete cell=${NAMES[$i]}" else rc=$? failures+=("${NAMES[$i]}:$rc") echo "[visual-rsm-pack] failed cell=${NAMES[$i]} rc=$rc" >&2 fidone
if [ "${#failures[@]}" -gt 0 ]; then printf '[visual-rsm-pack] pack=%s failed cells:' "$PACK" >&2 printf ' %s' "${failures[@]}" >&2 printf '\n' >&2 exit 1fiecho "[visual-rsm-pack] pack=$PACK complete cells=$COUNT"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222#!/bin/bash# Two-arm, one-GPU ablation for fair visual RSM occupancy supervision.## Both arms are strictly pixels-only, non-TD conditional-flow occupancies over# frozen h256 futures. Half of each occupancy batch uses the actor's uniform# same-trajectory future-goal distribution. The only varying factor is the# normalized frozen index-reader metric auxiliary (lambda 0 versus 1).# Recursive composition stays unreachable through the fixed 50k endpoint.set -euo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
usage() { echo "usage: $0 [--dry-run|--execute]" >&2 exit 2}
DRY_RUN=${PACK_DRY_RUN:-1}while [ "$#" -gt 0 ]; do case "$1" in --dry-run) DRY_RUN=1 ;; --execute) DRY_RUN=0 ;; *) usage ;; esac shiftdonecase "$DRY_RUN" in 0|1) ;; *) echo "[visual-rsm-occ-recipe] PACK_DRY_RUN must be 0 or 1" >&2 exit 2 ;;esac
CF=${CF:-$ROOT}REC=${REC:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion}PY=${PY:-$REC/.ogbench_venv/bin/python}TRAIN_SCRIPT=ogbench_genq/experiments/train_visual_rsm_occupancy_recursion.shRSM_IMPL=ogbench_genq/rsm.pyBASE=fair_px_gpred_gciql_z8_w003_gciqlretREADER_TAG=indexd4_diagmetricRDEC=${RDEC:-$CF/ckpt/rdec_${BASE}_${READER_TAG}.npz}RDEC_SHA256=9ab338b3940e4c0797b4fc419659d5907f96e745b95a8c57457c85099fdb85a7
for required in "$TRAIN_SCRIPT" "$RSM_IMPL"; do [ -r "$required" ] || { echo "[visual-rsm-occ-recipe] missing required file: $required" >&2 exit 1 }donefor literal in \ '--drop_proprio' \ '--latent_update frozen' \ '--occupancy_model flow' \ '--occ_actor_goal_fraction "$OCC_ACTOR_GOAL_FRACTION"' \ '--occ_reader_metric_weight "$OCC_READER_METRIC_WEIGHT"' \ '--recursion occupancy'; do rg -Fq -- "$literal" "$TRAIN_SCRIPT" || { echo "[visual-rsm-occ-recipe] launcher contract missing: $literal" >&2 exit 1 }donefor literal in \ 'occ_reader_metric_uses_reward_arrays": False' \ 'occ_reader_metric_uses_coordinates": False' \ 'occ_reader_metric_uses_td_or_bootstrap": False'; do rg -Fq -- "$literal" "$RSM_IMPL" || { echo "[visual-rsm-occ-recipe] implementation contract missing: $literal" >&2 exit 1 }done
if [ -s "$RDEC" ]; then ACTUAL_RDEC_SHA256=$(sha256sum "$RDEC") ACTUAL_RDEC_SHA256=${ACTUAL_RDEC_SHA256%% *} [ "$ACTUAL_RDEC_SHA256" = "$RDEC_SHA256" ] || { echo "[visual-rsm-occ-recipe] reader checksum mismatch: expected=$RDEC_SHA256 actual=$ACTUAL_RDEC_SHA256" >&2 exit 1 }elif [ "$DRY_RUN" = 0 ]; then echo "[visual-rsm-occ-recipe] missing reader: $RDEC" >&2 exit 1else echo "[visual-rsm-occ-recipe] reader preflight deferred in dry-run: $RDEC"fi
SCREEN_ID=${SCREEN_ID:-fair_visual_rsm_occ_recipe_v1}case "$SCREEN_ID" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-occ-recipe] SCREEN_ID contains unsafe characters" >&2 exit 2 ;;esacSEED=${SEED:-0}TRAIN_STEPS=${TRAIN_STEPS:-50000}[ "$TRAIN_STEPS" = 50000 ] || { echo "[visual-rsm-occ-recipe] endpoint is fixed at TRAIN_STEPS=50000" >&2 exit 2}LOG_ROOT=${LOG_ROOT:-bsub_out/visual_rsm_occupancy_recipe/${SCREEN_ID}}CELL_MEM_FRACTION=${CELL_MEM_FRACTION:-0.44}
PIDS=()NAMES=()launch_arm() { local arm=$1 local metric_weight=$2 local tag="${SCREEN_ID}_${arm}_s${SEED}" local checkpoint="ckpt/rsm_${tag}.pkl" local log="${LOG_ROOT}/${arm}_s${SEED}.log" local -a command=( env "CF=$CF" "PY=$PY" "TAG=$tag" "CKPT=$checkpoint" "SEED=$SEED" "TRAIN_STEPS=$TRAIN_STEPS" "ARCHIVE_EVERY=25000" "MODE=ddpgbc_distill" "REC_STATE=hidden" "READER_DELTA=4" "READER_TAG=$READER_TAG" "RDEC=$RDEC" "RDEC_SHA256=$RDEC_SHA256" "RDEC_SAMPLES=16" "ACTOR_AFTER=0" "ALPHA=1.0" "EXPECTILE=0.9" "DISTILL_ACTOR_GOALS=1" "DISTILL_ACTOR_ACTIONS=1" "DISTILL_ACTOR_ACTION_K=2" "DISTILL_ACTOR_ACTION_SIGMA=0.3" "DISTILL_ACTOR_ACTION_PAIRWISE_WEIGHT=1.0" "FLOW_STEPS=25" "OCC_HIDDEN=512" "OCC_LAYERS=4" "OCC_ACTION_CONTRAST_WEIGHT=0.5" "OCC_ACTION_CONTRAST_MARGIN=0.1" "OCC_ACTION_NEGATIVE=actor_local" "OCC_ACTION_NEGATIVE_SIGMA=0.3" "OCC_ACTION_NEGATIVE_K=2" "OCC_ACTOR_GOAL_FRACTION=0.5" "OCC_READER_METRIC_WEIGHT=$metric_weight" "GAMMA=0.99" "BETA=0.98" "REC_DEPTH=12" "REC_AFTER=1000000000" "REC_GUARD=ema" "BETA_SAMPLE_PROB=0.25" "GAMMA_SAMPLER=stratified_bins" "GAMMA_HORIZONS=2,4,8,16,32,50,64" "GAMMA_LO=0.50" "GAMMA_TASK_FRACTION=0.5" "WANDB_MODE=disabled" "XLA_PYTHON_CLIENT_PREALLOCATE=false" "XLA_PYTHON_CLIENT_MEM_FRACTION=$CELL_MEM_FRACTION" "OMP_NUM_THREADS=3" "OPENBLAS_NUM_THREADS=3" "MKL_NUM_THREADS=3" bash "$TRAIN_SCRIPT" ) printf '[visual-rsm-occ-recipe] arm=%s actor_goal_fraction=0.5 reader_metric_weight=%s checkpoint=%s log=%s\n' \ "$arm" "$metric_weight" "$checkpoint" "$log" if [ "$DRY_RUN" = 1 ]; then printf '[visual-rsm-occ-recipe] command=' printf ' %q' "${command[@]}" printf '\n' return 0 fi [ ! -e "$checkpoint" ] || { echo "[visual-rsm-occ-recipe] refusing existing destination: $checkpoint" >&2 exit 1 } mkdir -p "$(dirname "$checkpoint")" "$(dirname "$log")" { printf '[visual-rsm-occ-recipe] attempt_utc=%s arm=%s reader_metric_weight=%s\n' \ "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$arm" "$metric_weight" printf '[visual-rsm-occ-recipe] command=' printf ' %q' "${command[@]}" printf '\n' } >>"$log" "${command[@]}" >>"$log" 2>&1 & PIDS+=("$!") NAMES+=("$arm")}
launch_arm goalmix05_metric0 0.0launch_arm goalmix05_metric1 1.0
echo "[visual-rsm-occ-recipe] invariants arms=2 pixels_only=true drop_proprio=true frozen_encoder=true flow=true discount_conditioned=true no_td=true actor_goal_fraction=0.5 recursion_composition_inactive_through_step50000=true"if [ "$DRY_RUN" = 1 ]; then echo "[visual-rsm-occ-recipe] dry-run complete no_training=true no_submission=true" exit 0fi
terminate_children() { local pid for pid in "${PIDS[@]}"; do kill -TERM "$pid" 2>/dev/null || true done}trap terminate_children INT TERM
FAILURES=()for index in "${!PIDS[@]}"; do if wait "${PIDS[$index]}"; then echo "[visual-rsm-occ-recipe] complete arm=${NAMES[$index]}" else rc=$? FAILURES+=("${NAMES[$index]}:$rc") echo "[visual-rsm-occ-recipe] failed arm=${NAMES[$index]} rc=$rc" >&2 fidone[ "${#FAILURES[@]}" -eq 0 ] || { printf '[visual-rsm-occ-recipe] failures:' >&2 printf ' %s' "${FAILURES[@]}" >&2 printf '\n' >&2 exit 1}echo "[visual-rsm-occ-recipe] complete arms=2"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147#!/bin/bash# Exact official rollout of the immutable 30k frozen and jointly adapted# compact one-hop checkpoints. Both are strictly pixels-only RSM actors.set -euo pipefail
ROOT=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfreecd "$ROOT"
PREFLIGHT_ONLY=0if [ "${1:-}" = "--preflight-only" ]; then PREFLIGHT_ONLY=1elif [ "$#" -ne 0 ]; then echo "usage: $0 [--preflight-only]" >&2 exit 2fi
PY=${PY:-/proj/inf-scaling/zwhong/projs/gen_q/.ogbench_venv/bin/python}RDEC=ckpt/rdec_fair_px_gpred_gciql_z8_w003_gciqlret_indexd4_diagmetric.npzRDEC_SHA256=9ab338b3940e4c0797b4fc419659d5907f96e745b95a8c57457c85099fdb85a7LOG_ROOT=bsub_out/visual_rsm_onehop_v2/official_step30000mkdir -p "$LOG_ROOT"
actual_reader_sha=$(sha256sum "$RDEC")actual_reader_sha=${actual_reader_sha%% *}[ "$actual_reader_sha" = "$RDEC_SHA256" ] || { echo "[visual-rsm-30k-eval] reader SHA mismatch" >&2 exit 1}
preflight() { local checkpoint=$1 local latent_update=$2 local action_negative=$3 "$PY" - "$checkpoint" "$latent_update" "$action_negative" <<'PY'import pickleimport sys
checkpoint, latent_update, action_negative = sys.argv[1:]with open(checkpoint, "rb") as handle: blob = pickle.load(handle)meta = blob["run_meta"]step = int(blob["carry"][9])expected = { "env": "visual-cube-single-play-v0", "drop_proprio": True, "discount_conditioned": True, "occupancy_model": "flow", "recursion": "off", "uses_td_or_bootstrap": False, "occupancy_uses_reward_labels": False, "occupancy_uses_simulator_coordinates": False, "uses_completion_or_forward_model": False, "occupancy_and_actor_jointly_updated": True, "occ_action_negative": action_negative, "reward_decoder_model": "diag_metric", "reward_decoder_target": "index", "reward_decoder_index_delta": 4,}bad = { key: (meta.get(key), value) for key, value in expected.items() if meta.get(key) != value}actual_latent_update = meta.get("latent_update", "frozen")if actual_latent_update != latent_update: bad["latent_update"] = (actual_latent_update, latent_update)if step != 30_000 or bad: raise SystemExit( f"checkpoint preflight failed: step={step} bad={bad}")print( f"[visual-rsm-30k-eval] verified checkpoint={checkpoint} " f"step={step} latent={latent_update} negative={action_negative}", flush=True,)PY}
launch() { local cell=$1 local latent_update=$2 local action_negative=$3 local checkpoint="ckpt/rsm_fair_visual_rsm_onehop_v2_${cell}_s0_step30000_manual.pkl" local tag="fair_visual_rsm_onehop_v2_${cell}_step30000_official" local diagnostic="ogbench_genq/experiments/visual-cube-single-play-v0/${tag}_distill_audit.json" local log="$LOG_ROOT/${cell}.log" [ -s "$checkpoint" ] || { echo "[visual-rsm-30k-eval] missing checkpoint $checkpoint" >&2 exit 1 } preflight "$checkpoint" "$latent_update" "$action_negative" if [ "$PREFLIGHT_ONLY" = 1 ]; then return fi env \ PY="$PY" \ CKPT="$checkpoint" \ TAG="$tag" \ DIAG_OUT="$diagnostic" \ TRAIN_STEPS=50000 \ LATENT_UPDATE="$latent_update" \ OCC_ACTION_NEGATIVE="$action_negative" \ OCC_ACTION_NEGATIVE_K=2 \ ACTOR_AFTER=0 \ READER_DELTA=4 \ READER_TAG=indexd4_diagmetric \ RDEC="$ROOT/$RDEC" \ RDEC_SAMPLES=16 \ FLOW_STEPS=25 \ OCC_HIDDEN=256 \ OCC_LAYERS=4 \ GAMMA_SAMPLER=stratified_bins \ GAMMA_HORIZONS=2,4,8,16,32,64 \ GAMMA_TASK_FRACTION=0.5 \ XLA_PYTHON_CLIENT_PREALLOCATE=false \ XLA_PYTHON_CLIENT_MEM_FRACTION=0.45 \ WANDB_MODE=disabled \ bash ogbench_genq/experiments/eval_visual_rsm_index_distill.sh \ >"$log" 2>&1 & PIDS+=("$!") NAMES+=("$cell")}
PIDS=()NAMES=()launch frozen_local frozen locallaunch rich_adapter_actor_local rich_adapter actor_local
if [ "$PREFLIGHT_ONLY" = 1 ]; then echo "[visual-rsm-30k-eval] preflight-only complete" exit 0fi
failed=()for index in "${!PIDS[@]}"; do if wait "${PIDS[$index]}"; then echo "[visual-rsm-30k-eval] complete cell=${NAMES[$index]}" else rc=$? failed+=("${NAMES[$index]}:$rc") fidoneif [ "${#failed[@]}" -gt 0 ]; then printf '[visual-rsm-30k-eval] failed:' >&2 printf ' %s' "${failed[@]}" >&2 printf '\n' >&2 exit 1fi123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346#!/bin/bash# Compact visual Recursive Successor Model (RSM) one-hop screen. The four# manifest cells jointly update occupancy and actor in the canonical fused loop.# The fixed recipe is pixels-only, non-TD, discount-conditioned conditional# flow, index-d4 diagonal reader, stratified horizons, and DDPG+BC extraction.## Usage:# bash ogbench_genq/experiments/pack_visual_rsm_onehop_v2.sh [--dry-run]## A dry run validates the complete four-cell manifest and prints every command.# A real run first validates the reward-reader metadata, then packs the four# independently resumable cells as background processes in one GPU allocation.set -uo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
usage() { echo "usage: $0 [--dry-run]" >&2 exit 2}
DRY_RUN=${PACK_DRY_RUN:-0}while [ "$#" -gt 0 ]; do case "$1" in --dry-run) DRY_RUN=1 ;; *) usage ;; esac shiftdonecase "$DRY_RUN" in 0|1) ;; *) echo "[visual-rsm-onehop-v2] PACK_DRY_RUN must be 0 or 1" >&2; exit 2 ;;esac
MANIFEST=${MANIFEST:-ogbench_genq/experiments/visual_rsm_onehop_v2_manifest.tsv}TRAIN_SCRIPT=ogbench_genq/experiments/train_visual_rsm_index_distill.shCF=${CF:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfree}REC=${REC:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion}PY=${PY:-$REC/.ogbench_venv/bin/python}RSM_IMPL=$CF/ogbench_genq/rsm.pyBASE=fair_px_gpred_gciql_z8_w003_gciqlretREADER_DELTA=4READER_TAG=indexd4_diagmetricRDEC=${RDEC:-$CF/ckpt/rdec_${BASE}_${READER_TAG}.npz}RDEC_SHA256=${RDEC_SHA256:-9ab338b3940e4c0797b4fc419659d5907f96e745b95a8c57457c85099fdb85a7}
for required in "$MANIFEST" "$TRAIN_SCRIPT" "$RSM_IMPL"; do [ -r "$required" ] || { echo "[visual-rsm-onehop-v2] missing required file: $required" >&2 exit 1 }done
require_literal() { local literal=$1 local file=$2 grep -Fq -- "$literal" "$file" || { echo "[visual-rsm-onehop-v2] required contract '$literal' absent from $file" >&2 exit 1 }}
# Fail closed if the canonical launcher or implementation no longer encodes the# pixels-only, one-hop, jointly updated, non-TD contract.require_literal '--drop_proprio' "$TRAIN_SCRIPT"require_literal '--occupancy_model flow' "$TRAIN_SCRIPT"require_literal '--recursion off' "$TRAIN_SCRIPT"require_literal '--actor_after "$ACTOR_AFTER"' "$TRAIN_SCRIPT"require_literal 'uses_td_or_bootstrap=False' "$RSM_IMPL"require_literal 'occupancy_and_actor_jointly_updated=bool(' "$RSM_IMPL"require_literal 'q_weight = (step >= actor_after)' "$RSM_IMPL"if grep -Fq -- '--freeze_occupancy' "$TRAIN_SCRIPT"; then echo "[visual-rsm-onehop-v2] canonical launcher unexpectedly freezes occupancy" >&2 exit 1fi
SCREEN_ID=${SCREEN_ID:-fair_visual_rsm_onehop_v2}case "$SCREEN_ID" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-onehop-v2] SCREEN_ID must use only A-Z, a-z, 0-9, dot, underscore, or hyphen" >&2 exit 2 ;;esac
SEED=${SEED:-0}TRAIN_STEPS=${TRAIN_STEPS:-50000}ARCHIVE_EVERY=${ARCHIVE_EVERY:-25000}RDEC_SAMPLES=${RDEC_SAMPLES:-16}AUDIT_ARCHIVES=${AUDIT_ARCHIVES:-1}WANDB_MODE=${WANDB_MODE:-disabled}CELL_MEM_FRACTION=${CELL_MEM_FRACTION:-0.20}CELL_FILTER=${CELL_FILTER:-}LOG_ROOT=${LOG_ROOT:-bsub_out/visual_rsm_onehop_v2/${SCREEN_ID}}
case "$AUDIT_ARCHIVES" in 0|1) ;; *) echo "[visual-rsm-onehop-v2] AUDIT_ARCHIVES must be 0 or 1" >&2; exit 2 ;;esac
validate_reader() { [ -s "$RDEC" ] || { echo "[visual-rsm-onehop-v2] missing diagonal reader: $RDEC" >&2 exit 1 } local actual_sha256 actual_sha256=$(sha256sum "$RDEC") || return $? actual_sha256=${actual_sha256%% *} [ "$actual_sha256" = "$RDEC_SHA256" ] || { echo "[visual-rsm-onehop-v2] reader checksum mismatch: expected=$RDEC_SHA256 actual=$actual_sha256 path=$RDEC" >&2 return 1 } PYTHONPATH="$CF${PYTHONPATH:+:$PYTHONPATH}" "$PY" - "$RDEC" <<'PY' || return $?import sys
from ogbench_genq.genq.reward_reader import load_numpy_reward_reader
_, metadata = load_numpy_reward_reader(sys.argv[1])expected = { "reader_model": "diag_metric", "target": "index", "index_delta": 4, "pixels_only_latents": True, "frozen_encoder": True, "uses_coordinates_for_training": False, "uses_reward_arrays": False, "uses_td_or_bootstrap": False,}errors = [ f"{key}: expected {value!r}, got {metadata.get(key)!r}" for key, value in expected.items() if metadata.get(key) != value]if errors: raise SystemExit( "[visual-rsm-onehop-v2] reader contract mismatch:\n " + "\n ".join(errors) )print( "[visual-rsm-onehop-v2] reader verified " f"model={metadata['reader_model']} target={metadata['target']} " f"index_delta={metadata['index_delta']} pixels_only=true non_td=true", flush=True,)PY echo "[visual-rsm-onehop-v2] reader sha256=$actual_sha256"}
if [ -s "$RDEC" ]; then validate_reader || exit $?elif [ "$DRY_RUN" = 0 ]; then validate_reader || exit $?else echo "[visual-rsm-onehop-v2] reader preflight deferred in dry-run: $RDEC"fi
is_selected() { local cell=$1 [ -z "$CELL_FILTER" ] && return 0 case ",$CELL_FILTER," in *",$cell,"*) return 0 ;; *) return 1 ;; esac}
declare -A SEEN_ARMS=()declare -A SEEN_TAGS=()declare -A SEEN_CKPTS=()declare -A SEEN_LOGS=()PIDS=()NAMES=()TOTAL=0COUNT=0
launch_cell() { local cell=$1 local latent_update=$2 local action_negative=$3
is_selected "$cell" || return 0
local tag="${SCREEN_ID}_${cell}_s${SEED}" local ckpt="ckpt/rsm_${tag}.pkl" local log="${LOG_ROOT}/${cell}_s${SEED}.log" if [ -n "${SEEN_TAGS[$tag]+x}" ] || [ -n "${SEEN_CKPTS[$ckpt]+x}" ] || [ -n "${SEEN_LOGS[$log]+x}" ]; then echo "[visual-rsm-onehop-v2] duplicate output identity for cell=$cell" >&2 exit 2 fi SEEN_TAGS[$tag]=1 SEEN_CKPTS[$ckpt]=1 SEEN_LOGS[$log]=1 COUNT=$((COUNT + 1))
local cmd=( env "TAG=$tag" "CKPT=$ckpt" "PY=$PY" "SEED=$SEED" "TRAIN_STEPS=$TRAIN_STEPS" "ARCHIVE_EVERY=$ARCHIVE_EVERY" "MODE=ddpgbc_distill" "LATENT_UPDATE=$latent_update" "READER_DELTA=$READER_DELTA" "READER_TAG=$READER_TAG" "RDEC=$RDEC" "RDEC_SAMPLES=$RDEC_SAMPLES" "ACTOR_AFTER=0" "ALPHA=1.0" "EXPECTILE=0.9" "DISTILL_ACTOR_GOALS=1" "DISTILL_ACTOR_ACTIONS=1" "DISTILL_ACTOR_ACTION_K=2" "DISTILL_ACTOR_ACTION_SIGMA=0.3" "DISTILL_ACTOR_ACTION_PAIRWISE_WEIGHT=1.0" "FLOW_STEPS=25" "OCC_HIDDEN=256" "OCC_LAYERS=4" "OCC_ACTION_CONTRAST_WEIGHT=0.5" "OCC_ACTION_CONTRAST_MARGIN=0.1" "OCC_ACTION_NEGATIVE=$action_negative" "OCC_ACTION_NEGATIVE_SIGMA=0.3" "OCC_ACTION_NEGATIVE_K=2" "GAMMA_SAMPLER=stratified_bins" "GAMMA_HORIZONS=2,4,8,16,32,64" "GAMMA_LO=0.50" "GAMMA_TASK_FRACTION=0.5" "LATENT_HIDDEN=64" "LATENT_LR=3e-5" "LATENT_GOAL_WEIGHT=0.1" "LATENT_ANCHOR_WEIGHT=0.01" "AUDIT_ARCHIVES=$AUDIT_ARCHIVES" "WANDB_MODE=$WANDB_MODE" "XLA_PYTHON_CLIENT_PREALLOCATE=false" "XLA_PYTHON_CLIENT_MEM_FRACTION=$CELL_MEM_FRACTION" "OMP_NUM_THREADS=2" "OPENBLAS_NUM_THREADS=2" "MKL_NUM_THREADS=2" bash "$TRAIN_SCRIPT" )
printf '[visual-rsm-onehop-v2] cell=%s latent=%s negative=%s tag=%s log=%s\n' \ "$cell" "$latent_update" "$action_negative" "$tag" "$log" if [ "$DRY_RUN" = 1 ]; then printf '[visual-rsm-onehop-v2] command=' printf ' %q' "${cmd[@]}" printf '\n' return 0 fi
mkdir -p "$(dirname "$log")" "$(dirname "$ckpt")" { printf '\n[visual-rsm-onehop-v2] attempt_utc=%s cell=%s tag=%s\n' \ "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$cell" "$tag" printf '[visual-rsm-onehop-v2] command=' printf ' %q' "${cmd[@]}" printf '\n' } >>"$log" "${cmd[@]}" >>"$log" 2>&1 & PIDS+=("$!") NAMES+=("$cell")}
while IFS=$'\t' read -r cell latent_update action_negative rationale; do [ "$cell" = cell ] && continue [ -n "$cell" ] || continue case "$cell" in *[!A-Za-z0-9._-]*) echo "[visual-rsm-onehop-v2] invalid cell name: $cell" >&2 exit 2 ;; esac case "$latent_update" in frozen|rich_adapter) ;; *) echo "[visual-rsm-onehop-v2] invalid latent_update for $cell" >&2; exit 2 ;; esac case "$action_negative" in local|actor_local) ;; *) echo "[visual-rsm-onehop-v2] invalid action negative for $cell" >&2; exit 2 ;; esac
arm="${latent_update}/${action_negative}" [ -z "${SEEN_ARMS[$arm]+x}" ] || { echo "[visual-rsm-onehop-v2] duplicate arm: $arm" >&2 exit 2 } SEEN_ARMS[$arm]=$cell TOTAL=$((TOTAL + 1)) launch_cell "$cell" "$latent_update" "$action_negative"done <"$MANIFEST"
EXPECTED_ARMS=( frozen/local frozen/actor_local rich_adapter/local rich_adapter/actor_local)[ "$TOTAL" -eq 4 ] || { echo "[visual-rsm-onehop-v2] manifest must contain exactly four arms; found $TOTAL" >&2 exit 2}for arm in "${EXPECTED_ARMS[@]}"; do [ -n "${SEEN_ARMS[$arm]+x}" ] || { echo "[visual-rsm-onehop-v2] manifest missing arm: $arm" >&2 exit 2 }done[ "$COUNT" -gt 0 ] || { echo "[visual-rsm-onehop-v2] CELL_FILTER selected no cells: $CELL_FILTER" >&2 exit 2}
echo "[visual-rsm-onehop-v2] invariants pixels_only=true drop_proprio=true non_td=true occupancy_model=flow recursion=off reader=${READER_TAG} actor_q_start=0 sampler=stratified_bins"if [ "$DRY_RUN" = 1 ]; then echo "[visual-rsm-onehop-v2] dry-run complete cells=$COUNT manifest_arms=$TOTAL" exit 0fi
terminate_children() { local pid for pid in "${PIDS[@]}"; do kill -TERM "$pid" 2>/dev/null || true done}trap terminate_children INT TERM
failures=()for i in "${!PIDS[@]}"; do if wait "${PIDS[$i]}"; then echo "[visual-rsm-onehop-v2] complete cell=${NAMES[$i]}" else rc=$? failures+=("${NAMES[$i]}:$rc") echo "[visual-rsm-onehop-v2] failed cell=${NAMES[$i]} rc=$rc" >&2 fidone
if [ "${#failures[@]}" -gt 0 ]; then printf '[visual-rsm-onehop-v2] failed cells:' >&2 printf ' %s' "${failures[@]}" >&2 printf '\n' >&2 exit 1fiecho "[visual-rsm-onehop-v2] complete cells=$COUNT"1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495#!/bin/bash# Print (but never execute) the four-cell protected-endpoint visual RSM plan.## Cells cross frozen versus jointly trained reward-predictive latent with# lambda_hit in {0, 0.25}. Every cell jointly updates the conditional-flow# occupancy and trainable pixel actor. Recursive composition is deliberately# off: beta is protected as a supervised discount endpoint before composition.set -euo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
if [ "${PACK_DRY_RUN:-1}" != 1 ]; then echo "[visual-rsm-protected] this launcher is dry-run only" >&2 exit 2fiif [ "$#" -gt 1 ] || { [ "$#" -eq 1 ] && [ "$1" != "--dry-run" ]; }; then echo "usage: $0 [--dry-run]" >&2 exit 2fi
TRAIN_SCRIPT=ogbench_genq/experiments/train_visual_rsm_pixel_actor.shRSM_IMPL=ogbench_genq/rsm.pyfor required in "$TRAIN_SCRIPT" "$RSM_IMPL"; do [ -r "$required" ] || { echo "[visual-rsm-protected] missing required file: $required" >&2 exit 1 }donefor literal in \ '--actor_input pixels' \ '--drop_proprio' \ '--occupancy_model flow' \ '--occ_reader_hit_weight "$OCC_READER_HIT_WEIGHT"' \ '--gamma_sampler "$GAMMA_SAMPLER"' \ '--rec_beta "$BETA"' \ '--recursion off'; do rg -Fq -- "$literal" "$TRAIN_SCRIPT" || { echo "[visual-rsm-protected] pixel launcher contract missing: $literal" >&2 exit 1 }done
SCREEN_ID=${SCREEN_ID:-fair_visual_rsm_protected_v1}case "$SCREEN_ID" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-protected] SCREEN_ID contains unsafe characters" >&2 exit 2 ;;esacSEED=${SEED:-0}TRAIN_STEPS=${TRAIN_STEPS:-150000}
print_cell() { local latent_update=$1 local hit_weight=$2 local hit_tag=${hit_weight//./p} local tag="${SCREEN_ID}_${latent_update}_hit${hit_tag}_s${SEED}" local -a command=( env "TAG=$tag" "SEED=$SEED" "TRAIN_STEPS=$TRAIN_STEPS" "LATENT_UPDATE=$latent_update" "ACTOR_AFTER=0" "GAMMA=0.99" "BETA=0.98" "GAMMA_LO=0.50" "GAMMA_SAMPLER=protected_endpoints" "GAMMA_TASK_FRACTION=0.60" "GAMMA_HORIZONS=8,16,32,64" "OCC_ACTOR_GOAL_FRACTION=0.50" "OCC_READER_METRIC_WEIGHT=0.0" "OCC_READER_HIT_WEIGHT=$hit_weight" "READER_TAG=indexd4_diagmetric" "RDEC_SHA256=9ab338b3940e4c0797b4fc419659d5907f96e745b95a8c57457c85099fdb85a7" "OCC_ACTION_NEGATIVE_K=2" "OCC_ACTION_NEGATIVE_SIGMA=0.3" "WANDB_MODE=disabled" bash "$TRAIN_SCRIPT" --dry-run ) printf '[visual-rsm-protected] cell=%s latent_update=%s endpoint_hit_weight=%s command=' \ "$tag" "$latent_update" "$hit_weight" printf ' %q' "${command[@]}" printf '\n'}
print_cell frozen 0.0print_cell frozen 0.25print_cell joint 0.0print_cell joint 0.25
echo "[visual-rsm-protected] invariants cells=4 pixels_only=true proprio=false coordinates=false reward_arrays=false td=false bootstrap=false forward_model=false"echo "[visual-rsm-protected] occupancy_actor_joint_update=true discount_conditioned=true task_gamma_rows=1229 beta_rows=614 aux_rows=205 aux_sqrt_h_rows=28,40,57,80 actor_goal_rows=1024 value_goal_rows=1024"echo "[visual-rsm-protected] dry-run complete no_training=true no_submission=true"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412#!/bin/bash# Fail-closed gated continuation for the fair visual Recursive Successor# Model (RSM) hidden-state recursion sweep.## CELL_FILTER is mandatory. For every explicitly selected manifest cell,# GATE_DIR/<cell>.json must be a passing step-50k hidden-h256 gate bound to an# immutable *_step50000.pkl checkpoint. New state is written to a distinct# continuation checkpoint through step 100k. The default is validation and# command printing only; PACK_DRY_RUN=0 or --execute is required to train.set -euo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
usage() { echo "usage: CELL_FILTER=cell[,cell...] GATE_DIR=/abs/gates $0 [--dry-run|--execute]" >&2 exit 2}
DRY_RUN=${PACK_DRY_RUN:-1}while [ "$#" -gt 0 ]; do case "$1" in --dry-run) DRY_RUN=1 ;; --execute) DRY_RUN=0 ;; *) usage ;; esac shiftdonecase "$DRY_RUN" in 0|1) ;; *) echo "[visual-rsm-rec-cont] PACK_DRY_RUN must be 0 or 1" >&2 exit 2 ;;esac
MANIFEST=${MANIFEST:-ogbench_genq/experiments/visual_rsm_recursion_sweep_manifest.tsv}TRAIN_SCRIPT=ogbench_genq/experiments/train_visual_rsm_occupancy_recursion.shCONTRACT_MODULE=ogbench_genq.genq.visual_recursion_sweep_contractCONTRACT_SOURCE=ogbench_genq/genq/visual_recursion_sweep_contract.pyCF=${CF:-$ROOT}REC=${REC:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion}PY=${PY:-$REC/.ogbench_venv/bin/python}RSM_IMPL=$CF/ogbench_genq/rsm.py
for required in "$MANIFEST" "$TRAIN_SCRIPT" "$CONTRACT_SOURCE" "$RSM_IMPL"; do [ -r "$required" ] || { echo "[visual-rsm-rec-cont] missing required file: $required" >&2 exit 1 }done
require_literal() { local literal=$1 local file=$2 grep -Fq -- "$literal" "$file" || { echo "[visual-rsm-rec-cont] required contract '$literal' absent from $file" >&2 exit 1 }}
require_literal '--resume_ckpt "$RESUME_CKPT"' "$TRAIN_SCRIPT"require_literal '--resume_ckpt_sha256 "$RESUME_CKPT_SHA256"' "$TRAIN_SCRIPT"require_literal '--drop_proprio' "$TRAIN_SCRIPT"require_literal '--latent_update frozen' "$TRAIN_SCRIPT"require_literal '--recursion occupancy' "$TRAIN_SCRIPT"require_literal 'resolve_checkpoint_load(' "$RSM_IMPL"require_literal 'compose = (step > rec_after)' "$RSM_IMPL"require_literal 'REC_EVERY = 1' "$RSM_IMPL"
PYTHONPATH="$ROOT${PYTHONPATH:+:$PYTHONPATH}" \ "$PY" -m "$CONTRACT_MODULE" manifest "$MANIFEST" >/dev/null
CELL_FILTER=${CELL_FILTER:-}[ -n "$CELL_FILTER" ] || { echo "[visual-rsm-rec-cont] CELL_FILTER is required; no cell is selected implicitly" >&2 exit 2}case "$CELL_FILTER" in ,*|*,|*,,*) echo "[visual-rsm-rec-cont] CELL_FILTER contains an empty cell name" >&2 exit 2 ;;esac
declare -A REQUESTED=()IFS=',' read -r -a REQUESTED_NAMES <<<"$CELL_FILTER"for requested in "${REQUESTED_NAMES[@]}"; do case "$requested" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-rec-cont] unsafe CELL_FILTER entry: $requested" >&2 exit 2 ;; esac [ -z "${REQUESTED[$requested]+x}" ] || { echo "[visual-rsm-rec-cont] duplicate CELL_FILTER entry: $requested" >&2 exit 2 } REQUESTED[$requested]=1done
GATE_DIR=${GATE_DIR:-}[ -n "$GATE_DIR" ] && [ -d "$GATE_DIR" ] || { echo "[visual-rsm-rec-cont] GATE_DIR must name a directory containing <cell>.json gates" >&2 exit 2}GATE_DIR=$(cd "$GATE_DIR" && pwd)
CALIBRATION_STEPS=50000TRAIN_STEPS=${TRAIN_STEPS:-100000}[ "$TRAIN_STEPS" = 100000 ] || { echo "[visual-rsm-rec-cont] continuation endpoint is fixed at TRAIN_STEPS=100000" >&2 exit 2}ARCHIVE_EVERY=${ARCHIVE_EVERY:-25000}[ "$ARCHIVE_EVERY" = 25000 ] || { echo "[visual-rsm-rec-cont] ARCHIVE_EVERY is fixed at 25000" >&2 exit 2}
SCREEN_ID=${SCREEN_ID:-fair_visual_rsm_hidden_gated_cont50k_to100k_v1}case "$SCREEN_ID" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-rec-cont] SCREEN_ID contains unsafe characters" >&2 exit 2 ;;esac
RDEC_SAMPLES=${RDEC_SAMPLES:-16}WANDB_MODE=${WANDB_MODE:-disabled}CELL_MEM_FRACTION=${CELL_MEM_FRACTION:-0.14}CKPT_ROOT=${CKPT_ROOT:-ckpt}LOG_ROOT=${LOG_ROOT:-bsub_out/visual_rsm_recursion_continuation/${SCREEN_ID}}
declare -A FOUND=()declare -A SEEN_TAGS=()declare -A SEEN_CKPTS=()declare -A SEEN_LOGS=()PIDS=()NAMES=()TOTAL=0COUNT=0
launch_cell() { local cell=$1 local composition=$2 local gamma=$3 local beta=$4 local depth=$5 local beta_mass=$6 local gamma_horizons=$7 local rec_after=$8
[ -n "${REQUESTED[$cell]+x}" ] || return 0 FOUND[$cell]=1
local gate_candidate="$GATE_DIR/$cell.json" local validation_output validation_output=$( PYTHONPATH="$ROOT${PYTHONPATH:+:$PYTHONPATH}" \ "$PY" -m "$CONTRACT_MODULE" continuation \ --manifest "$MANIFEST" --cell "$cell" --gate "$gate_candidate" ) || { echo "[visual-rsm-rec-cont] gate validation failed for cell=$cell" >&2 exit 1 } local -a validated mapfile -t validated <<<"$validation_output" local -a expected_keys=( continuation_gate_pass cell gate_path gate_sha256 source_checkpoint source_checkpoint_sha256 source_checkpoint_step source_seed reader_path reader_sha256 ) [ "${#validated[@]}" -eq "${#expected_keys[@]}" ] || { echo "[visual-rsm-rec-cont] malformed validator output for cell=$cell" >&2 exit 1 } local index key for index in "${!expected_keys[@]}"; do key=${validated[$index]%%=*} [ "$key" = "${expected_keys[$index]}" ] || { echo "[visual-rsm-rec-cont] validator field mismatch for cell=$cell: expected=${expected_keys[$index]} actual=$key" >&2 exit 1 } done [ "${validated[0]#*=}" = true ] || { echo "[visual-rsm-rec-cont] continuation gate did not pass for cell=$cell" >&2 exit 1 } [ "${validated[1]#*=}" = "$cell" ] || { echo "[visual-rsm-rec-cont] continuation gate returned the wrong cell" >&2 exit 1 }
local gate_path=${validated[2]#*=} local gate_sha256=${validated[3]#*=} local source_checkpoint=${validated[4]#*=} local source_sha256=${validated[5]#*=} local source_step=${validated[6]#*=} local seed=${validated[7]#*=} local reader_path=${validated[8]#*=} local reader_sha256=${validated[9]#*=} [ "$source_step" = "$CALIBRATION_STEPS" ] || { echo "[visual-rsm-rec-cont] validator returned source_step=$source_step for cell=$cell" >&2 exit 1 }
if [ -f "$reader_path" ]; then local actual_reader_sha256 actual_reader_sha256=$(sha256sum "$reader_path") actual_reader_sha256=${actual_reader_sha256%% *} [ "$actual_reader_sha256" = "$reader_sha256" ] || { echo "[visual-rsm-rec-cont] reader checksum drift for cell=$cell path=$reader_path" >&2 exit 1 } elif [ "$DRY_RUN" = 0 ]; then echo "[visual-rsm-rec-cont] gated reader is missing for cell=$cell path=$reader_path" >&2 exit 1 else echo "[visual-rsm-rec-cont] reader artifact preflight deferred in dry-run: $reader_path" fi
local first_composed_update case "$composition" in on) [ "$rec_after" = "$CALIBRATION_STEPS" ] || { echo "[visual-rsm-rec-cont] enabled cell=$cell must use rec_after=$CALIBRATION_STEPS" >&2 exit 2 } first_composed_update=$((CALIBRATION_STEPS + 1)) ;; off) [ "$rec_after" = 1000000000 ] || { echo "[visual-rsm-rec-cont] control cell=$cell must keep composition unreachable" >&2 exit 2 } first_composed_update=none_through_step100000 ;; *) echo "[visual-rsm-rec-cont] invalid composition mode for cell=$cell" >&2 exit 2 ;; esac
local tag="${SCREEN_ID}_${cell}_source${CALIBRATION_STEPS}_to${TRAIN_STEPS}_s${seed}" local checkpoint="$CKPT_ROOT/rsm_${tag}.pkl" local log="$LOG_ROOT/${cell}_source${CALIBRATION_STEPS}_to${TRAIN_STEPS}_s${seed}.log" local source_real destination_real source_real=$(realpath "$source_checkpoint") destination_real=$(realpath -m "$checkpoint") [ "$source_real" != "$destination_real" ] || { echo "[visual-rsm-rec-cont] source and destination collide for cell=$cell" >&2 exit 2 } if [ -n "${SEEN_TAGS[$tag]+x}" ] || [ -n "${SEEN_CKPTS[$destination_real]+x}" ] || [ -n "${SEEN_LOGS[$log]+x}" ]; then echo "[visual-rsm-rec-cont] duplicate continuation output identity for cell=$cell" >&2 exit 2 fi SEEN_TAGS[$tag]=1 SEEN_CKPTS[$destination_real]=1 SEEN_LOGS[$log]=1 COUNT=$((COUNT + 1))
local -a cmd=( env "CF=$CF" "TAG=$tag" "CKPT=$checkpoint" "RESUME_CKPT=$source_checkpoint" "RESUME_CKPT_SHA256=$source_sha256" "PY=$PY" "SEED=$seed" "TRAIN_STEPS=$TRAIN_STEPS" "ARCHIVE_EVERY=$ARCHIVE_EVERY" "MODE=ddpgbc_distill" "REC_STATE=hidden" "READER_DELTA=4" "READER_TAG=indexd4_diagmetric" "RDEC=$reader_path" "RDEC_SHA256=$reader_sha256" "RDEC_SAMPLES=$RDEC_SAMPLES" "ACTOR_AFTER=0" "ALPHA=1.0" "EXPECTILE=0.9" "DISTILL_ACTOR_GOALS=1" "DISTILL_ACTOR_ACTIONS=1" "DISTILL_ACTOR_ACTION_K=2" "DISTILL_ACTOR_ACTION_SIGMA=0.3" "DISTILL_ACTOR_ACTION_PAIRWISE_WEIGHT=1.0" "FLOW_STEPS=25" "OCC_HIDDEN=512" "OCC_LAYERS=4" "OCC_ACTION_CONTRAST_WEIGHT=0.5" "OCC_ACTION_CONTRAST_MARGIN=0.1" "OCC_ACTION_NEGATIVE=actor_local" "OCC_ACTION_NEGATIVE_SIGMA=0.3" "OCC_ACTION_NEGATIVE_K=2" "GAMMA=$gamma" "BETA=$beta" "REC_DEPTH=$depth" "REC_AFTER=$rec_after" "REC_GUARD=ema" "BETA_SAMPLE_PROB=$beta_mass" "GAMMA_SAMPLER=stratified_bins" "GAMMA_HORIZONS=$gamma_horizons" "GAMMA_LO=0.50" "GAMMA_TASK_FRACTION=0.5" "WANDB_MODE=$WANDB_MODE" "XLA_PYTHON_CLIENT_PREALLOCATE=false" "XLA_PYTHON_CLIENT_MEM_FRACTION=$CELL_MEM_FRACTION" "OMP_NUM_THREADS=2" "OPENBLAS_NUM_THREADS=2" "MKL_NUM_THREADS=2" bash "$TRAIN_SCRIPT" )
printf '[visual-rsm-rec-cont] cell=%s composition=%s source_step=%s destination_step=%s first_composed_update=%s tag=%s log=%s\n' \ "$cell" "$composition" "$source_step" "$TRAIN_STEPS" \ "$first_composed_update" "$tag" "$log" printf '[visual-rsm-rec-cont] provenance cell=%s gate_json=%s gate_sha256=%s source_checkpoint=%s source_sha256=%s reader_sha256=%s\n' \ "$cell" "$gate_path" "$gate_sha256" "$source_checkpoint" \ "$source_sha256" "$reader_sha256" if [ "$DRY_RUN" = 1 ]; then printf '[visual-rsm-rec-cont] command=' printf ' %q' "${cmd[@]}" printf '\n' return 0 fi
mkdir -p "$(dirname "$log")" "$(dirname "$checkpoint")" { printf '\n[visual-rsm-rec-cont] attempt_utc=%s cell=%s phase=gated_recursive_continuation source_step=%s destination_step=%s composition=%s first_composed_update=%s\n' \ "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$cell" "$source_step" \ "$TRAIN_STEPS" "$composition" "$first_composed_update" printf '[visual-rsm-rec-cont] gate_json=%s gate_sha256=%s source_checkpoint=%s source_sha256=%s reader_path=%s reader_sha256=%s destination_checkpoint=%s\n' \ "$gate_path" "$gate_sha256" "$source_checkpoint" "$source_sha256" \ "$reader_path" "$reader_sha256" "$checkpoint" printf '[visual-rsm-rec-cont] command=' printf ' %q' "${cmd[@]}" printf '\n' } >>"$log" "${cmd[@]}" >>"$log" 2>&1 & PIDS+=("$!") NAMES+=("$cell")}
while IFS=$'\t' read -r cell composition gamma beta depth continuation \ cap_mass beta_mass gamma_horizons rec_after reader_tag reader_sha256 \ rationale; do [ "$cell" = cell ] && continue [ -n "$cell" ] || continue TOTAL=$((TOTAL + 1)) launch_cell "$cell" "$composition" "$gamma" "$beta" "$depth" \ "$beta_mass" "$gamma_horizons" "$rec_after"done <"$MANIFEST"
[ "$TOTAL" -eq 6 ] || { echo "[visual-rsm-rec-cont] manifest must contain exactly six cells; found $TOTAL" >&2 exit 2}for requested in "${REQUESTED_NAMES[@]}"; do [ -n "${FOUND[$requested]+x}" ] || { echo "[visual-rsm-rec-cont] CELL_FILTER names an unknown manifest cell: $requested" >&2 exit 2 }done[ "$COUNT" -eq "${#REQUESTED_NAMES[@]}" ] || { echo "[visual-rsm-rec-cont] internal selected-cell count mismatch" >&2 exit 2}
echo "[visual-rsm-rec-cont] invariants explicit_cells_only=true all_gates_pass=true immutable_source_step=50000 destination_step=100000 pixels_only=true hidden_future=h256 frozen_encoder=true no_td=true"if [ "$DRY_RUN" = 1 ]; then echo "[visual-rsm-rec-cont] dry-run complete cells=$COUNT no_training=true no_submission=true" exit 0fi
terminate_children() { local pid for pid in "${PIDS[@]}"; do kill -TERM "$pid" 2>/dev/null || true done}trap terminate_children INT TERM
failures=()for index in "${!PIDS[@]}"; do if wait "${PIDS[$index]}"; then echo "[visual-rsm-rec-cont] complete cell=${NAMES[$index]}" else rc=$? failures+=("${NAMES[$index]}:$rc") echo "[visual-rsm-rec-cont] failed cell=${NAMES[$index]} rc=$rc" >&2 fidone
if [ "${#failures[@]}" -gt 0 ]; then printf '[visual-rsm-rec-cont] failed cells:' >&2 printf ' %s' "${failures[@]}" >&2 printf '\n' >&2 exit 1fiecho "[visual-rsm-rec-cont] complete cells=$COUNT"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353#!/bin/bash# Pack the fair visual Recursive Successor Model (RSM) hidden-state one-hop# gamma/beta calibration into one GPU allocation.## Every cell uses a frozen pixels-only latent, explicit discount-conditioned# conditional flow occupancy, index-d4 diagonal reward reader, and the matched# supervised DDPG+BC extractor. Occupancy and actor update in the same fused# step. There is no temporal-difference/bootstrap target, completion model,# proprioception, or simulator coordinate.## Usage:# bash ogbench_genq/experiments/pack_visual_rsm_recursion_sweep.sh [--dry-run]## Every arm is declared with the final occupancy-recursion representation so# it models h256 futures and trains exact beta queries, but training stops at# step 50k and composition activates only when step > rec_after. Thus this# phase contains no recursive targets. Each resulting checkpoint must pass its# own hidden-future gate before a separate continuation may resume it.## Dry-run mode validates the complete manifest and prints every command without# launching training.set -euo pipefail
ROOT=$(cd "$(dirname "$0")/../.." && pwd)cd "$ROOT"
usage() { echo "usage: $0 [--dry-run]" >&2 exit 2}
# The low-level packer is safe by default too. The scheduler wrapper must# explicitly set PACK_DRY_RUN=0 inside its allocated GPU job.DRY_RUN=${PACK_DRY_RUN:-1}while [ "$#" -gt 0 ]; do case "$1" in --dry-run) DRY_RUN=1 ;; *) usage ;; esac shiftdonecase "$DRY_RUN" in 0|1) ;; *) echo "[visual-rsm-rec-sweep] PACK_DRY_RUN must be 0 or 1" >&2; exit 2 ;;esac
MANIFEST=${MANIFEST:-ogbench_genq/experiments/visual_rsm_recursion_sweep_manifest.tsv}TRAIN_SCRIPT=ogbench_genq/experiments/train_visual_rsm_occupancy_recursion.shCONTRACT_MODULE=ogbench_genq.genq.visual_recursion_sweep_contractCONTRACT_SOURCE=ogbench_genq/genq/visual_recursion_sweep_contract.pyCF=${CF:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-coordfree}REC=${REC:-/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/rsm-visual-recursion}PY=${PY:-$REC/.ogbench_venv/bin/python}RSM_IMPL=$CF/ogbench_genq/rsm.pyBASE=fair_px_gpred_gciql_z8_w003_gciqlretREADER_TAG=indexd4_diagmetricRDEC=${RDEC:-$CF/ckpt/rdec_${BASE}_${READER_TAG}.npz}RDEC_SHA256=9ab338b3940e4c0797b4fc419659d5907f96e745b95a8c57457c85099fdb85a7
for required in "$MANIFEST" "$TRAIN_SCRIPT" "$CONTRACT_SOURCE" "$RSM_IMPL"; do [ -r "$required" ] || { echo "[visual-rsm-rec-sweep] missing required file: $required" >&2 exit 1 }done
require_literal() { local literal=$1 local file=$2 grep -Fq -- "$literal" "$file" || { echo "[visual-rsm-rec-sweep] required contract '$literal' absent from $file" >&2 exit 1 }}
# Fail closed if the canonical launcher or implementation no longer encodes# the fair post-one-hop method. These checks complement checkpoint metadata.require_literal '--drop_proprio' "$TRAIN_SCRIPT"require_literal '--latent_update frozen' "$TRAIN_SCRIPT"require_literal '--occupancy_model flow' "$TRAIN_SCRIPT"require_literal '--actor_after "$ACTOR_AFTER"' "$TRAIN_SCRIPT"require_literal '--gamma "$GAMMA"' "$TRAIN_SCRIPT"require_literal '--recursion occupancy' "$TRAIN_SCRIPT"require_literal '--rec_beta "$BETA"' "$TRAIN_SCRIPT"require_literal '--rec_beta_sample_prob "$BETA_SAMPLE_PROB"' "$TRAIN_SCRIPT"require_literal '--rec_max_depth "$REC_DEPTH"' "$TRAIN_SCRIPT"require_literal 'uses_td_or_bootstrap=False' "$RSM_IMPL"require_literal 'occupancy_and_actor_jointly_updated=bool(' "$RSM_IMPL"require_literal 'q_weight = (step >= actor_after)' "$RSM_IMPL"if grep -Fq -- '--freeze_occupancy' "$TRAIN_SCRIPT"; then echo "[visual-rsm-rec-sweep] canonical launcher unexpectedly freezes occupancy" >&2 exit 1fi
PYTHONPATH="$ROOT${PYTHONPATH:+:$PYTHONPATH}" \ "$PY" -m "$CONTRACT_MODULE" manifest "$MANIFEST" || exit $?
validate_reader() { [ -s "$RDEC" ] || { echo "[visual-rsm-rec-sweep] missing diagonal reader: $RDEC" >&2 return 1 } local actual_sha256 actual_sha256=$(sha256sum "$RDEC") || return $? actual_sha256=${actual_sha256%% *} [ "$actual_sha256" = "$RDEC_SHA256" ] || { echo "[visual-rsm-rec-sweep] reader checksum mismatch: expected=$RDEC_SHA256 actual=$actual_sha256 path=$RDEC" >&2 return 1 } PYTHONPATH="$CF${PYTHONPATH:+:$PYTHONPATH}" "$PY" - "$RDEC" <<'PY' || return $?import sys
from ogbench_genq.genq.reward_reader import load_numpy_reward_reader
_, metadata = load_numpy_reward_reader(sys.argv[1])expected = { "reader_model": "diag_metric", "target": "index", "index_delta": 4, "pixels_only_latents": True, "frozen_encoder": True, "uses_coordinates_for_training": False, "uses_reward_arrays": False, "uses_td_or_bootstrap": False,}errors = [ f"{key}: expected {value!r}, got {metadata.get(key)!r}" for key, value in expected.items() if metadata.get(key) != value]if errors: raise SystemExit( "[visual-rsm-rec-sweep] reader contract mismatch:\n " + "\n ".join(errors) )print( "[visual-rsm-rec-sweep] reader verified " "model=diag_metric target=index index_delta=4 " "pixels_only=true non_td=true", flush=True,)PY echo "[visual-rsm-rec-sweep] reader sha256=$actual_sha256"}
if [ -s "$RDEC" ]; then validate_reader || exit $?elif [ "$DRY_RUN" = 0 ]; then validate_reader || exit $?else echo "[visual-rsm-rec-sweep] reader preflight deferred in dry-run: $RDEC"fi
SCREEN_ID=${SCREEN_ID:-fair_visual_rsm_hidden_onehop_gb_calib_v1}case "$SCREEN_ID" in *[!A-Za-z0-9._-]*|'') echo "[visual-rsm-rec-sweep] SCREEN_ID contains unsafe characters" >&2 exit 2 ;;esac
SEED=${SEED:-0}TRAIN_STEPS=${TRAIN_STEPS:-50000}ARCHIVE_EVERY=${ARCHIVE_EVERY:-25000}RDEC_SAMPLES=${RDEC_SAMPLES:-16}WANDB_MODE=${WANDB_MODE:-disabled}CELL_MEM_FRACTION=${CELL_MEM_FRACTION:-0.14}CELL_FILTER=${CELL_FILTER:-}LOG_ROOT=${LOG_ROOT:-bsub_out/visual_rsm_recursion_sweep/${SCREEN_ID}}
[ "$TRAIN_STEPS" = 50000 ] || { echo "[visual-rsm-rec-sweep] calibration is fixed at TRAIN_STEPS=50000; recursive continuation has a separate gated phase" >&2 exit 2}
is_selected() { local cell=$1 [ -z "$CELL_FILTER" ] && return 0 case ",$CELL_FILTER," in *",$cell,"*) return 0 ;; *) return 1 ;; esac}
declare -A SEEN_TAGS=()declare -A SEEN_CKPTS=()declare -A SEEN_LOGS=()PIDS=()NAMES=()TOTAL=0COUNT=0
launch_cell() { local cell=$1 local composition=$2 local gamma=$3 local beta=$4 local depth=$5 local beta_mass=$6 local gamma_horizons=$7 local rec_after=$8
is_selected "$cell" || return 0 [ "$rec_after" -ge "$TRAIN_STEPS" ] || { echo "[visual-rsm-rec-sweep] refusing $cell: rec_after=$rec_after would compose before the one-hop gate at step $TRAIN_STEPS" >&2 exit 2 }
local tag="${SCREEN_ID}_${cell}_s${SEED}" local ckpt="ckpt/rsm_${tag}.pkl" local log="${LOG_ROOT}/${cell}_s${SEED}.log" if [ -n "${SEEN_TAGS[$tag]+x}" ] || [ -n "${SEEN_CKPTS[$ckpt]+x}" ] || [ -n "${SEEN_LOGS[$log]+x}" ]; then echo "[visual-rsm-rec-sweep] duplicate output identity for cell=$cell" >&2 exit 2 fi SEEN_TAGS[$tag]=1 SEEN_CKPTS[$ckpt]=1 SEEN_LOGS[$log]=1 COUNT=$((COUNT + 1))
local cmd=( env "TAG=$tag" "CKPT=$ckpt" "PY=$PY" "SEED=$SEED" "TRAIN_STEPS=$TRAIN_STEPS" "ARCHIVE_EVERY=$ARCHIVE_EVERY" "MODE=ddpgbc_distill" "REC_STATE=hidden" "READER_DELTA=4" "READER_TAG=$READER_TAG" "RDEC=$RDEC" "RDEC_SAMPLES=$RDEC_SAMPLES" "ACTOR_AFTER=0" "ALPHA=1.0" "EXPECTILE=0.9" "DISTILL_ACTOR_GOALS=1" "DISTILL_ACTOR_ACTIONS=1" "DISTILL_ACTOR_ACTION_K=2" "DISTILL_ACTOR_ACTION_SIGMA=0.3" "DISTILL_ACTOR_ACTION_PAIRWISE_WEIGHT=1.0" "FLOW_STEPS=25" "OCC_HIDDEN=512" "OCC_LAYERS=4" "OCC_ACTION_CONTRAST_WEIGHT=0.5" "OCC_ACTION_CONTRAST_MARGIN=0.1" "OCC_ACTION_NEGATIVE=actor_local" "OCC_ACTION_NEGATIVE_SIGMA=0.3" "OCC_ACTION_NEGATIVE_K=2" "GAMMA=$gamma" "BETA=$beta" "REC_DEPTH=$depth" "REC_AFTER=$rec_after" "REC_GUARD=ema" "BETA_SAMPLE_PROB=$beta_mass" "GAMMA_SAMPLER=stratified_bins" "GAMMA_HORIZONS=$gamma_horizons" "GAMMA_LO=0.50" "GAMMA_TASK_FRACTION=0.5" "WANDB_MODE=$WANDB_MODE" "XLA_PYTHON_CLIENT_PREALLOCATE=false" "XLA_PYTHON_CLIENT_MEM_FRACTION=$CELL_MEM_FRACTION" "OMP_NUM_THREADS=2" "OPENBLAS_NUM_THREADS=2" "MKL_NUM_THREADS=2" bash "$TRAIN_SCRIPT" )
printf '[visual-rsm-rec-sweep] cell=%s composition=%s gamma=%s beta=%s depth=%s beta_mass=%s rec_after=%s tag=%s log=%s\n' \ "$cell" "$composition" "$gamma" "$beta" "$depth" "$beta_mass" \ "$rec_after" "$tag" "$log" if [ "$DRY_RUN" = 1 ]; then printf '[visual-rsm-rec-sweep] command=' printf ' %q' "${cmd[@]}" printf '\n' return 0 fi
mkdir -p "$(dirname "$log")" "$(dirname "$ckpt")" { printf '\n[visual-rsm-rec-sweep] attempt_utc=%s cell=%s tag=%s phase=hidden_onehop_calibration composition_inactive=true\n' \ "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$cell" "$tag" printf '[visual-rsm-rec-sweep] command=' printf ' %q' "${cmd[@]}" printf '\n' } >>"$log" "${cmd[@]}" >>"$log" 2>&1 & PIDS+=("$!") NAMES+=("$cell")}
while IFS=$'\t' read -r cell composition gamma beta depth continuation \ cap_mass beta_mass gamma_horizons rec_after reader_tag reader_sha256 \ rationale; do [ "$cell" = cell ] && continue [ -n "$cell" ] || continue TOTAL=$((TOTAL + 1)) [ "$reader_tag" = "$READER_TAG" ] || { echo "[visual-rsm-rec-sweep] reader tag drift in $cell" >&2 exit 2 } [ "$reader_sha256" = "$RDEC_SHA256" ] || { echo "[visual-rsm-rec-sweep] reader SHA drift in $cell" >&2 exit 2 } launch_cell "$cell" "$composition" "$gamma" "$beta" "$depth" \ "$beta_mass" "$gamma_horizons" "$rec_after"done <"$MANIFEST"
[ "$TOTAL" -eq 6 ] || { echo "[visual-rsm-rec-sweep] manifest must contain exactly six cells; found $TOTAL" >&2 exit 2}[ "$COUNT" -gt 0 ] || { echo "[visual-rsm-rec-sweep] CELL_FILTER selected no cells: $CELL_FILTER" >&2 exit 2}
echo "[visual-rsm-rec-sweep] invariants pixels_only=true drop_proprio=true latent_update=frozen non_td=true discount_conditioned=true occupancy_model=flow occupancy_actor_joint_update=true actor_q_start=0 reader=indexd4_diagmetric hidden_future=true composition_inactive_through_step=50000"if [ "$DRY_RUN" = 1 ]; then echo "[visual-rsm-rec-sweep] dry-run complete cells=$COUNT manifest_cells=$TOTAL" exit 0fi
terminate_children() { local pid for pid in "${PIDS[@]}"; do kill -TERM "$pid" 2>/dev/null || true done}trap terminate_children INT TERM
failures=()for i in "${!PIDS[@]}"; do if wait "${PIDS[$i]}"; then echo "[visual-rsm-rec-sweep] complete cell=${NAMES[$i]}" else rc=$? failures+=("${NAMES[$i]}:$rc") echo "[visual-rsm-rec-sweep] failed cell=${NAMES[$i]} rc=$rc" >&2 fidone
if [ "${#failures[@]}" -gt 0 ]; then printf '[visual-rsm-rec-sweep] failed cells:' >&2 printf ' %s' "${failures[@]}" >&2 printf '\n' >&2 exit 1fiecho "[visual-rsm-rec-sweep] complete cells=$COUNT"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195{ "method": "rsm", "readout": "elbo", "env": "pointmaze-giant-navigate-v0", "seed": 0, "alpha": 0.03, "gamma": 0.995, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.512, "best_sr": 0.52, "final_last_step": 0.064, "final_best_ckpt": 0.512, "best_ckpt_periodic_sr": 0.52, "per_task": [ 0.92, 1.0, 0.0, 0.64, 0.0 ], "curve": [ [ 25000, 0.0 ], [ 50000, 0.2 ], [ 75000, 0.52 ], [ 100000, 0.0 ], [ 125000, 0.0 ], [ 150000, 0.0 ], [ 175000, 0.0 ], [ 200000, 0.0 ], [ 225000, 0.04 ], [ 250000, 0.0 ], [ 275000, 0.0 ], [ 300000, 0.0 ], [ 325000, 0.0 ], [ 350000, 0.08 ], [ 375000, 0.24 ], [ 400000, 0.0 ], [ 425000, 0.10666666666666666 ], [ 450000, 0.12 ], [ 475000, 0.026666666666666665 ], [ 500000, 0.22666666666666666 ], [ 525000, 0.12 ], [ 550000, 0.14666666666666667 ], [ 575000, 0.026666666666666665 ], [ 600000, 0.013333333333333332 ], [ 625000, 0.0 ], [ 650000, 0.013333333333333332 ], [ 675000, 0.0 ], [ 700000, 0.0 ], [ 725000, 0.0 ], [ 750000, 0.0 ], [ 775000, 0.0 ], [ 800000, 0.0 ], [ 825000, 0.04 ], [ 850000, 0.0 ], [ 875000, 0.013333333333333332 ], [ 900000, 0.013333333333333332 ], [ 925000, 0.0 ], [ 950000, 0.0 ], [ 975000, 0.08 ], [ 1000000, 0.05333333333333333 ], [ 1000000, 0.064 ] ], "train_steps": 1000000, "wall_clock_sec": 23713.0, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/6eygxwet"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194{ "method": "rsm", "readout": "elbo", "env": "pointmaze-large-navigate-v0", "seed": 0, "alpha": 0.03, "recursion": "prob", "rec_after": 100000, "rec_beta": 0.98, "rec_guard": "tails", "gamma_spectrum_lo": 0.95, "latent": false, "success_rate": 0.33599999999999997, "best_sr": 0.4, "final_last_step": 0.2, "final_best_ckpt": 0.33599999999999997, "best_ckpt_periodic_sr": 0.4, "per_task": [ 0.7, 0.0, 0.98, 0.0, 0.0 ], "curve": [ [ 25000, 0.2 ], [ 50000, 0.30666666666666664 ], [ 75000, 0.3466666666666667 ], [ 100000, 0.27999999999999997 ], [ 125000, 0.21333333333333332 ], [ 150000, 0.2 ], [ 175000, 0.2 ], [ 200000, 0.17333333333333334 ], [ 225000, 0.2 ], [ 250000, 0.21333333333333332 ], [ 275000, 0.4 ], [ 300000, 0.04 ], [ 325000, 0.16 ], [ 350000, 0.0 ], [ 375000, 0.2 ], [ 400000, 0.2 ], [ 425000, 0.18666666666666668 ], [ 450000, 0.22666666666666666 ], [ 475000, 0.22666666666666666 ], [ 500000, 0.22666666666666666 ], [ 525000, 0.2 ], [ 550000, 0.26666666666666666 ], [ 575000, 0.4 ], [ 600000, 0.08 ], [ 625000, 0.4 ], [ 650000, 0.12 ], [ 675000, 0.29333333333333333 ], [ 700000, 0.3466666666666667 ], [ 725000, 0.06666666666666667 ], [ 750000, 0.4 ], [ 775000, 0.4 ], [ 800000, 0.4 ], [ 825000, 0.2 ], [ 850000, 0.14666666666666667 ], [ 875000, 0.026666666666666665 ], [ 900000, 0.04 ], [ 925000, 0.09333333333333334 ], [ 950000, 0.27999999999999997 ], [ 975000, 0.29333333333333333 ], [ 1000000, 0.2 ], [ 1000000, 0.2 ] ], "train_steps": 1000000, "wall_clock_sec": 124911.7, "wandb_url": "https://wandb.ai/improbableai_zwh/gen-q-policy-improvement/runs/6aui5pg4"}.gitattributes+1
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/rsm_a1_g995.jsonAdded+32
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/rsm_a3_g99.jsonAdded+32
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/rsm_a3_g995.jsonAdded+32
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/snapshots_ei25k/rsm_a1_g995.jsonAdded+32
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/snapshots_ei25k/rsm_a3_g99.jsonAdded+32
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/0/snapshots_ei25k/rsm_a3_g995.jsonAdded+32
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gcbc.jsonAdded+47
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql.jsonAdded+66
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq.jsonAdded+55
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b09.jsonAdded+59
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b09.json.doneAdded
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b095.jsonAdded+59
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/1/gciql_genq_rec_b095.json.doneAdded
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gcbc.jsonAdded+47
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql.jsonAdded+66
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq.jsonAdded+55
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b09.jsonAdded+59
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b09.json.doneAdded
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b095.jsonAdded+59
gen_q_rsm/ogbench_genq/experiments/humanoidmaze-medium-navigate-v0/results/2/gciql_genq_rec_b095.json.doneAdded
gen_q_rsm/ogbench_genq/experiments/pack8_ogbench.shAdded+72
gen_q_rsm/ogbench_genq/experiments/pack_combined_pxonly.shAdded+42
gen_q_rsm/ogbench_genq/experiments/pack_eval_visual_rsm_empirical_20k.shAdded+86
gen_q_rsm/ogbench_genq/experiments/pack_fair_px_awr.shAdded+106
gen_q_rsm/ogbench_genq/experiments/pack_gate_visual_rsm_gamma_beta.shAdded+73
gen_q_rsm/ogbench_genq/experiments/pack_goalcls_e2e.shAdded+44
gen_q_rsm/ogbench_genq/experiments/pack_goalclsbin_e2e.shAdded+44
gen_q_rsm/ogbench_genq/experiments/pack_goalpred_fair_px_awr.shAdded+100
gen_q_rsm/ogbench_genq/experiments/pack_qfilter_fast.shAdded+41
gen_q_rsm/ogbench_genq/experiments/pack_qfilter_recon.shAdded+49
gen_q_rsm/ogbench_genq/experiments/pack_rdec_e2e.shAdded+35
gen_q_rsm/ogbench_genq/experiments/pack_smooth_e2e.shAdded+60
gen_q_rsm/ogbench_genq/experiments/pack_smooth_enc.shAdded+41
gen_q_rsm/ogbench_genq/experiments/pack_valrew_enc.shAdded+49
gen_q_rsm/ogbench_genq/experiments/pack_valrew_rsm.shAdded+67
gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_coordfree.shAdded+38
gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_recononly.shAdded+61
gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_recononly_cal.shAdded+36
gen_q_rsm/ogbench_genq/experiments/pack_visual_cube_recursion.shAdded+94
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_fair_training.shAdded+298
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_occupancy_recipe_ablation.shAdded+222
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_onehop_30k_eval.shAdded+147
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_onehop_v2.shAdded+346
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_protected_endpoint_ablation.shAdded+95
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_recursion_continuation.shAdded+412
gen_q_rsm/ogbench_genq/experiments/pack_visual_rsm_recursion_sweep.shAdded+353
gen_q_rsm/ogbench_genq/experiments/pointmaze-giant-navigate-v0/results/0/rsm_newcov_g995.jsonAdded+195
gen_q_rsm/ogbench_genq/experiments/pointmaze-large-navigate-v0/results/0/rsm_s1.jsonAdded+194
gen_q_rsm/ogbench_genq/experiments/pointmaze-medium-navigate-v0/figures/suc.pngAdded
