diff --git a/.gitattributes b/.gitattributes index 3ea9cbaa913ad06beca671d5ce9965eb851a70dc..881eb71f404e5a117d2d06d2084919a953ebd2fa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -72,3 +72,177 @@ gen_q_rsm/preliminary_analysis/experiments/antmaze_large_navigate_v0/figures/ill gen_q_rsm/preliminary_analysis/experiments/antmaze_medium_navigate_v0/figures/illustration.gif filter=lfs diff=lfs merge=lfs -text gen_q_rsm/preliminary_analysis/experiments/pointmaze_large_navigate_v0/figures/illustration.gif filter=lfs diff=lfs merge=lfs -text gen_q_rsm/preliminary_analysis/experiments/pointmaze_medium_navigate_v0/figures/illustration.gif filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_libero/notes/action_contrast.pdf filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.pdf filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_expert_suboptimal.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_mgen.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_play.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_suboptimal.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_sub_20100.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_expert_play.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_mgen.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play_tipping.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_suboptimal.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_expert_suboptimal.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_mgen.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_play.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_suboptimal.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_sub_20100.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_expert_play.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_mgen.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play_tipping.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_suboptimal.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_proposal_curves.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_combo.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_global.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_combo.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_global.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_combo.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_combo.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_combo.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/pour_strip_ep148.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_subopt.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_success.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_timelines.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_wrist_start.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_wrist_start.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_global_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_global_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_global_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_global_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_wrist_start.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_wrist_arrival.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_global.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_wrist.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_grid_global.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_combo.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_grid.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_A.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_B.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_C3.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_v0lit.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16_split256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16_split2b256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_r256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_foldsame.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_foldsame.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_foldsame.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_foldsame.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_foldsame.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_foldsame.png filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/real_proposal_report.pdf filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/real_reward_study.pdf filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.pdf filter=lfs diff=lfs merge=lfs -text +gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_tables_latest.pdf filter=lfs diff=lfs merge=lfs -text diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/figures/mse.png b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/figures/mse.png new file mode 100644 index 0000000000000000000000000000000000000000..c6baf9f8ccdc6adbb2f9e20c90d0417e6ec7fe9d Binary files /dev/null and b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/figures/mse.png differ diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..c0bb33988494c8c0d171b627c5492483e0269354 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/genq.json @@ -0,0 +1,122 @@ +{ + "method": "genq_reward_latent", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 0, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 1.023522973060608, + 0.19105927646160126, + 0.1606016755104065, + 0.18757879734039307, + 0.18000784516334534, + 0.13725411891937256, + 0.14592890441417694, + 0.14458250999450684, + 0.13206292688846588, + 0.13802334666252136, + 0.1301162838935852, + 0.16003751754760742, + 0.1559370756149292, + 0.13223066926002502, + 0.15051677823066711, + 0.12414824962615967, + 0.14838171005249023, + 0.1357429176568985, + 0.12985064089298248, + 0.13411641120910645, + 0.13461871445178986, + 0.1175081878900528, + 0.15497374534606934, + 0.1391388177871704, + 0.12791691720485687, + 0.14376839995384216, + 0.12200479209423065, + 0.1354222595691681, + 0.12789097428321838, + 0.1462569534778595, + 0.11730469018220901, + 0.13860100507736206, + 0.12506838142871857, + 0.14251679182052612, + 0.15122273564338684, + 0.12967534363269806, + 0.11680444329977036, + 0.13652893900871277, + 0.11743645370006561, + 0.12052425742149353, + 0.12437745928764343, + 0.13077199459075928, + 0.11803334951400757, + 0.14000144600868225, + 0.12209025770425797, + 0.13256481289863586, + 0.11510388553142548, + 0.11319650709629059, + 0.13896140456199646, + 0.13421301543712616, + 0.1303102672100067 + ], + "train/q_mse": [ + 0.02418842547168858 + ], + "latent/reward_mse": 0.0004603317065630108, + "eval/q_mse": 0.02418842547168858, + "eval/q_mae": 0.11661465483356177, + "eval/q_corr": 0.7688938001942438, + "eval/q_spearman": 0.7925993287458046, + "eval/q_mse_by_n": { + "1": 0.10427708295616979, + "2": 0.05951837038308591, + "4": 0.042929799724609516, + "8": 0.03615196083966341, + "16": 0.027244554452114746, + "32": 0.026974146359083698, + "64": 0.02428700414242801, + "128": 0.024489868299928785, + "256": 0.024278866972587534 + }, + "eval/q_corr_by_n": { + "1": 0.4259941946101464, + "2": 0.5729064749947367, + "4": 0.653214372303005, + "8": 0.6969564579575995, + "16": 0.7326162891774732, + "32": 0.7516596854054147, + "64": 0.7608004812015723, + "128": 0.7657684814654997, + "256": 0.7693020782172023 + }, + "eval/q_mse_vs_N": [ + 0.10427708295616979, + 0.05951837038308591, + 0.042929799724609516, + 0.03615196083966341, + 0.027244554452114746, + 0.026974146359083698, + 0.02428700414242801, + 0.024489868299928785, + 0.024278866972587534 + ], + "eval/N_final": 256, + "eval/truth_std": 0.17342706411927783, + "wall_clock_s": 211.27295351028442, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..df7c97c7b224471aef2952713736269e0ce470ba --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/mc.json @@ -0,0 +1,124 @@ +{ + "method": "mc", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 0, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.300428181886673, + 0.02267445996403694, + 0.0215071402490139, + 0.02142311818897724, + 0.028002843260765076, + 0.020109882578253746, + 0.020046889781951904, + 0.02153805084526539, + 0.018007999286055565, + 0.01716446503996849, + 0.01681779883801937, + 0.017358364537358284, + 0.02150731161236763, + 0.018860554322600365, + 0.020630372688174248, + 0.01959878019988537, + 0.018222834914922714, + 0.017338993027806282, + 0.01767083629965782, + 0.01721610687673092, + 0.016842637211084366, + 0.01914386823773384, + 0.015379784628748894, + 0.01741034723818302, + 0.018324950709939003, + 0.015394306741654873, + 0.01669416017830372, + 0.01766800507903099, + 0.01653364673256874, + 0.015180330723524094, + 0.015547486953437328, + 0.013367079198360443, + 0.015776604413986206, + 0.015588213689625263, + 0.014996509999036789, + 0.015366061590611935, + 0.01568116620182991, + 0.015002715401351452, + 0.016817599534988403, + 0.018457632511854172, + 0.013548828661441803, + 0.015665411949157715, + 0.013671178370714188, + 0.016047248616814613, + 0.01627308875322342, + 0.013607887551188469, + 0.017151955515146255, + 0.015409056097269058, + 0.01558898389339447, + 0.012062326073646545, + 0.015025422908365726 + ], + "train/q_mse": [ + 0.300428181886673, + 0.02267445996403694, + 0.0215071402490139, + 0.02142311818897724, + 0.028002843260765076, + 0.020109882578253746, + 0.020046889781951904, + 0.02153805084526539, + 0.018007999286055565, + 0.01716446503996849, + 0.01681779883801937, + 0.017358364537358284, + 0.02150731161236763, + 0.018860554322600365, + 0.020630372688174248, + 0.01959878019988537, + 0.018222834914922714, + 0.017338993027806282, + 0.01767083629965782, + 0.01721610687673092, + 0.016842637211084366, + 0.01914386823773384, + 0.015379784628748894, + 0.01741034723818302, + 0.018324950709939003, + 0.015394306741654873, + 0.01669416017830372, + 0.01766800507903099, + 0.01653364673256874, + 0.015180330723524094, + 0.015547486953437328, + 0.013367079198360443, + 0.015776604413986206, + 0.015588213689625263, + 0.014996509999036789, + 0.015366061590611935, + 0.01568116620182991, + 0.015002715401351452, + 0.016817599534988403, + 0.018457632511854172, + 0.013548828661441803, + 0.015665411949157715, + 0.013671178370714188, + 0.016047248616814613, + 0.01627308875322342, + 0.013607887551188469, + 0.017151955515146255, + 0.015409056097269058, + 0.01558898389339447, + 0.012062326073646545, + 0.015025422908365726 + ], + "eval/q_mse": 0.02082740504568421, + "eval/q_mae": 0.09879234870651768, + "eval/q_corr": 0.8353318666663025, + "eval/q_spearman": 0.8860669754185964, + "eval/truth_std": 0.17342706411927783, + "wall_clock_s": 51.000584840774536, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/td.json new file mode 100644 index 0000000000000000000000000000000000000000..e2b80498e23179541278d42234fde0ee505effa2 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/0/td.json @@ -0,0 +1,124 @@ +{ + "method": "td", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 0, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.12668415904045105, + 1.8332171748625115e-05, + 1.2668673662119545e-05, + 5.6685854360694066e-05, + 2.666049294930417e-05, + 0.00012213226000312716, + 1.2408975635480601e-05, + 7.281507714651525e-05, + 1.4251440006773919e-05, + 2.8672966436715797e-05, + 1.9756591427722014e-05, + 1.800885183911305e-05, + 2.9631743018398993e-05, + 2.119257078447845e-05, + 2.3705892090220004e-05, + 3.014030517078936e-05, + 5.9920595958828926e-05, + 3.7254212656989694e-05, + 0.0001071523511200212, + 5.2011237130500376e-05, + 3.0067789339227602e-05, + 1.841087214415893e-05, + 3.670252408483066e-05, + 3.926284261979163e-05, + 3.8311438402161e-05, + 6.802458665333688e-05, + 7.342189201153815e-05, + 0.0001920453505590558, + 4.1177685488946736e-05, + 4.1980551031883806e-05, + 0.00010299332643626258, + 4.048525806865655e-05, + 0.00014721110346727073, + 4.002904461231083e-05, + 0.00011492889461806044, + 5.7826000556815416e-05, + 5.0739210564643145e-05, + 2.990572465932928e-05, + 6.57828277326189e-05, + 4.4449054257711396e-05, + 9.90485496004112e-05, + 6.106894579716027e-05, + 3.74849587387871e-05, + 4.809353413293138e-05, + 8.4279352449812e-05, + 9.354538633488119e-05, + 3.541153637343086e-05, + 4.724852624349296e-05, + 3.650022699730471e-05, + 6.568254320882261e-05, + 6.494991248473525e-05 + ], + "train/q_mse": [ + 0.12668415904045105, + 1.8332171748625115e-05, + 1.2668673662119545e-05, + 5.6685854360694066e-05, + 2.666049294930417e-05, + 0.00012213226000312716, + 1.2408975635480601e-05, + 7.281507714651525e-05, + 1.4251440006773919e-05, + 2.8672966436715797e-05, + 1.9756591427722014e-05, + 1.800885183911305e-05, + 2.9631743018398993e-05, + 2.119257078447845e-05, + 2.3705892090220004e-05, + 3.014030517078936e-05, + 5.9920595958828926e-05, + 3.7254212656989694e-05, + 0.0001071523511200212, + 5.2011237130500376e-05, + 3.0067789339227602e-05, + 1.841087214415893e-05, + 3.670252408483066e-05, + 3.926284261979163e-05, + 3.8311438402161e-05, + 6.802458665333688e-05, + 7.342189201153815e-05, + 0.0001920453505590558, + 4.1177685488946736e-05, + 4.1980551031883806e-05, + 0.00010299332643626258, + 4.048525806865655e-05, + 0.00014721110346727073, + 4.002904461231083e-05, + 0.00011492889461806044, + 5.7826000556815416e-05, + 5.0739210564643145e-05, + 2.990572465932928e-05, + 6.57828277326189e-05, + 4.4449054257711396e-05, + 9.90485496004112e-05, + 6.106894579716027e-05, + 3.74849587387871e-05, + 4.809353413293138e-05, + 8.4279352449812e-05, + 9.354538633488119e-05, + 3.541153637343086e-05, + 4.724852624349296e-05, + 3.650022699730471e-05, + 6.568254320882261e-05, + 6.494991248473525e-05 + ], + "eval/q_mse": 0.047415442621615254, + "eval/q_mae": 0.17140060018722703, + "eval/q_corr": 0.6945215405391422, + "eval/q_spearman": 0.7104207526297038, + "eval/truth_std": 0.17342706411927783, + "wall_clock_s": 128.8499734401703, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..8bc4794d13feb3ab3817f7dff581c22ed3d8d30e --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/genq.json @@ -0,0 +1,122 @@ +{ + "method": "genq_reward_latent", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 1, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 0.9809990525245667, + 0.17933084070682526, + 0.16511279344558716, + 0.1322927176952362, + 0.1478947550058365, + 0.13946112990379333, + 0.15920886397361755, + 0.14355158805847168, + 0.12853004038333893, + 0.12848305702209473, + 0.1428503841161728, + 0.13594722747802734, + 0.12514980137348175, + 0.12934759259223938, + 0.14530916512012482, + 0.1301221251487732, + 0.13413327932357788, + 0.1347767412662506, + 0.1427159607410431, + 0.13929331302642822, + 0.14646552503108978, + 0.1483486294746399, + 0.15737994015216827, + 0.1122862696647644, + 0.11022555083036423, + 0.10935921221971512, + 0.1225469708442688, + 0.13203954696655273, + 0.13515713810920715, + 0.11667963862419128, + 0.11377006769180298, + 0.13136602938175201, + 0.12783783674240112, + 0.12338382005691528, + 0.12003913521766663, + 0.10868240147829056, + 0.11822055280208588, + 0.12240321189165115, + 0.1288052499294281, + 0.13882607221603394, + 0.124045729637146, + 0.14778918027877808, + 0.12555858492851257, + 0.10658851265907288, + 0.11684204638004303, + 0.11461761593818665, + 0.12805622816085815, + 0.11907884478569031, + 0.1175164133310318, + 0.12526899576187134, + 0.12224960327148438 + ], + "train/q_mse": [ + 0.034146342858883016 + ], + "latent/reward_mse": 0.00025965768145397305, + "eval/q_mse": 0.034146342858883016, + "eval/q_mae": 0.14120046044467233, + "eval/q_corr": 0.841380566438283, + "eval/q_spearman": 0.8576217351358445, + "eval/q_mse_by_n": { + "1": 0.10166398215520857, + "2": 0.06788726373972398, + "4": 0.05383199234810165, + "8": 0.042872705614016536, + "16": 0.04083606126413326, + "32": 0.03533675406431094, + "64": 0.03641804118495191, + "128": 0.03474232110105016, + "256": 0.03467494483447413 + }, + "eval/q_corr_by_n": { + "1": 0.5432091431547831, + "2": 0.6889803738721912, + "4": 0.7474373967836503, + "8": 0.7723009237960272, + "16": 0.8134244967202252, + "32": 0.8309243589671356, + "64": 0.8304903471946687, + "128": 0.8355637822877324, + "256": 0.8395095947416329 + }, + "eval/q_mse_vs_N": [ + 0.10166398215520857, + 0.06788726373972398, + 0.05383199234810165, + 0.042872705614016536, + 0.04083606126413326, + 0.03533675406431094, + 0.03641804118495191, + 0.03474232110105016, + 0.03467494483447413 + ], + "eval/N_final": 256, + "eval/truth_std": 0.16826422062875934, + "wall_clock_s": 190.27805066108704, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..28b7db7944429960278a19e576662a3dfa41ce41 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/mc.json @@ -0,0 +1,124 @@ +{ + "method": "mc", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 1, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.7778210639953613, + 0.02339986339211464, + 0.023852061480283737, + 0.02484820783138275, + 0.020530669018626213, + 0.020015805959701538, + 0.02033216878771782, + 0.020929066464304924, + 0.02100355550646782, + 0.018495939671993256, + 0.016828354448080063, + 0.018103748559951782, + 0.015990406274795532, + 0.015134772285819054, + 0.017066648229956627, + 0.019263707101345062, + 0.01830333098769188, + 0.016004566103219986, + 0.01835515722632408, + 0.018100393936038017, + 0.016789056360721588, + 0.01756531558930874, + 0.017896192148327827, + 0.019197577610611916, + 0.01762261986732483, + 0.01672225259244442, + 0.016293030232191086, + 0.015451420098543167, + 0.01821363903582096, + 0.015113407745957375, + 0.017661530524492264, + 0.017328113317489624, + 0.017640316858887672, + 0.018558043986558914, + 0.015614695847034454, + 0.017359744757413864, + 0.014327095821499825, + 0.019603803753852844, + 0.01634526252746582, + 0.01730777695775032, + 0.015174825675785542, + 0.016079675406217575, + 0.018623583018779755, + 0.016195299103856087, + 0.014258256182074547, + 0.012366688810288906, + 0.012679745443165302, + 0.015978572890162468, + 0.01520790345966816, + 0.013839712366461754, + 0.0132619459182024 + ], + "train/q_mse": [ + 0.7778210639953613, + 0.02339986339211464, + 0.023852061480283737, + 0.02484820783138275, + 0.020530669018626213, + 0.020015805959701538, + 0.02033216878771782, + 0.020929066464304924, + 0.02100355550646782, + 0.018495939671993256, + 0.016828354448080063, + 0.018103748559951782, + 0.015990406274795532, + 0.015134772285819054, + 0.017066648229956627, + 0.019263707101345062, + 0.01830333098769188, + 0.016004566103219986, + 0.01835515722632408, + 0.018100393936038017, + 0.016789056360721588, + 0.01756531558930874, + 0.017896192148327827, + 0.019197577610611916, + 0.01762261986732483, + 0.01672225259244442, + 0.016293030232191086, + 0.015451420098543167, + 0.01821363903582096, + 0.015113407745957375, + 0.017661530524492264, + 0.017328113317489624, + 0.017640316858887672, + 0.018558043986558914, + 0.015614695847034454, + 0.017359744757413864, + 0.014327095821499825, + 0.019603803753852844, + 0.01634526252746582, + 0.01730777695775032, + 0.015174825675785542, + 0.016079675406217575, + 0.018623583018779755, + 0.016195299103856087, + 0.014258256182074547, + 0.012366688810288906, + 0.012679745443165302, + 0.015978572890162468, + 0.01520790345966816, + 0.013839712366461754, + 0.0132619459182024 + ], + "eval/q_mse": 0.02434390918869931, + "eval/q_mae": 0.10471990462915841, + "eval/q_corr": 0.8223561782154234, + "eval/q_spearman": 0.8820593253707835, + "eval/truth_std": 0.16826422062875934, + "wall_clock_s": 82.57715368270874, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/td.json new file mode 100644 index 0000000000000000000000000000000000000000..a8fbc38436c18646650bf31fdcc11dd95423e79b --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/1/td.json @@ -0,0 +1,124 @@ +{ + "method": "td", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 1, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.08922570943832397, + 2.3586251700180583e-05, + 3.551862755557522e-05, + 0.00023087025329004973, + 4.25379621447064e-05, + 3.934617416234687e-05, + 0.00012464394967537373, + 3.5465072869556025e-05, + 1.847404746513348e-05, + 5.548719491343945e-05, + 0.00011864618863910437, + 3.941592149203643e-05, + 5.4817210184410214e-05, + 0.0001261690049432218, + 6.886602204758674e-05, + 4.5921126002212986e-05, + 0.00026340721524320543, + 3.491710958769545e-05, + 6.15324461250566e-05, + 3.6591445677913725e-05, + 4.809158053831197e-05, + 3.477423160802573e-05, + 3.493107942631468e-05, + 8.450048335362226e-05, + 5.450391472550109e-05, + 0.0003894520632456988, + 0.00010916698374785483, + 4.6757017116760835e-05, + 4.382079350762069e-05, + 6.6999280534219e-05, + 4.934016760671511e-05, + 5.072278145235032e-05, + 4.0917060687206686e-05, + 7.26800863048993e-05, + 9.916475391946733e-05, + 5.48424432054162e-05, + 0.00011761068890336901, + 8.198009163606912e-05, + 8.76081467140466e-05, + 5.357425834517926e-05, + 7.92598002590239e-05, + 0.00025363703025504947, + 6.0045160353183746e-05, + 4.806789002032019e-05, + 5.262159538688138e-05, + 5.703686474589631e-05, + 0.0001106592026189901, + 9.103187767323107e-05, + 5.136866093380377e-05, + 0.0001198111058329232, + 5.662136391038075e-05 + ], + "train/q_mse": [ + 0.08922570943832397, + 2.3586251700180583e-05, + 3.551862755557522e-05, + 0.00023087025329004973, + 4.25379621447064e-05, + 3.934617416234687e-05, + 0.00012464394967537373, + 3.5465072869556025e-05, + 1.847404746513348e-05, + 5.548719491343945e-05, + 0.00011864618863910437, + 3.941592149203643e-05, + 5.4817210184410214e-05, + 0.0001261690049432218, + 6.886602204758674e-05, + 4.5921126002212986e-05, + 0.00026340721524320543, + 3.491710958769545e-05, + 6.15324461250566e-05, + 3.6591445677913725e-05, + 4.809158053831197e-05, + 3.477423160802573e-05, + 3.493107942631468e-05, + 8.450048335362226e-05, + 5.450391472550109e-05, + 0.0003894520632456988, + 0.00010916698374785483, + 4.6757017116760835e-05, + 4.382079350762069e-05, + 6.6999280534219e-05, + 4.934016760671511e-05, + 5.072278145235032e-05, + 4.0917060687206686e-05, + 7.26800863048993e-05, + 9.916475391946733e-05, + 5.48424432054162e-05, + 0.00011761068890336901, + 8.198009163606912e-05, + 8.76081467140466e-05, + 5.357425834517926e-05, + 7.92598002590239e-05, + 0.00025363703025504947, + 6.0045160353183746e-05, + 4.806789002032019e-05, + 5.262159538688138e-05, + 5.703686474589631e-05, + 0.0001106592026189901, + 9.103187767323107e-05, + 5.136866093380377e-05, + 0.0001198111058329232, + 5.662136391038075e-05 + ], + "eval/q_mse": 0.046722826478564225, + "eval/q_mae": 0.18053077077449248, + "eval/q_corr": 0.6928299200693895, + "eval/q_spearman": 0.6980194251214069, + "eval/truth_std": 0.16826422062875934, + "wall_clock_s": 135.48422956466675, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..b54e4e494c53babfdde3ea0af151668173cff76f --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/genq.json @@ -0,0 +1,122 @@ +{ + "method": "genq_reward_latent", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 2, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 1.024316668510437, + 0.1793454885482788, + 0.15517249703407288, + 0.1340932697057724, + 0.13335293531417847, + 0.13150489330291748, + 0.13454917073249817, + 0.14695987105369568, + 0.13363848626613617, + 0.12148027122020721, + 0.12004993110895157, + 0.15736988186836243, + 0.12241700291633606, + 0.12524090707302094, + 0.12828771770000458, + 0.1318449079990387, + 0.15014547109603882, + 0.12478946149349213, + 0.12095083296298981, + 0.13287462294101715, + 0.11742374300956726, + 0.13670894503593445, + 0.14853531122207642, + 0.1266043484210968, + 0.14328953623771667, + 0.12064675986766815, + 0.13112778961658478, + 0.11093735694885254, + 0.12830224633216858, + 0.13057976961135864, + 0.10531724989414215, + 0.13120026886463165, + 0.13122409582138062, + 0.12979282438755035, + 0.10491982102394104, + 0.12394106388092041, + 0.13706372678279877, + 0.13685330748558044, + 0.12740539014339447, + 0.11308732628822327, + 0.1389036774635315, + 0.13147905468940735, + 0.11338790506124496, + 0.11925211548805237, + 0.13030390441417694, + 0.11573618650436401, + 0.11731089651584625, + 0.12009034305810928, + 0.12889808416366577, + 0.10449075698852539, + 0.11116305738687515 + ], + "train/q_mse": [ + 0.024432747446616034 + ], + "latent/reward_mse": 0.0002573542296886444, + "eval/q_mse": 0.024432747446616034, + "eval/q_mae": 0.11475445740433432, + "eval/q_corr": 0.8041591442347077, + "eval/q_spearman": 0.8449954062212889, + "eval/q_mse_by_n": { + "1": 0.0998142523482076, + "2": 0.07049776675502882, + "4": 0.042721090125311195, + "8": 0.037813734067507834, + "16": 0.026469064864782607, + "32": 0.026449487809399503, + "64": 0.02434675654013557, + "128": 0.02408864906773499, + "256": 0.024358060718852038 + }, + "eval/q_corr_by_n": { + "1": 0.4527950314830981, + "2": 0.5788944407145811, + "4": 0.6266348581722568, + "8": 0.7055368038021134, + "16": 0.7794822560595883, + "32": 0.7870327906012677, + "64": 0.7987446807160185, + "128": 0.80674082562435, + "256": 0.8059638740570279 + }, + "eval/q_mse_vs_N": [ + 0.0998142523482076, + 0.07049776675502882, + 0.042721090125311195, + 0.037813734067507834, + 0.026469064864782607, + 0.026449487809399503, + 0.02434675654013557, + 0.02408864906773499, + 0.024358060718852038 + ], + "eval/N_final": 256, + "eval/truth_std": 0.17654507489690366, + "wall_clock_s": 190.1649649143219, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..27c9714a5a56488fdefa7cff3e26799f409d78d7 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/mc.json @@ -0,0 +1,124 @@ +{ + "method": "mc", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 2, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.4429917633533478, + 0.022357996553182602, + 0.023187624290585518, + 0.021833859384059906, + 0.0202195905148983, + 0.019669605419039726, + 0.017073694616556168, + 0.020152775570750237, + 0.01691555790603161, + 0.01923917606472969, + 0.016583403572440147, + 0.018169526010751724, + 0.017124615609645844, + 0.01890822872519493, + 0.02017965354025364, + 0.019468169659376144, + 0.02015000954270363, + 0.017852913588285446, + 0.016369212418794632, + 0.017571432515978813, + 0.016337791457772255, + 0.016603713855147362, + 0.015020797029137611, + 0.016736339777708054, + 0.015627248212695122, + 0.013909053057432175, + 0.01728198677301407, + 0.02094826102256775, + 0.016746126115322113, + 0.017170626670122147, + 0.017031293362379074, + 0.016752181574702263, + 0.016802242025732994, + 0.020353741943836212, + 0.014388898387551308, + 0.015708858147263527, + 0.017150770872831345, + 0.015197831206023693, + 0.015437373891472816, + 0.017017479985952377, + 0.013739853166043758, + 0.01366988755762577, + 0.015335265547037125, + 0.01730331778526306, + 0.014708343893289566, + 0.01554938592016697, + 0.01459048967808485, + 0.012942909263074398, + 0.015236981213092804, + 0.01549330074340105, + 0.013740262016654015 + ], + "train/q_mse": [ + 0.4429917633533478, + 0.022357996553182602, + 0.023187624290585518, + 0.021833859384059906, + 0.0202195905148983, + 0.019669605419039726, + 0.017073694616556168, + 0.020152775570750237, + 0.01691555790603161, + 0.01923917606472969, + 0.016583403572440147, + 0.018169526010751724, + 0.017124615609645844, + 0.01890822872519493, + 0.02017965354025364, + 0.019468169659376144, + 0.02015000954270363, + 0.017852913588285446, + 0.016369212418794632, + 0.017571432515978813, + 0.016337791457772255, + 0.016603713855147362, + 0.015020797029137611, + 0.016736339777708054, + 0.015627248212695122, + 0.013909053057432175, + 0.01728198677301407, + 0.02094826102256775, + 0.016746126115322113, + 0.017170626670122147, + 0.017031293362379074, + 0.016752181574702263, + 0.016802242025732994, + 0.020353741943836212, + 0.014388898387551308, + 0.015708858147263527, + 0.017150770872831345, + 0.015197831206023693, + 0.015437373891472816, + 0.017017479985952377, + 0.013739853166043758, + 0.01366988755762577, + 0.015335265547037125, + 0.01730331778526306, + 0.014708343893289566, + 0.01554938592016697, + 0.01459048967808485, + 0.012942909263074398, + 0.015236981213092804, + 0.01549330074340105, + 0.013740262016654015 + ], + "eval/q_mse": 0.028572852573103207, + "eval/q_mae": 0.1124454424148431, + "eval/q_corr": 0.8065496786031818, + "eval/q_spearman": 0.8727120169501059, + "eval/truth_std": 0.17654507489690366, + "wall_clock_s": 72.24020314216614, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/td.json new file mode 100644 index 0000000000000000000000000000000000000000..da5cf758c767b616f87ef43601f8e97fd64e1515 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/2/td.json @@ -0,0 +1,124 @@ +{ + "method": "td", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 2, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.12534111738204956, + 1.9910268747480586e-05, + 1.6004145436454564e-05, + 4.661513230530545e-05, + 0.0003531512338668108, + 3.990440018242225e-05, + 5.7517652749083936e-05, + 2.0071815015398897e-05, + 1.9873396013281308e-05, + 1.5575658835587092e-05, + 5.665469143423252e-05, + 9.225113899447024e-05, + 3.0335413612192497e-05, + 5.0036567699862644e-05, + 5.527953544515185e-05, + 4.24383906647563e-05, + 3.107404336333275e-05, + 8.414429612457752e-05, + 3.052110696444288e-05, + 3.6292054574005306e-05, + 8.18166954559274e-05, + 8.938631799537688e-05, + 6.787099118810147e-05, + 7.867449312470853e-05, + 0.00014428363647311926, + 4.576490755425766e-05, + 3.0030154448468238e-05, + 2.6521336621954106e-05, + 5.1336428441572934e-05, + 9.244908869732171e-05, + 6.353151547955349e-05, + 4.4155141949886456e-05, + 0.0001034806773532182, + 7.633137283846736e-05, + 0.00010885050141951069, + 0.00014073187776375562, + 9.10240487428382e-05, + 0.00021795034990645945, + 8.466524013783783e-05, + 0.00012538922601379454, + 7.03674741089344e-05, + 4.6943401684984565e-05, + 5.272848284221254e-05, + 4.764578989124857e-05, + 9.951114770956337e-05, + 8.630350203020498e-05, + 0.00010707996261771768, + 0.00011547016765689477, + 5.236967990640551e-05, + 0.00011771705612773076, + 6.523892807308584e-05 + ], + "train/q_mse": [ + 0.12534111738204956, + 1.9910268747480586e-05, + 1.6004145436454564e-05, + 4.661513230530545e-05, + 0.0003531512338668108, + 3.990440018242225e-05, + 5.7517652749083936e-05, + 2.0071815015398897e-05, + 1.9873396013281308e-05, + 1.5575658835587092e-05, + 5.665469143423252e-05, + 9.225113899447024e-05, + 3.0335413612192497e-05, + 5.0036567699862644e-05, + 5.527953544515185e-05, + 4.24383906647563e-05, + 3.107404336333275e-05, + 8.414429612457752e-05, + 3.052110696444288e-05, + 3.6292054574005306e-05, + 8.18166954559274e-05, + 8.938631799537688e-05, + 6.787099118810147e-05, + 7.867449312470853e-05, + 0.00014428363647311926, + 4.576490755425766e-05, + 3.0030154448468238e-05, + 2.6521336621954106e-05, + 5.1336428441572934e-05, + 9.244908869732171e-05, + 6.353151547955349e-05, + 4.4155141949886456e-05, + 0.0001034806773532182, + 7.633137283846736e-05, + 0.00010885050141951069, + 0.00014073187776375562, + 9.10240487428382e-05, + 0.00021795034990645945, + 8.466524013783783e-05, + 0.00012538922601379454, + 7.03674741089344e-05, + 4.6943401684984565e-05, + 5.272848284221254e-05, + 4.764578989124857e-05, + 9.951114770956337e-05, + 8.630350203020498e-05, + 0.00010707996261771768, + 0.00011547016765689477, + 5.236967990640551e-05, + 0.00011771705612773076, + 6.523892807308584e-05 + ], + "eval/q_mse": 0.04703190033019146, + "eval/q_mae": 0.17782433999639735, + "eval/q_corr": 0.6880166747998998, + "eval/q_spearman": 0.7019134494590591, + "eval/truth_std": 0.17654507489690366, + "wall_clock_s": 173.68622732162476, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..c7f292be46185a0956a016072ff2d2bfa8ce9879 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/genq.json @@ -0,0 +1,122 @@ +{ + "method": "genq_reward_latent", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 3, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 0.9786122441291809, + 0.1813828945159912, + 0.16335684061050415, + 0.15657462179660797, + 0.14482948184013367, + 0.15136945247650146, + 0.1602517068386078, + 0.14487171173095703, + 0.1275518387556076, + 0.14118008315563202, + 0.13817457854747772, + 0.1265709549188614, + 0.14510628581047058, + 0.1097148209810257, + 0.12812486290931702, + 0.11592552810907364, + 0.14503419399261475, + 0.11103656888008118, + 0.13784858584403992, + 0.10638585686683655, + 0.12266869097948074, + 0.13578736782073975, + 0.11891372501850128, + 0.11895227432250977, + 0.12104280292987823, + 0.11480166018009186, + 0.10633327066898346, + 0.13845336437225342, + 0.10790373384952545, + 0.11080335080623627, + 0.12742257118225098, + 0.10211851447820663, + 0.1400298923254013, + 0.12587080895900726, + 0.1037636399269104, + 0.11045695096254349, + 0.12478771060705185, + 0.11771151423454285, + 0.14330628514289856, + 0.11053226888179779, + 0.11037909984588623, + 0.12294399738311768, + 0.1331074982881546, + 0.11681242287158966, + 0.1415989100933075, + 0.12663546204566956, + 0.10575957596302032, + 0.10996787250041962, + 0.11652432382106781, + 0.1042134165763855, + 0.11657209694385529 + ], + "train/q_mse": [ + 0.03261971514659783 + ], + "latent/reward_mse": 0.00018257884948980063, + "eval/q_mse": 0.03261971514659783, + "eval/q_mae": 0.13390268875282402, + "eval/q_corr": 0.7574858238002674, + "eval/q_spearman": 0.8033770836067724, + "eval/q_mse_by_n": { + "1": 0.11800017661099597, + "2": 0.06831705131717261, + "4": 0.049247032290697046, + "8": 0.04359604283427686, + "16": 0.03706276048290737, + "32": 0.03516112533392767, + "64": 0.03321869847703921, + "128": 0.03189653154641794, + "256": 0.03161514213291374 + }, + "eval/q_corr_by_n": { + "1": 0.4650659249309307, + "2": 0.567179225609397, + "4": 0.613312688133767, + "8": 0.6924841970155693, + "16": 0.7218435078278452, + "32": 0.7363646775038664, + "64": 0.7393515761838985, + "128": 0.752980012927233, + "256": 0.7597189862536244 + }, + "eval/q_mse_vs_N": [ + 0.11800017661099597, + 0.06831705131717261, + 0.049247032290697046, + 0.04359604283427686, + 0.03706276048290737, + 0.03516112533392767, + 0.03321869847703921, + 0.03189653154641794, + 0.03161514213291374 + ], + "eval/N_final": 256, + "eval/truth_std": 0.1676409617116019, + "wall_clock_s": 214.69173336029053, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..bcc22af8d5e218ce416cb80cb2e5b97bd6c4f7c1 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/mc.json @@ -0,0 +1,124 @@ +{ + "method": "mc", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 3, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.11427582055330276, + 0.025900479406118393, + 0.02182270586490631, + 0.018609585240483284, + 0.02048398181796074, + 0.02097250521183014, + 0.019679706543684006, + 0.01927187666296959, + 0.016564100980758667, + 0.02113707736134529, + 0.01816052943468094, + 0.01731155999004841, + 0.01948174461722374, + 0.01947575993835926, + 0.020028414204716682, + 0.017292534932494164, + 0.018862828612327576, + 0.0204632505774498, + 0.017529692500829697, + 0.01708166114985943, + 0.01849568821489811, + 0.01659216359257698, + 0.01689644157886505, + 0.01867891661822796, + 0.018060501664876938, + 0.018033597618341446, + 0.017130481079220772, + 0.014515886083245277, + 0.01813732273876667, + 0.01816505566239357, + 0.01644013077020645, + 0.019669361412525177, + 0.016517076641321182, + 0.01640458032488823, + 0.017151495441794395, + 0.019820772111415863, + 0.017135582864284515, + 0.015625646337866783, + 0.015960179269313812, + 0.01435169205069542, + 0.015589943155646324, + 0.019253745675086975, + 0.014245660975575447, + 0.015107457526028156, + 0.015367028303444386, + 0.015443369746208191, + 0.016586344689130783, + 0.012922870926558971, + 0.015143996104598045, + 0.014632021076977253, + 0.017257817089557648 + ], + "train/q_mse": [ + 0.11427582055330276, + 0.025900479406118393, + 0.02182270586490631, + 0.018609585240483284, + 0.02048398181796074, + 0.02097250521183014, + 0.019679706543684006, + 0.01927187666296959, + 0.016564100980758667, + 0.02113707736134529, + 0.01816052943468094, + 0.01731155999004841, + 0.01948174461722374, + 0.01947575993835926, + 0.020028414204716682, + 0.017292534932494164, + 0.018862828612327576, + 0.0204632505774498, + 0.017529692500829697, + 0.01708166114985943, + 0.01849568821489811, + 0.01659216359257698, + 0.01689644157886505, + 0.01867891661822796, + 0.018060501664876938, + 0.018033597618341446, + 0.017130481079220772, + 0.014515886083245277, + 0.01813732273876667, + 0.01816505566239357, + 0.01644013077020645, + 0.019669361412525177, + 0.016517076641321182, + 0.01640458032488823, + 0.017151495441794395, + 0.019820772111415863, + 0.017135582864284515, + 0.015625646337866783, + 0.015960179269313812, + 0.01435169205069542, + 0.015589943155646324, + 0.019253745675086975, + 0.014245660975575447, + 0.015107457526028156, + 0.015367028303444386, + 0.015443369746208191, + 0.016586344689130783, + 0.012922870926558971, + 0.015143996104598045, + 0.014632021076977253, + 0.017257817089557648 + ], + "eval/q_mse": 0.03152841940559754, + "eval/q_mae": 0.11649606934512256, + "eval/q_corr": 0.7776767608263415, + "eval/q_spearman": 0.8543777773611083, + "eval/truth_std": 0.1676409617116019, + "wall_clock_s": 75.966548204422, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/td.json new file mode 100644 index 0000000000000000000000000000000000000000..183745a1d6d4c8eddf408208a139e6c51ea075f1 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/3/td.json @@ -0,0 +1,124 @@ +{ + "method": "td", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 3, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.13432824611663818, + 2.9250650186440907e-05, + 2.1772801119368523e-05, + 1.998736843233928e-05, + 0.0001087924829334952, + 4.3424755858723074e-05, + 3.897686838172376e-05, + 2.1876137907383963e-05, + 7.836107397451997e-05, + 1.8753249605651945e-05, + 0.00012637728650588542, + 3.2191601349040866e-05, + 6.535898137371987e-05, + 7.396026194328442e-05, + 2.215734639321454e-05, + 4.957913915859535e-05, + 0.00018714769976213574, + 0.00010593638580758125, + 2.382395541644655e-05, + 2.576542647148017e-05, + 2.5808321879594587e-05, + 7.161621761042625e-05, + 5.069085455033928e-05, + 9.0986599388998e-05, + 8.170856744982302e-05, + 3.36167577188462e-05, + 6.0377988120308146e-05, + 4.2951814975822344e-05, + 0.00010280728747602552, + 8.601638546679169e-05, + 0.00011885826097568497, + 4.1312734538223594e-05, + 6.003670932841487e-05, + 4.013587022200227e-05, + 2.867394869099371e-05, + 0.0001542841928312555, + 4.245143645675853e-05, + 4.938837082590908e-05, + 4.1362305637449026e-05, + 3.563420250429772e-05, + 0.00010009656398324296, + 0.00010307768388884142, + 6.730636232532561e-05, + 5.510987466550432e-05, + 0.00011000169615726918, + 5.2625480748247355e-05, + 5.1343056838959455e-05, + 4.147748404648155e-05, + 0.000153022599988617, + 3.814846422756091e-05, + 5.6674896768527105e-05 + ], + "train/q_mse": [ + 0.13432824611663818, + 2.9250650186440907e-05, + 2.1772801119368523e-05, + 1.998736843233928e-05, + 0.0001087924829334952, + 4.3424755858723074e-05, + 3.897686838172376e-05, + 2.1876137907383963e-05, + 7.836107397451997e-05, + 1.8753249605651945e-05, + 0.00012637728650588542, + 3.2191601349040866e-05, + 6.535898137371987e-05, + 7.396026194328442e-05, + 2.215734639321454e-05, + 4.957913915859535e-05, + 0.00018714769976213574, + 0.00010593638580758125, + 2.382395541644655e-05, + 2.576542647148017e-05, + 2.5808321879594587e-05, + 7.161621761042625e-05, + 5.069085455033928e-05, + 9.0986599388998e-05, + 8.170856744982302e-05, + 3.36167577188462e-05, + 6.0377988120308146e-05, + 4.2951814975822344e-05, + 0.00010280728747602552, + 8.601638546679169e-05, + 0.00011885826097568497, + 4.1312734538223594e-05, + 6.003670932841487e-05, + 4.013587022200227e-05, + 2.867394869099371e-05, + 0.0001542841928312555, + 4.245143645675853e-05, + 4.938837082590908e-05, + 4.1362305637449026e-05, + 3.563420250429772e-05, + 0.00010009656398324296, + 0.00010307768388884142, + 6.730636232532561e-05, + 5.510987466550432e-05, + 0.00011000169615726918, + 5.2625480748247355e-05, + 5.1343056838959455e-05, + 4.147748404648155e-05, + 0.000153022599988617, + 3.814846422756091e-05, + 5.6674896768527105e-05 + ], + "eval/q_mse": 0.062091866483208545, + "eval/q_mae": 0.19175105180722984, + "eval/q_corr": 0.653040559134656, + "eval/q_spearman": 0.6757079106744416, + "eval/truth_std": 0.1676409617116019, + "wall_clock_s": 150.6241955757141, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..bccb41a9d9b150474526cb599faedc1b92ebf1dc --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/genq.json @@ -0,0 +1,122 @@ +{ + "method": "genq_reward_latent", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 4, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 1.0221143960952759, + 0.15464206039905548, + 0.13698916137218475, + 0.15096651017665863, + 0.1399756371974945, + 0.13827411830425262, + 0.15386801958084106, + 0.14700762927532196, + 0.1270446479320526, + 0.14089421927928925, + 0.14881587028503418, + 0.13726650178432465, + 0.14134633541107178, + 0.10434136539697647, + 0.14067550003528595, + 0.12321922183036804, + 0.14194923639297485, + 0.12255091965198517, + 0.12179884314537048, + 0.11405657231807709, + 0.13789606094360352, + 0.13840842247009277, + 0.14163300395011902, + 0.12925845384597778, + 0.14221712946891785, + 0.11165930330753326, + 0.11027666926383972, + 0.134271040558815, + 0.11549004167318344, + 0.12998327612876892, + 0.11937310546636581, + 0.1511804759502411, + 0.10254085063934326, + 0.13579848408699036, + 0.11421668529510498, + 0.11789098381996155, + 0.12832027673721313, + 0.1332865059375763, + 0.12517359852790833, + 0.11915998160839081, + 0.13494136929512024, + 0.1402449905872345, + 0.11254194378852844, + 0.11143847554922104, + 0.1254590004682541, + 0.11728259921073914, + 0.13448892533779144, + 0.12565918266773224, + 0.10986718535423279, + 0.1203315481543541, + 0.1103968620300293 + ], + "train/q_mse": [ + 0.0325285088809079 + ], + "latent/reward_mse": 0.00012722922838293016, + "eval/q_mse": 0.0325285088809079, + "eval/q_mae": 0.14042291027594347, + "eval/q_corr": 0.8343707391026225, + "eval/q_spearman": 0.859819811373821, + "eval/q_mse_by_n": { + "1": 0.11749048527107937, + "2": 0.06507731086298359, + "4": 0.05152496529628317, + "8": 0.038036719248839834, + "16": 0.04049392737856005, + "32": 0.034567335346529574, + "64": 0.03224953411325952, + "128": 0.032026738340288394, + "256": 0.03178017218581198 + }, + "eval/q_corr_by_n": { + "1": 0.5001571625411021, + "2": 0.6424750229272684, + "4": 0.7033067227423613, + "8": 0.7732711422483145, + "16": 0.790210644271934, + "32": 0.8066095136313705, + "64": 0.8267415568147836, + "128": 0.8369205649892222, + "256": 0.8349037227999108 + }, + "eval/q_mse_vs_N": [ + 0.11749048527107937, + 0.06507731086298359, + 0.05152496529628317, + 0.038036719248839834, + 0.04049392737856005, + 0.034567335346529574, + 0.03224953411325952, + 0.032026738340288394, + 0.03178017218581198 + ], + "eval/N_final": 256, + "eval/truth_std": 0.17247575124413256, + "wall_clock_s": 204.09846472740173, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..39f2adfedae9364a45a8397394a3e71eb41d61e7 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/mc.json @@ -0,0 +1,124 @@ +{ + "method": "mc", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 4, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.34835368394851685, + 0.021781086921691895, + 0.022151704877614975, + 0.02001960203051567, + 0.020774640142917633, + 0.02400769107043743, + 0.02091117948293686, + 0.022001339122653008, + 0.019430074840784073, + 0.019683439284563065, + 0.02220391482114792, + 0.021904882043600082, + 0.021217767149209976, + 0.01888200454413891, + 0.01898941770195961, + 0.016956716775894165, + 0.015432142652571201, + 0.014268948696553707, + 0.015532889403402805, + 0.01790783181786537, + 0.015784412622451782, + 0.019660845398902893, + 0.0204515028744936, + 0.013847408816218376, + 0.015860646963119507, + 0.016796434298157692, + 0.017031237483024597, + 0.016207076609134674, + 0.01771123707294464, + 0.016995955258607864, + 0.016243355348706245, + 0.016266588121652603, + 0.015557675622403622, + 0.015755996108055115, + 0.01845301315188408, + 0.017771422863006592, + 0.013419459573924541, + 0.016886193305253983, + 0.015301067382097244, + 0.01601841300725937, + 0.01298343762755394, + 0.017222832888364792, + 0.017420273274183273, + 0.01316698919981718, + 0.016125483438372612, + 0.016258180141448975, + 0.018020782619714737, + 0.016702108085155487, + 0.014704195782542229, + 0.014174933545291424, + 0.014707410708069801 + ], + "train/q_mse": [ + 0.34835368394851685, + 0.021781086921691895, + 0.022151704877614975, + 0.02001960203051567, + 0.020774640142917633, + 0.02400769107043743, + 0.02091117948293686, + 0.022001339122653008, + 0.019430074840784073, + 0.019683439284563065, + 0.02220391482114792, + 0.021904882043600082, + 0.021217767149209976, + 0.01888200454413891, + 0.01898941770195961, + 0.016956716775894165, + 0.015432142652571201, + 0.014268948696553707, + 0.015532889403402805, + 0.01790783181786537, + 0.015784412622451782, + 0.019660845398902893, + 0.0204515028744936, + 0.013847408816218376, + 0.015860646963119507, + 0.016796434298157692, + 0.017031237483024597, + 0.016207076609134674, + 0.01771123707294464, + 0.016995955258607864, + 0.016243355348706245, + 0.016266588121652603, + 0.015557675622403622, + 0.015755996108055115, + 0.01845301315188408, + 0.017771422863006592, + 0.013419459573924541, + 0.016886193305253983, + 0.015301067382097244, + 0.01601841300725937, + 0.01298343762755394, + 0.017222832888364792, + 0.017420273274183273, + 0.01316698919981718, + 0.016125483438372612, + 0.016258180141448975, + 0.018020782619714737, + 0.016702108085155487, + 0.014704195782542229, + 0.014174933545291424, + 0.014707410708069801 + ], + "eval/q_mse": 0.025218780195969598, + "eval/q_mae": 0.10768196192798157, + "eval/q_corr": 0.8232307744599302, + "eval/q_spearman": 0.8845570284814278, + "eval/truth_std": 0.17247575124413256, + "wall_clock_s": 80.08448624610901, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/td.json new file mode 100644 index 0000000000000000000000000000000000000000..edde3801c65199a6e302fe987ebd2d54c761a17c --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/results/4/td.json @@ -0,0 +1,124 @@ +{ + "method": "td", + "env": "visual-pointmaze-medium-navigate-v0", + "seed": 4, + "wandb_url": null, + "representation": "ant_state_29d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "train/loss": [ + 0.12689602375030518, + 5.8314453781349584e-05, + 0.0002390430890955031, + 4.2148400098085403e-05, + 6.272075552260503e-05, + 0.00012217811308801174, + 3.392712096683681e-05, + 1.4556029782397673e-05, + 2.6110506951226853e-05, + 5.428169606602751e-05, + 1.7343005310976878e-05, + 1.8382921552984044e-05, + 2.6903804609901272e-05, + 2.159901850973256e-05, + 0.00012590631376951933, + 3.1839350413065404e-05, + 0.00014260338502936065, + 2.5799236027523875e-05, + 4.8569097998552024e-05, + 5.67318857065402e-05, + 3.83693040930666e-05, + 3.2438882044516504e-05, + 3.35777185682673e-05, + 2.5082532374653965e-05, + 5.6030432460829616e-05, + 4.5425469579640776e-05, + 8.850930316839367e-05, + 4.3394320528022945e-05, + 7.397429726552218e-05, + 7.845193613320589e-05, + 2.165625846828334e-05, + 6.838806439191103e-05, + 9.929090447258204e-05, + 2.5584453396731988e-05, + 2.6925225029117428e-05, + 3.4887045330833644e-05, + 7.293863745871931e-05, + 5.698925087926909e-05, + 4.541434464044869e-05, + 0.00011787991388700902, + 2.5135776013485156e-05, + 2.705133374547586e-05, + 9.204699017573148e-05, + 0.00019238758250139654, + 6.033916724845767e-05, + 6.98754665791057e-05, + 0.00014157664554659277, + 6.125553045421839e-05, + 6.424242747016251e-05, + 5.788148337160237e-05, + 7.827226363588125e-05 + ], + "train/q_mse": [ + 0.12689602375030518, + 5.8314453781349584e-05, + 0.0002390430890955031, + 4.2148400098085403e-05, + 6.272075552260503e-05, + 0.00012217811308801174, + 3.392712096683681e-05, + 1.4556029782397673e-05, + 2.6110506951226853e-05, + 5.428169606602751e-05, + 1.7343005310976878e-05, + 1.8382921552984044e-05, + 2.6903804609901272e-05, + 2.159901850973256e-05, + 0.00012590631376951933, + 3.1839350413065404e-05, + 0.00014260338502936065, + 2.5799236027523875e-05, + 4.8569097998552024e-05, + 5.67318857065402e-05, + 3.83693040930666e-05, + 3.2438882044516504e-05, + 3.35777185682673e-05, + 2.5082532374653965e-05, + 5.6030432460829616e-05, + 4.5425469579640776e-05, + 8.850930316839367e-05, + 4.3394320528022945e-05, + 7.397429726552218e-05, + 7.845193613320589e-05, + 2.165625846828334e-05, + 6.838806439191103e-05, + 9.929090447258204e-05, + 2.5584453396731988e-05, + 2.6925225029117428e-05, + 3.4887045330833644e-05, + 7.293863745871931e-05, + 5.698925087926909e-05, + 4.541434464044869e-05, + 0.00011787991388700902, + 2.5135776013485156e-05, + 2.705133374547586e-05, + 9.204699017573148e-05, + 0.00019238758250139654, + 6.033916724845767e-05, + 6.98754665791057e-05, + 0.00014157664554659277, + 6.125553045421839e-05, + 6.424242747016251e-05, + 5.788148337160237e-05, + 7.827226363588125e-05 + ], + "eval/q_mse": 0.045694480890922005, + "eval/q_mae": 0.1738537517968264, + "eval/q_corr": 0.6883529997958632, + "eval/q_spearman": 0.7279944874655466, + "eval/truth_std": 0.17247575124413256, + "wall_clock_s": 132.9508650302887, + "n_anchors": 400, + "anchor_protocol": "dataset_anchor", + "dataset_note": "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/run_genq.py b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/run_genq.py new file mode 100644 index 0000000000000000000000000000000000000000..5487d060bd87ef4c6406e2c456fe6f91a960c350 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/run_genq.py @@ -0,0 +1,87 @@ +"""Run the (self-rendered) visual-pointmaze policy-evaluation cells for one seed. + + python run_genq.py --method genq --seed 0 + python run_genq.py --method mc --seed 0 + python run_genq.py --method td --seed 0 + +genq uses the reward-predictive CNN latent occupancy in a FROZEN latent +(genq_visual.run) over rendered 64x64x3 images — NEVER raw pixels in the occupancy +model. mc/td run on the 4-D pointmaze state (qpos[2]+qvel[2]) as the non-latent +reference (genq_visual.run_mc / run_td). All score against FRESH-ROLLOUT truth: the +PointMaze scripted oracle-subgoal+noise controller, reset from the dataset anchor's xy +(qpos), via gc_core.gc_fresh_truth_pointmaze. Protocol = dataset_anchor. + +NOTE: `visual-pointmaze-medium-navigate-v0` is NOT an OGBench env (no registry entry, +dataset 404s). The images are SELF-RENDERED from the state pointmaze dataset's qpos +(build_visual_pointmaze_data.py). Truth never uses pixels, so it is unaffected. +Writes results/{seed}/{method}.json. +""" +import argparse +import json +import os +import sys + +_HERE = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.join(_HERE, "..", "..")) # preliminary_analysis on path + +import torch # noqa: E402 +_nt = int(os.environ.get("OMP_NUM_THREADS", "0") or 0) +if _nt > 0: + torch.set_num_threads(_nt) + +from config import make_cfg # noqa: E402 +import genq_visual # noqa: E402 + +ENV = "visual-pointmaze-medium-navigate-v0" +_FN = {"genq": "run", "mc": "run_mc", "td": "run_td"} +_OUT_NAME = {"genq": "genq", "mc": "mc", "td": "td"} + + +def result_path(seed, method): + d = os.path.join(_HERE, "results", str(seed)) + os.makedirs(d, exist_ok=True) + return os.path.join(d, f"{_OUT_NAME[method]}.json") + + +def run_one(method, seed, **ov): + cfg = make_cfg(**ov) + result = getattr(genq_visual, _FN[method])(ENV, seed, cfg) + # PointMaze obs IS rendered from the resettable maze state; the truth resets to the + # dataset validation anchor's xy and rolls the scripted oracle (dataset-anchor protocol). + result["anchor_protocol"] = "dataset_anchor" + result["dataset_note"] = "self_rendered_from_state_pointmaze (no OGBench visual-pointmaze exists)" + path = result_path(seed, method) + with open(path, "w") as f: + json.dump(result, f, indent=2, allow_nan=True) + print(f"[visual-pointmaze] wrote {path} eval/q_mse={result['eval/q_mse']:.5f} " + f"eval/q_corr={result.get('eval/q_corr')}", flush=True) + return result + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--method", choices=list(_FN), default="genq") + ap.add_argument("--seed", type=int, default=None, help="single seed; default 0..4") + ap.add_argument("--reward", default="dense") + ap.add_argument("--steps", type=int, default=None) + ap.add_argument("--latent_steps", type=int, default=None) + ap.add_argument("--n_anchors", type=int, default=None) + ap.add_argument("--truth_M", type=int, default=None) + ap.add_argument("--truth_H", type=int, default=None) + ap.add_argument("--vis_train_traj", type=int, default=None) + ap.add_argument("--vis_val_traj", type=int, default=None) + ap.add_argument("--wandb_mode", default=None) + args = ap.parse_args() + seeds = [args.seed] if args.seed is not None else list(range(5)) + ov = {"reward": args.reward} + for k in ("steps", "latent_steps", "n_anchors", "truth_M", "truth_H", + "vis_train_traj", "vis_val_traj", "wandb_mode"): + v = getattr(args, k) + if v is not None: + ov[k] = v + for s in seeds: + run_one(args.method, s, **ov) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/run_seq.sh b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/run_seq.sh new file mode 100644 index 0000000000000000000000000000000000000000..1104570394e813e9869e0a9da51009b2c1bf0329 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_pointmaze_medium_navigate_v0/run_seq.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# SEQUENTIAL policy-eval runner for the self-rendered visual-pointmaze cell. +# +# Blue Vela GPUs are mode=exclusive_process -> only ONE CUDA context per GPU. The +# packed "&"+wait pattern collides (cudaErrorDevicesUnavailable), so cells run +# SEQUENTIALLY, one (method,seed) per loop iteration. The image CNN encoder is heavier +# than the state MLPs, so keep <=1-2 cells per GPU; sequential is the safe default. +# +# Usage: +# SEEDS="0" METHODS="genq mc td" bash run_seq.sh +# Resume-safe: only runs a (method,seed) cell whose JSON is missing / not fresh_rollout. +set -u + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$HERE/../../.." && pwd)" +PA="$ROOT/preliminary_analysis" +PY="$ROOT/.venv/bin/python" +[ -x "$PY" ] || PY="/proj/inf-scaling/zwhong/projs/gen_q/.venv/bin/python" +DRIVER="$HERE/run_genq.py" + +SEEDS="${SEEDS:-0}" +METHODS="${METHODS:-genq mc td}" +REWARD="${REWARD:-dense}" +GENQ_STEPS="${GENQ_STEPS:-40000}" +LATENT_STEPS="${LATENT_STEPS:-20000}" +TRUTH_M="${TRUTH_M:-8}" +TRUTH_H="${TRUTH_H:-350}" +N_ANCHORS="${N_ANCHORS:-400}" +# rendered dataset is 300 train / 100 val traj; use all of it. +VIS_TRAIN_TRAJ="${VIS_TRAIN_TRAJ:-300}" +VIS_VAL_TRAJ="${VIS_VAL_TRAJ:-100}" + +if [ -f "$ROOT/.env" ]; then set -a; . "$ROOT/.env"; set +a; fi +export OMP_NUM_THREADS=3 MKL_NUM_THREADS=3 OPENBLAS_NUM_THREADS=3 +export NUMEXPR_NUM_THREADS=3 VECLIB_MAXIMUM_THREADS=3 +export XLA_FLAGS="--xla_cpu_multi_thread_eigen=false intra_op_parallelism_threads=3" +export JAX_PLATFORMS=cpu +export XLA_PYTHON_CLIENT_MEM_FRACTION=0.1 +export MUJOCO_GL=egl + +cd "$PA" +mkdir -p "$HERE/results" +echo "[run_seq vpm] SEEDS='$SEEDS' METHODS='$METHODS' steps=$GENQ_STEPS latent=$LATENT_STEPS M=$TRUTH_M H=$TRUTH_H anchors=$N_ANCHORS" + +fail=0 +for SEED in $SEEDS; do + for METHOD in $METHODS; do + out="$HERE/results/$SEED/$METHOD.json" + if [ -f "$out" ] && grep -q '"truth_kind": "fresh_rollout"' "$out" 2>/dev/null; then + echo "[run_seq vpm] SKIP existing $METHOD s$SEED"; continue + fi + echo "[run_seq vpm] === $METHOD seed=$SEED ===" + args=(--method "$METHOD" --seed "$SEED" --reward "$REWARD" \ + --steps "$GENQ_STEPS" --n_anchors "$N_ANCHORS" \ + --truth_M "$TRUTH_M" --truth_H "$TRUTH_H" \ + --vis_train_traj "$VIS_TRAIN_TRAJ" --vis_val_traj "$VIS_VAL_TRAJ") + if [ "$METHOD" = "genq" ]; then args+=(--latent_steps "$LATENT_STEPS"); fi + if ! "$PY" "$DRIVER" "${args[@]}" > "$HERE/results/${METHOD}_s${SEED}.log" 2>&1; then + echo "[run_seq vpm] CELL FAILED: $METHOD-s$SEED" + tail -8 "$HERE/results/${METHOD}_s${SEED}.log" + fail=1 + fi + done +done + +"$PY" plots.py --env "visual-pointmaze-medium-navigate-v0" || true +echo "[run_seq vpm] done (fail=$fail)" +exit "$fail" diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/NOTES.md b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/NOTES.md new file mode 100644 index 0000000000000000000000000000000000000000..59c026628f08c40a4473eed172a28b29bbddd097 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/NOTES.md @@ -0,0 +1,52 @@ +# visual-puzzle-3x3-play-v0 — Milestone 1 (Policy Evaluation), issue #35 + +Image-observation + combinatorial cell. **Expected outcome: an HONEST NEGATIVE, +inherited from the STATE `puzzle-3x3-play-v0` honest negative** (all of mc/td/genq at +~0 correlation). This is the correct, reported finding — not a failure of the image +recipe and not something to tune away. + +## What this cell runs + +- **genq** = image reward-predictive **latent** occupancy (`genq_visual_puzzle.run`). + CNN encoder `z = E(image 64x64x3)`; goal-conditioned reward decoder `R(z, g)` fit to + the puzzle **match-fraction** reward (`gc_core.puzzle_reward`, the issue-#35 reward); + freeze; conditional **diffusion** occupancy `p(z' | z_now, a, g)` on + `z' = stopgrad(E(image_{t+k}))`, `k ~ Geom(1-γ)`; `Q = mean_i R(z_i, g)`. NEVER raw + pixels (CLAUDE.md image rule). +- **mc / td** = trained-MC / IQL-TD critics over the **46-D `[qpos|qvel]` state** + (the non-latent reference, documented via `representation`), with the SAME + match-fraction reward and the button-state vector as the occupancy target. This + mirrors the `genq_visual` (visual-antmaze) precedent where mc/td run on the + underlying ant state. +- **Ground truth** = fresh-RESET fresh rollouts (Protocol B), **identical to the STATE + puzzle**: `ButtonMarkovOracle(gripper_always_closed=True)` rolled from + `set_state(qpos, qvel, button_states)`, renormalized discounted match-fraction reward + toward the target button pattern, averaged over M rollouts. The live PuzzleEnv has + all privileged info, so the truth is independent of whether the model observation is + an image or a state vector — the image-ness only changes the occupancy MODEL input. + The shared anchor pack (`gc_core.fresh_reset_anchors`) is built ONCE per seed and + shared by genq/mc/td so all three score the SAME (s, a, g). + +## Why the negative is expected (mechanism) + +The STATE puzzle is an honest negative because the truth is near-degenerate: the +discounted match-fraction return toward a single-target-button goal has **truth std +~0.011–0.014** across anchors (vs ~0.38 for the graded visual-antmaze navigation +truth). The Lights-Out button task is essentially "the target button gets pressed +within the horizon, or it doesn't" — there is no graded, rankable Q across anchors, so +Pearson/Spearman correlation against truth is ~0 for **every** estimator (the state +puzzle's mc/td/genq all land at |corr| ≤ 0.15). Passing the same degenerate truth +through an image reward-latent does not create signal that the task does not contain. + +So the image case is expected to **confirm** the state negative. If it differs, that is +itself the reportable finding — but it must come from an honest run, never from tuning. + +## Files + +- Driver: `../../genq_visual_puzzle.py` (genq image-latent + mc/td state reference). +- Per-seed runner: `run_seed.py` (builds shared truth once, runs genq+mc+td). +- Batch runner: `run_seq.sh` (one seed per process inside one bsub `-gpu num=1`). +- Results: `results/{seed}/{genq,mc,td}.json` — schema matches the other M1 envs + (`eval/q_mse`, `eval/q_corr`, `eval/q_mse_by_n`, `eval/q_corr_by_n`, + `truth_kind="fresh_rollout"`, `anchor_protocol="fresh_reset"`). +- Figures: `figures/{mse,corr}.png` (Gen-Q curve vs N, MC/TD reference lines). diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/.gitkeep b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/corr.png b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/corr.png new file mode 100644 index 0000000000000000000000000000000000000000..a0f2d9f3130ce9c22922918fe1631df74653132b Binary files /dev/null and b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/corr.png differ diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/mse.png b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/mse.png new file mode 100644 index 0000000000000000000000000000000000000000..fc76633601e54c3338e235fb62f564c36794e880 Binary files /dev/null and b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/figures/mse.png differ diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/.gitkeep b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..88d4c4556654cae1e2dafb19c0f8f85ed210adcc --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/genq.json @@ -0,0 +1,121 @@ +{ + "method": "genq_reward_latent", + "env": "visual-puzzle-3x3-play-v0", + "seed": 0, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 1.021519422531128, + 0.4601687490940094, + 0.2952587604522705, + 0.29642564058303833, + 0.2566065192222595, + 0.2608852982521057, + 0.2649744153022766, + 0.21888938546180725, + 0.22235921025276184, + 0.21022295951843262, + 0.2057866007089615, + 0.2536538243293762, + 0.25915318727493286, + 0.19905629754066467, + 0.23954977095127106, + 0.2539094388484955, + 0.254019558429718, + 0.23310111463069916, + 0.23211494088172913, + 0.2157919853925705, + 0.19920235872268677, + 0.20999859273433685, + 0.26213425397872925, + 0.23050303757190704, + 0.20321311056613922, + 0.15958988666534424, + 0.2099725306034088, + 0.22476862370967865, + 0.2110440880060196, + 0.2102266550064087, + 0.20764213800430298, + 0.2283616065979004, + 0.19830217957496643, + 0.21698564291000366, + 0.19947651028633118, + 0.19465507566928864, + 0.23041236400604248, + 0.23858603835105896, + 0.20363286137580872, + 0.18325605988502502, + 0.179934561252594, + 0.2046785056591034, + 0.2069043219089508, + 0.21145755052566528, + 0.17085985839366913, + 0.17966949939727783, + 0.17462216317653656, + 0.17755067348480225, + 0.20074118673801422, + 0.220272958278656, + 0.20178523659706116 + ], + "train/q_mse": [ + 0.07146202586195333 + ], + "latent/reward_mse": 2.6356749003753066e-05, + "eval/q_mse": 0.07146202586195333, + "eval/q_mae": 0.2648176458120056, + "eval/q_corr": -0.004094141213230109, + "eval/q_spearman": -0.0030695840290528957, + "eval/q_mse_by_n": { + "1": 0.1073083887446366, + "2": 0.0790610194466088, + "4": 0.08006403860746969, + "8": 0.0804523668037022, + "16": 0.07249970764970978, + "32": 0.07105027784024304, + "64": 0.07174116280155583, + "128": 0.07225206335540099, + "256": 0.07167250843326349 + }, + "eval/q_corr_by_n": { + "1": 0.06457914123567231, + "2": 0.10567364195550466, + "4": -0.03288992926825715, + "8": -0.007945798637642304, + "16": -0.0037951998332696603, + "32": 0.0016083051179053229, + "64": 0.021072154041039445, + "128": -0.007717643607183906, + "256": 0.007820503672876053 + }, + "eval/q_mse_vs_N": [ + 0.1073083887446366, + 0.0790610194466088, + 0.08006403860746969, + 0.0804523668037022, + 0.07249970764970978, + 0.07105027784024304, + 0.07174116280155583, + 0.07225206335540099, + 0.07167250843326349 + ], + "eval/N_final": 256, + "eval/truth_std": 0.01520020918542479, + "wall_clock_s": 216.02018404006958, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..4a0e240e40d5f3a80def9cf4dc12305c8fa4744e --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/mc.json @@ -0,0 +1,123 @@ +{ + "method": "mc", + "env": "visual-puzzle-3x3-play-v0", + "seed": 0, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.27377158403396606, + 0.01449478231370449, + 0.02048783376812935, + 0.015084651298820972, + 0.01668834313750267, + 0.014009361155331135, + 0.012490876019001007, + 0.014363992027938366, + 0.016287554055452347, + 0.01540954690426588, + 0.012552689760923386, + 0.015072048641741276, + 0.014254258945584297, + 0.012741902843117714, + 0.013847781345248222, + 0.01286780834197998, + 0.012072085402905941, + 0.013999857008457184, + 0.011457929387688637, + 0.012684045359492302, + 0.012237176299095154, + 0.01200703252106905, + 0.01054402906447649, + 0.007818711921572685, + 0.010167859494686127, + 0.009926622733473778, + 0.00923527404665947, + 0.0085448008030653, + 0.008351923897862434, + 0.00709732249379158, + 0.006109965965151787, + 0.005684474483132362, + 0.006194375921040773, + 0.007862245664000511, + 0.005147951189428568, + 0.008025170303881168, + 0.005333418026566505, + 0.0056441547349095345, + 0.004884111694991589, + 0.005278090946376324, + 0.004985888954252005, + 0.0041185906156897545, + 0.004817157052457333, + 0.0044778380542993546, + 0.0044335005804896355, + 0.0047149658203125, + 0.003720856737345457, + 0.004310415126383305, + 0.003513350849971175, + 0.004647546447813511, + 0.0034227771684527397 + ], + "train/q_mse": [ + 0.27377158403396606, + 0.01449478231370449, + 0.02048783376812935, + 0.015084651298820972, + 0.01668834313750267, + 0.014009361155331135, + 0.012490876019001007, + 0.014363992027938366, + 0.016287554055452347, + 0.01540954690426588, + 0.012552689760923386, + 0.015072048641741276, + 0.014254258945584297, + 0.012741902843117714, + 0.013847781345248222, + 0.01286780834197998, + 0.012072085402905941, + 0.013999857008457184, + 0.011457929387688637, + 0.012684045359492302, + 0.012237176299095154, + 0.01200703252106905, + 0.01054402906447649, + 0.007818711921572685, + 0.010167859494686127, + 0.009926622733473778, + 0.00923527404665947, + 0.0085448008030653, + 0.008351923897862434, + 0.00709732249379158, + 0.006109965965151787, + 0.005684474483132362, + 0.006194375921040773, + 0.007862245664000511, + 0.005147951189428568, + 0.008025170303881168, + 0.005333418026566505, + 0.0056441547349095345, + 0.004884111694991589, + 0.005278090946376324, + 0.004985888954252005, + 0.0041185906156897545, + 0.004817157052457333, + 0.0044778380542993546, + 0.0044335005804896355, + 0.0047149658203125, + 0.003720856737345457, + 0.004310415126383305, + 0.003513350849971175, + 0.004647546447813511, + 0.0034227771684527397 + ], + "eval/q_mse": 0.19029518513677396, + "eval/q_mae": 0.41816644217965093, + "eval/q_corr": 0.06425732763454055, + "eval/q_spearman": 0.08165093517280701, + "eval/truth_std": 0.01520020918542479, + "wall_clock_s": 45.317344188690186, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/td.json new file mode 100644 index 0000000000000000000000000000000000000000..1565d1092af37676e7886b2d4d2ad9f17770b97b --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/0/td.json @@ -0,0 +1,123 @@ +{ + "method": "td", + "env": "visual-puzzle-3x3-play-v0", + "seed": 0, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.0031114162411540747, + 5.278137450659415e-06, + 4.615293619281147e-06, + 4.854130111198174e-06, + 6.227544872672297e-06, + 4.015372724097688e-06, + 4.181146323389839e-06, + 5.594997674052138e-06, + 3.2843117878655903e-06, + 5.333041372068692e-06, + 5.873735972272698e-06, + 8.308212272822857e-06, + 5.001714725949569e-06, + 5.982739821774885e-06, + 5.971228347334545e-06, + 3.7389995668490883e-06, + 3.4900795071735047e-06, + 3.7658824112440925e-06, + 9.169029908662196e-06, + 6.395014224835904e-06, + 2.927656851170468e-06, + 4.1803928070294205e-06, + 7.145042218326125e-06, + 4.241586793796159e-06, + 3.831414232990937e-06, + 3.6492870094662067e-06, + 4.057833393744659e-06, + 4.213066858937964e-06, + 8.094826625892892e-06, + 5.4807915148558095e-06, + 3.109188583039213e-06, + 6.9497018557740375e-06, + 3.9180404201033525e-06, + 4.068935595569201e-06, + 7.827791705494747e-06, + 4.551379333861405e-06, + 3.7780212096549803e-06, + 5.656886514771031e-06, + 3.2655070754117332e-06, + 4.729612101073144e-06, + 4.336786332714837e-06, + 4.0762784010439645e-06, + 2.9380630621744785e-06, + 5.181247615837492e-06, + 3.665640178951435e-06, + 3.3901685583259678e-06, + 3.6557812563842162e-06, + 3.735813834282453e-06, + 9.290849448007066e-06, + 3.672404545795871e-06, + 4.4350563257467e-06 + ], + "train/q_mse": [ + 0.0031114162411540747, + 5.278137450659415e-06, + 4.615293619281147e-06, + 4.854130111198174e-06, + 6.227544872672297e-06, + 4.015372724097688e-06, + 4.181146323389839e-06, + 5.594997674052138e-06, + 3.2843117878655903e-06, + 5.333041372068692e-06, + 5.873735972272698e-06, + 8.308212272822857e-06, + 5.001714725949569e-06, + 5.982739821774885e-06, + 5.971228347334545e-06, + 3.7389995668490883e-06, + 3.4900795071735047e-06, + 3.7658824112440925e-06, + 9.169029908662196e-06, + 6.395014224835904e-06, + 2.927656851170468e-06, + 4.1803928070294205e-06, + 7.145042218326125e-06, + 4.241586793796159e-06, + 3.831414232990937e-06, + 3.6492870094662067e-06, + 4.057833393744659e-06, + 4.213066858937964e-06, + 8.094826625892892e-06, + 5.4807915148558095e-06, + 3.109188583039213e-06, + 6.9497018557740375e-06, + 3.9180404201033525e-06, + 4.068935595569201e-06, + 7.827791705494747e-06, + 4.551379333861405e-06, + 3.7780212096549803e-06, + 5.656886514771031e-06, + 3.2655070754117332e-06, + 4.729612101073144e-06, + 4.336786332714837e-06, + 4.0762784010439645e-06, + 2.9380630621744785e-06, + 5.181247615837492e-06, + 3.665640178951435e-06, + 3.3901685583259678e-06, + 3.6557812563842162e-06, + 3.735813834282453e-06, + 9.290849448007066e-06, + 3.672404545795871e-06, + 4.4350563257467e-06 + ], + "eval/q_mse": 0.18432445600994302, + "eval/q_mae": 0.4290393310427376, + "eval/q_corr": -0.07532079281012344, + "eval/q_spearman": -0.10866327462847249, + "eval/truth_std": 0.01520020918542479, + "wall_clock_s": 113.64547228813171, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..4b864c15510b46f4df1af5843fa054fccbfca155 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/genq.json @@ -0,0 +1,121 @@ +{ + "method": "genq_reward_latent", + "env": "visual-puzzle-3x3-play-v0", + "seed": 1, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 0.9807145595550537, + 0.4400460720062256, + 0.3610970675945282, + 0.2688695192337036, + 0.28034707903862, + 0.26231133937835693, + 0.2494300901889801, + 0.25018224120140076, + 0.22944794595241547, + 0.2130129635334015, + 0.24376246333122253, + 0.21491679549217224, + 0.2273327112197876, + 0.2546854615211487, + 0.2323516309261322, + 0.2361908107995987, + 0.24614675343036652, + 0.24467571079730988, + 0.20755019783973694, + 0.21395747363567352, + 0.20720559358596802, + 0.2488359808921814, + 0.2267460823059082, + 0.2283811867237091, + 0.2064915895462036, + 0.21840515732765198, + 0.20661449432373047, + 0.22264894843101501, + 0.20823489129543304, + 0.21716240048408508, + 0.18364380300045013, + 0.1748126745223999, + 0.20742008090019226, + 0.1701427400112152, + 0.17814505100250244, + 0.1915898323059082, + 0.2118266522884369, + 0.2002684473991394, + 0.20539897680282593, + 0.19456911087036133, + 0.1846393644809723, + 0.22991949319839478, + 0.24090014398097992, + 0.1669967770576477, + 0.2002880573272705, + 0.19123905897140503, + 0.19090206921100616, + 0.20155873894691467, + 0.187917560338974, + 0.20528344810009003, + 0.18759356439113617 + ], + "train/q_mse": [ + 0.05793036026812584 + ], + "latent/reward_mse": 3.492172254482284e-05, + "eval/q_mse": 0.05793036026812584, + "eval/q_mae": 0.23773052804047787, + "eval/q_corr": 0.07948781752793167, + "eval/q_spearman": 0.08533443600767049, + "eval/q_mse_by_n": { + "1": 0.09512565332175407, + "2": 0.08388511346914757, + "4": 0.06447527291491785, + "8": 0.06367595947903232, + "16": 0.059387474398493616, + "32": 0.057744328526531954, + "64": 0.05741584154619247, + "128": 0.05834494982701078, + "256": 0.05779518197889028 + }, + "eval/q_corr_by_n": { + "1": -0.009039003390065904, + "2": 0.09248342893143635, + "4": 0.009978365452553872, + "8": 0.16447670988236304, + "16": 0.14018888300798776, + "32": 0.06812872585293074, + "64": 0.09095566774236519, + "128": 0.03979257628922054, + "256": 0.04134770628953202 + }, + "eval/q_mse_vs_N": [ + 0.09512565332175407, + 0.08388511346914757, + 0.06447527291491785, + 0.06367595947903232, + 0.059387474398493616, + 0.057744328526531954, + 0.05741584154619247, + 0.05834494982701078, + 0.05779518197889028 + ], + "eval/N_final": 256, + "eval/truth_std": 0.014050113983847026, + "wall_clock_s": 241.66425371170044, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..ebca843b8f9afa0af7652f84dc33032dcb330d81 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/mc.json @@ -0,0 +1,123 @@ +{ + "method": "mc", + "env": "visual-puzzle-3x3-play-v0", + "seed": 1, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.33153998851776123, + 0.016061093658208847, + 0.017301592975854874, + 0.016898270696401596, + 0.01317935436964035, + 0.015605157241225243, + 0.015999682247638702, + 0.013921011239290237, + 0.013126138597726822, + 0.016829876229166985, + 0.01352191437035799, + 0.01486215740442276, + 0.015201425179839134, + 0.013477513566613197, + 0.012067161500453949, + 0.010814988985657692, + 0.013562566600739956, + 0.013427294790744781, + 0.01393778994679451, + 0.01043575070798397, + 0.01355486549437046, + 0.009328169748187065, + 0.009050591848790646, + 0.010213538073003292, + 0.00885345134884119, + 0.006860203109681606, + 0.01009971834719181, + 0.010200081393122673, + 0.007873302325606346, + 0.008852760307490826, + 0.008487625047564507, + 0.007925750687718391, + 0.006615819409489632, + 0.0068536484614014626, + 0.005707425065338612, + 0.00560744758695364, + 0.0063984571024775505, + 0.005186611320823431, + 0.005942762829363346, + 0.004300490487366915, + 0.005335991270840168, + 0.004683281295001507, + 0.00566362589597702, + 0.004111667163670063, + 0.004999744705855846, + 0.005114395171403885, + 0.0035127270966768265, + 0.00385737675242126, + 0.004656015429645777, + 0.003737775608897209, + 0.003998672589659691 + ], + "train/q_mse": [ + 0.33153998851776123, + 0.016061093658208847, + 0.017301592975854874, + 0.016898270696401596, + 0.01317935436964035, + 0.015605157241225243, + 0.015999682247638702, + 0.013921011239290237, + 0.013126138597726822, + 0.016829876229166985, + 0.01352191437035799, + 0.01486215740442276, + 0.015201425179839134, + 0.013477513566613197, + 0.012067161500453949, + 0.010814988985657692, + 0.013562566600739956, + 0.013427294790744781, + 0.01393778994679451, + 0.01043575070798397, + 0.01355486549437046, + 0.009328169748187065, + 0.009050591848790646, + 0.010213538073003292, + 0.00885345134884119, + 0.006860203109681606, + 0.01009971834719181, + 0.010200081393122673, + 0.007873302325606346, + 0.008852760307490826, + 0.008487625047564507, + 0.007925750687718391, + 0.006615819409489632, + 0.0068536484614014626, + 0.005707425065338612, + 0.00560744758695364, + 0.0063984571024775505, + 0.005186611320823431, + 0.005942762829363346, + 0.004300490487366915, + 0.005335991270840168, + 0.004683281295001507, + 0.00566362589597702, + 0.004111667163670063, + 0.004999744705855846, + 0.005114395171403885, + 0.0035127270966768265, + 0.00385737675242126, + 0.004656015429645777, + 0.003737775608897209, + 0.003998672589659691 + ], + "eval/q_mse": 0.1666778275137994, + "eval/q_mae": 0.3882469346361848, + "eval/q_corr": -0.03360009612223268, + "eval/q_spearman": -0.046043760435793425, + "eval/truth_std": 0.014050113983847026, + "wall_clock_s": 84.53309535980225, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/td.json new file mode 100644 index 0000000000000000000000000000000000000000..6bee88f2ec8cd40247dc796d705531304c66547e --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/1/td.json @@ -0,0 +1,123 @@ +{ + "method": "td", + "env": "visual-puzzle-3x3-play-v0", + "seed": 1, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.0012204032391309738, + 6.125352228991687e-06, + 5.217079888097942e-06, + 4.791495484823827e-06, + 3.2437026220577536e-06, + 3.5753496376855765e-06, + 4.218249159748666e-06, + 4.293704023439204e-06, + 3.894338078680448e-06, + 4.730663931695744e-06, + 4.639120561478194e-06, + 3.2838054266903782e-06, + 3.957793978770496e-06, + 6.253728770388989e-06, + 3.5554949135985225e-06, + 4.4017469917889684e-06, + 3.6687652027467266e-06, + 3.864938662445638e-06, + 4.212437033856986e-06, + 4.194202574581141e-06, + 3.5583732369559584e-06, + 3.567800831660861e-06, + 3.91760841012001e-06, + 4.5055608097754885e-06, + 3.901361196767539e-06, + 4.029919637105195e-06, + 3.964070401707431e-06, + 3.7007548598921858e-06, + 4.193703716737218e-06, + 4.805036041943822e-06, + 3.574690708774142e-06, + 4.073217496625148e-06, + 6.4449277488165535e-06, + 5.942266398051288e-06, + 3.554948307282757e-06, + 4.008534233435057e-06, + 4.516137778409757e-06, + 3.960966751037631e-06, + 3.709805696416879e-06, + 3.565084398360341e-06, + 5.899311872781254e-06, + 3.450305939622922e-06, + 3.187440142937703e-06, + 4.070351678819861e-06, + 2.9936820737930248e-06, + 3.9672340790275484e-06, + 2.9289030862855725e-06, + 3.862484845740255e-06, + 4.573448677547276e-06, + 3.3329736197629245e-06, + 3.6034641652804567e-06 + ], + "train/q_mse": [ + 0.0012204032391309738, + 6.125352228991687e-06, + 5.217079888097942e-06, + 4.791495484823827e-06, + 3.2437026220577536e-06, + 3.5753496376855765e-06, + 4.218249159748666e-06, + 4.293704023439204e-06, + 3.894338078680448e-06, + 4.730663931695744e-06, + 4.639120561478194e-06, + 3.2838054266903782e-06, + 3.957793978770496e-06, + 6.253728770388989e-06, + 3.5554949135985225e-06, + 4.4017469917889684e-06, + 3.6687652027467266e-06, + 3.864938662445638e-06, + 4.212437033856986e-06, + 4.194202574581141e-06, + 3.5583732369559584e-06, + 3.567800831660861e-06, + 3.91760841012001e-06, + 4.5055608097754885e-06, + 3.901361196767539e-06, + 4.029919637105195e-06, + 3.964070401707431e-06, + 3.7007548598921858e-06, + 4.193703716737218e-06, + 4.805036041943822e-06, + 3.574690708774142e-06, + 4.073217496625148e-06, + 6.4449277488165535e-06, + 5.942266398051288e-06, + 3.554948307282757e-06, + 4.008534233435057e-06, + 4.516137778409757e-06, + 3.960966751037631e-06, + 3.709805696416879e-06, + 3.565084398360341e-06, + 5.899311872781254e-06, + 3.450305939622922e-06, + 3.187440142937703e-06, + 4.070351678819861e-06, + 2.9936820737930248e-06, + 3.9672340790275484e-06, + 2.9289030862855725e-06, + 3.862484845740255e-06, + 4.573448677547276e-06, + 3.3329736197629245e-06, + 3.6034641652804567e-06 + ], + "eval/q_mse": 0.189145102131425, + "eval/q_mae": 0.43468024216468065, + "eval/q_corr": 0.08796130859680275, + "eval/q_spearman": 0.10375194018198786, + "eval/truth_std": 0.014050113983847026, + "wall_clock_s": 176.03912734985352, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..dc86c78b21145945fcffcb15d9535d24b597f671 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/genq.json @@ -0,0 +1,121 @@ +{ + "method": "genq_reward_latent", + "env": "visual-puzzle-3x3-play-v0", + "seed": 2, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 1.0270042419433594, + 0.4926109313964844, + 0.25451451539993286, + 0.24574831128120422, + 0.2283048927783966, + 0.20877614617347717, + 0.2705289125442505, + 0.2481229305267334, + 0.2179751694202423, + 0.2228512316942215, + 0.18179479241371155, + 0.24287348985671997, + 0.2439499795436859, + 0.2246687263250351, + 0.23155605792999268, + 0.20789775252342224, + 0.23746022582054138, + 0.17210029065608978, + 0.19767284393310547, + 0.1915525197982788, + 0.20987069606781006, + 0.18757885694503784, + 0.22028657793998718, + 0.20491041243076324, + 0.2406948208808899, + 0.17528264224529266, + 0.17716437578201294, + 0.21971076726913452, + 0.23385220766067505, + 0.21838140487670898, + 0.20587867498397827, + 0.20277276635169983, + 0.19320036470890045, + 0.209520161151886, + 0.2010309249162674, + 0.18754874169826508, + 0.20517519116401672, + 0.1789780706167221, + 0.19141335785388947, + 0.1696317493915558, + 0.21181648969650269, + 0.20939485728740692, + 0.14459873735904694, + 0.2180784046649933, + 0.21029719710350037, + 0.18462111055850983, + 0.1691209077835083, + 0.15534928441047668, + 0.22393280267715454, + 0.188382089138031, + 0.1731264293193817 + ], + "train/q_mse": [ + 0.05786949887487825 + ], + "latent/reward_mse": 2.9891922167735174e-05, + "eval/q_mse": 0.05786949887487825, + "eval/q_mae": 0.2373290019754777, + "eval/q_corr": 0.01914517078675529, + "eval/q_spearman": 0.031309757096339534, + "eval/q_mse_by_n": { + "1": 0.09020440271734823, + "2": 0.08067756407134383, + "4": 0.06299363260594396, + "8": 0.06765017370959912, + "16": 0.06134006430543755, + "32": 0.06051339577774429, + "64": 0.05766905909917022, + "128": 0.05903817699298815, + "256": 0.05837154201006975 + }, + "eval/q_corr_by_n": { + "1": -0.005713607682170413, + "2": -0.07272741581351423, + "4": 0.03221002397828272, + "8": -0.11647711909730074, + "16": -0.06127867419748186, + "32": 0.07472428029086302, + "64": 0.00941746659748049, + "128": -0.01715974434839922, + "256": 0.04954112923775513 + }, + "eval/q_mse_vs_N": [ + 0.09020440271734823, + 0.08067756407134383, + 0.06299363260594396, + 0.06765017370959912, + 0.06134006430543755, + 0.06051339577774429, + 0.05766905909917022, + 0.05903817699298815, + 0.05837154201006975 + ], + "eval/N_final": 256, + "eval/truth_std": 0.011446896413730248, + "wall_clock_s": 214.33634328842163, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..7b46c3cb53523461f421c02f1fdd8b5de515fbba --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/mc.json @@ -0,0 +1,123 @@ +{ + "method": "mc", + "env": "visual-puzzle-3x3-play-v0", + "seed": 2, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.40898996591567993, + 0.015920303761959076, + 0.014010515064001083, + 0.013672862201929092, + 0.017288688570261, + 0.015668045729398727, + 0.01285402849316597, + 0.014039140194654465, + 0.014095981605350971, + 0.016332391649484634, + 0.016876138746738434, + 0.01484333910048008, + 0.013885890133678913, + 0.011035697534680367, + 0.012117761187255383, + 0.010388154536485672, + 0.011715492233633995, + 0.013304205611348152, + 0.010947076603770256, + 0.01304270327091217, + 0.010827884078025818, + 0.013813907280564308, + 0.010653816163539886, + 0.007922614924609661, + 0.009903037920594215, + 0.010088683106005192, + 0.009109705686569214, + 0.009340403601527214, + 0.008670229464769363, + 0.008110998198390007, + 0.008070522919297218, + 0.007171010598540306, + 0.007696999236941338, + 0.0073455688543617725, + 0.007664284203201532, + 0.006526111159473658, + 0.005847295746207237, + 0.0065309698693454266, + 0.00772154051810503, + 0.005802817642688751, + 0.005282590165734291, + 0.005653972737491131, + 0.005036684684455395, + 0.0042710937559604645, + 0.004249030724167824, + 0.0037705216091126204, + 0.0037338915280997753, + 0.004787066485732794, + 0.004263255745172501, + 0.004285373724997044, + 0.003377311397343874 + ], + "train/q_mse": [ + 0.40898996591567993, + 0.015920303761959076, + 0.014010515064001083, + 0.013672862201929092, + 0.017288688570261, + 0.015668045729398727, + 0.01285402849316597, + 0.014039140194654465, + 0.014095981605350971, + 0.016332391649484634, + 0.016876138746738434, + 0.01484333910048008, + 0.013885890133678913, + 0.011035697534680367, + 0.012117761187255383, + 0.010388154536485672, + 0.011715492233633995, + 0.013304205611348152, + 0.010947076603770256, + 0.01304270327091217, + 0.010827884078025818, + 0.013813907280564308, + 0.010653816163539886, + 0.007922614924609661, + 0.009903037920594215, + 0.010088683106005192, + 0.009109705686569214, + 0.009340403601527214, + 0.008670229464769363, + 0.008110998198390007, + 0.008070522919297218, + 0.007171010598540306, + 0.007696999236941338, + 0.0073455688543617725, + 0.007664284203201532, + 0.006526111159473658, + 0.005847295746207237, + 0.0065309698693454266, + 0.00772154051810503, + 0.005802817642688751, + 0.005282590165734291, + 0.005653972737491131, + 0.005036684684455395, + 0.0042710937559604645, + 0.004249030724167824, + 0.0037705216091126204, + 0.0037338915280997753, + 0.004787066485732794, + 0.004263255745172501, + 0.004285373724997044, + 0.003377311397343874 + ], + "eval/q_mse": 0.18494481683358927, + "eval/q_mae": 0.40741203380782176, + "eval/q_corr": -0.00558418397262717, + "eval/q_spearman": -0.001841750417431737, + "eval/truth_std": 0.011446896413730248, + "wall_clock_s": 49.77327489852905, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/td.json new file mode 100644 index 0000000000000000000000000000000000000000..016009232279ef2bd887911290bb7887aaa497e4 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/2/td.json @@ -0,0 +1,123 @@ +{ + "method": "td", + "env": "visual-puzzle-3x3-play-v0", + "seed": 2, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.0009117407607845962, + 5.4393603932112455e-06, + 4.474584784475155e-06, + 4.81739289170946e-06, + 4.826188160222955e-06, + 5.254487405181862e-06, + 5.732536010327749e-06, + 4.0249865378427785e-06, + 4.44261240772903e-06, + 4.8801621232996695e-06, + 4.367894689494278e-06, + 8.360007996088825e-06, + 4.803511728823651e-06, + 4.238138444634387e-06, + 5.181236701901071e-06, + 3.949918209400494e-06, + 4.308625193516491e-06, + 3.623529892138322e-06, + 3.5488419598550536e-06, + 3.957788067054935e-06, + 3.946439392166212e-06, + 4.449716016097227e-06, + 3.952579845645232e-06, + 4.324317615100881e-06, + 4.5290798880159855e-06, + 3.1656122700951528e-06, + 5.1037868615821935e-06, + 4.201405317871831e-06, + 8.674192940816283e-06, + 4.629396244126838e-06, + 4.312078090151772e-06, + 3.1061936169862747e-06, + 3.6707233448396437e-06, + 4.410880592331523e-06, + 3.857937826978741e-06, + 5.9873386817344e-06, + 5.843794497195631e-06, + 3.567578687579953e-06, + 5.250517460808624e-06, + 4.246754542691633e-06, + 7.172588993853424e-06, + 7.115767857612809e-06, + 3.6871113024972146e-06, + 3.488460151856998e-06, + 3.4000220239249757e-06, + 5.6668345678190235e-06, + 3.277311861893395e-06, + 3.5255882266937988e-06, + 4.133057245780947e-06, + 4.664694642997347e-06, + 3.9704059417999815e-06 + ], + "train/q_mse": [ + 0.0009117407607845962, + 5.4393603932112455e-06, + 4.474584784475155e-06, + 4.81739289170946e-06, + 4.826188160222955e-06, + 5.254487405181862e-06, + 5.732536010327749e-06, + 4.0249865378427785e-06, + 4.44261240772903e-06, + 4.8801621232996695e-06, + 4.367894689494278e-06, + 8.360007996088825e-06, + 4.803511728823651e-06, + 4.238138444634387e-06, + 5.181236701901071e-06, + 3.949918209400494e-06, + 4.308625193516491e-06, + 3.623529892138322e-06, + 3.5488419598550536e-06, + 3.957788067054935e-06, + 3.946439392166212e-06, + 4.449716016097227e-06, + 3.952579845645232e-06, + 4.324317615100881e-06, + 4.5290798880159855e-06, + 3.1656122700951528e-06, + 5.1037868615821935e-06, + 4.201405317871831e-06, + 8.674192940816283e-06, + 4.629396244126838e-06, + 4.312078090151772e-06, + 3.1061936169862747e-06, + 3.6707233448396437e-06, + 4.410880592331523e-06, + 3.857937826978741e-06, + 5.9873386817344e-06, + 5.843794497195631e-06, + 3.567578687579953e-06, + 5.250517460808624e-06, + 4.246754542691633e-06, + 7.172588993853424e-06, + 7.115767857612809e-06, + 3.6871113024972146e-06, + 3.488460151856998e-06, + 3.4000220239249757e-06, + 5.6668345678190235e-06, + 3.277311861893395e-06, + 3.5255882266937988e-06, + 4.133057245780947e-06, + 4.664694642997347e-06, + 3.9704059417999815e-06 + ], + "eval/q_mse": 0.1951895251679614, + "eval/q_mae": 0.44165005798381674, + "eval/q_corr": 0.07182346057517712, + "eval/q_spearman": 0.08533443600767049, + "eval/truth_std": 0.011446896413730248, + "wall_clock_s": 118.18665862083435, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..0d3501716e643366e5a835691e41726e9c09ce56 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/genq.json @@ -0,0 +1,121 @@ +{ + "method": "genq_reward_latent", + "env": "visual-puzzle-3x3-play-v0", + "seed": 3, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 0.9782455563545227, + 0.44427141547203064, + 0.2513529062271118, + 0.25645506381988525, + 0.25300535559654236, + 0.22159214317798615, + 0.24054694175720215, + 0.24258647859096527, + 0.21553190052509308, + 0.22055687010288239, + 0.23031868040561676, + 0.1973576545715332, + 0.2200295776128769, + 0.17224003374576569, + 0.24014726281166077, + 0.2027468979358673, + 0.23267236351966858, + 0.2181975543498993, + 0.22526872158050537, + 0.20029038190841675, + 0.1863209307193756, + 0.19829438626766205, + 0.22926747798919678, + 0.18782304227352142, + 0.19903340935707092, + 0.21145157516002655, + 0.20335812866687775, + 0.21936026215553284, + 0.19507180154323578, + 0.161751389503479, + 0.20948335528373718, + 0.16540610790252686, + 0.17502406239509583, + 0.227451354265213, + 0.18766430020332336, + 0.21271398663520813, + 0.18983983993530273, + 0.21147474646568298, + 0.20223787426948547, + 0.17084136605262756, + 0.18709564208984375, + 0.181624636054039, + 0.19940930604934692, + 0.18329596519470215, + 0.2112322747707367, + 0.1833573281764984, + 0.17285016179084778, + 0.17316660284996033, + 0.20006756484508514, + 0.18272365629673004, + 0.19811692833900452 + ], + "train/q_mse": [ + 0.05627379084375046 + ], + "latent/reward_mse": 2.1702486264985055e-05, + "eval/q_mse": 0.05627379084375046, + "eval/q_mae": 0.23506933954390952, + "eval/q_corr": 0.050921992630317124, + "eval/q_spearman": 0.07428393350308007, + "eval/q_mse_by_n": { + "1": 0.0890390743371805, + "2": 0.06560755607663402, + "4": 0.06144249002532289, + "8": 0.055597929424343696, + "16": 0.06065228176157518, + "32": 0.0582575657367786, + "64": 0.05718524699761326, + "128": 0.05662805287235198, + "256": 0.057369118352628055 + }, + "eval/q_corr_by_n": { + "1": 0.08379193345611254, + "2": -0.029921736963810452, + "4": -0.007816767436413236, + "8": -0.06402912864250075, + "16": -0.017607984206427386, + "32": 0.01195957887538429, + "64": -0.11360552681113051, + "128": 0.04791701715106784, + "256": 0.04951509644648982 + }, + "eval/q_mse_vs_N": [ + 0.0890390743371805, + 0.06560755607663402, + 0.06144249002532289, + 0.055597929424343696, + 0.06065228176157518, + 0.0582575657367786, + 0.05718524699761326, + 0.05662805287235198, + 0.057369118352628055 + ], + "eval/N_final": 256, + "eval/truth_std": 0.01145595607353215, + "wall_clock_s": 208.27379155158997, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..941608417ba209e66e4b12fe0241a87537110f62 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/mc.json @@ -0,0 +1,123 @@ +{ + "method": "mc", + "env": "visual-puzzle-3x3-play-v0", + "seed": 3, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.32887721061706543, + 0.0184823889285326, + 0.016251366585493088, + 0.015726014971733093, + 0.016073077917099, + 0.015450923703610897, + 0.01689937710762024, + 0.01215272769331932, + 0.014407731592655182, + 0.017734870314598083, + 0.01689053326845169, + 0.01443566009402275, + 0.014742393977940083, + 0.014288846403360367, + 0.015843406319618225, + 0.012200770899653435, + 0.013554404489696026, + 0.011608617380261421, + 0.01359566766768694, + 0.011341533623635769, + 0.010478483512997627, + 0.01161889173090458, + 0.010681595653295517, + 0.00920659489929676, + 0.008972404524683952, + 0.010758858174085617, + 0.010782594792544842, + 0.006825141608715057, + 0.008270544931292534, + 0.007726939860731363, + 0.007580457255244255, + 0.007060015574097633, + 0.008039627224206924, + 0.0065657468512654305, + 0.00760623486712575, + 0.0070298947393894196, + 0.005899860057979822, + 0.0057176207192242146, + 0.005949524696916342, + 0.005750499665737152, + 0.0046784947626292706, + 0.004173046909272671, + 0.003770597046241164, + 0.004624794237315655, + 0.00455064419656992, + 0.004738840274512768, + 0.004517941270023584, + 0.0044085122644901276, + 0.004201848059892654, + 0.003777845995500684, + 0.0032655836548656225 + ], + "train/q_mse": [ + 0.32887721061706543, + 0.0184823889285326, + 0.016251366585493088, + 0.015726014971733093, + 0.016073077917099, + 0.015450923703610897, + 0.01689937710762024, + 0.01215272769331932, + 0.014407731592655182, + 0.017734870314598083, + 0.01689053326845169, + 0.01443566009402275, + 0.014742393977940083, + 0.014288846403360367, + 0.015843406319618225, + 0.012200770899653435, + 0.013554404489696026, + 0.011608617380261421, + 0.01359566766768694, + 0.011341533623635769, + 0.010478483512997627, + 0.01161889173090458, + 0.010681595653295517, + 0.00920659489929676, + 0.008972404524683952, + 0.010758858174085617, + 0.010782594792544842, + 0.006825141608715057, + 0.008270544931292534, + 0.007726939860731363, + 0.007580457255244255, + 0.007060015574097633, + 0.008039627224206924, + 0.0065657468512654305, + 0.00760623486712575, + 0.0070298947393894196, + 0.005899860057979822, + 0.0057176207192242146, + 0.005949524696916342, + 0.005750499665737152, + 0.0046784947626292706, + 0.004173046909272671, + 0.003770597046241164, + 0.004624794237315655, + 0.00455064419656992, + 0.004738840274512768, + 0.004517941270023584, + 0.0044085122644901276, + 0.004201848059892654, + 0.003777845995500684, + 0.0032655836548656225 + ], + "eval/q_mse": 0.16179320176005468, + "eval/q_mae": 0.38252232596642183, + "eval/q_corr": 0.03019245794959327, + "eval/q_spearman": 0.047271594047414586, + "eval/truth_std": 0.01145595607353215, + "wall_clock_s": 50.29546141624451, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/td.json new file mode 100644 index 0000000000000000000000000000000000000000..0d9f8b2a34363b5278cc8df5c7ddbc3ce1cf0ce9 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/3/td.json @@ -0,0 +1,123 @@ +{ + "method": "td", + "env": "visual-puzzle-3x3-play-v0", + "seed": 3, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.002337625715881586, + 5.740203505411046e-06, + 4.30700356446323e-06, + 5.171712473384105e-06, + 5.102906470710877e-06, + 4.104509116586996e-06, + 5.143627276993357e-06, + 4.495537268667249e-06, + 4.2764086174429394e-06, + 4.64982485937071e-06, + 3.9826500142225996e-06, + 5.766546109953197e-06, + 5.146061994310003e-06, + 3.4094923648808617e-06, + 4.137223186262418e-06, + 4.748269020637963e-06, + 3.421435849304544e-06, + 4.680872280005133e-06, + 5.169044925423805e-06, + 5.0218741307617165e-06, + 3.403627033549128e-06, + 7.118766916391905e-06, + 3.8282214518403634e-06, + 3.5068019315076526e-06, + 4.453886504052207e-06, + 4.005321443401044e-06, + 3.963611561630387e-06, + 3.5469520298647694e-06, + 3.3036731110769324e-06, + 8.62198976392392e-06, + 3.7550055367319146e-06, + 4.1472167140454985e-06, + 5.99345867158263e-06, + 3.56340137841471e-06, + 6.240554284886457e-06, + 4.807648110727314e-06, + 5.522140781977214e-06, + 4.200266175757861e-06, + 4.711405381385703e-06, + 5.466799848363735e-06, + 3.907559403160121e-06, + 3.46969591191737e-06, + 3.7734655506937997e-06, + 4.850208370044129e-06, + 3.5566936276154593e-06, + 4.298575731809251e-06, + 3.6074325180379674e-06, + 3.9186616049846634e-06, + 4.085369255335536e-06, + 6.069251412554877e-06, + 3.325084662719746e-06 + ], + "train/q_mse": [ + 0.002337625715881586, + 5.740203505411046e-06, + 4.30700356446323e-06, + 5.171712473384105e-06, + 5.102906470710877e-06, + 4.104509116586996e-06, + 5.143627276993357e-06, + 4.495537268667249e-06, + 4.2764086174429394e-06, + 4.64982485937071e-06, + 3.9826500142225996e-06, + 5.766546109953197e-06, + 5.146061994310003e-06, + 3.4094923648808617e-06, + 4.137223186262418e-06, + 4.748269020637963e-06, + 3.421435849304544e-06, + 4.680872280005133e-06, + 5.169044925423805e-06, + 5.0218741307617165e-06, + 3.403627033549128e-06, + 7.118766916391905e-06, + 3.8282214518403634e-06, + 3.5068019315076526e-06, + 4.453886504052207e-06, + 4.005321443401044e-06, + 3.963611561630387e-06, + 3.5469520298647694e-06, + 3.3036731110769324e-06, + 8.62198976392392e-06, + 3.7550055367319146e-06, + 4.1472167140454985e-06, + 5.99345867158263e-06, + 3.56340137841471e-06, + 6.240554284886457e-06, + 4.807648110727314e-06, + 5.522140781977214e-06, + 4.200266175757861e-06, + 4.711405381385703e-06, + 5.466799848363735e-06, + 3.907559403160121e-06, + 3.46969591191737e-06, + 3.7734655506937997e-06, + 4.850208370044129e-06, + 3.5566936276154593e-06, + 4.298575731809251e-06, + 3.6074325180379674e-06, + 3.9186616049846634e-06, + 4.085369255335536e-06, + 6.069251412554877e-06, + 3.325084662719746e-06 + ], + "eval/q_mse": 0.18596360105044027, + "eval/q_mae": 0.4310753625336595, + "eval/q_corr": -0.03173402573719374, + "eval/q_spearman": -0.03990459237768764, + "eval/truth_std": 0.01145595607353215, + "wall_clock_s": 120.29559874534607, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/genq.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/genq.json new file mode 100644 index 0000000000000000000000000000000000000000..84d49b75519d4206f565ed87aed895f7bbe5b188 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/genq.json @@ -0,0 +1,121 @@ +{ + "method": "genq_reward_latent", + "env": "visual-puzzle-3x3-play-v0", + "seed": 4, + "wandb_url": null, + "representation": "image_reward_predictive_latent", + "occ_model": "diffusion", + "z_dim": 8, + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "gen_sample_counts": [ + 1, + 2, + 4, + 8, + 16, + 32, + 64, + 128, + 256 + ], + "train/loss": [ + 1.019892930984497, + 0.4248729646205902, + 0.24708840250968933, + 0.2582969665527344, + 0.22500845789909363, + 0.2464507818222046, + 0.21035492420196533, + 0.23091760277748108, + 0.21091020107269287, + 0.22798123955726624, + 0.22061222791671753, + 0.23976722359657288, + 0.23086977005004883, + 0.19707626104354858, + 0.22658410668373108, + 0.21895770728588104, + 0.2098456770181656, + 0.23431675136089325, + 0.2306627482175827, + 0.17886599898338318, + 0.21544533967971802, + 0.21031345427036285, + 0.19956238567829132, + 0.2020793855190277, + 0.22815555334091187, + 0.22237959504127502, + 0.18172472715377808, + 0.2112666368484497, + 0.2072489857673645, + 0.1945192962884903, + 0.20812903344631195, + 0.2288488745689392, + 0.19235049188137054, + 0.21484673023223877, + 0.19197353720664978, + 0.24012184143066406, + 0.19207161664962769, + 0.20557308197021484, + 0.1931607574224472, + 0.18545930087566376, + 0.21581211686134338, + 0.2206421196460724, + 0.2071656733751297, + 0.18323364853858948, + 0.2132566273212433, + 0.20354220271110535, + 0.19931909441947937, + 0.2050253450870514, + 0.20356571674346924, + 0.2419741153717041, + 0.17199712991714478 + ], + "train/q_mse": [ + 0.05085395739655462 + ], + "latent/reward_mse": 2.5474451831541955e-05, + "eval/q_mse": 0.05085395739655462, + "eval/q_mae": 0.22185915743218212, + "eval/q_corr": -0.07876983680106972, + "eval/q_spearman": -0.09270143767739743, + "eval/q_mse_by_n": { + "1": 0.07356545741001524, + "2": 0.06689598549545636, + "4": 0.06212354072828871, + "8": 0.05356314045762392, + "16": 0.051019222542325, + "32": 0.051775144911726176, + "64": 0.05168495096245526, + "128": 0.05030355230130683, + "256": 0.05120412134205859 + }, + "eval/q_corr_by_n": { + "1": -0.03533544947859579, + "2": 0.028833294246466093, + "4": -0.05981882305186983, + "8": -0.022338602362678286, + "16": -0.08931320993877863, + "32": -0.00946746217080926, + "64": -0.12481975146034914, + "128": -0.04517909642739885, + "256": -0.07561273191550247 + }, + "eval/q_mse_vs_N": [ + 0.07356545741001524, + 0.06689598549545636, + 0.06212354072828871, + 0.05356314045762392, + 0.051019222542325, + 0.051775144911726176, + 0.05168495096245526, + 0.05030355230130683, + 0.05120412134205859 + ], + "eval/N_final": 256, + "eval/truth_std": 0.012477610209021018, + "wall_clock_s": 240.11588740348816, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/mc.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/mc.json new file mode 100644 index 0000000000000000000000000000000000000000..cd9c068b05074418dee068602f8575ef80f1fa63 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/mc.json @@ -0,0 +1,123 @@ +{ + "method": "mc", + "env": "visual-puzzle-3x3-play-v0", + "seed": 4, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.3973221182823181, + 0.013537771999835968, + 0.015678435564041138, + 0.015875155106186867, + 0.017030376940965652, + 0.015400794334709644, + 0.015258473344147205, + 0.01566459611058235, + 0.010292736813426018, + 0.018598206341266632, + 0.016016345471143723, + 0.012465794570744038, + 0.014229320921003819, + 0.016180628910660744, + 0.01499403826892376, + 0.011049514636397362, + 0.012883918359875679, + 0.013760831207036972, + 0.011692577973008156, + 0.014100328087806702, + 0.012667085975408554, + 0.010539358481764793, + 0.010846260003745556, + 0.009626545011997223, + 0.010217661038041115, + 0.009936617687344551, + 0.009830178692936897, + 0.008203509263694286, + 0.006727797910571098, + 0.0091972965747118, + 0.007912425324320793, + 0.008086002431809902, + 0.008157597854733467, + 0.006099458783864975, + 0.006586033385246992, + 0.006268269848078489, + 0.006526589393615723, + 0.005477622151374817, + 0.004991190508008003, + 0.005297564435750246, + 0.004588456824421883, + 0.005517447367310524, + 0.004829523153603077, + 0.005221773404628038, + 0.004591044038534164, + 0.004627092741429806, + 0.004188260994851589, + 0.004291519522666931, + 0.0043603889644145966, + 0.0036656265147030354, + 0.004810389131307602 + ], + "train/q_mse": [ + 0.3973221182823181, + 0.013537771999835968, + 0.015678435564041138, + 0.015875155106186867, + 0.017030376940965652, + 0.015400794334709644, + 0.015258473344147205, + 0.01566459611058235, + 0.010292736813426018, + 0.018598206341266632, + 0.016016345471143723, + 0.012465794570744038, + 0.014229320921003819, + 0.016180628910660744, + 0.01499403826892376, + 0.011049514636397362, + 0.012883918359875679, + 0.013760831207036972, + 0.011692577973008156, + 0.014100328087806702, + 0.012667085975408554, + 0.010539358481764793, + 0.010846260003745556, + 0.009626545011997223, + 0.010217661038041115, + 0.009936617687344551, + 0.009830178692936897, + 0.008203509263694286, + 0.006727797910571098, + 0.0091972965747118, + 0.007912425324320793, + 0.008086002431809902, + 0.008157597854733467, + 0.006099458783864975, + 0.006586033385246992, + 0.006268269848078489, + 0.006526589393615723, + 0.005477622151374817, + 0.004991190508008003, + 0.005297564435750246, + 0.004588456824421883, + 0.005517447367310524, + 0.004829523153603077, + 0.005221773404628038, + 0.004591044038534164, + 0.004627092741429806, + 0.004188260994851589, + 0.004291519522666931, + 0.0043603889644145966, + 0.0036656265147030354, + 0.004810389131307602 + ], + "eval/q_mse": 0.17283664920890093, + "eval/q_mae": 0.3975993708263472, + "eval/q_corr": 0.01978606616708757, + "eval/q_spearman": 0.03376542431958184, + "eval/truth_std": 0.012477610209021018, + "wall_clock_s": 84.21893644332886, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/td.json b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/td.json new file mode 100644 index 0000000000000000000000000000000000000000..90f29e7ced88a85052bb5ba11e8bc6752cf2296b --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/results/4/td.json @@ -0,0 +1,123 @@ +{ + "method": "td", + "env": "visual-puzzle-3x3-play-v0", + "seed": 4, + "wandb_url": null, + "representation": "puzzle_state_46d", + "reward": "dense", + "truth_kind": "fresh_rollout", + "anchor_protocol": "fresh_reset", + "train/loss": [ + 0.0016132708406075835, + 5.28473719896283e-06, + 4.727103259938303e-06, + 4.402791091706604e-06, + 3.3223111586266896e-06, + 3.7768290894746315e-06, + 5.115973181091249e-06, + 5.008134849049384e-06, + 4.792467279912671e-06, + 3.981813733844319e-06, + 3.7284023619577056e-06, + 5.092437277198769e-06, + 6.037279945303453e-06, + 3.4828635762096383e-06, + 3.96143286707229e-06, + 5.226540451985784e-06, + 4.216956313030096e-06, + 3.6615813314710977e-06, + 3.93502432416426e-06, + 4.533366336545441e-06, + 4.87484794575721e-06, + 4.411196186993038e-06, + 3.908722646883689e-06, + 3.9617702896066476e-06, + 3.2414773158961907e-06, + 3.4550882901385194e-06, + 3.6995527352701174e-06, + 3.507384462864138e-06, + 3.0945584512664936e-06, + 3.95306597056333e-06, + 5.549504749069456e-06, + 3.846819708996918e-06, + 5.695990694221109e-06, + 4.43494354840368e-06, + 4.27822487836238e-06, + 4.084134161530528e-06, + 3.250039753766032e-06, + 3.831450612779008e-06, + 6.13951215200359e-06, + 4.288238869776251e-06, + 4.407696906127967e-06, + 3.7216980217635864e-06, + 4.2679212128859945e-06, + 3.0003220672369935e-06, + 4.292792255000677e-06, + 5.7487836784275714e-06, + 5.628341114061186e-06, + 4.015937520307489e-06, + 3.1506799587077694e-06, + 3.535206815286074e-06, + 4.741995326185133e-06 + ], + "train/q_mse": [ + 0.0016132708406075835, + 5.28473719896283e-06, + 4.727103259938303e-06, + 4.402791091706604e-06, + 3.3223111586266896e-06, + 3.7768290894746315e-06, + 5.115973181091249e-06, + 5.008134849049384e-06, + 4.792467279912671e-06, + 3.981813733844319e-06, + 3.7284023619577056e-06, + 5.092437277198769e-06, + 6.037279945303453e-06, + 3.4828635762096383e-06, + 3.96143286707229e-06, + 5.226540451985784e-06, + 4.216956313030096e-06, + 3.6615813314710977e-06, + 3.93502432416426e-06, + 4.533366336545441e-06, + 4.87484794575721e-06, + 4.411196186993038e-06, + 3.908722646883689e-06, + 3.9617702896066476e-06, + 3.2414773158961907e-06, + 3.4550882901385194e-06, + 3.6995527352701174e-06, + 3.507384462864138e-06, + 3.0945584512664936e-06, + 3.95306597056333e-06, + 5.549504749069456e-06, + 3.846819708996918e-06, + 5.695990694221109e-06, + 4.43494354840368e-06, + 4.27822487836238e-06, + 4.084134161530528e-06, + 3.250039753766032e-06, + 3.831450612779008e-06, + 6.13951215200359e-06, + 4.288238869776251e-06, + 4.407696906127967e-06, + 3.7216980217635864e-06, + 4.2679212128859945e-06, + 3.0003220672369935e-06, + 4.292792255000677e-06, + 5.7487836784275714e-06, + 5.628341114061186e-06, + 4.015937520307489e-06, + 3.1506799587077694e-06, + 3.535206815286074e-06, + 4.741995326185133e-06 + ], + "eval/q_mse": 0.19437737321053766, + "eval/q_mae": 0.4407005841027336, + "eval/q_corr": 0.0682576828322628, + "eval/q_spearman": 0.08410663393683149, + "eval/truth_std": 0.012477610209021018, + "wall_clock_s": 176.08823823928833, + "n_anchors": 200 +} \ No newline at end of file diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seed.py b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seed.py new file mode 100644 index 0000000000000000000000000000000000000000..0e58f676f19593ef8de392f8f4a630241c64cd7c --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seed.py @@ -0,0 +1,76 @@ +"""Run genq(image-latent) + mc + td for visual-puzzle-3x3-play-v0, ONE seed. + +The fresh-RESET fresh-rollout truth (ButtonMarkovOracle, match-fraction reward) is the +EXPENSIVE part and is identical across the three methods, so we build the shared anchor +pack + truth ONCE and pass it to all three. This mirrors the STATE puzzle honest-negative +exactly, only the model observation differs (image latent for genq; 46-D [qpos|qvel] +state for the mc/td reference). See ../../genq_visual_puzzle.py for the recipe. + + python run_seed.py --seed 0 + python run_seed.py --seed 0 --methods genq # subset +""" +import argparse +import json +import os +import sys + +_HERE = os.path.dirname(os.path.abspath(__file__)) +sys.path.insert(0, os.path.join(_HERE, "..", "..")) # preliminary_analysis on path + +import torch # noqa: E402 +_nt = int(os.environ.get("OMP_NUM_THREADS", "0") or 0) +if _nt > 0: + torch.set_num_threads(_nt) + +from config import make_cfg # noqa: E402 +import genq_visual_puzzle as gvp # noqa: E402 + +ENV = "visual-puzzle-3x3-play-v0" +_FN = {"genq": gvp.run, "mc": gvp.run_mc, "td": gvp.run_td} + + +def result_path(seed, method): + d = os.path.join(_HERE, "results", str(seed)) + os.makedirs(d, exist_ok=True) + return os.path.join(d, f"{method}.json") + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--methods", default="genq,mc,td") + ap.add_argument("--reward", default="dense") + ap.add_argument("--steps", type=int, default=None) + ap.add_argument("--latent_steps", type=int, default=None) + ap.add_argument("--n_anchors", type=int, default=None) + ap.add_argument("--truth_M", type=int, default=None) + ap.add_argument("--truth_H", type=int, default=None) + ap.add_argument("--vis_train_traj", type=int, default=None) + ap.add_argument("--wandb_mode", default="offline") + args = ap.parse_args() + + ov = {"reward": args.reward, "wandb_mode": args.wandb_mode} + for k in ("steps", "latent_steps", "n_anchors", "truth_M", "truth_H", "vis_train_traj"): + v = getattr(args, k) + if v is not None: + ov[k] = v + cfg = make_cfg(**ov) + # Puzzle reward scale: the match-fraction reward needs no sigma/eps tuning, but + # prepare_eval_anchors' manipspace branch (used only by the gc_core path) would set + # them; here we build the pack directly, so leave the (unused) defaults. + + methods = [m.strip() for m in args.methods.split(",") if m.strip()] + pack = None + truth = None + for method in methods: + result, pack, truth = _FN[method](ENV, args.seed, cfg, pack=pack, truth=truth) + path = result_path(args.seed, method) + with open(path, "w") as f: + json.dump(result, f, indent=2, allow_nan=True) + print(f"[vis-puzzle] wrote {path} eval/q_mse={result['eval/q_mse']:.5f} " + f"eval/q_corr={result.get('eval/q_corr')} truth_std={result['eval/truth_std']:.5f}", + flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seq.sh b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seq.sh new file mode 100644 index 0000000000000000000000000000000000000000..48f9144671192d4f13ce17622433cfd007ec2322 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seq.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +# Sequential visual-puzzle-3x3 policy-eval runner (#35). One seed at a time inside a +# single bsub -gpu num=1 allocation (Blue Vela GPUs are exclusive_process — no packed &). +# Each seed builds the fresh-RESET truth ONCE and shares it across genq/mc/td. +# Image CNN is heavy; keep ONE seed per process. Resume-safe. +# +# bsub -G grp_runtime -q normal -gpu "num=1/task:mode=shared" -M 128G \ +# -o preliminary_analysis/bsub_outputs/vispuzzle_%J.out \ +# -e preliminary_analysis/bsub_outputs/vispuzzle_%J.err \ +# -- bash preliminary_analysis/experiments/visual_puzzle_3x3_play_v0/run_seq.sh "0" +set -u +SEEDS="${1:-0}" +STEPS="${STEPS:-40000}" +LATENT_STEPS="${LATENT_STEPS:-20000}" +N_ANCHORS="${N_ANCHORS:-200}" +TRUTH_M="${TRUTH_M:-8}" +TRUTH_H="${TRUTH_H:-200}" + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$HERE/../../.." && pwd)" +PA="$ROOT/preliminary_analysis" +PY="$ROOT/.venv/bin/python" +[ -x "$PY" ] || PY="/proj/inf-scaling/zwhong/projs/gen_q/.venv/bin/python" +DRIVER="$HERE/run_seed.py" + +if [ -f "$ROOT/.env" ]; then set -a; . "$ROOT/.env"; set +a; fi +export OMP_NUM_THREADS=3 MKL_NUM_THREADS=3 OPENBLAS_NUM_THREADS=3 +export NUMEXPR_NUM_THREADS=3 VECLIB_MAXIMUM_THREADS=3 +export XLA_FLAGS="--xla_cpu_multi_thread_eigen=false intra_op_parallelism_threads=3" +export JAX_PLATFORMS=cpu XLA_PYTHON_CLIENT_MEM_FRACTION=0.3 MUJOCO_GL=egl +export WANDB_MODE=offline +# Resolve the OGBench data dir robustly: $HOME differs between login (/proj/...) and +# compute (/u/zwhong) nodes, so prefer the proj-space copy where the datasets live. +if [ -z "${OGBENCH_DATA_DIR:-}" ]; then + for cand in /proj/inf-scaling/zwhong/.ogbench/data "$HOME/.ogbench/data" /u/zwhong/.ogbench/data; do + [ -f "$cand/visual-puzzle-3x3-play-v0.npz" ] && OGBENCH_DATA_DIR="$cand" && break + done +fi +export OGBENCH_DATA_DIR="${OGBENCH_DATA_DIR:-/proj/inf-scaling/zwhong/.ogbench/data}" +echo "[vispuzzle-seq] OGBENCH_DATA_DIR=$OGBENCH_DATA_DIR" + +mkdir -p "$HERE/results" +cd "$PA" +echo "[vispuzzle-seq] host=$(hostname) SEEDS='$SEEDS' steps=$STEPS latent=$LATENT_STEPS n_anchors=$N_ANCHORS M=$TRUTH_M H=$TRUTH_H" + +fail=0 +for SEED in $SEEDS; do + # Resume: skip a seed only if all three method JSONs already carry fresh_rollout truth. + done_all=1 + for METHOD in genq mc td; do + out="$HERE/results/$SEED/$METHOD.json" + grep -q '"truth_kind": "fresh_rollout"' "$out" 2>/dev/null || done_all=0 + done + if [ "$done_all" = "1" ]; then echo "[vispuzzle-seq] SKIP seed=$SEED (all done)"; continue; fi + echo "[vispuzzle-seq] === seed=$SEED ===" + "$PY" "$DRIVER" --seed "$SEED" --methods genq,mc,td \ + --reward dense --steps "$STEPS" --latent_steps "$LATENT_STEPS" \ + --n_anchors "$N_ANCHORS" --truth_M "$TRUTH_M" --truth_H "$TRUTH_H" \ + --wandb_mode offline \ + > "$HERE/results/seed${SEED}.log" 2>&1 \ + || { echo "[vispuzzle-seq] FAILED seed=$SEED"; tail -15 "$HERE/results/seed${SEED}.log"; fail=1; } +done + +"$PY" plots.py --env "visual-puzzle-3x3-play-v0" || true +echo "[vispuzzle-seq] done fail=$fail" +exit "$fail" diff --git a/gen_q_rsm/preliminary_analysis/gc_core.py b/gen_q_rsm/preliminary_analysis/gc_core.py new file mode 100644 index 0000000000000000000000000000000000000000..ae5c416cdb0cfbdd932ddac530289b69806f5755 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/gc_core.py @@ -0,0 +1,1612 @@ +"""Self-contained goal-conditioned core for the policy-evaluation methods. + +This module vendors (copies / lightly adapts) the goal-conditioned occupancy + +fresh-rollout machinery so ``preliminary_analysis/`` does not import from +any legacy tree at all. OGBench is goal-conditioned RL, so every quantity here is +conditioned on a goal g: + + Q^pi(s, a, g) = E_{x ~ d^pi_gamma(. | s, a, g)} [ r(x; g) ], + r(x; g) = exp(-||x_xy - g||^2 / 2 sigma^2) (dense) or 1[||x_xy - g|| < eps] (sparse). + +The occupancy model is a conditional diffusion (or flow-matching) model + p_theta(x_{t+k} | s_t, a_t, g), k ~ Geom(1-gamma). + +Goals for training come from HINDSIGHT relabeling (the data has no goal labels): +g = xy of a state downstream of the occupancy target in the same trajectory. + +GROUND TRUTH (headline, for MSE / correlation) is ALWAYS fresh on-policy rollouts: +``gc_fresh_truth_pointmaze`` rolls the data-collection behaviour policy (OGBench +scripted oracle-subgoal controller + N(0,0.2) noise) M times from each anchor and +averages the renormalized discounted goal-reaching return. We never substitute +in-dataset return-to-go for the truth. +""" +import numpy as np +import torch + +import models + + +# ---------------------------------------------------------------------------- +# dataset + geometric-horizon / hindsight-goal sampling +# ---------------------------------------------------------------------------- +def trajectory_bounds(terminals): + N = len(terminals) + ends = np.where(terminals > 0.5)[0] + 1 + if len(ends) == 0 or ends[-1] != N: + ends = np.append(ends, N) + end_per_idx = np.empty(N, dtype=np.int64) + start = 0 + for e in ends: + end_per_idx[start:e] = e + start = e + return end_per_idx + + +MANIPSPACE_FAMILIES = ("cube", "scene", "puzzle") + + +def manipspace_family(env_id): + """Return 'cube' / 'scene' / 'puzzle' for a manipspace env_id, else None.""" + for fam in MANIPSPACE_FAMILIES: + if env_id.startswith(fam) or f"-{fam}" in env_id or f"_{fam}" in env_id: + return fam + return None + + +def is_manipspace(env_id): + return manipspace_family(env_id) is not None + + +def load_ogbench_gc(env_id, gamma, dataset_dir="~/.ogbench/data", state_slice="auto"): + """Return (train, val) dicts with obs/act/end. + + `state_slice` controls the CONDITIONING state representation in `obs`: + - "auto": xy (obs[:, :2]) for mazes, full obs otherwise (back-compat default). + - "full": keep the full observation (e.g. AntMaze raw 29-D state occupancy). + - "xy": force xy. + The occupancy TARGET is always the xy position (first 2 dims) for mazes; callers + slice `obs[:, :pos]` for the target. For full-state mazes the conditioning is the + full state while the target stays xy — that is "raw N-D state occupancy". + + For the **manipspace** families (cube / scene / puzzle) the obs is a lossy + projection that does not expose raw object coordinates, so we load the dataset + with ``add_info=True`` and derive the per-step occupancy TARGET from privileged + qpos (object position; see ``manipspace_target_array``). The conditioning ``obs`` + stays the full normalized observation; only the target/goal use privileged coords. + The returned dicts then also carry an ``obj`` array ([N, pos_dim]) — the privileged + occupancy target — and the methods use ``obj`` instead of ``obs[:, :pos]``. + """ + import ogbench + fam = manipspace_family(env_id) + if fam is not None: + return _load_manipspace_gc(env_id, fam, dataset_dir) + # AntSoccer is special: the task is to dribble the BALL, not move the ant. The + # occupancy target / goal is the BALL xy (obs[:, 15:17]), NOT the ant xy (obs[:, :2]). + # Conditioning is the full 42-D state; the target rides in `obj` like the manipspace + # privileged target. + if "antsoccer" in env_id: + return _load_antsoccer_gc(env_id, dataset_dir) + env, train_ds, val_ds = ogbench.make_env_and_datasets(env_id, dataset_dir=dataset_dir) + is_maze = any(k in env_id for k in ("pointmaze", "antmaze", "humanoidmaze", "antsoccer")) + # AntSoccer: the reward / occupancy TARGET is the BALL xy, not the agent xy. The + # obs is the full MuJoCo state (qpos[22]+qvel[20] == obs[:42]); ball xy = obs[15:17] + # (the ball free-joint position). We therefore condition on the FULL 42-D state and + # carry a ``target_slice`` so ``_target_array`` / goal sampling read the ball xy. + is_antsoccer = "antsoccer" in env_id + target_slice = (15, 17) if is_antsoccer else None + if state_slice == "auto": + mode = "full" if is_antsoccer else ("xy" if is_maze else "full") + else: + mode = state_slice + sl = (lambda x: x[:, :2]) if mode == "xy" else (lambda x: x) + out = [] + for ds in (train_ds, val_ds): + obs = sl(np.asarray(ds["observations"], dtype=np.float32)) + act = np.asarray(ds["actions"], dtype=np.float32) + end = trajectory_bounds(np.asarray(ds["terminals"], dtype=np.float32)) + d = dict(obs=obs, act=act, end=end, N=len(obs), + s_dim=obs.shape[1], a_dim=act.shape[1]) + if target_slice is not None: + d["target_slice"] = target_slice + d["pos_dim"] = target_slice[1] - target_slice[0] + out.append(d) + return out[0], out[1], env, is_maze + + +# AntSoccer observation layout (verified empirically via set_agent_ball_xy + get_ob): +# obs[:, 0:2] = ant (agent) xy +# obs[:, 15:17] = BALL xy <- the task-relevant position / occupancy target +ANTSOCCER_BALL_SLICE = (15, 17) + + +def _load_antsoccer_gc(env_id, dataset_dir): + """AntSoccer loader. Conditioning obs = full 42-D state; occupancy TARGET = ball xy + (obs[:, 15:17]) carried in ``obj`` so ``_target_array`` returns the ball, NOT the ant. + ``add_info=True`` provides per-step qpos[22]/qvel[20] for resettable rollouts.""" + import ogbench + lo, hi = ANTSOCCER_BALL_SLICE + env, train_ds, val_ds = ogbench.make_env_and_datasets( + env_id, dataset_dir=dataset_dir, add_info=True) + out = [] + for ds in (train_ds, val_ds): + obs = np.asarray(ds["observations"], dtype=np.float32) + act = np.asarray(ds["actions"], dtype=np.float32) + end = trajectory_bounds(np.asarray(ds["terminals"], dtype=np.float32)) + obj = obs[:, lo:hi].copy() # ball xy = occupancy target + out.append(dict(obs=obs, act=act, end=end, N=len(obs), + s_dim=obs.shape[1], a_dim=act.shape[1], + obj=obj, qpos=np.asarray(ds["qpos"], dtype=np.float32), + qvel=np.asarray(ds["qvel"], dtype=np.float32), + antsoccer=True, pos_dim=2)) + return out[0], out[1], env, True + + +# qpos slices of EVERY block's free-joint position, per family. +# Verified for cube-single (block_0 free body is the last 7-D free joint, pos = qpos[14:17]) +# and cube-double (block_0 = qpos[14:17], block_1 = qpos[21:24]) by matching +# info['privileged/block__pos'] to the qpos slice at reset. +def _manipspace_block_qpos_slices(env, fam): + """Resolve the per-block qpos slices [lo, hi) giving each cube's 3-D position. + + Returns a LIST of (lo, hi) windows, one per block (cube-single -> 1 window, + cube-double -> 2). The occupancy TARGET concatenates all block positions so that + the model predicts the future configuration of EVERY block; this is required for + cube-double where the eval ``target_block`` alternates between blocks and a single + fixed block_0 target gives no Q-signal for target_block==1 (see issue #35). + For puzzle the occupancy target is the button-state vector (handled separately), + so this returns None. + """ + if fam == "puzzle": + return None + ob, info = env.reset(seed=0) + qpos = np.asarray(info["qpos"], dtype=np.float64) + block_keys = sorted(k for k in info + if k.startswith("privileged/block_") and k.endswith("_pos")) + slices = [] + for k in block_keys: + bp = np.asarray(info[k], dtype=np.float64) + found = None + for i in range(len(qpos) - 2): + if np.allclose(qpos[i:i + 3], bp, atol=1e-5): + found = (i, i + 3) + break + if found is None: + raise gc_core_error(f"could not locate qpos slice for {k} ({fam})") + slices.append(found) + if not slices: + raise gc_core_error(f"no block_*_pos keys found for {fam}") + return slices + + +class gc_core_error(RuntimeError): + pass + + +# ---------------------------------------------------------------------------- +# Scene multi-task occupancy target: a fixed-dim, task-AGNOSTIC representation. +# ---------------------------------------------------------------------------- +# scene-play-v0 is a *multi-task* env: each episode the data-collection oracle is +# keyed on info['privileged/target_task'] in {cube, button, drawer, window} and +# manipulates a DIFFERENT object. A cube-only occupancy target (as cube-single uses) +# is degenerate here — ~73% of anchors are NOT cube tasks, so the cube barely moves +# and a cube-position reward carries no signal. We therefore use the env's own 7-D +# *oracle goal representation* (SceneEnv.compute_oracle_observation) as the occupancy +# TARGET x and goal g for ALL four tasks. It is fixed-dim and exposes every +# manipulated object in one vector: +# [ (block_0_pos - center) * 10 (3) | button_states (2) | drawer_pos * 18 (1) | +# window_pos * 15 (1) ] == 7-D. +# The per-task goal g is this same vector with the manipulated component replaced by +# its target value. ||x - g|| then measures how close the manipulated object is to +# its target across every task, exactly mirroring the maze xy goal-reaching reward. +# See issue #35: this is the documented scene deviation from FRESH_RESET_SPEC's +# "target_block_pos" (which only covered the cube sub-task). +_SCENE_XYZ_CENTER = np.array([0.425, 0.0, 0.0]) +_SCENE_XYZ_SCALER = 10.0 +_SCENE_DRAWER_SCALER = 18.0 +_SCENE_WINDOW_SCALER = 15.0 +SCENE_OCC_DIM = 7 + + +def _scene_oracle_vec_from_parts(block0_pos, button_states, drawer_pos, window_pos): + """Assemble the 7-D scene oracle representation from raw privileged parts.""" + block0_pos = np.asarray(block0_pos, dtype=np.float64).reshape(3) + bs = np.asarray(button_states, dtype=np.float64).reshape(-1)[:2] + return np.concatenate([ + (block0_pos - _SCENE_XYZ_CENTER) * _SCENE_XYZ_SCALER, + bs, + np.array([float(np.asarray(drawer_pos).ravel()[0]) * _SCENE_DRAWER_SCALER]), + np.array([float(np.asarray(window_pos).ravel()[0]) * _SCENE_WINDOW_SCALER]), + ]).astype(np.float64) + + +def _scene_oracle_vec_from_info(info): + """7-D scene oracle representation from a live env info dict (current state).""" + return _scene_oracle_vec_from_parts( + info["privileged/block_0_pos"], + info["button_states"], + info["privileged/drawer_pos"], + info["privileged/window_pos"]) + + +def _scene_target_vec_from_info(info): + """7-D scene oracle TARGET config: the current oracle vector with the task's + manipulated component replaced by its target value.""" + cur = _scene_oracle_vec_from_info(info) + task = info["privileged/target_task"] + if task == "cube": + cur[0:3] = (np.asarray(info["privileged/target_block_pos"], dtype=np.float64) + - _SCENE_XYZ_CENTER) * _SCENE_XYZ_SCALER + elif task == "button": + tb = int(info["privileged/target_button"]) + cur[3 + tb] = float(np.asarray(info["privileged/target_button_state"]).ravel()[0]) + elif task == "drawer": + cur[5] = float(np.asarray(info["privileged/target_drawer_pos"]).ravel()[0]) * _SCENE_DRAWER_SCALER + elif task == "window": + cur[6] = float(np.asarray(info["privileged/target_window_pos"]).ravel()[0]) * _SCENE_WINDOW_SCALER + return cur + + +def _scene_obj_array_from_dataset(ds): + """Reconstruct the per-row 7-D scene oracle target array from dataset qpos + + button_states. block_0_pos = qpos[14:17], drawer = qpos[23], window = qpos[24] + (verified against the live scene model joint qposadr).""" + qpos = np.asarray(ds["qpos"], dtype=np.float64) + bs = np.asarray(ds["button_states"], dtype=np.float64) + block0 = qpos[:, 14:17] + drawer = qpos[:, 23] + window = qpos[:, 24] + out = np.empty((len(qpos), SCENE_OCC_DIM), dtype=np.float32) + out[:, 0:3] = (block0 - _SCENE_XYZ_CENTER[None]) * _SCENE_XYZ_SCALER + out[:, 3:5] = bs[:, :2] + out[:, 5] = drawer * _SCENE_DRAWER_SCALER + out[:, 6] = window * _SCENE_WINDOW_SCALER + return out + + +def _load_manipspace_gc(env_id, fam, dataset_dir): + """Manipspace data loader: conditioning obs = full normalized observation, + occupancy TARGET = privileged object position (cube), the 7-D oracle representation + (scene, multi-task), or the button-state vector (puzzle), derived from the + add_info=True dataset (qpos / button_states).""" + import ogbench + env, train_ds, val_ds = ogbench.make_env_and_datasets( + env_id, dataset_dir=dataset_dir, add_info=True) + if fam == "puzzle": + slice_info = None + pos_dim = int(np.asarray(train_ds["button_states"]).shape[1]) + elif fam == "scene": + slice_info = None + pos_dim = SCENE_OCC_DIM + else: + slice_info = _manipspace_block_qpos_slices(env, fam) # list of (lo, hi) per block + pos_dim = sum(hi - lo for (lo, hi) in slice_info) + out = [] + for ds in (train_ds, val_ds): + obs = np.asarray(ds["observations"], dtype=np.float32) + act = np.asarray(ds["actions"], dtype=np.float32) + end = trajectory_bounds(np.asarray(ds["terminals"], dtype=np.float32)) + if fam == "puzzle": + obj = np.asarray(ds["button_states"], dtype=np.float32) + elif fam == "scene": + obj = _scene_obj_array_from_dataset(ds) + else: + qpos = np.asarray(ds["qpos"], dtype=np.float32) + # occupancy target = ALL block positions concatenated [N, 3*n_blocks] + obj = np.concatenate([qpos[:, lo:hi] for (lo, hi) in slice_info], + axis=1).astype(np.float32) + out.append(dict(obs=obs, act=act, end=end, N=len(obs), + s_dim=obs.shape[1], a_dim=act.shape[1], + obj=obj, manipspace=True, family=fam, pos_dim=pos_dim)) + env.close() + return out[0], out[1], env, False + + +def future_idx(t, end, gamma, rng): + """Truncated-geometric future index j = t + k, k ~ Geom(1-gamma).""" + L = end[t] - t + logg = np.log(gamma) + Fmax = np.maximum(1.0 - gamma ** L, 1e-12) + u = rng.random(len(t)) * Fmax + k = np.clip(np.ceil(np.log1p(-u) / logg).astype(np.int64) - 1, 0, L - 1) + return t + k + + +def sample_goal_after(j, end, rng): + """Hindsight goal index at or after the occupancy target j (same trajectory).""" + e = end[j] + span = np.maximum(e - j, 1) + return np.clip(j + (rng.random(len(j)) * span).astype(np.int64), 0, e - 1) + + +def sample_goal_idx(t, end, rng, frac_lo=0.25): + """Hindsight goal index downstream of anchor t (biased to latter half).""" + L = end[t] - t + lo = (frac_lo * L).astype(np.int64) + span = np.maximum(L - 1 - lo, 1) + return np.clip(t + lo + (rng.random(len(t)) * span).astype(np.int64), 0, end[t] - 1) + + +def anchors_with_min_horizon(ds, n, min_h, rng): + rem = ds["end"] - np.arange(ds["N"]) + valid = np.where(rem >= min_h)[0] + if len(valid) == 0: + valid = np.arange(ds["N"]) + return valid[rng.integers(0, len(valid), size=n)] + + +# ---------------------------------------------------------------------------- +# goal-reaching reward +# ---------------------------------------------------------------------------- +def reward_of_dist(d, kind, sigma, eps): + if kind == "sparse": + return (d < eps).astype(np.float64) + return np.exp(-(d ** 2) / (2 * sigma ** 2)) + + +def reward_of_dist_t(d, kind, sigma, eps): + if kind == "sparse": + return (d < eps).float() + return torch.exp(-(d ** 2) / (2 * sigma ** 2)) + + +# ---------------------------------------------------------------------------- +# PUZZLE-specific button-state reward (issue #35 caveat fix) +# ---------------------------------------------------------------------------- +# The puzzle occupancy TARGET x and goal g are BINARY button-state vectors +# (length = num_buttons: 9 for 3x3, 16 for 4x4), NOT object positions. The shared +# position-distance reward `reward_of_dist` with the manip default sigma=0.05 / eps=0.04 +# is meaningless here: ||x - g|| = sqrt(Hamming distance), which is 0..sqrt(num_buttons) +# (and is exactly 1 at the anchor, where g differs from the current state in the single +# target button). exp(-1 / (2*0.05^2)) = exp(-200) ~ 0 saturates the reward to 0 for +# every realistic Hamming distance, so the truth has ~no spread and Q is unrankable. +# +# Principled replacement (used IDENTICALLY by occ_q, MC, TD and the fresh-rollout truth): +# r(x; g) = match-fraction = mean( round(x) == round(g) ) -- continuous in [0,1]. +# This is the natural "task-progress toward the goal button pattern" reward: 1 when the +# realized button vector equals the goal pattern, ~ (num_buttons-1)/num_buttons at the +# anchor (one button off). It is invariant to the binary embedding scale and needs no +# sigma tuning. Occupancy samples x are continuous (diffusion output) so we round each +# coordinate to the nearest bit before comparison. +# sparse variant: r = 1[ all buttons match ] = 1[ Hamming(x,g) == 0 ] -- exact pattern +# match (== the env's own Lights-Out success), continuous methods see it as 1[ match +# fraction == 1 ]. +PUZZLE_MATCH_TOL = 0.5 # |round to nearest bit| threshold + + +def puzzle_reward(x, g, kind): + """Button-state match-fraction reward (numpy). x, g: [..., num_buttons].""" + x = np.asarray(x, dtype=np.float64) + g = np.asarray(g, dtype=np.float64) + match = (np.abs(np.round(x) - np.round(g)) < PUZZLE_MATCH_TOL).astype(np.float64) + frac = match.mean(axis=-1) + if kind == "sparse": + return (frac >= 1.0 - 1e-9).astype(np.float64) # exact full-pattern match + return frac + + +def puzzle_reward_t(x, g, kind): + """Button-state match-fraction reward (torch). x: [..., D], g: [..., D].""" + match = (torch.abs(torch.round(x) - torch.round(g)) < PUZZLE_MATCH_TOL).float() + frac = match.mean(dim=-1) + if kind == "sparse": + return (frac >= 1.0 - 1e-9).float() + return frac + + +# ---------------------------------------------------------------------------- +# occupancy model build / train / Q (all goal-conditioned) +# ---------------------------------------------------------------------------- +def build_occupancy(occ_model, cond_dim, y_dim, cfg, device): + if occ_model == "diffusion": + m = models.ConditionalDiffusion(cond_dim, y_dim, hidden_dim=cfg["hidden_dim"], + num_layers=cfg["num_layers"], + T=cfg.get("diffusion_T", 100), + sample_steps=cfg.get("sample_steps", 30)) + elif occ_model == "flow": + m = models.ConditionalFlowMatching(cond_dim, y_dim, hidden_dim=cfg["hidden_dim"], + num_layers=cfg["num_layers"], + sample_steps=cfg.get("sample_steps", 30)) + else: + raise ValueError(f"occ_model must be 'diffusion' or 'flow', got {occ_model!r}") + return m.to(device) + + +def _target_array(ds, cfg): + """Occupancy TARGET x per dataset row: privileged object position for manipspace / + AntSoccer (``ds['obj']`` — ball xy for antsoccer), a non-leading slice of the obs + when ``target_slice`` is set, else the leading xy slice of the obs (mazes).""" + if ds.get("manipspace") or ds.get("antsoccer"): + return ds["obj"] + ts = ds.get("target_slice") + if ts is not None: + lo, hi = ts + return ds["obs"][:, lo:hi] + pos = cfg.get("pos_dim", 2) + return ds["obs"][:, :pos] + + +def train_gc_occupancy(occ, ds, gamma, cfg, device, seed, wandb_log=None): + """Train p_theta(x_{t+k} | s, a, g) on geometric-horizon targets x with hindsight + goals. For mazes x = future xy; for manipspace x = future privileged object + position (the goal g is a hindsight object position downstream). Returns the + periodic loss curve.""" + obs, act, end = ds["obs"], ds["act"], ds["end"] + pos = cfg.get("pos_dim", 2) + xy = _target_array(ds, cfg) # [N, pos] occupancy target (obj pos or xy) + rng = np.random.default_rng(seed) + # normalization from a sample + t0 = rng.integers(0, ds["N"], 20000) + j0 = future_idx(t0, end, gamma, rng) + g0 = xy[sample_goal_after(j0, end, rng)] + c0 = np.concatenate([obs[t0], act[t0], g0], 1) + occ.set_normalization(c0.mean(0), c0.std(0) + 1e-6, xy[j0].mean(0), xy[j0].std(0) + 1e-6) + opt = torch.optim.Adam(occ.parameters(), lr=cfg["lr"]) + losses = [] + log_every = max(1, cfg["steps"] // 50) + for step in range(1, cfg["steps"] + 1): + t = rng.integers(0, ds["N"], cfg["batch_size"]) + j = future_idx(t, end, gamma, rng) + g = xy[sample_goal_after(j, end, rng)] + c = np.concatenate([obs[t], act[t], g], 1) + loss = occ.training_loss(torch.as_tensor(c, dtype=torch.float32, device=device), + torch.as_tensor(xy[j], dtype=torch.float32, device=device)) + opt.zero_grad(); loss.backward() + gn = torch.nn.utils.clip_grad_norm_(occ.parameters(), 10.0) + opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())) + if wandb_log: + wandb_log({"train/loss": float(loss.item()), "train/grad_norm": float(gn)}, step=step) + occ.eval() + return losses + + +@torch.no_grad() +def occ_q(occ, s, a, g, N, sigma, device, kind="dense", eps=0.5, batch=256, family=None): + """Q(s,a,g) = mean over N occupancy samples of the goal-reaching reward. + + For puzzle (family=="puzzle") x,g are binary button-state vectors and the reward is + the match-fraction (``puzzle_reward_t``), NOT the position-distance reward — see + ``puzzle_reward`` for the rationale (issue #35). For all other families x,g are + positions and the reward is ``reward_of_dist_t(||x - g||)``.""" + out = np.zeros(len(s)) + for i in range(0, len(s), batch): + sb, ab, gb = s[i:i+batch], a[i:i+batch], g[i:i+batch] + c = np.concatenate([sb, ab, gb], 1) + ct = torch.as_tensor(c, dtype=torch.float32, device=device) + x = occ.sample(ct, N) # [B, N, pos] + gt = torch.as_tensor(gb, dtype=torch.float32, device=device).unsqueeze(1) + if family == "puzzle": + out[i:i+batch] = puzzle_reward_t(x, gt, kind).mean(1).cpu().numpy() + else: + d = torch.norm(x - gt, dim=-1) + out[i:i+batch] = reward_of_dist_t(d, kind, sigma, eps).mean(1).cpu().numpy() + return out + + +# ---------------------------------------------------------------------------- +# fresh-rollout ground truth (PointMaze): goal-conditioned, on-policy +# ---------------------------------------------------------------------------- +def build_vertex_cells(maze_map): + mm = np.asarray(maze_map); I, J = mm.shape + def free(i, j): return 0 <= i < I and 0 <= j < J and mm[i, j] == 0 + vc = [] + for i in range(I): + for j in range(J): + if mm[i, j] == 0: + hx = free(i, j - 1) or free(i, j + 1) + hy = free(i - 1, j) or free(i + 1, j) + if hx and hy: + vc.append((i, j)) + return vc + + +def gc_fresh_truth_pointmaze(env_id, s_anc, a_anc, g_anc, gamma, kind, sigma, eps, + M=8, H=350, seed=0, verbose=True): + """Fresh-rollout Q^pi(s, a, g) truth for PointMaze anchors. + + For each anchor (s_i, a_i, g_i): set the env to s_i, apply the recorded action + a_i first (conditioning Q on (s,a)), infer the latent navigation goal from a_i, + then roll the scripted oracle-subgoal + N(0,0.2) controller for H steps. Average + the renormalized discounted goal-reaching return toward g_i over M rollouts. + The rollout trajectory is independent of g_i (the controller follows its own + latent goal), so this is a low-variance unbiased estimate of Q^pi(s,a,g). + """ + import ogbench + # For the self-rendered visual-pointmaze cell the env_id carries a "visual-" prefix, + # but only the STATE pointmaze env is registered (and its dynamics/oracle are what we + # roll for truth). Strip the prefix so the live env is created (cf. the antmaze truth, + # which does the same). The image-ness only affects the OCCUPANCY model input. + env_name = env_id.replace("visual-", "") + env, _, _ = ogbench.make_env_and_datasets(env_name) + u = env.unwrapped + env.reset() + vertex = build_vertex_cells(u.maze_map) + vertex_xy = np.array([u.ij_to_xy(ij) for ij in vertex]) + rng = np.random.default_rng(seed) + disc = (1 - gamma) * gamma ** np.arange(H + 1) + mass = disc.sum() + + def goal_posterior(s_xy, a): + dirs = np.zeros((len(vertex), 2)) + for k, gxy in enumerate(vertex_xy): + sg, _ = u.get_oracle_subgoal(s_xy, gxy) + d = sg - s_xy + dirs[k] = d / (np.linalg.norm(d) + 1e-6) + w = np.exp(-((a[None, :2] - dirs) ** 2).sum(1) / (2 * 0.2 ** 2)) + ssum = w.sum() + return (w / ssum) if ssum > 1e-12 else np.ones(len(vertex)) / len(vertex) + + A = len(s_anc) + truth = np.zeros(A) + for ai in range(A): + s_i = np.asarray(s_anc[ai][:2], dtype=np.float64).copy() + a_i = np.asarray(a_anc[ai], dtype=np.float64).copy() + g_i = np.asarray(g_anc[ai][:2], dtype=np.float64) + gpost = goal_posterior(s_i, a_i) + ret = 0.0 + for _ in range(M): + g_ij = vertex[rng.choice(len(vertex), p=gpost)] + u.set_xy(s_i.copy()) + u.set_goal(goal_ij=g_ij) + xys = [u.get_xy().copy()] + _, _, _, _, info = u.step(a_i) + xys.append(u.get_xy().copy()) + if info.get("success", False): + u.set_goal(goal_ij=vertex[rng.integers(len(vertex))]) + for _t in range(1, H): + xy = u.get_xy() + sg, _ = u.get_oracle_subgoal(xy, u.cur_goal_xy) + d = sg - xy + d = d / (np.linalg.norm(d) + 1e-6) + a = np.clip(d + rng.normal(0, 0.2, 2), -1, 1) + _, _, _, _, info = u.step(a) + xys.append(u.get_xy().copy()) + if info.get("success", False): + u.set_goal(goal_ij=vertex[rng.integers(len(vertex))]) + xys = np.asarray(xys) + d2g = np.linalg.norm(xys - g_i[None], axis=1) + rr = reward_of_dist(d2g, kind, sigma, eps) + ret += float((disc * rr).sum() / mass) + truth[ai] = ret / M + if verbose and (ai + 1) % 100 == 0: + print(f" [gc-fresh-truth] anchor {ai+1}/{A}", flush=True) + env.close() + return truth + + +# ---------------------------------------------------------------------------- +# fresh-rollout ground truth (AntMaze / visual-AntMaze): SAC expert + oracle subgoal +# ---------------------------------------------------------------------------- +def _load_ant_sac_expert(seed=0): + """Load the OGBench SAC locomotion expert used to collect AntMaze data. The repo's + `utils`/`agents` packages clash with our module names, so we import with the repo on + the path, then clean sys.modules. Returns actor_fn(agent_ob, temperature)->action[8].""" + import os + import sys + import json + import numpy as np + here = os.path.dirname(os.path.abspath(__file__)) + repo = os.path.normpath(os.path.join(here, "..", "ogbench_repo")) + impls = os.path.join(repo, "impls") + expert = os.path.join(repo, "data_gen_scripts", "experts", "ant") + if not os.path.exists(os.path.join(expert, "params_400000.pkl")): + raise FreshRolloutUnavailable( + f"AntMaze SAC expert checkpoint not found at {expert}/params_400000.pkl") + os.environ.setdefault("JAX_PLATFORMS", "cpu") + sys.path.insert(0, impls) + try: + from agents import SACAgent + from utils.flax_utils import restore_agent + from utils.evaluation import supply_rng + agent_cfg = json.load(open(os.path.join(expert, "flags.json")))["agent"] + agent = SACAgent.create(seed, np.zeros(29), np.zeros(8), agent_cfg) + agent = restore_agent(agent, expert, 400000) + actor_fn = supply_rng(agent.sample_actions, rng=agent.rng) + finally: + if impls in sys.path: + sys.path.remove(impls) + for mod in [m for m in list(sys.modules) + if m == "utils" or m.startswith("utils.") + or m == "agents" or m.startswith("agents.")]: + del sys.modules[mod] + return actor_fn + + +class FreshRolloutUnavailable(RuntimeError): + """Raised when an env *should* support fresh rollouts but a needed asset (e.g. the + SAC expert checkpoint) is missing — distinct from envs that fundamentally cannot.""" + + +def gc_fresh_truth_antmaze(env_id, s_anc, a_anc, g_anc, gamma, kind, sigma, eps, + M=8, H=300, Khead=20, seed=0, verbose=True, anchor_full=None): + """Fresh-rollout Q^pi(s,a,g) truth for AntMaze, using the EXACT data-collection + policy: pretrained SAC locomotion expert + oracle-BFS subgoal waypoints + N(0,0.2) + noise. The 29-D obs is qpos[15]+qvel[14], so the env IS resettable to a dataset + anchor via set_state. Visual-AntMaze shares ant dynamics; pass `anchor_full` (the + [A,29] full qpos+qvel anchor states) when the obs itself is an image. + """ + import numpy as np + import ogbench + actor_fn = _load_ant_sac_expert(seed) + env_name = env_id.replace("visual-", "") + env = ogbench.make_env_and_datasets(env_name, env_only=True) + u = env.unwrapped + env.reset() + vertex = build_vertex_cells(u.maze_map) + vertex_xy = np.array([u.ij_to_xy(ij) for ij in vertex]) + rng = np.random.default_rng(seed) + disc = (1 - gamma) * gamma ** np.arange(H + 1) + + full = anchor_full if anchor_full is not None else s_anc + + def goal_posterior(s_xy, heading): + dirs = np.zeros((len(vertex), 2)) + for k, gxy in enumerate(vertex_xy): + sg, _ = u.get_oracle_subgoal(s_xy, gxy) + d = sg - s_xy + dirs[k] = d / (np.linalg.norm(d) + 1e-6) + w = np.exp((dirs @ heading) / 0.3) + return w / w.sum() + + A = len(full) + truth = np.zeros(A) + for ai in range(A): + s_full = np.asarray(full[ai], dtype=np.float64) + a_i = np.asarray(a_anc[ai], dtype=np.float64) + g_i = np.asarray(g_anc[ai][:2], dtype=np.float64) + # heading toward the recorded near-future: approximate via the action direction + head = a_i[:2] if np.linalg.norm(a_i[:2]) > 1e-6 else np.array([1.0, 0.0]) + head = head / (np.linalg.norm(head) + 1e-6) + gpost = goal_posterior(s_full[:2], head) + ret = 0.0 + for _ in range(M): + g_ij = vertex[rng.choice(len(vertex), p=gpost)] + u.set_state(s_full[:15].copy(), s_full[15:29].copy()) + u.set_goal(goal_ij=g_ij) + xys = [u.get_xy().copy()] + _, _, term, trunc, info = env.step(a_i) + xys.append(u.get_xy().copy()) + if info.get("success", False): + u.set_goal(goal_ij=vertex[rng.integers(len(vertex))]) + for _t in range(1, H): + sg, _ = u.get_oracle_subgoal(u.get_xy(), u.cur_goal_xy) + d = sg - u.get_xy() + d = d / (np.linalg.norm(d) + 1e-6) + ag_ob = np.concatenate([u.get_ob(ob_type="states")[2:], d]) + act = np.clip(np.asarray(actor_fn(ag_ob, temperature=0)) + rng.normal(0, 0.2, 8), -1, 1) + _, _, term, trunc, info = env.step(act) + xys.append(u.get_xy().copy()) + if info.get("success", False): + u.set_goal(goal_ij=vertex[rng.integers(len(vertex))]) + if term or trunc: + break + xys = np.asarray(xys) + n = len(xys) + d2g = np.linalg.norm(xys - g_i[None], axis=1) + rr = reward_of_dist(d2g, kind, sigma, eps) + ret += float((disc[:n] * rr).sum() / disc[:n].sum()) + truth[ai] = ret / M + if verbose and (ai + 1) % 25 == 0: + print(f" [gc-fresh-truth-ant] anchor {ai+1}/{A}", flush=True) + env.close() + return truth + + +# ---------------------------------------------------------------------------- +# fresh-rollout ground truth (AntSoccer): ant SAC loco expert + antball SAC dribble +# expert + oracle subgoal (the EXACT data-collection controller). Goal = BALL xy. +# ---------------------------------------------------------------------------- +def _load_antball_sac_expert(seed=0): + """Load the TWO SAC experts that the AntSoccer data-collection controller uses + (``generate_antsoccer.py``): + + * the ant *locomotion* expert (``experts/ant``, epoch 400000) that navigates the + ANT to the ball — agent obs = ob[2:15] (13 joint pos) + ob[22:36] (14 ant qvel) + + 2-D oracle-subgoal direction = 29-D, action = 8-D; + * the *antball* dribble expert (``experts/antball``, epoch 12000000) that dribbles + the BALL to a subgoal — agent obs = ob[2:15] (13) + ob[17:] (25: ball pose+all + qvel) + (ball_xy - agent_xy) (2) + (subgoal_xy - ball_xy) (2) = 42-D, action 8-D. + + Mirrors ``_load_ant_sac_expert`` (import the repo's ``impls`` package, restore, then + clean sys.modules). Returns ``(loco_actor_fn, ball_actor_fn)``, each + ``actor_fn(agent_ob, temperature) -> action[8]``. JAX is forced to CPU.""" + import os + import sys + import json + import glob + import numpy as np + here = os.path.dirname(os.path.abspath(__file__)) + repo = os.path.normpath(os.path.join(here, "..", "ogbench_repo")) + impls = os.path.join(repo, "impls") + experts_dir = os.path.join(repo, "data_gen_scripts", "experts") + loco_dir = os.path.join(experts_dir, "ant") + ball_dir = os.path.join(experts_dir, "antball") + if not os.path.exists(os.path.join(loco_dir, "params_400000.pkl")): + raise FreshRolloutUnavailable( + f"AntSoccer ant loco expert not found at {loco_dir}/params_400000.pkl") + if not glob.glob(os.path.join(ball_dir, "params_12000000.pkl")): + raise FreshRolloutUnavailable( + f"AntSoccer antball dribble expert not found at {ball_dir}/params_12000000.pkl") + os.environ.setdefault("JAX_PLATFORMS", "cpu") + sys.path.insert(0, impls) + try: + from agents import SACAgent + from utils.flax_utils import restore_agent + from utils.evaluation import supply_rng + + def _load(expert_dir, epoch, ob_dim): + cfg = json.load(open(os.path.join(expert_dir, "flags.json")))["agent"] + ag = SACAgent.create(seed, np.zeros(ob_dim), np.zeros(8), cfg) + ag = restore_agent(ag, expert_dir, epoch) + return supply_rng(ag.sample_actions, rng=ag.rng) + + loco_actor_fn = _load(loco_dir, 400000, 29) + ball_actor_fn = _load(ball_dir, 12000000, 42) + finally: + if impls in sys.path: + sys.path.remove(impls) + for mod in [m for m in list(sys.modules) + if m == "utils" or m.startswith("utils.") + or m == "agents" or m.startswith("agents.")]: + del sys.modules[mod] + return loco_actor_fn, ball_actor_fn + + +def _nearest_free_cell_xy(u, cells_xy, xy): + """Index of the free maze cell whose center is closest to a target xy.""" + return int(np.argmin(np.linalg.norm(cells_xy - np.asarray(xy)[None], axis=1))) + + +def gc_fresh_truth_antsoccer(env_id, s_anc, a_anc, g_anc, gamma, kind, sigma, eps, + M=4, H=300, seed=0, verbose=True, anchor_full=None): + """Fresh-rollout Q^pi(s, a, g) truth for AntSoccer, using the EXACT data-collection + controller from ``generate_antsoccer.py``: an ant SAC loco expert that walks the ant + to the ball when it is far (``||agent_xy - ball_xy|| > 2``), and an antball SAC + dribble expert that drives the ball toward the oracle subgoal otherwise, plus the + same N(0, 0.2) action noise. On goal success a new random goal cell is sampled (the + 'navigate' generator behaviour). The OCCUPANCY TARGET and REWARD are on the BALL xy + (obs[15:17]); g is a ball goal xy. The 42-D obs IS the full qpos[22]+qvel[20] state, + so each anchor is reset via ``set_state`` (dataset-anchor protocol, like AntMaze). + The controller dribbles toward the free maze cell nearest to the anchor goal g_i, so + the rolled policy is consistent with the goal Q(s,a,g) is queried at. + """ + import numpy as np + import ogbench + loco_actor_fn, ball_actor_fn = _load_antball_sac_expert(seed) + # terminate_at_goal=False so a rollout keeps accumulating reward across multiple goal + # completions (per FRESH_RESET_SPEC) — the discounted occupancy reward is defined over + # the full geometric horizon, not cut short at the first ball-goal success. + env = ogbench.make_env_and_datasets( + env_id, env_only=True, terminate_at_goal=False, max_episode_steps=H + 5) + u = env.unwrapped + env.reset() + mm = np.asarray(u.maze_map) + cells = [(i, j) for i in range(mm.shape[0]) for j in range(mm.shape[1]) if mm[i, j] == 0] + cells_xy = np.array([u.ij_to_xy(ij) for ij in cells]) + rng = np.random.default_rng(seed) + disc = (1 - gamma) * gamma ** np.arange(H + 1) + + full = anchor_full if anchor_full is not None else s_anc + + def loco_action(ob, goal_xy): + sg, _ = u.get_oracle_subgoal(ob[:2], goal_xy) + d = sg - ob[:2] + d = d / (np.linalg.norm(d) + 1e-6) + agent_ob = np.concatenate([ob[2:15], ob[22:36], d]) + return np.asarray(loco_actor_fn(agent_ob, temperature=0)) + + def ball_action(ob, agent_xy, ball_xy, goal_xy): + sg, _ = u.get_oracle_subgoal(ball_xy, goal_xy) + agent_ob = np.concatenate([ob[2:15], ob[17:], ball_xy - agent_xy, sg - ball_xy]) + return np.asarray(ball_actor_fn(agent_ob, temperature=0)) + + A = len(full) + truth = np.zeros(A) + for ai in range(A): + s_full = np.asarray(full[ai], dtype=np.float64) + a_i = np.asarray(a_anc[ai], dtype=np.float64) + g_i = np.asarray(g_anc[ai][:2], dtype=np.float64) # ball goal xy + g_cell0 = cells[_nearest_free_cell_xy(u, cells_xy, g_i)] + ret = 0.0 + for _ in range(M): + u.set_state(s_full[:22].copy(), s_full[22:].copy()) + u.set_goal(goal_ij=g_cell0) + ball_xy0 = np.asarray(u.get_agent_ball_xy()[1]) + balls = [ball_xy0.copy()] + # step 0: the recorded behaviour action a_i (conditioning Q on (s,a)). + ob, _, term, trunc, info = env.step(np.clip(a_i, -1, 1)) + balls.append(np.asarray(u.get_agent_ball_xy()[1]).copy()) + if info.get("success", False): + u.set_goal(goal_ij=cells[rng.integers(len(cells))]) + for _t in range(1, H): + agent_xy, ball_xy = map(np.asarray, u.get_agent_ball_xy()) + goal_xy = np.asarray(u.cur_goal_xy) + if np.linalg.norm(agent_xy - ball_xy) > 2: + act = loco_action(ob, ball_xy) + else: + act = ball_action(ob, agent_xy, ball_xy, goal_xy) + act = np.clip(act + rng.normal(0, 0.2, act.shape), -1, 1) + ob, _, term, trunc, info = env.step(act) + balls.append(np.asarray(u.get_agent_ball_xy()[1]).copy()) + if info.get("success", False): + u.set_goal(goal_ij=cells[rng.integers(len(cells))]) + if term or trunc: + break + balls = np.asarray(balls) + n = len(balls) + d2g = np.linalg.norm(balls - g_i[None], axis=1) + rr = reward_of_dist(d2g, kind, sigma, eps) + ret += float((disc[:n] * rr).sum() / disc[:n].sum()) + truth[ai] = ret / M + if verbose and (ai + 1) % 25 == 0: + print(f" [gc-fresh-truth-antsoccer] anchor {ai+1}/{A}", flush=True) + env.close() + return truth + + +# ---------------------------------------------------------------------------- +# fresh-reset anchor protocol (manipspace: cube / scene / puzzle) — Protocol B +# ---------------------------------------------------------------------------- +def _make_manipspace_env(env_id, dataset_dir="~/.ogbench/data"): + """Build the live manipspace env per FRESH_RESET_SPEC: data_collection mode, + terminate_at_goal=False, long horizon. Returns the gym env.""" + import ogbench + return ogbench.make_env_and_datasets( + env_id, env_only=True, terminate_at_goal=False, + mode="data_collection", max_episode_steps=1001, dataset_dir=dataset_dir) + + +def _make_manipspace_oracles(env, fam): + """Family-keyed live markov oracles (NOISY-equivalent closed loop). Returns a dict + keyed by ``info['privileged/target_task']`` so set_new_target re-keying works.""" + from ogbench.manipspace.oracles.markov.button_markov import ButtonMarkovOracle + from ogbench.manipspace.oracles.markov.cube_markov import CubeMarkovOracle + if fam == "cube": + return {"cube": CubeMarkovOracle(env=env, min_norm=0.4)} + if fam == "puzzle": + return {"button": ButtonMarkovOracle(env=env, min_norm=0.4, gripper_always_closed=True)} + if fam == "scene": + from ogbench.manipspace.oracles.markov.drawer_markov import DrawerMarkovOracle + from ogbench.manipspace.oracles.markov.window_markov import WindowMarkovOracle + return { + "cube": CubeMarkovOracle(env=env, min_norm=0.4, max_step=100), + "button": ButtonMarkovOracle(env=env, min_norm=0.4), + "drawer": DrawerMarkovOracle(env=env, min_norm=0.4), + "window": WindowMarkovOracle(env=env, min_norm=0.4), + } + raise gc_core_error(f"no manipspace oracle for family {fam!r}") + + +def _manipspace_block_positions(info): + """All blocks' current 3-D positions concatenated [3*n_blocks], in block index order + (matches the occupancy-target layout from ``_manipspace_block_qpos_slices``).""" + block_keys = sorted(k for k in info + if k.startswith("privileged/block_") and k.endswith("_pos") + and k != "privileged/target_block_pos") + return np.concatenate([np.asarray(info[k], dtype=np.float64) for k in block_keys]) + + +def _manipspace_goal(info, fam): + """Privileged goal g for an anchor, in the SAME layout as the occupancy target: + cube: all-blocks position vector [3*n_blocks] where the target block's slot is its + goal (``target_block_pos``) and every distractor block's slot is its CURRENT + position — so ||x-g|| rewards moving the target block to its goal while the + distractors stay put (cube-single: identical to the old 3-D goal; cube-double: + 6-D, the fix for the alternating target_block). + scene: the 7-D scene oracle TARGET config (multi-task). + puzzle: target button-state vector. + """ + if fam == "puzzle": + # full target button-state pattern (current states with the target button flipped) + cur = np.asarray(info["button_states"], dtype=np.float64).copy() + tb = int(info["privileged/target_button"]) + cur[tb] = float(info["privileged/target_button_state"]) + return cur + if fam == "scene": + return _scene_target_vec_from_info(info) + g = _manipspace_block_positions(info).copy() # current positions of all blocks + tb = int(info["privileged/target_block"]) + g[tb * 3:tb * 3 + 3] = np.asarray(info["privileged/target_block_pos"], dtype=np.float64) + return g + + +def _manipspace_object(info, fam): + """Privileged current object value x for reward accumulation, SAME layout as the + occupancy target: all blocks' current positions (cube), the current 7-D scene oracle + vector (scene, multi-task), or the current button-state vector (puzzle).""" + if fam == "puzzle": + return np.asarray(info["button_states"], dtype=np.float64) + if fam == "scene": + return _scene_oracle_vec_from_info(info) + return _manipspace_block_positions(info) + + +def prepare_eval_anchors(env_id, val_ds, cfg, seed): + """Return the (s, a, g) anchors a method queries Q at, plus metadata for truth. + + Returns a dict: + s, a, g : [A, .] conditioning state, behaviour action, goal (the model query) + anchor_idx : [A] dataset indices (mazes) or None (manipspace) + anchor_full : full qpos+qvel anchor states for antmaze-full, else None + anchors_pack : fresh-reset pack (manipspace) or None + anchor_protocol: "dataset_anchor" (mazes) | "fresh_reset" (manipspace) + + Maze path is unchanged from the original per-method code; manipspace uses + ``fresh_reset_anchors`` so the SAME anchors feed both Q(s,a,g) and the truth. + """ + pos = cfg.get("pos_dim", 2) + if is_manipspace(env_id): + # manipulation reward scale (NOT the maze sigma=5 / eps=0.5) unless the caller + # explicitly overrode it. The maze defaults are meaningless at object scale. + if not cfg.get("_reward_scale_set"): + fam = manipspace_family(env_id) + if fam == "scene": + # scene uses the 7-D oracle-space occupancy target (not raw 3-D meters): + # block xyz is scaled x10, drawer x18, window x15, button states are 0/1, + # so within-task moves are ~1-3 oracle units. Use a reward bandwidth at + # that scale (NOT the cube 0.05/0.04 meter scale). + if abs(cfg.get("sigma", 5.0) - 5.0) < 1e-9: + cfg["sigma"] = 0.5 + if abs(cfg.get("epsilon", 0.5) - 0.5) < 1e-9: + cfg["epsilon"] = 0.5 + else: + if abs(cfg.get("sigma", 5.0) - 5.0) < 1e-9: + cfg["sigma"] = 0.05 + if abs(cfg.get("epsilon", 0.5) - 0.5) < 1e-9: + cfg["epsilon"] = 0.04 + cfg["_reward_scale_set"] = True + pack = fresh_reset_anchors(env_id, cfg["n_anchors"], seed) + return dict(s=pack["s"], a=pack["a"], g=pack["g"], anchor_idx=None, + anchor_full=None, anchors_pack=pack, + anchor_protocol="fresh_reset") + rng = np.random.default_rng(seed) + anchors = anchors_with_min_horizon(val_ds, cfg["n_anchors"], cfg["min_horizon"], rng) + s_a = val_ds["obs"][anchors]; a_a = val_ds["act"][anchors] + # Goal lives in TARGET space: ball xy for antsoccer (via ds['obj']), agent xy for + # other mazes. _target_array returns ds['obj'] for antsoccer, obs xy slice for mazes. + target = _target_array(val_ds, cfg) + g_a = target[sample_goal_idx(anchors, val_ds["end"], rng)][:, :pos] + state_slice = cfg.get("state_slice", "auto") + # The fresh-rollout truth needs the FULL obs to set_state. AntSoccer obs IS the full + # qpos+qvel state (always full), so pass anchor_full unconditionally for it. + anchor_full = s_a if (("antsoccer" in env_id) + or (state_slice == "full" + and ("antmaze" in env_id or "humanoidmaze" in env_id))) else None + return dict(s=s_a, a=a_a, g=g_a, anchor_idx=anchors, anchor_full=anchor_full, + anchors_pack=None, anchor_protocol="dataset_anchor") + + +def fresh_reset_anchors(env_id, n_anchors, seed, dataset_dir="~/.ogbench/data"): + """Protocol B fresh-reset anchors for a manipspace env. + + Does ``n_anchors`` independent ``env.reset(seed=...)`` calls (a valid + in-distribution start each time) and records per anchor: + s : obs (full normalized observation, the conditioning state) + qpos : full MuJoCo qpos qvel : full MuJoCo qvel (for set_state) + g : privileged goal (target object position 3-D, or puzzle target button-state) + a : first oracle action at the reset state (behavior-policy action for Q(s,a)) + obj0 : privileged object value at reset (for reference) + The SAME anchors are used to query Q(s,a,g) AND to compute the fresh-rollout truth, + so the two align per-anchor. Returns a dict of stacked arrays + the family. + """ + fam = manipspace_family(env_id) + if fam is None: + raise gc_core_error(f"fresh_reset_anchors called for non-manipspace env {env_id}") + env = _make_manipspace_env(env_id, dataset_dir) + u = env.unwrapped + oracles = _make_manipspace_oracles(env, fam) + S, A, G, QP, QV, OBJ, TGT = [], [], [], [], [], [], [] + for i in range(n_anchors): + np.random.seed(seed * 100003 + i) # oracles use global np.random + ob, info = env.reset(seed=seed * 100003 + i) + oracle = oracles[info["privileged/target_task"]] + oracle.reset(ob, info) + a0 = np.clip(np.asarray(oracle.select_action(ob, info), dtype=np.float64), -1, 1) + S.append(np.asarray(ob, dtype=np.float32)) + A.append(a0.astype(np.float32)) + G.append(_manipspace_goal(info, fam).astype(np.float32)) + QP.append(np.asarray(info["qpos"], dtype=np.float64)) + QV.append(np.asarray(info["qvel"], dtype=np.float64)) + OBJ.append(_manipspace_object(info, fam).astype(np.float32)) + TGT.append(_capture_manipspace_target(u, fam, info)) + env.close() + # For puzzle, obj0 IS the button-state vector (needed by set_state). + return dict(family=fam, s=np.stack(S), a=np.stack(A), g=np.stack(G), + qpos=np.stack(QP), qvel=np.stack(QV), obj0=np.stack(OBJ), + target=TGT) + + +def _capture_manipspace_target(u, fam, info): + """Snapshot the task target the oracle drives toward, so the truth env can restore + it after set_state (set_state does NOT restore mocap / button / drawer / window + targets). For cube: (target_block, mocap_pos, mocap_quat). For puzzle: + (target_button, target_button_states). For scene the target depends on + info['privileged/target_task'] — we snapshot ALL scene target state so the exact + sub-task goal is reproduced (see _restore_manipspace_target).""" + if fam == "puzzle": + return dict(target_button=int(info["privileged/target_button"]), + target_button_states=np.asarray(u._target_button_states).copy()) + if fam == "scene": + # Capture everything the SceneEnv oracle keys / drives on for any of the 4 tasks, + # plus the current button states (needed by SceneEnv.set_state). + snap = dict( + target_task=str(info["privileged/target_task"]), + button_states=np.asarray(info["button_states"]).astype(np.int64).copy(), + target_block=int(u._target_block), + target_button=int(u._target_button), + target_button_states=np.asarray(u._target_button_states).copy(), + target_drawer_pos=float(u._target_drawer_pos), + target_window_pos=float(u._target_window_pos), + ) + snap["cube_mocap_pos"] = [np.asarray(u._data.mocap_pos[mid]).copy() + for mid in u._cube_target_mocap_ids] + snap["cube_mocap_quat"] = [np.asarray(u._data.mocap_quat[mid]).copy() + for mid in u._cube_target_mocap_ids] + # Drawer / window target SITE positions (the oracle reads target_*_handle_pos + # off these sites; set_new_target writes them via site.pos). + snap["drawer_target_site_pos"] = np.asarray( + u._model.site("drawer_handle_center_target").pos).copy() + snap["window_target_site_pos"] = np.asarray( + u._model.site("window_handle_center_target").pos).copy() + return snap + tb = int(info["privileged/target_block"]) + mid = u._cube_target_mocap_ids[tb] + return dict(target_block=tb, + mocap_pos=np.asarray(u._data.mocap_pos[mid]).copy(), + mocap_quat=np.asarray(u._data.mocap_quat[mid]).copy()) + + +def _restore_manipspace_target(u, fam, tgt): + """Re-apply a captured target onto the live env after set_state, so the oracle + drives toward the SAME goal that the recorded g / Q-query used.""" + import mujoco + if fam == "puzzle": + u._target_button = int(tgt["target_button"]) + u._target_button_states = np.asarray(tgt["target_button_states"]).copy() + return + if fam == "scene": + u._target_task = tgt["target_task"] + u._target_block = int(tgt["target_block"]) + u._target_button = int(tgt["target_button"]) + u._target_button_states = np.asarray(tgt["target_button_states"]).copy() + u._target_drawer_pos = float(tgt["target_drawer_pos"]) + u._target_window_pos = float(tgt["target_window_pos"]) + for mid, p, q in zip(u._cube_target_mocap_ids, + tgt["cube_mocap_pos"], tgt["cube_mocap_quat"]): + u._data.mocap_pos[mid] = np.asarray(p).copy() + u._data.mocap_quat[mid] = np.asarray(q).copy() + u._model.site("drawer_handle_center_target").pos[:] = tgt["drawer_target_site_pos"] + u._model.site("window_handle_center_target").pos[:] = tgt["window_target_site_pos"] + mujoco.mj_forward(u._model, u._data) + return + tb = int(tgt["target_block"]) + u._target_block = tb + mid = u._cube_target_mocap_ids[tb] + u._data.mocap_pos[mid] = np.asarray(tgt["mocap_pos"]).copy() + u._data.mocap_quat[mid] = np.asarray(tgt["mocap_quat"]).copy() + mujoco.mj_forward(u._model, u._data) + + +def gc_fresh_truth_manipspace(env_id, anchors, gamma, kind, sigma, eps, + M=8, H=200, seed=0, verbose=True, dataset_dir="~/.ogbench/data"): + """Fresh-rollout Q^pi(s,a,g) truth for manipspace anchors (Protocol B). + + `anchors` is the dict returned by ``fresh_reset_anchors``. For each anchor, M times: + 1. ``set_state(qpos, qvel)`` (mocap target persists from the original reset, so the + goal g is held fixed across the M repeats — we never reset between repeats). + 2. apply the recorded behaviour action ``a`` first (conditioning Q on (s,a)). + 3. roll the live markov oracle for H steps, re-keying on ``oracle.done`` via + ``env.unwrapped.set_new_target()`` (mirrors generate_manipspace.py), adding the + same per-episode Gaussian action noise the "noisy" generator uses. + Accumulate the renormalized discounted goal-reaching reward toward g, using the + privileged OBJECT value each step. Average over M. + """ + fam = anchors["family"] + env = _make_manipspace_env(env_id, dataset_dir) + u = env.unwrapped + env.reset(seed=seed) + oracles = _make_manipspace_oracles(env, fam) + rng = np.random.default_rng(seed) + disc = (1 - gamma) * gamma ** np.arange(H + 1) + + def reward_to_goal(obj, g): + # Goal-reaching reward, IDENTICAL to occ_q / MC / TD. For cube/scene x,g are 3-D + # object positions and the reward is the position-distance reward_of_dist(||x-g||). + # For PUZZLE x,g are binary button-state vectors; the position-distance reward with + # the manip sigma is meaningless (||x-g||=sqrt Hamming, saturates exp() to 0), so we + # use the match-fraction reward (issue #35 fix) consistently with occ_q/MC/TD. + if fam == "puzzle": + return float(puzzle_reward(obj, g, kind)) + d = float(np.linalg.norm(np.asarray(obj, dtype=np.float64) + - np.asarray(g, dtype=np.float64))) + return float(reward_of_dist(np.array([d]), kind, sigma, eps)[0]) + + A = len(anchors["s"]) + truth = np.zeros(A) + for ai in range(A): + qpos = anchors["qpos"][ai].copy() + qvel = anchors["qvel"][ai].copy() + a_i = anchors["a"][ai].astype(np.float64) + g_i = anchors["g"][ai].astype(np.float64) + tgt = anchors["target"][ai] + ret = 0.0 + for _ in range(M): + # restore the anchor state, then re-apply the captured task target so the + # oracle drives toward the SAME goal g the Q-query used (set_state alone does + # NOT restore the mocap / button target). + if fam == "puzzle": + # puzzle set_state needs the (integer) button-state vector. + u.set_state(qpos.copy(), qvel.copy(), + np.asarray(anchors["obj0"][ai]).astype(np.int64)) + elif fam == "scene": + # SceneEnv.set_state(qpos, qvel, button_states) requires the (integer) + # current button-state vector, captured per anchor in target["button_states"]. + u.set_state(qpos.copy(), qvel.copy(), + np.asarray(tgt["button_states"]).astype(np.int64).copy()) + else: + u.set_state(qpos.copy(), qvel.copy()) + _restore_manipspace_target(u, fam, tgt) + info = u.compute_ob_info() + ob = u.compute_observation() + xi = rng.uniform(0, 0.1) # noisy-oracle action noise + oracle = oracles[info["privileged/target_task"]] + oracle.reset(ob, info) + # step 0: the recorded behaviour action a_i + ob, _, term, trunc, info = env.step(np.clip(a_i, -1, 1)) + objs = [_manipspace_object(info, fam)] + if oracle.done: + ag_ob, ag_info = u.set_new_target() + oracle = oracles[ag_info["privileged/target_task"]] + oracle.reset(ag_ob, ag_info) + for _t in range(1, H): + action = np.asarray(oracle.select_action(ob, info), dtype=np.float64) + action = action + rng.normal(0, [xi, xi, xi, xi * 3, xi * 10], action.shape) + action = np.clip(action, -1, 1) + ob, _, term, trunc, info = env.step(action) + objs.append(_manipspace_object(info, fam)) + if oracle.done: + ag_ob, ag_info = u.set_new_target() + oracle = oracles[ag_info["privileged/target_task"]] + oracle.reset(ag_ob, ag_info) + if term or trunc: + break + objs = np.asarray(objs) + n = len(objs) + rr = np.array([reward_to_goal(objs[k], g_i) for k in range(n)]) + ret += float((disc[:n] * rr).sum() / disc[:n].sum()) + truth[ai] = ret / M + if verbose and (ai + 1) % 25 == 0: + print(f" [gc-fresh-truth-manip] anchor {ai+1}/{A}", flush=True) + env.close() + return truth + + +# ---------------------------------------------------------------------------- +# fresh-rollout ground truth (HumanoidMaze): humanoid SAC expert + oracle subgoal +# ---------------------------------------------------------------------------- +def _load_humanoid_sac_expert(seed=0): + """Load the OGBench SAC locomotion expert used to collect HumanoidMaze data. + + Mirrors ``_load_ant_sac_expert`` exactly (same import-and-clean trick around the + repo's ``impls/`` package), but with the HUMANOID body: the xy-env agent + observation is 69-D (``get_ob(states)[2:]`` = 67-D + 2-D subgoal direction) and the + action is 21-D. The expert checkpoint is ``params_40000000.pkl`` (restore_epoch + 40000000, per ``experts/humanoid/flags.json``). Returns + actor_fn(agent_ob[69], temperature) -> action[21]. JAX is forced to CPU.""" + import os + import sys + import json + import numpy as np + here = os.path.dirname(os.path.abspath(__file__)) + repo = os.path.normpath(os.path.join(here, "..", "ogbench_repo")) + impls = os.path.join(repo, "impls") + expert = os.path.join(repo, "data_gen_scripts", "experts", "humanoid") + restore_epoch = 40000000 + ckpt = os.path.join(expert, f"params_{restore_epoch}.pkl") + if not os.path.exists(ckpt): + raise FreshRolloutUnavailable( + f"HumanoidMaze SAC expert checkpoint not found at {ckpt}") + os.environ.setdefault("JAX_PLATFORMS", "cpu") + sys.path.insert(0, impls) + try: + from agents import SACAgent + from utils.flax_utils import restore_agent + from utils.evaluation import supply_rng + agent_cfg = json.load(open(os.path.join(expert, "flags.json")))["agent"] + # agent_ob = get_ob(states)[2:] (67) + subgoal_dir (2) = 69; action = 21. + agent = SACAgent.create(seed, np.zeros(69), np.zeros(21), agent_cfg) + agent = restore_agent(agent, expert, restore_epoch) + actor_fn = supply_rng(agent.sample_actions, rng=agent.rng) + finally: + if impls in sys.path: + sys.path.remove(impls) + for mod in [m for m in list(sys.modules) + if m == "utils" or m.startswith("utils.") + or m == "agents" or m.startswith("agents.")]: + del sys.modules[mod] + return actor_fn + + +def _humanoid_full_state_from_obs(u, ob): + """Reconstruct a (qpos[nq], qvel[nv]) reset state from a 69-D HumanoidMaze obs. + + The HumanoidMaze observation is NOT raw qpos+qvel (unlike AntMaze's 29-D). It is a + derived feature vector (see ogbench/locomaze/humanoid.py:get_ob): + xy(2) | joint_angles(21) | head_height(1) | extremities(12) | + torso_vertical_orientation(3) | com_velocity(3) | velocity=qvel(27) + qpos = [xy(2), root_z+quat(5), joint_angles(21)] (nq=28); qvel = velocity (nv=27). + Everything except qpos[2:7] (root height + orientation quaternion, which only enter + the obs through xpos/xmat-derived features that are not analytically invertible) is + recoverable EXACTLY from the obs. We fill qpos[2:7] from the env's canonical upright + init_qpos, so the anchor is a valid upright humanoid at the recorded xy with the + recorded joint configuration and full velocity — the closest physically-consistent + reset the dataset (which ships no qpos/qvel) permits.""" + import numpy as np + ob = np.asarray(ob, dtype=np.float64) + qpos = u.init_qpos.copy() + qvel = u.init_qvel.copy() + qpos[:2] = ob[:2] # xy + qpos[7:] = ob[2:23] # 21 joint angles + qvel[:] = ob[-27:] # 27-D qvel (tail of obs) + return qpos, qvel + + +def gc_fresh_truth_humanoidmaze(env_id, s_anc, a_anc, g_anc, gamma, kind, sigma, eps, + M=8, H=300, Khead=20, seed=0, verbose=True, anchor_full=None): + """Fresh-rollout Q^pi(s,a,g) truth for HumanoidMaze, using the EXACT data-collection + policy: pretrained HUMANOID SAC locomotion expert + oracle-BFS subgoal waypoints + + N(0,0.2) action noise (same controller family as AntMaze, different body). + + Unlike AntMaze, the HumanoidMaze obs is a 69-D derived feature vector, not raw + qpos+qvel, and the dataset ships no qpos/qvel. We reconstruct a valid reset state + via ``_humanoid_full_state_from_obs`` (exact xy / joint-angles / qvel; canonical + upright root height+quat) and reset with ``set_state``. The agent observation fed to + the expert is ``get_ob(states)[2:]`` concatenated with the unit oracle-subgoal + direction, exactly as generate_locomaze.py builds it.""" + import numpy as np + import ogbench + actor_fn = _load_humanoid_sac_expert(seed) + env_name = env_id.replace("visual-", "") + env = ogbench.make_env_and_datasets(env_name, env_only=True) + u = env.unwrapped + env.reset() + vertex = build_vertex_cells(u.maze_map) + vertex_xy = np.array([u.ij_to_xy(ij) for ij in vertex]) + rng = np.random.default_rng(seed) + disc = (1 - gamma) * gamma ** np.arange(H + 1) + + # For HumanoidMaze the conditioning obs IS the 69-D state (state_slice="full"), and + # `anchor_full` (when passed) carries those same 69-D obs to reconstruct the reset. + full = anchor_full if anchor_full is not None else s_anc + + def goal_posterior(s_xy, heading): + dirs = np.zeros((len(vertex), 2)) + for k, gxy in enumerate(vertex_xy): + sg, _ = u.get_oracle_subgoal(s_xy, gxy) + d = sg - s_xy + dirs[k] = d / (np.linalg.norm(d) + 1e-6) + w = np.exp((dirs @ heading) / 0.3) + return w / w.sum() + + A = len(full) + truth = np.zeros(A) + for ai in range(A): + ob_full = np.asarray(full[ai], dtype=np.float64) + a_i = np.asarray(a_anc[ai], dtype=np.float64) + g_i = np.asarray(g_anc[ai][:2], dtype=np.float64) + qpos0, qvel0 = _humanoid_full_state_from_obs(u, ob_full) + s_xy0 = ob_full[:2] + # heading toward the recorded near-future: approximate via the com-velocity xy + # (obs com_velocity is 3-D at index 39:42); fall back to a fixed heading. + head = ob_full[39:41] if np.linalg.norm(ob_full[39:41]) > 1e-6 else np.array([1.0, 0.0]) + head = head / (np.linalg.norm(head) + 1e-6) + gpost = goal_posterior(s_xy0, head) + ret = 0.0 + for _ in range(M): + g_ij = vertex[rng.choice(len(vertex), p=gpost)] + u.set_state(qpos0.copy(), qvel0.copy()) + u.set_goal(goal_ij=g_ij) + xys = [u.get_xy().copy()] + _, _, term, trunc, info = env.step(a_i) + xys.append(u.get_xy().copy()) + if info.get("success", False): + u.set_goal(goal_ij=vertex[rng.integers(len(vertex))]) + for _t in range(1, H): + sg, _ = u.get_oracle_subgoal(u.get_xy(), u.cur_goal_xy) + d = sg - u.get_xy() + d = d / (np.linalg.norm(d) + 1e-6) + ag_ob = np.concatenate([u.get_ob(ob_type="states")[2:], d]) + act = np.clip(np.asarray(actor_fn(ag_ob, temperature=0)) + rng.normal(0, 0.2, 21), -1, 1) + _, _, term, trunc, info = env.step(act) + xys.append(u.get_xy().copy()) + if info.get("success", False): + u.set_goal(goal_ij=vertex[rng.integers(len(vertex))]) + if term or trunc: + break + xys = np.asarray(xys) + n = len(xys) + d2g = np.linalg.norm(xys - g_i[None], axis=1) + rr = reward_of_dist(d2g, kind, sigma, eps) + ret += float((disc[:n] * rr).sum() / disc[:n].sum()) + truth[ai] = ret / M + if verbose and (ai + 1) % 25 == 0: + print(f" [gc-fresh-truth-humanoid] anchor {ai+1}/{A}", flush=True) + env.close() + return truth + + +# ---------------------------------------------------------------------------- +# fresh-rollout ground truth (Powderworld) — Protocol B, image obs + discrete action +# ---------------------------------------------------------------------------- +def gc_fresh_truth_powderworld(anchors, gamma, kind, sigma, eps, + M=8, H=120, seed=0, verbose=True, num_elems=2): + """Fresh-rollout Q^pi(s, a, g) truth for Powderworld anchors (Protocol B). + + Powderworld's obs is a (32,32,6) image and its data-collection behaviour policy is + OPEN-LOOP scripted drawing (Fill / Line / Square + 50% random semantic actions), + matching ``data_gen_scripts/generate_powderworld.py``. ``anchors`` is the dict from + ``powderworld_fresh_reset_anchors`` carrying, per anchor, the saved pw ``world`` array + (to restore the start), the recorded behaviour action ``a`` (a single discrete int), + the matching ``action_step`` phase, and the goal world-summary ``g`` (phi in R^2). + + For each anchor, M times: + 1. restore the saved world + action phase (the env start). + 2. apply the recorded discrete action ``a`` first (conditioning Q on (s,a)). + 3. roll the scripted behaviour policy (Fill/Line/Square + 50% random) for H *agent + decisions* (each = 3 env steps), exactly as the generator does, recording the + world summary phi after every completed 3-step draw. + Accumulate the renormalized discounted reward toward g over the phi sequence; average + over M. The behaviour is state-independent, so each rollout is a fresh draw of the + SAME action distribution the dataset was collected with — a low-variance unbiased + estimate of Q^pi(s,a,g) under the data policy. + """ + import gymnasium + import numpy as np + from ogbench.powderworld.behaviors import FillBehavior, LineBehavior, SquareBehavior + import sys + import os + # phi extractor (lives in the env experiment dir to keep gc_core env-agnostic) + here = os.path.dirname(os.path.abspath(__file__)) + pwdir = os.path.join(here, "experiments", "powderworld_easy_play_v0") + if pwdir not in sys.path: + sys.path.insert(0, pwdir) + import pw_core + + env_name = "powderworld-easy-v0" if num_elems == 2 else ( + "powderworld-medium-v0" if num_elems == 5 else "powderworld-v0") + env = gymnasium.make(env_name, mode="data_collection", max_episode_steps=10_000_000) + u = env.unwrapped + env.reset(seed=seed) + elems = u._elems + agents = [FillBehavior(env=env), LineBehavior(env=env), SquareBehavior(env=env)] + probs = np.array([1, 3, 3], dtype=np.float64) + probs = probs / probs.sum() + rng = np.random.default_rng(seed) + disc = (1 - gamma) * gamma ** np.arange(H + 1) + + def reward_to_goal(phi, g): + d = float(np.linalg.norm(np.asarray(phi, np.float64) - np.asarray(g, np.float64))) + return float(reward_of_dist(np.array([d]), kind, sigma, eps)[0]) + + state = {"agent": None} + + def pick_semantic(ob, info): + """50% random semantic action (matching the 0.5 generator), else scripted; re-keys + the agent before selecting if its sequence is exhausted.""" + if rng.random() < 0.5: + return u.sample_semantic_action() + ag = state["agent"] + if ag.done: + ag = agents[rng.choice(len(agents), p=probs)] + ag.reset(ob, info) + state["agent"] = ag + return ag.select_action(ob, info) + + A = len(anchors["world"]) + truth = np.zeros(A) + for ai in range(A): + world0 = anchors["world"][ai] + astep0 = int(anchors["action_step"][ai]) + a_i = int(anchors["a"][ai]) + g_i = np.asarray(anchors["g"][ai], np.float64) + ret = 0.0 + for _ in range(M): + # restore env to the anchor start (world + action phase) + u._world = np.array(world0).copy() + u._action_step = astep0 + u._action_elem_id = None + u._action_x = None + u._action_y = None + # set global np.random seed so Fill/Line/Square draws are reproducible per repeat + ob = u._get_ob() + info = {} + phis = [pw_core.pw_phi_from_world(u._world[0, 0], elems)] + # step 0: the recorded behaviour action a_i (advances the 3-phase action cycle) + ob, _, term, trunc, info = env.step(a_i) + if u._action_step == 0: + phis.append(pw_core.pw_phi_from_world(u._world[0, 0], elems)) + # roll the scripted behaviour policy for the remaining horizon + state["agent"] = agents[rng.choice(len(agents), p=probs)] + state["agent"].reset(ob, info) + decisions = 0 + # seed a semantic action for any mid-cycle phases left by applying a_i; use a + # random one so we do NOT consume an agent.select_action mid-sequence. + sa = u.sample_semantic_action() + while decisions < H: + if u._action_step == 0: + sa = pick_semantic(ob, info) + action = u.semantic_action_to_action(*sa) + ob, _, term, trunc, info = env.step(action) + if u._action_step == 0: + phis.append(pw_core.pw_phi_from_world(u._world[0, 0], elems)) + decisions += 1 + if term or trunc: + break + phis = np.asarray(phis) + n = len(phis) + rr = np.array([reward_to_goal(phis[k], g_i) for k in range(n)]) + ret += float((disc[:n] * rr).sum() / disc[:n].sum()) + truth[ai] = ret / M + if verbose and (ai + 1) % 25 == 0: + print(f" [gc-fresh-truth-pw] anchor {ai+1}/{A}", flush=True) + env.close() + return truth + + +def powderworld_fresh_reset_anchors(n_anchors, seed, num_elems=2, warmup_lo=10, warmup_hi=120): + """Protocol B fresh-reset anchors for Powderworld. + + Each anchor is its own ``env.reset`` start, advanced by a random number of scripted + behaviour-policy decisions (so the anchor world is in-distribution, not blank), then: + world : saved pw world array (to restore the exact start for the truth) + action_step : the env action-phase at the anchor (0/1/2) + obs : the (32,32,6) image observation (conditioning state) + a : the next behaviour-policy action (discrete int) — the Q(s,a) action + g : a hindsight future world-summary phi in R^2 (the goal), obtained by + rolling the behaviour policy forward a random downstream amount. + phi0 : world summary at the anchor (reference). + The SAME anchors feed both Q(s,a,g) and the fresh-rollout truth. + """ + import gymnasium + import numpy as np + from ogbench.powderworld.behaviors import FillBehavior, LineBehavior, SquareBehavior + import sys + import os + here = os.path.dirname(os.path.abspath(__file__)) + pwdir = os.path.join(here, "experiments", "powderworld_easy_play_v0") + if pwdir not in sys.path: + sys.path.insert(0, pwdir) + import pw_core + + env_name = "powderworld-easy-v0" if num_elems == 2 else ( + "powderworld-medium-v0" if num_elems == 5 else "powderworld-v0") + env = gymnasium.make(env_name, mode="data_collection", max_episode_steps=10_000_000) + u = env.unwrapped + agents = [FillBehavior(env=env), LineBehavior(env=env), SquareBehavior(env=env)] + probs = np.array([1, 3, 3], dtype=np.float64); probs = probs / probs.sum() + rng = np.random.default_rng(seed) + + # holder so the closure can swap the live agent on `done` + state = {"agent": None} + + def pick_semantic(ob, info): + """Return a semantic action: 50% random (matching the 0.5 generator), else from + the scripted agent. Re-keys the agent first if it has exhausted its sequence, so + ``select_action`` is never called past the end (mirrors generate_powderworld.py).""" + if rng.random() < 0.5: + return u.sample_semantic_action() + ag = state["agent"] + if ag.done: + ag = agents[rng.choice(len(agents), p=probs)] + ag.reset(ob, info) + state["agent"] = ag + return ag.select_action(ob, info) + + WORLD, ASTEP, OBS, ACT, G, PHI0 = [], [], [], [], [], [] + for i in range(n_anchors): + ob, info = env.reset(seed=seed * 100003 + i) + state["agent"] = agents[rng.choice(len(agents), p=probs)] + state["agent"].reset(ob, info) + warmup = int(rng.integers(warmup_lo, warmup_hi)) # agent decisions before anchor + sa = u.sample_semantic_action() + d = 0 + while d < warmup: + if u._action_step == 0: + sa = pick_semantic(ob, info) + ob, _, term, trunc, info = env.step(u.semantic_action_to_action(*sa)) + if u._action_step == 0: + d += 1 + if term or trunc: + ob, info = env.reset(seed=seed * 100003 + i + 7777) + state["agent"] = agents[rng.choice(len(agents), p=probs)] + state["agent"].reset(ob, info) + # at an action-phase==0 boundary: record the anchor + world0 = np.array(u._world).copy() + astep0 = int(u._action_step) + obs0 = np.asarray(ob, np.uint8).copy() + phi0 = pw_core.pw_phi_from_world(u._world[0, 0], elems=u._elems) + # the next behaviour action a (a single discrete int) at this state + sa = pick_semantic(ob, info) + a0 = int(u.semantic_action_to_action(*sa)) + # hindsight goal: roll forward a random downstream amount, take its phi + ghoriz = int(rng.integers(20, 100)) + sa2 = sa + d2 = 0 + gob, ginfo = ob, info + while d2 < ghoriz: + if u._action_step == 0: + sa2 = pick_semantic(gob, ginfo) + gob, _, gterm, gtrunc, ginfo = env.step(u.semantic_action_to_action(*sa2)) + if u._action_step == 0: + d2 += 1 + if gterm or gtrunc: + break + g0 = pw_core.pw_phi_from_world(u._world[0, 0], elems=u._elems) + WORLD.append(world0); ASTEP.append(astep0); OBS.append(obs0) + ACT.append(a0); G.append(g0.astype(np.float32)); PHI0.append(phi0.astype(np.float32)) + env.close() + return dict(world=WORLD, action_step=np.array(ASTEP, np.int64), + obs=np.stack(OBS), a=np.array(ACT, np.int64), + g=np.stack(G), phi0=np.stack(PHI0), num_elems=num_elems) + + +# ---------------------------------------------------------------------------- +# which envs have a re-runnable fresh-rollout behaviour policy +# ---------------------------------------------------------------------------- +SUPPORTS_FRESH_ROLLOUT = ("pointmaze", "antmaze", "humanoidmaze", "antsoccer", + "cube", "scene", "puzzle", "powderworld") + + +def supports_fresh_rollout(env_id): + return any(k in env_id for k in SUPPORTS_FRESH_ROLLOUT) + + +# ---------------------------------------------------------------------------- +# maze layout for figures (walls in xy coordinates) +# ---------------------------------------------------------------------------- +def maze_wall_rects(env): + """Return (rects, extent) for drawing the maze layout under xy scatter plots. + + rects: list of (x0, y0, w, h) rectangles for wall cells (maze_map == 1), in the + same xy coordinates as observations. extent: (xmin, xmax, ymin, ymax). + Returns (None, None) if the env exposes no maze geometry. + """ + import numpy as np + u = env.unwrapped + if not (hasattr(u, "maze_map") and hasattr(u, "ij_to_xy")): + return None, None + mm = np.asarray(u.maze_map) + I, J = mm.shape + # cell size from adjacent centers + c00 = np.asarray(u.ij_to_xy((0, 0)), dtype=float) + c01 = np.asarray(u.ij_to_xy((0, 1)), dtype=float) + c10 = np.asarray(u.ij_to_xy((1, 0)), dtype=float) + dx = abs(c01[0] - c00[0]) or 1.0 + dy = abs(c10[1] - c00[1]) or 1.0 + rects = [] + xs, ys = [], [] + for i in range(I): + for j in range(J): + cx, cy = u.ij_to_xy((i, j)) + xs += [cx - dx / 2, cx + dx / 2] + ys += [cy - dy / 2, cy + dy / 2] + if mm[i, j] == 1: + rects.append((cx - dx / 2, cy - dy / 2, dx, dy)) + extent = (min(xs), max(xs), min(ys), max(ys)) + return rects, extent + + +def draw_maze(ax, env, facecolor="0.6", edgecolor="0.4"): + """Draw maze walls as filled rectangles behind a scatter, set equal aspect/extent. + Returns True if a layout was drawn, False if no geometry (caller should flag).""" + from matplotlib.patches import Rectangle + rects, extent = maze_wall_rects(env) + if rects is None: + return False + for (x0, y0, w, h) in rects: + ax.add_patch(Rectangle((x0, y0), w, h, facecolor=facecolor, + edgecolor=edgecolor, lw=0.5, zorder=0)) + ax.set_xlim(extent[0], extent[1]); ax.set_ylim(extent[2], extent[3]) + ax.set_aspect("equal") + return True diff --git a/gen_q_rsm/preliminary_analysis/genq.py b/gen_q_rsm/preliminary_analysis/genq.py new file mode 100644 index 0000000000000000000000000000000000000000..1a4d8c775a7c1208cccaf84afc539bf9bcc0bcd6 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/genq.py @@ -0,0 +1,115 @@ +"""Gen-Q: TD-free goal-conditioned policy evaluation via a learned occupancy model. + +Math +---- +Gen-Q learns the discounted future-state occupancy of the (goal-conditioned) +behaviour policy as a conditional generative model + + p_theta(x_{t+k} | s_t, a_t, g), k ~ Geom(1 - gamma), + +so samples from p_theta are distributed as d^pi_gamma(. | s, a, g). The normalized +goal-conditioned value is then a plain expectation, estimated by sampling: + + Q^pi(s, a, g) = E_{x ~ p_theta(. | s, a, g)} [ r(x; g) ] + ~= (1/N) sum_{i=1}^N r(x_i; g), x_i ~ p_theta(. | s, a, g). + +Occupancy model: a **conditional denoising diffusion model** (DDPM cosine +alpha-bar schedule; DDIM deterministic sampling). Diffusion is chosen over a +Gaussian mixture density network because the discounted occupancy is strongly +multi-modal (futures branch around walls / object configurations) and diffusion +captures that without a fixed mode count. **Flow-matching** is an equally valid +choice and is available via ``--occ_model flow`` (``models.ConditionalFlowMatching``); +both share the interface ``.training_loss(c, y)`` / ``.sample(c, n) -> [B,n,D]``. + +Training objective (epsilon-prediction MSE): + L = E_{(s,a,g), k~Geom, eps, t} || eps - eps_theta(sqrt(abar_t)x0 + sqrt(1-abar_t)eps, t, (s,a,g)) ||^2, + x0 = xy(s_{t+k}), g = hindsight goal downstream of t+k. + +Pseudocode +---------- + train: minibatch (s, a, g, x=xy(s_{t+k})) ; minimize eps-prediction MSE + eval : for each anchor (s, a, g): draw N samples x_i ~ p_theta(.|s,a,g) + Q(s,a,g) <- mean_i r(x_i; g) +""" +import time + +import numpy as np + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +from evaluate_policy import ground_truth_q, FreshRolloutUnsupported + + +def run(env_id, seed, cfg): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"] + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + occ_model = cfg.get("occ_model", "diffusion") + + # state_slice="full" gives raw N-D state occupancy (AntMaze 29-D); occupancy target + # stays xy (first pos dims). For manipspace the occupancy target is the privileged + # object position and pos_dim comes from the dataset loader. + state_slice = cfg.get("state_slice", "auto") + train_ds, val_ds, _, _ = gc_core.load_ogbench_gc(env_id, gamma, state_slice=state_slice) + pos = train_ds.get("pos_dim", cfg.get("pos_dim", 2)) + cfg["pos_dim"] = pos + + pack = gc_core.prepare_eval_anchors(env_id, val_ds, cfg, seed) + sigma, eps = cfg["sigma"], cfg["epsilon"] # prepare may set manipspace reward scale + s_a, a_a, g_a = pack["s"], pack["a"], pack["g"] + anchors = pack["anchor_idx"] + anchor_full = pack["anchor_full"] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"genq-{occ_model}-{env_id}-s{seed}", + {**cfg, "env": env_id, "seed": seed, "method": "genq"}, mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + cond_dim = train_ds["s_dim"] + train_ds["a_dim"] + pos + occ = gc_core.build_occupancy(occ_model, cond_dim, pos, cfg, device) + + t0 = time.time() + losses = gc_core.train_gc_occupancy(occ, train_ds, gamma, cfg, device, seed, wandb_log=wlog) + train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, val_ds, anchors, g_a, gamma, + kind=kind, sigma=sigma, eps=eps, + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), + seed=seed, anchor_full=anchor_full, + anchors_pack=pack["anchors_pack"]) + + # Sample-count sweep: Gen-Q's estimate (1/N) sum r(x_i) should improve with N. + gen_counts = cfg.get("gen_sample_counts", [1, 2, 4, 8, 16, 32, 64, 128, 256]) + family = train_ds.get("family") + mse_by_n, corr_by_n, mse_curve = {}, {}, [] + for N in gen_counts: + est_n = gc_core.occ_q(occ, s_a, a_a, g_a, N, sigma, device, kind, eps, family=family) + mn = q_metrics(est_n, truth) + mse_by_n[str(N)] = mn["mse"]; corr_by_n[str(N)] = mn["pearson"] + mse_curve.append(mn["mse"]) + N_final = gen_counts[-1] + est = gc_core.occ_q(occ, s_a, a_a, g_a, N_final, sigma, device, kind, eps, family=family) + m = q_metrics(est, truth) + + result = { + "method": "genq", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "occ_model": occ_model, "reward": kind, "truth_kind": truth_kind, + "anchor_protocol": pack["anchor_protocol"], + "gen_sample_counts": gen_counts, + "train/loss": losses, "train/q_mse": [m["mse"]], + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/q_mse_by_n": mse_by_n, "eval/q_corr_by_n": corr_by_n, + "eval/q_mse_vs_N": mse_curve, "eval/N_final": N_final, + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(s_a)), + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}) + wfinish() + return result + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/preliminary_analysis/genq_reward_latent.py b/gen_q_rsm/preliminary_analysis/genq_reward_latent.py new file mode 100644 index 0000000000000000000000000000000000000000..b5bbdaaafb25cf8ca0655f5cbff6aa04c774557c --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/genq_reward_latent.py @@ -0,0 +1,202 @@ +"""Gen-Q with a reward-predictive latent, for image / high-dim observations. + +Why a latent? +------------- +When the state is an image (or otherwise high-dimensional), learning the occupancy +p_theta(x_{t+k} | s, a, g) directly over raw pixels is intractable: most pixel +variation is reward-irrelevant. The issue mandates that for image observations, +occupancy learning be performed in a **reward-predictive latent space** and used +(instead of raw pixels) for both occupancy estimation and Q^pi. + +How the latent is learned +-------------------------- +Train an encoder E_psi over the (future) state and a goal-conditioned reward +decoder R_psi so the latent keeps exactly the reward-relevant information: + + z = E_psi(x), r_hat = R_psi(z, g), + L_latent(psi) = E_{x,g} [ ( R_psi(E_psi(x), g) - r(x; g) )^2 ] + lambda ||z||^2. + +Then **freeze** E_psi, R_psi (so the occupancy target distribution does not drift). + +Occupancy in latent space +------------------------- + z_{t+k} = stopgrad( E_psi(x_{t+k}) ), p_theta(z_{t+k} | s_t, a_t, g), k ~ Geom(1-gamma). + +Q from latent occupancy +----------------------- + Q^pi(s, a, g) = E_{z ~ p_theta(.|s,a,g)} [ R_psi(z, g) ] ~= (1/N) sum_i R_psi(z_i, g). + +For the low-dim Tier-1 envs this is run as an *ablation* of raw-state Gen-Q (the +latent encodes the position dims); for true image envs E_psi would be a CNN +(``models.ImageEncoder``). The recipe is identical. +""" +import time + +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +import models +from evaluate_policy import ground_truth_q + + +class GCRewardDecoder(nn.Module): + """R(z, g) -> scalar goal-reaching reward.""" + def __init__(self, z_dim, g_dim, hidden=256, layers=2): + super().__init__() + self.net = models.mlp(z_dim + g_dim, 1, hidden, layers) + + def forward(self, z, g): + return self.net(torch.cat([z, g], -1)).squeeze(-1) + + +def train_reward_latent(ds, gamma, z_dim, cfg, device, seed, wlog): + """Reward-aware encoder over (future) state + goal-conditioned reward decoder.""" + pos = cfg.get("pos_dim", 2) + s_dim = ds["s_dim"] + enc = models.Encoder(s_dim, z_dim, cfg["hidden_dim"], cfg["num_layers"]).to(device) + dec = GCRewardDecoder(z_dim, pos, cfg["hidden_dim"], 2).to(device) + opt = torch.optim.Adam(list(enc.parameters()) + list(dec.parameters()), lr=cfg["lr"]) + rng = np.random.default_rng(seed + 3) + obs, end = ds["obs"], ds["end"] + lam = cfg.get("latent_l2", 1e-4) + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + steps = cfg.get("latent_steps", 20000) + final = 0.0 + for step in range(1, steps + 1): + x_idx = rng.integers(0, ds["N"], cfg["batch_size"]) + g = obs[gc_core.sample_goal_after(x_idx, end, rng)][:, :pos] + d = np.linalg.norm(obs[x_idx][:, :pos] - g, axis=1) + r = gc_core.reward_of_dist(d, kind, sigma, eps).astype(np.float32) + x = torch.as_tensor(obs[x_idx], device=device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + z = enc(x) + loss = F.mse_loss(dec(z, gt), rt) + lam * (z ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % max(1, steps // 20) == 0 or step == 1: + final = float(loss.item()) + wlog({"latent/loss": final}, step=step) + enc.eval(); dec.eval() + for p in enc.parameters(): p.requires_grad_(False) + for p in dec.parameters(): p.requires_grad_(False) + return enc, dec, final + + +def _encode_all(enc, obs, device, batch=8192): + out = [] + with torch.no_grad(): + for i in range(0, len(obs), batch): + out.append(enc(torch.as_tensor(obs[i:i+batch], dtype=torch.float32, device=device)).cpu().numpy()) + return np.concatenate(out, 0) + + +def train_latent_occupancy(occ, ds, enc, gamma, cfg, device, seed, wlog): + pos = cfg.get("pos_dim", 2) + z_all = _encode_all(enc, ds["obs"], device) + obs, act, end = ds["obs"], ds["act"], ds["end"] + rng = np.random.default_rng(seed + 7) + t0 = rng.integers(0, ds["N"], 20000); j0 = gc_core.future_idx(t0, end, gamma, rng) + g0 = obs[gc_core.sample_goal_after(j0, end, rng)][:, :pos] + c0 = np.concatenate([obs[t0], act[t0], g0], 1) + occ.set_normalization(c0.mean(0), c0.std(0) + 1e-6, z_all.mean(0), z_all.std(0) + 1e-6) + z_t = torch.from_numpy(z_all.astype(np.float32)) + opt = torch.optim.Adam(occ.parameters(), lr=cfg["lr"]) + losses = [] + log_every = max(1, cfg["steps"] // 50) + for step in range(1, cfg["steps"] + 1): + t = rng.integers(0, ds["N"], cfg["batch_size"]) + j = gc_core.future_idx(t, end, gamma, rng) + g = obs[gc_core.sample_goal_after(j, end, rng)][:, :pos] + c = np.concatenate([obs[t], act[t], g], 1) + loss = occ.training_loss(torch.as_tensor(c, dtype=torch.float32, device=device), + z_t[j].to(device)) + opt.zero_grad(); loss.backward() + gn = torch.nn.utils.clip_grad_norm_(occ.parameters(), 10.0); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/grad_norm": float(gn)}, step=step) + occ.eval() + return losses + + +@torch.no_grad() +def latent_occ_q(occ, dec, s, a, g, N, device, batch=256): + out = np.zeros(len(s)) + for i in range(0, len(s), batch): + c = np.concatenate([s[i:i+batch], a[i:i+batch], g[i:i+batch]], 1) + ct = torch.as_tensor(c, dtype=torch.float32, device=device) + z = occ.sample(ct, N) # [b, N, z] + b, n, zd = z.shape + gt = torch.as_tensor(g[i:i+batch], dtype=torch.float32, device=device) + gt = gt.unsqueeze(1).expand(-1, n, -1).reshape(b * n, -1) + r = dec(z.reshape(b * n, zd), gt).reshape(b, n) + out[i:i+batch] = r.mean(1).cpu().numpy() + return out + + +def run(env_id, seed, cfg): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"] + kind = cfg["reward"] + pos = cfg.get("pos_dim", 2); cfg["pos_dim"] = pos + occ_model = cfg.get("occ_model", "diffusion") + z_dim = cfg.get("z_dim", 8) + + state_slice = cfg.get("state_slice", "auto") + train_ds, val_ds, _, _ = gc_core.load_ogbench_gc(env_id, gamma, state_slice=state_slice) + rng = np.random.default_rng(seed) + anchors = gc_core.anchors_with_min_horizon(val_ds, cfg["n_anchors"], cfg["min_horizon"], rng) + s_a = val_ds["obs"][anchors]; a_a = val_ds["act"][anchors] + g_a = val_ds["obs"][gc_core.sample_goal_idx(anchors, val_ds["end"], rng)][:, :pos] + anchor_full = s_a if (state_slice == "full" and "antmaze" in env_id) else None + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"genqlatent-{occ_model}-z{z_dim}-{env_id}-s{seed}", + {**cfg, "env": env_id, "seed": seed, "method": "genq_reward_latent"}, mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + t0 = time.time() + enc, dec, latent_mse = train_reward_latent(train_ds, gamma, z_dim, cfg, device, seed, wlog) + cond_dim = train_ds["s_dim"] + train_ds["a_dim"] + pos + occ = gc_core.build_occupancy(occ_model, cond_dim, z_dim, cfg, device) + losses = train_latent_occupancy(occ, train_ds, enc, gamma, cfg, device, seed, wlog) + train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, val_ds, anchors, g_a, gamma, + kind=kind, sigma=cfg["sigma"], eps=cfg["epsilon"], + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), seed=seed, + anchor_full=anchor_full) + gen_counts = cfg.get("gen_sample_counts", [1, 2, 4, 8, 16, 32, 64, 128, 256]) + mse_by_n, corr_by_n, mse_curve = {}, {}, [] + for N in gen_counts: + mn = q_metrics(latent_occ_q(occ, dec, s_a, a_a, g_a, N, device), truth) + mse_by_n[str(N)] = mn["mse"]; corr_by_n[str(N)] = mn["pearson"]; mse_curve.append(mn["mse"]) + N_final = gen_counts[-1] + est = latent_occ_q(occ, dec, s_a, a_a, g_a, N_final, device) + m = q_metrics(est, truth) + + result = { + "method": "genq_reward_latent", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "occ_model": occ_model, "z_dim": z_dim, "reward": kind, "truth_kind": truth_kind, + "gen_sample_counts": gen_counts, + "train/loss": losses, "train/q_mse": [m["mse"]], "latent/reward_mse": latent_mse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/q_mse_by_n": mse_by_n, "eval/q_corr_by_n": corr_by_n, + "eval/q_mse_vs_N": mse_curve, "eval/N_final": N_final, + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(anchors)), + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}) + wfinish() + return result + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/preliminary_analysis/genq_visual.py b/gen_q_rsm/preliminary_analysis/genq_visual.py new file mode 100644 index 0000000000000000000000000000000000000000..75e2599a2d987c6e4b4d2006cec15844b3ccd180 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/genq_visual.py @@ -0,0 +1,450 @@ +"""Gen-Q policy evaluation for IMAGE observations (visual-antmaze-medium-navigate-v0). + +Why this file exists +-------------------- +For image states the occupancy p_theta(x_{t+k} | s, a, g) must be learned in a +REWARD-PREDICTIVE LATENT, never over raw pixels (CLAUDE.md "Image observations => +reward-predictive latent occupancy"). The state ``genq_reward_latent.py`` uses an MLP +encoder over a flat state vector and slices the xy goal/reward out of ``obs[:, :2]``; +neither works for a 64x64x3 image. This driver swaps in ``models.ImageEncoder`` (CNN) +and reads the xy reward/goal signal from the dataset's auxiliary ``qpos`` array. + +Recipe (reward-predictive latent, frozen, then diffusion occupancy) +------------------------------------------------------------------- +1. Encoder z = E_psi(image) (models.ImageEncoder, CNN, [B,3,64,64] in [0,1]) + Decoder r_hat = R_psi(z, g) (goal-conditioned, g = xy) + Loss E[(R_psi(E_psi(image), g) - r(xy; g))^2] + lambda||z||^2 ; FREEZE E,R. + The reward is goal-reaching on the ant xy = qpos[:, :2]. +2. Conditioning representation: we condition the occupancy on (z_now, a, g) where + z_now = E_psi(image_now). (Documented choice: the CNN latent of the current image + is the conditioning state; the action a (8-D ant torque) and goal g (xy) complete + the (s,a,g) input.) +3. Occupancy p_theta(z' | z_now, a, g), z' = stopgrad(E_psi(image_{t+k})), + k ~ Geom(1-gamma). Conditional diffusion (NEVER a Gaussian MDN). +4. Q^pi(s,a,g) = E_{z ~ p_theta}[ R_psi(z, g) ] ~= (1/N) sum_i R_psi(z_i, g). + +Ground truth = FRESH ROLLOUTS only. The image obs cannot reset the sim, so we pass the +dataset's 29-D qpos+qvel full state as ``anchor_full`` to +``evaluate_policy.ground_truth_q``; the shared lib rolls the SAC expert + oracle-subgoal +behaviour policy on ant dynamics from that exact state (the image-ness only changes the +OCCUPANCY model input, not the rollout). + +mc / td baselines: run on the 29-D qpos+qvel STATE (the non-latent reference), since a +trained-MC / IQL-TD critic over the raw 64x64x3 image is a separate CNN-critic study; +the honest, comparable reference here is the same MC/TD recipe on the full ant state. +This is documented in each result JSON via ``"representation"``. +""" +import os +import time + +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +import models +from evaluate_policy import ground_truth_q +from genq_reward_latent import GCRewardDecoder + +_HERE = os.path.dirname(os.path.abspath(__file__)) +# data_ogbench/ physically lives at the SHARED proj root and is symlinked into the +# worktree as /data_ogbench. The symlink is untracked+gitignored and can +# be removed by `git clean -fdx` during worktree ops, so we resolve the symlink to +# its real absolute target and use that stable shared path directly. Override with +# GENQ_DATA_DIR if needed. +def _resolve_data_dir(): + env = os.environ.get("GENQ_DATA_DIR") + if env: + return os.path.abspath(env) + cand = os.path.join(_HERE, "..", "data_ogbench") # repo-root data_ogbench (symlink) + # realpath follows the symlink to the shared /proj/.../gen_q/data_ogbench target, + # so reads keep working even if the worktree symlink is later cleaned. + return os.path.realpath(cand) +_DATA_DIR = _resolve_data_dir() + + +# ---------------------------------------------------------------------------- +# visual dataset (images + qpos/qvel) +# ---------------------------------------------------------------------------- +def load_visual_gc(env_id, split, n_traj=None): + """Load the visual-antmaze npz for `split` in {"train","val"}. + + Returns a dataset dict with: + img : uint8 [N, 64, 64, 3] (observation; encoded by the CNN, never modeled raw) + xy : float32 [N, 2] (ant xy = qpos[:, :2]; reward/goal signal) + full : float32 [N, 29] (qpos[15] + qvel[14]; resets the sim for fresh truth) + act : float32 [N, 8] + end : int64 [N] (trajectory end index per step) + N, a_dim + """ + fname = env_id if split == "train" else f"{env_id}-val" + path = os.path.join(_DATA_DIR, f"{fname}.npz") + if not os.path.exists(path): + raise FileNotFoundError( + f"visual dataset not found: {path} (expected data_ogbench/ symlink at repo root)") + d = np.load(path, mmap_mode="r") + term = np.asarray(d["terminals"], dtype=np.float32) + if n_traj is not None: + ends = np.where(term > 0.5)[0] + 1 + N = int(ends[min(n_traj, len(ends)) - 1]) if len(ends) else len(term) + else: + N = len(term) + qpos = np.asarray(d["qpos"][:N], dtype=np.float32) + qvel = np.asarray(d["qvel"][:N], dtype=np.float32) + full = np.concatenate([qpos, qvel], axis=1) # [N, 29] + return dict( + img=d["observations"][:N], # keep as mmap'd uint8; index lazily + xy=qpos[:, :2].copy(), + full=full, + # `obs` alias = 29-D full state so evaluate_policy.ground_truth_q can index + # val_ds["obs"]/["act"] generically; for visual-antmaze the antmaze truth uses + # `anchor_full` for the sim reset and only needs `act` from here. + obs=full, + act=np.asarray(d["actions"][:N], dtype=np.float32), + end=gc_core.trajectory_bounds(term[:N]), + N=N, a_dim=int(d["actions"].shape[1]), + ) + + +def _imgs_to_tensor(img_u8, device): + """uint8 [B,64,64,3] -> float [B,3,64,64] in [0,1].""" + x = torch.as_tensor(np.asarray(img_u8), dtype=torch.float32, device=device) / 255.0 + return x.permute(0, 3, 1, 2).contiguous() + + +# ---------------------------------------------------------------------------- +# reward-predictive CNN latent (encoder + goal-conditioned reward decoder) +# ---------------------------------------------------------------------------- +def train_reward_latent_image(ds, z_dim, cfg, device, seed, wlog): + enc = models.ImageEncoder(z_dim, hidden_dim=cfg["hidden_dim"]).to(device) + dec = GCRewardDecoder(z_dim, 2, cfg["hidden_dim"], 2).to(device) + opt = torch.optim.Adam(list(enc.parameters()) + list(dec.parameters()), lr=cfg["lr"]) + rng = np.random.default_rng(seed + 3) + xy, end = ds["xy"], ds["end"] + lam = cfg.get("latent_l2", 1e-4) + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + steps = cfg.get("latent_steps", 20000) + bs = cfg["batch_size"] + final = 0.0 + for step in range(1, steps + 1): + x_idx = rng.integers(0, ds["N"], bs) + g = xy[gc_core.sample_goal_after(x_idx, end, rng)] + d = np.linalg.norm(xy[x_idx] - g, axis=1) + r = gc_core.reward_of_dist(d, kind, sigma, eps).astype(np.float32) + img = _imgs_to_tensor(ds["img"][x_idx], device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + z = enc(img) + loss = F.mse_loss(dec(z, gt), rt) + lam * (z ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % max(1, steps // 20) == 0 or step == 1: + final = float(loss.item()) + wlog({"latent/loss": final}, step=step) + enc.eval(); dec.eval() + for p in enc.parameters(): p.requires_grad_(False) + for p in dec.parameters(): p.requires_grad_(False) + return enc, dec, final + + +@torch.no_grad() +def encode_images(enc, img_u8, device, batch=2048): + out = [] + for i in range(0, len(img_u8), batch): + out.append(enc(_imgs_to_tensor(img_u8[i:i+batch], device)).cpu().numpy()) + return np.concatenate(out, 0).astype(np.float32) + + +# ---------------------------------------------------------------------------- +# latent occupancy p_theta(z' | z_now, a, g) +# ---------------------------------------------------------------------------- +def train_latent_occupancy_image(occ, ds, z_all, gamma, cfg, device, seed, wlog): + """z_all: precomputed E_psi(image) for every step (conditioning AND target source).""" + act, end = ds["act"], ds["end"] + xy = ds["xy"] + rng = np.random.default_rng(seed + 7) + # normalization from a sample of (z_now, a, g) cond and z' target + t0 = rng.integers(0, ds["N"], 20000) + j0 = gc_core.future_idx(t0, end, gamma, rng) + g0 = xy[gc_core.sample_goal_after(j0, end, rng)] + c0 = np.concatenate([z_all[t0], act[t0], g0], 1) + occ.set_normalization(c0.mean(0), c0.std(0) + 1e-6, z_all[j0].mean(0), z_all[j0].std(0) + 1e-6) + z_t = torch.from_numpy(z_all) + opt = torch.optim.Adam(occ.parameters(), lr=cfg["lr"]) + losses = [] + log_every = max(1, cfg["steps"] // 50) + bs = cfg["batch_size"] + for step in range(1, cfg["steps"] + 1): + t = rng.integers(0, ds["N"], bs) + j = gc_core.future_idx(t, end, gamma, rng) + g = xy[gc_core.sample_goal_after(j, end, rng)] + c = np.concatenate([z_all[t], act[t], g], 1) + loss = occ.training_loss(torch.as_tensor(c, dtype=torch.float32, device=device), + z_t[j].to(device)) + opt.zero_grad(); loss.backward() + gn = torch.nn.utils.clip_grad_norm_(occ.parameters(), 10.0); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/grad_norm": float(gn)}, step=step) + occ.eval() + return losses + + +@torch.no_grad() +def latent_occ_q(occ, dec, z_now, a, g, N, device, batch=256): + out = np.zeros(len(z_now)) + for i in range(0, len(z_now), batch): + c = np.concatenate([z_now[i:i+batch], a[i:i+batch], g[i:i+batch]], 1) + ct = torch.as_tensor(c, dtype=torch.float32, device=device) + z = occ.sample(ct, N) # [b, N, z] + b, n, zd = z.shape + gt = torch.as_tensor(g[i:i+batch], dtype=torch.float32, device=device) + gt = gt.unsqueeze(1).expand(-1, n, -1).reshape(b * n, -1) + r = dec(z.reshape(b * n, zd), gt).reshape(b, n) + out[i:i+batch] = r.mean(1).cpu().numpy() + return out + + +# ---------------------------------------------------------------------------- +# anchors + goals shared across methods (so mc/td/genq score the SAME (s,a,g)) +# ---------------------------------------------------------------------------- +def _make_anchors(val_ds, cfg, seed): + rng = np.random.default_rng(seed) + n = cfg["n_anchors"]; min_h = cfg["min_horizon"] + rem = val_ds["end"] - np.arange(val_ds["N"]) + valid = np.where(rem >= min_h)[0] + if len(valid) == 0: + valid = np.arange(val_ds["N"]) + anchors = valid[rng.integers(0, len(valid), size=n)] + g_idx = gc_core.sample_goal_idx(anchors, val_ds["end"], rng) + g_a = val_ds["xy"][g_idx] + return anchors, g_a + + +# ---------------------------------------------------------------------------- +# genq (image reward-predictive latent occupancy) +# ---------------------------------------------------------------------------- +def run(env_id, seed, cfg): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"] + kind = cfg["reward"] + occ_model = cfg.get("occ_model", "diffusion") + z_dim = cfg.get("z_dim", 8) + n_traj_tr = cfg.get("vis_train_traj", None) + n_traj_val = cfg.get("vis_val_traj", None) + + train_ds = load_visual_gc(env_id, "train", n_traj_tr) + val_ds = load_visual_gc(env_id, "val", n_traj_val) + anchors, g_a = _make_anchors(val_ds, cfg, seed) + s_img_a = val_ds["img"][anchors] + a_a = val_ds["act"][anchors] + anchor_full = val_ds["full"][anchors] # 29-D qpos+qvel for fresh rollout + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"genqvisual-{occ_model}-z{z_dim}-{env_id}-s{seed}", + {**cfg, "env": env_id, "seed": seed, "method": "genq_reward_latent"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + t0 = time.time() + enc, dec, latent_mse = train_reward_latent_image(train_ds, z_dim, cfg, device, seed, wlog) + z_train = encode_images(enc, train_ds["img"], device) + cond_dim = z_dim + train_ds["a_dim"] + 2 # (z_now, a, g_xy) + occ = gc_core.build_occupancy(occ_model, cond_dim, z_dim, cfg, device) + losses = train_latent_occupancy_image(occ, train_ds, z_train, gamma, cfg, device, seed, wlog) + train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, val_ds, anchors, g_a, gamma, + kind=kind, sigma=cfg["sigma"], eps=cfg["epsilon"], + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), + seed=seed, anchor_full=anchor_full) + # encode anchor images to z_now for conditioning + z_now_a = encode_images(enc, s_img_a, device) + + gen_counts = cfg.get("gen_sample_counts", [1, 2, 4, 8, 16, 32, 64, 128, 256]) + mse_by_n, corr_by_n, mse_curve = {}, {}, [] + for N in gen_counts: + mn = q_metrics(latent_occ_q(occ, dec, z_now_a, a_a, g_a, N, device), truth) + mse_by_n[str(N)] = mn["mse"]; corr_by_n[str(N)] = mn["pearson"]; mse_curve.append(mn["mse"]) + N_final = gen_counts[-1] + est = latent_occ_q(occ, dec, z_now_a, a_a, g_a, N_final, device) + m = q_metrics(est, truth) + + result = { + "method": "genq_reward_latent", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "image_reward_predictive_latent", + "occ_model": occ_model, "z_dim": z_dim, "reward": kind, "truth_kind": truth_kind, + "gen_sample_counts": gen_counts, + "train/loss": losses, "train/q_mse": [m["mse"]], "latent/reward_mse": latent_mse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/q_mse_by_n": mse_by_n, "eval/q_corr_by_n": corr_by_n, + "eval/q_mse_vs_N": mse_curve, "eval/N_final": N_final, + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(anchors)), + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}) + wfinish() + return result + + +# ---------------------------------------------------------------------------- +# mc / td baselines on the 29-D ant STATE (non-latent reference, documented) +# ---------------------------------------------------------------------------- +def _shared_state_setup(env_id, seed, cfg): + """Build (train_ds, val_ds, anchors, g_a, anchor_full) on the 29-D ant state.""" + n_traj_tr = cfg.get("vis_train_traj", None) + n_traj_val = cfg.get("vis_val_traj", None) + train_v = load_visual_gc(env_id, "train", n_traj_tr) + val_v = load_visual_gc(env_id, "val", n_traj_val) + # state datasets: obs = full MuJoCo state (qpos+qvel); xy reward signal stays + # qpos[:, :2] (== full[:, :2]). s_dim is derived from the data so this works for + # both AntMaze (29-D) and the rendered visual-PointMaze (4-D qpos[2]+qvel[2]). + s_dim = int(train_v["full"].shape[1]) + tr = dict(obs=train_v["full"], act=train_v["act"], end=train_v["end"], + N=train_v["N"], s_dim=s_dim, a_dim=train_v["a_dim"]) + va = dict(obs=val_v["full"], act=val_v["act"], end=val_v["end"], + N=val_v["N"], s_dim=s_dim, a_dim=val_v["a_dim"]) + anchors, g_a = _make_anchors(val_v, cfg, seed) + anchor_full = val_v["full"][anchors] + return tr, va, val_v, anchors, g_a, anchor_full + + +def run_mc(env_id, seed, cfg): + """Trained-MC critic Q_MC(s,a,g) on the 29-D ant state (non-latent reference).""" + import mc as mc_mod + device = get_device(); set_seed(seed) + gamma = cfg["gamma"]; kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + pos = 2 + tr, va, val_v, anchors, g_a, anchor_full = _shared_state_setup(env_id, seed, cfg) + s_a = va["obs"][anchors]; a_a = va["act"][anchors] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"mc-state29-{env_id}-s{seed}", {**cfg, "env": env_id, "seed": seed, "method": "mc"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + rng = np.random.default_rng(seed) + cand = np.where((tr["end"] - np.arange(tr["N"])) >= 2)[0] + n_fit = min(cfg.get("mc_fit_anchors", 80000), len(cand)) + fit_idx = cand[rng.integers(0, len(cand), size=n_fit)] + fit_g = tr["obs"][gc_core.sample_goal_idx(fit_idx, tr["end"], rng)][:, :pos] + fit_ret = mc_mod.gc_return(tr["obs"][:, :pos], tr["end"], fit_g, fit_idx, gamma, sigma, kind, eps) + + net = mc_mod.QNet(tr["s_dim"], pos, tr["a_dim"], cfg["hidden_dim"], cfg["num_layers"]).to(device) + opt = torch.optim.Adam(net.parameters(), lr=cfg["lr"]) + St = torch.as_tensor(tr["obs"][fit_idx], dtype=torch.float32) + Gt = torch.as_tensor(fit_g, dtype=torch.float32) + At = torch.as_tensor(tr["act"][fit_idx], dtype=torch.float32) + Rt = torch.as_tensor(fit_ret, dtype=torch.float32) + losses, qmse = [], [] + log_every = max(1, cfg["steps"] // 50); t0 = time.time() + for step in range(1, cfg["steps"] + 1): + b = rng.integers(0, len(fit_idx), cfg["batch_size"]) + loss = ((net(St[b].to(device), Gt[b].to(device), At[b].to(device)) - Rt[b].to(device)) ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())); qmse.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/q_mse": float(loss.item())}, step=step) + net.eval(); train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, va, anchors, g_a, gamma, kind=kind, sigma=sigma, + eps=eps, M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), + seed=seed, anchor_full=anchor_full) + with torch.no_grad(): + est = net(torch.as_tensor(s_a, dtype=torch.float32, device=device), + torch.as_tensor(g_a, dtype=torch.float32, device=device), + torch.as_tensor(a_a, dtype=torch.float32, device=device)).cpu().numpy() + m = q_metrics(est, truth) + result = {"method": "mc", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "ant_state_29d", "reward": kind, "truth_kind": truth_kind, + "train/loss": losses, "train/q_mse": qmse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/truth_std": float(np.std(truth)), "wall_clock_s": train_wall, + "n_anchors": int(len(anchors))} + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}); wfinish() + return result + + +def run_td(env_id, seed, cfg): + """IQL-style TD critic Q(s,a,g) on the 29-D ant state (non-latent reference).""" + import mc as mc_mod + import td as td_mod + device = get_device(); set_seed(seed) + gamma = cfg["gamma"]; kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + pos = 2 + tr, va, val_v, anchors, g_a, anchor_full = _shared_state_setup(env_id, seed, cfg) + s_a = va["obs"][anchors]; a_a = va["act"][anchors] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"td-state29-{env_id}-s{seed}", {**cfg, "env": env_id, "seed": seed, "method": "td"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + obs = tr["obs"]; act = tr["act"]; end = tr["end"]; N = tr["N"] + nxt = np.where((end - np.arange(N)) > 1)[0] + sd, ad = tr["s_dim"], tr["a_dim"]; Hd, L = cfg["hidden_dim"], cfg["num_layers"] + q = mc_mod.QNet(sd, pos, ad, Hd, L).to(device) + qt = mc_mod.QNet(sd, pos, ad, Hd, L).to(device); qt.load_state_dict(q.state_dict()) + v = td_mod.VNet(sd, pos, Hd, L).to(device) + optq = torch.optim.Adam(q.parameters(), lr=cfg["lr"]) + optv = torch.optim.Adam(v.parameters(), lr=cfg["lr"]) + tau = cfg.get("iql_expectile", 0.5); polyak = cfg.get("polyak", 0.005) + rng = np.random.default_rng(seed) + losses, qmse = [], []; log_every = max(1, cfg["steps"] // 50); t0 = time.time() + for step in range(1, cfg["steps"] + 1): + idx = nxt[rng.integers(0, len(nxt), size=cfg["batch_size"])] + g = obs[gc_core.sample_goal_idx(idx, end, rng)][:, :pos] + d = np.linalg.norm(obs[idx][:, :pos] - g, axis=1) + r = gc_core.reward_of_dist(d, kind, sigma, eps).astype(np.float32) + s = torch.as_tensor(obs[idx], device=device) + a = torch.as_tensor(act[idx], device=device) + s2 = torch.as_tensor(obs[idx + 1], device=device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + with torch.no_grad(): + qsa = qt(s, gt, a) + diff = qsa - v(s, gt) + w = torch.abs(tau - (diff < 0).float()) + loss_v = (w * diff ** 2).mean() + optv.zero_grad(); loss_v.backward(); optv.step() + with torch.no_grad(): + y = (1 - gamma) * rt + gamma * v(s2, gt) + loss_q = ((q(s, gt, a) - y) ** 2).mean() + optq.zero_grad(); loss_q.backward(); optq.step() + with torch.no_grad(): + for p, ptg in zip(q.parameters(), qt.parameters()): + ptg.mul_(1 - polyak).add_(polyak * p) + if step % log_every == 0 or step == 1: + losses.append(float(loss_q.item())); qmse.append(float(loss_q.item())) + wlog({"train/loss": float(loss_q.item()), "train/q_mse": float(loss_q.item()), + "train/v_loss": float(loss_v.item())}, step=step) + q.eval(); train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, va, anchors, g_a, gamma, kind=kind, sigma=sigma, + eps=eps, M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), + seed=seed, anchor_full=anchor_full) + with torch.no_grad(): + est = q(torch.as_tensor(s_a, dtype=torch.float32, device=device), + torch.as_tensor(g_a, dtype=torch.float32, device=device), + torch.as_tensor(a_a, dtype=torch.float32, device=device)).cpu().numpy() + m = q_metrics(est, truth) + result = {"method": "td", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "ant_state_29d", "reward": kind, "truth_kind": truth_kind, + "train/loss": losses, "train/q_mse": qmse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/truth_std": float(np.std(truth)), "wall_clock_s": train_wall, + "n_anchors": int(len(anchors))} + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}); wfinish() + return result + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/preliminary_analysis/genq_visual_cube.py b/gen_q_rsm/preliminary_analysis/genq_visual_cube.py new file mode 100644 index 0000000000000000000000000000000000000000..31bf613af4026a874602120d6a01f2efa9d64f9d --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/genq_visual_cube.py @@ -0,0 +1,409 @@ +"""Gen-Q policy evaluation for IMAGE observations on a MANIPSPACE env +(visual-cube-single-play-v0). + +This file combines two already-proven pieces (issue #35): + + (a) image obs -> frozen REWARD-PREDICTIVE LATENT occupancy + (proven on visual-antmaze-medium-navigate-v0 via ``genq_visual.py``), and + (b) the FRESH-RESET manipspace ground truth + (proven on the STATE cube-single-play-v0, genq corr ~0.88, via + ``gc_core.fresh_reset_anchors`` + ``gc_core.gc_fresh_truth_manipspace``). + +Why a dedicated driver (vs reusing ``genq_visual.py``) +------------------------------------------------------ +``genq_visual.py`` was written for visual-ANTmaze, where (i) the reward/goal signal is +the 2-D ant xy = ``qpos[:, :2]`` and (ii) the ground truth uses the DATASET-anchor +protocol (the 29-D qpos+qvel slice resets the sim). visual-cube differs on BOTH axes: + + * The reward/goal is the 3-D OBJECT (block) position, not an agent xy. For cube-single + the block_0 position lives at ``qpos[:, 14:17]`` (resolved LIVE from the state cube + env so nothing is hardcoded across env versions). + * The cube observation is a lossy projection -> the truth MUST use the FRESH-RESET + protocol (FRESH_RESET_SPEC.md Protocol B): each anchor is its own ``env.reset()`` + start, the live CubeMarkovOracle is rolled from ``set_state`` for the truth, and the + SAME anchors are queried by the learned models. + +The underlying sim for ``visual-cube-single-play-v0`` is the SAME cube env as the state +version; only the observation rendering differs. So ``fresh_reset_anchors`` / +``gc_fresh_truth_manipspace`` work UNCHANGED when handed the visual env id — the only +difference is that the recorded anchor ``s`` is now a 64x64x3 IMAGE (used solely to +condition the CNN-latent occupancy), while the truth uses qpos/qvel/target/g from the +privileged ``info`` exactly as in the state cube. + +Recipe (reward-predictive latent, frozen, then diffusion occupancy) +------------------------------------------------------------------- +1. Encoder z = E_psi(image) (models.ImageEncoder, CNN, [B,3,64,64] in [0,1]) + Decoder r_hat = R_psi(z, g) (goal-conditioned, g = 3-D block-goal position) + Loss E[(R_psi(E_psi(image), g) - r(block_pos; g))^2] + lambda||z||^2 ; FREEZE E,R. + The reward is OBJECT goal-reaching: r(x;g)=exp(-||x-g||^2/2 sigma^2), x=block_pos. +2. Conditioning representation (s,a,g) = (z_now=E_psi(image_now), a (5-D), g (3-D)). +3. Occupancy p_theta(z' | z_now, a, g), z' = stopgrad(E_psi(image_{t+k})), + k ~ Geom(1-gamma). Conditional diffusion (NEVER a Gaussian MDN). +4. Q^pi(s,a,g) = E_{z ~ p_theta}[ R_psi(z, g) ] ~= (1/N) sum_i R_psi(z_i, g). + +Ground truth = FRESH ROLLOUTS only (Protocol B, fresh_reset). NO in-dataset return-to-go, +NO synthetic fallback. ``anchor_protocol="fresh_reset"`` in every result JSON. + +mc / td baselines run on the cube STATE (28-D obs) as the non-latent reference, against +the SAME fresh-reset anchors/truth — the honest comparable reference (a trained CNN +critic over raw pixels is a separate study). Documented via ``"representation"`` in each +result JSON. +""" +import os +import time + +import numpy as np +import torch +import torch.nn.functional as F + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +import models +from genq_reward_latent import GCRewardDecoder + +_HERE = os.path.dirname(os.path.abspath(__file__)) + + +def _resolve_data_dir(): + """Resolve the OGBench data dir robustly across login/compute nodes. + + On the login node $HOME=/proj/inf-scaling/zwhong, but on a Blue Vela compute node + $HOME=/u/zwhong (a separate .ogbench without the prefetched data). Prefer an explicit + OGBENCH_DATA_DIR, then any candidate that actually contains the dataset, else the + expanduser default.""" + cands = [] + if os.environ.get("OGBENCH_DATA_DIR"): + cands.append(os.path.expanduser(os.environ["OGBENCH_DATA_DIR"])) + cands += [ + os.path.expanduser("~/.ogbench/data"), + "/proj/inf-scaling/zwhong/.ogbench/data", + "/u/zwhong/.ogbench/data", + ] + for c in cands: + if os.path.isdir(c) and any(f.endswith(".npz") for f in os.listdir(c)): + return c + return os.path.expanduser("~/.ogbench/data") + + +_DATA_DIR = _resolve_data_dir() + +# cube-single block_0 position qpos slice (resolved live below; this is the fallback / +# documented default verified on 2026-06-28: qpos[14:17]). +_CUBE_BLOCK_SLICE = (14, 17) + + +# ---------------------------------------------------------------------------- +# block qpos slice (resolved live so we never hardcode across env versions) +# ---------------------------------------------------------------------------- +def _resolve_cube_block_slice(env_id): + """Resolve the (lo, hi) qpos slice giving the cube block_0 3-D position, by + inspecting the STATE cube env (same sim, has privileged block keys). Falls back to + the verified default if the live probe fails.""" + state_env_id = env_id.replace("visual-", "") + try: + import ogbench + env = ogbench.make_env_and_datasets( + state_env_id, env_only=True, terminate_at_goal=False, + mode="data_collection", max_episode_steps=1001, dataset_dir=_DATA_DIR) + sl = gc_core._manipspace_block_qpos_slices(env, "cube") + env.close() + # cube-single -> single (lo, hi) + return sl[0] + except Exception as e: # pragma: no cover - defensive + print(f"[visualcube] block-slice probe failed ({e}); using default {_CUBE_BLOCK_SLICE}", + flush=True) + return _CUBE_BLOCK_SLICE + + +# ---------------------------------------------------------------------------- +# visual cube dataset (images + qpos -> block position reward signal) +# ---------------------------------------------------------------------------- +def load_visual_cube(env_id, split, block_slice, n_traj=None): + """Load the visual-cube npz for `split` in {"train","val"}. + + Returns a dataset dict with: + img : uint8 [N, 64, 64, 3] (observation; encoded by the CNN, never modeled raw) + obj : float32 [N, 3] (block_0 position = qpos[:, lo:hi]; reward/goal signal) + full : float32 [N, 41] (qpos[21] + qvel[20]; reference only) + act : float32 [N, 5] + end : int64 [N] (trajectory end index per step) + N, a_dim + """ + fname = env_id if split == "train" else f"{env_id}-val" + path = os.path.join(_DATA_DIR, f"{fname}.npz") + if not os.path.exists(path): + raise FileNotFoundError(f"visual-cube dataset not found: {path}") + d = np.load(path, mmap_mode="r") + term = np.asarray(d["terminals"], dtype=np.float32) + if n_traj is not None: + ends = np.where(term > 0.5)[0] + 1 + N = int(ends[min(n_traj, len(ends)) - 1]) if len(ends) else len(term) + else: + N = len(term) + qpos = np.asarray(d["qpos"][:N], dtype=np.float32) + qvel = np.asarray(d["qvel"][:N], dtype=np.float32) + lo, hi = block_slice + return dict( + img=d["observations"][:N], # mmap'd uint8; index lazily + obj=qpos[:, lo:hi].copy().astype(np.float32), # [N, 3] block position + full=np.concatenate([qpos, qvel], axis=1), # reference only + act=np.asarray(d["actions"][:N], dtype=np.float32), + end=gc_core.trajectory_bounds(term[:N]), + N=N, a_dim=int(d["actions"].shape[1]), + ) + + +def _imgs_to_tensor(img_u8, device): + """uint8 [B,64,64,3] -> float [B,3,64,64] in [0,1].""" + x = torch.as_tensor(np.asarray(img_u8), dtype=torch.float32, device=device) / 255.0 + return x.permute(0, 3, 1, 2).contiguous() + + +# ---------------------------------------------------------------------------- +# reward-predictive CNN latent (encoder + goal-conditioned reward decoder) +# ---------------------------------------------------------------------------- +def train_reward_latent_image(ds, z_dim, g_dim, cfg, device, seed, wlog): + """E_psi(image), R_psi(z, g) trained so z retains reward-relevant info; then frozen. + The reward is OBJECT goal-reaching on the 3-D block position (ds['obj']).""" + enc = models.ImageEncoder(z_dim, hidden_dim=cfg["hidden_dim"]).to(device) + dec = GCRewardDecoder(z_dim, g_dim, cfg["hidden_dim"], 2).to(device) + opt = torch.optim.Adam(list(enc.parameters()) + list(dec.parameters()), lr=cfg["lr"]) + rng = np.random.default_rng(seed + 3) + obj, end = ds["obj"], ds["end"] + lam = cfg.get("latent_l2", 1e-4) + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + steps = cfg.get("latent_steps", 20000) + bs = cfg["batch_size"] + final = 0.0 + for step in range(1, steps + 1): + x_idx = rng.integers(0, ds["N"], bs) + g = obj[gc_core.sample_goal_after(x_idx, end, rng)] # hindsight block goal + d = np.linalg.norm(obj[x_idx] - g, axis=1) + r = gc_core.reward_of_dist(d, kind, sigma, eps).astype(np.float32) + img = _imgs_to_tensor(ds["img"][x_idx], device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + z = enc(img) + loss = F.mse_loss(dec(z, gt), rt) + lam * (z ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % max(1, steps // 20) == 0 or step == 1: + final = float(loss.item()) + wlog({"latent/loss": final}, step=step) + enc.eval(); dec.eval() + for p in enc.parameters(): p.requires_grad_(False) + for p in dec.parameters(): p.requires_grad_(False) + return enc, dec, final + + +@torch.no_grad() +def encode_images(enc, img_u8, device, batch=2048): + out = [] + for i in range(0, len(img_u8), batch): + out.append(enc(_imgs_to_tensor(img_u8[i:i + batch], device)).cpu().numpy()) + return np.concatenate(out, 0).astype(np.float32) + + +# ---------------------------------------------------------------------------- +# latent occupancy p_theta(z' | z_now, a, g) +# ---------------------------------------------------------------------------- +def train_latent_occupancy_image(occ, ds, z_all, gamma, cfg, device, seed, wlog): + """z_all: precomputed E_psi(image) for every step (conditioning AND target source). + Goal g = hindsight block-position goal (ds['obj'] downstream of the target).""" + act, end, obj = ds["act"], ds["end"], ds["obj"] + rng = np.random.default_rng(seed + 7) + t0 = rng.integers(0, ds["N"], 20000) + j0 = gc_core.future_idx(t0, end, gamma, rng) + g0 = obj[gc_core.sample_goal_after(j0, end, rng)] + c0 = np.concatenate([z_all[t0], act[t0], g0], 1) + occ.set_normalization(c0.mean(0), c0.std(0) + 1e-6, + z_all[j0].mean(0), z_all[j0].std(0) + 1e-6) + z_t = torch.from_numpy(z_all) + opt = torch.optim.Adam(occ.parameters(), lr=cfg["lr"]) + losses = [] + log_every = max(1, cfg["steps"] // 50) + bs = cfg["batch_size"] + for step in range(1, cfg["steps"] + 1): + t = rng.integers(0, ds["N"], bs) + j = gc_core.future_idx(t, end, gamma, rng) + g = obj[gc_core.sample_goal_after(j, end, rng)] + c = np.concatenate([z_all[t], act[t], g], 1) + loss = occ.training_loss(torch.as_tensor(c, dtype=torch.float32, device=device), + z_t[j].to(device)) + opt.zero_grad(); loss.backward() + gn = torch.nn.utils.clip_grad_norm_(occ.parameters(), 10.0); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/grad_norm": float(gn)}, step=step) + occ.eval() + return losses + + +@torch.no_grad() +def latent_occ_q(occ, dec, z_now, a, g, N, device, batch=256): + out = np.zeros(len(z_now)) + for i in range(0, len(z_now), batch): + c = np.concatenate([z_now[i:i + batch], a[i:i + batch], g[i:i + batch]], 1) + ct = torch.as_tensor(c, dtype=torch.float32, device=device) + z = occ.sample(ct, N) # [b, N, z] + b, n, zd = z.shape + gt = torch.as_tensor(g[i:i + batch], dtype=torch.float32, device=device) + gt = gt.unsqueeze(1).expand(-1, n, -1).reshape(b * n, -1) + r = dec(z.reshape(b * n, zd), gt).reshape(b, n) + out[i:i + batch] = r.mean(1).cpu().numpy() + return out + + +# ---------------------------------------------------------------------------- +# fresh-reset anchors with IMAGE conditioning state +# ---------------------------------------------------------------------------- +def _fresh_reset_image_anchors(env_id, n_anchors, seed): + """Protocol-B fresh-reset anchors for visual-cube. Identical to + ``gc_core.fresh_reset_anchors`` except the recorded conditioning state ``s`` is the + 64x64x3 IMAGE observation (the visual env reset returns an image obs while the + oracle/truth read everything from the privileged ``info``). Returns the same pack + dict (so ``gc_core.gc_fresh_truth_manipspace`` consumes it unchanged) with + ``s_img`` = [A,64,64,3] uint8 added.""" + fam = gc_core.manipspace_family(env_id) + assert fam == "cube", f"expected cube family, got {fam} for {env_id}" + env = gc_core._make_manipspace_env(env_id, _DATA_DIR) + u = env.unwrapped + oracles = gc_core._make_manipspace_oracles(env, fam) + S_img, A, G, QP, QV, OBJ, TGT = [], [], [], [], [], [], [] + for i in range(n_anchors): + np.random.seed(seed * 100003 + i) + ob, info = env.reset(seed=seed * 100003 + i) + oracle = oracles[info["privileged/target_task"]] + oracle.reset(ob, info) + a0 = np.clip(np.asarray(oracle.select_action(ob, info), dtype=np.float64), -1, 1) + S_img.append(np.asarray(ob, dtype=np.uint8)) # IMAGE obs + A.append(a0.astype(np.float32)) + G.append(gc_core._manipspace_goal(info, fam).astype(np.float32)) # 3-D block goal + QP.append(np.asarray(info["qpos"], dtype=np.float64)) + QV.append(np.asarray(info["qvel"], dtype=np.float64)) + OBJ.append(gc_core._manipspace_object(info, fam).astype(np.float32)) + TGT.append(gc_core._capture_manipspace_target(u, fam, info)) + env.close() + return dict(family=fam, s_img=np.stack(S_img), a=np.stack(A), g=np.stack(G), + qpos=np.stack(QP), qvel=np.stack(QV), obj0=np.stack(OBJ), target=TGT, + # `s` placeholder so gc_fresh_truth_manipspace's len(anchors["s"]) works + s=np.stack(A)) + + +# ---------------------------------------------------------------------------- +# genq (image reward-predictive latent occupancy) + fresh-reset truth +# ---------------------------------------------------------------------------- +def run(env_id, seed, cfg): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"] + occ_model = cfg.get("occ_model", "diffusion") + z_dim = cfg.get("z_dim", 8) + n_traj_tr = cfg.get("vis_train_traj", None) + n_traj_val = cfg.get("vis_val_traj", None) + + # manipulation reward scale (NOT maze sigma=5). Match state cube (0.05 / 0.04). + if abs(cfg.get("sigma", 5.0) - 5.0) < 1e-9: + cfg["sigma"] = 0.05 + if abs(cfg.get("epsilon", 0.5) - 0.5) < 1e-9: + cfg["epsilon"] = 0.04 + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + + block_slice = _resolve_cube_block_slice(env_id) + g_dim = block_slice[1] - block_slice[0] # 3 for cube-single + + train_ds = load_visual_cube(env_id, "train", block_slice, n_traj_tr) + # fresh-reset anchors (image s + privileged qpos/qvel/target for truth) + pack = _fresh_reset_image_anchors(env_id, cfg["n_anchors"], seed) + s_img_a = pack["s_img"] + a_a = pack["a"] + g_a = pack["g"] # [A, 3] block goal + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"genqvisualcube-{occ_model}-z{z_dim}-{env_id}-s{seed}", + {**cfg, "env": env_id, "seed": seed, "method": "genq_reward_latent"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + t0 = time.time() + enc, dec, latent_mse = train_reward_latent_image(train_ds, z_dim, g_dim, cfg, + device, seed, wlog) + z_train = encode_images(enc, train_ds["img"], device) + cond_dim = z_dim + train_ds["a_dim"] + g_dim # (z_now, a, g) + occ = gc_core.build_occupancy(occ_model, cond_dim, z_dim, cfg, device) + losses = train_latent_occupancy_image(occ, train_ds, z_train, gamma, cfg, device, seed, wlog) + train_wall = time.time() - t0 + + # FRESH-ROLLOUT truth (Protocol B) — CubeMarkovOracle rolled M x H from set_state. + truth = gc_core.gc_fresh_truth_manipspace( + env_id, pack, gamma, kind, sigma, eps, + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), seed=seed, verbose=True, + dataset_dir=_DATA_DIR) + truth_kind = "fresh_rollout" + + z_now_a = encode_images(enc, s_img_a, device) # encode anchor images + gen_counts = cfg.get("gen_sample_counts", [1, 2, 4, 8, 16, 32, 64, 128, 256]) + mse_by_n, corr_by_n, mse_curve = {}, {}, [] + for N in gen_counts: + mn = q_metrics(latent_occ_q(occ, dec, z_now_a, a_a, g_a, N, device), truth) + mse_by_n[str(N)] = mn["mse"]; corr_by_n[str(N)] = mn["pearson"]; mse_curve.append(mn["mse"]) + N_final = gen_counts[-1] + est = latent_occ_q(occ, dec, z_now_a, a_a, g_a, N_final, device) + m = q_metrics(est, truth) + + result = { + "method": "genq", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "image_reward_predictive_latent", + "anchor_protocol": "fresh_reset", + "occ_model": occ_model, "z_dim": z_dim, "reward": kind, "truth_kind": truth_kind, + "gen_sample_counts": gen_counts, + "train/loss": losses, "train/q_mse": [m["mse"]], "latent/reward_mse": latent_mse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/q_mse_by_n": mse_by_n, "eval/q_corr_by_n": corr_by_n, + "eval/q_mse_vs_N": mse_curve, "eval/N_final": N_final, + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(s_img_a)), + "block_slice": list(block_slice), "sigma": sigma, "epsilon": eps, + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}) + wfinish() + return result + + +# ---------------------------------------------------------------------------- +# mc / td baselines on the cube STATE (28-D obs) — non-latent reference +# ---------------------------------------------------------------------------- +# A trained-MC / IQL-TD critic over RAW 64x64x3 pixels is a separate CNN-critic study. +# The honest, comparable reference here is the SAME mc/td recipe on the cube STATE, run +# against the IDENTICAL fresh-reset truth. The underlying sim for visual-cube IS the +# state cube (only the observation rendering differs), and ``mc.run`` / ``td.run`` already +# use ``gc_core.fresh_reset_anchors`` + ``gc_core.gc_fresh_truth_manipspace`` on the cube +# family with the SAME (seed, n_anchors, M, H, sigma, eps). So delegating to the proven +# state-cube mc/td and only relabeling ``env`` gives results scored against the same +# fresh-rollout truth as genq, with zero reimplementation risk. ``representation`` and +# ``state_env`` document the deviation in the JSON. +def _run_state_baseline(method, env_id, seed, cfg): + import mc as mc_mod + import td as td_mod + state_env_id = env_id.replace("visual-", "") + fn = mc_mod.run if method == "mc" else td_mod.run + result = fn(state_env_id, seed, cfg) + result["env"] = env_id + result["state_env"] = state_env_id + result["representation"] = "cube_state_28d_nonlatent_reference" + return result + + +def run_mc(env_id, seed, cfg): + """Trained-MC critic on the cube STATE (non-latent reference; same fresh-reset truth).""" + return _run_state_baseline("mc", env_id, seed, cfg) + + +def run_td(env_id, seed, cfg): + """IQL-TD critic on the cube STATE (non-latent reference; same fresh-reset truth).""" + return _run_state_baseline("td", env_id, seed, cfg) + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/preliminary_analysis/genq_visual_puzzle.py b/gen_q_rsm/preliminary_analysis/genq_visual_puzzle.py new file mode 100644 index 0000000000000000000000000000000000000000..63c90c35dc640c0c4e5f58edaa7c7fb0c2a158b0 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/genq_visual_puzzle.py @@ -0,0 +1,439 @@ +"""Gen-Q policy evaluation for the IMAGE puzzle env (visual-puzzle-3x3-play-v0). + +Why this file exists +-------------------- +This is the IMAGE + COMBINATORIAL cell (issue #35). It marries two existing recipes: + + * the image reward-predictive-latent occupancy of ``genq_visual.py`` (CNN encoder + over 64x64x3 frames, NEVER raw-pixel occupancy), and + * the puzzle button-state machinery of ``gc_core.py`` (the match-fraction reward and + the manipspace fresh-RESET fresh-rollout truth used by the STATE puzzle cell). + +The puzzle reward / goal / occupancy TARGET are BINARY button-state vectors (9 bits for +3x3), NOT object positions. The principled reward is the match-fraction +(``gc_core.puzzle_reward``, see issue #35) used IDENTICALLY by genq, mc, td and the +fresh-rollout truth. + +Recipe (reward-predictive image latent, frozen, then latent occupancy) +---------------------------------------------------------------------- +1. Encoder z = E_psi(image) (models.ImageEncoder, CNN, [B,3,64,64] in [0,1]) + Decoder r_hat = R_psi(z, g) (g = 9-D goal button pattern) + Loss E[(R_psi(E_psi(image), g) - puzzle_reward(button_states; g))^2] + lam||z||^2 ; + FREEZE E,R. +2. Conditioning: occupancy on (z_now, a, g), z_now = E_psi(image_now). +3. Occupancy p_theta(z' | z_now, a, g), z' = stopgrad(E_psi(image_{t+k})), + k ~ Geom(1-gamma). Conditional diffusion (NEVER a Gaussian MDN). +4. Q^pi(s,a,g) = E_{z ~ p_theta}[ R_psi(z, g) ] ~= (1/N) sum_i R_psi(z_i, g). + +Ground truth = FRESH ROLLOUTS only (fresh-RESET Protocol B, identical to the STATE +puzzle). The live PuzzleEnv sim has all privileged info, so ``set_state(qpos,qvel, +button_states)`` + ButtonMarkovOracle rollouts produce the truth REGARDLESS of whether +the model's observation is an image or a state vector. The anchor pack is built ONCE +from a live env reset and SHARED by genq/mc/td so the three score the SAME (s,a,g). + +mc / td baselines: trained-MC / IQL-TD critics over the 46-D [qpos|qvel] STATE (the +non-latent reference, documented via ``representation``), exactly mirroring the +genq_visual antmaze precedent where mc/td run on the 29-D ant state. The occupancy +TARGET / reward signal for mc/td is the button-state vector (match-fraction reward), +the same target genq's latent decoder predicts. + +EXPECTED RESULT (honest negative, inherited from the STATE puzzle): the discrete +combinatorial button task yields near-degenerate fresh-rollout truth (the target +button is either pressed or not within the horizon; truth std ~ 0.01), so Q is +essentially unrankable and ALL THREE methods (mc/td/genq) land at ~0 correlation. +This driver runs the pipeline honestly and reports whatever it finds; it does NOT tune +toward a spurious positive. The image latent is one more transformation on top of the +same degenerate truth, so the image case is expected to CONFIRM the state negative. +""" +import os +import time + +import numpy as np +import torch +import torch.nn.functional as F + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +import models +from genq_reward_latent import GCRewardDecoder + +_HERE = os.path.dirname(os.path.abspath(__file__)) +_DATA_DIR = os.path.expanduser(os.environ.get("OGBENCH_DATA_DIR", "~/.ogbench/data")) + + +# ---------------------------------------------------------------------------- +# visual-puzzle dataset (images + button_states + qpos/qvel) +# ---------------------------------------------------------------------------- +def load_visual_puzzle(env_id, split, n_traj=None): + """Load the visual-puzzle npz for `split` in {"train","val"}. + + Returns a dataset dict with: + img : uint8 [N, 64, 64, 3] (observation; encoded by the CNN, never raw) + button : float32 [N, 9] (button-state vector; reward/goal/occ TARGET) + full : float32 [N, 46] (qpos[23]+qvel[23]; the mc/td STATE reference) + act : float32 [N, 5] + end : int64 [N] (trajectory end index per step) + N, a_dim + + `n_traj` (optional) caps the number of trajectories loaded — used only for fast + CPU smoke tests; the real GPU runs use the full set. + """ + fname = env_id if split == "train" else f"{env_id}-val" + path = os.path.join(_DATA_DIR, f"{fname}.npz") + if not os.path.exists(path): + raise FileNotFoundError(f"visual-puzzle dataset not found: {path}") + d = np.load(path, mmap_mode="r") + term = np.asarray(d["terminals"], dtype=np.float32) + if n_traj is not None: + ends = np.where(term > 0.5)[0] + 1 + N = int(ends[min(n_traj, len(ends)) - 1]) if len(ends) else len(term) + else: + N = len(term) + qpos = np.asarray(d["qpos"][:N], dtype=np.float32) + qvel = np.asarray(d["qvel"][:N], dtype=np.float32) + full = np.concatenate([qpos, qvel], axis=1) # [N, 46] + button = np.asarray(d["button_states"][:N], dtype=np.float32) + return dict( + img=d["observations"][:N], # mmap'd uint8; index lazily + button=button, + full=full, + act=np.asarray(d["actions"][:N], dtype=np.float32), + end=gc_core.trajectory_bounds(term[:N]), + N=N, a_dim=int(d["actions"].shape[1]), pos_dim=int(button.shape[1]), + ) + + +def _imgs_to_tensor(img_u8, device): + x = torch.as_tensor(np.asarray(img_u8), dtype=torch.float32, device=device) / 255.0 + return x.permute(0, 3, 1, 2).contiguous() + + +# ---------------------------------------------------------------------------- +# shared fresh-reset anchor pack (built ONCE; genq/mc/td all query the same (s,a,g)) +# ---------------------------------------------------------------------------- +def build_shared_anchors(env_id, cfg, seed): + """Fresh-RESET anchors for visual-puzzle. The live (image-obs) PuzzleEnv reset gives + the IMAGE obs (genq conditioning), the privileged button goal g, the behaviour + oracle action a, and qpos/qvel/button_states (for set_state + the mc/td state + reference). Identical protocol to the STATE puzzle, just with an image `s`.""" + pack = gc_core.fresh_reset_anchors(env_id, cfg["n_anchors"], seed, dataset_dir=_DATA_DIR) + # pack["s"] is the image obs (the visual env returns 64x64x3). Add the 46-D state. + pack["state"] = np.concatenate([pack["qpos"], pack["qvel"]], axis=1).astype(np.float32) + return pack + + +# ---------------------------------------------------------------------------- +# reward-predictive CNN latent (encoder + button-goal-conditioned reward decoder) +# ---------------------------------------------------------------------------- +def train_reward_latent_image(ds, z_dim, cfg, device, seed, wlog): + """z = E_psi(image); r_hat = R_psi(z, g); fit to puzzle_reward(button; g), then freeze.""" + pos = ds["pos_dim"] + enc = models.ImageEncoder(z_dim, hidden_dim=cfg["hidden_dim"]).to(device) + dec = GCRewardDecoder(z_dim, pos, cfg["hidden_dim"], 2).to(device) + opt = torch.optim.Adam(list(enc.parameters()) + list(dec.parameters()), lr=cfg["lr"]) + rng = np.random.default_rng(seed + 3) + button, end = ds["button"], ds["end"] + lam = cfg.get("latent_l2", 1e-4) + kind = cfg["reward"] + steps = cfg.get("latent_steps", 20000) + bs = cfg["batch_size"] + final = 0.0 + for step in range(1, steps + 1): + x_idx = rng.integers(0, ds["N"], bs) + g = button[gc_core.sample_goal_after(x_idx, end, rng)] # downstream button pattern + r = gc_core.puzzle_reward(button[x_idx], g, kind).astype(np.float32) + img = _imgs_to_tensor(ds["img"][x_idx], device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + z = enc(img) + loss = F.mse_loss(dec(z, gt), rt) + lam * (z ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % max(1, steps // 20) == 0 or step == 1: + final = float(loss.item()) + wlog({"latent/loss": final}, step=step) + enc.eval(); dec.eval() + for p in enc.parameters(): p.requires_grad_(False) + for p in dec.parameters(): p.requires_grad_(False) + return enc, dec, final + + +@torch.no_grad() +def encode_images(enc, img_u8, device, batch=2048): + out = [] + for i in range(0, len(img_u8), batch): + out.append(enc(_imgs_to_tensor(img_u8[i:i+batch], device)).cpu().numpy()) + return np.concatenate(out, 0).astype(np.float32) + + +# ---------------------------------------------------------------------------- +# latent occupancy p_theta(z' | z_now, a, g) +# ---------------------------------------------------------------------------- +def train_latent_occupancy_image(occ, ds, z_all, gamma, cfg, device, seed, wlog): + act, end = ds["act"], ds["end"] + button = ds["button"] + rng = np.random.default_rng(seed + 7) + t0 = rng.integers(0, ds["N"], 20000) + j0 = gc_core.future_idx(t0, end, gamma, rng) + g0 = button[gc_core.sample_goal_after(j0, end, rng)] + c0 = np.concatenate([z_all[t0], act[t0], g0], 1) + occ.set_normalization(c0.mean(0), c0.std(0) + 1e-6, z_all[j0].mean(0), z_all[j0].std(0) + 1e-6) + z_t = torch.from_numpy(z_all) + opt = torch.optim.Adam(occ.parameters(), lr=cfg["lr"]) + losses = [] + log_every = max(1, cfg["steps"] // 50) + bs = cfg["batch_size"] + for step in range(1, cfg["steps"] + 1): + t = rng.integers(0, ds["N"], bs) + j = gc_core.future_idx(t, end, gamma, rng) + g = button[gc_core.sample_goal_after(j, end, rng)] + c = np.concatenate([z_all[t], act[t], g], 1) + loss = occ.training_loss(torch.as_tensor(c, dtype=torch.float32, device=device), + z_t[j].to(device)) + opt.zero_grad(); loss.backward() + gn = torch.nn.utils.clip_grad_norm_(occ.parameters(), 10.0); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/grad_norm": float(gn)}, step=step) + occ.eval() + return losses + + +@torch.no_grad() +def latent_occ_q(occ, dec, z_now, a, g, N, device, batch=256): + out = np.zeros(len(z_now)) + for i in range(0, len(z_now), batch): + c = np.concatenate([z_now[i:i+batch], a[i:i+batch], g[i:i+batch]], 1) + ct = torch.as_tensor(c, dtype=torch.float32, device=device) + z = occ.sample(ct, N) # [b, N, z] + b, n, zd = z.shape + gt = torch.as_tensor(g[i:i+batch], dtype=torch.float32, device=device) + gt = gt.unsqueeze(1).expand(-1, n, -1).reshape(b * n, -1) + r = dec(z.reshape(b * n, zd), gt).reshape(b, n) + out[i:i+batch] = r.mean(1).cpu().numpy() + return out + + +def _truth_for_pack(env_id, pack, cfg, seed): + """Fresh-rollout truth at the shared pack (identical to the STATE puzzle path).""" + return gc_core.gc_fresh_truth_manipspace( + env_id, pack, cfg["gamma"], cfg["reward"], cfg["sigma"], cfg["epsilon"], + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 200), seed=seed, + verbose=True, dataset_dir=_DATA_DIR) + + +# ---------------------------------------------------------------------------- +# genq (image reward-predictive latent occupancy) +# ---------------------------------------------------------------------------- +def run(env_id, seed, cfg, pack=None, truth=None): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"]; kind = cfg["reward"] + occ_model = cfg.get("occ_model", "diffusion") + z_dim = cfg.get("z_dim", 8) + + train_ds = load_visual_puzzle(env_id, "train", cfg.get("vis_train_traj")) + pos = train_ds["pos_dim"] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"genqvispuzzle-{occ_model}-z{z_dim}-{env_id}-s{seed}", + {**cfg, "env": env_id, "seed": seed, "method": "genq_reward_latent"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + if pack is None: + pack = build_shared_anchors(env_id, cfg, seed) + a_a = pack["a"].astype(np.float32) + g_a = pack["g"].astype(np.float32) # 9-D goal button pattern + s_img_a = pack["s"] # image obs at each anchor + + t0 = time.time() + enc, dec, latent_mse = train_reward_latent_image(train_ds, z_dim, cfg, device, seed, wlog) + z_train = encode_images(enc, train_ds["img"], device) + cond_dim = z_dim + train_ds["a_dim"] + pos # (z_now, a, g_button) + occ = gc_core.build_occupancy(occ_model, cond_dim, z_dim, cfg, device) + losses = train_latent_occupancy_image(occ, train_ds, z_train, gamma, cfg, device, seed, wlog) + train_wall = time.time() - t0 + + if truth is None: + truth = _truth_for_pack(env_id, pack, cfg, seed) + z_now_a = encode_images(enc, s_img_a, device) + + gen_counts = cfg.get("gen_sample_counts", [1, 2, 4, 8, 16, 32, 64, 128, 256]) + mse_by_n, corr_by_n, mse_curve = {}, {}, [] + for N in gen_counts: + mn = q_metrics(latent_occ_q(occ, dec, z_now_a, a_a, g_a, N, device), truth) + mse_by_n[str(N)] = mn["mse"]; corr_by_n[str(N)] = mn["pearson"]; mse_curve.append(mn["mse"]) + N_final = gen_counts[-1] + est = latent_occ_q(occ, dec, z_now_a, a_a, g_a, N_final, device) + m = q_metrics(est, truth) + + result = { + "method": "genq_reward_latent", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "image_reward_predictive_latent", + "occ_model": occ_model, "z_dim": z_dim, "reward": kind, + "truth_kind": "fresh_rollout", "anchor_protocol": "fresh_reset", + "gen_sample_counts": gen_counts, + "train/loss": losses, "train/q_mse": [m["mse"]], "latent/reward_mse": latent_mse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/q_mse_by_n": mse_by_n, "eval/q_corr_by_n": corr_by_n, + "eval/q_mse_vs_N": mse_curve, "eval/N_final": N_final, + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(a_a)), + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}); wfinish() + return result, pack, truth + + +# ---------------------------------------------------------------------------- +# mc / td baselines on the 46-D [qpos|qvel] STATE (non-latent reference, documented) +# ---------------------------------------------------------------------------- +def _state_setup(env_id, cfg): + """Train/val state datasets: obs = 46-D [qpos|qvel]; occupancy TARGET = button vec.""" + tr_v = load_visual_puzzle(env_id, "train", cfg.get("vis_train_traj")) + tr = dict(obs=tr_v["full"], act=tr_v["act"], end=tr_v["end"], N=tr_v["N"], + s_dim=tr_v["full"].shape[1], a_dim=tr_v["a_dim"], pos_dim=tr_v["pos_dim"], + obj=tr_v["button"], manipspace=True, family="puzzle") + return tr + + +def run_mc(env_id, seed, cfg, pack=None, truth=None): + import mc as mc_mod + device = get_device(); set_seed(seed) + gamma = cfg["gamma"]; kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + tr = _state_setup(env_id, cfg) + pos = tr["pos_dim"] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"mc-state46-{env_id}-s{seed}", {**cfg, "env": env_id, "seed": seed, "method": "mc"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + if pack is None: + pack = build_shared_anchors(env_id, cfg, seed) + s_a = pack["state"]; a_a = pack["a"].astype(np.float32); g_a = pack["g"].astype(np.float32) + + rng = np.random.default_rng(seed) + tgt = tr["obj"] # button states (occ target / reward signal) + cand = np.where((tr["end"] - np.arange(tr["N"])) >= 2)[0] + n_fit = min(cfg.get("mc_fit_anchors", 80000), len(cand)) + fit_idx = cand[rng.integers(0, len(cand), size=n_fit)] + fit_g = tgt[gc_core.sample_goal_idx(fit_idx, tr["end"], rng)] + fit_ret = mc_mod.gc_return(tgt, tr["end"], fit_g, fit_idx, gamma, sigma, kind, eps, + family="puzzle") + + net = mc_mod.QNet(tr["s_dim"], pos, tr["a_dim"], cfg["hidden_dim"], cfg["num_layers"]).to(device) + opt = torch.optim.Adam(net.parameters(), lr=cfg["lr"]) + St = torch.as_tensor(tr["obs"][fit_idx], dtype=torch.float32) + Gt = torch.as_tensor(fit_g, dtype=torch.float32) + At = torch.as_tensor(tr["act"][fit_idx], dtype=torch.float32) + Rt = torch.as_tensor(fit_ret, dtype=torch.float32) + losses, qmse = [], []; log_every = max(1, cfg["steps"] // 50); t0 = time.time() + for step in range(1, cfg["steps"] + 1): + b = rng.integers(0, len(fit_idx), cfg["batch_size"]) + loss = ((net(St[b].to(device), Gt[b].to(device), At[b].to(device)) - Rt[b].to(device)) ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())); qmse.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/q_mse": float(loss.item())}, step=step) + net.eval(); train_wall = time.time() - t0 + + if truth is None: + truth = _truth_for_pack(env_id, pack, cfg, seed) + with torch.no_grad(): + est = net(torch.as_tensor(s_a, dtype=torch.float32, device=device), + torch.as_tensor(g_a, dtype=torch.float32, device=device), + torch.as_tensor(a_a, dtype=torch.float32, device=device)).cpu().numpy() + m = q_metrics(est, truth) + result = {"method": "mc", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "puzzle_state_46d", "reward": kind, + "truth_kind": "fresh_rollout", "anchor_protocol": "fresh_reset", + "train/loss": losses, "train/q_mse": qmse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/truth_std": float(np.std(truth)), "wall_clock_s": train_wall, + "n_anchors": int(len(a_a))} + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}); wfinish() + return result, pack, truth + + +def run_td(env_id, seed, cfg, pack=None, truth=None): + import mc as mc_mod + import td as td_mod + device = get_device(); set_seed(seed) + gamma = cfg["gamma"]; kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + tr = _state_setup(env_id, cfg) + pos = tr["pos_dim"] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"td-state46-{env_id}-s{seed}", {**cfg, "env": env_id, "seed": seed, "method": "td"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + if pack is None: + pack = build_shared_anchors(env_id, cfg, seed) + s_a = pack["state"]; a_a = pack["a"].astype(np.float32); g_a = pack["g"].astype(np.float32) + + obs = tr["obs"]; act = tr["act"]; end = tr["end"]; N = tr["N"]; tgt = tr["obj"] + nxt = np.where((end - np.arange(N)) > 1)[0] + sd, ad = tr["s_dim"], tr["a_dim"]; Hd, L = cfg["hidden_dim"], cfg["num_layers"] + q = mc_mod.QNet(sd, pos, ad, Hd, L).to(device) + qt = mc_mod.QNet(sd, pos, ad, Hd, L).to(device); qt.load_state_dict(q.state_dict()) + v = td_mod.VNet(sd, pos, Hd, L).to(device) + optq = torch.optim.Adam(q.parameters(), lr=cfg["lr"]) + optv = torch.optim.Adam(v.parameters(), lr=cfg["lr"]) + tau = cfg.get("iql_expectile", 0.5); polyak = cfg.get("polyak", 0.005) + rng = np.random.default_rng(seed) + losses, qmse = [], []; log_every = max(1, cfg["steps"] // 50); t0 = time.time() + for step in range(1, cfg["steps"] + 1): + idx = nxt[rng.integers(0, len(nxt), size=cfg["batch_size"])] + g = tgt[gc_core.sample_goal_idx(idx, end, rng)] # button-pattern goal + r = gc_core.puzzle_reward(tgt[idx], g, kind).astype(np.float32) # match-fraction reward + s = torch.as_tensor(obs[idx], device=device) + a = torch.as_tensor(act[idx], device=device) + s2 = torch.as_tensor(obs[idx + 1], device=device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + with torch.no_grad(): + qsa = qt(s, gt, a) + diff = qsa - v(s, gt) + w = torch.abs(tau - (diff < 0).float()) + loss_v = (w * diff ** 2).mean() + optv.zero_grad(); loss_v.backward(); optv.step() + with torch.no_grad(): + y = (1 - gamma) * rt + gamma * v(s2, gt) + loss_q = ((q(s, gt, a) - y) ** 2).mean() + optq.zero_grad(); loss_q.backward(); optq.step() + with torch.no_grad(): + for p, ptg in zip(q.parameters(), qt.parameters()): + ptg.mul_(1 - polyak).add_(polyak * p) + if step % log_every == 0 or step == 1: + losses.append(float(loss_q.item())); qmse.append(float(loss_q.item())) + wlog({"train/loss": float(loss_q.item()), "train/q_mse": float(loss_q.item()), + "train/v_loss": float(loss_v.item())}, step=step) + q.eval(); train_wall = time.time() - t0 + + if truth is None: + truth = _truth_for_pack(env_id, pack, cfg, seed) + with torch.no_grad(): + est = q(torch.as_tensor(s_a, dtype=torch.float32, device=device), + torch.as_tensor(g_a, dtype=torch.float32, device=device), + torch.as_tensor(a_a, dtype=torch.float32, device=device)).cpu().numpy() + m = q_metrics(est, truth) + result = {"method": "td", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "representation": "puzzle_state_46d", "reward": kind, + "truth_kind": "fresh_rollout", "anchor_protocol": "fresh_reset", + "train/loss": losses, "train/q_mse": qmse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/truth_std": float(np.std(truth)), "wall_clock_s": train_wall, + "n_anchors": int(len(a_a))} + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}); wfinish() + return result, pack, truth + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/preliminary_analysis/illustration.py b/gen_q_rsm/preliminary_analysis/illustration.py new file mode 100644 index 0000000000000000000000000000000000000000..a139eef14beed2761f2fad3f6a0139099772cc36 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/illustration.py @@ -0,0 +1,112 @@ +"""Animate how Gen-Q estimates the goal-conditioned Q^pi from the learned occupancy. + +Trains a goal-conditioned diffusion occupancy on PointMaze, then renders a GIF +showing, for a query (s, a, g): + * left panel: the occupancy cloud forming over DDIM denoising steps, coloured by + goal-reaching reward, over the maze + reward field; + * right panel: the running estimate Q^pi(s,a,g) = mean_i r(x_i; g) converging as + the denoising sharpens. +""" +import argparse +import os + +import numpy as np +import torch +import matplotlib +matplotlib.use("Agg") +import matplotlib.pyplot as plt +from matplotlib import animation + +from _common import get_device, set_seed +import gc_core +from config import make_cfg + +_HERE = os.path.dirname(os.path.abspath(__file__)) + + +def env_safe(env_id): + return env_id.replace("-", "_") + + +def make_gif(env_id="pointmaze-medium-navigate-v0", seed=0, steps=20000, n=400, out=None): + device = get_device() + set_seed(seed) + cfg = make_cfg(steps=steps, wandb_mode="disabled") + gamma = cfg["gamma"]; sigma = cfg["sigma"]; pos = 2; cfg["pos_dim"] = pos + kind, eps = "dense", cfg["epsilon"] + train_ds, val_ds, env, _ = gc_core.load_ogbench_gc(env_id, gamma) + env.reset() + # maze layout rectangles (drawn under the scatter so occupancy mass visibly + # respects the walls). If geometry can't be recovered, flag it. + wall_rects, wall_extent = gc_core.maze_wall_rects(env) + if wall_rects is None: + print(f"[illustration] WARNING: no maze geometry for {env_id}; background " + f"will be blank — FLAG this rather than trusting the layout.", flush=True) + + cond_dim = train_ds["s_dim"] + train_ds["a_dim"] + pos + occ = gc_core.build_occupancy("diffusion", cond_dim, pos, cfg, device) + gc_core.train_gc_occupancy(occ, train_ds, gamma, cfg, device, seed) + + rng = np.random.default_rng(seed) + idx = gc_core.anchors_with_min_horizon(val_ds, 1, cfg["min_horizon"], rng)[0] + s = val_ds["obs"][idx:idx + 1]; a = val_ds["act"][idx:idx + 1] + g = val_ds["obs"][gc_core.sample_goal_idx(np.array([idx]), val_ds["end"], rng)][:, :pos] + c = torch.as_tensor(np.concatenate([s, a, g], 1), dtype=torch.float32, device=device) + _, traj = occ.sample_trajectory(c, n_samples=n) + + def rew(pts): + d = np.linalg.norm(pts - g[0][None], axis=1) + return gc_core.reward_of_dist(d, kind, sigma, eps) + + from matplotlib.patches import Rectangle + running_q = [float(rew(cloud[0]).mean()) for cloud in traj] + fig, (axL, axR) = plt.subplots(1, 2, figsize=(11, 5)) + + def frame(i): + axL.clear(); axR.clear() + # real maze layout underneath: wall cells as filled gray rectangles in xy + if wall_rects is not None: + for (x0, y0, w, h) in wall_rects: + axL.add_patch(Rectangle((x0, y0), w, h, facecolor="0.6", + edgecolor="0.4", lw=0.5, zorder=0)) + axL.set_xlim(wall_extent[0], wall_extent[1]) + axL.set_ylim(wall_extent[2], wall_extent[3]) + axL.set_aspect("equal") + pts = traj[i][0] + axL.scatter(pts[:, 0], pts[:, 1], c=rew(pts), cmap="viridis", s=10, alpha=0.8, zorder=2) + axL.scatter([s[0, 0]], [s[0, 1]], c="black", s=120, marker="*", label="query s", zorder=3) + axL.scatter([g[0, 0]], [g[0, 1]], c="red", s=120, marker="X", label="goal g", zorder=3) + axL.set_title(f"occupancy p_theta(.|s,a,g) over the maze — denoising step {i+1}/{len(traj)}") + axL.legend(loc="upper left", fontsize=8) + axR.plot(range(1, i + 2), running_q[:i + 1], "-o", color="tab:green") + axR.axhline(running_q[-1], ls="--", color="gray", alpha=0.6, + label=f"final Q={running_q[-1]:.3f}") + axR.set_xlim(1, len(traj)); axR.set_ylim(0, max(running_q) * 1.2 + 1e-6) + axR.set_xlabel("denoising step"); axR.set_ylabel("Q(s,a,g) = mean r(x;g)") + axR.set_title("Gen-Q estimate converging"); axR.legend(fontsize=8); axR.grid(alpha=0.3) + + anim = animation.FuncAnimation(fig, frame, frames=len(traj), interval=200) + out = out or os.path.join(_HERE, "experiments", env_safe(env_id), "figures", "illustration.gif") + os.makedirs(os.path.dirname(out), exist_ok=True) + anim.save(out, writer=animation.PillowWriter(fps=5)) + plt.close(fig) + print(f"[illustration] wrote {out} final Q={running_q[-1]:.4f}", flush=True) + return out + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--env", default="pointmaze-medium-navigate-v0") + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--steps", type=int, default=20000) + ap.add_argument("--n", type=int, default=400) + ap.add_argument("--out", default=None, + help="explicit output path. visual-pointmaze has no live env, but the " + "occupancy->Q mechanism is identical on the underlying maze, so we " + "render the state-maze illustration into the visual env figures dir.") + args = ap.parse_args() + make_gif(args.env, args.seed, args.steps, args.n, out=args.out) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/preliminary_analysis/mc.py b/gen_q_rsm/preliminary_analysis/mc.py new file mode 100644 index 0000000000000000000000000000000000000000..ccf7009b48a6d0984a8b9db7df2d7c6aa136bfa4 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/mc.py @@ -0,0 +1,150 @@ +"""Monte-Carlo goal-conditioned policy evaluation of Q^pi(s, a, g). + +Math +---- +The goal-conditioned behaviour value is the discounted occupancy expectation of +the goal-reaching reward: + + Q^pi(s, a, g) = (1-gamma) E[ sum_{k>=0} gamma^k r(s_{t+k}; g) | s,a,g ]. + +MC estimates this from logged trajectories: the renormalized discounted +return-to-go toward a hindsight goal g, + + G_t(g) = ( sum_{j>=t} (1-gamma)gamma^{j-t} r(s_j; g) ) / ( sum_{j>=t} (1-gamma)gamma^{j-t} ), + +is an unbiased (high-variance) sample of Q^pi(s_t, a_t, g). We fit a regressor +Q_MC(s, a, g) on these targets so the estimate generalizes and averages out +single-rollout variance (the strong "trained MC" baseline). + +NOTE the in-trajectory return-to-go is the TRAINING TARGET for the MC regressor +only; the regressor's predictions are scored against FRESH on-policy rollouts +(``evaluate_policy.ground_truth_q``), exactly like Gen-Q and TD. + +Pseudocode +---------- + for sampled transitions t with hindsight goal g_t: G_t(g_t) <- renorm return-to-go + train Q_MC(s, a, g) by regression onto {(s_t, a_t, g_t) -> G_t} + eval : Q_MC(s_anchor, a_anchor, g_anchor) ; score vs fresh-rollout truth +""" +import time + +import numpy as np +import torch +import torch.nn as nn + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +import models +from evaluate_policy import ground_truth_q + + +class QNet(nn.Module): + """Q(s, g, a).""" + def __init__(self, s_dim, g_dim, a_dim, hidden=256, layers=3): + super().__init__() + self.net = models.mlp(s_dim + g_dim + a_dim, 1, hidden, layers) + + def forward(self, s, g, a): + return self.net(torch.cat([s, g, a], -1)).squeeze(-1) + + +def gc_return(obs_xy, end, goal_xy, anchors, gamma, sigma, kind, eps, family=None): + """Renormalized discounted goal-reaching return along each anchor's trajectory. + + For puzzle (family=="puzzle") obs_xy / goal_xy are binary button-state vectors and the + per-step reward is the match-fraction (``puzzle_reward``); else position-distance.""" + out = np.zeros(len(anchors)) + for i, t in enumerate(anchors): + e = end[t]; g = goal_xy[i] + idx = np.arange(t, e) + if family == "puzzle": + r = gc_core.puzzle_reward(obs_xy[idx], g[None, :], kind) + else: + d = np.linalg.norm(obs_xy[idx] - g, axis=1) + r = gc_core.reward_of_dist(d, kind, sigma, eps) + w = (1 - gamma) * gamma ** (idx - t) + out[i] = (w * r).sum() / max(w.sum(), 1e-12) + return out + + +def run(env_id, seed, cfg): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"] + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + state_slice = cfg.get("state_slice", "auto") + train_ds, val_ds, _, _ = gc_core.load_ogbench_gc(env_id, gamma, state_slice=state_slice) + pos = train_ds.get("pos_dim", cfg.get("pos_dim", 2)) + cfg["pos_dim"] = pos + rng = np.random.default_rng(seed) + pack = gc_core.prepare_eval_anchors(env_id, val_ds, cfg, seed) + sigma, eps = cfg["sigma"], cfg["epsilon"] # prepare may set manipspace reward scale + s_a, a_a, g_a = pack["s"], pack["a"], pack["g"] + anchors = pack["anchor_idx"] + anchor_full = pack["anchor_full"] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"mc-{env_id}-s{seed}", {**cfg, "env": env_id, "seed": seed, "method": "mc"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + # training targets: hindsight-goal-conditioned return-to-go on the train set. + # The reward/goal POSITION is the privileged object pos for manipspace, else xy. + tr = train_ds + tgt_pos = gc_core._target_array(tr, cfg) # [N, pos] + cand = np.where((tr["end"] - np.arange(tr["N"])) >= 2)[0] + n_fit = min(cfg.get("mc_fit_anchors", 80000), len(cand)) + fit_idx = cand[rng.integers(0, len(cand), size=n_fit)] + fit_g = tgt_pos[gc_core.sample_goal_idx(fit_idx, tr["end"], rng)] + family = tr.get("family") + fit_ret = gc_return(tgt_pos, tr["end"], fit_g, fit_idx, gamma, sigma, kind, eps, + family=family) + + net = QNet(tr["s_dim"], pos, tr["a_dim"], cfg["hidden_dim"], cfg["num_layers"]).to(device) + opt = torch.optim.Adam(net.parameters(), lr=cfg["lr"]) + St = torch.as_tensor(tr["obs"][fit_idx], dtype=torch.float32) + Gt = torch.as_tensor(fit_g, dtype=torch.float32) + At = torch.as_tensor(tr["act"][fit_idx], dtype=torch.float32) + Rt = torch.as_tensor(fit_ret, dtype=torch.float32) + + losses, qmse = [], [] + log_every = max(1, cfg["steps"] // 50) + t0 = time.time() + for step in range(1, cfg["steps"] + 1): + b = rng.integers(0, len(fit_idx), cfg["batch_size"]) + loss = ((net(St[b].to(device), Gt[b].to(device), At[b].to(device)) - Rt[b].to(device)) ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % log_every == 0 or step == 1: + losses.append(float(loss.item())); qmse.append(float(loss.item())) + wlog({"train/loss": float(loss.item()), "train/q_mse": float(loss.item())}, step=step) + net.eval() + train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, val_ds, anchors, g_a, gamma, + kind=kind, sigma=sigma, eps=eps, + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), seed=seed, + anchor_full=anchor_full, anchors_pack=pack["anchors_pack"]) + with torch.no_grad(): + est = net(torch.as_tensor(s_a, dtype=torch.float32, device=device), + torch.as_tensor(g_a, dtype=torch.float32, device=device), + torch.as_tensor(a_a, dtype=torch.float32, device=device)).cpu().numpy() + m = q_metrics(est, truth) + + result = { + "method": "mc", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "reward": kind, "truth_kind": truth_kind, + "anchor_protocol": pack["anchor_protocol"], + "train/loss": losses, "train/q_mse": qmse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(s_a)), + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}) + wfinish() + return result + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/preliminary_analysis/models.py b/gen_q_rsm/preliminary_analysis/models.py new file mode 100644 index 0000000000000000000000000000000000000000..29f46d6e0a5607318ec280d0d47bde3dad8241a1 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/models.py @@ -0,0 +1,487 @@ +"""Models: conditional Gaussian mixture density network, encoder/reward decoder, +one-step dynamics model, and proposal network. All in PyTorch.""" +import math +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F + +LOG_2PI = math.log(2 * math.pi) + + +def mlp(in_dim, out_dim, hidden_dim, num_layers, act=nn.ReLU): + layers = [] + d = in_dim + for _ in range(num_layers): + layers += [nn.Linear(d, hidden_dim), act()] + d = hidden_dim + layers += [nn.Linear(d, out_dim)] + return nn.Sequential(*layers) + + +class ConditionalGMM(nn.Module): + """p(y | c) as a diagonal-covariance Gaussian mixture, c = conditioning input. + + Outputs mixture logits [M], means [M, D], log_stds [M, D]. + """ + + def __init__(self, cond_dim, y_dim, num_components=8, hidden_dim=256, num_layers=3, + log_std_min=-7.0, log_std_max=2.0): + super().__init__() + self.y_dim = y_dim + self.M = num_components + self.log_std_min = log_std_min + self.log_std_max = log_std_max + self.backbone = mlp(cond_dim, hidden_dim, hidden_dim, num_layers) + self.head_logits = nn.Linear(hidden_dim, num_components) + self.head_means = nn.Linear(hidden_dim, num_components * y_dim) + self.head_logstd = nn.Linear(hidden_dim, num_components * y_dim) + + def forward(self, c): + h = F.relu(self.backbone(c)) + B = c.shape[0] + logits = self.head_logits(h) # [B, M] + means = self.head_means(h).view(B, self.M, self.y_dim) # [B, M, D] + log_stds = self.head_logstd(h).view(B, self.M, self.y_dim) + log_stds = torch.clamp(log_stds, self.log_std_min, self.log_std_max) + return logits, means, log_stds + + def training_loss(self, c, y): + return -self.log_prob(c, y).mean() + + @torch.no_grad() + def eval_loss(self, c, y): + return float((-self.log_prob(c, y)).mean().item()) + + def log_prob(self, c, y): + """log p(y|c). y: [B, D]. Returns [B].""" + logits, means, log_stds = self.forward(c) + log_w = F.log_softmax(logits, dim=-1) # [B, M] + y = y.unsqueeze(1) # [B, 1, D] + var = torch.exp(2 * log_stds) + comp_logp = -0.5 * (((y - means) ** 2) / var + 2 * log_stds + LOG_2PI) + comp_logp = comp_logp.sum(-1) # [B, M] + return torch.logsumexp(log_w + comp_logp, dim=-1) # [B] + + def log_prob_from_params(self, params, y): + logits, means, log_stds = params + log_w = F.log_softmax(logits, dim=-1) + y = y.unsqueeze(1) + var = torch.exp(2 * log_stds) + comp_logp = -0.5 * (((y - means) ** 2) / var + 2 * log_stds + LOG_2PI) + comp_logp = comp_logp.sum(-1) + return torch.logsumexp(log_w + comp_logp, dim=-1) + + @torch.no_grad() + def sample(self, c, n_samples=1): + """Sample y ~ p(.|c). Returns [B, n_samples, D].""" + logits, means, log_stds = self.forward(c) + B = c.shape[0] + probs = F.softmax(logits, dim=-1) # [B, M] + comp = torch.multinomial(probs, n_samples, replacement=True) # [B, n_samples] + idx = comp.unsqueeze(-1).expand(-1, -1, self.y_dim) # [B, n, D] + mu = torch.gather(means, 1, idx) + ls = torch.gather(log_stds, 1, idx) + eps = torch.randn_like(mu) + return mu + eps * torch.exp(ls) + + @torch.no_grad() + def sample_with_logprob(self, c, n_samples=1): + y = self.sample(c, n_samples) # [B, n, D] + B, n, D = y.shape + params = self.forward(c) + # broadcast log_prob over n samples + logits, means, log_stds = params + log_w = F.log_softmax(logits, dim=-1).unsqueeze(1) # [B,1,M] + var = torch.exp(2 * log_stds).unsqueeze(1) # [B,1,M,D] + mu = means.unsqueeze(1) # [B,1,M,D] + ls = log_stds.unsqueeze(1) + yy = y.unsqueeze(2) # [B,n,1,D] + comp_logp = -0.5 * (((yy - mu) ** 2) / var + 2 * ls + LOG_2PI).sum(-1) # [B,n,M] + logp = torch.logsumexp(log_w + comp_logp, dim=-1) # [B,n] + return y, logp + + +class SinusoidalEmbedding(nn.Module): + def __init__(self, dim): + super().__init__() + self.dim = dim + + def forward(self, t): + # t: [B] float in [0,1] + device = t.device + half = self.dim // 2 + freqs = torch.exp(-math.log(10000) * torch.arange(half, device=device) / max(half - 1, 1)) + ang = t[:, None] * freqs[None] * 1000.0 + return torch.cat([torch.sin(ang), torch.cos(ang)], dim=-1) + + +def _cosine_abar(T, s=0.008): + steps = torch.arange(T + 1, dtype=torch.float64) + f = torch.cos(((steps / T) + s) / (1 + s) * math.pi / 2) ** 2 + abar = f / f[0] + return abar[1:].clamp(1e-6, 0.9999).float() # alpha_bar[t], t=1..T + + +class ConditionalDiffusion(nn.Module): + """Conditional DDPM for p(y | c). Predicts noise eps; samples via DDIM. + + Same external interface as ConditionalGMM where possible: `.sample(c, n)` -> [B,n,D]. + Densities (for importance weighting) come from the probability-flow ODE: `.log_prob`. + """ + + def __init__(self, cond_dim, y_dim, hidden_dim=256, num_layers=4, T=100, + time_dim=64, sample_steps=30): + super().__init__() + self.y_dim = y_dim + self.cond_dim = cond_dim + self.T = T + self.sample_steps = sample_steps + self.time_emb = nn.Sequential(SinusoidalEmbedding(time_dim), + nn.Linear(time_dim, time_dim), nn.SiLU(), + nn.Linear(time_dim, time_dim)) + self.cond_emb = nn.Sequential(nn.Linear(cond_dim, hidden_dim), nn.SiLU()) + self.x_emb = nn.Linear(y_dim, hidden_dim) + layers = [] + d = hidden_dim + hidden_dim + time_dim + for _ in range(num_layers): + layers += [nn.Linear(d, hidden_dim), nn.SiLU()] + d = hidden_dim + self.trunk = nn.Sequential(*layers) + self.out = nn.Linear(hidden_dim, y_dim) + abar = _cosine_abar(T) + self.register_buffer("abar", abar) # [T], index t-1 + self.register_buffer("abar_prev", torch.cat([torch.ones(1), abar[:-1]])) + # normalization buffers (identity until set_normalization called) + self.register_buffer("cond_mean", torch.zeros(cond_dim)) + self.register_buffer("cond_std", torch.ones(cond_dim)) + self.register_buffer("y_mean", torch.zeros(y_dim)) + self.register_buffer("y_std", torch.ones(y_dim)) + + def set_normalization(self, cond_mean, cond_std, y_mean, y_std): + self.cond_mean.copy_(torch.as_tensor(cond_mean, dtype=torch.float32)) + self.cond_std.copy_(torch.as_tensor(cond_std, dtype=torch.float32)) + self.y_mean.copy_(torch.as_tensor(y_mean, dtype=torch.float32)) + self.y_std.copy_(torch.as_tensor(y_std, dtype=torch.float32)) + + def _nc(self, c): + return (c - self.cond_mean) / self.cond_std + + def _ny(self, y): + return (y - self.y_mean) / self.y_std + + def _uny(self, yn): + return yn * self.y_std + self.y_mean + + def eps_pred(self, x, t_frac, c): + """x:[B,D] normalized, t_frac:[B] in (0,1], c:[B,cond] normalized.""" + te = self.time_emb(t_frac) + h = torch.cat([self.x_emb(x), self.cond_emb(c), te], dim=-1) + return self.out(self.trunk(h)) + + def training_loss(self, c, x0): + c = self._nc(c); x0 = self._ny(x0) + B = x0.shape[0] + t = torch.randint(1, self.T + 1, (B,), device=x0.device) + abar = self.abar[t - 1].unsqueeze(-1) + noise = torch.randn_like(x0) + xt = abar.sqrt() * x0 + (1 - abar).sqrt() * noise + pred = self.eps_pred(xt, t.float() / self.T, c) + return F.mse_loss(pred, noise) + + @torch.no_grad() + def eval_loss(self, c, x0, n_t=8): + """Deterministic denoising-loss proxy averaged over a fixed t grid.""" + c = self._nc(c); x0 = self._ny(x0) + B = x0.shape[0] + ts = torch.linspace(1, self.T, n_t, device=x0.device).long().clamp(1, self.T) + gen = torch.Generator(device=x0.device).manual_seed(0) + tot = 0.0 + for t in ts: + abar = self.abar[t - 1] + noise = torch.randn(x0.shape, generator=gen, device=x0.device) + xt = abar.sqrt() * x0 + (1 - abar).sqrt() * noise + tf = torch.full((B,), float(t) / self.T, device=x0.device) + pred = self.eps_pred(xt, tf, c) + tot += F.mse_loss(pred, noise).item() + return tot / len(ts) + + @torch.no_grad() + def sample(self, c, n_samples=1, steps=None, eta=0.0): + """DDIM sampling. Returns [B, n_samples, D] in raw (unnormalized) coordinates.""" + steps = steps or self.sample_steps + c = self._nc(c) + B = c.shape[0] + cc = c.unsqueeze(1).expand(-1, n_samples, -1).reshape(B * n_samples, -1) + x = torch.randn(B * n_samples, self.y_dim, device=c.device) + ts = torch.linspace(self.T, 1, steps, device=c.device).long().clamp(1, self.T) + for i in range(steps): + t = ts[i] + abar_t = self.abar[t - 1] + tf = torch.full((B * n_samples,), float(t) / self.T, device=c.device) + eps = self.eps_pred(x, tf, cc) + x0 = (x - (1 - abar_t).sqrt() * eps) / abar_t.sqrt() + x0 = x0.clamp(-5.0, 5.0) # normalized data is ~unit std; clamp well outside support + if i < steps - 1: + t_next = ts[i + 1] + abar_n = self.abar[t_next - 1] + sigma = eta * ((1 - abar_n) / (1 - abar_t)).sqrt() * (1 - abar_t / abar_n).sqrt() + noise = torch.randn_like(x) if eta > 0 else 0.0 + x = abar_n.sqrt() * x0 + (1 - abar_n - sigma ** 2).clamp(min=0).sqrt() * eps + sigma * noise + else: + x = x0 + x = self._uny(x) + return x.view(B, n_samples, self.y_dim) + + @torch.no_grad() + def sample_trajectory(self, c, n_samples=1, steps=None): + """Like sample(), but returns (final, traj) where traj is a list of the clean-estimate x0 + (raw coords) at each DDIM step -- for animating how the occupancy cloud forms.""" + steps = steps or self.sample_steps + c = self._nc(c); B = c.shape[0] + cc = c.unsqueeze(1).expand(-1, n_samples, -1).reshape(B * n_samples, -1) + x = torch.randn(B * n_samples, self.y_dim, device=c.device) + ts = torch.linspace(self.T, 1, steps, device=c.device).long().clamp(1, self.T) + traj = [] + for i in range(steps): + t = ts[i]; abar_t = self.abar[t - 1] + tf = torch.full((B * n_samples,), float(t) / self.T, device=c.device) + eps = self.eps_pred(x, tf, cc) + x0 = ((x - (1 - abar_t).sqrt() * eps) / abar_t.sqrt()).clamp(-5.0, 5.0) + traj.append(self._uny(x0).view(B, n_samples, self.y_dim).cpu().numpy()) + if i < steps - 1: + abar_n = self.abar[ts[i + 1] - 1] + x = abar_n.sqrt() * x0 + (1 - abar_n).clamp(min=0).sqrt() * eps + else: + x = x0 + return self._uny(x).view(B, n_samples, self.y_dim), traj + + def score(self, x, t_frac, c): + """score = grad_x log p_t(x) = -eps / sqrt(1-abar_t).""" + t = (t_frac * self.T).round().long().clamp(1, self.T) + abar = self.abar[t - 1].unsqueeze(-1) + eps = self.eps_pred(x, t_frac, c) + return -eps / (1 - abar).sqrt() + + @torch.no_grad() + def log_prob(self, c, y, steps=None, n_hutch=4): + """Approximate log p(y|c) via the probability-flow ODE (continuous-time change of + variables). Uses Hutchinson trace estimation. Returns [B].""" + steps = steps or max(self.sample_steps, 40) + device = y.device + B = y.shape[0] + c = self._nc(c) + x = self._ny(y).clone() + jac_norm = -torch.log(self.y_std).sum() # change of vars for normalization + logdet = torch.zeros(B, device=device) + # integrate from t=eps_t -> t=1 (data -> noise) in continuous time s in (0,1] + s_grid = torch.linspace(1.0 / self.T, 1.0, steps, device=device) + eps_vecs = [torch.randint(0, 2, y.shape, device=device).float() * 2 - 1 for _ in range(n_hutch)] + for i in range(len(s_grid) - 1): + s0 = s_grid[i]; s1 = s_grid[i + 1] + ds = (s1 - s0) + sf = torch.full((B,), float(s0), device=device) + f = self._pf_drift(x, sf, c) + # divergence via Hutchinson + with torch.enable_grad(): + xg = x.detach().requires_grad_(True) + ff = self._pf_drift(xg, sf, c) + div = torch.zeros(B, device=device) + for ev in eps_vecs: + g = torch.autograd.grad(ff, xg, grad_outputs=ev, create_graph=False, retain_graph=True)[0] + div += (g * ev).sum(-1) + div /= len(eps_vecs) + x = x + ds * f + logdet = logdet + ds * div + # log p_1(x) standard normal + log_pT = (-0.5 * (x ** 2).sum(-1) - 0.5 * self.y_dim * math.log(2 * math.pi)) + return log_pT + logdet + jac_norm + + def _pf_drift(self, x, s_frac, c): + """Probability-flow ODE drift in the variance-preserving 's in (0,1]' time where + we map continuous s to nearest discrete t. dx/ds = f(x,s). Uses a VP-SDE form.""" + t = (s_frac * self.T).round().long().clamp(1, self.T) + abar = self.abar[t - 1].unsqueeze(-1) + abar_prev = self.abar_prev[t - 1].unsqueeze(-1) + # discrete beta_t approx + beta = (1 - abar / abar_prev).clamp(1e-6, 0.999) + eps = self.eps_pred(x, s_frac, c) + score = -eps / (1 - abar).sqrt() + # PF-ODE drift (VP): -0.5 beta x - 0.5 beta score, per unit discrete step; scale by T for s-time + return self.T * (-0.5 * beta * x - 0.5 * beta * score) + + +class ImageEncoder(nn.Module): + """z = E(image). Small CNN for 64x64x3 -> z. Input expected as [B,3,64,64] float in [0,1].""" + + def __init__(self, z_dim, ch=32, hidden_dim=256): + super().__init__() + self.conv = nn.Sequential( + nn.Conv2d(3, ch, 4, 2, 1), nn.ReLU(), # 64 -> 32 + nn.Conv2d(ch, ch * 2, 4, 2, 1), nn.ReLU(), # 32 -> 16 + nn.Conv2d(ch * 2, ch * 2, 4, 2, 1), nn.ReLU(), # 16 -> 8 + nn.Conv2d(ch * 2, ch * 2, 4, 2, 1), nn.ReLU(), # 8 -> 4 + ) + self.head = nn.Sequential(nn.Linear(ch * 2 * 4 * 4, hidden_dim), nn.ReLU(), + nn.Linear(hidden_dim, z_dim)) + + def forward(self, x): + h = self.conv(x).flatten(1) + return self.head(h) + + +class ImageDecoder(nn.Module): + """image_hat = D(z). Mirror of ImageEncoder, for the reward-agnostic autoencoder baseline.""" + + def __init__(self, z_dim, ch=32, hidden_dim=256): + super().__init__() + self.ch = ch + self.fc = nn.Sequential(nn.Linear(z_dim, hidden_dim), nn.ReLU(), + nn.Linear(hidden_dim, ch * 2 * 4 * 4), nn.ReLU()) + self.deconv = nn.Sequential( + nn.ConvTranspose2d(ch * 2, ch * 2, 4, 2, 1), nn.ReLU(), # 4 -> 8 + nn.ConvTranspose2d(ch * 2, ch * 2, 4, 2, 1), nn.ReLU(), # 8 -> 16 + nn.ConvTranspose2d(ch * 2, ch, 4, 2, 1), nn.ReLU(), # 16 -> 32 + nn.ConvTranspose2d(ch, 3, 4, 2, 1), nn.Sigmoid(), # 32 -> 64 + ) + + def forward(self, z): + h = self.fc(z).view(-1, self.ch * 2, 4, 4) + return self.deconv(h) + + +class Encoder(nn.Module): + """z = E(s). Reward-aware or reward-agnostic latent encoder.""" + + def __init__(self, s_dim, z_dim, hidden_dim=256, num_layers=3): + super().__init__() + self.net = mlp(s_dim, z_dim, hidden_dim, num_layers) + + def forward(self, s): + return self.net(s) + + +class RewardDecoder(nn.Module): + """r_hat = R(z).""" + + def __init__(self, z_dim, hidden_dim=256, num_layers=2): + super().__init__() + self.net = mlp(z_dim, 1, hidden_dim, num_layers) + + def forward(self, z): + return self.net(z).squeeze(-1) + + +class StateDecoder(nn.Module): + """s_hat = D(z), for reward-agnostic autoencoder baseline.""" + + def __init__(self, z_dim, s_dim, hidden_dim=256, num_layers=3): + super().__init__() + self.net = mlp(z_dim, s_dim, hidden_dim, num_layers) + + def forward(self, z): + return self.net(z) + + +class ConditionalFlowMatching(nn.Module): + """Conditional Flow Matching for p(y | c). Learns a velocity field v_theta(y_t, t, c) + that transports N(0,I) to the target distribution via linear interpolation paths. + + Same external interface as ConditionalDiffusion: .sample(c, n) -> [B,n,D]. + """ + + def __init__(self, cond_dim, y_dim, hidden_dim=256, num_layers=4, + time_dim=64, sample_steps=30): + super().__init__() + self.y_dim = y_dim + self.cond_dim = cond_dim + self.sample_steps = sample_steps + self.time_emb = nn.Sequential(SinusoidalEmbedding(time_dim), + nn.Linear(time_dim, time_dim), nn.SiLU(), + nn.Linear(time_dim, time_dim)) + self.cond_emb = nn.Sequential(nn.Linear(cond_dim, hidden_dim), nn.SiLU()) + self.y_emb = nn.Linear(y_dim, hidden_dim) + layers = [] + d = hidden_dim + hidden_dim + time_dim + for _ in range(num_layers): + layers += [nn.Linear(d, hidden_dim), nn.SiLU()] + d = hidden_dim + self.trunk = nn.Sequential(*layers) + self.out = nn.Linear(hidden_dim, y_dim) + # normalization buffers + self.register_buffer("cond_mean", torch.zeros(cond_dim)) + self.register_buffer("cond_std", torch.ones(cond_dim)) + self.register_buffer("y_mean", torch.zeros(y_dim)) + self.register_buffer("y_std", torch.ones(y_dim)) + + def set_normalization(self, cond_mean, cond_std, y_mean, y_std): + self.cond_mean.copy_(torch.as_tensor(cond_mean, dtype=torch.float32)) + self.cond_std.copy_(torch.as_tensor(cond_std, dtype=torch.float32)) + self.y_mean.copy_(torch.as_tensor(y_mean, dtype=torch.float32)) + self.y_std.copy_(torch.as_tensor(y_std, dtype=torch.float32)) + + def _nc(self, c): return (c - self.cond_mean) / self.cond_std + def _ny(self, y): return (y - self.y_mean) / self.y_std + def _uny(self, yn): return yn * self.y_std + self.y_mean + + def velocity(self, yt, t_frac, c): + """v_theta(y_t, t, c). y_t: [B,D] normalized; t_frac: [B] in [0,1]; c: [B,cond] normalized.""" + te = self.time_emb(t_frac) + h = torch.cat([self.y_emb(yt), self.cond_emb(c), te], dim=-1) + return self.out(self.trunk(h)) + + def training_loss(self, c, y1): + """CFM loss given pre-sampled target y1 (raw coords). Samples z0, t, forms path.""" + c = self._nc(c); y1n = self._ny(y1) + z0 = torch.randn_like(y1n) + t = torch.rand(y1n.shape[0], device=y1n.device) + yt = (1 - t.unsqueeze(-1)) * z0 + t.unsqueeze(-1) * y1n # linear path + u_t = y1n - z0 # constant velocity + v = self.velocity(yt, t, c) + return F.mse_loss(v, u_t) + + def training_loss_td(self, c, y1): + """Alias for training_loss — y1 may come from the TD mixture (external).""" + return self.training_loss(c, y1) + + @torch.no_grad() + def eval_loss(self, c, y1): + c = self._nc(c); y1n = self._ny(y1) + z0 = torch.zeros_like(y1n) # deterministic for eval + t = torch.full((y1n.shape[0],), 0.5, device=y1n.device) + yt = 0.5 * z0 + 0.5 * y1n + u_t = y1n - z0 + return F.mse_loss(self.velocity(yt, t, c), u_t).item() + + @torch.no_grad() + def sample(self, c, n_samples=1, steps=None): + """Euler ODE integration from z0~N(0,I). Returns [B, n_samples, D] raw coords.""" + steps = steps or self.sample_steps + c = self._nc(c); B = c.shape[0] + cc = c.unsqueeze(1).expand(-1, n_samples, -1).reshape(B * n_samples, -1) + z = torch.randn(B * n_samples, self.y_dim, device=c.device) + dt = 1.0 / steps + for i in range(steps): + t_frac = torch.full((B * n_samples,), i * dt, device=c.device) + v = self.velocity(z, t_frac, cc) + z = z + dt * v + return self._uny(z).view(B, n_samples, self.y_dim) + + +class OneStepModel(nn.Module): + """p(s_{t+1} | s_t, a_t) as a small conditional GMM over the *delta* s_{t+1}-s_t.""" + + def __init__(self, s_dim, a_dim, num_components=4, hidden_dim=256, num_layers=3): + super().__init__() + self.gmm = ConditionalGMM(s_dim + a_dim, s_dim, num_components, hidden_dim, num_layers) + self.s_dim = s_dim + + def log_prob(self, s, a, s_next): + c = torch.cat([s, a], dim=-1) + return self.gmm.log_prob(c, s_next - s) + + @torch.no_grad() + def step(self, s, a): + c = torch.cat([s, a], dim=-1) + delta = self.gmm.sample(c, 1).squeeze(1) + return s + delta diff --git a/gen_q_rsm/preliminary_analysis/plots.py b/gen_q_rsm/preliminary_analysis/plots.py new file mode 100644 index 0000000000000000000000000000000000000000..174df1cd4cbf1b9d8df47991f7a83e8a305ffe9d --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/plots.py @@ -0,0 +1,116 @@ +"""Aggregate per-seed result JSONs for one env and produce mse.png + corr.png. + +Gen-Q is drawn as a CURVE over the sample count N (x = N, log scale), with its +mean across seeds and a shaded ±std band. MC and TD are N-independent, so they are +drawn as horizontal reference lines (mean) with a shaded ±std band. This makes the +"more occupancy samples → better Gen-Q" story visible. +""" +import argparse +import json +import os + +import numpy as np +import matplotlib +matplotlib.use("Agg") +import matplotlib.pyplot as plt + +_HERE = os.path.dirname(os.path.abspath(__file__)) +_METHODS = ["mc", "td", "genq"] +_COLORS = {"mc": "tab:orange", "td": "tab:purple", "genq": "tab:green"} + + +def env_safe(env_id): + return env_id.replace("-", "_") + + +def _load(env_id): + base = os.path.join(_HERE, "experiments", env_safe(env_id), "results") + out = {m: [] for m in _METHODS} + if not os.path.isdir(base): + return out + for seed in sorted(os.listdir(base)): + sdir = os.path.join(base, seed) + if not os.path.isdir(sdir): + continue + for m in _METHODS: + p = os.path.join(sdir, f"{m}.json") + if os.path.exists(p): + d = json.load(open(p)) + if d.get("status"): # skipped (no fresh-rollout truth) + continue + out[m].append(d) + return out + + +def _genq_curves(records, key): + """Return (Ns, mean, std) for genq's per-N map `key`, or None if absent.""" + maps = [r[key] for r in records if key in r] + if not maps: + return None + Ns = sorted({int(n) for mp in maps for n in mp}, key=int) + M = np.full((len(maps), len(Ns)), np.nan) + for i, mp in enumerate(maps): + for j, N in enumerate(Ns): + if str(N) in mp: + M[i, j] = mp[str(N)] + return np.array(Ns), np.nanmean(M, 0), np.nanstd(M, 0) + + +def _hline(ax, records, scalar_key, color, label): + vals = [r[scalar_key] for r in records + if r.get(scalar_key) is not None and not np.isnan(r.get(scalar_key, np.nan))] + if not vals: + return + m, s = float(np.mean(vals)), float(np.std(vals)) + ax.axhline(m, color=color, ls="--", lw=2, label=f"{label} ({m:.3f})") + ax.axhspan(m - s, m + s, color=color, alpha=0.12) + + +def make_figures(env_id): + data = _load(env_id) + fig_dir = os.path.join(_HERE, "experiments", env_safe(env_id), "figures") + os.makedirs(fig_dir, exist_ok=True) + + # ---- MSE figure: Gen-Q curve over N + MC/TD horizontal lines ---- + fig, ax = plt.subplots(figsize=(6, 4.5)) + gc = _genq_curves(data["genq"], "eval/q_mse_by_n") + if gc is not None: + Ns, mean, std = gc + ax.plot(Ns, mean, "-o", color=_COLORS["genq"], label="Gen-Q (diffusion)") + ax.fill_between(Ns, mean - std, mean + std, color=_COLORS["genq"], alpha=0.2) + ax.set_xscale("log", base=2) + _hline(ax, data["mc"], "eval/q_mse", _COLORS["mc"], "MC") + _hline(ax, data["td"], "eval/q_mse", _COLORS["td"], "TD") + ax.set_yscale("log") + ax.set_xlabel("N occupancy samples (Gen-Q)"); ax.set_ylabel("eval/q_mse vs fresh-rollout truth") + ax.set_title(f"{env_id}: Q-MSE vs sample count\n(MC/TD are N-independent → dashed lines)") + ax.legend(fontsize=8); ax.grid(alpha=0.3, which="both") + fig.tight_layout(); fig.savefig(os.path.join(fig_dir, "mse.png"), dpi=130); plt.close(fig) + + # ---- CORR figure: Gen-Q curve over N + MC/TD horizontal lines ---- + fig, ax = plt.subplots(figsize=(6, 4.5)) + gc = _genq_curves(data["genq"], "eval/q_corr_by_n") + if gc is not None: + Ns, mean, std = gc + ax.plot(Ns, mean, "-o", color=_COLORS["genq"], label="Gen-Q (diffusion)") + ax.fill_between(Ns, mean - std, mean + std, color=_COLORS["genq"], alpha=0.2) + ax.set_xscale("log", base=2) + _hline(ax, data["mc"], "eval/q_corr", _COLORS["mc"], "MC") + _hline(ax, data["td"], "eval/q_corr", _COLORS["td"], "TD") + ax.set_xlabel("N occupancy samples (Gen-Q)"); ax.set_ylabel("eval/q_corr (Pearson) vs truth") + ax.set_ylim(-0.1, 1.0) + ax.set_title(f"{env_id}: Q-correlation vs sample count\n(MC/TD are N-independent → dashed lines)") + ax.legend(fontsize=8); ax.grid(alpha=0.3, which="both") + fig.tight_layout(); fig.savefig(os.path.join(fig_dir, "corr.png"), dpi=130); plt.close(fig) + print(f"[plots] wrote {fig_dir}/mse.png and corr.png", flush=True) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--env", required=True) + args = ap.parse_args() + make_figures(args.env) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/preliminary_analysis/run_cube_seq.sh b/gen_q_rsm/preliminary_analysis/run_cube_seq.sh new file mode 100644 index 0000000000000000000000000000000000000000..ad253f4581b9ff8a0f09b5a086a9474ecc1aded8 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/run_cube_seq.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Sequential (NOT &+wait) cube-single seed-0 genq+mc+td cell for issue #35. +# GPUs are mode=exclusive_process on this cluster, so we run one cell at a time +# inside a single bsub -gpu num=1 allocation (no background processes). +# +# bsub -G grp_runtime -q normal -gpu num=1 \ +# -o preliminary_analysis/bsub_outputs/cube_seq_%J.out \ +# -- bash preliminary_analysis/run_cube_seq.sh +set -u +ENV="cube-single-play-v0" +SEED=0 +N_ANCHORS="${N_ANCHORS:-128}" +STEPS="${STEPS:-20000}" +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PA="$ROOT/preliminary_analysis" +PY="$ROOT/.venv/bin/python" + +if [ -f "$ROOT/.env" ]; then set -a; . "$ROOT/.env"; set +a; fi + +cd "$PA" +SAFE="${ENV//-/_}" +mkdir -p "experiments/$SAFE/results/$SEED" bsub_outputs + +echo "[cube-seq] host=$(hostname) gpu=$CUDA_VISIBLE_DEVICES n_anchors=$N_ANCHORS steps=$STEPS" +nvidia-smi --query-gpu=name,memory.total --format=csv,noheader 2>/dev/null || true + +fail=0 +for METHOD in genq mc td; do + echo "[cube-seq] ===== $METHOD $ENV seed=$SEED n_anchors=$N_ANCHORS steps=$STEPS =====" + "$PY" _runner.py --method "$METHOD" --env "$ENV" --seed "$SEED" \ + --reward dense --steps "$STEPS" --n_anchors "$N_ANCHORS" \ + > "experiments/$SAFE/results/${METHOD}_s${SEED}.log" 2>&1 + rc=$? + echo "[cube-seq] $METHOD rc=$rc" + if [ $rc -ne 0 ]; then fail=1; tail -30 "experiments/$SAFE/results/${METHOD}_s${SEED}.log"; fi +done + +echo "[cube-seq] done fail=$fail" +exit "$fail" diff --git a/gen_q_rsm/preliminary_analysis/run_cube_validate.sh b/gen_q_rsm/preliminary_analysis/run_cube_validate.sh new file mode 100644 index 0000000000000000000000000000000000000000..dd58e6219d7b9a2922a48627ffdc2d97b521cb77 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/run_cube_validate.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Validate the manipspace fresh-reset path on cube-single-play-v0 seed 0. +# Packs mc + td + genq onto ONE GPU (each is a small MLP/diffusion). Thread caps +# are mandatory (a packed job without them spawns thousands of threads and LSF +# kills it). Small truth budget to iterate fast. Logs to the shared filesystem. +set -u +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$HERE/.." && pwd)" +PY="$ROOT/.venv/bin/python" +cd "$HERE" + +export MUJOCO_GL=egl +export OMP_NUM_THREADS=3 MKL_NUM_THREADS=3 OPENBLAS_NUM_THREADS=3 +export XLA_FLAGS="--xla_cpu_multi_thread_eigen=false intra_op_parallelism_threads=3" +export XLA_PYTHON_CLIENT_MEM_FRACTION=0.15 +export PYTHONPATH="$HERE:${PYTHONPATH:-}" +set -a; [ -f "$ROOT/.env" ] && . "$ROOT/.env"; set +a + +ENV=cube-single-play-v0 +SAFE="${ENV//-/_}" +SEED=0 +LOGD="$HERE/experiments/$SAFE/results" +mkdir -p "$LOGD/$SEED" +COMMON="--env $ENV --seed $SEED --reward dense --n_anchors 64 --truth_M 4 --truth_H 200 --steps 20000" + +pids=() +for M in mc td genq; do + echo "[launch] $M -> $LOGD/validate_${M}.log" + $PY _runner.py --method $M $COMMON > "$LOGD/validate_${M}.log" 2>&1 & + pids+=($!) +done + +fail=0 +for p in "${pids[@]}"; do + if ! wait "$p"; then fail=1; echo "[FAIL] pid $p"; fi +done +echo "[done] fail=$fail" +exit $fail diff --git a/gen_q_rsm/preliminary_analysis/run_packed_eval.sh b/gen_q_rsm/preliminary_analysis/run_packed_eval.sh new file mode 100644 index 0000000000000000000000000000000000000000..304abf19c324a3e15bd618a0a2f75b2892311c5c --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/run_packed_eval.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Packed policy-evaluation sweep for one env: runs all {genq, mc, td} x 5 seeds as +# background processes sharing ONE GPU (see CLAUDE.md "GPU sharing — pack multiple +# experiments per H100"). Submit with a single allocation: +# +# bsub -gpu num=1 -q gpu -o bsub_outputs/peval_%J.out -- \ +# bash preliminary_analysis/run_packed_eval.sh pointmaze-medium-navigate-v0 +# +# Models are small MLP diffusions (batch 256), so ~15 of these fit on an 80GB H100. +set -u +ENV="${1:-pointmaze-medium-navigate-v0}" +REWARD="${2:-dense}" +STEPS="${3:-40000}" +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PA="$ROOT/preliminary_analysis" +PY="$ROOT/.venv/bin/python" + +# Source W&B credentials so JSONs carry a real wandb_url. +if [ -f "$ROOT/.env" ]; then set -a; . "$ROOT/.env"; set +a; fi + +cd "$PA" +SAFE="${ENV//-/_}" +mkdir -p "experiments/$SAFE/results" + +# Cap per-process GPU memory so many cells coexist (autoscale otherwise). +export XLA_PYTHON_CLIENT_MEM_FRACTION=0.1 + +pids=() +for METHOD in genq mc td; do + for SEED in 0 1 2 3 4; do + echo "[packed] launching $METHOD $ENV seed=$SEED reward=$REWARD" + "$PY" _runner.py --method "$METHOD" --env "$ENV" --seed "$SEED" \ + --reward "$REWARD" --steps "$STEPS" \ + > "experiments/$SAFE/results/${METHOD}_s${SEED}.log" 2>&1 & + pids+=($!) + done +done + +fail=0 +for pid in "${pids[@]}"; do + wait "$pid" || fail=1 +done + +# Aggregate figures once all cells finish. +"$PY" plots.py --env "$ENV" || true +if [ "$ENV" = "pointmaze-medium-navigate-v0" ]; then + "$PY" illustration.py --env "$ENV" || true +fi + +echo "[packed] done (fail=$fail)" +exit "$fail" diff --git a/gen_q_rsm/preliminary_analysis/run_pm_genq_nsweep.sh b/gen_q_rsm/preliminary_analysis/run_pm_genq_nsweep.sh new file mode 100644 index 0000000000000000000000000000000000000000..1d1ae484825525ebfe0557fddd3ae78bc895a7de --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/run_pm_genq_nsweep.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Re-run pointmaze genq (5 seeds) SEQUENTIALLY to add the Gen-Q sample-count sweep +# curve. Sequential because the GPU is allocated exclusive_process (one CUDA context +# at a time) — concurrent processes hit cudaErrorDevicesUnavailable. Then regen figs. +set -u +ROOT=/proj/inf-scaling/zwhong/projs/gen_q/.claude/worktrees/issue-35-refactor +PA=$ROOT/preliminary_analysis +PY=$ROOT/.venv/bin/python +[ -f "$ROOT/.env" ] && { set -a; . "$ROOT/.env"; set +a; } +cd "$PA" +fail=0 +for SEED in 0 1 2 3 4; do + "$PY" _runner.py --method genq --env pointmaze-medium-navigate-v0 --seed $SEED --steps 40000 \ + > experiments/pointmaze_medium_navigate_v0/results/genq_nsweep_s${SEED}.log 2>&1 || fail=1 +done +"$PY" plots.py --env pointmaze-medium-navigate-v0 || true +"$PY" illustration.py --env pointmaze-medium-navigate-v0 || true +echo "[pm-nsweep] done fail=$fail" +exit $fail diff --git a/gen_q_rsm/preliminary_analysis/run_puzzle_seq.sh b/gen_q_rsm/preliminary_analysis/run_puzzle_seq.sh new file mode 100644 index 0000000000000000000000000000000000000000..00ba04c3677fa7ff7788ecaf90500fc7341484ac --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/run_puzzle_seq.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# Sequential puzzle policy-eval runner (#35). One cell at a time inside a single +# bsub -gpu num=1 allocation (Blue Vela GPUs are exclusive_process). Resume-safe. +# bsub -G grp_runtime -q normal -gpu num=1 \ +# -o preliminary_analysis/bsub_outputs/puzzle_%J.out \ +# -- bash preliminary_analysis/run_puzzle_seq.sh "" "" +set -u +ENV="${1:-puzzle-3x3-play-v0}" +SEEDS="${2:-0}" +STEPS="${STEPS:-40000}" +N_ANCHORS="${N_ANCHORS:-128}" +TRUTH_M="${TRUTH_M:-8}" +TRUTH_H="${TRUTH_H:-300}" +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +PA="$ROOT/preliminary_analysis" +PY="$ROOT/.venv/bin/python" +[ -x "$PY" ] || PY="/proj/inf-scaling/zwhong/projs/gen_q/.venv/bin/python" +if [ -f "$ROOT/.env" ]; then set -a; . "$ROOT/.env"; set +a; fi +cd "$PA" +SAFE="${ENV//-/_}" +mkdir -p "experiments/$SAFE/results" +export OMP_NUM_THREADS=3 MKL_NUM_THREADS=3 OPENBLAS_NUM_THREADS=3 +export NUMEXPR_NUM_THREADS=3 VECLIB_MAXIMUM_THREADS=3 +export XLA_FLAGS="--xla_cpu_multi_thread_eigen=false intra_op_parallelism_threads=3" +export JAX_PLATFORMS=cpu XLA_PYTHON_CLIENT_MEM_FRACTION=0.4 MUJOCO_GL=egl +# wandb offline: avoids the W&B teardown ConnectionResetError that crashes runs at cleanup +export WANDB_MODE=offline +echo "[puzzle-seq] host=$(hostname) ENV=$ENV SEEDS='$SEEDS' steps=$STEPS n_anchors=$N_ANCHORS M=$TRUTH_M H=$TRUTH_H wandb=offline" +fail=0 +for SEED in $SEEDS; do + for METHOD in genq mc td; do + out="experiments/$SAFE/results/$SEED/$METHOD.json" + if [ -f "$out" ] && grep -q '"truth_kind": "fresh_rollout"' "$out" 2>/dev/null; then + echo "[puzzle-seq] SKIP existing $METHOD s$SEED"; continue + fi + echo "[puzzle-seq] === $METHOD $ENV seed=$SEED ===" + "$PY" _runner.py --method "$METHOD" --env "$ENV" --seed "$SEED" \ + --reward dense --steps "$STEPS" --n_anchors "$N_ANCHORS" \ + --truth_M "$TRUTH_M" --truth_H "$TRUTH_H" --wandb_mode offline \ + > "experiments/$SAFE/results/${METHOD}_s${SEED}.log" 2>&1 \ + || { echo "[puzzle-seq] FAILED $METHOD-s$SEED"; tail -8 "experiments/$SAFE/results/${METHOD}_s${SEED}.log"; fail=1; } + done +done +"$PY" plots.py --env "$ENV" || true +echo "[puzzle-seq] done fail=$fail"; exit "$fail" diff --git a/gen_q_rsm/preliminary_analysis/run_seq.sh b/gen_q_rsm/preliminary_analysis/run_seq.sh new file mode 100644 index 0000000000000000000000000000000000000000..70e0c828c9825b881bdeb2a3b04e0787f609a1d5 --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/run_seq.sh @@ -0,0 +1,71 @@ +#!/usr/bin/env bash +# Generic SEQUENTIAL policy-eval runner (issue #35, Milestone 1 env-expansion). +# +# Blue Vela GPUs are mode=exclusive_process:j_exclusive=yes -> only ONE CUDA context +# per GPU at a time. The packed "&"+wait pattern (assumed by CLAUDE.md) makes all but +# the first concurrent cell die with cudaErrorDevicesUnavailable. So we run cells +# SEQUENTIALLY. The slow phase (SAC/scripted fresh-rollout truth) is CPU/JAX; the GPU +# phase per cell is short, so sequential is reliable and not much slower in wall-clock +# for the expert-truth envs. +# +# Usage: +# ENV=... METHODS="genq mc td" SEEDS="1 2 3 4" STATE_SLICE=full \ +# TRUTH_M=4 TRUTH_H=300 N_ANCHORS=200 STEPS=40000 \ +# bash run_seq.sh +# Only runs a (method,seed) cell if its result JSON is missing (resume-safe). +set -u + +ENV="${ENV:?set ENV}" +METHODS="${METHODS:-genq mc td}" +SEEDS="${SEEDS:-0}" +REWARD="${REWARD:-dense}" +STEPS="${STEPS:-40000}" +STATE_SLICE="${STATE_SLICE:-auto}" +TRUTH_M="${TRUTH_M:-8}" +TRUTH_H="${TRUTH_H:-350}" +N_ANCHORS="${N_ANCHORS:-400}" + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT="$(cd "$HERE/../.." && pwd)" +# HERE is preliminary_analysis; ROOT is worktree root +PA="$HERE" +PY="$ROOT/.venv/bin/python" +[ -x "$PY" ] || PY="/proj/inf-scaling/zwhong/projs/gen_q/.venv/bin/python" + +if [ -f "$ROOT/.env" ]; then set -a; . "$ROOT/.env"; set +a; fi + +cd "$PA" +SAFE="${ENV//-/_}" +mkdir -p "experiments/$SAFE/results" + +export OMP_NUM_THREADS=3 MKL_NUM_THREADS=3 OPENBLAS_NUM_THREADS=3 +export NUMEXPR_NUM_THREADS=3 VECLIB_MAXIMUM_THREADS=3 +export XLA_FLAGS="--xla_cpu_multi_thread_eigen=false intra_op_parallelism_threads=3" +export JAX_PLATFORMS=cpu +export XLA_PYTHON_CLIENT_MEM_FRACTION=0.5 +export MUJOCO_GL=egl + +echo "[run_seq] ENV=$ENV METHODS='$METHODS' SEEDS='$SEEDS' STATE_SLICE=$STATE_SLICE TRUTH_M=$TRUTH_M TRUTH_H=$TRUTH_H N_ANCHORS=$N_ANCHORS STEPS=$STEPS" + +fail=0 +for SEED in $SEEDS; do + for METHOD in $METHODS; do + out="experiments/$SAFE/results/$SEED/$METHOD.json" + if [ -f "$out" ] && grep -q '"truth_kind": "fresh_rollout"' "$out" 2>/dev/null; then + echo "[run_seq] SKIP existing $METHOD s$SEED" + continue + fi + echo "[run_seq] === $METHOD $ENV seed=$SEED ===" + args=(--method "$METHOD" --env "$ENV" --seed "$SEED" --reward "$REWARD" \ + --steps "$STEPS" --state_slice "$STATE_SLICE" --n_anchors "$N_ANCHORS" \ + --truth_M "$TRUTH_M" --truth_H "$TRUTH_H") + if ! "$PY" _runner.py "${args[@]}" \ + > "experiments/$SAFE/results/${METHOD}_s${SEED}.log" 2>&1; then + echo "[run_seq] CELL FAILED: $METHOD-s$SEED" + tail -5 "experiments/$SAFE/results/${METHOD}_s${SEED}.log" + fail=1 + fi + done +done +echo "[run_seq] done (fail=$fail)" +exit "$fail" diff --git a/gen_q_rsm/preliminary_analysis/td.py b/gen_q_rsm/preliminary_analysis/td.py new file mode 100644 index 0000000000000000000000000000000000000000..51f6295b0a6d25157155e0a7358b2d876c1849ba --- /dev/null +++ b/gen_q_rsm/preliminary_analysis/td.py @@ -0,0 +1,147 @@ +"""TD / Fitted-Q-Evaluation of the goal-conditioned Q^pi(s, a, g). + +Math +---- +TD estimates the behaviour value by bootstrapping the Bellman expectation +equation. For policy *evaluation* we use the IQL-style decomposition (stable; no +action bootstrap), goal-conditioned throughout: + + V(s, g) <- expectile_tau( Q_target(s, a, g) ), tau = 0.5 (mean = behaviour V) + Q(s, a, g) <- (1 - gamma) r(s; g) + gamma * V(s', g) + +with a Polyak target Q_target. tau = 0.5 is correct for policy evaluation; the +goal g is sampled by hindsight (downstream of the transition) and held fixed +across the (s, a, s') tuple so the Bellman backup is goal-consistent. + +Pseudocode +---------- + init Q, Q_target, V + repeat: + sample transition (s, a, s') with hindsight goal g ; r = r(s; g) + diff <- Q_target(s,a,g) - V(s,g) ; L_V <- |tau - 1[diff<0]| diff^2 ; update V + y <- (1-gamma) r + gamma V(s',g) ; L_Q <- (Q(s,a,g) - y)^2 ; update Q + Polyak-update Q_target + eval: Q(s_anchor, a_anchor, g_anchor) ; score vs fresh-rollout truth +""" +import time + +import numpy as np +import torch +import torch.nn as nn + +from _common import get_device, set_seed, q_metrics, init_wandb +import gc_core +import models +from mc import QNet +from evaluate_policy import ground_truth_q + + +class VNet(nn.Module): + """V(s, g).""" + def __init__(self, s_dim, g_dim, hidden=256, layers=3): + super().__init__() + self.net = models.mlp(s_dim + g_dim, 1, hidden, layers) + + def forward(self, s, g): + return self.net(torch.cat([s, g], -1)).squeeze(-1) + + +def run(env_id, seed, cfg): + device = get_device() + set_seed(seed) + gamma = cfg["gamma"] + kind, sigma, eps = cfg["reward"], cfg["sigma"], cfg["epsilon"] + state_slice = cfg.get("state_slice", "auto") + train_ds, val_ds, _, _ = gc_core.load_ogbench_gc(env_id, gamma, state_slice=state_slice) + pos = train_ds.get("pos_dim", cfg.get("pos_dim", 2)) + cfg["pos_dim"] = pos + rng = np.random.default_rng(seed) + pack = gc_core.prepare_eval_anchors(env_id, val_ds, cfg, seed) + sigma, eps = cfg["sigma"], cfg["epsilon"] # prepare may set manipspace reward scale + s_a, a_a, g_a = pack["s"], pack["a"], pack["g"] + anchors = pack["anchor_idx"] + anchor_full = pack["anchor_full"] + + run_obj, wlog, wfinish = init_wandb( + cfg.get("wandb_project", "genq-policy-eval"), + f"td-{env_id}-s{seed}", {**cfg, "env": env_id, "seed": seed, "method": "td"}, + mode=cfg.get("wandb_mode")) + wandb_url = getattr(run_obj, "url", None) + + tr = train_ds + obs = tr["obs"]; act = tr["act"]; end = tr["end"]; N = tr["N"] + tgt_pos = gc_core._target_array(tr, cfg) # reward/goal position (obj pos or xy) + family = tr.get("family") + nxt = np.where((end - np.arange(N)) > 1)[0] # transitions with a next state + sd, ad = tr["s_dim"], tr["a_dim"] + H, L = cfg["hidden_dim"], cfg["num_layers"] + q = QNet(sd, pos, ad, H, L).to(device) + qt = QNet(sd, pos, ad, H, L).to(device); qt.load_state_dict(q.state_dict()) + v = VNet(sd, pos, H, L).to(device) + optq = torch.optim.Adam(q.parameters(), lr=cfg["lr"]) + optv = torch.optim.Adam(v.parameters(), lr=cfg["lr"]) + tau = cfg.get("iql_expectile", 0.5); polyak = cfg.get("polyak", 0.005) + + losses, qmse = [], [] + log_every = max(1, cfg["steps"] // 50) + t0 = time.time() + for step in range(1, cfg["steps"] + 1): + idx = nxt[rng.integers(0, len(nxt), size=cfg["batch_size"])] + g = tgt_pos[gc_core.sample_goal_idx(idx, end, rng)] + if family == "puzzle": + r = gc_core.puzzle_reward(tgt_pos[idx], g, kind).astype(np.float32) + else: + d = np.linalg.norm(tgt_pos[idx] - g, axis=1) + r = gc_core.reward_of_dist(d, kind, sigma, eps).astype(np.float32) + s = torch.as_tensor(obs[idx], device=device) + a = torch.as_tensor(act[idx], device=device) + s2 = torch.as_tensor(obs[idx + 1], device=device) + gt = torch.as_tensor(g, dtype=torch.float32, device=device) + rt = torch.as_tensor(r, device=device) + with torch.no_grad(): + qsa = qt(s, gt, a) + diff = qsa - v(s, gt) + w = torch.abs(tau - (diff < 0).float()) + loss_v = (w * diff ** 2).mean() + optv.zero_grad(); loss_v.backward(); optv.step() + with torch.no_grad(): + y = (1 - gamma) * rt + gamma * v(s2, gt) + loss_q = ((q(s, gt, a) - y) ** 2).mean() + optq.zero_grad(); loss_q.backward(); optq.step() + with torch.no_grad(): + for p, ptg in zip(q.parameters(), qt.parameters()): + ptg.mul_(1 - polyak).add_(polyak * p) + if step % log_every == 0 or step == 1: + losses.append(float(loss_q.item())); qmse.append(float(loss_q.item())) + wlog({"train/loss": float(loss_q.item()), "train/q_mse": float(loss_q.item()), + "train/v_loss": float(loss_v.item())}, step=step) + q.eval() + train_wall = time.time() - t0 + + truth, truth_kind = ground_truth_q(env_id, val_ds, anchors, g_a, gamma, + kind=kind, sigma=sigma, eps=eps, + M=cfg.get("truth_M", 8), H=cfg.get("truth_H", 350), seed=seed, + anchor_full=anchor_full, anchors_pack=pack["anchors_pack"]) + with torch.no_grad(): + est = q(torch.as_tensor(s_a, dtype=torch.float32, device=device), + torch.as_tensor(g_a, dtype=torch.float32, device=device), + torch.as_tensor(a_a, dtype=torch.float32, device=device)).cpu().numpy() + m = q_metrics(est, truth) + + result = { + "method": "td", "env": env_id, "seed": seed, "wandb_url": wandb_url, + "reward": kind, "truth_kind": truth_kind, + "anchor_protocol": pack["anchor_protocol"], + "train/loss": losses, "train/q_mse": qmse, + "eval/q_mse": m["mse"], "eval/q_mae": m["mae"], + "eval/q_corr": m["pearson"], "eval/q_spearman": m["spearman"], + "eval/truth_std": float(np.std(truth)), + "wall_clock_s": train_wall, "n_anchors": int(len(s_a)), + } + wlog({"eval/q_mse": m["mse"], "eval/q_corr": m["pearson"]}) + wfinish() + return result + + +if __name__ == "__main__": + pass diff --git a/gen_q_rsm/requirements.txt b/gen_q_rsm/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5c2da2d9e92d950b3fd066476178265a4e8faaa --- /dev/null +++ b/gen_q_rsm/requirements.txt @@ -0,0 +1,36 @@ +# Gen-Q Python dependencies. +# +# TORCH (read this before `pip install`): install the wheel that matches YOUR +# CUDA, not the default PyPI wheel. +# - Blue Vela needs the cu126 build; the default wheel is missing libcudart +# on its login nodes. Pin: +# pip install torch==2.12.1+cu126 \ +# --extra-index-url https://download.pytorch.org/whl/cu126 +# - MIT / other clusters: pick the cu1xx (or CPU) wheel that matches the +# driver there, e.g. `--extra-index-url https://download.pytorch.org/whl/cu124`. +# - the drivers auto-detect CUDA vs CPU (torch.cuda.is_available()), so they +# are agnostic to which wheel you install — only the wheel choice +# differs per cluster. +# +# Install torch FIRST (per the note above), THEN `pip install -r requirements.txt` +# for the rest. torch is intentionally left unpinned here so the cluster-correct +# wheel above is not overwritten. +torch # install the CUDA-matched wheel first (see note above) + +# Core scientific stack +numpy +scipy +matplotlib + +# RL environments / datasets +ogbench # OGBench envs; auto-downloads data to ~/.ogbench/data/ on first import +gymnasium # used by q_filtered_bc.py and the manipspace goal wrappers + +# Config / logging / utils +pyyaml +wandb # optional; reads WANDB_API_KEY / WANDB_ENTITY from .env + +# Stats / metrics used by eval harnesses +scikit-learn # used by train_latent_occupancy.py (PCA reward-agnostic latent) +imageio # animation / video output (animate_genq.py, make_genq_video.py) +imageio-ffmpeg diff --git a/gen_q_rsm/results/comp_combined/quad_gsp_n4.json b/gen_q_rsm/results/comp_combined/quad_gsp_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..231ed836af6e053ba1123f87a07f2f0371f7243c --- /dev/null +++ b/gen_q_rsm/results/comp_combined/quad_gsp_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_combined/quad_oracle_n4.json b/gen_q_rsm/results/comp_combined/quad_oracle_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..aa7666bedfa19016fc429cdc1f6641a7688bcdf6 --- /dev/null +++ b/gen_q_rsm/results/comp_combined/quad_oracle_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": true, + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_combined/quad_zeroshot.json b/gen_q_rsm/results/comp_combined/quad_zeroshot.json new file mode 100644 index 0000000000000000000000000000000000000000..ee1cde3de76fe1472d29d2c893bc58c7adbab7d4 --- /dev/null +++ b/gen_q_rsm/results/comp_combined/quad_zeroshot.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 1, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": true, + "oracle_score": false, + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_combined/triple_gsp_n4.json b/gen_q_rsm/results/comp_combined/triple_gsp_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..5b29a3910200525e08d1df7f09aede5b170ca57d --- /dev/null +++ b/gen_q_rsm/results/comp_combined/triple_gsp_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_combined/triple_oracle_n4.json b/gen_q_rsm/results/comp_combined/triple_oracle_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..d238eca1906cdca108d4968f32d92595f8fd71fd --- /dev/null +++ b/gen_q_rsm/results/comp_combined/triple_oracle_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": true, + "success_rate": 0.016, + "per_task": [ + 0.08, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_combined/triple_zeroshot.json b/gen_q_rsm/results/comp_combined/triple_zeroshot.json new file mode 100644 index 0000000000000000000000000000000000000000..065571a1c9651314b2c3f4eb50a9084a9f50ae31 --- /dev/null +++ b/gen_q_rsm/results/comp_combined/triple_zeroshot.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 1, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": true, + "oracle_score": false, + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_fixed/quad_fixed.json b/gen_q_rsm/results/comp_fixed/quad_fixed.json new file mode 100644 index 0000000000000000000000000000000000000000..fd0ad049171c522e90b5ed73ccbed1d9f3450b62 --- /dev/null +++ b/gen_q_rsm/results/comp_fixed/quad_fixed.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 5, + "plan_m": 1024, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.012, + "per_task": [ + 0.06, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_fixed/triple_fixed.json b/gen_q_rsm/results/comp_fixed/triple_fixed.json new file mode 100644 index 0000000000000000000000000000000000000000..885baec124afe36a1b8370cb996bbfa88106113f --- /dev/null +++ b/gen_q_rsm/results/comp_fixed/triple_fixed.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 5, + "plan_m": 1024, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.028000000000000004, + "per_task": [ + 0.14, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_plan/ct_500k_gsp.json b/gen_q_rsm/results/comp_plan/ct_500k_gsp.json new file mode 100644 index 0000000000000000000000000000000000000000..da4eae495fd417d53745e2c5cfb5d9bbb6fef3e7 --- /dev/null +++ b/gen_q_rsm/results/comp_plan/ct_500k_gsp.json @@ -0,0 +1,19 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 256, + "gamma_eval": 0.995, + "beta": [ + 0.98, + 0.99 + ], + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_gsp" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_plan/ct_500k_lemma.json b/gen_q_rsm/results/comp_plan/ct_500k_lemma.json new file mode 100644 index 0000000000000000000000000000000000000000..7b58a2d3747b776cef27bc747df7a440c54e2015 --- /dev/null +++ b/gen_q_rsm/results/comp_plan/ct_500k_lemma.json @@ -0,0 +1,19 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 256, + "gamma_eval": 0.995, + "beta": [ + 0.99, + 0.995 + ], + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_gsp" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_plan/ct_500k_oracle.json b/gen_q_rsm/results/comp_plan/ct_500k_oracle.json new file mode 100644 index 0000000000000000000000000000000000000000..990426827aa1b42c6543a2aa293858e0f87e2f2c --- /dev/null +++ b/gen_q_rsm/results/comp_plan/ct_500k_oracle.json @@ -0,0 +1,19 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 512, + "gamma_eval": 0.995, + "beta": [ + 0.99, + 0.995 + ], + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_gsp" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_plan/ct_500k_zeroshot.json b/gen_q_rsm/results/comp_plan/ct_500k_zeroshot.json new file mode 100644 index 0000000000000000000000000000000000000000..f089ba5a6019a9321ce15512e6d88dd45d5d6475 --- /dev/null +++ b/gen_q_rsm/results/comp_plan/ct_500k_zeroshot.json @@ -0,0 +1,19 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 1, + "plan_m": 1024, + "gamma_eval": 0.995, + "beta": [ + 0.98, + 0.99 + ], + "success_rate": 0.0, + "per_task": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_gsp" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_sweep/triple_baseline.json b/gen_q_rsm/results/comp_sweep/triple_baseline.json new file mode 100644 index 0000000000000000000000000000000000000000..53276cbc941867a4b15820b230480bc597539454 --- /dev/null +++ b/gen_q_rsm/results/comp_sweep/triple_baseline.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 256, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.02, + "per_task": [ + 0.1, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_sweep/triple_mid.json b/gen_q_rsm/results/comp_sweep/triple_mid.json new file mode 100644 index 0000000000000000000000000000000000000000..7505d58dc9f65c692a9a6a95bbab6913db1a98d7 --- /dev/null +++ b/gen_q_rsm/results/comp_sweep/triple_mid.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 256, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.06, + "per_task": [ + 0.3, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_sweep/triple_near.json b/gen_q_rsm/results/comp_sweep/triple_near.json new file mode 100644 index 0000000000000000000000000000000000000000..55672a66bed76f6d2fda32f38a292250fb91de40 --- /dev/null +++ b/gen_q_rsm/results/comp_sweep/triple_near.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 6, + "plan_m": 256, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.06, + "per_task": [ + 0.3, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_sweep/triple_near8.json b/gen_q_rsm/results/comp_sweep/triple_near8.json new file mode 100644 index 0000000000000000000000000000000000000000..c7989817a0e4a57ca063ee80e45432a75f809e8b --- /dev/null +++ b/gen_q_rsm/results/comp_sweep/triple_near8.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 8, + "plan_m": 256, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.04, + "per_task": [ + 0.2, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_sweep/triple_vnear.json b/gen_q_rsm/results/comp_sweep/triple_vnear.json new file mode 100644 index 0000000000000000000000000000000000000000..5671c9741e30d44f46ec2a250bbf9717748a85ee --- /dev/null +++ b/gen_q_rsm/results/comp_sweep/triple_vnear.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 6, + "plan_m": 256, + "gamma_eval": 0.995, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.02, + "per_task": [ + 0.1, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_tdfree/quad_gsp_n4.json b/gen_q_rsm/results/comp_tdfree/quad_gsp_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..30da27b486083c9ece815d1fecae3e57005cb1df --- /dev/null +++ b/gen_q_rsm/results/comp_tdfree/quad_gsp_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.016, + "per_task": [ + 0.08, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_tdfree/quad_oracle_n4.json b/gen_q_rsm/results/comp_tdfree/quad_oracle_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..eb99c7403b5e7f375b4a277f447f3f08be37c25e --- /dev/null +++ b/gen_q_rsm/results/comp_tdfree/quad_oracle_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": true, + "success_rate": 0.008, + "per_task": [ + 0.04, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_tdfree/quad_zeroshot.json b/gen_q_rsm/results/comp_tdfree/quad_zeroshot.json new file mode 100644 index 0000000000000000000000000000000000000000..f6640314de7b13bd8d48a031f3c0c96d251fda1a --- /dev/null +++ b/gen_q_rsm/results/comp_tdfree/quad_zeroshot.json @@ -0,0 +1,17 @@ +{ + "env": "cube-quadruple-play-v0", + "plan_n": 1, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": true, + "oracle_score": false, + "success_rate": 0.008, + "per_task": [ + 0.04, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_tdfree/triple_gsp_n4.json b/gen_q_rsm/results/comp_tdfree/triple_gsp_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..2a23423b0ebc386f92d5487461b0b2a03512a977 --- /dev/null +++ b/gen_q_rsm/results/comp_tdfree/triple_gsp_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": false, + "success_rate": 0.048, + "per_task": [ + 0.24, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_tdfree/triple_oracle_n4.json b/gen_q_rsm/results/comp_tdfree/triple_oracle_n4.json new file mode 100644 index 0000000000000000000000000000000000000000..229e762e8ca2005d77b3792c20caf744f58fcd03 --- /dev/null +++ b/gen_q_rsm/results/comp_tdfree/triple_oracle_n4.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 4, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": false, + "oracle_score": true, + "success_rate": 0.024, + "per_task": [ + 0.12, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/results/comp_tdfree/triple_zeroshot.json b/gen_q_rsm/results/comp_tdfree/triple_zeroshot.json new file mode 100644 index 0000000000000000000000000000000000000000..5f3554a117caf26dc321dc66b5b48521219b90e3 --- /dev/null +++ b/gen_q_rsm/results/comp_tdfree/triple_zeroshot.json @@ -0,0 +1,17 @@ +{ + "env": "cube-triple-play-v0", + "plan_n": 1, + "plan_m": 1024, + "gamma_eval": 0.99, + "zero_shot": true, + "oracle_score": false, + "success_rate": 0.044, + "per_task": [ + 0.22, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "method": "comp_plan_combined" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/CLAUDE.md b/gen_q_rsm/rsm_libero/CLAUDE.md new file mode 100644 index 0000000000000000000000000000000000000000..d7ef613f133e4f77bd596d9cdf80179d3615f3ca --- /dev/null +++ b/gen_q_rsm/rsm_libero/CLAUDE.md @@ -0,0 +1,291 @@ +# rsm_libero — LIBERO-10 RSM critic evaluation + +## INVALIDATION (2026-09-13): every result before this date is void + +Every run directory under `rsm_libero_runs/mit/` suffixed `_wrong_eval_env` (105 of them) and +every eval JSON under `rsm_libero_runs/eval/wrong_eval_env/` (143) was produced with the rollout +latents and the evaluator in DIFFERENT feature spaces. Do not cite, compare against, or resume +from them. The results tables further down in this file are retained only as a record of what +was believed; they are superseded. Valid runs are `*_r` and later, trained on +`rsm_libero_cache/full_demo_r256` (or its full-corpus successor) and evaluated at `--cam-res 256`. + +## PINNED INPUT FORMAT (offline data == online environment, or the run is inadmissible) + +| item | value | why | +|---|---|---| +| camera render | **256x256**, both cameras (`--cam-res 256`, the default) | RLinf `config/env/libero_10.yaml`; the collector rendered at 256 | +| orientation | raw render `[::-1, ::-1]` -> serving orientation | parquet images are stored already upright; demo hdf5 stores raw | +| resize | 256 -> 224 bilinear, **round and clamp to uint8** | `to224`: float input alone moves the latent 3 sigma | +| encoder | the latent-cache BUILDER's PaliGemma, base||wrist 2048+2048 | same module the evaluator imports | +| proprio | eef_pos(3) ++ ee_ori **axis-angle**(3) ++ gripper_qpos(2) | Euler was the #243 bug | +| demos | `libero10_demo_ogpo_cache_r256` (re-rendered from hdf5 `states` at 256) | the 128 demo cache is off-manifold under this evaluator | +| normalisation | `feat_stats*.npz` of the cache being trained on | eval reads `norm_pool` from the checkpoint | + +**Naming and marker convention (2026-09-13).** Every dataset, cache and checkpoint carries the render +resolution it was produced at, twice: in the NAME (`_cam128`, `_cam256`; a mix is `_MIXED_..._INVALID`) +and in a machine-readable marker (`RENDER.json` / `PACK.json` `cam_res`; checkpoints store `cam_res`). +`eval_closed_loop.py` REFUSES a policy, critic or Q whose declared resolution differs from +`--cam-res`, and refuses an undeclared one (`--allow-cam-mismatch 1` overrides; never for a reported +number). `pack.py --cam-res` is how a cache gets its declaration. + +| asset | name | cam_res | +|---|---|---| +| rollout latents | `pi05_lib10_ogpo_fl15_v1` (+RENDER.json) | 256 | +| demos, LIBERO hdf5 render | `libero10_demo_ogpo_cache_cam128` | 128 -- invalid under the 256 evaluator | +| demos, re-rendered | `libero10_demo_ogpo_cache_cam256` | 256 | +| subset cache | `rsm_libero_cache/full_demo_cam256` (`full_demo_r256` is a symlink for running jobs) | 256 | +| full cache | `rsm_libero_cache/full_r256` | 256 | +| old subset cache | `full_demo_MIXED_128demos_256rollouts_INVALID` | mixed | + +Rule, extended from reward labels to features: **a latent the eval environment cannot produce is +inadmissible for offline training.** Verify with `rerender_rollouts.py --validate-rollouts` / +`--validate-demos` (re-render from logged state in the evaluator's env; L2 to the cached latent +must sit at the within-cloud scale, ~4-12, not 60+). + +## RULE: offline data must reproduce its reward labels in the EVAL environment + +**A trajectory is admissible for offline training only if replaying its logged actions +in the environment we evaluate in reproduces its reward labels. If it does not +reproduce, drop the trajectory.** + +This is not a data-cleaning nicety, it is a correctness condition. An offline learner +fits $(s,a,r,s')$ tuples and is then scored in the simulator. If those tuples cannot be +reproduced there, they describe different dynamics than the ones the policy is graded +against, and the learner is being fit to an environment that does not exist. That is the +standard way offline RL silently fails. + +Three consequences that are easy to get wrong: + +1. **"The label was honest" is NOT the admissibility test.** Evaluating the goal + predicate at an episode's own logged final state answers whether the recorder told + the truth about the state it reached. Useful diagnostics, wrong question. A truthful + label on a trajectory that will not reproduce here is still inadmissible. +2. **The replay must run in the SAME configuration as eval** — same venv, same package + versions, same renderer and device. A trajectory that reproduces on CPU/osmesa but + not on the GPU/EGL path we actually evaluate on is not admissible, because the eval + path is the one that defines the environment. +3. **If the eval environment changes, admissibility must be recomputed.** Moving eval to + a different cluster, venv or `bddl` version invalidates the existing mask. See the + pinned versions below: IBM's `bddl` is 1.0.1 against MIT's 3.6.0, and `bddl` defines + the goal predicates, so a mask built for MIT does not transfer. + +Measured on R1 (`pi05_lib10_sde_v1`): replaying logged successes reproduces **~81%** +(per task 0.620--0.938). The remaining ~19% are inadmissible and are dropped by +`merge_verify.py --shards`, leaving ~1800 usable rollout successes. For contrast, the +diagnostic goal-predicate check passes ~87% — the gap between the two is exactly the +set of trajectories that were honestly recorded but do not reproduce, and **those are +inadmissible too**. + +## THE TWO EVALUATION PROTOCOLS — always report both + +There are two initial-state distributions, they give materially different numbers, +and **which one you use decides who wins**. Never report one without saying which. + +| protocol | flag | what it does | who is at home in it | +|---|---|---|---| +| **A. stock LIBERO test set** | `FRESH=0` (default) | replays `bench.get_task_init_states(tid)` — the benchmark's own fixed init states | **the demos** (they were collected from these) | +| **B. 5 cm continuous region** | `FRESH=1` | `env.reset()` only, so the task's placement initialiser samples object poses continuously | **the rollouts** (`fresh_reset=true`, "fresh 5 cm inits") | + +```bash +# A: stock init states +sbatch --export=ALL,POLICY=$P,NINIT=50,OUT=$E/x.json eval_slurm.sbatch +# B: continuous region +sbatch --export=ALL,POLICY=$P,NINIT=50,FRESH=1,OUT=$E/x_fresh.json eval_slurm.sbatch +``` + +### How an initial condition is actually defined + +Per episode, indexed by task `tid` and episode `k` (both protocols): + +```python +pseed = 7_919_003 + policy_seed*500_009 + tid*1_013 + k # policy sampling RNG +torch.manual_seed(pseed); torch.cuda.manual_seed_all(pseed) +np.random.seed(seed*100_003 + tid*1_009 + k) +env.seed(seed*100_003 + tid*1_009 + k) # env RNG +env.reset() # B stops here +if not fresh: + env.set_init_state(inits[k % 50]) # A overrides the reset +``` + +**Protocol A** — `env.set_init_state()` writes one of LIBERO's 50 stored full sim-state +vectors (`bench.get_task_init_states(tid)`), overwriting whatever `reset()` sampled. +Object poses are therefore a deterministic replay of a fixed, finite, curated set. +`NINIT=10` replays inits 0-9, which is why it is biased (see above); `NINIT=50` uses +each stored state exactly once. + +**Protocol B** — no override, so object poses come from the task's BDDL placement +regions (`bddl_base_domain.py`: `regions[name]["ranges"]` → `UniformRandomSampler`, +uniform in x/y over the task's rectangle plus a z-rotation). Under B, `NINIT=10` is a +small unbiased sample rather than a curated subset — noisy, but not systematically easy. + +**MEASURED (`probe_inits.py`, 2026-09-12): protocol B is NARROWER than protocol A.** +Mean std of the randomised sim-state DoF, over 50 states per task: + +| protocol | mean std | note | +|---|---|---| +| A, stock init states | **0.0236** | wider on all 10 tasks | +| B, `env.reset()` | **0.0138** | 0.58x of A | + +So `--fresh 1` is **not** an "expanded region" — it is a tighter one, and A is the more +demanding of the two. (`stock_inside_fresh_support = 0.00` is a consequence of A being +wider, not of a distribution shift.) + +**Neither protocol reproduces the rollout corpus's init distribution.** The corpus was +collected with RLinf's `fresh_reset=true`, documented as "fresh 5 cm inits" — 0.05 +would be wider than both A and B. Our evaluator has no equivalent. Evaluating on the +genuine 5 cm region would require explicit jitter of object free-joint xy after reset; +until that exists, the critic and the success-pool policies are under a mild init +shift under BOTH protocols. + +**Protocol A CANNOT be replicated by varying `SEED`.** `set_init_state` overwrites +whatever `env.reset()` sampled, so `env.seed` has no effect; `np.random.seed` is set but +never used in the rollout loop; and the policy stream is keyed on `--policy-seed`, not +`--seed`. Re-running protocol A at a different `SEED` reproduces the identical 500 +episodes. **A is hard-capped at 500 distinct episodes** (50 stored inits x 10 tasks). +Its only legitimate replication is `PSEED=1,2,...`, which resamples the policy on those +same inits. Protocol B draws fresh placements per episode, so `SEED` gives genuine new +episodes and n scales without limit — it is the only protocol that supports replication. + +**Both protocols are PAIRED across arms.** The env seed depends only on +`(seed, tid, k)` and the policy seed only on `(policy_seed, tid, k)` — neither depends +on which policy or critic is being evaluated. So with `SEED=0` every arm sees the +identical sequence of initial conditions and the identical policy-sampling RNG stream. +Differences between arms are attributable to the arm, and variance on a *difference* +is lower than the independent-sample formula implies. Never vary `SEED` between arms +you intend to compare. + +### Why this is not a detail + +Provenance of every component, verified 2026-09-12 from the corpus `DATASET.md` files: + +| component | source | init distribution | +|---|---|---| +| 500 demos → BC-on-demos | `libero10_demo_ogpo_cache_srv` (official LIBERO-10 human demos) | **stock init states** | +| 4500 rollouts → BC-on-successes, **93% of critic training** | `pi05_lib10_ogpo_fl15_v1` ← `pi05_lib10_sde_v1` | **fresh 5 cm**, `fresh_reset=true` | + +Under protocol A we evaluate on exactly the configurations the demos were collected +from, while the rollout corpus — which trains the critic and the success-pool policies +— comes from a different, wider region. That is a structural advantage for +BC-on-demos and a distribution shift against everything else. Protocol B is the one +where the critic's training distribution matches the test distribution. + +## PINNED: simulator versions, and where eval may run + +**All LIBERO evaluation and the R1 rollout collection run in the SAME MIT venv**, so +they are comparable by construction. Do not change this venv without re-deriving every +number in this file. + +``` +venv continual_learning_for_manipulation/venvs/rlinf-libero-eval-venv (python 3.11.15) +mujoco 3.8.1 robosuite 1.4.1 bddl 3.6.0 libero vendored +installed 2026-08-31 (corpus R1 collected 2026-09-05 with this same venv, unchanged since) +collection driver: logs/09052026_pi05_lib10_collect.sh -> PYE=.../rlinf-libero-eval-venv/bin/python +``` + +**IBM cannot run LIBERO eval, and its stack is not equivalent:** + +| | MIT (eval + collection) | IBM `/proj/dmfexp/zwhong/venvs/lerobot_env` | +|---|---|---| +| mujoco | 3.8.1 | 3.8.1 | +| robosuite | **1.4.1** | **1.4.0** | +| bddl | **3.6.0** | **1.0.1** | +| libero | vendored | **absent** | + +`bddl` differs by a major version and **bddl defines the goal predicates**, so a +"success" computed on IBM would not be the same event. IBM is **training-only**; every +closed-loop number must come from MIT. + +**The replay divergence is NOT a version mismatch.** Collection and replay share the +venv and the versions, installed before collection and untouched since. Re-executing +logged actions reproduces only ~81% of successes because contact-rich manipulation is +chaotic and the two runs differ in floating-point detail (collection on GPU nodes under +EGL, replay on CPU under osmesa). This is why label correctness must be measured by +evaluating the goal predicate at the LOGGED FINAL state (~87% correct) rather than by +replay (~81%) -- replay conflates label error with non-reproducibility and overstates +it by roughly 3x on the worst task. + +## Other measurement traps in this directory + +**`NINIT=10` is a fixed easier subset, not a sample.** Init states are selected as +`inits[k % 50]`, so `n_init=10` always replays inits 0–9. Measured on one policy: +**0.630 at n=100 vs 0.532 at n=500**, a +0.098 mean per-task gap on 8 of 10 tasks. +It is deterministic and does not shrink with repetition. Control: a Q-filter gate +firing on 0.5% of decisions (≈ BC) returned exactly 0.630 at n=100. +**Use `NINIT=50` for any number you intend to quote.** At n=100 the standard error on +a *difference* is ±0.069, so sub-14-point effects are unresolvable. + +**Success labels are ~16% optimistic.** A replay audit of the source corpus found 5 of +32 logged successes did not actually succeed. BC-on-successes clones a pool where +~1 in 6 "successes" is a failure, and the critic's `γ^steps-to-success` reward gives +those episodes a full progress curve toward a success that never happened. + +**Held-out action win rate does not predict closed-loop.** `ckpt_best.pt` selects on +it, but it went 0.478 → 0.784 → 0.896 across critics while closed-loop went +0.496 → 0.490. A collapse to 0.363 cost only 0.046. Treat it as a broken-critic alarm, +not a selection criterion. + +**A silent 0% means a config mismatch**, not a bad policy — a chunk-25 flow policy run +through the chunk-10 concat harness scores exactly 0/350. Same signature as the +original Euler-vs-axis-angle proprio bug. + +## Results, n=500, both protocols + +Protocol B column is filled as arms land; `--` = not yet run. + +| arm | uses demo labels? | A: stock | B: 5 cm continuous | +|---|---|---|---| +| BC-on-demos | yes (pool) | **0.532** | **0.520** | +| BC-on-successes | no | 0.438 | -- | +| RSM ranking, successes proposal, N=32 | **no** | 0.416 | -- | +| IQL extraction (200k steps) | yes (pool) | 0.416 | -- | +| RSM ranking, demos proposal (best: `c1Mb`, β 0.98/0.99) | yes | **0.540** | -- | +| RSM ranking, successes proposal | **no** | -- | -- | +| AWR extraction on success pool | **no** | -- | -- | + +**Measured 2026-09-12: BC-on-demos scores 0.532 (A) vs 0.520 (B) — it does NOT +memorise the stock init states.** Protocol A is not inflating the baseline; the bar is +real. The remaining reason to run B is the reverse concern: the critic and the +success-pool policies were trained on the continuous-region corpus, so protocol A puts +*them* under mild shift. + +Scoring rule (PI): using the demo *label* is a privilege that only counts if it beats +BC-on-demos. Using demo *data* without the label is unprivileged; beating +BC-on-successes there is already signal, and beating BC-on-demos is the strong claim. + +### Critic ablations (protocol A, n=500, demos proposal) + +| knob | result | +|---|---| +| **trained β band** 0.85–0.97 / **0.93–0.995** / 0.96–0.999 | 0.490 / **0.540** / 0.502 — inverted-U, optimum found | +| read-out β 0.95 / 0.98 / 0.99 / 0.995 | 0.524 / 0.540 / 0.540 / 0.500 — plateau 0.98–0.99 | +| critic steps 12k → 110k (same band) | 0.496 → 0.490 — **no effect** | +| best-of-N 8 → 32 | flat to harmful | +| confidence gate (6 thresholds, 0.5%–60% fire) | 0.488–0.532 — no regime beats BC | +| candidate noise (SDE 0.3) | 0.510 → 0.290 — strongly harmful | +| demo-chunk retrieval (+4 / +8 / retrieval-only) | 0.516 / 0.392 / 0.352 — **strongly harmful** | +| action chunk 10 → 16 / 24 / 32 | 0.630 → 0.49 / 0.29 / 0.25 (n=100) — strongly harmful | +| AWR advantage into the actor (demos pool) | 0.520 → 0.350 vs its own `w≡1` control — strongly harmful | + +**The critic cannot rank off-proposal candidates.** Noise, N=32 and retrieval all fail, +and retrieval fails *in proportion to how often the retrieved chunk is used*. Its +ordering is calibrated only on the proposal's own distribution; outside it the ranking +is actively misleading, not merely uninformative. Corollary: AWR on a pool of uniformly +expert demos can only damage it — run advantage weighting on the **success** pool, +where quality actually varies. + +## Paths + +``` +code /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo # 5000 eps = 500 demo + 4500 rollout +runs /data/pulkitag/users/rli14/rsm_libero_runs/mit +evals /data/pulkitag/users/rli14/rsm_libero_runs/eval +best critic runs/mit/critic_1M_b995/ckpt_best.pt # band 0.93-0.995, step 110k +BC-demos runs/mit/A_nd/policy_r1.pt # 0.532 (A, n=500) +BC-successes runs/mit/B_nd/policy_r1.pt # 0.438 (A, n=500) +``` + +Compute: MIT slurm, `--qos=vision-pulkitag-free-cycles`. Never `vision-pulkitag-main`. +`lab-free`/`csail-shared-h200` gets root-cancelled within seconds — use +`vision-pulkitag-l40s,vision-pulkitag-a6000`. Training is resumable (`--resume 1`, +saves optimiser state); chain with `--dependency=afterany`. diff --git a/gen_q_rsm/rsm_libero/FINDINGS.md b/gen_q_rsm/rsm_libero/FINDINGS.md new file mode 100644 index 0000000000000000000000000000000000000000..f24eb52b9eb714b60ed1cb1d3c6dbceaca1c094a --- /dev/null +++ b/gen_q_rsm/rsm_libero/FINDINGS.md @@ -0,0 +1,344 @@ +# RSM on the LIBERO-10 pi0.5 rollout corpus: findings + +Branch `rsm-libero10-ope`. All closed-loop numbers: 10 tasks x 10 initial states +(n=100), 520-step cap, action chunk 10 with 10 executed, seed 0, measured by +`eval_closed_loop.py` after the fix described in section 2. + +--- + +## 1. Headline + +Behaviour cloning on the 500 demonstrations is the best policy in this lane, and +no value-guided extraction beats it. + +| arm | succ/n | SR | thr succ | thr all | +|---|---|---|---|---| +| **BC on demonstrations** | **63/100** | **0.630** | 1.132 | 0.874 | +| lane reference `bcdemos_h1024d4`, our harness | 53/100 | 0.530 | 0.946 | 0.691 | +| RSM Q-filter, 16 candidates | 51/100 | 0.510 | 0.951 | 0.668 | +| IQL + AWR (demo pool) | 50/100 | 0.500 | 0.963 | 0.658 | +| IQL + AWR (success pool) | 49/100 | 0.490 | 0.839 | 0.615 | +| BC on successful rollouts | 48/100 | 0.480 | 0.807 | 0.596 | +| PARL + RSM value (collapsed proposal) | 44/100 | 0.440 | - | - | +| RSM + AWR (demo pool) | 43/100 | 0.430 | 0.758 | 0.528 | +| RSM + AWR (success pool) | 41/100 | 0.410 | 0.802 | 0.513 | + +Our BC also clears the published 0.584 reference: that checkpoint scores 0.530 +through this harness, and ours scores 0.630 under the same protocol. + +Both critic arms start from the *same* 0.630 clone and move it **down**. The +advantage signal is harmful, not merely uninformative. + +--- + +## 2. The bug that invalidated everything before it + +For most of this work every arm scored **0%**. The cause was in our evaluator, not +in any policy: it converted the end-effector quaternion to **Euler angles**, while +the latent cache stores robosuite **axis-angle**. Three of the eight +proprioception dimensions were a different physical quantity at every timestep of +every episode. + +Proof, same machine and same weights, on the lane's own 0.584 policy: + +| evaluator | task 5 | +|---|---| +| lane's `09032026_latent_head_eval.py` (axis-angle) | 5/5 | +| ours before the fix (Euler) | 0/5 | +| ours after the fix | 5/5 | + +Why every existing check missed it: + +* The visual latent is 4096 of 4104 input dimensions, so the three corrupted ones + never moved a **cosine similarity**. Our encoder reproduces the cache at + cos 0.9999 offline and 0.9903 from live frames; both stayed green throughout. +* The **offline fit** is computed on cached proprio, which is correct, so held-out + sampled action MSE looked healthy at 0.049. +* A **bit-exact comparison of the first action chunk** passed, because it called + the same helper on both sides. + +Only an end-to-end control with a known-good policy exposes it. That control did +not exist in this lane before now; `eval_closed_loop.py --lane-norm` runs it. + +A second, smaller deviation in the same file: `to224` returned the raw float32 +interpolation where the cache builder rounds to uint8, shifting the latent by up +to 0.31 against a per-dim std of 0.107. Fixed, though not the cause of the 0%. + +**Anything measured through this evaluator before commit `b64ebddf` says nothing +about the policy it was measuring.** + +--- + +## 3. What the main-branch recipe gave us, and what it did not + +Adopted from `ogbench_unified_rsm/RECIPE.md` and the lane's BC: + +| item | effect here | +|---|---| +| flow-matching occupancy on residuals, per-dim RMS normalised | works; CFM val loss 0.17-0.30 | +| EMA target encoder, variance floor | no collapse observed (latent std min 0.10-0.41) | +| Fourier beta conditioning, FiLM in the successor | retained | +| beta band + query beta | see section 5: the band is not the lever | +| action-contrastive term | does not fix the action gap at any weight | +| concatenation flow head for the policy (their BC head) | matches their fit exactly | +| select on ODE-sampled MSE, not the CFM loss | correct, but see section 6 | +| SWA at deploy, two-tower `q_readout=lik` | **not implemented** | + +Two things we added that mattered more than any recipe item: + +1. **The policy must not read the critic's latent.** That encoder is trained to + predict reward and discards what an action head needs. On the 264-d latent a + flow policy beat a predict-the-mean baseline by 14% in action MSE with a biased + gripper channel. Reading the full observation is what took arms off the floor. +2. **Policy input scaling**, section 4. + +--- + +## 4. Normalisation is worth more than any algorithm here + +| policy input | SR | +|---|---| +| centred with DEMONSTRATION statistics | **0.630** | +| centred with rollout-dominated statistics | 0.430 | +| per-dim z-scored | 0.010 | + +Centring matters because the mean feature vector has norm 51.1 against a +per-frame deviation of 9.0, so 85% of the raw magnitude is a constant. *Which* +frames the statistics come from matters because the rollout corpus is a different +distribution (pi0.5 with SDE noise 0.5, about half failures). Whitening is +catastrophic because per-dim std spans 0.048 to 3.675, so it shrinks the few +informative directions up to 34x relative to the median. + +Note the sign flip against intuition: whitening *improved* the critic's action gap +(-0.086 to a +0.103 peak) while destroying the policy. The critic and the policy +want different input geometry, which is why they are scaled separately. + +--- + +## 5. The critic ranks states well and actions barely at all + +Held-out within-task action win rate versus reward AUC, across every intervention: + +| critic | action win | reward AUC | +|---|---|---| +| chunk 10, w_actcon 0.5 (deployed) | 0.568 | 0.96 | +| w_actcon 1.0, d_z 512 | 0.532 | 0.96 | +| w_actcon 2.0 | 0.533 | 0.96 | +| inverse dynamics 1.0 | 0.445 | 0.96 | +| inverse dynamics 5.0 | 0.534 | 0.96 | +| chunk 10, hop 0.97 | 0.558 | 0.96 | +| chunk 10, hop 0.99 | 0.551 | 0.96 | +| chunk 30, hop 0.967 | 0.597 | 0.96 | +| chunk 100, hop 0.99 | **0.613** | 0.95 | + +All peak between step 1000 and 2000 and then decay below chance. The state value +is excellent throughout; only the action channel is missing. + +**The lever is the action window, not the hop.** Holding chunk at 10 and sweeping +the hop is flat (0.568 / 0.558 / 0.551). Widening the window to 100 frames is the +only thing that moves it. A 10-frame chunk does not determine enough about the +outcome on these tasks. + +This is consistent with the lane's own earlier measurement: over 5 frames the +executed action correlates with the **proprio** delta at |r| up to 0.98 but with +the **visual-latent** delta at only 0.49 (mean 0.10). A mean-pooled PaliGemma +embedding barely resolves what a short chunk does. + +And the trade is strictly unfavourable, because the policy moves the other way: + +| chunk | BC on demos | RSM extraction | critic win | +|---|---|---|---| +| 10 | **0.630** | 0.430 | 0.568 | +| 30 | 0.440 | 0.160 | 0.597 | +| 100 | 0.080 | 0.020 | 0.613 | + +--- + +## 6. The experiment that settles it: PARL with proposal diversity + +PARL ranks N=32 proposal samples by Q, keeps the argmax, and distills. Its own +precondition is that the proposal must be diverse, because ranking N copies of one +action cannot improve anything. Measured action std against the data's 0.421: + +| proposal | action std | ratio | +|---|---|---| +| BC on demos, 120k steps, best-MSE checkpoint | 0.029 | 0.070 | +| BC on demos, 20k steps | 0.053 | 0.126 | +| the same, sampling temperature 1.5 | 0.103 | 0.244 | +| the same, sampling temperature 2.5 | 0.222 | 0.527 | + +**Selecting a checkpoint by best held-out sampled MSE picks the most +mean-collapsed policy.** Our earlier Q-filter was therefore ranking 32 near-copies +of one action, which is why it returned 0.510 instead of anything informative. +This is a trap for anyone reusing `train_bc`'s selection for a proposal. + +Result: + +| proposal diversity | PARL SR | +|---|---| +| 0.070 | 0.350 | +| 0.126 | 0.440 | +| 0.244 | 0.230 | +| 0.527 | **0.000** | + +and dropping the variance penalty, so selection follows the raw value instead of +hugging the mode, makes it worse again: + +| selection rule | T=1.5 | T=2.5 | +|---|---|---| +| Q minus 2 particle std | 0.230 | 0.000 | +| pure expected success | 0.130 | 0.010 | + +Critic, N, distillation and evaluator are fixed across every row; the only +variable is how much freedom the value has to choose. A value carrying signal gets +*better* with a wider candidate set. This one destroys the policy. + +**Conclusion: Q responds to the action, but the direction of its response is +uncorrelated with action quality.** Measured directly with +`probe_perturb.py` on demonstration frames, where the logged chunk is by +construction the good action: + +| perturbation noise | mean Q | expert wins | +|---|---|---| +| 0 (expert chunk) | 48.749 | - | +| 0.05 | 48.800 | 0.489 | +| 0.10 | 48.674 | 0.508 | +| 0.20 | 48.769 | 0.508 | +| 0.40 | 48.962 | 0.490 | +| 0.80 | 49.243 | 0.483 | + +The data's own action std is 0.421, so noise 0.80 destroys the action completely, +and mean Q moves by 1%, with the expert winning half the comparisons at every +level. + +That alone is ambiguous: it is equally consistent with "Q ignores the action" and +with "the Monte-Carlo estimator cannot resolve the action", because q_recursive +draws fresh flow noise per call. `probe_crn.py` separates them by scoring +candidates under COMMON random numbers, which cancels the shared noise from the +paired difference: + +| perturbation | paired abs dQ (CRN) | expert wins | ratio to repeat noise | +|---|---|---|---| +| 0.10 | 0.399 | 0.481 | 0.18 | +| 0.20 | 0.719 | 0.503 | 0.32 | +| 0.40 | 1.588 | 0.482 | 0.71 | +| 0.80 | 3.793 | 0.502 | 1.69 | + +(repeat noise, same action under independent draws: 2.246) + +So Q is **not** blind. It moves substantially when the action changes, roughly +linearly in the perturbation size, and at noise 0.8 the paired response exceeds +the estimator noise. What is missing is the SIGN: perturbing an expert action is +exactly as likely to raise Q as to lower it, even at the smallest perturbation and +even with the shared noise cancelled. + +The occupancy model has therefore learned an action-conditioned map whose +counterfactual gradient is meaningless. It is trained only on (state, action +actually taken, observed future); it never sees a counterfactual action with a +real outcome, so off the logged action it extrapolates confidently and +arbitrarily. Magnitude without direction. + +This explains every downstream result coherently, and explains the PARL sweep +better than "weak critic" does. Selection follows an arbitrary direction, so PARL +effectively picks a random member of its candidate set; the wider the set, the +further off-support the winner, and the worse the policy -- exactly the monotone +collapse 0.440 -> 0.230 -> 0.000. AWR weights become noise that dilutes the clone. +A collapsed proposal looks harmless because a random choice among 32 copies of one +action is still that action, and it is also the only configuration that stays +inside the region where the model was ever trained. + +It also explains why the 0.568 offline win rate looked survivable: comparing the +logged chunk against a DIFFERENT episode's chunk is dominated by on-support versus +off-support, which the occupancy model does capture. Ranking a policy's own +candidates at the same state is a different question, and there the model has +nothing to say. + +The 0.568 offline win rate did not reveal this, because ranking *dataset* +alternatives is dominated by on-support versus off-support. That is a different +question from ranking a policy's *own* candidates, which is what every extraction +method actually does. `probe_perturb.py` asks the right question directly: does Q +prefer the expert chunk over noisy perturbations of it. + +### The filtering test the corpus was collected for + +One configuration tests the critic's whole reason to exist. Fit the proposal to +the WHOLE corpus, failures included, so its candidate set genuinely contains both +good and bad behaviour, then let the value filter it. A critic that can separate +success-like from failure-like actions should recover demonstration-level +performance from a proposal that on its own is poor. + +| proposal | PARL SR | +|---|---| +| demonstrations only (diversity 0.126) | 0.440 | +| whole corpus incl. failures (diversity 0.132) | **0.170** | + +It does not filter. Given a candidate set that by construction contains the +failure modes the critic was trained on, selection makes things worse, not better. + +That run also shows candidate diversity cannot be bought with data: fitting the +proposal to the whole corpus gives action std 0.056, against 0.053 for +demonstrations only. Flow matching learns the conditional mean regardless of how +varied the data behind it is. The only lever that moved diversity was sampling +temperature, and that pushes candidates off the manifold -- exactly where the +value's response was measured to be arbitrary. On-manifold and diverse are not +jointly available from a flow behaviour clone here. + +--- + +## 7. Bugs fixed along the way + +Each of these alone produced a zero or a badly wrong number. + +1. Evaluator sent Euler angles where the cache holds axis-angle (section 2). +2. Evaluator fed float32 pixels where the builder quantises to uint8. +3. `import_file` given an absolute path: ValueError before any env was built. +4. The featuriser imported from the rollout producer, which does not define it. +5. `RawFeat` left on CPU once it carried a buffer. +6. `offline_score` indexed an empty failure pool on a demos-only cache. +7. `bc_arm` scored before saving, discarding a finished 120k-step run. +8. Launchers ended with `echo`, so crashed jobs exited 0 and every + `--dependency=afterok` eval ran against a checkpoint never written. +9. AWR weight degeneracy: advantage std ~8 at beta 3 saturates the exponent, so + the "soft" weight was a hard sign filter on a 0.568-accurate critic. Worth 0.11 + (IQL 0.380 to 0.490 once the advantage is standardised). +10. `q_recursive` called the extracted policy to re-draw continuation actions in + latent space, which a raw-feature policy cannot answer; it now uses a separate + latent-space continuation policy. + +--- + +## 8. Where to iterate next + +The blocker is specific: the latent does not carry the action, so no read-out +built on it can rank actions, and the horizon over which a short chunk matters is +too short to recover the signal. In rough order of expected value: + +1. ~~Ask whether the ranking is inverted or absent.~~ **Answered: neither.** Q + responds to the action with the right magnitude and an arbitrary sign + (section 6). There is no sign to flip and no variance to average away -- common + random numbers make the paired response exceed the estimator noise and the + expert still wins only half the time. The defect is that the model's + COUNTERFACTUAL response is untrained: it only ever sees the action that was + actually taken. Everything below attacks that. +2. **A latent that is action-predictive by construction.** The inverse-dynamics + auxiliary tried here (`--w-invdyn`) is the weak version: it shares the encoder + with a reward objective that dominates. Stronger: train the occupancy in a + latent whose *only* objectives are reward AND inverse dynamics, or concatenate + a proprio-history channel that already correlates with the action at 0.98. +3. **The recipe's `q_readout=lik`.** The two-tower InfoNCE goal likelihood is the + one main-branch item not implemented here. `GoalLikelihood` already exists in + `model.py`, unused. A contrastive read-out is better calibrated than a + saturating reward head and may rank where the sigmoid cannot. +4. **Decouple the critic's action window from the policy's.** The measured + trade-off is that the critic wants 100 frames and the policy wants 10. A + model-based lookahead that scores the policy's 10-frame chunk followed by + occupancy-rolled continuation would give the critic its long window without + forcing the policy to emit one. This is the most promising direction and the + most work; the pieces (`q_recursive`, a latent continuation policy) exist. +5. **Richer features.** Mean-pooled PaliGemma is the root constraint. Patch tokens + or an explicitly action-conditioned encoder would change the ceiling rather + than work around it. + +What is NOT worth repeating: action-contrastive weight sweeps, latent width, +recursion depth, hop length, and AWR pool choice. All were measured and none moves +the action win rate off ~0.57. diff --git a/gen_q_rsm/rsm_libero/README.md b/gen_q_rsm/rsm_libero/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7c5c121446e48c2825fe96a83772d1a0ee4714b4 --- /dev/null +++ b/gen_q_rsm/rsm_libero/README.md @@ -0,0 +1,737 @@ +# RSM + importance-sampled OPE on the LIBERO-10 rollout corpus + +Goal: learn an occupancy critic on the pi0.5 LIBERO-10 rollout corpus (43,135 +episodes, ~49.5% success), evaluate a target policy off-policy with the +importance-sampling correction, and distil a policy that beats behaviour cloning. + +## Why this corpus and not the demos + +The smolvla RSM critic was fit on demonstrations only. Its AWR extraction was a +null result for a mechanical reason recorded in `rsm_vla/smolvla_rsm/README.md`: +the mean absolute advantage was **0.019**, because a BC actor that imitates the +demos scores its own action the same as the demo action. Half of this corpus is +failure, so the advantage has real spread. + +## Pipeline + +| stage | file | what it produces | +|---|---|---| +| pack | `pack.py` | flat memmap cache from the per-episode npz corpus | +| critic | `train_rsm.py` | reward-predictive latent + action-conditioned occupancy | +| OPE | `is_ope.py`, `run_ope.py` | ratio nets, endpoint weight, recursive Q, gate | +| improvement | `awr.py` | advantage-weighted regression, looped with re-fitted ratios | + +## Tricks carried over from `main` (ogbench_unified_rsm) + +Taken from `RECIPE.md` and `notes/COLLAPSE_ANALYSIS.md`: + +* train over a **beta band**, not one discount, with Fourier features on the + log-horizon +* **residual** successor, normalised per dimension by the dataset RMS of the + residual +* **EMA target encoder** supplies the future target, with a variance floor + against latent collapse +* condition on the action chunk and the task **equally**, concat plus FiLM +* keep recursion **shallow** (2 hops here), and never prune mid checkpoints + +Deliberately not carried over: the goal-ball arrival likelihood. LIBERO has no +privileged success ball in this latent, so the read-out is a learned reward +decoder, which is what the image branch of `CLAUDE.md` requires anyway. + +The collapse analysis' central lesson drives the diagnostics: a value that ranks +STATES but cannot rank ACTIONS shows flat batch losses and then falls off a +cliff in closed loop. So the headline validation metric here is the **action gap**, +Q on the logged chunk minus Q on a foreign chunk at the same state, not the +state-level success AUC. + +## The importance-sampling correction + +The behaviour policy is a flow model sampled as an SDE at noise 0.5 and has **no +tractable density**, which is open question 2 in the notes. We never ask for one: + +1. a classifier separates a logged chunk from a chunk sampled from the target + policy at the same state, and its logit is `log pi/mu` on balanced classes; +2. the chunk product runs over the interior decisions of a beta-hop only, which + with a 10-action chunk is ~5 factors per hop rather than ~50; +3. that product is regressed onto the endpoint under squared loss, whose + minimizer is `E[W | endpoint] = d^pi_beta / d^mu_beta`, the only form usable + at inference because the occupancy model emits endpoints and not actions; +4. the recursive read multiplies endpoint weights along hops and self-normalises. + +Decision-point ratios are prefix-summed once per ratio fit, so the chunk product +is an O(1) lookup rather than one forward pass per interior decision. + +## Data notes + +* `task_index` is 0 in every episode of this corpus. The producer that caused it + is already fixed upstream; the packer takes ids from the canonical benchmark + order in `09052026_lib10_tasks.txt` and refuses to run on a task directory that + is not in that list. +* Failed episodes are all exactly 520 frames while successes end early, so + episode length nearly determines the outcome. Any label built from "frames + remaining" leaks it. The reward label is therefore defined on terminal states + of successful episodes, and action ranking is the headline metric. + +## Findings so far (dev cache: 2,350 episodes, 954k frames, 50% success) + +### The critic learns states well and actions weakly + +Reward AUC 0.99, occupancy loss 0.27 -> 0.13, state AUC 0.50 -> 0.66 over 16k steps. +The pooled action win rate never left chance in eight checkpoints. + +### The action-ranking metric has to use an ON-SUPPORT alternative + +Comparing Q on the logged chunk against a chunk permuted across the whole batch +compares against an action from a *different task*. Once the successor is +action-conditioned that lands off-manifold, and the frozen reward decoder scores +off-manifold latents arbitrarily -- the win rate fell to 0.361, i.e. the critic +"preferred" the off-support action 2 times in 3. The same bug was latent in the +sweep, whose recursion originally used an untrained continuation head. + +With a within-task alternative and 8,192 pairs, the base critic ranks actions +above chance near the goal: 0.61 mean near-terminal win, vs a cross-task control +pinned at 0.47-0.52 in all twelve cells. + +### Recursion depth costs action signal; longer single hops do not + +Base arm, near-terminal win pooled over four discounts: + +| depth | mean win | n | 95% CI | +|---|---|---|---| +| 1 | 0.630 | ~4000 | [0.615, 0.645] | +| 2 | 0.608 | ~4000 | [0.592, 0.623] | +| 3 | 0.580 | ~3000 | [0.562, 0.598] | + +The query action conditions only the first hop, so each extra hop hands more of +the trajectory to the continuation policy. Meanwhile reach at depth 1 grows from +25 to 200 frames as beta goes 0.96 -> 0.995 with the win rate flat at 0.61-0.64. +**A single long hop dominates stacked short hops here** -- but only because the +occupancy was trained on a beta BAND covering the query horizon. Recursion earns +its place when composing *beyond* the trained band, which is not what this tested. + +### The action-contrastive term: better actions, worse states, and an artifact + +At weight 1.0 it reaches its own objective (contrastive loss 0.68 -> 0.39) and +ranks near-terminal actions better (0.667 vs 0.609 over 12,000 pairs), but state +AUC drops 0.66 -> 0.59 and the occupancy loss stalls. + +It also shows a **perfect depth-parity artifact**: pooled win 0.460 / 0.617 / +0.542 at depths 1 / 2 / 3, with the value gap negative at odd depth and positive +at even depth in 12 of 12 cells. The base arm is flat at 0.505 for every depth. +Unexplained; not built on. + +### Contrastive weight: 0.1 is free, 1.0 is destructive + +| arm | w_actcon | state AUC | occupancy loss | +|---|---|---|---| +| base | 0 | 0.660 | 0.132 | +| actcon01 | 0.1 | **0.676** | 0.133 | +| actcon | 1.0 | 0.587 | 0.175 | + +The damage at 1.0 is an over-weighting artifact, not something inherent to the +contrastive idea. The 1.0 arm is also the one carrying the unexplained +depth-parity behaviour, so treat it as suspect. + +### The importance-sampling correction FAILED its null control + +Both gates use the same critic and differ only in whether the target policy is +genuinely different from the behaviour policy. + +| metric | signal (pi = BC on successes) | null (pi = BC on all ~ mu) | +|---|---|---| +| ratio classifier accuracy | 1.000 | 0.999 | +| raw `E_mu[W]` (must be 1.0) | 0.181 | 0.181 | +| calibration factor | x5.229 | x5.238 | +| weight ESS | 0.563 | 0.559 | +| corr(endpoint w, chunk W) | 0.432 | 0.434 | +| relative value shift from IS | 0.1925 | 0.1842 | +| success AUC change | +0.0019 | -0.0054 | + +Identical to within noise. The correction shifts values ~19% whether or not +there is a policy difference to correct, and never improves discrimination. + +**Cause, and it is an implementation error not a property of the method:** the +target policy was a diagonal Gaussian while the behaviour policy is a flow +sampled as an SDE. The classifier reached 100% accuracy by recognising the +SAMPLER, not the policy, so `log pi/mu` was a parametric-family artifact. This is +open question 2 of the notes -- a likelihood-free ratio only works if both +policies come from the same family, else the classifier solves the easier problem. + +Note how well the signal gate looked in isolation: weights calibrated to 1.016, +ESS 0.56, and the best success AUC in the run (0.6645). Without the null control +that would have been reported as a working correction. + +**Fix:** `FlowPolicy` in `model.py` -- a flow-matching target policy that matches +the behaviour family. AWR weights the per-sample flow-matching loss in place of a +log-density. The fix is confirmed only if classifier accuracy drops below 1.0 AND +the null gate moves to `E_mu[W]` near 1 while the signal gate does not. + +### The residual cause is the collection noise, not just the family + +Same critic, same null gate, only the ratio estimator changes: + +| configuration | classifier acc | `E_mu[W]` (must be 1.0) | +|---|---|---| +| Gaussian policy, no smoothing | 0.999 | 0.181 | +| flow policy, no smoothing | 0.98 | 0.184 | +| flow policy + per-dim smoothing (0.5) | 0.934 | 0.219 | + +Matching the family cut classifier confidence 20x (bce 0.0035 -> 0.076) and moved +`E_mu[W]` **not at all**. The corpus was collected with pi0.5 flow **SDE noise +0.5** deliberately injected for exploration; any policy fit to that data without +the same dispersion stays distinguishable from it. Exploration noise at +collection time is exactly what makes the behaviour distribution broad, and +breadth is what makes a target policy trivially separable from it. + +Across 3 critics and 2 policy families the correction consistently shifts values +18-26% and consistently fails to improve what the values are for: + +| critic / policy | rel value shift | success AUC with IS | without IS | +|---|---|---|---| +| base / gaussian, signal | 0.192 | 0.6645 | 0.6626 | +| base / gaussian, null | 0.184 | 0.6577 | 0.6631 | +| actcon / flow, signal | 0.256 | 0.5741 | 0.5768 | + +### Smoothing helps the diagnostics and not the estimator + +Null gate, where a correct weight must do NOTHING: + +| configuration | acc | `E_mu[W]` | weight ESS | rel value shift | AUC change | +|---|---|---|---|---|---| +| gaussian, no smoothing | 0.999 | 0.181 | 0.559 | 0.184 | -0.005 | +| flow, no smoothing | 0.98 | 0.184 | - | - | - | +| flow + smoothing 0.5 | 0.934 | 0.219 | 0.625 | 0.219 | **+0.018** | + +Smoothing did what it was meant to (acc 0.999 -> 0.934, ESS 0.559 -> 0.625) and +did not fix the estimator. The clearest tell is the **+0.018 AUC gain in the NULL +gate**: a correction that improves discrimination when there is nothing to +correct is fitting something other than the policy difference. The endpoint +regression also went unstable under smoothing (loss 0.11 -> 5.73 at step 3000). + +**Verdict: across 3 critics x 2 policy families x 2 smoothing levels, the +per-decision importance weight fails its null control every time.** + +### AWR made the policy WORSE, and the mechanism is dilution + +| metric | pi_0 (cloned on successes) | after 1 AWR round | +|---|---|---| +| flow loss on SUCCESS chunks | 0.1706 | 0.1708 | +| flow loss on FAILURE chunks | 0.1876 | **0.1713** | +| separation gap | **0.0170** | **0.00046** | + +Round 2 is worse still: success loss 0.1770 (up from 0.1706), failure loss 0.1672 +(down from 0.1876), gap **-0.0098**. The gap declines monotonically and CROSSES +ZERO -- after two rounds the policy fits FAILED chunks better than successful +ones. Iterating the loop does not merely fail to improve the policy, it +progressively inverts it. + +The policy did not improve on successes; it got much better at fitting FAILURES. +`awr_step` samples from ALL training episodes and relies on the advantage to +downweight the bad ones. With an advantage this weak (the critic ranks actions at +0.608 near the goal and at chance beyond one hop) that reduces to behaviour +cloning on the full half-failure corpus, undoing the success filtering that made +pi_0 good. It is the offline echo of this lane's own `bcall` 0.108 vs `bcdemos` +0.584. + +Normalised, the advantage is **not** larger than the demonstration-only baseline +it was supposed to beat: 0.0160-0.0221 in probability units vs the smolvla null +result's 0.0190. The raw printout reads 1.60-2.21 only because Q is divided by +(1-gamma). **The premise that failure data would give AWR a bigger signal is not +supported by this measurement.** + +**The correction is NOT what breaks the loop.** Turning it off changes nothing +qualitative: + +| arm | pi_0 gap | after round 1 | change | +|---|---|---|---| +| IS on | 0.0170 | 0.00046 | -97% | +| IS off | 0.0089 | 0.00111 | -87% | + +Both collapse. So the loop failure and the IS failure are INDEPENDENT negatives: +the weights never tracked the policy difference (they fail their null control), +and separately the advantage is too weak to stop AWR diluting a success-cloned +policy with the failure half of the corpus. + +**Caveat on the AWR arms:** `awr.py` seeded numpy but not torch, so the IS-on and +IS-off arms started from different policies (pi_0 gaps 0.0170 vs 0.0089). Each +arm's trajectory relative to its OWN baseline is valid; the absolute numbers are +not matched across arms. Fixed for future runs. + +### FINAL: no policy-extraction win. All three AWR arms lose ground. + +Separation gap between success and failure chunks (higher is better): + +| arm | pi_0 | round 1 | round 2 | +|---|---|---|---| +| IS on, pool=all | +0.0170 | +0.00046 | **-0.0098** | +| IS off, pool=all | +0.0089 | +0.00111 | **-0.0082** | +| IS off, pool=succ (dilution control) | +0.0211 | +0.0166 | **+0.0054** | + +Two of three INVERT: the policy ends up fitting FAILED chunks better than +successful ones. Restricting the pool slows the collapse a lot but still loses +3/4 of the starting gap. **None improves on its own starting point.** The +advantage from this critic is too weak to drive improvement even when it cannot +dilute. + +### FINAL: the smoothed IS pair is backwards + +| gate | rel value shift | AUC with IS | AUC without | +|---|---|---|---| +| NULL (pi ~ mu, should do nothing) | 0.219 | 0.6675 | 0.6499 | +| SIGNAL (pi better, should help) | 0.247 | 0.6510 | **0.6557** | + +It helps +0.018 where it should do nothing and hurts -0.005 where it should +help. Inverted. That closes the question. + +## Status + +COMPLETE. Critic works; every off-policy result is negative. See the two FINAL +sections above. Raw artifacts in `results/`; runs under +`/data/pulkitag/users/rli14/rsm_libero_runs/`. + +## FINAL RESULTS + +### The AWR loop WORKS once the action chunk spans the hop it conditions + +Every failing arm conditioned the occupancy on 10 frames of action while asking it +to predict a 50-frame hop, so 4/5 of the transition came from actions the critic +never saw. A model-free probe shows the action's contribution to predicting success +rises monotonically with sequence length: +0.0237 (10 frames) -> +0.0627 (100). + +With `--chunk 100` spanning a 100-frame hop: + +| critic | pooled action win | near-terminal | state AUC | +|---|---|---|---| +| chunk=100, depth 2 | **0.580** [0.569,0.591] | **0.73** | 0.698 | +| chunk=10, depth 2 | 0.519 | 0.60 | 0.664 | + +**Depth 2 beats depth 1** (0.580 vs 0.547), reversing the earlier "depth hurts" +result and supporting the 2-3 hop intuition once the chunk spans the hop. + +| AWR arm | pi_0 | round 1 | round 2 | +|---|---|---|---| +| **chunk=100, pool=succ** | **+0.0671** | **+0.0791** | **+0.0825** | +| chunk=10, IS on | +0.0170 | +0.00046 | -0.0098 | +| chunk=10, IS off | +0.0089 | +0.00111 | -0.0082 | +| chunk=10, pool=succ | +0.0211 | +0.0166 | +0.0054 | + +Advantage is 0.068-0.080 in probability units vs the demo-only smolvla null +result's 0.019 -- ~4x more. The original premise holds at the RIGHT granularity. + +### ROOT CAUSE of every IS failure: the classifier measures NETWORK IDENTITY + +Six confounds were found and removed (gaussian-vs-flow family mismatch, missing +smoothing, ratio scored over the conditioning window instead of decisions, target +policy at the wrong granularity, and two shape/order bugs). Overlap improved every +time -- classifier bce 0.0035 -> 0.286 -- and the weights still collapsed. + +The identity control explains why. Train two BC policies on **identical data** with +different seeds; they are the SAME policy, so a ratio classifier must be at chance: + +| comparison | classifier acc | +|---|---| +| two policies, same data, different seed | **0.945-0.977** | +| target policy vs behaviour policy | 0.941 | + +Identical. The classifier detects **which network generated a sample** -- sampler +artifacts and generator fingerprints -- not a density difference. Every ratio it +produced was meaningless. `E_mu[W]` sat at 0.13-0.22 in all six configurations +regardless of critic, family, smoothing or granularity, and the final clean null +gate applied a **0.537 relative value shift where zero is correct**. + +**This RETRACTS the intermediate conclusion** that flow SDE noise 0.5 at collection +made the policies too separable and that the fix was data collection. The +separability was never between policies; less injected noise would not have helped. + +**Actual cause:** discriminative density-ratio estimation does not work on +continuous high-dimensional action chunks in this setup. It is an ESTIMATOR +property, not a data property. The notes' likelihood-free route -- classify instead +of requiring normalised densities -- is not viable here. A working correction needs +a genuine likelihood ratio (tractable densities on both sides) or a correction that +does not route through sample classification. + +### The likelihood ratio FIXES the estimator; the product length still kills it + +Replacing the classifier with a genuine `pi/mu_hat` (two tractable Gaussians, one +fit to the logged actions by maximum likelihood, densities evaluated AT the logged +action so nothing has to tell samples apart): + +| route | E_mu[w] | median w | ESS | null-gate value shift | +|---|---|---|---|---| +| classifier | 0.156 | - | 0.52 | 0.537 | +| **likelihood** | **1.756** | **0.974** | 0.526 | 0.607 | + +The per-decision weight is now RIGHT IN THE BULK (median 0.974 vs a required 1.0); +the classifier's was wrong everywhere. But the null gate still fails, and the +endpoint regression needed a x10 calibration. + +**Cause is arithmetic.** At `beta_q=0.99` a hop spans 100 frames = **10 policy +decisions**, so W is a product of 10 factors each with p95 = 4.48. That product is +catastrophically heavy-tailed however well-calibrated each factor is. + +This is precisely the variance argument in the notes, and the real case for myopic +beta: keep each hop SHORT so the product has few factors, then recurse. The tension +is now measured on both sides: + +* action signal needs LONG action windows (+0.0237 at 10 frames -> +0.0627 at 100) +* estimable weights need SHORT hops (1 decision per hop, not 10) + +**Untested middle ground:** chunk = hop = ~25 frames, i.e. ~2.5 decisions per +product, where the probe still shows +0.0334 action contribution (40% above the +10-frame case). That is the configuration most likely to satisfy both, and it is +the obvious next experiment. + +## What would come next + +1. Run the loop **without** the correction: `--chunk 100 --awr-pool succ --use-is 0`. + This is the only configuration that improves the policy monotonically. +1b. To make IS viable, test chunk = hop = ~25 frames (~2.5 decisions per product) + with `--ratio-mode likelihood`. Both requirements are measured; this is where + they might overlap. +2. Condition the occupancy on an action window that **spans its hop** -- the single + highest-impact setting found. +3. For IS, replace the classifier with a genuine likelihood ratio, or drop it. +4. Closed-loop LIBERO eval is NOT run here. Nothing in this file supports a claim + of beating BC on demos (0.584 +- 0.025 step-matched in the lane). + +## Closed-loop results, 2026-09-10 (MIT) + +### The control that was missing + +The lane's own bcdemos policy, run through the lane's own evaluator on this +machine, scores **0.20 / 0.20 / 0.70 on tasks 0-2 (11/30 = 0.367)** before slurm +preempted it. The environment, EGL rendering, pi0.5 encoder, initial states and +success detection here are therefore sound, and any 0% is ours to fix. Two things +were needed to get it to run: `FL15_TASKS` must name the 10 libero_10 tasks (it +defaults to a 15-task list and the head's task embedding then refuses the +checkpoint), and the evaluation-protocol freeze needs a fresh output directory. + +### What actually caused the 0% across every arm + +The policy was conditioned on the critic's 264-d encoder output. That encoder is +trained to predict REWARD, so it keeps what separates success from failure and +discards what an action head needs. On a trained arm the policy beat a +predict-the-mean action baseline by only 14% in MSE (0.1456 vs 0.1701) with a +biased gripper channel. The policy now reads the full 4104-d observation; only +the advantage comes from the critic. + +### Whitening the policy input breaks the closed loop + +Four runs, one consistent pattern: + +| policy input | head | steps | pooled SR | +|---|---|---|---| +| raw, chunk 25 | FiLM | 60k | 0.040 | +| **center**, chunk 10 | FiLM | 60k | **0.110** | +| z-score, chunk 10 | FiLM | 60k | 0.000 | +| z-score, chunk 10 | concat | 120k | 0.000 | + +The z-scored arm had the BEST offline fit of any arm (sampled action MSE 0.0374 +against 0.042 for the others) and still scored 0/100. Per-dim std on this corpus +spans 0.048 to 3.675, so whitening shrinks the few high-variance directions by up +to 34x relative to the median and flattens the spectrum. Offline the network +simply relearns its weights; at deployment the small online-vs-cache featurisation +difference is then comparable to the signal that survives. Centering removes the +uninformative common mode (mean vector norm 51.1 against a per-frame deviation of +9.0) without flattening the spectrum, and is what the arms now use. + +### Not the cause, established by measurement + +* **Featurisation.** Our encoder reproduces the demo latent cache at cos 0.9999 + offline and 0.9903 from live env frames; demo and rollout latents agree at + 0.991; env obs shares the h5 orientation (pixel MAE 13.9 as-is vs 101 flipped), + so the evaluator's ROT180 is right. The previously reported 0.6015 mismatch does + not reproduce. +* **Policy architecture.** Their concatenation head, their loader and their loss, + trained here for 20k steps, reach val_mse 0.0495 -- the same as our pipeline at + the same budget (0.0471). Their published 0.0032 is reachable only with their + `--train-all` flag, which puts the validation demos into training. + +### Bugs fixed (each alone produced a zero) + +1. `import_file` given an absolute path -- ValueError before any env was built. +2. The featuriser imported from the producer, which does not define it. +3. `RawFeat` left on CPU once it carried a buffer. +4. `offline_score` indexed an empty failure pool on a demos-only cache. +5. `bc_arm` scored before saving, discarding a finished 120k-step run. +6. Launchers ended with `echo`, so crashed jobs exited 0 and every + `--dependency=afterok` eval ran against a checkpoint that was never written. + +## Results with the FIXED evaluator (2026-09-11) + +All runs: 10 tasks x 10 initial states, max 520 steps, chunk 10, executed 10. +Throughput = pooled SR * max_steps / mean_steps. + +| arm | succ/n | pooled SR | thr (succ) | thr (all) | +|---|---|---|---|---| +| reference bcdemos, **our** harness | 53/100 | 0.530 | 0.946 | 0.691 | +| reference bcdemos, **its own** harness | 46/100 | 0.460 | 0.888 | 0.591 | +| **A: BC on demos (ours)** | **58/100** | **0.580** | **1.082** | **0.794** | +| B: BC on successful rollouts | 47/100 | 0.470 | 0.831 | 0.591 | +| C: IQL critic + AWR | 38/100 | 0.380 | 0.607 | 0.443 | +| ablation: A with z-scored input | 1/100 | 0.010 | 0.014 | 0.010 | + +The harness control (0.530 ours vs 0.460 theirs, same weights) confirms this +evaluator is equivalent to the lane's; the 0.07 spread is seed variation at +n=100. + +### The whitening ablation is now clean + +A trained on demonstrations, center-scaled, scores 0.580. The identical run with +per-dim z-scored input scores 0.010. Same data, same head, same budget, same +seed -- only the input scaling differs. Whitening flattens a spectrum whose +per-dim std spans 0.048 to 3.675, shrinking the informative high-variance +directions by up to 34x relative to the median. + +### AWR currently HURTS + +C starts from a BC-on-successes clone (0.470) and IQL-weighted AWR takes it to +0.380. Both critic arms initialised on successes alone, which starts them 0.11 +below the BC-on-demos bar they must clear. `--init-pool demos_succ` now lets both +arms start from demonstrations plus successful rollouts, so the comparison +measures the critic rather than the initialisation. + +## Matched four-arm comparison (2026-09-11, demonstration statistics) + +Every arm: full_demo cache, demo-pool feature statistics, center scaling, the +concatenation flow head, chunk 10, batch 1024, 120k steps, seed 0. The critic +arms start from the SAME behaviour clone as arm A, so the comparison isolates the +improvement signal. + +| arm | succ/n | SR | thr succ / all | +|---|---|---|---| +| **A: BC on demonstrations** | **63/100** | **0.630** | 1.183 / 0.788 | +| B: BC on successful rollouts | 48/100 | 0.480 | 0.807 / 0.596 | +| C: IQL critic + AWR (soft) | 49/100 | 0.490 | 0.839 / 0.615 | +| D: RSM critic + AWR (soft, pessimism 2.0) | running | | | + +Reference: the lane's own bcdemos policy scores 0.530 through this harness and +0.460 through its own. + +### Two normalisation findings worth keeping + +| policy input | SR | +|---|---| +| centred with DEMONSTRATION statistics | 0.630 | +| centred with rollout-dominated statistics | 0.430 | +| per-dim z-scored | 0.010 | + +Centring matters (the mean feature vector has norm 51.1 against a per-frame +deviation of 9.0), WHICH frames the statistics come from matters (the rollout +corpus is a noisier, half-failing distribution), and whitening is catastrophic +(per-dim std spans 0.048 to 3.675, so it shrinks the informative directions up to +34x relative to the median). + +## The critic is the blocker, and it is upstream of the flow + +Held-out within-task action win rate -- how often Q ranks the action actually +taken above another action from the same task -- across every intervention tried: + +| critic | best win rate | +|---|---| +| chunk 10, w_actcon 0.5 (the one deployed) | 0.568 | +| w_actcon 1.0, d_z 512 | 0.532 | +| w_actcon 2.0 | 0.533 | +| inverse dynamics 1.0 | 0.445 | +| inverse dynamics 5.0 | 0.534 | +| deployed critic + pessimism 2.0 (probe) | 0.570 | + +All peak between step 1000 and 2000 and then decay below chance while reward AUC +stays above 0.95. The state value is excellent and the action ranking is near +coin-flip. + +The cause is upstream of the occupancy model. This lane measured that over 5 +frames the executed action correlates with the proprio delta at |r| up to 0.98 +but with the visual-latent delta at only 0.49 (mean 0.10): a mean-pooled +PaliGemma embedding barely resolves the motion a 10-frame chunk produces. Raising +the action-contrastive weight asks the flow to use information the latent does +not carry, which is why 2.0 was worse than 0.5. + +### Every downstream use of that critic fails + +| use | from | to | +|---|---|---| +| AWR, hard weight (IQL) | 0.470 | 0.380 | +| AWR, hard weight (RSM) round 1 | 0.470 | 0.400 | +| AWR, hard weight (RSM) round 2 | 0.470 | 0.290 | +| AWR, soft weight (IQL) | 0.630 | 0.490 | +| Q-filter, 16 candidates (RSM) | 0.630 | 0.510 | + +The hard-weight collapse was a real bug and is fixed: with advantage std ~8 and +beta 3 the exponent saturates, so the "soft" weight became a hard filter on the +sign of a 0.568-accurate critic. Standardising the advantage recovers most of the +loss (IQL 0.380 -> 0.490) but does not turn a coin-flip critic into an +improvement. + +## Where RSM stands (2026-09-11) + +Matched: full_demo cache, demo statistics, center scaling, concatenation flow +head, chunk 10, batch 1024, 120k steps, seed 0. C and D start from the SAME +demonstration clone as A. + +| arm | succ/n | SR | thr succ / all | +|---|---|---|---| +| **A: BC on demonstrations** | **63/100** | **0.630** | 1.183 / 0.788 | +| C: IQL + AWR (soft, pool = successes) | 49/100 | 0.490 | 0.839 / 0.615 | +| B: BC on successful rollouts | 48/100 | 0.480 | 0.807 / 0.596 | +| RSM Q-filter, 16 candidates, on A | 51/100 | 0.510 | - | +| D: RSM + AWR (soft, pessimism 2.0, pool = successes) | 41/100 | 0.410 | 0.802 / 0.513 | + +**RSM does not yet beat the baselines.** Both critic arms move the policy DOWN +from the 0.630 clone they start at, and RSM moves it further down than IQL. + +Chunk 100 was tried because it is the only setting where the critic ranks actions +well (win 0.613 against 0.568 at chunk 10, confirming that over a 10-frame hop the +action barely moves the success probability). It does not rescue the result: BC at +chunk 100 fits far worse (sampled action MSE 0.114 against 0.049) and scores +0.00-0.20 per task over the first six, so the better critic sits on top of a much +weaker policy. + +### What would have to change + +The critic ranks actions at 0.57 and that ceiling survived every intervention: +action-contrastive weight 0.5/1.0/2.0, latent width 512, inverse dynamics 1.0/5.0, +particle pessimism, and chunk/hop length. Reward AUC stays above 0.95 throughout, +so the state value is strong and only the ACTION channel is missing. The measured +cause is upstream: over 5 frames the executed action correlates with the proprio +delta at |r| up to 0.98 but with the visual latent delta at only 0.49 (mean 0.10). +Until the latent carries the action, no read-out on top of it can rank actions, +and every consumer of that ranking -- AWR in two flavours, Q-filtering -- lowers a +good policy instead of raising it. + +## FINAL: all arms, fixed evaluator (2026-09-11) + +10 tasks x 10 initial states, 520-step cap, chunk 10 executed 10. Every arm uses +the same cache, demonstration statistics, center scaling, concatenation flow head, +batch 1024, 120k steps, seed 0. Both critic arms start from the SAME demonstration +clone as arm A, so the only difference is the improvement signal. + +| arm | succ/n | SR | thr succ | thr all | +|---|---|---|---|---| +| **A: BC on demonstrations** | **63/100** | **0.630** | 1.132 | 0.874 | +| reference bcdemos, our harness | 53/100 | 0.530 | 0.946 | 0.691 | +| RSM Q-filter, 16 candidates | 51/100 | 0.510 | 0.951 | 0.668 | +| C: IQL + AWR (demo pool) | 50/100 | 0.500 | 0.963 | 0.658 | +| C: IQL + AWR (success pool) | 49/100 | 0.490 | 0.839 | 0.615 | +| B: BC on successful rollouts | 48/100 | 0.480 | 0.807 | 0.596 | +| D: RSM + AWR (demo pool) | 43/100 | 0.430 | 0.758 | 0.528 | +| D: RSM + AWR (success pool) | 41/100 | 0.410 | 0.802 | 0.513 | + +**The RSM recipe does not beat BC-on-demonstrations, BC-on-successes, or IQL +extraction on this dataset.** Behaviour cloning on the 500 demonstrations wins +outright, and it also beats the published reference through the same harness. + +### The search that was run + +Critic: action-contrastive weight 0.5 / 1.0 / 2.0; latent width 256 / 512; +inverse dynamics 1.0 / 5.0; chunk and hop 10 / 100; particle pessimism 0 to 4. +Extraction: AWR with hard and standardised weights, over the all / success / +demonstration pools, with and without the importance-sampling correction, one and +two rounds, plus deployment-time Q-filtering over 4 and 16 candidates. + +### The single blocker + +Held-out within-task action win rate never exceeds 0.57 at chunk 10 (0.613 at +chunk 100), while reward AUC stays above 0.95. The state value is strong; the +action channel is missing, and it is missing upstream of the occupancy model: over +5 frames the executed action correlates with the proprio delta at |r| up to 0.98 +but with the visual-latent delta at only 0.49 (mean 0.10). A mean-pooled PaliGemma +embedding does not resolve what a 10-frame chunk does. Every consumer of that +ranking therefore lowers a good policy rather than raising it. + +The chunk-100 result is the constructive part: lengthening the action window and +the hop is the one intervention that moved the win rate (0.568 -> 0.613), which +says the horizon, not the read-out, is what starves the signal. Making that +usable needs a policy that is still accurate at a 100-frame chunk; ours loses more +to the longer chunk (sampled action MSE 0.114 vs 0.049) than the critic gains. + +### The ceiling is the ACTION WINDOW, not the hop + +Held-out within-task action win rate, chunk 10 held fixed while the hop varies: + +| chunk | hop (beta_q) | best win | +|---|---|---| +| 10 | 0.90 (~10 frames) | 0.568 | +| 10 | 0.97 (~33 frames) | 0.558 | +| 10 | 0.99 (~100 frames) | 0.551 | +| 100 | 0.99 (~100 frames) | **0.613** | + +Lengthening the hop does nothing; lengthening the ACTION WINDOW is what moves it. +A 10-frame chunk simply does not determine much about the future on this task, so +the ranking ceiling at chunk 10 is a property of the data rather than a modelling +failure. And the policy trades the other way: a chunk-100 policy loses more to the +longer chunk (sampled action MSE 0.114 against 0.049) than the critic gains. + +With this featurisation you can have an accurate policy or a discriminative +critic, not both. That is the finding, and it is what any future attempt on this +corpus has to break. + +## PARL with the RSM value, and the experiment that settles it + +PARL: sample N=32 action chunks from a proposal policy, rank by the RSM Q, keep +the argmax, distill into a fresh head. The recipe's own precondition is that the +proposal's samples must be DIVERSE, because ranking N copies of one action cannot +improve anything. Measured proposal action std against the data's 0.421: + +| proposal | action std | ratio | +|---|---|---| +| BC on demos, 120k steps, best-MSE checkpoint | 0.029 | 0.070 | +| BC on demos, 20k steps | 0.053 | 0.126 | +| the same, sampling temperature 1.5 | 0.103 | 0.244 | +| the same, sampling temperature 2.5 | 0.222 | 0.527 | + +Selecting a checkpoint by best held-out sampled reconstruction MSE picks the most +mean-collapsed one, so the earlier Q-filter run was ranking near-identical +candidates. That is fixed above. + +### The result + +| proposal diversity | PARL SR | +|---|---| +| 0.070 (120k clone) | 0.350 | +| 0.126 | 0.440 | +| 0.244 | 0.230 | +| 0.527 | **0.000** | + +Success falls monotonically as the critic is given more freedom to choose. Every +other factor is fixed: same critic, same N, same distillation, same evaluator. +The only variable is how different the candidates are. If the value function +carried signal, widening the candidate set would help; it destroys the policy +instead, so the ranking is not weak, it is pointed the wrong way. A collapsed +proposal scores near BC simply because selection can do little harm when all 32 +candidates are the same action. + +This is the cleanest isolation of the critic in this lane, and it agrees with the +offline probe: held-out within-task action win rate 0.568, barely above chance, +while reward AUC stays above 0.95. + +Chunk 30 closes the last alternative: BC 0.440, RSM + AWR 0.160, with a critic +that ranks at 0.597. Across all three action windows the same pattern holds. + +| chunk | BC on demos | RSM extraction | critic win rate | +|---|---|---|---| +| 10 | 0.630 | 0.430 | 0.568 | +| 30 | 0.440 | 0.160 | 0.597 | +| 100 | 0.080 | 0.020 | 0.613 | + +A better-ranking critic goes with a worse policy at every size, and the product is +worse than plain behaviour cloning in all three. + +### PARL grid: both knobs point the same way + +| selection rule | T=1.5 (diversity 0.244) | T=2.5 (diversity 0.527) | +|---|---|---| +| Q minus 2 particle std | 0.230 | 0.000 | +| pure expected success | 0.130 | 0.010 | + +Two independent controls, same conclusion. Giving the value more candidates to +choose among makes it worse, and removing the variance penalty -- so that +selection follows the raw value rather than staying near the mode -- makes it +worse again. The penalty was masking the problem by keeping choices close to the +proposal's mode, not by adding information. + +The RSM value's preference over actions is anti-correlated with action quality on +this corpus. That is a stronger and more useful statement than "the critic is +weak", and it is what the offline probe was too blunt to show: a 0.568 win rate +against dataset alternatives is dominated by on-support versus off-support, which +says nothing about ranking a policy's own candidates. diff --git a/gen_q_rsm/rsm_libero/audit_logged_goal.py b/gen_q_rsm/rsm_libero/audit_logged_goal.py new file mode 100644 index 0000000000000000000000000000000000000000..2364662b54d02b29a26149305dc0277149046b78 --- /dev/null +++ b/gen_q_rsm/rsm_libero/audit_logged_goal.py @@ -0,0 +1,93 @@ +"""Is the label wrong, or did the replay diverge? These are different claims. + +Replaying logged actions tests reproducibility; the corpus is documented as NOT +bit-reproducible, so a replay failure does not by itself prove the label is wrong. + +This does the direct test instead and needs no replay: load the episode's LOGGED FINAL +sim_state, restore the simulator to it, and evaluate LIBERO's own goal predicate. +If the predicate is false in the very state the episode ended in, while is_success=1, +the label is wrong -- no nondeterminism can explain it. + +Per-conjunct results are also recorded, which measures how much of a compound task a +"successful" episode actually completed. +""" +import argparse, io, os, re, sys, base64 +import numpy as np +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +SRC = "/data/pulkitag/users/rli14/pi05_lib10_sde_v1" +PAT = re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") + + +def src_parquet(ep_src): + m = PAT.search(str(ep_src)) + if not m: return None + t, b, i, idx = m.groups() + p = (f"{SRC}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + return p if os.path.exists(p) else None + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True); ap.add_argument("--task", type=int, required=True) + ap.add_argument("--out", required=True); ap.add_argument("--limit", type=int, default=0) + ap.add_argument("--save-img", type=int, default=12, help="keep this many final frames of label errors") + args = ap.parse_args() + + import pyarrow.parquet as pq + from libero.libero import benchmark, get_libero_path + from libero.libero.envs.env_wrapper import ControlEnv + from pathlib import Path + + m = np.load(f"{args.cache}/meta.npz", allow_pickle=True) + d, s, task = m["ep_demo"].astype(bool), m["ep_success"].astype(bool), m["ep_task"] + todo = np.where((task == args.task) & s & ~d)[0] + if args.limit: todo = todo[:args.limit] + + bench = benchmark.get_benchmark_dict()["libero_10"]() + t = bench.get_task(args.task) + env = ControlEnv(bddl_file_name=str(Path(get_libero_path("bddl_files")) + / t.problem_folder / t.bddl_file), + has_renderer=False, has_offscreen_renderer=False, use_camera_obs=False) + env.reset() + goal = env.env.parsed_problem["goal_state"] + print(f"[audit] task {args.task}: {len(todo)} logged successes, goal={goal}", flush=True) + + rows, imgs = [], [] + for n, e in enumerate(todo): + p = src_parquet(m["ep_src"][e]) + if p is None: rows.append((int(e), -1, -1, 0)); continue + tb = pq.read_table(p, columns=["sim_state", "is_success", "image"]) + last = tb.num_rows - 1 + st = np.asarray(tb["sim_state"][last].as_py(), np.float64) + env.env.sim.set_state_from_flattened(st) + env.env.sim.forward() + conj = [bool(env.env._eval_predicate(g)) for g in goal] + ok = all(conj) + rows.append((int(e), int(ok), int(sum(conj)), len(conj))) + if not ok and len(imgs) < args.save_img: + imgs.append((int(e), int(sum(conj)), len(conj), + base64.b64encode(tb["image"][last].as_py()["bytes"]).decode())) + if (n + 1) % 50 == 0: + g = [r for r in rows if r[1] >= 0] + print(f"[audit] {n+1}/{len(todo)} goal-holds-at-logged-end " + f"{sum(r[1] for r in g)}/{len(g)}", flush=True) + env.close() + a = np.array([r for r in rows if r[1] >= 0]) + np.savez_compressed(args.out, rows=np.array(rows), task=args.task, + imgs=np.array([i[3] for i in imgs], dtype=object), + img_ep=np.array([i[0] for i in imgs]), + img_sat=np.array([[i[1], i[2]] for i in imgs])) + if len(a): + holds = int(a[:, 1].sum()); tot = len(a) + print(f"[audit] task {args.task}: goal predicate TRUE at the logged final state " + f"for {holds}/{tot} ({holds/tot:.3f}) of logged successes", flush=True) + bad = a[a[:, 1] == 0] + if len(bad): + print(f"[audit] of the {len(bad)} label errors, conjuncts satisfied: " + f"{np.bincount(bad[:, 2], minlength=int(a[0,3])+1).tolist()} " + f"(index = #subgoals met of {int(a[0,3])})", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/audit_logged_goal.sbatch b/gen_q_rsm/rsm_libero/audit_logged_goal.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..c80805de4fa27acd9bf575760baf58bc3f1c3d02 --- /dev/null +++ b/gen_q_rsm/rsm_libero/audit_logged_goal.sbatch @@ -0,0 +1,17 @@ +#!/bin/bash +#SBATCH --job-name=audit_goal +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --array=0-9 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/goalaudit; mkdir -p $OUT +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/audit_logged_goal.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --task $SLURM_ARRAY_TASK_ID --out $OUT/task$SLURM_ARRAY_TASK_ID.npz diff --git a/gen_q_rsm/rsm_libero/autoresearch_driver.py b/gen_q_rsm/rsm_libero/autoresearch_driver.py new file mode 100644 index 0000000000000000000000000000000000000000..d14df344b7ecc8e44e5bb790d64d7a34292f5b98 --- /dev/null +++ b/gen_q_rsm/rsm_libero/autoresearch_driver.py @@ -0,0 +1,78 @@ +"""Autoresearch driver: reads the local JSON mirror, advances stages, launches the next +cells via ibm_autoresearch.sh. Idempotent (state in a JSON file); run it repeatedly.""" +import json, os, subprocess, sys, glob +sys.argv = ["x"]; sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +import ibm_table as T +D = "/data/pulkitag/scratch/rli14/ibm_eval_json"; ST = "/data/pulkitag/scratch/rli14/autoresearch_state.json" +IB = "/proj/dmfexp/zwhong/rsm_libero"; R = f"{IB}/runs/full_r256" +st = json.load(open(ST)) if os.path.exists(ST) else {} +def save(): json.dump(st, open(ST, "w"), indent=1) +def run(*a): return subprocess.run(["./ibm_autoresearch.sh", *a], capture_output=True, text=True, timeout=1800).stdout +cells = T.load(D) +V = {k[0]: v for k, v in cells.items() if k[1] == "DL" and k[4] == "V"} +plain = V.get("plain") +def vs_plain(arm): + if arm not in V or plain is None: return None + r = T.pair(V[arm], plain); return r +print(f"V cells: {len(V)} plain={plain['sr'] if plain else None}") +for arm in sorted(V): + r = vs_plain(arm); print(f" {arm:22} SR {V[arm]['sr']:.3f} thr {V[arm]['thr']:.3f}" + (f" dSR {r['dsr']:+.3f} p={r['p']:.2f}" if r else "")) +# ---- stage 1 -> stage 2 +s1 = [f"RSMb{b}d{d}{pp}" for b in (90, 95, 98) for d in (1, 2, 3) for pp in ("", "p256")] +if "stage2" not in st and all(a in V for a in s1) and plain: + best = max(s1, key=lambda a: (V[a]["sr"], V[a]["thr"])) + b, d = best[4:6], best[7]; pp = "256" if best.endswith("p256") else "16" # RSMbd[p256] + print(f"stage1 complete -> best {best}; launching stage2 at {pp} particles"); os.environ["QFPART"] = pp; print(run("stage2", b, d)) + st["stage2"] = {"beta": b, "depth": d, "part": pp}; save() +# ---- BC checkpoint selection +if "bcsel" not in st: + out = subprocess.run(["ssh", "-o", "BatchMode=yes", "bluevela", f"ls {R}/BCdemo_c/policy_s120000.pt 2>/dev/null"], capture_output=True, text=True, timeout=120).stdout + if "policy_s120000" in out: + print("BCdemo_c finished -> launching bcsel"); print(run("bcsel")); st["bcsel"] = 1; save() +# ---- critic checkpoint selection on V for each finished critic run, then confirm the arg-max on A/B +CB = f"{R}/qsg_f/ckpt_best.pt"; HOP = f"{R}/HOPdemo_f/policy_r1.pt" +b2, d2 = (st["stage2"]["beta"], st["stage2"]["depth"]) if "stage2" in st else ("95", "3") +for crun in ("qsg_bce", "qind_bce", "qsoft_f", "qsg_b90", "qsg_wide"): + key = f"critsel_{crun}" + if key not in st: + done = subprocess.run(["ssh", "-o", "BatchMode=yes", "bluevela", f"grep -q '^\\[rsm\\] DONE' {R}/logs/{crun}.out && ls {R}/{crun}/ckpt_s*.pt 2>/dev/null | wc -l"], capture_output=True, text=True, timeout=120).stdout.strip() + if done and done != "0": + print(f"{crun} finished ({done} periodic ckpts) -> critsel on V"); print(run("critsel", crun, b2, d2)) + st[key] = {"n": int(done)}; save() + elif "confirmed" not in st[key]: + arms = sorted([a for a in V if a.startswith(f"RSMc{crun}S")], key=lambda a: -V[a]["sr"]) + if len(arms) >= st[key]["n"] and arms: + step = arms[0][len(f"RSMc{crun}S"):] + print(f"{crun}: V arg-max checkpoint = step {step} (SR {V[arms[0]]['sr']:.3f}); confirming on A/B x 3 seeds") + env = f"CRITIC={R}/{crun}/ckpt_s{step}.pt, SELECT=argmaxq, HOPPOL={HOP}, QFDEPTH={d2}, QFBETA=0.{b2}, QFILTER=8, QFPES=0, QFGATE=0, QFCRN=1, QFPART=16" + print(run("stage3", f"RSMc{crun}", env, "DL", f"{R}/BCdemo_f/policy_last.pt")) + st[key]["confirmed"] = step; save() +# ---- stage 2 -> stage 3 +if "stage2" in st and "stage3" not in st: + b, d = st["stage2"]["beta"], st["stage2"]["depth"] + s2 = [f"RSMb{b}d{d}{x}" for x in ("n32", "n16", "q90", "q90n32", "near4", "fold", "pes1", "nocrn", "cL")] + [f"RSMb{b}d{d}" + ("p256" if st["stage2"].get("part") == "256" else "")] + pc = sorted([a for a in V if a.startswith("plainC")], key=lambda a: -V[a]["sr"]) + if all(a in V for a in s2) and (("bcsel" in st and pc and len(pc) >= 12) or plain): + top = sorted(s2, key=lambda a: -(V[a]["sr"] + 0.1 * V[a]["thr"]))[:2] + bc_ckpt = f"{R}/BCdemo_c/policy_s{pc[0][6:]}.pt" if pc else f"{R}/BCdemo_f/policy_last.pt" + prop = "DC" if pc else "DL" + print(f"stage2 complete -> confirming {top} on A/B x3 seeds against BC ckpt {bc_ckpt}") + CB = f"{R}/qsg_f/ckpt_best.pt"; HOP = f"{R}/HOPdemo_f/policy_r1.pt" + pp = st["stage2"].get("part", "256") + def env_for(a): + x = a[len(f"RSMb{b}d{d}"):].replace("p256", "") + e = f"CRITIC={CB}, HOPPOL={HOP}, QFDEPTH={d}, QFBETA=0.{b}, QFGATE=0, QFCRN=1, QFPART={pp}, QFPES=0, QFILTER=8, SELECT=argmaxq" + if x == "n32": e = e.replace("QFILTER=8", "QFILTER=32") + if x == "n16": e = e.replace("QFILTER=8", "QFILTER=16") + if x == "q90": e = e.replace("SELECT=argmaxq", "SELECT=quantile, SELQ=0.9") + if x == "q90n32": e = e.replace("SELECT=argmaxq", "SELECT=quantile, SELQ=0.9").replace("QFILTER=8", "QFILTER=32") + if x == "near4": e = e.replace("SELECT=argmaxq", "SELECT=qnear, QNEARK=4") + if x == "fold": e += ", QFMODE=fold" + if x == "pes1": e = e.replace("QFPES=0", "QFPES=1") + if x == "nocrn": e = e.replace("QFCRN=1", "QFCRN=0") + if x == "cL": e = e.replace(CB, f"{R}/qsg_f/ckpt.pt") + return e + for a in top: print(run("stage3", a, env_for(a), prop, bc_ckpt)) + print(run("stage3", "plain", "QFILTER=0", prop, bc_ckpt)) + print(run("stage3", "medoid8", "SELECT=medoid, QFILTER=8, QFDEPTH=1, QFBETA=0.98, QFPES=0, QFGATE=0", prop, bc_ckpt)) + st["stage3"] = {"arms": top, "bc_ckpt": bc_ckpt}; save() diff --git a/gen_q_rsm/rsm_libero/awr.py b/gen_q_rsm/rsm_libero/awr.py new file mode 100644 index 0000000000000000000000000000000000000000..9705795ffc6f20f9dd5453ff4f1125e3bd8c4bfa --- /dev/null +++ b/gen_q_rsm/rsm_libero/awr.py @@ -0,0 +1,275 @@ +"""Policy improvement by advantage-weighted regression on the IS-corrected Q, +and the evaluation <-> improvement loop. + + A(z,A) = Q^pi(z,A) - V(z), V(z) = mean over M chunks drawn from pi itself + loss = -E[ w * log pi(A_data | z) ], w = clip(exp(beta*A), 0, w_max) + +Why this can carry signal where the smolvla run's could not: that critic was fit +on demonstrations only, so Q(demo action) ~= Q(actor's own action) and the mean +absolute advantage was 0.019 -- no gradient. Here half the corpus is failure, so +the advantage has real spread, and the weights are additionally corrected toward +pi by the endpoint ratio rather than left at the behaviour policy's value. + +The loop is deliberately short (2-3 rounds). Each round re-fits the ratio nets, +because the target policy has moved and a stale ratio silently evaluates the +wrong policy -- the notes flag exactly this. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch + +from model import BCHead, FlowPolicy +from data import LiberoRSMData +from is_ope import ( + policy_features, load_critic, train_bc, train_ratio, train_endpoint_ratio, + q_recursive, make_policy, policy_nll) +from train_rsm import auc + + +def awr_step(d, enc, pol, *, rew, flow, rms, wend, args, device, steps, M=4, + pfeat=None, d_policy=None, cont_pol=None): + """One improvement round. Returns a NEW policy; `pol` is left untouched. + + `awr_pool` controls which episodes the regression draws from. Standard AWR + uses ALL data and relies on the advantage to downweight bad actions. Measured + consequence when the advantage is weak: pi_0 was cloned on SUCCESSES, one AWR + round over all data collapsed its success-vs-failure separation from 0.0170 + to 0.00046, and the loss on FAILED chunks improved from 0.1876 to 0.1713 -- + i.e. it walked the policy back toward cloning the full half-failure corpus. + That is the offline echo of this lane's own bcall=0.108 vs bcdemos=0.584. + `awr_pool=succ` restricts the pool so AWR can only sharpen within the slice + pi_0 was fit on, which isolates dilution from genuine improvement.""" + pf = enc if pfeat is None else pfeat + # q_recursive rolls hops through the occupancy model and must re-draw a + # continuation action at each hop CONDITIONED ON THE PREDICTED LATENT z'. + # Once the extracted policy reads raw 4104-d observations it cannot be + # queried there -- there is no observation for a latent the flow imagined. + # `cont_pol` is a small BC policy living in the critic's latent space used + # only inside the recursion; the policy AWR actually improves is `new`. + roll = cont_pol if cont_pol is not None else pol + new = make_policy(args, d, device, d_z=d_policy) + new.load_state_dict(pol.state_dict()) + opt = torch.optim.AdamW(new.parameters(), lr=1e-4, weight_decay=0.01) + rng = np.random.default_rng(args.seed + 11) + stats = [] + _ap = getattr(args, "awr_pool", "all") + for step in range(1, steps + 1): + b = d.sample_frames(args.batch, rng, "train", device) + if _ap != "all": + keep = (b["succ"] > 0.5) if _ap == "succ" else (b["demo"] > 0.5) + if keep.sum() < 8: + continue + b = {k: (v[keep.cpu().numpy()] if isinstance(v, np.ndarray) + else (v[keep] if torch.is_tensor(v) else v)) + for k, v in b.items()} + with torch.no_grad(): + z = enc(b["x"]) # critic latent -> advantage + zp = pf(b["x"]) # policy features -> action head + q_data, _ = q_recursive(z, b["a"], b["task"], rew=rew, flow=flow, rms=rms, + pol=roll, wend=wend, beta=args.beta_q, + gamma=args.gamma, depth=args.depth, + n_particles=args.particles, use_is=args.use_is, + pessimism=args.q_pessimism) + # V(z) = Monte-Carlo baseline over the policy's own chunks + v = torch.zeros_like(q_data) + for _ in range(M): + a_pi = new.sample(zp, b["task"]) + qi, _ = q_recursive(z, a_pi, b["task"], rew=rew, flow=flow, rms=rms, + pol=roll, wend=wend, beta=args.beta_q, + gamma=args.gamma, depth=args.depth, + n_particles=args.particles, use_is=args.use_is, + pessimism=args.q_pessimism) + v += qi + v /= M + adv = q_data - v + # Standardise the advantage before exponentiating. Measured on this + # corpus the raw advantage has std ~8, so at beta=3 the exponent is + # ~24 per standard deviation: every positive sample saturates the + # clip and every negative one underflows to zero. The "soft" weight + # degenerates into a hard sign filter that throws away half the data + # and hands the decision entirely to the critic's sign -- whose + # held-out action win rate is only 0.568. That is why AWR moved the + # IQL arm from 0.470 down to 0.380. Standardising makes beta mean + # what it is supposed to mean: weights span exp(+-beta) per sigma. + if args.adv_norm == "std": + adv = (adv - adv.mean()) / adv.std().clamp_min(1e-6) + w = (args.awr_beta * adv).exp().clamp(0, args.w_max) + w = w / w.mean().clamp_min(1e-6) + # AWR on a flow policy weights the PER-SAMPLE flow-matching loss, since + # a flow head has no tractable log-density. + loss = (w * policy_nll(new, zp, b["task"], b["a"], reduce=False)).mean() + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(new.parameters(), 1.0); opt.step() + if step % 500 == 0: + rec = {"step": step, "loss": float(loss), "mean_abs_adv": float(adv.abs().mean()), + "adv_std": float(adv.std()), "w_max_batch": float(w.max())} + stats.append(rec) + print(f"[awr] {step} loss={rec['loss']:.3f} |adv|={rec['mean_abs_adv']:.4f} " + f"adv_std={rec['adv_std']:.4f} w_max={rec['w_max_batch']:.2f}", flush=True) + new.eval() + return new, stats + + +@torch.no_grad() +def offline_score(d, enc, pol, rng, device, n=4096, pfeat=None): + """Offline proxies, reported together and never individually as a win: + bc_nll_succ : negative log-likelihood of SUCCESSFUL logged chunks + act_gap : how much more likely a success chunk is than a failure chunk + Neither is closed-loop success; they are screens, not the result.""" + ok = np.array([e for e in d.val_eps if d.ep_success[e]], dtype=np.int64) + bad = np.array([e for e in d.val_eps if not d.ep_success[e]], dtype=np.int64) + def nll(pool): + # A demonstrations-only cache has no failures at all, so this pool is + # empty; report nan rather than indexing with an empty float array. + if len(pool) == 0: + return float("nan") + w = d.ep_len[pool].astype(np.float64); w /= w.sum() + e = rng.choice(pool, size=n, p=w) + lo, hi = d.ep_from[e], d.ep_to[e] + t = lo + (rng.random(n) * (hi - lo)).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(device) + a = torch.from_numpy(d._chunk_at(t, e)).to(device) + tk = torch.from_numpy(d.ep_task[e]).long().to(device) + return float(policy_nll(pol, (enc if pfeat is None else pfeat)(x), tk, a)) + s, f = nll(ok), nll(bad) + return {"bc_nll_success": s, "bc_nll_failure": f, "act_gap": f - s} + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--norm-pool", default="all", choices=["all", "demos"], + help="frames the feature statistics come from. demos is worth +0.15 closed-loop over rollout-dominated statistics.") + + ap.add_argument("--q-pessimism", type=float, default=2.0, + help="subtract this many particle standard deviations from Q. " + "Probed on the deployed critic, the held-out within-task " + "action win rate goes 0.549 (0.0) -> 0.570 (2.0).") + + ap.add_argument("--adv-norm", default="std", choices=["std", "none"], + help="standardise the advantage inside the AWR weight. " + "Without it beta is uninterpretable and the weight " + "collapses to a hard sign filter.") + + ap.add_argument("--init-pool", default="succ", + choices=["succ", "demos", "demos_succ", "all"], + help="episodes the pi_0 clone is fit on. Both critic arms must " + "use the SAME value or the comparison measures the initialisation rather than the critic.") + + ap.add_argument("--lr", type=float, default=3e-4) + + ap.add_argument("--feat-scale", default="zscore", choices=["zscore", "center"], + help="how the POLICY sees the observation. zscore matches the " + "lane BC recipe that reaches 0.584; center keeps relative " + "dim importance. Ranked on held-out sampled action MSE, " + "never on the CFM loss.") + + ap.add_argument("--critic", required=True) + ap.add_argument("--policy-features", default="raw", choices=["raw", "latent"], + help="what the POLICY reads. raw = the full 4104-d observation " + "(what a BC baseline sees); latent = the critic's " + "reward-predictive bottleneck, which discards action " + "detail and produced the 0%% closed-loop cliff. The " + "ADVANTAGE always comes from the critic latent either way.") + + ap.add_argument("--out", required=True) + ap.add_argument("--rounds", type=int, default=2) + ap.add_argument("--batch", type=int, default=256) + ap.add_argument("--beta-q", type=float, default=0.98) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--depth", type=int, default=2) + ap.add_argument("--particles", type=int, default=8) + ap.add_argument("--awr-beta", type=float, default=1.0) + ap.add_argument("--w-max", type=float, default=20.0) + ap.add_argument("--awr-steps", type=int, default=4000) + ap.add_argument("--bc-steps", type=int, default=8000) + ap.add_argument("--ratio-steps", type=int, default=4000) + ap.add_argument("--wend-steps", type=int, default=4000) + ap.add_argument("--use-is", type=int, default=1) + ap.add_argument("--chunk", type=int, default=10, + help="MUST match the critic's training chunk; the action\n dim is chunk*7 and a mismatch silently breaks loading") + ap.add_argument("--ratio-chunk", type=int, default=0, + help="action length the IS ratio scores; 0 = same as --chunk. " + "Set to the BEHAVIOUR POLICY decision period (10 for pi0.5). " + "The occupancy may condition on a much longer window; the " + "ratio is a product over DECISIONS and must not.") + ap.add_argument("--success-gamma", type=float, default=0.98, + help="discount for reward-mode=soft: the label is " + "success_gamma ** (frames until success)") + ap.add_argument("--reward-mode", default="dense", choices=["dense","terminal","soft"], + help="dense = P(task succeeds|z), every frame of a success is a " + "positive (~50%%). terminal = last k frames only (~0.5%%), which " + "leaves Q near-constant in the action.") + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--policy-family", default="concat", choices=["concat", "flow", "gauss"]) + ap.add_argument("--awr-pool", default="all", choices=["all", "succ", "demos"], + help="which episodes AWR regresses on; 'succ' isolates dilution") + ap.add_argument("--ratio-smooth", type=float, default=0.0, + help="Gaussian kernel width applied to BOTH action classes before " + "the ratio classifier; buys overlap at the cost of a blurred ratio") + args = ap.parse_args() + args.use_is = bool(args.use_is) + + # Seed torch too, not just numpy: the policy head init and the + # flow-matching noise are torch RNG. Without this two arms meant to + # differ in ONE flag start from different policies -- observed as + # pi_0 separation gaps of 0.0170 (IS on) vs 0.0089 (IS off). + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode, + success_gamma=getattr(args, 'success_gamma', 0.98), + norm_pool=args.norm_pool) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, dev, data=d) + args.d_z = cfg["d_z"] + pfeat, d_pol = policy_features(args, enc, d, cfg, dev) + print(f"[loop] policy reads {args.policy_features} ({d_pol}-d); " + f"advantage reads critic latent ({cfg['d_z']}-d)", flush=True) + rng = np.random.default_rng(args.seed + 23) + + pol = train_bc(d, enc, args, dev, only_success=args.init_pool, steps=args.bc_steps, + pfeat=pfeat, d_policy=d_pol, + resume_path=str(Path(args.out) / 'bc_resume.pt')) + # Continuation policy for the recursion only (critic-latent space). Cheap: + # it never has to be a good controller, only a plausible next-action model + # so the imagined hops stay on the behaviour manifold. + cont_pol = (pol if args.policy_features != "raw" + else train_bc(d, enc, args, dev, only_success=True, + steps=max(args.bc_steps // 6, 2000), + pfeat=enc, d_policy=cfg["d_z"])) + log = {"config": vars(args), "rounds": []} + log["pi_0"] = offline_score(d, enc, pol, rng, dev, pfeat=pfeat) + print(f"[loop] pi_0 {log['pi_0']}", flush=True) + + for r in range(1, args.rounds + 1): + if args.use_is: + # Re-fit every round: the target policy has moved, and a stale ratio + # silently evaluates the wrong policy. + print(f"=== round {r}: re-fit ratio for the CURRENT policy ===", flush=True) + ratio = train_ratio(d, enc, cont_pol, args, dev, steps=args.ratio_steps) + wend = train_endpoint_ratio(d, enc, ratio, args, dev, steps=args.wend_steps) + else: + # q_recursive ignores wend when use_is is False, so fitting it is + # pure waste in the ablation arm. + print(f"=== round {r}: IS off, skipping ratio fit ===", flush=True) + wend = None + pol, stats = awr_step(d, enc, pol, rew=rew, flow=flow, rms=rms, wend=wend, + args=args, device=dev, steps=args.awr_steps, + pfeat=pfeat, d_policy=d_pol, cont_pol=cont_pol) + sc = offline_score(d, enc, pol, rng, dev, pfeat=pfeat) + log["rounds"].append({"round": r, "awr": stats, "score": sc}) + print(f"[loop] round {r} {sc}", flush=True) + torch.save({"pol": pol.state_dict(), "round": r, "config": vars(args)}, + out / f"policy_r{r}.pt") + (out / "loop.json").write_text(json.dumps(log, indent=2)) + print(json.dumps(log["rounds"][-1]["score"], indent=2), flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/bc_arm.py b/gen_q_rsm/rsm_libero/bc_arm.py new file mode 100644 index 0000000000000000000000000000000000000000..7c9addae5d5a56d9f034ff8d930c9ac6842a4df0 --- /dev/null +++ b/gen_q_rsm/rsm_libero/bc_arm.py @@ -0,0 +1,153 @@ +"""Behaviour-cloning arms: the bars an RSM recipe has to clear. + +Two pools, one script: + --pool demos -> A_bc_demos, cloning the 500 human demonstrations. This is the + headline baseline: the lane's own bcdemos bar is 0.584. + --pool succ -> B_bc_succ, cloning the SUCCESSFUL rollouts of the behaviour + policy. This is behaviour-policy extraction with no critic at + all, which is what "RSM adds value" has to beat. + +No critic is loaded when the policy reads raw features, so these arms are +independent of the RSM run and can train in parallel with it. The policy class, +chunk, optimiser and seed are identical to the AWR arms so the only thing that +differs across the four arms is where the improvement signal comes from. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import train_bc, policy_features +from awr import offline_score + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--norm-pool", default="all", choices=["all", "demos"], + help="frames the feature statistics come from. demos is worth +0.15 closed-loop over rollout-dominated statistics.") + + ap.add_argument("--lr", type=float, default=3e-4) + + ap.add_argument("--feat-scale", default="zscore", choices=["zscore", "center"], + help="how the POLICY sees the observation. zscore matches the " + "lane BC recipe that reaches 0.584; center keeps relative " + "dim importance. Ranked on held-out sampled action MSE, " + "never on the CFM loss.") + + ap.add_argument("--out", required=True) + ap.add_argument("--pool", required=True, + choices=["demos", "succ", "rollsucc", "rollsucc_mix", "demos_succ", "all"], + help="rollsucc = successful ROLLOUTS with demos excluded; " + "succ silently includes all 500 demos.") + ap.add_argument("--critic", default="", + help="only needed when --policy-features latent") + ap.add_argument("--policy-features", default="raw", choices=["raw", "latent"]) + ap.add_argument("--policy-family", default="concat", choices=["concat", "flow", "gauss"]) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--pol-width", type=int, default=1024, help="policy MLP width (1024 -> 7.7M params; 3072x8 -> ~90M)") + ap.add_argument("--pol-depth", type=int, default=4) + ap.add_argument("--demo-weight", type=float, default=1.0, + help="sampling weight multiplier for demonstration episodes in a mixed pool") + ap.add_argument("--save-every", type=int, default=0, + help="save policy_s.pt every N steps (checkpoint selection on validation inits)") + ap.add_argument("--bc-steps", type=int, default=30000) + ap.add_argument("--batch", type=int, default=1024) + ap.add_argument("--in-ram", type=int, default=0) + ap.add_argument("--success-gamma", type=float, default=0.98, + help="discount for reward-mode=soft: the label is " + "success_gamma ** (frames until success)") + ap.add_argument("--reward-mode", default="dense", choices=["dense", "terminal", "soft"]) + ap.add_argument("--demos-per-task", type=int, default=5, + help="pool=rollsucc_mix only: demonstrations added per task on top " + "of the rollout successes. 0 reduces to pool=rollsucc.") + ap.add_argument("--success-mask", default="", + help="npz with keep[] from merge_verify.py. Drops logged successes whose replay did not reproduce.") + ap.add_argument("--eps-per-task", type=int, default=0, + help="cap distinct initial conditions per task (0 = all). Each " + "episode is an independent BDDL draw, so this is a direct " + "coverage-density knob at FIXED data quality.") + ap.add_argument("--qfilter-frac", type=float, default=0.0, + help="clone only the top fraction of each oversampled batch " + "by critic advantage (the port's qfilter_frac=0.25). " + "Requires --critic. A third way to use the critic: data " + "selection, not action selection or gradient weighting.") + ap.add_argument("--beta-q", type=float, default=0.98) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--wandb-entity", default=_os.environ.get("RSM_WANDB_ENTITY", ""), + help="W&B entity; '' (default) = no W&B. rsm_rise sets RSM_WANDB_ENTITY via wandb_env.sh.") + ap.add_argument("--wandb-project", default=_os.environ.get("RSM_WANDB_PROJECT", "rsm_rise")) + ap.add_argument("--wandb-name", default="", help="run name (default: basename of --out)") + ap.add_argument("--wandb-mode", default="online", choices=["online", "offline", "disabled"]) + args = ap.parse_args() + + # ---- W&B (same pattern as train_rsm.py: off unless RSM_WANDB_ENTITY is set; run id from --out) ---- + if args.wandb_entity and args.wandb_mode != "disabled": + try: + import wandb, hashlib + import is_ope as _isope + _rid = hashlib.md5(str(Path(args.out).resolve()).encode()).hexdigest()[:16] + _isope.WANDB_RUN = wandb.init(entity=args.wandb_entity, project=args.wandb_project, + name=args.wandb_name or Path(args.out).name, id=_rid, + resume="allow", mode=args.wandb_mode, config=vars(args), + dir=str(Path(args.out))) + print(f"[bc_arm] wandb: {_isope.WANDB_RUN.url}", flush=True) + except Exception as e: + print(f"[bc_arm] wandb disabled: {e}", flush=True) + + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode, + success_gamma=getattr(args, 'success_gamma', 0.98), + norm_pool=args.norm_pool, + success_mask=getattr(args, 'success_mask', '') or '') + + enc, cfg = None, {"d_z": 0} + if args.policy_features == "latent": + if not args.critic: + raise SystemExit("--policy-features latent needs --critic") + from is_ope import load_critic + enc, _r, _f, _rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + args.d_z = cfg["d_z"] + pfeat, d_pol = policy_features(args, enc, d, cfg, dev) + print(f"[bc_arm] pool={args.pool} eps={d.n_ep} chunk={d.chunk} " + f"policy reads {args.policy_features} ({d_pol}-d)", flush=True) + + Path(args.out).mkdir(parents=True, exist_ok=True) + pool = {"demos": "demos", "succ": True, "rollsucc": "rollsucc", + "rollsucc_mix": "rollsucc_mix", + "demos_succ": "demos_succ", "all": False}[args.pool] + pol = train_bc(d, enc, args, dev, only_success=pool, steps=args.bc_steps, + pfeat=pfeat, d_policy=d_pol, + resume_path=str(Path(args.out) / 'bc_resume.pt')) + + # Save FIRST: a defect in the offline proxies must never discard an hour of + # training that already produced a usable policy. + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + torch.save({"pol": pol.state_dict(), "round": 1, "config": vars(args), + "cam_res": getattr(d, "cam_res", "UNKNOWN"), "encoder": getattr(d, "encoder", "pi05_base_pytorch")}, + out / "policy_r1.pt") + rng = np.random.default_rng(args.seed + 23) + sc = offline_score(d, enc, pol, rng, dev, pfeat=pfeat) + sc["sampled_action_mse"] = getattr(pol, "best_sampled_mse", float("nan")) + print(f"[bc_arm] {args.pool} {sc}", flush=True) + (out / "loop.json").write_text(json.dumps( + {"config": vars(args), "pi_0": sc, "rounds": []}, indent=2)) + import is_ope as _isope + if _isope.WANDB_RUN is not None: + try: + _isope.WANDB_RUN.log({f"final/{k}": v for k, v in sc.items() if isinstance(v, (int, float))}) + _isope.WANDB_RUN.finish() + except Exception as e: + print(f"[bc_arm] wandb finish failed: {e}", flush=True) + print("[bc_arm] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/capture_cpu.sbatch b/gen_q_rsm/rsm_libero/capture_cpu.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..7d98b3ed49ab26b28ed51ff90ba1e741f0b7f920 --- /dev/null +++ b/gen_q_rsm/rsm_libero/capture_cpu.sbatch @@ -0,0 +1,32 @@ +#!/bin/bash +#SBATCH --job-name=capfeat +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +# EXACTLY label_subgoals.sbatch's resources. 8 cpus / 40G was CANCELLED by uid 0 +# three seconds in, with no output file ever created -- indistinguishable from a +# crash. groenig nodes are 16 cpu / 64298 MB, so --mem=64G is also rejected outright +# ("Memory specification can not be satisfied"). Do not widen these without testing. +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export REPO_PATH=$B/external/rlinf PYTHONPATH="$B/external/rlinf:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +# CPU rendering: only the FIRST observation of each episode is needed, so there is +# no rollout and no GPU. osmesa is the same backend verify_successes.py used. +export MUJOCO_GL=osmesa PYOPENGL_PLATFORM=osmesa +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +export CUDA_VISIBLE_DEVICES="" +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +$B/venvs/rlinf-libero-eval-venv/bin/python $G/capture_init_feats.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --norm-pool demos --tasks "${TASKS:-0,1,2,3,4,6,7,8,9}" --n-init "${NINIT:-5}" \ + --fresh "${FRESH:-0}" --out "${OUT:?set OUT}" +echo "[cap] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/capture_init_feats.py b/gen_q_rsm/rsm_libero/capture_init_feats.py new file mode 100644 index 0000000000000000000000000000000000000000..8a352429f3a7af7d1c51d63db6e6cd8de788801e --- /dev/null +++ b/gen_q_rsm/rsm_libero/capture_init_feats.py @@ -0,0 +1,88 @@ +"""Capture the evaluator's t=0 feature vector without rolling out. + +The question this answers: are the features the closed-loop evaluator actually +feeds the policy in the DEMO region of the cache or the ROLLOUT region? It decides +whether a critic trained on a 90%-rollout corpus is read on-support at eval time. + +Only the first observation of each episode is needed, so no policy and no GPU are +required -- reset, one zero step, encode, done. Uses the SAME featurization path as +eval_closed_loop.py (to224 quantisation, axis-angle proprio, cache normalisation); +any deviation would make the comparison meaningless. +""" +from __future__ import annotations +import argparse, importlib.util, sys, os +from pathlib import Path +import numpy as np +import torch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from eval_closed_loop import to224, _eef_ori, BUILDER # identical transforms + +_spec = importlib.util.spec_from_file_location("ogpo_cap", BUILDER) +ogpo = importlib.util.module_from_spec(_spec) +sys.modules["ogpo_cap"] = ogpo +_spec.loader.exec_module(ogpo) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True, help="cache whose feat stats the policy used") + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--tasks", default="0,1,2,3,4,6,7,8,9") + ap.add_argument("--n-init", type=int, default=5) + ap.add_argument("--fresh", type=int, default=0) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--out", required=True) + args = ap.parse_args() + + dev = "cuda" if torch.cuda.is_available() else "cpu" + print(f"[cap] device {dev}", flush=True) + tower = ogpo.build_paligemma(dev) + from libero.libero import benchmark, get_libero_path + from libero.libero.envs import OffScreenRenderEnv + bench = benchmark.get_benchmark_dict()["libero_10"]() + + sname = "feat_stats.npz" if args.norm_pool == "all" else f"feat_stats_{args.norm_pool}.npz" + st = np.load(str(Path(args.cache) / sname)) + nmu = torch.tensor(st["mu"], dtype=torch.float32, device=dev) + nsd = torch.tensor(st["sd"], dtype=torch.float32, device=dev) + print(f"[cap] normalisation {sname} dim={int(st['dim'])}", flush=True) + + tasks, feats = [], [] + for tid in [int(t) for t in args.tasks.split(",")]: + task = bench.get_task(tid) + ids = ogpo.tokenize_prompt(task.language) + inits = bench.get_task_init_states(tid) + env = OffScreenRenderEnv( + bddl_file_name=str(Path(get_libero_path("bddl_files")) + / task.problem_folder / task.bddl_file), + camera_heights=128, camera_widths=128) + for k in range(args.n_init): + np.random.seed(args.seed * 100003 + tid * 1009 + k) + if hasattr(env, "seed"): + env.seed(args.seed * 100003 + tid * 1009 + k) + env.reset() + if not args.fresh: + env.set_init_state(inits[k % len(inits)]) + obs, _, _, _ = env.step(np.zeros(7)) + cams = [] + for key in ("agentview_image", "robot0_eye_in_hand_image"): + cams.append(to224(obs[key][::-1, ::-1])[None]) + z = np.concatenate( + [ogpo.encode_frames(tower, c, ids, dev, 2) for c in cams], axis=1)[0] + prop = np.concatenate([ + obs["robot0_eef_pos"], _eef_ori(obs), obs["robot0_gripper_qpos"], + ]).astype(np.float32) + x = torch.tensor(np.concatenate([z, prop])[None], dtype=torch.float32, device=dev) + x = (x - nmu) / nsd + tasks.append(tid); feats.append(np.asarray(x[0].cpu(), np.float32)) + print(f"[cap] task {tid} init {k}: |x|={float(x.norm()):.2f}", flush=True) + env.close() + np.savez_compressed(args.out, task=np.array(tasks), x=np.stack(feats), + norm_pool=args.norm_pool, fresh=args.fresh) + print(f"[cap] wrote {len(tasks)} features -> {args.out}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/crn_diag.py b/gen_q_rsm/rsm_libero/crn_diag.py new file mode 100644 index 0000000000000000000000000000000000000000..dfb5f48d034ff6fea75e08af0b8c32fe050b50e7 --- /dev/null +++ b/gen_q_rsm/rsm_libero/crn_diag.py @@ -0,0 +1,58 @@ +"""Does the Q arg-max over N near-copy candidates track the critic or the Monte-Carlo +noise? Score the same N candidates twice with fresh seeds, with independent draws and +with common random numbers (crn), and report arg-max agreement and the ratio of +between-candidate Q spread to between-seed Q noise. CPU/GPU, no env. +usage: crn_diag.py --critic ckpt --policy proposer.pt --hop hop.pt [--depth 3] [--n 8] [--states 200] +""" +import argparse, numpy as np, torch +from data import LiberoRSMData +from is_ope import load_critic, q_recursive, make_policy +from eval_closed_loop import load_policy, _resolve_cache + +ap = argparse.ArgumentParser() +ap.add_argument("--critic", required=True); ap.add_argument("--policy", required=True) +ap.add_argument("--hop", default=""); ap.add_argument("--depth", type=int, default=3) +ap.add_argument("--n", type=int, default=8); ap.add_argument("--states", type=int, default=200) +ap.add_argument("--particles", type=int, default=16); ap.add_argument("--beta", type=float, default=0.98) +a = ap.parse_args() +dev = "cuda" if torch.cuda.is_available() else "cpu" +pcfg = torch.load(a.policy, map_location="cpu", weights_only=False)["config"] +d = LiberoRSMData(_resolve_cache(pcfg["cache"]), chunk=pcfg.get("chunk", 10), seed=0, in_ram=False, + reward_mode="dense", norm_pool=pcfg.get("norm_pool", "all")) +pfeat, pol, chunk, ccfg, pmode, d_lat, _ = load_policy(a.critic, a.policy, d.n_task, dev) +q_enc, q_rew, q_flow, q_rms, q_cfg = load_critic(a.critic, d.feat_dim, d.n_task, dev, data=d) +hop = None +if a.depth >= 2: + hk = torch.load(a.hop, map_location=dev, weights_only=False) + hop = make_policy(hk["config"], d, dev, d_z=q_cfg["d_z"]); hop.load_state_dict(hk["pol"]); hop.eval() +rng = np.random.default_rng(0) +# demo frames from the pool the proposer was trained on +eps = np.where(d.ep_demo)[0]; rows = [] +tasks = [] +for e in rng.choice(eps, size=a.states, replace=True): + s, l = int(d.ep_from[e]), int(d.ep_len[e]); rows.append(s + int(rng.integers(0, max(1, l - chunk)))); tasks.append(int(d.ep_task[e])) +agree = {0: [], 1: []}; ratio = {0: [], 1: []}; agree_x = [] +with torch.no_grad(): + for i, ti in zip(rows, tasks): + x = torch.as_tensor(d._feat(i)[None], device=dev).float(); tt = torch.tensor([ti], device=dev) + torch.manual_seed(1234 + i) + cand = pol.sample(pfeat(x).expand(a.n, -1), tt.expand(a.n)) + z = q_enc(x).expand(a.n, -1) + qs = {} + for crn in (0, 1): + out = [] + for seed in (1, 2): + torch.manual_seed(seed) + q, _ = q_recursive(z, cand, tt.expand(a.n), rew=q_rew, flow=q_flow, rms=q_rms, pol=hop, + wend=None, beta=a.beta, gamma=0.99, depth=a.depth, n_particles=a.particles, + use_is=False, crn=bool(crn)) + out.append(q.cpu().numpy()) + q1, q2 = out; qs[crn] = (q1, q2) + agree[crn].append(float(q1.argmax() == q2.argmax())) + spread = 0.5 * (q1.std() + q2.std()); noise = np.abs(q1 - q2).mean() / np.sqrt(2) + ratio[crn].append(spread / max(noise, 1e-9)) + agree_x.append(float(qs[0][0].argmax() == qs[1][0].argmax())) +for crn in (0, 1): + print(f"crn={crn}: argmax agreement across seeds {np.mean(agree[crn]):.3f} " + f"median (between-candidate spread / between-seed noise) {np.median(ratio[crn]):.2f}") +print(f"chance agreement = {1/a.n:.3f}; independent-vs-crn argmax agreement {np.mean(agree_x):.3f}") diff --git a/gen_q_rsm/rsm_libero/data.py b/gen_q_rsm/rsm_libero/data.py new file mode 100644 index 0000000000000000000000000000000000000000..8b3d1f9cfec761e98110370df22480890275be98 --- /dev/null +++ b/gen_q_rsm/rsm_libero/data.py @@ -0,0 +1,428 @@ +"""Batch sampling over the packed LIBERO-10 rollout cache.""" +from __future__ import annotations +from pathlib import Path +import json as _json # was only imported inside the cam_res loop below, so the encoder + # tag lookup (which runs first) always hit NameError and kept the + # legacy default; importing it here makes PACK.json's encoder tag load +import numpy as np +import torch + + +def truncated_geometric_future(rows, ep_ends, discounts, uniforms): + """Ported verbatim from gen_q ogbench_genq/rsm.py (via the CLM fast-critic port). + + Draws k ~ Geom(1-discount) truncated to the episode end, so the sampled future + is always a REAL logged frame -- the Monte-Carlo occupancy target with no + bootstrap anywhere. + """ + length = (ep_ends - rows) + log_d = np.log(discounts) + finite_mass = np.maximum(1.0 - np.exp(length * log_d), 1e-12) + offset = np.ceil(np.log1p(-uniforms * finite_mass) / log_d).astype(np.int64) - 1 + offset = np.clip(offset, 0, length - 1) + return rows + offset + + +class LiberoRSMData: + def __init__(self, root, chunk: int = 10, k_success: int = 10, + val_frac: float = 0.1, seed: int = 0, in_ram: bool = True, + success_mask: str = "", + subgoal_dir: str = "", + reward_mode: str = "dense", success_gamma: float = 0.98, + reward_npy: str = "", + weight_npy: str = "", + normalize: bool = True, + norm_pool: str = "all", + stratify_success: bool = False): + root = Path(root) + self.root = root + m = np.load(root / "meta.npz", allow_pickle=True) + self.z = np.load(root / "z.f16.npy", mmap_mode="r") + self.act = np.load(root / "act.f32.npy", mmap_mode="r") + pp = root / "proprio.f32.npy" + self.proprio = np.load(pp, mmap_mode="r") if pp.exists() else None + # Measured on this corpus: over 5 frames the executed action correlates + # with the PROPRIO delta at max |r| 0.98, but with the visual-latent delta + # at only 0.49 (mean 0.10). A mean-pooled PaliGemma embedding barely + # resolves the motion a 10-step chunk produces, which is why the occupancy + # could rank states (0.66-0.69 AUC) but never actions (~chance pooled). + # Concatenating proprio puts the action-sensitive channel INTO the latent + # the successor has to predict. + self.use_proprio = self.proprio is not None + if in_ram: + # training draws ~512 RANDOM rows per step; over NFS that is 512 + # separate 8 kB reads and caps throughput at a few it/s. The cache is + # small enough to hold, so pull it in once. + gb = self.z.nbytes / 1e9 + print(f"[data] loading {gb:.1f} GB of latents into RAM", flush=True) + self.z = np.ascontiguousarray(self.z) + self.act = np.ascontiguousarray(self.act) + if self.proprio is not None: + self.proprio = np.ascontiguousarray(self.proprio) + self.ep_from = m["ep_from"]; self.ep_to = m["ep_to"]; self.ep_len = m["ep_len"] + self.ep_task = m["ep_task"]; self.ep_success = m["ep_success"] + # ADMISSIBILITY (see CLAUDE.md): a logged success whose actions do not + # reproduce in the eval environment is not a success here. Applied before any + # reward is built, so the critic never sees a progress curve toward an event + # that will not occur in the environment it is scored in. + if success_mask: + _keep = np.load(success_mask)["keep"].astype(bool) + _n0 = int(self.ep_success.sum()) + self.ep_success = self.ep_success.astype(bool) & _keep + print(f"[data] admissibility mask: {_n0} -> {int(self.ep_success.sum())} " + f"successes ({_n0-int(self.ep_success.sum())} dropped as " + f"non-reproducing)", flush=True) + self.ep_demo = m["ep_demo"] if "ep_demo" in m else np.zeros(len(self.ep_task), bool) + # Declared render resolution of the latents (RENDER.json, else PACK.json). Stored + # into every checkpoint config so the evaluator can refuse a mismatch (i251). + self.cam_res = "UNKNOWN" + self.encoder = "pi05_base_pytorch" # legacy caches predate the tag + for _f in ("PACK.json", "RENDER.json"): + try: + _e = _json.load(open(f"{root}/{_f}")).get("encoder") + if _e: self.encoder = _e; break + except Exception: + pass + for _f in ("RENDER.json", "PACK.json"): + try: + _v = _json.load(open(f"{root}/{_f}")).get("cam_res") + if _v is not None: + self.cam_res = _v; break + except Exception: + pass + self.tasks = [str(t) for t in m["tasks"]] + self.dim = int(m["dim"]); self.adim = int(m["adim"]) + self.chunk = chunk; self.k_success = k_success + self.n_task = len(self.tasks) + self.n_ep = len(self.ep_len) + + # episode-level split: adjacent frames cannot leak across the boundary + rng = np.random.default_rng(seed) + n_val = max(1, int(val_frac * self.n_ep)) + if stratify_success: + # STRATIFY ON ep_success (gen_q#261). An unstratified 10% split of the real cooking + # corpus put 2 of the 50 rewarded episodes in val. Under a sparse reward label that is + # 80 positive val frames, so a 256-anchor val eval draws well under one positive and the + # printed `val auc` is noise rather than evidence (measured: 0.9960 sampled vs 0.9983 + # over the exact full split). Holding out the SAME FRACTION of rewarded and unrewarded + # episodes makes a held-out reward metric estimable at all. Off by default so every + # existing run's split is bit-identical. + _s = np.asarray(self.ep_success, bool) + _parts = [] + for _grp in (np.nonzero(_s)[0], np.nonzero(~_s)[0]): + if len(_grp) == 0: + continue + _pg = _grp[rng.permutation(len(_grp))] + _k = max(1, int(round(val_frac * len(_grp)))) if len(_grp) > 1 else 0 + _parts.append(_pg[:_k]) + self.val_eps = np.sort(np.concatenate(_parts)) if _parts else np.array([], np.int64) + self.train_eps = np.sort(np.setdiff1d(np.arange(self.n_ep), self.val_eps)) + print(f"[data] success-stratified split: {len(self.val_eps)} val " + f"({int(_s[self.val_eps].sum())} rewarded) / {len(self.train_eps)} train " + f"({int(_s[self.train_eps].sum())} rewarded)", flush=True) + else: + perm = rng.permutation(self.n_ep) + self.val_eps = np.sort(perm[:n_val]) + self.train_eps = np.sort(perm[n_val:]) + + # Feature normalisation (see _feat for why this matters). + self.norm_mu = self.norm_sd = None + self.z_clip = 0.0 # set from feat_stats.npz (rsm_rise caches store z_clip=10) + self.norm_pool = norm_pool + if normalize: + self._fit_norm() + + # Per-frame reward label. + # + # "terminal": 1 on the last k frames of successful episodes. SPARSE -- + # positives are ~0.5% of frames, so nearly every sampled future reads ~0, + # Q is near-constant in the action, and there is nothing to rank. This is + # the likely reason action ranking stayed near chance. + # + # "dense": 1 on EVERY frame of a successful episode, i.e. P(episode + # succeeds | z). Dense and well-posed, but it is an OUTCOME predictor and + # carries almost no action information: a supervised Q(z,a) beats a + # state-only V(z) by AUC 0.9550 vs 0.9539 (+0.0012). Whether an episode + # succeeds is a property of the state, not of the next 10 frames. + # + # "soft" (RECOMMENDED): gamma_s ** (frames until this episode's success), + # and 0 for episodes that never succeed. Both binary labels above are + # FLAT in the sense that matters -- neither varies with PROGRESS, so + # moving one chunk closer to the goal does not change the target, and an + # action therefore cannot move the value. The soft label is monotone in + # time-to-success, so it does. This is the fix the OCBench port + # identifies for exactly this symptom: its binary `indicator` target + # leaves the readout ~0 on almost every state (q_mean 0.02-0.07, "so the + # Q is flat") while the soft target raises q_mean to ~0.43 and "makes the + # readout vary with progress". + self.r = np.zeros(int(self.ep_to[-1]), dtype=np.float32) + # PER-FRAME REWARD-LOSS WEIGHT (gen_q #271 scheme C). A float32 [n_frames] array of + # non-negative sample weights for the reward BCE ONLY; 1.0 everywhere when unset, so the + # loss is bit-identical to the unweighted path. Scheme C puts w_neg on the frames whose + # reached_state_id is a failure terminal (S5/S6) to make them hard negatives. + self.w = None + if weight_npy: + _wv = np.load(weight_npy).astype(np.float32).ravel() + assert len(_wv) == len(self.r), (len(_wv), len(self.r)) + assert (_wv >= 0).all(), "negative reward-loss weight" + self.w = _wv + print(f"[data] reward-loss weights {weight_npy}: mean w={self.w.mean():.4f}, " + f"{int((self.w != 1.0).sum())} reweighted frames of {len(self.w)}", flush=True) + if reward_npy: + # EXTERNAL PER-FRAME REWARD (rsm_rise #261 reward-head study). A float32 array of + # exactly n_frames entries replaces every rule above, so a label defined outside this + # file (e.g. the goal-transition label from the dataset's own per-frame stage + # annotations, scripts/real/make_goal_reward.py) is trained with a bit-identical + # pipeline to the provenance label. Nothing else changes. + _rv = np.load(reward_npy).astype(np.float32).ravel() + assert len(_rv) == len(self.r), (len(_rv), len(self.r)) + self.r[:] = _rv + print(f"[data] external reward {reward_npy}: mean r={self.r.mean():.6f}, " + f"{int((self.r > 0).sum())} positive frames of {len(self.r)}", flush=True) + return + if reward_mode in ("subgoal", "subgoal_ind"): + # r(s) = satisfied BDDL conjuncts / K. A genuine function of the state: + # identical configurations get identical targets, and every frame of every + # episode is labelled -- including failures, which under the soft label + # contributed only zeros (50.5% of the corpus, no gradient at all). + import glob as _g + n_lab = 0 + for _f in sorted(_g.glob(f"{subgoal_dir}/task*.npz")): + _z = np.load(_f, allow_pickle=True) + _K = int(_z["K"]) + for _e, _v in zip(_z["ep"], _z["vals"]): + _a, _b = int(self.ep_from[_e]), int(self.ep_to[_e]) + _v = np.asarray(_v, np.float32) + _v[_v < 0] = 0.0 # unresolvable -> no credit + _val = (_v >= _K).astype(np.float32) if reward_mode == "subgoal_ind" \ + else _v / max(_K, 1) + self.r[_a:_a + min(len(_val), _b - _a)] = _val[:_b - _a] + n_lab += 1 + # demonstrations complete the task by construction + for _i in np.where(self.ep_demo)[0]: + self.r[int(self.ep_from[_i]):int(self.ep_to[_i])] = 1.0 + print(f"[data] {reward_mode} reward: {n_lab} rollouts labelled from " + f"{subgoal_dir}, mean r={self.r.mean():.4f}", flush=True) + return + for i in range(self.n_ep): + if not self.ep_success[i]: + continue + lo, hi = int(self.ep_from[i]), int(self.ep_to[i]) + if reward_mode == "dense": + self.r[lo:hi] = 1.0 + elif reward_mode == "soft": + # discounted time-to-success, measured from the last frame + n = hi - lo + self.r[lo:hi] = (success_gamma + ** np.arange(n - 1, -1, -1, dtype=np.float64) + ).astype(np.float32) + else: + self.r[max(lo, hi - k_success):hi] = 1.0 + + def _feat(self, idx): + """Observation every head sees: visual latent, optionally with proprio, + z-scored per dimension. + + Normalisation is not cosmetic here. Measured on this corpus, the mean + feature vector has norm 51.1 while the per-frame deviation from it has + norm 9.0 -- 85% of the input magnitude is a constant offset carrying no + information, and the per-dim |mean|/std ratio is 3.14 median / 8.0 at p90. + Fed raw, the informative variation is a small perturbation riding on a + large common mode, which is exactly the conditioning an MLP handles + worst. Proprio is worse still: its per-dim std spans 0.014 to 1.372, so + the gripper channel is invisible next to the wrist angle. + + Stats are computed once and cached in the cache directory so that + training and the closed-loop evaluator apply the IDENTICAL transform; a + policy evaluated under different statistics is off-distribution and + indistinguishable from a bad policy.""" + z = np.asarray(self.z[idx], np.float32) + if self.proprio is not None: + z = np.concatenate([z, np.asarray(self.proprio[idx], np.float32)], -1) + if self.norm_mu is None: + return z + z = (z - self.norm_mu) / self.norm_sd + # rsm_rise STATE DEFINITION: x = clip((feat - mu) / max(sd, sd_floor), -z_clip, z_clip). + # A GeM channel whose patch tokens are almost always negative collapses to the 1e-6 + # clamp on nearly every frame (sd ~1e-3) and then takes |x| = 30-70 on the few frames + # where it is not; the flow is queried far off-support on those rows and the val + # min-MSE read 2e5 (mug M, step 5000). z_clip comes from feat_stats.npz (0 = off). + if self.z_clip: + z = np.clip(z, -self.z_clip, self.z_clip, out=z) + return z + + def _fit_norm(self, stride=97): + """Per-dim mean/std over a strided pass, cached next to the data. + + `norm_pool` selects WHICH frames the statistics come from, and it matters + a great deal. Measured: behaviour cloning on demonstrations scores 0.580 + closed-loop when centred with demonstration statistics and 0.430 with + statistics dominated by the 4500 rollout episodes -- same policy, same + data, same budget. The rollout corpus is a different distribution (a + noisy pi0.5 with SDE noise 0.5, half of it failures), so its mean is the + wrong origin for a policy that acts like a demonstrator. + """ + tag = "" if self.norm_pool == "all" else f"_{self.norm_pool}" + f = self.root / f"feat_stats{tag}.npz" + if f.exists(): + c = np.load(f) + if int(c["dim"]) == self.feat_dim: + self.norm_mu, self.norm_sd = c["mu"], c["sd"] + self.z_clip = float(c["z_clip"]) if "z_clip" in c.files else 0.0 + print(f"[data] feature normalisation loaded from {f.name}" + f" (sd min {float(self.norm_sd.min()):.1e}, z_clip {self.z_clip})", flush=True) + return + if self.norm_pool == "demos": + keep = np.zeros(len(self.z), bool) + for e in np.where(self.ep_demo)[0]: + keep[self.ep_from[e]:self.ep_to[e]] = True + idx = np.where(keep)[0][::max(1, stride // 8)] + else: + idx = np.arange(0, len(self.z), stride) + x = np.asarray(self.z[idx], np.float32) + if self.proprio is not None: + x = np.concatenate([x, np.asarray(self.proprio[idx], np.float32)], -1) + mu = x.mean(0) + sd = np.maximum(x.std(0), 1e-3) # floor: a dead dim must not be amplified + self.norm_mu, self.norm_sd = mu.astype(np.float32), sd.astype(np.float32) + try: + np.savez(f, mu=self.norm_mu, sd=self.norm_sd, dim=self.feat_dim, + n=len(idx)) + print(f"[data] feature normalisation fitted on {len(idx)} frames " + f"-> {f.name}", flush=True) + except OSError as e: # read-only cache dir: still normalise in-process + print(f"[data] normalisation fitted but not cached ({e})", flush=True) + + @property + def feat_dim(self): + return self.dim + (0 if self.proprio is None else self.proprio.shape[1]) + + def _chunk_at(self, idx, ep_i, chunk_len=None): + """Flattened next-`chunk_len` executed actions, padded by repeating the last. + + `chunk_len` defaults to the occupancy conditioning window, but the IS + ratio must use the BEHAVIOUR POLICY'S DECISION granularity instead. The + notes define W as a product over interior DECISIONS; pi0.5 re-decided + every 10 frames. Scoring 100-frame windows makes the two policies + perfectly separable (classifier acc 1.000 at 700 dims vs 0.934 at 70), + which destroys the ratio the correction needs. + """ + cl = self.chunk if chunk_len is None else chunk_len + idx = np.asarray(idx, np.int64); ep_i = np.asarray(ep_i, np.int64) + if isinstance(self.act, np.ndarray) and not isinstance(self.act, np.memmap): + # in-RAM fast path (same result as the loop below): frames past the episode + # end are clamped to its last frame, which IS "pad by repeating the last + # action". At batch 4096 the Python loop was the step-time bottleneck. + fr = idx[:, None] + np.arange(cl)[None, :] + fr = np.minimum(fr, self.ep_to[ep_i][:, None] - 1) + return np.asarray(self.act[fr], np.float32).reshape(len(idx), cl * self.adim) + out = np.empty((len(idx), cl * self.adim), np.float32) + for j, (t, e) in enumerate(zip(idx, ep_i)): + hi = int(self.ep_to[e]) + take = min(cl, hi - t) + a = np.asarray(self.act[t:t + take], np.float32) + if take < cl: + a = np.concatenate([a, np.repeat(a[-1:], cl - take, 0)], 0) + out[j] = a.reshape(-1) + return out + + def sample(self, batch: int, rng, beta_lo: float, beta_hi: float, + split: str = "train", device="cuda", beta_trunc_eps: float = 0.02, + with_next: bool = False): + eps_pool = self.train_eps if split == "train" else self.val_eps + w = self.ep_len[eps_pool].astype(np.float64); w /= w.sum() + e = rng.choice(eps_pool, size=batch, p=w) + lo = self.ep_from[e]; hi = self.ep_to[e] + t = lo + (rng.random(batch) * (hi - lo)).astype(np.int64) + # BETA MEANS ONE THING (gen_q#262). k ~ Geom(1-beta) is truncated at the episode end, and + # E[k | k beta_cap = eps**(1/L) + # Anchors with a long remaining horizon (a full episode from its initial condition) get the + # whole band; short-remaining anchors get a correspondingly narrower one, because a + # long-horizon target genuinely does not exist there. + L = np.maximum(hi - t, 1).astype(np.float64) + beta_cap = np.power(beta_trunc_eps, 1.0 / L) + beta_hi_eff = np.clip(beta_cap, beta_lo, beta_hi) + beta = beta_lo + rng.random(batch) * (beta_hi_eff - beta_lo) + fut = truncated_geometric_future(t, hi, beta, rng.random(batch)) + + x_now = torch.from_numpy(self._feat(t)).to(device) + x_fut = torch.from_numpy(self._feat(fut)).to(device) + a_now = torch.from_numpy(self._chunk_at(t, e)).to(device) + out = { + "x_now": x_now, "x_fut": x_fut, "a_now": a_now, + "task": torch.from_numpy(self.ep_task[e]).long().to(device), + "beta": torch.from_numpy(beta).float().to(device), + "r_now": torch.from_numpy(self.r[t]).to(device), + "r_fut": torch.from_numpy(self.r[fut]).to(device), + "succ": torch.from_numpy(self.ep_success[e].astype(np.float32)).to(device), + "demo": torch.from_numpy(self.ep_demo[e].astype(np.float32)).to(device), + "t_idx": t, "ep": e, "fut_idx": fut, + } + if self.w is not None: + out["w_now"] = torch.from_numpy(self.w[t]).to(device) + if with_next: + # TD-FLOW (gen_q#268). The Bellman right-hand side of the occupancy identity + # m_beta(. | s,a) = (1-beta) P(. | s,a) + beta E_{s'}[ m_beta(. | s', pi(s')) ] + # needs the ONE-STEP successor s' and the action the behaviour policy takes there. + # This lane fits the occupancy of the DATASET policy (train_rsm.py has no actor), so + # a' is the logged chunk at t+1 -- exactly the analogue of a' = pi(s') for the policy + # the Monte-Carlo path already integrates along. + # Clamped to hi-1, i.e. the terminal frame is its own successor; the mixture coin is + # drawn per row in train_rsm.py, so a terminal anchor that takes the bootstrap branch + # bootstraps from itself rather than from a frame of the next episode. + # NOTHING here draws from `rng`: with with_next=False (the default) this block does not + # run at all, and with it True the MC draws above are bit-for-bit unchanged. + nxt = np.minimum(t + 1, hi - 1) + out["x_next"] = torch.from_numpy(self._feat(nxt)).to(device) + out["a_next"] = torch.from_numpy(self._chunk_at(nxt, e)).to(device) + out["r_next"] = torch.from_numpy(self.r[nxt]).to(device) + out["next_idx"] = nxt + return out + + def goal_pool(self): + """Terminal latents of SUCCESSFUL episodes, per task -- the goal set the + two-tower likelihood scores against. Built once; index by task id.""" + if getattr(self, "_gpool", None) is None: + pool = {} + for i in range(self.n_ep): + if not self.ep_success[i]: + continue + hi = int(self.ep_to[i]) + pool.setdefault(int(self.ep_task[i]), []).extend( + range(max(int(self.ep_from[i]), hi - self.k_success), hi)) + self._gpool = {k: np.array(v, np.int64) for k, v in pool.items()} + return self._gpool + + def sample_goals(self, task_ids, rng, device="cuda"): + """One goal latent per row, drawn from that row's task's terminal states.""" + gp = self.goal_pool() + idx = np.empty(len(task_ids), np.int64) + for j, ti in enumerate(np.asarray(task_ids)): + c = gp.get(int(ti)) + idx[j] = rng.choice(c) if c is not None and len(c) else 0 + return torch.from_numpy(self._feat(idx)).to(device) + + def sample_frames(self, batch: int, rng, split="train", device="cuda"): + """(x, action chunk, task, reward, success) with no future -- for the + reward head, the ratio classifier and behavior cloning.""" + eps_pool = self.train_eps if split == "train" else self.val_eps + w = self.ep_len[eps_pool].astype(np.float64); w /= w.sum() + e = rng.choice(eps_pool, size=batch, p=w) + lo = self.ep_from[e]; hi = self.ep_to[e] + t = lo + (rng.random(batch) * (hi - lo)).astype(np.int64) + return { + "to_end": torch.from_numpy((hi - t).astype(np.float32)).to(device), + "x": torch.from_numpy(self._feat(t)).to(device), + "a": torch.from_numpy(self._chunk_at(t, e)).to(device), + "task": torch.from_numpy(self.ep_task[e]).long().to(device), + "r": torch.from_numpy(self.r[t]).to(device), + "succ": torch.from_numpy(self.ep_success[e].astype(np.float32)).to(device), + "demo": torch.from_numpy(self.ep_demo[e].astype(np.float32)).to(device), + "t_idx": t, "ep": e, + } diff --git a/gen_q_rsm/rsm_libero/dinowm_readout.py b/gen_q_rsm/rsm_libero/dinowm_readout.py new file mode 100644 index 0000000000000000000000000000000000000000..de002130732e9d8d3dfae3599a34ce4613fbb743 --- /dev/null +++ b/gen_q_rsm/rsm_libero/dinowm_readout.py @@ -0,0 +1,129 @@ +"""DINO-WM read-out: the same best-of-N scorer interface as dwm_readout, with DINO-WM's dynamics. + +gen_q#268. The single-actor flagship asks one question -- "same RISE actor, same 128 candidates, +same provenance reward, only the value estimator changes" -- so a world-model comparator is only +worth running if it differs from RSM/DWM in the MODEL and in nothing else. That is why this module +is 60 lines instead of 600: `DINOWMCritic` SUBCLASSES `dwm_readout.DWMCritic` and overrides exactly +two methods, the transition and the hop length. The fold algebra, the hop-policy chaining, the +reward head, the token normaliser, the temperature calibration and the two-stage rescore are the +same code objects the DWM column runs. + +WHAT DINO-WM IS HERE +-------------------- +stable-worldmodel's PreJEPA recipe: frozen DINOv2 ViT-S/14 patch features + a causal transformer +that predicts the next frame's features from the current ones and the action, trained by latent MSE. +Our caches already hold exactly those features (cache//tokens/tok.f16.npy is +[N, 514, 384] = 2 cameras x (CLS + 256 patches) from dinov2_vits14 at 224 px), and dwm_model.DWM is +already "the DINO-WM predictor" -- stream C built it as the velocity network of a token-space flow. +So DINO-WM is that predictor trained with train_rsm_dwm.py --dynamics latent_mse, and scored here. + +TRANSITION. Deterministic: s' = f_theta(s, a), one action chunk ahead. The predictor is queried +at the one fixed point of its flow-time/noise inputs that training used (x_k = 0, k = 0, beta = 0), +so the "future" half of its token sequence is a learned query attending to the current frame's patch +tokens under the action embedding. There is no ODE, no noise and no particle dimension: n_particles +is forced to 1 and common random numbers are vacuous, which also makes this the cheapest scorer in +the table -- worth stating, because search cost is part of what the flagship discloses. + +HOP LENGTH. One DINO-WM hop is `hop_frames` frames (the action chunk the model was trained on, 8 = +0.4 s at 20 Hz), whereas an RSM/DWM hop spans 1/(1-beta) frames. The two scorers are therefore +matched on the NUMBER of hops, L in {1,2,4,8}, not on beta -- a latent-dynamics model has no beta -- +and the fold's per-hop discount uses gamma ** hop_frames. L is the only knob this scorer has, which +is why its arm label in verdict_table is "L N" with no beta in it. + +DEVIATIONS FROM THE PAPER, DECLARED +----------------------------------- +1. History length 1, not 3. Forced by the protocol, not chosen: rsm_planner.plan_get_action hands a + scorer the SINGLE current frame (`obs_t = {k: v[:, -1] ...}`), so a history-3 world model cannot + be evaluated on the same observation every other scorer sees. +2. Two cameras (514 tokens) rather than one, because that is what the RISE observation is and what + every other scorer in the table reads. +3. Actions enter as the flattened 8-step chunk the RISE actor emits, not per-frame, for the same + reason: it is the candidate the planner ranks. +4. The reward probe is the checkpoint's own head on the provenance/membership label -- the same + label and the same head class RSM's membership read-out uses. +""" +from __future__ import annotations + +import json +from pathlib import Path + +import torch + +# (no direct model construction here: DWMCritic.__init__ builds the predictor and the reward head) +from dwm_readout import DWMCritic + + +class DINOWMCritic(DWMCritic): + """DWMCritic with DINO-WM's deterministic latent dynamics instead of the occupancy flow.""" + + def __init__(self, ck, device, use_ema=True): + super().__init__(ck, device, use_ema=use_ema) + # frames per hop: the action chunk the model was trained to step over. + self.hop_frames = float(ck.get("hop_frames", self.config.get("chunk", 8))) + self.dynamics = str(self.config.get("dynamics", "latent_mse")) + + def _step(self, tzr, pzr, ar, bq, B, n, g, flow_steps, micro): + """s' = f_theta(s, a): one deterministic chunk step, in normalised token space. + + Mirrors the training call in train_rsm_dwm._latent_mse_terms exactly -- same zero flow-time, + same zero noise input, same zero beta, same residual reparameterisation -- so the model is + queried at scoring time at the one point it was fitted at. `micro` still bounds the rows per + forward, because N=128 candidates x 514 tokens is the same memory problem the flow path has. + """ + outs_t, outs_p = [], [] + m = max(int(micro), 1) + for i in range(0, tzr.shape[0], m): + t_i, p_i, a_i = tzr[i:i + m], pzr[i:i + m], ar[i:i + m] + zt = torch.zeros_like(t_i) + zp = torch.zeros_like(p_i) + kz = torch.zeros(t_i.shape[0], device=t_i.device) + bz = torch.zeros(t_i.shape[0], device=t_i.device) + with self.autocast(): + v_tok, v_pr = self.flow(t_i, p_i, a_i, bz, zt, zp, kz) + nt = t_i.float() + self.rms_tok * v_tok.float() + npr = (p_i.float() + self.rms_pr * v_pr.float()) if v_pr.shape[1] else p_i.float() + outs_t.append(nt) + outs_p.append(npr) + return torch.cat(outs_t, 0), torch.cat(outs_p, 0) + + def _hop_frames(self, beta): + return self.hop_frames + + def q(self, *a, **kw): + """Deterministic dynamics: one particle is the whole estimator, so n_particles is forced to 1. + + Left as an override rather than a caller-side convention because the planner passes + plan_particles from the shared grid; silently averaging 16 identical roll-outs would burn 16x + the compute and report the same number, and the table discloses search cost per scorer. + """ + if kw.get("n_particles", 1) != 1: + kw["n_particles"] = 1 + if kw.get("n_particles_rescore"): + kw["n_particles_rescore"] = 1 + return super().q(*a, **kw) + + +def load_critic_dwm(path, device="cuda", use_ema=True, calib="auto") -> DINOWMCritic: + """Same name and signature as dwm_readout.load_critic_dwm, so this module is a drop-in for the + scorer's DWM backend (which imports `load_critic_dwm` from `rsm_dwm_module`).""" + ck = torch.load(str(path), map_location="cpu", weights_only=False) + m = str(ck.get("model", "dwm")) + dyn = dict(ck.get("config", {})).get("dynamics") + if m != "dinowm" or dyn != "latent_mse": + raise RuntimeError( + f"{path} is model={m!r} dynamics={dyn!r}; dinowm_readout needs a checkpoint trained with " + f"train_rsm_dwm.py --dynamics latent_mse. A flow DWM must be loaded by " + f"dwm_readout.load_critic_dwm -- reading it here would treat a velocity field as a " + f"next-state predictor.") + crit = DINOWMCritic(ck, device, use_ema=use_ema) + if isinstance(calib, (int, float)) and not isinstance(calib, bool): + crit.temperature = float(calib) + elif calib == "auto": + cj = Path(path).parent / "calib.json" + if cj.exists(): + try: + crit.calib = json.loads(cj.read_text()) + crit.temperature = float(crit.calib["T"]) + except Exception as e: + print(f"[dinowm_readout] calib.json unreadable ({e}); T=1", flush=True) + return crit diff --git a/gen_q_rsm/rsm_libero/dwm_model.py b/gen_q_rsm/rsm_libero/dwm_model.py new file mode 100644 index 0000000000000000000000000000000000000000..b40a26004ba1c4eb7459bca31439ed1ffe446d53 --- /dev/null +++ b/gen_q_rsm/rsm_libero/dwm_model.py @@ -0,0 +1,562 @@ +"""DWM: the DINO-WM predictor architecture, trained as a beta-discounted SUCCESSOR model. + +DINO-WM (gaoyuezhou/dino_wm, conf/predictor/vit.yaml): a ViT (depth 6, 16 heads x 64, +MLP 2048, dropout 0.1) over frozen DINOv2 ViT-S/14 patch tokens (384-d) with the action and +proprio embeddings CONCATENATED to every token, trained by MSE to the next frame's tokens. + +Ours keeps the ViT and changes the target and the objective (LAUNCH_MATRIX rev. 4, "DWM"): + + * sequence = 514 "now" tokens (agentview CLS + 256 patches, wrist CLS + 256 patches) + + 514 NOISY FUTURE tokens x_k = (1-k) y + k eps, full attention, + learned position embedding shared by the two halves + a 2-way TYPE embedding; + * y = (x_{t+K} - x_t) / rho, the residual of the z-scored tokens, rho = running + per-(token, channel) RMS of the residual (OccFlow's per-dim normalisation); + * K ~ Geom(1 - beta), beta ~ U[lo, hi], truncated at the episode end (data.py sampler); + * conditioning, concatenated to EVERY token as DINO-WM does: action chunk (8x7=56 -> 16), + proprio (9 -> 8), Fourier(log(-log beta)) (-> 8), flow time k sinusoid (8): 384+40 = 424; + * output = the flow velocity v = y - eps read at the future positions (LayerNorm+Linear); + * reward head R: mean-pooled tokens per camera (2x384) ++ proprio -> MLP 512x2 -> logit. + +One documented addition: a 515th "proprio" token per frame (9-d proprio embedded to 384, and +its own 9-d residual on the future side, read out by a 424->9 head). The MLP cells model the +pooled 1545-d state, which INCLUDES proprio, and the Stage-2 hop policy consumes the pooled +state of the sampled future, so the DWM successor has to predict proprio too. Cost: 2 tokens +out of 1030. + +No learned encoder: DINO is frozen and its tokens are the state (Stage 1 "no learned encoder +in either case"). +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import json +from pathlib import Path +import numpy as np +import torch +import torch.utils.checkpoint +import torch.nn as nn +import torch.nn.functional as F + +from model import beta_fourier, time_embed +from data import truncated_geometric_future + +# token layout of cache//tokens/tok.f16.npy [N, 514, 384] +N_PATCH = 256 +D_TOK = 384 +TOK_LAYOUT = {"agent_cls": 0, "agent_patch": (1, 1 + N_PATCH), + "wrist_cls": 1 + N_PATCH, "wrist_patch": (2 + N_PATCH, 2 + 2 * N_PATCH)} +N_TOK = 2 + 2 * N_PATCH # 514 +# Stage-1 state normalisation rule (orchestrator, 2026-09-18; B_stage1.md "STATE DEFINITION (final)"): +# x = clip((feat - mu) / max(sd, SD_FLOOR), -Z_CLIP, Z_CLIP) -- same floor/clip for pooled and token space +# and the residual RMS rho is floored at RHO_FLOOR; the normalised residual y is clipped to +-Y_CLIP so a dead +# channel (sd at the floor, delta up to 2*Z_CLIP) can never blow up the flow target. +SD_FLOOR = 0.01 +Z_CLIP = 10.0 +RHO_FLOOR = 0.01 +Y_CLIP = 10.0 +STATS_VERSION = 2 + + +# --------------------------------------------------------------------------- # +# pooled 1545-d state from tokens (RISE's DinoV2Core(concatenate=True) ++ proprio) +# --------------------------------------------------------------------------- # +def gem_pool(patches: torch.Tensor, p: float = 4.0, eps: float = 1e-6) -> torch.Tensor: + """GeM over the patch axis exactly as robomimic/models/obs_core.py DinoV2Core does: + clamp(min=1e-6) -> mean over the 16x16 grid of x^4 -> ^(1/4). patches [..., 256, 384].""" + return patches.clamp(min=eps).pow(p).mean(-2).pow(1.0 / p) + + +def pool_tokens(tokens: torch.Tensor, proprio: torch.Tensor | None = None) -> torch.Tensor: + """[B, 514, 384] RAW DINO tokens (+ [B, 9] proprio) -> [B, 1536 (+9)] pooled state + = [agent CLS ‖ GeM(agent patches) ‖ wrist CLS ‖ GeM(wrist patches)] ‖ proprio, + i.e. what cache//z.f16.npy ‖ proprio.f32.npy holds (un-normalised).""" + t = tokens.float() + a0, (a1, a2) = TOK_LAYOUT["agent_cls"], TOK_LAYOUT["agent_patch"] + w0, (w1, w2) = TOK_LAYOUT["wrist_cls"], TOK_LAYOUT["wrist_patch"] + parts = [t[:, a0], gem_pool(t[:, a1:a2]), t[:, w0], gem_pool(t[:, w1:w2])] + if proprio is not None: + parts.append(proprio.float()) + return torch.cat(parts, -1) + + +# --------------------------------------------------------------------------- # +# data: the pooled pack's meta/actions/proprio/labels + the token memmap +# --------------------------------------------------------------------------- # +class TokenRSMData: + """Same episode split, reward label and future sampler as data.LiberoRSMData, but the + state is the [514, 384] token frame from /tokens/tok.f16.npy (memmap; the page + cache is shared by the 8 DDP ranks on a node). Frame order = the pooled pack's.""" + + def __init__(self, root, chunk: int = 8, val_frac: float = 0.1, seed: int = 0, + reward_mode: str = "dense", success_gamma: float = 0.98, + in_ram: bool = False, tokens_file: str = "", goal_file: str = "", + tok_rows: str = ""): + root = Path(root) + self.root = root + m = np.load(root / "meta.npz", allow_pickle=True) + self.ep_from = m["ep_from"].astype(np.int64); self.ep_to = m["ep_to"].astype(np.int64) + self.ep_len = m["ep_len"].astype(np.int64) + self.ep_task = m["ep_task"].astype(np.int64); self.ep_success = m["ep_success"].astype(bool) + self.ep_demo = m["ep_demo"] if "ep_demo" in m else np.zeros(len(self.ep_task), bool) + self.tasks = [str(t) for t in m["tasks"]] + self.n_task = len(self.tasks); self.n_ep = len(self.ep_len) + self.adim = int(m["adim"]); self.chunk = chunk + self.act = np.load(root / "act.f32.npy", mmap_mode="r") + pp = root / "proprio.f32.npy" + self.proprio = np.load(pp, mmap_mode="r") if pp.exists() else None + tf = Path(tokens_file) if tokens_file else root / "tokens" / "tok.f16.npy" + self.tok_path = tf + self.tok = np.load(tf, mmap_mode="r") + assert self.tok.ndim == 3 and self.tok.shape[1:] == (N_TOK, D_TOK), \ + f"token cache {tf} has shape {self.tok.shape}, expected [N, {N_TOK}, {D_TOK}]" + # ROW MAP (gen_q#268). A cache that is a ROW SLICE of a parent -- cache/square_sub_20100 is + # exactly that of cache/square_expert_suboptimal (SLICE.json, + # scripts/build_sq20100_cache_slice.py), and its PACK.json records that tokens were not + # sliced -- can read the PARENT's token file through an index array instead of getting a + # 15.6 GB copy of it. /proj/dmfexp runs at 99% full, so the copy is not an option. + # tok_rows[i] is the parent-file row of THIS cache's frame i; it must have one entry per + # frame of the pooled pack, and the pooled pack's own frame count is what everything else + # (act, proprio, meta, the reward label) is indexed by. + self.tok_rows = None + if tok_rows: + self.tok_rows = np.load(tok_rows).astype(np.int64) + assert len(self.tok_rows) == int(self.ep_to[-1]), \ + f"row map {tok_rows} has {len(self.tok_rows)} entries, pooled pack has {int(self.ep_to[-1])} frames" + assert int(self.tok_rows.max()) < self.tok.shape[0], \ + f"row map indexes frame {int(self.tok_rows.max())} of a {self.tok.shape[0]}-frame token file" + print(f"[data] token row map {tok_rows}: {len(self.tok_rows)} frames read out of " + f"{self.tok.shape[0]} in {tf}", flush=True) + else: + assert self.tok.shape[0] == int(self.ep_to[-1]), \ + f"token frames {self.tok.shape[0]} != pooled pack frames {int(self.ep_to[-1])}" + self.tok_info = {} + tj = tf.parent / "TOKENS.json" + if tj.exists(): + try: + self.tok_info = json.loads(tj.read_text()) + except Exception: + pass + self.act = np.ascontiguousarray(self.act) + if self.proprio is not None: + self.proprio = np.ascontiguousarray(self.proprio) + if in_ram: + gb = self.tok.nbytes / 1e9 + print(f"[data] loading {gb:.1f} GB of tokens into RAM", flush=True) + self.tok = np.ascontiguousarray(self.tok) + if self.tok_rows is not None and in_ram: + # keep only the rows this cache uses, and renumber the map onto them + self.tok = np.ascontiguousarray(self.tok[np.sort(np.unique(self.tok_rows))]) + _u = np.sort(np.unique(np.load(tok_rows).astype(np.int64))) + self.tok_rows = np.searchsorted(_u, np.load(tok_rows).astype(np.int64)) + self.n_pr = 0 if self.proprio is None else int(self.proprio.shape[1]) + + # episode-level split, IDENTICAL to LiberoRSMData(seed=seed) so the val set matches + # the MLP cells + rng = np.random.default_rng(seed) + perm = rng.permutation(self.n_ep) + n_val = max(1, int(val_frac * self.n_ep)) + self.val_eps = np.sort(perm[:n_val]); self.train_eps = np.sort(perm[n_val:]) + + # per-frame reward label (LiberoRSMData: dense = every frame of a success; soft = + # gamma ** frames-to-end on successes) + self.r = np.zeros(int(self.ep_to[-1]), dtype=np.float32) + if reward_mode == "goal": + # GOAL-STATE label: env.is_success() at the replayed frame (scripts/goal_label_replay.py), not the + # outcome. The dense label fires on every frame of a successful episode and makes the read-out saturate. + gf = Path(goal_file) if goal_file else root / "goal.npz" + g = np.load(gf, allow_pickle=True)["goal"] + assert len(g) == len(self.r), f"{gf}: {len(g)} frames vs cache {len(self.r)}" + self.r[:] = g.astype(np.float32) + print(f"[data] goal label from {gf}: {self.r.mean():.4f} of frames", flush=True) + for i in range(self.n_ep): + if reward_mode == "goal" or not self.ep_success[i]: + continue + lo, hi = int(self.ep_from[i]), int(self.ep_to[i]) + if reward_mode == "dense": + self.r[lo:hi] = 1.0 + elif reward_mode == "soft": + n = hi - lo + self.r[lo:hi] = (success_gamma ** np.arange(n - 1, -1, -1, dtype=np.float64) + ).astype(np.float32) + else: + raise ValueError(f"reward_mode {reward_mode} not supported for DWM") + self.stats = self._fit_stats() + + # ---- normalisation statistics (per token position x channel; per proprio dim) ---- + def _fit_stats(self, stride: int = 97): + # With a row map the token file belongs to the PARENT task, so its tok_stats.npz describes + # the parent's frame distribution, not ours. Fit and cache our own, in our own cache dir. + f = (self.root / "tokens" / "tok_stats.npz") if self.tok_rows is not None \ + else self.tok_path.parent / "tok_stats.npz" + f.parent.mkdir(parents=True, exist_ok=True) + n = int(self.ep_to[-1]) + if f.exists(): + try: + c = np.load(f) + if c["mu"].shape == (N_TOK, D_TOK) and int(c["version"]) == STATS_VERSION \ + and float(c["sd_floor"]) == SD_FLOOR and float(c["z_clip"]) == Z_CLIP: + print(f"[data] token normalisation loaded from {f} (sd floor {SD_FLOOR}, clip {Z_CLIP})", flush=True) + return {k: c[k] for k in ("mu", "sd", "pr_mu", "pr_sd")} + print(f"[data] token stats {f} are an older version; refitting", flush=True) + except Exception as e: # a half-written file from a concurrent job: refit + print(f"[data] token stats unreadable ({e}); refitting", flush=True) + idx = np.arange(0, n, max(1, min(stride, max(n // 64, 1)))) + x = np.asarray(self.tok[self._rows(idx)], np.float32) + mu = x.mean(0); sd_raw = x.std(0); sd = np.maximum(sd_raw, SD_FLOOR) + if self.proprio is not None: + p = np.asarray(self.proprio[idx], np.float32) + pr_mu, pr_sd = p.mean(0), np.maximum(p.std(0), SD_FLOOR) + else: + pr_mu = np.zeros(0, np.float32); pr_sd = np.ones(0, np.float32) + st = {"mu": mu.astype(np.float32), "sd": sd.astype(np.float32), + "pr_mu": pr_mu.astype(np.float32), "pr_sd": pr_sd.astype(np.float32)} + n_floor = int((sd_raw < SD_FLOOR).sum()) + try: + tmp = f.with_name(f"tok_stats.{_os.getpid()}.tmp.npz") + np.savez(tmp, n=len(idx), version=STATS_VERSION, sd_floor=SD_FLOOR, z_clip=Z_CLIP, + rho_floor=RHO_FLOOR, y_clip=Y_CLIP, sd_raw=sd_raw.astype(np.float32), **st) + _os.replace(tmp, f) # atomic: concurrent jobs + (f.parent / "TOK_STATS.json").write_text(json.dumps({ + "file": "tok_stats.npz", "version": STATS_VERSION, "n_frames": int(len(idx)), + "stride": int(idx[1] - idx[0]) if len(idx) > 1 else 1, + "rule": "x = clip((tok - mu) / max(sd, sd_floor), -z_clip, z_clip), per (token position, channel); " + "proprio: per dim, same floor/clip", + "sd_floor": SD_FLOOR, "z_clip": Z_CLIP, + "residual": "y = clip((x_fut - x_now) / max(rho, rho_floor), -y_clip, y_clip), rho = running " + "per-(token, channel) RMS of the residual", + "rho_floor": RHO_FLOOR, "y_clip": Y_CLIP, + "n_token_channels_at_sd_floor": n_floor, + "sd_raw_min": float(sd_raw.min()), "sd_raw_p01": float(np.percentile(sd_raw, 1)), + "abs_z_max_on_fit_frames": float(np.abs((x - mu) / sd).max())}, indent=1)) + print(f"[data] token normalisation fitted on {len(idx)} frames -> {f} " + f"({n_floor} token-channels at the sd floor {SD_FLOOR}; z clipped to +-{Z_CLIP})", flush=True) + except OSError as e: + print(f"[data] token normalisation fitted but not cached ({e})", flush=True) + return st + + def _chunk_at(self, idx, ep_i, chunk_len=None): + cl = self.chunk if chunk_len is None else chunk_len + out = np.empty((len(idx), cl * self.adim), np.float32) + for j, (t, e) in enumerate(zip(idx, ep_i)): + hi = int(self.ep_to[e]); take = min(cl, hi - t) + a = np.asarray(self.act[t:t + take], np.float32) + if take < cl: + a = np.concatenate([a, np.repeat(a[-1:], cl - take, 0)], 0) + out[j] = a.reshape(-1) + return out + + def _rows(self, idx): + """cache frame indices -> rows of the token file (identity unless a row map is in use).""" + return idx if self.tok_rows is None else self.tok_rows[idx] + + def _tok(self, idx): + """RAW fp16 tokens for a set of rows (gathered in sorted order for locality).""" + idx = self._rows(np.asarray(idx, np.int64)) + order = np.argsort(idx, kind="stable") + g = np.asarray(self.tok[idx[order]]) + out = np.empty_like(g); out[order] = g + return out + + def _pr(self, idx): + if self.proprio is None: + return np.zeros((len(idx), 0), np.float32) + return np.asarray(self.proprio[idx], np.float32) + + def draw(self, batch, rng, beta_lo, beta_hi, split="train"): + """Index-level draw (no I/O): the (t, K, beta) tuple per row.""" + eps_pool = self.train_eps if split == "train" else self.val_eps + w = self.ep_len[eps_pool].astype(np.float64); w /= w.sum() + e = rng.choice(eps_pool, size=batch, p=w) + lo = self.ep_from[e]; hi = self.ep_to[e] + t = lo + (rng.random(batch) * (hi - lo)).astype(np.int64) + beta = rng.uniform(beta_lo, beta_hi, size=batch) + fut = truncated_geometric_future(t, hi, beta, rng.random(batch)) + return e, t, fut, beta + + def gather(self, e, t, fut, beta, with_fut=True): + """CPU tensors for a draw. Tokens stay fp16 (normalised on the device).""" + out = {"tok_now": torch.from_numpy(self._tok(t)), + "pr_now": torch.from_numpy(self._pr(t)), + "a_now": torch.from_numpy(self._chunk_at(t, e)), + "task": torch.from_numpy(self.ep_task[e]).long(), + "beta": torch.from_numpy(np.asarray(beta)).float(), + "r_now": torch.from_numpy(self.r[t]), + "succ": torch.from_numpy(self.ep_success[e].astype(np.float32)), + "to_end": torch.from_numpy((self.ep_to[e] - t).astype(np.float32)), + "t_idx": t, "ep": e, "fut_idx": fut} + if with_fut: + out["tok_fut"] = torch.from_numpy(self._tok(fut)) + out["pr_fut"] = torch.from_numpy(self._pr(fut)) + out["r_fut"] = torch.from_numpy(self.r[fut]) + return out + + def sample(self, batch, rng, beta_lo, beta_hi, split="train", device="cpu"): + e, t, fut, beta = self.draw(batch, rng, beta_lo, beta_hi, split) + b = self.gather(e, t, fut, beta) + return {k: (v.to(device, non_blocking=True) if torch.is_tensor(v) else v) + for k, v in b.items()} + + def sample_frames(self, batch, rng, split="train", device="cpu"): + e, t, _, _ = self.draw(batch, rng, 0.5, 0.5, split) + b = self.gather(e, t, t, np.zeros(batch), with_fut=False) + b["x"] = b.pop("tok_now"); b["a"] = b.pop("a_now"); b["r"] = b.pop("r_now") + return {k: (v.to(device, non_blocking=True) if torch.is_tensor(v) else v) + for k, v in b.items()} + + +class Normalizer(nn.Module): + """z-scoring of raw tokens / proprio, stored in the checkpoint as buffers.""" + + def __init__(self, stats): + super().__init__() + self.register_buffer("mu", torch.as_tensor(stats["mu"], dtype=torch.float32)) + self.register_buffer("sd", torch.as_tensor(stats["sd"], dtype=torch.float32)) + self.register_buffer("pr_mu", torch.as_tensor(stats["pr_mu"], dtype=torch.float32)) + self.register_buffer("pr_sd", torch.as_tensor(stats["pr_sd"], dtype=torch.float32)) + + def tok(self, x): # raw -> z-scored, sd floored (in the stats) and clipped + return ((x.float() - self.mu) / self.sd.clamp_min(SD_FLOOR)).clamp(-Z_CLIP, Z_CLIP) + + def tok_inv(self, z): # z-scored -> raw + return z.float() * self.sd.clamp_min(SD_FLOOR) + self.mu + + def pr(self, p): + return ((p.float() - self.pr_mu) / self.pr_sd.clamp_min(SD_FLOOR)).clamp(-Z_CLIP, Z_CLIP) + + def pr_inv(self, z): + return z.float() * self.pr_sd.clamp_min(SD_FLOOR) + self.pr_mu + + +# --------------------------------------------------------------------------- # +# the DINO-WM ViT (vit-pytorch style: PreNorm, Attention, FeedForward, dropout) +# --------------------------------------------------------------------------- # +class Attention(nn.Module): + def __init__(self, dim, heads=16, dim_head=64, dropout=0.0): + super().__init__() + inner = heads * dim_head + self.heads, self.dim_head, self.dropout = heads, dim_head, dropout + self.norm = nn.LayerNorm(dim) + self.to_qkv = nn.Linear(dim, inner * 3, bias=False) + self.to_out = nn.Sequential(nn.Linear(inner, dim), nn.Dropout(dropout)) + + def forward(self, x): + B, N, _ = x.shape + q, k, v = self.to_qkv(self.norm(x)).chunk(3, -1) + q, k, v = (t.view(B, N, self.heads, self.dim_head).transpose(1, 2) for t in (q, k, v)) + o = F.scaled_dot_product_attention(q, k, v, dropout_p=self.dropout if self.training else 0.0) + return self.to_out(o.transpose(1, 2).reshape(B, N, -1)) + + +class FeedForward(nn.Module): + def __init__(self, dim, hidden, dropout=0.0): + super().__init__() + self.net = nn.Sequential(nn.LayerNorm(dim), nn.Linear(dim, hidden), nn.GELU(), + nn.Dropout(dropout), nn.Linear(hidden, dim), nn.Dropout(dropout)) + + def forward(self, x): + return self.net(x) + + +class Transformer(nn.Module): + def __init__(self, dim, depth, heads, dim_head, mlp_dim, dropout=0.0, grad_ckpt=False): + super().__init__() + self.layers = nn.ModuleList([nn.ModuleList([Attention(dim, heads, dim_head, dropout), + FeedForward(dim, mlp_dim, dropout)]) + for _ in range(depth)]) + self.norm = nn.LayerNorm(dim) + self.grad_ckpt = grad_ckpt + + @staticmethod + def _block(attn, ff, x): + x = x + attn(x) + return x + ff(x) + + def forward(self, x): + for attn, ff in self.layers: + if self.grad_ckpt and self.training and torch.is_grad_enabled(): + x = torch.utils.checkpoint.checkpoint(self._block, attn, ff, x, use_reentrant=False) + else: + x = self._block(attn, ff, x) + return self.norm(x) + + +class DWM(nn.Module): + """Successor flow in token space with the DINO-WM predictor as the velocity network.""" + + def __init__(self, n_tok=N_TOK, d_tok=D_TOK, n_pr=9, d_act=56, depth=6, heads=16, + dim_head=64, mlp_dim=2048, dropout=0.1, d_act_emb=16, d_pr_emb=8, + d_beta_emb=8, d_time_emb=8, n_fourier=6, emb_dropout=0.1, grad_ckpt=False, + tok_drop=0.0): + super().__init__() + self.tok_drop = tok_drop # training-time dropout of WHOLE "now" tokens (regulariser probe) + self.n_tok, self.d_tok, self.n_pr, self.d_act = n_tok, d_tok, n_pr, d_act + self.d_cond = d_act_emb + d_pr_emb + d_beta_emb + d_time_emb + self.dim = d_tok + self.d_cond # 424 + self.d_time_emb = d_time_emb; self.n_fourier = n_fourier + self.act_emb = nn.Linear(d_act, d_act_emb) + self.pr_emb = nn.Linear(max(n_pr, 1), d_pr_emb) + self.beta_emb = nn.Linear(2 * n_fourier + 1, d_beta_emb) + # the extra proprio token (now: embedded proprio; future: embedded noisy residual) + self.pr_tok_now = nn.Linear(max(n_pr, 1), d_tok) + self.pr_tok_fut = nn.Linear(max(n_pr, 1), d_tok) + self.n_seq = n_tok + 1 + self.pos = nn.Parameter(torch.randn(1, self.n_seq, self.dim) * 0.02) + self.type_emb = nn.Parameter(torch.randn(2, 1, self.dim) * 0.02) + self.drop = nn.Dropout(emb_dropout) + self.transformer = Transformer(self.dim, depth, heads, dim_head, mlp_dim, dropout, grad_ckpt) + self.head_tok = nn.Linear(self.dim, d_tok) + self.head_pr = nn.Linear(self.dim, max(n_pr, 1)) + + def _cond(self, a, pr, beta, k): + c = torch.cat([self.act_emb(a), self.pr_emb(pr if self.n_pr else torch.zeros_like(a[:, :1])), + self.beta_emb(beta_fourier(beta.float(), self.n_fourier)), + time_embed(k.float(), self.d_time_emb)], -1) + return c + + def forward(self, tok_now, pr_now, a, beta, xk_tok, xk_pr, k): + """tok_now [B,514,384] z-scored; pr_now [B,9] z-scored; a [B,56]; beta [B]; + xk_tok [B,514,384] noisy residual; xk_pr [B,9]; k [B] flow time (1 = noise). + -> (v_tok [B,514,384], v_pr [B,9])""" + B = tok_now.shape[0] + pr_in = pr_now if self.n_pr else torch.zeros(B, 1, device=tok_now.device) + xk_pr_in = xk_pr if self.n_pr else torch.zeros(B, 1, device=tok_now.device) + if self.tok_drop > 0 and self.training: + keep = (torch.rand(B, tok_now.shape[1], 1, device=tok_now.device) >= self.tok_drop).to(tok_now.dtype) + tok_now = tok_now * keep # dropped token -> 0 = the mean token (z-scored space) + now = torch.cat([tok_now, self.pr_tok_now(pr_in)[:, None]], 1) # [B,515,384] + fut = torch.cat([xk_tok, self.pr_tok_fut(xk_pr_in)[:, None]], 1) # [B,515,384] + c = self._cond(a, pr_in, beta, k)[:, None].expand(-1, self.n_seq, -1) # [B,515,40] + now = torch.cat([now, c], -1) + self.pos + self.type_emb[0] + fut = torch.cat([fut, c], -1) + self.pos + self.type_emb[1] + h = self.transformer(self.drop(torch.cat([now, fut], 1))) # [B,1030,424] + hf = h[:, self.n_seq:] + v_tok = self.head_tok(hf[:, :self.n_tok]) + v_pr = self.head_pr(hf[:, self.n_tok]) + return v_tok, (v_pr if self.n_pr else v_pr[:, :0]) + + +class DWMReward(nn.Module): + """R(x): mean-pooled tokens per camera (2 x 384) ++ proprio -> MLP 512 x 2 -> logit.""" + + def __init__(self, n_tok=N_TOK, d_tok=D_TOK, n_pr=9, width=512): + super().__init__() + self.n_tok, self.n_pr = n_tok, n_pr + self.net = nn.Sequential(nn.Linear(2 * d_tok + n_pr, width), nn.SiLU(), + nn.Linear(width, width), nn.SiLU(), nn.Linear(width, 1)) + + @staticmethod + def pool(tok): + h = tok.shape[1] // 2 + return torch.cat([tok[:, :h].mean(1), tok[:, h:].mean(1)], -1) + + def forward(self, tok, pr): + x = self.pool(tok.float()) + if self.n_pr: + x = torch.cat([x, pr.float()], -1) + return self.net(x).squeeze(-1) + + +# --------------------------------------------------------------------------- # +# sampling +# --------------------------------------------------------------------------- # +@torch.no_grad() +def sample_future_dwm(model, tok_now, pr_now, a, beta, rms_tok, rms_pr, n_steps=8, n=1, + x0=None, micro=512, autocast=None, y_clip=Y_CLIP): + """Euler ODE sample of the token residual, returned as ABSOLUTE z-scored tokens/proprio. + x0: optional (noise_tok [rows,514,384], noise_pr [rows,9]) for common random numbers. + autocast: zero-arg callable returning a context manager (default: bf16 on cuda). + y_clip: the integrated residual is clamped to +-y_clip (rho units) after every Euler step -- the + training target lives in that box, so anything outside it is a diverged velocity, not a + successor (stream B measured the MLP flow's velocity growing 170 -> 8500 over 8 steps on + held-out episodes; this bounds the damage at read-out). 0 = off. + Returns (tok_fut_z [B*n,514,384], pr_fut_z [B*n,9]).""" + B = tok_now.shape[0] + if n > 1: + tok_now = tok_now.repeat_interleave(n, 0); pr_now = pr_now.repeat_interleave(n, 0) + a = a.repeat_interleave(n, 0); beta = beta.repeat_interleave(n, 0) + R = tok_now.shape[0] + dev = tok_now.device + if x0 is None: + xt = torch.randn(R, model.n_tok, model.d_tok, device=dev) + xp = torch.randn(R, model.n_pr, device=dev) + else: + xt, xp = x0[0].clone(), x0[1].clone() + if autocast is None: + autocast = (lambda: torch.autocast("cuda", dtype=torch.bfloat16)) if dev.type == "cuda" \ + else (lambda: torch.autocast("cpu", enabled=False)) + for s in range(n_steps): + kk = 1.0 - s / n_steps + for i in range(0, R, micro): + sl = slice(i, i + micro) + k = torch.full((xt[sl].shape[0],), kk, device=dev) + with autocast(): + vt, vp = model(tok_now[sl], pr_now[sl], a[sl], beta[sl], xt[sl], xp[sl], k) + xt[sl] = (xt[sl] + vt.float() / n_steps).clamp(-y_clip, y_clip) if y_clip else xt[sl] + vt.float() / n_steps + xp[sl] = (xp[sl] + vp.float() / n_steps).clamp(-y_clip, y_clip) if y_clip else xp[sl] + vp.float() / n_steps + return tok_now + xt * rms_tok, pr_now + xp * rms_pr + + +# --------------------------------------------------------------------------- # +# synthetic cache with the real layout (tests, and development before stream B's dump) +# --------------------------------------------------------------------------- # +def make_synthetic_cache(root, n_ep=6, ep_len=(30, 50), seed=0, success_rate=0.5, n_pr=9, adim=7): + """Writes meta.npz, act.f32.npy, proprio.f32.npy, z.f16.npy (pooled, via the reference + GeM), tokens/tok.f16.npy [N,514,384], tokens/TOKENS.json. Tokens drift smoothly along + the episode so a successor has something to learn.""" + root = Path(root); (root / "tokens").mkdir(parents=True, exist_ok=True) + rng = np.random.default_rng(seed) + lens = rng.integers(ep_len[0], ep_len[1] + 1, size=n_ep).astype(np.int64) + ep_to = np.cumsum(lens); ep_from = ep_to - lens; N = int(ep_to[-1]) + tok = np.lib.format.open_memmap(root / "tokens" / "tok.f16.npy", mode="w+", + dtype=np.float16, shape=(N, N_TOK, D_TOK)) + act = np.zeros((N, adim), np.float32); pr = np.zeros((N, n_pr), np.float32) + base = rng.normal(0, 1, size=(N_TOK, D_TOK)).astype(np.float32) + base[1:1 + N_PATCH] = np.abs(base[1:1 + N_PATCH]) + 0.5 # patches mostly positive (GeM) + base[2 + N_PATCH:] = np.abs(base[2 + N_PATCH:]) + 0.5 + succ = rng.random(n_ep) < success_rate + for i in range(n_ep): + s, e = int(ep_from[i]), int(ep_to[i]); T = e - s + a = np.tanh(rng.normal(0, 0.7, size=(T, adim))).astype(np.float32) + a = np.cumsum(a, 0) / np.sqrt(np.arange(1, T + 1))[:, None] # correlated in time + act[s:e] = np.clip(a, -1, 1) + drift = rng.normal(0, 0.3, size=(D_TOK,)).astype(np.float32) + for t in range(T): + frac = t / max(T - 1, 1) + x = base + frac * drift[None] + 0.05 * rng.normal(size=(N_TOK, D_TOK)).astype(np.float32) + x += 0.2 * np.cumsum(act[s:s + t + 1], 0)[-1].sum() * (base > 0) * 0.01 + tok[s + t] = x.astype(np.float16) + pr[s + t] = np.concatenate([np.cumsum(act[s:s + t + 1, :3], 0)[-1] * 0.05, + np.array([1, 0, 0, 0], np.float32), + np.array([0.04 - 0.03 * frac, -0.04 + 0.03 * frac])])[:n_pr] + tok.flush() + # pooled pack with the reference formula (torch avg_pool2d, as obs_core.py) + z = np.zeros((N, 4 * D_TOK), np.float16) + for i in range(0, N, 64): + t = torch.from_numpy(np.asarray(tok[i:i + 64], np.float32)) + parts = [] + for c0, (p0, p1) in ((TOK_LAYOUT["agent_cls"], TOK_LAYOUT["agent_patch"]), + (TOK_LAYOUT["wrist_cls"], TOK_LAYOUT["wrist_patch"])): + p = t[:, p0:p1].reshape(t.shape[0], 16, 16, -1).clamp(min=1e-6).permute(0, 3, 1, 2) + g = F.avg_pool2d(p.pow(4), (16, 16)).pow(1 / 4).reshape(t.shape[0], -1) + parts += [t[:, c0], g] + z[i:i + 64] = torch.cat(parts, -1).numpy().astype(np.float16) + np.save(root / "z.f16.npy", z) + np.save(root / "act.f32.npy", act); np.save(root / "proprio.f32.npy", pr) + np.savez(root / "meta.npz", ep_from=ep_from, ep_to=ep_to, ep_len=lens, + ep_task=np.zeros(n_ep, np.int64), ep_success=succ, ep_demo=np.zeros(n_ep, bool), + tasks=np.array(["synthetic"]), dim=4 * D_TOK, adim=adim, stride=1, n_frames=N) + # goal-state label: the last 30 % of frames of every successful episode (env-success-by-replay stand-in) + goal = np.zeros(N, np.uint8); first = np.full(n_ep, -1, np.int64) + for i in range(n_ep): + if succ[i]: + s, e = int(ep_from[i]), int(ep_to[i]); first[i] = s + int(0.7 * (e - s)); goal[first[i]:e] = 1 + first[i] -= s + np.savez(root / "goal.npz", goal=goal, first_success=first, label="synthetic") + (root / "tokens" / "TOKENS.json").write_text(json.dumps({ + "file": "tok.f16.npy", "shape": [N, N_TOK, D_TOK], "dtype": "float16", + "layout": "[agentview CLS, 256 agentview patches, wrist CLS, 256 wrist patches]", + "encoder": "synthetic", "synthetic": True}, indent=1)) + (root / "PACK.json").write_text(json.dumps({"encoder": "synthetic", "cam_res": 84, + "frames": N, "episodes": n_ep, + "sd_floor": SD_FLOOR, "z_clip": Z_CLIP}, indent=1)) + return root diff --git a/gen_q_rsm/rsm_libero/dwm_readout.py b/gen_q_rsm/rsm_libero/dwm_readout.py new file mode 100644 index 0000000000000000000000000000000000000000..aa4741e12056244e65612d84dfed0a4235715383 --- /dev/null +++ b/gen_q_rsm/rsm_libero/dwm_readout.py @@ -0,0 +1,294 @@ +"""Stage-3 read-out of a DWM checkpoint: Q̄_β(x, A) = E_{x' ~ d_β(.|x, A)}[σ(R(x'))]. + + from dwm_readout import load_critic_dwm + crit = load_critic_dwm("runs//rsm/DWM/ckpt_best.pt", device) + q = crit.q(x_tokens, a_chunk, beta, n_particles=16, crn_seed=0, depth=1, mode="d1", + proprio=proprio) # -> [B] in [0, 1] + +Inputs are RAW: x_tokens [B, 514, 384] DINOv2 ViT-S/14 tokens at 224 input, in the cache order +[agentview CLS, 256 agentview patches, wrist CLS, 256 wrist patches] (fp16/fp32 both fine); +proprio [B, 9] = robot0_eef_pos(3) ‖ robot0_eef_quat(4) ‖ robot0_gripper_qpos(2), un-normalised; +a_chunk [B, 56] = the next 8 actions flattened (7-d OSC_POSE, in [-1, 1]); beta a float. + +mode="d1" one hop from the query chunk, mean over particles of σ(R(x')). +mode="fold" is_ope.q_fold's product fold over `depth` hops: hop 1 from the query chunk, + hop k+1 from `hop_policy` evaluated on the POOLED 1545-d state of hop k + (pool_tokens: [CLS ‖ GeM(patches)] per camera ‖ proprio, RAW units, the same + vector cache//z.f16.npy ‖ proprio.f32.npy holds). + Q = c_L; Q = c_k + (1 - c_k) γ^h Q (h = 1/(1-β)), mean over particles. + hop_policy(pooled_raw [R, 1545], eps [R, d_act]) -> a_chunk [R, 56]; the caller + applies its own feature normalisation (feat_stats.npz) inside that callable. + Optional attribute hop_policy.d_act (default 56) sizes the CRN noise eps. + +PRIMARY read-out for planning (orchestrator 13:05): the dense expert-membership head with LOGIT averaging, + q, q_logit = crit.q(x_tokens, a_chunk, beta, ..., return_logit=True) # rank candidates by q_logit +q_logit = mean over particles of R(x'_i) (no sigmoid), which does not saturate/tie at 1.0 the way q does. +Temperature: calib_dwm.py fits T on held-out frames -> runs//rsm/DWM/calib.json; load_critic_dwm reads it +(crit.temperature) and q = mean_i sigmoid(logit_i / T); q(..., temperature=T) overrides. +Two-stage screening: q(..., n_particles=4, rescore_top=16, n_particles_rescore=64) scores all candidates with 4 +particles, rescores the top-16 by q_logit with 64 particles, returns full-length arrays. + +reward="goal_clf", reward_path="runs//goal_clf/clf.pt" (PRIVILEGED ABLATION: env success via state +replay, which RISE's baselines never see): the read-out reward is the standalone GOAL-STATE +classifier (train_goal_clf.py; env-success-by-replay label) on the pooled 1545-d state of every sampled future +instead of the checkpoint's own head; return_logit=True also returns q_logit (mean logit over particles). + +Common random numbers: crn_seed seeds a torch.Generator; every particle i draws ONE noise +tensor shared by all B rows (candidates), so Q differences between candidates at the same +state are paired (same convention as is_ope.q_fold(crn=True)). Euler ODE with `flow_steps` +(8) steps in token space; the EMA weights are used. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +from pathlib import Path +import numpy as np +import torch + +from dwm_model import (DWM, DWMReward, Normalizer, pool_tokens, sample_future_dwm, N_TOK, D_TOK) + + +class DWMCritic: + def __init__(self, ck, device, use_ema=True): + a = ck["arch"] + self.device = torch.device(device) + self.n_pr, self.d_act = int(a["n_pr"]), int(a["d_act"]) + self.flow = DWM(a["n_tok"], a["d_tok"], a["n_pr"], a["d_act"], depth=a["depth"], + heads=a["heads"], dim_head=a["dim_head"], mlp_dim=a["mlp_dim"], + dropout=a["dropout"], emb_dropout=a["dropout"]).to(self.device) + self.rew = DWMReward(a["n_tok"], a["d_tok"], a["n_pr"]).to(self.device) + self.flow.load_state_dict(ck["flow_ema" if use_ema else "flow"]) + self.rew.load_state_dict(ck["rew_ema" if use_ema else "rew"]) + self.norm = Normalizer({k: v.numpy() if torch.is_tensor(v) else v for k, v in ck["norm"].items()}).to(self.device) + self.rms_tok = ck["rms_tok"].to(self.device); self.rms_pr = ck["rms_pr"].to(self.device) + self.config = dict(ck["config"]); self.step = int(ck.get("step", -1)) + self.temperature = 1.0; self.calib = None + self.q_action_winrate = ck.get("q_action_winrate", float("nan")) + for m in (self.flow, self.rew): + m.eval() + for p in m.parameters(): + p.requires_grad_(False) + self.autocast = (lambda: torch.autocast("cuda", dtype=torch.bfloat16)) if self.device.type == "cuda" \ + else (lambda: torch.autocast("cpu", enabled=False)) + + # ---- helpers ---- + def _prep(self, x_tokens, proprio, a_chunk): + x = torch.as_tensor(x_tokens).to(self.device) + assert x.ndim == 3 and x.shape[1:] == (N_TOK, D_TOK), f"x_tokens must be [B,{N_TOK},{D_TOK}], got {tuple(x.shape)}" + B = x.shape[0] + if self.n_pr: + assert proprio is not None, "this checkpoint models proprio: pass proprio=[B, 9]" + p = torch.as_tensor(proprio).to(self.device).float().view(B, self.n_pr) + else: + p = torch.zeros(B, 0, device=self.device) + a = torch.as_tensor(a_chunk).to(self.device).float().view(B, -1) + assert a.shape[1] == self.d_act, f"a_chunk must be [B,{self.d_act}] (chunk x adim flattened)" + return self.norm.tok(x), self.norm.pr(p), a + + @torch.no_grad() + def reward(self, x_tokens, proprio=None, reward="head", reward_path=None): + """σ(R(x)) on RAW tokens/proprio -> [B]; reward='goal_clf' uses the goal classifier.""" + tz, pz, _ = self._prep(x_tokens, proprio, torch.zeros(len(x_tokens), self.d_act)) + if reward == "goal_clf": + if reward_path is not None and getattr(self, "goal_clf", {}).get("path") != str(reward_path): + self.load_goal_clf(reward_path) + return torch.sigmoid(self.goal_logit(tz, pz)) + with self.autocast(): + return torch.sigmoid(self.rew(tz, pz).float()) + + @torch.no_grad() + def sample_future(self, x_tokens, a_chunk, beta, proprio=None, n=1, crn_seed=None, flow_steps=8, micro=512): + """Raw-unit successor samples: (tokens [B*n,514,384], proprio [B*n,9]).""" + tz, pz, a = self._prep(x_tokens, proprio, a_chunk) + B = tz.shape[0] + bq = torch.full((B,), float(beta), device=self.device) + x0 = self._crn_noise(B, n, crn_seed) if crn_seed is not None else None + xt, xp = sample_future_dwm(self.flow, tz, pz, a, bq, self.rms_tok, self.rms_pr, flow_steps, n=n, + x0=x0, micro=micro, autocast=self.autocast) + return self.norm.tok_inv(xt), self.norm.pr_inv(xp) + + # ---- goal-state classifier read-out (orchestrator 2026-09-18: R must be a goal classifier) ---- + def load_goal_clf(self, path): + """train_goal_clf.py checkpoint: MLP on the pooled z-scored state; cached on the critic.""" + ck = torch.load(str(path), map_location="cpu", weights_only=False) + c = ck["config"] + from train_goal_clf import build_net + net = build_net(c["d_in"], c["width"], c["depth"]).to(self.device) + net.load_state_dict(ck["net"]); net.eval() + for p in net.parameters(): + p.requires_grad_(False) + nm = ck["norm"] + self.goal_clf = {"net": net, "mu": nm["mu"].to(self.device), "sd": nm["sd"].to(self.device), + "z_clip": float(nm["z_clip"]), "sd_floor": float(nm.get("sd_floor", 0.01)), + "path": str(path), "config": c} + return self.goal_clf + + def goal_logit(self, tz, pz): + """logit of 'goal state' for z-scored token/proprio tensors (sampled futures or real frames).""" + g = self.goal_clf + pooled = pool_tokens(self.norm.tok_inv(tz), self.norm.pr_inv(pz) if self.n_pr else None) # raw 1545 + x = (pooled - g["mu"]) / g["sd"].clamp_min(g["sd_floor"]) + if g["z_clip"]: + x = x.clamp(-g["z_clip"], g["z_clip"]) + return g["net"](x).squeeze(-1).float() + + def _gen(self, seed): + g = torch.Generator(device=self.device); g.manual_seed(int(seed)); return g + + def _crn_noise(self, B, n, seed, gen=None): + """[n, ...] noise per particle, tiled over the B rows (rows are repeat_interleave'd + by particle, so particle i of row b sits at b*n + i -> tile with .repeat(B, ...)).""" + g = gen if gen is not None else self._gen(seed) + nt = torch.randn(n, N_TOK, D_TOK, device=self.device, generator=g).repeat(B, 1, 1) + npr = torch.randn(n, self.n_pr, device=self.device, generator=g).repeat(B, 1) + return nt, npr + + @torch.no_grad() + def q(self, x_tokens, a_chunk, beta, n_particles=16, crn_seed=0, depth=1, mode="d1", + proprio=None, hop_policy=None, gamma=0.99, flow_steps=8, micro=512, return_hops=False, + reward="head", reward_path=None, return_logit=False, temperature=None, + rescore_top=0, n_particles_rescore=0): + """Q̄ estimate per row. See the module docstring. + reward="head": the checkpoint's own reward head R (trained on the run's --reward-mode label). + reward="goal_clf": the standalone goal-state classifier (train_goal_clf.py; PRIVILEGED ablation) on the POOLED + state of each sampled future; reward_path = its clf.pt (loaded once and cached). + temperature: q = mean_i sigmoid(logit_i / T). None -> self.temperature (calib.json next to the checkpoint, + fitted by calib_dwm.py on held-out frames; 1.0 if absent). q_logit is the RAW mean logit (ranking is T-free). + rescore_top=K, n_particles_rescore=M: two-stage screening -- score every candidate with n_particles, keep the + top-K by q_logit, rescore those with M particles (CRN seed family crn_seed -> crn_seed*7919+1) and write the + rescored values back; non-rescored rows keep their stage-1 values. Full-length outputs. + return_logit=True -> (q, q_logit); return_hops=True -> (out, [c_k [B, n]]) of the stage-1 pass.""" + if reward == "goal_clf": + if reward_path is not None and getattr(self, "goal_clf", {}).get("path") != str(reward_path): + self.load_goal_clf(reward_path) + assert getattr(self, "goal_clf", None), "reward='goal_clf' needs reward_path= once" + elif reward != "head": + raise ValueError(f"reward {reward!r}: use 'head' or 'goal_clf'") + if mode == "d1": + depth = 1 + elif mode != "fold": + raise ValueError(f"mode {mode!r}: use 'd1' or 'fold'") + if depth > 1 and hop_policy is None: + raise ValueError("depth > 1 needs hop_policy(pooled_raw [R,1545], eps [R,d_act]) -> a_chunk") + T = float(self.temperature if temperature is None else temperature) + tz, pz, a = self._prep(x_tokens, proprio, a_chunk) + q, ql, cs = self._q_once(tz, pz, a, beta, int(n_particles), self._gen(crn_seed), depth, mode, hop_policy, + gamma, flow_steps, micro, reward, T) + if rescore_top and n_particles_rescore and rescore_top < tz.shape[0]: + top = torch.topk(ql, int(rescore_top)).indices + q2, ql2, _ = self._q_once(tz[top], pz[top], a[top], beta, int(n_particles_rescore), + self._gen(int(crn_seed) * 7919 + 1), depth, mode, hop_policy, gamma, + flow_steps, micro, reward, T) + q = q.clone(); ql = ql.clone(); q[top] = q2; ql[top] = ql2 + out = (q, ql) if return_logit else q + if return_hops: + return out, cs + return out + + # ---- the two things a different dynamics model has to change (gen_q#268) ------------------- + # Factored out so DINO-WM (dinowm_readout.DINOWMCritic) can subclass this class and override + # ONLY the transition and the hop length, exactly as TDFlowAgent subclasses RSMAgent to override + # only the occupancy target. Everything else -- the fold algebra, the hop-policy chaining, the + # reward head, the normaliser, the temperature, the two-stage rescore -- is then literally the + # same code, which is what makes the two columns of a matched-proposer table comparable. + def _step(self, tzr, pzr, ar, bq, B, n, g, flow_steps, micro): + """One hop: a DRAW from the beta-discounted successor, by Euler-integrating the flow.""" + x0 = self._crn_noise(B, n, None, gen=g) + return sample_future_dwm(self.flow, tzr, pzr, ar, bq, self.rms_tok, self.rms_pr, flow_steps, + n=1, x0=x0, micro=micro, autocast=self.autocast) + + def _hop_frames(self, beta): + """Frames one hop spans, for the fold's per-hop discount gamma ** h.""" + return 1.0 / (1.0 - float(beta)) + + def _q_once(self, tz, pz, a, beta, n, g, depth, mode, hop_policy, gamma, flow_steps, micro, reward, T): + B = tz.shape[0] + tzr = tz.repeat_interleave(n, 0); pzr = pz.repeat_interleave(n, 0); ar = a.repeat_interleave(n, 0) + bq = torch.full((B * n,), float(beta), device=self.device) + cs = [] + for k in range(depth): + tzr, pzr = self._step(tzr, pzr, ar, bq, B, n, g, flow_steps, micro) + with self.autocast(): + lg = self.goal_logit(tzr, pzr) if reward == "goal_clf" else self.rew(tzr, pzr).float() + cs.append(torch.sigmoid(lg / T)) + if k == depth - 1: + break + pooled = pool_tokens(self.norm.tok_inv(tzr), self.norm.pr_inv(pzr) if self.n_pr else None) + d_act = int(getattr(hop_policy, "d_act", self.d_act)) + eps = torch.randn(n, d_act, device=self.device, generator=g).repeat(B, 1) + ar = torch.as_tensor(hop_policy(pooled, eps)).to(self.device).float().view(B * n, -1) + assert ar.shape[1] == self.d_act, "hop_policy must return [R, chunk*adim] chunks" + if mode == "d1": + q = cs[0] + else: + h = self._hop_frames(beta) + q = torch.zeros_like(cs[-1]) + for c in reversed(cs): + q = c + (1.0 - c) * (gamma ** h) * q + q = torch.nan_to_num(q, nan=0.0).clamp(0.0, 1.0).view(B, n).mean(1) + q_logit = torch.nan_to_num(lg, nan=0.0).view(B, n).mean(1) + return q, q_logit, [c.view(B, n) for c in cs] + + +def load_critic_dwm(path, device="cuda", use_ema=True, calib="auto") -> DWMCritic: + """calib: "auto" reads /calib.json (calib_dwm.py) and sets crit.temperature = T if present; + a float sets T directly; None/False leaves T = 1.0.""" + ck = torch.load(str(path), map_location="cpu", weights_only=False) + _m = str(ck.get("model", "dwm")) + if _m != "dwm": + raise RuntimeError( + f"{path} is a '{_m}' checkpoint (config dynamics=" + f"{dict(ck.get('config', {})).get('dynamics')!r}), not a flow DWM. Load it with the " + f"read-out for that model (dinowm_readout.load_critic_dwm) -- Euler-integrating a " + f"network that was never trained as a velocity field would report a number that is " + f"neither method.") + crit = DWMCritic(ck, device, use_ema=use_ema) + if isinstance(calib, (int, float)) and not isinstance(calib, bool): + crit.temperature = float(calib) + elif calib == "auto": + cj = Path(path).parent / "calib.json" + if cj.exists(): + try: + import json + crit.calib = json.loads(cj.read_text()); crit.temperature = float(crit.calib["T"]) + except Exception as e: + print(f"[dwm_readout] calib.json unreadable ({e}); T=1", flush=True) + return crit + + +# --------------------------------------------------------------------------- # +@torch.no_grad() +def verify_pooling(cache_dir, n=512, seed=0, tokens_file=""): + """pool_tokens(tokens, proprio) vs the pooled pack z.f16.npy ‖ proprio.f32.npy on n random + frames. Returns dict(max_abs, max_rel, fp16_ok). fp16_ok: every |diff| <= 2 fp16 ulps of the + stored value (the pack is fp16-rounded; the pooling itself is fp32).""" + cache_dir = Path(cache_dir) + z = np.load(cache_dir / "z.f16.npy", mmap_mode="r") + pr = np.load(cache_dir / "proprio.f32.npy", mmap_mode="r") if (cache_dir / "proprio.f32.npy").exists() else None + tf = Path(tokens_file) if tokens_file else cache_dir / "tokens" / "tok.f16.npy" + tok = np.load(tf, mmap_mode="r") + assert tok.shape[0] == z.shape[0], f"tokens {tok.shape[0]} frames vs pooled {z.shape[0]}" + rng = np.random.default_rng(seed) + idx = np.sort(rng.choice(tok.shape[0], size=min(n, tok.shape[0]), replace=False)) + t = torch.from_numpy(np.asarray(tok[idx], np.float32)) + p = torch.from_numpy(np.asarray(pr[idx], np.float32)) if pr is not None else None + got = pool_tokens(t, p).numpy() + ref = np.asarray(z[idx], np.float32) + if p is not None: + ref = np.concatenate([ref, p.numpy()], -1) + assert got.shape == ref.shape, f"pooled dim {got.shape[1]} vs pack {ref.shape[1]}" + diff = np.abs(got - ref) + ulp = np.abs(np.asarray(ref, np.float16)).astype(np.float32) * 2 ** -10 + 1e-6 + ok = bool((diff <= 2 * ulp + 1e-4).all()) + return {"n": int(len(idx)), "dim": int(got.shape[1]), "max_abs": float(diff.max()), + "max_rel": float((diff / (np.abs(ref) + 1e-3)).max()), "fp16_ok": ok, + "frac_within_2ulp": float((diff <= 2 * ulp + 1e-4).mean())} + + +if __name__ == "__main__": + import argparse, json + ap = argparse.ArgumentParser(description="verify pool_tokens against the pooled pack") + ap.add_argument("--cache", required=True); ap.add_argument("--n", type=int, default=512) + ap.add_argument("--tokens", default="") + a = ap.parse_args() + print(json.dumps(verify_pooling(a.cache, a.n, tokens_file=a.tokens), indent=1)) diff --git a/gen_q_rsm/rsm_libero/encode_parquet.py b/gen_q_rsm/rsm_libero/encode_parquet.py new file mode 100644 index 0000000000000000000000000000000000000000..82cc23b17d2ccc2841c2b58aac33eb066bc4a781 --- /dev/null +++ b/gen_q_rsm/rsm_libero/encode_parquet.py @@ -0,0 +1,83 @@ +"""Encode RLinf LeRobot parquet rollouts straight from their RECORDED frames into the +per-episode npz the cache packer consumes (z fp16 [T,4096], proprio [T,8], actions [T,7], +success, prompt, task_index) -- no re-rendering, no EGL. + +The recorded frames ARE the evaluation environment's frames (the collector renders at +cam_res 256 and RLinf stores them upright, i.e. already in the evaluator's serving +orientation), and the parquet `state` equals the evaluator's proprio exactly (checked: +max |state - proprio| = 0 on the existing corpus). The encoder is whatever OGPO_PI05_BASE +points at, so this is how a LIBERO-finetuned pi0.5 (lerobot/pi05_libero_base) becomes the +feature encoder for a new cache; the tag is recorded in every episode. + +usage: OGPO_PI05_BASE= encode_parquet.py --root --out + [--shard i --num-shards n] [--task-file lib10_tasks.txt] +Layout in: /task{t}_block{b}/rank_*/id_{i}/data/chunk-*/episode_{k:06d}.parquet +Layout out: //ep_t{t}_b{b}_i{i}_{k:06d}.npz (same as the existing corpus) +""" +from __future__ import annotations +import argparse, io, os, re, sys, glob, time +from pathlib import Path +import numpy as np +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from eval_closed_loop import BUILDER, ogpo, to224 # the evaluator's own encoder path + +PAT = re.compile(r"task(\d+)_block(\d+)/rank_(\d+)/id_(\d+)/data/chunk-(\d+)/episode_(\d+)\.parquet$") + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--root", required=True); ap.add_argument("--out", required=True) + ap.add_argument("--shard", type=int, default=0); ap.add_argument("--num-shards", type=int, default=1) + ap.add_argument("--batch", type=int, default=64) + ap.add_argument("--task-file", default=os.environ.get("RSM_TASKS_FILE", "")) + a = ap.parse_args() + import torch, pyarrow.parquet as pq + from PIL import Image + from libero.libero import benchmark + dev = "cuda" if torch.cuda.is_available() else "cpu" + enc_tag = os.path.basename(os.path.normpath(os.environ.get("OGPO_PI05_BASE", "pi05_base_pytorch"))) + canon = [n.strip() for n in Path(a.task_file).read_text().replace("\n", ",").split(",") if n.strip()] + bench = benchmark.get_benchmark_dict()["libero_10"]() + lang = {bench.get_task(i).name: bench.get_task(i).language for i in range(bench.n_tasks)} + files = sorted(glob.glob(f"{a.root}/task*_block*/rank_*/id_*/data/chunk-*/episode_*.parquet")) + files = [f for k, f in enumerate(files) if k % a.num_shards == a.shard] + print(f"[enc] encoder={enc_tag} shard {a.shard}/{a.num_shards}: {len(files)} episodes", flush=True) + model = ogpo.build_paligemma(dev) + ids_cache = {} + n_done = n_skip = 0; t0 = time.time() + for k, f in enumerate(files): + m = PAT.search(f) + if not m: + continue + t, b, i, _c, ep = (int(x) for x in (m.group(1), m.group(2), m.group(4), m.group(5), m.group(6))) + tname = canon[t] + op = Path(a.out) / tname / f"ep_t{t}_b{b}_i{i}_{ep:06d}.npz" + if op.exists(): + n_skip += 1; continue + tb = pq.read_table(f, columns=["state", "actions", "is_success", "image", "wrist_image"]) + st = np.asarray(tb.column("state").to_pylist(), np.float32) + ac = np.asarray(tb.column("actions").to_pylist(), np.float32) + succ = bool(np.asarray(tb.column("is_success").to_pylist()).any()) + frames = {} + for cam in ("image", "wrist_image"): + col = tb.column(cam).to_pylist() + frames[cam] = np.stack([to224(np.asarray(Image.open(io.BytesIO(x["bytes"])).convert("RGB"))) + for x in col]) + if t not in ids_cache: + ids_cache[t] = ogpo.tokenize_prompt(lang[tname]) + za = ogpo.encode_frames(model, frames["image"], ids_cache[t], dev, a.batch) + zw = ogpo.encode_frames(model, frames["wrist_image"], ids_cache[t], dev, a.batch) + z = np.concatenate([za, zw], 1).astype(np.float16) + op.parent.mkdir(parents=True, exist_ok=True) + tmp = str(op) + ".tmp.npz" + np.savez(tmp, z=z, proprio=st, actions=ac, success=succ, prompt=ids_cache[t], + task_index=t, encoder=enc_tag, cam_res=256) + os.replace(tmp, op); n_done += 1 + if n_done % 20 == 0: + el = time.time() - t0 + print(f"[enc] {k+1}/{len(files)} done={n_done} skip={n_skip} {el/n_done:.1f}s/ep", flush=True) + print(f"[enc] DONE shard {a.shard}: {n_done} written, {n_skip} existed, encoder={enc_tag}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/encode_t5.py b/gen_q_rsm/rsm_libero/encode_t5.py new file mode 100644 index 0000000000000000000000000000000000000000..daffa4c3fea458ba1fb4305ad79f386e7fcc5114 --- /dev/null +++ b/gen_q_rsm/rsm_libero/encode_t5.py @@ -0,0 +1,52 @@ +"""Encode the ten LIBERO-10 instructions with T5 and cache the vectors. + +Replaces the learned nn.Embedding(n_task) conditioning. An index lookup carries no +information about WHAT the task is: it cannot transfer to a held-out instruction, and it +gives the network a free shortcut so nothing forces the visual latent to represent the +instruction. A frozen T5 embedding conditions on the sentence itself. + +Ten short strings, so this runs once and the result is a few hundred KB. +""" +import argparse, numpy as np, torch, os + +ap = argparse.ArgumentParser() +ap.add_argument("--cache", required=True) +ap.add_argument("--out", required=True) +ap.add_argument("--model", default="google-t5/t5-11b") +ap.add_argument("--pool", default="mean", choices=["mean", "first"]) +a = ap.parse_args() + +m = np.load(f"{a.cache}/meta.npz", allow_pickle=True) +# the cache stores directory names; recover the instruction the way the evaluator does +from libero.libero import benchmark +b = benchmark.get_benchmark_dict()["libero_10"]() +names = [str(t) for t in m["tasks"]] +by_name = {b.get_task(i).name: b.get_task(i).language for i in range(b.n_tasks)} +texts = [by_name.get(n, n.replace("_", " ")) for n in names] +for i, t in enumerate(texts): + print(f" [{i}] {t}", flush=True) + +from transformers import T5EncoderModel, T5Tokenizer +tok = T5Tokenizer.from_pretrained(a.model, legacy=False) +enc = T5EncoderModel.from_pretrained(a.model, torch_dtype=torch.float16).eval() +dev = "cuda" if torch.cuda.is_available() else "cpu" +enc = enc.to(dev) +with torch.no_grad(): + bt = tok(texts, return_tensors="pt", padding=True) + out = enc(input_ids=bt["input_ids"].to(dev), + attention_mask=bt["attention_mask"].to(dev)).last_hidden_state + msk = bt["attention_mask"].to(dev).unsqueeze(-1).float() + vec = ((out.float() * msk).sum(1) / msk.sum(1)) if a.pool == "mean" else out[:, 0].float() +vec = vec.cpu().numpy().astype(np.float32) +np.savez(a.out, emb=vec, tasks=np.array(names, dtype=object), + texts=np.array(texts, dtype=object), model=a.model, pool=a.pool) +print(f"[t5] wrote {a.out} shape={vec.shape} " + f"norm mean={np.linalg.norm(vec,axis=1).mean():.2f}", flush=True) +# sanity: the two LIVING_ROOM_SCENE2 tasks differ only in the objects named +import itertools +D = np.linalg.norm(vec[:, None] - vec[None], axis=-1) +iu = list(itertools.combinations(range(len(vec)), 2)) +d = [(D[i, j], i, j) for i, j in iu] +d.sort() +print(f"[t5] closest pair : t{d[0][1]} / t{d[0][2]} dist {d[0][0]:.2f}") +print(f"[t5] farthest pair : t{d[-1][1]} / t{d[-1][2]} dist {d[-1][0]:.2f}") diff --git a/gen_q_rsm/rsm_libero/encode_t5.sbatch b/gen_q_rsm/rsm_libero/encode_t5.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..2831f345740df0507115747322b2ff02fd1b36e5 --- /dev/null +++ b/gen_q_rsm/rsm_libero/encode_t5.sbatch @@ -0,0 +1,16 @@ +#!/bin/bash +#SBATCH --job-name=encode_t5 +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 --cpus-per-task=8 --mem=120G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/encode_t5.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --out /data/pulkitag/users/rli14/rsm_libero_runs/t5_lib10.npz diff --git a/gen_q_rsm/rsm_libero/eval_closed_loop.py b/gen_q_rsm/rsm_libero/eval_closed_loop.py new file mode 100644 index 0000000000000000000000000000000000000000..278b28a32e077e551b36368a06b488f823f99e71 --- /dev/null +++ b/gen_q_rsm/rsm_libero/eval_closed_loop.py @@ -0,0 +1,1025 @@ +"""Closed-loop LIBERO-10 success rate for an rsm_libero policy. + +Reuses the LANE'S evaluator wholesale -- featurization, env construction, seeding, +task ordering, chunk execution -- and swaps ONLY the policy call. That is +deliberate: the 0.584 +- 0.025 `bcdemos_m120k` bar was produced by +`09032026_latent_head_eval.py`, and a success rate measured by any other harness +is not comparable to it. + +Featurization contract copied exactly from that evaluator: + * ROT180 to serving orientation (`obs[key][::-1, ::-1]`) + * 128 -> 224 bilinear + * per-camera 2048-d pool, agentview ++ wrist -> 4096 + * proprio = eef_pos(3) ++ eef_ori(3) ++ gripper_qpos(2) = 8 + +Features are z-scored with the SAME per-dim statistics the policy trained under, +loaded from the training cache (`feat_stats.npz`). Getting normalisation wrong in +either direction evaluates a good policy off-distribution and is +indistinguishable from the policy being bad, so the stats travel with the run +rather than being reconstructed here. +""" +from __future__ import annotations +import argparse, hashlib, importlib.util, json, os, sys +from pathlib import Path +import numpy as np +import torch + +WT = os.environ.get("RSM_WT", + "/data/pulkitag/hamer_diffusion_policy_project/projects/" + "continual_learning_for_manipulation/.claude/worktrees/08312026_jvq_recap_worktree") +# RSM_WT: the CLM worktree holding scripts/rlinf_jvq (the latent-cache BUILDER). On IBM it +# is /proj/dmfexp/zwhong/rli14_jvq_worktree; the builder itself reads OGPO_PI05_BASE and +# OGPO_TOKENIZER for its weights. +sys.path.insert(0, WT + "/scripts/rlinf_jvq") +sys.path.insert(0, str(Path(__file__).resolve().parent)) + +# build_paligemma / tokenize_prompt / encode_frames live in the latent-cache +# BUILDER; the rollout producer merely imports it under the local name `ogpo`. +# Importing the producer instead gives a module without those attributes, which +# kills the evaluator on its first line of work. This is the SAME builder that +# wrote the training cache -- verified to reproduce it at cos 0.9999 offline and +# 0.9903 from live env frames. +BUILDER = WT + "/scripts/rlinf_jvq/08312026_1110pm_ogpo_latent_cache.py" +_spec = importlib.util.spec_from_file_location("ogpo_cache", BUILDER) +ogpo = importlib.util.module_from_spec(_spec) +sys.modules["ogpo_cache"] = ogpo +_spec.loader.exec_module(ogpo) + +from model import Encoder, FlowPolicy, BCHead, ConcatFlowPolicy +from is_ope import _LatWithProprio + + +def to224(img): + """128 -> 224 bilinear, then ROUND AND CLAMP TO uint8. + + The uint8 quantisation is not cosmetic. The latent cache was built from PIL + uint8 images, so the encoder has only ever seen quantised pixels. Feeding it + the raw float32 interpolation instead shifts the latent by up to 0.31 in a + space whose per-dimension standard deviation is 0.107 -- a three-sigma + perturbation on the dimensions that matter, re-applied at every one of the + ~52 chunk decisions in an episode. Measured: the lane's own 0.584 policy + scores 0/50 through this evaluator with float input and 0.46 through its own + evaluator, which quantises. Cosine similarity (0.999898) hides this entirely, + which is why it was not caught by the featurisation checks. + """ + t = torch.from_numpy(np.ascontiguousarray(img[None])).permute(0, 3, 1, 2).float() + t = torch.nn.functional.interpolate(t, size=(224, 224), mode="bilinear", + align_corners=False) + return t.permute(0, 2, 3, 1).round().clamp(0, 255).byte().numpy()[0] + + +def _eef_ori(obs): + """End-effector orientation as AXIS-ANGLE, matching the cache. + + This was the bug that produced 0% everywhere. The cache's 8-d proprio is + eef_pos(3) ++ ee_ori(3) ++ gripper_qpos(2), and LIBERO's `ee_ori` is + robosuite AXIS-ANGLE. This evaluator previously converted the quaternion to + Euler roll/pitch/yaw, so three of the eight proprio dimensions were a + different quantity at every timestep. The policy still emitted plausible + first actions -- the visual latent dominates the input -- which is why the + featurisation checks, the offline fit and even a bit-exact comparison of the + first action chunk all looked healthy. + + Measured with the lane's own 0.584 policy on task 5: 0/5 through this + evaluator with Euler, 5/5 through theirs with axis-angle, same machine and + same weights. + """ + q = obs.get("robot0_eef_quat") + if q is None: + return np.zeros(3, np.float32) + try: + from robosuite.utils.transform_utils import quat2axisangle + return np.asarray(quat2axisangle(np.asarray(q)), dtype=np.float32) + except Exception: + w = np.clip(q[3], -1, 1) + ang = 2 * np.arccos(abs(w)) + axis = q[:3] / (np.linalg.norm(q[:3]) + 1e-8) + return (axis * ang).astype(np.float32) + + +_oodx = [] # (task, online t=0 feature) when --probe-ood: lets the online region be + # compared against the cached demo and rollout clouds offline + + +# A checkpoint records the cache it trained on. When it was trained on the OTHER cluster, +# resolve that path to the local twin: both caches are packed from the same pinned +# episode list (index-identical, latents bit-identical) and their stats come from the +# same arrays. Extend with RSM_CACHE_REMAP="from1=to1,from2=to2" if a new pair appears. +_CACHE_TWINS = { + "/proj/dmfexp/zwhong/rsm_libero/cache/": "/data/pulkitag/users/rli14/rsm_libero_cache/", + "/data/pulkitag/users/rli14/rsm_libero_cache/": "/proj/dmfexp/zwhong/rsm_libero/cache/", +} + + +def _resolve_cache(path): + import os as _os + p = str(path or "") + if not p or _os.path.exists(p): + return p + pairs = list(_CACHE_TWINS.items()) + for kv in filter(None, _os.environ.get("RSM_CACHE_REMAP", "").split(",")): + a, b = kv.split("=", 1); pairs.append((a, b)) + for a, b in pairs: + if p.startswith(a) and _os.path.exists(b + p[len(a):]): + print(f"[cache] {p} -> {b + p[len(a):]} (cluster twin)", flush=True) + return b + p[len(a):] + return p + + +def _declared_cam_res(ckpt_path): + """What resolution were this checkpoint's latents rendered at? From the checkpoint + itself, else from its cache's RENDER.json / PACK.json. 'UNKNOWN' if neither.""" + import json as _j + try: + ck = torch.load(ckpt_path, map_location="cpu", weights_only=False) + except Exception: + return "UNKNOWN" + if ck.get("cam_res") not in (None, "UNKNOWN"): + return ck["cam_res"] + cache = _resolve_cache((ck.get("config") or {}).get("cache", "")) + for f in ("RENDER.json", "PACK.json"): + try: + v = _j.load(open(f"{cache}/{f}")).get("cam_res") + if v is not None: + return v + except Exception: + pass + return "UNKNOWN" + + +def _declared_encoder(ckpt_path): + """Which feature encoder produced this checkpoint's latents (basename of the + OGPO_PI05_BASE it was built with). Legacy checkpoints predate the tag -> pi05_base_pytorch.""" + import json as _j + try: + ck = torch.load(ckpt_path, map_location="cpu", weights_only=False) + except Exception: + return "UNKNOWN" + if ck.get("encoder"): + return ck["encoder"] + cache = _resolve_cache((ck.get("config") or {}).get("cache", "")) + for f in ("PACK.json", "RENDER.json"): + try: + v = _j.load(open(os.path.join(cache, f))).get("encoder") + if v: return v + except Exception: + pass + return "pi05_base_pytorch" + + +def _guard_encoder(args): + """Refuse to evaluate with a feature encoder different from the one the latents were + encoded with (the 128/256 lesson applied to the encoder weights themselves).""" + mine = os.path.basename(os.path.normpath(os.environ.get("OGPO_PI05_BASE", "pi05_base_pytorch"))) + bad = [] + for label, path in (("policy", args.policy), ("policy2", getattr(args, "policy2", "")), ("critic", args.critic), + ("qf-ckpt", args.qf_ckpt), ("hop-policy", getattr(args, "hop_policy", ""))): + if not path: + continue + v = _declared_encoder(path) + if v != mine: + bad.append(f"{label} {path}: latents from encoder '{v}', evaluator encoder '{mine}'") + if bad and not args.allow_cam_mismatch: + raise SystemExit("[guard] ENCODER MISMATCH -- refusing:\n " + "\n ".join(bad)) + for b in bad: + print(f"[guard] OVERRIDDEN encoder mismatch: {b}", flush=True) + + +def _guard_render_resolution(args): + """Refuse to evaluate a policy/critic at a resolution its latents were not rendered + at. This is the defect that voided every result before 2026-09-13 (i251): rollout + latents at 256, evaluator at 128, and nothing complained.""" + bad = [] + for label, path in (("policy", args.policy), ("critic", args.critic), ("qf-ckpt", args.qf_ckpt), ("hop-policy", getattr(args, "hop_policy", ""))): + if not path: + continue + v = _declared_cam_res(path) + if v == "UNKNOWN": + # trusting an undeclared checkpoint is exactly how the 128/256 mismatch ran + # unnoticed for weeks; undeclared is refused like a mismatch + bad.append(f"{label} {path}: render resolution UNDECLARED (no cam_res in checkpoint " + f"or in its cache's RENDER.json/PACK.json)") + elif str(v) != str(args.cam_res): + bad.append(f"{label} {path}: latents rendered at {v}, evaluator at {args.cam_res}") + if bad and not args.allow_cam_mismatch: + raise SystemExit("[guard] RENDER RESOLUTION MISMATCH -- refusing:\n " + "\n ".join(bad) + + "\n (--allow-cam-mismatch 1 to override; never for a reported number)") + for b in bad: + print(f"[guard] OVERRIDDEN mismatch: {b}", flush=True) + + +def load_policy(critic_path, policy_path, n_task, device, lane_norm=""): + """Encoder from the critic checkpoint + the trained policy. + + The policy may read the FULL observation (`policy_features=raw`, the default + since the reward-predictive bottleneck was found to strip action detail) or + the critic latent. Which one is recorded in the policy checkpoint, so the + evaluator can never feed a policy the features it was not trained on. + """ + d_in = 4096 + 8 + pk = torch.load(policy_path, map_location=device, weights_only=False) + + # HARNESS CONTROL: a lane checkpoint (key "model") is wrapped so it runs + # through THIS evaluator unchanged. If it reproduces the score its own + # evaluator gives, this harness is proven equivalent and any 0% belongs to + # our training rather than to deployment. + if "model" in pk: + import importlib.util as _il + _sp = _il.spec_from_file_location("lh", WT + "/scripts/rlinf_jvq/" + "09032026_latent_head_bc.py") + _lh = _il.module_from_spec(_sp); sys.modules["lh"] = _lh + _sp.loader.exec_module(_lh) + c = pk["config"] + head = _lh.Head(4096, 8, len(_lh.FS15), c["hidden"], c["depth"], + c["chunk"]).to(device) + head.load_state_dict(pk["model"]); head.eval() + if not lane_norm: + raise SystemExit("a lane checkpoint needs --lane-norm ") + nz = np.load(lane_norm) + zm = torch.tensor(nz["zm"], dtype=torch.float32, device=device) + zs = torch.tensor(nz["zs"], dtype=torch.float32, device=device) + pm = torch.tensor(nz["pm"], dtype=torch.float32, device=device) + ps = torch.tensor(nz["ps"], dtype=torch.float32, device=device) + + class _LaneWrap(torch.nn.Module): + """Exposes the lane Head through our (pfeat, sample) interface.""" + d_act = c["chunk"] * 7 + + def __init__(self): + super().__init__(); self.h = head; self.chunk = c["chunk"] + + @torch.no_grad() + def sample(self, x, task): + z = (x[:, :4096] - zm) / zs + pr = (x[:, 4096:] - pm) / ps + adv = torch.full((x.shape[0],), 2, dtype=torch.long, device=x.device) + a = torch.randn(x.shape[0], self.chunk, 7, device=x.device) + for st in range(10): + kk = torch.full((x.shape[0],), 1 - st / 10, device=x.device) + a = a + self.h(z, pr, task, adv, a, kk).view_as(a) / 10 + return a.flatten(1) + + mu0 = torch.zeros(d_in, device=device); sd1 = torch.ones(d_in, device=device) + return ((lambda x: x), _LaneWrap(), c["chunk"], {"d_z": 0}, "lane", + d_in, (mu0, sd1)) + # the exact transform the policy trained under -- never re-derived here + # the stats file must match the pool the policy trained under + _np = pk["config"].get("norm_pool", "all") + st = Path(_resolve_cache(pk["config"].get("cache", ""))) / ( + "feat_stats.npz" if _np == "all" else f"feat_stats_{_np}.npz") + if not st.exists(): + raise FileNotFoundError( + f"feature stats missing: {st}. The policy was trained on normalised " + f"features; evaluating it on raw ones is off-distribution.") + _s = np.load(st) + if int(_s["dim"]) != d_in: + raise ValueError(f"feat_stats dim {int(_s['dim'])} != evaluator dim {d_in}") + nmu = torch.tensor(_s["mu"], dtype=torch.float32, device=device) + nsd = torch.tensor(_s["sd"], dtype=torch.float32, device=device) + # A raw-feature policy trains on CENTERED input, which the data layer + # produces by z-scoring and then rescaling the visual block back by + # sd / mean(sd). Rebuilt here from the same stats file so the evaluator and + # is_ope.policy_features cannot drift apart. Proprio (last 8 dims) keeps its + # per-dim z-score. + _sd = np.asarray(_s["sd"], np.float32) + _sc = np.ones(d_in, np.float32) + _sc[:4096] = _sd[:4096] / max(float(_sd[:4096].mean()), 1e-6) + nsc = torch.tensor(_sc, dtype=torch.float32, device=device) + if pk["config"].get("policy_features", "latent") == "raw": + # a raw-feature policy needs no encoder at all, so a BC arm evaluates + # without ever loading a critic + cls = (ConcatFlowPolicy + if pk["config"].get("policy_family", "flow") == "concat" + else FlowPolicy) + _kw = {} + if pk["config"].get("policy_family", "flow") == "concat": + _kw = dict(width=int(pk["config"].get("pol_width", 1024) or 1024), + depth=int(pk["config"].get("pol_depth", 4) or 4)) + pol = cls(d_in, pk["config"]["chunk"] * 7, n_task, **_kw).to(device) + pol.load_state_dict(pk["pol"]); pol.eval() + return ((lambda x: x * nsc), pol, pk["config"]["chunk"], {"d_z": 0}, + "raw", d_in, (nmu, nsd)) + if not critic_path: + raise SystemExit("this policy reads latent features; pass --critic") + ck = torch.load(critic_path, map_location=device, weights_only=False) + c = ck["config"] + n_pr = int(ck.get("n_pr", 0) or 0) + base = Encoder(d_in, c["d_z"], c["enc_width"]).to(device) + base.load_state_dict(ck["enc"]) + pcfg = pk["config"] + chunk = pcfg["chunk"] + mode = pcfg.get("policy_features", "latent") + + mu = sd = torch.zeros(0, device=device) + if n_pr: + # proprio normalisation must come from the cache the CRITIC was fit on, + # not a hard-coded path: different caches have different proprio stats. + pcache = Path(pcfg.get("cache", "")) / "proprio.f32.npy" + if not pcache.exists(): + raise FileNotFoundError(f"proprio stats cache missing: {pcache}") + pr = np.asarray(np.load(pcache, mmap_mode="r")[::37], np.float32) + mu = torch.tensor(pr.mean(0), device=device) + sd = torch.tensor(pr.std(0) + 1e-6, device=device) + enc = _LatWithProprio(base, n_pr, mu, sd).to(device).eval() + + if mode == "raw": + pfeat, d_lat = (lambda x: x), d_in + else: + pfeat, d_lat = enc, c["d_z"] + n_pr + + cls = (ConcatFlowPolicy if pcfg.get("policy_family", "flow") == "concat" + else FlowPolicy) + pol = cls(d_lat, chunk * 7, n_task).to(device) + pol.load_state_dict(pk["pol"]) + pol.eval() + return pfeat, pol, chunk, c, mode, d_lat, (nmu, nsd) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--critic", default="", + help="only needed when the policy reads latent features") + ap.add_argument("--policy", required=True) + ap.add_argument("--tasks", default="0,1,2,3,4,5,6,7,8,9") + ap.add_argument("--n-init", type=int, default=10) + ap.add_argument("--execute", type=int, default=10) + ap.add_argument("--max-steps", type=int, default=520) + ap.add_argument("--suite", default="libero_10") + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--policy-seed", type=int, default=0) + ap.add_argument("--fresh", type=int, default=0) + ap.add_argument("--qf-gate", type=float, default=0.0, + help="only OVERRIDE the policy's own action when the best " + "candidate beats it by more than this margin in Q units. " + "0 = always take the arg-max (plain ranking, 0.550); a " + "large value never fires and reduces exactly to the " + "policy (0.630). The ranker is weak on average -- " + "expert-vs-perturbation wins only 0.515 at small " + "perturbations -- so acting on it only where it is " + "confident is the way to use it without paying for its " + "average quality.") + ap.add_argument("--policy-sde", type=float, default=0.0, + help="noise injected DURING integration when --q-filter is " + "on. Unlike --policy-temp this follows the learned " + "drift, so candidates stay near the manifold. Measured: " + "test-time ranking (0.550) beats distilling the selected " + "actions (0.410), because distillation replaces the " + "policy while ranking only picks among its own samples.") + ap.add_argument("--policy-sde-anneal", type=int, default=0, + help="1 = scale --policy-sde noise by the remaining noise " + "fraction so the last integration steps are clean.") + ap.add_argument("--policy-temp", type=float, default=1.0, + help="scales the proposal's initial noise when --q-filter is " + "on. A trained flow clone samples at action std 0.029 " + "against the data's 0.421, so 8 candidates are near " + "copies and there is nothing to rank. Diversity only " + "pays once the ranker has the right SIGN, which the " + "supervised student Q does and our counterfactual Q did " + "not.") + ap.add_argument("--qf-ckpt", default="", + help="main_rsm.pt from rsm_main.py. Ranks --q-filter candidate " + "chunks by the DISTILLED student qf(z,a), which main " + "supervises on real (s,a,s') transitions, instead of by " + "conditioning the occupancy on a counterfactual action.") + ap.add_argument("--save-frames", default="", + help="directory to write per-episode agentview JPEG strips. Lets a " + "closed-loop FAILURE be inspected: the scalar SR says an arm " + "lost an episode, not what the arm did wrong.") + ap.add_argument("--frame-stride", type=int, default=12) + ap.add_argument("--init-jitter", type=float, default=0.0, + help="metres of uniform xy perturbation applied to every object " + "free joint after reset. BOTH stock init states and env.reset() " + "are narrow (std 0.024 / 0.014), and both sit inside " + "BC-on-demos's training support, so neither tests whether a " + "demo-trained policy degrades off-support. This widens the " + "initial-state distribution explicitly. Applies to A and B " + "alike; 0 = off.") + ap.add_argument("--select", default="argmaxq", + choices=["argmaxq", "random", "medoid", "qnear", "quantile", "randgate"], + help="how to pick among the --q-filter candidates. argmaxq uses " + "the critic. random picks uniformly (must reproduce plain BC, " + "and is the sanity check that the harness adds nothing). " + "medoid picks the candidate nearest the other N-1, a " + "CRITIC-FREE variance reducer -- if best-of-N helps for any " + "reason other than value, medoid captures it, and any gain " + "over medoid is what the critic actually contributes.") + ap.add_argument("--demo-cand", type=int, default=0, + help="append this many nearest-DEMO action chunks to the " + "candidate set, retrieved by L2 in the same normalised " + "feature space the policy reads. The ranker is otherwise " + "confined to the proposal's own support: 8 samples from a " + "flow with action std 0.029 against the data's 0.421 are " + "near-copies, so even a perfect ranker has nothing to " + "choose. Demo chunks are off-proposal but ON-manifold, " + "unlike --policy-sde noise which cost 0.22.") + ap.add_argument("--q-filter", type=int, default=0, + help="sample this many action chunks from the policy and " + "execute the one the RSM critic scores highest. 0 = off. " + "Uses the occupancy model at DEPLOYMENT, which needs only " + "a critic that RANKS actions, not one that is calibrated.") + ap.add_argument("--qf-beta", type=float, default=0.97, + help="hop length for the filter, inside the critic's training " + "band [0.85, 0.97]; 0.97 looks ~33 frames ahead") + ap.add_argument("--qf-depth", type=int, default=1, + help="depth 1 needs no continuation policy: the recursion " + "breaks before it would have to re-draw an action in a " + "latent the flow only imagined") + ap.add_argument("--qf-particles", type=int, default=16) + ap.add_argument("--qf-mode", default="restart", choices=["restart", "fold"], + help="restart: geometric mixture of beta-hops (restart prob " + "(gamma-beta)/(gamma(1-beta))) = the gamma-occupancy, reward read " + "once at the stopping state. fold: the OCBench product fold " + "Q_k = c_k + (1-c_k) gamma^(1/(1-beta)) Q_{k+1} over a FIXED " + "number of hops (--qf-depth).") + ap.add_argument("--policy2", default="", + help="second proposer checkpoint; --q-filter2 of its samples are appended " + "to the candidate set (test-time stitching of two policies)") + ap.add_argument("--q-filter2", type=int, default=0) + ap.add_argument("--select-q", type=float, default=0.9, + help="select=quantile: execute the candidate at this quantile of Q " + "(rank round(q*(N-1)) in ascending order) instead of the arg-max.") + ap.add_argument("--qf-crn", type=int, default=0, + help="1 = common random numbers across candidates in the Q " + "recursion (same flow noise / restart coins / hop-policy noise " + "for particle i of every candidate), so the arg-max compares " + "paired estimates. Independent draws rank near-copies by noise.") + ap.add_argument("--qnear-k", type=int, default=4, + help="select=qnear: arg-max Q among the K candidates nearest the medoid") + ap.add_argument("--hop-policy", default="", + help="bc_arm checkpoint trained with --policy-features latent over the " + "SAME critic encoder. Required for --qf-depth >= 2: the beta-hop " + "composition continues the trajectory from the sampled latent z' " + "with pi(a|z'), and the raw-feature proposer cannot read z'.") + ap.add_argument("--qf-pessimism", type=float, default=2.0) + ap.add_argument("--partial-only", type=int, default=0, + help="write only .partial.t files; the final JSON is left to an assembly run") + ap.add_argument("--allow-cam-mismatch", type=int, default=0, + help="override the render-resolution guard. Never for a reported number.") + ap.add_argument("--init-source", default="libero", choices=["libero", "demo", "rollout"], + help="where episode k's initial state comes from. libero = the stock " + "init_states (protocol A) or env.reset() (protocol B); demo = the " + "EXACT first sim state of demo k from the LIBERO hdf5; rollout = the " + "first sim_state of the k-th cached rollout of this task.") + ap.add_argument("--save-video-frames", default="", + help="dir: write full-res agentview frames (uint8, every --video-stride " + "steps) per episode, for mp4 export") + ap.add_argument("--video-stride", type=int, default=2) + ap.add_argument("--cam-res", type=int, default=256, + help="render resolution of both cameras. 128 is the LIBERO demo-hdf5 " + "convention and what the demo cache was encoded from; 256 is what " + "RLinf's libero_10 env (the lane's evaluator AND the rollout " + "collector) uses, i.e. the space the 43k rollout latents live in. " + "A policy must be evaluated at the resolution its latents were " + "encoded at, or it is off-support from step 1 (i251).") + ap.add_argument("--probe-ood", type=int, default=0, + help="print the first decision's action scale per episode. Default " + "off so queued evals are unaffected.") + ap.add_argument("--lane-norm", default="", + help="norm npz for a lane checkpoint run as a harness control") + ap.add_argument("--out", required=True) + args = ap.parse_args() + _guard_render_resolution(args) + _guard_encoder(args) + + dev = "cuda" if torch.cuda.is_available() else "cpu" # an assembly run (all tasks in partials) needs no GPU + tower = ogpo.build_paligemma(dev) + from libero.libero import benchmark, get_libero_path + from libero.libero.envs import OffScreenRenderEnv + import time as _time + _T0 = _time.time() + def _lap(msg): + print(f"[eval][t+{_time.time()-_T0:6.0f}s] {msg}", flush=True) + bench = benchmark.get_benchmark_dict()[args.suite]() + _lap("imports + benchmark ready") + + canon = [n.strip() for n in Path( + os.environ.get("RSM_TASKS_FILE", + "/data/pulkitag/hamer_diffusion_policy_project/projects/" + "continual_learning_for_manipulation/logs/09052026_lib10_tasks.txt") + ).read_text().replace("\n", ",").split(",") if n.strip()] + by_name = {t: i for i, t in enumerate(canon)} + + pfeat, pol, chunk, ccfg, pmode, d_lat, (nmu, nsd) = load_policy( + args.critic, args.policy, len(canon), dev, lane_norm=args.lane_norm) + _lap("policy (+encoder) loaded") + pol2 = pfeat2 = None + if args.policy2: + # Second proposer: its candidates are appended to the first's, so the selector + # can stitch between a narrow strong policy (demos) and a broad one (successes) + # per decision. Both must share the feature normalisation (checked). + pfeat2, pol2, chunk2, _c2, _m2, _d2, (nmu2, nsd2) = load_policy( + args.critic, args.policy2, len(canon), dev, lane_norm=args.lane_norm) + if chunk2 != chunk or not torch.allclose(nmu2, nmu) or not torch.allclose(nsd2, nsd): + raise SystemExit("--policy2 must share chunk length and feature normalisation with --policy") + print(f"[eval] second proposer: {args.policy2} x {args.q_filter2} candidates", flush=True) + + qf = None + gate_stats = {"fire": 0, "hold": 0} + if args.q_filter and args.qf_ckpt and torch.load(args.qf_ckpt, map_location="cpu", + weights_only=False).get("iql_q"): + # IQL baseline, ranked with EXACTLY the RSM arm's best-of-N machinery: same + # proposal policy, same N, same arg-max; only the source of Q differs. The IQL + # Q reads the frozen encoder of the RSM critic it was trained against. + from iql import QNet as _QNet + from is_ope import load_critic as _lc + from data import LiberoRSMData + ck = torch.load(args.qf_ckpt, map_location=dev, weights_only=False) + _pc = torch.load(args.policy, map_location="cpu", weights_only=False)["config"] + _dq = LiberoRSMData(_resolve_cache(_pc["cache"]), chunk=chunk, seed=0, in_ram=False, + reward_mode="dense", norm_pool=_pc.get("norm_pool", "all")) + _enc, _r, _f, _rms, _cfg = _lc(_resolve_cache(ck["critic"]), _dq.feat_dim, _dq.n_task, dev, data=_dq) + _enc.eval() + _qc = ck.get("config") or {} + qnet = _QNet(ck["d_z"], ck["d_act"], ck["n_task"], width=int(_qc.get("width", 512) or 512), + depth=int(_qc.get("depth", 3) or 3)).to(dev) + qnet.load_state_dict(ck["q"]); qnet.eval() + + def qf(x_norm, tt, cand): + z = _enc(x_norm).expand(cand.shape[0], -1) + q = qnet(z, cand, tt.expand(cand.shape[0])) + if args.select == "quantile": + # Rank the candidates by Q and execute the one at quantile --select-q + # (0.9 of 8 -> the 2nd best, of 32 -> the 4th best). The arg-max is the + # candidate most exposed to off-support optimism; a high-but-not-top + # quantile keeps a strongly-scored action while discarding the extreme. + _order = torch.argsort(q) # ascending + _r = int(round(args.select_q * (cand.shape[0] - 1))) + gate_stats["fire"] += 1 + return int(_order[min(max(_r, 0), cand.shape[0] - 1)]) + best = int(q.argmax()) + if args.qf_gate > 0 and float(q[best] - q[0]) < args.qf_gate: + gate_stats["hold"] += 1 + return 0 + gate_stats["fire"] += 1 + return best + print(f"[eval] IQL Q reader ON: {args.q_filter} candidates (tau={ck['config'].get('tau')})", flush=True) + elif args.q_filter and args.qf_ckpt: + # main's reader: a student Q supervised on logged transitions. + from model import Encoder as _Enc + from rsm_main import QStudent + ck = torch.load(args.qf_ckpt, map_location=dev, weights_only=False) + c = ck["config"] + qenc = _Enc(4096 + 8, c["d_z"], c["enc_width"]).to(dev) + qenc.load_state_dict(ck["enc"]); qenc.eval() + qnet = QStudent(c["d_z"], ck["d_act"], len(canon)).to(dev) + qnet.load_state_dict(ck["qf"]); qnet.eval() + + def qf(x_norm, tt, cand): + z = qenc(x_norm).expand(cand.shape[0], -1) + q = qnet(z, cand, tt.expand(cand.shape[0])) + best = int(q.argmax()) + # candidate 0 is an ordinary draw from the policy: the default action + if args.qf_gate > 0 and float(q[best] - q[0]) < args.qf_gate: + gate_stats["hold"] += 1 + return 0 + gate_stats["fire"] += 1 + return best + print(f"[eval] qf reader ON: {args.q_filter} candidates, student Q " + f"(arrival AUC {ck.get('arrival_auc', float('nan')):.4f})", flush=True) + elif args.q_filter and args.select not in ("argmaxq", "qnear", "quantile"): # randgate/medoid/random are critic-free + qf = None # critic-free selector; no critic needed + print(f"[eval] CRITIC-FREE selector '{args.select}' over " + f"{args.q_filter} candidates", flush=True) + elif args.q_filter: + if not args.critic: + raise SystemExit("--q-filter needs --critic or --qf-ckpt") + from data import LiberoRSMData + from is_ope import load_critic, q_recursive + pcfg_cache = torch.load(args.policy, map_location="cpu", + weights_only=False)["config"] + _d = LiberoRSMData(_resolve_cache(pcfg_cache["cache"]), chunk=chunk, seed=0, in_ram=False, + reward_mode="dense", + norm_pool=pcfg_cache.get("norm_pool", "all")) + q_enc, q_rew, q_flow, q_rms, q_cfg = load_critic( + args.critic, _d.feat_dim, _d.n_task, dev, data=_d) + + hop_pol = None + if args.qf_depth >= 2: + if not args.hop_policy: + raise SystemExit("--qf-depth >= 2 needs --hop-policy (latent-feature BC over the critic encoder)") + from is_ope import make_policy as _mk + _hk = torch.load(args.hop_policy, map_location=dev, weights_only=False) + _hc = _hk["config"] + if _hc.get("policy_features") != "latent": + raise SystemExit(f"--hop-policy must be a --policy-features latent checkpoint (got {_hc.get('policy_features')})") + class _HA: pass + _ha = _HA(); [setattr(_ha, k, v) for k, v in _hc.items()] + hop_pol = _mk(_ha, _d, dev, d_z=q_cfg["d_z"]) + hop_pol.load_state_dict(_hk["pol"]); hop_pol.eval() + print(f"[eval] beta-hop policy loaded: {args.hop_policy} (depth {args.qf_depth}, " + f"restart p={(0.99 - args.qf_beta) / (0.99 * (1 - args.qf_beta)):.3f})", flush=True) + + from is_ope import q_fold + if args.qf_mode == "fold": + print(f"[eval] Q = OCBench product fold, depth {args.qf_depth}, " + f"gamma^h = {0.99 ** (1 / (1 - args.qf_beta)):.3f} per hop, crn={args.qf_crn}", flush=True) + def qf(x_norm, tt, cand): + """cand: [N, chunk*7] -> index of the highest-scoring chunk.""" + z = q_enc(x_norm).expand(cand.shape[0], -1) + if args.qf_mode == "fold": + q, _ = q_fold(z, cand, tt.expand(cand.shape[0]), + rew=q_rew, flow=q_flow, rms=q_rms, pol=hop_pol, + beta=args.qf_beta, gamma=0.99, depth=args.qf_depth, + n_particles=args.qf_particles, crn=bool(args.qf_crn)) + else: + q, _ = q_recursive(z, cand, tt.expand(cand.shape[0]), + rew=q_rew, flow=q_flow, rms=q_rms, pol=hop_pol, + wend=None, beta=args.qf_beta, gamma=0.99, + depth=args.qf_depth, n_particles=args.qf_particles, + use_is=False, pessimism=args.qf_pessimism, + crn=bool(args.qf_crn)) + if args.select == "qnear": + # Support-constrained arg-max: the critic orders only the K candidates + # nearest the medoid. Measured failure of plain arg-max: off-support + # candidates draw diffuse futures whose read-out drifts to the base rate + # and outranks confident low scores on real actions; the medoid never + # selects those outliers, and beat plain arg-max on B by 0.05-0.08. + _dd = torch.cdist(cand, cand).sum(1) + _near = torch.topk(-_dd, k=min(args.qnear_k, cand.shape[0])).indices + best = int(_near[q[_near].argmax()]) + gate_stats["fire"] += 1 + return best + if args.select == "quantile": + # Rank the candidates by Q and execute the one at quantile --select-q + # (0.9 of 8 -> the 2nd best, of 32 -> the 4th best). The arg-max is the + # candidate most exposed to off-support optimism; a high-but-not-top + # quantile keeps a strongly-scored action while discarding the extreme. + _order = torch.argsort(q) # ascending + _r = int(round(args.select_q * (cand.shape[0] - 1))) + gate_stats["fire"] += 1 + return int(_order[min(max(_r, 0), cand.shape[0] - 1)]) + best = int(q.argmax()) + if args.qf_gate > 0 and float(q[best] - q[0]) < args.qf_gate: + gate_stats["hold"] += 1 + return 0 + gate_stats["fire"] += 1 + return best + print(f"[eval] Q-filter ON: {args.q_filter} candidates, beta={args.qf_beta}, " + f"depth={args.qf_depth}, pessimism={args.qf_pessimism}, " + f"gate={args.qf_gate}", flush=True) + print(f"[eval] chunk={chunk} policy_features={pmode} d_policy={d_lat} " + f"suite={args.suite}", flush=True) + _lap("critic / selector ready") + + demo_bank = None + if args.demo_cand > 0: + import numpy as _np + pcfg_c = torch.load(args.policy, map_location="cpu", + weights_only=False)["config"] + _ca = pcfg_c["cache"] + _m = _np.load(f"{_ca}/meta.npz", allow_pickle=True) + _isd = _m["ep_demo"].astype(bool) + if not _isd.any(): + raise SystemExit("--demo-cand: cache has no demo episodes") + _zs = _np.load(f"{_ca}/z.f16.npy", mmap_mode="r") + _pr = _np.load(f"{_ca}/proprio.f32.npy", mmap_mode="r") + _ac = _np.load(f"{_ca}/act.f32.npy", mmap_mode="r") + _idx = [] + for _e in _np.where(_isd)[0]: + _lo, _hi = int(_m["ep_from"][_e]), int(_m["ep_to"][_e]) + # only frames with a full chunk ahead inside the same episode + if _hi - _lo > chunk: + _idx.append(_np.arange(_lo, _hi - chunk)) + _idx = _np.concatenate(_idx) + _f = _np.concatenate([_np.asarray(_zs[_idx], _np.float32), + _np.asarray(_pr[_idx], _np.float32)], 1) + _f = torch.tensor(_f, device=dev) + _f = ((_f - nmu) / nsd).half() # identical transform to x + _off = _np.arange(chunk)[None, :] + _idx[:, None] + _A = torch.tensor(_np.asarray(_ac[_off], _np.float32).reshape(len(_idx), -1), + device=dev) + demo_bank = (_f, _A) + print(f"[eval] demo-cand ON: {args.demo_cand} nearest of " + f"{len(_idx)} demo frames appended to each candidate set", flush=True) + + demo_pick = {"demo": 0, "policy": 0} + mix_pick = {"p1": 0, "p2": 0} + results, episodes = {}, {} + # Resume from a preempted run: tasks already finished are in .partial. On IBM's + # preemptable queue an hour-long eval is interrupted every ~30 min; without this it + # never completes. Episodes within a task are re-run (seeds are per-episode, so the + # completed tasks are unaffected by where the restart happens). + import glob as _glob + for _pp in sorted(_glob.glob(args.out + ".partial*")): + try: + _pj = json.loads(Path(_pp).read_text()) + results.update(_pj.get("results", {})); episodes.update(_pj.get("episodes", {})) + except Exception as _e: + print(f"[eval] partial file {_pp} unreadable ({_e}); ignored", flush=True) + if results: + print(f"[eval] RESUMED: {len(results)} tasks already done from partial files", flush=True) + for tid in [int(x) for x in args.tasks.split(",")]: + task = bench.get_task(tid) + tname = task.name + if tname in results: + print(f"[eval] t{tid} {tname[:40]}: done in a previous run (SR {results[tname]:.2f}), skipping", flush=True) + continue + if tname not in by_name: + raise ValueError(f"task {tid} ({tname}) not in the canonical libero_10 list") + thead = by_name[tname] + ids = ogpo.tokenize_prompt(task.language) + inits = bench.get_task_init_states(tid) + if args.init_source == "demo": + import h5py as _h5 + with _h5.File(f"/data/pulkitag/users/rli14/libero_datasets/libero_10/{tname}_demo.hdf5", "r") as _H: + _ks = sorted(_H["data"].keys(), key=lambda q: int(q.split("_")[1])) + inits = [np.asarray(_H["data"][q]["states"][0]) for q in _ks] + print(f"[eval] t{tid}: {len(inits)} EXACT demo initial states from hdf5", flush=True) + elif args.init_source == "rollout": + import pyarrow.parquet as _pq, re as _re + _m = np.load("/data/pulkitag/users/rli14/rsm_libero_cache/full_demo_cam256/meta.npz", allow_pickle=True) + _PAT = _re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") + inits = [] + for _e in np.where((_m["ep_task"] == tid) & ~_m["ep_demo"].astype(bool))[0]: + _g = _PAT.search(str(_m["ep_src"][_e])); _t, _b, _i, _x = _g.groups() + _pp = (f"/data/pulkitag/users/rli14/pi05_lib10_sde_v1/task{int(_t)}_block{int(_b)}" + f"/rank_0/id_{int(_i)}/data/chunk-000/episode_{int(_x):06d}.parquet") + if not Path(_pp).exists(): continue + inits.append(np.asarray(_pq.read_table(_pp, columns=["sim_state"])["sim_state"][0].as_py())) + if len(inits) >= args.n_init: break + print(f"[eval] t{tid}: {len(inits)} rollout initial sim_states from parquet", flush=True) + _lap(f"t{tid}: creating env") + env = OffScreenRenderEnv( + bddl_file_name=str(Path(get_libero_path("bddl_files")) + / task.problem_folder / task.bddl_file), + camera_heights=args.cam_res, camera_widths=args.cam_res) + _lap(f"t{tid}: env ready") + _objn, _objb, _target = [], [], [] + if args.save_frames: + try: + _objn = list(env.env.obj_body_id.keys()) + _objb = [env.env.obj_body_id[n] for n in _objn] + _target = list(env.env.obj_of_interest) + print(f"[eval] t{tid} objects={_objn} target={_target}", flush=True) + except Exception as _e: + print(f"[eval] object handles unavailable: {_e}", flush=True) + succ, episodes[tname] = [], [] + # Per-episode progress: the EGL driver on IBM aborts the process (SIGABRT, no + # traceback) at random points DURING a task, not only at teardown, so a 50-episode + # task job that dies at episode 40 must not redo 40 episodes. Every finished + # episode is appended to .progress.t; a restarted job reloads it and + # skips those episode indices (inits are seeded per (seed, tid, k), so the + # remaining episodes are the same ones the dead job would have run). + _prog = Path(args.out + f".progress.t{tid}") + _done_k = set() + try: + if _prog.exists(): + for _e in json.loads(_prog.read_text()): + if int(_e["episode"]) < args.n_init and int(_e["episode"]) not in _done_k: + episodes[tname].append(_e); succ.append(bool(_e["success"])) + _done_k.add(int(_e["episode"])) + if _done_k: + print(f"[eval] t{tid}: resumed {len(_done_k)} episodes from {_prog.name}", flush=True) + except Exception as _e: + print(f"[eval] t{tid}: progress file unreadable ({_e}); starting over", flush=True) + episodes[tname], succ, _done_k = [], [], set() + for k in range(args.n_init): + if k in _done_k: + continue + pseed = 7_919_003 + args.policy_seed * 500_009 + tid * 1_013 + k + torch.manual_seed(pseed); torch.cuda.manual_seed_all(pseed) + np.random.seed(args.seed * 100003 + tid * 1009 + k) + if hasattr(env, "seed"): + env.seed(args.seed * 100003 + tid * 1009 + k) + env.reset() + if args.init_source != "libero": + env.env.sim.set_state_from_flattened(np.asarray(inits[k % len(inits)], np.float64)) + env.env.sim.forward() + elif not args.fresh: + env.set_init_state(inits[k % len(inits)]) + if args.init_jitter > 0: + # Perturb object free joints only. mjtJoint FREE == 0; its qpos block is + # [x, y, z, qw, qx, qy, qz], so writing indices 0-1 moves the object in + # the table plane without touching height or orientation (which would + # make the state unphysical). The robot is welded in LIBERO, so free + # joints are exactly the manipulable objects. + _sim = env.env.sim + _st = np.asarray(_sim.get_state().flatten()).copy() + _nq = _sim.model.nq + _rs = np.random.RandomState( + 987_631 + args.seed * 7919 + tid * 131 + k) + _moved = 0 + for _j in range(_sim.model.njnt): + if int(_sim.model.jnt_type[_j]) != 0: + continue + _a = int(_sim.model.jnt_qposadr[_j]) + if _a + 1 >= _nq: + continue + _st[1 + _a] += _rs.uniform(-args.init_jitter, args.init_jitter) + _st[1 + _a + 1] += _rs.uniform(-args.init_jitter, args.init_jitter) + _moved += 1 + _sim.set_state_from_flattened(_st) + _sim.forward() + for _ in range(5): # let contacts settle onto the table + _sim.step() + if tid == 0 and k == 0: + print(f"[eval] init-jitter {args.init_jitter*100:.1f} cm on " + f"{_moved} object free joints", flush=True) + done, steps = False, 0 + _frames, _geo, _vid = [], [], [] + obs, _, _, _ = env.step(np.zeros(7)) + init_hash = hashlib.sha256( + np.asarray(env.env.sim.get_state().flatten()).tobytes()).hexdigest() + while steps < args.max_steps and not done: + cams = [] + for key in ("agentview_image", "robot0_eye_in_hand_image"): + img = obs[key][::-1, ::-1] + cams.append(to224(img)[None]) + if args.save_video_frames and steps % args.video_stride == 0: + _vid.append(np.asarray(obs["agentview_image"][::-1, ::-1], np.uint8).copy()) + if args.save_frames and steps % args.frame_stride == 0: + _frames.append(np.asarray(obs["agentview_image"][::-1, ::-1]).copy()) + # geometry for offline failure typing: where the hand is, whether it + # is closed, and where every object is. obj_of_interest names the + # BDDL goal's target, so "went to the wrong object" is measurable + # without touching a network. + _ee = np.asarray(obs["robot0_eef_pos"], np.float32) + _gq = np.asarray(obs["robot0_gripper_qpos"], np.float32) + _op = np.stack([np.asarray(env.env.sim.data.body_xpos[_b], np.float32) + for _b in _objb]) if _objb else np.zeros((0, 3), np.float32) + _geo.append(np.concatenate([_ee, _gq[:2], _op.reshape(-1)])) + z = np.concatenate( + [ogpo.encode_frames(tower, c, ids, dev, 2) for c in cams], axis=1)[0] + prop = np.concatenate([ + obs["robot0_eef_pos"], _eef_ori(obs), obs["robot0_gripper_qpos"], + ]).astype(np.float32) + x = torch.tensor(np.concatenate([z, prop])[None], dtype=torch.float32, + device=dev) + x = (x - nmu) / nsd # same transform as LiberoRSMData._feat + tt = torch.tensor([thead], device=dev) + if args.probe_ood and steps == 0: + # Off-distribution guard. A policy cloned from one pool can be a + # near-perfect predictor on its own frames (held-out action MSE + # 0.0008 at t=0 for BC_rollsucc) and still emit actions 5x too + # large on the evaluator's first observation, which reads as a + # flat 0/500 indistinguishable from a weak policy. Printing the + # first action's scale next to the reference pools' action scale + # separates "bad policy" from "policy evaluated off its manifold". + with torch.no_grad(): + _a0 = pol.sample(pfeat(x), tt)[0].view(chunk, 7) + _oodx.append((int(tid), np.asarray(x[0].cpu(), np.float32))) + print(f"[ood] task {tid} init {k}: |a| std={float(_a0.std()):.3f} " + f"max={float(_a0.abs().max()):.3f} " + f"frac|a|>1={float((_a0.abs() > 1).float().mean()):.3f} " + f"(corpus action std ~0.43) |x|={float(x.norm()):.2f}", + flush=True) + with torch.no_grad(): + if qf is None and not args.q_filter: + a = pol.sample(pfeat(x), tt)[0].view(chunk, 7).cpu().numpy() + else: + feats = pfeat(x).expand(args.q_filter, -1) + cand = pol.sample(feats, tt.expand(args.q_filter), + temp=args.policy_temp, + sde=args.policy_sde, + sde_anneal=bool(args.policy_sde_anneal)) + if pol2 is not None and args.q_filter2 > 0: + cand2 = pol2.sample(pfeat2(x).expand(args.q_filter2, -1), + tt.expand(args.q_filter2)) + cand = torch.cat([cand, cand2], 0) + n_pol = cand.shape[0] + if demo_bank is not None: + _fb, _Ab = demo_bank + _d = torch.cdist(x.half(), _fb).squeeze(0) + _nn = torch.topk(_d, args.demo_cand, largest=False).indices + cand = torch.cat([cand, _Ab[_nn].to(cand.dtype)], 0) + if args.select == "random": + _pick = int(torch.randint(cand.shape[0], (1,)).item()) + elif args.select == "randgate": + # control for the critic gate: with prob --select-q execute a + # random NON-default candidate, else the default (candidate 0) + _pick = int(torch.randint(1, cand.shape[0], (1,)).item()) \ + if float(torch.rand(1)) < args.select_q else 0 + elif args.select == "medoid": + _dd = torch.cdist(cand, cand) # [N,N] + _pick = int(_dd.sum(1).argmin()) + else: + _pick = qf(x, tt, cand) + if demo_bank is not None: + demo_pick["demo" if _pick >= n_pol else "policy"] += 1 + if pol2 is not None: + mix_pick["p2" if args.q_filter <= _pick < args.q_filter + args.q_filter2 else "p1"] += 1 + a = cand[_pick].view(chunk, 7).cpu().numpy() + for act in a[: args.execute]: + obs, _, done, _ = env.step(act.astype(np.float64)) + steps += 1 + if done or steps >= args.max_steps: + break + succ.append(bool(done)) + episodes[tname].append({"episode": k, "success": bool(done), "steps": steps, + "init_sha256": init_hash}) + try: + Path(args.out).parent.mkdir(parents=True, exist_ok=True) + _tmp = _prog.with_suffix(_prog.suffix + ".tmp") + _tmp.write_text(json.dumps(episodes[tname])); _tmp.replace(_prog) + except Exception as _e: + print(f"[eval] progress write failed ({_e})", flush=True) + if (len(episodes[tname]) % 10) == 0: + _lap(f"t{tid}: {len(episodes[tname])}/{args.n_init} episodes, SR so far {np.mean(succ):.2f}") + if args.save_video_frames and _vid: + _vd = Path(args.save_video_frames); _vd.mkdir(parents=True, exist_ok=True) + np.savez_compressed(_vd / f"t{tid}_e{k}.npz", frames=np.stack(_vid), + success=bool(done), steps=steps, task=tid, ep=k, + stride=args.video_stride) + if args.save_frames and _frames: + import io as _io, base64 as _b64 + from PIL import Image as _Im + _fd = Path(args.save_frames); _fd.mkdir(parents=True, exist_ok=True) + _enc = [] + for _fr in _frames[:40]: + _im = _Im.fromarray(_fr).convert("RGB"); _im.thumbnail((144, 144)) + _bb = _io.BytesIO(); _im.save(_bb, "JPEG", quality=70) + _enc.append(_b64.b64encode(_bb.getvalue()).decode()) + np.savez_compressed( + _fd / f"t{tid}_e{k}.npz", + frames=np.array(_enc, dtype=object), + geo=np.asarray(_geo, np.float32), + objects=np.array(_objn, dtype=object), + target=np.array(_target, dtype=object), + success=bool(done), steps=steps, task=tid, ep=k) + episodes[tname].sort(key=lambda _e: int(_e["episode"])) + results[tname] = float(np.mean(succ)) + try: # partial results survive a teardown abort or a preemption. Written BEFORE + # env.close(): on IBM's EGL driver close() aborts the process (rc=134). + Path(args.out).parent.mkdir(parents=True, exist_ok=True) + # one file per task: parallel per-task jobs never write the same file + Path(args.out + f".partial.t{tid}").write_text(json.dumps( + {"results": {tname: results[tname]}, "episodes": {tname: episodes[tname]}}, indent=1)) + except Exception: + pass + if os.environ.get("RSM_NO_ENV_CLOSE"): + _keep_alive = globals().setdefault("_KEEP_ENVS", []); _keep_alive.append(env) + else: + try: + env.close() + except Exception as _e: + print(f"[eval] env.close() raised (ignored): {_e}", flush=True) + print(f"task {tid} {tname[:40]}: SR {results[tname]:.2f} " + f"({sum(succ)}/{len(succ)})", flush=True) + + overall = float(np.mean(list(results.values()))) + n_tot = sum(len(v) for v in episodes.values()) + n_suc = sum(e["success"] for v in episodes.values() for e in v) + pooled = n_suc / max(n_tot, 1) + # THROUGHPUT = SR * max_steps / mean_steps. Rewards finishing FAST, not just + # finishing: a policy that solves in half the horizon does twice the work per + # unit time. Reported two ways because they answer different questions: + # _succ : mean over SUCCESSFUL episodes -- how fast is it when it works + # _all : mean over ALL episodes -- failures burn the full horizon, so this + # penalises failing twice (once in SR, once in the time it wasted) + all_steps = [e["steps"] for v in episodes.values() for e in v] + suc_steps = [e["steps"] for v in episodes.values() for e in v if e["success"]] + mean_all = float(np.mean(all_steps)) if all_steps else float("nan") + mean_suc = float(np.mean(suc_steps)) if suc_steps else float("nan") + thr_all = pooled * args.max_steps / mean_all if mean_all == mean_all and mean_all > 0 else float("nan") + thr_suc = pooled * args.max_steps / mean_suc if mean_suc == mean_suc and mean_suc > 0 else float("nan") + per_task_thr = {} + for tname, eps in episodes.items(): + s = [e["steps"] for e in eps if e["success"]] + if s: + per_task_thr[tname] = results[tname] * args.max_steps / float(np.mean(s)) + out = {"overall_task_mean_SR": overall, "successes": n_suc, "episodes": n_tot, + "pooled_SR": pooled, + "throughput_succ": thr_suc, "throughput_all": thr_all, + "mean_steps_success": mean_suc, "mean_steps_all": mean_all, + "max_steps": args.max_steps, "per_task_throughput": per_task_thr, + "per_task": results, + "critic": args.critic, "policy": args.policy, "chunk": chunk, + "policy_features": pmode, + "seed": args.seed, "n_init": args.n_init, "suite": args.suite, + "episodes_detail": episodes} + Path(args.out).parent.mkdir(parents=True, exist_ok=True) + if args.partial_only: + print("[eval] --partial-only: final JSON left to the assembly run", flush=True) + else: + Path(args.out).write_text(json.dumps(out, indent=1)) + if args.probe_ood and _oodx: + _p = str(Path(args.out).with_suffix("")) + "_oodx.npz" + np.savez_compressed(_p, task=np.array([t for t, _ in _oodx], np.int64), + x=np.stack([v for _, v in _oodx])) + print(f"[ood] wrote {len(_oodx)} online t=0 features to {_p}", flush=True) + if pol2 is not None: + _m1, _m2 = mix_pick["p1"], mix_pick["p2"] + print(f"[eval] mixed proposer: policy2 chosen {_m2}/{_m1+_m2} ({_m2/max(_m1+_m2,1):.3f})", flush=True) + _dp, _pp = demo_pick["demo"], demo_pick["policy"] + if _dp + _pp: + print(f"[eval] demo-cand: expert chunk chosen {_dp}/{_dp+_pp} " + f"({_dp/(_dp+_pp):.3f}) of decisions", flush=True) + _gf, _gh = gate_stats["fire"], gate_stats["hold"] + if _gf + _gh: + print(f"[eval] gate={args.qf_gate}: fired {_gf}/{_gf+_gh} " + f"({_gf/(_gf+_gh):.3f}) decisions overridden", flush=True) + print(f"\nOVERALL task-mean SR {overall:.4f} | pooled {n_suc}/{n_tot} = {pooled:.4f}", + flush=True) + print(f"THROUGHPUT succ-only {thr_suc:.4f} all-episodes {thr_all:.4f} " + f"(mean steps: success {mean_suc:.0f}, all {mean_all:.0f}, max {args.max_steps})", + flush=True) + print(f"BAR: bcdemos_m120k = 0.584 +- 0.025 (n=500, same harness family)", flush=True) + # Everything is on disk. Skip interpreter teardown: on IBM's EGL driver robosuite's + # context destructor aborts the process (rc=134), which on a normal exit would turn a + # finished, written evaluation into a "failed" job. + import sys as _sys; _sys.stdout.flush(); _sys.stderr.flush() + os._exit(0) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/eval_slurm.sbatch b/gen_q_rsm/rsm_libero/eval_slurm.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..df5bb495a8fd02c30d28cebaf63eff4d6d31bc01 --- /dev/null +++ b/gen_q_rsm/rsm_libero/eval_slurm.sbatch @@ -0,0 +1,90 @@ +#!/bin/bash +#SBATCH --job-name=rsm_libero_eval +#SBATCH --account=vision-pulkitag +#SBATCH --qos=lab-free +#SBATCH --partition=csail-shared-h200 +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=8 +#SBATCH --mem=64G +#SBATCH --time=20:00:00 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err + +# Closed-loop LIBERO-10 success rate for an rsm_libero policy. +# Environment copied EXACTLY from the lane's own eval launcher +# (08312026_0135am_libero10_pertask_eval.sbatch) so the number is comparable to +# the bcdemos_m120k = 0.584 +- 0.025 bar. A success rate from a different +# harness or a different render backend is not comparable to it. +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +VENV=$B/venvs/rlinf-libero-eval-venv +PY=$VENV/bin/python + +export REPO_PATH=$B/external/rlinf +export PYTHONPATH="$REPO_PATH:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config +export ROBOT_PLATFORM=LIBERO +export LIBERO_TYPE=standard +export MUJOCO_GL=egl +export PYOPENGL_PLATFORM=egl +_GPU="$(echo "${CUDA_VISIBLE_DEVICES:-0}" | cut -d, -f1)" +export MUJOCO_EGL_DEVICE_ID="$_GPU" EGL_DEVICE_ID="$_GPU" +export TOKENIZERS_PARALLELISM=false +export PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export HF_HUB_OFFLINE=1 +# the lane head sizes its task embedding from FL15_TASKS; harmless for our heads +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" + +CRITIC=${CRITIC:-} # only needed when the policy reads latent features +POLICY=${POLICY:?set POLICY} +OUT=${OUT:?set OUT} +LANE_NORM=${LANE_NORM:-} +QFILTER=${QFILTER:-0} +QFCKPT=${QFCKPT:-} +PTEMP=${PTEMP:-1.0} +PSDE=${PSDE:-0.0} +QFGATE=${QFGATE:-0.0} +QFBETA=${QFBETA:-0.97} +QFDEPTH=${QFDEPTH:-1} +QFPES=${QFPES:-2.0} +NINIT=${NINIT:-10} +SEED=${SEED:-0} +# protocol A ignores SEED entirely (set_init_state overwrites the reset, and +# np.random is unused in the loop). Its ONLY source of variation is the policy +# sampling stream, which is keyed on --policy-seed. +PSEED=${PSEED:-0} +# steps of each predicted chunk actually executed. Hardcoding 10 made every +# chunk>10 policy waste capacity on steps that are always discarded, which is an +# unfair comparison across chunk lengths. +EXEC=${EXEC:-10} +DEMOCAND=${DEMOCAND:-0} +# 0 = replay LIBERO's fixed init_states (which the demos were collected from); +# 1 = env.reset() only, so object placements are sampled from the task's +# continuous placement region. Fixed inits risk measuring memorisation. +FRESH=${FRESH:-0} +SELECT=${SELECT:-argmaxq} +JITTER=${JITTER:-0.0} +SAVEFRAMES=${SAVEFRAMES:-} +PROBEOOD=${PROBEOOD:-0} +TASKS=${TASKS:-0,1,2,3,4,5,6,7,8,9} +MAXSTEPS=${MAXSTEPS:-520} +CAMRES=${CAMRES:-256} +INITSRC=${INITSRC:-libero} +VIDEO=${VIDEO:-} + +echo "[eval] critic=$CRITIC" +echo "[eval] policy=$POLICY n_init=$NINIT seed=$SEED" +$PY /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/eval_closed_loop.py \ + ${CRITIC:+--critic "$CRITIC"} ${LANE_NORM:+--lane-norm "$LANE_NORM"} --policy "$POLICY" \ + --tasks "$TASKS" --n-init "$NINIT" --seed "$SEED" --policy-seed "$PSEED" --fresh "$FRESH" \ + --cam-res "$CAMRES" --init-source "$INITSRC" ${VIDEO:+--save-video-frames "$VIDEO"} --probe-ood "$PROBEOOD" --q-filter "$QFILTER" --demo-cand "$DEMOCAND" --select "$SELECT" --init-jitter "$JITTER" ${SAVEFRAMES:+--save-frames "$SAVEFRAMES"} --qf-beta "$QFBETA" --qf-depth "$QFDEPTH" ${HOPPOL:+--hop-policy "$HOPPOL"} --qf-pessimism "$QFPES" \ + ${QFCKPT:+--qf-ckpt "$QFCKPT"} --policy-temp "$PTEMP" --policy-sde "$PSDE" --qf-gate "$QFGATE" \ + --suite libero_10 --max-steps "$MAXSTEPS" --execute "$EXEC" \ + --out "$OUT" +RC=$? +echo "[eval] done rc=$RC" +exit $RC diff --git a/gen_q_rsm/rsm_libero/extract_clips.py b/gen_q_rsm/rsm_libero/extract_clips.py new file mode 100644 index 0000000000000000000000000000000000000000..49c7156358b664f2ac1e6561cd869e3cd9eb4a05 --- /dev/null +++ b/gen_q_rsm/rsm_libero/extract_clips.py @@ -0,0 +1,98 @@ +"""Build playable clips: demos (hdf5) vs rollout successes vs rollout failures (parquet). + +Same task, same frame budget, same size -- so the three slices are directly comparable +by eye. Demos come from the stock LIBERO hdf5 (agentview_rgb); rollouts from the source +corpus PNGs. +""" +import argparse, base64, io, json, os, re +import numpy as np + +SRC = "/data/pulkitag/users/rli14/pi05_lib10_sde_v1" +DEMO = "/data/pulkitag/users/rli14/libero_datasets/libero_10" +PAT = re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") + + +def src_parquet(ep_src): + m = PAT.search(str(ep_src)) + if not m: return None + t, b, i, idx = m.groups() + p = (f"{SRC}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + return p if os.path.exists(p) else None + + +def enc(arr, px, q): + from PIL import Image + im = Image.fromarray(arr).convert("RGB") + im.thumbnail((px, px)) + b = io.BytesIO(); im.save(b, "JPEG", quality=q) + return base64.b64encode(b.getvalue()).decode() + + +def pick(n, k): + """k evenly spaced indices spanning 0..n-1, always including the last frame.""" + if n <= k: return list(range(n)) + return [int(round(i * (n - 1) / (k - 1))) for i in range(k)] + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True); ap.add_argument("--out", required=True) + ap.add_argument("--per", type=int, default=3, help="episodes per slice per task") + ap.add_argument("--nf", type=int, default=36); ap.add_argument("--px", type=int, default=84) + ap.add_argument("--quality", type=int, default=45) + args = ap.parse_args() + + import pyarrow.parquet as pq, h5py + m = np.load(f"{args.cache}/meta.npz", allow_pickle=True) + d, s, task = m["ep_demo"].astype(bool), m["ep_success"].astype(bool), m["ep_task"] + tasks = [str(t) for t in m["tasks"]] + rng = np.random.default_rng(0) + out = {"tasks": tasks, "nf": args.nf, "clips": []} + + for ti, tname in enumerate(tasks): + # demos straight from the stock LIBERO hdf5 + h = f"{DEMO}/{tname}_demo.hdf5" + if os.path.exists(h): + with h5py.File(h, "r") as f: + keys = sorted(f["data"].keys(), key=lambda x: int(x.split("_")[1])) + for k in keys[:args.per]: + rgb = f["data"][k]["obs"]["agentview_rgb"] + ids = pick(rgb.shape[0], args.nf) + # robosuite stores bottom-up; flip to human-upright like the evaluator + fr = [enc(np.asarray(rgb[i])[::-1], args.px, args.quality) for i in ids] + out["clips"].append({"slice": "demo", "task": ti, + "len": int(rgb.shape[0]), "f": fr}) + else: + print(f"[clip] MISSING demo hdf5 for {tname}", flush=True) + # rollouts from the source parquet + for name, mask in (("success", s & ~d), ("failure", ~s & ~d)): + cand = np.where(mask & (task == ti))[0] + rng.shuffle(cand) + got = 0 + for e in cand: + if got >= args.per: break + p = src_parquet(m["ep_src"][e]) + if not p: continue + try: + tb = pq.read_table(p, columns=["image"]) + ids = pick(tb.num_rows, args.nf) + from PIL import Image + fr = [] + for i in ids: + im = Image.open(io.BytesIO(tb["image"][i].as_py()["bytes"])) + fr.append(enc(np.asarray(im.convert("RGB")), args.px, args.quality)) + out["clips"].append({"slice": name, "task": ti, + "len": int(tb.num_rows), "f": fr}) + got += 1 + except Exception as ex: + print(f"[clip] t{ti} {name}: {str(ex)[:50]}", flush=True) + print(f"[clip] task {ti} done ({len(out['clips'])} clips)", flush=True) + + json.dump(out, open(args.out, "w")) + print(f"[clip] wrote {args.out} {os.path.getsize(args.out)/1e6:.1f} MB " + f"{len(out['clips'])} clips", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/extract_viz.py b/gen_q_rsm/rsm_libero/extract_viz.py new file mode 100644 index 0000000000000000000000000000000000000000..deaf3f38c9537b9919abfdcdbbe33d05b61d906c --- /dev/null +++ b/gen_q_rsm/rsm_libero/extract_viz.py @@ -0,0 +1,90 @@ +"""Sample episodes from each corpus slice and emit a compact JSON bundle for the viewer. + +Demos have no frames anywhere on disk (the OGPO demo cache stores latents only, and +LIBERO's datasets/ dir is not installed), so frames are rollout-only. End-effector +trajectories come from proprio and exist for all three slices, which makes them the one +directly comparable view. +""" +import argparse, base64, io, json, os, re, sys +import numpy as np + +SRC = "/data/pulkitag/users/rli14/pi05_lib10_sde_v1" +PAT = re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") + + +def src_parquet(ep_src): + m = PAT.search(str(ep_src)) + if not m: return None + t, b, i, idx = m.groups() + p = (f"{SRC}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + return p if os.path.exists(p) else None + + +def jpeg(png_bytes, px, q): + from PIL import Image + im = Image.open(io.BytesIO(png_bytes)).convert("RGB") + im.thumbnail((px, px)) + b = io.BytesIO(); im.save(b, "JPEG", quality=q) + return base64.b64encode(b.getvalue()).decode() + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--n", type=int, default=100) + ap.add_argument("--px", type=int, default=110) + ap.add_argument("--quality", type=int, default=55) + args = ap.parse_args() + + import pyarrow.parquet as pq + m = np.load(f"{args.cache}/meta.npz", allow_pickle=True) + d, s = m["ep_demo"].astype(bool), m["ep_success"].astype(bool) + task, lo, hi = m["ep_task"], m["ep_from"], m["ep_to"] + tasks = [str(t) for t in m["tasks"]] + prop = np.load(f"{args.cache}/proprio.f32.npy", mmap_mode="r") + rng = np.random.default_rng(0) + + slices = {"demo": np.where(d)[0], + "success": np.where(s & ~d)[0], + "failure": np.where(~s & ~d)[0]} + out = {"tasks": tasks, "episodes": []} + for name, pool in slices.items(): + # stratify across tasks so no slice is dominated by one scene + pick = [] + per = max(1, args.n // max(len(set(task[pool].tolist())), 1)) + for t in sorted(set(task[pool].tolist())): + c = pool[task[pool] == t] + pick += list(rng.choice(c, size=min(per, len(c)), replace=False)) + pick = list(rng.permutation(pick))[:args.n] + print(f"[viz] {name}: {len(pick)} episodes", flush=True) + for e in pick: + a, b = int(lo[e]), int(hi[e]) + P = np.asarray(prop[a:b], np.float32) + k = max(1, len(P) // 60) + rec = {"slice": name, "task": int(task[e]), "len": int(b - a), + "eef": [[round(float(v), 4) for v in p[:3]] for p in P[::k]], + "grip": [round(float(p[6]), 4) for p in P[::k]]} + if name != "demo": + p = src_parquet(m["ep_src"][e]) + if p: + try: + tb = pq.read_table(p, columns=["image"]) + n = tb.num_rows + rec["frames"] = [ + jpeg(tb["image"][i].as_py()["bytes"], args.px, args.quality) + for i in (0, n // 2, n - 1)] + except Exception as ex: + rec["err"] = str(ex)[:60] + out["episodes"].append(rec) + with open(args.out, "w") as f: + json.dump(out, f) + mb = os.path.getsize(args.out) / 1e6 + nf = sum(1 for e in out["episodes"] if "frames" in e) + print(f"[viz] wrote {args.out} {mb:.1f} MB " + f"{len(out['episodes'])} episodes, {nf} with frames", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/ibm_autoresearch.sh b/gen_q_rsm/rsm_libero/ibm_autoresearch.sh new file mode 100644 index 0000000000000000000000000000000000000000..1686be6ff31b2f1ea9b0d36062de34ecddad992c --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_autoresearch.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Autoresearch for "RSM beats BC-on-demos": screen settings on a VALIDATION set of initial +# conditions (protocol V: fresh inits, SEED=7, 20 per task = 200 episodes), select +# checkpoints on BOTH sides by arg-max over checkpoints on V, then confirm the winners on +# the untouched test protocols A/B x 3 seeds at n=500. Cells are named __s7e7_V. +# usage: ibm_autoresearch.sh train | stage1 | bcsel | stage2 | stage3 [prop] [policy] [hop] +set -uo pipefail +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256; CACHE=$IB/cache/full_r256 +S="ssh -o BatchMode=yes -o ConnectTimeout=20" +CB=$R/qsg_f/ckpt_best.pt; PROPL=$R/BCdemo_f/policy_last.pt; HOP=$R/HOPdemo_f/policy_r1.pt +V="SEED=7, QFCRN=1, QFPART=${QFPART:-256}"; VN=20 +sub(){ echo "$(NINIT=$VN ./ibm_cell.sh "$1" "$2" 7 1 "$3" &1 | grep -o "<[0-9]*>"; } +CR="train_rsm.py --cache $CACHE --d-z 256 --enc-width 1024 --flow-width 1024 --flow-depth 4 --chunk 10 --batch 512 --lr 3e-4 --ema 0.995 --var-floor 0.1 --w-reward 1.0 --flow-steps 8 --w-actcon 0.5 --warmup-reward 2000 --in-ram 1 --append-proprio 1 --resume 1 --steps 400000 --eval-every 10000 --seed 0 --reward-mode subgoal --subgoal-dir $R/subgoals_full --success-mask $R/verified_mask.npz --save-every 20000" +BC="bc_arm.py --cache $CACHE --chunk 10 --bc-steps 120000 --batch 1024 --lr 3e-4 --norm-pool demos --feat-scale center --policy-features raw --policy-family concat --in-ram 1 --reward-mode soft --success-gamma 0.995 --seed 0 --save-every 10000" +case "${1:?}" in +train) # BC with periodic checkpoints (for fair arg-max selection) + two critic variants + echo "$(cell BCdemo_c "$BC --pool demos --out $R/BCdemo_c" /dev/null | sed -E 's/.*policy_s([0-9]+)\.pt/\1/' | sort -n"); do + sub plainC${st}_DL_s7e7_V $R/BCdemo_c/policy_s${st}.pt "QFILTER=0, $V" + done;; +stage2) # around the best (beta, depth): N, selector, Q mode, critic ckpt, pessimism, CRN off + b=${2:?}; d=${3:?}; base="CRITIC=$CB, HOPPOL=$HOP, QFDEPTH=$d, QFBETA=0.$b, QFGATE=0, $V" + sub RSMb${b}d${d}n32_DL_s7e7_V $PROPL "SELECT=argmaxq, QFILTER=32, QFPES=0, $base" + sub RSMb${b}d${d}n16_DL_s7e7_V $PROPL "SELECT=argmaxq, QFILTER=16, QFPES=0, $base" + sub RSMb${b}d${d}q90_DL_s7e7_V $PROPL "SELECT=quantile, SELQ=0.9, QFILTER=8, QFPES=0, $base" + sub RSMb${b}d${d}q90n32_DL_s7e7_V $PROPL "SELECT=quantile, SELQ=0.9, QFILTER=32, QFPES=0, $base" + sub RSMb${b}d${d}near4_DL_s7e7_V $PROPL "SELECT=qnear, QNEARK=4, QFILTER=8, QFPES=0, $base" + sub RSMb${b}d${d}fold_DL_s7e7_V $PROPL "SELECT=argmaxq, QFILTER=8, QFPES=0, QFMODE=fold, $base" + sub RSMb${b}d${d}pes1_DL_s7e7_V $PROPL "SELECT=argmaxq, QFILTER=8, QFPES=1, $base" + sub RSMb${b}d${d}nocrn_DL_s7e7_V $PROPL "SELECT=argmaxq, QFILTER=8, QFPES=0, CRITIC=$CB, HOPPOL=$HOP, QFDEPTH=$d, QFBETA=0.$b, QFGATE=0, SEED=7, QFCRN=0" + sub RSMb${b}d${d}cL_DL_s7e7_V $PROPL "SELECT=argmaxq, QFILTER=8, QFPES=0, CRITIC=$R/qsg_f/ckpt.pt, HOPPOL=$HOP, QFDEPTH=$d, QFBETA=0.$b, QFGATE=0, $V";; +critsel) # critic checkpoint selection on V: RSM 3-hop at every periodic checkpoint of + run=${2:?}; b=${3:-95}; d=${4:-3} + for st in $($S bluevela "ls $R/$run/ckpt_s*.pt 2>/dev/null | sed -E 's/.*ckpt_s([0-9]+)\.pt/\1/' | sort -n"); do + sub RSMc${run}S${st}_DL_s7e7_V $PROPL "CRITIC=$R/$run/ckpt_s${st}.pt, SELECT=argmaxq, HOPPOL=$HOP, QFDEPTH=$d, QFILTER=8, QFBETA=0.$b, QFPES=0, QFGATE=0, SEED=7, QFCRN=1, QFPART=16" + done;; +stage3) # confirm: on A/B x seeds 0,1e1,2e2 at n=500 (proposer = BC ckpt of record) + arm=${2:?}; env=${3:?}; prop=${4:-DL}; pol=${5:-$PROPL} + for s in 0 1 2; do for P in A B; do F=0; [ $P = B ] && F=1; sfx=$s; [ $s != 0 ] && sfx=${s}e${s} + echo "$(./ibm_cell.sh ${arm}_${prop}_s${sfx}_$P $pol $s $F "$env, SEED=$s" "" +# Each task job gets its own GPU (a second env on a used GPU aborts on this EGL driver); +# the assembly job runs once all ten are done, resumes from the per-task partials, builds +# no env, and writes .json. Wall-clock per cell drops ~10x. +set -uo pipefail +NAME=${1:?}; POLICY=${2:?}; PSEED=${3:-0}; FRESH=${4:-0}; EXTRA=${5:-} +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256; E=$R/eval; L=$R/logs +Q=${LSF_QUEUE:-normal}; G=${LSF_GROUP:-grp_runtime} +MANIFEST_ONLY=${MANIFEST_ONLY:-0} +COMMON="all, POLICY=$POLICY, OUT=$E/$NAME.json, NINIT=${NINIT:-50}, PSEED=$PSEED, FRESH=$FRESH, CAMRES=256${EXTRA:+, $EXTRA}" +ssh -o BatchMode=yes -o ConnectTimeout=20 bluevela " +export MANIFEST_ONLY=$MANIFEST_ONLY +printf '%s' \"$COMMON\" > $E/$NAME.cell # manifest: the env this cell was submitted with (retries read it) +[ \"\${MANIFEST_ONLY:-0}\" = 1 ] && exit 0 +for t in 0 1 2 3 4 5 6 7 8 9; do + bsub -G $G -q $Q -gpu num=1 -n 8 -M 64G -J ${NAME}_t\$t -o $L/${NAME}_t\$t.out -e $L/${NAME}_t\$t.err -env \"$COMMON, TASKS=\$t, PARTIALONLY=1\" $IB/code/ibm_eval.sh >/dev/null 2>&1 +done +bsub -G $G -q $Q -n 4 -M 32G -J ${NAME}_asm -o $L/${NAME}_asm.out -e $L/${NAME}_asm.err -env \"$COMMON, ASM=1\" $IB/code/ibm_eval.sh 2>&1 | grep -o '<[0-9]*>' +" &1 | grep -v Authorized | tr -d '<>' diff --git a/gen_q_rsm/rsm_libero/ibm_crn_diag.sh b/gen_q_rsm/rsm_libero/ibm_crn_diag.sh new file mode 100644 index 0000000000000000000000000000000000000000..3673365859d935fa2a4881daebb02446a8e310f0 --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_crn_diag.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# CRN diagnostic on IBM: no env, one GPU. Reuses ibm_eval.sh's environment block. +set -uo pipefail +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256 +PY=/proj/dmfexp/zwhong/rli14_jvq_worktree/venvs/rlinf-libero-eval-venv/bin/python +export RSM_TASKS_FILE=$IB/lib10_tasks.txt RSM_WT=/proj/dmfexp/zwhong/rli14_jvq_worktree +export OGPO_PI05_BASE=/proj/dmfexp/zwhong/rli14_jvq_worktree/models/pi05_base_pytorch +export OGPO_TOKENIZER=/proj/dmfexp/zwhong/rlinf_models/openpi_tokenizer/big_vision/paligemma_tokenizer.model +export LIBERO_CONFIG_PATH=$IB/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard MUJOCO_GL=egl PYOPENGL_PLATFORM=egl +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 HF_HUB_OFFLINE=1 +export RSM_CACHE_REMAP="/data/pulkitag/users/rli14/rsm_libero_cache/=$IB/cache/,/data/pulkitag/scratch/rli14/rsm_libero_cache/=$IB/cache/,/data/pulkitag/users/rli14/rsm_libero_runs/mit/=$IB/runs/full_r256/" +cd $IB/code +$PY crn_diag.py --critic $R/qsg_f/ckpt_best.pt --policy "${POLICY:?}" --hop "${HOP:?}" --depth "${DEPTH:-3}" --n "${N:-8}" --states "${STATES:-200}" --particles "${PART:-16}" diff --git a/gen_q_rsm/rsm_libero/ibm_eval.sh b/gen_q_rsm/rsm_libero/ibm_eval.sh new file mode 100644 index 0000000000000000000000000000000000000000..ff827ea2ff7e6a2227efae3e15242f94913875f6 --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_eval.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# Closed-loop LIBERO-10 eval on IBM. Same evaluator (eval_closed_loop.py), the pinned venv +# (version-identical to MIT), and the same 256 render -- results are admissible alongside +# MIT's. Env: POLICY OUT [CRITIC QFCKPT QFILTER SELECT PSEED FRESH NINIT TASKS CAMRES ...] +set -uo pipefail +IB=/proj/dmfexp/zwhong/rsm_libero +export RSM_TASKS_FILE=/proj/dmfexp/zwhong/rsm_libero/lib10_tasks.txt +export RSM_WT=/proj/dmfexp/zwhong/rli14_jvq_worktree +export OGPO_PI05_BASE=/proj/dmfexp/zwhong/rli14_jvq_worktree/models/pi05_base_pytorch +export OGPO_TOKENIZER=/proj/dmfexp/zwhong/rlinf_models/openpi_tokenizer/big_vision/paligemma_tokenizer.model +export LIBERO_CONFIG_PATH=$IB/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl +_G="$(echo "${CUDA_VISIBLE_DEVICES:-0}" | cut -d, -f1)"; export MUJOCO_EGL_DEVICE_ID="$_G" EGL_DEVICE_ID="$_G" +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 HF_HUB_OFFLINE=1 +# robosuite EGL context free() aborts the process on this driver: never close envs here +export RSM_NO_ENV_CLOSE=1 +export RSM_CACHE_REMAP="/data/pulkitag/users/rli14/rsm_libero_cache/=$IB/cache/,/data/pulkitag/scratch/rli14/rsm_libero_cache/=$IB/cache/,/data/pulkitag/users/rli14/rsm_libero_runs/mit/=$IB/runs/full_r256/" +PY=/proj/dmfexp/zwhong/rli14_jvq_worktree/venvs/rlinf-libero-eval-venv/bin/python +TASKS=${TASKS:-0,1,2,3,4,5,6,7,8,9}; TASKS=${TASKS//;/,} # LSF -env cannot carry commas: pass task lists with ";" +cd $IB/code +# One LSF job = one GPU = one process. A second OffScreenRenderEnv on a GPU that already +# hosted one aborts on this EGL driver (even across processes), so a full n=500 cell is +# submitted as 10 single-task jobs (ibm_eval_matrix.sh) plus an assembly job that runs +# with every task already in .partial.t* and therefore builds no env. +run_eval(){ $PY eval_closed_loop.py ${CRITIC:+--critic "$CRITIC"} --policy "${POLICY:?}" \ + --tasks "${TASKS:-0,1,2,3,4,5,6,7,8,9}" --n-init "${NINIT:-50}" --seed "${SEED:-0}" --policy-seed "${PSEED:-0}" --fresh "${FRESH:-0}" \ + --cam-res "${CAMRES:-256}" --q-filter "${QFILTER:-0}" --select "${SELECT:-argmaxq}" \ + --qf-beta "${QFBETA:-0.98}" --qf-depth "${QFDEPTH:-1}" ${HOPPOL:+--hop-policy "$HOPPOL"} --qf-pessimism "${QFPES:-0}" --qf-gate "${QFGATE:-0}" --qnear-k "${QNEARK:-4}" --qf-crn "${QFCRN:-0}" --qf-particles "${QFPART:-16}" --select-q "${SELQ:-0.9}" ${POLICY2:+--policy2 "$POLICY2"} --q-filter2 "${QFILTER2:-0}" --qf-mode "${QFMODE:-restart}" \ + ${QFCKPT:+--qf-ckpt "$QFCKPT"} --policy-temp "${TEMP:-1.0}" --policy-sde "${SDE:-0.0}" --policy-sde-anneal "${SDEANN:-0}" --probe-ood "${PROBEOOD:-0}" \ + --suite libero_10 --max-steps "${MAXSTEPS:-520}" --execute 10 --out "${OUT:?}" --partial-only "${PARTIALONLY:-0}"; } +if [ "${ASM:-0}" = 1 ]; then + # Assembly: wait until every task's partial exists (task jobs retry on EGL aborts), then + # run with nothing left to do -- no env is built, the JSON is written. + for i in $(seq 1 360); do n=$(ls "${OUT}.partial.t"* 2>/dev/null | wc -l); [ "$n" -ge "${NTASKS:-10}" ] && break; sleep 60; done + echo "[eval] assembly: $n/${NTASKS:-10} partials present"; run_eval; echo "[eval] done rc=$?"; exit 0 +fi +RETRY=${RETRY:-0}; PARTIALONLY=${PARTIALONLY:-0} +echo "[eval] start $(date -u +%FT%TZ) host=$(hostname) gpu=${CUDA_VISIBLE_DEVICES:-?}" +run_eval; RC=$? +echo "[eval] done rc=$RC $(date -u +%FT%TZ)" +# Some GPUs are left in a bad EGL state by earlier jobs: the first env creation aborts +# (SIGABRT 134 / SIGSEGV 139) with no traceback. Resubmit the task -- a different node is +# likely -- up to 6 times. Only for single-task partial jobs, and only if the partial is +# still missing. +if [ "${PARTIALONLY:-0}" = 1 ] && { [ "$RC" = 134 ] || [ "$RC" = 139 ]; } && [ ! -f "${OUT}.partial.t${TASKS}" ] && [ "${RETRY:-0}" -lt 6 ]; then + echo "[eval] EGL abort on $(hostname); resubmitting task ${TASKS} (retry $((RETRY+1)))" + bsub -G "${LSF_GROUP:-grp_runtime}" -q "${LSF_QUEUE:-normal}" -gpu num=1 -n 8 -M 64G -J "${LSB_JOBNAME}" \ + -o "${LSB_OUTPUTFILE:-/dev/null}" -e "${LSB_ERRORFILE:-/dev/null}" \ + -env "all, RETRY=$((RETRY+1))" $IB/code/ibm_eval.sh +fi +exit $RC diff --git a/gen_q_rsm/rsm_libero/ibm_eval_depth.sh b/gen_q_rsm/rsm_libero/ibm_eval_depth.sh new file mode 100644 index 0000000000000000000000000000000000000000..8538e9e112ae5a851875c3f484f1863365aa29d9 --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_eval_depth.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# beta-hop sweep cells only. usage: ibm_eval_depth.sh [seeds] [depths] +set -uo pipefail +PROPRUN=${1:?}; TAG=${2:?}; HOPRUN=${3:?}; SEEDS=${4:-0}; DEPTHS=${5:-2,3} +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256; E=$R/eval; L=$R/logs +S="ssh -o BatchMode=yes -o ConnectTimeout=20" +sub(){ ./ibm_cell.sh "$1" "$2" "$3" "$4" "$5"; } \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/ibm_eval_matrix.sh b/gen_q_rsm/rsm_libero/ibm_eval_matrix.sh new file mode 100644 index 0000000000000000000000000000000000000000..e6815716a8c82bd8babf545b55f70ea555edf398 --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_eval_matrix.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Extraction matrix on IBM over a given PROPOSER policy: n=500, protocols A/B, evaluator +# at 256, one LSF job per cell. usage: ibm_eval_matrix.sh [seeds] +# e.g. ibm_eval_matrix.sh BCdemo_f D 0,1,2 -> cells RSMsg8_D_s0_A ... (D = demos proposer) +# ibm_eval_matrix.sh BCsuccv_f2 S 0 -> the successes proposer ladder +set -uo pipefail +PROPRUN=${1:?proposer run dir}; TAG=${2:?tag}; SEEDS=${3:-0}; HOPRUN=${4:-} # 4th arg: latent hop policy run dir -> depth 2/3 cells +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256; E=$R/eval; L=$R/logs +S="ssh -o BatchMode=yes -o ConnectTimeout=20" +sub(){ ./ibm_cell.sh "$1" "$2" "$3" "$4" "$5"; } +PROP=$R/$PROPRUN/policy_r1.pt; BON="QFILTER=8, QFBETA=0.98, QFDEPTH=1, QFPES=0, QFGATE=0" +for s in ${SEEDS//,/ }; do for P in A B; do F=0; [ $P = B ] && F=1 + echo "$(sub RSMsg8_${TAG}_s${s}_$P $PROP $s $F "CRITIC=$R/qsg_f/ckpt_best.pt, SELECT=argmaxq, $BON") RSMsg8_$TAG s$s $P" + echo "$(sub medoid8_${TAG}_s${s}_$P $PROP $s $F "SELECT=medoid, $BON") medoid8_$TAG s$s $P" + echo "$(sub plain_${TAG}_s${s}_$P $PROP $s $F "QFILTER=0") plain_$TAG s$s $P" +done; done +# beta-hop sweep (depth 2, 3) with the matching latent hop policy (4th arg) +[ -n "$HOPRUN" ] && HOP=$R/$HOPRUN && for D in 2 3; do for s in ${SEEDS//,/ }; do for P in A B; do F=0; [ $P = B ] && F=1 + echo "$(sub RSMsg8d${D}_${TAG}_s${s}_$P $PROP $s $F "CRITIC=$R/qsg_f/ckpt_best.pt, SELECT=argmaxq, HOPPOL=$HOP/policy_r1.pt, QFDEPTH=$D, QFILTER=8, QFBETA=0.98, QFPES=0, QFGATE=0") RSMsg8 depth$D $TAG s$s $P" +done; done; done +for P in A B; do F=0; [ $P = B ] && F=1 + echo "$(sub RSMind8_${TAG}_s0_$P $PROP 0 $F "CRITIC=$R/qind_f/ckpt_best.pt, SELECT=argmaxq, $BON") RSMind8_$TAG s0 $P" + echo "$(sub random8_${TAG}_s0_$P $PROP 0 $F "SELECT=random, $BON") random8_$TAG s0 $P" + [ -n "${IQLQ:-}" ] && echo "$(sub IQL8_${TAG}_s0_$P $PROP 0 $F "QFCKPT=$IQLQ, SELECT=argmaxq, $BON") IQL8_$TAG s0 $P" +done diff --git a/gen_q_rsm/rsm_libero/ibm_eval_matrix_last.sh b/gen_q_rsm/rsm_libero/ibm_eval_matrix_last.sh new file mode 100644 index 0000000000000000000000000000000000000000..64f816fb0862ade1651f8bc819b8c82a7fabb13d --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_eval_matrix_last.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# Extraction matrix over the BC-demos LAST checkpoint proposer (tag DL). The held-out +# sampled-MSE proxy picked step 102k (policy_r1.pt) which evaluates ~0.10 SR below the +# final step-120k weights (policy_last.pt), so every "DL" cell uses the last checkpoint on +# the BC side. 3 seeds varying BOTH the policy sampling seed and the eval-init seed +# (s0, s1e1, s2e2), protocols A/B, n=500. Submission order = decision priority. +set -uo pipefail +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256 +PROPL=$R/BCdemo_f/policy_last.pt; HOP=$R/HOPdemo_f/policy_r1.pt +CB=$R/qsg_f/ckpt_best.pt; CL=$R/qsg_f/ckpt.pt +BON="QFILTER=8, QFBETA=0.98, QFPES=0, QFGATE=0" +D3="SELECT=argmaxq, HOPPOL=$HOP, QFDEPTH=3, $BON" +sub(){ echo "$(./ibm_cell.sh "$1" "$2" "$3" "$4" "$5" IBM code dir +# pack bsub: pack full_r256 on IBM from the pinned episode list (CPU, 220G) +# meta-back scp IBM meta.npz -> MIT so the CPU labellers run without MIT's pack +# sync-labels rsync subgoals_full + verified_mask -> IBM +# train bsub: BC arms + critics + IQL (self-resubmitting preemptable cells) +# eval bsub: n=500 A/B evals at 256 via IBM's run_eval.sh (self-check gated) +set -uo pipefail +PH=${1:?phase} +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +S="ssh -o BatchMode=yes -o ConnectTimeout=20" +IB=/proj/dmfexp/zwhong/rsm_libero; ID=/proj/dmfexp/zwhong/data +CACHE=$IB/cache/full_r256; RUNS=$IB/runs/full_r256; LOGS=$RUNS/logs +PYT=/proj/dmfexp/zwhong/venvs/lerobot_env/bin/python +MIT_META=/data/pulkitag/users/rli14/rsm_libero_cache/full_r256 +case $PH in +sync-code) + rsync -a --exclude __pycache__ --exclude '*.pt' -e "$S" $G/ bluevela:$IB/code/ && echo "code synced";; +pack) + $S bluevela "mkdir -p $LOGS $CACHE && bsub -G grp_preemptable -q preemptable -n 32 -M 220G -R 'rusage[mem=220G]' -J pack_full_r256 -o $LOGS/pack.out -e $LOGS/pack.err \ + \"cd $IB/code && $PYT pack.py --src $ID/pi05_lib10_ogpo_fl15_v1 --demos $ID/libero10_demo_ogpo_cache_cam256 --out $CACHE --max-eps 0 --stride 1 --keep-all-demos --workers 32 --cam-res 256 --episode-list $ID/full_r256_episodes.txt --tasks-file $IB/lib10_tasks.txt\"";; +meta-back) + mkdir -p $MIT_META && scp -q -o BatchMode=yes bluevela:$CACHE/meta.npz bluevela:$CACHE/PACK.json bluevela:$CACHE/RENDER.json $MIT_META/ && ls -la $MIT_META;; +sync-labels) + rsync -a -e "$S" /data/pulkitag/users/rli14/rsm_libero_runs/subgoals_full bluevela:$RUNS/ && \ + rsync -a -e "$S" /data/pulkitag/users/rli14/rsm_libero_runs/verify_full/verified_mask.npz bluevela:$RUNS/ && echo "labels+mask synced";; +train|train-nomask) + SG=$RUNS/subgoals_full; MASK=$RUNS/verified_mask.npz + BC="bc_arm.py --cache $CACHE --chunk 10 --bc-steps 120000 --batch 1024 --lr 3e-4 --norm-pool demos --feat-scale center --policy-features raw --policy-family concat --in-ram 1 --reward-mode soft --success-gamma 0.995 --seed 0" + CR="train_rsm.py --cache $CACHE --d-z 256 --enc-width 1024 --flow-width 1024 --flow-depth 4 --chunk 10 --beta-lo 0.93 --beta-hi 0.995 --beta-q 0.98 --batch 512 --lr 3e-4 --ema 0.995 --var-floor 0.1 --w-reward 1.0 --flow-steps 8 --w-actcon 0.5 --warmup-reward 2000 --in-ram 1 --append-proprio 1 --resume 1 --steps 400000 --eval-every 10000 --seed 0" + cell(){ # name cmd + $S bluevela "bsub -G grp_preemptable -q preemptable -r -gpu num=1 -n 8 -M 160G -R 'rusage[mem=160G]' -J $1 -o $LOGS/$1.out -e $LOGS/$1.err -env \"all, CELL=$1, CMD=$2, O=$RUNS\" $IB/run_cell.sh" 2>&1 | grep -o "<[0-9]*>"; } + NOMASK="BCd_f|$BC --pool demos --out $RUNS/BCd_f +BCroll_f|$BC --pool rollsucc --out $RUNS/BCroll_f" + MASKED="BCrollv_f|$BC --pool rollsucc --success-mask $MASK --out $RUNS/BCrollv_f +BCsucc_f|$BC --pool succ --success-mask $MASK --out $RUNS/BCsucc_f +qind_f|$CR --reward-mode subgoal_ind --subgoal-dir $SG --success-mask $MASK --out $RUNS/qind_f +qsg_f|$CR --reward-mode subgoal --subgoal-dir $SG --success-mask $MASK --out $RUNS/qsg_f" + [ "$PH" = train-nomask ] && LIST="$NOMASK" || LIST="$MASKED" + # /dev/null | xargs -n1 basename | sed 's/.json$//'" /dev/null | grep -v Authorized) +IQLQ=$R/iql_f_mit/iql_q.pt; BON="QFILTER=8, QFBETA=0.98, QFDEPTH=1, QFPES=0, QFGATE=0" +plan(){ # name policy pseed fresh extra + if [ "${MANIFEST_ONLY:-0}" = 1 ]; then MANIFEST_ONLY=1 ./ibm_cell.sh "$1" "$2" "$3" "$4" "$5" /dev/null; echo "manifest $1"; return; fi + echo "$have" | grep -qx "$1" && return + echo "$(./ibm_cell.sh "$1" "$2" "$3" "$4" "$5" .cell) written at submission. Idempotent; run repeatedly. +set -uo pipefail +ssh -o BatchMode=yes -o ConnectTimeout=20 bluevela ' +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256; E=$R/eval; L=$R/logs; n=0 +active=$(bjobs -noheader -w 2>/dev/null | awk "\$3==\"RUN\"||\$3==\"PEND\" {print \$7}") +for m in $E/*.cell; do cell=$(basename $m .cell); [ -f $E/$cell.json ] && continue + env=$(cat $m) + for t in 0 1 2 3 4 5 6 7 8 9; do + [ -f $E/$cell.json.partial.t$t ] && continue + echo "$active" | grep -qx "${cell}_t$t" && continue + bsub -G grp_runtime -q normal -gpu num=1 -n 8 -M 64G -J ${cell}_t$t -o $L/${cell}_t$t.out -e $L/${cell}_t$t.err -env "$env, TASKS=$t, PARTIALONLY=1" $IB/code/ibm_eval.sh >/dev/null 2>&1 && n=$((n+1)) + done + echo "$active" | grep -qx "${cell}_asm" || bsub -G grp_runtime -q normal -n 4 -M 32G -J ${cell}_asm -o $L/${cell}_asm.out -e $L/${cell}_asm.err -env "$env, ASM=1" $IB/code/ibm_eval.sh >/dev/null 2>&1 +done; echo "resubmitted $n task jobs"' diff --git a/gen_q_rsm/rsm_libero/ibm_table.py b/gen_q_rsm/rsm_libero/ibm_table.py new file mode 100644 index 0000000000000000000000000000000000000000..6d75bc360954a9a72b5b2e97da025dfe9806782f --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_table.py @@ -0,0 +1,70 @@ +"""Assemble the RSM-vs-baselines table from IBM eval JSONs, with PAIRED tests. + +Cells are named __s[e]_. Two cells with the same +proposer, pseed/evalseed and protocol share initial conditions (init_sha256 per episode), +so arm differences are paired: McNemar exact test on discordant episodes, plus the paired +throughput difference. Reports every arm against `plain` (BC single action) and against +`medoid8` (the value-free selector) on the same cell. +""" +import argparse, glob, json, os, re, sys +from collections import defaultdict +from math import comb + +def mcnemar(b, c): + n = b + c + if n == 0: return 1.0 + k = min(b, c); p = sum(comb(n, i) for i in range(0, k + 1)) / 2 ** n + return min(1.0, 2 * p) + +def load(d): + cells = {} + for f in glob.glob(f"{d}/*.json"): + n = os.path.basename(f)[:-5] + m = re.match(r"(.+)_(D|S|DL|R|RL|DC)_s(\d)(?:e(\d))?_(A|B|V)$", n) + if not m: continue + arm, prop, ps, es, P = m.groups(); es = es or "0" + j = json.load(open(f)) + eps = {} + for t, lst in j["episodes_detail"].items(): + for e in lst: eps[(t, e["episode"], e["init_sha256"])] = (bool(e["success"]), int(e["steps"])) + cells[(arm, prop, ps, es, P)] = dict(sr=j["pooled_SR"], thr=j["throughput_all"], n=j["episodes"], eps=eps) + return cells + +def pair(a, b): + keys = set(a["eps"]) & set(b["eps"]) + if not keys: return None + sa = [a["eps"][k][0] for k in keys]; sb = [b["eps"][k][0] for k in keys] + B = sum(1 for x, y in zip(sa, sb) if x and not y); C = sum(1 for x, y in zip(sa, sb) if y and not x) + ta = [520 * a["eps"][k][0] / a["eps"][k][1] for k in keys]; tb = [520 * b["eps"][k][0] / b["eps"][k][1] for k in keys] + return dict(n=len(keys), dsr=(sum(sa) - sum(sb)) / len(keys), b=B, c=C, p=mcnemar(B, C), + dthr=(sum(ta) - sum(tb)) / len(keys)) + +def main(): + ap = argparse.ArgumentParser(); ap.add_argument("--dir", required=True); ap.add_argument("--prop", default="D") + a = ap.parse_args(); cells = load(a.dir) + arms = sorted({k[0] for k in cells if k[1] == a.prop}) + print(f"proposer={a.prop} cells: {sum(1 for k in cells if k[1]==a.prop)}\n") + print(f"{'arm':<14} {'seed':>6} {'P':>2} {'SR':>6} {'thr':>6} | {'vs plain dSR':>12} {'p':>7} {'dthr':>7} | {'vs medoid dSR':>13} {'p':>7} {'dthr':>7}") + for arm in arms: + for (ar, pr, ps, es, P), c in sorted(cells.items()): + if ar != arm or pr != a.prop: continue + row = f"{arm:<14} {ps+'/'+es:>6} {P:>2} {c['sr']:6.3f} {c['thr']:6.3f} |" + for base in ("plain", "medoid8"): + bc = cells.get((base, pr, ps, es, P)) + if bc is None or base == arm: row += f" {'':>12} {'':>7} {'':>7} |"; continue + r = pair(c, bc); row += f" {r['dsr']:+12.3f} {r['p']:7.3f} {r['dthr']:+7.3f} |" if r else f" {'no overlap':>28} |" + print(row) + # pooled across seeds for the headline arms + print("\npooled over available (seed, protocol) pairs, arm minus baseline:") + for arm in arms: + for base in ("plain", "medoid8"): + if arm == base: continue + B = C = n = 0; dth = 0.0 + for (ar, pr, ps, es, P), c in cells.items(): + if ar != arm or pr != a.prop: continue + bc = cells.get((base, pr, ps, es, P)); r = pair(c, bc) if bc else None + if r: B += r["b"]; C += r["c"]; n += r["n"]; dth += r["dthr"] * r["n"] + if n: print(f" {arm:<14} vs {base:<8} n={n:5d} dSR={(B-C)/n:+.3f} McNemar p={mcnemar(B,C):.4f} dthr={dth/n:+.3f}") + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/ibm_train_onpol.sh b/gen_q_rsm/rsm_libero/ibm_train_onpol.sh new file mode 100644 index 0000000000000000000000000000000000000000..279fc81ee5a1dce4b6ec7a037f310f96568aa0eb --- /dev/null +++ b/gen_q_rsm/rsm_libero/ibm_train_onpol.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Retrain the RSM critic with the on-policy pack mixed into training batches. +# env: MIX2 (fraction from cache2, default 0.5), OUT (run dir), STEPS (default 300000) +set -uo pipefail +IB=/proj/dmfexp/zwhong/rsm_libero; R=$IB/runs/full_r256 +PY=/proj/dmfexp/zwhong/rli14_jvq_worktree/venvs/rlinf-libero-eval-venv/bin/python +export PYTHONUNBUFFERED=1 HF_HUB_OFFLINE=1 +export RSM_CACHE_REMAP="/data/pulkitag/users/rli14/rsm_libero_cache/=$IB/cache/,/data/pulkitag/scratch/rli14/rsm_libero_cache/=$IB/cache/,/data/pulkitag/users/rli14/rsm_libero_runs/mit/=$IB/runs/full_r256/" +cd $IB/code +$PY train_rsm.py --cache $IB/cache/full_r256 --subgoal-dir $R/subgoals_full --reward-mode subgoal \ + --cache2 $IB/cache/onpol_r256 --subgoal-dir2 $R/subgoals_onpol --mix2 "${MIX2:-0.5}" \ + --reward-loss bce --append-proprio 1 --d-z 256 --enc-width 1024 --flow-width 1024 --flow-depth 4 \ + --beta-lo 0.93 --beta-hi 0.995 --beta-q 0.98 --w-actcon 0.5 --batch 512 --lr 3e-4 --ema 0.995 \ + --steps "${STEPS:-300000}" --save-every 20000 --eval-every 10000 --in-ram 1 --seed "${SEED:-0}" \ + --out "${OUT:?}" diff --git a/gen_q_rsm/rsm_libero/iql.py b/gen_q_rsm/rsm_libero/iql.py new file mode 100644 index 0000000000000000000000000000000000000000..fe469a03b5cdb80951551a8f0b59a8e910b28edd --- /dev/null +++ b/gen_q_rsm/rsm_libero/iql.py @@ -0,0 +1,259 @@ +"""IQL critic + policy extraction, as the standard offline-RL baseline for RSM. + +Matched to the RSM arms on purpose: same latents, same reward labels, same +FlowPolicy class, same AWR extraction, same offline score. The ONLY thing that +differs is where the advantage comes from -- IQL's expectile-regressed Q - V +versus RSM's occupancy read-out. That is what makes the comparison a test of the +critic rather than of the pipeline around it. + +IQL (Kostrikov et al., ICLR 2022): + L_V = E[ expectile_tau( Q_target(z,a) - V(z) ) ] + L_Q = E[ ( r + gamma * V(z') - Q(z,a) )^2 ] + advantage = Q(z,a) - V(z) +Reward is the same DENSE P(success|z) label the RSM critic reads, so neither method +gets a reward the other does not see. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch +import torch.nn.functional as F + +from model import Encoder, mlp, FlowPolicy +from data import LiberoRSMData +from is_ope import make_policy, policy_nll, train_bc, policy_features +from train_rsm import auc + + +class QNet(torch.nn.Module): + def __init__(self, d_z, d_act, n_task, d_task=64, width=512, depth=3): + super().__init__() + self.task = torch.nn.Embedding(n_task, d_task) + self.net = mlp([d_z + d_act + d_task] + [width] * depth + [1], norm=True) + + def load_state_dict(self, sd, strict=True): + # Self-describing checkpoints: rebuild the MLP to the saved width/depth if the + # caller constructed the default size (evaluator constructs QNet(d_z, d_act, n_task) + # and is edited by more than one session; the checkpoint is the source of truth). + lin = sorted((int(k.split(".")[1]), sd[k]) for k in sd + if k.startswith("net.") and k.endswith(".weight") and sd[k].dim() == 2) + if lin: + d_in = int(lin[0][1].shape[1]); sizes = [d_in] + [int(w.shape[0]) for _, w in lin] + mine = [m for m in self.net if isinstance(m, torch.nn.Linear)] + if [d_in] + [m.out_features for m in mine] != sizes: + self.net = mlp(sizes, norm=True).to(lin[0][1].device) + return super().load_state_dict(sd, strict=strict) + + def forward(self, z, a, task): + return self.net(torch.cat([z, a, self.task(task)], -1)).squeeze(-1) + + +class VNet(torch.nn.Module): + def __init__(self, d_z, n_task, d_task=64, width=512, depth=3): + super().__init__() + self.task = torch.nn.Embedding(n_task, d_task) + self.net = mlp([d_z + d_task] + [width] * depth + [1], norm=True) + + def forward(self, z, task): + return self.net(torch.cat([z, self.task(task)], -1)).squeeze(-1) + + +def expectile_loss(diff, tau): + return torch.where(diff > 0, tau, 1 - tau) * diff.pow(2) + + +def train_iql(d, enc, args, device, steps): + """Expectile V + TD Q on the frozen reward-predictive latent.""" + d_act = d.chunk * d.adim + q = QNet(args.d_z, d_act, d.n_task).to(device) + q_t = QNet(args.d_z, d_act, d.n_task).to(device) + q_t.load_state_dict(q.state_dict()) + for p in q_t.parameters(): + p.requires_grad_(False) + v = VNet(args.d_z, d.n_task).to(device) + opt = torch.optim.AdamW(list(q.parameters()) + list(v.parameters()), + lr=3e-4, weight_decay=0.01) + rng = np.random.default_rng(args.seed + 3) + for step in range(1, steps + 1): + b = d.sample_frames(args.batch, rng, "train", device) + # next state: one action-chunk ahead, clamped to the episode end + t_next = np.minimum(b["t_idx"] + d.chunk, d.ep_to[b["ep"]] - 1) + with torch.no_grad(): + z = enc(b["x"]) + xn = torch.from_numpy(d._feat(t_next)).to(device) + zn = enc(xn) + r = torch.from_numpy(d.r[t_next]).to(device) + done = torch.from_numpy( + (t_next >= d.ep_to[b["ep"]] - 1).astype(np.float32)).to(device) + qt = q_t(z, b["a"], b["task"]) + vv = v(z, b["task"]) + l_v = expectile_loss(qt - vv, args.tau).mean() + with torch.no_grad(): + vn = v(zn, b["task"]) + target = r + args.gamma * (1 - done) * vn + l_q = (q(z, b["a"], b["task"]) - target).pow(2).mean() + loss = l_v + l_q + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(list(q.parameters()) + list(v.parameters()), 1.0) + opt.step() + with torch.no_grad(): + for pt, po in zip(q_t.parameters(), q.parameters()): + pt.mul_(0.995).add_(po.detach(), alpha=0.005) + if step % 1000 == 0: + with torch.no_grad(): + adv = (q(z, b["a"], b["task"]) - vv) + print(f"[iql] {step} l_v={float(l_v):.4f} l_q={float(l_q):.4f} " + f"|adv|={float(adv.abs().mean()):.4f}", flush=True) + q.eval(); v.eval() + return q, v + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--norm-pool", default="all", choices=["all", "demos"], + help="frames the feature statistics come from. demos is worth +0.15 closed-loop over rollout-dominated statistics.") + + ap.add_argument("--adv-norm", default="std", choices=["std", "none"], + help="standardise the advantage inside the AWR weight. " + "Without it beta is uninterpretable and the weight " + "collapses to a hard sign filter.") + + ap.add_argument("--init-pool", default="succ", + choices=["succ", "demos", "demos_succ", "all"], + help="episodes the pi_0 clone is fit on. Both critic arms must " + "use the SAME value or the comparison measures the initialisation rather than the critic.") + + ap.add_argument("--lr", type=float, default=3e-4) + + ap.add_argument("--feat-scale", default="zscore", choices=["zscore", "center"], + help="how the POLICY sees the observation. zscore matches the " + "lane BC recipe that reaches 0.584; center keeps relative " + "dim importance. Ranked on held-out sampled action MSE, " + "never on the CFM loss.") + + ap.add_argument("--policy-features", default="raw", choices=["raw", "latent"], + help="what the POLICY reads: raw = full observation (BC-baseline " + "parity), latent = critic bottleneck. Advantage always " + "comes from the critic latent.") + + ap.add_argument("--critic", required=True, + help="RSM checkpoint -- used ONLY for its frozen encoder, so " + "IQL and RSM read the same latent") + ap.add_argument("--out", required=True) + ap.add_argument("--chunk", type=int, default=25) + ap.add_argument("--tau", type=float, default=0.7, help="IQL expectile") + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--awr-beta", type=float, default=1.0) + ap.add_argument("--w-max", type=float, default=20.0) + ap.add_argument("--iql-steps", type=int, default=12000) + ap.add_argument("--bc-steps", type=int, default=3000) + ap.add_argument("--awr-steps", type=int, default=1500) + ap.add_argument("--rounds", type=int, default=2) + ap.add_argument("--batch", type=int, default=256) + ap.add_argument("--awr-pool", default="succ", + choices=["all", "succ", "demos"], + help="episodes AWR regresses on. succ draws from the noisy\n pi0.5 rollouts (SDE noise 0.5); demos keeps the policy\n inside the distribution it was cloned on, so the advantage\n can only re-weight demonstrations rather than drag the\n policy toward a noisier behaviour.") + ap.add_argument("--policy-family", default="concat", choices=["concat", "flow", "gauss"]) + ap.add_argument("--in-ram", type=int, default=0) + ap.add_argument("--success-gamma", type=float, default=0.98, + help="discount for reward-mode=soft: the label is " + "success_gamma ** (frames until success)") + ap.add_argument("--subgoal-dir", default="", help="per-frame satisfied-conjunct labels (reward-mode subgoal*)") + ap.add_argument("--success-mask", default="", help="admissibility mask npz (keep); drops non-reproducing successes") + ap.add_argument("--q-only", type=int, default=0, + help="train IQL Q/V, save them as iql_q.pt for best-of-N ranking in the evaluator, and stop. " + "No BC clone, no AWR: the extraction is then IDENTICAL to the RSM arm except for where Q comes from.") + ap.add_argument("--reward-mode", default="dense", choices=["dense","terminal","soft","subgoal","subgoal_ind"], + help="dense = P(task succeeds|z), every frame of a success is a " + "positive (~50%%). terminal = last k frames only (~0.5%%), which " + "leaves Q near-constant in the action.") + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode, + success_gamma=getattr(args, 'success_gamma', 0.98), + norm_pool=args.norm_pool, subgoal_dir=args.subgoal_dir, + success_mask=args.success_mask) + from is_ope import load_critic + enc, _rew, _flow, _rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + args.d_z = cfg["d_z"] + pfeat, d_pol = policy_features(args, enc, d, cfg, dev) + Path(args.out).mkdir(parents=True, exist_ok=True) + print(f"[iql] {d.n_ep} eps, chunk={d.chunk}, d_z={args.d_z}, tau={args.tau}", + flush=True) + + q, v = train_iql(d, enc, args, dev, args.iql_steps) + torch.save({"iql_q": True, "cam_res": getattr(d, "cam_res", "UNKNOWN"), + "q": q.state_dict(), "v": v.state_dict(), "config": vars(args), + "d_act": d.chunk * d.adim, "d_z": args.d_z, "n_task": d.n_task, + "critic": args.critic}, Path(args.out) / "iql_q.pt") + print(f"[iql] saved Q/V -> {Path(args.out) / 'iql_q.pt'}", flush=True) + if args.q_only: + print("[iql] DONE (q-only)", flush=True); return + + from awr import offline_score + rng = np.random.default_rng(args.seed + 23) + pol = train_bc(d, enc, args, dev, only_success=args.init_pool, steps=args.bc_steps, + pfeat=pfeat, d_policy=d_pol, + resume_path=str(Path(args.out) / 'bc_resume.pt')) + log = {"config": vars(args), + "pi_0": offline_score(d, enc, pol, rng, dev, pfeat=pfeat), "rounds": []} + print(f"[iql] pi_0 {log['pi_0']}", flush=True) + + for r in range(1, args.rounds + 1): + new = make_policy(args, d, dev, d_z=d_pol) + new.load_state_dict(pol.state_dict()) + opt = torch.optim.AdamW(new.parameters(), lr=1e-4, weight_decay=0.01) + rg = np.random.default_rng(args.seed + 11 + r) + stats = [] + for step in range(1, args.awr_steps + 1): + b = d.sample_frames(args.batch, rg, "train", dev) + if args.awr_pool != "all": + keep = ((b["succ"] > 0.5) if args.awr_pool == "succ" + else (b["demo"] > 0.5)) + if keep.sum() < 8: + continue + km = keep.cpu().numpy() + b = {k: (v_[km] if isinstance(v_, np.ndarray) + else (v_[keep] if torch.is_tensor(v_) else v_)) + for k, v_ in b.items()} + with torch.no_grad(): + z = enc(b["x"]) # critic latent -> advantage + zp = pfeat(b["x"]) # policy features -> action head + adv = q(z, b["a"], b["task"]) - v(z, b["task"]) + # See awr.awr_step: the raw advantage saturates the exponent and + # turns AWR into a hard sign filter on a critic whose action win + # rate is 0.568. + if args.adv_norm == "std": + adv = (adv - adv.mean()) / adv.std().clamp_min(1e-6) + w = (args.awr_beta * adv).exp().clamp(0, args.w_max) + w = w / w.mean().clamp_min(1e-6) + loss = (w * policy_nll(new, zp, b["task"], b["a"], reduce=False)).mean() + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(new.parameters(), 1.0); opt.step() + if step % 500 == 0: + stats.append({"step": step, "loss": float(loss), + "mean_abs_adv": float(adv.abs().mean())}) + print(f"[iql-awr] r{r} {step} loss={float(loss):.3f} " + f"|adv|={float(adv.abs().mean()):.4f}", flush=True) + new.eval(); pol = new + sc = offline_score(d, enc, pol, rng, dev, pfeat=pfeat) + log["rounds"].append({"round": r, "awr": stats, "score": sc}) + print(f"[iql] round {r} {sc}", flush=True) + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + torch.save({"pol": pol.state_dict(), "round": r, "config": vars(args)}, + out / f"policy_r{r}.pt") + (out / "loop.json").write_text(json.dumps(log, indent=2)) + print("[iql] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/is_ope.py b/gen_q_rsm/rsm_libero/is_ope.py new file mode 100644 index 0000000000000000000000000000000000000000..19669c6e2149659a8f181413ecee924968f24348 --- /dev/null +++ b/gen_q_rsm/rsm_libero/is_ope.py @@ -0,0 +1,727 @@ +"""Importance-sampled off-policy evaluation of Q^pi with the RSM occupancy. + +Implements the notes' Sections 7-9 without ever needing a normalized action +density, which matters because the behavior policy here is a pi0.5 flow model +sampled as an SDE at noise 0.5 and has no tractable likelihood. + + Step 1 per-decision ratio by CLASSIFICATION. Train c(z, A) to separate a + logged chunk (label 0, from mu) from a chunk sampled from pi at the + SAME logged state (label 1). On balanced classes the logit is exactly + log pi/mu, so `w_j = exp(logit)` replaces pi(a_j|s_j)/mu(a_j|s_j). + + Step 2 chunk product. A beta-hop spans several 10-step decisions; the first + is conditioned on, so W = prod over the INTERIOR decisions only. With + a 10-action chunk a 50-frame hop carries ~5 factors instead of 50, + which is the variance argument for doing the correction per hop rather + than over a flat trajectory. + + Step 3 Rao-Blackwellize onto the endpoint. Regress W onto (z, A, z') under + squared loss; the minimizer is E[W | endpoint] = d^pi_beta / d^mu_beta. + This is the only form usable at inference, because the occupancy model + emits an endpoint and never the intervening actions. + + Step 4 recursive read. Q^pi = E[ C * r(z_end) ] / (1-gamma) with C the + product of endpoint weights along the hops, self-normalized. Boundary + actions are drawn from pi, so only chunk interiors need correcting. + +VALIDATION (the gate, and it can fail): a synthetic target policy whose +occupancy we can compute directly. Take pi := "mu restricted to episodes that +succeed". d^pi is then estimable by fitting the occupancy on successes only, +while the IS estimate reweights the all-data model. If the corrected estimate +does not move toward the success-only reference, the weights are not working and +no policy is trained on them. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json, time +from pathlib import Path +import numpy as np +import torch +import torch.nn.functional as F + +from types import SimpleNamespace + +from model import (Encoder, RewardHead, OccFlow, RatioNet, EndpointRatio, + BCHead, FlowPolicy) +from data import LiberoRSMData +from train_rsm import sample_future, auc + + +class _LatWithProprio(torch.nn.Module): + """Encoder wrapper that re-appends the proprio channel to the latent. + + Training may append n_pr normalised proprio dims to the 256-d latent so the + successor has to PREDICT an action-sensitive channel (action-proprio |r| 0.98 + vs action-latent 0.49). The checkpoint therefore carries a d_z+n_pr latent, + and rebuilding the heads at d_z alone fails with a size mismatch. + """ + + def __init__(self, enc, n_pr, mu, sd): + super().__init__() + self.enc = enc; self.n_pr = n_pr + self.register_buffer("mu", mu); self.register_buffer("sd", sd) + + def forward(self, x): + z = self.enc(x) + if not self.n_pr: + return z + return torch.cat([z, (x[:, -self.n_pr:] - self.mu) / self.sd], -1) + + def back(self, z): + """PCA checkpoints only: latent -> full state (n_pr == 0 there).""" + return self.enc.back(z) + + +def load_critic(path, d_in, n_task, device, data=None): + ck = torch.load(path, map_location=device, weights_only=False) + c = ck["config"] + n_pr = int(ck.get("n_pr", 0) or 0) + enc_kind = ck.get("enc_kind", c.get("enc", "mlp")) or "mlp" + if enc_kind == "identity": + # train_rsm.py --enc identity: the z-scored feature is the latent (d_z == feature dim). + # The blob's d_in records the feature width the run saw; a cache of another width + # would silently mis-size every head, so refuse it here. + d_ck = int(ck.get("d_in", c["d_z"])) + if int(d_in) != d_ck: + raise RuntimeError(f"identity-encoder checkpoint was trained on {d_ck}-d features, " + f"cache provides {d_in}-d") + from model import IdentityEncoder + base = IdentityEncoder(d_in).to(device) + d_lat = d_in + n_pr + elif enc_kind == "pca": + d_ck = int(ck.get("d_in", d_in)) + if int(d_in) != d_ck: + raise RuntimeError(f"PCA checkpoint was fitted on {d_ck}-d features, cache provides {d_in}-d") + from model import PCAEncoder + base = PCAEncoder(d_in, int(c["pca_dim"])).to(device) + base.load_state_dict(ck["enc"]) # mean + W buffers + d_lat = int(c["pca_dim"]) + n_pr + else: + d_lat = c["d_z"] + n_pr + base = Encoder(d_in, c["d_z"], c["enc_width"]).to(device) + base.load_state_dict(ck["enc"]) + if n_pr: + if data is None or data.proprio is None: + raise RuntimeError(f"checkpoint appends {n_pr} proprio dims; pass data=") + pr = np.asarray(data.proprio[::37], np.float32) + mu = torch.tensor(pr.mean(0), device=device) + sd = torch.tensor(pr.std(0) + 1e-6, device=device) + else: + mu = sd = torch.zeros(0, device=device) + enc = _LatWithProprio(base, n_pr, mu, sd).to(device) + rew = RewardHead(d_lat, n_task).to(device) + flow = OccFlow(d_lat, ck["d_act"], n_task, width=c["flow_width"], + depth=c["flow_depth"], norm=bool(c.get("flow_norm", 0)), + dropout=float(c.get("flow_dropout", 0.0) or 0.0)).to(device) + rew.load_state_dict(ck["rew"]) + flow.load_state_dict(ck["flow"]) + for m in (enc, rew, flow): + m.eval() + for p in m.parameters(): + p.requires_grad_(False) + c = dict(c); c["d_z"] = d_lat # downstream sizes policies by the FULL latent + c["enc_kind"] = enc_kind + return enc, rew, flow, ck["rms"].to(device), c + + +# --------------------------------------------------------------------------- # +# pi_0: behaviour cloning on a chosen slice of the corpus +# --------------------------------------------------------------------------- # +def make_policy(args, d, device, d_act=None, d_z=None): + """Flow by default. A Gaussian target against a flow-SDE behaviour policy let + the ratio classifier hit 100% accuracy by recognising the SAMPLER rather than + the policy: E_mu[W] came out 0.181 in BOTH the signal gate and the null gate + where the two policies were meant to be the same. Matching the family removes + that shortcut.""" + fam = getattr(args, "policy_family", "concat") + da = d_act or (d.chunk * d.adim) + dz = args.d_z if d_z is None else d_z + if fam == "gauss": + return BCHead(dz, da, d.n_task).to(device) + if fam == "flow": + return FlowPolicy(dz, da, d.n_task).to(device) + from model import ConcatFlowPolicy + return ConcatFlowPolicy(dz, da, d.n_task, + width=int(getattr(args, "pol_width", 1024) or 1024), + depth=int(getattr(args, "pol_depth", 4) or 4)).to(device) + + +def policy_features(args, enc, d, cfg, device=None): + """(module, width) feeding the POLICY -- deliberately separate from the + critic's latent. See model.RawFeat for why raw is the default.""" + from model import RawFeat + mode = getattr(args, "policy_features", "raw") + if mode != "raw": + return enc, cfg["d_z"] + scale = np.ones(d.feat_dim, np.float32) + if getattr(args, "feat_scale", "zscore") == "center" and d.norm_sd is not None: + n_pr = 0 if d.proprio is None else d.proprio.shape[1] + n_z = d.feat_dim - n_pr + sd_z = d.norm_sd[:n_z] + scale[:n_z] = sd_z / max(float(sd_z.mean()), 1e-6) # undo the whitening + rf = RawFeat(d.feat_dim, torch.from_numpy(scale)) + return (rf if device is None else rf.to(device)), d.feat_dim + + +def policy_nll(pol, z, task, a, reduce=True): + """-log pi surrogate: exact for the Gaussian head, per-sample flow-matching + loss for the flow head (the substitution the smolvla AWR run used).""" + if hasattr(pol, "fm_loss"): + return pol.fm_loss(z, task, a, reduce=reduce) + lp = -pol.log_prob(z, task, a) + return lp.mean() if reduce else lp + + +@torch.no_grad() +def sampled_action_mse(pol, d, pfeat, rng, device, pool, n=2048, chunk_len=None): + """Held-out ODE-sampled reconstruction MSE -- THE flow-BC metric. + + The raw conditional-flow-matching loss is a velocity residual at a random + flow time and does NOT track how good the ACTIONS the policy emits are: on + this corpus it ranked raw features best (0.158) while the closed loop said + otherwise. What the lane's own BC sweep ranks on, and what we rank on here, + is the MSE between the logged chunk and the chunk the policy actually + integrates out of noise.""" + cl = chunk_len or d.chunk + eps_pool = np.array([e for e in d.val_eps if pool[e]]) + if not len(eps_pool): + return float("nan") + w = d.ep_len[eps_pool].astype(np.float64); w /= w.sum() + e = rng.choice(eps_pool, size=n, p=w) + lo, hi = d.ep_from[e], d.ep_to[e] + t = lo + (rng.random(n) * (hi - lo)).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(device) + a = torch.from_numpy(d._chunk_at(t, e, chunk_len=cl)).to(device) + tk = torch.from_numpy(d.ep_task[e]).long().to(device) + out = [] + for i in range(0, n, 512): + z = pfeat(x[i:i + 512]) + out.append(((pol.sample(z, tk[i:i + 512]) - a[i:i + 512]) ** 2).mean(-1)) + return float(torch.cat(out).mean()) + + +# Optional W&B run for the BC loop (set by bc_arm.py when RSM_WANDB_ENTITY is set; None = off). +# Kept as a module global rather than an args attribute so that vars(args) stays JSON/torch-serialisable. +WANDB_RUN = None + + +def train_bc(d, enc, args, device, only_success=True, steps=8000, chunk_len=None, + pfeat=None, d_policy=None, resume_path=None): + """chunk_len=None fits the occupancy's action window. Pass the behaviour + policy's DECISION period to fit a policy directly comparable to logged + decisions: scoring the first 10 actions of a 100-action plan is not the same + distribution a 10-action policy emits, and that mismatch alone kept the ratio + classifier at 0.98 accuracy.""" + cl = chunk_len or d.chunk + pf = enc if pfeat is None else pfeat + pol = make_policy(args, d, device, d_act=cl * d.adim, d_z=d_policy) + # pool selector: "succ" = successful episodes, "demos" = demonstrations only + # (the BC-on-demos baseline), None/False = everything. + # plain Adam, no weight decay: the 0.584 recipe's optimiser + opt = torch.optim.Adam(pol.parameters(), lr=getattr(args, "lr", 3e-4)) + rng = np.random.default_rng(args.seed + 1) + # ONE chain. This used to be two (the rollsucc branch was added as a fresh `if` + # after the mask block), so the trailing `elif only_success:` -- true for any + # non-empty string -- silently overrode "demos" with ALL successes. BC-on-demos + # arms trained on 24,673 episodes instead of 500, and looked identical to the + # successes arm on both clusters (2026-09-14). + _mask = getattr(args, "success_mask", "") or "" + _ver = None + if _mask: + _ver = np.load(_mask)["keep"].astype(bool) + print(f"[bc] success mask: {int(_ver.sum())}/{len(_ver)} episodes verified", flush=True) + if only_success == "demos": + # a replayed demo that did not reproduce success is inadmissible (legacy demo + # caches mark every demo successful, so this is a no-op for them) + ok = d.ep_demo & d.ep_success + elif only_success == "demos_succ": + ok = d.ep_demo | d.ep_success + elif only_success == "rollsucc_mix": + _k = int(getattr(args, "demos_per_task", 5) or 0) + ok = (d.ep_success & ~d.ep_demo).copy() + _rs = np.random.default_rng(args.seed + 77) + _added = 0 + for _t in range(d.n_task): + _cand = np.where(d.ep_demo & (d.ep_task == _t))[0] + if len(_cand) == 0 or _k <= 0: + continue + _pick = _rs.choice(_cand, size=min(_k, len(_cand)), replace=False) + ok[_pick] = True + _added += len(_pick) + print(f"[bc] rollsucc_mix: {int((d.ep_success & ~d.ep_demo).sum())} rollout " + f"successes + {_added} demos ({_k}/task)", flush=True) + elif only_success == "rollsucc": + ok = d.ep_success & ~d.ep_demo + elif only_success: # True / "succ": demos + successful rollouts + ok = d.ep_success.copy() + else: + ok = np.ones(d.n_ep, bool) + # Admissibility: a logged success that does not reproduce in the eval env is never + # cloned. Applied to every pool that contains rollout successes (demos are always kept). + if _ver is not None and only_success != "demos": + _before = int(ok.sum()); ok = ok & (_ver | d.ep_demo) + print(f"[bc] verified filter: {_before} -> {int(ok.sum())} episodes", flush=True) + print(f"[bc] pool={only_success!r}: {int(ok.sum())} episodes " + f"({int((ok & d.ep_demo).sum())} demos + {int((ok & ~d.ep_demo).sum())} rollouts)", flush=True) + pool = np.array([e for e in d.train_eps if ok[e]]) + # Init-density ablation: cap the number of EPISODES per task. Every demo and + # every fresh-reset rollout starts from its own independent BDDL draw, so + # episodes-per-task IS distinct-initial-conditions-per-task. Holding the pool + # (hence data quality) fixed and varying this isolates coverage density from + # quality, which the demos-vs-rollouts comparison confounds. + _cap = int(getattr(args, "eps_per_task", 0) or 0) + if _cap > 0: + _keep, _seen = [], {} + _rs = np.random.default_rng(args.seed + 5150) + for _e in _rs.permutation(pool): + _t = int(d.ep_task[_e]) + if _seen.get(_t, 0) < _cap: + _keep.append(_e); _seen[_t] = _seen.get(_t, 0) + 1 + pool = np.array(sorted(_keep)) + print(f"[bc] init-density cap: {_cap} episodes/task -> {len(pool)} episodes " + f"over {len(_seen)} tasks", flush=True) + ev_every = max(1, steps // 20) + ev_rng = np.random.default_rng(args.seed + 77) + best, best_sd, best_step = float("inf"), None, 0 + # Resume support. These arms run on a preemptible queue; without it a + # preemption at step 96000 restarts from zero and the arm never finishes. + start = 0 + if resume_path is not None and Path(resume_path).exists(): + ck = torch.load(resume_path, map_location=device, weights_only=False) + pol.load_state_dict(ck["pol"]); opt.load_state_dict(ck["opt"]) + start, best, best_step = ck["step"], ck["best"], ck["best_step"] + best_sd = ck["best_sd"] + rng = np.random.default_rng(ck["rng_seed"]) + print(f"[bc] resumed at step {start} (best {best:.5f} @ {best_step})", + flush=True) + # Hard Q-filter on the TRAINING DATA (the port's `qfilter_frac`, never run here). + # Distinct from ranking (picks actions at test time) and from AWR (re-weights + # gradients): this decides which logged (s,a) pairs are cloned at all, and the + # resulting policy needs no test-time sampling -- so a value-free selector like + # medoid cannot reproduce it. + qf_frac = float(getattr(args, "qfilter_frac", 0.0) or 0.0) + qf_ctx = None + if qf_frac > 0: + _enc, _rew, _flow, _rms, _cfg = load_critic(args.critic, d.feat_dim, d.n_task, + device, data=d) + qf_ctx = (_enc, _rew, _flow, _rms) + print(f"[bc] Q-filter ON: cloning the top {qf_frac:.0%} of each " + f"oversampled batch by critic advantage", flush=True) + + for step in range(start + 1, steps + 1): + nb = args.batch if qf_frac <= 0 else int(args.batch / qf_frac) + w = d.ep_len[pool].astype(np.float64) + _dw = float(getattr(args, "demo_weight", 1.0) or 1.0) + if _dw != 1.0: + w = w * np.where(d.ep_demo[pool], _dw, 1.0) # up-weight demonstrations in a mixed pool + w /= w.sum() + e = rng.choice(pool, size=nb, p=w) + lo, hi = d.ep_from[e], d.ep_to[e] + t = lo + (rng.random(nb) * (hi - lo)).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(device) + a = torch.from_numpy(d._chunk_at(t, e, chunk_len=cl)).to(device) + task = torch.from_numpy(d.ep_task[e]).long().to(device) + if qf_frac > 0: + with torch.no_grad(): + _e2, _r2, _f2, _rm2 = qf_ctx + zc = _e2(x) + q, _ = q_recursive(zc, a, task, rew=_r2, flow=_f2, rms=_rm2, + pol=None, wend=None, + beta=getattr(args, "beta_q", 0.98), gamma=0.99, + depth=1, n_particles=8, use_is=False, + pessimism=0.0) + keep = torch.topk(q, args.batch).indices + x, a, task = x[keep], a[keep], task[keep] + with torch.no_grad(): + z = pf(x) + loss = policy_nll(pol, z, task, a) + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(pol.parameters(), 1.0); opt.step() + if step % ev_every == 0 or step == steps: + pol.eval() + m = sampled_action_mse(pol, d, pf, ev_rng, device, ok, chunk_len=cl) + pol.train() + tag = "" + if m == m and m < best: + best, best_step = m, step + best_sd = {k: v.detach().clone() for k, v in pol.state_dict().items()} + tag = " <- best" + print(f"[bc] {step} cfm={float(loss):.4f} sampled_mse={m:.5f}{tag}", + flush=True) + if WANDB_RUN is not None: + try: + WANDB_RUN.log({"bc/loss": float(loss), "bc/sampled_mse": m, + "bc/best_sampled_mse": best, "bc/best_step": best_step}, step=step) + except Exception as _e: # logging must never kill a run + print(f"[bc] wandb log failed: {_e}", flush=True) + if resume_path is not None: + tmp = str(resume_path) + ".tmp" + torch.save({"pol": pol.state_dict(), "opt": opt.state_dict(), + "step": step, "best": best, "best_step": best_step, + "best_sd": best_sd, "rng_seed": args.seed + 1}, tmp) + _os.replace(tmp, resume_path) # atomic: a kill mid-write is safe + _se = int(getattr(args, "save_every", 0) or 0) + if resume_path is not None and _se and step % _se == 0: + # Periodic checkpoints so the policy can be selected by arg-max over + # checkpoints on a held-out set of VALIDATION initial conditions -- + # the sampled-MSE proxy above picked a checkpoint 0.10 SR below the + # last one (BCdemo_f: 102k vs 120k), so it is not a usable selector. + torch.save({"pol": pol.state_dict(), "round": 1, "step": step, + "config": vars(args), + "cam_res": getattr(d, "cam_res", "UNKNOWN"), + "encoder": getattr(d, "encoder", "pi05_base_pytorch")}, + str(Path(resume_path).parent / f"policy_s{step}.pt")) + # Keep the checkpoint that emits the best ACTIONS, not the last one. + if best_sd is not None: + pol.load_state_dict(best_sd) + print(f"[bc] restored best sampled_mse={best:.5f} from step {best_step}", + flush=True) + pol.eval() + pol.best_sampled_mse = best + return pol + + +# --------------------------------------------------------------------------- # +# Step 1: per-decision density ratio by classification +# --------------------------------------------------------------------------- # +class LikelihoodRatio: + """Genuine likelihood ratio pi(a|z)/mu_hat(a|z), no classifier. + + The identity control killed the discriminative route: two BC policies trained + on IDENTICAL data with different seeds are 0.945-0.977 separable, the same as + target-vs-behaviour (0.941). A classifier reads WHICH NETWORK produced a + sample -- sampler artifacts, generator fingerprints -- long before it reads a + density difference, so its logit is not log pi/mu at all. + + Evaluating densities AT THE LOGGED ACTION removes that channel: nothing is + asked to tell samples apart. mu has no tractable density (pi0.5 flow SDE), so + we fit `mu_hat`, a Gaussian behaviour model, by maximum likelihood on the + logged actions. Both sides are then tractable and the ratio is a real one. + + Null test is exact by construction: with pi == mu_hat the ratio is identically + 1, which no classifier-based estimator could guarantee. + """ + + def __init__(self, pi, mu_hat, clip=1.5): + self.pi = pi; self.mu_hat = mu_hat; self.clip = clip + + @torch.no_grad() + def __call__(self, z, a, task): + lr = self.pi.log_prob(z, task, a) - self.mu_hat.log_prob(z, task, a) + return lr.clamp(-self.clip, self.clip) + + def eval(self): + return self + + def state_dict(self): + return {"pi": self.pi.state_dict(), "mu_hat": self.mu_hat.state_dict(), + "clip": self.clip} + + +def train_likelihood_ratio(d, enc, args, device, steps=6000, only_success=True, + chunk_len=None): + """Fit tractable Gaussian densities for BOTH policies, then take their ratio.""" + cl = chunk_len or d.chunk + ga = SimpleNamespace(d_z=args.d_z, batch=args.batch, seed=args.seed, + policy_family="gauss") + print(f"[likratio] fitting mu_hat (Gaussian behaviour model, chunk {cl})", flush=True) + mu_hat = train_bc(d, enc, ga, device, only_success=False, steps=steps, + chunk_len=cl) + gb = SimpleNamespace(d_z=args.d_z, batch=args.batch, seed=args.seed + 5, + policy_family="gauss") + print(f"[likratio] fitting pi ({'successes' if only_success else 'all data'})", + flush=True) + pi = train_bc(d, enc, gb, device, only_success=only_success, steps=steps, + chunk_len=cl) + # sanity: E_mu[pi/mu_hat] over LOGGED actions must be ~1 + rng = np.random.default_rng(args.seed + 41) + acc = [] + with torch.no_grad(): + for _ in range(8): + b = d.sample_frames(1024, rng, "val", device) + z = enc(b["x"]) + a = torch.from_numpy( + d._chunk_at(b["t_idx"], b["ep"], chunk_len=cl)).to(device) + lr = (pi.log_prob(z, b["task"], a) + - mu_hat.log_prob(z, b["task"], a)).clamp(-1.5, 1.5) + acc.append(lr.exp()) + w = torch.cat(acc) + print(f"[likratio] E_mu[w] = {float(w.mean()):.4f} (target 1.0) " + f"median {float(w.median()):.4f} ESS " + f"{float((w.sum()**2)/(w.pow(2).sum()*len(w))):.3f} " + f"p95 {float(w.quantile(0.95)):.3f}", flush=True) + return LikelihoodRatio(pi, mu_hat), pi + + +def train_ratio(d, enc, pol, args, device, steps=6000): + """Density-ratio classifier, optionally on SMOOTHED chunks. + + Measured: with a Gaussian target vs the flow-SDE behaviour policy the + classifier hit acc 0.999 (bce 0.0035) -- it was recognising the sampler. + Matching the family (FlowPolicy) dropped it to acc 0.98 (bce 0.076), a 20x + drop in confidence, but the two are still near-separable because the logged + data was collected with SDE noise 0.5 while the target policy samples an ODE. + + `ratio_smooth` adds the SAME Gaussian kernel to both classes before the + classifier. That estimates the ratio of the SMOOTHED densities, which is + well-defined by construction and trades a controlled bias for overlap. A + ratio between two near-disjoint distributions is not estimable at all, so a + blurred but finite ratio is the more useful object. + """ + rc = int(getattr(args, "ratio_chunk", 0) or d.chunk) + net = RatioNet(args.d_z, rc * d.adim, d.n_task).to(device) + opt = torch.optim.AdamW(net.parameters(), lr=3e-4, weight_decay=0.01) + rng = np.random.default_rng(args.seed + 2) + sm = float(getattr(args, "ratio_smooth", 0.0)) + # Per-dimension kernel: the 7 action dims span std 0.031 to 0.975 (the + # gripper is near-binary), so one scalar sigma would erase the fine dims + # while barely touching the gripper. sigma_i = smooth * std_i. + a_scale = None + if sm > 0: + _b = d.sample_frames(4096, np.random.default_rng(args.seed + 99), + "train", device) + _am = torch.from_numpy( + d._chunk_at(_b["t_idx"], _b["ep"], chunk_len=rc)).to(device) + a_scale = _am.std(0).clamp_min(1e-3) * sm + print(f"[ratio] per-dim smoothing on, mean sigma " + f"{float(a_scale.mean()):.4f}", flush=True) + for step in range(1, steps + 1): + b = d.sample_frames(args.batch, rng, "train", device) + with torch.no_grad(): + z = enc(b["x"]) + a_pi = pol.sample(z, b["task"]) + if a_pi.shape[-1] != rc * d.adim: + a_pi = a_pi[:, :rc * d.adim] + a_mu = torch.from_numpy( + d._chunk_at(b["t_idx"], b["ep"], chunk_len=rc)).to(device) + if sm > 0: + a_mu = a_mu + a_scale * torch.randn_like(a_mu) + a_pi = a_pi + a_scale * torch.randn_like(a_pi) + logit_mu = net(z, a_mu, b["task"]) # logged -> label 0 + logit_pi = net(z, a_pi, b["task"]) # from pi -> label 1 + loss = (F.binary_cross_entropy_with_logits(logit_mu, torch.zeros_like(logit_mu)) + + F.binary_cross_entropy_with_logits(logit_pi, torch.ones_like(logit_pi))) + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(net.parameters(), 1.0); opt.step() + if step % 1000 == 0: + with torch.no_grad(): + acc = ((logit_pi > 0).float().mean() + (logit_mu < 0).float().mean()) / 2 + print(f"[ratio] {step} bce={float(loss):.4f} acc={float(acc):.3f}", flush=True) + net.eval() + return net + + +# --------------------------------------------------------------------------- # +# Step 2+3: chunk product -> endpoint weight +# --------------------------------------------------------------------------- # +@torch.no_grad() +def precompute_decision_logratio(d, enc, ratio, device, batch=4096, rc=None): + """One pass over the cache -> per-frame log pi/mu at DECISION points, plus a + per-episode prefix sum. + + The logged policy re-decided every `chunk` frames, so the only frames that + carry a ratio factor are ep_from + chunk*j. Prefix-summing them turns the + chunk product of Section 7 into an O(1) lookup per sample, instead of one + network call per interior decision (16x fewer forwards per training step). + """ + N = int(d.ep_to[-1]) + rc = rc or d.chunk + lr = np.zeros(N, np.float32) + dec = np.zeros(N, bool) + for i in range(d.n_ep): + lo, hi = int(d.ep_from[i]), int(d.ep_to[i]) + dec[np.arange(lo, hi, rc)] = True + idx = np.nonzero(dec)[0] + ep_of = np.searchsorted(d.ep_to, idx, side="right") + for s in range(0, len(idx), batch): + sl = idx[s:s + batch] + x = torch.from_numpy(d._feat(sl)).to(device) + a = torch.from_numpy( + d._chunk_at(sl, ep_of[s:s + batch], chunk_len=rc)).to(device) + tk = torch.from_numpy(d.ep_task[ep_of[s:s + batch]]).long().to(device) + lr[sl] = ratio(enc(x), a, tk).float().cpu().numpy() # log pi/mu + pre = np.zeros(N + 1, np.float64) + np.cumsum(lr, out=pre[1:]) + # restart the prefix at every episode boundary so no product spans episodes + for i in range(d.n_ep): + lo = int(d.ep_from[i]) + pre[lo + 1:int(d.ep_to[i]) + 1] -= pre[lo] + return pre + + +def chunk_logW_fast(pre, t_idx, fut_idx): + """log W over decisions strictly inside (t, fut). The decision AT t is the + conditioned-on action a_t and is excluded, matching w_{t,k} in the notes.""" + lo = np.minimum(t_idx + 1, fut_idx) + return (pre[fut_idx] - pre[lo]).astype(np.float32) + + +def train_endpoint_ratio(d, enc, ratio, args, device, steps=6000, logw_clip=4.0): + """Squared-loss regression of W onto (z, A, z'): the minimizer is E[W|endpoint].""" + rc = int(getattr(args, "ratio_chunk", 0) or d.chunk) + pre = precompute_decision_logratio(d, enc, ratio, device, rc=rc) + # Sized by the OCCUPANCY chunk: w*(z, A, z') conditions on the action the + # successor was conditioned on. Only the per-decision classifier uses rc. + net = EndpointRatio(args.d_z, d.chunk * d.adim, d.n_task).to(device) + opt = torch.optim.AdamW(net.parameters(), lr=3e-4, weight_decay=0.01) + rng = np.random.default_rng(args.seed + 3) + for step in range(1, steps + 1): + b = d.sample(args.batch, rng, args.beta_q, args.beta_q, "train", device) + logW = torch.from_numpy( + chunk_logW_fast(pre, b["t_idx"], b["fut_idx"])).to(device) + W = logW.clamp(-logw_clip, logw_clip).exp() + with torch.no_grad(): + z = enc(b["x_now"]); zf = enc(b["x_fut"]) + pred = net(z, b["a_now"], zf, b["task"]) + loss = (pred - W).pow(2).mean() + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(net.parameters(), 1.0); opt.step() + if step % 1000 == 0: + print(f"[wend] {step} mse={float(loss):.4f} " + f"E_mu[W]={float(W.mean()):.3f} E_mu[what]={float(pred.mean()):.3f}", + flush=True) + net.eval() + # Global calibration: E_mu[w] must be 1 for a correct density ratio. Rescale + # on held-out data and RECORD the factor -- a factor far from 1 means the + # ratio is mis-fit, and that is a finding, not something to silently absorb. + with torch.no_grad(): + acc = [] + for _ in range(8): + b = d.sample(1024, rng, args.beta_q, args.beta_q, "val", device) + z = enc(b["x_now"]); zf = enc(b["x_fut"]) + acc.append(net(z, b["a_now"], zf, b["task"])) + m = float(torch.cat(acc).mean()) + net.calib = 1.0 / max(m, 1e-3) + print(f"[wend] calibration E_mu[w]={m:.3f} -> scale x{net.calib:.3f}", flush=True) + return net + + +# --------------------------------------------------------------------------- # +# Step 4: recursive, importance-corrected Q +# --------------------------------------------------------------------------- # +@torch.no_grad() +def q_recursive(enc_z, a_chunk, task, *, rew, flow, rms, pol, wend, beta, gamma, + depth=2, n_particles=16, flow_steps=8, self_norm=True, + use_is=True, logw_clip=4.0, pessimism=0.0, crn=False): + """Q^pi(z,A) by composing beta-hops. Boundary actions come from pi, so only + chunk interiors carry a weight. depth is small on purpose (2-3). + + crn=True: common random numbers across the B rows (candidates). Particle i of + every candidate uses the same flow noise, the same restart coin and the same hop- + policy noise, so Q differences between candidates are paired and the Monte-Carlo + error cancels in the arg-max (the OCBench recipe scores all N candidates on one + shared z0 for exactly this reason). With independent draws, near-identical + candidates are ranked by noise.""" + dev = enc_z.device + B = enc_z.shape[0] + D = enc_z.shape[1] + def _tile(t): # [n_particles, ...] -> [B*n_particles, ...] matching repeat_interleave + return t.repeat(B, *([1] * (t.dim() - 1))) + p = (gamma - beta) / (gamma * (1.0 - beta)) # restart probability + p = float(np.clip(p, 0.0, 0.95)) + # Truncating the recursion at `depth` is not free: the composition needs an + # unbounded number of hops, so a finite depth realises a SHORTER effective + # horizon than the nominal gamma. Report it rather than claim gamma. + # E[hops] = (1 - p^L)/(1 - p), each hop covering 1/(1-beta) frames. + z = enc_z.repeat_interleave(n_particles, 0) + a = a_chunk.repeat_interleave(n_particles, 0) + tk = task.repeat_interleave(n_particles, 0) + bq = torch.full((z.shape[0],), beta, device=dev) + logC = torch.zeros(z.shape[0], device=dev) + alive = torch.ones(z.shape[0], dtype=torch.bool, device=dev) + z_end = z.clone() + for h in range(depth): + x0 = _tile(torch.randn(n_particles, D, device=dev)) if crn else None + zp = sample_future(flow, z, a, tk, bq, rms, flow_steps, n=1, x0=x0) + if use_is and wend is not None: + w = (wend(z, a, zp, tk) * getattr(wend, "calib", 1.0)).clamp_min(1e-4) + logC = logC + torch.where(alive, w.log().clamp(-logw_clip, logw_clip), + torch.zeros_like(logC)) + z_end = torch.where(alive[:, None], zp, z_end) + if h == depth - 1: + break + coin = _tile(torch.rand(n_particles, device=dev)) if crn else torch.rand(z.shape[0], device=dev) + cont = alive & (coin < p) + if not cont.any(): + break + z = torch.where(cont[:, None], zp, z) + if crn and hasattr(pol, "sample_eps"): + a_new = pol.sample_eps(z, tk, _tile(torch.randn(n_particles, pol.d_act, device=dev))) + else: + a_new = pol.sample(z, tk) + a = torch.where(cont[:, None], a_new, a) + alive = cont + r = torch.sigmoid(rew(z_end, tk)).view(B, n_particles) + C = logC.exp().view(B, n_particles) + if self_norm: + q = (C * r).sum(1) / C.sum(1).clamp_min(1e-6) + else: + q = (C * r).mean(1) + if pessimism: + # Penalise DISAGREEMENT between particles. The measured failure mode of + # this critic is off-support optimism: conditioned on an action the data + # never took, the occupancy flow produces diffuse samples that drift + # toward the dataset mean, where the reward head returns roughly the base + # rate -- which outranks a confident low reward on a genuinely failing + # taken action. The action win rate accordingly starts near 0.55 and + # decays below chance as the flow sharpens. Particle spread is exactly + # the signal that separates the two cases, and subtracting it is the + # standard offline-RL pessimism penalty. + q = q - pessimism * r.std(1) + ess = (C.sum(1) ** 2) / (C.pow(2).sum(1)).clamp_min(1e-9) / n_particles + return q / (1 - gamma), ess + + +def q_fold(enc_z, a_chunk, task, *, rew, flow, rms, pol, beta, gamma, depth=1, + n_particles=16, flow_steps=8, crn=True): + """The OCBench product fold (ocbench_unified_rsm, rsm_core.step_q): + + Q_k = c_k + (1 - c_k) * gamma**h * Q_{k+1}, h = 1/(1-beta), Q_{depth+1} = 0 + + read as reach-or-continue: c_k = read-out at the k-th hop state ("already at a + success/goal state"), otherwise pay one hop of discount and inherit the next hop. + Hop 1 is decoded from the QUERY action; hop k+1 from pol(hop_k). A FIXED number of + hops (no restart coin), per-particle fold, Monte-Carlo mean over n_particles, all + candidates (rows of enc_z) scored on the same noise when crn=True -- exactly the + recipe's estimator. With the subgoal-fraction head, c_k is the fraction of the goal + reached at hop k (partial credit); with the indicator head it is P(success state). + Returns Q in [0, 1].""" + dev = enc_z.device + B, D = enc_z.shape + h = 1.0 / (1.0 - beta) + def _tile(t): + return t.repeat(B, *([1] * (t.dim() - 1))) + z = enc_z.repeat_interleave(n_particles, 0) + a = a_chunk.repeat_interleave(n_particles, 0) + tk = task.repeat_interleave(n_particles, 0) + bq = torch.full((z.shape[0],), beta, device=dev) + cs = [] + for k in range(depth): + x0 = _tile(torch.randn(n_particles, D, device=dev)) if crn else None + z = sample_future(flow, z, a, tk, bq, rms, flow_steps, n=1, x0=x0) + cs.append(torch.sigmoid(rew(z, tk))) + if k == depth - 1: + break + if crn and hasattr(pol, "sample_eps"): + a = pol.sample_eps(z, tk, _tile(torch.randn(n_particles, pol.d_act, device=dev))) + else: + a = pol.sample(z, tk) + q = torch.zeros_like(cs[-1]) + for c in reversed(cs): # backward fold + q = c + (1.0 - c) * (gamma ** h) * q + q = torch.nan_to_num(q, nan=0.0).clamp(0.0, 1.0).view(B, n_particles) + return q.mean(1), torch.ones(B, device=dev) + + +def effective_horizon(beta, gamma, depth): + """What a depth-truncated recursion actually estimates.""" + p = float(np.clip((gamma - beta) / (gamma * (1.0 - beta)), 0.0, 0.95)) + hops = (1.0 - p ** depth) / (1.0 - p) + frames = hops / (1.0 - beta) + return {"restart_p": p, "mean_hops": hops, + "mean_hops_untruncated": 1.0 / (1.0 - p), + "effective_frames": frames, + "gamma_effective": 1.0 - 1.0 / max(frames, 1.0), + "gamma_nominal": gamma, + "truncation_mass": p ** depth} diff --git a/gen_q_rsm/rsm_libero/label_full.sbatch b/gen_q_rsm/rsm_libero/label_full.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..bb83d02365a8d65ee13748d92bb2c2c8013aff8f --- /dev/null +++ b/gen_q_rsm/rsm_libero/label_full.sbatch @@ -0,0 +1,20 @@ +#!/bin/bash +#SBATCH --job-name=label_full +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --array=0-39 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +T=$((SLURM_ARRAY_TASK_ID / 4)); K=$((SLURM_ARRAY_TASK_ID % 4)) +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/subgoals_full; mkdir -p $OUT +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/label_subgoals.py \ + --cache /data/pulkitag/scratch/rli14/rsm_libero_cache/full_r256 \ + --task $T --shard $K --num-shards 4 --out $OUT/task${T}_s${K}.npz --stride 5 diff --git a/gen_q_rsm/rsm_libero/label_subgoals.py b/gen_q_rsm/rsm_libero/label_subgoals.py new file mode 100644 index 0000000000000000000000000000000000000000..4d1ca82f4b3e449c56ea613ce064715a1945e400 --- /dev/null +++ b/gen_q_rsm/rsm_libero/label_subgoals.py @@ -0,0 +1,91 @@ +"""Per-frame satisfied-subgoal count: a reward that IS a function of state. + +gamma_s**(frames-to-success) is not a function of the state -- it depends on the +episode's outcome and the frame index, so identical configurations carry targets +differing by ~1.4 sigma of the reward range (measured). A regressor fit to it can only +recover P(success|z). + +Each LIBERO goal is a conjunction of BDDL predicates over object geometry. Evaluating +them per frame gives r(s) = (#conjuncts satisfied)/K: deterministic in the state, +identical for identical states, and defined for EVERY frame of EVERY episode including +failures -- which today contribute only zeros. + +Emits per-episode arrays aligned to the cache's frame index. +""" +import argparse, os, re, sys +import numpy as np +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +SRC = "/data/pulkitag/users/rli14/pi05_lib10_sde_v1" +PAT = re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") + + +def src_parquet(ep_src): + m = PAT.search(str(ep_src)) + if not m: return None + t, b, i, idx = m.groups() + p = (f"{SRC}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + return p if os.path.exists(p) else None + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True); ap.add_argument("--task", type=int, required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--shard", type=int, default=0); ap.add_argument("--num-shards", type=int, default=1) + ap.add_argument("--stride", type=int, default=5, + help="evaluate every Nth frame and hold; subgoal count is piecewise " + "constant and changes a handful of times per episode") + args = ap.parse_args() + + import pyarrow.parquet as pq + from libero.libero import benchmark, get_libero_path + from libero.libero.envs.env_wrapper import ControlEnv + from pathlib import Path + + m = np.load(f"{args.cache}/meta.npz", allow_pickle=True) + task, lo, hi = m["ep_task"], m["ep_from"], m["ep_to"] + demo = m["ep_demo"].astype(bool) + todo = np.where((task == args.task) & ~demo)[0] # rollouts; demos have no parquet + todo = todo[args.shard::args.num_shards] # within-task sharding for the full corpus + b = benchmark.get_benchmark_dict()["libero_10"]() + t = b.get_task(args.task) + env = ControlEnv(bddl_file_name=str(Path(get_libero_path("bddl_files")) + / t.problem_folder / t.bddl_file), + has_renderer=False, has_offscreen_renderer=False, use_camera_obs=False) + env.reset() + goal = env.env.parsed_problem["goal_state"] + K = len(goal) + print(f"[label] task {args.task}: {len(todo)} rollouts, K={K} conjuncts {goal}", flush=True) + + eps, vals = [], [] + for n, e in enumerate(todo): + p = src_parquet(m["ep_src"][e]) + nfr = int(hi[e] - lo[e]) + if p is None: + eps.append(int(e)); vals.append(np.full(nfr, -1, np.int8)); continue + tb = pq.read_table(p, columns=["sim_state"]) + N = min(tb.num_rows, nfr) + out = np.zeros(nfr, np.int8) + last = 0 + for i in range(0, N, args.stride): + st = np.asarray(tb["sim_state"][i].as_py(), np.float64) + env.env.sim.set_state_from_flattened(st); env.env.sim.forward() + last = sum(bool(env.env._eval_predicate(g)) for g in goal) + out[i:min(i + args.stride, nfr)] = last + if N < nfr: out[N:] = last + eps.append(int(e)); vals.append(out) + if (n + 1) % 100 == 0: + f = np.concatenate(vals) + print(f"[label] {n+1}/{len(todo)} mean subgoals {f[f>=0].mean():.3f}", flush=True) + env.close() + np.savez_compressed(args.out, ep=np.array(eps), + vals=np.array(vals, dtype=object), K=K, task=args.task) + f = np.concatenate(vals); f = f[f >= 0] + print(f"[label] task {args.task} DONE: {len(eps)} eps, mean subgoals " + f"{f.mean():.3f}/{K}, frames at 0/1/2 = " + f"{np.bincount(f, minlength=K+1).tolist()}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/label_subgoals.sbatch b/gen_q_rsm/rsm_libero/label_subgoals.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..a8c493c9b91e9ce5f1acb9b98296cd1ad11e326f --- /dev/null +++ b/gen_q_rsm/rsm_libero/label_subgoals.sbatch @@ -0,0 +1,17 @@ +#!/bin/bash +#SBATCH --job-name=label_sub +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --array=0-9 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/subgoals; mkdir -p $OUT +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/label_subgoals.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --task $SLURM_ARRAY_TASK_ID --out $OUT/task$SLURM_ARRAY_TASK_ID.npz --stride 5 diff --git a/gen_q_rsm/rsm_libero/lane_control.sbatch b/gen_q_rsm/rsm_libero/lane_control.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..6e27aca6de89d6d047e29472a687039215370393 --- /dev/null +++ b/gen_q_rsm/rsm_libero/lane_control.sbatch @@ -0,0 +1,36 @@ +#!/bin/bash +#SBATCH --job-name=lane_ctl +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=8 +#SBATCH --mem=64G +#SBATCH --time=12:00:00 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +# CONTROL: the lane's OWN bcdemos policy through the lane's OWN evaluator on THIS +# machine. If it reproduces ~0.584 the env, EGL, encoder and init states here are +# sound and any 0% we see is our training's fault. If it does not, the harness is. +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +W=$B/.claude/worktrees/08312026_jvq_recap_worktree/scripts/rlinf_jvq +PY=$B/venvs/rlinf-libero-eval-venv/bin/python +export REPO_PATH=$B/external/rlinf +export PYTHONPATH="$REPO_PATH:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl +_G="$(echo "${CUDA_VISIBLE_DEVICES:-0}" | cut -d, -f1)" +export MUJOCO_EGL_DEVICE_ID="$_G" EGL_DEVICE_ID="$_G" +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +# The head's task embedding is sized by FL15_TASKS. It defaults to the 15-task +# libero_90 list, which cannot load a 10-task libero_10 checkpoint. +export FL15_TASKS="$(tr '\n' ',' < /data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +echo "[ctl] FL15_TASKS has $(echo "$FL15_TASKS" | tr ',' '\n' | grep -c .) tasks" +$PY $W/09032026_latent_head_eval.py \ + --ckpt /data/pulkitag/users/rli14/laneP_bc_v1/bcdemos_h1024d4.best.pt \ + --norm /data/pulkitag/users/rli14/laneP_bc_v1/bcdemos_h1024d4.norm.npz \ + --suite libero_10 --tasks 0,1,2,3,4,5,6,7,8,9 --n-init 10 \ + --max-steps 520 --execute 10 --seed 0 \ + --out /data/pulkitag/users/rli14/rsm_libero_runs/lane_control2/LANE_CONTROL.json +echo "[ctl] rc=$?" diff --git a/gen_q_rsm/rsm_libero/launch_full_r256.sh b/gen_q_rsm/rsm_libero/launch_full_r256.sh new file mode 100644 index 0000000000000000000000000000000000000000..d08174658b91a411416d8df2a04ec1ed2059690f --- /dev/null +++ b/gen_q_rsm/rsm_libero/launch_full_r256.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# The full-corpus, one-latent-space wave (williamd4112/gen_q#252). Submits a slurm DAG: +# pack -> stats -> {BC-demos, BC-rollsucc} -> n=500 evals A/B +# pack -> {label x40, verify x40} -> mask -> {BC-succ, BC-rollsucc-masked, critics ind/sg} -> evals +# critic qind_f -> IQL (q-only, same frozen encoder) -> BoN8 evals +# BC-demos + critics/IQL -> best-of-8 argmax / random / medoid, 3 policy seeds +# Every training job is --requeue + --resume; every eval is --requeue. No --export anywhere +# (tig-cpu kills exported jobs); values ride in the environment. +set -uo pipefail +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +SR=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation/launchers/slurm_remote.sh +GPUP=vision-pulkitag-h200,vision-pulkitag-a100,vision-pulkitag-l40s,vision-pulkitag-a6000 +MEMP=vision-pulkitag-l40s,vision-pulkitag-a100,vision-pulkitag-h200 +Q=vision-pulkitag-free-cycles +CACHE=/data/pulkitag/users/rli14/rsm_libero_cache/full_r256 +RUNS=/data/pulkitag/users/rli14/rsm_libero_runs/mit; O=/data/pulkitag/users/rli14/rsm_libero_runs/eval +SG=/data/pulkitag/users/rli14/rsm_libero_runs/subgoals_full +MASK=/data/pulkitag/users/rli14/rsm_libero_runs/verify_full/verified_mask.npz +LEDGER=$O/launch_full_r256.ledger; : > $LEDGER +sub(){ local id; id=$($SR exec "cd $G && $1" 2>&1 | grep -o "Submitted batch job [0-9]*" | grep -o "[0-9]*$"); echo "$id $2" >> $LEDGER; echo "$id"; } + +# ---- data ---- +J_PACK=$(sub "sbatch --qos=$Q --partition=$MEMP $G/pack_full_r256.sbatch" pack_full_r256) +J_STATS=$(sub "sbatch --dependency=afterok:$J_PACK --qos=$Q --partition=$MEMP $G/stats_full.sbatch" stats_full) +J_LAB=$(sub "sbatch --dependency=afterok:$J_PACK $G/label_full.sbatch" label_full_x40) +J_VER=$(sub "sbatch --dependency=afterok:$J_PACK $G/verify_full.sbatch" verify_full_x40) +J_MASK=$(sub "sbatch --dependency=afterok:$J_LAB:$J_VER $G/merge_full.sbatch" merge_full) + +# ---- trainers ---- +BC="bc_arm.py --cache $CACHE --chunk 10 --bc-steps 120000 --batch 1024 --lr 3e-4 --norm-pool demos --feat-scale center --policy-features raw --policy-family concat --in-ram 1 --reward-mode soft --success-gamma 0.995 --seed 0" +CR="train_rsm.py --cache $CACHE --d-z 256 --enc-width 1024 --flow-width 1024 --flow-depth 4 --chunk 10 --beta-lo 0.93 --beta-hi 0.995 --beta-q 0.98 --batch 512 --lr 3e-4 --ema 0.995 --var-floor 0.1 --w-reward 1.0 --flow-steps 8 --w-actcon 0.5 --warmup-reward 2000 --in-ram 1 --append-proprio 1 --resume 1 --steps 400000 --eval-every 10000 --seed 0" +train(){ sub "CMD='$2' sbatch --job-name=$1 --dependency=afterok:$3 --qos=$Q --partition=$GPUP --requeue --time=20:00:00 $G/train_slurm.sbatch" "train $1"; } +J_BCD=$(train BCd_f "$BC --pool demos --out $RUNS/BCd_f" $J_STATS) +J_BCR=$(train BCroll_f "$BC --pool rollsucc --out $RUNS/BCroll_f" $J_STATS) +J_BCRV=$(train BCrollv_f "$BC --pool rollsucc --success-mask $MASK --out $RUNS/BCrollv_f" $J_STATS:$J_MASK) +J_BCS=$(train BCsucc_f "$BC --pool succ --success-mask $MASK --out $RUNS/BCsucc_f" $J_STATS:$J_MASK) +J_QI=$(train qind_f "$CR --reward-mode subgoal_ind --subgoal-dir $SG --success-mask $MASK --out $RUNS/qind_f" $J_STATS:$J_MASK) +J_QS=$(train qsg_f "$CR --reward-mode subgoal --subgoal-dir $SG --success-mask $MASK --out $RUNS/qsg_f" $J_STATS:$J_MASK) +IQ="iql.py --cache $CACHE --critic $RUNS/qind_f/ckpt_best.pt --out $RUNS/iql_f --chunk 10 --norm-pool demos --feat-scale center --policy-features raw --reward-mode subgoal_ind --subgoal-dir $SG --success-mask $MASK --tau 0.7 --gamma 0.99 --iql-steps 60000 --q-only 1 --in-ram 1 --seed 0" +J_IQL=$(train iql_f "$IQ" $J_QI) # same encoder as the RSM arm: only the source of Q differs + +# ---- evals: n=500, protocols A and B, evaluator at 256 ---- +ev(){ # name dep policy extra-env pseed + for P in A B; do F=0; [ $P = B ] && F=1 + sub "POLICY=$3 CAMRES=256 FRESH=$F NINIT=50 PSEED=$5 $4 OUT=$O/F_${1}_s$5_$P.json sbatch --job-name=e${1}$5$P --dependency=afterok:$2 --qos=$Q --partition=$GPUP --requeue --time=10:00:00 $G/eval_slurm.sbatch" "eval $1 seed$5 $P" >/dev/null + done; } +PROP=$RUNS/BCd_f/policy_r1.pt +for s in 0 1 2; do ev BCd $J_BCD $PROP "" $s; done +ev BCroll $J_BCR $RUNS/BCroll_f/policy_r1.pt "" 0 +ev BCrollv $J_BCRV $RUNS/BCrollv_f/policy_r1.pt "" 0 +ev BCsucc $J_BCS $RUNS/BCsucc_f/policy_r1.pt "" 0 +BON="QFILTER=8 QFBETA=0.98 QFDEPTH=1 QFPES=0 QFGATE=0" +for s in 0 1 2; do + ev RSMind_bon8 $J_BCD:$J_QI $PROP "CRITIC=$RUNS/qind_f/ckpt_best.pt $BON SELECT=argmaxq" $s + ev IQL_bon8 $J_BCD:$J_IQL $PROP "QFCKPT=$RUNS/iql_f/iql_q.pt $BON SELECT=argmaxq" $s + ev medoid8 $J_BCD $PROP "$BON SELECT=medoid" $s +done +ev RSMsg_bon8 $J_BCD:$J_QS $PROP "CRITIC=$RUNS/qsg_f/ckpt_best.pt $BON SELECT=argmaxq" 0 +ev random8 $J_BCD $PROP "$BON SELECT=random" 0 +echo "ledger: $LEDGER"; cat $LEDGER diff --git a/gen_q_rsm/rsm_libero/lewm_data.py b/gen_q_rsm/rsm_libero/lewm_data.py new file mode 100644 index 0000000000000000000000000000000000000000..29b2d0aff3cb14782451244266a0903bfaaddab1 --- /dev/null +++ b/gen_q_rsm/rsm_libero/lewm_data.py @@ -0,0 +1,177 @@ +"""Streaming frame windows for LeWM (gen_q#268) -- no image pack, by hard constraint. + +/proj/dmfexp runs at 99% full (5.6 T free of 350 T, and rsm_rise's own runs/ is 5.6 T), so an 84x84 +two-camera image pack of all seven tasks (~29 GB) is not something this lane may write. LeWM needs +pixels -- it is a JEPA that predicts its OWN encoder's embeddings, so feeding it frozen DINO features +would turn it into DINO-WM -- therefore the frames are streamed out of the task's source HDF5 at +training time instead. + +WHY AN EPISODE-RESIDENT BUFFER AND NOT RANDOM READS. A batch of 128 windows of 4 frames x 2 cameras +is 1024 separate 21 kB HDF5 reads; over this filesystem that is seconds per step and 100k steps is +out of reach. Whole episodes are contiguous, so the loader keeps `resident` episodes in RAM (each is +~300 frames x 2 cams x 21 kB = 13 MB, so 96 episodes is ~1.2 GB), draws every window from those, and +retires one episode every `refresh_every` steps. The buffer therefore turns over completely every +`resident * refresh_every` steps -- 768 at the defaults, i.e. ~130 full passes over a 100k-step run. + +ALIGNMENT. Frames come from the HDF5 but ACTIONS and the reward LABEL come from the packed cache, so +LeWM reads the same actions and the same provenance label as every other scorer in the table: + * cache//meta.npz ep_from/ep_to/ep_len/ep_src/ep_success (ep_src = the HDF5 demo key) + * cache//act.f32.npy (stride 1, cache row order) + * the label is ep_success, which is exactly what train_rsm.py --reward-mode dense turns into r=1 + on every frame of an expert episode -- the membership head's label. +The cache was packed from this HDF5 at stride 1 (PACK.json), so cache row ep_from[e]+j is frame j of +demo ep_src[e]; the constructor asserts that for every episode it loads. + +The episode split is the same permutation LiberoRSMData(seed=seed) uses, so LeWM's validation +episodes are the ones every other scorer held out. +""" +from __future__ import annotations + +import json +from collections import OrderedDict +from pathlib import Path + +import numpy as np +import torch + +CAMS = ("agentview_image", "robot0_eye_in_hand_image") + + +class StreamingFrameData: + def __init__(self, cache, hdf5="", chunk: int = 8, ctx: int = 3, n_preds: int = 1, + resident: int = 96, refresh_every: int = 8, val_frac: float = 0.1, + seed: int = 0, cams=CAMS, res: int = 84): + import h5py # imported here: the scorer never needs it + self.h5py = h5py + self.root = Path(cache) + m = np.load(self.root / "meta.npz", allow_pickle=True) + self.ep_from = m["ep_from"].astype(np.int64) + self.ep_to = m["ep_to"].astype(np.int64) + self.ep_len = m["ep_len"].astype(np.int64) + self.ep_success = m["ep_success"].astype(bool) + assert "ep_src" in m.files, f"{cache}/meta.npz has no ep_src: cannot map frames to the HDF5" + self.ep_src = [str(s) for s in m["ep_src"]] + self.adim = int(m["adim"]) + self.n_ep = len(self.ep_len) + self.act = np.ascontiguousarray(np.load(self.root / "act.f32.npy", mmap_mode="r")) + self.chunk, self.ctx, self.n_preds = chunk, ctx, n_preds + self.T = ctx + n_preds + self.cams, self.res = tuple(cams), res + self.d_act = chunk * self.adim + if not hdf5: + hdf5 = json.loads((self.root / "PACK.json").read_text())["src"] + self.hdf5 = str(hdf5) + self.f = h5py.File(self.hdf5, "r") + + rng = np.random.default_rng(seed) + perm = rng.permutation(self.n_ep) + n_val = max(1, int(val_frac * self.n_ep)) + self.val_eps = np.sort(perm[:n_val]) + self.train_eps = np.sort(perm[n_val:]) + # only episodes long enough to hold one window are usable + ok = self.ep_len >= self.T + self.train_eps = np.array([e for e in self.train_eps if ok[e]], np.int64) + self.val_eps = np.array([e for e in self.val_eps if ok[e]], np.int64) + self.resident, self.refresh_every = int(resident), int(refresh_every) + self.buf = {"train": OrderedDict(), "val": OrderedDict()} + self._n_draw = 0 + print(f"[lewm_data] {self.n_ep} eps ({len(self.train_eps)} train / {len(self.val_eps)} val), " + f"label positives {self.ep_success.mean():.4f}, frames from {self.hdf5}", flush=True) + + # ---- episode I/O --------------------------------------------------------------------------- + def _load_ep(self, e): + """[T, 2, res, res, 3] uint8 for one episode, read whole (contiguous in the HDF5).""" + g = self.f["data"][self.ep_src[e]]["obs"] + arrs = [] + for c in self.cams: + a = np.asarray(g[c][:]) + arrs.append(a) + n = int(self.ep_to[e] - self.ep_from[e]) + assert arrs[0].shape[0] == n, (f"episode {self.ep_src[e]}: HDF5 has {arrs[0].shape[0]} frames, " + f"cache has {n} -- the row map would be wrong") + assert arrs[0].shape[1:3] == (self.res, self.res), \ + f"{self.cams[0]} is {arrs[0].shape[1:3]}, expected {(self.res, self.res)}" + return np.stack(arrs, 1) + + def _ensure(self, split, rng): + pool = self.train_eps if split == "train" else self.val_eps + buf = self.buf[split] + want = self.resident if split == "train" else min(self.resident, max(8, len(pool))) + while len(buf) < want: + cand = [int(e) for e in pool if int(e) not in buf] + if not cand: + break + e = int(rng.choice(cand)) + buf[e] = self._load_ep(e) + # retire the oldest and pull one new episode in, so the buffer keeps turning over + if split == "train" and self.refresh_every > 0 and self._n_draw % self.refresh_every == 0 \ + and len(pool) > len(buf): + buf.popitem(last=False) + cand = [int(e) for e in pool if int(e) not in buf] + if cand: + e = int(rng.choice(cand)) + buf[e] = self._load_ep(e) + + # ---- windows ------------------------------------------------------------------------------- + def _chunk_at(self, t, e): + """the flattened `chunk`-step action window at cache row t, padded by repeating the last.""" + hi = int(self.ep_to[e]) + take = min(self.chunk, hi - t) + a = np.asarray(self.act[t:t + take], np.float32) + if take < self.chunk: + a = np.concatenate([a, np.repeat(a[-1:], self.chunk - take, 0)], 0) + return a.reshape(-1) + + def sample(self, batch, rng, split="train", device="cpu"): + """-> frames [B,T,6,res,res] uint8, actions [B,T,d_act], label [B], plus bookkeeping.""" + self._n_draw += 1 + self._ensure(split, rng) + buf = self.buf[split] + eps = np.array(list(buf.keys()), np.int64) + w = (self.ep_len[eps] - self.T + 1).astype(np.float64) + w = np.maximum(w, 1.0) + w /= w.sum() + pick = rng.choice(len(eps), size=batch, p=w) + fr = np.empty((batch, self.T, 2, self.res, self.res, 3), np.uint8) + ac = np.empty((batch, self.T, self.d_act), np.float32) + lab = np.empty(batch, np.float32) + for j, pi in enumerate(pick): + e = int(eps[pi]) + n = int(self.ep_len[e]) + j0 = int(rng.integers(0, max(n - self.T + 1, 1))) + fr[j] = buf[e][j0:j0 + self.T] if n >= self.T else \ + np.concatenate([buf[e], np.repeat(buf[e][-1:], self.T - n, 0)], 0)[:self.T] + base = int(self.ep_from[e]) + j0 + for i in range(self.T): + ac[j, i] = self._chunk_at(min(base + i, int(self.ep_to[e]) - 1), e) + lab[j] = float(self.ep_success[e]) + # [B,T,2,H,W,3] -> [B,T,6,H,W]: the two cameras become channels (declared deviation 1) + f6 = torch.from_numpy(fr).permute(0, 1, 2, 5, 3, 4).reshape(batch, self.T, 6, self.res, self.res) + return {"frames": f6.to(device, non_blocking=True), + "actions": torch.from_numpy(ac).to(device, non_blocking=True), + "label": torch.from_numpy(lab).to(device, non_blocking=True)} + + def close(self): + try: + self.f.close() + except Exception: + pass + + +def frames_from_obs(obs_t, cams=CAMS, res=84): + """The scorer's side of the SAME transform: the planner's obs dict -> [B,6,res,res] uint8. + + The planner hands float CHW images in [0,1] (robomimic ObsUtils.process_frame); LeWM's encoder + expects raw uint8 because it does the /127.5 - 1 itself, so the round trip back to uint8 here is + what makes scoring see the same inputs training did. + """ + out = [] + for c in cams: + x = obs_t[c] + x = torch.as_tensor(x) + if x.ndim == 4 and x.shape[-1] == 3: # NHWC -> NCHW + x = x.permute(0, 3, 1, 2) + if x.dtype.is_floating_point: + x = (x.clamp(0, 1) * 255.0).round().to(torch.uint8) + out.append(x) + return torch.cat(out, 1) diff --git a/gen_q_rsm/rsm_libero/lewm_model.py b/gen_q_rsm/rsm_libero/lewm_model.py new file mode 100644 index 0000000000000000000000000000000000000000..67b705107fcaab82afd76e8047365f186760b45d --- /dev/null +++ b/gen_q_rsm/rsm_libero/lewm_model.py @@ -0,0 +1,237 @@ +"""LeWorldModel (LeWM), ported to torch from the JAX reference for gen_q#268. + +Reference implementation: /proj/dmfexp/zwhong/projs/wt-i97-beta/rsm_vla/lewm.py (flax) and its +`rsm_vla/models.py:Encoder`. This is a line-for-line port of the *method*: JEPA next-embedding +prediction with an AdaLN-zero causal predictor, collapse prevented by SIGReg alone -- NO +stop-gradient and NO EMA target encoder, which is the recipe's defining choice and the easiest thing +to "fix" by accident into a different method. Every constant below is the reference's: + + CTX = 3 history frames the predictor conditions on + N_PREDS = 1 next-step target only + LAMBDA = 0.09 SIGReg weight + LR = 5e-5, WD = 1e-3, global-norm clip 1.0 (AdamW) + LEWM_SIZES (emb_dim, depth, heads, mlp_dim); "m" is the official ~15M config + +WHY A PORT AND NOT THE ORIGINAL. The reference is JAX/flax; rsm_rise's venv has torch only (no +jax), and the reference's shell runners point at a clone that no longer exists on this filesystem. +The port therefore has to be checked rather than trusted: tests/test_lewm_port.py asserts the SIGReg +statistic against an independent numpy implementation and asserts the AdaLN-zero block is the +identity at initialisation (which is what "zero" means and what makes the recipe trainable). + +DECLARED DEVIATIONS from the reference, all forced by the rsm_rise observation and protocol: + 1. INPUT is 84x84 with SIX channels -- the two RISE cameras (agentview, wrist) stacked -- not one + 64x64 RGB frame. The encoder is resolution-general (stride-2 stages until the spatial size is + <= 4), so 84px needs 5 stages where 64px needs 4; nothing else changes. + 2. ACTIONS are the 8-step chunk the RISE actor emits, flattened, not a single step: that is the + candidate the planner ranks, so it is what the world model has to be conditioned on. + 3. The reward probe is a SINGLE-argument probe on the predicted embedding, trained by BCE on the + provenance/membership label, rather than the reference's (z, z_goal) pair probe. gen_q#268 + fixes the reward for every scorer to that label, and a goal-conditioned probe would be reading a + different reward than RSM, TD-Flow and DINO-WM do. +""" +from __future__ import annotations + +import math + +import torch +import torch.nn as nn +import torch.nn.functional as F + +CTX = 3 +N_PREDS = 1 +LAMBDA = 0.09 +LR = 5e-5 +WD = 1e-3 +CLIP = 1.0 +PROBE_LR = 3e-4 +# (emb_dim, depth, heads, mlp_dim) +LEWM_SIZES = {"s": (128, 4, 8, 1024), "m": (192, 6, 16, 2048), "l": (384, 8, 16, 3072)} + + +class Encoder(nn.Module): + """uint8 image -> z_dim latent. Resolution-general: stride-2 stages until spatial <= 4. + + Port note: the reference divides by 127.5 and subtracts 1 INSIDE the encoder, so the caller + hands it raw uint8. Keeping that boundary here means the scorer can feed the planner's frames + through the identical transform the trainer used. + """ + + CHANS = (32, 64, 128, 256, 512, 512, 512) + + def __init__(self, z_dim=192, in_ch=6, res=84): + super().__init__() + layers, c_in, s = [], in_ch, res + i = 0 + while s > 4: + c_out = self.CHANS[min(i, len(self.CHANS) - 1)] + layers += [nn.Conv2d(c_in, c_out, 3, stride=2, padding=1), + nn.GroupNorm(8, c_out), nn.SiLU()] + c_in, s, i = c_out, (s + 1) // 2, i + 1 + self.conv = nn.Sequential(*layers) + self.flat = c_in * s * s + self.fc1 = nn.Linear(self.flat, 512) + self.fc2 = nn.Linear(512, z_dim) + self.n_stages, self.out_res = i, s + + def forward(self, img_u8): + x = img_u8.float() / 127.5 - 1.0 + x = self.conv(x).flatten(1) + return self.fc2(F.silu(self.fc1(x))) + + +class ProjMLP(nn.Module): + """Dense(hidden) -> LayerNorm -> gelu -> Dense(out_dim), as in the reference.""" + + def __init__(self, in_dim, out_dim, hidden=2048): + super().__init__() + self.l1 = nn.Linear(in_dim, hidden) + self.ln = nn.LayerNorm(hidden) + self.l2 = nn.Linear(hidden, out_dim) + + def forward(self, x): + return self.l2(F.gelu(self.ln(self.l1(x)))) + + +class ActionEmbedder(nn.Module): + """Dense(A) -> Dense(4*emb) -> silu -> Dense(emb), applied per time step.""" + + def __init__(self, a_dim, emb_dim, mlp_scale=4): + super().__init__() + self.l0 = nn.Linear(a_dim, a_dim) + self.l1 = nn.Linear(a_dim, mlp_scale * emb_dim) + self.l2 = nn.Linear(mlp_scale * emb_dim, emb_dim) + + def forward(self, a): + return self.l2(F.silu(self.l1(self.l0(a)))) + + +def modulate(x, shift, scale): + return x * (1.0 + scale) + shift + + +class AdaLNBlock(nn.Module): + """One AdaLN-zero transformer block: the conditioning head is zero-initialised, so the block is + the IDENTITY at initialisation and the predictor starts as a pass-through of the embedding. + That is what makes this recipe trainable without a target network, so the zero init is not a + detail -- tests/test_lewm_port.py asserts it.""" + + def __init__(self, dim, heads, mlp_dim, dropout=0.0): + super().__init__() + self.ln1 = nn.LayerNorm(dim, elementwise_affine=False) + self.ln2 = nn.LayerNorm(dim, elementwise_affine=False) + self.heads, self.inner = heads, 64 * heads + self.to_qkv = nn.Linear(dim, 3 * self.inner, bias=False) + self.to_out = nn.Linear(self.inner, dim) + self.mlp = nn.Sequential(nn.Linear(dim, mlp_dim), nn.GELU(), nn.Linear(mlp_dim, dim)) + self.ada = nn.Linear(dim, 6 * dim) + nn.init.zeros_(self.ada.weight) + nn.init.zeros_(self.ada.bias) + self.dropout = dropout + + def forward(self, x, c, mask): + sh1, sc1, g1, sh2, sc2, g2 = self.ada(F.silu(c)).chunk(6, -1) + h = modulate(self.ln1(x), sh1, sc1) + B, T, _ = h.shape + q, k, v = self.to_qkv(h).chunk(3, -1) + q, k, v = (t.view(B, T, self.heads, 64).transpose(1, 2) for t in (q, k, v)) + o = F.scaled_dot_product_attention(q, k, v, attn_mask=mask, + dropout_p=self.dropout if self.training else 0.0) + x = x + g1 * self.to_out(o.transpose(1, 2).reshape(B, T, self.inner)) + return x + g2 * self.mlp(modulate(self.ln2(x), sh2, sc2)) + + +class ARPredictor(nn.Module): + """Causal transformer over the CTX embedding history, conditioned on the action embedding.""" + + def __init__(self, emb_dim, depth, heads, mlp_dim, num_frames=CTX, dropout=0.0): + super().__init__() + self.pos = nn.Parameter(torch.randn(1, num_frames, emb_dim) * 0.02) + self.blocks = nn.ModuleList([AdaLNBlock(emb_dim, heads, mlp_dim, dropout) for _ in range(depth)]) + self.norm = nn.LayerNorm(emb_dim) + mask = torch.tril(torch.ones(num_frames, num_frames, dtype=torch.bool)) + self.register_buffer("mask", mask[None, None], persistent=False) + + def forward(self, emb_ctx, act_ctx): + x = emb_ctx + self.pos[:, : emb_ctx.shape[1]] + m = self.mask[..., : x.shape[1], : x.shape[1]] + for blk in self.blocks: + x = blk(x, act_ctx, m) + return self.norm(x) + + +class LeWM(nn.Module): + """encoder -> projector -> causal predictor -> pred_proj, JEPA-style.""" + + def __init__(self, size="m", a_dim=56, in_ch=6, res=84, ctx=CTX, dropout=0.0): + super().__init__() + emb, depth, heads, mlp = LEWM_SIZES[size] + self.emb_dim, self.ctx, self.a_dim = emb, ctx, a_dim + self.encoder = Encoder(emb, in_ch=in_ch, res=res) + self.projector = ProjMLP(emb, emb) + self.pred_proj = ProjMLP(emb, emb) + self.act_enc = ActionEmbedder(a_dim, emb) + self.predictor = ARPredictor(emb, depth, heads, mlp, num_frames=ctx, dropout=dropout) + + def embed(self, frames_u8): + """frames [B,T,C,H,W] uint8 -> embeddings [B,T,D] (encoder + projector).""" + B, T = frames_u8.shape[:2] + z = self.encoder(frames_u8.reshape(B * T, *frames_u8.shape[2:])) + return self.projector(z).view(B, T, -1) + + def step_emb(self, emb_hist, act_hist): + """[B,ctx,D] history + [B,ctx,A] actions -> the NEXT embedding [B,D].""" + h = self.predictor(emb_hist, self.act_enc(act_hist)) + return self.pred_proj(h)[:, -1] + + def forward(self, frames_u8, actions): + """frames [B,ctx+N_PREDS,C,H,W] uint8, actions [B,ctx+N_PREDS,A] + -> (pred [B,ctx,D], emb [B,ctx+N_PREDS,D]). `emb` is NOT detached anywhere: the target of + the prediction loss is the live encoder's own output, which is the recipe.""" + emb = self.embed(frames_u8) + act = self.act_enc(actions) + h = self.predictor(emb[:, : self.ctx], act[:, : self.ctx]) + return self.pred_proj(h), emb + + +def sigreg_stat(emb_tbd, generator=None, knots=17, num_proj=1024, A=None): + """Epps-Pulley SIGReg statistic, ported verbatim from the reference. + + emb_tbd: [T, B, D]. Projects onto `num_proj` random unit directions and compares the empirical + characteristic function of each projection against a standard normal's on a trapezoid grid over + t in [0, 3]. Scaled by B and averaged over time slices, exactly as the reference does. + This term is the ONLY thing preventing representation collapse in LeWM -- there is no target + network -- so its weight (LAMBDA = 0.09) and its scaling are load-bearing. + """ + dev, dt_ = emb_tbd.device, emb_tbd.dtype + T, B, D = emb_tbd.shape + t = torch.linspace(0.0, 3.0, knots, device=dev, dtype=dt_) + dt = 3.0 / (knots - 1) + w = torch.full((knots,), 2 * dt, device=dev, dtype=dt_) + w[0] = dt + w[-1] = dt + phi = torch.exp(-t ** 2 / 2.0) + weights = w * phi + # `A` is injectable ONLY so test_lewm_port.py can check the statistic against an independent + # implementation on the same projections; training always draws it fresh, as the reference does. + if A is None: + A = torch.randn(D, num_proj, device=dev, dtype=dt_, generator=generator) + A = A / A.norm(dim=0, keepdim=True) + x_t = (emb_tbd @ A).unsqueeze(-1) * t # [T,B,P,K] + err = (x_t.cos().mean(-3) - phi) ** 2 + x_t.sin().mean(-3) ** 2 # [T,P,K] + return ((err @ weights) * B).mean() + + +class RewardProbe(nn.Module): + """p(membership | z): logit MLP on one embedding (see the deviation note in the module docstring).""" + + def __init__(self, emb_dim, hidden=512): + super().__init__() + self.net = nn.Sequential(nn.Linear(emb_dim, hidden), nn.SiLU(), + nn.Linear(hidden, hidden), nn.SiLU(), nn.Linear(hidden, 1)) + + def forward(self, z): + return self.net(z).squeeze(-1) + + +def make_optimizer(model, lr=LR, wd=WD): + return torch.optim.AdamW(model.parameters(), lr=lr, weight_decay=wd) diff --git a/gen_q_rsm/rsm_libero/lewm_readout.py b/gen_q_rsm/rsm_libero/lewm_readout.py new file mode 100644 index 0000000000000000000000000000000000000000..07cca86116d7b395c257ae0eb3a1cbdf42a2e18c --- /dev/null +++ b/gen_q_rsm/rsm_libero/lewm_readout.py @@ -0,0 +1,163 @@ +"""LeWM read-out: best-of-N scoring of RISE-actor action chunks with a LeWM world model (gen_q#268). + +Q(s, A) for a candidate chunk A at the current frame s: + + z_0 = projector(encoder(s)) one frame, repeated to fill the ctx history + z_k+1 = pred_proj(predictor(hist_k, act_k)) one LeWM step under the chunk + c_k = sigmoid(probe(z_k)) the membership reward probe + Q = c_1 (mode "d1", L = 1) + = c_1 + (1-c_1) g^h (c_2 + (1-c_2) g^h (...)) (mode "fold", L hops, h = chunk frames) + +The fold is the SAME reach-or-continue algebra RSM, DWM and DINO-WM use, so the L>1 columns differ +in the model and not in the read-out arithmetic. + +TWO DEVIATIONS, BOTH FORCED AND BOTH DECLARED + 1. HISTORY. LeWM conditions on 3 frames; the planner hands a scorer the SINGLE current frame + (rsm_planner.plan_get_action: `obs_t = {k: v[:, -1] ...}`). The history is therefore filled by + repeating that frame. Changing the planner to keep a frame stack would change what EVERY other + scorer sees, so this is the only choice that keeps the comparison matched. + 2. HOPS BEYOND THE FIRST use the SAME candidate chunk again, not the hop head that RSM/DINO-WM + chain with. This is not a shortcut: LeWM predicts in ITS OWN embedding space, so a rolled state + has no pooled DINO vector and the hop head -- which is a policy over DINO states -- cannot be + queried there. gen_q#268's own wording for this scorer is "rolling the predictor L steps under + the candidate chunk", which is what this does. DINO-WM, whose latent IS the DINO token space, + keeps the hop-head chaining. + +PROPRIO is not an input to LeWM (the reference is pixels + actions), so the `pr` half of the +scorer's input tuple is accepted and ignored rather than being silently concatenated somewhere. +""" +from __future__ import annotations + +import json +from pathlib import Path + +import torch + +from lewm_model import LeWM, RewardProbe + + +class LeWMCritic: + """The interface robomimic's RSMScorer expects of a backend core (see rsm_scorer.DWMBackend).""" + + def __init__(self, ck, device): + a = ck["arch"] + self.device = torch.device(device) + self.arch = dict(a) + self.chunk = int(a["chunk"]) + self.adim = int(a["adim"]) + self.d_act = int(ck["d_act"]) + self.res = int(a["res"]) + self.ctx = int(a["ctx"]) + self.in_ch = int(a["in_ch"]) + self.model = LeWM(size=a["size"], a_dim=self.d_act, in_ch=self.in_ch, res=self.res, + ctx=self.ctx).to(self.device) + self.probe = RewardProbe(int(a["emb_dim"])).to(self.device) + self.model.load_state_dict(ck["lewm"]) + self.probe.load_state_dict(ck["probe"]) + for m in (self.model, self.probe): + m.eval() + for p in m.parameters(): + p.requires_grad_(False) + self.config = dict(ck.get("config", {})) + self.step = int(ck.get("step", -1)) + self.q_action_winrate = ck.get("q_action_winrate", float("nan")) + self.temperature = 1.0 + self.calib = None + self.hop_frames = float(self.chunk) + self.cams = tuple(ck.get("cams", ("agentview_image", "robot0_eye_in_hand_image"))) + self.autocast = (lambda: torch.autocast("cuda", dtype=torch.bfloat16)) \ + if self.device.type == "cuda" else (lambda: torch.autocast("cpu", enabled=False)) + + # ------------------------------------------------------------------------------------------ + def _prep(self, inp, a_chunk): + img = inp[0] if isinstance(inp, (tuple, list)) else inp + x = torch.as_tensor(img).to(self.device) + if x.dtype.is_floating_point: # the planner's frames are float in [0,1] + x = (x.clamp(0, 1) * 255.0).round().to(torch.uint8) + assert x.ndim == 4 and x.shape[1] == self.in_ch, \ + f"LeWM expects [B,{self.in_ch},{self.res},{self.res}] frames, got {tuple(x.shape)}" + aa = torch.as_tensor(a_chunk).to(self.device).float().view(x.shape[0], -1) + assert aa.shape[1] == self.d_act, f"a_chunk must be [B,{self.d_act}], got {tuple(aa.shape)}" + return x, aa + + @torch.no_grad() + def q(self, inp, a_chunk, beta=None, n_particles=1, crn_seed=None, depth=1, mode="d1", + proprio=None, hop_policy=None, gamma=0.99, flow_steps=8, micro=256, return_hops=False, + return_logit=False, temperature=None, return_lcb=None, rescore_top=0, + n_particles_rescore=0): + """Q per row. Deterministic, so n_particles / crn_seed / flow_steps are accepted (the shared + planner passes them to every backend) and ignored; `beta` is likewise inert -- LeWM has no + discount, and the fold's per-hop discount uses hop_frames = the action chunk.""" + if mode == "d1": + depth = 1 + elif mode != "fold": + raise ValueError(f"mode {mode!r}: use 'd1' or 'fold'") + if return_lcb is not None: + raise ValueError("plan_score=conformal_lcb needs a particle distribution; LeWM's " + "roll-out is deterministic, so there is none to take a quantile of") + x, aa = self._prep(inp, a_chunk) + T = float(self.temperature if temperature is None else temperature) + logits, cs = [], [] + m = max(int(micro), 1) + for i in range(0, x.shape[0], m): + xi, ai = x[i:i + m], aa[i:i + m] + with self.autocast(): + z0 = self.model.embed(xi.unsqueeze(1))[:, 0] # one frame -> [b, D] + hist = z0.unsqueeze(1).repeat(1, self.ctx, 1) # deviation 1: repeat it + acts = ai.unsqueeze(1).repeat(1, self.ctx, 1) # deviation 2: same chunk + lg_i, cs_i = [], [] + for _ in range(int(depth)): + with self.autocast(): + z = self.model.step_emb(hist, acts) + lg = self.probe(z).float() + lg_i.append(lg) + cs_i.append(torch.sigmoid(lg / T)) + hist = torch.cat([hist[:, 1:], z.unsqueeze(1).float()], 1) + logits.append(torch.stack(lg_i, 0)) + cs.append(torch.stack(cs_i, 0)) + lg_all = torch.cat(logits, 1) # [depth, B] + cs_all = torch.cat(cs, 1) + if mode == "d1": + q = cs_all[0] + else: + h = self.hop_frames + q = torch.zeros_like(cs_all[-1]) + for k in range(int(depth) - 1, -1, -1): + c = cs_all[k] + q = c + (1.0 - c) * (gamma ** h) * q + q = torch.nan_to_num(q, nan=0.0).clamp(0.0, 1.0) + q_logit = torch.nan_to_num(lg_all[-1], nan=0.0) + out = (q, q_logit) if return_logit else q + if return_hops: + return out, [c for c in cs_all] + return out + + def hop_sample(self, x, eps): + raise RuntimeError("LeWM has no hop head: its latent is its own, so a policy over DINO " + "states cannot be queried at a rolled state (see the module docstring)") + + def describe(self): + return {"backend": "lewm", "size": self.arch.get("size"), "emb_dim": self.arch.get("emb_dim"), + "ctx": self.ctx, "chunk": self.chunk, "hop_frames": self.hop_frames, + "step": self.step, "q_action_winrate": self.q_action_winrate, + "deterministic": True} + + +def load_critic_lewm(path, device="cuda", calib="auto") -> LeWMCritic: + ck = torch.load(str(path), map_location="cpu", weights_only=False) + m = str(ck.get("model", "?")) + if m != "lewm": + raise RuntimeError(f"{path} is a {m!r} checkpoint, not a LeWM one (train_lewm.py writes " + f"model='lewm')") + crit = LeWMCritic(ck, device) + if isinstance(calib, (int, float)) and not isinstance(calib, bool): + crit.temperature = float(calib) + elif calib == "auto": + cj = Path(path).parent / "calib.json" + if cj.exists(): + try: + crit.calib = json.loads(cj.read_text()) + crit.temperature = float(crit.calib["T"]) + except Exception as e: + print(f"[lewm_readout] calib.json unreadable ({e}); T=1", flush=True) + return crit diff --git a/gen_q_rsm/rsm_libero/make_video_report.py b/gen_q_rsm/rsm_libero/make_video_report.py new file mode 100644 index 0000000000000000000000000000000000000000..8187fc90470f1eac3969e78708de4de06c32f299 --- /dev/null +++ b/gen_q_rsm/rsm_libero/make_video_report.py @@ -0,0 +1,94 @@ +"""Turn the eval matrix (video frames + per-episode outcomes) into a report: +mp4 per episode, one collage per cell (10 tasks x first/mid/last frame, outcome-coded), +and an HTML index with the SR table and links. Cells are named by the eval job: + __, e.g. r256_demo = BC_rollsucc @256 from exact demo inits.""" +import argparse, json, glob, os +from pathlib import Path +import numpy as np + + +def mp4(frames, path, fps=15): + import imageio + w = imageio.get_writer(path, fps=fps, codec="libx264", quality=7, macro_block_size=1) + for f in frames: w.append_data(f) + w.close() + + +def collage(cell_dir, out_png, title): + from PIL import Image, ImageDraw + files = sorted(glob.glob(f"{cell_dir}/t*_e*.npz"), + key=lambda p: (int(Path(p).stem.split("_")[0][1:]), int(Path(p).stem.split("_")[1][1:]))) + by_task = {} + for f in files: + z = np.load(f, allow_pickle=True); by_task.setdefault(int(z["task"]), []).append((f, z)) + tasks = sorted(by_task); n_ep = max(len(v) for v in by_task.values()) if by_task else 0 + S = 96; cols = 3 * n_ep; rows = len(tasks) + im = Image.new("RGB", (cols * S + 60, rows * S + 24), (245, 245, 245)); dr = ImageDraw.Draw(im) + dr.text((4, 4), title, fill=(0, 0, 0)) + for r, t in enumerate(tasks): + dr.text((4, 24 + r * S + S // 2 - 6), f"t{t}", fill=(0, 0, 0)) + for e, (f, z) in enumerate(by_task[t]): + fr = z["frames"]; ok = bool(z["success"]); n = len(fr) + for j, k in enumerate((0, n // 2, n - 1)): + tile = Image.fromarray(fr[k]).resize((S, S)) + x, y = 60 + (e * 3 + j) * S, 24 + r * S + im.paste(tile, (x, y)) + dr.rectangle([x, y, x + S - 1, y + S - 1], outline=(0, 170, 0) if ok else (200, 0, 0), width=3) + dr.text((60 + e * 3 * S + 2, 24 + r * S + 2), "OK" if ok else f"fail {int(z['steps'])}", + fill=(0, 120, 0) if ok else (180, 0, 0)) + im.save(out_png) + return len(files), sum(bool(np.load(f, allow_pickle=True)["success"]) for f in files) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--video-root", default="/data/pulkitag/users/rli14/rsm_libero_runs/video") + ap.add_argument("--eval-root", default="/data/pulkitag/users/rli14/rsm_libero_runs/eval") + ap.add_argument("--cells", default="r256_lib,r256_demo,r256_roll,r128_demo,d128_lib,d256_lib") + ap.add_argument("--out", required=True) + args = ap.parse_args() + out = Path(args.out); (out / "mp4").mkdir(parents=True, exist_ok=True) + legend = {"r256_lib": "BC_rollsucc @256, LIBERO stock inits (protocol A)", + "r256_demo": "BC_rollsucc @256, EXACT demo initial states (hdf5 states[0])", + "r256_roll": "BC_rollsucc @256, EXACT rollout initial states (its own training inits)", + "r128_demo": "BC_rollsucc @128 (old evaluator), EXACT demo initial states", + "d128_lib": "BC-on-demos @128 (old evaluator, the 0.584 bar), LIBERO inits", + "d256_lib": "BC-on-demos @256 (new evaluator), LIBERO inits"} + rows = [] + for c in args.cells.split(","): + cd = f"{args.video_root}/{c}" + if not glob.glob(f"{cd}/t*_e*.npz"): + rows.append((c, legend.get(c, c), None, None, None, None)); continue + n, k = collage(cd, out / f"{c}.png", legend.get(c, c)) + links = [] + for f in sorted(glob.glob(f"{cd}/t*_e*.npz")): + z = np.load(f, allow_pickle=True); name = f"{c}_{Path(f).stem}_{'ok' if z['success'] else 'fail'}.mp4" + p = out / "mp4" / name + if not p.exists(): mp4(z["frames"], str(p)) + links.append((name, bool(z["success"]), int(z["task"]))) + js = f"{args.eval_root}/{c}.json" + sr = json.load(open(js)).get("overall", {}) if os.path.exists(js) else {} + rows.append((c, legend.get(c, c), n, k, sr, links)) + html = ["BC on rollout successes: evaluator at 256", + "", + "

BC on rollout successes — does the existing policy work once the evaluator renders at 256?

", + "

Same checkpoints as before; the only change is the evaluator's camera resolution and where the initial state comes from. Green border = success, red = failure (with step count). Videos are the agentview camera, every 2nd step.

", + ""] + for c, what, n, k, sr, links in rows: + if n is None: + html.append(f""); continue + html.append(f"") + html.append("
cellwhatsuccessfrom json
{c}{what}not run yet
{c}{what}{k}/{n} = {k/n:.3f}{sr}
") + for c, what, n, k, sr, links in rows: + if n is None: continue + html.append(f"

{c} — {what}

{k}/{n} succeeded

") + html.append("

" + " · ".join(f"t{t}{'✓' if ok else '✗'}" for nm, ok, t in links) + "

") + html.append("") + (out / "index.html").write_text("\n".join(html)) + print(f"[report] {out}/index.html") + for c, what, n, k, sr, links in rows: + print(f" {c:<10} {('%d/%d' % (k, n)) if n else 'pending':>8} {what}") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/mc_critic.py b/gen_q_rsm/rsm_libero/mc_critic.py new file mode 100644 index 0000000000000000000000000000000000000000..79215fc2a67ef2ef4bb37fbbc7f19192d7d8d5b1 --- /dev/null +++ b/gen_q_rsm/rsm_libero/mc_critic.py @@ -0,0 +1,72 @@ +"""Scalar Monte-Carlo critic on the frozen RSM latent: Q(z, a_chunk, task) regressed on the +LOGGED discounted return of the offline corpus -- no occupancy, no bootstrap. The matched +scalar comparator for the RSM read-out (same latent, same inputs, same held-out set). + G_sub = (1-g) sum_k g^k r_{t+k} (dense subgoal-fraction reward) -> head 'sub' + G_succ = g^(steps to success) or 0 -> head 'succ' +Saved in the evaluator's --qf-ckpt format (iql_q=True) so it plugs into every selection +arm unchanged; `q` = the G_sub head unless --target succ. +usage: mc_critic.py --cache C --critic ckpt --subgoal-dir D --mask M --out DIR [--steps 60000]""" +import argparse, os, sys, json, numpy as np, torch, torch.nn.functional as F +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from data import LiberoRSMData +from is_ope import load_critic +from iql import QNet +from scipy.stats import spearmanr + +ap = argparse.ArgumentParser() +ap.add_argument("--cache", required=True); ap.add_argument("--critic", required=True) +ap.add_argument("--subgoal-dir", default=""); ap.add_argument("--mask", default="") +ap.add_argument("--out", required=True); ap.add_argument("--steps", type=int, default=60000) +ap.add_argument("--batch", type=int, default=1024); ap.add_argument("--lr", type=float, default=3e-4) +ap.add_argument("--gamma", type=float, default=0.99); ap.add_argument("--target", default="sub", choices=["sub", "succ"]) +ap.add_argument("--width", type=int, default=1024); ap.add_argument("--depth", type=int, default=3) +ap.add_argument("--seed", type=int, default=0) +a = ap.parse_args() +torch.manual_seed(a.seed); dev = "cuda" if torch.cuda.is_available() else "cpu" +d = LiberoRSMData(a.cache, chunk=10, seed=a.seed, in_ram=True, reward_mode="subgoal", subgoal_dir=a.subgoal_dir, + success_mask=a.mask, norm_pool="demos") +enc, rew, flow, rms, cfg = load_critic(a.critic, d.feat_dim, d.n_task, dev, data=d) +g = a.gamma +# ---- precompute per-frame returns once (both targets), vectorised per episode +G_sub = np.zeros(len(d.r), np.float32); G_succ = np.zeros(len(d.r), np.float32) +for e in range(d.n_ep): + lo, hi = int(d.ep_from[e]), int(d.ep_to[e]); rr = np.asarray(d.r[lo:hi], np.float64) + acc = 0.0 + for i in range(hi - lo - 1, -1, -1): + acc = rr[i] + g * acc; G_sub[lo + i] = (1 - g) * acc + if bool(d.ep_success[e]): + G_succ[lo:hi] = g ** np.arange(hi - lo, 0, -1) +print(f"[mc] returns: mean G_sub={G_sub.mean():.3f} G_succ={G_succ.mean():.3f}", flush=True) +q = QNet(cfg["d_z"], 70, d.n_task, width=a.width, depth=a.depth).to(dev) +opt = torch.optim.AdamW(q.parameters(), lr=a.lr, weight_decay=1e-4) +rng = np.random.default_rng(a.seed) +def batch(split, n): + eps = d.train_eps if split == "train" else d.val_eps + w = d.ep_len[eps].astype(np.float64); w /= w.sum(); e = rng.choice(eps, size=n, p=w) + t = d.ep_from[e] + (rng.random(n) * np.maximum(d.ep_to[e] - d.ep_from[e] - 10, 1)).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(dev); tk = torch.from_numpy(d.ep_task[e]).long().to(dev) + act = torch.from_numpy(d._chunk_at(t, e)).to(dev).view(n, -1) + tgt = torch.from_numpy((G_sub if a.target == "sub" else G_succ)[t]).to(dev) + return x, tk, act, tgt, t +os.makedirs(a.out, exist_ok=True); best = -1 +for step in range(1, a.steps + 1): + x, tk, act, tgt, _ = batch("train", a.batch) + with torch.no_grad(): z = enc(x) + pred = q(z, act, tk).squeeze(-1) + loss = F.mse_loss(pred, tgt); opt.zero_grad(); loss.backward(); opt.step() + if step % 5000 == 0 or step == a.steps: + q.eval() + with torch.no_grad(): + x, tk, act, tgt, t = batch("val", 6000); z = enc(x); pv = q(z, act, tk).squeeze(-1).cpu().numpy() + tkn = tk.cpu().numpy(); gs, gc = G_sub[t], G_succ[t] + wt = np.nanmean([spearmanr(pv[tkn == tt], gs[tkn == tt]).correlation for tt in range(d.n_task) if (tkn == tt).sum() > 30]) + sp = spearmanr(pv, gs).correlation; sc = spearmanr(pv, gc).correlation + print(f"[mc] {step} train_mse={float(loss):.4f} | VAL spearman G_sub {sp:+.3f} within-task {wt:+.3f} | G_succ {sc:+.3f}", flush=True) + blob = {"iql_q": True, "q": q.state_dict(), "d_z": cfg["d_z"], "d_act": 70, "n_task": d.n_task, "critic": a.critic, + "config": {"target": a.target, "gamma": g, "width": a.width, "depth": a.depth, "steps": step}, + "cam_res": getattr(d, "cam_res", "UNKNOWN"), "encoder": getattr(d, "encoder", "pi05_base_pytorch"), + "val_spearman_within": float(wt), "val_spearman": float(sp)} + torch.save(blob, os.path.join(a.out, f"mc_q_s{step}.pt")); torch.save(blob, os.path.join(a.out, "mc_q.pt")) + if wt > best: best = wt; torch.save(blob, os.path.join(a.out, "mc_q_best.pt")) + q.train() +print("[mc] DONE", flush=True) diff --git a/gen_q_rsm/rsm_libero/merge_and_train.sbatch b/gen_q_rsm/rsm_libero/merge_and_train.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..88c8c9a88bc1dc059d7c5870f99d567d1ed84ca2 --- /dev/null +++ b/gen_q_rsm/rsm_libero/merge_and_train.sbatch @@ -0,0 +1,13 @@ +#!/bin/bash +#SBATCH --job-name=merge_verify +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=2 --mem=16G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +PY=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python +$PY $G/merge_verify.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --shards /data/pulkitag/users/rli14/rsm_libero_runs/verify \ + --out /data/pulkitag/users/rli14/rsm_libero_runs/verify/verified_mask.npz diff --git a/gen_q_rsm/rsm_libero/merge_full.sbatch b/gen_q_rsm/rsm_libero/merge_full.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..4149931e4c9e22e27f583db6c5d2ebcfdb202f23 --- /dev/null +++ b/gen_q_rsm/rsm_libero/merge_full.sbatch @@ -0,0 +1,15 @@ +#!/bin/bash +#SBATCH --job-name=merge_full +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +#SBATCH --cpus-per-task=2 --mem=16G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python $G/merge_verify.py \ + --cache /data/pulkitag/scratch/rli14/rsm_libero_cache/full_r256 \ + --shards /data/pulkitag/users/rli14/rsm_libero_runs/verify_full \ + --out /data/pulkitag/users/rli14/rsm_libero_runs/verify_full/verified_mask.npz +echo "[merge] rc=$?" diff --git a/gen_q_rsm/rsm_libero/merge_verify.py b/gen_q_rsm/rsm_libero/merge_verify.py new file mode 100644 index 0000000000000000000000000000000000000000..99447b748fddf5a1c3ed10c1fd01f5218b806cac --- /dev/null +++ b/gen_q_rsm/rsm_libero/merge_verify.py @@ -0,0 +1,60 @@ +"""Merge the per-task replay-verification shards into one success mask. + +Output: keep[i] over cache episode indices. An episode stays in the success pool only +if it is a demo (ground truth, never replayed), or a rollout whose logged success +REPRODUCED when its actions were re-executed from the logged sim_state. Episodes that +could not be resolved (source parquet missing) are dropped from the success pool rather +than trusted -- the whole point is that an unverified success is not a success. +""" +import argparse, glob, numpy as np + +ap = argparse.ArgumentParser() +ap.add_argument("--cache", required=True) +ap.add_argument("--shards", required=True, help="REPLAY shards (reproducibility)") +ap.add_argument("--goal-shards", default="", + help="GOAL-AUDIT shards (goal predicate at the logged final state). " + "DIAGNOSTIC ONLY -- do NOT filter on this. It answers 'was the label " + "honest about the state the episode reached', which is not the " + "admissibility question. Admissibility is REPRODUCIBILITY in the eval " + "environment; see --shards.") +ap.add_argument("--out", required=True) +ap.add_argument("--keep-unresolvable", type=int, default=0) +a = ap.parse_args() + +m = np.load(f"{a.cache}/meta.npz", allow_pickle=True) +demo, succ = m["ep_demo"].astype(bool), m["ep_success"].astype(bool) +keep = demo.copy() # demos always kept +seen = np.zeros(len(demo), bool) +rep = unres = 0 +# ADMISSIBILITY RULE: a trajectory may train an offline learner only if its reward +# labels REPRODUCE in the environment we evaluate in. A label that was honest about the +# state its own run reached is still inadmissible if replaying those actions here does +# not get there -- those (s,a,r) tuples describe different dynamics than the ones the +# policy will be scored against, which is exactly what breaks offline RL. +src, mode = a.shards, "REPLAY in the eval environment (admissibility)" +if a.goal_shards: + print("[merge] NOTE: goal-audit shards given but NOT used as the filter; " + "they are diagnostic. Filtering on reproducibility.") +print(f"[merge] filtering on: {mode}") +for f in sorted(glob.glob(f"{src}/task*.npz")): + z = np.load(f, allow_pickle=True) + if a.goal_shards: + r = z["rows"]; idx, ver = r[:, 0], r[:, 1] + else: + idx, ver = z["ep_index"], z["verified"] + for e, v in zip(idx, ver): + seen[e] = True + if v == 1: keep[e] = True; rep += 1 + elif v < 0: + unres += 1 + if a.keep_unresolvable: keep[e] = True +n_succ = int((succ & ~demo).sum()) +missing = int((succ & ~demo & ~seen).sum()) +np.savez(a.out, keep=keep, n_checked=int(seen.sum()), n_reproduced=rep) +print(f"[merge] rollout successes in cache : {n_succ}") +print(f"[merge] checked : {int(seen.sum())} (missing shards: {missing})") +print(f"[merge] reproduced : {rep} ({rep/max(seen.sum(),1):.1%})") +print(f"[merge] unresolvable : {unres} " + f"({'kept' if a.keep_unresolvable else 'DROPPED'})") +print(f"[merge] success pool: {int((succ).sum())} -> {int(keep.sum())} episodes") +print(f"[merge] wrote {a.out}") diff --git a/gen_q_rsm/rsm_libero/mislabel_report.py b/gen_q_rsm/rsm_libero/mislabel_report.py new file mode 100644 index 0000000000000000000000000000000000000000..f27a0ca4e7bfa2b8c0ab16399f9ceefb8c4070a7 --- /dev/null +++ b/gen_q_rsm/rsm_libero/mislabel_report.py @@ -0,0 +1,41 @@ +"""Per-task mislabelling breakdown: episodes AND reward-frames affected. + +An episode's success bit is one label, but the reward is per-frame and derived from +it, so a single mislabelled episode corrupts every frame it occupies. Both counts are +reported because they answer different questions: how much of the success POOL is +fake (episodes), and how much of the reward SIGNAL is wrong (frames).""" +import glob, sys, numpy as np +V = sys.argv[1] if len(sys.argv) > 1 else "/data/pulkitag/users/rli14/rsm_libero_runs/verify" +C = "/data/pulkitag/users/rli14/rsm_libero_cache/full_demo" +m = np.load(f"{C}/meta.npz", allow_pickle=True) +elen = (m["ep_to"] - m["ep_from"]).astype(int) +tn = [str(t) for t in m["tasks"]] +d, s = m["ep_demo"].astype(bool), m["ep_success"].astype(bool) +rows, TE, TB, TF, TFB = [], 0, 0, 0, 0 +for f in sorted(glob.glob(f"{V}/task*.npz")): + z = np.load(f); t = int(z["task"]) + idx, ver = z["ep_index"], z["verified"] + ok = ver >= 0; idx, ver = idx[ok], ver[ok] + if len(idx) == 0: + rows.append((t, 0, 0, 0, 0)); continue + bad = idx[ver == 0] + nf, nfb = int(elen[idx].sum()), int(elen[bad].sum()) + rows.append((t, len(idx), len(bad), nf, nfb)) + TE += len(idx); TB += len(bad); TF += nf; TFB += nfb +print(f"{'task':4s} {'name':36s} {'checked':>8s} {'MISLAB':>7s} {'rate':>6s} " + f"{'frames':>9s} {'bad frames':>11s} {'%':>6s}") +for t, n, b, nf, nfb in sorted(rows): + if n == 0: + print(f" {t:<3d} {tn[t][:36]:36s} {'--':>8s} {'--':>7s} {'--':>6s}" + f" {'--':>9s} {'--':>11s} {'--':>6s} (no logged successes)") + continue + print(f" {t:<3d} {tn[t][:36]:36s} {n:8d} {b:7d} {b/n:6.1%} " + f"{nf:9,d} {nfb:11,d} {nfb/nf:6.1%}") +nd = sum(1 for r in rows if r[1] > 0) +print(f"\n TOTAL over {nd} tasks with successes: {TE} checked, " + f"{TB} mislabelled ({TB/max(TE,1):.1%})") +print(f" reward frames: {TF:,} in verified episodes, {TFB:,} carry a wrong label " + f"({TFB/max(TF,1):.1%})") +npool = int((s & ~d).sum()) +print(f" rollout successes in cache: {npool}; checked {TE} ({TE/npool:.0%})" + f" -> projected ~{round(npool*TB/max(TE,1))} mislabelled at the pooled rate") diff --git a/gen_q_rsm/rsm_libero/model.py b/gen_q_rsm/rsm_libero/model.py new file mode 100644 index 0000000000000000000000000000000000000000..9c006359c647f7ddc3b9f8700f8f0dc276fdcd34 --- /dev/null +++ b/gen_q_rsm/rsm_libero/model.py @@ -0,0 +1,525 @@ +"""Nets for RSM on the LIBERO-10 pi0.5 rollout corpus. + +Design follows the unified-RSM recipe on gen_q `main` (ogbench_unified_rsm/RECIPE.md, +notes/COLLAPSE_ANALYSIS.md), adapted from goal-ball OGBench to sparse-success LIBERO: + + * beta BAND training, not a single discount (RECIPE "train beta [0.8,0.98]") + * Fourier features on log(-log beta) (RECIPE "fourier_unit, n_fourier=6") + * residual successor z' = z + delta, with delta divided by the per-dimension + dataset RMS of (z_fut - z_now) (RECIPE v6.1 "horizon-normalize + then per-dimension divide by rms((s'-s)_i)") + * EMA target encoder supplies the future target, stop-grad, plus a per-coordinate + variance floor (RECIPE "variance floor keeps the + embedding from collapsing"; smolvla_rsm METHOD.md) + * action chunk conditions the occupancy on an equal footing with the task + embedding, via concat + FiLM (RECIPE v6 "condition on g and a equally") + +What is deliberately NOT ported: the goal-ball arrival likelihood (`q_readout=lik`, +`p = exp(-d^2/2 tol^2)` on privileged xy/xyz). LIBERO has no privileged success ball +in this latent, so the read-out is a learned reward decoder over the same latent, as +the image branch of CLAUDE.md requires. + +COLLAPSE_ANALYSIS lesson carried over: a value that scores STATES but cannot rank +ACTIONS produces flat batch metrics and a closed-loop cliff. The occupancy here is +action-conditioned for exactly that reason, and action ranking is the headline +diagnostic rather than state ranking. +""" +from __future__ import annotations +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F + + +def beta_fourier(beta: torch.Tensor, n: int = 6) -> torch.Tensor: + """Fourier features on the log-horizon of a discount in (0,1).""" + x = torch.log(-torch.log(beta.clamp(1e-6, 1 - 1e-6))) + fr = torch.arange(1, n + 1, device=beta.device, dtype=beta.dtype) + a = x[:, None] * fr[None] + return torch.cat([a.sin(), a.cos(), x[:, None]], -1) # 2n+1 + + +def time_embed(t: torch.Tensor, dim: int = 64) -> torch.Tensor: + half = dim // 2 + fr = torch.exp(-np.log(10000.0) * torch.arange(half, device=t.device, + dtype=t.dtype) / half) + a = t[:, None] * fr[None] * 1000.0 + return torch.cat([a.sin(), a.cos()], -1) + + +def mlp(sizes, act=nn.SiLU, out_act=False, norm=False): + layers = [] + for i in range(len(sizes) - 1): + layers.append(nn.Linear(sizes[i], sizes[i + 1])) + if i < len(sizes) - 2 or out_act: + if norm: + layers.append(nn.LayerNorm(sizes[i + 1])) + layers.append(act()) + return nn.Sequential(*layers) + + + +class TaskCond(nn.Module): + """Task conditioning: a frozen T5 sentence embedding, projected. + + The alternative -- nn.Embedding(n_task, d_task) -- conditions on an INDEX. It carries + nothing about what the task is, cannot transfer to a held-out instruction, and gives + the network a shortcut that removes any pressure on the visual latent to represent + the instruction. Passing t5_path swaps in the frozen sentence embedding; omitting it + keeps the index embedding so old checkpoints still load. + """ + + def __init__(self, n_task: int, d_task: int = 64, t5_path: str = ""): + super().__init__() + self.t5 = bool(t5_path) + if self.t5: + import numpy as _np + emb = _np.load(t5_path)["emb"].astype("float32") + emb = emb / (_np.linalg.norm(emb, axis=1, keepdims=True) + 1e-6) + self.register_buffer("E", torch.tensor(emb), persistent=True) + self.proj = nn.Linear(emb.shape[1], d_task) + else: + # hold the table as `weight` and look it up with F.embedding, so the + # state_dict key stays `.task.weight` -- exactly what + # nn.Embedding produced. Wrapping it as a submodule would rename the + # key and break every checkpoint written before this change. + self.weight = nn.Parameter(torch.randn(n_task, d_task) * 0.02) + + def forward(self, task): + if self.t5: + return self.proj(self.E[task]) + return F.embedding(task, self.weight) + + +class Encoder(nn.Module): + """OGPO 4096-d -> compact reward-predictive latent.""" + + def __init__(self, d_in: int, d_z: int = 256, width: int = 1024, depth: int = 3): + super().__init__() + self.net = mlp([d_in] + [width] * depth + [d_z], norm=True) + self.d_z = d_z + + def forward(self, x): + return self.net(x) + + +class IdentityEncoder(nn.Module): + """`--enc identity`: the (z-scored) input feature IS the latent. No parameters, so the + EMA target, the variance floor and the reward warm-up are all no-ops. Used when the + feature is a frozen foundation-model embedding modelled directly (rsm_rise: DINOv2 + CLS|GeM per camera + proprio, 1545-d), as the OCBench visual recipe did.""" + + def __init__(self, d_in: int): + super().__init__() + self.d_z = int(d_in) + + def forward(self, x): + return x + + +class PCAEncoder(nn.Module): + """`--pca-dim k`: a FIXED linear map fitted once on training frames (not a learned encoder). + z = (x - mean) @ W with W [d_in, k] orthonormal columns (top-k right singular vectors), so the + pseudo-inverse is W^T: back(z) = z @ W^T + mean. mean/W are persistent buffers, saved in the + checkpoint's `enc` state_dict and reloaded by is_ope.load_critic.""" + + def __init__(self, d_in: int, k: int): + super().__init__() + self.d_z = int(k) + self.register_buffer("mean", torch.zeros(int(d_in))) + self.register_buffer("W", torch.zeros(int(d_in), int(k))) + + @torch.no_grad() + def fit(self, X): + """X [n, d_in] float tensor of (z-scored) training states. Returns explained-variance ratio.""" + self.mean.copy_(X.mean(0)) + _u, S, Vh = torch.linalg.svd(X - self.mean, full_matrices=False) + self.W.copy_(Vh[: self.d_z].T) + var = S.pow(2) + return float(var[: self.d_z].sum() / var.sum()) + + def forward(self, x): + return (x - self.mean) @ self.W + + def back(self, z): + return z @ self.W.T + self.mean + + +class RewardHead(nn.Module): + """Goal-conditioned reward decoder R(z, task) -> logit of 'task complete here'.""" + + def __init__(self, d_z: int, n_task: int, d_task: int = 64, width: int = 512, t5_path: str = ""): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + self.net = mlp([d_z + d_task, width, width, 1]) + + def forward(self, z, task): + return self.net(torch.cat([z, self.task(task)], -1)).squeeze(-1) + + +class GoalLikelihood(nn.Module): + """Dense two-tower goal likelihood -- the recipe's `q_readout=lik`. + + `l = sigmoid( / tau)` with phi, psi unit-norm MLPs. Asymmetric + on purpose (phi != psi), because "z is at goal g" is not "g is at goal z". + + Why this replaces a binary success head: the success head is SPARSE -- terminal + labels are ~0.5% of frames, so almost every sampled future reads ~0 and Q is + near-constant in the action, leaving nothing to rank. This gives EVERY (z, g) + pair a probability, which is what makes the read-out able to separate actions. + + Trained by in-batch InfoNCE: positive is (z + eps, z), negatives are the other + goals in the batch. Recipe knobs: goal_feat_dim 256, towers (512,)x3, + goal_nce_tau 0.2, nce_noise 0.1. The scorer is STOP-GRAD in the Q path -- NCE + is the only gradient into the towers. + """ + + def __init__(self, d_z: int, d_feat: int = 256, width: int = 512, depth: int = 3, + tau: float = 0.2, noise: float = 0.1): + super().__init__() + self.phi = mlp([d_z] + [width] * depth + [d_feat], norm=True) + self.psi = mlp([d_z] + [width] * depth + [d_feat], norm=True) + self.tau = tau + self.noise = noise + + def _emb(self, net, z): + e = net(z) + return e / e.norm(dim=-1, keepdim=True).clamp_min(1e-6) + + def logit(self, z, g): + return (self._emb(self.phi, z) * self._emb(self.psi, g)).sum(-1) / self.tau + + def forward(self, z, g): + return torch.sigmoid(self.logit(z, g)) + + def nce_loss(self, z): + """In-batch InfoNCE. Positive (z+eps, z); negatives are other batch rows.""" + zp = z + self.noise * torch.randn_like(z) + a = self._emb(self.phi, zp) + b = self._emb(self.psi, z) + logits = (a @ b.t()) / self.tau + tgt = torch.arange(z.shape[0], device=z.device) + return F.cross_entropy(logits, tgt) + + +class FiLM(nn.Module): + def __init__(self, d_cond, d_h): + super().__init__() + self.to_gb = nn.Linear(d_cond, 2 * d_h) + + def forward(self, h, c): + g, b = self.to_gb(c).chunk(2, -1) + return h * (1 + g) + b + + +class OccFlow(nn.Module): + """Conditional flow-matching velocity for the beta-discounted successor. + + Predicts the velocity of the RESIDUAL delta = (z_fut - z_now) / rms, so the + network never has to re-encode z_now's own coordinates. + """ + + def __init__(self, d_z: int, d_act: int, n_task: int, d_task: int = 64, + width: int = 1024, depth: int = 4, n_fourier: int = 6, t5_path: str = "", + norm: bool = False, dropout: float = 0.0): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + d_cond = d_z + d_act + d_task + (2 * n_fourier + 1) + self.cond = mlp([d_cond, width, width], out_act=True, norm=True) + self.in_proj = nn.Linear(d_z + 128, width) + # norm=True (train_rsm.py --flow-norm 1): LayerNorm inside every residual block and on the + # stream before the output head. rsm_rise measured the un-normalised trunk amplifying + # held-out states (velocity 170 -> 8500 over 8 Euler steps on val rows, 8 -> 11 on train). + # Default False keeps every existing checkpoint loadable (Identity has no parameters). + self.blocks = nn.ModuleList([mlp([width, width], out_act=True, norm=norm) + for _ in range(depth)]) + if dropout > 0: + # appended INSIDE each block's Sequential so the Linear keeps state_dict index 0 + for blk in self.blocks: + blk.append(nn.Dropout(dropout)) + self.films = nn.ModuleList([FiLM(width, width) for _ in range(depth)]) + self.final_norm = nn.LayerNorm(width) if norm else nn.Identity() + self.out = nn.Linear(width, d_z) + self.n_fourier = n_fourier + + def forward(self, z_now, a_chunk, task, beta, x_k, k): + c = self.cond(torch.cat( + [z_now, a_chunk, self.task(task), beta_fourier(beta, self.n_fourier)], -1)) + h = self.in_proj(torch.cat([x_k, time_embed(k, 128)], -1)) + for blk, film in zip(self.blocks, self.films): + h = h + film(blk(h), c) + return self.out(self.final_norm(h)) + + +class RatioNet(nn.Module): + """Per-decision density-ratio classifier. + + Trained to separate a LOGGED action chunk at state z (from the behavior policy + mu) from a chunk freshly SAMPLED from the target policy pi at the same z. On + balanced classes the logit is exactly log pi/mu, so we never need a normalized + density for either policy -- which matters because mu here is a flow model + sampled as an SDE and has no tractable likelihood. This is the substitute for + the notes' w_{t,k} = prod pi(a_j|s_j)/mu(a_j|s_j). + """ + + def __init__(self, d_z: int, d_act: int, n_task: int, d_task: int = 64, + width: int = 512, depth: int = 3, t5_path: str = ""): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + self.net = mlp([d_z + d_act + d_task] + [width] * depth + [1], norm=True) + + def forward(self, z, a_chunk, task): + return self.net(torch.cat([z, a_chunk, self.task(task)], -1)).squeeze(-1) + + +class EndpointRatio(nn.Module): + """Rao-Blackwellized endpoint weight w*(z,a,z') = d^pi_beta / d^mu_beta. + + Regression target is the chunk-level product of per-decision ratios; the + squared-loss minimizer is the conditional expectation given the endpoint, + which is precisely the notes' Section-9 identity. Predicts LOG w for stability. + """ + + def __init__(self, d_z: int, d_act: int, n_task: int, d_task: int = 64, + width: int = 512, depth: int = 3, t5_path: str = ""): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + self.net = mlp([2 * d_z + d_act + d_task] + [width] * depth + [1], norm=True) + # start at w ~= 1: softplus(0.5413) = 1.0 + nn.init.zeros_(self.net[-1].weight); nn.init.constant_(self.net[-1].bias, 0.5413) + + def forward(self, z, a_chunk, z_fut, task): + """Returns w > 0 directly. softplus rather than exp: under squared loss an + exponential head has gradient proportional to w itself, so once it + undershoots it stops learning -- observed as E_mu[w]=0.45 against a target + of 1.0. softplus keeps the gradient alive as w -> 0.""" + o = self.net(torch.cat([z, a_chunk, z_fut, self.task(task)], -1)).squeeze(-1) + return F.softplus(o) + + +class RawFeat(nn.Module): + """Feature map for policy extraction: full observation, CENTERED only. + + Two separate findings drive this. + + (1) The policy must not read the critic's latent. That encoder is trained to + predict REWARD, so its bottleneck keeps what separates success from failure + and discards what an action head needs. Measured: a flow policy on the 264-d + reward latent beat a predict-the-mean action baseline by only 14% in MSE, + with a biased gripper channel. + + (2) It must not read PER-DIM Z-SCORED features either. Whitening gives all + 4104 dimensions equal variance, which amplifies thousands of near-dead + directions up to the scale of the informative ones. Measured on BC-on-demos: + action loss rose 0.158 -> 0.355 and closed-loop success fell from 3/10 to + 0/10 on task 2 when the policy input was whitened. + + What the input actually needed was CENTERING: the mean feature vector has + norm 51.1 against a per-frame deviation of norm 9.0, so 85% of the raw + magnitude is a constant carrying no information. Centering removes that + without touching the relative importance of dimensions. + + The data layer hands over z-scored features (the critic wants those), so this + module rescales them back by `scale` = sd / mean(sd) over the visual block, + recovering (x - mu) / s_global exactly. Proprio keeps its per-dim z-score: + its 8 dims are genuinely different units, spanning std 0.014 to 1.372.""" + + def __init__(self, d, scale=None): + super().__init__() + self.d_out = int(d) + if scale is None: + scale = torch.ones(int(d)) + self.register_buffer("scale", torch.as_tensor(scale, dtype=torch.float32)) + + def forward(self, x): + return x * self.scale + + +class ConcatFlowPolicy(nn.Module): + """Flow-matching action-chunk policy, CONCATENATION-conditioned. + + A faithful port of the head behind this lane's 0.584 bcdemos bar. The + difference from FlowPolicy is not cosmetic: FlowPolicy squeezes the whole + 4104-d observation through a `cond` MLP and injects it only as FiLM scale and + shift, so the action branch never sees the observation directly. Measured + consequence at identical chunk (10), width (1024), depth (4) and demo cache: + held-out ODE-sampled reconstruction MSE was 0.0480 for FiLM against 0.00319 + for the concatenation head that reaches 0.584 -- a 15x gap that no amount of + normalisation or feature choice closed. + + Everything else matches that recipe: SiLU, no normalisation layers, 64-d task + embedding, 128-d sinusoidal flow-time embedding, the noisy chunk fed straight + in, and 10 Euler steps at sampling time. + """ + + def __init__(self, d_z: int, d_act: int, n_task: int, d_task: int = 64, + width: int = 1024, depth: int = 4, steps: int = 10, t5_path: str = ""): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + ind = d_z + d_task + 128 + d_act + layers = [] + for i in range(depth): + layers += [nn.Linear(ind if i == 0 else width, width), nn.SiLU()] + layers += [nn.Linear(width, d_act)] + self.net = nn.Sequential(*layers) + self.d_act = d_act + self.steps = steps + + def velocity(self, z, task, a_k, k): + return self.net(torch.cat([z, self.task(task), time_embed(k, 128), a_k], -1)) + + def fm_loss(self, z, task, a, reduce=True): + k = torch.rand(a.shape[0], device=a.device) + noise = torch.randn_like(a) + a_k = (1 - k)[:, None] * a + k[:, None] * noise + per = (self.velocity(z, task, a_k, k) - (a - noise)).pow(2).mean(-1) + return per.mean() if reduce else per + + @torch.no_grad() + def sample(self, z, task, temp: float = 1.0, sde: float = 0.0, + sde_anneal: bool = False): + """temp scales the initial noise; sde injects noise DURING integration. + + sde_anneal scales the injected noise by the remaining noise fraction k, so + the perturbation is large early (where the drift can still re-project it + onto the manifold) and vanishes at the last steps; constant sde leaves an + un-corrected sde*sqrt(dt) kick on the final action. + + These buy diversity in different places and it matters here. temp inflates + the PRIOR the ODE transports, so every sample starts further out and the + map carries it somewhere the data never was -- measured closed-loop 0.550 + at temp 1.0, 0.310 at 1.5, 0.000 at 2.0, with the ranker held fixed. sde + follows the learned drift and perturbs along the way, which keeps samples + near the manifold the drift was fitted on. That is the mechanism that + produced usable candidate diversity in the related lane. + + Flow matching learns a near-deterministic map for a unimodal conditional, + so a trained policy's samples barely differ: measured action std 0.029 at + 120k steps and 0.053 at 20k, against 0.421 in the data. PARL cannot rank + N copies of one action, so temp>1 widens the prior the ODE transports and + gives the critic something to choose between. Candidates further from the + mode are exactly what the value is there to accept or reject. + """ + return self.sample_eps(z, task, torch.randn(z.shape[0], self.d_act, device=z.device), + temp=temp, sde=sde, sde_anneal=sde_anneal) + + def sample_eps(self, z, task, eps, temp: float = 1.0, sde: float = 0.0, + sde_anneal: bool = False): + """sample() with caller-supplied initial noise eps [B, d_act] (common random + numbers across candidates); the SDE perturbations, if any, stay independent.""" + x = eps * temp + dt = 1.0 / self.steps + for s in range(self.steps): + k = torch.full((z.shape[0],), 1 - s / self.steps, device=z.device) + x = x + self.velocity(z, task, x, k) * dt + if sde: + # Euler-Maruyama style: the drift is followed exactly and the + # perturbation scales as sqrt(dt), so total injected variance is + # independent of the number of solver steps. + sc = sde * (dt ** 0.5) + if sde_anneal: + sc = sc * float(k[0]) + x = x + sc * torch.randn_like(x) + return x + + +class BCHead(nn.Module): + """Gaussian action-chunk policy over the frozen latent: pi(A | z, task). + + Deliberately a tractable Gaussian, unlike the flow-SDE behavior policy: the + target policy is the one we must SAMPLE from many times per state (for the + ratio classifier and for AWR), and a closed form keeps that cheap. + """ + + def __init__(self, d_z: int, d_act: int, n_task: int, d_task: int = 64, + width: int = 1024, depth: int = 4, log_std_init: float = -1.0, t5_path: str = ""): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + self.trunk = mlp([d_z + d_task] + [width] * depth, out_act=True, norm=True) + self.mu = nn.Linear(width, d_act) + self.log_std = nn.Parameter(torch.full((d_act,), log_std_init)) + + def forward(self, z, task): + h = self.trunk(torch.cat([z, self.task(task)], -1)) + return self.mu(h), self.log_std.clamp(-5.0, 2.0) + + def sample(self, z, task, n: int = 1): + mu, ls = self(z, task) + if n == 1: + return mu + torch.randn_like(mu) * ls.exp() + mu = mu[:, None].expand(-1, n, -1) + return mu + torch.randn_like(mu) * ls.exp() + + def sample_eps(self, z, task, eps): + """Sample with caller-supplied standard-normal noise (common random numbers).""" + mu, ls = self(z, task) + return mu + eps * ls.exp() + + def log_prob(self, z, task, a): + mu, ls = self(z, task) + var = (2 * ls).exp() + return (-0.5 * ((a - mu) ** 2 / var + 2 * ls + np.log(2 * np.pi))).sum(-1) + + +class FlowPolicy(nn.Module): + """Flow-matching action-chunk policy pi(A | z, task). + + Replaces the Gaussian head because of a measured failure: with a Gaussian + target and a flow-SDE behaviour policy, the density-ratio classifier hit + 99.9-100% accuracy. It was not separating good actions from bad, it was + separating "Gaussian sample" from "flow sample" -- a parametric-family + artifact -- which drove E_mu[W] to 0.18 against a required 1.0 and made the + importance weights meaningless. Matching the family removes that shortcut. + + No tractable density, which is fine: the classifier supplies the ratio, and + AWR weights the per-sample flow-matching loss instead of a log-likelihood + (the same substitution the smolvla AWR run used). + """ + + def __init__(self, d_z: int, d_act: int, n_task: int, d_task: int = 64, + width: int = 1024, depth: int = 4, steps: int = 8, t5_path: str = ""): + super().__init__() + self.task = TaskCond(n_task, d_task, t5_path) + self.cond = mlp([d_z + d_task, width, width], out_act=True, norm=True) + self.in_proj = nn.Linear(d_act + 128, width) + self.blocks = nn.ModuleList([mlp([width, width], out_act=True) + for _ in range(depth)]) + self.films = nn.ModuleList([FiLM(width, width) for _ in range(depth)]) + self.out = nn.Linear(width, d_act) + self.d_act = d_act + self.steps = steps + + def velocity(self, z, task, a_k, k): + c = self.cond(torch.cat([z, self.task(task)], -1)) + h = self.in_proj(torch.cat([a_k, time_embed(k, 128)], -1)) + for blk, film in zip(self.blocks, self.films): + h = h + film(blk(h), c) + return self.out(h) + + def fm_loss(self, z, task, a, reduce=True): + """Per-sample flow-matching loss; stands in for -log pi(a|z).""" + k = torch.rand(a.shape[0], device=a.device) + noise = torch.randn_like(a) + a_k = (1 - k)[:, None] * a + k[:, None] * noise + v = self.velocity(z, task, a_k, k) + per = (v - (a - noise)).pow(2).mean(-1) + return per.mean() if reduce else per + + @torch.no_grad() + def sample(self, z, task, n: int = 1): + if n > 1: + z = z.repeat_interleave(n, 0) + task = task.repeat_interleave(n, 0) + a = torch.randn(z.shape[0], self.d_act, device=z.device) + for s in range(self.steps): + k = torch.full((z.shape[0],), 1.0 - s / self.steps, device=z.device) + a = a + self.velocity(z, task, a, k) / self.steps + return a + + +@torch.no_grad() +def ema_update(target: nn.Module, online: nn.Module, m: float = 0.995): + for pt, po in zip(target.parameters(), online.parameters()): + pt.mul_(m).add_(po.detach(), alpha=1 - m) + for bt, bo in zip(target.buffers(), online.buffers()): + bt.copy_(bo) diff --git a/gen_q_rsm/rsm_libero/notes/action_contrast.pdf b/gen_q_rsm/rsm_libero/notes/action_contrast.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ee49476a9e88e8a40fb4c00a0f06f26b39901ee5 --- /dev/null +++ b/gen_q_rsm/rsm_libero/notes/action_contrast.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65c4330748f098ef6fcd6fbf42b24807b9bfb2dd2146e0ad8851b75d8e29cea3 +size 187852 diff --git a/gen_q_rsm/rsm_libero/notes/action_contrast.tex b/gen_q_rsm/rsm_libero/notes/action_contrast.tex new file mode 100644 index 0000000000000000000000000000000000000000..bbdc28c13a9a74693660ca02a5e8adbbd9a386e1 --- /dev/null +++ b/gen_q_rsm/rsm_libero/notes/action_contrast.tex @@ -0,0 +1,182 @@ +\documentclass[11pt]{article} +\usepackage[margin=1in]{geometry} +\usepackage{amsmath,amssymb,booktabs,microtype} +\title{\vspace{-2em}The action-contrast term: same intent, opposite sign,\\opposite conclusion} +\author{gen\_q, branch \texttt{rsm-libero10-ope}} +\date{2026-09-11} +\begin{document}\maketitle\vspace{-1.5em} + +\section{Why this needs writing down} + +\texttt{origin/main}'s campaign concludes that its action-contrast term is +\emph{wrong-signed}, a ``flat standing tax on correct behaviour'', and ablates it. +Ours is superficially the same idea. It would be easy --- and wrong --- to copy +that conclusion across. The two terms have opposite signs, and measured on this +corpus ours is load-bearing: removing it makes the critic worse. + +\section{The two terms} + +Write $e_{\text{true}}$ for the flow's reconstruction error of the true future +when conditioned on the action actually taken, and $e_{\text{shuf}}$ for the same +error when conditioned on another action from the batch. The \emph{desired} +state of affairs is $e_{\text{true}} < e_{\text{shuf}}$: the real action should +explain the real future better. Define the gap as main does, +\begin{equation} +\mathrm{gap} \;=\; e_{\text{true}} - e_{\text{shuf}}, +\qquad\text{so desired}\;\Longleftrightarrow\; \mathrm{gap} < 0 . +\end{equation} + +\paragraph{main's hinge.} +$\mathcal{L} = \mathrm{relu}\!\left(e_{\text{shuf}} - e_{\text{true}} + m\right) + = \mathrm{relu}(-\mathrm{gap} + m)$, with margin $m = 0.02$. This is +\emph{large} exactly when the gap is most negative, i.e. when the model is +behaving best. Their own reproduction pins it: + +\begin{center}\small +\begin{tabular}{lrrrrr} +\toprule +cell & $e_{\text{true}}$ & $e_{\text{shuf}}$ & gap & logged term & corrected hinge \\ +\midrule +cube-single & 0.3017 & 0.3675 & $-0.0658$ & \textbf{0.0858} & 0.0000 \\ +cube-double & 0.2670 & 0.3319 & $-0.0649$ & \textbf{0.0849} & 0.0000 \\ +cube-triple & 0.2419 & 0.3002 & $-0.0583$ & \textbf{0.0783} & 0.0000 \\ +cube-quadruple & 0.2240 & 0.2788 & $-0.0548$ & \textbf{0.0748} & 0.0000 \\ +\bottomrule +\end{tabular} +\end{center} + +The logged value equals $\mathrm{relu}(-\mathrm{gap}+m)$ to four decimals on every +cell, which is what confirms the sign. The true action \emph{already} reconstructs +better everywhere, and the hinge penalises that by $\approx 0.085$ on every step +of every run. The corrected hinge, $\mathrm{relu}(\mathrm{gap}+m)$, evaluates to +exactly $0$ on all four cells --- so on state their ``fix'' is an \textbf{ablation} +of the term, not a re-aiming of it. On pixels the same term is steeply +cell-dependent rather than uniform: $0.4069 \pm 0.0630$ on visual-single against +$0.0278 \pm 0.0075$ on quadruple, a ${\sim}15\times$ spread, falling hardest on +the cell that works best. + +\paragraph{Ours.} +$\mathcal{L} = \mathrm{softplus}\!\left(e_{\text{true}} - e_{\text{shuf}}\right) + = \mathrm{softplus}(\mathrm{gap})$. Minimising it drives the gap \emph{more} +negative, which is the desired direction. The sign is right. + +It is not, however, inert once the gap goes negative, and that is worth stating +because it is the natural assumption. At a gap of $-0.065$, +\begin{equation} +\mathrm{softplus}(-0.065) = \ln\!\left(1 + e^{-0.065}\right) \approx 0.661, +\qquad +\frac{\partial}{\partial\,\mathrm{gap}}\,\mathrm{softplus} = \sigma(-0.065) \approx 0.484 . +\end{equation} +So it still contributes a substantial loss and, more importantly, a gradient of +roughly $0.48$ --- it keeps pushing long after the ordering is correct. That is the +sense in which it resembles a tax; the difference from main's is that it pushes in +the \emph{right} direction. + +\section{Which negative? Measured, not argued} + +The natural reading of the term is ``the error on $(s,a,s')$ should beat the error +on $(s,a_{\text{rand}},s'_{\text{rand}})$'' --- shuffle the action \emph{and} the +target. What we implement holds $s'$ fixed and shuffles only the action. The +worry about the first form is that it confounds two effects: its error is large +partly because the action is wrong and partly because the target is an unrelated +future, and a successor that ignored the action entirely would still score well on +it. + +Measured on the deployed critic (\texttt{probe\_actcon.py}, 4 batches of 2048, +$\beta=0.9$, held-out): + +\begin{center}\small +\begin{tabular}{lrr} +\toprule +negative & flow-matching error & gap vs true \\ +\midrule +(true action, true target) & 0.5989 & --- \\ +shuffled ACTION, true target & \textbf{14.1241} & $+13.5251$ \\ +true action, shuffled target & 0.7378 & $+0.1389$ \\ +shuffled action AND target & 13.4020 & $+12.8031$ \\ +\bottomrule +\end{tabular} +\end{center} + +The action accounts for \textbf{105.6\%} of the both-shuffled gap and the target +for \textbf{1.1\%}. So the confound is negligible here: the intuitive form and the +implemented form measure essentially the same thing, because on this model +essentially all of the difficulty comes from the conditioning action. Holding +$s'$ fixed is still the cleaner instrument --- it is a paired comparison, same +target, same noise, same flow time --- but the two are not in practical conflict. + +(What one would \emph{ideally} contrast against is +$(s, a_{\text{rand}}, s'\!\mid\! a_{\text{rand}})$, the future that the random +action would actually have produced. That is unobtainable offline: the dataset +never shows where $a_{\text{rand}}$ leads from $s$. This is the same missing +counterfactual that makes the value's action direction arbitrary.) + +\section{The number that reframes everything} + +Shuffling the action multiplies the flow-matching error by \textbf{23.6$\times$} +($0.599 \to 14.12$). The successor is not remotely action-blind: it keys on the +action extremely strongly. Give it an action that did not produce this future and +its velocity prediction falls apart. + +That sits beside a fact established separately (\texttt{probe\_crn.py}): the +\emph{value} read off this same flow does not rank actions --- perturbing an +expert chunk raises $Q$ as often as it lowers it. Both are true, and together they +say something sharper than either alone. The model has learned a strong, +confident mapping from action to future. For actions it never saw at that state +that mapping produces a \emph{wildly} different prediction, and a wildly different +latent earns an essentially arbitrary reward. The failure is not indifference to +the action; it is confident nonsense off the data. + +\paragraph{A correction to this document.} An earlier version argued our term is +``not inert'' once the gap goes negative, computing +$\mathrm{softplus}(-0.065)\approx0.661$ with gradient $\approx0.48$. That used +\emph{main's} measured gap. Ours is $-13.53$, where +$\mathrm{softplus}(-13.53)\approx 1.3\times10^{-6}$ and the gradient is +$\sigma(-13.53)\approx 1.3\times10^{-6}$. On the trained model our term is +\textbf{numerically inert}. It is active only early, while the gap is still +small --- which is precisely where the action win rate peaks (steps 1000--2000) +before decaying. That is a better explanation of the ablation result below than +``a standing force'': the term shapes the successor early and then switches off. + +\section{What it is worth here} + +Held-out within-task action win rate of the critic, everything else fixed: + +\begin{center}\small +\begin{tabular}{lcc} +\toprule +$w_{\text{actcon}}$ & label & best action win rate \\ +\midrule +0.0 & dense (outcome) & 0.522 \\ +0.0 & terminal (arrival) & 0.478 \\ +\textbf{0.5} & dense & \textbf{0.568} \\ +1.0 (with $d_z{=}512$) & dense & 0.532 \\ +2.0 & dense & 0.533 \\ +\bottomrule +\end{tabular} +\end{center} + +Removing the term costs $0.046$ of win rate; doubling it past $0.5$ costs about as +much again. There is an optimum near $0.5$ and we are at it. \textbf{main's +ablation conclusion does not transfer}, and the reason is simply that their term +had the opposite sign: ablating a penalty on correct behaviour helps, ablating a +reward for it does not. + +\section{The caveat that limits all of this} + +The win rates above live in $0.52$--$0.57$, barely above chance, and the term +moves them by $0.05$. It is a real effect on a critic that is weak in a way this +term does not address. Separate measurement (\texttt{probe\_crn.py}) shows the +counterfactual-conditioned $Q$ responds to an action with roughly the right +magnitude and an \emph{arbitrary sign}, because it is trained only on the action +actually taken. The action-contrast term sharpens how much the successor depends +on the action; it does nothing to make that dependence point the right way. The +reader that does rank actions correctly here is the supervised student $Q$, fit by +regression onto real $(s,a,s')$ transitions --- expert-versus-perturbation wins +rising $0.515 \to 0.614$ with perturbation size, against flat chance for the +counterfactual read-out. + +So: keep the term at $0.5$, do not copy the ablation, and do not expect it to fix +the direction problem. + +\end{document} diff --git a/gen_q_rsm/rsm_libero/notes/is_successor_tutorial.pdf b/gen_q_rsm/rsm_libero/notes/is_successor_tutorial.pdf new file mode 100644 index 0000000000000000000000000000000000000000..946ace6a82e814ea79427765dbbe6ed26d5e0fcd Binary files /dev/null and b/gen_q_rsm/rsm_libero/notes/is_successor_tutorial.pdf differ diff --git a/gen_q_rsm/rsm_libero/notes/is_successor_tutorial.tex b/gen_q_rsm/rsm_libero/notes/is_successor_tutorial.tex new file mode 100644 index 0000000000000000000000000000000000000000..ea8d0759076cdf13a835efff4d8c62964ec2e0df --- /dev/null +++ b/gen_q_rsm/rsm_libero/notes/is_successor_tutorial.tex @@ -0,0 +1,104 @@ +\documentclass[9pt]{extarticle} +\usepackage[margin=0.4in]{geometry} +\usepackage{amsmath,amssymb,amsthm} +\usepackage{bm} +\usepackage{enumitem} +\usepackage[colorlinks=true,linkcolor=blue!60!black,urlcolor=blue!60!black]{hyperref} +\usepackage{xcolor} +\usepackage{tcolorbox} +\usepackage{parskip} +\setlength{\parskip}{2pt}\setlength{\abovedisplayskip}{3pt}\setlength{\belowdisplayskip}{3pt}\setlength{\abovedisplayshortskip}{2pt}\setlength{\belowdisplayshortskip}{2pt} + +\newcommand{\E}{\mathbb{E}} +\newcommand{\ind}{\mathbf{1}} +\newcommand{\dpi}{d^{\pi}_{\lambda}} +\newcommand{\dmu}{d^{\mu}_{\lambda}} + + +\linespread{0.92}\pagestyle{empty} +\begin{document} +\begin{center}{\large\bfseries Importance Sampling for Successor Distributions}\\[1pt]{\small How to turn a behavior-policy occupancy into a target-policy occupancy, and why the same weight reweights $Q$}\end{center}\vspace{-4pt} + +\paragraph{Short answer.} The note uses importance sampling to do \emph{both}: Sections~7--8 reweight to change the +\emph{distribution} ($\dmu \to \dpi$), and Section~9 pushes the identical weight through to the $Q$ readout, where +it becomes a per-particle multiplier. They are the same identity applied at different points. + + +\paragraph{Setup.} +The successor model $\hat d_\lambda(z\mid s,a)$ predicts a \emph{single} future state $z$. In the dataset that +state was produced by a logged sub-trajectory $\tau = (s_0, a_0, s_1, a_1, \dots, s_K)$ with $K\sim \mathrm{Geom}(1-\lambda)$ +and $z := s_K$. Call $\tau$ the chunk; it lives only in the data and in this derivation, never as a model output. +Conditioning on the first state--action pair, the chunk probability under a policy $\rho$ factorizes into dynamics, +the stopping clock, and the policy's own action choices: +\[ +p_\rho(\tau\mid s_0,a_0) \;=\; P(K)\prod_{j=0}^{K-1} P(s_{j+1}\mid s_j,a_j)\prod_{j=1}^{K-1}\rho(a_j\mid s_j). +\] +The dataset gives chunks from $p_\mu$ (behavior). We want the occupancy of the target policy $\pi$. + +\paragraph{Step 1: the trajectory ratio.} +Dynamics and the stopping clock do not depend on the policy, so they cancel in the ratio, leaving only the +intervening actions: +$w(\tau) := p_\pi(\tau\mid s_0,a_0)/p_\mu(\tau\mid s_0,a_0) = \prod_{j=1}^{K-1}\pi(a_j\mid s_j)/\mu(a_j\mid s_j)$. +The first action is excluded because both sides condition on it. This is the $w_{t,k}$ of Section~7 of the note. + +\paragraph{Step 2: the change of measure.} +For any function $f$ of the chunk, assuming $\mu>0$ wherever $\pi>0$, +\[ +\E_{\tau\sim p_\pi}[f(\tau)] \;=\; \sum_\tau p_\pi(\tau)\, f(\tau) \;=\; \sum_\tau p_\mu(\tau)\,\frac{p_\pi(\tau)}{p_\mu(\tau)}\, f(\tau) \;=\; \E_{\tau\sim p_\mu}\big[w(\tau)\, f(\tau)\big]. +\] +This one line is the whole method; everything else is choosing $f$. + +\paragraph{Step 3: from trajectories to the endpoint occupancy.} +Take $f(\tau)=\ind[s_K = z]$. The left side is $\dpi(z\mid s_0,a_0)$. Splitting the right side by endpoint, +\[ +\dpi(z\mid s,a) \;=\; \E_\mu\big[w(\tau)\,\ind[s_K=z]\big] \;=\; \dmu(z\mid s,a)\cdot\underbrace{\E_\mu\big[w(\tau)\mid s,a,s_K=z\big]}_{=:\;w^*(s,a,z)}. +\] +So the endpoint density ratio is the \emph{conditional average} of the trajectory ratio over all logged chunks that +share the same endpoint: +\[ +w^*(s,a,z) \;=\; \frac{\dpi(z\mid s,a)}{\dmu(z\mid s,a)} \;=\; \E_\mu\!\left[\prod_{j=1}^{K-1}\frac{\pi(a_j\mid s_j)}{\mu(a_j\mid s_j)}\;\middle|\; s,a,\,s_K=z\right]. +\] +This is the boxed identity in Section~9, and it is the key step: because the model emits only $z$, the only +weight usable at inference is a function of $(s,a,z)$, and $w^*$ is that function. Regressing $w(\tau)$ onto $(s,a,z)$ +with squared loss recovers it exactly, since the squared-loss minimizer is the conditional expectation. Averaging over +the hidden trajectories is Rao--Blackwellization, so $w^*$ has lower variance than $w(\tau)$. + +\paragraph{Step 4: three places to apply the weight.} +All three are Step~2 with a different $f$. +\begin{enumerate}[leftmargin=1.5em,itemsep=1pt,topsep=1pt] +\item \textbf{Training-time reweighting} (Sec.~7). Take $f=\ell_\theta(z\mid s,a)$, the endpoint flow-matching loss. Then +$\E_\mu[w\,\ell_\theta]=\E_\pi[\ell_\theta]$, so weighting each logged $(s,a,z)$ tuple by $w(\tau)$, computed from the +logged intervening actions, fits the endpoint model to $\dpi$ directly. The model still predicts only $z$. +\item \textbf{Test-time resampling} (Sec.~8). Sample chunks $\tau_i$ from the behavior model, compute $w_i$, normalize +$\tilde w_i = w_i/\sum_j w_j$, resample. Sampling--importance--resampling converts behavior samples into approximate +target samples. This is the one variant that needs the model to generate the whole chunk with its actions, i.e.\ a truncated trajectory/video model rather than a successor model. +\item \textbf{$Q$ reweighting} (Sec.~9). Take $f=r(z)$. Then +$Q^\pi(s,a) = \frac{1}{1-\gamma}\,\E_{z\sim d^\pi_\gamma}[r(z)] = \frac{1}{1-\gamma}\,\E_{z\sim d^\mu_\gamma}\big[w^*(s,a,z)\,r(z)\big]$. +The occupancy model stays fixed at $d^\mu$. Only a small learned $\hat w_\omega\approx w^*$ changes with $\pi$. +\end{enumerate} + +\paragraph{Step 5: through the recursion.} +With restart probability $p=\frac{\gamma-\lambda}{\gamma(1-\lambda)}$, a particle makes jumps $\ell=0,1,\dots$ and +draws each boundary action $a^{(\ell+1)}\sim\pi(\cdot\mid s^{(\ell+1)})$ itself. The boundary is already on-policy, +so only the \emph{inside} of each chunk needs correcting, and the corrections multiply: +\[ +C_i \;=\; \prod_{\ell}\hat w_\omega\big(s^{(\ell)},a^{(\ell)},z^{(\ell)}\big),\qquad +\hat Q^\pi(s,a) \;=\; \frac{1}{(1-\gamma)N}\sum_{i=1}^N C_i\, r(z_i). +\] +The self-normalized form $\frac{1}{1-\gamma}\,\sum_i C_i r(z_i)\big/\sum_i C_i$ trades a small bias for much lower +variance; resampling by $\hat w$ after every jump instead of carrying the product is the sequential Monte Carlo variant and avoids weight collapse. + +\paragraph{What it costs.} +Normalized action likelihoods for both policies ($\mu$ needs a fitted density; diffusion/flow policies have no tractable one); +variance of $w$ growing roughly like $\exp\!\big(K\cdot\mathrm{KL}(\pi\|\mu)\big)$, which is the argument for short chunks; and the +weight corrects policy mismatch only, never error in the learned proposal $\hat d^\mu_\lambda$. + +\begin{tcolorbox}[colback=orange!5,colframe=orange!60!black,boxrule=0.5pt,boxsep=1pt,top=2pt,bottom=2pt,left=4pt,right=4pt] +\textbf{Why this bears on the stitching result.} Boundary-only stitching swaps the policy at one action per chunk. +At $\lambda=0.98$ a chunk averages $\lambda/(1-\lambda)\approx 49$ steps, so the composed process follows $\pi$ on +roughly $2\%$ of steps and $\mu$ on the rest. The $Q$ estimate is then mostly evaluating the behavior policy, which +would make an improvement signal at the boundaries hard to see. Importance weighting is what makes the inside of each +chunk follow $\pi$ too. +\end{tcolorbox} + +\end{document} diff --git a/gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.pdf b/gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5063b2d9ed3f9529a3e1f790fb506377d2f49481 --- /dev/null +++ b/gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4df1f5ceef4984acf8b865afd0c510f854c61c91e3214a49ad86f239e8302ebc +size 202537 diff --git a/gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.tex b/gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.tex new file mode 100644 index 0000000000000000000000000000000000000000..2bc0c33d83005d1370867682304a0e526d5d5402 --- /dev/null +++ b/gen_q_rsm/rsm_libero/notes/rsm_formula_comparison.tex @@ -0,0 +1,141 @@ +\documentclass[11pt]{article} +\usepackage[margin=1in]{geometry} +\usepackage{amsmath,amssymb,booktabs,microtype} +\usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref} +\title{\vspace{-2em}RSM on LIBERO-10 rollouts: how our value differs from +\texttt{origin/main}} +\author{gen\_q, branch \texttt{rsm-libero10-ope}} +\date{2026-09-11} +\begin{document}\maketitle\vspace{-1.5em} + +\section{Why this document} + +Our RSM recipe does not improve on behaviour cloning for LIBERO-10 +(BC-on-demos $0.630$; best value-guided arm $0.510$), while the same family of +method works on \texttt{origin/main}'s benchmarks. This compares the two value +definitions term by term. The conclusion is that they are \emph{not the same +estimator}: three differences are structural, and one of them is a variance +problem that \texttt{main} explicitly documents and fixes and we did not. + +\section{The two definitions} + +Both start from the same object, the discounted successor occupancy +\begin{equation} +d^{\pi}_{\beta}(x\mid s,a,\cdot)=(1-\beta)\sum_{k\ge0}\beta^{k} +P^{\pi}\!\big(s_{t+k}=x\mid s_t=s,a_t=a\big), +\end{equation} +fitted by conditional flow matching on the residual +$\tilde x=(E(x)-E(s))/\eta(\beta)$ with $E(s)$ stop-gradient. Up to here the two +implementations agree, including the per-dimension residual normalisation and the +EMA target encoder. They diverge at the read-out. + +\paragraph{\texttt{origin/main}: a survival product over hops.} +A two-tower InfoNCE arrival likelihood +$\ell(x,g)=\sigma\!\big(\varphi(x)\!\cdot\!\psi_g(g)/\tau_q\big)$ is folded +backwards along a $K$-hop chain, giving +\begin{equation} +Q_{\text{main}}(s,a,g)\;=\;-\frac{\gamma^{K}}{1-\gamma} +\prod_{k=1}^{K}\big(1-\ell(h_k,g)\big), +\qquad +\arg\max_a Q \;=\; \arg\max_a \sum_{k=1}^{K}\operatorname{softplus}(f_k), +\label{eq:main} +\end{equation} +where $\ell=\sigma(f)$. Each factor is the modelled probability of \emph{not} +having arrived by hop $k$. + +\paragraph{Ours: an expectation of reward at one endpoint.} +A reward head $r$ is trained by BCE against a dense success label, and +\begin{equation} +Q_{\text{ours}}(z,a)\;=\;\frac{1}{1-\gamma}\, +\mathbb{E}_{z'\sim d^{\mu}_{\beta}}\big[\sigma(r(z'))\big], +\label{eq:ours} +\end{equation} +estimated as a self-normalised importance-weighted mean over $N$ particles, where +$z'$ is the endpoint of a geometrically-truncated recursion with restart +probability $p=(\gamma-\beta)/(\gamma(1-\beta))$. + +\section{The three structural differences} + +\begin{enumerate} +\item \textbf{Product over hops versus a single endpoint.} +\eqref{eq:main} accumulates arrival evidence at \emph{every} hop; \eqref{eq:ours} +reads the reward head \emph{once}, at the final endpoint, and discards the +intermediate hops. With a dense per-frame success label this throws away most of +the signal the chain generates and makes the estimate depend on one noisy draw +rather than $K$. + +\item \textbf{Unsaturating versus saturating.} +In log space \eqref{eq:main} is a \emph{sum of softplus}, whose derivative +$\sigma(f)\in(0,1)$ never vanishes. Ours is a mean of $\sigma$, whose gradient +vanishes at both ends. Our reward head reaches AUC $0.96$, so it is routinely +saturated, precisely where it stops discriminating. + +\item \textbf{Contrastive arrival versus a BCE reward head.} +$\ell$ is normalised against in-batch negatives, so it is a \emph{relative} +quantity and cannot collapse to a base rate. $\sigma(r(z'))$ is absolute: an +off-support $z'$ that drifts toward the dataset mean returns roughly the corpus +success rate, which is $0.545$ here and outranks a confident low score on a +genuinely failing action. +\end{enumerate} + +\section{The variance difference, which is the one that bites} + +\texttt{main} reports that the per-state estimator has +$\mathrm{sd}(\hat Q)\approx 4.51$ against a policy-improvement signal +$\mathbb{E}[Q(a_\pi)-Q(a_{\text{data}})]\approx 0.82$, a ratio of $5.5$, and +concludes that ``a maximising actor ascends estimator noise as readily as +signal''. Its fix is clipped double-$Q$ built from \emph{flow noise rather than +twin networks}: split the $N$ draws, take the minimum of the two half-means, +\begin{equation} +\hat Q_{\min2}=\min\Big\{\tfrac{2}{N}\textstyle\sum_{i\le N/2}Q^{(i)},\; +\tfrac{2}{N}\textstyle\sum_{i>N/2}Q^{(i)}\Big\}. +\label{eq:min2} +\end{equation} + +We measured the same regime independently on LIBERO-10 with +\texttt{probe\_crn.py}: repeat noise (same action, independent draws) $2.246$ +against a paired action effect of $0.399$ at the smallest perturbation, a ratio of +$5.6$. \textbf{The numbers agree almost exactly, and we did not implement +\eqref{eq:min2}.} We used the plain mean, optionally minus a particle standard +deviation. Those are not the same estimator: subtracting a spread penalises +disagreement symmetrically, whereas \eqref{eq:min2} is a one-sided pessimistic +bias that specifically stops an argmax from selecting a draw that was lucky. + +\begin{table}[h]\centering\small +\begin{tabular}{lll} +\toprule +& \texttt{origin/main} & ours \\ +\midrule +conditioning & goal $g$, reward-free & task id, dense success label \\ +arrival signal & two-tower InfoNCE $\ell(x,g)$ & $\sigma$ of a BCE reward head \\ +value form & survival product over $K$ hops & mean reward at one endpoint \\ +composition & fixed $K$, policy acts after hop 1 & geometric restart $p$, truncated \\ +estimator & $\min$ of two half-means & mean ($\pm$ std penalty) \\ +actor & $\max Q$ + BC anchor, scale-normalised & AWR exponential weights \\ +deployment & Polyak--Ruppert tail average & last / best checkpoint \\ +off-policy term & none & importance sampling (interior + endpoint) \\ +\bottomrule +\end{tabular} +\end{table} + +\section{What this predicts, and what it does not excuse} + +The differences above are enough to explain a weak value, and \eqref{eq:min2} +plus the product form are directly portable. They do \emph{not} by themselves +explain our sharper finding: with common random numbers cancelling the shared +noise, perturbing an expert action raises our $Q$ exactly as often as it lowers +it, at every perturbation size. That is a statement about \emph{direction}, not +variance, and no estimator applied after the fact repairs it. Its likely cause is +upstream of both formulas: the occupancy model is trained only on the action that +was actually taken, so its counterfactual response is unsupervised, and our +mean-pooled PaliGemma latent barely resolves what a 10-frame chunk does (action +versus proprio-delta correlation $0.98$, versus visual-latent delta $0.49$). + +Ordered by expected value: (i) adopt \eqref{eq:min2}; (ii) adopt the +product-over-hops read-out, which uses every hop and is unsaturating; +(iii) adopt the contrastive arrival likelihood, which cannot collapse to a base +rate. Items (i) and (ii) are small changes to \texttt{q\_recursive}; (iii) needs +the \texttt{GoalLikelihood} module already present but unused in +\texttt{model.py}. + +\end{document} diff --git a/gen_q_rsm/rsm_libero/pack.py b/gen_q_rsm/rsm_libero/pack.py new file mode 100644 index 0000000000000000000000000000000000000000..dc899ff8fb29c3fb0408514dc528de8ffb203541 --- /dev/null +++ b/gen_q_rsm/rsm_libero/pack.py @@ -0,0 +1,278 @@ +"""Pack the LIBERO-10 pi0.5 OGPO rollout corpus into a flat memmap cache. + +Source layout (one npz per episode, 43,135 episodes over 10 task dirs): + /ep_t{T}_b{B}_i{id}_{epidx:06d}.npz + z [F,4096] float16 OGPO latent (agentview | wrist) + (task_index is NOT read -- see the guard in main()) + proprio [F,8] float32 + actions [F,7] float32 + success () bool + prompt () str + +Cache layout (written atomically into /): + z.f16 memmap [N,D] latents, frame-major, episodes contiguous + act.f32 memmap [N,7] executed action at that frame + meta.npz ep_from/ep_to/ep_len/ep_task/ep_success/ep_src, tasks, dim + +LEAKAGE NOTE recorded here because it shapes every downstream label choice: +failed episodes are ALL exactly 520 frames (the timeout) while successful ones +terminate early (mean ~263). Episode LENGTH therefore predicts success almost +perfectly. Any label built from "frames remaining" leaks the outcome, so the +reward label is defined on terminal states of successful episodes only, and the +headline diagnostic is action ranking at a FIXED state, never state ranking. +""" +from __future__ import annotations +import argparse, io, json, os, time, zipfile +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path +import numpy as np + + +def read_header(path, assume_success=None): + """(n_frames, success) without reading the arrays. + + `np.load(f)["z"].shape` materialises the whole 2.3 MB latent block, which for + 43k episodes is ~99 GB of pointless NFS traffic. npz is a zip of .npy members, + so the shape lives in the member's own header: parse that and stop. + """ + with zipfile.ZipFile(path) as zf: + with zf.open("z.npy") as f: + ver = np.lib.format.read_magic(f) + shape, _fortran, _dt = np.lib.format._read_array_header(f, ver) + if assume_success is None or "success.npy" in zf.namelist(): + # rollouts always carry it; REPLAYED demo caches (rerender_rollouts.py + # --pool demos_replay) carry it too, and a demo whose live replay did not + # end in success is inadmissible exactly like a non-reproducing rollout + with zf.open("success.npy") as f: + succ = bool(np.load(io.BytesIO(f.read()), allow_pickle=False)) + else: + succ = assume_success # legacy demo caches carry no success field + return int(shape[0]), succ + + +def episode_files(root: Path): + """-> list of (task_name, path, is_demo). Task id comes from the directory name. + + Rollout dirs hold ep_*.npz and carry a `success` flag. The demo cache uses the + same task name with a `_demo` suffix, holds demo_*.npz, and has no success + field because every demonstration succeeds.""" + out = [] + for d in sorted(p for p in root.iterdir() if p.is_dir()): + demo = d.name.endswith("_demo") + name = d.name[:-5] if demo else d.name + for f in sorted(d.glob("demo_*.npz" if demo else "ep_*.npz")): + out.append((name, f, demo)) + return out + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--src", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--demos", default="", help="optional demo cache root to union in") + ap.add_argument("--max-eps", type=int, default=0, help="0 = all") + ap.add_argument("--stride", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--workers", type=int, default=32, + help="threads for the header scan (NFS latency-bound)") + ap.add_argument("--header-cache", default="", + help="npz to cache/reuse the (success,length) scan") + ap.add_argument("--tasks-file", default="/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation/logs/09052026_lib10_tasks.txt", + help="canonical LIBERO benchmark-id task order; task ids are " + "assigned from THIS list, never from directory sort order " + "and never from the npz `task_index` field.") + ap.add_argument("--keep-all-demos", action="store_true", + help="always include EVERY demo episode, then fill the rest " + "with rollouts. Balanced sampling kept only 94 of 500 " + "demos, which starves a BC-on-demos baseline.") + ap.add_argument("--episode-list", default="", + help="text file, one '/.npz' per line: pack EXACTLY these " + "rollouts in this order. Two clusters packing from the same list produce " + "index-identical caches, so per-episode artefacts (subgoal labels, " + "admissibility mask) transfer by index.") + ap.add_argument("--encoder", default="pi05_base_pytorch", + help="feature-encoder tag (basename of OGPO_PI05_BASE the latents were encoded " + "with). Written to PACK.json/RENDER.json; the evaluator refuses a mismatch.") + ap.add_argument("--cam-res", default="", + help="render resolution the SOURCE latents were encoded from (e.g. 256). " + "Written to PACK.json and RENDER.json; the evaluator refuses a cache " + "whose cam_res is undeclared or differs from its own --cam-res.") + ap.add_argument("--balance", action="store_true", + help="equalize success/failure count within each task") + args = ap.parse_args() + + rng = np.random.default_rng(args.seed) + src, out = Path(args.src), Path(args.out) + out.mkdir(parents=True, exist_ok=True) + files = episode_files(src) + if args.episode_list: + _want = [l.strip() for l in open(args.episode_list) if l.strip()] + _by = {f"{f.parent.name}/{f.name}": (n, f, dm) for n, f, dm in files if not dm} + _missing = [w for w in _want if w not in _by] + if _missing: + raise SystemExit(f"--episode-list: {len(_missing)} listed episodes absent under --src, e.g. {_missing[:3]}") + files = [_by[w] for w in _want] + [t for t in files if t[2]] # rollouts in list order, then demos + print(f"[pack] episode list: {len(_want)} rollouts pinned from {args.episode_list}", flush=True) + if args.demos: + files += episode_files(Path(args.demos)) + print(f"[pack] found {len(files)} episodes in {len(set(t for t, *_ in files))} tasks", + flush=True) + + # ---- pass 1: read headers (success + length), pick the subset ---- + hc = Path(args.header_cache) if args.header_cache else out / "headers.npz" + if hc.exists(): + c = np.load(hc, allow_pickle=True) + if len(c["paths"]) == len(files) and set(map(str, c["paths"])) == {str(f[1]) for f in files}: + dm_col = c["demo"] if "demo" in c.files else np.zeros(len(c["paths"]), bool) + hdr = [(t, Path(p), bool(s), int(L), bool(dm)) for t, p, s, L, dm in + zip(c["tasknames"], c["paths"], c["succ"], c["lens"], dm_col)] + print(f"[pack] header scan reused from {hc}", flush=True) + else: + hc.unlink() + if not hc.exists(): + def rd(tf): + task, f, demo = tf + L, succ = read_header(f, assume_success=True if demo else None) + return (task, f, succ, L, demo) + t_scan = time.time() + with ThreadPoolExecutor(max_workers=args.workers) as ex: + hdr = list(ex.map(rd, files, chunksize=16)) + print(f"[pack] header scan {len(hdr)} files in {time.time()-t_scan:.0f}s", + flush=True) + hc.parent.mkdir(parents=True, exist_ok=True) + np.savez(hc, tasknames=np.array([h[0] for h in hdr]), + paths=np.array([str(h[1]) for h in hdr]), + succ=np.array([h[2] for h in hdr]), + lens=np.array([h[3] for h in hdr]), + demo=np.array([h[4] for h in hdr])) + + # Task ids come from the canonical benchmark-id list so they agree with every + # other trainer in this lane. Two things are deliberately NOT used: directory + # sort order (incidental, and disagrees with benchmark id), and the npz + # `task_index` field (0 in every episode of this corpus). + canon = [n.strip() for n in + Path(args.tasks_file).read_text().replace("\n", ",").split(",") if n.strip()] + tid = {t: i for i, t in enumerate(canon)} + present = sorted(set(t for t, *_ in hdr)) + unknown = [t for t in present if t not in tid] + if unknown: + raise SystemExit(f"[pack] refusing: task dir(s) not in {args.tasks_file}: {unknown}") + tasks = canon + chosen = [] + unbalanced = [] + forced = [] + if args.keep_all_demos: + forced = [h for h in hdr if h[4]] + hdr = [h for h in hdr if not h[4]] + print(f"[pack] forcing all {len(forced)} demo episodes into the cache", flush=True) + if args.max_eps and args.max_eps < len(hdr): + per_task = args.max_eps // len(tasks) + for t in tasks: + pool = [h for h in hdr if h[0] == t] + if args.balance: + s = [h for h in pool if h[2]] + f_ = [h for h in pool if not h[2]] + k = min(per_task // 2, len(s), len(f_)) + pick = ([s[i] for i in rng.choice(len(s), k, replace=False)] + + [f_[i] for i in rng.choice(len(f_), k, replace=False)]) + if k == 0 and pool: + # A task can be entirely one-sided: STUDY_SCENE1 has 0 + # successes in 2,962 rollouts, so 50/50 balancing would drop + # it silently. Keep it at natural composition and record that + # it could not be balanced -- a task the behaviour policy + # never solves is a result, not a reason to hide the task. + kk = min(per_task, len(pool)) + pick = [pool[i] for i in rng.choice(len(pool), kk, replace=False)] + unbalanced.append((t, len(s), len(f_))) + else: + k = min(per_task, len(pool)) + pick = [pool[i] for i in rng.choice(len(pool), k, replace=False)] + chosen += pick + else: + chosen = hdr + chosen = forced + chosen + rng.shuffle(chosen) + sel_task = np.array([tid[h[0]] for h in chosen]) + n_per = np.bincount(sel_task, minlength=len(tasks)) + missing = [tasks[i] for i, n in enumerate(n_per) if n == 0 and + any(h[0] == tasks[i] for h in hdr)] + if missing: + raise SystemExit(f"[pack] refusing: task(s) present in source but absent " + f"from the selection: {missing}") + print(f"[pack] packing {len(chosen)} episodes " + f"(success {np.mean([h[2] for h in chosen]):.3f}) " + f"per-task {n_per.tolist()}", flush=True) + if unbalanced: + print(f"[pack] NOT balanceable (kept at natural composition): " + f"{[(u[0][:28], u[1], u[2]) for u in unbalanced]}", flush=True) + + # ---- pass 2: sizes, allocate, fill ---- + lens = np.array([1 + (h[3] - 1) // args.stride for h in chosen], dtype=np.int64) + ep_demo = np.array([h[4] for h in chosen], bool) + ep_to = np.cumsum(lens); ep_from = ep_to - lens + N = int(ep_to[-1]) + with np.load(chosen[0][1], allow_pickle=True) as n: + D = int(n["z"].shape[1]); A = int(n["actions"].shape[1]) + print(f"[pack] N={N} frames D={D} A={A} " + f"({N*D*2/1e9:.1f} GB latents)", flush=True) + + zmm = np.lib.format.open_memmap(out / "z.f16.npy", mode="w+", + dtype=np.float16, shape=(N, D)) + # proprio is cheap (8 floats/frame) and the lane's closed-loop policy head + # consumes it alongside the latent, so pack it for interoperability even + # though the occupancy critic here does not use it. + pmm = np.lib.format.open_memmap(out / "proprio.f32.npy", mode="w+", + dtype=np.float32, shape=(N, 8)) + amm = np.lib.format.open_memmap(out / "act.f32.npy", mode="w+", + dtype=np.float32, shape=(N, A)) + ep_task = np.zeros(len(chosen), np.int64) + ep_succ = np.zeros(len(chosen), bool) + ep_src = [] + for i, (task, f, succ, _L, _dm) in enumerate(chosen): + with np.load(f, allow_pickle=True) as n: + z = n["z"][::args.stride] + a = n["actions"][::args.stride] + pr = n["proprio"][::args.stride] if "proprio" in n.files else None + s, e = int(ep_from[i]), int(ep_to[i]) + zmm[s:e] = z[: e - s] + amm[s:e] = a[: e - s] + if pr is not None: + pmm[s:e] = pr[: e - s] + ep_task[i] = tid[task]; ep_succ[i] = succ + ep_src.append(str(f)) + if (i + 1) % 250 == 0: + # Bound dirty-page accumulation: without periodic flushes the whole + # written cache sits dirty in page cache and the box is reported as + # out of memory (it killed this job and the concurrent upload once). + zmm.flush(); amm.flush(); pmm.flush() + print(f"[pack] {i+1}/{len(chosen)} episodes", flush=True) + zmm.flush(); amm.flush(); pmm.flush() + + np.savez(out / "meta.npz", ep_from=ep_from, ep_to=ep_to, ep_len=lens, + ep_task=ep_task, ep_success=ep_succ, ep_demo=ep_demo, + tasks=np.array(tasks), + dim=D, adim=A, stride=args.stride, n_frames=N, + ep_src=np.array(ep_src)) + _cam = int(args.cam_res) if str(args.cam_res).isdigit() else (args.cam_res or "UNKNOWN") + (out / "RENDER.json").write_text(json.dumps({ + "cam_res": _cam, "encoder": args.encoder, "flip": "[::-1,::-1] to serving orientation", + "resize": "-> 224 bilinear, uint8", + "encoder": "08312026_1110pm_ogpo_latent_cache.py PaliGemma base||wrist", + "proprio": "eef_pos(3)+axis_angle(3)+gripper(2)"}, indent=1)) + (out / "PACK.json").write_text(json.dumps({ + "cam_res": _cam, "encoder": args.encoder, + "src": str(src), "episodes": len(chosen), "frames": N, "dim": D, + "adim": A, "stride": args.stride, + "success_rate": float(ep_succ.mean()), + "n_demo": int(ep_demo.sum()), + "tasks": tasks, + "task_id_source": f"canonical benchmark order from {args.tasks_file} " + f"(dir sort order and the npz task_index field are both ignored)", + "episodes_per_task": n_per.tolist(), + "tasks_not_balanceable": [[u[0], int(u[1]), int(u[2])] for u in unbalanced], + }, indent=2)) + print(f"[pack] DONE -> {out}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/pack_full.sbatch b/gen_q_rsm/rsm_libero/pack_full.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..31eecaec479efb777ccb45f70233834b688e2f4f --- /dev/null +++ b/gen_q_rsm/rsm_libero/pack_full.sbatch @@ -0,0 +1,18 @@ +#!/bin/bash +#SBATCH --job-name=pack_full +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=32 --mem=200G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +PY=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python +export PYTHONUNBUFFERED=1 +# --max-eps 0 = ALL 43,135 rollouts (the existing cache capped at 4,500 to fit a +# 110G --mem request; the a100/h200 nodes have 1-2 TB, so the cap is not binding) +$PY $G/pack.py \ + --src /data/pulkitag/users/rli14/pi05_lib10_ogpo_fl15_v1 \ + --demos /data/pulkitag/users/rli14/libero10_demo_ogpo_cache_srv \ + --out /data/pulkitag/scratch/rli14/rsm_libero_cache_full \ + --max-eps 0 --stride 1 --keep-all-demos --workers 32 +RC=$?; echo "[pack] rc=$RC $(date -u +%T)"; exit $RC diff --git a/gen_q_rsm/rsm_libero/pack_full_r256.sbatch b/gen_q_rsm/rsm_libero/pack_full_r256.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..b187808db5120af93bbb1a49360b0094694f2730 --- /dev/null +++ b/gen_q_rsm/rsm_libero/pack_full_r256.sbatch @@ -0,0 +1,18 @@ +#!/bin/bash +#SBATCH --job-name=pack_full_r256 +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=32 --mem=200G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +PY=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python +export PYTHONUNBUFFERED=1 +# ALL 43,135 rollouts (256-encoded, as the collector produced them) + the 500 demos +# re-rendered at 256. One latent space, the evaluator's. +$PY $G/pack.py \ + --src /data/pulkitag/users/rli14/pi05_lib10_ogpo_fl15_v1 \ + --demos /data/pulkitag/users/rli14/libero10_demo_ogpo_cache_r256 \ + --out /data/pulkitag/scratch/rli14/rsm_libero_cache/full_r256 \ + --max-eps 0 --stride 1 --keep-all-demos --workers 32 --cam-res 256 --episode-list /data/pulkitag/users/rli14/rsm_libero_cache/full_r256_episodes.txt +RC=$?; echo "[pack] rc=$RC $(date -u +%T)"; exit $RC diff --git a/gen_q_rsm/rsm_libero/pack_r256.sbatch b/gen_q_rsm/rsm_libero/pack_r256.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..190dd1d187299f0d504914e734af5790c981531e --- /dev/null +++ b/gen_q_rsm/rsm_libero/pack_r256.sbatch @@ -0,0 +1,18 @@ +#!/bin/bash +#SBATCH --job-name=pack_r256 +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=32 --mem=120G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +PY=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python +export PYTHONUNBUFFERED=1 +# Same 4,500-rollout subset as full_demo (same seed + header cache) so per-episode +# artefacts (subgoal labels, verified mask) stay aligned by index; demos at 256. +$PY $G/pack.py \ + --src /data/pulkitag/users/rli14/pi05_lib10_ogpo_fl15_v1 \ + --demos /data/pulkitag/users/rli14/libero10_demo_ogpo_cache_r256 \ + --out /data/pulkitag/users/rli14/rsm_libero_cache/full_demo_r256 \ + --max-eps 4500 --stride 1 --keep-all-demos --workers 32 --cam-res 256 --seed 0 --header-cache /data/pulkitag/users/rli14/rsm_libero_cache/headers_v2.npz +RC=$?; echo "[pack] rc=$RC $(date -u +%T)"; exit $RC diff --git a/gen_q_rsm/rsm_libero/paired_test.py b/gen_q_rsm/rsm_libero/paired_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e1b441c5581e64006461e0c581f253bb9b3664c8 --- /dev/null +++ b/gen_q_rsm/rsm_libero/paired_test.py @@ -0,0 +1,55 @@ +"""Paired comparison of two closed-loop evals. + +Arms are paired by construction: the env seed depends only on (seed, tid, k), so two +arms run at the same SEED see identical initial conditions. This verifies that from the +recorded init_sha256 and then runs McNemar's exact test on the discordant pairs, which +is the correct test for paired binary outcomes. The unpaired two-proportion z-test used +elsewhere is conservative here and understates real differences. +""" +import json, sys +from math import comb + +def load(p): + """Key on (task, episode index), NOT on init_sha256. + + The env seed is a pure function of (seed, tid, k), so episode k is the same + initial condition in every arm run at the same SEED. init_sha256 hashes raw + float64 sim-state bytes and therefore differs between compute nodes for a + logically identical state, which made it useless as a join key.""" + r = json.load(open(p)) + out, sha = {}, {} + for task, eps in r["episodes_detail"].items(): + for e in eps: + out[(task, e["episode"])] = bool(e["success"]) + sha[(task, e["episode"])] = e.get("init_sha256") + return out, r["pooled_SR"], sha + +def mcnemar(b, c): + """two-sided exact binomial on the discordant pairs""" + n = b + c + if n == 0: + return 1.0 + k = min(b, c) + tail = sum(comb(n, i) for i in range(0, k + 1)) / (2 ** n) + return min(1.0, 2 * tail) + +A, srA, shA = load(sys.argv[1]) +B, srB, shB = load(sys.argv[2]) +shared = set(A) & set(B) +print(f" {sys.argv[1].split('/')[-1][:-5]:26s} SR {srA:.3f} n={len(A)}") +print(f" {sys.argv[2].split('/')[-1][:-5]:26s} SR {srB:.3f} n={len(B)}") +nsha = sum(1 for k in shared if shA.get(k) and shA[k] == shB.get(k)) +print(f" matched episodes: {len(shared)}/{min(len(A),len(B))}" + f" ({'PAIRED' if len(shared)==min(len(A),len(B)) else 'PARTIAL'})" + f" [identical init hash on {nsha}/{len(shared)}" + f"{'' if nsha==len(shared) else ' — rest differ only in float bits across nodes'}]") +if not shared: + print(" no shared inits; arms used different seeds"); raise SystemExit +b = sum(1 for k in shared if A[k] and not B[k]) +c = sum(1 for k in shared if B[k] and not A[k]) +agree = len(shared) - b - c +p = mcnemar(b, c) +d = srA - srB +print(f" concordant {agree} A-only {b} B-only {c}") +print(f" diff {d:+.3f} McNemar exact p = {p:.4g}" + f" {'SIGNIFICANT' if p < 0.05 else 'not significant'} at 0.05") diff --git a/gen_q_rsm/rsm_libero/parl_rsm.py b/gen_q_rsm/rsm_libero/parl_rsm.py new file mode 100644 index 0000000000000000000000000000000000000000..4eb1a34c8995c9acbf5d00fb91e0404d42f98a42 --- /dev/null +++ b/gen_q_rsm/rsm_libero/parl_rsm.py @@ -0,0 +1,305 @@ +"""PARL with the RSM occupancy value: rank proposal samples by Q, distill the argmax. + +Faithful to the lane's PARL recipe (MaxSobolMark/PolicyAgnosticRL action +optimisation): sample N action chunks from a base proposal policy, rank them by +Q, keep the best, and distill those into a fresh head with the ordinary flow +loss. Our Q is the RSM occupancy read-out rather than a TD value. + +Why this is different from the Q-filtering already tried, and why that one was +handicapped: PARL's own note is that it "only helps if the proposal policy's N +samples are DIVERSE -- an overtrained flow collapses to the mean, so there is +nothing to rank". Our behaviour clones are trained 120k steps and then the +checkpoint is selected by BEST held-out sampled reconstruction MSE, which selects +precisely the most mean-collapsed checkpoint. Measured here as `proposal_std`, +which is reported before any distillation so a collapsed proposal is visible +rather than silently wasting the run. + +Selection uses depth 1 by default so the recursion never has to re-draw an action +in a latent the flow only imagined, which a raw-feature policy cannot be queried +for. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import load_critic, make_policy, policy_nll, policy_features, \ + q_recursive, sampled_action_mse +from awr import offline_score + + +@torch.no_grad() +def proposal_diversity(pol, pfeat, d, rng, device, n_states=256, n_samp=16, + temp=1.0, sde=0.0): + """Mean per-dimension std across N samples at a FIXED state. + + This is the quantity PARL lives or dies on. A collapsed proposal gives the + ranker N copies of the same action and the argmax is then meaningless. + """ + b = d.sample_frames(n_states, rng, "val", device) + z = pfeat(b["x"]) + acts = torch.stack([pol.sample(z, b["task"], temp=temp, sde=sde) + for _ in range(n_samp)]) + return float(acts.std(0).mean()), float(b["a"].std()) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--proposal", required=True, help="base policy checkpoint") + ap.add_argument("--out", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--proposal-sde", type=float, default=0.0, + help="noise injected during integration. Unlike temp it " + "follows the learned drift, so candidates stay near " + "the manifold instead of being thrown off it.") + ap.add_argument("--proposal-temp", type=float, default=1.0, + help="scales the proposal's initial noise; >1 widens the " + "candidate set the value ranks over") + ap.add_argument("--n-actions", type=int, default=32, + help="candidates per state (PARL repo default 32)") + ap.add_argument("--select-pool", default="demos", + choices=["demos", "succ", "demos_succ", "all"], + help="states the distillation set is drawn from") + ap.add_argument("--qf-ckpt", default="", + help="rank with the SUPERVISED student Q from rsm_main.py " + "instead of the counterfactual-conditioned occupancy " + "read-out. The student is fit on real (s,a,s') " + "transitions and is the only reader measured to rank " + "actions correctly on this corpus.") + ap.add_argument("--num-keep", type=int, default=4, + help="keep the top-k candidates, not only the arg-max. " + "Distilling a single arg-max concentrates all of the " + "estimator's error into the target.") + ap.add_argument("--margin-quantile", type=float, default=0.7, + help="confidence GATE. Keep only states whose critic margin " + "(best minus median candidate) is above this quantile; " + "apply selection only where the value actually separates " + "candidates, and leave the rest to the anchor. 0 = off.") + ap.add_argument("--include-demos", type=int, default=1, + help="anchor the distillation set on (state, LOGGED demo " + "action) pairs alongside the selected ones. PA-RL's " + "distil set is selected pairs PLUS demonstrations; " + "without the anchor the student has nothing holding it " + "on the demonstration manifold.") + ap.add_argument("--distill-states", type=int, default=200000) + ap.add_argument("--distill-steps", type=int, default=60000) + ap.add_argument("--batch", type=int, default=1024) + ap.add_argument("--lr", type=float, default=3e-4) + ap.add_argument("--beta-q", type=float, default=0.90) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--depth", type=int, default=1) + ap.add_argument("--particles", type=int, default=8) + ap.add_argument("--q-pessimism", type=float, default=2.0) + ap.add_argument("--policy-features", default="raw", choices=["raw", "latent"]) + ap.add_argument("--feat-scale", default="center", choices=["zscore", "center"]) + ap.add_argument("--policy-family", default="concat", + choices=["concat", "flow", "gauss"]) + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--reward-mode", default="dense", choices=["dense", "terminal", "subgoal", "soft"]) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--proposal-sde-anneal", type=int, default=0, + help="1 = anneal --proposal-sde to zero by the last integration step") + ap.add_argument("--rank", default="critic", choices=["critic", "random"], + help="random = keep --num-keep random candidates (critic-free control)") + ap.add_argument("--hop-policy", default="", + help="latent-feature BC checkpoint for hops >= 2 (required if --depth > 1)") + ap.add_argument("--crn", type=int, default=1, + help="common random numbers across candidates when scoring") + ap.add_argument("--save-every", type=int, default=10000, + help="save policy_s.pt during distillation; policy_last.pt is always saved") + args = ap.parse_args() + + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode, + norm_pool=args.norm_pool) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + args.d_z = cfg["d_z"] + qstud = qenc = None + if args.qf_ckpt: + from model import Encoder as _Enc + from rsm_main import QStudent + _ck = torch.load(args.qf_ckpt, map_location=dev, weights_only=False) + _c = _ck["config"] + qenc = _Enc(d.feat_dim, _c["d_z"], _c["enc_width"]).to(dev) + qenc.load_state_dict(_ck["enc"]); qenc.eval() + qstud = QStudent(_c["d_z"], _ck["d_act"], d.n_task).to(dev) + qstud.load_state_dict(_ck["qf"]); qstud.eval() + print(f"[parl] ranking with the SUPERVISED student Q " + f"(arrival AUC {_ck.get('arrival_auc', float('nan')):.4f})", flush=True) + pfeat, d_pol = policy_features(args, enc, d, cfg, dev) + hop = None + if args.depth > 1: + if not args.hop_policy: + raise SystemExit("--depth > 1 needs --hop-policy") + _hk = torch.load(args.hop_policy, map_location=dev, weights_only=False) + class _HA: pass + _ha = _HA(); [setattr(_ha, k, v) for k, v in _hk["config"].items()] + hop = make_policy(_ha, d, dev, d_z=cfg["d_z"]); hop.load_state_dict(_hk["pol"]); hop.eval() + print(f"[parl] hop policy loaded for depth {args.depth}", flush=True) + + pk = torch.load(args.proposal, map_location=dev, weights_only=False) + # the distilled head inherits the proposal's architecture (width/depth) + args.pol_width = int(pk["config"].get("pol_width", 1024) or 1024) + args.pol_depth = int(pk["config"].get("pol_depth", 4) or 4) + base = make_policy(args, d, dev, d_z=d_pol) + base.load_state_dict(pk["pol"]); base.eval() + + rng = np.random.default_rng(args.seed + 31) + std_a, std_data = proposal_diversity(base, pfeat, d, rng, dev, + temp=args.proposal_temp, + sde=args.proposal_sde) + print(f"[parl] proposal action std {std_a:.5f} vs data action std {std_data:.5f} " + f"(ratio {std_a / max(std_data, 1e-9):.3f})", flush=True) + if std_a < 0.02 * std_data: + print("[parl] WARNING: the proposal has collapsed to the mean; ranking " + "N copies of one action cannot improve anything", flush=True) + + ok = {"demos": d.ep_demo, "succ": d.ep_success, + "demos_succ": d.ep_demo | d.ep_success, + "all": np.ones(d.n_ep, bool)}[args.select_pool] + pool = np.array([e for e in d.train_eps if ok[e]], dtype=np.int64) + + # ---- build the distillation set: argmax_a Q(z, a) over N proposal draws ---- + xs, acts, tasks, margins = [], [], [], [] + got, bs = 0, 256 + sel = np.random.default_rng(args.seed + 41) + t_report = 0 + while got < args.distill_states: + w = d.ep_len[pool].astype(np.float64); w /= w.sum() + e = sel.choice(pool, size=bs, p=w) + t = d.ep_from[e] + (sel.random(bs) * (d.ep_to[e] - d.ep_from[e])).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(dev) + tk = torch.from_numpy(d.ep_task[e]).long().to(dev) + with torch.no_grad(): + zc = enc(x) # critic latent for scoring + zp = pfeat(x) # policy features for proposing + cand = torch.stack([base.sample(zp, tk, temp=args.proposal_temp, + sde=args.proposal_sde, + sde_anneal=bool(args.proposal_sde_anneal)) + for _ in range(args.n_actions)]) + N, B, A = cand.shape + qs = [] + zq = qenc(x) if qstud is not None else None + _seed_i = int(args.seed * 1000003 + got) + for i in range(N): + if args.crn: + torch.manual_seed(_seed_i) # same MC noise for every candidate of this batch + if qstud is not None: + q = qstud(zq, cand[i], tk) + else: + q, _ = q_recursive(zc, cand[i], tk, rew=rew, flow=flow, rms=rms, + pol=hop, wend=None, beta=args.beta_q, + gamma=args.gamma, depth=args.depth, + n_particles=args.particles, use_is=False, + pessimism=args.q_pessimism) + qs.append(q) + Q = torch.stack(qs) # [N, B] + k = max(1, min(args.num_keep, Q.shape[0])) + if args.rank == "random": + topk = torch.stack([torch.randperm(N, device=dev)[:k] for _ in range(B)], 1) # [k, B] + else: + topk = Q.topk(k, dim=0).indices # [k, B] + # margin: how far the best candidate stands above the typical one. + # Small margin means the value does not separate the candidates here. + margin = Q.max(0).values - Q.median(0).values # [B] + ar = torch.arange(B, device=dev) + for j in range(k): + xs.append(x.cpu()); acts.append(cand[topk[j], ar].cpu()) + tasks.append(tk.cpu()); margins.append(margin.cpu()) + got += bs + if got - t_report >= 25600: + t_report = got + print(f"[parl] selected {got}/{args.distill_states}", flush=True) + X = torch.cat(xs); A_ = torch.cat(acts); T = torch.cat(tasks) + Mg = torch.cat(margins) + if args.margin_quantile > 0: + thr = torch.quantile(Mg, args.margin_quantile) + keep = Mg >= thr + print(f"[parl] margin gate q={args.margin_quantile} thr={float(thr):.4f} " + f"keeps {int(keep.sum())}/{len(keep)}", flush=True) + X, A_, T = X[keep], A_[keep], T[keep] + n_sel = len(X) + if args.include_demos: + # the anchor: raw (state, LOGGED action) pairs from demonstrations + dm = np.array([e for e in d.train_eps if d.ep_demo[e]], dtype=np.int64) + ax, aa, at = [], [], [] + need, dr = max(n_sel, 1), np.random.default_rng(args.seed + 51) + while sum(len(t) for t in ax) < need: + w = d.ep_len[dm].astype(np.float64); w /= w.sum() + e = dr.choice(dm, size=1024, p=w) + t = d.ep_from[e] + (dr.random(1024) * (d.ep_to[e] - d.ep_from[e])).astype(np.int64) + ax.append(torch.from_numpy(d._feat(t))) + aa.append(torch.from_numpy(d._chunk_at(t, e))) + at.append(torch.from_numpy(d.ep_task[e]).long()) + X = torch.cat([X] + ax); A_ = torch.cat([A_] + aa); T = torch.cat([T] + at) + print(f"[parl] demo anchor: {len(X) - n_sel} demo pairs + {n_sel} selected " + f"= {len(X)} ({100.0 * (len(X) - n_sel) / len(X):.1f}% demo share)", + flush=True) + print(f"[parl] distillation set {tuple(X.shape)} from {args.select_pool}", flush=True) + + # ---- distill a FRESH head onto the selected actions ---- + new = make_policy(args, d, dev, d_z=d_pol) + opt = torch.optim.Adam(new.parameters(), lr=args.lr) + ev = np.random.default_rng(args.seed + 77) + best_mse, best_sd, best_step = float("inf"), None, 0 + for step in range(1, args.distill_steps + 1): + idx = torch.randint(0, len(X), (args.batch,)) + xb = X[idx].to(dev); ab = A_[idx].to(dev); tb = T[idx].to(dev) + loss = policy_nll(new, pfeat(xb), tb, ab) + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(new.parameters(), 1.0); opt.step() + if step % max(1, args.distill_steps // 20) == 0 or step == args.distill_steps: + new.eval() + m = sampled_action_mse(new, d, pfeat, ev, dev, ok) + new.train() + tag = "" + if m == m and m < best_mse: + best_mse, best_step = m, step + best_sd = {k: v.detach().clone() for k, v in new.state_dict().items()} + tag = " <- best" + print(f"[parl] distill {step} loss={float(loss):.4f} " + f"sampled_mse_vs_LOGGED={m:.5f}{tag}", flush=True) + if args.save_every and step % args.save_every == 0: + torch.save({"pol": new.state_dict(), "round": 1, "step": step, "config": vars(args), + "cam_res": getattr(d, "cam_res", "UNKNOWN"), "encoder": getattr(d, "encoder", "pi05_base_pytorch")}, out / f"policy_s{step}.pt") + # The LAST distilled head is the deployable one: the logged-action MSE proxy selects + # AGAINST the Q-preferred actions PARL is supposed to move toward (and picked a + # checkpoint 0.10 SR below the last one for plain BC). policy_r1.pt keeps the + # proxy-best for comparison; select between them on validation inits. + torch.save({"pol": new.state_dict(), "round": 1, "step": args.distill_steps, "config": vars(args), + "cam_res": getattr(d, "cam_res", "UNKNOWN"), "encoder": getattr(d, "encoder", "pi05_base_pytorch"), + "note": "LAST distilled checkpoint"}, out / "policy_last.pt") + if best_sd is not None: + new.load_state_dict(best_sd) + new.eval() + + torch.save({"pol": new.state_dict(), "round": 1, "config": vars(args), + "cam_res": getattr(d, "cam_res", "UNKNOWN"), "encoder": getattr(d, "encoder", "pi05_base_pytorch")}, + out / "policy_r1.pt") + sc = offline_score(d, enc, new, np.random.default_rng(args.seed + 23), dev, + pfeat=pfeat) + sc["proposal_action_std"] = std_a + sc["data_action_std"] = std_data + # NOTE: sampled_mse against the LOGGED action is not the objective here -- a + # working PARL run should move AWAY from the logged action toward the + # Q-preferred one, so a higher value is expected and is not a failure. + (out / "parl.json").write_text(json.dumps( + {"config": vars(args), "score": sc, "best_distill_step": best_step}, + indent=2)) + print(f"[parl] {sc}", flush=True) + print("[parl] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/pooled_test.py b/gen_q_rsm/rsm_libero/pooled_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d065243928d079355e8e9c12b1f8c7406992d23b --- /dev/null +++ b/gen_q_rsm/rsm_libero/pooled_test.py @@ -0,0 +1,25 @@ +"""Pool paired McNemar counts across seeds. Each seed is an independent draw of +500 initial conditions on protocol B, so discordant pairs add.""" +import json, sys +from math import comb, sqrt, erfc +def counts(pa, pb): + def load(p): + r=json.load(open(p)); o={} + for t,eps in r["episodes_detail"].items(): + for e in eps: o[(t,e["episode"])]=bool(e["success"]) + return o, r["pooled_SR"] + A,sa=load(pa); B,sb=load(pb); sh=set(A)&set(B) + return (sum(1 for k in sh if A[k] and not B[k]), + sum(1 for k in sh if B[k] and not A[k]), len(sh), sa, sb) +B=C=N=0; srs=[] +for i in range(1,len(sys.argv),2): + b,c,n,sa,sb = counts(sys.argv[i], sys.argv[i+1]) + B+=b; C+=c; N+=n; srs.append((sa,sb)) + print(f" seed pair {i//2}: SR {sa:.3f} vs {sb:.3f} b={b} c={c} diff {sa-sb:+.3f}") +z=(B-C)/sqrt(B+C) if B+C else 0.0 +p=erfc(abs(z)/sqrt(2)) +msr=sum(a for a,_ in srs)/len(srs); mbs=sum(b for _,b in srs)/len(srs) +print(f"\n POOLED over {len(srs)} seeds, {N} paired episodes") +print(f" mean SR {msr:.3f} vs {mbs:.3f} diff {msr-mbs:+.3f}") +print(f" discordant b={B} c={C} z={z:.2f} p={p:.4f} " + f"{'SIGNIFICANT' if p<0.05 else 'NOT significant'} at 0.05") diff --git a/gen_q_rsm/rsm_libero/probe_actcon.py b/gen_q_rsm/rsm_libero/probe_actcon.py new file mode 100644 index 0000000000000000000000000000000000000000..f355db89470063931af07e049ed7548d0204881e --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_actcon.py @@ -0,0 +1,95 @@ +"""Which negative does the action-contrast term actually need? + +Two candidate negatives for the flow-matching error at a state z: + (A) shuffle the ACTION only (s, a_rand, s') <- what we implement + (B) shuffle the action AND the target (s, a_rand, s'_rand) + +(B) is the intuitive reading, but it confounds two effects. Its error is large +partly because the conditioning action is wrong and partly because the TARGET is +an unrelated future. A successor that ignores the action entirely still scores +well on (B), because predicting the true future from z is easy and predicting an +unrelated one is hard -- which is exactly the failure the term exists to prevent. + +This measures the decomposition on a trained critic: + e_pos true action, true target + e_act shuffled action, TRUE target -> isolates the action + e_both shuffled action, shuffled target -> action + target confounded + e_tgt TRUE action, shuffled target -> isolates the target +If (e_both - e_pos) is dominated by (e_tgt - e_pos), then (B) is mostly a +target-mismatch test and says little about action sensitivity. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import load_critic + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--beta", type=float, default=0.90) + ap.add_argument("--batch", type=int, default=4096) + ap.add_argument("--reps", type=int, default=8) + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + torch.manual_seed(args.seed) + dev = "cuda" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode="dense", + norm_pool=args.norm_pool) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + rng = np.random.default_rng(args.seed + 13) + acc = {k: 0.0 for k in ("pos", "act", "both", "tgt")} + with torch.no_grad(): + for _ in range(args.reps): + b = d.sample(args.batch, rng, args.beta, args.beta, "val", dev) + z = enc(b["x_now"]); zf = enc(b["x_fut"]) + y = (zf - z) / rms # true normalised residual + k = torch.rand(args.batch, device=dev) + noise = torch.randn_like(y) + x_k = (1 - k)[:, None] * y + k[:, None] * noise + u = y - noise + p = torch.randperm(args.batch, device=dev) + a_t, a_r = b["a_now"], b["a_now"][p] + # shuffled TARGET: rebuild the path from the permuted residual + y_r = y[p]; n_r = noise[p] + x_k_r = (1 - k)[:, None] * y_r + k[:, None] * n_r + u_r = y_r - n_r + + def err(a, xk, tgt): + return (flow(z, a, b["task"], b["beta"], xk, k) + - tgt).pow(2).mean(-1).mean() + acc["pos"] += float(err(a_t, x_k, u)) + acc["act"] += float(err(a_r, x_k, u)) # action only + acc["both"] += float(err(a_r, x_k_r, u_r)) # action + target + acc["tgt"] += float(err(a_t, x_k_r, u_r)) # target only + for kk in acc: + acc[kk] /= args.reps + print(f"\n{'negative':<34s} {'flow-matching error':>20s} {'gap vs true':>13s}") + print(f"{'(true action, true target)':<34s} {acc['pos']:20.5f} {0.0:13.5f}") + print(f"{'A: shuffled ACTION, true target':<34s} {acc['act']:20.5f} " + f"{acc['act'] - acc['pos']:+13.5f}") + print(f"{' true action, shuffled target':<34s} {acc['tgt']:20.5f} " + f"{acc['tgt'] - acc['pos']:+13.5f}") + print(f"{'B: shuffled action AND target':<34s} {acc['both']:20.5f} " + f"{acc['both'] - acc['pos']:+13.5f}") + ga, gb = acc["act"] - acc["pos"], acc["both"] - acc["pos"] + gt = acc["tgt"] - acc["pos"] + print(f"\naction-only gap as a share of the both-shuffled gap: " + f"{100.0 * ga / gb:.1f}%" if gb else "") + print(f"target-only gap as a share of the both-shuffled gap: " + f"{100.0 * gt / gb:.1f}%" if gb else "") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/probe_action_info.py b/gen_q_rsm/rsm_libero/probe_action_info.py new file mode 100644 index 0000000000000000000000000000000000000000..e2ed7896cb7a8e9a74f36919134390950265a6f4 --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_action_info.py @@ -0,0 +1,97 @@ +"""Does the ACTION carry outcome information beyond the state, in this corpus? + +Everything in this lane hinges on it. The RSM Q takes its action dependence from +the occupancy model extrapolating to actions never observed at that state, which +is unsupervised in the action direction, and was measured to have arbitrary sign. +A directly supervised head has that dependence SUPERVISED by real outcomes. + +Two heads, same latent, same data, same budget, held-out AUC against episode +success: + V(z) state only + Q(z, a) state and the logged action chunk +If Q does not beat V, the action carries nothing beyond the state at this +granularity and NO critic of any kind can rank actions here -- the ceiling is the +data, not the model. If Q does beat V, the action signal exists and the defect is +the occupancy model's extrapolation, which is fixable. + +Reported on rollouts (which contain failures); demonstrations alone are almost +all successes and cannot answer the question. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse +import numpy as np +import torch +import torch.nn.functional as F + +from data import LiberoRSMData +from is_ope import load_critic +from model import mlp +from train_rsm import auc + + +def train_head(d, enc, dev, use_action, steps, batch, lr, seed, tag): + torch.manual_seed(seed) + d_act = d.chunk * d.adim + din = 264 + (d_act if use_action else 0) + net = mlp([din, 1024, 1024, 1], norm=True).to(dev) + emb = torch.nn.Embedding(d.n_task, 0).to(dev) # task enters via the latent + opt = torch.optim.Adam(net.parameters(), lr=lr) + rng = np.random.default_rng(seed + 3) + for step in range(1, steps + 1): + b = d.sample_frames(batch, rng, "train", dev) + with torch.no_grad(): + z = enc(b["x"]) + x = torch.cat([z, b["a"]], -1) if use_action else z + loss = F.binary_cross_entropy_with_logits(net(x).squeeze(-1), b["succ"]) + opt.zero_grad(); loss.backward(); opt.step() + if step % max(1, steps // 5) == 0: + print(f" [{tag}] {step} bce={float(loss):.4f}", flush=True) + # held-out AUC against EPISODE success + net.eval() + ev = np.random.default_rng(seed + 77) + P, Y = [], [] + with torch.no_grad(): + for _ in range(8): + b = d.sample_frames(2048, ev, "val", dev) + z = enc(b["x"]) + x = torch.cat([z, b["a"]], -1) if use_action else z + P.append(torch.sigmoid(net(x).squeeze(-1)).cpu().numpy()) + Y.append(b["succ"].cpu().numpy()) + return float(auc(np.concatenate(P), np.concatenate(Y))) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--steps", type=int, default=20000) + ap.add_argument("--batch", type=int, default=1024) + ap.add_argument("--lr", type=float, default=3e-4) + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + dev = "cuda" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode="dense", + norm_pool=args.norm_pool) + enc, _r, _f, _rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + print(f"[probe] corpus success rate {float(d.ep_success.mean()):.3f}", flush=True) + a_v = train_head(d, enc, dev, False, args.steps, args.batch, args.lr, + args.seed, "V(z)") + a_q = train_head(d, enc, dev, True, args.steps, args.batch, args.lr, + args.seed, "Q(z,a)") + print(f"\nheld-out AUC vs episode success") + print(f" V(z) state only {a_v:.4f}") + print(f" Q(z,a) state and action {a_q:.4f}") + print(f" delta {a_q - a_v:+.4f}") + print("\ndelta ~ 0 means the action adds nothing beyond the state at this " + "granularity, and no critic can rank actions on this corpus.", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/probe_crn.py b/gen_q_rsm/rsm_libero/probe_crn.py new file mode 100644 index 0000000000000000000000000000000000000000..085b28516f2b3b3b5f36c991953ae86653062de2 --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_crn.py @@ -0,0 +1,105 @@ +"""Is Q blind to the action, or is its ESTIMATOR too noisy to see the action? + +q_recursive draws fresh flow noise on every call, so comparing Q(a1) with Q(a2) +compares two noisy Monte-Carlo estimates. If the per-call noise is larger than the +effect an action has, the comparison is pure coin-flip -- which is exactly what +probe_perturb saw (expert wins 0.483-0.508, mean Q moving 1% when the action is +destroyed). That is equally consistent with "Q ignores the action" and with "the +estimator cannot resolve the action". + +This separates them: + repeat noise |Q(a) - Q'(a)| same action, INDEPENDENT noise + paired effect |Q(a) - Q(a+e)| different action, COMMON noise (CRN) +If the paired effect is comparable to or larger than the repeat noise, the signal +is there and was being drowned; common random numbers recover it. If the paired +effect is ~0 under CRN, the model genuinely ignores the action. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import load_critic +from train_rsm import sample_future + + +def q_fixed_noise(enc_z, a, tk, *, rew, flow, rms, beta, gamma, n_particles, + flow_steps, noise): + """Q with the flow's initial noise SUPPLIED, so candidates share it.""" + B, D = enc_z.shape + z = enc_z.repeat_interleave(n_particles, 0) + aa = a.repeat_interleave(n_particles, 0) + t = tk.repeat_interleave(n_particles, 0) + bq = torch.full((z.shape[0],), beta, device=z.device) + x = noise.clone() + for s in range(flow_steps): + k = torch.full((z.shape[0],), 1.0 - s / flow_steps, device=z.device) + x = x + flow(z, aa, t, bq, x, k) / flow_steps + z_end = z + x * rms + r = torch.sigmoid(rew(z_end, t)).view(B, n_particles) + return r.mean(1) / (1 - gamma) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--beta-q", type=float, default=0.90) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--flow-steps", type=int, default=8) + ap.add_argument("--n", type=int, default=1024) + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + + torch.manual_seed(args.seed) + dev = "cuda" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode="dense", + norm_pool=args.norm_pool) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + pool = np.array([e for e in d.val_eps if d.ep_demo[e]], dtype=np.int64) + if not len(pool): + pool = np.array([e for e in d.train_eps if d.ep_demo[e]], dtype=np.int64) + rng = np.random.default_rng(args.seed + 9) + w = d.ep_len[pool].astype(np.float64); w /= w.sum() + e = rng.choice(pool, size=args.n, p=w) + t = d.ep_from[e] + (rng.random(args.n) * (d.ep_to[e] - d.ep_from[e])).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(dev) + a0 = torch.from_numpy(d._chunk_at(t, e)).to(dev) + tk = torch.from_numpy(d.ep_task[e]).long().to(dev) + + with torch.no_grad(): + z = enc(x) + D = z.shape[1] + kw = dict(rew=rew, flow=flow, rms=rms, beta=args.beta_q, gamma=args.gamma, + n_particles=args.particles, flow_steps=args.flow_steps) + n1 = torch.randn(args.n * args.particles, D, device=dev) + n2 = torch.randn(args.n * args.particles, D, device=dev) + q_a = q_fixed_noise(z, a0, tk, noise=n1, **kw) + q_b = q_fixed_noise(z, a0, tk, noise=n2, **kw) + repeat = (q_a - q_b).abs().mean() + print(f"repeat noise, same action different noise : {float(repeat):.5f}") + print(f"{'noise':>7s} {'|dQ| CRN':>10s} {'expert wins CRN':>16s} " + f"{'|dQ|/repeat':>12s}") + for sig in (0.1, 0.2, 0.4, 0.8): + q_p = q_fixed_noise(z, a0 + sig * torch.randn_like(a0), tk, + noise=n1, **kw) # COMMON noise + dq = (q_a - q_p) + win = float((dq > 0).float().mean()) + print(f"{sig:7.2f} {float(dq.abs().mean()):10.5f} {win:16.3f} " + f"{float(dq.abs().mean() / repeat.clamp_min(1e-9)):12.2f}", + flush=True) + print("\nexpert wins CRN > 0.5 means the model DOES prefer the expert action " + "once the shared noise is removed.", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/probe_inits.py b/gen_q_rsm/rsm_libero/probe_inits.py new file mode 100644 index 0000000000000000000000000000000000000000..fdf86c1210f2a7a2f284d115f6b748adcb17496c --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_inits.py @@ -0,0 +1,46 @@ +"""Characterise the two initial-condition distributions the evaluator can use. + +Protocol A replays LIBERO's 50 stored init states; protocol B lets the task's BDDL +placement region resample. Both are full sim-state vectors, so they are directly +comparable. Reports, per task, how much each distribution actually spreads and +whether A's 50 states are a subset of B's support. +""" +import os, sys, numpy as np +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from libero.libero import benchmark, get_libero_path +from libero.libero.envs import OffScreenRenderEnv +from pathlib import Path + +bench = benchmark.get_benchmark_dict()["libero_10"]() +rows = [] +for tid in range(10): + task = bench.get_task(tid) + env = OffScreenRenderEnv( + bddl_file_name=str(Path(get_libero_path("bddl_files")) + / task.problem_folder / task.bddl_file), + camera_heights=128, camera_widths=128) + inits = np.asarray(bench.get_task_init_states(tid)) # protocol A + fresh = [] + for k in range(50): # protocol B, eval seeds + env.seed(0 * 100003 + tid * 1009 + k) + env.reset() + fresh.append(np.asarray(env.env.sim.get_state().flatten())) + fresh = np.stack(fresh) + n = min(inits.shape[1], fresh.shape[1]) + A, B = inits[:, :n], fresh[:, :n] + # dims that actually vary in either protocol = the randomised object DoF + var = (A.std(0) > 1e-6) | (B.std(0) > 1e-6) + sa, sb = A[:, var].std(0), B[:, var].std(0) + # is every stock state inside the fresh support? + lo, hi = B[:, var].min(0), B[:, var].max(0) + inside = ((A[:, var] >= lo - 1e-6) & (A[:, var] <= hi + 1e-6)).all(1).mean() + rows.append((tid, task.name[:34], int(var.sum()), sa.mean(), sb.mean(), inside)) + print(f"t{tid} {task.name[:34]:34s} varying_dof={int(var.sum()):3d} " + f"std_stock={sa.mean():.4f} std_fresh={sb.mean():.4f} " + f"stock_inside_fresh_support={inside:.2f}", flush=True) + env.close() +print() +print(f"MEAN std_stock={np.mean([r[3] for r in rows]):.4f} " + f"std_fresh={np.mean([r[4] for r in rows]):.4f} " + f"ratio={np.mean([r[4] for r in rows])/max(np.mean([r[3] for r in rows]),1e-9):.2f}x " + f"stock_inside={np.mean([r[5] for r in rows]):.2f}") diff --git a/gen_q_rsm/rsm_libero/probe_inits.sbatch b/gen_q_rsm/rsm_libero/probe_inits.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..8f380172f6aceae582026565487b28ee2bf5598c --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_inits.sbatch @@ -0,0 +1,17 @@ +#!/bin/bash +#SBATCH --job-name=probe_inits +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=4 +#SBATCH --mem=32G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +PY=$B/venvs/rlinf-libero-eval-venv/bin/python +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl PYTHONUNBUFFERED=1 +_G="$(echo "${CUDA_VISIBLE_DEVICES:-0}" | cut -d, -f1)" +export MUJOCO_EGL_DEVICE_ID="$_G" EGL_DEVICE_ID="$_G" +$PY /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/probe_inits.py diff --git a/gen_q_rsm/rsm_libero/probe_inits2.py b/gen_q_rsm/rsm_libero/probe_inits2.py new file mode 100644 index 0000000000000000000000000000000000000000..a75d29fe0353eb974d93872c4bd35f92ff6135d6 --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_inits2.py @@ -0,0 +1,39 @@ +"""Exactly what each protocol randomises: per-DoF comparison + the sampler ranges.""" +import os, sys, numpy as np +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from libero.libero import benchmark, get_libero_path +from libero.libero.envs import OffScreenRenderEnv +from pathlib import Path + +bench = benchmark.get_benchmark_dict()["libero_10"]() +for tid in [0, 3]: + task = bench.get_task(tid) + env = OffScreenRenderEnv( + bddl_file_name=str(Path(get_libero_path("bddl_files")) + / task.problem_folder / task.bddl_file), + camera_heights=128, camera_widths=128) + print(f"\n===== t{tid} {task.name} =====") + pi = env.env.placement_initializer + for smp in getattr(pi, "samplers", {}).values() if hasattr(pi, "samplers") else []: + xr = getattr(smp, "x_range", None); yr = getattr(smp, "y_range", None) + rot = getattr(smp, "rotation", None) + if xr is None: continue + xs = float(np.ptp(np.asarray(xr))); ys = float(np.ptp(np.asarray(yr))) + print(f" sampler {smp.name[:38]:38s} x-span {xs*100:6.2f} cm y-span {ys*100:6.2f} cm rot {rot}") + inits = np.asarray(bench.get_task_init_states(tid)) + fresh = [] + for k in range(50): + env.seed(tid*1009 + k); env.reset() + fresh.append(np.asarray(env.env.sim.get_state().flatten())) + fresh = np.stack(fresh) + n = min(inits.shape[1], fresh.shape[1]); A, B = inits[:, :n], fresh[:, :n] + va, vb = A.std(0) > 1e-6, B.std(0) > 1e-6 + both, only_a, only_b = va & vb, va & ~vb, vb & ~va + print(f" DoF varying in BOTH: {both.sum():3d} stdA {A[:,both].std(0).mean():.4f} " + f"stdB {B[:,both].std(0).mean():.4f}") + print(f" DoF varying in STOCK ONLY (A randomises, B holds fixed): {only_a.sum():3d}" + f" stdA {A[:,only_a].std(0).mean() if only_a.any() else 0:.4f}") + print(f" DoF varying in FRESH ONLY: {only_b.sum():3d}") + nq = env.env.sim.model.nq + print(f" (nq={nq}; robot joints are the first ~7-9 dims, objects are free joints after)") + env.close() diff --git a/gen_q_rsm/rsm_libero/probe_inits2.sbatch b/gen_q_rsm/rsm_libero/probe_inits2.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..449ab30216af74856425de93022034bb35c9246b --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_inits2.sbatch @@ -0,0 +1,15 @@ +#!/bin/bash +#SBATCH --job-name=probe_inits2 +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 --cpus-per-task=4 --mem=32G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl PYTHONUNBUFFERED=1 +_G="$(echo "${CUDA_VISIBLE_DEVICES:-0}" | cut -d, -f1)" +export MUJOCO_EGL_DEVICE_ID="$_G" EGL_DEVICE_ID="$_G" +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/probe_inits2.py diff --git a/gen_q_rsm/rsm_libero/probe_perturb.py b/gen_q_rsm/rsm_libero/probe_perturb.py new file mode 100644 index 0000000000000000000000000000000000000000..cc8552cafa865f8bb464f69f537cacbd8654bbbb --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_perturb.py @@ -0,0 +1,81 @@ +"""Does Q prefer the EXPERT action over noisy perturbations of it? + +This is the question PARL actually asks, and it has unambiguous ground truth: on +a demonstration frame the logged chunk IS the good action, and adding noise can +only make it worse. The earlier action-gap probe compared the logged action +against a DIFFERENT episode's action, which is dominated by on-support versus +off-support and says little about ranking candidates near the mode. + +Reports, per noise scale: the fraction of states where Q ranks the expert action +above the perturbed one, and mean Q as a function of noise. If mean Q RISES with +noise the critic is inverted, and the fix is a sign, not more training. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import load_critic, q_recursive + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--beta-q", type=float, default=0.90) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--depth", type=int, default=1) + ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--n", type=int, default=1024) + ap.add_argument("--pool", default="demos", choices=["demos", "succ", "all"]) + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--pessimism", type=float, default=0.0) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + + torch.manual_seed(args.seed) + dev = "cuda" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode="dense", + norm_pool=args.norm_pool) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, + dev, data=d) + ok = {"demos": d.ep_demo, "succ": d.ep_success, + "all": np.ones(d.n_ep, bool)}[args.pool] + pool = np.array([e for e in d.val_eps if ok[e]], dtype=np.int64) + if not len(pool): + pool = np.array([e for e in d.train_eps if ok[e]], dtype=np.int64) + rng = np.random.default_rng(args.seed + 9) + w = d.ep_len[pool].astype(np.float64); w /= w.sum() + e = rng.choice(pool, size=args.n, p=w) + t = d.ep_from[e] + (rng.random(args.n) * (d.ep_to[e] - d.ep_from[e])).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(dev) + a0 = torch.from_numpy(d._chunk_at(t, e)).to(dev) + tk = torch.from_numpy(d.ep_task[e]).long().to(dev) + + def Q(a): + q, _ = q_recursive(enc(x), a, tk, rew=rew, flow=flow, rms=rms, pol=None, + wend=None, beta=args.beta_q, gamma=args.gamma, + depth=args.depth, n_particles=args.particles, + use_is=False, pessimism=args.pessimism) + return q + + with torch.no_grad(): + q0 = Q(a0) + print(f"expert action: mean Q {float(q0.mean()):+.5f}", flush=True) + print(f"{'noise':>7s} {'mean Q':>10s} {'expert wins':>12s}") + for sig in (0.05, 0.1, 0.2, 0.4, 0.8): + qn = Q(a0 + sig * torch.randn_like(a0)) + win = float((q0 > qn).float().mean()) + print(f"{sig:7.2f} {float(qn.mean()):+10.5f} {win:12.3f}", flush=True) + print("\nexpert wins > 0.5 = the critic prefers the expert action.", flush=True) + print("mean Q RISING with noise = the critic is inverted.", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/probe_pessimism.py b/gen_q_rsm/rsm_libero/probe_pessimism.py new file mode 100644 index 0000000000000000000000000000000000000000..13a8593b4e34a92bacaea1502954a2f7fda91059 --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_pessimism.py @@ -0,0 +1,73 @@ +"""Does a disagreement penalty fix the critic's inverted action ranking? + +Measures the held-out action win rate -- how often Q ranks the action actually +taken above a different action taken in the SAME task -- as a function of the +pessimism coefficient. Within-task negatives on purpose: cross-task negatives +measure support violation, not preference. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import load_critic, q_recursive, train_bc, policy_features + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--beta-q", type=float, default=0.90) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--depth", type=int, default=3) + ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--n", type=int, default=1024) + ap.add_argument("--batch", type=int, default=256) + ap.add_argument("--bc-steps", type=int, default=4000) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--policy-family", default="concat") + args = ap.parse_args() + torch.manual_seed(args.seed) + dev = "cuda" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode="dense") + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, dev, data=d) + args.d_z = cfg["d_z"] + # continuation policy in the critic's latent space, as the recursion needs + cont = train_bc(d, enc, args, dev, only_success=True, steps=args.bc_steps) + + rng = np.random.default_rng(args.seed + 5) + b = d.sample_frames(args.n, rng, "val", dev) + # within-task negative: another frame's action chunk from the SAME task + task = b["task"].cpu().numpy() + perm = np.arange(len(task)) + for t in np.unique(task): + idx = np.where(task == t)[0] + perm[idx] = rng.permutation(idx) + a_neg = b["a"][torch.from_numpy(perm).to(dev)] + + with torch.no_grad(): + z = enc(b["x"]) + print(f"{'pessimism':>10s} {'win rate':>9s} {'gap':>10s}") + for pe in (0.0, 0.5, 1.0, 2.0, 4.0): + qp, _ = q_recursive(z, b["a"], b["task"], rew=rew, flow=flow, rms=rms, + pol=cont, wend=None, beta=args.beta_q, + gamma=args.gamma, depth=args.depth, + n_particles=args.particles, use_is=False, + pessimism=pe) + qn, _ = q_recursive(z, a_neg, b["task"], rew=rew, flow=flow, rms=rms, + pol=cont, wend=None, beta=args.beta_q, + gamma=args.gamma, depth=args.depth, + n_particles=args.particles, use_is=False, + pessimism=pe) + win = float((qp > qn).float().mean()) + print(f"{pe:10.1f} {win:9.3f} {float((qp - qn).mean()):+10.5f}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/probe_qf.py b/gen_q_rsm/rsm_libero/probe_qf.py new file mode 100644 index 0000000000000000000000000000000000000000..a8dc50e5a32e27c176decf45a7882b480d8707e5 --- /dev/null +++ b/gen_q_rsm/rsm_libero/probe_qf.py @@ -0,0 +1,76 @@ +"""Does main's SUPERVISED student Q rank actions where our counterfactual Q cannot? + +Same test as probe_perturb/probe_crn, applied to qf(z,a) from rsm_main.py. qf is +fit by regression onto r + gamma(1-done)V(s') using the REAL logged s', so its +action dependence is supervised rather than extrapolated. It is also +deterministic, so there is no sampling noise to cancel -- the comparison is exact. + +expert wins > 0.5 means it prefers the expert chunk over a perturbation of it. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse +import numpy as np +import torch + +from data import LiberoRSMData +from model import Encoder +from rsm_main import QStudent + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--ckpt", required=True) + ap.add_argument("--n", type=int, default=2048) + ap.add_argument("--pool", default="demos", choices=["demos", "succ", "all"]) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + dev = "cuda" + ck = torch.load(args.ckpt, map_location=dev, weights_only=False) + c = ck["config"] + d = LiberoRSMData(args.cache, chunk=c["chunk"], k_success=c["k_success"], + seed=args.seed, in_ram=bool(args.in_ram), + reward_mode="terminal", norm_pool=c["norm_pool"]) + enc = Encoder(d.feat_dim, c["d_z"], c["enc_width"]).to(dev) + enc.load_state_dict(ck["enc"]); enc.eval() + qf = QStudent(c["d_z"], ck["d_act"], d.n_task).to(dev) + qf.load_state_dict(ck["qf"]); qf.eval() + + ok = {"demos": d.ep_demo, "succ": d.ep_success, + "all": np.ones(d.n_ep, bool)}[args.pool] + pool = np.array([e for e in d.val_eps if ok[e]], dtype=np.int64) + if not len(pool): + pool = np.array([e for e in d.train_eps if ok[e]], dtype=np.int64) + rng = np.random.default_rng(args.seed + 9) + w = d.ep_len[pool].astype(np.float64); w /= w.sum() + e = rng.choice(pool, size=args.n, p=w) + t = d.ep_from[e] + (rng.random(args.n) * (d.ep_to[e] - d.ep_from[e])).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(dev) + a0 = torch.from_numpy(d._chunk_at(t, e)).to(dev) + tk = torch.from_numpy(d.ep_task[e]).long().to(dev) + + with torch.no_grad(): + z = enc(x) + q0 = qf(z, a0, tk) + print(f"expert chunk: mean Q {float(q0.mean()):+.4f} sd {float(q0.std()):.4f}") + print(f"{'noise':>7s} {'mean Q':>10s} {'expert wins':>12s} {'mean dQ':>10s}") + for sig in (0.05, 0.1, 0.2, 0.4, 0.8): + qn = qf(z, a0 + sig * torch.randn_like(a0), tk) + print(f"{sig:7.2f} {float(qn.mean()):+10.4f} " + f"{float((q0 > qn).float().mean()):12.3f} " + f"{float((q0 - qn).mean()):+10.4f}", flush=True) + # in-support control: a real chunk from a DIFFERENT frame of the same task + tt = tk.cpu().numpy(); perm = np.arange(len(tt)) + for task in np.unique(tt): + idx = np.where(tt == task)[0] + perm[idx] = rng.permutation(idx) + qo = qf(z, a0[torch.from_numpy(perm).to(dev)], tk) + print(f"\nwithin-task other real chunk: expert wins " + f"{float((q0 > qo).float().mean()):.3f}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/proposer_bias_diag.py b/gen_q_rsm/rsm_libero/proposer_bias_diag.py new file mode 100644 index 0000000000000000000000000000000000000000..b1a52ecbfa1ec085e54a8bf0e78f470754e547b0 --- /dev/null +++ b/gen_q_rsm/rsm_libero/proposer_bias_diag.py @@ -0,0 +1,105 @@ +"""Does the critic prefer one PROPOSER's action style regardless of state? + +At held-out frames, grouped by where they come from (demo episodes, successful +rollouts, failed rollouts), draw N chunks from the BC-demos policy and N from the +BC-successes policy and score every chunk with the same recursive Q the closed-loop +mixed arms use. Reports, per frame source: mean Q by proposer, how often the +arg-max over the 2N pool lands on a successes chunk, and the Q of the logged action. + +A critic that evaluates ACTIONS should prefer neither proposer on the demo frames +(where the demos policy is at home) in particular. A critic that identifies the +POLICY from the action style prefers the successes proposer everywhere, because the +demos are <1% of the frames it was fit on. + +usage: proposer_bias_diag.py --cache ... --critic ... --hop-policy ... --pol1 + --pol2 [--n 8 --frames 512 --beta 0.95 --depth 3 --particles 16] +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +import numpy as np +import torch +from data import LiberoRSMData +from is_ope import load_critic, make_policy, policy_features, q_recursive + + +def load_pol(path, d, dev, d_pol): + pk = torch.load(path, map_location=dev, weights_only=False) + class _A: pass + a = _A(); [setattr(a, k, v) for k, v in pk["config"].items()] + a.pol_width = int(pk["config"].get("pol_width", 1024) or 1024) + a.pol_depth = int(pk["config"].get("pol_depth", 4) or 4) + pol = make_policy(a, d, dev, d_z=d_pol); pol.load_state_dict(pk["pol"]); pol.eval() + return pol + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True); ap.add_argument("--critic", required=True) + ap.add_argument("--hop-policy", default=""); ap.add_argument("--pol1", required=True) + ap.add_argument("--pol2", required=True); ap.add_argument("--out", required=True) + ap.add_argument("--n", type=int, default=8); ap.add_argument("--frames", type=int, default=512) + ap.add_argument("--beta", type=float, default=0.95); ap.add_argument("--gamma", type=float, default=0.98) + ap.add_argument("--depth", type=int, default=3); ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--norm-pool", default="all"); ap.add_argument("--reward-mode", default="dense") + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + torch.manual_seed(args.seed) + dev = "cuda" + d = LiberoRSMData(args.cache, chunk=10, seed=0, in_ram=False, reward_mode=args.reward_mode, + norm_pool=args.norm_pool) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, dev, data=d) + enc.eval() + class _P: pass + _p = _P(); _p.policy_features = "raw" + pfeat, d_pol = policy_features(_p, enc, d, cfg, dev) + hop = None + if args.hop_policy: + hop = load_pol(args.hop_policy, d, dev, cfg["d_z"]) + pol1 = load_pol(args.pol1, d, dev, d_pol); pol2 = load_pol(args.pol2, d, dev, d_pol) + rng = np.random.default_rng(args.seed) + val = d.val_eps + groups = {"demo": val[d.ep_demo[val]], + "roll_succ": val[d.ep_success[val] & ~d.ep_demo[val]], + "roll_fail": val[~d.ep_success[val] & ~d.ep_demo[val]]} + res = {} + for g, eps in groups.items(): + if len(eps) == 0: + continue + e = rng.choice(eps, size=args.frames, replace=True) + t = d.ep_from[e] + (rng.random(args.frames) * np.maximum(d.ep_to[e] - d.ep_from[e] - 10, 1)).astype(np.int64) + x = torch.from_numpy(d._feat(t)).to(dev); tk = torch.from_numpy(d.ep_task[e]).long().to(dev) + a_log = torch.from_numpy(d._chunk_at(t, e)).to(dev).view(args.frames, -1) + with torch.no_grad(): + zc = enc(x); zp = pfeat(x) + c1 = torch.stack([pol1.sample(zp, tk) for _ in range(args.n)]) + c2 = torch.stack([pol2.sample(zp, tk) for _ in range(args.n)]) + cand = torch.cat([c1, c2, a_log[None]], 0) # [2N+1, B, A] + qs = [] + for i in range(cand.shape[0]): + torch.manual_seed(args.seed * 7919 + 1) # CRN across candidates + q, _ = q_recursive(zc, cand[i], tk, rew=rew, flow=flow, rms=rms, pol=hop, + wend=None, beta=args.beta, gamma=args.gamma, depth=args.depth, + n_particles=args.particles, use_is=False, pessimism=0.0) + qs.append(q) + Q = torch.stack(qs).cpu().numpy() # [2N+1, B] + q1, q2, ql = Q[:args.n], Q[args.n:2 * args.n], Q[-1] + am = Q[:2 * args.n].argmax(0) + # action-style distance: how far each proposer's chunks sit from the logged one + d1 = (c1 - a_log[None]).pow(2).mean(-1).sqrt().mean().item() + d2 = (c2 - a_log[None]).pow(2).mean(-1).sqrt().mean().item() + r = {"frames": int(args.frames), "mean_q_demoBC": float(q1.mean()), "mean_q_succBC": float(q2.mean()), + "mean_q_logged": float(ql.mean()), "argmax_is_succBC": float((am >= args.n).mean()), + "frac_frames_succ_mean_higher": float((q2.mean(0) > q1.mean(0)).mean()), + "within_demoBC_std": float(q1.std(0).mean()), "within_succBC_std": float(q2.std(0).mean()), + "rms_dist_to_logged_demoBC": d1, "rms_dist_to_logged_succBC": d2, + "mean_r_at_frame": float(d.r[t].mean())} + res[g] = r + print(f"[bias] {g:10s} " + " ".join(f"{k}={v:.3f}" for k, v in r.items() if isinstance(v, float)), flush=True) + json.dump({"args": vars(args), "res": res}, open(args.out, "w"), indent=1) + print("[bias] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/q_vs_return_diag.py b/gen_q_rsm/rsm_libero/q_vs_return_diag.py new file mode 100644 index 0000000000000000000000000000000000000000..0c6ade5b3d36fb8c578d79b66bd86c85367d5a33 --- /dev/null +++ b/gen_q_rsm/rsm_libero/q_vs_return_diag.py @@ -0,0 +1,85 @@ +"""Policy-evaluation quality of the critics on HELD-OUT logged (state, action) pairs: +Spearman / Pearson between each estimated Q(s,a) and the logged discounted return G_t. + G_sub = (1-g) * sum_k g^k r_{t+k} r = per-frame BDDL subgoal fraction (dense) + G_succ = g^(steps to success) if the episode succeeds else 0 (sparse, terminal) +Arms: RSM restart-Q at depth 1 and 3 (16 particles, shared noise), RSM depth 1 with 256 +particles, the IQL Q trained on the same latent, the reward head alone r_hat(z_t) (no +future), and the per-task constant (the null every pooled correlation has to beat). +Pooled AND within-task (mean of per-task Spearman) are reported: pooled rank correlation +is dominated by task identity (tasks differ in mean subgoal fraction). +usage: q_vs_return_diag.py --cache C --critic ckpt --subgoal-dir D --mask M [--iql iql_q.pt] [--hop hop.pt]""" +import argparse, os, sys, numpy as np, torch +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from data import LiberoRSMData +from is_ope import load_critic, q_recursive, make_policy +from scipy.stats import spearmanr, pearsonr + +ap = argparse.ArgumentParser() +ap.add_argument("--cache", required=True); ap.add_argument("--critic", required=True) +ap.add_argument("--subgoal-dir", default=""); ap.add_argument("--mask", default="") +ap.add_argument("--iql", default=""); ap.add_argument("--hop", default="") +ap.add_argument("--n", type=int, default=6000); ap.add_argument("--gamma", type=float, default=0.99) +ap.add_argument("--beta", type=float, default=0.98) +a = ap.parse_args() +dev = "cuda" if torch.cuda.is_available() else "cpu" +d = LiberoRSMData(a.cache, chunk=10, seed=0, in_ram=False, reward_mode="subgoal", subgoal_dir=a.subgoal_dir, + success_mask=a.mask, norm_pool="demos") +enc, rew, flow, rms, cfg = load_critic(a.critic, d.feat_dim, d.n_task, dev, data=d) +hop = None +if a.hop: + hk = torch.load(a.hop, map_location=dev, weights_only=False) + class _A: pass + ha = _A(); [setattr(ha, k, v) for k, v in hk["config"].items()] + hop = make_policy(ha, d, dev, d_z=cfg["d_z"]); hop.load_state_dict(hk["pol"]); hop.eval() +qnet = None +if a.iql: + from iql import QNet + ck = torch.load(a.iql, map_location=dev, weights_only=False) + qnet = QNet(ck["d_z"], ck["d_act"], ck["n_task"]).to(dev); qnet.load_state_dict(ck["q"]); qnet.eval() +rng = np.random.default_rng(0) +g = a.gamma +# ---- sample held-out frames with their logged action chunk and compute logged returns +eps = d.val_eps; w = d.ep_len[eps].astype(np.float64); w /= w.sum() +e = rng.choice(eps, size=a.n, p=w) +t = d.ep_from[e] + (rng.random(a.n) * np.maximum(d.ep_to[e] - d.ep_from[e] - 10, 1)).astype(np.int64) +G_sub = np.zeros(a.n); G_succ = np.zeros(a.n); to_end = np.zeros(a.n) +for i in range(a.n): + lo, hi = int(t[i]), int(d.ep_to[e[i]]) + rr = np.asarray(d.r[lo:hi], np.float64); k = np.arange(len(rr)) + G_sub[i] = (1 - g) * float((g ** k * rr).sum()) + G_succ[i] = (g ** (hi - lo)) if bool(d.ep_success[e[i]]) else 0.0 + to_end[i] = hi - lo +x = torch.from_numpy(d._feat(t)).to(dev); tk = torch.from_numpy(d.ep_task[e]).long().to(dev) +act = torch.from_numpy(d._chunk_at(t, e)).to(dev).view(a.n, -1) +res = {} +with torch.no_grad(): + z = enc(x) + res["reward head r_hat(z_t) (no future)"] = torch.sigmoid(rew(z, tk)).cpu().numpy() + def rsm(depth, part, crn=True): + out = [] + for i in range(0, a.n, 256): + q, _ = q_recursive(z[i:i+256], act[i:i+256], tk[i:i+256], rew=rew, flow=flow, rms=rms, pol=hop, wend=None, + beta=a.beta, gamma=g, depth=depth, n_particles=part, use_is=False, crn=crn) + out.append(q.cpu()) + return torch.cat(out).numpy() + res["RSM depth 1, 16 particles"] = rsm(1, 16) + res["RSM depth 1, 256 particles"] = rsm(1, 256) + if hop is not None: + res["RSM depth 3, 16 particles"] = rsm(3, 16) + res["RSM depth 3, 256 particles"] = rsm(3, 256) + if qnet is not None: + res["IQL Q(z,a)"] = qnet(z, act, tk).squeeze(-1).cpu().numpy() +tk_np = tk.cpu().numpy() +res["per-task constant (null)"] = np.array([G_sub[tk_np == tt].mean() for tt in tk_np]) +def report(name, q): + rows = [] + for gname, G in (("G_sub", G_sub), ("G_succ", G_succ)): + sp = spearmanr(q, G).correlation; pe = pearsonr(q, G)[0] + wt = [spearmanr(q[tk_np == tt], G[tk_np == tt]).correlation for tt in range(d.n_task) if (tk_np == tt).sum() > 30] + wt = [v for v in wt if v == v] + rows.append(f"{gname}: spearman {sp:+.3f} pearson {pe:+.3f} within-task spearman {np.mean(wt):+.3f}") + print(f"{name:36} | " + " | ".join(rows), flush=True) +print(f"held-out frames n={a.n} from {len(eps)} val episodes; mean G_sub={G_sub.mean():.3f} mean G_succ={G_succ.mean():.3f}") +for k, v in res.items(): + report(k, np.asarray(v, np.float64)) +print("[diag] DONE") diff --git a/gen_q_rsm/rsm_libero/recheck128_cpu.sbatch b/gen_q_rsm/rsm_libero/recheck128_cpu.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..f7ad1280f16c095baf2ca5d548765e99e191f872 --- /dev/null +++ b/gen_q_rsm/rsm_libero/recheck128_cpu.sbatch @@ -0,0 +1,32 @@ +#!/bin/bash +#SBATCH --job-name=recheck128 +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +# EXACTLY label_subgoals.sbatch's resources. 8 cpus / 40G was CANCELLED by uid 0 +# three seconds in, with no output file ever created -- indistinguishable from a +# crash. groenig nodes are 16 cpu / 64298 MB, so --mem=64G is also rejected outright +# ("Memory specification can not be satisfied"). Do not widen these without testing. +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export REPO_PATH=$B/external/rlinf PYTHONPATH="$B/external/rlinf:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +# CPU rendering: only the FIRST observation of each episode is needed, so there is +# no rollout and no GPU. osmesa is the same backend verify_successes.py used. +export MUJOCO_GL=osmesa PYOPENGL_PLATFORM=osmesa +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +export CUDA_VISIBLE_DEVICES="" +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +$B/venvs/rlinf-libero-eval-venv/bin/python $G/recheck_encoding.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --n-ep 6 --frames 4 --pool rollsucc --src-res 128 --flips none + +echo "[cap] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/recheckD_cpu.sbatch b/gen_q_rsm/rsm_libero/recheckD_cpu.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..6c16f87851322228a6b5fcb2c7cba2ad91747774 --- /dev/null +++ b/gen_q_rsm/rsm_libero/recheckD_cpu.sbatch @@ -0,0 +1,32 @@ +#!/bin/bash +#SBATCH --job-name=recheckD +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +# EXACTLY label_subgoals.sbatch's resources. 8 cpus / 40G was CANCELLED by uid 0 +# three seconds in, with no output file ever created -- indistinguishable from a +# crash. groenig nodes are 16 cpu / 64298 MB, so --mem=64G is also rejected outright +# ("Memory specification can not be satisfied"). Do not widen these without testing. +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export REPO_PATH=$B/external/rlinf PYTHONPATH="$B/external/rlinf:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +# CPU rendering: only the FIRST observation of each episode is needed, so there is +# no rollout and no GPU. osmesa is the same backend verify_successes.py used. +export MUJOCO_GL=osmesa PYOPENGL_PLATFORM=osmesa +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +export CUDA_VISIBLE_DEVICES="" +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +$B/venvs/rlinf-libero-eval-venv/bin/python $G/recheck_encoding.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --n-ep 6 --frames 4 --pool demos + +echo "[cap] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/recheck_cpu.sbatch b/gen_q_rsm/rsm_libero/recheck_cpu.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..f44b969cbb26f1766f0bec36775f8fe7c8ccb3df --- /dev/null +++ b/gen_q_rsm/rsm_libero/recheck_cpu.sbatch @@ -0,0 +1,32 @@ +#!/bin/bash +#SBATCH --job-name=recheck +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +# EXACTLY label_subgoals.sbatch's resources. 8 cpus / 40G was CANCELLED by uid 0 +# three seconds in, with no output file ever created -- indistinguishable from a +# crash. groenig nodes are 16 cpu / 64298 MB, so --mem=64G is also rejected outright +# ("Memory specification can not be satisfied"). Do not widen these without testing. +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export REPO_PATH=$B/external/rlinf PYTHONPATH="$B/external/rlinf:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +# CPU rendering: only the FIRST observation of each episode is needed, so there is +# no rollout and no GPU. osmesa is the same backend verify_successes.py used. +export MUJOCO_GL=osmesa PYOPENGL_PLATFORM=osmesa +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +export CUDA_VISIBLE_DEVICES="" +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +$B/venvs/rlinf-libero-eval-venv/bin/python $G/recheck_encoding.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --n-ep 6 --frames 4 + +echo "[cap] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/recheck_encoding.py b/gen_q_rsm/rsm_libero/recheck_encoding.py new file mode 100644 index 0000000000000000000000000000000000000000..80d1cb52af890616d1ea25d6a38b82afb8816021 --- /dev/null +++ b/gen_q_rsm/rsm_libero/recheck_encoding.py @@ -0,0 +1,157 @@ +"""Was the ROLLOUT cache built with the same image preprocessing as the evaluator? + +Hypothesis 2 of williamd4112/gen_q#251. The demo cache and the rollout cache have +different producers, and demo frames sit 48.7-61.5 from the nearest rollout frame +against 7.5-9.2 within the rollout cloud. `to224`'s own docstring records that uint8 +quantisation alone moves the latent 3 sigma on the dimensions that matter and cost a +working policy 0.46 -> 0/50, with cosine similarity 0.999898 hiding it completely. + +So: take a rollout episode's OWN raw frames (the parquets carry `image` and +`wrist_image`), push them through the EVALUATOR's exact path, and compare against that +frame's cached latent. Agreement means the rollout cache matches the evaluator and the +support gap is real scene difference. Disagreement means every rollout latent is in a +space the evaluator never produces, and no policy or critic trained on them can be read +online. + +Reports L2 in z-scored feature units, so the numbers are directly comparable to the +48.7-61.5 / 7.5-9.2 gap measured in #251 -- cosine similarity is deliberately NOT the +headline for the reason above. +""" +from __future__ import annotations +import argparse, importlib.util, io, os, re, sys +from pathlib import Path +import numpy as np +import torch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from eval_closed_loop import to224, BUILDER + +_spec = importlib.util.spec_from_file_location("ogpo_rc", BUILDER) +ogpo = importlib.util.module_from_spec(_spec) +sys.modules["ogpo_rc"] = ogpo +_spec.loader.exec_module(ogpo) + +PAT = re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") +PQ_ROOT = "/data/pulkitag/users/rli14/pi05_lib10_sde_v1" + + +def decode(cell): + """Parquet image cell -> HxWx3 uint8. LeRobot stores either raw bytes (PNG/JPEG) + or a nested list; handle both rather than guessing.""" + v = cell.as_py() if hasattr(cell, "as_py") else cell + if isinstance(v, dict) and "bytes" in v: + v = v["bytes"] + if isinstance(v, (bytes, bytearray)): + from PIL import Image + return np.asarray(Image.open(io.BytesIO(v)).convert("RGB"), np.uint8) + a = np.asarray(v) + if a.dtype != np.uint8: + a = (a * 255).round().clip(0, 255).astype(np.uint8) if a.max() <= 1.001 else a.astype(np.uint8) + if a.ndim == 1: + n = int(round((a.size / 3) ** 0.5)); a = a.reshape(n, n, 3) + if a.ndim == 3 and a.shape[0] == 3: + a = a.transpose(1, 2, 0) + return a + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--n-ep", type=int, default=6) + ap.add_argument("--frames", type=int, default=4, help="frames checked per episode") + ap.add_argument("--pool", default="rollsucc", choices=["rollsucc", "demos"], + help="demos re-encodes from the LIBERO hdf5 (agentview_rgb / " + "eye_in_hand_rgb); the demo cache's npz holds no images") + ap.add_argument("--src-res", type=int, default=0, + help="resize the source image to this square resolution BEFORE " + "to224, emulating a camera that renders at that size. The " + "rollout parquets are 256x256; the evaluator renders at 128.") + ap.add_argument("--flips", default="both,none,ud,lr", + help="flip conventions to try; the evaluator uses img[::-1,::-1] = both") + args = ap.parse_args() + + import pyarrow.parquet as pq + dev = "cuda" if torch.cuda.is_available() else "cpu" + print(f"[rc] device {dev}", flush=True) + tower = ogpo.build_paligemma(dev) + from libero.libero import benchmark + bench = benchmark.get_benchmark_dict()["libero_10"]() + + C = Path(args.cache) + m = np.load(C / "meta.npz", allow_pickle=True) + fr, to = m["ep_from"].astype(int), m["ep_to"].astype(int) + dem = m["ep_demo"].astype(bool); suc = m["ep_success"].astype(bool) + tk = m["ep_task"]; dim = int(m["dim"]) + Z = np.load(C / "z.f16.npy", mmap_mode="r").reshape(-1, dim) + st = np.load(C / "feat_stats_demos.npz") + sd_vis = st["sd"][:dim] # visual block only + + flips = {"both": (slice(None, None, -1), slice(None, None, -1)), + "none": (slice(None), slice(None)), + "ud": (slice(None, None, -1), slice(None)), + "lr": (slice(None), slice(None, None, -1))} + want = [f for f in args.flips.split(",") if f in flips] + + def frames_of(e): + """(n_frames, getter(r) -> (agentview, wrist)) for episode e, from the raw + image source that produced its cached latents.""" + if args.pool == "rollsucc": + g = PAT.search(str(m["ep_src"][e])) + t, b, i, idx = g.groups() + p = (f"{PQ_ROOT}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + if not os.path.exists(p): + return 0, None + tb = pq.read_table(p, columns=["image", "wrist_image"]) + return tb.num_rows, (lambda r: (decode(tb["image"][int(r)]), + decode(tb["wrist_image"][int(r)]))) + import h5py + sp = str(m["ep_src"][e]) # .../_demo/demo_7.npz + tdir = Path(sp).parent.name # _demo + k = Path(sp).stem # demo_7 + H = h5py.File(f"/data/pulkitag/users/rli14/libero_datasets/libero_10/{tdir}.hdf5", "r") + ob = H["data"][k]["obs"] + return ob["agentview_rgb"].shape[0], (lambda r: (np.asarray(ob["agentview_rgb"][int(r)]), + np.asarray(ob["eye_in_hand_rgb"][int(r)]))) + + eps = np.where((suc & ~dem) if args.pool == "rollsucc" else dem)[0][:args.n_ep] + print(f"[rc] pool={args.pool}: {len(eps)} episodes, {args.frames} frames each\n", flush=True) + agg = {f: [] for f in want} + for e in eps: + t = int(tk[e]) + n_src, get = frames_of(e) + if get is None: + print(f" ep {e}: source missing"); continue + ids = ogpo.tokenize_prompt(bench.get_task(t).language) + n = min(n_src, int(to[e] - fr[e])) + rows = np.linspace(0, n - 1, args.frames).astype(int) + for r in rows: + im0, im1 = get(r) + if args.src_res and im0.shape[0] != args.src_res: + from PIL import Image + _rs = lambda a: np.asarray(Image.fromarray(a).resize( + (args.src_res, args.src_res), Image.BILINEAR), np.uint8) + im0, im1 = _rs(im0), _rs(im1) + z_cache = np.asarray(Z[fr[e] + int(r)], np.float32) + for f in want: + a, bb = flips[f] + cams = [to224(im0[a, bb])[None], to224(im1[a, bb])[None]] + z = np.concatenate( + [ogpo.encode_frames(tower, c, ids, dev, 2) for c in cams], axis=1)[0] + # L2 in z-scored units: comparable to the #251 support-gap numbers + agg[f].append(float(np.linalg.norm((z - z_cache) / sd_vis))) + print(f" ep {e} t{t} done " + " ".join( + f"{f}={np.mean(agg[f][-args.frames:]):.2f}" for f in want), flush=True) + + print(f"\n=== pool={args.pool}: re-encode vs cached latent, L2 in z-scored units ===") + print("(reference from #251: rollout->nearest rollout 7.5-9.2, demo->nearest rollout 48.7-61.5)") + for f in want: + v = np.array(agg[f]) + print(f" flip={f:<5} n={len(v):<4} mean={v.mean():>8.2f} min={v.min():>8.2f} max={v.max():>8.2f}") + best = min(want, key=lambda f: np.mean(agg[f])) + print(f"\nbest convention: {best} (evaluator uses 'both')") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/reencode.sbatch b/gen_q_rsm/rsm_libero/reencode.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..f2c96c460c5510608d788af4f4a698d55e357514 --- /dev/null +++ b/gen_q_rsm/rsm_libero/reencode.sbatch @@ -0,0 +1,28 @@ +#!/bin/bash +#SBATCH --job-name=reenc +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=8 +#SBATCH --mem=64G +#SBATCH --time=6:00:00 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +# Re-encode rollout latents at the evaluator's 128 camera resolution (i251). +# Same venv + env as eval_slurm.sbatch so the encoder is the evaluator's encoder. +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export REPO_PATH=$B/external/rlinf PYTHONPATH="$B/external/rlinf:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +OUT=${OUT:-/data/pulkitag/scratch/rli14/pi05_lib10_ogpo_fl15_v1_r128} +$B/venvs/rlinf-libero-eval-venv/bin/python $G/reencode_rollouts.py \ + --out "$OUT" --cam-res "${CAMRES:-128}" --shard "${SHARD:-0}" --num-shards "${NSHARDS:-1}" \ + ${ONLYCACHE:+--only-cache "$ONLYCACHE"} ${LIMIT:+--limit "$LIMIT"} +echo "[re] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/reencode_rollouts.py b/gen_q_rsm/rsm_libero/reencode_rollouts.py new file mode 100644 index 0000000000000000000000000000000000000000..32b31d495e4fb47d84528ba37d581a35876404d7 --- /dev/null +++ b/gen_q_rsm/rsm_libero/reencode_rollouts.py @@ -0,0 +1,121 @@ +"""Re-encode the rollout corpus at the resolution the evaluator actually renders. + +Finding (williamd4112/gen_q#251): the rollout latents in `pi05_lib10_ogpo_fl15_v1` +were encoded from the collector's 256x256 renders. The closed-loop evaluator renders +at 128x128 (`camera_heights=128`), and so does the demo hdf5. Re-encoding a rollout +frame through the evaluator's own path puts it 74.97 z-scored units from its cached +latent (within-cloud scale 7.5-9.2; demo cache re-encoded the same way: 4.27). Every +rollout latent is therefore off the manifold the evaluator produces -- which is why +BC on rollout successes is 0/500 with held-out action MSE 0.0008, and why a critic +trained on a 90%-rollout corpus is read off-support online. + +This rebuilds the rollout npz tree with latents from: parquet image (256, stored +upright) -> 128 (PIL bilinear, emulating the 128 camera) -> 224 (PIL bilinear, the +builder's own step) -> the SAME encoder. No flip: the parquet images are already in +the serving orientation (verified visually and by L2: flip=none matches at 4.26). +proprio / actions / success / prompt / task_index are copied from the original npz, +which are bit-identical to the parquet fields. + +Output tree mirrors the input so pack.py runs unchanged with --src . +""" +from __future__ import annotations +import argparse, importlib.util, io, os, re, sys, time +from pathlib import Path +import numpy as np +import torch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from eval_closed_loop import BUILDER +from recheck_encoding import decode, PAT, PQ_ROOT + +_spec = importlib.util.spec_from_file_location("ogpo_re", BUILDER) +ogpo = importlib.util.module_from_spec(_spec) +sys.modules["ogpo_re"] = ogpo +_spec.loader.exec_module(ogpo) + + +def prep(img, cam_res): + """uint8 HxWx3 (upright) -> uint8 224x224x3 via the camera resolution.""" + from PIL import Image + im = Image.fromarray(img) + if im.size != (cam_res, cam_res): + im = im.resize((cam_res, cam_res), Image.BILINEAR) + if im.size != (224, 224): + im = im.resize((224, 224), Image.BILINEAR) # builder's own step + return np.asarray(im, np.uint8) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--src", default="/data/pulkitag/users/rli14/pi05_lib10_ogpo_fl15_v1") + ap.add_argument("--out", required=True) + ap.add_argument("--cam-res", type=int, default=128) + ap.add_argument("--shard", type=int, default=0) + ap.add_argument("--num-shards", type=int, default=1) + ap.add_argument("--only-cache", default="", + help="meta.npz of a cache: re-encode only the episodes it uses " + "(the 4,500-rollout subset first, the full corpus after)") + ap.add_argument("--batch", type=int, default=128) + ap.add_argument("--limit", type=int, default=0, help="smoke: stop after N episodes") + args = ap.parse_args() + + import pyarrow.parquet as pq + dev = "cuda" if torch.cuda.is_available() else "cpu" + tower = ogpo.build_paligemma(dev) + + if args.only_cache: + m = np.load(args.only_cache, allow_pickle=True) + srcs = [str(s) for s, d in zip(m["ep_src"], m["ep_demo"]) if not d] + else: + srcs = sorted(str(p) for p in Path(args.src).glob("*/ep_*.npz")) + srcs = srcs[args.shard::args.num_shards] + if args.limit: + srcs = srcs[:args.limit] + print(f"[re] shard {args.shard}/{args.num_shards}: {len(srcs)} episodes -> {args.out} " + f"(cam_res={args.cam_res}, device={dev})", flush=True) + + t0 = time.time(); n_done = n_skip = 0 + for k, sp in enumerate(srcs): + rel = Path(sp).relative_to(args.src) + op = Path(args.out) / rel + if op.exists(): + n_skip += 1; continue + g = PAT.search(sp) + t, b, i, idx = g.groups() + pp = (f"{PQ_ROOT}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + if not os.path.exists(pp): + print(f"[re] MISSING parquet for {rel}", flush=True); continue + z0 = np.load(sp, allow_pickle=True) + T = int(z0["z"].shape[0]) + tb = pq.read_table(pp, columns=["image", "wrist_image"]) + if tb.num_rows < T: + print(f"[re] {rel}: parquet has {tb.num_rows} rows < npz {T}; truncating", + flush=True); T = tb.num_rows + ids = ogpo.tokenize_prompt(str(z0["prompt"])) + zs = [] + for cam in ("image", "wrist_image"): + frames = np.stack([prep(decode(tb[cam][j]), args.cam_res) for j in range(T)]) + outs = [] + for s in range(0, T, args.batch): + outs.append(ogpo.encode_frames(tower, frames[s:s + args.batch], ids, dev, + args.batch)) + zs.append(np.concatenate(outs, 0)) + z = np.concatenate(zs, 1).astype(np.float16) # [T, 4096] base||wrist + assert z.shape == (T, z0["z"].shape[1]), (z.shape, z0["z"].shape) + op.parent.mkdir(parents=True, exist_ok=True) + tmp = str(op) + ".tmp.npz" + np.savez(tmp, z=z, proprio=z0["proprio"][:T], actions=z0["actions"][:T], + success=z0["success"], prompt=z0["prompt"], task_index=z0["task_index"]) + os.replace(tmp, op) + n_done += 1 + if n_done % 25 == 0: + el = time.time() - t0 + print(f"[re] {k+1}/{len(srcs)} done={n_done} skip={n_skip} " + f"{el/n_done:.1f}s/ep eta {(len(srcs)-k-1)*el/n_done/60:.0f} min", flush=True) + print(f"[re] DONE shard {args.shard}: {n_done} written, {n_skip} existed", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/report.py b/gen_q_rsm/rsm_libero/report.py new file mode 100644 index 0000000000000000000000000000000000000000..e3beba245705a8fdeaaa97408d4bdeb020329fd2 --- /dev/null +++ b/gen_q_rsm/rsm_libero/report.py @@ -0,0 +1,96 @@ +"""Collect run artifacts into one honest table. + +Reports what was actually measured and labels what was NOT. In particular the +offline metrics here are NOT closed-loop LIBERO success, so they cannot by +themselves support a claim of beating behaviour cloning; that requires the lane's +per-task closed-loop eval. This script prints the distinction rather than hiding it. +""" +from __future__ import annotations +import argparse, json +from pathlib import Path + + +def row(k, v, w=34): + print(f" {k:<{w}} {v}") + + +def winrate_ci(win, n, z=1.96): + """Wilson interval for a win rate. The action gap is a heavy-tailed mean and + swings between evals (+0.045 / +0.063 / +0.018 on consecutive checkpoints); + the win rate over the same pairs is the stable statistic, so report it with + an interval rather than quoting a point estimate.""" + if not n: + return (float("nan"), float("nan")) + p = win + d = 1 + z * z / n + c = (p + z * z / (2 * n)) / d + h = z * ((p * (1 - p) / n + z * z / (4 * n * n)) ** 0.5) / d + return (c - h, c + h) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--critic", default="") + ap.add_argument("--ope-signal", default="") + ap.add_argument("--ope-null", default="") + ap.add_argument("--awr", default="") + a = ap.parse_args() + + if a.critic: + h = json.loads((Path(a.critic) / "history.json").read_text()) + last, best = h[-1], max(h, key=lambda r: r["q_action_gap"]) + print("\n== CRITIC (occupancy + reward latent) ==") + row("reward AUC (held-out)", f"{last['reward_auc']:.4f}") + row("occupancy CFM val loss", f"{last['cfm_val']:.4f}") + row("latent std min (collapse guard)", f"{last['latent_std_min']:.4f}") + lo, hi = winrate_ci(last["q_action_winrate"], 1024) + row("ACTION gap (headline)", f"{last['q_action_gap']:+.5f} " + f"(win {last['q_action_winrate']:.3f}, 95% CI [{lo:.3f},{hi:.3f}])") + bh = last.get("by_horizon", {}) + for k, v in bh.items(): + blo, bhi = winrate_ci(v["action_winrate"], v["n"]) + sig = "" if blo <= 0.5 <= bhi else " <-- excludes chance" + row(f" frames-to-end {k}", + f"gap {v['action_gap']:+.5f} win {v['action_winrate']:.3f} " + f"[{blo:.3f},{bhi:.3f}] n={v['n']}{sig}") + row(" best over training", f"{best['q_action_gap']:+.5f} @ step {best['step']}") + row("state success AUC", f"{last['q_success_auc']:.4f}") + print(" NOTE action gap is the metric that matters: COLLAPSE_ANALYSIS shows a") + print(" state-ranking value with a flat action gap dies in closed loop.") + + for tag, path in (("SIGNAL pi=BC(successes)", a.ope_signal), + ("NULL pi=BC(all)~mu", a.ope_null)): + if not path: + continue + r = json.loads((Path(path) / "report.json").read_text()) + c, v = r["calibration"], r["value"] + print(f"\n== OPE GATE :: {tag} ==") + row("E_mu[w] after calibration", f"{c['E_mu[w_endpoint]']:.4f} (target 1.000)") + row("calibration factor applied", f"{c['calib_scale']:.3f}") + row("E_mu[W] raw chunk product", f"{c['E_mu[W_chunk]']:.4f} (target 1.000)") + row("corr(endpoint w, chunk W)", f"{c['corr_w_vs_W']:.4f}") + row("weight ESS fraction", f"{c['ess_frac']:.3f}") + row("particle ESS fraction", f"{v['ess_particles']:.3f}") + row("success AUC with IS", f"{v['auc_success_IS']:.4f}") + row("success AUC without IS", f"{v['auc_success_noIS']:.4f}") + row("relative |dQ| from IS", f"{v['rel_shift_IS_vs_noIS']:.4f}") + row("expectation", v["gate_expectation"]) + + if a.awr: + L = json.loads((Path(a.awr) / "loop.json").read_text()) + print("\n== AWR LOOP ==") + row("pi_0 offline score", json.dumps(L["pi_0"])) + for r in L["rounds"]: + adv = r["awr"][-1] if r["awr"] else {} + row(f"round {r['round']} mean|adv|", + f"{adv.get('mean_abs_adv', float('nan')):.4f} " + f"(smolvla null result was 0.0190)") + row(f"round {r['round']} score", json.dumps(r["score"])) + + print("\nNOT MEASURED HERE: closed-loop LIBERO success. Every number above is") + print("offline. Beating BC on demos (0.584 +- 0.025 step-matched in this lane)") + print("requires the per-task closed-loop harness and is not claimed by this table.") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/report_arms.py b/gen_q_rsm/rsm_libero/report_arms.py new file mode 100644 index 0000000000000000000000000000000000000000..5dcd3bdd892113d594ffe67080fcee9a606002f8 --- /dev/null +++ b/gen_q_rsm/rsm_libero/report_arms.py @@ -0,0 +1,95 @@ +"""The headline table: closed-loop LIBERO-10 success and throughput, four arms. + +Throughput = pooled_SR * max_steps / mean_steps, reported two ways because they +answer different questions: + succ : mean steps over SUCCESSFUL episodes -- how fast it is when it works + all : mean steps over ALL episodes -- a failure burns the full horizon, so + this penalises failing twice (once in SR, once in wasted time) + +Success rates are pooled over all task-episodes and carry a Wilson interval. +Arms are compared against A_bc_demos, the BC-on-demonstrations bar an RSM recipe +has to clear; a difference is only called a win when the intervals separate. +""" +from __future__ import annotations +import argparse, json +from pathlib import Path + +ARMS = [("LANE_CONTROL", "lane bcdemos (reference bar)"), + ("A_bc_demos", "BC on demos, our pipeline"), + ("B_bc_succ", "behaviour-policy extraction"), + ("C_iql", "IQL critic + AWR"), + ("D_rsm", "RSM critic + AWR (ours)")] + + +def wilson(k, n, z=1.96): + if not n: + return float("nan"), float("nan") + p = k / n + d = 1 + z * z / n + c = (p + z * z / (2 * n)) / d + h = z * ((p * (1 - p) / n + z * z / (4 * n * n)) ** 0.5) / d + return c - h, c + h + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--eval-dir", default="/data/pulkitag/users/rli14/rsm_libero_runs/eval") + a = ap.parse_args() + d = Path(a.eval_dir) + + got = {} + for tag, _ in ARMS: + f = d / f"{tag}.json" + if f.exists(): + got[tag] = json.loads(f.read_text()) + + print("\n== CLOSED-LOOP LIBERO-10 (10 tasks x 10 inits, max 520 steps) ==") + print(f" {'arm':<12} {'what it is':<30} {'succ/n':>9} {'pooled SR':>10} " + f"{'95% CI':>16} {'thr_succ':>9} {'thr_all':>8}") + for tag, what in ARMS: + r = got.get(tag) + if r is None: + print(f" {tag:<12} {what:<30} {'--':>9} {'not yet run':>10}") + continue + k, n = r["successes"], r["episodes"] + lo, hi = wilson(k, n) + print(f" {tag:<12} {what:<30} {f'{k}/{n}':>9} {r['pooled_SR']:>10.3f} " + f"{f'[{lo:.3f},{hi:.3f}]':>16} {r['throughput_succ']:>9.3f} " + f"{r['throughput_all']:>8.3f}") + + # The bar is the REFERENCE policy when we have it: comparing our arms + # against our own broken BC would let a 0.02 arm look like a "win". + base = got.get("LANE_CONTROL") or got.get("A_bc_demos") + if base: + blo, bhi = wilson(base["successes"], base["episodes"]) + print(f"\n== vs the BC-on-demos bar ({base['pooled_SR']:.3f}) ==") + for tag, what in ARMS: + if got.get(tag) is base: + continue + r = got.get(tag) + if r is None: + continue + lo, hi = wilson(r["successes"], r["episodes"]) + if lo > bhi: + v = "WIN (intervals separate)" + elif hi < blo: + v = "LOSS (intervals separate)" + else: + v = "no separation at 95%" + print(f" {tag:<12} {r['pooled_SR'] - base['pooled_SR']:+.3f} {v}") + + if got: + print("\n== per-task pooled SR ==") + tasks = sorted({t for r in got.values() for t in r["per_task"]}) + print(f" {'task':<52}" + "".join(f"{t:>12}" for t, _ in ARMS if t in got)) + for tk in tasks: + print(f" {tk[:50]:<52}" + + "".join(f"{got[t]['per_task'].get(tk, float('nan')):>12.2f}" + for t, _ in ARMS if t in got)) + missing = [t for t, _ in ARMS if t not in got] + if missing: + print(f"\n NOT YET MEASURED: {', '.join(missing)} -- the table above is incomplete.") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/rerender.sbatch b/gen_q_rsm/rsm_libero/rerender.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..7033c7b65baa2ecf815376047760da2e9a447ee9 --- /dev/null +++ b/gen_q_rsm/rsm_libero/rerender.sbatch @@ -0,0 +1,28 @@ +#!/bin/bash +#SBATCH --job-name=rerender +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=8 +#SBATCH --mem=64G +#SBATCH --time=6:00:00 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +# Re-encode rollout latents at the evaluator's 128 camera resolution (i251). +# Same venv + env as eval_slurm.sbatch so the encoder is the evaluator's encoder. +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export REPO_PATH=$B/external/rlinf PYTHONPATH="$B/external/rlinf:${PYTHONPATH:-}" +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl +export TOKENIZERS_PARALLELISM=false PYTHONUNBUFFERED=1 +export HF_HOME=/data/pulkitag/users/rli14/hf_cache HF_HUB_OFFLINE=1 +export HF_TOKEN=$(cat /data/pulkitag/users/rli14/hf_cache/token 2>/dev/null || echo "") +export HUGGINGFACE_HUB_TOKEN=$HF_TOKEN +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +G=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +OUT=${OUT:-/data/pulkitag/scratch/rli14/pi05_lib10_ogpo_fl15_v1_rr} +$B/venvs/rlinf-libero-eval-venv/bin/python $G/rerender_rollouts.py \ + --out "$OUT" --shard "${SHARD:-0}" --num-shards "${NSHARDS:-1}" \ + ${ONLYCACHE:+--only-cache "$ONLYCACHE"} ${LIMIT:+--limit "$LIMIT"} ${VALDEMOS:+--validate-demos "$VALDEMOS"} ${VALROLL:+--validate-rollouts "$VALROLL"} --cam-res "${CAMRES:-256}" --pool "${POOL:-rollouts}" ${DEMOCACHE:+--demo-cache "$DEMOCACHE"} +echo "[re] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/rerender_rollouts.py b/gen_q_rsm/rsm_libero/rerender_rollouts.py new file mode 100644 index 0000000000000000000000000000000000000000..0b752e30d6a1025e0356829db4739fb70798fbae --- /dev/null +++ b/gen_q_rsm/rsm_libero/rerender_rollouts.py @@ -0,0 +1,318 @@ +"""Re-render every rollout frame INSIDE the evaluator's environment, then encode. + +Why not resize the collector's 256x256 pixels (reencode_rollouts.py)? Measured: a +256->128 bilinear downsample lands in a THIRD region -- 63.7 from the live evaluator +feature, 71.5 from the demo cloud, 81.5 from the old rollout cloud -- no closer to the +evaluator than the cache it was meant to fix. SigLIP features do not survive an +approximate raster (to224's docstring: uint8 rounding alone is 3 sigma). + +So do the only thing that is evaluator-consistent BY CONSTRUCTION: the parquets log +`sim_state` for every frame; set it in the evaluator's own OffScreenRenderEnv +(camera_heights=128, EGL), read both cameras exactly as eval_closed_loop does +([::-1, ::-1], to224), encode with the evaluator's encoder. This is the admissibility +rule applied to features: a latent is admissible only if the eval environment can +produce it. + +Built-in validation (--validate-demos N): the demo hdf5 stores `states`; re-rendering +those through this path must land ~4 z-scored units from the demo cache (which was +built from the hdf5's own recorded images). If it does not, the path is wrong and no +rollout output should be trusted. + +Output mirrors the input npz tree so pack.py runs unchanged. Idempotent (skips +existing), atomic writes, requeue-safe. +""" +from __future__ import annotations +import argparse, importlib.util, os, re, sys, time +from pathlib import Path +import numpy as np +import torch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +from eval_closed_loop import BUILDER, to224, _eef_ori +from recheck_encoding import PAT, PQ_ROOT + +_spec = importlib.util.spec_from_file_location("ogpo_rr", BUILDER) +ogpo = importlib.util.module_from_spec(_spec) +sys.modules["ogpo_rr"] = ogpo +_spec.loader.exec_module(ogpo) + +DEMO_H5 = os.environ.get("RSM_DEMO_H5", "/data/pulkitag/users/rli14/libero_datasets/libero_10") + + +class Renderer: + """One evaluator env per task, reused across episodes.""" + def __init__(self, cam_res=128): + self.cam_res = cam_res + from libero.libero import benchmark, get_libero_path + from libero.libero.envs import OffScreenRenderEnv + self.bench = benchmark.get_benchmark_dict()["libero_10"]() + self.get_libero_path = get_libero_path; self.Env = OffScreenRenderEnv + self.envs, self.ids = {}, {} + + def env(self, tid): + # ONE live env at a time. robosuite's offscreen EGL context is shared across + # OffScreenRenderEnv instances in a process: with several alive, a render can + # come from whichever model last touched the context (measured: a task-0 state + # rendered as task-4's mugs and plates; one frame came back black). The + # evaluator builds one env per task and closes it; do the same. + if tid not in self.envs: + for _k in list(self.envs): + try: + self.envs[_k].close() + except Exception: + pass + self.envs.pop(_k, None) + t = self.bench.get_task(tid) + e = self.Env(bddl_file_name=str(Path(self.get_libero_path("bddl_files")) + / t.problem_folder / t.bddl_file), + camera_heights=self.cam_res, camera_widths=self.cam_res) + e.reset(); e.step(np.zeros(7)) + self.envs[tid] = e; self.ids[tid] = ogpo.tokenize_prompt(t.language) + return self.envs[tid], self.ids[tid] + + def frames(self, tid, states): + """states [T, nq+nv] -> (agent [T,224,224,3], wrist [T,224,224,3], proprio [T,8])""" + env, _ = self.env(tid) + sim = env.env.sim + A, W, P = [], [], [] + for st in states: + sim.set_state_from_flattened(np.asarray(st, np.float64)); sim.forward() + # Python-side visuals are NOT in the MuJoCo state: the stove burner is a + # site_rgba alpha in sim.model toggled by set_visualization() from + # turn_on(qpos), which the env runs inside step() via _check_success -> + # _post_process. Replay that update or a mid-episode kitchen frame renders + # with the burner off while the logged image has it on (measured: kitchen + # tasks drift 10-37, living-room tasks 3-4). + try: + env.env._check_success() + except Exception: + pass + if hasattr(env.env, "set_visualization"): + env.env.set_visualization() + sim.forward() + obs = env.env._get_observations(force_update=True) + A.append(to224(obs["agentview_image"][::-1, ::-1])) + W.append(to224(obs["robot0_eye_in_hand_image"][::-1, ::-1])) + P.append(np.concatenate([obs["robot0_eef_pos"], _eef_ori(obs), + obs["robot0_gripper_qpos"]]).astype(np.float32)) + return np.stack(A), np.stack(W), np.stack(P) + + +def encode(tower, ids, A, W, dev, bs): + za = ogpo.encode_frames(tower, A, ids, dev, bs) + zw = ogpo.encode_frames(tower, W, ids, dev, bs) + return np.concatenate([za, zw], 1).astype(np.float16) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--src", default="/data/pulkitag/users/rli14/pi05_lib10_ogpo_fl15_v1") + ap.add_argument("--out", required=True) + ap.add_argument("--shard", type=int, default=0) + ap.add_argument("--num-shards", type=int, default=1) + ap.add_argument("--only-cache", default="") + ap.add_argument("--limit", type=int, default=0) + ap.add_argument("--batch", type=int, default=128) + ap.add_argument("--cam-res", type=int, default=256, + help="256 = RLinf libero_10 env (lane evaluator + collector); 128 = demo hdf5") + ap.add_argument("--pool", default="rollouts", choices=["rollouts", "demos", "demos_replay"], + help="demos: re-render the 500 demo episodes from hdf5 `states` into a " + "new demo cache tree (/_demo/demo_k.npz)") + ap.add_argument("--validate-rollouts", type=int, default=0, + help="re-render N rollout episodes (4 frames each) and report L2 to the " + "CACHED rollout latent. ~4 at --cam-res 256 means our evaluator at 256 " + "reproduces the collector, and the 43k latents are on-manifold as-is.") + ap.add_argument("--validate-demos", type=int, default=0, + help="re-render N demo episodes' hdf5 states and report L2 to the " + "demo cache (z-scored, demo stats). Run BEFORE trusting output.") + ap.add_argument("--demo-cache", default="/data/pulkitag/users/rli14/libero10_demo_ogpo_cache_cam128") + ap.add_argument("--stats", default="/data/pulkitag/users/rli14/rsm_libero_cache/full_demo_cam256/feat_stats_demos.npz") + args = ap.parse_args() + + dev = "cuda" if torch.cuda.is_available() else "cpu" + tower = ogpo.build_paligemma(dev) + R = Renderer(args.cam_res) + print(f"[rr] cam_res={args.cam_res} pool={args.pool}", flush=True) + + if args.validate_demos: + import h5py, glob + st = np.load(args.stats); mu, sd = st["mu"][:4096], st["sd"][:4096] + dists = [] + h5s = sorted(glob.glob(f"{DEMO_H5}/*.hdf5")) + for tid, h5 in enumerate(h5s[:args.validate_demos]): + tname = Path(h5).stem[:-5] # strip _demo + tids = [i for i in range(10) if R.bench.get_task(i).name == tname] + if not tids: print(f"[rr] validate: no task for {tname}"); continue + tid = tids[0] + with h5py.File(h5, "r") as H: + states = np.asarray(H["data"]["demo_0"]["states"][:]) + rows = np.linspace(0, len(states) - 1, 4).astype(int) + A, W, _ = R.frames(tid, states[rows]) + _, ids = R.env(tid) + z = encode(tower, ids, A, W, dev, args.batch).astype(np.float32) + zc = np.load(f"{args.demo_cache}/{tname}_demo/demo_0.npz")["z"][rows].astype(np.float32) + print(f"[rr] validate demo task {tid}: comparing against {args.demo_cache}", flush=True) + dd = np.linalg.norm((z - zc) / sd, axis=1) + dists += dd.tolist() + print(f"[rr] validate demo task {tid} ({tname[:30]}): L2 to demo cache " + f"{np.round(dd, 2).tolist()}", flush=True) + print(f"[rr] VALIDATE demos: mean {np.mean(dists):.2f} max {np.max(dists):.2f} " + f"(demo cache re-encoded from its own hdf5 images: 3.7-4.3; " + f"anything >10 means this path is NOT the evaluator's)", flush=True) + + import pyarrow.parquet as pq + if args.validate_rollouts: + st = np.load(args.stats); sd = st["sd"][:4096] + m = np.load(args.only_cache, allow_pickle=True) if args.only_cache else None + cand = [str(s) for s, d in zip(m["ep_src"], m["ep_demo"]) if not d] if m is not None \ + else sorted(str(p) for p in Path(args.src).glob("*/ep_*.npz")) + dists = [] + for sp in cand[:args.validate_rollouts]: + g = PAT.search(sp); t, b, i, idx = g.groups() + pp = (f"{PQ_ROOT}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + z0 = np.load(sp, allow_pickle=True); T = int(z0["z"].shape[0]) + tb = pq.read_table(pp, columns=["sim_state"]) + rows = np.linspace(0, min(T, tb.num_rows) - 1, 4).astype(int) + states = np.stack([np.asarray(tb["sim_state"][int(r)].as_py(), np.float64) for r in rows]) + tid = int(t) # from the FILENAME: the npz task_index field is wrong in the raw corpus (#234) + A, W, P = R.frames(tid, states); _, ids = R.env(tid) + z = encode(tower, ids, A, W, dev, args.batch).astype(np.float32) + dd = np.linalg.norm((z - z0["z"][rows].astype(np.float32)) / sd, axis=1) + dists += dd.tolist() + # Is the LOGGED image the same scene as the LOGGED sim_state? Compare the + # re-rendered proprio to the logged proprio (consistency of sim_state with + # state/actions), and save frame-0 side by side for the eye. + dp = float(np.abs(P - z0["proprio"][rows]).mean()) + print(f"[rr] validate rollout t{t} {Path(sp).name}: L2 to cached " + f"{np.round(dd, 2).tolist()} |rerendered proprio - logged| = {dp:.4f}", flush=True) + try: + from PIL import Image + from recheck_encoding import decode + tbi = pq.read_table(pp, columns=["image"]) + logged = Image.fromarray(decode(tbi["image"][int(rows[0])])).resize((224, 224)) + pair = Image.new("RGB", (448, 224)); pair.paste(logged, (0, 0)); pair.paste(Image.fromarray(A[0]), (224, 0)) + od = Path(args.out) / "validate_pairs"; od.mkdir(parents=True, exist_ok=True) + pair.save(od / f"{Path(sp).stem}_L2_{dd[0]:.0f}.png") + except Exception as e: + print(f"[rr] (pair save failed: {e})", flush=True) + print(f"[rr] VALIDATE rollouts @{args.cam_res}: mean {np.mean(dists):.2f} " + f"max {np.max(dists):.2f} (cache re-encoded from its own 256 pixels: 4.0-4.3)", + flush=True) + + if args.pool == "demos_replay": + # REPLAY the demonstration's logged actions live in the evaluator env from its + # logged initial state, recording what the env actually renders. Re-rendering + # from per-frame sim_state cannot reproduce a live render on the kitchen/study + # scenes (two fresh renders of the same state differ by 10-37 z-scored units; + # living rooms 3-4), so the only demo frames that are guaranteed to be in the + # evaluator's space are ones the evaluator itself produced along a trajectory. + # A demo whose replay does not end in success is inadmissible (same rule as + # rollouts) and is written with success=False so pack/BC can drop it. + import h5py, glob + n_done = n_ok = 0 + for h5 in sorted(glob.glob(f"{DEMO_H5}/*.hdf5")): + tname = Path(h5).stem[:-5] + tids = [i for i in range(10) if R.bench.get_task(i).name == tname] + if not tids: print(f"[rr] no task for {tname}"); continue + tid = tids[0]; env, ids = R.env(tid) + src_npz = sorted(glob.glob(f"{args.demo_cache}/{tname}_demo/demo_*.npz")) + with h5py.File(h5, "r") as H: + for sp in src_npz: + k = Path(sp).stem; op = Path(args.out) / f"{tname}_demo" / f"{k}.npz" + if op.exists(): continue + z0 = np.load(sp, allow_pickle=True) + acts = np.asarray(H["data"][k]["actions"][:], np.float32) + st0 = np.asarray(H["data"][k]["states"][0], np.float64) + env.reset(); env.env.sim.set_state_from_flattened(st0); env.env.sim.forward() + obs, _, _, _ = env.step(np.zeros(7)) + A, W, P = [], [], []; done = False + for a in acts: + A.append(to224(obs["agentview_image"][::-1, ::-1])) + W.append(to224(obs["robot0_eye_in_hand_image"][::-1, ::-1])) + P.append(np.concatenate([obs["robot0_eef_pos"], _eef_ori(obs), + obs["robot0_gripper_qpos"]]).astype(np.float32)) + obs, _, done, _ = env.step(a) + if done: break + T = len(A) + z = encode(tower, ids, np.stack(A), np.stack(W), dev, args.batch) + op.parent.mkdir(parents=True, exist_ok=True) + tmp = str(op) + ".tmp.npz" + np.savez(tmp, z=z, proprio=np.stack(P), actions=acts[:T], prompt=z0["prompt"], + success=bool(done), replayed=True) + os.replace(tmp, op); n_done += 1; n_ok += int(bool(done)) + print(f"[rr] demos_replay task {tid}: {len(src_npz)} episodes, replay success so far " + f"{n_ok}/{n_done}", flush=True) + print(f"[rr] DONE demos_replay: {n_done} episodes, {n_ok} reproduce success " + f"({n_ok / max(n_done, 1):.3f}) at cam_res={args.cam_res}", flush=True) + return + + if args.pool == "demos": + import h5py, glob + n_done = 0 + for h5 in sorted(glob.glob(f"{DEMO_H5}/*.hdf5")): + tname = Path(h5).stem[:-5] + tids = [i for i in range(10) if R.bench.get_task(i).name == tname] + if not tids: print(f"[rr] no task for {tname}"); continue + tid = tids[0]; _, ids = R.env(tid) + src_npz = sorted(glob.glob(f"{args.demo_cache}/{tname}_demo/demo_*.npz")) + with h5py.File(h5, "r") as H: + for sp in src_npz: + k = Path(sp).stem; op = Path(args.out) / f"{tname}_demo" / f"{k}.npz" + if op.exists(): continue + z0 = np.load(sp, allow_pickle=True) + states = np.asarray(H["data"][k]["states"][:]) + T = min(len(states), int(z0["z"].shape[0])) + A, W, P = R.frames(tid, states[:T]) + z = encode(tower, ids, A, W, dev, args.batch) + op.parent.mkdir(parents=True, exist_ok=True) + tmp = str(op) + ".tmp.npz" + np.savez(tmp, z=z, proprio=P, actions=z0["actions"][:T], prompt=z0["prompt"]) + os.replace(tmp, op); n_done += 1 + print(f"[rr] demos task {tid}: {len(src_npz)} episodes -> {args.out}/{tname}_demo " + f"(total written {n_done})", flush=True) + print(f"[rr] DONE demos: {n_done} episodes at cam_res={args.cam_res}", flush=True) + return + + if args.only_cache: + m = np.load(args.only_cache, allow_pickle=True) + srcs = [str(s) for s, d in zip(m["ep_src"], m["ep_demo"]) if not d] + else: + srcs = sorted(str(p) for p in Path(args.src).glob("*/ep_*.npz")) + srcs = srcs[args.shard::args.num_shards] + if args.limit: srcs = srcs[:args.limit] + print(f"[rr] shard {args.shard}/{args.num_shards}: {len(srcs)} episodes -> {args.out}", flush=True) + + t0 = time.time(); n_done = n_skip = 0 + for k, sp in enumerate(srcs): + rel = Path(sp).relative_to(args.src); op = Path(args.out) / rel + if op.exists(): n_skip += 1; continue + g = PAT.search(sp); t, b, i, idx = g.groups() + pp = (f"{PQ_ROOT}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + if not os.path.exists(pp): print(f"[rr] MISSING parquet {rel}", flush=True); continue + z0 = np.load(sp, allow_pickle=True); T = int(z0["z"].shape[0]) + tb = pq.read_table(pp, columns=["sim_state"]) + T = min(T, tb.num_rows) + states = np.stack([np.asarray(tb["sim_state"][j].as_py(), np.float64) for j in range(T)]) + tid = int(t) # from the FILENAME: the npz task_index field is wrong in the raw corpus (#234) + A, W, P = R.frames(tid, states) + _, ids = R.env(tid) + z = encode(tower, ids, A, W, dev, args.batch) + # proprio: the re-rendered observation, which is what the evaluator would feed; + # agrees with the logged `state` to float precision (checked: mean |d| = 0.0) + op.parent.mkdir(parents=True, exist_ok=True) + tmp = str(op) + ".tmp.npz" + np.savez(tmp, z=z, proprio=P, actions=z0["actions"][:T], success=z0["success"], + prompt=z0["prompt"], task_index=z0["task_index"]) + os.replace(tmp, op); n_done += 1 + if n_done % 25 == 0: + el = time.time() - t0 + print(f"[rr] {k+1}/{len(srcs)} done={n_done} skip={n_skip} {el/n_done:.1f}s/ep " + f"eta {(len(srcs)-k-1)*el/n_done/60:.0f} min", flush=True) + print(f"[rr] DONE shard {args.shard}: {n_done} written, {n_skip} existed", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/results/awr_is.json b/gen_q_rsm/rsm_libero/results/awr_is.json new file mode 100644 index 0000000000000000000000000000000000000000..e0e2edacbd8d7e92f9f78c0a8400a977dd1ecb25 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/awr_is.json @@ -0,0 +1,108 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/awr_is", + "rounds": 2, + "batch": 256, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 8, + "awr_beta": 3.0, + "w_max": 20.0, + "awr_steps": 2000, + "bc_steps": 6000, + "ratio_steps": 3000, + "wend_steps": 3000, + "use_is": true, + "seed": 0, + "in_ram": 0, + "policy_family": "flow", + "ratio_smooth": 0.0, + "d_z": 256 + }, + "rounds": [ + { + "round": 1, + "awr": [ + { + "step": 500, + "loss": 0.16257646679878235, + "mean_abs_adv": 1.6013294458389282, + "adv_std": 4.7013840675354, + "w_max_batch": 9.430573463439941 + }, + { + "step": 1000, + "loss": 0.1544513702392578, + "mean_abs_adv": 1.835625171661377, + "adv_std": 5.795838832855225, + "w_max_batch": 6.571922302246094 + }, + { + "step": 1500, + "loss": 0.15181061625480652, + "mean_abs_adv": 2.207453727722168, + "adv_std": 6.558887004852295, + "w_max_batch": 11.571876525878906 + }, + { + "step": 2000, + "loss": 0.15949973464012146, + "mean_abs_adv": 1.663811445236206, + "adv_std": 4.831233024597168, + "w_max_batch": 10.90399169921875 + } + ], + "score": { + "bc_nll_success": 0.17084458470344543, + "bc_nll_failure": 0.17130279541015625, + "act_gap": 0.00045821070671081543 + } + }, + { + "round": 2, + "awr": [ + { + "step": 500, + "loss": 0.15983301401138306, + "mean_abs_adv": 1.0695834159851074, + "adv_std": 3.722569704055786, + "w_max_batch": 9.685918807983398 + }, + { + "step": 1000, + "loss": 0.15429604053497314, + "mean_abs_adv": 0.7141176462173462, + "adv_std": 2.485543966293335, + "w_max_batch": 11.612875938415527 + }, + { + "step": 1500, + "loss": 0.20286273956298828, + "mean_abs_adv": 1.0271759033203125, + "adv_std": 3.73201847076416, + "w_max_batch": 11.328639030456543 + }, + { + "step": 2000, + "loss": 0.13324297964572906, + "mean_abs_adv": 0.9385720491409302, + "adv_std": 3.4402856826782227, + "w_max_batch": 11.071598052978516 + } + ], + "score": { + "bc_nll_success": 0.17699238657951355, + "bc_nll_failure": 0.1672143042087555, + "act_gap": -0.009778082370758057 + } + } + ], + "pi_0": { + "bc_nll_success": 0.17064538598060608, + "bc_nll_failure": 0.1876475065946579, + "act_gap": 0.01700212061405182 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/awr_nois.json b/gen_q_rsm/rsm_libero/results/awr_nois.json new file mode 100644 index 0000000000000000000000000000000000000000..be7c798a4a449d5411a50204727d4988c3d4c535 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/awr_nois.json @@ -0,0 +1,109 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/awr_nois", + "rounds": 2, + "batch": 256, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 8, + "awr_beta": 3.0, + "w_max": 20.0, + "awr_steps": 2000, + "bc_steps": 6000, + "ratio_steps": 3000, + "wend_steps": 3000, + "use_is": false, + "seed": 0, + "in_ram": 0, + "policy_family": "flow", + "awr_pool": "all", + "ratio_smooth": 0.0, + "d_z": 256 + }, + "rounds": [ + { + "round": 1, + "awr": [ + { + "step": 500, + "loss": 0.195926696062088, + "mean_abs_adv": 1.5207128524780273, + "adv_std": 3.9703404903411865, + "w_max_batch": 9.167509078979492 + }, + { + "step": 1000, + "loss": 0.1670464277267456, + "mean_abs_adv": 1.6043593883514404, + "adv_std": 3.9212582111358643, + "w_max_batch": 10.829105377197266 + }, + { + "step": 1500, + "loss": 0.15901966392993927, + "mean_abs_adv": 1.8362610340118408, + "adv_std": 5.85999870300293, + "w_max_batch": 10.425881385803223 + }, + { + "step": 2000, + "loss": 0.1412782222032547, + "mean_abs_adv": 1.9440784454345703, + "adv_std": 6.391367435455322, + "w_max_batch": 8.848503112792969 + } + ], + "score": { + "bc_nll_success": 0.17096398770809174, + "bc_nll_failure": 0.17207448184490204, + "act_gap": 0.0011104941368103027 + } + }, + { + "round": 2, + "awr": [ + { + "step": 500, + "loss": 0.1808767318725586, + "mean_abs_adv": 1.7913116216659546, + "adv_std": 5.498270034790039, + "w_max_batch": 8.57076644897461 + }, + { + "step": 1000, + "loss": 0.18697738647460938, + "mean_abs_adv": 1.5218538045883179, + "adv_std": 3.9496538639068604, + "w_max_batch": 6.969772815704346 + }, + { + "step": 1500, + "loss": 0.13867154717445374, + "mean_abs_adv": 2.0528721809387207, + "adv_std": 5.918031692504883, + "w_max_batch": 8.451258659362793 + }, + { + "step": 2000, + "loss": 0.19296662509441376, + "mean_abs_adv": 2.0750231742858887, + "adv_std": 6.377630710601807, + "w_max_batch": 6.74656867980957 + } + ], + "score": { + "bc_nll_success": 0.17648011445999146, + "bc_nll_failure": 0.16832603514194489, + "act_gap": -0.00815407931804657 + } + } + ], + "pi_0": { + "bc_nll_success": 0.17538213729858398, + "bc_nll_failure": 0.18425589799880981, + "act_gap": 0.00887376070022583 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/awr_pool_succ.json b/gen_q_rsm/rsm_libero/results/awr_pool_succ.json new file mode 100644 index 0000000000000000000000000000000000000000..d3928448f0904cbde94b699feb62d947004a4652 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/awr_pool_succ.json @@ -0,0 +1,95 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/awr_pool_succ", + "rounds": 2, + "batch": 256, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 8, + "awr_beta": 3.0, + "w_max": 20.0, + "awr_steps": 1500, + "bc_steps": 3000, + "ratio_steps": 1500, + "wend_steps": 1500, + "use_is": false, + "seed": 0, + "in_ram": 0, + "policy_family": "flow", + "awr_pool": "succ", + "ratio_smooth": 0.0, + "d_z": 256 + }, + "rounds": [ + { + "round": 1, + "awr": [ + { + "step": 500, + "loss": 0.203533336520195, + "mean_abs_adv": 3.2522952556610107, + "adv_std": 7.032632350921631, + "w_max_batch": 5.746964454650879 + }, + { + "step": 1000, + "loss": 0.1729510873556137, + "mean_abs_adv": 2.6058743000030518, + "adv_std": 5.858712673187256, + "w_max_batch": 11.027697563171387 + }, + { + "step": 1500, + "loss": 0.241312637925148, + "mean_abs_adv": 1.988947868347168, + "adv_std": 3.9411566257476807, + "w_max_batch": 10.441418647766113 + } + ], + "score": { + "bc_nll_success": 0.19998064637184143, + "bc_nll_failure": 0.21658773720264435, + "act_gap": 0.016607090830802917 + } + }, + { + "round": 2, + "awr": [ + { + "step": 500, + "loss": 0.14199835062026978, + "mean_abs_adv": 3.5519473552703857, + "adv_std": 8.122130393981934, + "w_max_batch": 6.081887245178223 + }, + { + "step": 1000, + "loss": 0.16939425468444824, + "mean_abs_adv": 2.661106824874878, + "adv_std": 5.243246555328369, + "w_max_batch": 5.711920738220215 + }, + { + "step": 1500, + "loss": 0.12747256457805634, + "mean_abs_adv": 2.00933575630188, + "adv_std": 4.834885120391846, + "w_max_batch": 7.9043755531311035 + } + ], + "score": { + "bc_nll_success": 0.20760184526443481, + "bc_nll_failure": 0.21295753121376038, + "act_gap": 0.0053556859493255615 + } + } + ], + "pi_0": { + "bc_nll_success": 0.18510574102401733, + "bc_nll_failure": 0.2062300741672516, + "act_gap": 0.021124333143234253 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/critic_actcon01_history.json b/gen_q_rsm/rsm_libero/results/critic_actcon01_history.json new file mode 100644 index 0000000000000000000000000000000000000000..34e202e884f3e65b1903716ae2474f1b57a39e3e --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/critic_actcon01_history.json @@ -0,0 +1,786 @@ +[ + { + "step": 2000, + "reward_auc": 0.9876610505450941, + "cfm_val": 0.25738441944122314, + "per_task": { + "0": { + "n": 100, + "action_gap": 0.004566409159451723, + "success_auc": 0.5842985842985843, + "succ_rate": 0.3700000047683716 + }, + "1": { + "n": 137, + "action_gap": -0.005876636598259211, + "success_auc": 0.4227956989247312, + "succ_rate": 0.45255473256111145 + }, + "2": { + "n": 156, + "action_gap": 0.01211931649595499, + "success_auc": 0.5297852474323063, + "succ_rate": 0.32692307233810425 + }, + "3": { + "n": 107, + "action_gap": 0.002370755886659026, + "success_auc": 0.45433996383363473, + "succ_rate": 0.2616822421550751 + }, + "4": { + "n": 76, + "action_gap": -0.013497255742549896, + "success_auc": 0.5821000704721635, + "succ_rate": 0.43421053886413574 + }, + "5": { + "n": 26, + "action_gap": -0.010058850049972534, + "success_auc": 0.6470588235294118, + "succ_rate": 0.6538461446762085 + }, + "6": { + "n": 93, + "action_gap": 0.010616077110171318, + "success_auc": 0.40674603174603174, + "succ_rate": 0.22580644488334656 + }, + "7": { + "n": 129, + "action_gap": 0.0065583945252001286, + "success_auc": 0.6056045666839647, + "succ_rate": 0.3643410801887512 + }, + "8": { + "n": 97, + "action_gap": -0.022468166425824165, + "success_auc": 0.5272078501338091, + "succ_rate": 0.39175257086753845 + }, + "9": { + "n": 103, + "action_gap": 0.006738460157066584, + "success_auc": 0.5214676034348166, + "succ_rate": 0.5922330021858215 + } + }, + "by_horizon": { + "0-50": { + "n": 115, + "action_gap": 0.037848301231861115, + "action_winrate": 0.6521739130434783, + "q_mean": 0.2682979106903076 + }, + "50-100": { + "n": 130, + "action_gap": -0.006974631920456886, + "action_winrate": 0.47692307692307695, + "q_mean": 0.055154867470264435 + }, + "100-200": { + "n": 245, + "action_gap": -0.01264046411961317, + "action_winrate": 0.4448979591836735, + "q_mean": 0.03335871174931526 + }, + "200+": { + "n": 534, + "action_gap": 0.0009504547924734652, + "action_winrate": 0.46441947565543074, + "q_mean": 0.0198063962161541 + } + }, + "latent_std_min": 0.18378838896751404, + "q_action_gap": 0.0008364089298993349, + "q_action_winrate": 0.482421875, + "q_success_auc": 0.5158398905234348, + "q_mean": 0.055443257093429565 + }, + { + "step": 4000, + "reward_auc": 0.9876276512175962, + "cfm_val": 0.17982925474643707, + "per_task": { + "0": { + "n": 104, + "action_gap": -0.018495649099349976, + "success_auc": 0.6214526214526215, + "succ_rate": 0.25961539149284363 + }, + "1": { + "n": 109, + "action_gap": -0.013799305073916912, + "success_auc": 0.4601889338731444, + "succ_rate": 0.47706422209739685 + }, + "2": { + "n": 134, + "action_gap": 0.015660826116800308, + "success_auc": 0.49041656018400204, + "succ_rate": 0.3208955228328705 + }, + "3": { + "n": 110, + "action_gap": 0.007917151786386967, + "success_auc": 0.4323962516733601, + "succ_rate": 0.2454545497894287 + }, + "4": { + "n": 104, + "action_gap": 0.007151569705456495, + "success_auc": 0.4701797385620915, + "succ_rate": 0.3461538553237915 + }, + "5": { + "n": 24, + "action_gap": -0.008169957436621189, + "success_auc": 0.75, + "succ_rate": 0.3333333432674408 + }, + "6": { + "n": 66, + "action_gap": 0.015843722969293594, + "success_auc": 0.7058823529411765, + "succ_rate": 0.25757575035095215 + }, + "7": { + "n": 147, + "action_gap": -0.005361799616366625, + "success_auc": 0.6405058209554396, + "succ_rate": 0.36054420471191406 + }, + "8": { + "n": 142, + "action_gap": -0.007460034918040037, + "success_auc": 0.4775747508305648, + "succ_rate": 0.39436620473861694 + }, + "9": { + "n": 84, + "action_gap": 0.020410602912306786, + "success_auc": 0.48788265306122447, + "succ_rate": 0.6666666865348816 + } + }, + "by_horizon": { + "0-50": { + "n": 129, + "action_gap": 0.040712807327508926, + "action_winrate": 0.5736434108527132, + "q_mean": 0.22582679986953735 + }, + "50-100": { + "n": 115, + "action_gap": -0.01250066515058279, + "action_winrate": 0.5130434782608696, + "q_mean": 0.031353823840618134 + }, + "100-200": { + "n": 246, + "action_gap": -0.014171958900988102, + "action_winrate": 0.516260162601626, + "q_mean": 0.013526356779038906 + }, + "200+": { + "n": 534, + "action_gap": 0.0012622518697753549, + "action_winrate": 0.5187265917602997, + "q_mean": 0.021329164505004883 + } + }, + "latent_std_min": 0.10585425049066544, + "q_action_gap": 0.000978628871962428, + "q_action_winrate": 0.5244140625, + "q_success_auc": 0.5189727786337955, + "q_mean": 0.0463423877954483 + }, + { + "step": 6000, + "reward_auc": 0.987619517466582, + "cfm_val": 0.1564761996269226, + "per_task": { + "0": { + "n": 108, + "action_gap": -0.0029598644468933344, + "success_auc": 0.6661812886785584, + "succ_rate": 0.37962964177131653 + }, + "1": { + "n": 111, + "action_gap": -0.012450174428522587, + "success_auc": 0.4107023411371237, + "succ_rate": 0.4144144058227539 + }, + "2": { + "n": 131, + "action_gap": 0.0009704058174975216, + "success_auc": 0.5333333333333333, + "succ_rate": 0.4580152630805969 + }, + "3": { + "n": 118, + "action_gap": 0.0006856883992440999, + "success_auc": 0.3781239857189224, + "succ_rate": 0.3305084705352783 + }, + "4": { + "n": 89, + "action_gap": 0.01947815716266632, + "success_auc": 0.600111234705228, + "succ_rate": 0.3483146131038666 + }, + "5": { + "n": 22, + "action_gap": -0.004661570303142071, + "success_auc": 0.7166666666666667, + "succ_rate": 0.5454545617103577 + }, + "6": { + "n": 86, + "action_gap": -0.009215174242854118, + "success_auc": 0.6065934065934065, + "succ_rate": 0.24418604373931885 + }, + "7": { + "n": 153, + "action_gap": 0.0005523079307749867, + "success_auc": 0.7152777777777778, + "succ_rate": 0.37254902720451355 + }, + "8": { + "n": 110, + "action_gap": 0.011075697839260101, + "success_auc": 0.5532801110725443, + "succ_rate": 0.3909091055393219 + }, + "9": { + "n": 96, + "action_gap": 0.026935627683997154, + "success_auc": 0.4722858451672011, + "succ_rate": 0.6145833134651184 + } + }, + "by_horizon": { + "0-50": { + "n": 131, + "action_gap": 0.0486595593392849, + "action_winrate": 0.5954198473282443, + "q_mean": 0.22337323427200317 + }, + "50-100": { + "n": 138, + "action_gap": -0.0038172707427293062, + "action_winrate": 0.572463768115942, + "q_mean": 0.03140514716506004 + }, + "100-200": { + "n": 256, + "action_gap": -0.0018287473358213902, + "action_winrate": 0.5078125, + "q_mean": 0.017960501834750175 + }, + "200+": { + "n": 499, + "action_gap": -0.004300427623093128, + "action_winrate": 0.4348697394789579, + "q_mean": 0.02231152355670929 + } + }, + "latent_std_min": 0.1156306192278862, + "q_action_gap": 0.0031577597837895155, + "q_action_winrate": 0.4921875, + "q_success_auc": 0.5466356570656171, + "q_mean": 0.048171039670705795 + }, + { + "step": 8000, + "reward_auc": 0.9923620933521924, + "cfm_val": 0.1500718593597412, + "per_task": { + "0": { + "n": 88, + "action_gap": 0.001879670424386859, + "success_auc": 0.6567493112947659, + "succ_rate": 0.375 + }, + "1": { + "n": 112, + "action_gap": -0.013231679797172546, + "success_auc": 0.428890306122449, + "succ_rate": 0.5 + }, + "2": { + "n": 156, + "action_gap": 0.011789332143962383, + "success_auc": 0.6479665940450254, + "succ_rate": 0.3461538553237915 + }, + "3": { + "n": 110, + "action_gap": -7.351743261096999e-05, + "success_auc": 0.4026442307692308, + "succ_rate": 0.290909081697464 + }, + "4": { + "n": 114, + "action_gap": 0.02756674960255623, + "success_auc": 0.6703964194373402, + "succ_rate": 0.4035087823867798 + }, + "5": { + "n": 23, + "action_gap": -0.0038583874702453613, + "success_auc": 0.8384615384615385, + "succ_rate": 0.5652173757553101 + }, + "6": { + "n": 88, + "action_gap": 0.030580373480916023, + "success_auc": 0.6935483870967742, + "succ_rate": 0.2954545319080353 + }, + "7": { + "n": 129, + "action_gap": 0.003452255390584469, + "success_auc": 0.7311827956989247, + "succ_rate": 0.27906978130340576 + }, + "8": { + "n": 126, + "action_gap": -0.003117024665698409, + "success_auc": 0.3851744186046512, + "succ_rate": 0.3174603283405304 + }, + "9": { + "n": 78, + "action_gap": 0.00961407832801342, + "success_auc": 0.5909722222222222, + "succ_rate": 0.6153846383094788 + } + }, + "by_horizon": { + "0-50": { + "n": 129, + "action_gap": 0.050272565335035324, + "action_winrate": 0.5038759689922481, + "q_mean": 0.21413478255271912 + }, + "50-100": { + "n": 115, + "action_gap": 0.004295047372579575, + "action_winrate": 0.591304347826087, + "q_mean": 0.010329574346542358 + }, + "100-200": { + "n": 276, + "action_gap": -0.0049506304785609245, + "action_winrate": 0.5036231884057971, + "q_mean": 0.009217144921422005 + }, + "200+": { + "n": 504, + "action_gap": 0.0028754533268511295, + "action_winrate": 0.49404761904761907, + "q_mean": 0.013028163462877274 + } + }, + "latent_std_min": 0.11352813243865967, + "q_action_gap": 0.006896430626511574, + "q_action_winrate": 0.5087890625, + "q_success_auc": 0.585498046875, + "q_mean": 0.037032630294561386 + }, + { + "step": 10000, + "reward_auc": 0.9923778851315084, + "cfm_val": 0.12619173526763916, + "per_task": { + "0": { + "n": 98, + "action_gap": 0.008085733279585838, + "success_auc": 0.6601477618426771, + "succ_rate": 0.3979591727256775 + }, + "1": { + "n": 117, + "action_gap": -0.017585037276148796, + "success_auc": 0.45784198113207547, + "succ_rate": 0.45299145579338074 + }, + "2": { + "n": 145, + "action_gap": -0.006606878712773323, + "success_auc": 0.7018947368421052, + "succ_rate": 0.3448275923728943 + }, + "3": { + "n": 102, + "action_gap": -0.0062676831148564816, + "success_auc": 0.45077220077220076, + "succ_rate": 0.27450981736183167 + }, + "4": { + "n": 94, + "action_gap": 0.008275660686194897, + "success_auc": 0.6149193548387096, + "succ_rate": 0.3404255211353302 + }, + "5": { + "n": 23, + "action_gap": 0.0049131689593195915, + "success_auc": 0.9705882352941176, + "succ_rate": 0.260869562625885 + }, + "6": { + "n": 90, + "action_gap": 0.024443859234452248, + "success_auc": 0.6631016042780749, + "succ_rate": 0.24444444477558136 + }, + "7": { + "n": 158, + "action_gap": 0.016934383660554886, + "success_auc": 0.7546551724137931, + "succ_rate": 0.3670886158943176 + }, + "8": { + "n": 119, + "action_gap": 0.001397809013724327, + "success_auc": 0.4739952718676123, + "succ_rate": 0.3949579894542694 + }, + "9": { + "n": 78, + "action_gap": 0.022675467655062675, + "success_auc": 0.5071010860484545, + "succ_rate": 0.7307692170143127 + } + }, + "by_horizon": { + "0-50": { + "n": 123, + "action_gap": 0.05798455327749252, + "action_winrate": 0.5772357723577236, + "q_mean": 0.2775479257106781 + }, + "50-100": { + "n": 123, + "action_gap": 0.004857067484408617, + "action_winrate": 0.5121951219512195, + "q_mean": 0.03623020276427269 + }, + "100-200": { + "n": 281, + "action_gap": -0.0038929434958845377, + "action_winrate": 0.45907473309608543, + "q_mean": 0.0360763780772686 + }, + "200+": { + "n": 497, + "action_gap": -0.003614547196775675, + "action_winrate": 0.47283702213279677, + "q_mean": 0.026242343708872795 + } + }, + "latent_std_min": 0.12484024465084076, + "q_action_gap": 0.004725754261016846, + "q_action_winrate": 0.486328125, + "q_success_auc": 0.595913523637303, + "q_mean": 0.060326773673295975 + }, + { + "step": 12000, + "reward_auc": 0.9876347116189305, + "cfm_val": 0.1233709380030632, + "per_task": { + "0": { + "n": 103, + "action_gap": 0.005045799538493156, + "success_auc": 0.7376760563380281, + "succ_rate": 0.3106796145439148 + }, + "1": { + "n": 118, + "action_gap": -0.00090402876958251, + "success_auc": 0.6080069124423964, + "succ_rate": 0.47457626461982727 + }, + "2": { + "n": 129, + "action_gap": 0.004968222696334124, + "success_auc": 0.7342696629213483, + "succ_rate": 0.3100775182247162 + }, + "3": { + "n": 105, + "action_gap": 0.002376304008066654, + "success_auc": 0.6008163265306122, + "succ_rate": 0.3333333432674408 + }, + "4": { + "n": 97, + "action_gap": 0.0065465266816318035, + "success_auc": 0.756021409455843, + "succ_rate": 0.39175257086753845 + }, + "5": { + "n": 24, + "action_gap": 0.01102861762046814, + "success_auc": 0.9785714285714285, + "succ_rate": 0.5833333134651184 + }, + "6": { + "n": 86, + "action_gap": 0.0038813373539596796, + "success_auc": 0.4214963119072708, + "succ_rate": 0.151162788271904 + }, + "7": { + "n": 140, + "action_gap": -0.0022797761484980583, + "success_auc": 0.7220990391722099, + "succ_rate": 0.2928571403026581 + }, + "8": { + "n": 128, + "action_gap": 0.007921185344457626, + "success_auc": 0.5657476139978791, + "succ_rate": 0.359375 + }, + "9": { + "n": 94, + "action_gap": -0.0014507672749459743, + "success_auc": 0.4441391941391941, + "succ_rate": 0.5531914830207825 + } + }, + "by_horizon": { + "0-50": { + "n": 124, + "action_gap": 0.027390604838728905, + "action_winrate": 0.5887096774193549, + "q_mean": 0.19646181166172028 + }, + "50-100": { + "n": 126, + "action_gap": 0.008937668986618519, + "action_winrate": 0.5952380952380952, + "q_mean": 0.035325318574905396 + }, + "100-200": { + "n": 255, + "action_gap": -0.0027388862799853086, + "action_winrate": 0.4980392156862745, + "q_mean": 0.018841728568077087 + }, + "200+": { + "n": 519, + "action_gap": -0.0014043253613635898, + "action_winrate": 0.47398843930635837, + "q_mean": 0.00328398821875453 + } + }, + "latent_std_min": 0.13129401206970215, + "q_action_gap": 0.0030227736569941044, + "q_action_winrate": 0.5087890625, + "q_success_auc": 0.6288637560706539, + "q_mean": 0.034493446350097656 + }, + { + "step": 14000, + "reward_auc": 0.9906342913776016, + "cfm_val": 0.11462379992008209, + "per_task": { + "0": { + "n": 89, + "action_gap": 0.005121784750372171, + "success_auc": 0.665079365079365, + "succ_rate": 0.3932584226131439 + }, + "1": { + "n": 115, + "action_gap": -0.007077975198626518, + "success_auc": 0.5030637254901961, + "succ_rate": 0.4434782564640045 + }, + "2": { + "n": 167, + "action_gap": 0.012538731098175049, + "success_auc": 0.7364824717765894, + "succ_rate": 0.4071856141090393 + }, + "3": { + "n": 110, + "action_gap": 0.0010763962054625154, + "success_auc": 0.6112637362637363, + "succ_rate": 0.23636363446712494 + }, + "4": { + "n": 63, + "action_gap": 0.0034723386634141207, + "success_auc": 0.7493606138107417, + "succ_rate": 0.2698412835597992 + }, + "5": { + "n": 23, + "action_gap": -0.007009751163423061, + "success_auc": 0.9230769230769231, + "succ_rate": 0.5652173757553101 + }, + "6": { + "n": 88, + "action_gap": 0.00752568244934082, + "success_auc": 0.7718550106609808, + "succ_rate": 0.23863635957241058 + }, + "7": { + "n": 177, + "action_gap": -0.004055559169501066, + "success_auc": 0.7535563751317176, + "succ_rate": 0.4124293923377991 + }, + "8": { + "n": 107, + "action_gap": 0.010423188097774982, + "success_auc": 0.5270785659801678, + "succ_rate": 0.35514017939567566 + }, + "9": { + "n": 85, + "action_gap": 0.03035472333431244, + "success_auc": 0.5923645320197044, + "succ_rate": 0.658823549747467 + } + }, + "by_horizon": { + "0-50": { + "n": 118, + "action_gap": 0.029233518987894058, + "action_winrate": 0.6016949152542372, + "q_mean": 0.3040999472141266 + }, + "50-100": { + "n": 123, + "action_gap": 0.004453870002180338, + "action_winrate": 0.5284552845528455, + "q_mean": 0.050180476158857346 + }, + "100-200": { + "n": 242, + "action_gap": 0.0020689768716692924, + "action_winrate": 0.48760330578512395, + "q_mean": 0.015485279262065887 + }, + "200+": { + "n": 541, + "action_gap": 0.001947433571331203, + "action_winrate": 0.48613678373382624, + "q_mean": 0.013620138168334961 + } + }, + "latent_std_min": 0.12894012033939362, + "q_action_gap": 0.005421518348157406, + "q_action_winrate": 0.5048828125, + "q_success_auc": 0.6192664600960072, + "q_mean": 0.05192571133375168 + }, + { + "step": 16000, + "reward_auc": 0.9956026204792247, + "cfm_val": 0.13298256695270538, + "per_task": { + "0": { + "n": 81, + "action_gap": 0.012630690820515156, + "success_auc": 0.8055944055944056, + "succ_rate": 0.32098764181137085 + }, + "1": { + "n": 129, + "action_gap": -0.0008594573009759188, + "success_auc": 0.6262183235867447, + "succ_rate": 0.44186046719551086 + }, + "2": { + "n": 152, + "action_gap": 0.010547131299972534, + "success_auc": 0.8338224504768892, + "succ_rate": 0.3815789520740509 + }, + "3": { + "n": 109, + "action_gap": -0.00010792343528009951, + "success_auc": 0.6195238095238095, + "succ_rate": 0.2293577939271927 + }, + "4": { + "n": 105, + "action_gap": 0.02172073908150196, + "success_auc": 0.6946938775510204, + "succ_rate": 0.3333333432674408 + }, + "5": { + "n": 24, + "action_gap": -0.0010894726729020476, + "success_auc": 0.993006993006993, + "succ_rate": 0.5416666865348816 + }, + "6": { + "n": 77, + "action_gap": 0.0006615500897169113, + "success_auc": 0.5631578947368421, + "succ_rate": 0.25974026322364807 + }, + "7": { + "n": 132, + "action_gap": -0.002495224354788661, + "success_auc": 0.788235294117647, + "succ_rate": 0.35606059432029724 + }, + "8": { + "n": 123, + "action_gap": 0.004555290564894676, + "success_auc": 0.6388888888888888, + "succ_rate": 0.2926829159259796 + }, + "9": { + "n": 92, + "action_gap": 0.00992683507502079, + "success_auc": 0.5723958333333333, + "succ_rate": 0.6521739363670349 + } + }, + "by_horizon": { + "0-50": { + "n": 120, + "action_gap": 0.04743295535445213, + "action_winrate": 0.5416666666666666, + "q_mean": 0.16258755326271057 + }, + "50-100": { + "n": 123, + "action_gap": -0.004087105859071016, + "action_winrate": 0.5040650406504065, + "q_mean": 0.012095688842236996 + }, + "100-200": { + "n": 241, + "action_gap": 0.0004168970917817205, + "action_winrate": 0.43983402489626555, + "q_mean": 0.00493627181276679 + }, + "200+": { + "n": 540, + "action_gap": 0.0012288391590118408, + "action_winrate": 0.46296296296296297, + "q_mean": 0.005437801126390696 + } + }, + "latent_std_min": 0.11616120487451553, + "q_action_gap": 0.00581375602632761, + "q_action_winrate": 0.4716796875, + "q_success_auc": 0.6760932932653873, + "q_mean": 0.02453547902405262 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/critic_base_history.json b/gen_q_rsm/rsm_libero/results/critic_base_history.json new file mode 100644 index 0000000000000000000000000000000000000000..a4b18afb4b012336c8203146d106e40120423540 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/critic_base_history.json @@ -0,0 +1,786 @@ +[ + { + "step": 2000, + "reward_auc": 0.9877931945820945, + "cfm_val": 0.2719613313674927, + "per_task": { + "0": { + "n": 100, + "action_gap": 0.006409567780792713, + "success_auc": 0.5019305019305019, + "succ_rate": 0.3700000047683716 + }, + "1": { + "n": 137, + "action_gap": -0.0006269386503845453, + "success_auc": 0.42838709677419357, + "succ_rate": 0.45255473256111145 + }, + "2": { + "n": 156, + "action_gap": -0.007360421121120453, + "success_auc": 0.48328664799253035, + "succ_rate": 0.32692307233810425 + }, + "3": { + "n": 107, + "action_gap": -0.0035040834918618202, + "success_auc": 0.4421338155515371, + "succ_rate": 0.2616822421550751 + }, + "4": { + "n": 76, + "action_gap": 0.00958211813122034, + "success_auc": 0.5010570824524313, + "succ_rate": 0.43421053886413574 + }, + "5": { + "n": 26, + "action_gap": 0.016778195276856422, + "success_auc": 0.7712418300653595, + "succ_rate": 0.6538461446762085 + }, + "6": { + "n": 93, + "action_gap": 0.0034999591298401356, + "success_auc": 0.4662698412698413, + "succ_rate": 0.22580644488334656 + }, + "7": { + "n": 129, + "action_gap": 0.002188619691878557, + "success_auc": 0.5111572392319668, + "succ_rate": 0.3643410801887512 + }, + "8": { + "n": 97, + "action_gap": 0.004824227187782526, + "success_auc": 0.49910793933987513, + "succ_rate": 0.39175257086753845 + }, + "9": { + "n": 103, + "action_gap": 0.0015593749703839421, + "success_auc": 0.49882903981264637, + "succ_rate": 0.5922330021858215 + } + }, + "by_horizon": { + "0-50": { + "n": 115, + "action_gap": 0.04457010701298714, + "action_winrate": 0.5391304347826087, + "q_mean": 0.258619099855423 + }, + "50-100": { + "n": 130, + "action_gap": 0.0029214469250291586, + "action_winrate": 0.5538461538461539, + "q_mean": 0.059412311762571335 + }, + "100-200": { + "n": 245, + "action_gap": -0.006007762625813484, + "action_winrate": 0.4489795918367347, + "q_mean": 0.03499697521328926 + }, + "200+": { + "n": 534, + "action_gap": -0.00487018097192049, + "action_winrate": 0.5056179775280899, + "q_mean": 0.016915302723646164 + } + }, + "latent_std_min": 0.15928788483142853, + "q_action_gap": 0.0013991909800097346, + "q_action_winrate": 0.501953125, + "q_success_auc": 0.49751061560443544, + "q_mean": 0.05378107726573944 + }, + { + "step": 4000, + "reward_auc": 0.9918061033043611, + "cfm_val": 0.17078743875026703, + "per_task": { + "0": { + "n": 90, + "action_gap": 0.006965033244341612, + "success_auc": 0.6233836206896551, + "succ_rate": 0.35555556416511536 + }, + "1": { + "n": 104, + "action_gap": -0.004016174003481865, + "success_auc": 0.4863636363636364, + "succ_rate": 0.42307692766189575 + }, + "2": { + "n": 138, + "action_gap": -0.007320027332752943, + "success_auc": 0.4710648148148148, + "succ_rate": 0.3478260934352875 + }, + "3": { + "n": 124, + "action_gap": 0.016234273090958595, + "success_auc": 0.4537373737373737, + "succ_rate": 0.2016129046678543 + }, + "4": { + "n": 101, + "action_gap": 0.004218746442347765, + "success_auc": 0.542572463768116, + "succ_rate": 0.31683167815208435 + }, + "5": { + "n": 18, + "action_gap": 0.028326719999313354, + "success_auc": 0.7901234567901234, + "succ_rate": 0.5 + }, + "6": { + "n": 80, + "action_gap": 0.028160223737359047, + "success_auc": 0.6538201487491548, + "succ_rate": 0.36250001192092896 + }, + "7": { + "n": 159, + "action_gap": 0.0043665445409715176, + "success_auc": 0.609965034965035, + "succ_rate": 0.3459119498729706 + }, + "8": { + "n": 129, + "action_gap": 0.005183717235922813, + "success_auc": 0.6113013698630136, + "succ_rate": 0.43410852551460266 + }, + "9": { + "n": 81, + "action_gap": 0.028182461857795715, + "success_auc": 0.4458064516129032, + "succ_rate": 0.6172839403152466 + } + }, + "by_horizon": { + "0-50": { + "n": 134, + "action_gap": 0.06312573701143265, + "action_winrate": 0.5970149253731343, + "q_mean": 0.28379589319229126 + }, + "50-100": { + "n": 121, + "action_gap": 0.012869387865066528, + "action_winrate": 0.5537190082644629, + "q_mean": 0.03760857135057449 + }, + "100-200": { + "n": 249, + "action_gap": -0.0013214896898716688, + "action_winrate": 0.5461847389558233, + "q_mean": 0.022991467267274857 + }, + "200+": { + "n": 520, + "action_gap": -0.003154587931931019, + "action_winrate": 0.43653846153846154, + "q_mean": 0.016621064394712448 + } + }, + "latent_std_min": 0.1195826530456543, + "q_action_gap": 0.007858015596866608, + "q_action_winrate": 0.498046875, + "q_success_auc": 0.5521330500163452, + "q_mean": 0.05561242252588272 + }, + { + "step": 6000, + "reward_auc": 0.9877277214394687, + "cfm_val": 0.14670471847057343, + "per_task": { + "0": { + "n": 114, + "action_gap": -0.0017151666106656194, + "success_auc": 0.6476650563607085, + "succ_rate": 0.3947368562221527 + }, + "1": { + "n": 117, + "action_gap": -0.00499859219416976, + "success_auc": 0.36208955223880596, + "succ_rate": 0.4273504316806793 + }, + "2": { + "n": 151, + "action_gap": -0.009663020260632038, + "success_auc": 0.48579545454545453, + "succ_rate": 0.3642384111881256 + }, + "3": { + "n": 95, + "action_gap": 0.013272133655846119, + "success_auc": 0.3953846153846154, + "succ_rate": 0.31578946113586426 + }, + "4": { + "n": 92, + "action_gap": 0.008168470114469528, + "success_auc": 0.6130831643002028, + "succ_rate": 0.3695652186870575 + }, + "5": { + "n": 28, + "action_gap": 0.010491804219782352, + "success_auc": 0.5935828877005348, + "succ_rate": 0.3928571343421936 + }, + "6": { + "n": 79, + "action_gap": -0.0009604941587895155, + "success_auc": 0.6393034825870647, + "succ_rate": 0.15189872682094574 + }, + "7": { + "n": 143, + "action_gap": 0.002327292924746871, + "success_auc": 0.6429769392033543, + "succ_rate": 0.37062937021255493 + }, + "8": { + "n": 123, + "action_gap": 0.003327814396470785, + "success_auc": 0.48412698412698413, + "succ_rate": 0.3414634168148041 + }, + "9": { + "n": 82, + "action_gap": 0.004303997382521629, + "success_auc": 0.3740350877192982, + "succ_rate": 0.6951219439506531 + } + }, + "by_horizon": { + "0-50": { + "n": 120, + "action_gap": 0.017688516527414322, + "action_winrate": 0.5833333333333334, + "q_mean": 0.19690124690532684 + }, + "50-100": { + "n": 140, + "action_gap": -0.0035559427924454212, + "action_winrate": 0.5142857142857142, + "q_mean": 0.035192739218473434 + }, + "100-200": { + "n": 248, + "action_gap": -0.006306999828666449, + "action_winrate": 0.5, + "q_mean": 0.010996377095580101 + }, + "200+": { + "n": 516, + "action_gap": 0.0019867457449436188, + "action_winrate": 0.48643410852713176, + "q_mean": 0.012091262266039848 + } + }, + "latent_std_min": 0.12486922740936279, + "q_action_gap": 0.00106036604847759, + "q_action_winrate": 0.5048828125, + "q_success_auc": 0.5337773009736251, + "q_mean": 0.0366419181227684 + }, + { + "step": 8000, + "reward_auc": 0.9926145839060238, + "cfm_val": 0.13243581354618073, + "per_task": { + "0": { + "n": 103, + "action_gap": -0.007044427562505007, + "success_auc": 0.6183978873239436, + "succ_rate": 0.3106796145439148 + }, + "1": { + "n": 115, + "action_gap": 0.00042230208055116236, + "success_auc": 0.5823244552058111, + "succ_rate": 0.5130434632301331 + }, + "2": { + "n": 144, + "action_gap": 0.0024494652170687914, + "success_auc": 0.5689453125, + "succ_rate": 0.4444444477558136 + }, + "3": { + "n": 112, + "action_gap": 0.005480488296598196, + "success_auc": 0.4014336917562724, + "succ_rate": 0.2767857015132904 + }, + "4": { + "n": 102, + "action_gap": 0.0025110540445894003, + "success_auc": 0.5699013157894737, + "succ_rate": 0.37254902720451355 + }, + "5": { + "n": 26, + "action_gap": 0.00364819192327559, + "success_auc": 0.7810650887573964, + "succ_rate": 0.5 + }, + "6": { + "n": 79, + "action_gap": -0.0009238740894943476, + "success_auc": 0.6669085631349783, + "succ_rate": 0.3291139304637909 + }, + "7": { + "n": 127, + "action_gap": -0.00818592868745327, + "success_auc": 0.6187012987012988, + "succ_rate": 0.3937007784843445 + }, + "8": { + "n": 134, + "action_gap": 0.01101685967296362, + "success_auc": 0.4859437751004016, + "succ_rate": 0.3805970251560211 + }, + "9": { + "n": 82, + "action_gap": 0.03006887063384056, + "success_auc": 0.5240384615384616, + "succ_rate": 0.6829268336296082 + } + }, + "by_horizon": { + "0-50": { + "n": 117, + "action_gap": 0.06807809323072433, + "action_winrate": 0.6068376068376068, + "q_mean": 0.29577046632766724 + }, + "50-100": { + "n": 125, + "action_gap": 0.007352953311055899, + "action_winrate": 0.552, + "q_mean": 0.035094257444143295 + }, + "100-200": { + "n": 277, + "action_gap": -0.011254442855715752, + "action_winrate": 0.4729241877256318, + "q_mean": 0.031610190868377686 + }, + "200+": { + "n": 505, + "action_gap": -0.004548436962068081, + "action_winrate": 0.4316831683168317, + "q_mean": 0.014708572998642921 + } + }, + "latent_std_min": 0.13052812218666077, + "q_action_gap": 0.003388490993529558, + "q_action_winrate": 0.4775390625, + "q_success_auc": 0.5410753705455692, + "q_mean": 0.05388259142637253 + }, + { + "step": 10000, + "reward_auc": 0.9952735788801362, + "cfm_val": 0.12641239166259766, + "per_task": { + "0": { + "n": 93, + "action_gap": 0.00958632118999958, + "success_auc": 0.5436280137772675, + "succ_rate": 0.2795698940753937 + }, + "1": { + "n": 114, + "action_gap": 0.004666919354349375, + "success_auc": 0.5947611710323575, + "succ_rate": 0.5175438523292542 + }, + "2": { + "n": 149, + "action_gap": 0.008862324059009552, + "success_auc": 0.617196056955093, + "succ_rate": 0.4429530203342438 + }, + "3": { + "n": 115, + "action_gap": -8.788835839368403e-05, + "success_auc": 0.4393939393939394, + "succ_rate": 0.2869565188884735 + }, + "4": { + "n": 112, + "action_gap": -0.0038778905291110277, + "success_auc": 0.7638474295190714, + "succ_rate": 0.4017857015132904 + }, + "5": { + "n": 23, + "action_gap": 0.013691545464098454, + "success_auc": 0.8409090909090909, + "succ_rate": 0.52173912525177 + }, + "6": { + "n": 83, + "action_gap": 0.009849518537521362, + "success_auc": 0.6374807987711214, + "succ_rate": 0.2530120611190796 + }, + "7": { + "n": 134, + "action_gap": -0.0017945445142686367, + "success_auc": 0.7155835080363382, + "succ_rate": 0.3955223858356476 + }, + "8": { + "n": 140, + "action_gap": -9.543576743453741e-05, + "success_auc": 0.5804810360777058, + "succ_rate": 0.3285714387893677 + }, + "9": { + "n": 61, + "action_gap": -0.0006616313476115465, + "success_auc": 0.5769230769230769, + "succ_rate": 0.5737704634666443 + } + }, + "by_horizon": { + "0-50": { + "n": 110, + "action_gap": 0.04189131036400795, + "action_winrate": 0.6090909090909091, + "q_mean": 0.22503556311130524 + }, + "50-100": { + "n": 145, + "action_gap": 0.002932266565039754, + "action_winrate": 0.503448275862069, + "q_mean": 0.01357592549175024 + }, + "100-200": { + "n": 255, + "action_gap": -0.0037341732531785965, + "action_winrate": 0.4470588235294118, + "q_mean": 0.008922974579036236 + }, + "200+": { + "n": 514, + "action_gap": -0.0018349618185311556, + "action_winrate": 0.4669260700389105, + "q_mean": 0.007097852881997824 + } + }, + "latent_std_min": 0.11313363909721375, + "q_action_gap": 0.0030642952769994736, + "q_action_winrate": 0.482421875, + "q_success_auc": 0.5804743292800618, + "q_mean": 0.0318809375166893 + }, + { + "step": 12000, + "reward_auc": 0.9875996015936255, + "cfm_val": 0.14582675695419312, + "per_task": { + "0": { + "n": 106, + "action_gap": 0.019602810963988304, + "success_auc": 0.5134803921568627, + "succ_rate": 0.3207547068595886 + }, + "1": { + "n": 127, + "action_gap": 0.006570063065737486, + "success_auc": 0.5638350720317934, + "succ_rate": 0.4803149700164795 + }, + "2": { + "n": 150, + "action_gap": -0.005994896870106459, + "success_auc": 0.618923449431924, + "succ_rate": 0.3933333456516266 + }, + "3": { + "n": 114, + "action_gap": 0.0037662810645997524, + "success_auc": 0.44189016602809705, + "succ_rate": 0.2368421107530594 + }, + "4": { + "n": 89, + "action_gap": 0.016635524109005928, + "success_auc": 0.6725571725571725, + "succ_rate": 0.4157303273677826 + }, + "5": { + "n": 17, + "action_gap": 0.027434324845671654, + "success_auc": 1.0, + "succ_rate": 0.529411792755127 + }, + "6": { + "n": 80, + "action_gap": 0.008997109718620777, + "success_auc": 0.7337526205450734, + "succ_rate": 0.3375000059604645 + }, + "7": { + "n": 123, + "action_gap": -0.0023393582087010145, + "success_auc": 0.738204833141542, + "succ_rate": 0.35772356390953064 + }, + "8": { + "n": 135, + "action_gap": 0.012750799767673016, + "success_auc": 0.5908029878618114, + "succ_rate": 0.3777777850627899 + }, + "9": { + "n": 83, + "action_gap": 0.04165320843458176, + "success_auc": 0.6290322580645161, + "succ_rate": 0.6265060305595398 + } + }, + "by_horizon": { + "0-50": { + "n": 141, + "action_gap": 0.06903799623250961, + "action_winrate": 0.6453900709219859, + "q_mean": 0.1966162919998169 + }, + "50-100": { + "n": 137, + "action_gap": 0.013401753269135952, + "action_winrate": 0.5693430656934306, + "q_mean": 0.04996121674776077 + }, + "100-200": { + "n": 262, + "action_gap": -0.002184053650125861, + "action_winrate": 0.5229007633587787, + "q_mean": 0.00442706560716033 + }, + "200+": { + "n": 484, + "action_gap": -0.0020624196622520685, + "action_winrate": 0.47107438016528924, + "q_mean": 0.004376966040581465 + } + }, + "latent_std_min": 0.11370516568422318, + "q_action_gap": 0.009765589609742165, + "q_action_winrate": 0.521484375, + "q_success_auc": 0.598435692470269, + "q_mean": 0.03695891052484512 + }, + { + "step": 14000, + "reward_auc": 0.9930000897424393, + "cfm_val": 0.11024355888366699, + "per_task": { + "0": { + "n": 105, + "action_gap": 0.006106030195951462, + "success_auc": 0.647887323943662, + "succ_rate": 0.32380953431129456 + }, + "1": { + "n": 100, + "action_gap": 0.0031750958878546953, + "success_auc": 0.5752709755118426, + "succ_rate": 0.4699999988079071 + }, + "2": { + "n": 146, + "action_gap": 0.0011619975557550788, + "success_auc": 0.7397233586596532, + "succ_rate": 0.4041095972061157 + }, + "3": { + "n": 132, + "action_gap": -0.001316036214120686, + "success_auc": 0.5952871870397644, + "succ_rate": 0.2651515007019043 + }, + "4": { + "n": 85, + "action_gap": 0.03164169192314148, + "success_auc": 0.5798368298368298, + "succ_rate": 0.38823530077934265 + }, + "5": { + "n": 22, + "action_gap": 0.0435030423104763, + "success_auc": 1.0, + "succ_rate": 0.5454545617103577 + }, + "6": { + "n": 87, + "action_gap": 0.019851239398121834, + "success_auc": 0.6884920634920635, + "succ_rate": 0.27586206793785095 + }, + "7": { + "n": 129, + "action_gap": -0.0024974446278065443, + "success_auc": 0.7235294117647059, + "succ_rate": 0.26356589794158936 + }, + "8": { + "n": 137, + "action_gap": 0.0035060448572039604, + "success_auc": 0.5772413793103448, + "succ_rate": 0.36496350169181824 + }, + "9": { + "n": 81, + "action_gap": 0.03467779606580734, + "success_auc": 0.4585714285714286, + "succ_rate": 0.6913580298423767 + } + }, + "by_horizon": { + "0-50": { + "n": 128, + "action_gap": 0.05899292230606079, + "action_winrate": 0.609375, + "q_mean": 0.30233797430992126 + }, + "50-100": { + "n": 139, + "action_gap": 0.004043913912028074, + "action_winrate": 0.49640287769784175, + "q_mean": 0.045786742120981216 + }, + "100-200": { + "n": 248, + "action_gap": 0.0032756340224295855, + "action_winrate": 0.5, + "q_mean": 0.016110241413116455 + }, + "200+": { + "n": 509, + "action_gap": 0.0007264256710186601, + "action_winrate": 0.4911591355599214, + "q_mean": 0.014695562422275543 + } + }, + "latent_std_min": 0.1204683780670166, + "q_action_gap": 0.009077447466552258, + "q_action_winrate": 0.5087890625, + "q_success_auc": 0.6366617838541667, + "q_mean": 0.055213868618011475 + }, + { + "step": 16000, + "reward_auc": 0.9877941981390257, + "cfm_val": 0.13146889209747314, + "per_task": { + "0": { + "n": 96, + "action_gap": 0.004865909926593304, + "success_auc": 0.7935483870967742, + "succ_rate": 0.3229166567325592 + }, + "1": { + "n": 119, + "action_gap": 0.001266196253709495, + "success_auc": 0.5974431818181818, + "succ_rate": 0.462184876203537 + }, + "2": { + "n": 145, + "action_gap": 0.0035740588791668415, + "success_auc": 0.8214736842105264, + "succ_rate": 0.3448275923728943 + }, + "3": { + "n": 107, + "action_gap": -0.00022753907251171768, + "success_auc": 0.6809024979854955, + "succ_rate": 0.3177570104598999 + }, + "4": { + "n": 98, + "action_gap": 0.028498968109488487, + "success_auc": 0.662719298245614, + "succ_rate": 0.3877550959587097 + }, + "5": { + "n": 20, + "action_gap": -0.010041766799986362, + "success_auc": 0.9797979797979798, + "succ_rate": 0.44999998807907104 + }, + "6": { + "n": 84, + "action_gap": 0.003478787373751402, + "success_auc": 0.5842781557067271, + "succ_rate": 0.25 + }, + "7": { + "n": 141, + "action_gap": 0.0013932707952335477, + "success_auc": 0.7867276887871854, + "succ_rate": 0.326241135597229 + }, + "8": { + "n": 115, + "action_gap": -0.003131964011117816, + "success_auc": 0.45934959349593496, + "succ_rate": 0.2869565188884735 + }, + "9": { + "n": 99, + "action_gap": 0.009113285690546036, + "success_auc": 0.5525423728813559, + "succ_rate": 0.5959596037864685 + } + }, + "by_horizon": { + "0-50": { + "n": 134, + "action_gap": 0.029561201110482216, + "action_winrate": 0.5895522388059702, + "q_mean": 0.18105097115039825 + }, + "50-100": { + "n": 127, + "action_gap": 0.008339605294167995, + "action_winrate": 0.5433070866141733, + "q_mean": 0.015619616955518723 + }, + "100-200": { + "n": 257, + "action_gap": -0.0032016062177717686, + "action_winrate": 0.44357976653696496, + "q_mean": 0.004435449372977018 + }, + "200+": { + "n": 506, + "action_gap": 0.001061168615706265, + "action_winrate": 0.5158102766798419, + "q_mean": 0.010990219190716743 + } + }, + "latent_std_min": 0.11561814695596695, + "q_action_gap": 0.0046235048212111, + "q_action_winrate": 0.5107421875, + "q_success_auc": 0.6598699763593381, + "q_mean": 0.03217332437634468 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/ope_null_base.json b/gen_q_rsm/rsm_libero/results/ope_null_base.json new file mode 100644 index 0000000000000000000000000000000000000000..f7cede01501b5cf3eec74d2a9d2e352e54c85667 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/ope_null_base.json @@ -0,0 +1,51 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/ope_null_base", + "batch": 512, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 16, + "bc_steps": 6000, + "ratio_steps": 4000, + "wend_steps": 4000, + "pi_mode": "all", + "seed": 0, + "in_ram": 0, + "d_z": 256 + }, + "calibration": { + "calib_scale": 5.237595756905884, + "E_mu[W_chunk]": 0.18588261306285858, + "E_mu[w_endpoint]": 1.0162439346313477, + "w_p05": 0.178162083029747, + "w_p50": 0.769451379776001, + "w_p95": 2.4898264408111572, + "ess_frac": 0.5588774085044861, + "corr_w_vs_W": 0.4341499684578188 + }, + "horizon": { + "restart_p": 0.505050505050505, + "mean_hops": 1.505050505050505, + "mean_hops_untruncated": 2.020408163265306, + "effective_frames": 75.25252525252519, + "gamma_effective": 0.9867114093959731, + "gamma_nominal": 0.99, + "truncation_mass": 0.25507601265177016 + }, + "value": { + "pi_mode": "all", + "rel_shift_IS_vs_noIS": 0.18422631919384003, + "gate_expectation": "null: weights ~1 and rel_shift should be SMALL", + "auc_success_IS": 0.6577155507688626, + "auc_success_noIS": 0.6631035720696464, + "q_mean_IS": 4.157533168792725, + "q_mean_noIS": 4.162613391876221, + "ess_particles": 0.6232997179031372, + "depth": 2, + "beta": 0.98, + "gamma": 0.99 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/ope_signal_base.json b/gen_q_rsm/rsm_libero/results/ope_signal_base.json new file mode 100644 index 0000000000000000000000000000000000000000..f3ee9d545264b17c20a9aefa1444adb5615de8d6 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/ope_signal_base.json @@ -0,0 +1,51 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/ope_signal_base", + "batch": 512, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 16, + "bc_steps": 6000, + "ratio_steps": 4000, + "wend_steps": 4000, + "pi_mode": "succ", + "seed": 0, + "in_ram": 0, + "d_z": 256 + }, + "calibration": { + "calib_scale": 5.228771711827236, + "E_mu[W_chunk]": 0.1858443021774292, + "E_mu[w_endpoint]": 1.0155830383300781, + "w_p05": 0.18472248315811157, + "w_p50": 0.7708338499069214, + "w_p95": 2.5086076259613037, + "ess_frac": 0.5631883144378662, + "corr_w_vs_W": 0.4324678136650354 + }, + "horizon": { + "restart_p": 0.505050505050505, + "mean_hops": 1.505050505050505, + "mean_hops_untruncated": 2.020408163265306, + "effective_frames": 75.25252525252519, + "gamma_effective": 0.9867114093959731, + "gamma_nominal": 0.99, + "truncation_mass": 0.25507601265177016 + }, + "value": { + "pi_mode": "succ", + "rel_shift_IS_vs_noIS": 0.19249221682548523, + "gate_expectation": "signal: pi is better than mu, Q should move UP", + "auc_success_IS": 0.6645485550170526, + "auc_success_noIS": 0.6625660663355871, + "q_mean_IS": 4.31668758392334, + "q_mean_noIS": 4.41709566116333, + "ess_particles": 0.63212651014328, + "depth": 2, + "beta": 0.98, + "gamma": 0.99 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/ope_smoketest_smooth.json b/gen_q_rsm/rsm_libero/results/ope_smoketest_smooth.json new file mode 100644 index 0000000000000000000000000000000000000000..4e510bf928ac191025f9036e3b34c895f94f950c --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/ope_smoketest_smooth.json @@ -0,0 +1,53 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/ope_smoketest_smooth", + "batch": 512, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 8, + "bc_steps": 3000, + "ratio_steps": 3000, + "wend_steps": 3000, + "pi_mode": "all", + "seed": 0, + "in_ram": 0, + "policy_family": "flow", + "ratio_smooth": 0.5, + "d_z": 256 + }, + "calibration": { + "calib_scale": 4.564842539855811, + "E_mu[W_chunk]": 0.22500823438167572, + "E_mu[w_endpoint]": 1.0092662572860718, + "w_p05": 0.18696357309818268, + "w_p50": 0.8847378492355347, + "w_p95": 2.304257869720459, + "ess_frac": 0.6249898076057434, + "corr_w_vs_W": 0.23125867938004438 + }, + "horizon": { + "restart_p": 0.505050505050505, + "mean_hops": 1.505050505050505, + "mean_hops_untruncated": 2.020408163265306, + "effective_frames": 75.25252525252519, + "gamma_effective": 0.9867114093959731, + "gamma_nominal": 0.99, + "truncation_mass": 0.25507601265177016 + }, + "value": { + "pi_mode": "all", + "rel_shift_IS_vs_noIS": 0.21909917891025543, + "gate_expectation": "null: weights ~1 and rel_shift should be SMALL", + "auc_success_IS": 0.6674714294261952, + "auc_success_noIS": 0.6499461497038234, + "q_mean_IS": 4.233530044555664, + "q_mean_noIS": 4.331247329711914, + "ess_particles": 0.6933380365371704, + "depth": 2, + "beta": 0.98, + "gamma": 0.99 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/ope_smooth_signal.json b/gen_q_rsm/rsm_libero/results/ope_smooth_signal.json new file mode 100644 index 0000000000000000000000000000000000000000..260781c0e5808442cbeefa1e9ab747c54dbdd25a --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/ope_smooth_signal.json @@ -0,0 +1,53 @@ +{ + "config": { + "cache": "/data/pulkitag/users/rli14/rsm_libero_cache/dev4k", + "critic": "/data/pulkitag/users/rli14/rsm_libero_runs/dev_base/ckpt.pt", + "out": "/data/pulkitag/users/rli14/rsm_libero_runs/ope_smooth_signal", + "batch": 512, + "beta_q": 0.98, + "gamma": 0.99, + "depth": 2, + "particles": 8, + "bc_steps": 3000, + "ratio_steps": 3000, + "wend_steps": 3000, + "pi_mode": "succ", + "seed": 0, + "in_ram": 0, + "policy_family": "flow", + "ratio_smooth": 0.5, + "d_z": 256 + }, + "calibration": { + "calib_scale": 3.764181771045251, + "E_mu[W_chunk]": 0.2209673523902893, + "E_mu[w_endpoint]": 1.008519172668457, + "w_p05": 0.31671518087387085, + "w_p50": 0.9019677042961121, + "w_p95": 2.0570905208587646, + "ess_frac": 0.7216845154762268, + "corr_w_vs_W": 0.3029320624145348 + }, + "horizon": { + "restart_p": 0.505050505050505, + "mean_hops": 1.505050505050505, + "mean_hops_untruncated": 2.020408163265306, + "effective_frames": 75.25252525252519, + "gamma_effective": 0.9867114093959731, + "gamma_nominal": 0.99, + "truncation_mass": 0.25507601265177016 + }, + "value": { + "pi_mode": "succ", + "rel_shift_IS_vs_noIS": 0.2472643256187439, + "gate_expectation": "signal: pi is better than mu, Q should move UP", + "auc_success_IS": 0.6510411057260815, + "auc_success_noIS": 0.6556542810985461, + "q_mean_IS": 4.378605842590332, + "q_mean_noIS": 4.441417694091797, + "ess_particles": 0.9089834690093994, + "depth": 2, + "beta": 0.98, + "gamma": 0.99 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/sweep_actcon.json b/gen_q_rsm/rsm_libero/results/sweep_actcon.json new file mode 100644 index 0000000000000000000000000000000000000000..8b8b7277e2cc8b005a41d8026622464a0371d20f --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/sweep_actcon.json @@ -0,0 +1,230 @@ +[ + { + "beta": 0.96, + "depth": 1, + "eff_frames": 24.99999999999998, + "gamma_eff": 0.96, + "gap_pooled": -51.546424865722656, + "win_pooled": 0.46142578125, + "gap_pooled_crosstask": -125.83489990234375, + "win_pooled_crosstask": 0.5009765625, + "state_auc": 0.5813405354817708, + "gap_0-50": 80.0497817993164, + "win_0-50": 0.6206896551724138, + "gap_50-100": -43.533599853515625, + "win_50-100": 0.576271186440678, + "gap_100-200": -55.44401931762695, + "win_100-200": 0.46938775510204084, + "gap_200+": -83.900634765625, + "win_200+": 0.3930254476908577 + }, + { + "beta": 0.96, + "depth": 2, + "eff_frames": 48.74999999999993, + "gamma_eff": 0.9794871794871794, + "gap_pooled": 34.69417953491211, + "win_pooled": 0.65234375, + "gap_pooled_crosstask": -4.634228706359863, + "win_pooled_crosstask": 0.69287109375, + "state_auc": 0.5486317952473958, + "gap_0-50": 162.04180908203125, + "win_0-50": 0.7509578544061303, + "gap_50-100": 40.9615592956543, + "win_50-100": 0.6694915254237288, + "gap_100-200": 11.722060203552246, + "win_100-200": 0.6224489795918368, + "gap_200+": 12.582496643066406, + "win_200+": 0.6380772855796418 + }, + { + "beta": 0.96, + "depth": 3, + "eff_frames": 71.31249999999993, + "gamma_eff": 0.985977212971078, + "gap_pooled": -28.83934211730957, + "win_pooled": 0.5517578125, + "gap_pooled_crosstask": -71.80011749267578, + "win_pooled_crosstask": 0.5625, + "state_auc": 0.5696919759114584, + "gap_0-50": 97.36705017089844, + "win_0-50": 0.6781609195402298, + "gap_50-100": -16.318790435791016, + "win_50-100": 0.5550847457627118, + "gap_100-200": -48.95175552368164, + "win_100-200": 0.4959183673469388, + "gap_200+": -53.38188552856445, + "win_200+": 0.5457115928369463 + }, + { + "beta": 0.98, + "depth": 1, + "eff_frames": 49.99999999999996, + "gamma_eff": 0.98, + "gap_pooled": -61.46691131591797, + "win_pooled": 0.46142578125, + "gap_pooled_crosstask": -128.90740966796875, + "win_pooled_crosstask": 0.515625, + "state_auc": 0.600732421875, + "gap_0-50": 79.28109741210938, + "win_0-50": 0.6130268199233716, + "gap_50-100": -55.58386993408203, + "win_50-100": 0.4830508474576271, + "gap_100-200": -63.31771469116211, + "win_100-200": 0.463265306122449, + "gap_200+": -96.5439453125, + "win_200+": 0.4184731385485391 + }, + { + "beta": 0.98, + "depth": 2, + "eff_frames": 97.49999999999986, + "gamma_eff": 0.9897435897435898, + "gap_pooled": 30.28516387939453, + "win_pooled": 0.62646484375, + "gap_pooled_crosstask": -4.869052886962891, + "win_pooled_crosstask": 0.6865234375, + "state_auc": 0.5759409586588542, + "gap_0-50": 156.78802490234375, + "win_0-50": 0.7203065134099617, + "gap_50-100": 38.11271667480469, + "win_50-100": 0.6271186440677966, + "gap_100-200": 9.85483455657959, + "win_100-200": 0.5897959183673469, + "gap_200+": 6.860384464263916, + "win_200+": 0.6201696512723845 + }, + { + "beta": 0.98, + "depth": 3, + "eff_frames": 142.62499999999986, + "gamma_eff": 0.992988606485539, + "gap_pooled": -30.98450469970703, + "win_pooled": 0.53857421875, + "gap_pooled_crosstask": -76.52243041992188, + "win_pooled_crosstask": 0.5615234375, + "state_auc": 0.6020416259765625, + "gap_0-50": 93.0474624633789, + "win_0-50": 0.685823754789272, + "gap_50-100": -7.158599853515625, + "win_50-100": 0.5550847457627118, + "gap_100-200": -56.07952880859375, + "win_100-200": 0.5122448979591837, + "gap_200+": -55.205711364746094, + "win_200+": 0.5108388312912346 + }, + { + "beta": 0.99, + "depth": 1, + "eff_frames": 99.99999999999991, + "gamma_eff": 0.99, + "gap_pooled": -60.12482452392578, + "win_pooled": 0.45654296875, + "gap_pooled_crosstask": -129.4288787841797, + "win_pooled_crosstask": 0.5185546875, + "state_auc": 0.6174367268880209, + "gap_0-50": 83.76277923583984, + "win_0-50": 0.6091954022988506, + "gap_50-100": -40.346195220947266, + "win_50-100": 0.5550847457627118, + "gap_100-200": -67.20990753173828, + "win_100-200": 0.4346938775510204, + "gap_200+": -96.64766693115234, + "win_200+": 0.4071630537229029 + }, + { + "beta": 0.99, + "depth": 2, + "eff_frames": 190.0900900900899, + "gamma_eff": 0.994739336492891, + "gap_pooled": 24.974506378173828, + "win_pooled": 0.61328125, + "gap_pooled_crosstask": -10.323814392089844, + "win_pooled_crosstask": 0.64697265625, + "state_auc": 0.5864532470703125, + "gap_0-50": 148.56842041015625, + "win_0-50": 0.7126436781609196, + "gap_50-100": 36.02408981323242, + "win_50-100": 0.6610169491525424, + "gap_100-200": 2.261622667312622, + "win_100-200": 0.5836734693877551, + "gap_200+": 2.602782964706421, + "win_200+": 0.5918944392082941 + }, + { + "beta": 0.99, + "depth": 3, + "eff_frames": 271.2523334144953, + "gamma_eff": 0.9963133957691271, + "gap_pooled": -26.120960235595703, + "win_pooled": 0.541015625, + "gap_pooled_crosstask": -76.4961929321289, + "win_pooled_crosstask": 0.53173828125, + "state_auc": 0.5991790771484375, + "gap_0-50": 91.29505157470703, + "win_0-50": 0.632183908045977, + "gap_50-100": -0.051404986530542374, + "win_50-100": 0.5932203389830508, + "gap_100-200": -51.6431999206543, + "win_100-200": 0.5040816326530613, + "gap_200+": -49.01643371582031, + "win_200+": 0.5240339302544769 + }, + { + "beta": 0.995, + "depth": 1, + "eff_frames": 199.99999999999983, + "gamma_eff": 0.995, + "gap_pooled": -68.11668395996094, + "win_pooled": 0.4619140625, + "gap_pooled_crosstask": -134.58949279785156, + "win_pooled_crosstask": 0.50146484375, + "state_auc": 0.6300608317057291, + "gap_0-50": 89.25088500976562, + "win_0-50": 0.6245210727969349, + "gap_50-100": -54.56651306152344, + "win_50-100": 0.559322033898305, + "gap_100-200": -72.14842224121094, + "win_100-200": 0.45918367346938777, + "gap_200+": -107.98023223876953, + "win_200+": 0.40150801131008484 + }, + { + "beta": 0.995, + "depth": 2, + "eff_frames": 360.1601601601599, + "gamma_eff": 0.9972234574763758, + "gap_pooled": 15.491418838500977, + "win_pooled": 0.5751953125, + "gap_pooled_crosstask": -22.10919189453125, + "win_pooled_crosstask": 0.6171875, + "state_auc": 0.6097300211588542, + "gap_0-50": 146.7181854248047, + "win_0-50": 0.7088122605363985, + "gap_50-100": 23.76041603088379, + "win_50-100": 0.5720338983050848, + "gap_100-200": -3.270139217376709, + "win_100-200": 0.5346938775510204, + "gap_200+": -9.964289665222168, + "win_200+": 0.5617342130065975 + }, + { + "beta": 0.995, + "depth": 3, + "eff_frames": 488.41654467280046, + "gamma_eff": 0.9979525673097951, + "gap_pooled": -25.263416290283203, + "win_pooled": 0.53662109375, + "gap_pooled_crosstask": -73.59703826904297, + "win_pooled_crosstask": 0.51708984375, + "state_auc": 0.6070821126302083, + "gap_0-50": 102.81361389160156, + "win_0-50": 0.6551724137931034, + "gap_50-100": -12.5304536819458, + "win_50-100": 0.5889830508474576, + "gap_100-200": -42.36178970336914, + "win_100-200": 0.5204081632653061, + "gap_200+": -51.70533752441406, + "win_200+": 0.5032987747408105 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/sweep_actcon01.json b/gen_q_rsm/rsm_libero/results/sweep_actcon01.json new file mode 100644 index 0000000000000000000000000000000000000000..b99b04db04fb7ca934f9971c729e31c8f77a4a52 --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/sweep_actcon01.json @@ -0,0 +1,230 @@ +[ + { + "beta": 0.96, + "depth": 1, + "eff_frames": 24.99999999999998, + "gamma_eff": 0.96, + "gap_pooled": 6.30864143371582, + "win_pooled": 0.48974609375, + "gap_pooled_crosstask": 5.91621732711792, + "win_pooled_crosstask": 0.4765625, + "state_auc": 0.6868655641649493, + "gap_0-50": 53.18166732788086, + "win_0-50": 0.6010050251256281, + "gap_50-100": -1.352872610092163, + "win_50-100": 0.5072324011571842, + "gap_100-200": -0.8440123200416565, + "win_100-200": 0.4645354645354645, + "gap_200+": 0.4466739594936371, + "win_200+": 0.4708994708994709 + }, + { + "beta": 0.96, + "depth": 2, + "eff_frames": 48.74999999999993, + "gamma_eff": 0.9794871794871794, + "gap_pooled": 5.7522172927856445, + "win_pooled": 0.4842529296875, + "gap_pooled_crosstask": 3.9665169715881348, + "win_pooled_crosstask": 0.478515625, + "state_auc": 0.6975916856370438, + "gap_0-50": 55.342628479003906, + "win_0-50": 0.5798994974874372, + "gap_50-100": 2.232736349105835, + "win_50-100": 0.5053037608486017, + "gap_100-200": -2.134530782699585, + "win_100-200": 0.46703296703296704, + "gap_200+": -1.439578652381897, + "win_200+": 0.46440596440596443 + }, + { + "beta": 0.96, + "depth": 3, + "eff_frames": 71.31249999999993, + "gamma_eff": 0.985977212971078, + "gap_pooled": 5.2091827392578125, + "win_pooled": 0.48828125, + "gap_pooled_crosstask": 2.6576032638549805, + "win_pooled_crosstask": 0.47998046875, + "state_auc": 0.6982983088828134, + "gap_0-50": 53.2354736328125, + "win_0-50": 0.5758793969849246, + "gap_50-100": 7.161194801330566, + "win_50-100": 0.5226615236258437, + "gap_100-200": -3.719944953918457, + "win_100-200": 0.468031968031968, + "gap_200+": -2.471020221710205, + "win_200+": 0.4684944684944685 + }, + { + "beta": 0.98, + "depth": 1, + "eff_frames": 49.99999999999996, + "gamma_eff": 0.98, + "gap_pooled": 6.295346260070801, + "win_pooled": 0.48291015625, + "gap_pooled_crosstask": 5.396781921386719, + "win_pooled_crosstask": 0.474365234375, + "state_auc": 0.6895984549860658, + "gap_0-50": 54.81524658203125, + "win_0-50": 0.6090452261306533, + "gap_50-100": -0.7992590665817261, + "win_50-100": 0.5284474445515911, + "gap_100-200": -1.1928950548171997, + "win_100-200": 0.47002997002997005, + "gap_200+": 0.05947805568575859, + "win_200+": 0.44757094757094756 + }, + { + "beta": 0.98, + "depth": 2, + "eff_frames": 97.49999999999986, + "gamma_eff": 0.9897435897435898, + "gap_pooled": 5.325685501098633, + "win_pooled": 0.48388671875, + "gap_pooled_crosstask": 3.506357192993164, + "win_pooled_crosstask": 0.4827880859375, + "state_auc": 0.7004525566035722, + "gap_0-50": 53.64113235473633, + "win_0-50": 0.5648241206030151, + "gap_50-100": 5.9683966636657715, + "win_50-100": 0.5274831243972999, + "gap_100-200": -3.4839394092559814, + "win_100-200": 0.46403596403596403, + "gap_200+": -2.1547107696533203, + "win_200+": 0.46320346320346323 + }, + { + "beta": 0.98, + "depth": 3, + "eff_frames": 142.62499999999986, + "gamma_eff": 0.992988606485539, + "gap_pooled": 5.533291816711426, + "win_pooled": 0.4918212890625, + "gap_pooled_crosstask": 1.2059924602508545, + "win_pooled_crosstask": 0.4788818359375, + "state_auc": 0.6955710735894732, + "gap_0-50": 52.95362854003906, + "win_0-50": 0.563819095477387, + "gap_50-100": 10.891581535339355, + "win_50-100": 0.5226615236258437, + "gap_100-200": -3.717881202697754, + "win_100-200": 0.4675324675324675, + "gap_200+": -2.6963698863983154, + "win_200+": 0.4785954785954786 + }, + { + "beta": 0.99, + "depth": 1, + "eff_frames": 99.99999999999991, + "gamma_eff": 0.99, + "gap_pooled": 5.030198574066162, + "win_pooled": 0.4903564453125, + "gap_pooled_crosstask": 4.482872009277344, + "win_pooled_crosstask": 0.473388671875, + "state_auc": 0.6890126312717897, + "gap_0-50": 43.38360595703125, + "win_0-50": 0.5869346733668341, + "gap_50-100": -0.8099265098571777, + "win_50-100": 0.5197685631629702, + "gap_100-200": -0.7152834534645081, + "win_100-200": 0.476023976023976, + "gap_200+": 0.07517894357442856, + "win_200+": 0.4668109668109668 + }, + { + "beta": 0.99, + "depth": 2, + "eff_frames": 190.0900900900899, + "gamma_eff": 0.994739336492891, + "gap_pooled": 3.990938425064087, + "win_pooled": 0.48388671875, + "gap_pooled_crosstask": 2.947385787963867, + "win_pooled_crosstask": 0.4820556640625, + "state_auc": 0.6884089513406015, + "gap_0-50": 41.63627243041992, + "win_0-50": 0.5738693467336683, + "gap_50-100": 4.091736793518066, + "win_50-100": 0.5380906460945034, + "gap_100-200": -2.1627180576324463, + "win_100-200": 0.45704295704295705, + "gap_200+": -2.0797717571258545, + "win_200+": 0.46176046176046176 + }, + { + "beta": 0.99, + "depth": 3, + "eff_frames": 271.2523334144953, + "gamma_eff": 0.9963133957691271, + "gap_pooled": 3.611988067626953, + "win_pooled": 0.494140625, + "gap_pooled_crosstask": 2.0005316734313965, + "win_pooled_crosstask": 0.4805908203125, + "state_auc": 0.6812484177231277, + "gap_0-50": 42.16130447387695, + "win_0-50": 0.6040201005025125, + "gap_50-100": 7.271562099456787, + "win_50-100": 0.5207328833172613, + "gap_100-200": -4.476435661315918, + "win_100-200": 0.47352647352647353, + "gap_200+": -2.63104248046875, + "win_200+": 0.47113997113997114 + }, + { + "beta": 0.995, + "depth": 1, + "eff_frames": 199.99999999999983, + "gamma_eff": 0.995, + "gap_pooled": 6.226694583892822, + "win_pooled": 0.4937744140625, + "gap_pooled_crosstask": 5.46646785736084, + "win_pooled_crosstask": 0.4813232421875, + "state_auc": 0.6890978454599711, + "gap_0-50": 53.39063262939453, + "win_0-50": 0.6060301507537689, + "gap_50-100": -0.2218518704175949, + "win_50-100": 0.5188042430086789, + "gap_100-200": -0.9892496466636658, + "win_100-200": 0.47802197802197804, + "gap_200+": 0.023074371740221977, + "win_200+": 0.46825396825396826 + }, + { + "beta": 0.995, + "depth": 2, + "eff_frames": 360.1601601601599, + "gamma_eff": 0.9972234574763758, + "gap_pooled": 5.552397727966309, + "win_pooled": 0.4931640625, + "gap_pooled_crosstask": 3.7978029251098633, + "win_pooled_crosstask": 0.4825439453125, + "state_auc": 0.6908156643631088, + "gap_0-50": 52.535335540771484, + "win_0-50": 0.5829145728643216, + "gap_50-100": 6.096987724304199, + "win_50-100": 0.5274831243972999, + "gap_100-200": -3.048335075378418, + "win_100-200": 0.4695304695304695, + "gap_200+": -1.685240626335144, + "win_200+": 0.4745069745069745 + }, + { + "beta": 0.995, + "depth": 3, + "eff_frames": 488.41654467280046, + "gamma_eff": 0.9979525673097951, + "gap_pooled": 4.832504749298096, + "win_pooled": 0.4888916015625, + "gap_pooled_crosstask": 2.0376412868499756, + "win_pooled_crosstask": 0.48095703125, + "state_auc": 0.687118537828745, + "gap_0-50": 52.42646026611328, + "win_0-50": 0.5718592964824121, + "gap_50-100": 8.476884841918945, + "win_50-100": 0.532304725168756, + "gap_100-200": -4.376927852630615, + "win_100-200": 0.45054945054945056, + "gap_200+": -3.031353235244751, + "win_200+": 0.4766714766714767 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/results/sweep_base.json b/gen_q_rsm/rsm_libero/results/sweep_base.json new file mode 100644 index 0000000000000000000000000000000000000000..bbaa528bb0af6955eb2e55075299d45a94d6e59f --- /dev/null +++ b/gen_q_rsm/rsm_libero/results/sweep_base.json @@ -0,0 +1,230 @@ +[ + { + "beta": 0.96, + "depth": 1, + "eff_frames": 24.99999999999998, + "gamma_eff": 0.96, + "gap_pooled": 2.919712543487549, + "win_pooled": 0.5205078125, + "gap_pooled_crosstask": 2.7210028171539307, + "win_pooled_crosstask": 0.494140625, + "state_auc": 0.6619578043619792, + "gap_0-50": 27.9962100982666, + "win_0-50": 0.6398467432950191, + "gap_50-100": -0.9122968912124634, + "win_50-100": 0.5127118644067796, + "gap_100-200": -2.5012218952178955, + "win_100-200": 0.5102040816326531, + "gap_200+": 0.10693741589784622, + "win_200+": 0.49764373232799247 + }, + { + "beta": 0.96, + "depth": 2, + "eff_frames": 48.74999999999993, + "gamma_eff": 0.9794871794871794, + "gap_pooled": 2.280273914337158, + "win_pooled": 0.5009765625, + "gap_pooled_crosstask": 1.7893123626708984, + "win_pooled_crosstask": 0.5146484375, + "state_auc": 0.6495737711588542, + "gap_0-50": 20.17959976196289, + "win_0-50": 0.6015325670498084, + "gap_50-100": -0.04096969589591026, + "win_50-100": 0.5084745762711864, + "gap_100-200": -1.4540495872497559, + "win_100-200": 0.5040816326530613, + "gap_200+": 0.11807619035243988, + "win_200+": 0.473138548539114 + }, + { + "beta": 0.96, + "depth": 3, + "eff_frames": 71.31249999999993, + "gamma_eff": 0.985977212971078, + "gap_pooled": 3.340029716491699, + "win_pooled": 0.49658203125, + "gap_pooled_crosstask": 2.551269292831421, + "win_pooled_crosstask": 0.50439453125, + "state_auc": 0.6516652425130208, + "gap_0-50": 29.56572914123535, + "win_0-50": 0.578544061302682, + "gap_50-100": -1.016560673713684, + "win_50-100": 0.4449152542372881, + "gap_100-200": -1.5416101217269897, + "win_100-200": 0.47346938775510206, + "gap_200+": 0.11217954009771347, + "win_200+": 0.49858623939679547 + }, + { + "beta": 0.98, + "depth": 1, + "eff_frames": 49.99999999999996, + "gamma_eff": 0.98, + "gap_pooled": 4.422482490539551, + "win_pooled": 0.490234375, + "gap_pooled_crosstask": 3.0656747817993164, + "win_pooled_crosstask": 0.47021484375, + "state_auc": 0.6657206217447916, + "gap_0-50": 36.3089599609375, + "win_0-50": 0.6053639846743295, + "gap_50-100": -2.8381195068359375, + "win_50-100": 0.5211864406779662, + "gap_100-200": -1.0212669372558594, + "win_100-200": 0.45918367346938777, + "gap_200+": 0.7076546549797058, + "win_200+": 0.46936852026390197 + }, + { + "beta": 0.98, + "depth": 2, + "eff_frames": 97.49999999999986, + "gamma_eff": 0.9897435897435898, + "gap_pooled": 3.420022964477539, + "win_pooled": 0.5068359375, + "gap_pooled_crosstask": 3.1979477405548096, + "win_pooled_crosstask": 0.4892578125, + "state_auc": 0.6654937744140625, + "gap_0-50": 31.808181762695312, + "win_0-50": 0.6130268199233716, + "gap_50-100": 0.33880019187927246, + "win_50-100": 0.5338983050847458, + "gap_100-200": -2.4181067943573, + "win_100-200": 0.47551020408163264, + "gap_200+": -0.18172825872898102, + "win_200+": 0.4891611687087653 + }, + { + "beta": 0.98, + "depth": 3, + "eff_frames": 142.62499999999986, + "gamma_eff": 0.992988606485539, + "gap_pooled": 3.5487027168273926, + "win_pooled": 0.50390625, + "gap_pooled_crosstask": 2.7771530151367188, + "win_pooled_crosstask": 0.50341796875, + "state_auc": 0.6565541585286458, + "gap_0-50": 27.154804229736328, + "win_0-50": 0.5977011494252874, + "gap_50-100": 1.9898091554641724, + "win_50-100": 0.4830508474576271, + "gap_100-200": -1.0167019367218018, + "win_100-200": 0.49795918367346936, + "gap_200+": 0.19691623747348785, + "win_200+": 0.4882186616399623 + }, + { + "beta": 0.99, + "depth": 1, + "eff_frames": 99.99999999999991, + "gamma_eff": 0.99, + "gap_pooled": 4.452927589416504, + "win_pooled": 0.51025390625, + "gap_pooled_crosstask": 2.8550586700439453, + "win_pooled_crosstask": 0.4912109375, + "state_auc": 0.6666798909505208, + "gap_0-50": 33.996402740478516, + "win_0-50": 0.6398467432950191, + "gap_50-100": 1.073217749595642, + "win_50-100": 0.5296610169491526, + "gap_100-200": -1.5662366151809692, + "win_100-200": 0.47959183673469385, + "gap_200+": 0.7169742584228516, + "win_200+": 0.4882186616399623 + }, + { + "beta": 0.99, + "depth": 2, + "eff_frames": 190.0900900900899, + "gamma_eff": 0.994739336492891, + "gap_pooled": 3.6026997566223145, + "win_pooled": 0.5185546875, + "gap_pooled_crosstask": 1.7554620504379272, + "win_pooled_crosstask": 0.48193359375, + "state_auc": 0.6637013753255209, + "gap_0-50": 26.31501579284668, + "win_0-50": 0.5977011494252874, + "gap_50-100": 2.8295605182647705, + "win_50-100": 0.5466101694915254, + "gap_100-200": -1.1450427770614624, + "win_100-200": 0.5020408163265306, + "gap_200+": 0.380211740732193, + "win_200+": 0.5004712535344015 + }, + { + "beta": 0.99, + "depth": 3, + "eff_frames": 271.2523334144953, + "gamma_eff": 0.9963133957691271, + "gap_pooled": 3.078533411026001, + "win_pooled": 0.50537109375, + "gap_pooled_crosstask": 1.4733316898345947, + "win_pooled_crosstask": 0.49853515625, + "state_auc": 0.6554555257161458, + "gap_0-50": 27.982181549072266, + "win_0-50": 0.5593869731800766, + "gap_50-100": 2.456202268600464, + "win_50-100": 0.5127118644067796, + "gap_100-200": -1.2090694904327393, + "win_100-200": 0.45918367346938777, + "gap_200+": -0.9290597438812256, + "win_200+": 0.5117813383600377 + }, + { + "beta": 0.995, + "depth": 1, + "eff_frames": 199.99999999999983, + "gamma_eff": 0.995, + "gap_pooled": 4.393555641174316, + "win_pooled": 0.49853515625, + "gap_pooled_crosstask": 3.221923828125, + "win_pooled_crosstask": 0.486328125, + "state_auc": 0.6645701090494792, + "gap_0-50": 39.18448257446289, + "win_0-50": 0.6283524904214559, + "gap_50-100": -1.7130212783813477, + "win_50-100": 0.5127118644067796, + "gap_100-200": -1.7897416353225708, + "win_100-200": 0.45918367346938777, + "gap_200+": 0.049102868884801865, + "win_200+": 0.4816211121583412 + }, + { + "beta": 0.995, + "depth": 2, + "eff_frames": 360.1601601601599, + "gamma_eff": 0.9972234574763758, + "gap_pooled": 5.160642147064209, + "win_pooled": 0.4912109375, + "gap_pooled_crosstask": 3.7217297554016113, + "win_pooled_crosstask": 0.4873046875, + "state_auc": 0.6655629475911459, + "gap_0-50": 39.35454559326172, + "win_0-50": 0.6168582375478927, + "gap_50-100": 2.9915273189544678, + "win_50-100": 0.4872881355932203, + "gap_100-200": -0.6084309220314026, + "win_100-200": 0.4775510204081633, + "gap_200+": -0.10406177490949631, + "win_200+": 0.46748350612629597 + }, + { + "beta": 0.995, + "depth": 3, + "eff_frames": 488.41654467280046, + "gamma_eff": 0.9979525673097951, + "gap_pooled": 4.199846267700195, + "win_pooled": 0.515625, + "gap_pooled_crosstask": 2.3940823078155518, + "win_pooled_crosstask": 0.486328125, + "state_auc": 0.6591898600260416, + "gap_0-50": 37.53031539916992, + "win_0-50": 0.6206896551724138, + "gap_50-100": 4.017754077911377, + "win_50-100": 0.559322033898305, + "gap_100-200": -4.878033638000488, + "win_100-200": 0.47959183673469385, + "gap_200+": 0.23366372287273407, + "win_200+": 0.49670122525918947 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_libero/reward_diag.py b/gen_q_rsm/rsm_libero/reward_diag.py new file mode 100644 index 0000000000000000000000000000000000000000..d6783a88e07eeb815acc9cb124bf3ffc4588d40f --- /dev/null +++ b/gen_q_rsm/rsm_libero/reward_diag.py @@ -0,0 +1,56 @@ +"""How good is the RSM reward head, really? Held-out (val-split) frames, per task, plus the +two failure modes that matter for ranking: (a) goal-mismatch (right state, wrong task id), +(b) imagined endpoints (flow samples) vs. the true future subgoal fraction. +usage: reward_diag.py --cache C --critic ckpt [--subgoal-dir D] [--mask M]""" +import argparse, os, sys, numpy as np, torch +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +from data import LiberoRSMData +from is_ope import load_critic +from train_rsm import sample_future, auc + +ap = argparse.ArgumentParser() +ap.add_argument("--cache", required=True); ap.add_argument("--critic", required=True) +ap.add_argument("--subgoal-dir", default=""); ap.add_argument("--mask", default="") +ap.add_argument("--n", type=int, default=20000); ap.add_argument("--beta", type=float, default=0.98) +a = ap.parse_args() +dev = "cuda" if torch.cuda.is_available() else "cpu" +d = LiberoRSMData(a.cache, chunk=10, seed=0, in_ram=False, reward_mode="subgoal", subgoal_dir=a.subgoal_dir, + success_mask=a.mask, norm_pool="demos") +enc, rew, flow, rms, cfg = load_critic(a.critic, d.feat_dim, d.n_task, dev, data=d) +lat = enc # load_critic already wraps the encoder with the proprio append (same as the evaluator) +rng = np.random.default_rng(0) +with torch.no_grad(): + fb = d.sample_frames(a.n, rng, "val", dev) + x, tk, r = fb["x"], fb["task"], fb["r"].float() + z = lat(x); rh = torch.sigmoid(rew(z, tk)) + e = (rh - r); print(f"VAL frames n={a.n}: MSE={float(e.pow(2).mean()):.4f} (const-null MSE={float((r-r.mean()).pow(2).mean()):.4f}) " + f"Pearson={float(np.corrcoef(rh.cpu(), r.cpu())[0,1]):.3f} mean r={float(r.mean()):.3f} mean r_hat={float(rh.mean()):.3f}") + print(f" AUC(all subgoals satisfied, r==1): {auc(rh.cpu().numpy(), (r.cpu().numpy()>=0.999).astype(float)):.3f} " + f"AUC(any progress, r>0): {auc(rh.cpu().numpy(), (r.cpu().numpy()>0.001).astype(float)):.3f}") + # calibration by true fraction + for lo, hi in ((0, 0.001), (0.001, 0.4), (0.4, 0.7), (0.7, 0.999), (0.999, 1.01)): + m = (r >= lo) & (r < hi) + if m.any(): print(f" true r in [{lo:.2f},{hi:.2f}): n={int(m.sum()):6d} mean r_hat={float(rh[m].mean()):.3f} std={float(rh[m].std()):.3f}") + # per task + for t in range(d.n_task): + m = tk == t + if m.sum() > 50: + print(f" task {t}: n={int(m.sum()):5d} Pearson={float(np.corrcoef(rh[m].cpu(), r[m].cpu())[0,1]):.3f} MSE={float(e[m].pow(2).mean()):.4f} mean r={float(r[m].mean()):.3f}") + # (a) goal mismatch: same latent, wrong task id + tk2 = (tk + torch.randint(1, d.n_task, tk.shape, device=dev)) % d.n_task + rh2 = torch.sigmoid(rew(z, tk2)) + print(f"GOAL-MISMATCH (wrong task id): mean r_hat={float(rh2.mean()):.3f} vs correct-task {float(rh.mean()):.3f}; " + f"fraction where wrong-task r_hat > correct-task r_hat: {float((rh2 > rh).float().mean()):.3f}") + # (b) imagined endpoints: flow sample at beta vs true future subgoal fraction + vb = d.sample(min(a.n, 8192), rng, a.beta, a.beta, "val", dev) + zc = lat(vb["x_now"]); zf_true = lat(vb["x_fut"]) + zf_imag = sample_future(flow, zc, vb["a_now"], vb["task"], vb["beta"], rms, 8, n=1) + r_true_fut = torch.sigmoid(rew(zf_true, vb["task"])) + r_imag = torch.sigmoid(rew(zf_imag, vb["task"])) + print(f"IMAGINED ENDPOINTS (beta={a.beta}): r_hat(true future latent) mean={float(r_true_fut.mean()):.3f}, r_hat(flow sample) mean={float(r_imag.mean()):.3f}, " + f"Pearson(imagined, true-future r_hat)={float(np.corrcoef(r_imag.cpu(), r_true_fut.cpu())[0,1]):.3f}, " + f"Pearson(imagined, TRUE future subgoal fraction)={float(np.corrcoef(r_imag.cpu(), vb['r_fut'].float().cpu())[0,1]) if 'r_fut' in vb else float('nan'):.3f}") + # (c) random latents: gaussian noise in latent space -> base-rate drift? + zr = torch.randn_like(z) * z.std(0, keepdim=True) + z.mean(0, keepdim=True) + print(f"RANDOM LATENTS (matched moments): mean r_hat={float(torch.sigmoid(rew(zr, tk)).mean()):.3f}") +print("[diag] DONE") diff --git a/gen_q_rsm/rsm_libero/rsm_main.py b/gen_q_rsm/rsm_libero/rsm_main.py new file mode 100644 index 0000000000000000000000000000000000000000..0e4a18bd041b51cf2b7467d577da05157cb535f4 --- /dev/null +++ b/gen_q_rsm/rsm_libero/rsm_main.py @@ -0,0 +1,325 @@ +"""origin/main's MIMICGEN RSM port, applied to the LIBERO-10 latent corpus. + +SCOPE CORRECTION. This file ports mimicgen_rsm/rsm_mimicgen/rsm.py, which is +ONE variant on main and not the main RSM recipe. The headline recipe in +ogbench_unified_rsm IS action-conditioned: its flow trains on (s, a, g) -> +s_{t+K} pairs and hop 1 uses the queried action. Only the mimicgen port drops +that, stating "NOT goal-conditioned ... d_beta(s'|s), reward(s), qf(s,a)". +Both are worth running here; do not read this file as "what main does". + +Our own recipe differs from main's in four ways that matter, and this file adopts +all four. See notes/rsm_formula_comparison.pdf for the derivation side. + +1. REWARD IS AN ARRIVAL DETECTOR, NOT AN OUTCOME PREDICTOR. + main: a classifier with a CALIBRATED threshold, hard-thresholded to + r_hat(s) = 1[logit > thr] - 1 in {0, -1}; the threshold is fit on held-out + episodes because "the classifier's scores are well ordered but not centred on + 0". ours (until now): r = 1 on EVERY frame of a successful episode, i.e. + P(this episode succeeds | s). Measured consequence of ours: a directly + supervised Q(z,a) beats a state-only V(z) by AUC 0.9550 vs 0.9539, delta + +0.0012 -- the action adds nothing, because whether an episode succeeds is a + property of the state, not of the next 10 frames. + +2. THE OCCUPANCY IS STATE-ONLY in THIS port: d_beta(s'|s). The ogbench recipe + conditions on the action instead; that variant is the action-conditioned + critic this lane already has. + +3. THE ACTION ENTERS BY SUPERVISED REGRESSION, NOT BY CONDITIONING A GENERATIVE + MODEL ON A COUNTERFACTUAL. main distils a student + qf(s,a) <- r + gamma * (1-done) * V(s'), s' the REAL logged next state, + with V from the frozen occupancy and, in their words, "no TD bootstrap off + qf". Ours conditioned the flow on a candidate action, which is unsupervised in + the action direction; probe_crn measured the result to have the right + magnitude and an arbitrary sign. + +4. ARRIVAL ABSORBS AND STOPPING IS GEOMETRIC OVER MANY HOPS. + p_stop = beta(1-gamma)/(gamma(1-beta)); a rollout stops on the coin OR on + reaching the goal, over max_hops (expected ~11 at beta=0.9, gamma=0.99). Ours + read the reward once at a fixed depth of 2-3. The reduction is an optimistic + hop-weighted expectile, not a plain mean. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch +import torch.nn.functional as F + +from data import LiberoRSMData +from model import Encoder, RewardHead, OccFlow, mlp, ema_update +from train_rsm import auc + + +# --------------------------------------------------------------------------- # +def p_stop_of(beta: float, gamma: float) -> float: + """main's geometric stopping probability. beta <= gamma is required.""" + assert beta <= gamma, f"need beta <= gamma, got {beta} > {gamma}" + return beta * (1.0 - gamma) / (gamma * (1.0 - beta)) if beta < gamma else 1.0 + + +def hop_weighted_value(r, absorb_hop, tau, rho, gamma, gain=1.0): + """main's speed-weighted upper expectile over per-rollout returns in {0,-1}.""" + A = 1.0 / (2.0 * (1.0 - tau)) + is_goal = r == 0.0 + w = torch.where(is_goal, + 1.0 + (A - 1.0) * gain * rho ** (absorb_hop.clamp_min(1) - 1).float(), + torch.ones_like(r)) + return ((w * r).sum(1) / w.sum(1).clamp_min(1e-12)) / (1.0 - gamma) + + +def value_from_at_goal_prob(q, tau, gamma): + if tau == 0.5: + m = q - 1.0 + else: + num = (1.0 - tau) * (1.0 - q) + den = tau * q + (1.0 - tau) * (1.0 - q) + m = -num / den.clamp_min(1e-12) + return m / (1.0 - gamma) + + +class MainRSM(torch.nn.Module): + """State-only occupancy + thresholded arrival reward + geometric-stop value.""" + + def __init__(self, d_lat, n_task, width=1024, depth=4): + super().__init__() + # d_act=1 with a zero action: the occupancy is state-only by construction, + # while reusing the same FiLM/Fourier successor the rest of the lane uses. + self.flow = OccFlow(d_lat, 1, n_task, width=width, depth=depth) + self.rew = RewardHead(d_lat, n_task) + self.register_buffer("rms", torch.ones(d_lat)) + self.threshold = 0.0 + + def flow_v(self, z, task, beta, x_k, k): + a0 = torch.zeros(z.shape[0], 1, device=z.device) + return self.flow(z, a0, task, beta, x_k, k) + + @torch.no_grad() + def hop(self, z, task, beta, steps=8): + x = torch.randn_like(z) + for s in range(steps): + k = torch.full((z.shape[0],), 1.0 - s / steps, device=z.device) + x = x + self.flow_v(z, task, beta, x, k) / steps + return z + x * self.rms + + @torch.no_grad() + def r_hat(self, z, task): + """Hard arrival reward in {0, -1} at the CALIBRATED threshold.""" + return (self.rew(z, task) > self.threshold).float() - 1.0 + + @torch.no_grad() + def estimate_value(self, z, task, *, beta, gamma, n_samples=16, max_hops=20, + tau=0.5, rho=0.9, gain=1.0, mode="hop", flow_steps=8): + B = z.shape[0] + p_stop = p_stop_of(beta, gamma) + s = z.repeat_interleave(n_samples, 0) + tk = task.repeat_interleave(n_samples, 0) + bq = torch.full((s.shape[0],), beta, device=z.device) + M = s.shape[0] + active = torch.ones(M, dtype=torch.bool, device=z.device) + stopped = s.clone() + absorb = torch.zeros(M, dtype=torch.long, device=z.device) + for h in range(1, max_hops + 1): + s_next = self.hop(s, tk, bq, steps=flow_steps) + s = torch.where(active.unsqueeze(-1), s_next, s) + at_goal = self.r_hat(s, tk) == 0.0 + coin = torch.rand(M, device=z.device) < p_stop + just = active & (coin | at_goal) + absorb = torch.where(just & at_goal, torch.full_like(absorb, h), absorb) + stopped = torch.where(just.unsqueeze(-1), s, stopped) + active = active & ~just + if not active.any(): + break + stopped = torch.where(active.unsqueeze(-1), s, stopped) + r = self.r_hat(stopped, tk).reshape(B, n_samples) + ah = absorb.reshape(B, n_samples) + if mode == "hop": + return hop_weighted_value(r, ah, tau, rho, gamma, gain) + q = (r == 0.0).float().mean(1) + return value_from_at_goal_prob(q, tau, gamma) + + +class QStudent(torch.nn.Module): + def __init__(self, d_lat, d_act, n_task, d_task=64, width=1024, depth=3): + super().__init__() + self.task = torch.nn.Embedding(n_task, d_task) + self.net = mlp([d_lat + d_act + d_task] + [width] * depth + [1], norm=True) + + def forward(self, z, a, task): + return self.net(torch.cat([z, a, self.task(task)], -1)).squeeze(-1) + + +def calibrate_threshold(model, d, enc, dev, rng, n=8192): + """Fit the cutoff on HELD-OUT frames, as main does. + + Chosen to match the positive base rate rather than at logit 0: main's note is + that the scores are well ordered but not centred, and estimate_value + thresholds hard, so an uncentred cutoff silently changes the arrival rate. + """ + P, Y = [], [] + with torch.no_grad(): + for _ in range(max(1, n // 2048)): + b = d.sample_frames(2048, rng, "val", dev) + z = enc(b["x"]) + P.append(model.rew(z, b["task"]).cpu().numpy()) + Y.append(b["r"].cpu().numpy()) + P = np.concatenate(P); Y = np.concatenate(Y) + pos = float(Y.mean()) + thr = float(np.quantile(P, 1.0 - pos)) if 0 < pos < 1 else 0.0 + a = auc(P, Y) + at_rate = float((P > thr).mean()) + return thr, a, pos, at_rate + + +# --------------------------------------------------------------------------- # +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--d-z", type=int, default=256) + ap.add_argument("--enc-width", type=int, default=1024) + ap.add_argument("--flow-width", type=int, default=1024) + ap.add_argument("--flow-depth", type=int, default=4) + ap.add_argument("--beta", type=float, default=0.90) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--k-success", type=int, default=10, + help="frames at the END of a successful episode counted as " + "AT GOAL. This is main's arrival convention; the dense " + "whole-episode label is an outcome predictor and was " + "measured to carry no action information.") + ap.add_argument("--n-value-samples", type=int, default=16) + ap.add_argument("--max-hops", type=int, default=20) + ap.add_argument("--value-expectile", type=float, default=0.7) + ap.add_argument("--expectile-mode", default="hop", choices=["hop", "reward"]) + ap.add_argument("--hop-rho", type=float, default=0.9) + ap.add_argument("--occ-steps", type=int, default=20000) + ap.add_argument("--qf-steps", type=int, default=40000) + ap.add_argument("--distill-states", type=int, default=153600, + help="transitions in the distillation buffer; V is " + "computed once per transition, not per batch") + ap.add_argument("--batch", type=int, default=512) + ap.add_argument("--qf-batch", type=int, default=256) + ap.add_argument("--lr", type=float, default=3e-4) + ap.add_argument("--ema", type=float, default=0.005) + ap.add_argument("--norm-pool", default="demos", choices=["all", "demos"]) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + args = ap.parse_args() + + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + # ARRIVAL labels, not outcome labels + d = LiberoRSMData(args.cache, chunk=args.chunk, k_success=args.k_success, + seed=args.seed, in_ram=bool(args.in_ram), + reward_mode="terminal", norm_pool=args.norm_pool) + print(f"[main-rsm] {d.n_ep} eps, at-goal frames {float(d.r.mean()):.4f} " + f"(main's arrival convention), p_stop " + f"{p_stop_of(args.beta, args.gamma):.4f}, E[hops] " + f"{1.0 / max(p_stop_of(args.beta, args.gamma), 1e-9):.1f}", flush=True) + + enc = Encoder(d.feat_dim, args.d_z, args.enc_width).to(dev) + enc_t = Encoder(d.feat_dim, args.d_z, args.enc_width).to(dev) + enc_t.load_state_dict(enc.state_dict()) + for p in enc_t.parameters(): + p.requires_grad_(False) + m = MainRSM(args.d_z, d.n_task, args.flow_width, args.flow_depth).to(dev) + opt = torch.optim.AdamW(list(enc.parameters()) + list(m.flow.parameters()) + + list(m.rew.parameters()), lr=args.lr, weight_decay=0.01) + rng = np.random.default_rng(args.seed) + pos_w = torch.tensor(max((1 - d.r.mean()) / max(d.r.mean(), 1e-6), 1.0), device=dev) + + # ---- stage 1: state-only occupancy + arrival classifier ---- + for step in range(1, args.occ_steps + 1): + b = d.sample(args.batch, rng, args.beta, args.beta, "train", dev) + z = enc(b["x_now"]) + with torch.no_grad(): + z_fut = enc_t(b["x_fut"]) + l_rew = F.binary_cross_entropy_with_logits( + m.rew(z, b["task"]), b["r_now"], pos_weight=pos_w) + delta = z_fut - (z.detach() if step <= 2000 else z) + with torch.no_grad(): + m.rms.mul_(0.99).add_(delta.pow(2).mean(0).sqrt().clamp_min(1e-3), alpha=0.01) + y = delta / m.rms + k = torch.rand(args.batch, device=dev) + noise = torch.randn_like(y) + x_k = (1 - k)[:, None] * y + k[:, None] * noise + v = m.flow_v(z if step > 2000 else z.detach(), b["task"], b["beta"], x_k, k) + l_cfm = (v - (y - noise)).pow(2).mean() + std = z.std(0) + loss = l_rew + l_cfm + 10.0 * F.relu(0.1 - std).mean() + opt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_( + list(enc.parameters()) + list(m.flow.parameters()) + + list(m.rew.parameters()), 1.0) + opt.step(); ema_update(enc_t, enc, args.ema) + if step % 2000 == 0: + print(f"[occ] {step} rew={float(l_rew):.4f} cfm={float(l_cfm):.4f}", + flush=True) + + enc.eval(); m.eval() + torch.save({"enc": enc.state_dict(), "flow": m.flow.state_dict(), + "rew": m.rew.state_dict(), "rms": m.rms.cpu(), + "config": vars(args)}, out / "stage1.pt") + thr, a_r, pos, at_rate = calibrate_threshold(m, d, enc, dev, + np.random.default_rng(args.seed + 5)) + m.threshold = thr + print(f"[main-rsm] arrival classifier AUC {a_r:.4f}; threshold {thr:+.3f} " + f"calibrated to base rate {pos:.4f} (at-goal rate {at_rate:.4f})", + flush=True) + + # ---- stage 2: distil qf(z,a) <- r + gamma (1-done) V(z'), REAL z' ---- + # Build the distillation BUFFER once. Recomputing V per batch means a fresh + # 16-rollout, 20-hop expansion every step (<1.7 steps/s measured); the target + # does not change during stage 2, so it is computed once and regressed on. + rq = np.random.default_rng(args.seed + 11) + Z, ZA, TK, TG = [], [], [], [] + got, bs = 0, 512 + while got < args.distill_states: + b = d.sample_frames(bs, rq, "train", dev) + t_next = np.minimum(b["t_idx"] + d.chunk, d.ep_to[b["ep"]] - 1) + done = torch.from_numpy( + (t_next >= d.ep_to[b["ep"]] - 1).astype(np.float32)).to(dev) + with torch.no_grad(): + z = enc(b["x"]) + zn = enc(torch.from_numpy(d._feat(t_next)).to(dev)) + r_now = m.r_hat(z, b["task"]) + v_next = m.estimate_value( + zn, b["task"], beta=args.beta, gamma=args.gamma, + n_samples=args.n_value_samples, max_hops=args.max_hops, + tau=args.value_expectile, rho=args.hop_rho, + mode=args.expectile_mode) + target = r_now + args.gamma * (1 - done) * v_next + Z.append(z.cpu()); ZA.append(b["a"].cpu()) + TK.append(b["task"].cpu()); TG.append(target.cpu()) + got += bs + if got % 25600 == 0: + print(f"[buf] {got}/{args.distill_states} " + f"target_mean={float(target.mean()):.3f}", flush=True) + Z = torch.cat(Z); ZA = torch.cat(ZA); TK = torch.cat(TK); TG = torch.cat(TG) + print(f"[buf] done {tuple(Z.shape)} target mean {float(TG.mean()):.3f} " + f"sd {float(TG.std()):.3f}", flush=True) + + qf = QStudent(args.d_z, d.chunk * d.adim, d.n_task).to(dev) + qopt = torch.optim.Adam(qf.parameters(), lr=args.lr) + for step in range(1, args.qf_steps + 1): + idx = torch.randint(0, len(Z), (args.qf_batch,)) + loss = F.mse_loss(qf(Z[idx].to(dev), ZA[idx].to(dev), TK[idx].to(dev)), + TG[idx].to(dev)) + qopt.zero_grad(); loss.backward() + torch.nn.utils.clip_grad_norm_(qf.parameters(), 1.0); qopt.step() + if step % 4000 == 0: + print(f"[qf] {step} loss={float(loss):.4f}", flush=True) + + torch.save({"enc": enc.state_dict(), "flow": m.flow.state_dict(), + "rew": m.rew.state_dict(), "rms": m.rms.cpu(), + "threshold": thr, "qf": qf.state_dict(), + "config": vars(args), "d_act": d.chunk * d.adim, + "tasks": d.tasks, "arrival_auc": a_r}, out / "main_rsm.pt") + print("[main-rsm] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/run_cell.sh b/gen_q_rsm/rsm_libero/run_cell.sh new file mode 100644 index 0000000000000000000000000000000000000000..f265e371adf207ae96d6f83c3d57599084bedf8d --- /dev/null +++ b/gen_q_rsm/rsm_libero/run_cell.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Self-resubmitting cell on IBM's preemptable queue (SIGINT on preemption; LSF -r does not +# requeue). Both train_rsm.py (--resume 1, ckpt.pt) and bc_arm.py (bc_resume.pt) continue +# from their last checkpoint, so a preempted cell picks up where it left off. +set -uo pipefail +B=/proj/dmfexp/zwhong/rsm_libero; PY=/proj/dmfexp/zwhong/venvs/lerobot_env/bin/python +cd $B/code; export PYTHONUNBUFFERED=1 +echo "[cell] $CELL start $(date -u +%T) on $(hostname)" +eval "$PY $CMD"; RC=$? +echo "[cell] $CELL rc=$RC $(date -u +%T)" +DONE=$(grep -qE "^\[(rsm|bc_arm|iql)\] DONE" $O/logs/$CELL.out 2>/dev/null && echo 1 || echo 0) +if [ "$RC" -ne 0 ] && [ "$DONE" = 0 ]; then + echo "[cell] $CELL incomplete -> resubmitting" + bsub -G grp_preemptable -q preemptable -r -gpu num=1 -n 8 -M 160G -R 'rusage[mem=160G]' -J $CELL \ + -o $O/logs/$CELL.out -e $O/logs/$CELL.err -env "all, CELL=$CELL, CMD=$CMD, O=$O" $B/run_cell.sh +fi +exit $RC diff --git a/gen_q_rsm/rsm_libero/run_ope.py b/gen_q_rsm/rsm_libero/run_ope.py new file mode 100644 index 0000000000000000000000000000000000000000..d3d6a6167bd9d645022263ab0b9416d13a150d09 --- /dev/null +++ b/gen_q_rsm/rsm_libero/run_ope.py @@ -0,0 +1,171 @@ +"""Driver: pi_0 -> ratio -> endpoint weight -> IS-corrected Q, with the gate. + +Order of operations is deliberate. The IS machinery is validated BEFORE any +policy is trained on it, because a critic that is never checked is how the +smolvla line shipped an advantage of 0.019 and a null AWR result. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import (load_critic, train_bc, train_ratio, train_endpoint_ratio, + train_likelihood_ratio, + q_recursive, precompute_decision_logratio, chunk_logW_fast, + effective_horizon) +from train_rsm import auc + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--batch", type=int, default=512) + ap.add_argument("--beta-q", type=float, default=0.98) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--depth", type=int, default=2) + ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--bc-steps", type=int, default=8000) + ap.add_argument("--ratio-steps", type=int, default=6000) + ap.add_argument("--wend-steps", type=int, default=6000) + ap.add_argument("--pi-mode", default="succ", choices=["succ", "all"], + help="succ = BC on successful rollouts (a genuinely better " + "target policy); all = BC on everything, which approximates " + "the behaviour policy and is the NULL control: with pi ~= mu " + "the weights must be ~1 and IS must not move Q.") + ap.add_argument("--chunk", type=int, default=10, + help="MUST match the critic's training chunk; the action\n dim is chunk*7 and a mismatch silently breaks loading") + ap.add_argument("--ratio-mode", default="classifier", + choices=["classifier", "likelihood"], + help="classifier = discriminative density ratio (SHOWN BROKEN: " + "an identity control puts two same-data policies at 0.945-" + "0.977 separability, so the logit reads network identity). " + "likelihood = genuine pi/mu_hat with tractable Gaussians.") + ap.add_argument("--ratio-chunk", type=int, default=0, + help="action length the IS ratio scores; 0 = same as --chunk. " + "Set to the BEHAVIOUR POLICY decision period (10 for pi0.5). " + "The occupancy may condition on a much longer window; the " + "ratio is a product over DECISIONS and must not.") + ap.add_argument("--reward-mode", default="dense", choices=["dense","terminal"], + help="dense = P(task succeeds|z), every frame of a success is a " + "positive (~50%%). terminal = last k frames only (~0.5%%), which " + "leaves Q near-constant in the action.") + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--policy-family", default="flow", choices=["flow", "gauss"]) + ap.add_argument("--ratio-smooth", type=float, default=0.0, + help="Gaussian kernel width applied to BOTH action classes before " + "the ratio classifier; buys overlap at the cost of a blurred ratio") + args = ap.parse_args() + + # Seed torch too, not just numpy: the policy head init and the + # flow-matching noise are torch RNG. Without this two arms meant to + # differ in ONE flag start from different policies -- observed as + # pi_0 separation gaps of 0.0170 (IS on) vs 0.0089 (IS off). + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, dev, data=d) + args.d_z = cfg["d_z"] + rng = np.random.default_rng(args.seed + 7) + report = {"config": vars(args)} + + only_succ = (args.pi_mode == "succ") + print(f"=== pi_0: behaviour cloning ({'successes only' if only_succ else 'ALL data (null control)'}) ===", + flush=True) + pol = train_bc(d, enc, args, dev, only_success=only_succ, steps=args.bc_steps) + + print("=== step 1: per-decision density ratio by classification ===", flush=True) + rc = args.ratio_chunk or d.chunk + if args.ratio_mode == "likelihood": + ratio, pol_dec = train_likelihood_ratio( + d, enc, args, dev, steps=args.ratio_steps, + only_success=only_succ, chunk_len=rc) + elif rc != d.chunk: + print(f"=== fitting a DECISION-level policy (chunk {rc}) for the ratio ===", + flush=True) + print(f"=== fitting a DECISION-level policy (chunk {rc}) for the ratio ===", + flush=True) + pol_dec = train_bc(d, enc, args, dev, only_success=only_succ, + steps=args.bc_steps, chunk_len=rc) + ratio = train_ratio(d, enc, pol_dec, args, dev, steps=args.ratio_steps) + else: + pol_dec = pol + ratio = train_ratio(d, enc, pol_dec, args, dev, steps=args.ratio_steps) + + print("=== step 2/3: endpoint weight (Rao-Blackwellized) ===", flush=True) + wend = train_endpoint_ratio(d, enc, ratio, args, dev, steps=args.wend_steps) + + # ---------------- calibration: E_mu[w] should be ~1 ---------------- + b = d.sample(4096, rng, args.beta_q, args.beta_q, "val", dev) + with torch.no_grad(): + z = enc(b["x_now"]); zf = enc(b["x_fut"]) + w = wend(z, b["a_now"], zf, b["task"]) * getattr(wend, "calib", 1.0) + pre = precompute_decision_logratio(d, enc, ratio, dev, rc=rc) + W = torch.from_numpy(chunk_logW_fast(pre, b["t_idx"], b["fut_idx"])).to(dev) + W = W.clamp(-4, 4).exp() + ess = float((w.sum() ** 2) / (w.pow(2).sum() * len(w))) + report["calibration"] = { + "calib_scale": float(getattr(wend, "calib", 1.0)), + "E_mu[W_chunk]": float(W.mean()), "E_mu[w_endpoint]": float(w.mean()), + "w_p05": float(w.quantile(0.05)), "w_p50": float(w.quantile(0.5)), + "w_p95": float(w.quantile(0.95)), "ess_frac": ess, + "corr_w_vs_W": float(np.corrcoef(w.cpu().numpy(), W.cpu().numpy())[0, 1]), + } + print(f"[gate] E_mu[w]={w.mean():.3f} (target 1.0) ESS={ess:.3f} " + f"corr(what,W)={report['calibration']['corr_w_vs_W']:.3f}", flush=True) + + # ---------------- the falsifiable gate ---------------- + # pi_synth := mu restricted to successful episodes. Its occupancy is directly + # estimable, so the IS-corrected value can be checked against a reference + # rather than merely asserted. + fb = d.sample_frames(2048, rng, "val", dev) + with torch.no_grad(): + zq = enc(fb["x"]) + q_is, ess_q = q_recursive(zq, fb["a"], fb["task"], rew=rew, flow=flow, rms=rms, + pol=pol, wend=wend, beta=args.beta_q, gamma=args.gamma, + depth=args.depth, n_particles=args.particles, + use_is=True) + q_no, _ = q_recursive(zq, fb["a"], fb["task"], rew=rew, flow=flow, rms=rms, + pol=pol, wend=wend, beta=args.beta_q, gamma=args.gamma, + depth=args.depth, n_particles=args.particles, + use_is=False) + succ = fb["succ"].cpu().numpy() + dq = float((q_is - q_no).abs().mean() / q_no.abs().mean().clamp_min(1e-6)) + report["horizon"] = effective_horizon(args.beta_q, args.gamma, args.depth) + print(f"[horizon] depth={args.depth} -> {report['horizon']['mean_hops']:.2f} hops, " + f"~{report['horizon']['effective_frames']:.0f} frames, " + f"gamma_eff={report['horizon']['gamma_effective']:.4f} " + f"(nominal {args.gamma}); truncated mass " + f"{report['horizon']['truncation_mass']:.3f}", flush=True) + report["value"] = { + "pi_mode": args.pi_mode, + "rel_shift_IS_vs_noIS": dq, + "gate_expectation": ("null: weights ~1 and rel_shift should be SMALL" + if args.pi_mode == "all" else + "signal: pi is better than mu, Q should move UP"), + "auc_success_IS": auc(q_is.cpu().numpy(), succ), + "auc_success_noIS": auc(q_no.cpu().numpy(), succ), + "q_mean_IS": float(q_is.mean()), "q_mean_noIS": float(q_no.mean()), + "ess_particles": float(ess_q.mean()), + "depth": args.depth, "beta": args.beta_q, "gamma": args.gamma, + } + print(f"[gate] pi_mode={args.pi_mode} success-AUC IS={report['value']['auc_success_IS']:.4f} " + f"noIS={report['value']['auc_success_noIS']:.4f} " + f"rel|dQ|={dq:.4f} particle ESS={float(ess_q.mean()):.3f}", flush=True) + + torch.save({"pol": pol.state_dict(), "ratio": ratio.state_dict(), + "wend": wend.state_dict(), "config": vars(args)}, out / "is_stack.pt") + (out / "report.json").write_text(json.dumps(report, indent=2)) + print(json.dumps(report, indent=2), flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/run_slurm.sh b/gen_q_rsm/rsm_libero/run_slurm.sh new file mode 100644 index 0000000000000000000000000000000000000000..c88879dad292987e4d35040ea227def9abb64f2d --- /dev/null +++ b/gen_q_rsm/rsm_libero/run_slurm.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Launch an RSM/OPE arm on MIT slurm. +# ARM=critic bash rsm_libero/run_slurm.sh +# ARM=ope bash rsm_libero/run_slurm.sh +# ARM=awr bash rsm_libero/run_slurm.sh +# QoS note: vision-pulkitag-main is off limits per standing instruction; lab-free +# has no GPU cap and reaches csail-shared-h200 (24h wall clock max there). +set -euo pipefail +ROOT=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q +PY=$ROOT/.venv/bin/python +CACHE=${CACHE:-/data/pulkitag/users/rli14/rsm_libero_cache/full} +OUTROOT=${OUTROOT:-/data/pulkitag/users/rli14/rsm_libero_runs} +ARM=${ARM:-critic} +TAG=${TAG:-$(date +%m%d)_${ARM}} +QOS=${QOS:-lab-free} +PART=${PART:-csail-shared-h200} +TIME=${TIME:-23:00:00} +MEM=${MEM:-400G} +OUT=$OUTROOT/$TAG +mkdir -p "$OUT" "$OUT/slurm" + +case "$ARM" in + critic) CMD="$PY $ROOT/rsm_libero/train_rsm.py --cache $CACHE --out $OUT \ + --steps ${STEPS:-60000} --batch ${BATCH:-512} --beta-lo 0.90 --beta-hi 0.995 \ + --beta-q ${BETAQ:-0.98} --w-actcon ${ACTCON:-0} --seed ${SEED:-0}" ;; + ope) CMD="$PY $ROOT/rsm_libero/run_ope.py --cache $CACHE --critic ${CRITIC:?set CRITIC} \ + --out $OUT --beta-q ${BETAQ:-0.98} --gamma ${GAMMA:-0.99} \ + --depth ${DEPTH:-2} --seed ${SEED:-0}" ;; + awr) CMD="$PY $ROOT/rsm_libero/awr.py --cache $CACHE --critic ${CRITIC:?set CRITIC} \ + --out $OUT --rounds ${ROUNDS:-2} --depth ${DEPTH:-2} \ + --use-is ${USE_IS:-1} --seed ${SEED:-0}" ;; + *) echo "unknown ARM=$ARM" >&2; exit 2 ;; +esac + +sbatch --job-name="rsm_$TAG" --account=vision-pulkitag --qos="$QOS" \ + --partition="$PART" --gres=gpu:1 --cpus-per-task=8 --mem="$MEM" --time="$TIME" \ + --output="$OUT/slurm/%j.out" --error="$OUT/slurm/%j.err" \ + --wrap="cd $ROOT/rsm_libero && $CMD" +echo "submitted $ARM -> $OUT" diff --git a/gen_q_rsm/rsm_libero/stats_full.sbatch b/gen_q_rsm/rsm_libero/stats_full.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..7ccb22f381770333bfc4422c2bfe069a2e698a98 --- /dev/null +++ b/gen_q_rsm/rsm_libero/stats_full.sbatch @@ -0,0 +1,18 @@ +#!/bin/bash +#SBATCH --job-name=stats_full +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=8 --mem=120G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +# Compute feat_stats{,_demos}.npz for the one-space cache ONCE, so the six trainers +# launched behind this (--dependency=afterok) read them instead of racing to write. +set -uo pipefail +cd /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python - <<'PY' +import sys; sys.path.insert(0,".") +from data import LiberoRSMData +for np_ in ("all","demos"): + d=LiberoRSMData("/data/pulkitag/users/rli14/rsm_libero_cache/full_r256",chunk=10,seed=0,in_ram=False,reward_mode="dense",norm_pool=np_) + print("[stats] ok", np_, d.feat_dim, flush=True) +PY +echo "[stats] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/stats_r256.sbatch b/gen_q_rsm/rsm_libero/stats_r256.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..ca53d75dff772979ccd8ee154606ea82880c9dda --- /dev/null +++ b/gen_q_rsm/rsm_libero/stats_r256.sbatch @@ -0,0 +1,18 @@ +#!/bin/bash +#SBATCH --job-name=stats_r256 +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=8 --mem=120G +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%j.err +# Compute feat_stats{,_demos}.npz for the one-space cache ONCE, so the six trainers +# launched behind this (--dependency=afterok) read them instead of racing to write. +set -uo pipefail +cd /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python - <<'PY' +import sys; sys.path.insert(0,".") +from data import LiberoRSMData +for np_ in ("all","demos"): + d=LiberoRSMData("/data/pulkitag/users/rli14/rsm_libero_cache/full_demo_r256",chunk=10,seed=0,in_ram=False,reward_mode="dense",norm_pool=np_) + print("[stats] ok", np_, d.feat_dim, flush=True) +PY +echo "[stats] rc=$? $(date -u +%T)" diff --git a/gen_q_rsm/rsm_libero/subgoals_from_npz.py b/gen_q_rsm/rsm_libero/subgoals_from_npz.py new file mode 100644 index 0000000000000000000000000000000000000000..6259dfde2adb9be1c774aa4c1d98775c9c65a7e1 --- /dev/null +++ b/gen_q_rsm/rsm_libero/subgoals_from_npz.py @@ -0,0 +1,24 @@ +"""Subgoal labels for a pack whose per-episode npz already carry a per-frame `subgoals` +count (written by eval_closed_loop.py --collect from the live BDDL predicates). Emits the +/task{t}.npz (ep, vals, K) layout that data.py reward_mode=subgoal reads. + +usage: subgoals_from_npz.py --cache --out +""" +import argparse, numpy as np +from pathlib import Path +ap = argparse.ArgumentParser(); ap.add_argument("--cache", required=True); ap.add_argument("--out", required=True) +a = ap.parse_args() +m = np.load(f"{a.cache}/meta.npz", allow_pickle=True) +out = Path(a.out); out.mkdir(parents=True, exist_ok=True) +for t in range(len(m["tasks"])): + eps, vals, K = [], [], None + for e in np.where((m["ep_task"] == t) & ~m["ep_demo"].astype(bool))[0]: + z = np.load(str(m["ep_src"][e]), allow_pickle=True) + v = np.asarray(z["subgoals"], np.int8)[::int(m["stride"])] + n = int(m["ep_to"][e] - m["ep_from"][e]) + if len(v) < n: v = np.concatenate([v, np.full(n - len(v), v[-1] if len(v) else 0, np.int8)]) + eps.append(int(e)); vals.append(v[:n]); K = int(z["K"]) + if eps: + np.savez_compressed(out / f"task{t}.npz", ep=np.array(eps), vals=np.array(vals, dtype=object), K=K) + f = np.concatenate(vals); print(f"[sg] task {t}: {len(eps)} eps, K={K}, mean subgoal frac {f.mean()/K:.3f}", flush=True) +print("[sg] DONE") diff --git a/gen_q_rsm/rsm_libero/sweep_horizon.py b/gen_q_rsm/rsm_libero/sweep_horizon.py new file mode 100644 index 0000000000000000000000000000000000000000..d9e46709ded09c6920c3f42519508c350c6ac774 --- /dev/null +++ b/gen_q_rsm/rsm_libero/sweep_horizon.py @@ -0,0 +1,140 @@ +"""Sweep query discount x recursion depth on a TRAINED critic. No retraining. + +The critic is fit on a beta BAND, so one checkpoint can be read at any query +beta. That makes the central tradeoff cheap to map: + + short hops -> the action still determines where you land, but the read is + myopic and never reaches the terminal reward + long hops -> the read reaches further, but the successor tends to ignore + the action chunk entirely + +Reports the action gap bucketed by time-to-episode-end, because a pooled number +averages the signal away: at beta=0.98 depth=1 the gap is +0.063 within 50 +frames of the end and ~0 beyond it, while the pooled value is +0.008. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, json +from pathlib import Path +import numpy as np +import torch + +from data import LiberoRSMData +from is_ope import load_critic, q_recursive, effective_horizon, train_bc +from model import BCHead +from train_rsm import auc + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--critic", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--betas", default="0.96,0.98,0.99,0.995") + ap.add_argument("--depths", default="1,2,3") + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--n", type=int, default=2048) + ap.add_argument("--chunk", type=int, default=10, + help="MUST match the critic's training chunk; the action\n dim is chunk*7 and a mismatch silently breaks loading") + ap.add_argument("--reward-mode", default="dense", choices=["dense","terminal"], + help="dense = P(task succeeds|z), every frame of a success is a " + "positive (~50%%). terminal = last k frames only (~0.5%%), which " + "leaves Q near-constant in the action.") + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--policy-family", default="flow", choices=["flow", "gauss"]) + ap.add_argument("--bc-steps", type=int, default=3000) + ap.add_argument("--batch", type=int, default=512) + args = ap.parse_args() + + # Seed torch too, not just numpy: the policy head init and the + # flow-matching noise are torch RNG. Without this two arms meant to + # differ in ONE flag start from different policies -- observed as + # pi_0 separation gaps of 0.0170 (IS on) vs 0.0089 (IS off). + torch.manual_seed(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + d = LiberoRSMData(args.cache, chunk=args.chunk, seed=args.seed, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode) + enc, rew, flow, rms, cfg = load_critic(args.critic, d.feat_dim, d.n_task, dev, data=d) + rng = np.random.default_rng(args.seed + 5) + # Continuation policy for the recursion boundary. This MUST be on-support: an + # untrained head emits off-manifold action chunks at every hop, and the frozen + # reward decoder then scores the resulting latents arbitrarily -- the same + # support-exploitation artifact that turned the cross-task action gap + # negative. A quick behaviour clone keeps the boundary actions in + # distribution so the depth>1 numbers mean something. + args.d_z = cfg["d_z"] + args.seed = args.seed + pol = train_bc(d, enc, args, dev, only_success=False, steps=args.bc_steps) + + fb = d.sample_frames(args.n, rng, "val", dev) + with torch.no_grad(): + z = enc(fb["x"]) + te = fb["to_end"].cpu().numpy() + succ = fb["succ"].cpu().numpy() + # Two negatives, deliberately: + # within-task -- an on-support alternative; the fair action-ranking test + # cross-task -- the old batch-wide permutation, kept as a CONTROL. Once + # the flow is genuinely action-conditioned, an off-support + # action yields an off-manifold latent that the frozen + # reward decoder scores arbitrarily, so a "preference" for + # it measures support violation, not action quality. + tk_np_all = fb["task"].cpu().numpy() + perm_cross = torch.randperm(args.n, device=dev) + pw = np.arange(args.n) + for ti in np.unique(tk_np_all): + idx = np.nonzero(tk_np_all == ti)[0] + if len(idx) > 1: + pw[idx] = rng.permutation(idx) + perm_within = torch.from_numpy(pw).to(dev) + rows = [] + for beta in [float(b) for b in args.betas.split(",")]: + for depth in [int(x) for x in args.depths.split(",")]: + if beta >= args.gamma and depth > 1: + continue + with torch.no_grad(): + q_log, ess = q_recursive(z, fb["a"], fb["task"], rew=rew, flow=flow, + rms=rms, pol=pol, wend=None, beta=beta, + gamma=args.gamma, depth=depth, + n_particles=args.particles, use_is=False) + q_win, _ = q_recursive(z, fb["a"][perm_within], fb["task"], rew=rew, + flow=flow, rms=rms, pol=pol, wend=None, + beta=beta, gamma=args.gamma, depth=depth, + n_particles=args.particles, use_is=False) + q_crs, _ = q_recursive(z, fb["a"][perm_cross], fb["task"], rew=rew, + flow=flow, rms=rms, pol=pol, wend=None, + beta=beta, gamma=args.gamma, depth=depth, + n_particles=args.particles, use_is=False) + gl = (q_log - q_win).cpu().numpy() + gc = (q_log - q_crs).cpu().numpy() + ql = q_log.cpu().numpy() + h = effective_horizon(beta, args.gamma, depth) + row = {"beta": beta, "depth": depth, + "eff_frames": h["effective_frames"], + "gamma_eff": h["gamma_effective"], + "gap_pooled": float(gl.mean()), + "win_pooled": float((gl > 0).mean()), + "gap_pooled_crosstask": float(gc.mean()), + "win_pooled_crosstask": float((gc > 0).mean()), + "state_auc": auc(ql, succ)} + for name, lo_, hi_ in (("0-50", 0, 50), ("50-100", 50, 100), + ("100-200", 100, 200), ("200+", 200, 1e9)): + m = (te >= lo_) & (te < hi_) + if m.sum() >= 16: + row[f"gap_{name}"] = float(gl[m].mean()) + row[f"win_{name}"] = float((gl[m] > 0).mean()) + rows.append(row) + print(f"beta={beta:<6} depth={depth} eff={h['effective_frames']:5.0f}f " + f"pooled gap={row['gap_pooled']:+.5f} win={row['win_pooled']:.3f} " + f"auc={row['state_auc']:.3f} " + f"0-50 win={row.get('win_0-50', float('nan')):.2f} " + f"| xtask win={row['win_pooled_crosstask']:.3f}", flush=True) + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + (out / "horizon_sweep.json").write_text(json.dumps(rows, indent=2)) + print(f"\nwrote {out/'horizon_sweep.json'}", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/sync_to_ibm.sh b/gen_q_rsm/rsm_libero/sync_to_ibm.sh new file mode 100644 index 0000000000000000000000000000000000000000..0bec8e7cd62ab681c3aaeda00c5dac6af8ae351c --- /dev/null +++ b/gen_q_rsm/rsm_libero/sync_to_ibm.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# Push this lane's code (and the feature stats it depends on) to Blue Vela and +# print the launch lines. Idempotent: safe to re-run. +# +# ACCESS: bluevela is reached only through a reverse tunnel on katsudon:3104 that +# is itself an LSF job named `claude_tunnel`. When that job ends the whole route +# dies and NOTHING here can revive it, because relaunching the job requires a +# bluevela shell, which requires the tunnel. A human with a live bluevela session +# must resubmit it. This script checks first and says so rather than hanging. +set -euo pipefail # -e: a failed rsync must NOT print the success notes +SRC=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +DST=/proj/dmfexp/zwhong/rsm_libero +CACHE_STATS=/data/pulkitag/users/rli14/rsm_libero_cache/full_demo/feat_stats.npz +SSHQ=(-o BatchMode=yes + + -J katsudon.csail.mit.edu -p 3104) +HOST=zwhong@127.0.0.1 + +if ! ssh -o BatchMode=yes katsudon.csail.mit.edu \ + 'ss -ltn 2>/dev/null | grep -q ":3104 "'; then + echo "TUNNEL DOWN: no listener on katsudon:3104." + echo "The LSF job 'claude_tunnel' (queue normal, group grp_runtime) has ended." + echo "Someone with a live bluevela shell must resubmit it; then re-run this." + exit 3 +fi + +# The tunnel being up does not mean we can authenticate. The cert can be valid +# and ACCEPTED by the server while the private key stays passphrase-locked with +# nothing in the agent, in which case every rsync fails and, without -e, this +# script used to print its launch notes anyway and look like it had worked. +if ! ssh "${SSHQ[@]}" "$HOST" true 2>/dev/null; then + echo "TUNNEL UP BUT AUTH FAILS." + ssh-keygen -L -f "$HOME/.ssh/id_rsa_zwhong-cert.pub" 2>/dev/null \ + | grep -E "Valid|Principals" -A1 | head -4 + echo "If the cert is still in date, the private key is passphrase-locked and" + echo "the agent is empty. Load it once: ssh-add ~/.ssh/id_rsa_zwhong" + exit 4 +fi +echo "[sync] tunnel up and authenticated; pushing code" +rsync -az --delete -e "ssh ${SSHQ[*]}" \ + --include='*.py' --include='*.sh' --include='*.sbatch' --include='*.md' \ + --exclude='*' "$SRC/" "$HOST:$DST/code/" +# DO NOT push feature statistics. The IBM cache is a DIFFERENT pack (4500 eps / +# 1.82M frames / 51.1% success) from the MIT one (5000 / 1.93M / 54.5%), and both +# are 4104-d, so the evaluator's dimension guard cannot catch a mismatched file. +# Copying MIT stats over IBM's silently mis-centres every run there. Each cache +# fits its own on first use. +# +# Note the one case where a checkpoint DOES transfer safely: --norm-pool demos +# computes statistics over demonstration frames only, and both packs contain the +# same 500 demos, so demo-pool stats agree across them. +echo "[sync] NOT pushing feature stats: each cache must fit its own" + +cat <<'NOTE' + +[sync] done. On bluevela the arms launch as (adjust --cache to the IBM cache): + + PY=/bin/python + C=/proj/dmfexp/zwhong/rsm_libero/cache/full_demo + R=/proj/dmfexp/zwhong/rsm_libero/runs/mit_port + + $PY code/bc_arm.py --cache $C --out $R/A --pool demos --policy-features raw \ + --feat-scale center --chunk 10 --bc-steps 60000 --in-ram 1 --seed 0 + $PY code/bc_arm.py --cache $C --out $R/B --pool succ --policy-features raw \ + --feat-scale center --chunk 10 --bc-steps 60000 --in-ram 1 --seed 0 + $PY code/train_rsm.py --cache $C --out $R/critic10 --chunk 10 --d-z 256 \ + --enc-width 1024 --flow-width 1024 --flow-depth 4 --batch 512 --steps 20000 \ + --warmup-reward 2000 --beta-lo 0.85 --beta-hi 0.97 --beta-q 0.90 \ + --w-actcon 0.5 --append-proprio 1 --in-ram 1 --eval-every 1000 --seed 0 + $PY code/iql.py --cache $C --critic $R/critic10/ckpt_best.pt --out $R/C ... + $PY code/awr.py --cache $C --critic $R/critic10/ckpt_best.pt --out $R/D ... + +If the IBM cache lacks feat_stats.npz for its own dim, delete the copied file and +let LiberoRSMData refit it there -- stats must match the cache they index. +NOTE diff --git a/gen_q_rsm/rsm_libero/test_lewm_port.py b/gen_q_rsm/rsm_libero/test_lewm_port.py new file mode 100644 index 0000000000000000000000000000000000000000..5788305d7539faf2754c4073a3407fb75355be61 --- /dev/null +++ b/gen_q_rsm/rsm_libero/test_lewm_port.py @@ -0,0 +1,143 @@ +"""Checks on the LeWM torch port (gen_q#268). CPU-only, seconds to run. + +The port is of a JAX reference this venv cannot execute (no jax), so its correctness has to be +ASSERTED rather than assumed. These are the four things that, if wrong, would silently turn LeWM +into a different method and make its column in the flagship table meaningless: + + 1. SIGReg is the Epps-Pulley statistic the reference computes -- checked against an independent + numpy implementation on the same random projections, and against its two limiting behaviours + (small on a standard normal, large on a collapsed representation). + 2. The AdaLN-zero block is the IDENTITY at initialisation. That is what "zero" means; if the + conditioning head were default-initialised, the predictor would start as noise and the recipe + -- which has no target network to stabilise it -- would not train. + 3. The prediction target is NOT detached. The reference comments this explicitly ("NO detach + (recipe)"): the encoder is pulled by the loss through the target as well as the prediction, and + collapse is prevented by SIGReg alone. Detaching is the single most natural "cleanup" someone + would apply, so the test pins it. + 4. The read-out round-trips: a checkpoint in train_lewm.py's format loads, scores, stays in [0,1], + and `fold` at depth 1 equals `d1`. + +usage: python test_lewm_port.py (or pytest test_lewm_port.py) +""" +import numpy as np +import torch + +from lewm_model import CTX, N_PREDS, AdaLNBlock, Encoder, LeWM, RewardProbe, sigreg_stat + + +def _sigreg_numpy(emb, A, knots=17): + """Independent implementation, transcribed from the reference's jnp version.""" + T, B, D = emb.shape + t = np.linspace(0.0, 3.0, knots) + dt = 3.0 / (knots - 1) + w = np.full((knots,), 2 * dt) + w[0] = dt + w[-1] = dt + phi = np.exp(-t ** 2 / 2.0) + weights = w * phi + x_t = (emb @ A)[..., None] * t + err = (np.cos(x_t).mean(-3) - phi) ** 2 + np.sin(x_t).mean(-3) ** 2 + return float(((err @ weights) * B).mean()) + + +def test_sigreg_matches_reference(): + g = torch.Generator().manual_seed(0) + emb = torch.randn(4, 64, 32, generator=g, dtype=torch.float64) + A = torch.randn(32, 128, generator=g, dtype=torch.float64) + A = A / A.norm(dim=0, keepdim=True) + got = float(sigreg_stat(emb, A=A, num_proj=128)) + want = _sigreg_numpy(emb.numpy(), A.numpy()) + assert abs(got - want) < 1e-8, f"SIGReg {got} != independent {want}" + + +def test_sigreg_penalises_collapse(): + g = torch.Generator().manual_seed(1) + normal = torch.randn(4, 256, 32, generator=g, dtype=torch.float64) + collapsed = torch.zeros(4, 256, 32, dtype=torch.float64) + 3.0 + A = torch.randn(32, 256, generator=g, dtype=torch.float64) + A = A / A.norm(dim=0, keepdim=True) + s_n = float(sigreg_stat(normal, A=A, num_proj=256)) + s_c = float(sigreg_stat(collapsed, A=A, num_proj=256)) + assert s_c > 10 * s_n, f"SIGReg does not penalise collapse: normal {s_n}, collapsed {s_c}" + + +def test_adaln_zero_is_identity_at_init(): + torch.manual_seed(0) + blk = AdaLNBlock(32, heads=4, mlp_dim=64) + x = torch.randn(3, CTX, 32) + c = torch.randn(3, CTX, 32) + mask = torch.tril(torch.ones(CTX, CTX, dtype=torch.bool))[None, None] + y = blk(x, c, mask) + assert torch.allclose(y, x, atol=0, rtol=0), \ + f"AdaLN-zero block is not the identity at init (max |dy| = {float((y - x).abs().max())})" + + +def test_encoder_stage_count(): + assert Encoder(16, in_ch=6, res=84).n_stages == 5 # 84->42->21->11->6->3 + assert Encoder(16, in_ch=3, res=64).n_stages == 4 # 64->32->16->8->4 + assert Encoder(16, in_ch=6, res=84).out_res <= 4 + + +def test_target_is_not_detached(): + """The encoder gradient must differ from the detached-target variant -- i.e. the loss really does + pull the target. If someone adds .detach(), this test is the one that fails.""" + torch.manual_seed(0) + m = LeWM(size="s", a_dim=14, in_ch=6, res=32, ctx=CTX) + frames = torch.randint(0, 255, (2, CTX + N_PREDS, 6, 32, 32), dtype=torch.uint8) + acts = torch.randn(2, CTX + N_PREDS, 14) + + def enc_grad(detach): + m.zero_grad(set_to_none=True) + pred, emb = m(frames, acts) + tgt = emb[:, N_PREDS:] + (pred - (tgt.detach() if detach else tgt)).pow(2).mean().backward() + return m.encoder.fc2.weight.grad.detach().clone() + + g_live = enc_grad(False) + g_det = enc_grad(True) + assert not torch.allclose(g_live, g_det, atol=1e-12), \ + "encoder gradient is identical with and without a detached target: the target is detached" + assert float(g_live.abs().sum()) > 0, "no gradient reaches the encoder at all" + + +def test_readout_round_trip(tmp=None): + import tempfile, os + import lewm_readout + torch.manual_seed(0) + a_dim, res, B = 56, 32, 5 + m = LeWM(size="s", a_dim=a_dim, in_ch=6, res=res, ctx=CTX) + pr = RewardProbe(m.emb_dim) + blob = {"model": "lewm", "lewm": m.state_dict(), "probe": pr.state_dict(), + "config": {"chunk": 8}, "d_act": a_dim, "step": 1, "q_action_winrate": 0.5, + "cams": ["agentview_image", "robot0_eye_in_hand_image"], + "arch": {"size": "s", "emb_dim": m.emb_dim, "a_dim": a_dim, "in_ch": 6, "res": res, + "ctx": CTX, "chunk": 8, "adim": 7}} + d = tempfile.mkdtemp() + p = os.path.join(d, "ckpt.pt") + torch.save(blob, p) + crit = lewm_readout.load_critic_lewm(p, device="cpu") + img = torch.randint(0, 255, (B, 6, res, res), dtype=torch.uint8) + a = torch.randn(B, a_dim).clamp(-1, 1) + q1, ql = crit.q((img, None), a, mode="d1", depth=1, gamma=0.99, return_logit=True) + qf, _ = crit.q((img, None), a, mode="fold", depth=1, gamma=0.99, return_logit=True) + q4, _ = crit.q((img, None), a, mode="fold", depth=4, gamma=0.99, return_logit=True) + for name, q in (("d1", q1), ("fold1", qf), ("fold4", q4)): + assert q.shape == (B,), f"{name}: shape {tuple(q.shape)}" + assert torch.isfinite(q).all(), f"{name}: non-finite" + assert bool((q >= 0).all() and (q <= 1).all()), f"{name}: outside [0,1]" + assert torch.allclose(q1, qf, atol=1e-6), "fold at depth 1 must equal d1" + # deterministic: the same inputs twice give the same answer bit for bit + q1b, _ = crit.q((img, None), a, mode="d1", depth=1, gamma=0.99, return_logit=True) + assert torch.equal(q1, q1b), "LeWM read-out is not deterministic" + # float frames in [0,1] (what the planner hands it) must match the uint8 path + qf_float, _ = crit.q((img.float() / 255.0, None), a, mode="d1", depth=1, gamma=0.99, + return_logit=True) + assert torch.allclose(q1, qf_float, atol=1e-5), "float-in-[0,1] frames disagree with uint8" + + +if __name__ == "__main__": + fns = [v for k, v in sorted(globals().items()) if k.startswith("test_")] + for f in fns: + f() + print(f" ok {f.__name__}") + print(f"\nall {len(fns)} LeWM port checks passed") diff --git a/gen_q_rsm/rsm_libero/their_ctl.sbatch b/gen_q_rsm/rsm_libero/their_ctl.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..1d2f530ffbb1a1d69f255f666da6b7adf16194cc --- /dev/null +++ b/gen_q_rsm/rsm_libero/their_ctl.sbatch @@ -0,0 +1,16 @@ +#!/bin/bash +#SBATCH --job-name=their_ctl +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=8 +#SBATCH --mem=64G +#SBATCH --time=12:00:00 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/mit/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/mit/%x_%j.err +set -uo pipefail +export PYTHONUNBUFFERED=1 +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +export FL15_TASKS="$(tr '\n' ',' < $B/logs/09052026_lib10_tasks.txt | sed 's/,,*/,/g; s/,$//')" +cd /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python their_trainer_control.py +RC=$?; echo "[ctl] rc=$RC"; exit $RC diff --git a/gen_q_rsm/rsm_libero/their_trainer_control.py b/gen_q_rsm/rsm_libero/their_trainer_control.py new file mode 100644 index 0000000000000000000000000000000000000000..5488c588ca9bff7d497d3c9e1577c5b57019df53 --- /dev/null +++ b/gen_q_rsm/rsm_libero/their_trainer_control.py @@ -0,0 +1,46 @@ +"""CONTROL: run the lane's own BC trainer to its full budget. + +Their bcdemos checkpoint records a held-out ODE-sampled MSE of 0.0032 at step +110000. Our pipeline plateaus near 0.042 at 120000. A 20k-step bisect showed both +paths equal (0.0495 theirs vs 0.0471 ours), so the question is whether their +number is reachable at all at the full budget, or whether it came from somewhere +else. Same loader, same head, same loss, same optimiser, logged every 5000 steps. +""" +import importlib.util, sys, numpy as np, torch + +W = ("/data/pulkitag/hamer_diffusion_policy_project/projects/" + "continual_learning_for_manipulation/.claude/worktrees/" + "08312026_jvq_recap_worktree/scripts/rlinf_jvq") +sys.path.insert(0, W) +_s = importlib.util.spec_from_file_location("lh", W + "/09032026_latent_head_bc.py") +lh = importlib.util.module_from_spec(_s); sys.modules["lh"] = lh; _s.loader.exec_module(lh) + +CACHE = "/data/pulkitag/users/rli14/libero10_demo_ogpo_cache_srv" +CH, BS, STEPS, DEV = 10, 1024, 120000, "cuda" + +def main(): + z, p, a, task, val = lh.load_cache(CACHE, CH) + tr = torch.nonzero(~val).squeeze(1); va = torch.nonzero(val).squeeze(1) + print(f"[ctl] {len(z)} frames, {len(tr)} train / {len(va)} val", flush=True) + torch.manual_seed(0) + m = lh.Head(4096, 8, len(lh.FS15), 1024, 4, CH).to(DEV) + opt = torch.optim.Adam(m.parameters(), lr=3e-4) + best = float("inf") + for step in range(1, STEPS + 1): + idx = tr[torch.randint(0, len(tr), (BS,))] + zb, pb, tb = z[idx].to(DEV), p[idx].to(DEV), task[idx].to(DEV) + ab = a[idx].to(DEV) + adv = torch.full((BS,), 2, dtype=torch.long, device=DEV) + k = torch.rand(BS, device=DEV); eps = torch.randn_like(ab) + x_k = (1 - k)[:, None, None] * ab + k[:, None, None] * eps + loss = ((m(zb, pb, tb, adv, x_k, k).view_as(ab) - (ab - eps)) ** 2).mean() + opt.zero_grad(); loss.backward(); opt.step() + if step % 5000 == 0 or step == STEPS: + v = lh.val_mse(m, z[va], p[va], task[va], a[va], DEV) + best = min(best, v) + print(f"[ctl] {step} cfm={float(loss):.5f} val_mse={v:.5f} best={best:.5f}", + flush=True) + print(f"[ctl] DONE best={best:.5f} (their checkpoint records 0.00319)", flush=True) + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/thr_test.py b/gen_q_rsm/rsm_libero/thr_test.py new file mode 100644 index 0000000000000000000000000000000000000000..5167a92bcfd741037061bcdd47c96a049f70b280 --- /dev/null +++ b/gen_q_rsm/rsm_libero/thr_test.py @@ -0,0 +1,32 @@ +"""Throughput comparison. thr_all = SR*max/mean_steps_all conflates success rate with +speed; the paired steps-to-success on episodes BOTH arms solved isolates speed alone.""" +import json, sys, statistics as st +from math import sqrt, erfc +E="/data/pulkitag/users/rli14/rsm_libero_runs/eval" +def load(f): + r=json.load(open(f"{E}/{f}.json")); d={} + for t,eps in r["episodes_detail"].items(): + for e in eps: d[(t,e["episode"])]=(bool(e["success"]), e["steps"]) + return r, d +pairs=[] +for i in range(1,len(sys.argv),2): pairs.append((sys.argv[i],sys.argv[i+1])) +TA=TB=SA=SB=0.0; dif=[]; wins=loss=0; n=0 +print(f"{'pair':26s} {'thr_all A':>10s} {'thr_all B':>10s} {'d%':>7s} {'thrS A':>8s} {'thrS B':>8s}") +for a,b in pairs: + RA,DA=load(a); RB,DB=load(b) + TA+=RA["throughput_all"]; TB+=RB["throughput_all"] + SA+=RA["throughput_succ"]; SB+=RB["throughput_succ"]; n+=1 + d=(RA["throughput_all"]-RB["throughput_all"])/RB["throughput_all"]*100 + print(f"{a[:26]:26s} {RA['throughput_all']:10.3f} {RB['throughput_all']:10.3f} " + f"{d:+7.1f} {RA['throughput_succ']:8.3f} {RB['throughput_succ']:8.3f}") + both=[k for k in set(DA)&set(DB) if DA[k][0] and DB[k][0]] + for k in both: + dd=DA[k][1]-DB[k][1]; dif.append(dd) + wins+= dd<0; loss+= dd>0 +print(f"\nMEAN thr_all {TA/n:.3f} vs {TB/n:.3f} {(TA-TB)/TB*100:+.1f}%") +print(f"MEAN thr_succ {SA/n:.3f} vs {SB/n:.3f} {(SA-SB)/SB*100:+.1f}%") +print(f"\nSPEED on {len(dif)} episodes BOTH arms solved (same init):") +print(f" mean {st.mean(dif):+.1f} steps median {st.median(dif):+.0f}") +print(f" A faster on {wins}, slower on {loss}, tied on {len(dif)-wins-loss}") +z=(wins-loss)/sqrt(max(wins+loss,1)); p=erfc(abs(z)/sqrt(2)) +print(f" sign test z={z:.2f} p={p:.3f} {'SIGNIFICANT' if p<0.05 else 'not significant'}") diff --git a/gen_q_rsm/rsm_libero/train_lewm.py b/gen_q_rsm/rsm_libero/train_lewm.py new file mode 100644 index 0000000000000000000000000000000000000000..4ba8d6c9d0c0904963356c696a8d998b025acd25 --- /dev/null +++ b/gen_q_rsm/rsm_libero/train_lewm.py @@ -0,0 +1,244 @@ +#!/usr/bin/env python3 +"""Train LeWM (LeWorldModel) as a best-of-N scorer for the single-actor flagship (gen_q#268). + +The objective is the reference recipe, unchanged (see lewm_model.py for the port and its declared +deviations): JEPA next-embedding prediction with an AdaLN-zero causal predictor, collapse prevented +by SIGReg alone -- no stop-gradient, no EMA target -- AdamW 5e-5 / wd 1e-3 with a global-norm clip +of 1.0, lambda_sig 0.09. + + loss = || pred_proj(predictor(emb[:, :ctx], act[:, :ctx])) - emb[:, 1:] ||^2 + + 0.09 * sigreg(emb) + +REWARD PROBE. Trained alongside on DETACHED embeddings with its own AdamW(3e-4) and a +class-balanced BCE against the provenance/membership label -- the same label RSM's membership head, +TD-Flow and DINO-WM all read. Detaching is what makes this equivalent to the reference's two-phase +fit (world model first, probe on frozen embeddings second) while costing one pass instead of two: +the probe cannot shape the representation, so the world model that results is the same one the +reference's phase 1 produces. The probe is fitted on BOTH the encoder embedding of a real frame and +the PREDICTED embedding of the next one, because scoring applies it to predicted embeddings and a +probe fitted only on encoder outputs would be evaluated off its own training distribution -- that +mismatch would weaken the baseline for a reason that has nothing to do with the world model. + +CHECKPOINT SELECTION is the rule every other scorer in the table uses: keep the checkpoint that best +RANKS ACTIONS on held-out episodes (the true chunk against a shuffled one), not the last one. + +usage: train_lewm.py --cache cache/ --out runs//wm/lewm [--size m] [--steps 100000] +""" +from __future__ import annotations + +import argparse +import json +import os as _os +import time +from pathlib import Path + +import numpy as np +import torch +import torch.nn.functional as F + +from lewm_data import StreamingFrameData +from lewm_model import (CLIP, CTX, LAMBDA, LEWM_SIZES, LR, N_PREDS, PROBE_LR, WD, LeWM, RewardProbe, + sigreg_stat) + + +def auc(score, label): + s = np.asarray(score, np.float64).ravel() + y = np.asarray(label, np.float64).ravel() > 0.5 + if y.all() or (~y).all(): + return float("nan") + r = s.argsort().argsort().astype(np.float64) + 1.0 + n1 = float(y.sum()) + n0 = float(len(y) - n1) + return float((r[y].sum() - n1 * (n1 + 1) / 2.0) / (n1 * n0)) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--hdf5", default="", help="source HDF5; default = cache/PACK.json src") + ap.add_argument("--out", required=True) + ap.add_argument("--size", default="m", choices=list(LEWM_SIZES), help="m = the official ~15M config") + ap.add_argument("--chunk", type=int, default=8, help="action chunk the world model is conditioned on") + ap.add_argument("--ctx", type=int, default=CTX) + ap.add_argument("--res", type=int, default=84) + ap.add_argument("--batch", type=int, default=128) + ap.add_argument("--steps", type=int, default=100000, + help="the reference default is 60000; 100000 matches every other scorer in the " + "flagship table, and a baseline given MORE than its own recipe's budget is " + "the safe direction to err in") + ap.add_argument("--lr", type=float, default=LR) + ap.add_argument("--wd", type=float, default=WD) + ap.add_argument("--clip", type=float, default=CLIP) + ap.add_argument("--lambda-sig", type=float, default=LAMBDA) + ap.add_argument("--num-proj", type=int, default=1024, help="SIGReg random projections") + ap.add_argument("--probe-lr", type=float, default=PROBE_LR) + ap.add_argument("--dropout", type=float, default=0.0) + ap.add_argument("--resident", type=int, default=96, help="episodes held in RAM (no image pack)") + ap.add_argument("--refresh-every", type=int, default=8, help="steps between episode swaps") + ap.add_argument("--eval-every", type=int, default=2500) + ap.add_argument("--eval-rows", type=int, default=1024) + ap.add_argument("--save-every", type=int, default=10000) + ap.add_argument("--resume", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--log-every", type=int, default=100) + ap.add_argument("--wandb-entity", default=_os.environ.get("RSM_WANDB_ENTITY", "")) + ap.add_argument("--wandb-project", default=_os.environ.get("RSM_WANDB_PROJECT", "rsm_rise")) + ap.add_argument("--wandb-name", default="") + ap.add_argument("--wandb-mode", default="online", choices=["online", "offline", "disabled"]) + args = ap.parse_args() + + torch.manual_seed(args.seed) + rng = np.random.default_rng(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + out = Path(args.out) + out.mkdir(parents=True, exist_ok=True) + + wb = None + if args.wandb_entity and args.wandb_mode != "disabled": + try: + import hashlib + + import wandb + _rid = hashlib.md5(str(out.resolve()).encode()).hexdigest()[:16] + wb = wandb.init(entity=args.wandb_entity, project=args.wandb_project, + name=args.wandb_name or out.name, id=_rid, resume="allow", + mode=args.wandb_mode, config=vars(args), dir=str(out)) + print(f"[lewm] wandb: {wb.url}", flush=True) + except Exception as e: + print(f"[lewm] wandb disabled: {e}", flush=True) + + d = StreamingFrameData(args.cache, args.hdf5, chunk=args.chunk, ctx=args.ctx, n_preds=N_PREDS, + resident=args.resident, refresh_every=args.refresh_every, seed=args.seed, + res=args.res) + d_act = d.d_act + model = LeWM(size=args.size, a_dim=d_act, in_ch=6, res=args.res, ctx=args.ctx, + dropout=args.dropout).to(dev) + probe = RewardProbe(model.emb_dim).to(dev) + opt = torch.optim.AdamW(model.parameters(), lr=args.lr, weight_decay=args.wd) + popt = torch.optim.AdamW(probe.parameters(), lr=args.probe_lr) + n_par = sum(p.numel() for p in model.parameters()) + print(f"[lewm] size={args.size} emb={model.emb_dim} params={n_par/1e6:.1f}M d_act={d_act} " + f"enc_stages={model.encoder.n_stages} enc_res={model.encoder.out_res} dev={dev}", flush=True) + + pos = float(d.ep_success.mean()) + pos_w = torch.tensor(max((1 - pos) / max(pos, 1e-6), 1.0), device=dev) + + start_step, best_win, hist = 0, -1.0, [] + ck = out / "ckpt.pt" + if args.resume and ck.exists(): + c = torch.load(ck, map_location=dev, weights_only=False) + model.load_state_dict(c["lewm"]) + probe.load_state_dict(c["probe"]) + if "opt" in c: + opt.load_state_dict(c["opt"]) + if "popt" in c: + popt.load_state_dict(c["popt"]) + start_step = int(c["step"]) + best_win = c.get("best_win", -1.0) + hist = c.get("hist", []) + rng = np.random.default_rng(args.seed + 9973 * start_step) + print(f"[lewm] RESUMED at step {start_step}/{args.steps} (best win {best_win:.3f})", flush=True) + if start_step >= args.steps: + print("[lewm] already complete", flush=True) + return + + @torch.no_grad() + def evaluate(): + model.eval(); probe.eval() + b = d.sample(min(args.eval_rows, 512), rng, "val", dev) + pred, emb = model(b["frames"], b["actions"]) + pl = float((pred - emb[:, N_PREDS:]).pow(2).mean()) + # does the probe on the PREDICTED embedding rank the true chunk above a shuffled one? + hist_emb = emb[:, : args.ctx] + a_true = b["actions"][:, : args.ctx] + perm = torch.randperm(a_true.shape[0], device=dev) + z_true = model.step_emb(hist_emb, a_true) + z_shuf = model.step_emb(hist_emb, a_true[perm]) + q_true = torch.sigmoid(probe(z_true)) + q_shuf = torch.sigmoid(probe(z_shuf)) + win = float((q_true > q_shuf).float().mean()) + gap = float((q_true - q_shuf).mean()) + pr = torch.sigmoid(probe(emb[:, args.ctx])).float().cpu().numpy() + a_ = auc(pr, b["label"].cpu().numpy()) + std = float(emb.reshape(-1, emb.shape[-1]).std(0).min()) + model.train(); probe.train() + return {"pred_mse_val": pl, "probe_auc": a_, "action_win": win, "action_gap": gap, + "emb_std_min": std} + + t0 = time.time() + model.train(); probe.train() + for step in range(start_step + 1, args.steps + 1): + b = d.sample(args.batch, rng, "train", dev) + pred, emb = model(b["frames"], b["actions"]) + # NOT detached: the target is the live encoder's own output. This is the recipe. + tgt = emb[:, N_PREDS:] + l_pred = (pred - tgt).pow(2).mean() + l_sig = sigreg_stat(emb.permute(1, 0, 2), num_proj=args.num_proj) + loss = l_pred + args.lambda_sig * l_sig + opt.zero_grad(set_to_none=True) + loss.backward() + gn = float(torch.nn.utils.clip_grad_norm_(model.parameters(), args.clip)) + opt.step() + + # ---- reward probe on DETACHED embeddings (see the module docstring) ---- + with torch.no_grad(): + z_enc = emb[:, args.ctx].detach() + z_pred = pred[:, -1].detach() + lg = probe(z_enc) + lg2 = probe(z_pred) + l_probe = 0.5 * (F.binary_cross_entropy_with_logits(lg, b["label"], pos_weight=pos_w) + + F.binary_cross_entropy_with_logits(lg2, b["label"], pos_weight=pos_w)) + popt.zero_grad(set_to_none=True) + l_probe.backward() + gn_p = float(torch.nn.utils.clip_grad_norm_(probe.parameters(), args.clip)) + popt.step() + + if step % 500 == 0: + print(f"[lewm] {step} pred={float(l_pred):.5f} sig={float(l_sig):.5f} " + f"probe={float(l_probe):.4f} gradnorm={gn:.3f} gradnorm_probe={gn_p:.3f} " + f"({step/(time.time()-t0):.2f} it/s)", flush=True) + if wb is not None and (step % args.log_every == 0 or step == 1): + wb.log({"train/loss": float(loss), "train/l_pred": float(l_pred), + "train/l_sigreg": float(l_sig), "train/l_probe": float(l_probe), + "train/gradnorm": gn, "train/gradnorm_probe": gn_p, + "train/it_per_s": step / max(time.time() - t0, 1e-6)}, step=step) + + if step % args.eval_every == 0 or step == args.steps: + e = evaluate() + hist.append({"step": step, **e}) + (out / "history.json").write_text(json.dumps(hist, indent=1)) + print(f"[lewm] EVAL {step}: pred_mse={e['pred_mse_val']:.5f} probe_auc={e['probe_auc']:.4f} " + f"ACTION win={e['action_win']:.3f} gap={e['action_gap']:+.5f} " + f"emb_std_min={e['emb_std_min']:.4f}", flush=True) + if wb is not None: + wb.log({f"eval/{k}": v for k, v in e.items()}, step=step) + blob = {"model": "lewm", "lewm": model.state_dict(), "probe": probe.state_dict(), + "config": vars(args), "arch": {"size": args.size, "emb_dim": model.emb_dim, + "a_dim": d_act, "in_ch": 6, "res": args.res, + "ctx": args.ctx, "chunk": args.chunk, + "adim": d.adim}, + "d_act": d_act, "step": step, "q_action_winrate": e["action_win"], + "cams": list(d.cams), "hdf5": d.hdf5, "cache": str(d.root)} + blob_r = dict(blob) + blob_r["opt"] = opt.state_dict(); blob_r["popt"] = popt.state_dict() + blob_r["best_win"] = max(best_win, e["action_win"]); blob_r["hist"] = hist + tmp = out / "ckpt.pt.tmp" + torch.save(blob_r, tmp) + _os.replace(tmp, out / "ckpt.pt") + if args.save_every and step % args.save_every == 0: + torch.save(blob, out / f"ckpt_s{step}.pt") + # A collapsed representation can rank actions by accident; require a live embedding. + healthy = e["emb_std_min"] > 1e-3 + if e["action_win"] > best_win and healthy: + best_win = e["action_win"] + torch.save(blob, out / "ckpt_best.pt") + print(f"[lewm] new BEST action winrate {best_win:.3f} at step {step}", flush=True) + elif not healthy: + print(f"[lewm] emb_std_min {e['emb_std_min']:.2e}: representation near collapse, " + f"NOT eligible as best", flush=True) + d.close() + print("[lewm] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/train_rsm.py b/gen_q_rsm/rsm_libero/train_rsm.py new file mode 100644 index 0000000000000000000000000000000000000000..a0b1a90c2a2c329b886ab9b9a60af3bf2e42c194 --- /dev/null +++ b/gen_q_rsm/rsm_libero/train_rsm.py @@ -0,0 +1,1182 @@ +"""Joint reward-latent + action-conditioned occupancy training (RSM) on LIBERO-10. + +No TD target, no return regression: the occupancy target is a REAL logged future +frame drawn at k ~ Geom(1-beta), and reward enters only at read-out. + +Diagnostics follow COLLAPSE_ANALYSIS: batch losses can look healthy while the +critic is useless, so the headline validation metric is the ACTION-ranking gap +(does Q prefer the logged chunk over a foreign chunk at the same state), not the +state-ranking AUC. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import os as _os +import argparse, json, time +from pathlib import Path +import numpy as np +import torch +import torch.nn.functional as F + +from model import (Encoder, RewardHead, OccFlow, ema_update) +from model import mlp, IdentityEncoder, PCAEncoder +from data import LiberoRSMData + + +def auc(score, label): + score = np.asarray(score, np.float64); label = np.asarray(label) > 0.5 + if label.all() or (~label).all(): + return float("nan") + order = np.argsort(score) + ranks = np.empty(len(score), np.float64); ranks[order] = np.arange(1, len(score) + 1) + npos = int(label.sum()); nneg = len(label) - npos + return float((ranks[label].sum() - npos * (npos + 1) / 2) / (npos * nneg)) + + +@torch.no_grad() +def sample_future(flow, enc_z, a, task, beta, rms, n_steps=8, n=1, x0=None): + """Euler ODE sample of the residual, returned as an absolute latent. + x0: optional initial noise [rows, D] -- lets a caller share the same draws across + candidates (common random numbers) so a comparison of Q values is paired.""" + B, D = enc_z.shape + if n > 1: + enc_z = enc_z.repeat_interleave(n, 0); a = a.repeat_interleave(n, 0) + task = task.repeat_interleave(n, 0); beta = beta.repeat_interleave(n, 0) + x = torch.randn(enc_z.shape[0], D, device=enc_z.device) if x0 is None else x0 + for s in range(n_steps): + k = torch.full((enc_z.shape[0],), 1.0 - s / n_steps, device=enc_z.device) + x = x + flow(enc_z, a, task, beta, x, k) / n_steps + return enc_z + x * rms + + +# ------------------------------------------------------------------------------------------------ +# TD-FLOW (gen_q#268): the occupancy target by BOOTSTRAPPING instead of Monte Carlo. +# +# Both rules fit the same object, m_beta(. | s, a), the beta-discounted successor measure, which +# obeys the Bellman equation ON MEASURES +# +# m_beta(. | s,a) = (1 - beta) P(. | s,a) + beta E_{s' ~ P(.|s,a)}[ m_beta(. | s', pi(s')) ]. +# +# RSM samples the LEFT-hand side directly: data.py returns s_{t+k} with k ~ Geom(1-beta) truncated +# at the episode end, an exact draw from m_beta along the behaviour trajectory (no bootstrap +# anywhere). TD-Flow samples the RIGHT-hand side using the previous iterate (an EMA target field +# theta_bar), which is Farebrother, Wiltzer, Bellemare, Castro, Pires & Tomar, "Temporal Difference +# Flows" (arXiv:2503.09817): +# +# X1 ~ (1 - beta) delta_{s'} + beta * delta_{psi_1(X0 | s', a'; theta_bar)} (eq. 6/7) +# +# and regresses the SAME rectified-flow loss onto that X1. Ported from the ocbench TDFlowAgent +# (projs/gen_q branch baseline/tdflow-ocbench, impls/agents/tdflow.py), which subclasses RSMAgent +# and overrides ONLY the occupancy target; this port keeps the same discipline -- identical velocity +# field and architecture, identical residual/RMS normaliser, identical reward head, identical beta +# sampling INCLUDING data.py's per-anchor truncation cap, identical chunking, optimiser and steps. +# The only thing that moves is what `delta` regresses onto. +# +# FLOW FRAME. OccFlow predicts the NORMALISED RESIDUAL y = (z_fut - z_now) / rms, so the flow's +# data space is a residual w.r.t. whatever state it is conditioned on. A sample or a path produced +# at (s', a') must therefore be TRANSLATED into the (s, a) frame before it can be a target for the +# field conditioned on (s, a). The map is a pure translation by (z_next - z_now)/rms, which is why +# velocities transfer unchanged and only positions shift (same argument as TDFlowAgent's +# _to_flow_frame / _from_flow_frame). All of this code therefore works in ABSOLUTE latents and +# lets the existing `delta = z_tgt - z_now` line do the framing. +TDFLOW_VARIANTS = ("td", "td_c", "td2") + + +def _euler_to_tau(flow_, z, a, task, beta, x0, tau, n_steps): + """`sample_future`'s Euler integrator stopped at a PER-SAMPLE time tau instead of at 1. + + Same field, same left-endpoint Euler rule, same n_steps; only the step size is per-sample + (tau / n_steps), so each row lands on psi_tau rather than psi_1. Returned in the FLOW's + coordinates (normalised residual), not as an absolute latent -- td2 regresses velocities there. + Used by the td2 variant only; td / td_c never need an interior point. + """ + x = x0 + dt = tau / n_steps + for s_ in range(n_steps): + k = 1.0 - s_ * dt + x = x + flow_(z, a, task, beta, x, k) * dt[:, None] + return x + + +@torch.no_grad() +def tdflow_occupancy_target(flow_b, z_now, z_next, a_next, task, beta, rms, z0, + n_steps=8, sample_clip=0.0): + """One draw from (1 - beta) delta_{s'} + beta * psi_1(. | s', a'; theta_bar), as an ABSOLUTE latent. + + `z0` is the flow's source noise. Passing the SAME noise that the interpolation will use is the + coupled variant td-cfm(c) (eq. 7) -- the natural coupling the sampler hands us for free and a + strictly better estimator of the same loss; passing a fresh independent draw is plain td-cfm + (eq. 6). The caller decides, so this function is variant-agnostic. + + The Bernoulli(beta) coin IS the Bellman mixture: at beta = 0.95 roughly 95% of a batch takes the + bootstrap branch and 5% regresses onto the true one-step successor, which is the only term that + carries ground truth. That is the paper's regime and the reason a target network is needed. + + `nan_to_num` mirrors the eval-side read-outs: an early, untrained field can emit non-finite + velocities and ONE non-finite target would poison the whole batch's gradient. `sample_clip` + (train_rsm.py --sample-clip 10 on every deployed arm) additionally holds the bootstrap inside + the state box the z-scored features actually live in; the Monte-Carlo target is a REAL logged + frame and so is bounded by construction, and without this the TD target is the one term in the + loss that is not. + """ + boot = sample_future(flow_b, z_next, a_next, task, beta, rms, n_steps=n_steps, n=1, x0=z0) + boot = torch.nan_to_num(boot, nan=0.0, posinf=0.0, neginf=0.0) + if sample_clip > 0: + boot = boot.clamp(-sample_clip, sample_clip) + take_boot = torch.rand(beta.shape[0], device=beta.device) < beta + z_tgt = torch.where(take_boot[:, None], boot, z_next) + return z_tgt, take_boot + + +def _wbce(logit, target, w, pos_w): + """BCE-with-logits, optionally with PER-FRAME sample weights (gen_q #271 scheme C). + + w is None or all-ones -> exactly F.binary_cross_entropy_with_logits(..., pos_weight=pos_w), + bit-for-bit the pre-#271 loss. Otherwise the per-frame losses are averaged with weights + w (sum(w*l)/sum(w)), so the scale of the reward term -- and hence its balance against the + flow/inverse-dynamics terms -- does not move when w_neg is raised. + """ + if w is None: + return F.binary_cross_entropy_with_logits(logit, target, pos_weight=pos_w) + w = w.reshape(logit.shape) + l = F.binary_cross_entropy_with_logits(logit, target, pos_weight=pos_w, reduction="none") + return (l * w).sum() / w.sum().clamp_min(1e-8) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--out", required=True) + ap.add_argument("--d-z", type=int, default=256) + ap.add_argument("--enc-width", type=int, default=1024) + ap.add_argument("--flow-width", type=int, default=1024) + ap.add_argument("--flow-depth", type=int, default=4) + ap.add_argument("--chunk", type=int, default=10) + ap.add_argument("--k-success", type=int, default=10) + ap.add_argument("--stratify-success", type=int, default=0, + help="1: hold out the same FRACTION of rewarded and unrewarded episodes. An\n" + "unstratified 10%% split of real_cooking_v5 put 2 of its 50 rewarded\n" + "episodes in val, so a sparse reward label leaves ~80 positive val frames\n" + "and any sampled val AUC is noise (gen_q#261). Required for every new real\n" + "cell; left 0 by default so existing runs resume on their original split.") + ap.add_argument("--beta-lo", type=float, default=0.90) + ap.add_argument("--beta-hi", type=float, default=0.995) + ap.add_argument("--beta-q", type=float, default=0.98, help="query beta for diagnostics") + ap.add_argument("--eval-nnl1-k", type=int, default=0, + help="K>0: at every eval run the SUCCESSOR-FIT sanity check. For B anchor frames " + "draw K successors at the anchor's own training beta and report " + "min_j |z_sample - z_j|_1 / dim against (a) that trajectory's OWN FUTURE " + "(nnl1_in) and (b) a DIFFERENT trajectory (nnl1_cross, the control) and " + "(c) random pool frames scored against the own future (nnl1_rand, chance). " + "nnl1_ratio = in/cross: ~1 means the model learned the MARGINAL, not the " + "successor conditional. Also logs reward-head MAE/AUC on the same frames. " + "Candidates come from a fixed strided pool built once (--eval-nnl1-pool).") + ap.add_argument("--eval-nnl1-b", type=int, default=256, help="anchor frames per NN-L1 eval") + ap.add_argument("--eval-nnl1-pool", type=int, default=20000, + help="frames in the fixed strided candidate pool (kept on GPU, fp16)") + ap.add_argument("--eval-nnl1-m", type=int, default=128, + help="candidates compared per anchor per side (subsampled from the pool)") + ap.add_argument("--beta-trunc-eps", type=float, default=0.02, + help="data.py caps beta per anchor at eps**(1/L) (L = frames remaining) so the\n" + "truncated geometric leaves a CONSTANT eps tail and beta means one thing\n" + "(gen_q#262). Set eps >= beta_hi to DISABLE the cap (then beta_cap >= beta_hi\n" + "for every L) and recover the pre-fix behaviour -- the A/B control arm.") + ap.add_argument("--batch", type=int, default=512) + ap.add_argument("--steps", type=int, default=40000) + ap.add_argument("--warmup-reward", type=int, default=2000) + ap.add_argument("--lr", type=float, default=3e-4) + ap.add_argument("--ema", type=float, default=0.995) + ap.add_argument("--var-floor", type=float, default=0.1) + ap.add_argument("--w-reward", type=float, default=1.0) + ap.add_argument("--flow-steps", type=int, default=8) + ap.add_argument("--w-actcon", type=float, default=0.0, + help="action-contrastive weight. RECIPE.md applies this on Ant/cubes " + "and not on PointMaze: it is needed exactly when the successor " + "would otherwise ignore the action. Turn it on if the action gap " + "is flat, which is the COLLAPSE_ANALYSIS failure mode.") + ap.add_argument("--w-invdyn", type=float, default=0.0, + help="inverse-dynamics auxiliary on the encoder: predict the " + "action chunk from (z_t, z_t+k). Needed because the " + "visual latent barely reflects the action, so the " + "occupancy is nearly independent of it.") + ap.add_argument("--eval-every", type=int, default=2000) + ap.add_argument("--success-gamma", type=float, default=0.98, + help="discount for reward-mode=soft: the label is " + "success_gamma ** (frames until success)") + ap.add_argument("--reward-loss", default="mse", choices=["mse", "bce"], + help="reward-head loss for the subgoal/soft modes: mse (regression) " + "or bce (classifier; class-balanced for subgoal_ind)") + ap.add_argument("--save-every", type=int, default=0, + help="save ckpt_s.pt every N steps (checkpoint selection on validation inits)") + ap.add_argument("--reward-mode", default="dense", choices=["dense","terminal","soft","subgoal","subgoal_ind"], + help="dense = P(task succeeds|z), every frame of a success is a " + "positive (~50%%). terminal = last k frames only (~0.5%%), which " + "leaves Q near-constant in the action.") + ap.add_argument("--reward-npy", default="", + help="path to a float32 [n_frames] .npy of per-frame reward labels that " + "REPLACES --reward-mode entirely (rsm_rise #261 reward-head study)") + ap.add_argument("--weight-npy", default="", + help="path to a float32 [n_frames] .npy of per-frame REWARD-LOSS sample " + "weights (gen_q #271 scheme C: w_neg on the S5/S6 hard negatives). " + "Affects the reward BCE only; unset = all ones = the old loss.") + ap.add_argument("--resume", type=int, default=1, + help="continue from /ckpt.pt if present. A 500k-step run " + "cannot fit one slurm window, so the run MUST be " + "restartable or the chain silently retrains from zero.") + ap.add_argument("--w-rrank", type=float, default=0.0, + help="weight on the READ-OUT RANKING loss (the port uses 2.0). " + "Ranks the success logit of a hop sampled under the REAL " + "action above one sampled under a shuffled action. This is " + "the action win rate we have only ever MEASURED; this term " + "optimises it. Hops are stop-grad, so it trains the reward " + "tower only and cannot corrupt the occupancy field. Distinct " + "from --w-actcon, which contrasts flow-matching ERRORS rather " + "than the success logits the Q read-out consumes.") + ap.add_argument("--rrank-tau", type=float, default=0.1) + ap.add_argument("--cache2", default="", help="second pack mixed into training batches (see below)") + ap.add_argument("--mix2", type=float, default=0.25, help="fraction of each training batch from --cache2") + ap.add_argument("--subgoal-dir2", default="", help="subgoal labels for --cache2") + ap.add_argument("--subgoal-dir", default="", + help="per-frame satisfied-subgoal labels from label_subgoals.py. " + "Required for --reward-mode subgoal, which is the only mode " + "whose target is a function of the state.") + ap.add_argument("--success-mask", default="", + help="admissibility mask from merge_verify.py. Logged successes " + "that do not reproduce in the eval environment are treated " + "as failures, so no reward is built for them.") + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--in-ram", type=int, default=1) + ap.add_argument("--wandb-entity", default=_os.environ.get("RSM_WANDB_ENTITY", ""), + help="W&B entity; '' (the default) disables W&B logging entirely. " + "rsm_rise sets RSM_WANDB_ENTITY=richardrl via its own wandb_env.sh; " + "nothing else changes, so other users of this script are unaffected.") + ap.add_argument("--wandb-project", default=_os.environ.get("RSM_WANDB_PROJECT", "rsm_rise")) + ap.add_argument("--wandb-name", default="", + help="run name (default: basename of --out)") + ap.add_argument("--wandb-mode", default="online", choices=["online", "offline", "disabled"]) + ap.add_argument("--wandb-id-salt", default="", + help="mixed into the run id (md5 of --out [+ salt]). A relaunch into the SAME --out after " + "deleting it would otherwise resume the old W&B run, whose step counter is ahead, " + "and W&B silently drops every log below that step.") + ap.add_argument("--log-every", type=int, default=100, + help="train-loss / grad-norm logging period (steps)") + ap.add_argument("--enc", default="mlp", choices=["mlp", "identity"], + help="identity: no learned encoder -- lat(x) = x (the z-scored cache feature, " + "d_z = feature dim), no EMA target, variance floor 0, reward warm-up 0. " + "For frozen foundation-model features modelled directly (rsm_rise DINO).") + ap.add_argument("--eval-minmse-n", type=int, default=0, + help="N>0: at every eval draw N futures per row (sample_future n=N) on a train " + "and a val batch of 2048 rows and log minmse_{train,val} = mean_rows min_i " + "|x'_i - x_{t+K}|^2/d in the latent the flow predicts in (identity: the " + "z-scored state), plus meanmse_* and staymse_* (x' = x_t). The fit criterion.") + ap.add_argument("--pca-dim", type=int, default=0, + help="k>0: fixed PCA map of the (z-scored) state to k dims, fitted on training frames " + "(model.PCAEncoder, stored in the checkpoint). Flow and reward head work in PCA " + "space; minmse is reported there AND mapped back to the full state (minmse_full_*).") + ap.add_argument("--pca-fit-frames", type=int, default=40000, help="training frames (strided) used to fit the PCA") + ap.add_argument("--flow-dropout", type=float, default=0.0, help="dropout inside the flow's residual blocks") + ap.add_argument("--flow-norm", type=int, default=0, + help="1: LayerNorm in the flow's residual blocks and before its output (model.OccFlow norm=True)") + ap.add_argument("--wd", type=float, default=0.01, help="AdamW weight decay (was hard-coded 0.01)") + ap.add_argument("--sample-clip", type=float, default=0.0, + help="clamp the sampled future latent to +-this in the diagnostics (0 = off). With " + "--enc identity the state itself is clip(+-z_clip), so clamping the sample to the " + "same box only removes off-manifold divergence of the Euler integration.") + ap.add_argument("--x-noise", type=float, default=0.0, + help="Gaussian noise (z-scored units) added to the CONDITIONING state x_now seen by " + "the flow and reward head during training (targets stay clean). Regulariser " + "against memorising episode identity: mug M generalised only within the " + "same-episode radius (NN dist 0.39) while other episodes sit at ~0.6, so val " + "velocities exploded (cfm_val 112 vs 0.95 train at step 5000). 0 = off.") + ap.add_argument("--flow-expectile", type=float, default=0.5, + help="expectile tau for the flow-matching (occupancy) loss. 0.5 = OFF and takes the " + "exact old code path (plain mean squared error on the velocity residual). With " + "tau > 0.5 the loss is 2*|tau - 1(u<0)|*u^2 with u = target - prediction, so " + "UNDER-prediction of the velocity toward the successor state is penalised more " + "than over-prediction: an optimistic successor/value estimate in the sense of " + "IQL-style expectile regression. tau < 0.5 is the pessimistic direction. The " + "factor 2 makes tau=0.5 numerically identical to the mse, so the tau knob does " + "not change the effective flow-loss weight.") + ap.add_argument("--append-proprio", type=int, default=0, + help="append normalised proprio to the LATENT, not just the " + "encoder input. Feeding it as 8 of 4104 input dims did " + "nothing: the encoder is trained by a reward loss that " + "does not depend on joint state, so it drops them. " + "Appending forces the successor to PREDICT the " + "action-sensitive channel (action-proprio |r| 0.98 vs " + "action-latent 0.49).") + # ---- TD-Flow occupancy target (gen_q#268) ---- + ap.add_argument("--occupancy-target", default="mc", choices=["mc", "td"], + help="mc (DEFAULT, unchanged): the occupancy target is the logged future " + "s_{t+k}, k ~ Geom(1-beta) truncated at the episode end -- Monte Carlo, no " + "bootstrap. td: the Bellman right-hand side sampled off an EMA target " + "field, (1-beta) delta_{s'} + beta psi_1(. | s', a'; theta_bar) " + "(Farebrother et al. 2025, arXiv:2503.09817). EVERYTHING else -- velocity " + "field, architecture, beta band and its per-anchor truncation cap, reward " + "head, chunking, optimiser, steps -- is identical, so an `mc` run and a " + "`td` run of the same cell differ in the occupancy target and nothing else.") + ap.add_argument("--tdflow-variant", default="td_c", choices=list(TDFLOW_VARIANTS), + help="td_c (DEFAULT) = Coupled TD-CFM, eq. 7: the interpolation source IS the " + "noise that generated the bootstrap sample. td = TD-CFM, eq. 6: a fresh " + "independent source. td2 = TD^2-CFM, eq. 8: the bootstrap term regresses " + "the live velocity onto the TARGET FIELD's velocity at a random interior " + "time along the target's own ODE path, so the loss FORM changes too.") + ap.add_argument("--tdflow-target", default="ema", choices=["ema", "live"], + help="which parameters the bootstrap reads. ema (DEFAULT): a target copy of " + "the flow, EMA-updated at --tdflow-tau, as Algorithm 1 requires. live: no " + "target network -- a diagnosis knob, not a reportable arm.") + ap.add_argument("--tdflow-tau", type=float, default=-1.0, + help="EMA rate of the target occupancy field; <0 means use --ema (0.995), the " + "same rate the encoder target already uses.") + ap.add_argument("--tdflow-mc-warmup", type=int, default=0, + help="force the (1-beta) one-step branch for the first N updates. OFF by " + "default: an arm that uses it is a HYBRID, not a clean TD-Flow baseline, " + "and any table row carrying it must say so.") + args = ap.parse_args() + + torch.manual_seed(args.seed); rng = np.random.default_rng(args.seed) + dev = "cuda" if torch.cuda.is_available() else "cpu" + out = Path(args.out); out.mkdir(parents=True, exist_ok=True) + + # ---- W&B (entity richardrl / project rsm_rise by default; resumable by run id) ---- + wb = None + if args.wandb_entity and args.wandb_mode != "disabled": + try: + import wandb, hashlib + _rid = hashlib.md5((str(out.resolve()) + args.wandb_id_salt).encode()).hexdigest()[:16] + wb = wandb.init(entity=args.wandb_entity, project=args.wandb_project, + name=args.wandb_name or out.name, id=_rid, resume="allow", + mode=args.wandb_mode, config=vars(args), dir=str(out)) + print(f"[rsm] wandb: {wb.url}", flush=True) + except Exception as e: # never let logging kill a run + print(f"[rsm] wandb disabled: {e}", flush=True) + wb = None + + def _flat(prefix, obj, acc): + """flatten nested dicts of floats for wandb.log""" + if isinstance(obj, dict): + for k, v in obj.items(): + _flat(f"{prefix}/{k}" if prefix else str(k), v, acc) + elif isinstance(obj, (int, float)): + acc[prefix] = float(obj) + return acc + + d = LiberoRSMData(args.cache, chunk=args.chunk, k_success=args.k_success, seed=args.seed, + stratify_success=bool(args.stratify_success), + success_gamma=args.success_gamma, + in_ram=bool(args.in_ram), reward_mode=args.reward_mode, + success_mask=args.success_mask, + reward_npy=args.reward_npy, + weight_npy=args.weight_npy, + subgoal_dir=args.subgoal_dir) + if args.cache2: + # Second pack mixed into TRAINING batches only (validation stays on --cache so the + # history is comparable). Use: on-policy rollouts of the proposers the critic has to + # rank -- the base corpus is 99% pi0.5 rollouts, so the BC-demos policy's actions are + # off-support for a critic fit on it alone (proposer_bias_diag: Q nearly flat over + # demo-style chunks, 2x the spread over rollout-style chunks -> the arg-max over a + # mixed pool is a winner's curse, not a value judgement). + d2 = LiberoRSMData(args.cache2, chunk=args.chunk, k_success=args.k_success, seed=args.seed, + stratify_success=bool(args.stratify_success), + success_gamma=args.success_gamma, in_ram=bool(args.in_ram), + reward_mode=args.reward_mode, subgoal_dir=args.subgoal_dir2, + normalize=False) + d2.norm_mu, d2.norm_sd = d.norm_mu, d.norm_sd # ONE feature transform + assert d2.feat_dim == d.feat_dim and d2.n_task == d.n_task, "cache2 layout differs" + print(f"[rsm] cache2: {d2.n_ep} eps, positives={d2.r.mean():.4f}, mixed at {args.mix2:.2f} " + f"of every training batch", flush=True) + + class _Mix: + def __init__(self, a, b, p): self.a, self.b, self.p = a, b, p + def __getattr__(self, k): return getattr(self.a, k) + def sample(self, batch, rng, lo, hi, split="train", device="cuda", beta_trunc_eps=0.02, + with_next=False): + if split != "train": + return self.a.sample(batch, rng, lo, hi, split, device, beta_trunc_eps, with_next) + nb = int(round(batch * self.p)); na = batch - nb + ba = self.a.sample(na, rng, lo, hi, split, device, beta_trunc_eps, with_next) + bb = self.b.sample(nb, rng, lo, hi, split, device, beta_trunc_eps, with_next) + out = {} + for k in ba: + if torch.is_tensor(ba[k]): out[k] = torch.cat([ba[k], bb[k]], 0) + else: out[k] = np.concatenate([ba[k], bb[k] + (self.a.n_ep if k == "ep" else self.a.ep_to[-1])]) + return out + d = _Mix(d, d2, args.mix2) + print(f"[rsm] {d.n_ep} eps ({len(d.train_eps)} train / {len(d.val_eps)} val), " + f"{d.n_task} tasks, dim={d.feat_dim}, positives={d.r.mean():.4f}", flush=True) + + @torch.no_grad() + def minmse_eval(lat_fn, flow_, enc_, enc_t_, rms_, split, n_samp, rows=2048, chunk_rows=256): + """--eval-minmse-n: per-row min over N sampled futures of the per-dim MSE to the + real logged x_{t+K}, in the latent the flow predicts in (identity: z-scored state).""" + b = d.sample(rows, rng, args.beta_lo, args.beta_hi, split, dev, args.beta_trunc_eps) + z_now = lat_fn(b["x_now"], enc_); z_fut = lat_fn(b["x_fut"], enc_t_) + back = getattr(enc_, "back", None) # PCA: map samples back to the full state space + mins, means, mins_f, means_f = [], [], [], [] + for i in range(0, rows, chunk_rows): + sl = slice(i, i + chunk_rows) + xs = sample_future(flow_, z_now[sl], b["a_now"][sl], b["task"][sl], b["beta"][sl], + rms_, args.flow_steps, n=n_samp) + if args.sample_clip > 0 and back is None: + xs = xs.clamp(-args.sample_clip, args.sample_clip) + err = (xs.view(-1, n_samp, xs.shape[-1]) - z_fut[sl][:, None]).pow(2).mean(-1) # [rows, N] + mins.append(err.min(1).values); means.append(err.mean(1)) + if back is not None: + xf = back(xs) + if args.sample_clip > 0: + xf = xf.clamp(-args.sample_clip, args.sample_clip) + errf = (xf.view(-1, n_samp, xf.shape[-1]) - b["x_fut"][sl][:, None]).pow(2).mean(-1) + mins_f.append(errf.min(1).values); means_f.append(errf.mean(1)) + out = {"minmse": float(torch.cat(mins).mean()), "meanmse": float(torch.cat(means).mean()), + "staymse": float((z_now - z_fut).pow(2).mean(-1).mean())} + if back is not None: # full 1545-d space, comparable with identity runs (includes the PCA reconstruction floor) + out.update({"minmse_full": float(torch.cat(mins_f).mean()), "meanmse_full": float(torch.cat(means_f).mean()), + "staymse_full": float((b["x_now"] - b["x_fut"]).pow(2).mean(-1).mean()), + "pcafloor_full": float((back(z_fut) - b["x_fut"]).pow(2).mean(-1).mean())}) + return out + + # ------------------------------------------------------------------ SUCCESSOR-FIT SANITY + # Does the flow actually fit the DINO features as a SUCCESSOR CONDITIONAL, or only as the + # corpus marginal? For B anchors we draw K successors at that anchor's own training beta and + # measure min_j |z_sample - z_j|_1 / dim over + # (a) the anchor trajectory's OWN FUTURE -> nnl1_in + # (b) one DIFFERENT trajectory -> nnl1_cross <-- the essential control + # (c) own future, but scoring RANDOM pool frames instead of samples -> nnl1_rand (chance) + # nnl1_ratio = nnl1_in / nnl1_cross. A model that learned the marginal scores the same against + # any trajectory, so ratio ~ 1. Candidates are a fixed strided pool built once and parked on + # the GPU in fp16, so each eval is a handful of batched cdist calls. + _nn = {"pool": None, "secs": 0.0} + + def _nnl1_build_pool(): + stride = max(1, int(d.ep_to[-1]) // max(args.eval_nnl1_pool, 1)) + # ALL episodes: a val anchor's own future lives in a val episode, so a train-only pool + # would leave every val anchor with no in-trajectory candidates. The pool is only ever + # read as NN candidates for a diagnostic, never trained on. + idx = np.concatenate([np.arange(int(d.ep_from[i]), int(d.ep_to[i]), stride, dtype=np.int64) + for i in range(d.n_ep)]) + ep_of = np.zeros(len(idx), np.int64) + for i in range(d.n_ep): + m = (idx >= d.ep_from[i]) & (idx < d.ep_to[i]) + ep_of[m] = i + with torch.no_grad(): + Z = [] + for j in range(0, len(idx), 2048): + Z.append(lat(torch.from_numpy(d._feat(idx[j:j + 2048])).to(dev), enc_t).half()) + Z = torch.cat(Z) + by_ep = {} + for i in np.unique(ep_of): + by_ep[int(i)] = np.nonzero(ep_of == i)[0] + print(f"[rsm] nnl1 pool: {len(idx)} frames (stride {stride}) from " + f"{len(by_ep)} episodes, {Z.numel()*2/1e6:.0f} MB fp16 on {dev}", flush=True) + # OPTIONAL per-frame segment id (rsm_rise real caches write seg.i16.npy). On the cooking + # corpus every episode is one ROUTE made of 1-2 SEGMENTS separated by an operator subgoal + # marker, and no route demonstrates the full 0->..->3->4 task: the 4-stage path only exists + # by stitching two episodes. Whether a successor sample can cross a segment boundary at all + # is therefore the composition question, so NN-L1 is split into "same segment" (easy) and + # "a LATER segment" (across the stitch boundary). + segf = None + try: + segf = np.load(Path(args.cache) / "seg.i16.npy") + if len(segf) != int(d.ep_to[-1]): + print(f"[rsm] seg.i16.npy length {len(segf)} != {int(d.ep_to[-1])}; ignored", flush=True) + segf = None + except Exception: + segf = None + eps_all = np.array(sorted(by_ep.keys()), np.int64) + tr = set(int(x) for x in d.train_eps) + return {"Z": Z, "t": idx, "ep": ep_of, "by_ep": by_ep, "eps": eps_all, + "seg": (segf[idx] if segf is not None else None), "segf": segf, + "eps_by_split": {"train": np.array([e for e in eps_all if int(e) in tr], np.int64), + "val": np.array([e for e in eps_all if int(e) not in tr], np.int64)}} + + @torch.no_grad() + def nnl1_eval(split="train"): + t_start = time.time() + if _nn["pool"] is None: + _nn["pool"] = _nnl1_build_pool() + P = _nn["pool"] + B, K, M = args.eval_nnl1_b, args.eval_nnl1_k, args.eval_nnl1_m + b = d.sample(B, rng, args.beta_lo, args.beta_hi, split, dev, args.beta_trunc_eps) + z_now = lat(b["x_now"], enc) + t_np, ep_np = b["t_idx"], b["ep"] + # candidate index matrices: [B,M] into the pool + in_idx = np.zeros((B, M), np.int64); cr_idx = np.zeros((B, M), np.int64) + sg_idx = np.zeros((B, M), np.int64); nx_idx = np.zeros((B, M), np.int64) + sg_ok = np.zeros(B, bool); nx_ok = np.zeros(B, bool) + keep = np.zeros(B, bool) + for i in range(B): + e = int(ep_np[i]) + cand = P["by_ep"].get(e) + if cand is None: + continue + fut = cand[P["t"][cand] > int(t_np[i])] # strictly future, same trajectory + if len(fut) == 0: + continue + pool_eps = P["eps_by_split"].get(split, P["eps"]) + if len(pool_eps) < 2: + pool_eps = P["eps"] + others = pool_eps[pool_eps != e] + if len(others) == 0: + continue + oc = P["by_ep"][int(rng.choice(others))] # one DIFFERENT trajectory, all of it + in_idx[i] = rng.choice(fut, size=M, replace=len(fut) < M) + cr_idx[i] = rng.choice(oc, size=M, replace=len(oc) < M) + keep[i] = True + if P["seg"] is not None: + s_now = int(P["segf"][int(t_np[i])]) + same = fut[P["seg"][fut] == s_now] + later = fut[P["seg"][fut] > s_now] + if len(same): + sg_idx[i] = rng.choice(same, size=M, replace=len(same) < M); sg_ok[i] = True + if len(later): + nx_idx[i] = rng.choice(later, size=M, replace=len(later) < M); nx_ok[i] = True + if keep.sum() < 8: + _nn["secs"] += time.time() - t_start + return {} + kp = np.nonzero(keep)[0] + zk = z_now[torch.from_numpy(kp).to(dev)] + bk = {k: (v[torch.from_numpy(kp).to(dev)] if torch.is_tensor(v) else v[kp]) + for k, v in b.items()} + nB = len(kp) + xs = sample_future(flow, zk, bk["a_now"], bk["task"], bk["beta"], rms, + args.flow_steps, n=K) + if args.sample_clip > 0: + xs = xs.clamp(-args.sample_clip, args.sample_clip) + dimf = xs.shape[-1] + xs = xs.view(nB, K, dimf).float() + rnd = P["Z"][torch.from_numpy(rng.choice(len(P["t"]), size=nB * K)).to(dev)] \ + .view(nB, K, dimf).float() + outs = {} + for tag, cidx, qry in (("in", in_idx[kp], xs), ("cross", cr_idx[kp], xs), + ("rand", in_idx[kp], rnd)): + acc = [] + for j in range(0, nB, 32): # chunk so cdist stays small + sl = slice(j, min(j + 32, nB)) + C = P["Z"][torch.from_numpy(cidx[sl]).to(dev)].float() # [c,M,dim] + acc.append(torch.cdist(qry[sl], C, p=1).div_(dimf).min(-1).values) # [c,K] + outs[f"nnl1_{tag}"] = float(torch.cat(acc).mean()) + # "STAY" reference, scored BOTH ways. sample_future returns z_now + rms*residual, so every + # sample is anchored at the anchor latent; that alone makes in < cross even for an untrained + # flow (verified: ratio 0.80 after 20 steps). The honest baseline is therefore the ratio the + # trivial "stay" predictor already achieves. The model has learned successor structure only + # if nnl1_ratio is materially BELOW nnl1_ratio_stay -- nnl1_ratio < 1 on its own proves + # nothing. + for tag, cidx in (("stay", in_idx[kp]), ("stay_cross", cr_idx[kp])): + acc = [] + for j in range(0, nB, 32): + sl = slice(j, min(j + 32, nB)) + C = P["Z"][torch.from_numpy(cidx[sl]).to(dev)].float() + acc.append(torch.cdist(zk[sl].float()[:, None], C, p=1).div_(dimf).min(-1).values) + outs[f"nnl1_{tag}"] = float(torch.cat(acc).mean()) + outs["nnl1_ratio"] = outs["nnl1_in"] / max(outs["nnl1_cross"], 1e-12) + outs["nnl1_ratio_stay"] = outs["nnl1_stay"] / max(outs["nnl1_stay_cross"], 1e-12) + outs["nnl1_ratio_vs_stay"] = outs["nnl1_ratio"] / max(outs["nnl1_ratio_stay"], 1e-12) + # within-segment vs across the subgoal (stitch) boundary + if P["seg"] is not None: + for tag, ok_all, cidx_all in (("sameseg", sg_ok, sg_idx), ("nextseg", nx_ok, nx_idx)): + sel = np.nonzero(ok_all[kp])[0] + if len(sel) < 8: + continue + acc = [] + for j in range(0, len(sel), 32): + ss = sel[j:j + 32] + C = P["Z"][torch.from_numpy(cidx_all[kp][ss]).to(dev)].float() + q = xs[torch.from_numpy(ss).to(dev)] + acc.append(torch.cdist(q, C, p=1).div_(dimf).min(-1).values) + outs[f"nnl1_{tag}"] = float(torch.cat(acc).mean()) + outs[f"nnl1_{tag}_n"] = int(len(sel)) + outs["nnl1_ratio_rand"] = outs["nnl1_in"] / max(outs["nnl1_rand"], 1e-12) + outs["nnl1_n_anchors"] = int(nB) + # ---- reward-head calibration on the SAME anchor frames ---- + pr = torch.sigmoid(rew(zk, bk["task"])).float().cpu().numpy().ravel() + lab = bk["r_now"].float().cpu().numpy().ravel() + outs["rhead_mae"] = float(np.abs(pr - lab).mean()) + outs["rhead_auc"] = auc(pr, lab) + outs["rhead_pos_rate"] = float((lab > 0.5).mean()) + outs["rhead_pred_mean"] = float(pr.mean()) + outs["rhead_pred_mean_pos"] = float(pr[lab > 0.5].mean()) if (lab > 0.5).any() else float("nan") + outs["rhead_pred_mean_neg"] = float(pr[lab <= 0.5].mean()) if (lab <= 0.5).any() else float("nan") + _nn["secs"] += time.time() - t_start + return outs + + d_act = args.chunk * d.adim + if args.pca_dim > 0: + args.enc = "pca" + if args.enc in ("identity", "pca"): + # The cache feature already carries proprio (data.py concatenates it), so appending + # it a second time would only duplicate 9 dims; the encoder-side knobs are no-ops. + if args.append_proprio: + print("[rsm] --enc identity: --append-proprio ignored (proprio is already in the feature)", flush=True) + args.append_proprio = 0 + if args.var_floor != 0 or args.warmup_reward != 0: + print(f"[rsm] --enc identity: forcing --var-floor 0 (was {args.var_floor}) and " + f"--warmup-reward 0 (was {args.warmup_reward})", flush=True) + args.var_floor = 0.0; args.warmup_reward = 0 + args.d_z = int(d.feat_dim) if args.enc == "identity" else int(args.pca_dim) + print(f"[rsm] --enc {args.enc}: latent = {'z-scored feature' if args.enc == 'identity' else 'fixed PCA of it'}, d_z={args.d_z}", flush=True) + n_pr = d.proprio.shape[1] if (args.append_proprio and d.proprio is not None) else 0 + pr_mu = pr_sd = None + if n_pr: + pr_s = np.asarray(d.proprio[::37], np.float32) + pr_mu = torch.tensor(pr_s.mean(0), device=dev) + pr_sd = torch.tensor(pr_s.std(0) + 1e-6, device=dev) + print(f"[rsm] appending {n_pr} proprio dims to the latent", flush=True) + d_lat = args.d_z + n_pr + if args.enc == "identity": + enc = IdentityEncoder(d.feat_dim).to(dev) + enc_t = enc # no parameters: target == online, EMA is a no-op + elif args.enc == "pca": + enc = PCAEncoder(d.feat_dim, args.pca_dim).to(dev) + _tr = np.concatenate([np.arange(d.ep_from[e], d.ep_to[e]) for e in d.train_eps]) + _tr = _tr[:: max(1, len(_tr) // args.pca_fit_frames)] + _evr = enc.fit(torch.from_numpy(d._feat(_tr)).to(dev)) + print(f"[rsm] PCA fitted on {len(_tr)} training frames: {args.pca_dim} dims explain " + f"{100*_evr:.1f}% of the variance", flush=True) + enc_t = enc # fixed map: no parameters, no EMA (resume reloads the stored map) + else: + enc = Encoder(d.feat_dim, args.d_z, args.enc_width).to(dev) + enc_t = Encoder(d.feat_dim, args.d_z, args.enc_width).to(dev) + enc_t.load_state_dict(enc.state_dict()) + for p in enc_t.parameters(): + p.requires_grad_(False) + rew = RewardHead(d_lat, d.n_task).to(dev) + flow = OccFlow(d_lat, d_act, d.n_task, width=args.flow_width, + depth=args.flow_depth, norm=bool(args.flow_norm), dropout=args.flow_dropout).to(dev) + # TD-Flow's theta_bar: the SAME module class and constructor arguments as the online field, so + # the only difference between the two is how their weights got there. Built only for + # --occupancy-target td, so the MC path allocates nothing extra and its step cost is unchanged. + flow_t, tdf_tau = None, (args.ema if args.tdflow_tau < 0 else args.tdflow_tau) + if args.occupancy_target == "td": + flow_t = OccFlow(d_lat, d_act, d.n_task, width=args.flow_width, + depth=args.flow_depth, norm=bool(args.flow_norm), + dropout=args.flow_dropout).to(dev) + flow_t.load_state_dict(flow.state_dict()) + for _p in flow_t.parameters(): + _p.requires_grad_(False) + flow_t.eval() # dropout/norm in inference mode: theta_bar is only ever sampled from + print(f"[rsm] OCCUPANCY TARGET = TD-Flow ({args.tdflow_variant}), target params " + f"{args.tdflow_target} (tau={tdf_tau}), flow_steps={args.flow_steps}, " + f"mc_warmup={args.tdflow_mc_warmup}", flush=True) + + def lat(x, enc_fn): + z = enc_fn(x) + if not n_pr: + return z + return torch.cat([z, (x[:, -n_pr:] - pr_mu) / pr_sd], -1) + invdyn = mlp([2 * d_lat, 1024, 1024, d_act], norm=True).to(dev) + _trainable = (list(enc.parameters()) + list(rew.parameters()) + + list(flow.parameters()) + list(invdyn.parameters())) + opt = torch.optim.AdamW(_trainable, lr=args.lr, weight_decay=args.wd) + + # running per-dimension RMS of the residual (the RECIPE normalisation) + rms = torch.ones(d_lat, device=dev) + hist = [] + best_win = -1.0 + t0 = time.time() + + start_step = 0 + _ck = out / "ckpt.pt" + if args.resume and _ck.exists(): + _c = torch.load(_ck, map_location=dev, weights_only=False) + enc.load_state_dict(_c["enc"]); enc_t.load_state_dict(_c["enc_t"]) + rew.load_state_dict(_c["rew"]); flow.load_state_dict(_c["flow"]) + if flow_t is not None: + # Without theta_bar a restart bootstraps off the ONLINE field for the first ~1/(1-tau) + # steps, which is the one configuration Algorithm 1 forbids. Older TD blobs (or an + # mc->td switch) have no flow_t; fall back to the online weights and say so. + if "flow_t" in _c: + flow_t.load_state_dict(_c["flow_t"]) + else: + flow_t.load_state_dict(flow.state_dict()) + print("[rsm] resume: checkpoint carries no flow_t; theta_bar reinitialised from " + "the online field", flush=True) + if "invdyn" in _c: + invdyn.load_state_dict(_c["invdyn"]) + if "opt" in _c: + opt.load_state_dict(_c["opt"]) + rms = _c["rms"].to(dev) + best_win = _c.get("best_win", -1.0) + hist = _c.get("hist", []) + start_step = int(_c["step"]) + # decorrelate the stream from the pre-restart draws + rng = np.random.default_rng(args.seed + 9973 * start_step) + print(f"[rsm] RESUMED at step {start_step}/{args.steps} " + f"(best action winrate {best_win:.3f})", flush=True) + if start_step >= args.steps: + print("[rsm] already complete; nothing to do", flush=True) + return + + for step in range(start_step + 1, args.steps + 1): + # with_next = the TD path only: it adds s_{t+1} and the logged chunk there to the batch and + # draws NOTHING from `rng`, so the MC path's draws are bit-for-bit what they always were. + b = d.sample(args.batch, rng, args.beta_lo, args.beta_hi, "train", dev, args.beta_trunc_eps, + args.occupancy_target == "td") + z = lat(b["x_now"], enc) + with torch.no_grad(): + z_fut_t = lat(b["x_fut"], enc_t) + z_clean = z + if args.x_noise > 0: + # perturb what the networks CONDITION on; the residual target below is built from the + # clean state so the flow still integrates to real futures at sampling time + z = z + args.x_noise * torch.randn_like(z) + # ---- reward head (class-balanced: positives are ~0.5% of frames) ---- + logit = rew(z, b["task"]) + if args.reward_loss == "bce" and args.reward_mode in ("soft", "subgoal", "subgoal_ind"): + # CLASSIFIER head. subgoal / soft: BCE against the [0,1] target (unweighted -- + # the minimiser is still E[r|z], but the loss is the proper scoring rule for a + # probability and does not flatten near 0/1 the way the squared error does). + # subgoal_ind: class-balanced BCE on the goal indicator, i.e. a goal + # classifier with positives up-weighted to the base rate. + if args.reward_mode == "subgoal_ind": + pos_w = torch.tensor(max((1 - d.r.mean()) / max(d.r.mean(), 1e-6), 1.0), + device=dev) + l_rew = _wbce(logit, b["r_now"], b.get("w_now"), pos_w) + else: + l_rew = _wbce(logit, b["r_now"], b.get("w_now"), None) + elif args.reward_mode in ("soft", "subgoal", "subgoal_ind"): + # Continuous per-state target in [0,1] -> REGRESS it. Class-balanced BCE + # would be wrong twice over: the base rate no longer means anything on a + # continuous target, and weighted BCE on a soft target t converges to + # w*t/(w*t + 1 - t), not t. The occupancy identity needs the read-out to + # be E[r|z] on the nose, so a monotone-but-biased head re-introduces + # exactly the type error this reward mode exists to remove. + l_rew = (torch.sigmoid(logit) - b["r_now"]).pow(2).mean() + else: + pos_w = torch.tensor(max((1 - d.r.mean()) / max(d.r.mean(), 1e-6), 1.0), + device=dev) + l_rew = _wbce(logit, b["r_now"], b.get("w_now"), pos_w) + + # ---- inverse dynamics: force ACTION information into the latent ---- + # Root cause of the flat/inverted action gap. This lane already measured + # that over 5 frames the executed action correlates with the proprio delta + # at |r| up to 0.98 but with the VISUAL-latent delta at only 0.49 (mean + # 0.10): a mean-pooled PaliGemma embedding barely resolves the motion a + # 10-frame chunk produces. The encoder is then trained on reward alone, so + # nothing stops it discarding what little action signal survives, and + # p(z'|z,A) ends up almost independent of A -- a value that ranks states + # but not actions, which is exactly what every critic here showed + # (win rate 0.52-0.57, decaying below chance). + # Predicting the action chunk from (z_t, z_t+k) makes the latent keep it. + l_inv = torch.zeros((), device=dev) + if args.w_invdyn > 0: + z_fut_live = lat(b["x_fut"], enc) # grad flows into the encoder + l_inv = (invdyn(torch.cat([z, z_fut_live], -1)) + - b["a_now"]).pow(2).mean() + + # ---- occupancy: flow-match the NORMALISED residual ---- + # OCCUPANCY TARGET (gen_q#268). `mc` (the default) keeps the Monte-Carlo future s_{t+k}; + # `td` replaces it with a draw from the Bellman right-hand side off theta_bar. The MC + # branch is the original code, unmoved, and consumes the identical RNG stream: only the TD + # branch draws anything extra, and it draws k/noise EARLY because the coupled variant needs + # the interpolation source to be the bootstrap's source. + z_tgt, td_diag = z_fut_t, {} + if args.occupancy_target == "td": + z_next_t = lat(b["x_next"], enc_t).detach() + flow_b = flow_t if args.tdflow_target == "ema" else flow + k = torch.rand(args.batch, device=dev) + noise = torch.randn(args.batch, d_lat, device=dev) + z0 = noise if args.tdflow_variant in ("td_c", "td2") else \ + torch.randn(args.batch, d_lat, device=dev) + if args.tdflow_variant == "td2": + # eq. 8 keeps the (1-beta) branch as ordinary CFM onto the TRUE one-step successor + # and replaces the bootstrap branch with velocity matching against theta_bar, so + # here the target is s' and the second term enters the loss below. + z_tgt = z_next_t + else: + z_tgt, _take = tdflow_occupancy_target( + flow_b, z_clean.detach(), z_next_t, b["a_next"], b["task"], b["beta"], rms, z0, + n_steps=args.flow_steps, sample_clip=args.sample_clip) + if step <= args.tdflow_mc_warmup: + z_tgt = z_next_t # hybrid warm-up: one-step branch only + td_diag["boot_frac"] = float(_take.float().mean()) + # The MC-vs-TD gap, measured per step on the same anchors: how far the bootstrapped + # target sits from the logged future that the MC arm would have regressed onto. + td_diag["tgt_mse_vs_mc"] = float((z_tgt - z_fut_t).pow(2).mean()) + td_diag["tgt_absmax"] = float(z_tgt.abs().max()) + # The reference for tgt_mse_vs_mc is NOT zero: the occupancy is a distribution, so a + # correct bootstrap is an independent draw and differs from the MC draw by the + # distribution's own spread (scripts/mc_target_spread.py measures it: 0.55-0.69 on these + # caches, and a converged MC model's own sample sits at 1.27x it). These two make the + # failure mode of the ratio readable per step: over-dispersion shows up as tgt_std + # climbing away from mc_std. + td_diag["tgt_std"] = float(z_tgt.std()) + td_diag["mc_std"] = float(z_fut_t.std()) + delta = (z_tgt - z_clean.detach()) if step <= args.warmup_reward else (z_tgt - z_clean) + # RMS IS A PROPERTY OF THE DATA, NOT OF THE TARGET (gen_q#268, fixed 2026-09-21 08:5x UTC). + # `rms` is the per-dimension scale the flow's data space is expressed in: the field predicts + # the velocity of (z_fut - z_now)/rms, and sample_future multiplies its output back by rms. + # Fitting it on the TD target therefore closes a loop -- a slightly over-dispersed bootstrap + # raises rms, which scales the next bootstrap up, which raises rms again -- with no fixed + # point short of the --sample-clip box. Measured on the first TD runs + # (scripts/tdflow_target_diag.py, status/tdflow/target_diag.json): rms drifted 0.88 (the MC + # twin's converged value) -> 1.66 at step 15000 on one task and -> 3.21 on another, and the + # TD target's std reached 3.09 against the Monte-Carlo target's 1.01, i.e. 15x the MSE two + # independent MC draws differ by. The clamp was NOT binding (clip_frac 0.004), so this was + # divergence, not saturation. + # The MC future is drawn on the TD path anyway (for the td_tgt_mse_vs_mc diagnostic), so the + # normaliser can be fitted on the REAL logged residual on both paths -- which is also what + # "same residual / horizon normalisers" in the TDFlowAgent contract requires. On the MC path + # rms_src IS delta, so this is a no-op there. + rms_src = delta if args.occupancy_target == "mc" else (z_fut_t - z_clean).detach() + with torch.no_grad(): + cur = rms_src.pow(2).mean(0).sqrt().clamp_min(1e-3) + rms.mul_(0.99).add_(cur, alpha=0.01) + y = delta / rms + if args.occupancy_target == "mc": + k = torch.rand(args.batch, device=dev) + noise = torch.randn_like(y) + x_k = (1 - k)[:, None] * y + k[:, None] * noise + v = flow(z if step > args.warmup_reward else z.detach(), + b["a_now"], b["task"], b["beta"], x_k, k) + if args.occupancy_target == "td" and args.tdflow_variant == "td2": + # ell_td2 = (1-beta) || v_theta(X_t | s,a) - (Delta - X0) ||^2 + # + beta || v_theta(Xc_t | s,a) - v_thetabar(Xc'_t | s', a') ||^2 + # with Xc'_t = psi_tau(X0 | s', a'; theta_bar) the target's own path stopped at a random + # tau, and Xc_t the same point expressed in THIS state's flow frame (a translation by + # (z' - z)/rms, see the frame note on tdflow_occupancy_target). The weights are the + # per-row Bellman mixture, not a batch mean, so a low-beta row still regresses mostly + # on ground truth. --flow-expectile does not apply to this variant: the loss form + # itself is the paper's, and an asymmetric weight on top of it would be a third method. + _u_row = (v - (y - noise)).pow(2).mean(-1) + tau_t = torch.rand(args.batch, device=dev) + with torch.no_grad(): + xc_p = _euler_to_tau(flow_b, z_next_t, b["a_next"], b["task"], b["beta"], + noise, tau_t, args.flow_steps) + xc_p = torch.nan_to_num(xc_p, nan=0.0, posinf=0.0, neginf=0.0) + v_tgt = torch.nan_to_num( + flow_b(z_next_t, b["a_next"], b["task"], b["beta"], xc_p, 1.0 - tau_t), + nan=0.0, posinf=0.0, neginf=0.0) + xc = xc_p + (z_next_t - z_clean.detach()) / rms + v_live = flow(z if step > args.warmup_reward else z.detach(), + b["a_now"], b["task"], b["beta"], xc, 1.0 - tau_t) + l_cfm = ((1.0 - b["beta"]) * _u_row + + b["beta"] * (v_live - v_tgt).pow(2).mean(-1)).mean() + elif args.flow_expectile == 0.5: + l_cfm = (v - (y - noise)).pow(2).mean() + else: + # expectile regression on the velocity residual (u = target - prediction); + # tau > 0.5 up-weights u > 0, i.e. the model predicting too little motion. + _tau = args.flow_expectile + _u = (y - noise) - v + _w = torch.where(_u >= 0, _tau, 1.0 - _tau) + l_cfm = (2.0 * _w * _u.pow(2)).mean() + + # Action-contrastive: the velocity conditioned on the TRUE chunk must + # explain the true target better than one conditioned on another chunk + # from the batch. Without this the successor can ignore A entirely, which + # yields a value that ranks states but not actions. + l_ac = torch.zeros((), device=dev) + if args.w_actcon > 0: + u = y - noise + perm = torch.randperm(args.batch, device=dev) + v_neg = flow(z if step > args.warmup_reward else z.detach(), + b["a_now"][perm], b["task"], b["beta"], x_k, k) + e_pos = (v - u).pow(2).mean(-1) + e_neg = (v_neg - u).pow(2).mean(-1) + l_ac = F.softplus(e_pos - e_neg).mean() + + # ---- variance floor: stops the latent collapsing under the EMA target ---- + std = z.std(0) + l_var = F.relu(args.var_floor - std).mean() + + # ---- read-out ranking on sampled hops (port: reward_rank_weight=2.0) ---- + l_rr = torch.zeros((), device=dev) + if args.w_rrank > 0: + with torch.no_grad(): + perm = torch.randperm(b["a"].shape[0], device=dev) + a_shuf = b["a"][perm] + hop_d = sample_future(flow, z.detach(), b["a"], b["task"], + b["beta"], rms, args.flow_steps, n=1) + hop_r = sample_future(flow, z.detach(), a_shuf, b["task"], + b["beta"], rms, args.flow_steps, n=1) + logit_d = rew(hop_d, b["task"]) + logit_r = rew(hop_r, b["task"]) + l_rr = -F.logsigmoid((logit_d - logit_r) / max(args.rrank_tau, 1e-6)).mean() + + loss = (args.w_reward * l_rew + l_cfm + 10.0 * l_var + + args.w_actcon * l_ac + args.w_invdyn * l_inv + + args.w_rrank * l_rr) + opt.zero_grad(); loss.backward() + # total grad norm BEFORE clipping (clip_grad_norm_ returns it), plus per-module norms + gn_total = float(torch.nn.utils.clip_grad_norm_(_trainable, 1.0)) + opt.step() + ema_update(enc_t, enc, args.ema) + if flow_t is not None: + # theta_bar <- tau theta_bar + (1-tau) theta, the same rule and the same rate the + # encoder target uses. Stepped AFTER opt.step() so theta_bar always lags the online + # field by exactly one update, as Algorithm 1 has it. + ema_update(flow_t, flow, tdf_tau) + + if step % 500 == 0: + print(f"[rsm] {step} rew={float(l_rew):.4f} cfm={float(l_cfm):.4f} " + f"ac={float(l_ac):.4f} gradnorm={gn_total:.3f} " + f"std_min={float(std.min()):.3f} ({step/(time.time()-t0):.1f} it/s)" + + ("".join(f" td_{_k}={_v:.4g}" for _k, _v in td_diag.items()) if td_diag else ""), + flush=True) + if wb is not None and (step % args.log_every == 0 or step == 1): + def _mod_gn(m): + sq = [p.grad.detach().float().pow(2).sum() for p in m.parameters() if p.grad is not None] + return float(torch.stack(sq).sum().sqrt()) if sq else 0.0 + _log = {"train/loss": float(loss), "train/l_rew": float(l_rew), + "train/l_cfm": float(l_cfm), "train/l_var": float(l_var), + "train/l_actcon": float(l_ac), "train/l_invdyn": float(l_inv), + "train/l_rrank": float(l_rr), + "train/gradnorm": gn_total, "train/gradnorm_clipped": min(gn_total, 1.0), + "train/gradnorm_enc": _mod_gn(enc), "train/gradnorm_rew": _mod_gn(rew), + "train/gradnorm_flow": _mod_gn(flow), + "train/latent_std_min": float(std.min()), "train/rms_mean": float(rms.mean()), + "train/lr": opt.param_groups[0]["lr"], + "train/it_per_s": step / max(time.time() - t0, 1e-6)} + # TD-Flow diagnostics; empty dict (and so no extra keys) on the MC path. + _log.update({f"train/td_{_k}": _v for _k, _v in td_diag.items()}) + wb.log(_log, step=step) + + if step % args.eval_every == 0 or step == args.steps: + enc.eval(); rew.eval(); flow.eval() + with torch.no_grad(): + vb = d.sample(2048, rng, args.beta_lo, args.beta_hi, "val", dev, args.beta_trunc_eps) + zv = lat(vb["x_now"], enc) + r_auc = auc(rew(zv, vb["task"]).cpu().numpy(), vb["r_now"].cpu().numpy()) + zf = lat(vb["x_fut"], enc_t) + yv = (zf - zv) / rms + kv = torch.rand(2048, device=dev); nv = torch.randn_like(yv) + xk = (1 - kv)[:, None] * yv + kv[:, None] * nv + cfm_v = float((flow(zv, vb["a_now"], vb["task"], vb["beta"], xk, kv) + - (yv - nv)).pow(2).mean()) + + # ---- headline: does Q RANK ACTIONS at a fixed state? ---- + fb = d.sample_frames(1024, rng, "val", dev) + zq = lat(fb["x"], enc) + beta_q = torch.full((1024,), args.beta_q, device=dev) + # WITHIN-TASK permutation: a cross-task chunk is off-support, and + # once the successor is action-conditioned the frozen reward head + # scores off-manifold latents arbitrarily. Comparing against it + # measures support violation rather than action quality. + tkp = fb["task"].cpu().numpy() + pw = np.arange(1024) + for _ti in np.unique(tkp): + _ix = np.nonzero(tkp == _ti)[0] + if len(_ix) > 1: + pw[_ix] = rng.permutation(_ix) + perm = torch.from_numpy(pw).to(dev) + def q_of(a_chunk): + zp = sample_future(flow, zq, a_chunk, fb["task"], beta_q, rms, + args.flow_steps, n=4) + if args.sample_clip > 0: + zp = zp.clamp(-args.sample_clip, args.sample_clip) + p = torch.sigmoid(rew(zp, fb["task"].repeat_interleave(4, 0))) + return p.view(1024, 4).mean(1) + q_log = q_of(fb["a"]) + q_for = q_of(fb["a"][perm]) + gap = float((q_log - q_for).mean()) + gap_win = float((q_log > q_for).float().mean()) + q_succ_auc = auc(q_log.cpu().numpy(), fb["succ"].cpu().numpy()) + + # ---- does the read-out actually ESTIMATE Qbar? ---- + # Qbar(s,a) = E_{z'~d_beta(.|s,a)}[r(z')] = E_{k~Geom(1-beta)}[r(s_{t+k})]. + # With a per-state reward the right-hand side is computable directly + # from the logged trajectory (final frame absorbing), so this is a + # ground-truth check of the identity rather than a proxy. It is only + # meaningful when r IS a function of the state: under reward-mode=soft + # the target is a return and no state-indexed RHS exists. + tk_np = fb["task"].cpu().numpy() + _ep = fb["ep"]; _t = fb["t_idx"] + _kk = rng.geometric(1.0 - args.beta_q, size=(256, len(_ep))) - 1 + _ix = np.minimum(_t[None, :] + _kk, d.ep_to[_ep][None, :] - 1) + q_mc = d.r[_ix].mean(0) + _qh = q_log.cpu().numpy() + identity = { + "q_mc_mean": float(q_mc.mean()), + "q_hat_mean": float(_qh.mean()), + "mse": float(((_qh - q_mc) ** 2).mean()), + "corr": float(np.corrcoef(_qh, q_mc)[0, 1]) if _qh.std() > 1e-8 else 0.0, + "spearman": float(np.corrcoef( + np.argsort(np.argsort(_qh)), np.argsort(np.argsort(q_mc)))[0, 1]), + # a read-out that ignored the state would match the mean but + # carry no correlation; this is the null it has to beat + "mse_const": float(((q_mc.mean() - q_mc) ** 2).mean()), + } + # Pooled corr is dominated by TASK identity: mean subgoal fraction + # ranges 0.00 (task 5) to 0.41 (task 8) across tasks, so a read-out + # that only knew which task it was looking at already scores ~0.45. + # Within-task is the number that says the read-out tracks the state. + _wt = [] + for _ti in np.unique(tk_np): + _m = tk_np == _ti + if _m.sum() < 32 or _qh[_m].std() < 1e-8 or q_mc[_m].std() < 1e-8: + continue + _wt.append(float(np.corrcoef(_qh[_m], q_mc[_m])[0, 1])) + identity["corr_within_task"] = float(np.mean(_wt)) if _wt else 0.0 + identity["n_tasks_scored"] = len(_wt) + + # per-task breakdown: success rates in this corpus span 0.000 + # (STUDY_SCENE1, 0/2962 rollouts) to 0.957, so a pooled number + # hides which tasks the critic actually works on. + gl = (q_log - q_for).cpu().numpy() + ql = q_log.cpu().numpy(); sc = fb["succ"].cpu().numpy() + # Time-to-end buckets. At beta=0.98 a depth-2 read covers ~75 + # frames, so the value can only be informative near the end of an + # episode; this shows where the action signal actually lives + # instead of averaging it away. + te = fb["to_end"].cpu().numpy() + by_horizon = {} + for name, lo_, hi_ in (("0-50", 0, 50), ("50-100", 50, 100), + ("100-200", 100, 200), ("200+", 200, 1e9)): + m = (te >= lo_) & (te < hi_) + if m.sum() < 16: + continue + by_horizon[name] = {"n": int(m.sum()), + "action_gap": float(gl[m].mean()), + "action_winrate": float((gl[m] > 0).mean()), + "q_mean": float(ql[m].mean())} + + per_task = {} + for ti in np.unique(tk_np): + m = tk_np == ti + per_task[int(ti)] = {"n": int(m.sum()), + "action_gap": float(gl[m].mean()), + "success_auc": auc(ql[m], sc[m]), + "succ_rate": float(sc[m].mean())} + mm = {} + if args.eval_nnl1_k > 0: + for _sp in ("train", "val"): + for _k, _v in nnl1_eval(_sp).items(): + mm[f"{_k}_{_sp}"] = _v + mm["nnl1_secs_total"] = _nn["secs"] + mm["nnl1_frac_walltime"] = _nn["secs"] / max(time.time() - t0, 1e-9) + if args.eval_minmse_n > 0: + for _sp in ("train", "val"): + _r = minmse_eval(lat, flow, enc, enc_t, rms, _sp, args.eval_minmse_n) + for _k, _v in _r.items(): + mm[f"{_k}_{_sp}"] = _v + enc.train(); rew.train(); flow.train() + + rec = {"step": step, "reward_auc": r_auc, "cfm_val": cfm_v, + "per_task": per_task, "by_horizon": by_horizon, + "latent_std_min": float(std.min().detach()), + "q_action_gap": gap, "q_action_winrate": gap_win, + "q_success_auc": q_succ_auc, "q_mean": float(q_log.mean()), + "identity": identity, **mm} + hist.append(rec) + if "nnl1_in_train" in mm and "nnl1_in_val" in mm: + print(f"[rsm] NNL1(K={args.eval_nnl1_k},B={mm['nnl1_n_anchors_train']}) " + f"train in={mm['nnl1_in_train']:.4f} cross={mm['nnl1_cross_train']:.4f} " + f"rand={mm['nnl1_rand_train']:.4f} stay={mm['nnl1_stay_train']:.4f} " + f"ratio(in/cross)={mm['nnl1_ratio_train']:.3f} " + f"stay_ratio={mm['nnl1_ratio_stay_train']:.3f} " + f"vs_stay={mm['nnl1_ratio_vs_stay_train']:.3f} | " + f"val in={mm['nnl1_in_val']:.4f} cross={mm['nnl1_cross_val']:.4f} " + f"ratio={mm['nnl1_ratio_val']:.3f}", flush=True) + if "nnl1_sameseg_train" in mm or "nnl1_nextseg_train" in mm: + print(f"[rsm] NNL1-SEG train sameseg=" + f"{mm.get('nnl1_sameseg_train', float('nan')):.4f} " + f"(n={mm.get('nnl1_sameseg_n_train', 0)}) nextseg=" + f"{mm.get('nnl1_nextseg_train', float('nan')):.4f} " + f"(n={mm.get('nnl1_nextseg_n_train', 0)}) " + f"[nextseg >> sameseg => one hop cannot cross a subgoal boundary]", + flush=True) + print(f"[rsm] RHEAD train mae={mm['rhead_mae_train']:.4f} " + f"auc={mm['rhead_auc_train']:.4f} pos={mm['rhead_pos_rate_train']:.3f} " + f"pred(pos/neg)={mm['rhead_pred_mean_pos_train']:.3f}/" + f"{mm['rhead_pred_mean_neg_train']:.3f} | val mae={mm['rhead_mae_val']:.4f} " + f"auc={mm['rhead_auc_val']:.4f} || hook cost " + f"{mm['nnl1_frac_walltime']*100:.3f}% of wall time " + f"({mm['nnl1_secs_total']:.1f}s)", flush=True) + if mm: + print(f"[rsm] MINMSE(n={args.eval_minmse_n}) train={mm['minmse_train']:.4f} " + f"val={mm['minmse_val']:.4f} | mean train={mm['meanmse_train']:.4f} " + f"val={mm['meanmse_val']:.4f} | stay train={mm['staymse_train']:.4f} " + f"val={mm['staymse_val']:.4f}", flush=True) + if "minmse_full_train" in mm: + print(f"[rsm] MINMSE_FULL(1545-d) train={mm['minmse_full_train']:.4f} val={mm['minmse_full_val']:.4f} " + f"| mean train={mm['meanmse_full_train']:.4f} val={mm['meanmse_full_val']:.4f} " + f"| stay train={mm['staymse_full_train']:.4f} val={mm['staymse_full_val']:.4f} " + f"| pca floor train={mm['pcafloor_full_train']:.4f} val={mm['pcafloor_full_val']:.4f}", flush=True) + if wb is not None: + wb.log(_flat("eval", {k: v for k, v in rec.items() if k != "step"}, {}), step=step) + print(f"[rsm] EVAL {step}: reward_auc={r_auc:.4f} cfm={cfm_v:.4f} " + f"ACTION gap={gap:+.5f} win={gap_win:.3f} | state auc={q_succ_auc:.4f}", + flush=True) + print(f"[rsm] IDENTITY Qbar: corr={identity['corr']:.3f} " + f"spearman={identity['spearman']:.3f} mse={identity['mse']:.5f} " + f"within-task={identity['corr_within_task']:.3f} " + f"(const-null mse {identity['mse_const']:.5f}) " + f"qhat={identity['q_hat_mean']:.4f} vs mc={identity['q_mc_mean']:.4f}", + flush=True) + print("[rsm] by time-to-end: " + " ".join( + f"{k}:gap={v['action_gap']:+.5f}/win={v['action_winrate']:.2f}(n={v['n']})" + for k, v in by_horizon.items()), flush=True) + (out / "history.json").write_text(json.dumps(hist, indent=1)) + blob = {"cam_res": getattr(d, "cam_res", "UNKNOWN"), + "encoder": getattr(d, "encoder", "pi05_base_pytorch"), + "enc": enc.state_dict(), "enc_t": enc_t.state_dict(), + "rew": rew.state_dict(), "flow": flow.state_dict(), + # theta_bar: resume-only. Every read-out (is_ope.load_critic, rsm_scorer) reads + # "flow", so a TD blob loads and scores exactly like an MC blob of the same cell. + **({"flow_t": flow_t.state_dict()} if flow_t is not None else {}), + "rms": rms.cpu(), "config": vars(args), "n_pr": n_pr, + "tasks": d.tasks, "d_act": d_act, "step": step, + "q_action_winrate": gap_win, + # is_ope.load_critic reads these: identity checkpoints carry no encoder + # weights, so the feature width has to be recorded explicitly. + "enc_kind": args.enc, "d_in": int(d.feat_dim), "d_lat": int(d_lat)} + # resume state: without the optimiser moments a restart restarts Adam + # cold and undoes progress, and without best_win the chain forgets + # which checkpoint was the best ranker. + blob_r = dict(blob) + blob_r["opt"] = opt.state_dict() + blob_r["invdyn"] = invdyn.state_dict() + blob_r["best_win"] = max(best_win, gap_win) + blob_r["hist"] = hist + # 2026-09-22: the RESUME blob is ~3x the size of the scoring blob (it carries the AdamW + # moments) and it is written FIRST, so on a full/flaky filesystem its failure used to take + # the whole run down BEFORE the small scoring checkpoint was written -- 5000 good steps + # thrown away for a write error (observed on ess6000-1 at 348.6T/350T: "unexpected pos + # 30895936 vs 30895824"). Resume state is a convenience; the scoring checkpoint is the + # product. So: warn and carry on, and leave the previous ckpt.pt in place (the partial + # write goes to .tmp and is removed, so resume falls back to the last good blob). + _tmp = out / "ckpt.pt.tmp" + try: + torch.save(blob_r, _tmp) + _os.replace(_tmp, out / "ckpt.pt") # atomic: a kill mid-write is safe + except Exception as e: # noqa: BLE001 + print(f"[rsm] WARNING: resume checkpoint not written at step {step}: " + f"{type(e).__name__}: {e} -- training continues, resume falls back to the " + f"previous ckpt.pt", flush=True) + try: + _tmp.unlink() + except OSError: + pass + if args.save_every and step % args.save_every == 0: + try: + torch.save(blob, out / f"ckpt_s{step}.pt") # for validation-set selection + except Exception as e: # noqa: BLE001 + print(f"[rsm] WARNING: ckpt_s{step}.pt not written: {type(e).__name__}: {e}", + flush=True) + # Keep the checkpoint that best RANKS ACTIONS, not the last one. The + # critic exists to supply an advantage, and action ranking is not + # monotone in training: this run peaked at win 0.615 / gap +0.103 at + # step 14000 and decayed to 0.516 / +0.023 by 20000 as off-support + # optimism crept back, so keeping the last checkpoint throws away the + # only thing AWR consumes. Selection is on the held-out split. + # A checkpoint is eligible as BEST only if the occupancy is still healthy. + # qsg_r (subset, 2026-09-13) oscillated 0.22-0.93 in cfm_val, spiked to + # 3.7 at 120k and 38.3 at 130k -- and was selected as best at 130k because + # action win-rate happened to peak on the diverging flow. Ranking by a + # diverging occupancy is not the method. + _cf = [h["cfm_val"] for h in hist[:-1] if "cfm_val" in h] + _healthy = (len(_cf) < 3) or (cfm_v <= 2.0 * float(np.median(_cf))) + if not _healthy: + print(f"[rsm] cfm_val {cfm_v:.3f} > 2x running median " + f"{float(np.median(_cf)):.3f}: occupancy unstable, NOT eligible as best", + flush=True) + if gap_win > best_win and _healthy: + best_win = gap_win + torch.save(blob, out / "ckpt_best.pt") + print(f"[rsm] new BEST action winrate {gap_win:.3f} " + f"(gap {gap:+.5f}) at step {step}", flush=True) + print("[rsm] DONE", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/train_rsm_dwm.py b/gen_q_rsm/rsm_libero/train_rsm_dwm.py new file mode 100644 index 0000000000000000000000000000000000000000..5dd50da63f76cc8fb3e5eb04adf1e1bbc8f1f19b --- /dev/null +++ b/gen_q_rsm/rsm_libero/train_rsm_dwm.py @@ -0,0 +1,765 @@ +"""DWM successor-model trainer: DINO-WM's ViT predictor, trained by conditional flow matching +to output beta-discounted successors in DINOv2 token space (LAUNCH_MATRIX rev. 4, Stage 1). + +Interface-compatible with train_rsm.py: same flags where they exist, same console prints, +same history.json keys (plus the min-MSE fit criterion), same W&B convention, same +ckpt.pt / ckpt_best.pt / ckpt_s.pt files. Multi-GPU by torchrun (DDP, one node): + + torchrun --standalone --nproc_per_node 8 train_rsm_dwm.py --cache cache/ \ + --out runs//rsm/DWM --batch 4096 --steps 100000 ... + +Run without torchrun for a single process. The token cache is memory-mapped, so the 8 +ranks share one page-cache copy of tok.f16.npy. +""" +from __future__ import annotations +import sys as _sys, os as _os +_sys.path.insert(0, _os.path.dirname(_os.path.abspath(__file__))) +import argparse, copy, datetime, json, queue, threading, time +from pathlib import Path +import numpy as np +import torch +import torch.distributed as dist +import torch.nn.functional as F + +from model import ema_update +from train_rsm import auc +from dwm_model import (DWM, DWMReward, Normalizer, TokenRSMData, sample_future_dwm, + N_TOK, D_TOK, RHO_FLOOR, Y_CLIP, SD_FLOOR, Z_CLIP) + + +# --------------------------------------------------------------------------- # +# distributed helpers +# --------------------------------------------------------------------------- # +def ddp_setup(): + if "WORLD_SIZE" in _os.environ and int(_os.environ["WORLD_SIZE"]) > 1: + backend = "nccl" if torch.cuda.is_available() else "gloo" + dist.init_process_group(backend, timeout=datetime.timedelta(minutes=120)) + rank, world = dist.get_rank(), dist.get_world_size() + local = int(_os.environ.get("LOCAL_RANK", 0)) + else: + rank, world, local = 0, 1, 0 + if torch.cuda.is_available(): + torch.cuda.set_device(local) + dev = torch.device("cuda", local) + else: + dev = torch.device("cpu") + return rank, world, local, dev + + +def _all_reduce_mean(t): + if dist.is_initialized(): + dist.all_reduce(t, op=dist.ReduceOp.SUM); t /= dist.get_world_size() + return t + + +def _gather_cat(t): + """all_gather equal-sized shards -> concatenated on every rank (order = rank order).""" + if not dist.is_initialized(): + return t + out = [torch.empty_like(t) for _ in range(dist.get_world_size())] + dist.all_gather(out, t.contiguous()) + return torch.cat(out, 0) + + +def _barrier(): + if dist.is_initialized(): + dist.barrier() + + +# --------------------------------------------------------------------------- # +# background batch prefetch (memmap gather + pinned H2D overlap the ViT step) +# --------------------------------------------------------------------------- # +class Prefetcher: + def __init__(self, data, rng, batch, beta_lo, beta_hi, device, n_slots=3, onestep=False): + self.d, self.rng, self.batch = data, rng, batch + # onestep (DINO-WM, gen_q#268): the target frame is the anchor plus ONE action chunk, not a + # draw from the beta-discounted occupancy. The anchor draw itself is untouched, so a + # latent-MSE run and a flow run see the same episodes and the same anchors. + self.onestep = onestep + self.lo, self.hi, self.dev = beta_lo, beta_hi, device + self.n = n_slots + self.slots = [None] * n_slots; self.events = [None] * n_slots + self.q = queue.Queue(maxsize=n_slots - 1) + self.stop = False + self.pin = device.type == "cuda" + self.th = threading.Thread(target=self._run, daemon=True); self.th.start() + + def _run(self): + i = 0 + while not self.stop: + s = i % self.n + if self.stop: + break + ev = self.events[s] + if ev is not None: + ev.synchronize() + e, t, fut, beta = self.d.draw(self.batch, self.rng, self.lo, self.hi, "train") + if self.onestep: + fut, beta = _onestep_future(self.d, e, t) + b = self.d.gather(e, t, fut, beta) + tens = {k: v for k, v in b.items() if torch.is_tensor(v)} + meta = {k: v for k, v in b.items() if not torch.is_tensor(v)} + if self.slots[s] is None: + self.slots[s] = {k: (torch.empty_like(v).pin_memory() if self.pin else torch.empty_like(v)) + for k, v in tens.items()} + for k, v in tens.items(): + self.slots[s][k].copy_(v) + self.q.put((s, meta)) + i += 1 + # leave the pinned buffers alive until the main thread's pending H2D copies are done + for ev in self.events: + if ev is not None: + try: + ev.synchronize() + except Exception: + pass + + def next(self): + s, meta = self.q.get() + out = {k: v.to(self.dev, non_blocking=True, copy=True) for k, v in self.slots[s].items()} + if self.pin: + ev = torch.cuda.Event(); ev.record(); self.events[s] = ev + out.update(meta) + return out + + def close(self): + """Stop and JOIN the worker: returning from main while the thread is inside a numpy/torch + copy aborts the interpreter at teardown ('terminate called without an active exception').""" + self.stop = True + for _ in range(600): # drain until the thread has left its loop + try: + while True: + self.q.get_nowait() + except queue.Empty: + pass + self.th.join(timeout=0.1) + if not self.th.is_alive(): + break + + +# --------------------------------------------------------------------------- # +def _onestep_future(d, e, t): + """(fut, beta) for the DINO-WM one-step target: the frame one ACTION CHUNK ahead. + + A DINO-WM hop is one chunk of `d.chunk` frames (0.4 s at 20 Hz), which is what the action the + model is conditioned on actually covers -- whereas an RSM/DWM hop spans 1/(1-beta) frames. That + is why gen_q#268 matches the two scorers on the NUMBER of hops (L in {1,2,4,8}) and not on beta: + a latent-dynamics model has no beta. beta is returned as ZERO so the predictor's beta + conditioning is a constant on this path and carries no information; the read-out passes the same + constant, so training and scoring agree. + Clamped to the episode's last frame: a terminal anchor predicts itself rather than the first + frame of the next episode. + """ + hi = d.ep_to[e] + fut = np.minimum(t + d.chunk, hi - 1) + return fut, np.zeros(len(t), dtype=np.float64) + + +def cfm_terms(model, norm, rms_tok, rms_pr, b, k=None, noise=None, perm=None, x_noise=0.0, + dynamics="flow"): + """Flow-matching pieces on one (micro-)batch. Returns dict with per-row errors. + x_noise: Gaussian noise (z-scored units) on the CONDITIONING state only (train_rsm.py's + --x-noise); the residual target is built from the clean state.""" + tok_now = norm.tok(b["tok_now"]); tok_fut = norm.tok(b["tok_fut"]) + pr_now = norm.pr(b["pr_now"]); pr_fut = norm.pr(b["pr_fut"]) + B = tok_now.shape[0] + y_tok = ((tok_fut - tok_now) / rms_tok).clamp(-Y_CLIP, Y_CLIP) # rms floored at RHO_FLOOR + y_pr = ((pr_fut - pr_now) / rms_pr).clamp(-Y_CLIP, Y_CLIP) + tok_now_clean, pr_now_clean = tok_now, pr_now + if x_noise > 0: + tok_now = tok_now + x_noise * torch.randn_like(tok_now) + pr_now = pr_now + x_noise * torch.randn_like(pr_now) + if dynamics == "latent_mse": + return _latent_mse_terms(model, b, tok_now, pr_now, tok_now_clean, pr_now_clean, + tok_fut, pr_fut, rms_tok, rms_pr, y_tok, y_pr, perm) + if k is None: + k = torch.rand(B, device=tok_now.device) + if noise is None: + noise = (torch.randn_like(y_tok), torch.randn_like(y_pr)) + n_tok, n_pr = noise + xk_tok = (1 - k)[:, None, None] * y_tok + k[:, None, None] * n_tok + xk_pr = (1 - k)[:, None] * y_pr + k[:, None] * n_pr + u_tok, u_pr = y_tok - n_tok, y_pr - n_pr + v_tok, v_pr = model(tok_now, pr_now, b["a_now"], b["beta"], xk_tok, xk_pr, k) + e_tok = (v_tok.float() - u_tok).pow(2).mean((-1, -2)) # [B] + e_pr = (v_pr.float() - u_pr).pow(2).mean(-1) if u_pr.shape[1] else torch.zeros_like(e_tok) + out = {"e_tok": e_tok, "e_pr": e_pr, "tok_now": tok_now, "pr_now": pr_now, + "tok_fut": tok_fut, "pr_fut": pr_fut, "y_tok": y_tok, "y_pr": y_pr} + if perm is not None: + v_tok2, v_pr2 = model(tok_now, pr_now, b["a_now"][perm], b["beta"], xk_tok, xk_pr, k) + out["e_tok_neg"] = (v_tok2.float() - u_tok).pow(2).mean((-1, -2)) + out["e_pr_neg"] = (v_pr2.float() - u_pr).pow(2).mean(-1) if u_pr.shape[1] else torch.zeros_like(e_tok) + return out + + +def _latent_mse_terms(model, b, tok_now, pr_now, tok_now_clean, pr_now_clean, tok_fut, pr_fut, + rms_tok, rms_pr, y_tok, y_pr, perm): + """DINO-WM's objective: DETERMINISTIC next-latent prediction under latent MSE (gen_q#268). + + Same predictor, same frozen DINOv2 patch features, same normaliser, same reward head -- the ONLY + thing that changes against the flow path is what the network regresses: + + flow : v_theta(x_k | s, a, beta, k) -> the conditional flow-matching velocity of the + normalised residual toward a draw from the beta-discounted occupancy + latent_mse : f_theta(s, a) -> the next latent one action chunk ahead, scored by + || f_theta(s,a) - s' ||^2 in the z-scored DINO latent space + + The predictor is queried at ONE fixed point of its flow-time/noise inputs (x_k = 0, k = 0), so + the "future" half of its token sequence is a learned query attending to the current frame's + patch tokens under the action embedding -- which is exactly DINO-WM's structure: a causal + transformer predicting the next frame's patch features from this frame's plus the action. + + HISTORY LENGTH. DINO-WM conditions on 3 frames; this port conditions on 1, and that is forced by + the evaluation protocol rather than chosen: the planner hands a scorer the SINGLE current frame + (`obs_t = {k: v[:, -1] ...}` in rsm_planner.plan_get_action), so a history-3 world model could + not be evaluated here at all without changing what every other scorer sees. It is a declared + deviation, not a silent one. + + The residual parameterisation (predict rms * v and add the current latent) is kept from the flow + path so the two share their conditioning and their output scale; it is a reparameterisation of + the same prediction and the LOSS is in the latent space, unclamped, as latent MSE requires. + """ + zeros_tok = torch.zeros_like(y_tok) + zeros_pr = torch.zeros_like(y_pr) + kz = torch.zeros(tok_now.shape[0], device=tok_now.device) + bz = torch.zeros_like(b["beta"]) + + def _pred(a): + v_tok, v_pr = model(tok_now, pr_now, a, bz, zeros_tok, zeros_pr, kz) + p_tok = tok_now_clean.float() + rms_tok * v_tok.float() + p_pr = (pr_now_clean.float() + rms_pr * v_pr.float()) if v_pr.shape[1] else v_pr.float() + return p_tok, p_pr + + p_tok, p_pr = _pred(b["a_now"]) + e_tok = (p_tok - tok_fut.float()).pow(2).mean((-1, -2)) + e_pr = (p_pr - pr_fut.float()).pow(2).mean(-1) if p_pr.shape[1] else torch.zeros_like(e_tok) + out = {"e_tok": e_tok, "e_pr": e_pr, "tok_now": tok_now, "pr_now": pr_now, + "tok_fut": tok_fut, "pr_fut": pr_fut, "y_tok": y_tok, "y_pr": y_pr} + if perm is not None: + n_tok, n_pr = _pred(b["a_now"][perm]) + out["e_tok_neg"] = (n_tok - tok_fut.float()).pow(2).mean((-1, -2)) + out["e_pr_neg"] = ((n_pr - pr_fut.float()).pow(2).mean(-1) if n_pr.shape[1] + else torch.zeros_like(e_tok)) + return out + + +def per_row_cfm(e_tok, e_pr, n_tok=N_TOK): + """One CFM number per row: mean over the 515 'tokens' of the per-token MSE.""" + return (n_tok * e_tok + e_pr) / (n_tok + 1) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True, help="cache/; reads tokens/tok.f16.npy from it") + ap.add_argument("--tokens", default="", help="override: directory holding tok.f16.npy") + ap.add_argument("--tok-rows", default="", + help="row-index .npy mapping THIS cache's frames into --tokens' file, for a " + "cache that is a row slice of a parent (cache/square_sub_20100 of " + "cache/square_expert_suboptimal). Avoids a multi-GB copy of the parent's " + "token file; token normalisation is then fitted on our rows and cached in " + "OUR cache dir, not the parent's.") + ap.add_argument("--out", required=True) + ap.add_argument("--depth", type=int, default=6) + ap.add_argument("--heads", type=int, default=16) + ap.add_argument("--dim-head", type=int, default=64) + ap.add_argument("--mlp", type=int, default=2048) + ap.add_argument("--dropout", type=float, default=0.1, help="DINO-WM's predictor dropout") + ap.add_argument("--grad-ckpt", type=int, default=0, + help="activation checkpointing per transformer layer (memory for ~30%% compute)") + ap.add_argument("--chunk", type=int, default=8) + ap.add_argument("--beta-lo", type=float, default=0.90) + ap.add_argument("--beta-hi", type=float, default=0.995) + ap.add_argument("--beta-q", type=float, default=0.95, help="query beta for diagnostics") + ap.add_argument("--batch", type=int, default=4096, help="GLOBAL batch (split over ranks)") + ap.add_argument("--micro", type=int, default=256, help="rows per forward on one GPU (grad accumulation)") + ap.add_argument("--steps", type=int, default=100000) + ap.add_argument("--lr", type=float, default=3e-4) + ap.add_argument("--wd", type=float, default=0.01) + ap.add_argument("--ema", type=float, default=0.995) + ap.add_argument("--w-reward", type=float, default=1.0) + ap.add_argument("--flow-steps", type=int, default=8) + ap.add_argument("--w-actcon", type=float, default=0.5, + help="action-contrastive weight (train_rsm.py): softplus(e_pos - e_neg) " + "with e_neg the CFM error under a within-batch permuted chunk") + ap.add_argument("--actcon-rows", type=int, default=0, + help="rows per micro-batch that get the (second, full-gradient) negative " + "forward; 0 = all rows") + ap.add_argument("--tok-drop", type=float, default=0.0, + help="training-time dropout of whole 'now' tokens (regulariser probe)") + ap.add_argument("--x-noise", type=float, default=0.0, + help="Gaussian noise (z-scored units) on the conditioning state during training " + "(train_rsm.py's --x-noise; stream B's regulariser against episode memorisation)") + ap.add_argument("--eval-every", type=int, default=5000) + ap.add_argument("--eval-minmse-n", type=int, default=16) + ap.add_argument("--eval-rows", type=int, default=2048) + ap.add_argument("--eval-frames", type=int, default=1024) + ap.add_argument("--success-gamma", type=float, default=0.98) + ap.add_argument("--reward-loss", default="bce", choices=["bce"]) + ap.add_argument("--reward-mode", default="dense", choices=["dense", "soft", "goal"], + help="goal = env-success-by-replay per-frame label (cache//goal.npz): a goal-STATE classifier") + ap.add_argument("--goal-file", default="", help="goal.npz for --reward-mode goal (default /goal.npz)") + ap.add_argument("--save-every", type=int, default=10000) + ap.add_argument("--resume", type=int, default=1) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--in-ram", type=int, default=0, help="copy the token memmap into RAM per rank") + ap.add_argument("--warm-cache", type=int, default=1, help="sequential read of the token file " + "on local rank 0 before training (page cache)") + ap.add_argument("--wandb-entity", default=_os.environ.get("RSM_WANDB_ENTITY", "")) + ap.add_argument("--wandb-project", default=_os.environ.get("RSM_WANDB_PROJECT", "rsm_rise")) + ap.add_argument("--wandb-name", default="") + ap.add_argument("--wandb-mode", default="online", choices=["online", "offline", "disabled"]) + ap.add_argument("--log-every", type=int, default=100) + ap.add_argument("--print-every", type=int, default=100) + ap.add_argument("--compile", type=int, default=0, help="torch.compile the training forward") + ap.add_argument("--allow-old-pack", type=int, default=0, + help="run even if PACK.json lacks the final state-definition keys (probes only)") + # DINO-WM (gen_q#268): the DYNAMICS objective. `flow` (default) is unchanged DWM -- the + # beta-discounted successor fitted by conditional flow matching. `latent_mse` is DINO-WM: + # deterministic next-latent prediction one action chunk ahead, scored by MSE in the frozen + # DINOv2 latent space. Everything else (predictor, features, normaliser, reward head, + # optimiser, steps) is identical, so the pair isolates the dynamics model. + ap.add_argument("--dynamics", default="flow", choices=["flow", "latent_mse"], + help="flow = DWM's occupancy flow matching (DEFAULT, unchanged); " + "latent_mse = DINO-WM's deterministic next-latent prediction") + ap.add_argument("--time-steps", type=int, default=0, + help="if >0: run this many steps, print s/step and exit (throughput probe)") + args = ap.parse_args() + + rank, world, local, dev = ddp_setup() + is_main = rank == 0 + torch.manual_seed(args.seed * 1000 + rank) + out = Path(args.out) + if is_main: + out.mkdir(parents=True, exist_ok=True) + per_rank = args.batch // world + assert per_rank * world == args.batch, f"--batch {args.batch} not divisible by {world} ranks" + micro = min(args.micro, per_rank) + n_micro = per_rank // micro + assert n_micro * micro == per_rank, f"per-rank batch {per_rank} not divisible by --micro {micro}" + use_cuda = dev.type == "cuda" + ac = (lambda: torch.autocast("cuda", dtype=torch.bfloat16)) if use_cuda else (lambda: torch.autocast("cpu", enabled=False)) + + # ---- W&B (rank 0; entity/project from wandb_env.sh; resumable by run id) ---- + wb = None + if is_main and args.wandb_entity and args.wandb_mode != "disabled": + try: + import wandb, hashlib + _rid = hashlib.md5(str(out.resolve()).encode()).hexdigest()[:16] + wb = wandb.init(entity=args.wandb_entity, project=args.wandb_project, + name=args.wandb_name or out.name, id=_rid, resume="allow", + mode=args.wandb_mode, config=vars(args), dir=str(out)) + print(f"[dwm] wandb: {wb.url}", flush=True) + except Exception as e: + print(f"[dwm] wandb disabled: {e}", flush=True) + wb = None + + def _flat(prefix, obj, acc): + if isinstance(obj, dict): + for k, v in obj.items(): + _flat(f"{prefix}/{k}" if prefix else str(k), v, acc) + elif isinstance(obj, (int, float)): + acc[prefix] = float(obj) + return acc + + # ---- data ---- + # The action-contrastive auxiliary is OUR addition to the flow recipe, not part of DINO-WM. A + # latent-MSE run left at the flow default would therefore be "DINO-WM plus an auxiliary we + # invented", which is not the published comparator, so it is switched off unless the caller asks + # for it explicitly. Pass --w-actcon to override (and say so in any table that uses it). + if args.dynamics == "latent_mse" and abs(args.w_actcon - ap.get_default("w_actcon")) < 1e-12: + print(f"[dwm] --dynamics latent_mse: --w-actcon {args.w_actcon} -> 0.0 " + f"(DINO-WM is latent MSE only; pass --w-actcon explicitly to keep the auxiliary)", + flush=True) + args.w_actcon = 0.0 + if args.dynamics == "latent_mse": + print("[dwm] DYNAMICS = latent_mse (DINO-WM): deterministic next-latent prediction one " + f"chunk ({args.chunk} frames) ahead, latent MSE in the z-scored DINOv2 space; " + "beta conditioning is a constant 0 on this path", flush=True) + tokens_file = str(Path(args.tokens) / "tok.f16.npy") if args.tokens else "" + try: + _pack = json.loads((Path(args.cache) / "PACK.json").read_text()) + except Exception: + _pack = {} + if not args.allow_old_pack and not ("sd_floor" in _pack and "z_clip" in _pack): + raise SystemExit(f"[dwm] {args.cache}/PACK.json lacks 'sd_floor'/'z_clip' (the final Stage-1 state " + f"definition); refusing to launch. Pass --allow-old-pack 1 for probes.") + if _pack and is_main: + print(f"[dwm] PACK.json: sd_floor={_pack.get('sd_floor')} z_clip={_pack.get('z_clip')} " + f"(token space uses sd_floor={SD_FLOOR} z_clip={Z_CLIP} rho_floor={RHO_FLOOR} y_clip={Y_CLIP})", flush=True) + if rank != 0: + _barrier() # rank 0 fits + writes tok_stats.npz first; the others then load it + d = TokenRSMData(args.cache, chunk=args.chunk, seed=args.seed, reward_mode=args.reward_mode, + success_gamma=args.success_gamma, in_ram=bool(args.in_ram), + tokens_file=tokens_file, goal_file=args.goal_file, tok_rows=args.tok_rows) + if rank == 0: + _barrier() + if is_main: + try: + print(f"[dwm] host {_os.uname().nodename}: {len(_os.sched_getaffinity(0))} cpus in affinity mask, " + f"{torch.cuda.device_count() if use_cuda else 0} gpus visible", flush=True) + except Exception: + pass + print(f"[dwm] {d.n_ep} eps ({len(d.train_eps)} train / {len(d.val_eps)} val), " + f"{d.n_task} tasks, tokens={tuple(d.tok.shape)} proprio={d.n_pr}, " + f"positives={d.r.mean():.4f}, world={world} batch={args.batch} " + f"({per_rank}/rank, micro {micro} x {n_micro})", flush=True) + if args.warm_cache and not args.in_ram and local == 0: + t0 = time.time(); n = d.tok.shape[0]; step_rows = max(1, (1 << 28) // (N_TOK * D_TOK * 2)) + for i in range(0, n, step_rows): + _blk = np.array(d.tok[i:i + step_rows]); del _blk # copy => reads every page + print(f"[dwm] warmed page cache: {d.tok.nbytes/1e9:.1f} GB in {time.time()-t0:.0f}s", flush=True) + _barrier() + + d_act = args.chunk * d.adim + norm = Normalizer(d.stats).to(dev) + flow = DWM(N_TOK, D_TOK, d.n_pr, d_act, depth=args.depth, heads=args.heads, + dim_head=args.dim_head, mlp_dim=args.mlp, dropout=args.dropout, + emb_dropout=args.dropout, grad_ckpt=bool(args.grad_ckpt), tok_drop=args.tok_drop).to(dev) + rew = DWMReward(N_TOK, D_TOK, d.n_pr).to(dev) + n_flow = sum(p.numel() for p in flow.parameters()); n_rew = sum(p.numel() for p in rew.parameters()) + if is_main: + print(f"[dwm] params: flow {n_flow/1e6:.2f} M (ViT depth {args.depth}, {args.heads}x{args.dim_head}, " + f"mlp {args.mlp}, dim {flow.dim}, seq {2*flow.n_seq}) + reward {n_rew/1e6:.2f} M", flush=True) + flow_ema = copy.deepcopy(flow).eval(); rew_ema = copy.deepcopy(rew).eval() + for p in list(flow_ema.parameters()) + list(rew_ema.parameters()): + p.requires_grad_(False) + _trainable = list(flow.parameters()) + list(rew.parameters()) + opt = torch.optim.AdamW(_trainable, lr=args.lr, weight_decay=args.wd) + rms_tok = torch.ones(N_TOK, D_TOK, device=dev); rms_pr = torch.ones(max(d.n_pr, 1), device=dev)[:d.n_pr] + hist = []; best_win = -1.0; start_step = 0 + + _ck = out / "ckpt.pt" + if args.resume and _ck.exists(): + _c = torch.load(_ck, map_location=dev, weights_only=False) + flow.load_state_dict(_c["flow"]); rew.load_state_dict(_c["rew"]) + flow_ema.load_state_dict(_c["flow_ema"]); rew_ema.load_state_dict(_c["rew_ema"]) + if "opt" in _c: + opt.load_state_dict(_c["opt"]) + rms_tok = _c["rms_tok"].to(dev); rms_pr = _c["rms_pr"].to(dev) + best_win = _c.get("best_win", -1.0); hist = _c.get("hist", []) + start_step = int(_c["step"]) + if is_main: + print(f"[dwm] RESUMED at step {start_step}/{args.steps} (best action winrate {best_win:.3f})", + flush=True) + if start_step >= args.steps: + if is_main: + print("[dwm] already complete; nothing to do", flush=True) + return + _barrier() + + if world > 1: + ddp = torch.nn.parallel.DistributedDataParallel(flow, device_ids=[local] if use_cuda else None) + rew_d = torch.nn.parallel.DistributedDataParallel(rew, device_ids=[local] if use_cuda else None) + else: + ddp, rew_d = flow, rew + model = torch.compile(ddp, dynamic=False) if args.compile else ddp # compile on top of DDP + + # per-rank data stream, decorrelated across ranks and across restarts + rng = np.random.default_rng(args.seed + 9973 * start_step + 7919 * rank) + pf = Prefetcher(d, rng, per_rank, args.beta_lo, args.beta_hi, dev, + onestep=args.dynamics == "latent_mse") + pos_w = torch.tensor(max((1 - d.r.mean()) / max(d.r.mean(), 1e-6), 1.0), device=dev) + t0 = time.time(); t_last = time.time(); step_t = [] + + def save(step, gap_win, gap, cfm_v): + nonlocal best_win + blob = {"encoder": d.tok_info.get("encoder", "dinov2_vits14_tokens"), + "cam_res": d.tok_info.get("cam_res", 84), + # "model" is what a read-out dispatches on: a latent-MSE checkpoint must NOT be + # loaded by the flow read-out (it would Euler-integrate a network that was never + # trained as a velocity field and report the result as DINO-WM). + "model": "dinowm" if args.dynamics == "latent_mse" else "dwm", + "dynamics": args.dynamics, "hop_frames": int(args.chunk), + "flow": flow.state_dict(), "rew": rew.state_dict(), + "flow_ema": flow_ema.state_dict(), "rew_ema": rew_ema.state_dict(), + "norm": {k: torch.as_tensor(v) for k, v in d.stats.items()}, + "rms_tok": rms_tok.cpu(), "rms_pr": rms_pr.cpu(), "config": vars(args), + "arch": {"n_tok": N_TOK, "d_tok": D_TOK, "n_pr": d.n_pr, "d_act": d_act, + "depth": args.depth, "heads": args.heads, "dim_head": args.dim_head, + "mlp_dim": args.mlp, "dropout": args.dropout}, + "n_pr": d.n_pr, "tasks": d.tasks, "d_act": d_act, "step": step, + "q_action_winrate": gap_win} + blob_r = dict(blob); blob_r["opt"] = opt.state_dict() + blob_r["best_win"] = max(best_win, gap_win); blob_r["hist"] = hist + _tmp = out / "ckpt.pt.tmp"; torch.save(blob_r, _tmp); _os.replace(_tmp, out / "ckpt.pt") + if args.save_every and step % args.save_every == 0: + torch.save(blob, out / f"ckpt_s{step}.pt") + _cf = [h["cfm_val"] for h in hist[:-1] if "cfm_val" in h] + _healthy = (len(_cf) < 3) or (cfm_v <= 2.0 * float(np.median(_cf))) + if not _healthy: + print(f"[dwm] cfm_val {cfm_v:.3f} > 2x running median {float(np.median(_cf)):.3f}: " + f"occupancy unstable, NOT eligible as best", flush=True) + if gap_win > best_win and _healthy: + best_win = gap_win + torch.save(blob, out / "ckpt_best.pt") + print(f"[dwm] new BEST action winrate {gap_win:.3f} (gap {gap:+.5f}) at step {step}", flush=True) + + # ------------------------------------------------------------------ # + for step in range(start_step + 1, args.steps + 1): + b_full = pf.next() + opt.zero_grad(set_to_none=True) + acc_l = {"rew": 0.0, "cfm": 0.0, "cfm_pr": 0.0, "ac": 0.0, "loss": 0.0} + for mi in range(n_micro): + sl = slice(mi * micro, (mi + 1) * micro) + b = {k: (v[sl] if torch.is_tensor(v) else v[sl]) for k, v in b_full.items()} + last = mi == n_micro - 1 + ctx_f = ddp.no_sync() if (world > 1 and not last) else _nullctx() + ctx_r = rew_d.no_sync() if (world > 1 and not last) else _nullctx() + with ctx_f, ctx_r: + # running per-(token, channel) RMS of the residual, identical on all ranks + with torch.no_grad(): + tn = norm.tok(b["tok_now"]); tf_ = norm.tok(b["tok_fut"]) + cur = (tf_ - tn).pow(2).mean(0) + cur_pr = (norm.pr(b["pr_fut"]) - norm.pr(b["pr_now"])).pow(2).mean(0) + _all_reduce_mean(cur); _all_reduce_mean(cur_pr) + rms_tok.mul_(0.99).add_(cur.sqrt().clamp_min(RHO_FLOOR), alpha=0.01) + rms_pr.mul_(0.99).add_(cur_pr.sqrt().clamp_min(RHO_FLOOR), alpha=0.01) + with ac(): + # ---- reward head on the CURRENT frame (balanced BCE on the success label) ---- + logit = rew_d(norm.tok(b["tok_now"]), norm.pr(b["pr_now"])) + if args.reward_mode == "soft": + l_rew = F.binary_cross_entropy_with_logits(logit.float(), b["r_now"]) + else: + l_rew = F.binary_cross_entropy_with_logits(logit.float(), b["r_now"], pos_weight=pos_w) + # ---- occupancy: flow-match the normalised token residual ---- + l_ac = torch.zeros((), device=dev) + if args.w_actcon > 0 and args.actcon_rows and args.actcon_rows < micro: + # contrast on the first --actcon-rows rows (positive + negative forward), + # plain CFM on the rest: one positive forward per row either way + nr = args.actcon_rows + bs = {k: v[:nr] for k, v in b.items()} + br = {k: v[nr:] for k, v in b.items()} + c_sub = cfm_terms(model, norm, rms_tok, rms_pr, bs, perm=torch.randperm(nr, device=dev), x_noise=args.x_noise, dynamics=args.dynamics) + c_rest = cfm_terms(model, norm, rms_tok, rms_pr, br, x_noise=args.x_noise, dynamics=args.dynamics) + e_pos_c = per_row_cfm(c_sub["e_tok"], c_sub["e_pr"]) + e_neg_c = per_row_cfm(c_sub["e_tok_neg"], c_sub["e_pr_neg"]) + l_ac = F.softplus(e_pos_c - e_neg_c).mean() + c = {"e_tok": torch.cat([c_sub["e_tok"], c_rest["e_tok"]]), + "e_pr": torch.cat([c_sub["e_pr"], c_rest["e_pr"]])} + else: + perm = torch.randperm(micro, device=dev) if args.w_actcon > 0 else None + c = cfm_terms(model, norm, rms_tok, rms_pr, b, perm=perm, x_noise=args.x_noise, dynamics=args.dynamics) + if perm is not None: + e_pos_c = per_row_cfm(c["e_tok"], c["e_pr"]) + e_neg_c = per_row_cfm(c["e_tok_neg"], c["e_pr_neg"]) + l_ac = F.softplus(e_pos_c - e_neg_c).mean() + l_cfm = per_row_cfm(c["e_tok"], c["e_pr"]).mean() + l_cfm_pr = c["e_pr"].mean() + loss = args.w_reward * l_rew + l_cfm + args.w_actcon * l_ac + (loss / n_micro).backward() + for k_, v_ in (("rew", l_rew), ("cfm", l_cfm), ("cfm_pr", l_cfm_pr), ("ac", l_ac), ("loss", loss)): + acc_l[k_] += float(v_.detach()) / n_micro + gn_total = float(torch.nn.utils.clip_grad_norm_(_trainable, 1.0)) + opt.step() + ema_update(flow_ema, flow, args.ema); ema_update(rew_ema, rew, args.ema) + + if use_cuda and (step % args.print_every == 0 or args.time_steps): + torch.cuda.synchronize() + now = time.time(); step_t.append(now - t_last); t_last = now + if args.time_steps and step - start_step >= args.time_steps: + st = np.array(step_t[max(0, len(step_t) // 4):]) # drop warm-up + if is_main: + print(f"[dwm] TIMING {len(st)} steps: {st.mean():.3f} s/step (median {np.median(st):.3f}), " + f"global batch {args.batch}, world {world}, micro {micro}; " + f"projected {args.steps} steps = {args.steps*st.mean()/3600:.1f} h; " + f"peak mem {torch.cuda.max_memory_allocated()/2**30 if use_cuda else 0:.1f} GiB", flush=True) + pf.close() + if dist.is_initialized(): + dist.destroy_process_group() + return + if is_main and step % args.print_every == 0: + print(f"[dwm] {step} rew={acc_l['rew']:.4f} cfm={acc_l['cfm']:.4f} " + f"ac={acc_l['ac']:.4f} gradnorm={gn_total:.3f} " + f"rms_mean={float(rms_tok.mean()):.3f} ({np.mean(step_t[-args.print_every:]):.3f} s/step, " + f"{(step-start_step)/(time.time()-t0):.2f} it/s)", flush=True) + if wb is not None and (step % args.log_every == 0 or step == start_step + 1): + def _mod_gn(m): + sq = [p.grad.detach().float().pow(2).sum() for p in m.parameters() if p.grad is not None] + return float(torch.stack(sq).sum().sqrt()) if sq else 0.0 + wb.log({"train/loss": acc_l["loss"], "train/l_rew": acc_l["rew"], + "train/l_cfm": acc_l["cfm"], "train/l_cfm_pr": acc_l["cfm_pr"], + "train/l_actcon": acc_l["ac"], + "train/gradnorm": gn_total, "train/gradnorm_clipped": min(gn_total, 1.0), + "train/gradnorm_rew": _mod_gn(rew), "train/gradnorm_flow": _mod_gn(flow), + "train/rms_mean": float(rms_tok.mean()), "train/rms_pr_mean": float(rms_pr.mean()) if d.n_pr else 0.0, + "train/lr": opt.param_groups[0]["lr"], + "train/s_per_step": float(np.mean(step_t[-args.log_every:])), + "train/it_per_s": (step - start_step) / max(time.time() - t0, 1e-6)}, step=step) + + # ------------------------------------------------------------------ # + if step % args.eval_every == 0 or step == args.steps: + rec = evaluate(args, d, norm, flow_ema, rew_ema, rms_tok, rms_pr, dev, rank, world, + step, micro, ac) + if is_main: + rec["step"] = step + rec = {"step": step, **{k: v for k, v in rec.items() if k != "step"}} + hist.append(rec) + if wb is not None: + wb.log(_flat("eval", {k: v for k, v in rec.items() if k != "step"}, {}), step=step) + ident = rec["identity"] + print(f"[dwm] EVAL {step}: reward_auc={rec['reward_auc']:.4f} cfm={rec['cfm_val']:.4f} " + f"ACTION gap={rec['q_action_gap']:+.5f} win={rec['q_action_winrate']:.3f} | " + f"state auc={rec['q_success_auc']:.4f}", flush=True) + print(f"[dwm] MINMSE(n={args.eval_minmse_n}): train={rec['minmse_train']:.4f} " + f"val={rec['minmse_val']:.4f} meanmse={rec['meanmse_val']:.4f} " + f"staymse={rec['staymse_val']:.4f} (train stay {rec['staymse_train']:.4f})", flush=True) + print(f"[dwm] GENERALISATION: cfm train={rec['cfm_train']:.4f} val={rec['cfm_val']:.4f} " + f"(val/train {rec['val_over_train_cfm']:.2f}x, medians {rec['cfm_train_median']:.3f}/{rec['cfm_val_median']:.3f}) | " + f"minmse val/train {rec['val_over_train_minmse']:.2f}x " + f"(medians {rec['minmse_train_median']:.3f}/{rec['minmse_val_median']:.3f})", flush=True) + print(f"[dwm] IDENTITY Qbar: corr={ident['corr']:.3f} spearman={ident['spearman']:.3f} " + f"mse={ident['mse']:.5f} within-task={ident['corr_within_task']:.3f} " + f"(const-null mse {ident['mse_const']:.5f}) qhat={ident['q_hat_mean']:.4f} " + f"vs mc={ident['q_mc_mean']:.4f}", flush=True) + print("[dwm] by time-to-end: " + " ".join( + f"{k}:gap={v['action_gap']:+.5f}/win={v['action_winrate']:.2f}(n={v['n']})" + for k, v in rec["by_horizon"].items()), flush=True) + (out / "history.json").write_text(json.dumps(hist, indent=1)) + save(step, rec["q_action_winrate"], rec["q_action_gap"], rec["cfm_val"]) + _barrier() + pf.close() + if is_main: + print("[dwm] DONE", flush=True) + if dist.is_initialized(): + dist.destroy_process_group() + + +class _nullctx: + def __enter__(self): return self + def __exit__(self, *a): return False + + +# --------------------------------------------------------------------------- # +# evaluation, sharded across ranks (rows split by rank, gathered to every rank) +# --------------------------------------------------------------------------- # +@torch.no_grad() +def evaluate(args, d, norm, flow_ema, rew_ema, rms_tok, rms_pr, dev, rank, world, step, micro, ac): + flow_ema.eval(); rew_ema.eval() + rng = np.random.default_rng(args.seed + 12345 + step) # identical on every rank + n_rows = (args.eval_rows // world) * world + n_fr = (args.eval_frames // world) * world + N = args.eval_minmse_n + + def shard(arrs): + return [a[rank::world] for a in arrs] + + def _to(b): + return {k: (v.to(dev) if torch.is_tensor(v) else v) for k, v in b.items()} + + def minmse_block(split): + e, t, fut, beta = d.draw(n_rows, rng, args.beta_lo, args.beta_hi, split) + if args.dynamics == "latent_mse": + fut, beta = _onestep_future(d, e, t) # else validation would score another target + e, t, fut, beta = shard([e, t, fut, beta]) + mins, means, stays, cfms, cfm_prs, logits, r_now = [], [], [], [], [], [], [] + chunk = max(1, 4096 // max(N, 1)) + for i in range(0, len(t), chunk): + b = _to(d.gather(e[i:i + chunk], t[i:i + chunk], fut[i:i + chunk], beta[i:i + chunk])) + tn = norm.tok(b["tok_now"]); tf_ = norm.tok(b["tok_fut"]) + pn = norm.pr(b["pr_now"]) + B = tn.shape[0] + with ac(): + c = cfm_terms(flow_ema, norm, rms_tok, rms_pr, b, dynamics=args.dynamics) + logits.append(rew_ema(tn, pn).float()) + cfms.append(per_row_cfm(c["e_tok"], c["e_pr"])); cfm_prs.append(c["e_pr"]) + r_now.append(b["r_now"]) + xs, _ = sample_future_dwm(flow_ema, tn, pn, b["a_now"], b["beta"], rms_tok, rms_pr, + args.flow_steps, n=N, micro=micro, autocast=ac) + err = (xs.view(B, N, N_TOK, D_TOK) - tf_[:, None]).pow(2).mean((-1, -2)) # [B,N] + mins.append(err.min(1).values); means.append(err.mean(1)) + stays.append((tn - tf_).pow(2).mean((-1, -2))) + cat = lambda xs_: _gather_cat(torch.cat(xs_)).cpu().numpy() + return {"minmse": cat(mins), "meanmse": cat(means), "staymse": cat(stays), + "cfm": cat(cfms), "cfm_pr": cat(cfm_prs), "logit": cat(logits), "r_now": cat(r_now)} + + val = minmse_block("val") + tr = minmse_block("train") + r_auc = auc(val["logit"], val["r_now"]) + + # ---- headline: does Q RANK ACTIONS at a fixed state? (CRN across the two chunks) ---- + e, t, _, _ = d.draw(n_fr, rng, 0.5, 0.5, "val") + tkp = d.ep_task[e] + pw = np.arange(n_fr) + for _ti in np.unique(tkp): + _ix = np.nonzero(tkp == _ti)[0] + if len(_ix) > 1: + pw[_ix] = rng.permutation(_ix) + a_all = d._chunk_at(t, e); a_for_all = a_all[pw] + order = np.concatenate([np.arange(n_fr)[r::world] for r in range(world)]) # gathered row order + e_s, t_s = shard([e, t]) + a_s = torch.from_numpy(a_all[rank::world]).to(dev); af_s = torch.from_numpy(a_for_all[rank::world]).to(dev) + q_log, q_for = [], [] + n_part = 4 + chunk = max(1, 2048 // n_part) + for i in range(0, len(t_s), chunk): + b = _to(d.gather(e_s[i:i + chunk], t_s[i:i + chunk], t_s[i:i + chunk], np.zeros(min(chunk, len(t_s) - i)), with_fut=False)) + tn = norm.tok(b["tok_now"]); pn = norm.pr(b["pr_now"]); B = tn.shape[0] + beta_q = torch.full((B,), args.beta_q, device=dev) + x0 = (torch.randn(B * n_part, N_TOK, D_TOK, device=dev), torch.randn(B * n_part, d.n_pr, device=dev)) + + def q_of(a_chunk): + xt, xp = sample_future_dwm(flow_ema, tn, pn, a_chunk, beta_q, rms_tok, rms_pr, + args.flow_steps, n=n_part, x0=x0, micro=micro, autocast=ac) + with ac(): + p = torch.sigmoid(rew_ema(xt, xp).float()) + return p.view(B, n_part).mean(1) + q_log.append(q_of(a_s[i:i + chunk])); q_for.append(q_of(af_s[i:i + chunk])) + q_log = _gather_cat(torch.cat(q_log)).cpu().numpy(); q_for = _gather_cat(torch.cat(q_for)).cpu().numpy() + e_o, t_o = e[order], t[order] + succ = d.ep_success[e_o].astype(np.float32); te = (d.ep_to[e_o] - t_o).astype(np.float32) + tk_np = d.ep_task[e_o] + gap = float((q_log - q_for).mean()); gap_win = float((q_log > q_for).mean()) + q_succ_auc = auc(q_log, succ) + + # ---- MC identity: Qbar(s,a) = E_{k~Geom(1-beta)}[r(s_{t+k})] from the logged trajectory ---- + _kk = rng.geometric(1.0 - args.beta_q, size=(256, len(e_o))) - 1 + _ix = np.minimum(t_o[None, :] + _kk, d.ep_to[e_o][None, :] - 1) + q_mc = d.r[_ix].mean(0); _qh = q_log + identity = {"q_mc_mean": float(q_mc.mean()), "q_hat_mean": float(_qh.mean()), + "mse": float(((_qh - q_mc) ** 2).mean()), + "corr": float(np.corrcoef(_qh, q_mc)[0, 1]) if (_qh.std() > 1e-8 and q_mc.std() > 1e-8) else 0.0, + "spearman": float(np.corrcoef(np.argsort(np.argsort(_qh)), np.argsort(np.argsort(q_mc)))[0, 1]) + if (_qh.std() > 1e-8 and q_mc.std() > 1e-8) else 0.0, + "mse_const": float(((q_mc.mean() - q_mc) ** 2).mean())} + _wt = [] + for _ti in np.unique(tk_np): + _m = tk_np == _ti + if _m.sum() < 32 or _qh[_m].std() < 1e-8 or q_mc[_m].std() < 1e-8: + continue + _wt.append(float(np.corrcoef(_qh[_m], q_mc[_m])[0, 1])) + identity["corr_within_task"] = float(np.mean(_wt)) if _wt else 0.0 + identity["n_tasks_scored"] = len(_wt) + gl = q_log - q_for + by_horizon = {} + for name, lo_, hi_ in (("0-50", 0, 50), ("50-100", 50, 100), ("100-200", 100, 200), ("200+", 200, 1e9)): + m = (te >= lo_) & (te < hi_) + if m.sum() < 16: + continue + by_horizon[name] = {"n": int(m.sum()), "action_gap": float(gl[m].mean()), + "action_winrate": float((gl[m] > 0).mean()), "q_mean": float(q_log[m].mean())} + per_task = {} + for ti in np.unique(tk_np): + m = tk_np == ti + per_task[int(ti)] = {"n": int(m.sum()), "action_gap": float(gl[m].mean()), + "success_auc": auc(q_log[m], succ[m]), "succ_rate": float(succ[m].mean())} + rec = {"step": step, "reward_auc": r_auc, "cfm_val": float(val["cfm"].mean()), + "cfm_pr_val": float(val["cfm_pr"].mean()), + "cfm_train": float(tr["cfm"].mean()), "cfm_pr_train": float(tr["cfm_pr"].mean()), + "cfm_val_median": float(np.median(val["cfm"])), "cfm_train_median": float(np.median(tr["cfm"])), + "minmse_val_median": float(np.median(val["minmse"])), "minmse_train_median": float(np.median(tr["minmse"])), + "val_over_train_cfm": float(val["cfm"].mean() / max(tr["cfm"].mean(), 1e-9)), + "val_over_train_minmse": float(val["minmse"].mean() / max(tr["minmse"].mean(), 1e-9)), + "per_task": per_task, "by_horizon": by_horizon, + "q_action_gap": gap, "q_action_winrate": gap_win, + "q_success_auc": q_succ_auc, "q_mean": float(q_log.mean()), "identity": identity, + "minmse_train": float(tr["minmse"].mean()), "minmse_val": float(val["minmse"].mean()), + "meanmse_train": float(tr["meanmse"].mean()), "meanmse_val": float(val["meanmse"].mean()), + "staymse_train": float(tr["staymse"].mean()), "staymse_val": float(val["staymse"].mean()), + "meanmse": float(val["meanmse"].mean()), "staymse": float(val["staymse"].mean()), + "minmse_n": N, "eval_rows": n_rows, "eval_frames": n_fr, + "rms_mean": float(rms_tok.mean())} + return rec + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/train_slurm.sbatch b/gen_q_rsm/rsm_libero/train_slurm.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..72f1dba70dc9336d54a499517b18ee9c389251ff --- /dev/null +++ b/gen_q_rsm/rsm_libero/train_slurm.sbatch @@ -0,0 +1,22 @@ +#!/bin/bash +#SBATCH --job-name=rsm_arm +#SBATCH --account=vision-pulkitag +#SBATCH --qos=lab-free +#SBATCH --partition=csail-shared-h200 +#SBATCH --gres=gpu:1 +#SBATCH --cpus-per-task=8 +#SBATCH --mem=110G +#SBATCH --time=20:00:00 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/mit/%x_%j.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/mit/%x_%j.err +set -uo pipefail +export PYTHONUNBUFFERED=1 +cd /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero +PY=/data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/.venv/bin/python +echo "[arm] $SLURM_JOB_NAME on $(hostname) :: $CMD" +eval "$PY $CMD" +RC=$? +echo "[arm] rc=$RC $(date -u +%T)" +# propagate: otherwise the trailing echo makes a crashed job exit 0 and +# every --dependency=afterok eval launches against a missing checkpoint +exit $RC diff --git a/gen_q_rsm/rsm_libero/verify_cpu.sbatch b/gen_q_rsm/rsm_libero/verify_cpu.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..c3211b85af2040f1e3c39ab92119e676720cbd9e --- /dev/null +++ b/gen_q_rsm/rsm_libero/verify_cpu.sbatch @@ -0,0 +1,19 @@ +#!/bin/bash +#SBATCH --job-name=verify_succ +#SBATCH --account=vision-pulkitag +#SBATCH --cpus-per-task=4 --mem=32G +#SBATCH --array=0-9 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +# no renderer at all -- osmesa keeps mujoco happy without a GPU or EGL +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/verify +mkdir -p $OUT +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/verify_successes.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --task $SLURM_ARRAY_TASK_ID --out $OUT/task$SLURM_ARRAY_TASK_ID.npz diff --git a/gen_q_rsm/rsm_libero/verify_full.sbatch b/gen_q_rsm/rsm_libero/verify_full.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..e594f89950a15a4b266f3de38f511d28b892b19c --- /dev/null +++ b/gen_q_rsm/rsm_libero/verify_full.sbatch @@ -0,0 +1,20 @@ +#!/bin/bash +#SBATCH --job-name=verify_full +#SBATCH --account=vision-pulkitag +#SBATCH --qos=tig-main +#SBATCH --partition=tig-cpu +#SBATCH --cpus-per-task=4 --mem=40G +#SBATCH --array=0-39 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +T=$((SLURM_ARRAY_TASK_ID / 4)); K=$((SLURM_ARRAY_TASK_ID % 4)) +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/verify_full; mkdir -p $OUT +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/verify_successes.py \ + --cache /data/pulkitag/scratch/rli14/rsm_libero_cache/full_r256 \ + --task $T --shard $K --num-shards 4 --out $OUT/task${T}_s${K}.npz diff --git a/gen_q_rsm/rsm_libero/verify_fullg.sbatch b/gen_q_rsm/rsm_libero/verify_fullg.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..d94c538c9cb1892fc10aa111aa14de18e98291d8 --- /dev/null +++ b/gen_q_rsm/rsm_libero/verify_fullg.sbatch @@ -0,0 +1,22 @@ +#!/bin/bash +#SBATCH --job-name=verify_fullg +#SBATCH --account=vision-pulkitag +#SBATCH --qos=vision-pulkitag-free-cycles +#SBATCH --partition=vision-pulkitag-a100,vision-pulkitag-h200,vision-pulkitag-l40s,vision-pulkitag-a6000 +#SBATCH --cpus-per-task=4 --mem=40G +# CPU-only on the GPU nodes (no --gres): their cores sit idle while tig-cpu runs 2 shards at a time +#SBATCH --array=0-39 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=osmesa PYTHONUNBUFFERED=1 +T=$((SLURM_ARRAY_TASK_ID / 4)); K=$((SLURM_ARRAY_TASK_ID % 4)) +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/verify_full; mkdir -p $OUT +[ -f $OUT/task${T}_s${K}.npz ] && { echo "shard task${T}_s${K} already done"; exit 0; } +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/verify_successes.py \ + --cache /data/pulkitag/scratch/rli14/rsm_libero_cache/full_r256 \ + --task $T --shard $K --num-shards 4 --out $OUT/task${T}_s${K}.npz diff --git a/gen_q_rsm/rsm_libero/verify_successes.py b/gen_q_rsm/rsm_libero/verify_successes.py new file mode 100644 index 0000000000000000000000000000000000000000..a6683a70f11df3de835d5328b9333fc26cfb3af4 --- /dev/null +++ b/gen_q_rsm/rsm_libero/verify_successes.py @@ -0,0 +1,97 @@ +"""Replay-verify every logged success: does it actually succeed in the simulator? + +The R1 corpus's is_success labels are ~16% optimistic on the positive side (60-episode +audit: 5/32 logged successes did not reproduce, 0/28 logged failures did). BC-on-successes +clones that pool, and the critic's gamma^steps-to-success reward gives a false success a +full progress curve toward an event that never happened. + +This re-executes each logged action sequence from the logged initial sim_state and records +whether the episode actually succeeds. Emits a boolean mask aligned to the cache's episode +index, consumed via --success-mask. + +Error is one-sided (no logged failure ever reproduced as a success), so verification only +ever REMOVES episodes from the success pool. +""" +import argparse, os, re, sys +import numpy as np +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + +SRC = "/data/pulkitag/users/rli14/pi05_lib10_sde_v1" +PAT = re.compile(r"ep_t(\d+)_b(\d+)_i(\d+)_(\d+)\.npz$") + + +def src_parquet(ep_src: str): + """cache ep_src -> the source episode parquet holding sim_state + actions.""" + m = PAT.search(ep_src) + if not m: + return None + t, b, i, idx = m.groups() + return (f"{SRC}/task{int(t)}_block{int(b)}/rank_0/id_{int(i)}" + f"/data/chunk-000/episode_{int(idx):06d}.parquet") + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--cache", required=True) + ap.add_argument("--task", type=int, required=True, help="libero_10 task id shard") + ap.add_argument("--out", required=True) + ap.add_argument("--shard", type=int, default=0); ap.add_argument("--num-shards", type=int, default=1) + ap.add_argument("--max-steps", type=int, default=520) + args = ap.parse_args() + + import pyarrow.parquet as pq + from libero.libero import benchmark, get_libero_path + from libero.libero.envs.env_wrapper import ControlEnv + from pathlib import Path + + m = np.load(f"{args.cache}/meta.npz", allow_pickle=True) + ep_src, ep_task = m["ep_src"], m["ep_task"] + is_demo, is_succ = m["ep_demo"].astype(bool), m["ep_success"].astype(bool) + # only logged SUCCESSES from ROLLOUTS need checking; demos are ground truth + todo = np.where((ep_task == args.task) & is_succ & ~is_demo)[0] + todo = todo[args.shard::args.num_shards] # within-task sharding for the full corpus + print(f"[verify] task {args.task}: {len(todo)} logged successes to replay", flush=True) + + bench = benchmark.get_benchmark_dict()["libero_10"]() + task = bench.get_task(args.task) + # Physics only: success is the task's goal predicate over sim state, so no + # cameras and no EGL are needed. That drops the GPU requirement entirely and lets + # this run on CPU nodes instead of competing with the training queue. + env = ControlEnv( + bddl_file_name=str(Path(get_libero_path("bddl_files")) + / task.problem_folder / task.bddl_file), + has_renderer=False, has_offscreen_renderer=False, use_camera_obs=False) + + rows = [] + for n, e in enumerate(todo): + p = src_parquet(str(ep_src[e])) + if p is None or not os.path.exists(p): + rows.append((int(e), -1)); continue # -1 = unresolvable, keep as-is + tb = pq.read_table(p, columns=["sim_state", "actions"]) + sim0 = np.asarray(tb["sim_state"][0].as_py(), dtype=np.float64) + acts = np.asarray([a.as_py() for a in tb["actions"]], dtype=np.float64) + env.reset() + env.env.sim.set_state_from_flattened(sim0) + env.env.sim.forward() + ok = False + for s in range(min(len(acts), args.max_steps)): + _o, _r, done, _i = env.step(acts[s]) + if done: + ok = True; break + rows.append((int(e), int(ok))) + if (n + 1) % 25 == 0: + got = [r for _, r in rows if r >= 0] + print(f"[verify] {n+1}/{len(todo)} reproduced {sum(got)}/{len(got)} " + f"({np.mean(got) if got else float('nan'):.3f})", flush=True) + env.close() + idx = np.array([r[0] for r in rows], np.int64) + val = np.array([r[1] for r in rows], np.int64) + np.savez(args.out, ep_index=idx, verified=val, task=args.task) + good = val[val >= 0] + print(f"[verify] task {args.task} DONE: {good.sum()}/{len(good)} reproduced " + f"({good.mean() if len(good) else float('nan'):.3f}); " + f"{int((val < 0).sum())} unresolvable", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_libero/verify_successes.sbatch b/gen_q_rsm/rsm_libero/verify_successes.sbatch new file mode 100644 index 0000000000000000000000000000000000000000..8a16c44a98eb9123e19e747bb106293ff6c3556f --- /dev/null +++ b/gen_q_rsm/rsm_libero/verify_successes.sbatch @@ -0,0 +1,20 @@ +#!/bin/bash +#SBATCH --job-name=verify_succ +#SBATCH --account=vision-pulkitag +#SBATCH --gres=gpu:1 --cpus-per-task=4 --mem=48G +#SBATCH --array=0-9 +#SBATCH --output=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.out +#SBATCH --error=/data/pulkitag/users/rli14/rsm_libero_runs/eval/%x_%a_%A.err +set -uo pipefail +B=/data/pulkitag/hamer_diffusion_policy_project/projects/continual_learning_for_manipulation +S=/data/pulkitag/users/rli14/rlinf_recap_task_expansion +export LIBERO_CONFIG_PATH=$S/libero_config ROBOT_PLATFORM=LIBERO LIBERO_TYPE=standard +export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl PYTHONUNBUFFERED=1 +_G="$(echo "${CUDA_VISIBLE_DEVICES:-0}" | cut -d, -f1)" +export MUJOCO_EGL_DEVICE_ID="$_G" EGL_DEVICE_ID="$_G" +OUT=/data/pulkitag/users/rli14/rsm_libero_runs/verify +mkdir -p $OUT +$B/venvs/rlinf-libero-eval-venv/bin/python \ + /data/pulkitag/hamer_diffusion_policy_project/projects/gen_q/rsm_libero/verify_successes.py \ + --cache /data/pulkitag/users/rli14/rsm_libero_cache/full_demo \ + --task $SLURM_ARRAY_TASK_ID --out $OUT/task$SLURM_ARRAY_TASK_ID.npz diff --git a/gen_q_rsm/rsm_rise/HF_CHECKPOINTS.md b/gen_q_rsm/rsm_rise/HF_CHECKPOINTS.md new file mode 100644 index 0000000000000000000000000000000000000000..341a7e9c3e7bc5859914936ab287e0a37573d8ac --- /dev/null +++ b/gen_q_rsm/rsm_rise/HF_CHECKPOINTS.md @@ -0,0 +1,34 @@ +# Checkpoints and code on Hugging Face + +Loader helper: `rsm_rise/pipeline/hf_ckpt.py` (`fetch(hf_path)`, `fetch_source(cluster_path)`; uses the cluster copy when present). + + +All repos are public under the `rli14` account. Each checkpoint repo has a `manifest.tsv` with columns +`hf_path, source_path, bytes, sha256, n_cells, example_cell`. `source_path` is the cluster path the eval cells print. + +| where | what | +|---|---| +| [rli14/rsm_rise_sim_checkpoints](https://huggingface.co/rli14/rsm_rise_sim_checkpoints) | **sim, paper set.** Every checkpoint a paper-table cell loads: the 280 rows of `status/disk/ct_keep_paper_ckpts.tsv` (RISE / IDQL / IFQL / BC-expert / BC-unified actors and their critics, RSM successors, hop heads, IFQL bundles, world-model baselines), plus sidecars (run `config.json`, RSM `history.json`, hop `loop.json`) and the small per-task cache metadata (`/cache/feat_stats.npz`, `meta.npz`, `goal*.npz`, `*.json`; no feature arrays). `rsmpi//round/` holds the RSM policy-iteration rounds that have evals. Layout = `runs/` | +| [rli14/rsm_real_checkpoints](https://huggingface.co/rli14/rsm_real_checkpoints) | **real robot (cooking), everything not already in the two places below.** v6 / v7 successors, hop heads, IQL, DINO-WM, `cooking_v6_rw_*` actors, and every pi0.5 fine-tune step on disk (`openpi/...`: params + assets only, no optimizer state). Layout = `runs/` | +| [rli14/rsm_cooking_v5_checkpoints](https://huggingface.co/rli14/rsm_cooking_v5_checkpoints) | real robot v5 deliverable (RISE actors, BC-union, pi0.5 stock, successors, hop head, normalisation). Files are renamed; the model card maps them | +| `hf://buckets/rsm-bucket/rsm-shared/` | v6 / v7 real-robot deploy exports (`cooking_v6_rsm/`, `cooking_v6_ft50/`, `v7/...`), synced by the V6_POST / V7 streams | +| [rli14/rsm_rise_code](https://huggingface.co/rli14/rsm_rise_code) | code snapshot: `gen_q_rsm/` (branch `rsm_rise_data`), the frozen RSM code the tables used, `rsm_rise/scripts` + `docs`, source-only RISE stack, `THIRD_PARTY.md` | + +```bash +hf download rli14/rsm_rise_sim_checkpoints square_sub_20100/rsm/M/ckpt_best.pt --local-dir ckpts/ +hf download rli14/rsm_rise_sim_checkpoints --include "two_piece_expert_play/*" --local-dir ckpts/ # one task +hf download rli14/rsm_real_checkpoints --include "openpi/checkpoints/pi05_cooking_stock/stock_s0/29999/*" --local-dir ckpts/ +hf download rli14/rsm_cooking_v5_checkpoints successor_rsm_real_RM_s0_100k.pt --local-dir ckpts/ +hf download rli14/rsm_rise_code --local-dir rsm_rise_code/ +hf buckets sync hf://buckets/rsm-bucket/rsm-shared/v7/rsm_noaug ckpts/v7_rsm_noaug # bucket (needs bucket access) +``` +```python +from huggingface_hub import hf_hub_download +p = hf_hub_download("rli14/rsm_rise_sim_checkpoints", "square_sub_20100/rsm/M/ckpt_best.pt") +# or, with the cluster-path fallback: from rsm_rise.pipeline.hf_ckpt import fetch, fetch_source +``` +Loading: actors / critics are robomimic checkpoints (`robomimic.utils.file_utils.policy_from_checkpoint(ckpt_path=p)`, +from the RISE robomimic fork in `rsm_rise_code/code_src/rise_robomimic`); successors and hop heads are loaded by the +RSM planner (`code_src/rise_robomimic/robomimic/algo/rsm_scorer.py`, which imports the `rsm_libero` model code from +`frozen/rsm_libero_freeze_20261002` via `RSM_LIBERO_DIR`; trainer `train_rsm.py`); pi0.5 dirs load with openpi +`policy_config.create_trained_policy(config, )`. diff --git a/gen_q_rsm/rsm_rise/README.md b/gen_q_rsm/rsm_rise/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b8f65a93673bbfe05533286e00127da01d518bb0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/README.md @@ -0,0 +1,91 @@ +# rsm_rise — vision-based Gen-Q / RSM on the RISE play datasets + +**Checkpoints + code on Hugging Face:** see [HF_CHECKPOINTS.md](HF_CHECKPOINTS.md) (sim paper set `rli14/rsm_rise_sim_checkpoints`, real robot `rli14/rsm_real_checkpoints` + `rli14/rsm_cooking_v5_checkpoints`, code `rli14/rsm_rise_code`). + +Branch `rsm_rise_data` (off `richard_libero10`, 2026-09-18). Goal: a fair, RSM-attributable win of +RSM-guided planning over BC-on-demos, on data whose proposer samples are genuinely multi-modal — +the property the LIBERO-10 study showed to be missing (see `docs/` on the LIBERO branch: over +near-copy 10-step BC chunks an oracle selector gains only what a value-free medoid gets). + +## The data (inspected 2026-09-18, `mug_expert_suboptimal.hdf5`, `square_expert_play.hdf5`) + +robomimic-format hdf5 on **MimicGen / robosuite 1.4.1** envs, Panda, `OSC_POSE` 7-d relative +actions in [-1, 1], sparse reward, `combined=True` datasets stitched from several collections: + +| file | env | episodes | success | len (mean / min / max) | description (from attrs) | +|---|---|---|---|---|---| +| mug_expert_suboptimal | MugCleanup | 120 | 0.167 | 348 / 233 / 572 | "open drawer then fail, no grasp" + "drawer open, failure with bad grasp" | +| square_expert_play | NutAssemblySquare | 424 (404 train / 20 valid) | 0.472 | 364 / 202 / 700 | 7 sources: "random pick play", "peg expert from top right, new env", … | +| square_expert_suboptimal, threading_expert_play, two_piece_expert_{play,play_tipping,suboptimal} | (downloading) | | | | | + +Per episode: `obs/{agentview_image, robot0_eye_in_hand_image}` **84×84×3 uint8**, low-dim +`obs/{object, robot0_eef_pos, robot0_eef_quat, robot0_gripper_qpos, robot0_joint_*}`, `actions [T,7]`, +`rewards [T]` (episode-level success broadcast over frames: successful episodes carry 1 on every +frame, failures 0), `dones`, **`states [T, 34|45]` + `model_file`** → every frame is a replayable +MuJoCo state (admissibility rule: the eval env can reproduce every training trajectory; also +enables oracle / counterfactual-branch analysis exactly as on LIBERO-10). + +Why this data fits the question: the play collections mix distinct sub-behaviours (open drawer +only, bad grasp, random pick, expert from one corner), so a BC proposer trained on them is +**multi-modal by construction** and its samples differ in outcome — the decidable-decision +fraction that was 8–16 % on LIBERO-10 should be large here, and BC-on-play is a weak baseline +(the OGBench "stitch" regime). The fair BC-on-demos baseline is BC on the *successful* subset. + +Local copy: `/data/pulkitag/scratch/rli14/rise_data/` (gdown resume loop `fetch_loop.sh`; +Drive per-file quota stalls some files for hours). IBM copy: `/proj/dmfexp/zwhong/rsm_libero/data/rise_data/`. + +## The RISE paper (arXiv 2510.19495) — what to match + +Image-based end-to-end: wrist + third-person RGB and proprio into a ResNet18 encoder trained +jointly with a diffusion-policy BC (U-Net, chunk 16, 2-frame history) and IDQL Q/V MLPs; 0/1 +rewards; two additions: spectral-norm Lipschitz penalty on the BC policy, and DINOv2-ViT-S kNN +action-swap augmentation across trajectories. Eval: 100 rollouts x 3 seeds, wide init region. + +Settings and data (Table IV): **Coverage** = expert (200) + high-coverage play (199-224); +**Suboptimal** = expert (10-20) + failure demos (80-100). Our files: `*_expert_play` = Coverage, +`*_expert_suboptimal` = Suboptimal. + +Success % (Table I, sim): + +| setting / task | BC (experts) | BC-all | IDQL | RISE | +|---|---|---|---|---| +| Coverage square-peg | 18.7 | 0.0 | 19.6 | 50.7 | +| Coverage piece-assembly | 14.7 | 2.0 | 16.3 | 70.7 | +| Coverage piece-assembly (tip) | 0.0 | 0.0 | 8.0 | 51.3 | +| Coverage threading | 17.3 | 0.0 | 9.8 | 22.7 | +| Suboptimal mug-cleanup | 31.3 | 32.7 | 36.7 | 40.7 | +| Suboptimal piece-assembly (tip) | 20.0 | 23.3 | 35.7 | 36.0 | +| Suboptimal square-peg | 8.0 | 34.0 | 41.3 | 56.0 | + +Implication: BC-on-demos is weak (15-19 %) because test inits lie outside the expert region and +the task must be stitched from play; that is the regime where a Q-guided proposer ranking should +win by a wide margin (unlike LIBERO-10). Baselines to reproduce first: BC (experts), BC-all, IDQL. +Paper PDF/text: `/data/pulkitag/scratch/rli14/rise_paper.{pdf,txt}`. + +## Plan (reuses `rsm_libero/` — pack format, `train_rsm.py`, `bc_arm.py`, `is_ope.q_recursive/q_fold`, evaluator structure) + +1. **Env + replay.** `mimicgen` + `robosuite==1.4.1` in a dedicated venv; verify `states`+`model_file` + replay reproduces `rewards` (success) for a sample of episodes per task. Eval env = the same + MimicGen env with the dataset's `env_kwargs` (84×84, two cams). Protocols A/B/V as on LIBERO. +2. **Reward-predictive latent (hard requirement for image obs).** Two candidates, both written as + per-episode npz (`z [T,D] fp16, proprio, actions, success, subgoals`) so `pack.py`/`data.py` are unchanged: + - (a) ResNet18-spatialsoftmax trunk (robomimic's default for these tasks) on both cams, + trained with the reward/subgoal head + BC auxiliary, then **frozen**; D ≈ 128–512. + - (b) frozen DINOv2-small CLS+pooled patch features at 224 (84→224 upsample) as a + no-training control; π0.5 PaliGemma is a poor fit at 84 px. + Encoder tag recorded in PACK.json; evaluator refuses a mismatch (as on LIBERO). +3. **Dense progress labels.** MimicGen envs expose per-subtask completion signals; label every + frame by replaying `states` (`label_subgoals.py` pattern) → `reward_mode=subgoal`, BCE head. +4. **Proposers.** `BCplay` (all episodes) and `BCdemo` (successful episodes only) flow policies, + chunk 10, checkpoint selected on V. Candidate pool for selection: N=8–16 from `BCplay` + (multi-modal), optionally + `BCdemo`. +5. **Critic.** `train_rsm.py` on the pack (+ `--cache2` on-policy rollouts of the proposers once + the env loop works; `--collect` port of the evaluator). +6. **Arms** (all value-free controls included from day 1): plain BCdemo, plain BCplay, random-N, + medoid-N, RSM argmax / quantile / near-K, IQL-N, plus **oracle-N** (simulate each candidate + H steps from the cloned state — cheap here, states are stored) to measure the selection + ceiling before any critic is trained. If oracle-N ≈ medoid-N again, stop and change the pool. +7. Report: throughput + SR, paired McNemar, n=500, 3 seeds; V for every selection. + +First milestone: step 1 + the oracle ceiling of step 6 on `square_expert_play` (no training), +because that single number decides whether this dataset can deliver an RSM-attributable win. diff --git a/gen_q_rsm/rsm_rise/RISE_RSM_DROPIN_PLAN.md b/gen_q_rsm/rsm_rise/RISE_RSM_DROPIN_PLAN.md new file mode 100644 index 0000000000000000000000000000000000000000..b627cd0206c86afa6aa1ff24fac786de266e21a2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/RISE_RSM_DROPIN_PLAN.md @@ -0,0 +1,149 @@ +# RISE × RSM: drop the RSM in as the value function of RISE's flagship recipe + +Instructions for the MIT-slurm RSM session. Written 2026-09-18 by the gen_q session (`gen-q-9b`) +after reading the RISE paper (arXiv 2510.19495) and code. Richard's ask, verbatim: + +> if they already use DINOv2 ViT-S for states — it is natural to train an RSM on this latent +> space and drop it in as a q-value function. Take their flagship IDFQL recipe, and drop in the +> RSM with beta-stitching as the value function instead of the default TD-trained IQL value +> function. + +Everything below is verified against the code, with file:line anchors. Local clones: +`/data/pulkitag/scratch/rli14/rise_code` (github.com/UWRobotLearning/RISE, `f251e27`) and +`/data/pulkitag/scratch/rli14/rise_robomimic` (their robomimic fork, `5070abf`). Paper text: +`/data/pulkitag/scratch/rli14/rise_paper.txt`. Data: `/data/pulkitag/scratch/rli14/rise_data/` +(`square_expert_play.hdf5` 424 eps and `mug_expert_suboptimal.hdf5` 120 eps are complete; the +other 5 files are stuck on a Google-Drive quota, Richard is downloading them locally). + +## 1. What the flagship recipe actually is (read this before touching anything) + +Their "IDQL" (`robomimic/algo/iql_diffusion.py`, class `IQLDiffusion`, selected by +`ImitationAlgorithm.IDQL` in `sim_pipeline/configs/training/_imitation_learning/_offline_rl/iql_diffusion.py`) +is **advantage-weighted diffusion behaviour cloning**, not test-time best-of-N: + +- **Critic** (`_compute_critic_loss`, L318-436): twin Q(s_t, a_t) on the SINGLE first action + (`actions = batch["actions"][:, i, :]`, i=0 in `ONE_STEP` mode), one-step TD target + `r + (1-d)·γ·V_target(s_{t+1})`, IQL expectile V (`vf_quantile=0.9`), `γ=0.99`, + `target_tau=0.01`, 0/1 rewards (successful episodes carry 1 on every frame — see the hdf5), + twin-min for the advantage. Each critic has its OWN ResNet18 image encoder (L149-185). +- **Actor** (`_compute_actor_loss`, L437-596): diffusion-policy denoising MSE on a + 16-step chunk (`prediction_horizon=16`, `action_horizon=8` executed, `observation_horizon=2`), + weighted per sample by `exp((Q−V)/β)` (`_get_adv_weights`, L597; `adv.beta`, clip options). + Plus the RISE additions: spectral-norm penalty on the policy's obs encoder + (`spectral_norm_policy=True`, weight `policy_bottleneck_beta` 0.1 square / 0.001 mug,threading) + and the DINOv2 kNN action-swap augmentation (`robomimic/utils/dataset.py` L560-620, + `advanced_augmentation=True`, `distance_threshold` 0.15 square / 0.05 mug, `num_neighbors=15`; + the distance model is `DinoV2Core(dinov2_vits14, concatenate=False)`, `obs_core.py` L316). +- **Test time** (`get_action`, L692-760): ONE sample from the weighted diffusion policy, execute + 8 of 16 actions. No Q is consulted at test time. (Table III's "64 samples" is not in this path.) +- Per-task flagship configs: `sim_pipeline/configs/training/_imitation_learning/_offline_rl/_experiments/{square,mug,threading,piece_assembly*,square_suboptimal}.py` + (all inherit `IQLDiffusionSpectralImageTrainingConfig`: ResNet18 encoders trained from scratch, + `down_dims [512,1024,2048]`, 5000 epochs, batch 64, lr 1e-4). +- Train: `python scripts/train_robomimic.py -cn iql_diffusion +training=square data.dataset_path=`; + eval: `python scripts/eval.py -cn eval_robomimic_iql_diffusion exp.model_path= +env=` + (100 rollouts × 3 seeds in the paper; envs in `sim_pipeline/configs/env/`, e.g. + `robomimic_square_coverage.py` = the wide init region used for the Coverage numbers). + +Paper numbers to reproduce (success %, sim): square Coverage BC 18.7 / IDQL 19.6 / RISE 50.7; +piece-assembly Coverage 14.7 / 16.3 / 70.7; mug Suboptimal 31.3 / 36.7 / 40.7; square Suboptimal +8.0 / 41.3 / 56.0. + +**So the drop-in is at the ADVANTAGE, not at action selection.** This is the AWR-with-Gen-Q recipe +from `gen_q/CLAUDE.md` ("improve the policy with AWR, −E[log π · exp(β Â)], Gen-Q as the critic +source, no TD critic"), and it side-steps the LIBERO-10 dead end: there the critic had to rank 8 +near-identical chunks of one policy at test time (oracle ceiling = medoid); here it re-weights +the whole play/expert/failure dataset, where actions at nearby states differ enormously. + +## 2. The RSM in DINOv2 space + +Latent = exactly their frozen feature: `DinoV2Core(input_shape=(3,84,84), backbone_name='dinov2_vits14', concatenate=True)` += CLS ++ GeM-pooled patch tokens = 768-d per camera, 84→Resize(256)→CenterCrop(224)→ImageNet-norm +(`obs_core.py` L316-360); two cameras → 1536-d, ++ proprio (`robot0_eef_pos` 3, `robot0_eef_quat` 4, +`robot0_gripper_qpos` 2). Their `sim_pipeline/data_manager/relabel_dino_features.py` writes it as +`obs/dino_features` into a copy of the hdf5 — run that first (it is also what their augmentation +metric uses, so the RSM lives in the same space the recipe already trusts). + +Pack it into the `rsm_libero` format (per-episode npz: `z fp16 [T,1536]`, `proprio [T,9]`, +`actions [T,7]`, `success`, `states`) → `rsm_libero/pack.py --encoder dinov2_vits14_clsgem --cam-res 84`, +then `rsm_libero/train_rsm.py` (gen_q branch `rsm_rise_data`, off `richard_libero10`): + +``` +train_rsm.py --cache --reward-mode dense --reward-loss bce --append-proprio 1 \ + --d-z 256 --enc-width 1024 --flow-width 1024 --flow-depth 4 --chunk 8 \ + --beta-lo 0.93 --beta-hi 0.995 --beta-q 0.98 --w-actcon 0.5 --batch 512 --lr 3e-4 --ema 0.995 \ + --steps 200000 --save-every 20000 --eval-every 10000 --out +``` +- `n_task = 1` (single-task datasets; task id is a constant). +- `--chunk 8` = the executed horizon `action_horizon`; the RSM's Q is Q(z_t, a_{t:t+8}). (Their Q + uses the single a_t; keep chunk 8 as primary, `--chunk 1` as the like-for-like ablation.) +- Reward: 0/1 success as in RISE (`dense`). Optional later: MimicGen subtask signals replayed + from `states` → `subgoal` reward (`label_subgoals.py` pattern) — a strictly richer target. +- Hop policy for β-stitching (depth 2-3): a small flow/Gaussian head on the DINO latent trained + by BC on ALL data (`bc_arm.py --pool all`, latent features) — the LIBERO `HOPdemo_f` analogue. + Depth 1 needs no hop policy. +- Select the RSM checkpoint by `history.json` (`q_action_winrate`, `reward_auc`) — never on + eval rollouts. + +## 3. The drop-in (one patch, ~60 lines, in the robomimic fork) + +Add an advantage source to `IQLDiffusion` that replaces the IQL nets: + +1. New algo-config flag `rsm_adv_ckpt: str | None` (+ `rsm_adv_depth`, `rsm_adv_beta_q`, + `rsm_adv_particles=16`, `rsm_adv_v_samples=8`, `rsm_adv_hop_ckpt`), plumbed through + `IQLDiffusionTrainingConfig` → robomimic algo config like the other flags. +2. In `_create_networks`: if `rsm_adv_ckpt` is set, do NOT build `critic`/`vf` nets; load the + frozen RSM (`is_ope.load_critic`) + hop policy + the frozen `DinoV2Core(concatenate=True)`. +3. New `_rsm_advantage(batch)` called from `train_on_batch` in the `ONE_STEP` branch in place + of `_compute_critic_loss` (L279-292): for the batch's obs at `To-1` build + `x = [dino(agentview) ++ dino(eye_in_hand) ++ proprio]` (normalised with the pack's + `feat_stats.npz`), `z = enc(x)`; + `Q = q_recursive(z, actions[:, :8].flatten(1), task=0, beta=beta_q, depth=d, n_particles=16, crn=True)` + (or `q_fold` for the OCBench product form); + `V = mean_k Q(z, a^(k))` over `rsm_adv_v_samples` chunks drawn from the hop policy at `z` + (depth-1 V; this is the RSM-consistent baseline, no TD); + `adv = Q − V` → return it as `critic_info["vf/q_pred"] − ["vf/v_pred"]` so `_compute_actor_loss` + (L437) and `_get_adv_weights` (L597) run UNCHANGED (same `β`, same clipping). + Cache nothing across epochs: the kNN augmentation creates (obs, neighbour-action) pairs on the + fly (`dataset.py` L590-605), and the RSM must score exactly those pairs — computing adv per + batch (64 states × 16 particles × depth) is cheap. +4. Everything else identical to the per-task flagship config: spectral norm on, augmentation on, + same ResNet18 policy encoder from scratch, same horizons, 5000 epochs, same eval script/env. + +DINO features for the actor's batch: the dataset already caches images; run `DinoV2Core` on them +in `_rsm_advantage` (frozen, no_grad; ~64×2 images per step is negligible next to the U-Net), or +precompute `obs/dino_features` with their relabel script and add it to `low_dim_keys` for the +critic side only. Either is fine; the first keeps the hdf5 untouched. + +## 4. Experiment matrix (per task; start with `square_expert_play`, then `mug_expert_suboptimal`) + +Every arm = the flagship config with one thing changed; 3 seeds; their eval (100 rollouts, wide init) — +plus n=500 with fixed inits once an arm looks like a win. + +| arm | advantage source | purpose | +|---|---|---| +| RISE (repro) | IQL Q−V (theirs) | must land near 50.7 (square) before anything else is trusted | +| BC | `use_bc=True` (uniform weights) | their 18.7 | +| BC-all vs BC-expert | uniform, on all data vs successful episodes only | the "BC on demos" baseline for our story | +| **RSM-d1** | RSM Q(z,a_{:8}) − V, depth 1 | the drop-in | +| **RSM-d2 / RSM-d3** | β-recursion with the hop policy | the stitching claim | +| RSM-fold | OCBench product fold, depth 2-3 | recipe variant | +| RSM-chunk1 | chunk 1 | like-for-like with their single-action Q | +| shuffled-adv | RSM adv permuted across the batch | weights-carry-information control | +| MC-adv | Monte-Carlo return-to-go − state mean | cheap-critic control (was the "MC critic" on LIBERO) | +| (optional) RSM-subgoal | subgoal reward from replayed states | richer target | + +Win = RSM-dK ≥ RISE on the Coverage tasks (≥ 2 seeds, both n=100×3 and n=500) and ≫ BC/BC-expert, +with shuffled-adv ≈ BC. Report throughput too (SR × max_steps / mean_steps). + +## 5. Order of work + +1. Build the RISE env on slurm (`environment.yaml` + their robosuite/robomimic/mimicgen forks; + pytorch3d as in their README). Smoke: `scripts/eval.py` with their eval config on 5 episodes. +2. Reproduce RISE + BC on `square_expert_play` (1 seed) — this is the gate. +3. DINO relabel → pack → `train_rsm.py` (200k steps, one GPU, ~3-4 h) + hop head. +4. Patch `iql_diffusion.py` per §3; run RSM-d1 and RSM-d3 (3 seeds), then the controls. +5. Repeat on mug (Suboptimal) and, when the files arrive, piece-assembly (largest headroom: 14.7 → 70.7). + +Constraints carried over: no CLM-repo content into the gen_q GitHub; selection on validation +only; `vision-pulkitag-free-cycles`/`lab-free` QoS, never `vision-pulkitag-main`; GCP is off. +Questions → `gen-q-9b` (SendMessage) or Richard. diff --git a/gen_q_rsm/rsm_rise/pipeline/CLAUDE.md b/gen_q_rsm/rsm_rise/pipeline/CLAUDE.md new file mode 100644 index 0000000000000000000000000000000000000000..8d8dfb33db99d2ccc5acc1d0d0c627b6dc59eeee --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/CLAUDE.md @@ -0,0 +1,13 @@ +# rsm_rise -- working rules for Claude sessions in this directory + +- **Delegate anything that takes more than a few seconds to a background enterprise Claude worker** + (`scripts/workers/run_worker.sh ` on `scripts/workers/_full.md` = `COMMON.md` + task), so the + main session's context stays small. The main session only: reads issues when a worker hands back or a + monitor fires, launches/re-arms monitors, and relays results. Quick one-liners (a `bjobs`, an `ls`, a + `git push`) stay in the main session. (Owner, 2026-09-22.) +- No compute on the login node: every download/test/eval/training/table build goes through + `scripts/bsub_cpu.sh` / `scripts/bsub_gpu.sh` (GPU jobs `j_exclusive`, preemptable when normal is full). +- W&B only to richardrl/rsm_rise via `wandb_env.sh`; never print or commit the key. +- GitHub actions as richardrl use the stored token (`~/.git-credentials`), never `gh` (logged in as another user). +- Vendored pipeline repo: `/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm` (branch `rsm_rise_data`); + this directory is not a git repo. diff --git a/gen_q_rsm/rsm_rise/pipeline/README.md b/gen_q_rsm/rsm_rise/pipeline/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3d0389b1b791ccb23a9f60c378a75421dc25bd48 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/README.md @@ -0,0 +1,112 @@ +# Flagship table pipeline (RSM × RISE) + +Everything needed to regenerate the flagship comparison table from a `runs/` tree of evaluation +JSONs. The generators are pure readers: they never launch anything and never mutate `runs/`, so +regenerating is always safe. + +Paths inside these scripts are absolute to `/proj/dmfexp/zwhong/rsm_rise` (the working tree that holds +`runs/`, `cache/` and `data/raw/`). Point `ROOT` at a different tree to run elsewhere. + +## Regenerate the table + +```bash +python3 scripts/master_table.py # -> docs/MASTER_TABLE.md (the full working table) +python3 scripts/flagship_latex.py # -> docs/tex/flagship_table.tex (the paper table) +scripts/check_iclr_fit.sh # compiles against iclr2027_conference.sty, fails on overfull +``` + +`flagship_latex.py` imports `master_table` by default so both documents are built from **one snapshot** +of `runs/`. That matters: with evaluation jobs landing continuously, two independent reads of the eval +tree disagree, and the two documents would quietly describe different data. `--no-sync` opts out. + +## What the numbers mean + +**Reward.** Every method sees the dataset's binary data-provenance label: `1` on every frame of an +expert episode, `0` on every frame of a suboptimal one. This is what RISE's `relabel_rewards.py` +writes and what its IQL critic consumes unchanged — it is *provenance*, not outcome. BC and BC-u use no +reward. The `membership` successor head is the reward-matched one; `completion` (per-frame env success) +is a *different* reward reported separately, and `progress` (dense privileged shaping) is +**disqualified** and must not be quoted. + +**Seeds.** A seed retrains actor *and* critic (`exp.seed`), as in RISE; `exp.eval_seed` only reseeds +the environment. Error bars are the standard error **across training seeds**, because the seed is the +unit of replication — a binomial interval over pooled rollouts would treat correlated episodes from one +policy as independent and understate the spread by roughly a third. + +**Controls.** `Δ no-sel` compares against the same proposer sampled greedily; `Δ shuf` is a +random-candidate control: the same N candidates from the same proposer, one picked at random (permuted +scores). On 6/7 flagship rows that run used a different successor configuration from the reported arm +(2026-09-21 audit), so it is not a shuffle of the reported arm's own scores. These, not the margin over a baseline, are what test +whether the *scorer* contributes: a row can beat every baseline and still be carried by its proposer. + +**Evaluation region is part of the measurement.** `verdict_table.CANON` pins one region per task and +silently drops cells measured anywhere else, so a cell run in the wrong env is not a wrong number but an +*invisible* one. Known traps: `square_expert_play` must use `robomimic_square_image_ood`; +`two_piece_expert_play` must use the whole table, not `_top_right` (the expert's own quadrant); +`threading_expert_play` must use `robomimic_threading_coverage`, not `robomimic_threading`. +`two_piece_expert_suboptimal` on `_top_right` *is* correct — the paper evaluates suboptimal from p0. + +## Selection bias + +The flagship row is a maximum over every arm evaluated on a task, taken on the same episodes used to +report it. `heldout_table.py` quantifies and removes that: + +```bash +python3 scripts/heldout_table.py --null +``` + +It selects each arm on seed 0 and scores it on seeds 1–2 (unbiased for the chosen arm), and runs a +max-over-arms null showing what pure search noise would produce given the number of arms searched. + +## Throughput + +``` +throughput = success_rate * horizon / mean policy timesteps +``` + +`throughput.py` computes it over the existing archive — nothing needs re-running. It uses +`first_success_step`, **not** `length`: every eval sets `end_on_success` but the rollout loop runs to +the horizon regardless, so `length` is the constant 400 on successes and failures alike. + +## Filling the table + +```bash +python3 scripts/launch_flagship_topup.py --status # what each task's arm has vs needs +python3 scripts/launch_flagship_topup.py # top up the reported arm to 3x3 +python3 scripts/launch_flagship_topup.py --top-k 3 # when arms are within noise of each other +``` + +`--top-k` exists because topping up only the maximum does not converge on a task whose arms are +statistically tied: verifying the leader knocks it down, another one-seed arm takes its place, and the +cycle repeats. Bringing the top *k* arms to three seeds ends it. + +`eval_health.py` says which cells actually failed. Do **not** grep eval logs for `Traceback`: +robosuite's EGL context raises `EGLError` from `binding_utils.__del__` at interpreter teardown, so a +completed cell ends its log with one — in one sample 18 of 25 logs had a traceback and all 18 had +produced a full JSON. The artefact is the fact: DONE if the JSON has episodes, PARTIAL if only a +`.partial_best` exists (the per-episode EGL SIGABRT, which requeues and resumes), EMPTY otherwise. + +Two cells must never run concurrently: `eval.py` resumes from `.json.partial_best`, so a +double submission interleaves writes to one resume file. `launch_e1_grid.py` guards this by reading +live jobs' scripts, but two *overlapping invocations* of a launcher can still race. Check with +`bjobs -o job_name | grep | sort | uniq -c` — a frequency count, not a set membership test, +which silently collapses the duplicates it is meant to find. + +## Search budget is part of the comparison + +`parity_sweep.py` runs, under the membership reward, the recipes only the disqualified progress head +ever saw. The two sweeps did not cover the same ground — beta 0.95 and the RISE-policy proposer are +well represented under progress and thin under membership — so a head-to-head between them partly +measures search budget. On piece-tip the counts were 9 recipes against 4, and the scores 29.5 % against +1.6 %. Compare like with like before concluding a reward is worse. + +`bad_hosts_from_logs.py` maintains `config/bad_eval_hosts.txt`. It detects renderer-broken hosts from +**log evidence** rather than LSF exit status, because the MuJoCo/EGL abort happens per episode inside a +job that stays `RUN` and therefore never registers an `EXIT`. + +## Dependency + +Successor models are trained by `rsm_libero/train_rsm.py` in this repository; the flags `rr_rsm.sh` +passes (`--enc identity`, `--eval-minmse-n`, `--sample-clip`, `--wandb-name`, …) come from the commit +that precedes this one. `rr_rsm.sh` sources `wandb_env.sh`, which is **not** committed — it holds the +W&B credentials and must be supplied locally. diff --git a/gen_q_rsm/rsm_rise/pipeline/audit/AUDIT_claude.md b/gen_q_rsm/rsm_rise/pipeline/audit/AUDIT_claude.md new file mode 100644 index 0000000000000000000000000000000000000000..6091e36a21e29fac81c5b72a0ef35e0335bf023a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/audit/AUDIT_claude.md @@ -0,0 +1,304 @@ +# Fairness audit of the RSM x RISE flagship table (read-only, 2026-09-21) + +Auditor: Claude (Fable 5.1), adversarial read-only pass. Everything below was checked against code and +on-disk data, not against documentation. Tree audited: `/proj/dmfexp/zwhong/rsm_rise` (runs/, cache/, +data/); pipeline audited: `/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/` +(output snapshot of 2026-09-21 04:05 UTC). Note that the eval tree has moved since that snapshot +(15 JSONs newer than `output/FLAGSHIP_TABLE.md` on mug+threading alone), so a few numbers I recompute +differ from the printed table; where they do I say so. + +Organising question (per the reframed brief): **does the RSM *method* (the scorer) demonstrably beat +the baselines under matched reward and matched randomness, row by row?** Sections A-E give the parity +checks; the final section gives the per-row verdict table and the count. + +--- + +## A. Same reward for every reward-using method + +### A1. RISE/IDQL critics train on a constant-per-episode provenance label — VERIFIED + +Evidence (h5py, `rewards` dataset only, per episode): + +| file (as consumed by `run_train.sh`) | episodes | reward values | non-constant episodes | reward-1 episodes | +|---|---|---|---|---| +| data/raw/square_expert_suboptimal.hdf5 | 200 | {0,1} | 0 | 100 (demo_0..99) | +| data/raw/square_expert_play.hdf5 | 424 | {0,1} | 0 | 200 (demo_224..423) | +| data/raw/two_piece_expert_suboptimal.hdf5 | 120 | {0,1} | 0 | 20 (demo_100..119) | +| data/raw/two_piece_expert_play.hdf5 | 399 | {0,1} | 0 | 200 (demo_199..398) | +| data/derived/mug_expert_suboptimal_nextobs.hdf5 (S0A/S0Aidql/S0B use this copy) | 120 | {0,1} | 0 | 20 (demo_0..19) | +| data/raw/threading_expert_play.hdf5 | 450 | {0,1} | 0 | 250 (demo_0..249) | +| data/raw/two_piece_expert_play_tipping.hdf5 | 704 | {0,1} | 0 | 200 | +| data/derived/square_sub_20100.hdf5 (flagship "Square (Sub.)" row) | 120 | {0,1} | 0 | 20 (SLICE.json expert_keys) | + +Consumer: `code/rise_robomimic/robomimic/algo/iql_diffusion.py:246` copies `batch["rewards"]` into the +training batch unchanged; `:410` `q_target = rewards + (1. - dones) * discount * target_vf_pred`. No +shaping, no success relabel, no transform of the label. `relabel_rewards.py:53` writes +`np.ones_like(...) * const_reward`. `train.hdf5_filter_key` is `None` in every recorded `config.json`, so +the critics train on all episodes (including the file's `mask/valid` split). + +### A2. RSM membership head = the same expert set — VERIFIED in substance, but the stated mechanism is wrong + +The brief/README say `self.r` is set from `ep_demo`. It is not. In `reward_mode=dense` (what `rr_rsm.sh:47` +passes) `rsm_libero/data.py:158-163` sets `r=1` on every frame of episodes with `ep_success[i]`; `ep_demo` +is only consulted in the `subgoal` branch (`data.py:153`). In every cache `ep_demo` is all-False +(`PACK.json: n_demo 0`, written by `scripts/relabel_dino.py:240` as `np.zeros(...)`). + +What saves the reward matching is `relabel_dino.py:183`: `ep_success = rewards.max() > 0` read from the +same HDF5. Checked for all 8 caches: `set(ep_src[ep_success]) == {k : rewards.max()>0}` is True and the +episode universes are identical (100/200, 200/424, 20/120, 200/399, 20/120, 250/450, 200/704, 20/120). +So the successor's reward IS the provenance label. Fix the README/brief text (`ep_demo` -> `ep_success` +derived from HDF5 `rewards`), because as written it describes a code path that does not run. + +Minor asymmetry: `data.py:97-101` holds out 10 % of episodes (`val_frac=0.1`) from RSM training; the +critics train on 100 %. Favours the baselines slightly; not a reward mismatch. + +### A3. Admissibility mask — VERIFIED not applied (but it WOULD change the reward if it were) + +Lead 1 is mechanically correct: the mask (`data.py:65-71`) rewrites `ep_success`, and `dense` reward is +built from `ep_success` (`:158-163`), so an applied mask changes `self.r`. It is never applied: +`rr_rsm.sh` passes no `--success-mask`, `scripts/stage1_config.env` adds only +`--flow-norm 1 --x-noise 0.3 --flow-dropout 0.1 --wd 0.1`, and every recorded run config +(`runs/*/rsm/*/wandb/*/files/config.yaml`) has `success_mask: ""` and `reward_mode: dense`, including +the reported models (mug M_s1, threading M, two_piece L40/M, square L40/M, tipping M). The `M_bcap*` +models have no wandb config on disk; none of them is a reported arm. + +### A4. `dense` + `bce` is not the progress head; no proghead/goalhead in flagship cells — VERIFIED + +`train_rsm.py:540-543`: for `reward_mode=dense`, `l_rew` is class-balanced BCE on the per-frame 0/1 +target. "dense" means the label covers every frame (`data.py:117-121`), not the privileged potential. +`verdict_table.py:133` routes `ckpt_proghead*` -> `rsm:progress` and `ckpt_goalhead*` -> `rsm:completion`; +`master_table.py` sends those to sections 3 and 2. Every reported arm uses `ckpt_best.pt` or +`ckpt_s100000.pt` (ARM_STATUS.txt) — membership. + +One caveat that matters for the controls (see B3/C1): the *permuted* arm key is +`("permuted", head)` with no model/beta/hops/N (`verdict_table.py:125-128`), so the "shuffled-score +control" pools permuted runs of whatever membership configuration exists for that proposer. + +### A5. BC / BC-unified ignore the reward; S3H1 expert set == A1's reward-1 set — VERIFIED + +`config.json` for every epoch-5000 S0B/S3H1 checkpoint: `algo.use_bc = True`; `iql_diffusion.py:565-579` +then uses `actor_loss = bc_loss.mean()` and skips the critic update. S3H1 trains on +`data/derived/_expert.hdf5`, whose episode set is exactly the reward-1 set (same counts and key +ranges; `square_sub_20100_expert.hdf5` = the 20 SLICE.json expert keys). Reward values in those files are all 1. + +Recipe differences that are *not* reward: S3H1 has augmentation off, S0B on (`run_train.sh:53,68`); +S0Aidql has spectral norm and augmentation off (paper's IDQL). Recorded in every config.json. + +--- + +## B. Same randomness per seed + +### B1. Same eval_seed / env / horizon / end_on_success across columns — VERIFIED, with two findings + +Side-by-side of what `verdict_table.cells()` pools at `eval_seed=0` (every file in the pool agrees on the +listed fields): + +| task | column (files pooled at es=0, all policy seeds) | eval_seed | reset_states_file | init_obj_range | horizon | end_on_success | plan_n / rule | epoch | +|---|---|---|---|---|---|---|---|---| +| piece (Sub.) | greedy BC-expert | 0 | None | Piece1 [-0.22,-0],[0,0.22] | 400 | True | 1 or None / argmax | 5000 | +| piece (Sub.) | greedy BC-unified | 0 | None | same | 400 | True | 1 or None / argmax | 5000 | +| piece (Sub.) | IDQL critic (S0Aidql, backend iql) | 0 | None | same | 400 | True | 128 / argmax | 5000 | +| piece (Sub.) | RISE critic (S0A, backend iql) | 0 | None | same | 400 | True | 128 / argmax | 5000 | +| piece (Sub.) | RSM reported (M@s100000 b0.95 L2, S0A proposer) | 0 | None | same | 400 | True | 128 / argmax | 5000 | +| mug (Sub.) | greedy BC-expert | 0 | None | SquareNut [0,0.12],[-0.225,0] | 400 | True | 1 or None / argmax | 5000 | +| mug (Sub.) | greedy BC-unified | 0 | None | same | 400 | True | 1 or None / argmax | 5000 | +| mug (Sub.) | RISE critic | 0 | None | same | 400 | True | 128 / argmax | 5000 | +| mug (Sub.) | RSM reported (M_s1@best b0.95 L1, S3H1 proposer) | 0 | None | same | 400 | True | 128 / argmax | 5000 | + +Env seeding: `eval.py:51-120` builds the env with `seed=config.exp.eval_seed`; +`envs/initialization_wrapper.py:13-15` does `np.random.seed(seed)`; robosuite's placement sampler draws +from global `np.random`, so episode *i* at eval_seed *k* gets the same initial state for every method +provided nothing else consumes `np.random` inside a rollout (I found no such draw in the rollout path; +`rsm_scorer.py:869` uses its own `default_rng`). `reset_states_file` is only used for tipping (same file for +all columns). So initial conditions are matched by construction, but not *enforced* (no init-state file on +6 of 7 tasks). + +**Finding B1-a (misclassified cells).** `runs//eval/*.json` contains, per task, 900 episodes on the +S0A policy with `planner_overrides.plan_n = None` and `policy_mode = "idql"`. Per `eval.py:364-380`, +`plan_n=None` + `policy_mode != 'bc'` on an IDQL checkpoint builds `RobomimicSamplingRolloutPolicy`, +which draws **128 samples and takes argmax of the min-Q critic** +(`robomimic_sampling_rollout_policy.py:63,101-110`); `eval_cell.sh:9` documents this mode as "RISE: 128 +samples ranked by the IQL critic". `verdict_table.py:119-122` maps `plan_n=None` -> `n=1` -> arm +`"greedy"`. So RISE's released critic-ranked rollouts are pooled into the *no-selection* control of every +RISE-proposer row: + +| task | "greedy RISE policy" as pooled by verdict_table | truly greedy (plan_n=1) | misclassified (plan_n=None, mode idql) | +|---|---|---|---| +| piece (Sub.) | 26.5 (n=2250) | 30.7 (n=1350) | 20.3 (n=900) | +| piece (Cov.) | 20.3 (n=2300) | 29.7 (n=1400) | 5.7 (n=900) | +| mug (Sub.) | 1.4 (n=2100) | 1.8 (n=1200) | 0.9 (n=900) | +| threading (Cov.) | 2.4 (n=1800) | 1.0 (n=900) | 3.9 (n=900) | +| piece-tip (Cov.) | 2.3 (n=1800) | 0.9 (n=900) | 3.7 (n=900) | + +The paired McNemar numbers in the table are *coincidentally* unaffected: `cells()` globs `eval_*/` before +`eval/`, and `mcnemar()` truncates each cell to `min(len)` = the RSM cell's 50-150 episodes, so the +misclassified episodes are appended last and dropped. The pooled rates (section 0 "base", `verdict_table` +main's RISE-policy baseline) are wrong, and the correctness of the paired test depends on glob order. +(BC policies with `plan_n=None` have `policy_mode=bc` and are genuinely greedy; S0Aidql has no such files.) + +**Finding B1-b (unequal pooling).** Cells are not "50 episodes": baseline greedy cells pool 2-12 files +(150-700 episodes) per (policy seed, eval seed), while the reported RSM cells are one file of 50 +(threading: 3 files, 216/cell). Not unfair by itself, but the paired test then compares the RSM cell to +the first `min(len)` episodes of whichever baseline file globbed first. + +**Finding B1-c.** The RSM arm key ignores `plan_particles`; the square (Cov.) and mug reported arms pool +particles=16 and particles=256 runs as one arm. + +### B2. Every column at model_epoch_5000, no epoch mixing — VERIFIED + +`verdict_table.py:113-114` accepts only `model_epoch_5000.pth`. Enumerated the epoch-5000 directory of +every S0A/S0Aidql/S0B/S3H1 cell on all 8 tasks (one directory each). IDQL `@ep3000 *(interim)*` appears +only in the master table with its tag; the LaTeX table prints `--` there. + +### B3. Candidate budget N=128 / greedy N=1 — VIOLATED for one row + +Greedy cells: `plan_n` 1 (or None -> single sample for BC). Critic arms: 128, `argmax`, min over the +critic ensemble (`rsm_planner.py:134-165`, matching the released rollout). RSM reported arms: N=128 on six +rows, but **Square (Sub.) uses N=8** (`ARM_STATUS.txt`, master table N column) while its shuffled control +is an N=128 permuted run. Fewer candidates is not an advantage, but the row is not budget-matched to its +own controls and the caption does not say so. + +### B4. train.seed = 1 for every method — VERIFIED symmetric; one asymmetry to state + +Every epoch-5000 `config.json` (all 8 tasks, S0A/S0Aidql/S0B/S3H1, seeds 0/1/2) records `train.seed = 1` +(also `np.random.seed(1)` via `train_robomimic.py:57-58`, so data order and kNN augmentation draws are +shared too). The 2026-09-21 02:xx relaunches wrote new `config.json` files with `train.seed = k` for +two_piece (Sub.) and square_sub_20100 but produced no checkpoints (resume found epoch 5000), so nothing +is mixed. The LaTeX caption states that init is held fixed and a seed varies action draw + env inits — true. + +Asymmetry: a "seed" retrains the proposer only. The **successor model is one fixed network across all +three seeds of an arm** (`rr_rsm.sh:34-38` admits this), whereas the baseline critic is nominally +retrained per seed. Today the critic re-training is a no-op (seed 1 everywhere) so the defect is +symmetric in effect; the moment gen_q#260 is fixed for the critics it becomes asymmetric unless the +successor is re-seeded per seed as well. Also: mug's reported arm is `M_s1` — the second successor seed — +chosen because it scored higher than `M`, i.e. RSM's number is a max over successor seeds while baselines +are means over seeds. + +### B5. Action-draw seeding — VERIFIED same derivation for every method + +`setup_experiment(eval=True)` calls `set_random_seed(eval_seed)` (`utils/experiment.py:24-27, 46-60`): +`random`, `np.random`, `torch` all seeded with the eval seed. `plan_seed = -1` in every pooled JSON, so +the planner never reseeds (`rsm_planner.py:323-336`) and candidates come from the torch global stream for +every ranked method. The streams diverge after the first step because methods draw different numbers of +samples; that is inherent and symmetric. + +--- + +## C. Same statistics + +### C1. 50 episodes per cell, identical pooling, SE across seeds — PARTLY VIOLATED + +SE is computed identically for every column (`flagship_latex.py:117-135, 240-256`), daggers are placed +correctly, and the LaTeX matches the markdown. But "50 episodes per cell" is false (B1-b): the flagship +BC/BC-u/RISE columns pool 900-2300 episodes per task, the RSM column 50-1950. The "shuffled-score +control" is not "identical scores in permuted order": for 6 of 7 rows the permuted pool is a *different* +successor configuration from the reported arm (e.g. piece (Cov.): reported `L40@best b0.98 L8`, permuted +`M@best b0.9 L1` + progress-head runs; mug: reported `M_s1@best b0.95 L1`, permuted `M@best b0.9 L2`; only +threading has a matching `M@s100000 b0.9 L1` run, 1350 of 1800 episodes). Because argmax of permuted +scores is a uniform pick among N candidates, the control is still a valid "random candidate" control, but +the README/caption claim about identical scores is not what the code does. + +### C2. Δ vs the strongest baseline — VERIFIED as coded, with an omitted baseline + +`flagship_latex.py:289-296`: Δ = RSM minus max over printed BC/BC-u/IDQL/RISE. No row is measured +against a critic arm that sits below greedy. However the strongest reward-trained *policy* is not printed: +RISE's actor rolled out greedily (S0A, plan_n=1) scores 29.7 on piece (Cov.) — above the printed best +baseline BC-u 25.3 — and 30.7 on piece (Sub.). With it, piece (Cov.) Δ is +20.3 not +25.1. The master +table additionally sets RISE = max(critic arm, `eval_riseonline`), a max for a baseline (small effect). + +--- + +## D. Matched-proposer table — PARTLY VIOLATED + +Same S0B checkpoints (`eval_ckpt` = `S0B_seed{k}/.../model_epoch_5000.pth`), same env, same eval seeds — +verified. But the three columns are not the same cells: greedy = all 9 S0B cells pooled; IQL = the +`eval_matchprop` cells; RSM = **max over every BC-unified membership arm regardless of seed count** +(`flagship_latex.py:305-315`): 98 arms on piece (Sub.), 60 on piece (Cov.), 49 on threading. It is not +paired, not pre-registered, and not reproducible from the current tree: the printed RSM values for mug / +threading / piece-tip are all 8.0, whereas today's tree gives 4.0 (that arm topped up to 2 seeds), 20.0 +(a new 1-seed arm) and 6.0. The "vs greedy" column of this table therefore carries the full winner's curse. + +--- + +## E. Disclosure — VIOLATED (search size understated; correction not in the paper table) + +* "How the flagship arm was chosen" counts only arms with >= 2 seeds (8/27/16/9/9/8/6). Arms actually + evaluated under the membership head: 16/28/133/82/41/85/35 (heldout `--null`: 16/27/131/79/37/82/35). + Three flagship rows (Square (Sub.), Piece (Sub.), Piece-tip) are single-seed maxima taken over the + *full* set, so the disclosed size is the wrong one for exactly the rows that need it most. +* The search also ranges over successor checkpoints (piece (Sub.): 27 `M` and 30 `L40` checkpoints + evaluated), successor seeds (M vs M_s1), proposer (3), beta, hops, N, particles. None of that is in the + caption. +* The null test says the observed max is inside the max-over-arms null p95 on 5 of 7 tasks + (square_sub 52.0 < 56.0; piece (Sub.) 48.0 < 50.0; mug 11.1 < 18.0; threading 18.5 < 22.0; tipping 8.0 < + 11.0). Only piece (Cov.) (50.8 > 48.0) and marginally square (Cov.) (12.4 vs 12.0) exceed it. This is not + quoted anywhere near the table. +* `docs/PROPOSER_SELECTION.md`, cited as showing the proposer choice survives held-out validation, was + computed under the disqualified `progress` head (its own banner says so). +* A reviewer would not accept the table as presented: one column is a max over 16-133 configurations + (including the scorer's own checkpoint and seed) reported on the same episodes used to select it, three + rows are one seed of 50 episodes, and the baselines are single fixed configurations. Minimum fix: report + the split-selection (held-out) number as the headline or beside it, state the arm count per row, and + drop or dagger-and-grey the single-seed rows. + +--- + +## Per-row verdict: is the win attributable to the scorer? + +Controls recomputed from the current tree with the plan_n=None/idql cells removed from the greedy pool +("clean"); paired = exact McNemar over shared (policy seed, eval seed) cells. "held-out" = the reported +arm's policy seeds 1-2 (which did not choose it) vs the best printed baseline, or the `heldout_table.py` +arm when the reported arm has one seed. + +| task | reported Δ vs best baseline (seeds) | beats no-selection ctrl? (paired p) | beats shuffled ctrl? (p) | same proposer as best baseline? | held-out Δ | VERDICT | +|---|---|---|---|---|---|---| +| Square (Sub.) [sub_20100] | +4.0 (1 seed, 50 ep, N=8; now 48.7 at 3 seeds) | NO: -1.7 (p=0.69); printed -4.0 (p=0.77) | NO: -1.0 (p=0.85) | yes (BC-u proposer, BC-u baseline) | -0.3 (heldout arm); reported arm seeds 1-2: +4.7 (p=0.32) | **proposer win / no gain** — BC-u carries it | +| Square (Cov.) | +3.2 (3 seeds) | NO: +1.6 (p=0.35) | NO: -5.3 (p=0.10) | yes (BC-expert) | +1.8 (p=0.37) | **not resolvable**; observed max ≈ null p95 | +| Piece (Sub.) | +15.1* (1 seed, 50 ep) | NO: +4.0 (p=0.82) | NO: +12.0 (p=0.33) | no (RISE-actor proposer vs BC-u baseline) | heldout arm +10.9*; 3-seed arm 46.5: +16.8 (p<0.001) / +15.1 (p<0.001), matched BC-u proposer 46-48 (2 seeds) vs 32.9 | reported row **not resolvable**; the 3-seed runner-up arm is a **method win** | +| Piece (Cov.) | +25.1* (3 seeds; +20.3 vs greedy RISE actor) | YES: +17.1 (p<0.001), clean greedy 29.7 | YES: +15.7 (p<0.001; control is a different scorer config) | no (RISE actor vs BC-u); matched BC-u: 49.0 vs 25.6 (1 seed) | +25.0* (reported arm), +10.0* (heldout arm) | **method win** | +| Mug (Sub.) | +4.2* (3 seeds) | YES: +6.0 (p=0.001) | YES: +4.4 (p=0.027; different config) | yes (BC-expert) | +5.1* (reported arm seeds 1-2: 12.0 vs 6.9); heldout arm +3.1 (n.s.) | **method win (small)**; note M_s1 chosen over M | +| Thread (Cov.) | +5.4* (3 seeds, 1950 ep) | YES: +5.3 (p<0.001) | YES: +4.2 (p<0.001; matched config for 1350/1800 ep) | yes (BC-expert) | +6.1* (seeds 1-2: 19.2 vs 13.1) | **method win** | +| Piece-tip (Cov.) | +5.9* (1 seed, 50 ep) | NO: +8.0 (p=0.125) | NO: +8.0 (p=0.125) | no (RISE actor vs RISE critic) | heldout arm +1.1 (n.s.); 3-seed arm 5.8: +4.8 / +5.2 (p<0.001), vs RISE 2.1 | reported row **not resolvable**; 3-seed arm is a **method win on ~1 % base rates** | + +**Answer.** Under matched reward and matched randomness, the RSM *method* demonstrably beats the baselines on +**3 of 7 rows as printed** (Piece (Cov.), Mug, Thread — all with the scorer beating its own proposer and the +random-candidate control at p<0.05 and surviving held-out seeds). **None of the three single-seed rows +(Square (Sub.), Piece (Sub.), Piece-tip) is resolvable from its printed number**; two of them (Piece (Sub.), +Piece-tip) have a verified 3-seed arm that is a method win at a lower score, which the table should print +instead. **Square (Sub.) and Square (Cov.) show no scorer effect.** So the honest count is 3 (5 if the +3-seed arms replace the single-seed maxima), not 7. + +--- + +## Overall fairness verdict + +Reward: **matched** (A1-A5), with the README describing the wrong mechanism. Randomness: **matched per +seed** in env seed, initial states, horizon, end_on_success and RNG derivation (B1, B5), with one budget +mismatch (B3) and a symmetric seed defect (B4). Statistics and disclosure: **not fair as presented** — the +"greedy" RISE pool includes RISE's own critic-ranked rollouts (B1-a), the shuffled control is not the +reported arm's scores (C1), three headline rows are 50-episode single-seed maxima over 16-133 arms with the +search size understated by 2-8x (E1), the matched-proposer table is an unpaired max over up to 98 arms +(D1), and the successor model is never re-seeded across "seeds" (B4). The 7/7 headline is not supported; +3/7 is. + +## Required fixes (ordered) + +1. `verdict_table.py:119-122`: classify `plan_n=None` + `policy_mode='idql'` on S0A/S0Aidql as the + critic arm (or drop those files); they are RISE's released N=128 critic rollout, not greedy. Re-derive + every pooled greedy rate and stop relying on glob order for the paired test. +2. Replace the three single-seed flagship rows with the best >= 2-seed arm (or wait for the top-up) and + print the seed count of every RSM cell; do not print a 50-episode cell in bold beside 900-episode cells. +3. Report the search size over *all* arms evaluated (16/28/133/82/41/85/35), including checkpoints and + successor seeds, and put the held-out (`heldout_table.py`) number in or beside the paper table. +4. Make the shuffled control use the reported arm's own scorer config, or rename it "random-candidate + control" and fix README/caption ("identical scores"). +5. Square (Sub.): use N=128 like every other row or state N=8 in the row. +6. Fix seed plumbing (gen_q#260) for the critics *and* retrain the successor per seed (M/M_s1/M_s2 exist + for M only); until then the caption must say the scorer is one network across seeds. +7. Add "RISE actor, greedy" (S0A, N=1) as a printed baseline — it is the strongest reward-trained policy + on Piece (Cov.) — or justify its exclusion. +8. Matched-proposer table: fix one pre-chosen arm per task, use the same (policy seed, eval seed) cells for + all three columns, pair the test, and show seed counts. The current values are stale relative to the tree. +9. Equalise episodes per cell across columns (or print n per column) and key arms on `plan_particles`. +10. README/brief: `self.r` comes from `ep_success = rewards.max()>0`, not `ep_demo`; note the 90/10 + episode split RSM trains on versus 100 % for the critics. diff --git a/gen_q_rsm/rsm_rise/pipeline/audit/AUDIT_codex.md b/gen_q_rsm/rsm_rise/pipeline/audit/AUDIT_codex.md new file mode 100644 index 0000000000000000000000000000000000000000..997b9812ce98ecb76e397a51c3b7c1281b469e62 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/audit/AUDIT_codex.md @@ -0,0 +1,451 @@ +# Fairness audit: RSM × RISE flagship comparison + +Auditor: **codex**. Date: **2026-09-21 UTC**. Read-only audit; the only file written by this audit is this report. + +The comparison is **not fair as presented**. Binary reward-label parity largely survives inspection, but the cell loader mixes critic identities and epochs, merges different RSM scoring configurations, admits a diagnostic with a different success criterion, and does not construct a matched evaluation panel. The advertised matched-proposer experiment does not match seeds or candidate draws. Selection-bias diagnostics exist, but they do not correct the flagship estimates or significance stars. + +Evidence below comes from source code, evaluation JSONs, saved training configurations, bounded reward/action slices, and checkpoint metadata. Documentation and generated tables are used only to identify what is being claimed. + +Path abbreviations used in file:line references: + +- **W** = /proj/dmfexp/zwhong/rsm_rise +- **P** = /proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline +- **R** = /proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero + +The audited saved tables are P/output/flagship_table.tex and P/output/MASTER_TABLE.md, both with modification time **2026-09-21 04:05:55 UTC**. Their SHA-256 hashes at inspection were, respectively, **ab451f91643b5c4939021542f7eb89a34336d678e1db902cf4d82d0fc92e8570** and **9e21b00141ebaf2a584e6afab8979ba6e2c67cc0500b398fa4e071f77fb52f57**. + +Evaluation files continued arriving during the audit. The inventories below record the read snapshots around 04:18–04:24 UTC, rather than pretending they reconstruct the exact 04:05 table snapshot. The saved tables have no immutable input manifest. Where newer cells changed an arm's score, both the saved claim and the observed data are identified explicitly. No table generator, evaluation, training, or job launcher was run. + +The loader audit imported only verdict_table and independently reconstructed its file admission/classification rules; the reconstructed complete cell dictionary was asserted equal to verdict_table.cells for each flagship task. HDF5 reads used at most 512 reward values per slice and individual action rows, never whole HDF5 files or image arrays. Checkpoint inspection read only the approximately 8 KB ZIP data.pkl metadata member, with tensor/storage reconstruction replaced by inert placeholders; no model tensors were loaded. + +## A1. RISE and IDQL critic reward targets + +**Verdict: VERIFIED for the actual stored labels and critic consumption.** + +All 17 relevant HDF5 files were checked: seven raw files, the square_sub_20100 derived union, the mug next_obs copy, and eight expert-only derived files including the released square parent. Every reward dataset was scanned in bounded slices. **Zero episodes had nonbinary rewards or rewards varying within an episode.** + +| Task | Union file actually selected by run_train.sh | Reward-1 episodes | Reward-0 episodes | Frames | +|---|---|---:|---:|---:| +| square_sub_20100 | W/data/derived/square_sub_20100.hdf5 | 20 | 100 | 39,473 | +| square_expert_play | W/data/raw/square_expert_play.hdf5 | 200 | 224 | 154,446 | +| two_piece_expert_suboptimal | W/data/raw/two_piece_expert_suboptimal.hdf5 | 20 | 100 | 27,859 | +| two_piece_expert_play | W/data/raw/two_piece_expert_play.hdf5 | 200 | 199 | 121,809 | +| mug_expert_suboptimal | W/data/derived/mug_expert_suboptimal_nextobs.hdf5 | 20 | 100 | 41,739 | +| threading_expert_play | W/data/raw/threading_expert_play.hdf5 | 250 | 200 | 114,935 | +| two_piece_expert_play_tipping | W/data/raw/two_piece_expert_play_tipping.hdf5 | 200 | 504 | 189,372 | +| square_expert_suboptimal, released parent | W/data/raw/square_expert_suboptimal.hdf5 | 100 | 100 | 54,275 | + +The raw mug file also has 20/100 episodes and 41,739 frames. Its positive episode keys and all episode lengths equal those of the derived next_obs file. Every expert-only file contains only constant reward 1; its episode count and identity checks are in A2/A5. + +[run_train.sh:15](/proj/dmfexp/zwhong/rsm_rise/scripts/run_train.sh:15) selects the raw datasets; lines 34 and 44 select the square variant and any next_obs replacement. Saved policy config.json files confirm these train.data paths, not just the launcher defaults. All inspected policy configurations use algo_name = "idql", including S0A, S0B, S3H1, and S0Aidql. Thus idql.py is the operative critic implementation, despite the iql_diffusion training command name. + +[relabel_rewards.py:39](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/data_manager/relabel_rewards.py:39) has optional copying and monotonic-shaping branches, so the filename alone would not establish constant labels. The constant branch at line 53 writes ones_like(rewards) × const_reward; the actual arrays above establish that the present datasets have the claimed constant binary labels. Historical original relabel invocations cannot be recovered from these arrays alone. + +The trainer passes dataset keys and use_bc into robomimic; [train_robomimic.py:501](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/training/train_robomimic.py:501) sets the actual data path. [idql.py:251](/proj/dmfexp/zwhong/rsm_rise/code/rise_robomimic/robomimic/algo/idql.py:251) slices the rewards without relabeling, and lines 376–387 use: + + q_target = rewards + (1 - dones) * discount * target_vf_pred + +The discount multiplies the bootstrap term, not the immediate provenance label. The corresponding iql_diffusion.py paths do the same at lines 246 and 399–410. In the operative IDQL implementation, augmented-data epochs skip critic updates entirely (idql.py:280, 309–326). Consequently the augmentation's copied neighbor labels do not become shaped critic targets. + +This verifies shared **label semantics**. It does not imply identical objectives, data splits, or fitted value functions. + +## A2. ep_demo identity and the RSM membership reward + +**Verdict: VIOLATED as stated. The actual unmasked reward-label correspondence is VERIFIED.** + +The brief's asserted ep_demo implementation does not exist in the dense path. [data.py:72](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py:72) loads ep_demo, but lines 158–163 test **ep_success**, then assign 1 to every frame of that episode. ep_demo is used in the separate subgoal/subgoal_ind branch at lines 153–154. + +The cache builder makes this distinction explicit in executable code: [relabel_dino.py:183](/proj/dmfexp/zwhong/rsm_rise/scripts/relabel_dino.py:183) builds ep_success from HDF5 rewards.max() > 0; lines 238–240 save ep_success and an **all-false ep_demo**. + +| Cache/task | Episodes | ep_demo.sum() | ep_success.sum() | ep_src positive set equals A1 reward-1 set? | +|---|---:|---:|---:|---| +| square_sub_20100 | 120 | 0 | 20 | Yes | +| square_expert_play | 424 | 0 | 200 | Yes | +| two_piece_expert_suboptimal | 120 | 0 | 20 | Yes | +| two_piece_expert_play | 399 | 0 | 200 | Yes | +| mug_expert_suboptimal | 120 | 0 | 20 | Yes | +| threading_expert_play | 450 | 0 | 250 | Yes | +| two_piece_expert_play_tipping | 704 | 0 | 200 | Yes | +| square_expert_suboptimal, parent | 200 | 0 | 100 | Yes | + +For every cache, ep_task has the sole value 0. The complete ep_src set equals its union HDF5 episode-key set, with no episode-length mismatches. First and last action rows were compared for **all 2,537 cached episodes** across the seven flagship datasets and released square parent: zero mismatches within float32 tolerance. This checks actual episode correspondence beyond agreeing counts. + +The square_sub_20100 positive set is exactly: + + demo_2, demo_7, demo_8, demo_13, demo_16, demo_22, demo_24, demo_26, + demo_30, demo_33, demo_53, demo_54, demo_55, demo_73, demo_75, + demo_78, demo_86, demo_92, demo_93, demo_95 + +Those same keys occur in the derived union, the derived expert-only file, and the cache's ep_success-positive ep_src entries. [build_square_sub_20_100.py:16](/proj/dmfexp/zwhong/rsm_rise/scripts/build_square_sub_20_100.py:16) selects them; [build_sq20100_cache_slice.py:60](/proj/dmfexp/zwhong/rsm_rise/scripts/build_sq20100_cache_slice.py:60) checks their identities before slicing. + +There is an additional data-budget distinction: RSM holds out 10% of episodes using data.py:96–101, whereas the inspected critic configurations have train.hdf5_filter_key = null and train on the full union. For the saved flagship successor models, RSM training episode/positive counts are respectively **108/16, 382/181, 108/17, 360/179, 108/19, 405/230, 634/179** in flagship task order. This does not change a retained episode's label or grant extra positives to RSM, but “exactly the same training episode set” would also be inaccurate. + +## A3. Effect of the admissibility mask + +**Verdict: VERIFIED that the selected flagship checkpoints have no mask-induced reward mismatch. The mask would change dense rewards if enabled.** + +[data.py:65](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py:65) changes ep_success to ep_success & keep **before** constructing self.r. Because dense reward construction subsequently tests ep_success at line 159, dropping a positive episode would change all its frame labels from 1 to 0. It is incorrect to say this mask affects only unrelated bookkeeping. + +However, the actual seven saved flagship successor checkpoints all record: + + config.reward_mode = "dense" + config.reward_loss = "bce" + config.success_mask = "" + +Their cache paths point to the correct task caches, including cache/square_sub_20100. Their positive counts before/after applying their recorded configuration are **20/20, 200/200, 20/20, 200/200, 20/20, 250/250, 200/200**. No admissibility mask was active in these artifacts. The selected checkpoint metadata is enumerated in A4. + +Therefore this suspected mismatch is **not present** in the audited flagship. Future masked runs must not be assumed reward-matched merely because their filename is classified as membership. + +## A4. Dense/BCE versus privileged progress or completion heads + +**Verdict: VERIFIED for the saved flagship columns.** + +[rr_rsm.sh:89](/proj/dmfexp/zwhong/rsm_rise/scripts/rr_rsm.sh:89) passes --reward-mode dense --reward-loss bce. The actual checkpoint metadata confirms both arguments and an empty success_mask: + +| Task | Successor checkpoint under W/runs/ | Saved step | Successor seed | Metadata bytes read | +|---|---|---:|---:|---:| +| square_sub_20100 | square_sub_20100/rsm/M/ckpt_best.pt | 100000 | 0 | 8,079 | +| square_expert_play | square_expert_play/rsm/L40/ckpt_best.pt | 60000 | 0 | 8,058 | +| two_piece_expert_suboptimal | two_piece_expert_suboptimal/rsm/M/ckpt_s100000.pt | 100000 | 0 | 8,057 | +| two_piece_expert_play | two_piece_expert_play/rsm/L40/ckpt_best.pt | 30000 | 0 | 8,035 | +| mug_expert_suboptimal | mug_expert_suboptimal/rsm/M_s1/ckpt_best.pt | 75000 | 1 | 8,074 | +| threading_expert_play | threading_expert_play/rsm/M/ckpt_s100000.pt | 100000 | 0 | 8,033 | +| two_piece_expert_play_tipping | two_piece_expert_play_tipping/rsm/M/ckpt_best.pt | 10000 | 0 | 8,088 | + +Here “dense” means the **binary episode label is present on every frame**, rather than only terminal frames. It does not mean a distance/progress potential. More precisely, this is binary classification, not continuous privileged shaping: [train_rsm.py:538](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/train_rsm.py:538) applies class-balanced BCE to r_now for dense targets. Class weighting changes the fitting objective/calibration; it does not introduce a different label source. + +[verdict_table.py:130](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/verdict_table.py:130) classifies ckpt_proghead* as rsm:progress and ckpt_goalhead* as rsm:completion. [flagship_latex.py:187](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_latex.py:187) considers only rsm:membership, including for its BC-unified matched table at lines 308–312. master_table.py:245–268 separates the three head categories. + +The evaluated rsm_ckpt fields for the saved flagship recipes point to the seven checkpoints above, with no proghead or goalhead path. New live maximums observed during the audit also remained in membership. No privileged progress/completion checkpoint contribution to a flagship score was found. This finding does **not** validate the incompatible readouts pooled under some of these checkpoint names; see C1. + +## A5. BC, BC-unified, and the expert-only subset + +**Verdict: VIOLATED for the blanket assertion that both training pipelines ignore rewards. BC loss independence and the S3H1 episode subset are VERIFIED.** + +[run_train.sh:53](/proj/dmfexp/zwhong/rsm_rise/scripts/run_train.sh:53) sets use_bc for S0B; lines 68–69 do so for S3H1 and select the expert-only derived file. Saved configs confirm algo.use_bc = true. The operative idql.py:312–326 skips critic computation/update in that path, and its actor loss at lines 529–535 is diffusion BC loss. The alternative iql_diffusion.py:578–582 likewise takes an unweighted BC loss when use_bc is true. + +The expert-only derived sets contain exactly **20, 200, 20, 200, 20, 250, 200** episodes in flagship task order, matching A1's positive episode sets. The released square parent has 100. Complete episode-key equality and lengths were checked; first/last action rows for every one of these **1,010 expert episodes including the parent** exactly match their union sources. The stored filter key is null, so no additional training mask silently removes members of these expert subsets. + +**The counterexample is S0B augmentation.** In all six non-variant flagship tasks, its saved configs set both augment_nearby_states/action_augmentation and advanced_augmentation to true. For example: + +- W/runs/square_expert_play/policy/S0B_seed0/square_expert_play_S0B_s0/20260918122807/config.json:58–63 records augmentation enabled, with different expert/play cutoff thresholds. +- [dataset.py:626](/proj/dmfexp/zwhong/rsm_rise/code/rise_robomimic/robomimic/utils/dataset.py:626) branches on whether all rewards equal zero to construct expert versus play neighbor pools. +- Lines 658–683 construct play-to-expert augmentation using those reward-defined pools. +- [train_robomimic.py:241](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/training/train_robomimic.py:241) switches to those augmented examples on even epochs. + +Changing the reward labels can therefore change BCU's training examples, even though they never weight its loss. The square_sub_20100 variant disables augmentation and does not have this dependence. S3H1 also disables augmentation, so its learning loss ignores rewards after selecting the expert subset. + +The caption's “BC and BC-u use no reward by construction” is too strong. An accurate description is: **no critic/reward-weighted actor loss; BCU additionally uses provenance-dependent augmentation on six tasks**. The saved S3H1/S0B policies also retain spectral_norm_policy = true; these are the configured unified controls, not plain unregularized diffusion BC. + +## B1. Environment randomness, resets, and evaluation grid + +**Verdict: VIOLATED as a complete matched-panel claim. The recorded canonical configuration fields match among admitted methods.** + +For the baseline columns and the saved flagship RSM recipes, admitted JSONs have **rollout_horizon = 400**, **end_on_success = true**, and eval_seed values drawn from **{0,1,2}**. Within each task there is one recorded full env dictionary across the inspected flagship/baseline files, not merely one matching x/y range. + +| Task | Relevant recorded init_obj_range | reset_states_file | +|---|---|---| +| Square (Sub.) | SquareNut: [0,0.12], [-0.225,0] | null | +| Square (Cov.) | SquareNut: [-0.115,-0.09], [-0.12,0.11] | null | +| Piece (Sub.) | Piece1: [-0.22,0], [0,0.22]; rotation [1.3708,1.7708] | null | +| Piece (Cov.) | Piece1: [-0.22,0.22], [-0.22,0.22]; rotation [1.5708,1.5708] | null | +| Mug (Sub.) | Inherited SquareNut entry: [0,0.12], [-0.225,0]; custom_obj_init=false | null | +| Thread (Cov.) | Needle: [-0.2,0.12], [0.05,0.25]; rotation [-2.0943951,-1.0471976] | null | +| Piece-tip (Cov.) | Same Piece1 range as Piece (Cov.) | W/data/derived/two_piece_tipped_init_states.json | + +The tipped reset file contains **104 initial states**. [eval.py:824](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/eval/eval.py:824) uses RandomState(eval_seed) to draw episode reset indices from this pool. Other methods use the same make_env seed route at eval.py:58–62 and the common setup_experiment seed at eval.py:500. For Mug, the inherited “SquareNut” field is not a meaningful mug placement box; equality of that field alone would not establish placement equivalence. + +The pinned CANON ranges at verdict_table.py:44–46 match the square-coverage and piece-coverage records; the other tasks use the modal recorded region from lines 85–98. The launch choices in W/scripts/launch_flagship_topup.py:35–42 agree with the named task environments. The auto-selected region is not a permanent specification: its tally is recomputed from mutable files. + +**The required complete grid is absent.** There are no admitted epoch-5000 IDQL-critic cells on five flagship tasks; Square (Sub.) also has no RISE-critic cells. Piece (Cov.) IDQL has policy seeds 0 and 2 only. Piece (Sub.) IDQL has only eval_seed=2 for policy seed 1. Saved single-seed RSM winners were not evaluated on the same grid as their three-seed baselines. C1 gives the complete per-cell episode inventory, including zeros. + +**More seriously, matching env JSON is insufficient here: a different success criterion is actually pooled.** Both files below enter the Piece (Sub.) BCU baseline at policy seed 2, eval seed 0: + +- W/runs/two_piece_expert_suboptimal/eval/patchchk_S0B_seed2_ep5000.json: **14/30 successes**. +- W/runs/two_piece_expert_suboptimal/eval/patchchk_dz05_S0B_seed2_ep5000.json: **4/30 successes**. + +They have identical recorded env dictionaries, the same eval_ckpt, horizon 400, and end_on_success=true. The latter's actual launch is recorded at **W/logs/lsf/rr_ev_patchchk_piecesub_dz.1770920.out:1203** and invokes rr_eval_piece_dz_ab.sh. That script's line 2 exports **RSM_RISE_PIECE_DZ_TOL=0.05**. [three_piece_assembly.py:819](/proj/dmfexp/zwhong/rsm_rise/code/mimicgen_environments/mimicgen_envs/envs/robosuite/three_piece_assembly.py:819) uses it to impose an additional z-distance success condition. The default run's launch at W/logs/lsf/rr_ev_patchchk_piecesub.1770849.out:1203 uses eval_cell.sh directly. + +verdict_table.cells neither records nor filters this difference. Thus the same baseline pool contains measurements under different definitions of success. Exact historical simulator initial-state equality for non-pool runs is also **UNVERIFIABLE** from these JSONs: per-episode initial-state identifiers/hashes are not recorded. + +## B2. Policy/checkpoint epochs and seed identity + +**Verdict: VIOLATED for the complete method identity; proposer epochs alone are VERIFIED.** + +[verdict_table.py:113](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/verdict_table.py:113) extracts the proposer family and policy seed from eval_ckpt and rejects proposer epochs other than 5000. The inspected admitted proposer paths all obey this rule and use the appropriate family_seed{k} directory. No mixed proposer epoch was found in the LaTeX loader. + +But the critic arm key at lines 123–124 contains only ("critic", "N=128"). It does **not** retain or validate planner_overrides.rsm_ckpt. The column is then named from the proposer family. Consequently an S0A proposer ranked by an early **S0Aidql** critic is pooled into “RISE”: + +| Admitted file under W/runs/ | Proposer | Critic in planner_overrides.rsm_ckpt | eval_seed | Successes | +|---|---|---|---:|---:| +| two_piece_expert_suboptimal/eval_sameprop/S3H4-N128-IDQLCRIT-onflag-sS0As0.json | S0A_seed0, epoch 5000 | S0Aidql_seed0/.../20260919101826/models/model_epoch_1500.pth | 0 | 11/50 | +| two_piece_expert_play/eval_sameprop/S3H4-N128-IDQLCRIT-onflag-sS0As0.json | S0A_seed0, epoch 5000 | S0Aidql_seed0/.../20260919105016/models/model_epoch_3000.pth | 0 | 2/50 | +| two_piece_expert_play_tipping/eval_sameprop/S3H4-N128-IDQLCRIT-onflag-sS0As0.json | S0A_seed0, epoch 5000 | S0Aidql_seed0/.../20260919193332/models/model_epoch_500.pth | 0 | 3/50 | + +All three have plan_n=128, plan_rule="argmax", and rsm_backend="iql". The same RISE pools also contain S0A epoch-5000 critics. This is an actual method/epoch mixture, not a cosmetic filename issue: rsm_planner.py:212–218 loads the external critic when rsm_ckpt is supplied. + +The Markdown generator additionally bypasses the epoch-5000 loader. [master_table.py:181](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/master_table.py:181) obtains interim **greedy** IDQL values from other epochs, without the canonical horizon/region filter; lines 227–231 independently admit eval_riseonline files. Its shared formatting lambda at line 278 uses the IDQL interim note for any missing numeric baseline. This explains why the saved Square (Sub.) row shows **52.0 @ep3000 (interim)** in both IDQL and RISE even though the proper loader has neither critic column. The LaTeX table instead prints dashes. + +Thus the premise that verdict_table is the sole place all displayed cells are filtered/pooled is false for MASTER_TABLE.md. + +**The loader also misclassifies native RISE ranking as greedy.** It turns a null plan_n into 1 at verdict_table.py:119, but [eval.py:364](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/eval/eval.py:364) distinguishes explicit plan_n from null. With null and policy_mode="idql", lines 373–381 select RobomimicSamplingRolloutPolicy. That wrapper draws **128 candidates** at robomimic_sampling_rollout_policy.py:63 and ranks them with the policy's IQL critics at lines 97–114. For example, W/runs/two_piece_expert_play/eval/S0A_seed0_es1.json has plan_n=null, policy_mode="idql", S0A_seed0 at epoch 5000, eval_seed=1, and 2/100 successes: this is ranked evaluation, not greedy. Across Piece (Sub.), Piece (Cov.), Mug, Thread, and Piece-tip, **900 episodes per task (4,500 total)** follow this native path but are placed in the loader's RISE-policy greedy pools. They are excluded from its main RISE-critic column and contaminate its no-selection controls. + +## B3. Candidate budget and selection rule + +**Verdict: VIOLATED for uniform N=128; no selected method was found to receive more than 128 candidates.** + +All files explicitly classified into the IDQL/RISE critic columns use **plan_n=128, plan_rule="argmax", rsm_backend="iql"**. The BC/BCU greedy columns use explicit plan_n=1 or null with policy_mode="bc", which takes the single-sample route. Null plan_n is **not universally equivalent to greedy**: native RISE evaluation can still rank 128 candidates through its outer wrapper, a distinction the loader misses (B2). + +The saved flagship RSM candidate budgets are: + +| Task | Saved recipe | N | +|---|---|---:| +| Square (Sub.) | M@best, beta .9, depth 2, S0B | **8** | +| Square (Cov.) | L40@best, beta .9, depth 2, S3H1 | 128 | +| Piece (Sub.) | M@s100000, beta .95, depth 2, S0A | 128 | +| Piece (Cov.) | L40@best, beta .98, depth 8, S0A | 128 | +| Mug (Sub.) | M_s1@best, beta .95, depth 1, S3H1 | 128 | +| Thread (Cov.) | M@s100000, beta .9, depth 1, S3H1 | 128 | +| Piece-tip (Cov.) | M@best, beta .95, depth 4, S0A | 128 | + +The saved Square (Sub.) 52% comes from **26/50** in W/runs/square_sub_20100/eval_flagtopup/E1-Mb-R0.90-2-N8-argmax-SQRECIPE-es0-sS0Bs1.json. Its fields are eval_seed=0, S0B_seed1/model_epoch_5000.pth, plan_n=8, plan_rule="argmax", beta=.9, depth=2. + +The smaller N does not give RSM extra samples, but the claimed common candidate budget is false, and N was part of the selection search. The matched table's “N=128” header is also false for this row and for the Mug RSM arm that supplied its original 8% (N=16; see D1). + +## B4. Fixed network initialization and seed disclosure + +**Verdict: VERIFIED for the audited evaluated policy cohort, with a source-version boundary.** + +All **65 distinct saved policy configurations** associated with the inspected admitted baseline/flagship proposer paths have train.seed=1: + +| Task | Saved policy configurations checked | train.seed values | +|---|---:|---| +| Square (Sub.) | 6 | 1 | +| Square (Cov.) | 9 | 1 | +| Piece (Sub.) | 12 | 1 | +| Piece (Cov.) | 11 | 1 | +| Mug (Sub.) | 9 | 1 | +| Thread (Cov.) | 9 | 1 | +| Piece-tip (Cov.) | 9 | 1 | + +These cover every evaluated family/seed present, not just S0A. For example, the S0B Square (Cov.) config named in A5 records seed=1 at line 75, as does W/runs/two_piece_expert_suboptimal/policy/S0Aidql_seed0/two_piece_expert_suboptimal_S0Aidql_s0/20260920025209/config.json:75. S3H1 saved configurations use the same value. + +[train_robomimic.py:57](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/training/train_robomimic.py:57) seeds NumPy and Torch from train.seed before constructing the model at line 133. The defect is symmetric across this evaluated policy cohort. It is not evidence that RSM received independent proposer initializations while baselines did not. + +The saved LaTeX caption at P/output/flagship_table.tex:13–18 explicitly states that action draws/environment initial conditions vary while initialization is fixed, and does not describe these as independently initialized training runs. The separately trained successor is also held fixed within an arm; its model seed is a separate search choice, as A4 shows. + +**Current source has already changed.** train_robomimic.py:629–641 now copies exp.seed into train.seed. Newer, unevaluated/resumed configurations with values 0 and 2 exist in some run directories. They were not the 65 configurations above. Therefore “train.seed is always 1” is true of the audited evaluated cohort, not of all current or future training code/runs. Future tables must distinguish cohorts and resume provenance rather than inherit the old caption automatically. + +Finally, the displayed SE groups by the checkpoint's policy-seed directory, while action/environment seeding uses eval_seed. Those are two different axes. Fixed initialization plus different saved policies, nondeterminism, resume histories, and unequal eval coverage is not a clean estimate of initialization variance. + +## B5. Candidate-sampling randomness + +**Verdict: VIOLATED for common candidate draws; the initial scalar seed derivation is VERIFIED.** + +[eval.py:500](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/eval/eval.py:500) calls setup_experiment(..., eval=True). [experiment.py:53](/proj/dmfexp/zwhong/rsm_rise/code/rise_code/sim_pipeline/utils/experiment.py:53) selects exp.eval_seed, then seeds Python, NumPy, and Torch through lines 24–27. This initial mapping is common to all methods. + +However, the actual candidate sampler uses the **global Torch RNG**, with no generator or per-(eval seed, episode, decision) reseed: [idql.py:826](/proj/dmfexp/zwhong/rsm_rise/code/rise_robomimic/robomimic/algo/idql.py:826) draws Gaussian noise, and lines 842–846 call the diffusion scheduler without a separate generator. rsm_planner.py:298–324 samples candidates, then calls the method-specific scorer. + +Every inspected headline method has **plan_seed=-1**. [rsm_scorer.py:93](/proj/dmfexp/zwhong/rsm_rise/code/rise_robomimic/robomimic/algo/rsm_scorer.py:93) then bypasses RNG forking/restoration. Its fold/d1 scorer consumes additional global Torch random numbers for successor particles and hop noise at lines 349–352. The IQL scorer does not make those same draws. Consequently later policy sampling sees method-dependent RNG states even with identical initial eval_seed and the same proposer. plan_seed controls scorer/selection randomness, not an isolated policy sampling stream. + +Resumption is another break: eval.py:625–643 and 844–862 save/restore NumPy state for environment resets, but not the policy's Torch CPU/CUDA RNG state. Actual selected Thread files record resumes, for example W/runs/threading_expert_play/eval_prop/E1-Ms100000-R0.90-1-N128-argmax-PROP-es0-sS3H1s2.json has **resumed_from_episode=48**, num_episodes=50, eval_seed=0, plan_seed=-1. + +Thus identical eval_seed establishes a common starting seed, **not identical candidate draws or a resume-invariant rollout stream**. No direction of performance bias from this alone is established; the claimed pairing/control guarantee is what fails. + +## C1. Episode pooling, standard errors, and controls + +**Verdict: VIOLATED overall. The seed SE formula and single-seed dagger implementation are VERIFIED.** + +[flagship_latex.py:117](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_latex.py:117) implements the same arithmetic for every column: + + mean = sum(per_policy_seed_rates) / k + SE = sqrt(sample_variance(per_policy_seed_rates) / k) + +Lines 174–184 and 206–210 construct per-policy-seed rates consistently. Lines 241–255 use a binomial SE for k=1 and mark it with a dagger. The saved single-seed Square (Sub.), Piece (Sub.), and Piece-tip entries do carry that dagger. For example, Thread per-seed rates are **17.3333%, 22.8333%, 15.5%**, giving **18.5556% ± 2.20%**, which agrees with its printed 18.6±2.2. + +**The “50 episodes per cell, pooled identically” experiment does not exist.** Below, ps is the policy-seed directory and es is JSON eval_seed. Each triple gives the accumulated episode counts at es=0/1/2; zero means absent. These are observed loader counts, not requested rollout counts. RSM rows retain the recipes in the saved table even where newer cells have changed their means. + +| Task | Column | ps=0: n at es=0/1/2 | ps=1: n at es=0/1/2 | ps=2: n at es=0/1/2 | Total | +|---|---|---|---|---|---:| +| Square (Sub.) | BC | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Square (Sub.) | BCU | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Square (Sub.) | IDQL | 0/0/0 | 0/0/0 | 0/0/0 | 0 | +| Square (Sub.) | RISE | 0/0/0 | 0/0/0 | 0/0/0 | 0 | +| Square (Sub.) | RSM, saved arm | 50/50/50 | 50/0/0 | 0/0/0 | 200 | +| Square (Cov.) | BC | 200/50/50 | 200/50/50 | 200/50/50 | 900 | +| Square (Cov.) | BCU | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Square (Cov.) | IDQL | 0/0/0 | 0/0/0 | 0/0/0 | 0 | +| Square (Cov.) | RISE | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Square (Cov.) | RSM, saved arm | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Piece (Sub.) | BC | 150/150/150 | 150/150/150 | 150/150/150 | 1350 | +| Piece (Sub.) | BCU | 450/250/250 | 200/150/150 | 260/150/150 | 2010 | +| Piece (Sub.) | IDQL | 150/150/150 | 0/0/100 | 100/100/100 | 850 | +| Piece (Sub.) | RISE | 250/150/150 | 250/150/150 | 250/150/150 | 1650 | +| Piece (Sub.) | RSM, saved arm | 50/0/0 | 0/0/0 | 0/0/0 | 50 | +| Piece (Cov.) | BC | 150/150/150 | 150/150/150 | 150/150/150 | 1350 | +| Piece (Cov.) | BCU | 350/150/150 | 200/150/150 | 200/150/150 | 1650 | +| Piece (Cov.) | IDQL | 100/100/100 | 0/0/0 | 0/100/100 | 500 | +| Piece (Cov.) | RISE | 200/0/100 | 200/100/100 | 200/100/100 | 1100 | +| Piece (Cov.) | RSM, saved arm | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Mug (Sub.) | BC | 150/150/150 | 200/150/100 | 100/150/100 | 1250 | +| Mug (Sub.) | BCU | 150/150/150 | 250/250/250 | 150/150/150 | 1650 | +| Mug (Sub.) | IDQL | 0/0/0 | 0/0/0 | 0/0/0 | 0 | +| Mug (Sub.) | RISE | 150/100/100 | 250/200/200 | 150/100/100 | 1350 | +| Mug (Sub.) | RSM, saved arm | 50/50/50 | 50/50/50 | 50/50/50 | 450 | +| Thread (Cov.) | BC | 300/250/250 | 150/150/150 | 150/150/150 | 1700 | +| Thread (Cov.) | BCU | 250/250/250 | 150/150/150 | 150/150/150 | 1650 | +| Thread (Cov.) | IDQL | 0/0/0 | 0/0/0 | 0/0/0 | 0 | +| Thread (Cov.) | RISE | 150/100/100 | 150/100/100 | 150/100/100 | 1050 | +| Thread (Cov.) | RSM, saved arm | 250/250/250 | 200/200/200 | 200/200/200 | 1950 | +| Piece-tip (Cov.) | BC | 100/100/100 | 150/150/150 | 150/100/150 | 1150 | +| Piece-tip (Cov.) | BCU | 150/150/150 | 100/100/100 | 100/100/100 | 1050 | +| Piece-tip (Cov.) | IDQL | 0/0/0 | 0/0/0 | 0/0/0 | 0 | +| Piece-tip (Cov.) | RISE | 200/100/100 | 200/100/100 | 200/100/100 | 1200 | +| Piece-tip (Cov.) | RSM, saved arm | 50/0/0 | 0/0/0 | 0/0/0 | 50 | + +For example, Piece (Sub.) BCU contains **27 files / 2,010 episodes**, including two 30-episode diagnostics, eleven 50-episode files, and fourteen 100-episode files. Thread RSM contains **27 files / 1,950 episodes**, with 200 or 250 episodes in a pooled cell. Square (Cov.) BC has **150-episode** files as well as 50-episode files. The saved Piece (Cov.) RSM row had only **400 episodes / 8 of 9 cells**; a ninth cell had arrived by this audit's inventory. + +The concatenation at [verdict_table.py:136](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/verdict_table.py:136) has no 50-episode requirement, episode-ID deduplication, explicit replicate identifier, or matching-panel join. Repeated files with the same (policy seed, eval seed) are simply appended in glob order. + +**An exact repeated outcome sequence is present in the Thread flagship pool.** W/runs/threading_expert_play/eval_prop/E1-Ms100000-R0.90-1-N128-argmax-PROP-es0-sS3H1s2.json and W/runs/threading_expert_play/eval_ver3/E1-Ms100000-R0.90-1-N128-argmax-VER3-es0-sS3H1s2.json have identical eval_ckpt, eval_seed=0, full env, and planner_overrides. All **50** per-episode success/return/length/first_success_step records agree exactly, including **9 successes**. Both sequences are counted, contributing 100 records and 18 successes to the 1,950-episode headline. Their different cell names and resume metadata (48 versus 0 resumed episodes) do not establish an independent sample. Full simulator trajectories were not read, so this finding concerns the stored outcome records rather than a bytewise trajectory comparison. + +**Different rankers are merged as one RSM arm.** The arm key at verdict_table.py:135 omits plan_score and plan_particles, among other behavior-changing fields: + +- Square (Cov.) L40@best beta=.9 depth=2 N=128 combines **42/300** from prob/16-particle cells with **14/150** from logit/256-particle cells, yielding the advertised **56/450 = 12.444%**. Concrete files: W/runs/square_expert_play/eval_flagtopup/E1-L40b-R0.90-2-N128-argmax-FLAGTOPUP-es2-sS3H1s2.json versus W/runs/square_expert_play/eval_oodregion/E1-L40-R0.90-2-N128-argmax-OODSWEEP2-sS3H1s2.json. +- Mug M_s1@best beta=.95 depth=1 N=128 combines **42/400** from prob/16 with **8/50** from logit/256, yielding **50/450 = 11.111%**. The latter file is W/runs/mug_expert_suboptimal/eval_win/E1-M_s1-R0.95-1-N128-argmax-WIN-sS3H1s1.json. + +Mean probability and mean logit are different ranking functions over uncertain future states; increasing particles also changes the estimator. These are not harmless display differences. + +**The paired control statistics are not correctly matched either.** verdict_table.py:125–128 collapses permuted controls to rule plus head, discarding their model/beta/depth/N. flagship_latex.py:212–214 then pairs these broad pools by ps/es, and verdict_table.py:172–173 truncates and zips prefixes without checking episode IDs. + +Actual mismatches include: + +- Square (Cov.) selected L40@best beta=.9 depth=2 is compared with permuted **M@best beta=.9 depth=1**, 600 episodes, e.g. eval_oodregion/E1-M-R0.90-1-N128-permuted-OODROW-sS3H1s1.json. +- Mug selected M_s1@best beta=.95 depth=1 is compared with permuted **M@best beta=.9 depth=2**, 450 episodes, e.g. eval_tmpflag/E1-M-R0.90-2-N128-permuted-TMPFLAG-es0-sS3H1s1.json. +- Thread's permuted pool mixes **450 episodes** from M@best beta=.95 depth=3 with **1,350 episodes** from the selected M@s100000 beta=.9 depth=1 configuration. + +Thus the “identical scores shuffled” control description is not supported by the pools tested. The RNG issue in B5 further breaks literal pairing. + +Finally, the caption's **3,400 evaluation episodes in total** is only the sum of saved RSM-column episodes: 50+450+50+400+450+1950+50. flagship_latex.py:395 sums r["eps"], assigned the RSM n at line 324. It excludes baseline episodes. The audited baseline inventory alone contains **25,210 episodes**. Also, significance stars use an episode-level two-proportion z-test despite the caption identifying policy seed as the replication unit; see C2/E1. + +## C2. Strongest-baseline delta + +**Verdict: VIOLATED as the broad strongest-baseline and displayed-difference claim. The maximum over the four defined pooled columns is computed correctly.** + +flagship_latex.py:47–50 defines BC/BCU as greedy but IDQL/RISE as critic-ranked. Lines 230–231 choose the maximum of those four pooled values, so rows with a stronger printed BC/BCU are not compared just against a weak critic. This important safeguard is present. + +There are two remaining failures. + +**1. Stronger available baseline arms are omitted.** Correct evaluator routing is necessary here; simply taking the loader's so-called greedy pools would repeat its B2 misclassification. + +- **Piece (Cov.): true greedy S0A scores 416/1,400 = 29.7143%**, using explicit plan_n=1. Its BC-unified comparator is only **423/1,650 = 25.6364%**, while the printed RISE critic is approximately 6.5% pooled. Thus a genuinely stronger greedy RISE baseline is excluded, inflating the pooled-baseline margin by about **4.1 percentage points**. One admitted example is W/runs/two_piece_expert_play/eval_final/BC-FLAG5000-S0A_seed1-es1-s0a.json: plan_n=1, policy_mode="idql" (the explicit plan_n selects the plain wrapper), S0A_seed1 at epoch 5000, eval_seed=1, **28/100** successes. +- **Piece-tip: the native RISE critic route scores 33/900 = 3.6667%**, versus **25/1,200 = 2.0833%** in the designated RISE-critic pool. Its JSONs have plan_n=null and policy_mode="idql" and are wrongly excluded as greedy. For example, W/runs/two_piece_expert_play_tipping/eval/S0A_seed0_es0.json has **5/100** successes and uses the native 128-candidate wrapper. Relative to that stronger available ranked baseline, 8% corresponds to approximately **+4.3**, rather than the saved **+5.9**. The true explicit-N=1 S0A greedy subset here scores only **8/900 = 0.8889%**; it must not be confused with the mixture labeled greedy by the loader. + +These comparisons expose omitted stronger baseline arms; they are not replacement significance tests or corrected final tables. Their episode panels also need the repairs in B1/C1. + +**2. The displayed means and delta use different estimands.** _fmt2 displays an equal-policy-seed mean at lines 245–255, but sr, bb, and the z-test/delta at lines 288–295 are episode-weighted pooled rates. + +Concrete saved-table inconsistencies at P/output/flagship_table.tex:35–38: + +- Piece (Sub.): **48.0 − 33.4 = 14.6**, but Δ prints **+15.1**. The underlying BCU pooled rate is 32.8856%, whereas its equal-seed mean is 33.3569%. +- Piece (Cov.): **51.4 − 25.3 = 26.1**, but Δ prints **+25.1**. +- Thread: **18.6 − 12.9 = 5.7**, but Δ prints **+5.4**. + +These are not rounding errors. The drift check at flagship_latex.py:342–346 explicitly compares Markdown with the hidden pooled RSM rate rather than the displayed seed mean, so it does not prevent this inconsistency. MASTER_TABLE.md's independent online/interim baseline paths introduce further differences from the LaTeX table. + +The delta should use the same estimator as the cells and name the actual strongest eligible baseline. Its uncertainty/significance must respect the replication design and selection process, not just the concatenated episode count. + +## D1. Matched-proposer table + +**Verdict: VIOLATED. Matching the S0B family is implemented; matching the experiment is not.** + +[flagship_latex.py:303](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_latex.py:303) pools **all** BC-unified greedy files, all BC-unified critic files, and independently maximizes over BC-unified membership arms. It never intersects policy/eval seeds, never requires the exact same eval_ckpt on a common panel, and never enforces N=128 for the selected RSM arm. + +A decisive counterexample is the saved Piece-tip matched row: + +- RSM **4/50 = 8%**: W/runs/two_piece_expert_play_tipping/eval_fullgrid/E1-Mb-R0.95-8-N128-argmax-FULLGRID-es0-sS0Bs0.json uses **S0B_seed0**, eval_seed=0, M@best, beta=.95, depth=8, N=128. +- IQL **2/150 = 1.333%**: the three W/runs/two_piece_expert_play_tipping/eval_matchprop/S3H4-N128-MATCHPROP-es{k}-sS0Bs1.json files use **S0B_seed1**, eval_seed=0/1/2, and an S0Aidql_seed1 epoch-5000 external critic. +- Greedy **11/1,050 = 1.0476%** pools S0B policy seeds 0/1/2. + +The RSM and IQL samples have **no common policy seed**. The IQL proposer is specifically .../S0B_seed1/two_piece_expert_play_tipping_S0B_s1/20260919082409/models/model_epoch_5000.pth; the RSM proposer is in S0B_seed0. These cannot be “the same checkpoint at the same policy/eval seed.” + +Mug gives a second independent failure. Its originally displayed matched RSM **8%** is 4/50 from W/runs/mug_expert_suboptimal/eval_parity/E1-Ms1b-R0.95-1-N16-argmax-PARITY-es0-sS0Bs0.json, using **S0B_seed0, N=16**. A newer es=1 file adds 2/50, making that arm 6/100 at the audit snapshot. The IQL matched pool is **4/300** at policy seeds **1 and 2**. Again there is no common policy seed, and the candidate counts differ. + +On Piece (Sub.), the observed live best S0B RSM arm has only policy seed 0 (72/150), whereas IQL has all three policy seeds (70/450) and greedy has 2,010 episodes. Family identity does not repair that panel mismatch. + +At overlapping cells, the proposer paths do match the corresponding S0B checkpoint, which is the correct starting point. But N=1 greedy does not sample 128 candidates, and B5 shows even the N=128 ranked methods do not preserve a shared candidate-noise stream. The saved caption at P/output/flagship_table.tex:56–64 and N=128 header at line 70 therefore overstate the experiment. The saved matched table also omits the arm recipes and seed counts needed to reconstruct historical ties/selection. + +## E1. Search size, selection correction, and presentation + +**Verdict: VIOLATED as a confirmatory fair-comparison claim. Search disclosure and a separate held-out/null report do exist.** + +The flagship is explicitly a maximum over observed outcomes: flagship_latex.py:187–205 selects the best membership recipe/proposer, allowing a one-seed maximum to outrank a better-replicated arm. The same data select and estimate the winner. No equivalent validated tuning protocol is implemented for the baseline configurations. As B2 shows, the baseline loader additionally mixes configurations unintentionally; this does not constitute a fair baseline search. + +**The master-table disclosure is materially wrong.** master_table.py:264–277 counts only arms having at least two policy seeds, but the selected flagship can have one. Lines 764–770 nevertheless say the maximum used at least two seeds. Lines 772–776 index SEARCH by the original task, so the Square (Sub.) disclosure describes the released **100/100** task instead of the flagship **20/100** variant. + +The saved P/output/MASTER_TABLE.md:114–124 claims search counts **8, 27, 16, 9, 9, 8, 6**. Its Square row even reports a 72.7% “best,” although the flagship variant reports 52%. + +A more complete, separate artifact exists: **[HELDOUT_AND_NULL.txt](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/output/HELDOUT_AND_NULL.txt)**. Its lines 12–18 report the saved search counts **16, 27, 131, 79, 37, 82, 35**. The direct loader scan found **16, 27, 131, 80, 39, 85, 35** as newer cells arrived. Even these counts are lower bounds on distinct full configurations because verdict_table collapses readout/particle differences (C1). + +**Selection correction is reported separately, but not applied to the flagship.** The saved held-out artifact contains: + +| Task | Selection score on policy seed 0 | Held-out score | Held-out episodes | Reported margin | +|---|---:|---:|---:|---:| +| Square (Sub.) | 53.3 | 47.7 | 300 | -0.3 | +| Square (Cov.) | 15.3 | 11.0 | 300 | +1.8 | +| Piece (Sub.) | 52.5 | 43.8 | 450 | +10.9* | +| Piece (Cov.) | 50.0 | 35.7 | 300 | +10.0* | +| Mug (Sub.) | 12.0 | 10.0 | 300 | +3.1 | +| Thread (Cov.) | 18.0 | unavailable | 0 | unavailable | +| Piece-tip (Cov.) | 8.0 | 3.2 | 250 | +1.1 | + +These are the artifact's values, not regenerated results. Independent arithmetic over the JSON loader reproduced the stable first five held-out values at the audit snapshot; newer Thread candidates changed its seed-0 choice, and another tipped cell changed the latter's held-out value to 4.6667% over 300 episodes. This is further evidence that no immutable reporting snapshot is attached. + +[heldout_table.py:63](/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/scripts/heldout_table.py:63) selects using key[1], the **policy seed**, not eval_seed. Lines 73–79 evaluate other policy seeds but compare against baselines pooled over **all** policy seeds, including seed 0. The same faulty cell/arm identities still apply. Moreover, a retrospective split after adaptive searches/top-ups is not evidence that the held-out data were never used to choose the candidate set or protocol. A fresh, locked evaluation is needed for that stronger claim. + +The saved null calculation reports expected maxima, including **14.2% for Mug versus observed 11.1%, 18.6% for Thread versus observed 18.5%, and 7.9% for Piece-tip versus observed 8.0%**. Five of the seven observed maxima are below that illustrative null's 95th percentile. The code at heldout_table.py:95–102 uses independent binomial draws with a common pooled rate; this is a sensitivity calculation, not a correlation-aware adjusted p-value or proof that a particular gain is spurious. + +The LaTeX flagship caption contains neither the search counts nor the held-out correction and still places uncorrected episode-level significance stars on selected maxima. Calling it “Preliminary” and flagging single seeds does not remedy that inferential mismatch. The master-table prose does acknowledge multiplicity, but its exact counts/selection description are inconsistent and the correction is not the headline estimate. + +A reviewer could reasonably accept these as **exploratory search results with useful reward-matched components**. They should not accept the present table as evidence of a controlled, unbiased, matched-proposer advantage across seven tasks. + +Minimum honest presentation: place the complete search counts, exact selected configurations, seed/cell coverage, unequal N, and held-out results beside the flagship; label maxima exploratory; remove uncorrected confirmatory stars. Minimum confirmatory protocol: fix the loader identities and controls, choose a complete configuration using development data, freeze it, and score all methods on a fresh common evaluation panel with matched budgets and a predeclared seed-level estimator. Baseline tuning should receive a comparable protocol or its asymmetry must remain explicit. + +## Overall fairness verdict + +**NOT FAIR AS PRESENTED.** + +The most important reward suspicion is substantially cleared: the unmasked RSM dense labels and critic labels identify the same provenance-positive episodes, including the 20/100 square variant. No privileged progress/completion head was found in the saved flagship, and fixed policy initialization is symmetric for the evaluated cohort. + +Those successes do not rescue the comparison. Observed failures include: + +- A stricter success-criterion diagnostic inside a baseline pool. +- “RISE” pools containing early IDQL critics, despite epoch-5000 proposer filtering, while native RISE ranking is misclassified as greedy. +- Different RSM readouts/particle counts combined into a single reported arm. +- Unequal/missing evaluation cells, a repeated 50-episode outcome sequence counted twice, and incorrect recipe matching for shuffled controls. +- Method-dependent candidate RNG streams and incomplete RNG restoration on resume. +- A matched-proposer table with disjoint policy-seed sets and incorrect N=128 claims. +- Displayed seed means paired with deltas/tests on differently weighted pooled means. +- Max-over-search headline values with incomplete search disclosure and uncorrected significance stars. + +The current evidence does not establish that every observed RSM improvement disappears after repair. It does establish that the advertised fairness and statistical interpretation are unsupported. + +## Required fixes (ordered) + +1. **Correct admitted experiment identity and freeze the evidence.** Attach an immutable per-table input manifest with JSON hashes, exact proposer/critic/successor/hop checkpoints, dataset/split identity, every behavior-changing planner field, full resolved environment and success criterion, seed axes, and episode identifiers. Exclude diagnostic success definitions and incompatible simulator/protocol versions. Separate the saved 04:05 artifact from later arrivals. + +2. **Repair baseline attribution and epoch checks.** Classify the actual rollout wrapper as well as planner_overrides: null plan_n with policy_mode=idql can be native N=128 critic ranking. Validate the critic's own checkpoint/family/seed/epoch, not just eval_ckpt. Keep S0A ranked by S0Aidql as a named ablation. Remove the independent unfiltered online/interim pooling paths or give them explicit separate columns; never fill a missing RISE cell with an IDQL greedy interim string. + +3. **Repair RSM arm keys and controls.** Include readout, particle count, mode, gamma, flow steps, calibration, and all checkpoint identities. Pair each permuted/random control with the exact selected recipe and proposer. Pair episodes by immutable identity, not glob order and truncated list prefixes. Remove duplicated outcome records and resolve repeated-run weighting explicitly. + +4. **Separate selection from evaluation.** Freeze a complete selected recipe on development data, then use genuinely untouched evaluation seeds/data for all methods. Give baselines a comparable tuning protocol or disclose its absence. Until then, present maxima as exploratory and elevate the existing held-out/null report beside them; correct the undercounted search sizes and the Square variant lookup. + +5. **Build the common evaluation panel and candidate budget.** Require the same policy/eval seed combinations, horizon, success termination, reset schedule, and predeclared episode count for all compared methods. Complete or explicitly withhold missing critic comparisons. Enforce N=128 if that is the claim; otherwise print the actual per-row N and treat N selection as part of the search. For the matched table, require the exact same S0B checkpoint and common cell set. + +6. **Isolate and restore RNG streams.** Give the proposer a dedicated RNG derived from eval seed plus episode/decision identity, independent of RSM particles, critic loading, and control shuffles; use explicit generators throughout diffusion sampling. Persist/restore all relevant RNG state on resume. “Same candidates” also requires common observed states or an explicitly defined paired candidate-evaluation protocol. + +7. **Use one estimator consistently.** Compute every displayed score and Δ with the same seed weighting and use the actual strongest eligible baseline, including a stronger greedy option. Derive uncertainty/tests from the declared replication unit and account for selection/multiplicity. Correct the episode-total caption and disclose per-method cell counts. Do not interpret a seed SE on heterogeneous configurations as replication of one arm. + +8. **Correct reward and seed disclosures without inventing a reward mismatch.** Name ep_success as the actual dense label carrier; state that ep_demo is all false and no selected success mask is active. Disclose the RSM training/validation split and class weighting. Describe BCU's provenance-dependent augmentation or use a genuinely label-independent BCU configuration if that is intended. Keep the old fixed-initialization cohort distinct from the newer seed-plumbing fix; do not silently mix resumed/new training cohorts. + +These are required changes to obtain a defensible comparison; **none was executed during this audit**. diff --git a/gen_q_rsm/rsm_rise/pipeline/audit/FAIRNESS_AUDIT_BRIEF.md b/gen_q_rsm/rsm_rise/pipeline/audit/FAIRNESS_AUDIT_BRIEF.md new file mode 100644 index 0000000000000000000000000000000000000000..375016d426fddb7aaa53574310ce6f1cdc787153 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/audit/FAIRNESS_AUDIT_BRIEF.md @@ -0,0 +1,92 @@ +# Fairness audit brief — RSM×RISE flagship table (read-only) + +You are auditing whether the flagship comparison is FAIR. Verify each claim below against CODE and DATA, +not against our documentation. For every claim report VERIFIED / VIOLATED / UNVERIFIABLE with evidence +(file:line, JSON field values, episode counts). Then give an overall verdict and the list of required fixes. +Do NOT launch jobs, modify code, or regenerate tables. Reading JSON/small files, grep, and small h5py +slices are fine; do not load whole HDF5 files or run training/eval. + +## Where things are +- Table + generators (committed): /proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_rise/pipeline/ + (README.md explains the reward, seed semantics, controls; scripts/verdict_table.py is the cell loader and + the single place cells are filtered/pooled; scripts/master_table.py + flagship_latex.py build the tables; + output/flagship_table.tex and output/MASTER_TABLE.md are the current tables) +- Working tree: /proj/dmfexp/zwhong/rsm_rise + - eval cells: runs//eval_*/*.json (fields: eval_seed, eval_ckpt, planner_overrides{plan_n, plan_rule, + rsm_backend, rsm_ckpt, plan_beta, plan_depth}, env{init_obj_range}, reset_states_file, rollout_horizon, + end_on_success, episodes[].success) + - training data: data/raw/.hdf5 (robomimic; per-episode `rewards`) + - RISE/IDQL reward relabel: code/rise_code/sim_pipeline/data_manager/relabel_rewards.py + - RISE/IDQL trainer: code/rise_code/sim_pipeline/training/train_robomimic.py; configs under + code/rise_code/sim_pipeline/configs/ (iql_diffusion*, use_bc, spectral_norm_policy, augmentation flags); + cell definitions: scripts/run_train.sh (S0A=RISE, S0B=BC-unified, S3H1=BC-expert, S0Aidql=IDQL) + - RSM successor trainer + reward: /proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/ + data.py (self.r built ~lines 133-160; `ep_demo`, `ep_success`, "admissibility mask" lines 60-72), + train_rsm.py; caches: /proj/dmfexp/zwhong/rsm_rise/cache//meta.npz (ep_demo, ep_success, ep_task) + - canonical eval regions: verdict_table.CANON; launch envs: scripts/launch_flagship_topup.py ENVS + +## A. Same reward for every reward-using method +A1. RISE (S0A) and IDQL (S0Aidql) critics train on HDF5 `rewards` written by relabel_rewards.py as a CONSTANT + per episode (1 for the expert file, 0 for the suboptimal file). Confirm on the actual files used for + training (data/raw/ + any data/derived/ used by run_train.sh) that rewards are in {0,1} and constant within + each episode, and that train_robomimic / iql_diffusion consume `rewards` unchanged (no shaping, no + success-based relabel, no discounting of the label itself). +A2. RSM `membership` head: data.py sets self.r = 1.0 on every frame of episodes flagged `ep_demo` and 0 + otherwise. Confirm ep_demo in cache//meta.npz corresponds EXACTLY to the expert-file episodes of A1 + (same episode set, same count) for each flagship task, incl. the square_sub_20100 variant. +A3. The "admissibility mask" (data.py ~67-69) drops some successes from ep_success. Determine whether it + changes self.r (the reward the successor is trained on) or only ep_success (used elsewhere). If it changes + which episodes are positive for RSM but not for the critics, the rewards are NOT matched — flag it. +A4. `reward_mode` in train_rsm.py / rr_rsm.sh is "dense" with `--reward-loss bce`: confirm "dense" here refers + to the regression target shape and NOT to the disqualified `progress` head (dense privileged shaping). + Confirm no `ckpt_proghead*` / `ckpt_goalhead*` checkpoint contributes to any flagship column + (verdict_table maps those to rsm:progress / rsm:completion; check the filter and check the pooled cells). +A5. BC (S3H1) and BC-unified (S0B): confirm training ignores rewards (use_bc=True path) and that S3H1's + "expert only" subset is the same expert set as A1's reward-1 episodes. + +## B. Same randomness per seed, for every method +B1. For each task and each eval seed k in {0,1,2}: every method's cell (greedy BC, greedy BCU, IDQL critic, + RISE critic, RSM) records the same `eval_seed` k, the same `reset_states_file` (or same env seed + derivation), the same env config / `init_obj_range` (the canonical region), the same `rollout_horizon` + (400) and `end_on_success`. Sample the JSONs that verdict_table actually pools (not just any file). +B2. Policy seeds: for seed k every method uses its own `_seed{k}` checkpoint at model_epoch_5000 + (verdict_table drops other epochs). Confirm no column mixes epochs. +B3. Candidate budget: ranked methods (IDQL critic, RISE critic, RSM) all use plan_n=128 with plan_rule=argmax + in the flagship; greedy uses plan_n=1. Confirm no method is given more candidates. (Some RSM arms use + N=8/16 — if the reported flagship arm uses N!=128, say so.) +B4. Network init: train.seed is the constant 1 for all methods/seeds (known defect, gen_q#260). Confirm it is + SYMMETRIC (same for every method) and that the table caption states what a seed varies (action draw + env + initial conditions, init fixed). A symmetric defect is fair; an asymmetric one is not. +B5. Action-draw randomness: confirm the sampling seed for the N candidates is derived from eval_seed the same + way for every ranked method (look at how eval.py / the planner seeds the policy sampler). + +## C. Same statistics +C1. 50 episodes per cell, pooled identically; SE is across policy seeds, computed the same way for every + column (flagship_latex.seed_stats); single-seed entries flagged with a dagger. +C2. The Δ column compares RSM to the STRONGEST baseline per row; confirm no row's Δ is measured against a + critic arm that scores below greedy in a way that flatters RSM. + +## D. Matched-proposer table +D1. The greedy / IQL-critic / RSM columns for a task draw candidates from the SAME S0B checkpoint at the same + (policy seed, eval seed); only the ranker differs. Verify via eval_ckpt + planner_overrides. + +## E. Disclosure +E1. RSM's flagship number is a max over many (model, beta, hops, N, proposer) arms; each baseline is one + configuration. Is the search size disclosed (master_table section "How the flagship arm was chosen", + heldout_table.py)? Is the selection-bias correction reported? Say whether a reviewer would consider the + comparison fair as presented, and what minimum disclosure or protocol change would make it so. + +## Output +Write your report to /proj/dmfexp/zwhong/rsm_rise/docs/audit/AUDIT_.md with one section per +claim (A1..E1), evidence, verdict, then "Overall fairness verdict" and "Required fixes (ordered)". +Be adversarial: assume something is unfair and try to find it. + +## F. The claim under audit: "the RSM *method* beats the baselines" +Organise the verdict around this claim, per flagship row. A win counts as a METHOD win only if it is +attributable to the scorer: (1) it beats the same proposer sampled greedily (no-selection control) and the +identical scores permuted (shuffled control) — master_table.py, McNemar paired; (2) the proposer is the same +one the baseline uses, or the win survives in the matched-proposer table; (3) the held-out estimate +(heldout_table.py --null: select on seed 0, score on seeds 1–2) still beats the baseline; (4) the reward is +matched (A1–A5). Final table: task | reported Δ | beats no-sel ctrl? (p) | beats shuffled? (p) | same +proposer? | held-out Δ | VERDICT ∈ {method win, proposer win, not resolvable, loss}. Then answer: on how +many tasks does the RSM METHOD demonstrably beat the baselines under matched reward and randomness? diff --git a/gen_q_rsm/rsm_rise/pipeline/check_closure.py b/gen_q_rsm/rsm_rise/pipeline/check_closure.py new file mode 100644 index 0000000000000000000000000000000000000000..51c3c53420223a795922f324fc347d081069d3f7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/check_closure.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +"""Static reproducibility check for the vendored pipeline: does every local import resolve inside the tree? + +Written 2026-09-21 after the vendored tree was found internally inconsistent in both directions -- table-side +code referencing a baseline whose implementation was not vendored, and a script importing +`robomimic.algo.rsm_planner` which was not vendored at all, so the vendored copy could not import. Run this +before claiming the pipeline commit reproduces anything. Third-party modules are ignored; only imports that +name a file we are supposed to ship are checked. +""" +import ast, os, sys +ROOT = os.path.dirname(os.path.abspath(__file__)) +LOCAL = {} +SIBLING = os.path.join(os.path.dirname(os.path.dirname(ROOT)), "rsm_libero") # gen_q_rsm/rsm_libero +for base in (ROOT, SIBLING): + if not os.path.isdir(base): + continue + for d, ds, fs in os.walk(base): + if "__pycache__" in d: + continue + for f in fs: + if f.endswith(".py"): + LOCAL.setdefault(f[:-3], []).append(os.path.relpath(os.path.join(d, f), ROOT)) + for sub in ds: # a directory is importable as a package here (sys.path tricks) + if sub != "__pycache__": + LOCAL.setdefault(sub, []).append(os.path.relpath(os.path.join(d, sub), ROOT)) +# modules we ship but whose imports point outside the tree on purpose (the live repo supplies them) +EXTERNAL_OK = {"robomimic", "sim_pipeline", "rsm_libero", "torch", "numpy", "h5py", "wandb", "jax", "flax", + "optax", "ml_collections", "distrax", "matplotlib", "scipy", "PIL", "av", "pyarrow", "tqdm", + "einops", "orbax", "absl", "gymnasium", "gym", "mujoco", "robosuite", "mimicgen_envs", "hydra", + "omegaconf", "transformers", "safetensors", "lerobot", "openpi", "chex", "tensorflow", + "dill", "stable_baselines3", "diffusion_policy", "imageio", "cv2", "sklearn", "pandas", + "augmax", "jaxlib", "ogbench", "d4rl", "libero", "pytest", "robomimic_genq"} +missing = [] +for name, paths in sorted(LOCAL.items()): + for rel in paths: + if not os.path.isfile(os.path.join(ROOT, rel)): # package dirs are index entries, not sources + continue + try: + tree = ast.parse(open(os.path.join(ROOT, rel)).read()) + except SyntaxError as e: + missing.append((rel, f"SYNTAX ERROR: {e}")); continue + for n in ast.walk(tree): + mods = [] + if isinstance(n, ast.Import): + mods = [a.name.split(".")[0] for a in n.names] + elif isinstance(n, ast.ImportFrom) and n.module and n.level == 0: + mods = [n.module.split(".")[0]] + for m in mods: + if m in EXTERNAL_OK or m in sys.stdlib_module_names or m in LOCAL: + continue + missing.append((rel, f"imports '{m}' which is not vendored and not declared external")) +# only report each (file, module) once +missing = sorted(set(missing)) +for rel, why in missing: + print(f"MISSING {rel}: {why}") +print(f"\n{len(LOCAL)} local modules, {len(missing)} unresolved imports") +sys.exit(1 if missing else 0) diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/__init__.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/agents/__init__.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/agents/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/agents/ifql.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/agents/ifql.py new file mode 100644 index 0000000000000000000000000000000000000000..69d9501faafe0c74377e06f3adaa8fff6915bf4f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/agents/ifql.py @@ -0,0 +1,285 @@ +import copy +from typing import Any + +import flax +import jax +import jax.numpy as jnp +import ml_collections +import optax + +from utils.encoders import encoder_modules +from utils.flax_utils import ModuleDict, TrainState, nonpytree_field +from utils.loss_utils import hl_gauss_cross_entropy, hl_gauss_from_logits, sample_beta_times +from utils.networks import MLP_CLASSES, ActorVectorField, CategoricalValue + + +class IFQLAgent(flax.struct.PyTreeNode): + """Implicit flow Q-learning (IFQL) agent. + + IFQL is the flow variant of implicit diffusion Q-learning (IDQL). + """ + + rng: Any + network: Any + config: Any = nonpytree_field() + + @staticmethod + def expectile_loss(adv, diff, expectile): + """Compute the expectile loss.""" + weight = jnp.where(adv >= 0, expectile, (1 - expectile)) + return weight * (diff**2) + + def value_loss(self, batch, grad_params): + """Compute the IQL value loss.""" + qs = self.network.select('target_critic')(batch['observations'], actions=batch['actions']) + if self.config['q_agg'] == 'min': + q = qs.min(axis=0) + else: + q = qs.mean(axis=0) + v_logits = self.network.select('value')(batch['observations'], output_logits=True, params=grad_params) + v = hl_gauss_from_logits(v_logits) + weight = jnp.where(q - v >= 0, self.config['expectile'], 1 - self.config['expectile']) + value_loss = (weight * hl_gauss_cross_entropy(v_logits, q)).mean() + + return value_loss, { + 'value_loss': value_loss, + 'v_mean': v.mean(), + 'v_max': v.max(), + 'v_min': v.min(), + } + + def critic_loss(self, batch, grad_params): + """Compute the IQL critic loss.""" + next_v = self.network.select('value')(batch['next_observations']) + discounts = batch['discounts'] if 'discounts' in batch else self.config['discount'] * batch['masks'] + q = batch['rewards'] + discounts * next_v + + q_logits = self.network.select('critic')( + batch['observations'], actions=batch['actions'], output_logits=True, params=grad_params + ) + critic_loss = hl_gauss_cross_entropy(q_logits, q).mean() + + return critic_loss, { + 'critic_loss': critic_loss, + 'q_mean': q.mean(), + 'q_max': q.max(), + 'q_min': q.min(), + } + + def actor_loss(self, batch, grad_params, rng=None): + """Compute the behavioral flow-matching actor loss.""" + batch_size, action_dim = batch['actions'].shape + rng, x_rng, t_rng = jax.random.split(rng, 3) + + x_0 = jax.random.normal(x_rng, (batch_size, action_dim)) + x_1 = batch['actions'] + t = sample_beta_times(t_rng, (batch_size, 1), self.config['betas']) + x_t = (1 - t) * x_0 + t * x_1 + vel = x_1 - x_0 + + pred = self.network.select('actor_flow')(batch['observations'], x_t, t, params=grad_params) + actor_loss = jnp.mean((pred - vel) ** 2) + + return actor_loss, { + 'actor_loss': actor_loss, + } + + @jax.jit + def total_loss(self, batch, grad_params, rng=None): + """Compute the total loss.""" + info = {} + rng = rng if rng is not None else self.rng + + value_loss, value_info = self.value_loss(batch, grad_params) + for k, v in value_info.items(): + info[f'value/{k}'] = v + + critic_loss, critic_info = self.critic_loss(batch, grad_params) + for k, v in critic_info.items(): + info[f'critic/{k}'] = v + + rng, actor_rng = jax.random.split(rng) + actor_loss, actor_info = self.actor_loss(batch, grad_params, actor_rng) + for k, v in actor_info.items(): + info[f'actor/{k}'] = v + + loss = value_loss + critic_loss + actor_loss + return loss, info + + def target_update(self, network, module_name): + """Update the target network.""" + new_target_params = jax.tree_util.tree_map( + lambda p, tp: p * self.config['tau'] + tp * (1 - self.config['tau']), + self.network.params[f'modules_{module_name}'], + self.network.params[f'modules_target_{module_name}'], + ) + network.params[f'modules_target_{module_name}'] = new_target_params + + @jax.jit + def update(self, batch): + """Update the agent and return a new agent with information dictionary.""" + new_rng, rng = jax.random.split(self.rng) + + def loss_fn(grad_params): + return self.total_loss(batch, grad_params, rng=rng) + + new_network, info = self.network.apply_loss_fn(loss_fn=loss_fn) + self.target_update(new_network, 'critic') + + return self.replace(network=new_network, rng=new_rng), info + + @jax.jit + def sample_actions( + self, + observations, + seed=None, + temperature=1.0, + ): + """Sample actions from the actor.""" + orig_observations = observations + batch_shape = orig_observations.shape[: -len(self.config['ob_dims'])] + if self.config['encoder'] is not None: + observations = self.network.select('actor_flow_encoder')(observations) + action_seed, _ = jax.random.split(seed) + + # Sample `num_samples` noises and propagate them through the flow. + sample_shape = (*batch_shape, self.config['num_samples']) + actions = jax.random.normal( + action_seed, + ( + *sample_shape, + self.config['action_dim'], + ), + ) + sample_axis = len(batch_shape) + n_observations = jnp.repeat( + jnp.expand_dims(observations, sample_axis), self.config['num_samples'], axis=sample_axis + ) + n_orig_observations = jnp.repeat( + jnp.expand_dims(orig_observations, sample_axis), self.config['num_samples'], axis=sample_axis + ) + for i in range(self.config['flow_steps']): + t = jnp.full((*sample_shape, 1), i / self.config['flow_steps']) + vels = self.network.select('actor_flow')(n_observations, actions, t, is_encoded=True) + actions = actions + vels / self.config['flow_steps'] + actions = jnp.clip(actions, -1, 1) + + # Pick the action with the highest Q-value. + qs = self.network.select('critic')(n_orig_observations, actions=actions) + if self.config['q_agg'] == 'min': + q = qs.min(axis=0) + else: + q = qs.mean(axis=0) + best_idxs = jnp.argmax(q, axis=-1) + gather_idxs = jnp.broadcast_to(best_idxs[..., None, None], (*best_idxs.shape, 1, self.config['action_dim'])) + actions = jnp.take_along_axis(actions, gather_idxs, axis=-2).squeeze(axis=-2) + return actions + + @classmethod + def create( + cls, + seed, + ex_observations, + ex_actions, + config, + ): + """Create a new agent. + + Args: + seed: Random seed. + ex_observations: Example batch of observations. + ex_actions: Example batch of actions. + config: Configuration dictionary. + """ + rng = jax.random.PRNGKey(seed) + rng, init_rng = jax.random.split(rng, 2) + + ex_times = ex_actions[..., :1] + ob_dims = ex_observations.shape[1:] + action_dim = ex_actions.shape[-1] + + if config['mlp_class'] not in MLP_CLASSES: + raise ValueError(f'Invalid mlp_class: {config["mlp_class"]}') + mlp_class = MLP_CLASSES[config['mlp_class']] + + # Define encoders. + encoders = dict() + if config['encoder'] is not None: + encoder_module = encoder_modules[config['encoder']] + encoders['value'] = encoder_module() + encoders['critic'] = encoder_module() + encoders['actor_flow'] = encoder_module() + + # Define networks. + value_def = CategoricalValue( + hidden_dims=config['value_hidden_dims'], + layer_norm=config['layer_norm'], + num_ensembles=1, + mlp_class=mlp_class, + encoder=encoders.get('value'), + ) + critic_def = CategoricalValue( + hidden_dims=config['value_hidden_dims'], + layer_norm=config['layer_norm'], + num_ensembles=2, + mlp_class=mlp_class, + encoder=encoders.get('critic'), + ) + actor_flow_def = ActorVectorField( + hidden_dims=config['actor_hidden_dims'], + action_dim=action_dim, + mlp_class=mlp_class, + layer_norm=config['actor_layer_norm'], + encoder=encoders.get('actor_flow'), + ) + + network_info = dict( + value=(value_def, (ex_observations,)), + critic=(critic_def, (ex_observations, ex_actions)), + target_critic=(copy.deepcopy(critic_def), (ex_observations, ex_actions)), + actor_flow=(actor_flow_def, (ex_observations, ex_actions, ex_times)), + ) + if encoders.get('actor_flow') is not None: + # Add actor_flow_encoder to ModuleDict to make it separately callable. + network_info['actor_flow_encoder'] = (encoders.get('actor_flow'), (ex_observations,)) + networks = {k: v[0] for k, v in network_info.items()} + network_args = {k: v[1] for k, v in network_info.items()} + + network_def = ModuleDict(networks) + network_tx = optax.adam(learning_rate=config['lr']) + network_params = network_def.init(init_rng, **network_args)['params'] + network = TrainState.create(network_def, network_params, tx=network_tx) + + params = network_params + params['modules_target_critic'] = params['modules_critic'] + + config['ob_dims'] = ob_dims + config['action_dim'] = action_dim + return cls(rng, network=network, config=flax.core.FrozenDict(**config)) + + +def get_config(): + config = ml_collections.ConfigDict( + dict( + agent_name='ifql', # Agent name. + ob_dims=ml_collections.config_dict.placeholder(list), # Observation dimensions (will be set automatically). + action_dim=ml_collections.config_dict.placeholder(int), # Action dimension (will be set automatically). + lr=3e-4, # Learning rate. + batch_size=256, # Batch size. + actor_hidden_dims=(512, 512, 512, 512), # Actor network hidden dimensions. + value_hidden_dims=(512, 512, 512, 512), # Value network hidden dimensions. + mlp_class='resmlp', # MLP class ('mlp' or 'resmlp'). + layer_norm=True, # Whether to use layer normalization. + actor_layer_norm=True, # Whether to use layer normalization for the actor. + discount=0.9999, # Discount factor. + tau=0.001, # Target network update rate. + expectile=0.5, # IQL expectile. + n_step=200, # Number of steps for bootstrapped returns. + q_agg='mean', # Aggregation method for Q values. + num_samples=32, # Number of action samples for rejection sampling. + flow_steps=10, # Number of flow steps. + betas=(1.0, 1.5), # Beta parameters for time sampling. + encoder=ml_collections.config_dict.placeholder(str), # Visual encoder name (None, 'impala_small', etc.). + ) + ) + return config diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/__init__.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/encoders.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/encoders.py new file mode 100644 index 0000000000000000000000000000000000000000..addc56a9e15d426ead7d93d81916dbf8d9ea35cc --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/encoders.py @@ -0,0 +1,108 @@ +import functools +from typing import Sequence + +import flax.linen as nn +import jax.numpy as jnp + +from utils.networks import MLP + + +class ResnetStack(nn.Module): + """ResNet stack module.""" + + num_features: int + num_blocks: int + max_pooling: bool = True + + @nn.compact + def __call__(self, x): + initializer = nn.initializers.xavier_uniform() + conv_out = nn.Conv( + features=self.num_features, + kernel_size=(3, 3), + strides=1, + kernel_init=initializer, + padding='SAME', + )(x) + + if self.max_pooling: + conv_out = nn.max_pool( + conv_out, + window_shape=(3, 3), + padding='SAME', + strides=(2, 2), + ) + + for _ in range(self.num_blocks): + block_input = conv_out + conv_out = nn.relu(conv_out) + conv_out = nn.Conv( + features=self.num_features, + kernel_size=(3, 3), + strides=1, + padding='SAME', + kernel_init=initializer, + )(conv_out) + + conv_out = nn.relu(conv_out) + conv_out = nn.Conv( + features=self.num_features, + kernel_size=(3, 3), + strides=1, + padding='SAME', + kernel_init=initializer, + )(conv_out) + conv_out += block_input + + return conv_out + + +class ImpalaEncoder(nn.Module): + """IMPALA encoder.""" + + width: int = 1 + stack_sizes: tuple = (16, 32, 32) + num_blocks: int = 2 + dropout_rate: float = None + mlp_hidden_dims: Sequence[int] = (512,) + layer_norm: bool = True + + def setup(self): + stack_sizes = self.stack_sizes + self.stack_blocks = [ + ResnetStack( + num_features=stack_sizes[i] * self.width, + num_blocks=self.num_blocks, + ) + for i in range(len(stack_sizes)) + ] + if self.dropout_rate is not None: + self.dropout = nn.Dropout(rate=self.dropout_rate) + + @nn.compact + def __call__(self, x, train=True, cond_var=None): + x = x.astype(jnp.float32) / 255.0 + + conv_out = x + + for idx in range(len(self.stack_blocks)): + conv_out = self.stack_blocks[idx](conv_out) + if self.dropout_rate is not None: + conv_out = self.dropout(conv_out, deterministic=not train) + + conv_out = nn.relu(conv_out) + if self.layer_norm: + conv_out = nn.LayerNorm()(conv_out) + out = conv_out.reshape((*x.shape[:-3], -1)) + + out = MLP(self.mlp_hidden_dims, activate_final=True, layer_norm=self.layer_norm)(out) + + return out + + +encoder_modules = { + 'impala': ImpalaEncoder, + 'impala_debug': functools.partial(ImpalaEncoder, num_blocks=1, stack_sizes=(4, 4)), + 'impala_small': functools.partial(ImpalaEncoder, num_blocks=1), + 'impala_large': functools.partial(ImpalaEncoder, stack_sizes=(64, 128, 128), mlp_hidden_dims=(1024,)), +} diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/flax_utils.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/flax_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..e2ee66a782450284101212e217ffe2e19fe280da --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/flax_utils.py @@ -0,0 +1,337 @@ +import functools +import gc +import glob +import json +import os +import pickle +import time +from typing import Any, Dict, Mapping, Sequence + +import flax +import flax.linen as nn +import jax +import jax.numpy as jnp +import numpy as np +import optax + +nonpytree_field = functools.partial(flax.struct.field, pytree_node=False) + + +class ModuleDict(nn.Module): + """A dictionary of modules. + + This allows sharing parameters between modules and provides a convenient way to access them. + + Attributes: + modules: Dictionary of modules. + """ + + modules: Dict[str, nn.Module] + + @nn.compact + def __call__(self, *args, name=None, **kwargs): + """Forward pass. + + For initialization, call with `name=None` and provide the arguments for each module in `kwargs`. + Otherwise, call with `name=` and provide the arguments for that module. + """ + if name is None: + if kwargs.keys() != self.modules.keys(): + raise ValueError( + f'When `name` is not specified, kwargs must contain the arguments for each module. ' + f'Got kwargs keys {kwargs.keys()} but module keys {self.modules.keys()}' + ) + out = {} + for key, value in kwargs.items(): + if isinstance(value, Mapping): + out[key] = self.modules[key](**value) + elif isinstance(value, Sequence): + out[key] = self.modules[key](*value) + else: + out[key] = self.modules[key](value) + return out + + return self.modules[name](*args, **kwargs) + + +class TrainState(flax.struct.PyTreeNode): + """Custom train state for models. + + Attributes: + step: Counter to keep track of the training steps. It is incremented by 1 after each `apply_gradients` call. + apply_fn: Apply function of the model. + model_def: Model definition. + params: Parameters of the model. + tx: optax optimizer. + opt_state: Optimizer state. + """ + + step: int + apply_fn: Any = nonpytree_field() + model_def: Any = nonpytree_field() + params: Any + tx: Any = nonpytree_field() + opt_state: Any + + @classmethod + def create(cls, model_def, params, tx=None, **kwargs): + """Create a new train state.""" + if tx is not None: + opt_state = tx.init(params) + else: + opt_state = None + + return cls( + step=1, + apply_fn=model_def.apply, + model_def=model_def, + params=params, + tx=tx, + opt_state=opt_state, + **kwargs, + ) + + def __call__(self, *args, params=None, method=None, **kwargs): + """Forward pass. + + When `params` is not provided, it uses the stored parameters. + + The typical use case is to set `params` to `None` when you want to *stop* the gradients, and to pass the current + traced parameters when you want to flow the gradients. In other words, the default behavior is to stop the + gradients, and you need to explicitly provide the parameters to flow the gradients. + + Args: + *args: Arguments to pass to the model. + params: Parameters to use for the forward pass. If `None`, it uses the stored parameters, without flowing + the gradients. + method: Method to call in the model. If `None`, it uses the default `apply` method. + **kwargs: Keyword arguments to pass to the model. + """ + if params is None: + params = self.params + variables = {'params': params} + if method is not None: + method_name = getattr(self.model_def, method) + else: + method_name = None + + return self.apply_fn(variables, *args, method=method_name, **kwargs) + + def select(self, name): + """Helper function to select a module from a `ModuleDict`.""" + return functools.partial(self, name=name) + + def apply_gradients(self, grads, **kwargs): + """Apply the gradients and return the updated state.""" + updates, new_opt_state = self.tx.update(grads, self.opt_state, self.params) + new_params = optax.apply_updates(self.params, updates) + + return self.replace( + step=self.step + 1, + params=new_params, + opt_state=new_opt_state, + **kwargs, + ) + + def apply_loss_fn(self, loss_fn): + """Apply the loss function and return the updated state and info. + + It additionally computes the gradient statistics and adds them to the dictionary. + """ + grads, info = jax.grad(loss_fn, has_aux=True)(self.params) + + grad_max = jax.tree_util.tree_map(jnp.max, grads) + grad_min = jax.tree_util.tree_map(jnp.min, grads) + grad_norm = jax.tree_util.tree_map(jnp.linalg.norm, grads) + + grad_max_flat = jnp.concatenate([jnp.reshape(x, -1) for x in jax.tree_util.tree_leaves(grad_max)], axis=0) + grad_min_flat = jnp.concatenate([jnp.reshape(x, -1) for x in jax.tree_util.tree_leaves(grad_min)], axis=0) + grad_norm_flat = jnp.concatenate([jnp.reshape(x, -1) for x in jax.tree_util.tree_leaves(grad_norm)], axis=0) + + final_grad_max = jnp.max(grad_max_flat) + final_grad_min = jnp.min(grad_min_flat) + final_grad_norm = jnp.linalg.norm(grad_norm_flat, ord=1) + + info.update( + { + 'grad/max': final_grad_max, + 'grad/min': final_grad_min, + 'grad/norm': final_grad_norm, + } + ) + + return self.apply_gradients(grads=grads), info + + +def save_agent(agent, save_dir, epoch, name=None): + """Save the agent to a file, atomically. + + Args: + agent: Agent. + save_dir: Directory to save the agent. + epoch: Epoch number. + name: Override the file name (used for the rolling resume checkpoint). + + The write goes to a temporary file that is then renamed. A checkpoint is multiple GB and jobs on this + cluster are killed mid-write; a half-written params_*.pkl is the worst possible failure, because resume + picks the newest checkpoint and would then crash on every relaunch. + """ + + save_dict = dict( + agent=flax.serialization.to_state_dict(agent), + ) + save_path = os.path.join(save_dir, name if name is not None else f'params_{epoch}.pkl') + tmp_path = f'{save_path}.tmp{os.getpid()}' + with open(tmp_path, 'wb') as f: + pickle.dump(save_dict, f) + f.flush() + os.fsync(f.fileno()) + os.replace(tmp_path, save_path) + + print(f'Saved to {save_path}') + + +LATEST_PARAMS = 'params_latest.pkl' +RESUME_STATE = 'resume.json' + + +def save_resume_checkpoint(agent, save_dir, step): + """Overwrite the rolling resume checkpoint (params_latest.pkl + resume.json). + + Archival checkpoints (params_.pkl) exist to be re-evaluated later, so they sit on the evaluation + grid and are kept. This one exists only so a killed job restarts near where it died, so it is written + far more often and overwritten in place -- one file per run, not one per save. + """ + save_agent(agent, save_dir, step, name=LATEST_PARAMS) + tmp = os.path.join(save_dir, RESUME_STATE + '.tmp') + with open(tmp, 'w') as f: + json.dump(dict(step=int(step), time=time.time()), f) + os.replace(tmp, os.path.join(save_dir, RESUME_STATE)) + + +def _load_state_dict_host(path): + """Unpickle a checkpoint's state dict into HOST memory, never the accelerator. + + ``jax.Array.__reduce__`` reconstructs through ``device_put(np_value)`` with no device, so a plain + ``pickle.load`` stages every leaf on the default device. That is fatal on resume: the freshly + initialised agent is already resident, so a 4096x4 arm asks the card for a second ~3 GB copy of + itself and dies with RESOURCE_EXHAUSTED inside ``pickle.load`` (the packed waves run two workers + per card at mem_frac 0.45). Pinning the default device to CPU for the unpickle keeps the + checkpoint in host RAM; the caller then frees the template's buffers before copying it back, so + peak device memory over the whole restore is one copy of the model instead of two. + """ + with jax.default_device(jax.devices('cpu')[0]): + with open(path, 'rb') as f: + load_dict = pickle.load(f) + # Uncommitted CPU arrays would be re-transferred on every jitted call; hand back plain numpy so the + # tree is unambiguously host-side until we put it back deliberately. + return jax.tree_util.tree_map(np.asarray, load_dict['agent']) + + +def _reset_opt_state(agent, state_dict): + """Replace every saved ``opt_state`` subtree with the TARGET's freshly-initialized one. + + A fork onto a DIFFERENT optax structure cannot restore the saved optimizer state. Concretely: + a parent trained with `occ_lr_mult == actor_lr_mult == 1.0` takes rsm.py's single + `optax.adam` branch, whose state serializes as a plain 2-tuple ({'0','1'}); a child that + sets `occ_lr_mult != 1.0` trips the `actor_knobs` test and builds `optax.multi_transform`, + whose state is `MultiTransformState(inner_states=...)`. `from_state_dict` then raises + + ValueError: The field names of the state dict and the named tuple do not match, + got {'0', '1'} and {'inner_states'} at path ./network/opt_state + + and the arm dies at restore having trained ZERO steps (this killed all 10 arms of wave ocOL). + The PARAMS are unaffected -- only Adam's accumulators are structurally incompatible. + + Dropping them gives a COLD Adam restart (m = v = 0), which is NOT free: with zero + accumulators the first bias-corrected update is ~lr * sign(g) on every parameter, a full-size + kick on an otherwise converged network. That transient is real, so every arm in a wave that + uses this path -- INCLUDING its control -- must take the same path, or the transient is + attributed to whatever else the arms differ in. + """ + fresh = flax.serialization.to_state_dict(agent) + + def walk(loaded, tgt): + for k, v in loaded.items(): + if k == 'opt_state' and k in tgt: + loaded[k] = tgt[k] + elif isinstance(v, dict) and isinstance(tgt.get(k), dict): + walk(v, tgt[k]) + + walk(state_dict, fresh) + return state_dict + + +def _fill_missing_opt_state(agent, state_dict): + """Re-insert any ``opt_state`` subtree the checkpoint does NOT carry, from the fresh target. + + ``tools/strip_opt_state.py`` rewrites archival ``params_.pkl`` without their Adam + accumulators: ``opt_state`` is two thirds of every checkpoint (2.02 GB of a 3.03 GB file) and is + read only when RESUMING training. A re-scored grid point is only ever rolled out, so for + ``tools/final_eval.py`` / ``tools/eval_checkpoint.py`` the accumulators are dead weight. + + ``flax.serialization.from_state_dict`` matches key sets exactly, so a stripped file otherwise dies + with ``ValueError: target dict contains keys {'opt_state'} which are not present in state dict``. + This differs from ``_reset_opt_state``, which handles a key that is PRESENT but structurally + incompatible; here the key is ABSENT. Both end at the same place -- the target's freshly + initialised accumulators -- so a stripped checkpoint restores as a COLD Adam start. That is + exactly why the stripper refuses to touch a seed's highest-step checkpoint: resuming from a + stripped file would be a real behaviour change, while re-evaluating one cannot be. + + Returns the state dict unchanged when nothing is missing, so the 8000+ unstripped checkpoints + take a byte-identical path through the loader. + """ + fresh = flax.serialization.to_state_dict(agent) + + def walk(loaded, tgt): + if not isinstance(loaded, dict) or not isinstance(tgt, dict): + return + for k, v in tgt.items(): + if k not in loaded: + if k == 'opt_state': + loaded[k] = v + continue + walk(loaded[k], v) + + walk(state_dict, fresh) + return state_dict + + +def _merge_state_dict(agent, state_dict, path): + """Load a host-side state dict into ``agent`` and return it on the default device.""" + # OC_RESTORE_PARAMS_ONLY=1 keeps the target's own fresh opt_state instead of the saved one. + # Required for any fork that changes occ_lr_mult / actor_lr_mult / actor_grad_clip / + # actor_adam_b2 away from the parent's, because those switch the optimizer STRUCTURE. + if os.environ.get('OC_RESTORE_PARAMS_ONLY', '') not in ('', '0'): + state_dict = _reset_opt_state(agent, state_dict) + print('OC_RESTORE_PARAMS_ONLY: kept fresh opt_state (COLD Adam restart)', flush=True) + # A stripped archival checkpoint carries params but no opt_state; refill it so the key sets match. + state_dict = _fill_missing_opt_state(agent, state_dict) + agent = flax.serialization.from_state_dict(agent, state_dict) # numpy leaves; template buffers now dead + del state_dict + gc.collect() # actually release the template's device buffers before allocating the restored ones + agent = jax.tree_util.tree_map(lambda x: jax.device_put(x) if isinstance(x, np.ndarray) else x, agent) + print(f'Restored from {path}', flush=True) + return agent + + +def restore_agent_file(agent, path): + """Restore the agent from an exact .pkl path (used by the resume launcher, which picks the file).""" + return _merge_state_dict(agent, _load_state_dict_host(path), path) + + +def restore_agent(agent, restore_path, restore_epoch): + """Restore the agent from a file. + + Args: + agent: Agent. + restore_path: Path to the directory containing the saved agent. + restore_epoch: Epoch number. + """ + candidates = glob.glob(restore_path) + + assert len(candidates) == 1, f'Found {len(candidates)} candidates: {candidates}' + + restore_path = candidates[0] + f'/params_{restore_epoch}.pkl' + + return _merge_state_dict(agent, _load_state_dict_host(restore_path), restore_path) diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/loss_utils.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/loss_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..f2805b955189e9df01de36454d2fa39347f32b74 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/loss_utils.py @@ -0,0 +1,56 @@ +import jax +import jax.numpy as jnp +import jax.scipy.special + + +HL_GAUSS_MIN_VALUE = 0.0 +HL_GAUSS_MAX_VALUE = 1.0 +HL_GAUSS_NUM_BINS = 101 +HL_GAUSS_SIGMA_RATIO = 0.75 + + +def sample_beta_times(rng, shape, betas): + """Sample flow times from a Beta distribution.""" + beta_a, beta_b = betas + if beta_a == 1.0: + # Use inverse CDF for Beta(1, b), which is much faster than jax.random.beta. + t_uniform = jax.random.uniform(rng, shape) + return 1 - (1 - t_uniform) ** (1 / beta_b) + return jax.random.beta(rng, beta_a, beta_b, shape) + + +def hl_gauss_bin_centers(num_bins=HL_GAUSS_NUM_BINS): + """Return HL-Gauss bin centers over [0, 1].""" + edges = jnp.linspace(HL_GAUSS_MIN_VALUE, HL_GAUSS_MAX_VALUE, num_bins + 1, dtype=jnp.float32) + return (edges[:-1] + edges[1:]) / 2 + + +def hl_gauss_targets(targets, num_bins=HL_GAUSS_NUM_BINS): + """Convert scalar targets to Gaussian-smoothed histogram targets.""" + edges = jnp.linspace(HL_GAUSS_MIN_VALUE, HL_GAUSS_MAX_VALUE, num_bins + 1, dtype=jnp.float32) + bin_width = (HL_GAUSS_MAX_VALUE - HL_GAUSS_MIN_VALUE) / num_bins + sigma = HL_GAUSS_SIGMA_RATIO * bin_width + + targets = jnp.clip(targets, HL_GAUSS_MIN_VALUE, HL_GAUSS_MAX_VALUE)[..., None] + cdf_evals = jax.scipy.special.erf((edges - targets) / (jnp.sqrt(2.0) * sigma)) + z = cdf_evals[..., -1:] - cdf_evals[..., :1] + probs = cdf_evals[..., 1:] - cdf_evals[..., :-1] + return probs / jnp.maximum(z, 1e-8) + + +def hl_gauss_from_probs(probs): + """Convert categorical probabilities to scalar values.""" + centers = hl_gauss_bin_centers(probs.shape[-1]) + return jnp.sum(probs * centers, axis=-1) + + +def hl_gauss_from_logits(logits): + """Convert categorical logits to scalar values.""" + return hl_gauss_from_probs(jax.nn.softmax(logits, axis=-1)) + + +def hl_gauss_cross_entropy(logits, targets): + """Compute cross entropy from HL-Gauss targets to predicted logits.""" + target_probs = hl_gauss_targets(targets, num_bins=logits.shape[-1]) + log_probs = jax.nn.log_softmax(logits, axis=-1) + return -jnp.sum(target_probs * log_probs, axis=-1) diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/networks.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/networks.py new file mode 100644 index 0000000000000000000000000000000000000000..43debf8748d26bf8b1ec2381d75fb0b1870d2354 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/ifql/impls/utils/networks.py @@ -0,0 +1,378 @@ +from typing import Any, Optional, Sequence + +try: # rsm_rise: the project's JAX env (third_party/openpi/.venv) has no distrax. IFQL uses only + # MLP / ResidualMLP / CategoricalValue / ActorVectorField, none of which need it, so the import + # is made optional rather than vendoring distrax. Anything that DOES need it fails at use time. + import distrax +except ModuleNotFoundError: # pragma: no cover + distrax = None +import flax.linen as nn +import jax.numpy as jnp + +from utils.loss_utils import HL_GAUSS_NUM_BINS, hl_gauss_from_logits + + +def default_init(scale=1.0): + """Default kernel initializer.""" + return nn.initializers.variance_scaling(scale, 'fan_avg', 'uniform') + + +def ensemblize(cls, num_qs, in_axes=None, out_axes=0, **kwargs): + """Ensemblize a module.""" + return nn.vmap( + cls, + variable_axes={'params': 0, 'intermediates': 0}, + split_rngs={'params': True}, + in_axes=in_axes, + out_axes=out_axes, + axis_size=num_qs, + **kwargs, + ) + + +class Identity(nn.Module): + """Identity layer.""" + + def __call__(self, x): + return x + + +class MLP(nn.Module): + """Multi-layer perceptron. + + Attributes: + hidden_dims: Hidden layer dimensions. + activations: Activation function. + activate_final: Whether to apply activation to the final layer. + kernel_init: Kernel initializer. + layer_norm: Whether to apply layer normalization. + """ + + hidden_dims: Sequence[int] + activations: Any = nn.gelu + activate_final: bool = False + kernel_init: Any = default_init() + layer_norm: bool = True + + @nn.compact + def __call__(self, x): + for i, size in enumerate(self.hidden_dims): + x = nn.Dense(size, kernel_init=self.kernel_init)(x) + if i + 1 < len(self.hidden_dims) or self.activate_final: + x = self.activations(x) + if self.layer_norm: + x = nn.LayerNorm()(x) + if i == len(self.hidden_dims) - 2: + self.sow('intermediates', 'feature', x) + return x + + +class ResidualMLPBlock(nn.Module): + """Residual dense block for vector features.""" + + hidden_dim: int + activations: Any = nn.gelu + kernel_init: Any = default_init() + layer_norm: bool = True + + @nn.compact + def __call__(self, x: Any) -> Any: + residual = x + x = nn.Dense(self.hidden_dim, kernel_init=self.kernel_init)(x) + x = self.activations(x) + if self.layer_norm: + x = nn.LayerNorm()(x) + x = nn.Dense(self.hidden_dim, kernel_init=self.kernel_init)(x) + x = residual + x + x = self.activations(x) + if self.layer_norm: + x = nn.LayerNorm()(x) + return x + + +class ResidualMLP(nn.Module): + """Residual MLP for vector inputs.""" + + hidden_dims: Sequence[int] + output_dim: int + activations: Any = nn.gelu + kernel_init: Any = default_init() + layer_norm: bool = True + + @nn.compact + def __call__(self, x: Any) -> Any: + if not self.hidden_dims: + return nn.Dense(self.output_dim, kernel_init=self.kernel_init)(x) + + x = nn.Dense(self.hidden_dims[0], kernel_init=self.kernel_init)(x) + x = self.activations(x) + if self.layer_norm: + x = nn.LayerNorm()(x) + + for hidden_dim in self.hidden_dims: + if hidden_dim != x.shape[-1]: + raise ValueError( + 'ResidualMLP requires constant hidden widths after the input projection; ' + f'got current width {x.shape[-1]} and requested width {hidden_dim}.' + ) + x = ResidualMLPBlock( + hidden_dim=hidden_dim, + activations=self.activations, + kernel_init=self.kernel_init, + layer_norm=self.layer_norm, + )(x) + + return nn.Dense(self.output_dim, kernel_init=self.kernel_init)(x) + + +MLP_CLASSES = dict( + mlp=MLP, + resmlp=ResidualMLP, +) + + +class LogParam(nn.Module): + """Scalar parameter module with log scale.""" + + init_value: float = 1.0 + + @nn.compact + def __call__(self): + log_value = self.param('log_value', init_fn=lambda key: jnp.full((), jnp.log(self.init_value))) + return jnp.exp(log_value) + + +class TransformedWithMode(distrax.Transformed if distrax is not None else object): + """Transformed distribution with mode calculation.""" + + def mode(self): + return self.bijector.forward(self.distribution.mode()) + + +class Actor(nn.Module): + """Gaussian actor network. + + Attributes: + hidden_dims: Hidden layer dimensions. + action_dim: Action dimension. + mlp_class: MLP class. + layer_norm: Whether to apply layer normalization. + log_std_min: Minimum value of log standard deviation. + log_std_max: Maximum value of log standard deviation. + tanh_squash: Whether to squash the action with tanh. + state_dependent_std: Whether to use state-dependent standard deviation. + const_std: Whether to use constant standard deviation. + final_fc_init_scale: Initial scale of the final fully-connected layer. + encoder: Optional encoder module to encode the inputs. + """ + + hidden_dims: Sequence[int] + action_dim: int + mlp_class: Any = MLP + layer_norm: bool = True + log_std_min: Optional[float] = -5 + log_std_max: Optional[float] = 2 + tanh_squash: bool = False + state_dependent_std: bool = False + const_std: bool = True + final_fc_init_scale: float = 1e-2 + encoder: nn.Module = None + + def setup(self): + if self.mlp_class is ResidualMLP: + self.actor_net = self.mlp_class( + self.hidden_dims, + self.hidden_dims[-1], + layer_norm=self.layer_norm, + ) + else: + self.actor_net = self.mlp_class( + self.hidden_dims, + activate_final=True, + layer_norm=self.layer_norm, + ) + self.mean_net = nn.Dense(self.action_dim, kernel_init=default_init(self.final_fc_init_scale)) + if self.state_dependent_std: + self.log_std_net = nn.Dense(self.action_dim, kernel_init=default_init(self.final_fc_init_scale)) + else: + if not self.const_std: + self.log_stds = self.param('log_stds', nn.initializers.zeros, (self.action_dim,)) + + def __call__( + self, + observations, + temperature=1.0, + ): + """Return action distributions. + + Args: + observations: Observations. + temperature: Scaling factor for the standard deviation. + """ + if self.encoder is not None: + inputs = self.encoder(observations) + else: + inputs = observations + outputs = self.actor_net(inputs) + + means = self.mean_net(outputs) + if self.state_dependent_std: + log_stds = self.log_std_net(outputs) + else: + if self.const_std: + log_stds = jnp.zeros_like(means) + else: + log_stds = self.log_stds + + log_stds = jnp.clip(log_stds, self.log_std_min, self.log_std_max) + + distribution = distrax.MultivariateNormalDiag(loc=means, scale_diag=jnp.exp(log_stds) * temperature) + if self.tanh_squash: + distribution = TransformedWithMode(distribution, distrax.Block(distrax.Tanh(), ndims=1)) + + return distribution + + +class Value(nn.Module): + """Value/critic network. + + This module can be used for both value V(s, g) and critic Q(s, a, g) functions. + + Attributes: + hidden_dims: Hidden layer dimensions. + layer_norm: Whether to apply layer normalization. + num_ensembles: Number of ensemble components. + encoder: Optional encoder module to encode the inputs. + """ + + hidden_dims: Sequence[int] + layer_norm: bool = True + num_ensembles: int = 2 + mlp_class: Any = MLP + encoder: nn.Module = None + + def setup(self): + use_residual = self.mlp_class is ResidualMLP + mlp_class = self.mlp_class + if self.num_ensembles > 1: + mlp_class = ensemblize(mlp_class, self.num_ensembles) + if use_residual: + value_net = mlp_class(self.hidden_dims, 1, layer_norm=self.layer_norm) + else: + value_net = mlp_class((*self.hidden_dims, 1), activate_final=False, layer_norm=self.layer_norm) + + self.value_net = value_net + + def __call__(self, observations, actions=None): + """Return values or critic values. + + Args: + observations: Observations. + actions: Actions (optional). + """ + if self.encoder is not None: + inputs = [self.encoder(observations)] + else: + inputs = [observations] + if actions is not None: + inputs.append(actions) + inputs = jnp.concatenate(inputs, axis=-1) + + v = self.value_net(inputs).squeeze(-1) + + return v + + +class CategoricalValue(nn.Module): + """Categorical value/critic network for HL-Gauss losses.""" + + hidden_dims: Sequence[int] + layer_norm: bool = True + num_ensembles: int = 2 + num_bins: int = HL_GAUSS_NUM_BINS + mlp_class: Any = MLP + encoder: nn.Module = None + + def setup(self): + use_residual = self.mlp_class is ResidualMLP + mlp_class = self.mlp_class + if self.num_ensembles > 1: + mlp_class = ensemblize(mlp_class, self.num_ensembles) + if use_residual: + self.value_net = mlp_class(self.hidden_dims, self.num_bins, layer_norm=self.layer_norm) + else: + self.value_net = mlp_class( + (*self.hidden_dims, self.num_bins), + activate_final=False, + layer_norm=self.layer_norm, + ) + + def __call__(self, observations, actions=None, output_logits=False): + """Return scalar values or categorical logits.""" + if self.encoder is not None: + inputs = [self.encoder(observations)] + else: + inputs = [observations] + if actions is not None: + inputs.append(actions) + inputs = jnp.concatenate(inputs, axis=-1) + + logits = self.value_net(inputs) + if output_logits: + return logits + return hl_gauss_from_logits(logits) + + +class ActorVectorField(nn.Module): + """Actor vector field network for flow matching. + + Attributes: + hidden_dims: Hidden layer dimensions. + action_dim: Action dimension. + layer_norm: Whether to apply layer normalization. + encoder: Optional encoder module to encode the inputs. + """ + + hidden_dims: Sequence[int] + action_dim: int + mlp_class: Any = MLP + layer_norm: bool = True + encoder: nn.Module = None + + def setup(self) -> None: + if self.mlp_class is ResidualMLP: + self.mlp = self.mlp_class(self.hidden_dims, self.action_dim, layer_norm=self.layer_norm) + else: + self.mlp = self.mlp_class( + (*self.hidden_dims, self.action_dim), + activate_final=False, + layer_norm=self.layer_norm, + ) + + def _embed_times(self, times): + freqs = jnp.arange(1, 33, dtype=times.dtype) + angles = 2 * jnp.pi * times * freqs + return jnp.concatenate([times, jnp.cos(angles), jnp.sin(angles)], axis=-1) + + @nn.compact + def __call__(self, observations, actions, times=None, conditions=None, is_encoded=False): + """Return the vectors at the given states, actions, and times (optional). + + Args: + observations: Observations. + actions: Actions. + times: Times (optional). + conditions: Additional conditioning variables (optional). + is_encoded: Whether the observations are already encoded. + """ + if not is_encoded and self.encoder is not None: + observations = self.encoder(observations) + inputs = [observations, actions] + if conditions is not None: + inputs.append(conditions) + if times is not None: + inputs.append(self._embed_times(times)) + inputs = jnp.concatenate(inputs, axis=-1) + v = self.mlp(inputs) + + return v diff --git a/gen_q_rsm/rsm_rise/pipeline/code/ifql/train_ifql.py b/gen_q_rsm/rsm_rise/pipeline/code/ifql/train_ifql.py new file mode 100644 index 0000000000000000000000000000000000000000..46481e5f384f86831f7b58950db47c6598fbc7bb --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/ifql/train_ifql.py @@ -0,0 +1,395 @@ +#!/usr/bin/env python +"""IFQL (implicit flow Q-learning) on an rsm_rise RISE task -- gen_q#264, the flagship baseline. + +IFQL is the flow variant of IDQL: a flow-matching BC actor (unweighted) plus an IQL expectile critic with +an HL-Gauss two-hot value head; at action time it draws `num_samples` noises, integrates the flow with +`flow_steps` Euler steps and takes the arg-max Q. The agent itself is the VERBATIM ogbench_plus +implementation, vendored under impls/ (`impls/agents/ifql.py`, md5 a6152bff6837e24f2bf63fef36fbb0b6 == +the upstream file); nothing in this script changes its losses, its network shapes or its defaults. What +this script supplies is the rsm_rise data loader, the fairness constants and the export. + +OBSERVATION (primary variant, `--obs dino`): the pooled frozen-DINOv2 state of the CURRENT frame -- +[agentview CLS|GeM (768) | wrist CLS|GeM (768) | eef_pos(3) eef_quat(4) gripper_qpos(2)] = 1545 -- z-scored +with the Stage-1 cache's feat_stats.npz, i.e. the EXACT input our successor scorer sees +(cache//{z.f16.npy,proprio.f32.npy,feat_stats.npz}, robomimic/algo/rsm_scorer.PooledDinoState). +`--obs pixels` is the secondary variant: the two 84x84 cameras stacked on the channel axis plus proprio, +encoded by ifql's own `impala_small` (needs --hdf5 and is much slower; not used for the paper numbers). + +ACTION: the 7-d executed action of that frame (cache//act.f32.npy), single step, exactly as +published -- the flow actor is a per-step actor, not a chunked one. + +REWARD (fairness rule, same as every other column of the flagship table): the binary data-provenance +label, 1 on every frame of an episode that came from the expert file and 0 on every frame of a +suboptimal/play episode. It is read from the source HDF5's `rewards` (constant within an episode; the +script asserts that) and cross-checked against the cache's own ep_success. + +VALUE SCALE. IFQL's value head is HL-Gauss over the FIXED support [0, 1] (impls/utils/loss_utils.py: +HL_GAUSS_MIN_VALUE=0, HL_GAUSS_MAX_VALUE=1), because upstream rewards are sparse-at-goal so that +V in [0,1]. Our provenance reward is DENSE (1 on every expert frame), so the raw n-step return +sum_{k<200} gamma^k r is ~200 and every expert state would clip to the top bin -- a constant critic with +no ranking at all. The reward is therefore multiplied by (1 - discount) (`--reward-scale auto`), which is +a strictly monotone rescaling of the identical reward signal: the fixed point becomes +V = (1-gamma) * E[sum gamma^k r] in [0, 1], i.e. the discounted AVERAGE provenance label = "how expert-like +does the future from here look", the same quantity the RSM membership head estimates. Rankings are +unchanged by the rescale, so the fairness rule ("same reward as every other method") is preserved; only +the axis the two-hot head has to represent changes. `--reward-scale 1.0` restores the raw sum for a +control. + +n-STEP RETURNS: computed inside each episode exactly as impls/utils/datasets.Dataset.get_n_step_returns +(stop at the episode's last frame, bootstrap from the frame `steps-1` ahead). + +TERMINAL CONVENTION (`--terminal`, default `truncate`): a demonstration ends because the demonstration +ends, not because the MDP reached an absorbing state, so the last transition is TRUNCATED and keeps +masks = 1, bootstrapping off the final observation -- the standard convention, and the one ogbench uses +for its own non-goal-reaching trajectories. That is also what makes the value usable here: it puts the +fixed point at V = r, so V spans the whole HL-Gauss support [0, 1]. Treating the end as a true terminal +(`--terminal terminate`, masks = 0) instead caps the return at (1 - gamma^L) ~= 0.023-0.036 for our +230-370-frame episodes at gamma = 0.9999, which is 2-4 of the 101 bins: the provenance gap survives but +the differences between 128 candidate actions at one state fall below one bin and the critic cannot rank +at all. Every run records its realised Q/V range in IFQL.json (`value_spread.q_range_in_bins`) so this +is checkable rather than assumed. + +STEP BUDGET: `--steps` gradient steps at IFQL's own batch size 256. Our RISE/IDQL policies (S0A, +S0Aidql) train for num_epochs=5000 x epoch_every_n_steps=100 = 500 000 gradient steps at batch 64, so +--steps 500000 matches them step for step (and gives IFQL 4x their sample presentations). + +RESUME: these runs sit on the PREEMPTABLE queue and LSF requeues a preempted job, so the trainer writes +a rolling `params_latest.pkl` + `resume.json` every `--resume-every` steps (25 000, ~2 min of work) and +continues from it on restart. Without that a preemption threw away up to the whole 500k-step run -- 5 of +the first 21 trainings restarted from step 1 before this existed. `train.seed` still fixes the network +initialisation, so a resumed run is the SAME arm; only the batch order after the restart differs, and the +data rng is re-seeded with (seed, start_step) so the resumed run does not replay batches it already saw. +`--no-resume` ignores the rolling checkpoint. + +OUTPUT (--out): params_.pkl (flax state dict, for resuming / re-export) and, at the end, +`ifql_bundle.pt` -- a TORCH file holding every weight as a plain numpy array plus the config and the +feat_stats path. Eval runs inside the RISE robomimic env, whose python has no JAX, so both the critic +backend (robomimic/algo/ifql_torch.py) and the flow actor read that bundle in torch. Numerical parity of +the two implementations is asserted by scripts/ifql_parity.py. + +usage (LSF only -- never on the login node): + scripts/rr_ifql.sh [extra train_ifql.py args] +""" +from __future__ import annotations + +import argparse +import json +import os +import pickle +import sys +import time +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE / "impls")) # so `utils.*` / `agents.*` resolve as upstream expects + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +SD_FLOOR_DEFAULT, Z_CLIP_DEFAULT = 0.01, 10.0 + + +# --------------------------------------------------------------------------- data +def load_cache(cache: Path, hdf5: str | None, verbose=True): + """The DINO cache of one task -> (x [N,1545] float32 z-scored, a [N,7], rewards [N], ep_from, ep_to).""" + meta = np.load(cache / "meta.npz", allow_pickle=True) + ep_from, ep_to = np.asarray(meta["ep_from"]), np.asarray(meta["ep_to"]) + ep_succ = np.asarray(meta["ep_success"]).astype(np.float32) + ep_src = [str(s) for s in np.asarray(meta["ep_src"])] + z = np.load(cache / "z.f16.npy", mmap_mode="r") + pr = np.load(cache / "proprio.f32.npy", mmap_mode="r") + a = np.load(cache / "act.f32.npy").astype(np.float32) + n = z.shape[0] + assert pr.shape[0] == n == a.shape[0], (z.shape, pr.shape, a.shape) + feat = np.concatenate([np.asarray(z, np.float32), np.asarray(pr, np.float32)], 1) + st = np.load(cache / "feat_stats.npz") + mu, sd = np.asarray(st["mu"], np.float32), np.asarray(st["sd"], np.float32) + sd_floor, z_clip = SD_FLOOR_DEFAULT, Z_CLIP_DEFAULT + if "sd_floor" in st.files: + sd_floor = float(st["sd_floor"]) + if "z_clip" in st.files: + z_clip = float(st["z_clip"]) + pack = cache / "PACK.json" + if pack.is_file(): + pk = json.loads(pack.read_text()) + sd_floor = float(pk.get("sd_floor", sd_floor)) + z_clip = float(pk.get("z_clip", z_clip)) + x = (feat - mu) / np.maximum(sd, sd_floor) + if z_clip and z_clip > 0: + x = np.clip(x, -z_clip, z_clip) + x = x.astype(np.float32) + + # ---- provenance reward, from the SOURCE hdf5 (`rewards`), laid out in cache frame order ------------- + src = hdf5 or json.loads((cache / "PACK.json").read_text())["src"] + rew = np.zeros(n, np.float32) + import h5py + with h5py.File(src, "r") as f: + for k, i0, i1 in zip(ep_src, ep_from, ep_to): + r = np.asarray(f[f"data/{k}/rewards"], np.float32) + L = int(i1 - i0) + assert len(r) >= L, f"{k}: hdf5 has {len(r)} rewards, cache wants {L}" + u = np.unique(r[:L]) + assert u.size == 1, f"{k}: rewards are not constant over the episode ({u[:5]}) -- the " + rew[i0:i1] = float(u[0]) + # cross-check against the cache's own episode label (rewards.max() > 0) + got = np.array([rew[i0] > 0 for i0 in ep_from], np.float32) + assert np.array_equal(got, (ep_succ > 0).astype(np.float32)), "hdf5 rewards disagree with meta.ep_success" + if verbose: + print(f"[ifql] {n} frames, {len(ep_from)} episodes, {int(got.sum())} expert-provenance " + f"({100 * got.mean():.1f}%), state {x.shape[1]}-d, action {a.shape[1]}-d", flush=True) + return x, a, rew, ep_from.astype(np.int64), ep_to.astype(np.int64) + + +class EpisodeDataset: + """n-step transitions over episodes laid end to end, matching impls/utils/datasets.Dataset. + + TERMINAL CONVENTION (`terminal`), which decides what the value function can even represent here: + + "truncate" (default, and the faithful reading of the published agent). A robomimic demonstration + ends because the demonstration ends, not because the MDP reached an absorbing state -- that is + truncation, and the standard convention, which ogbench also follows, is masks = 1 for a truncated + transition, bootstrapping from the final observation. The Bellman fixed point at the last frame is + then V = (1-gamma) r + gamma V => V = r, so V(s) is the probability that the future from s looks + like expert data and spans the whole HL-Gauss support [0, 1]. This is exactly the quantity the RSM + membership head estimates, which is what makes the two columns comparable. + + "terminate". masks = 0 on the last frame, so the return is the truncated sum + sum_{k {'a/b/c': ndarray}""" + out = {} + for k, v in params.items(): + key = f"{prefix}{k}" + if hasattr(v, "items"): + out.update(flatten_params(v, key + "/")) + else: + out[key] = np.asarray(v) + return out + + +def export_bundle(agent, cfg, out_path, feat_stats, task, seed, step, obs_mode): + import torch + flat = flatten_params(_to_numpy_tree(agent.network.params)) + bundle = { + "kind": "ifql_bundle_v1", + "params": {k: torch.from_numpy(np.asarray(v, np.float32)) for k, v in flat.items()}, + "config": {k: (list(v) if isinstance(v, tuple) else v) for k, v in dict(cfg).items()}, + "feat_stats": str(feat_stats), + "task": task, "seed": int(seed), "step": int(step), "obs_mode": obs_mode, + "hl_gauss": {"num_bins": 101, "min": 0.0, "max": 1.0, "sigma_ratio": 0.75}, + "source": "rsm_rise/code/ifql/train_ifql.py (gen_q#264)", + } + os.makedirs(os.path.dirname(os.path.abspath(out_path)), exist_ok=True) + tmp = str(out_path) + ".tmp" + torch.save(bundle, tmp) + os.replace(tmp, out_path) + print(f"[ifql] exported {len(flat)} arrays -> {out_path}", flush=True) + return sorted(flat) + + +# --------------------------------------------------------------------------- main +def main(): + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--task", required=True) + ap.add_argument("--cache", default="", help="default cache/") + ap.add_argument("--hdf5", default="", help="source hdf5 for `rewards` (default: the cache's PACK.json src)") + ap.add_argument("--out", required=True) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--steps", type=int, default=500_000, + help="gradient steps; 500000 = S0A/S0Aidql's 5000 epochs x 100 steps/epoch") + ap.add_argument("--obs", default="dino", choices=["dino", "pixels"]) + ap.add_argument("--num-samples", type=int, default=128, + help="candidate budget at action time (ifql default 32; the flagship uses 128)") + ap.add_argument("--terminal", default="truncate", choices=["truncate", "terminate"], + help="how an episode's last frame is treated; see EpisodeDataset. 'truncate' " + "(default) bootstraps from the final observation, so V spans [0,1]") + ap.add_argument("--reward-scale", default="auto", + help="'auto' = (1 - discount) so the HL-Gauss [0,1] support holds the value of a DENSE " + "provenance reward; a float overrides it") + ap.add_argument("--save-every", type=int, default=100_000) + ap.add_argument("--resume-every", type=int, default=25_000, + help="overwrite the rolling resume checkpoint every N steps. These runs sit on the " + "PREEMPTABLE queue and the job is requeued on preemption, so without a resume a " + "kill throws away up to the whole 500k-step run -- 5 of the first 21 trainings " + "restarted from step 1 before this existed. 0 disables it.") + ap.add_argument("--no-resume", action="store_true", + help="ignore any rolling checkpoint and start from step 1") + ap.add_argument("--log-every", type=int, default=5_000) + ap.add_argument("--wandb-name", default="") + ap.add_argument("--set", action="append", default=[], help="override an ifql get_config() key: k=v") + a = ap.parse_args() + + cache = Path(a.cache or (ROOT / "cache" / a.task)) + out = Path(a.out); out.mkdir(parents=True, exist_ok=True) + if a.obs != "dino": + raise SystemExit("--obs pixels is the secondary variant and is not wired in this script yet; " + "it needs the hdf5 image loader, not the DINO cache (see the module docstring)") + + import jax, jax.numpy as jnp + print(f"[ifql] jax {jax.__version__} devices={jax.devices()}", flush=True) + from agents.ifql import IFQLAgent, get_config + + cfg = get_config() + cfg["num_samples"] = int(a.num_samples) + for kv in a.set: + k, v = kv.split("=", 1) + cur = cfg[k] + cfg[k] = type(cur)(v) if not isinstance(cur, bool) else v.lower() in ("1", "true", "yes") + rs = (1.0 - float(cfg["discount"])) if a.reward_scale == "auto" else float(a.reward_scale) + + x, act, rew, ep_from, ep_to = load_cache(cache, a.hdf5 or None) + ds = EpisodeDataset(x, act, rew, ep_from, ep_to, cfg["discount"], cfg["n_step"], rs, + terminal=a.terminal) + print(f"[ifql] reward_scale={rs:g} discount={cfg['discount']} n_step={cfg['n_step']} " + f"terminal={a.terminal} batch={cfg['batch_size']} steps={a.steps} " + f"num_samples={cfg['num_samples']}", flush=True) + + rng = np.random.default_rng(a.seed) + b0 = ds.sample(4, rng) + agent = IFQLAgent.create(a.seed, b0["observations"], b0["actions"], cfg) + + # ---- RESUME (rolling checkpoint) -------------------------------------------------------------- + # `train.seed` still defines the network initialisation, so the resumed run is the same arm; only the + # BATCH ORDER differs after a restart, which is a sampling stream and not a result-defining seed. + # The data rng is re-seeded with (seed, start_step) so a resumed run does not replay the batches it + # already consumed. + from utils.flax_utils import save_resume_checkpoint, restore_agent_file, LATEST_PARAMS, RESUME_STATE + start = 1 + _latest, _rstate = out / LATEST_PARAMS, out / RESUME_STATE + if not a.no_resume and _latest.is_file() and _rstate.is_file(): + try: + _st = json.loads(_rstate.read_text()) + _k = int(_st["step"]) + if 0 < _k < a.steps: + agent = restore_agent_file(agent, str(_latest)) + start = _k + 1 + rng = np.random.default_rng([a.seed, _k]) + print(f"[ifql] RESUMED from {_latest} at step {_k} -> continuing at {start}/{a.steps}", + flush=True) + elif _k >= a.steps: + print(f"[ifql] rolling checkpoint is already at step {_k} >= {a.steps}; " + f"restoring it and skipping straight to the export", flush=True) + agent = restore_agent_file(agent, str(_latest)) + start = a.steps + 1 + except Exception as e: + print(f"[ifql] rolling checkpoint unusable ({e!r}) -- starting from step 1", flush=True) + + wb = None + if a.wandb_name and os.environ.get("RSM_WANDB_ENTITY"): + try: + import wandb + wb = wandb.init(entity=os.environ["RSM_WANDB_ENTITY"].split("/")[0], + project=os.environ.get("RSM_WANDB_PROJECT", "rsm_rise"), + name=a.wandb_name, group=a.task, config=dict(cfg), reinit=True) + except Exception as e: + print(f"[ifql] wandb off ({e!r})", flush=True) + + t0 = time.time() + for step in range(start, a.steps + 1): + batch = ds.sample(cfg["batch_size"], rng) + agent, info = agent.update(batch) + if step % a.log_every == 0 or step == 1: + info = {k: float(v) for k, v in info.items()} + el = time.time() - t0 + _done = step - start + 1 + _rate = _done / max(el, 1e-6) + print(f"[ifql] step {step}/{a.steps} ({_rate:.0f} it/s, eta " + f"{(a.steps - step) / max(_rate, 1e-6) / 60:.1f} min) " + + " ".join(f"{k}={v:.4f}" for k, v in sorted(info.items())), flush=True) + if wb is not None: + wb.log(info, step=step) + if a.resume_every and (step % a.resume_every == 0) and step != a.steps: + save_resume_checkpoint(agent, str(out), step) + if step % a.save_every == 0 or step == a.steps: + import flax + os.makedirs(out, exist_ok=True) + with open(out / f"params_{step}.pkl", "wb") as f: + pickle.dump({"agent": flax.serialization.to_state_dict(agent)}, f) + keys = export_bundle(agent, cfg, out / "ifql_bundle.pt", cache / "feat_stats.npz", + a.task, a.seed, a.steps, a.obs) + try: + diag = ds.sample(4096, np.random.default_rng(12345)) + q_diag = np.asarray(agent.network.select("critic")(diag["observations"], actions=diag["actions"])) + v_diag = np.asarray(agent.network.select("value")(diag["observations"])) + q_diag = q_diag.mean(0) if q_diag.ndim > 1 else q_diag + value_spread = { + "q_min": float(q_diag.min()), "q_max": float(q_diag.max()), "q_mean": float(q_diag.mean()), + "q_std": float(q_diag.std()), "v_min": float(v_diag.min()), "v_max": float(v_diag.max()), + "hl_gauss_bin_width": 1.0 / 101, + "q_range_in_bins": float((q_diag.max() - q_diag.min()) * 101), + "note": "Q/V over 4096 logged transitions. q_range_in_bins << 10 means the two-hot head " + "has almost no resolution left for ranking candidates at one state (see --terminal).", + } + except Exception as e: + value_spread = {"error": repr(e)} + print(f"[ifql] value spread: {value_spread}", flush=True) + (out / "IFQL.json").write_text(json.dumps({ + "task": a.task, "seed": a.seed, "steps": a.steps, "obs": a.obs, + "config": {k: (list(v) if isinstance(v, tuple) else v) for k, v in dict(cfg).items()}, + "reward_scale": rs, "reward": "binary data-provenance label (1 = expert file), from hdf5 `rewards`", + "terminal": a.terminal, + # VALUE SPREAD. The HL-Gauss head can only rank as finely as its bins: if the realised Q range + # covers a couple of the 101 bins, the critic cannot separate 128 candidate actions at one state + # whatever it learned. Recorded per run so the failure is visible in the artefact rather than + # having to be inferred from the loss curves. + "value_spread": value_spread, + "cache": str(cache), "feat_stats": str(cache / "feat_stats.npz"), + "step_budget_match": "500000 gradient steps = S0A/S0Aidql num_epochs 5000 x epoch_every_n_steps 100", + "param_keys": keys, "wall_time_s": time.time() - t0, + }, indent=2)) + print(f"[ifql] done in {(time.time() - t0) / 60:.1f} min", flush=True) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_code/sim_pipeline/eval/eval.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_code/sim_pipeline/eval/eval.py new file mode 100644 index 0000000000000000000000000000000000000000..0f68249dcac499f81b6caa1ddba4f6ce13128093 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_code/sim_pipeline/eval/eval.py @@ -0,0 +1,1023 @@ +import os +import numpy as np +import hydra +import torch +import cv2 +import h5py +import uuid +import json +import dill + +import robomimic.utils.file_utils as FileUtils +from omegaconf import open_dict, OmegaConf +from contextlib import nullcontext +from pathlib import Path +from hydra.core.hydra_config import HydraConfig +from hydra import compose + +from gym.vector.vector_env import VectorEnv +from stable_baselines3.common.vec_env import VecEnv + +import robomimic.utils.obs_utils as ObsUtils + +from sim_pipeline.eval.rollout_env import PossibleVecEnv +from sim_pipeline.eval.rollout_policies import * +from sim_pipeline.eval.rollout import rollout +from sim_pipeline.configs._evaluation.eval_base import EvaluationConfig +from sim_pipeline.configs.constants import PolicyType, CombinedPolicyType, ImitationAlgorithm, ROLLOUT_DATA_DIR +from sim_pipeline.envs.robosuite_wrapper import RobomimicObsWrapper +from sim_pipeline.envs.make_env import make_env, make_vec_env +from sim_pipeline.eval.rollout_stats import RolloutStats +from sim_pipeline.utils.rollout_utils import add_trajectory_to_dataset, merge_obs_specs +from sim_pipeline.utils.train_utils import get_latest_sb_policy, get_latest_robomimic_policy, get_latest_diffusion_policy, get_latest_ogbench_policy +from sim_pipeline.utils.experiment import setup_experiment +from sim_pipeline.utils.video_writer import video_writer_manager +from sim_pipeline.utils.diffusion_utils import get_policy_class, get_workspace +from sim_pipeline.data_manager.modify_dataset import fill_metadata +from sim_pipeline.data_manager.dataset_metadata_enums import * +from sim_pipeline.data_manager.edit_dataset_description import edit_dataset_description +from sim_pipeline.model_manager.get_model import get_model +from sim_pipeline.data_manager.get_dataset import get_dataset + +def get_env(policy_type: PolicyType, config: EvaluationConfig, obs_modality_specs=None, n_envs_override: int = None) -> RobomimicObsWrapper | VecEnv | VectorEnv: + if n_envs_override is not None: + n_envs = n_envs_override + else: + n_envs = config.exp.num_workers + if policy_type == PolicyType.ROBOMIMIC: + if n_envs > 1: + env: VectorEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + use_gym_vec_env=True, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + ) + elif policy_type == PolicyType.STABLE_BASELINES: + if n_envs > 1: + env: VecEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=True, + use_gym_vec_env=False, + mp_context='forkserver', + obs_modality_specs=obs_modality_specs, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=True, + ) + elif policy_type == PolicyType.DIFFUSION or policy_type == PolicyType.COMPOSITE or policy_type == PolicyType.OGBENCH: + if n_envs > 1: + env: VectorEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + use_gym_vec_env=True, + mp_context='forkserver', + obs_modality_specs=obs_modality_specs, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + ) + elif policy_type == PolicyType.PD: + if n_envs > 1: + env: VectorEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + use_gym_vec_env=True, + mp_context='forkserver', + obs_modality_specs=obs_modality_specs, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + ) + else: + raise NotImplementedError + return env + + +def get_policy_dir(policy_type: PolicyType, config: EvaluationConfig) -> Path | None: + if config.exp.use_model_manager and not policy_type in [PolicyType.PD, PolicyType.COMPOSITE, PolicyType.STABLE_BASELINES, PolicyType.OGBENCH]: + identifier = config.exp.date_string + if identifier: + model_path = get_model(config.name, identifier) + else: + model_path = get_model(config.name) + return Path(model_path) + + if config.exp.model_path: + return Path(config.exp.model_path) + + log_path = config.exp.logdir + match policy_type: + case PolicyType.STABLE_BASELINES: + logdir = Path(log_path) / f'{config.name}' / f'{config.exp.seed}' + case PolicyType.ROBOMIMIC | PolicyType.DISCRIMINATOR: + logdir: Path = Path(log_path) / f'{config.name}' / config.exp.date_string + case PolicyType.DIFFUSION: + logdir: Path = Path(log_path) / f'{config.name}' / config.exp.date_string + case PolicyType.OGBENCH: + logdir: Path = Path(log_path) / f'{config.name}' + case PolicyType.PD: + logdir = None + case PolicyType.COMPOSITE: + logdir: Path = Path(log_path) / config.name + if not logdir.exists(): + logdir.mkdir() + case _: + raise NotImplementedError + return logdir + + +def load_policy(policy_type: PolicyType, config: EvaluationConfig, policy_dir: Path, env, device: torch.device): + match policy_type: + case PolicyType.STABLE_BASELINES: + algo = config.training.algo.get_algo() + ckpt_path = get_latest_sb_policy(policy_dir / 'policy' / '_step_') + model = algo.load(ckpt_path, device=device, env=env) + + return model + case PolicyType.ROBOMIMIC | PolicyType.DISCRIMINATOR: + if policy_dir.suffix == '.pth' and policy_dir.is_file(): # rsm_rise: a checkpoint file directly + ckpt_path = policy_dir + else: + ckpt_path = get_latest_robomimic_policy(policy_dir / 'models') + + policy, ckpt_dict = FileUtils.policy_from_checkpoint(ckpt_path=ckpt_path, device=device, verbose=True, + discriminator=policy_type == PolicyType.DISCRIMINATOR) + # rsm_rise (stream D): the eval config's planner keys (training.plan_* / rsm_*) override the + # checkpoint's algo config -> best-of-N over the diffusion sampler with the RSM scorer. + algo = getattr(policy, 'policy', None) + if hasattr(algo, 'configure_planner'): + from sim_pipeline.configs.training._imitation_learning._offline_rl.iql_diffusion import planner_kwargs + kw = planner_kwargs(config.training) + if kw: + algo.configure_planner(**kw) + print(f"[rsm_rise] planner configured: plan_n={kw.get('plan_n')} rule={kw.get('plan_rule')} " + f"backend={kw.get('rsm_backend')} mode={kw.get('plan_mode')} depth={kw.get('plan_depth')} " + f"beta={kw.get('plan_beta')} rsm_ckpt={kw.get('rsm_ckpt')!r}") + + return policy + case PolicyType.DIFFUSION: + ckpt_path = get_latest_diffusion_policy(policy_dir / 'checkpoints') + payload = torch.load(open(ckpt_path, 'rb'), pickle_module=dill) + diffusion_cfg = payload['cfg'] + + lowdim_keys = config.training.low_dim_keys + rgb_keys = config.training.rgb_keys + depth_keys = config.training.depth_keys + + # adapt old diffusion library configs + with open_dict(diffusion_cfg): + diffusion_cfg.debug = False + + workspace_cls = get_workspace(rgb_keys, lowdim_keys, depth_keys) + workspace = workspace_cls(diffusion_cfg, output_dir=policy_dir) + workspace.load_payload(payload) + + policy = workspace.model + if diffusion_cfg.training.use_ema: + policy = workspace.ema_model + policy.to(device) + policy.eval() + case PolicyType.OGBENCH: + from impls.utils.flax_utils import restore_agent + from diffusion_policy.dataset.robomimic_replay_image_dataset import RobomimicReplayImageDataset + from diffusion_policy.dataset.robomimic_replay_lowdim_dataset import RobomimicReplayLowdimDataset + from torch.utils.data import DataLoader + + dataset_path = get_dataset(config.data) + + if config.training.rgb_keys: + with h5py.File(dataset_path, 'r') as f: + data = f['data'] + ep_keys = list(data.keys()) + ep = data[ep_keys[0]] + action_shape = ep['actions'].shape[1:] + obs_shapes = {} + for key in config.training.low_dim_keys: + if key not in ep['obs'].keys(): + raise ValueError(f"Key {key} not found in dataset") + obs_shapes[key] = {'shape': ep['obs'][key].shape[1:]} + for key in config.training.rgb_keys: + if key not in ep['obs'].keys(): + raise ValueError(f"Key {key} not found in dataset") + # switch to channels first + obs_shapes[key] = ep['obs'][key].shape[1:] + obs_shapes[key] = { + 'shape': (obs_shapes[key][2], obs_shapes[key][0], obs_shapes[key][1]), + 'type': 'rgb', + } + + shape_meta = { + 'obs': obs_shapes, + 'action': { + 'shape': action_shape, + } + } + + dataset = RobomimicReplayImageDataset( + shape_meta=shape_meta, + dataset_path=dataset_path, + horizon=1, + pad_before=0, + pad_after=0, + n_obs_steps=1, + abs_action=False, + use_cache=True, + seed=config.exp.seed, + val_ratio=0.0, + extra_info=True, + sample_goals=True, + p_currgoal=config.training.p_currgoal, + squeeze=True, + ) + else: + dataset = RobomimicReplayLowdimDataset( + obs_keys=config.training.low_dim_keys, + dataset_path=dataset_path, + horizon=1, + pad_before=0, + pad_after=0, + abs_action=False, + seed=config.exp.seed, + val_ratio=0.0, + extra_info=True, + sample_goals=True, + p_currgoal=config.training.p_currgoal, + squeeze=True, + ) + + train_dataloader = DataLoader( + dataset, + batch_size=config.training.batch_size, + num_workers=0, + shuffle=True, + generator=torch.Generator(device=device), + ) + + example_batch = next(iter(train_dataloader)) + example_batch_np = { + 'observations': example_batch['obs'].numpy(), + 'actions': example_batch['action'].numpy(), + } + agent_class = config.training.algo.get_agent() + agent = agent_class.create( + seed=config.exp.seed, + ex_observations=example_batch_np['observations'], + ex_actions=example_batch_np['actions'], + config=OmegaConf.to_container(config.training), + ) + latest_epoch = get_latest_ogbench_policy(policy_dir / 'checkpoints', find_epoch=True) + policy = restore_agent(agent, str(policy_dir / 'checkpoints'), latest_epoch) + case PolicyType.PD: + policy = None + case _: + raise NotImplementedError + return policy + + +def create_combined_policy( + policies, + combined_policy_type: CombinedPolicyType, + n_envs: int, +): + match combined_policy_type: + case CombinedPolicyType.HEURISTIC_RESET: + policy = HeuristicResetPolicy( + policies=policies, + n_envs=n_envs + ) + case CombinedPolicyType.HEURISTIC_RESET_SPLIT: + policy = HeuristicResetSplitPolicy( + policies=policies, + n_envs=n_envs + ) + case _: + raise NotImplementedError + return policy + + +def create_rollout_policy( + policy, + policy_type: PolicyType, + config: EvaluationConfig, + n_obs_steps: int | None = None, + action_chunking: bool = False, + obs_keys: list[str] | None = None, + lowdim: bool = False, + manual_lookahead: bool = False, + opex: bool = False, + discriminator = None, + expert_policy = None, + ) -> RolloutPolicy: + match policy_type: + case PolicyType.STABLE_BASELINES: + return StableBaselinesRolloutPolicy( + policy, + ) + case PolicyType.ROBOMIMIC: + if opex: + return RobomimicOpexRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + if manual_lookahead: + return ManualLookaheadRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + plan_n = config.training.get('plan_n', None) if hasattr(config.training, 'get') else None + if plan_n is not None: + # rsm_rise (stream D): the planner lives in the algo's get_action; plain rollout policy + return RobomimicRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + if config.training.algo == ImitationAlgorithm.IDQL and config.exp.get('policy_mode', 'idql') != 'bc': + return RobomimicSamplingRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion(), + discriminator=discriminator, + expert_policy=expert_policy, + ) + return RobomimicRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + case PolicyType.DIFFUSION: + return DiffusionRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + obs_keys=obs_keys, + lowdim=lowdim + ) + case PolicyType.OGBENCH: + return OGBenchRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + obs_keys=obs_keys, + lowdim=lowdim, + ) + case PolicyType.PD: + return PDRolloutPolicy( + policy=None, + target_pos=config.exp.target_pos, + ) + case _: + raise NotImplementedError + + +def get_policy_info(policy_type: PolicyType, config: EvaluationConfig) -> tuple: + action_chunking = True if policy_type in [PolicyType.DIFFUSION] else False + n_obs_steps = config.training.obs_horizon if policy_type in [PolicyType.DIFFUSION] else None + all_obs_keys = None + only_lowdim = False + obs_modality_specs = None + if policy_type == PolicyType.DIFFUSION or policy_type == PolicyType.OGBENCH: + lowdim_keys = OmegaConf.to_container(config.training.low_dim_keys) + rgb_keys = OmegaConf.to_container(config.training.rgb_keys) + depth_keys = OmegaConf.to_container(config.training.depth_keys) + all_obs_keys = [] + for key in lowdim_keys + rgb_keys + depth_keys: + if key in all_obs_keys: + raise ValueError(f"Duplicate obs key {key}") + all_obs_keys.append(key) + only_lowdim = lowdim_keys and not rgb_keys and not depth_keys + obs_modality_specs = RobomimicObsWrapper.get_specs_from_obs_keys(lowdim_keys, rgb_keys, depth_keys) + elif policy_type == PolicyType.ROBOMIMIC: + if config.training.algo in [ImitationAlgorithm.IQL_DIFFUSION, ImitationAlgorithm.IDQL, ImitationAlgorithm.IDQL_QSM]: + action_chunking = True + n_obs_steps = config.training.observation_horizon + elif policy_type == PolicyType.PD: + obs_modality_specs = {} + return action_chunking, n_obs_steps, all_obs_keys, only_lowdim, obs_modality_specs + + +def get_policy(policy_type: PolicyType, config: EvaluationConfig, device: torch.device, discriminator=None, expert_policy=None) -> tuple[RolloutPolicy, dict | None]: + if policy_type == PolicyType.COMPOSITE: + all_policies = [] + all_obs_modality_specs = [] + for policy_cfg_str in config.exp.policy_configs: + policy_cfg: EvaluationConfig = compose(policy_cfg_str) + rollout_policy, obs_modality_specs = get_policy(policy_cfg.exp.policy_type, policy_cfg, device) + if obs_modality_specs is not None: + all_obs_modality_specs.append(obs_modality_specs) + all_policies.append(rollout_policy) + + obs_modality_specs = merge_obs_specs(all_obs_modality_specs) + + rollout_policy = create_combined_policy( + policies=all_policies, + combined_policy_type=config.exp.combined_policy_type, + n_envs=config.exp.num_workers, + ) + + return rollout_policy, obs_modality_specs + + # rsm_rise gen_q#264 -- IFQL AS PUBLISHED (column (a) of the flagship's IFQL pair). IFQL is not a + # robomimic algo and is trained in JAX, so it is loaded from its exported torch bundle + # (exp.eval_ckpt, written by code/ifql/train_ifql.py) rather than through policy_from_checkpoint. + # Because nothing initialises ObsUtils on this path, the obs specs are built here and returned, which + # is what makes setup_eval call initialize_obs_utils_with_obs_specs before the env is created -- the + # env's observation dict must be the processed one (images float CHW in [0, 1]) that the frozen-DINO + # state expects. Column (b) does not come through here at all: it is the ordinary robomimic path + # with training.rsm_backend=ifql. + if bool(config.exp.get('ifql_policy', False)): + from sim_pipeline.eval.rollout_policies.ifql_rollout_policy import IFQLRolloutPolicy + from robomimic.algo.rsm_scorer import CAMS, PROPRIO_KEYS + ckpt = str(config.exp.get('eval_ckpt', '') or '') + if not ckpt: + raise ValueError('exp.ifql_policy=True needs exp.eval_ckpt = the ifql_bundle.pt') + specs = RobomimicObsWrapper.get_specs_from_obs_keys(list(PROPRIO_KEYS), list(CAMS), []) + rollout_policy = IFQLRolloutPolicy( + ckpt=ckpt, + feat_stats=str(config.exp.get('ifql_feat_stats', '') or ''), + device=device, + num_samples=int(config.exp.get('ifql_num_samples', 128)), + eval_seed=int(config.exp.eval_seed), + ) + print(f'[rsm_rise] IFQL policy (as published): ckpt={ckpt} ' + f'N={config.exp.get("ifql_num_samples", 128)} eval_seed={config.exp.eval_seed}') + return rollout_policy, specs + + policy_dir = get_policy_dir(config.exp.policy_type, config) + action_chunking, n_obs_steps, all_obs_keys, lowdim, obs_modality_specs = get_policy_info(config.exp.policy_type, config) + + if policy_type == PolicyType.STABLE_BASELINES: + # we need env in order to load sb policy + temp_env = get_env(config.exp.policy_type, config, obs_modality_specs, n_envs_override=1) + else: + temp_env = None + + policy = load_policy( + policy_type=config.exp.policy_type, + config=config, + policy_dir=policy_dir, + env=temp_env, + device=device + ) + if policy_type == PolicyType.DISCRIMINATOR: + return policy, None + + if config.exp.use_discriminator: + assert discriminator is not None, "Discriminator policy not found" + + rollout_policy = create_rollout_policy( + policy, + policy_type=config.exp.policy_type, + config=config, + obs_keys=all_obs_keys, + lowdim=lowdim, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + manual_lookahead=config.exp.manual_lookahead, + opex=config.exp.opex, + discriminator=discriminator, + expert_policy=expert_policy, + ) + + return rollout_policy, obs_modality_specs + + +def setup_eval(config: EvaluationConfig): + device = setup_experiment(config.exp, eval=True) + + log_video = config.exp.log_video + render = config.env.render + + policy_dir = get_policy_dir(config.exp.policy_type, config) + + if config.exp.use_discriminator: + import copy + discriminator_config = copy.deepcopy(config) + discriminator_config.exp.policy_type = PolicyType.DISCRIMINATOR + discriminator_config.name = config.exp.discriminator_name + discriminator, _ = get_policy(PolicyType.DISCRIMINATOR, discriminator_config, device) + + expert_config = copy.deepcopy(config) + expert_config.exp.policy_type = PolicyType.DIFFUSION + expert_config.exp.use_discriminator = False + expert_config.exp.discriminator_name = None + expert_policy, _ = get_policy(PolicyType.DIFFUSION, expert_config, device) + else: + discriminator = None + + policy, obs_modality_specs = get_policy(config.exp.policy_type, config, device, discriminator=discriminator) + + if obs_modality_specs is not None: + ObsUtils.initialize_obs_utils_with_obs_specs(obs_modality_specs) + env = get_env(config.exp.policy_type, config, obs_modality_specs) + env = PossibleVecEnv(env) + + # human render takes precedence over video recording + if log_video and not render: + video_dir: Path = policy_dir / 'videos_eval' + + if not video_dir.exists(): + video_dir.mkdir() + + default_size = tuple((s[0] if not env.is_vec_env else s[0][0]) for s in env.get_camera_sizes()) + size = default_size if config.exp.video_dims is None else config.exp.video_dims + fps = 20 + video_writers = [] + for i in range(config.exp.num_workers): + video_writer = cv2.VideoWriter(str(video_dir / f'rollout_video_{i}.mp4'), cv2.VideoWriter_fourcc(*'mp4v'), fps, size) + video_writers.append(video_writer) + + render_mode = 'rgb_array' + elif render: + render_mode = 'human' + video_writers = None + else: + render_mode = None + video_writers = None + + return env, policy, render_mode, video_writers + + +def _plan_summary(plan_log): + """Per-episode summary of the planner's per-step logs (rsm_planner.RSMPlannerMixin.pop_plan_log).""" + if not plan_log: + return None + if isinstance(plan_log, dict): + return plan_log # rsm_rise: a summary restored from a .partial on resume -- pass it through + import numpy as _np + def _flat(key): + return [float(v) for st in plan_log for v in (st[key] if isinstance(st[key], list) else [st[key]])] + chosen, smax, smean, sstd = _flat('score_chosen'), _flat('score_max'), _flat('score_mean'), _flat('score_std') + return { + 'steps': len(plan_log), 'n': plan_log[0]['n'], 'rule': plan_log[0]['rule'], + 'score_chosen_mean': float(_np.mean(chosen)), 'score_max_mean': float(_np.mean(smax)), + 'score_mean_mean': float(_np.mean(smean)), 'score_std_mean': float(_np.mean(sstd)), + 'gap_chosen_minus_mean': float(_np.mean(_np.array(chosen) - _np.array(smean))), + 'ties_at_max_mean': float(_np.mean(_flat('ties_at_max'))) if 'ties_at_max' in plan_log[0] else None, + 'frac_saturated_mean': float(_np.mean(_flat('frac_saturated'))) if 'frac_saturated' in plan_log[0] else None, + # rsm_rise (stream E): both read-outs of the RSM scorer, whichever one ranks (plan_score) + 'score_kind': plan_log[0].get('score_kind'), + 'prob_chosen_mean': float(_np.mean(_flat('prob_chosen'))) if 'prob_chosen' in plan_log[0] else None, + 'prob_max_mean': float(_np.mean(_flat('prob_max'))) if 'prob_max' in plan_log[0] else None, + # ties of the PROBABILITY array itself (gen_q#266), which `ties_at_max_mean` does not give when + # another read-out ranks -- this is what makes the prob-vs-prob_log tie claim a within-cell one. + 'prob_ties_at_max_mean': float(_np.mean(_flat('prob_ties_at_max'))) if 'prob_ties_at_max' in plan_log[0] else None, + 'prob_ties_at_max_exact_mean': float(_np.mean(_flat('prob_ties_at_max_exact'))) if 'prob_ties_at_max_exact' in plan_log[0] else None, + 'prob_distinct_mean': float(_np.mean(_flat('prob_distinct'))) if 'prob_distinct' in plan_log[0] else None, + 'logit_chosen_mean': float(_np.mean(_flat('logit_chosen'))) if 'logit_chosen' in plan_log[0] else None, + 'logit_max_mean': float(_np.mean(_flat('logit_max'))) if 'logit_max' in plan_log[0] else None, + 'logit_mean_mean': float(_np.mean(_flat('logit_mean'))) if 'logit_mean' in plan_log[0] else None, + 'logit_std_mean': float(_np.mean(_flat('logit_std'))) if 'logit_std' in plan_log[0] else None, + 'logit_ties_at_max_mean': float(_np.mean(_flat('logit_ties_at_max'))) if 'logit_ties_at_max' in plan_log[0] else None, + # log-complement read-out (gen_q#266, plan_score=prob_log): `prob` folded in log space. The tie + # count is the health number for it -- the claim is that it orders all N where prob ties ~half of + # them, and `prob_log_ties_at_max_mean` next to `ties_at_max_mean` makes that checkable from this + # JSON with no re-scoring. + 'prob_log_chosen_mean': float(_np.mean(_flat('prob_log_chosen'))) if 'prob_log_chosen' in plan_log[0] else None, + 'prob_log_max_mean': float(_np.mean(_flat('prob_log_max'))) if 'prob_log_max' in plan_log[0] else None, + 'prob_log_mean_mean': float(_np.mean(_flat('prob_log_mean'))) if 'prob_log_mean' in plan_log[0] else None, + 'prob_log_std_mean': float(_np.mean(_flat('prob_log_std'))) if 'prob_log_std' in plan_log[0] else None, + 'prob_log_ties_at_max_mean': float(_np.mean(_flat('prob_log_ties_at_max'))) if 'prob_log_ties_at_max' in plan_log[0] else None, + # tolerance-free versions: prob_log spans 40+ orders of magnitude, so an absolute 1e-6 tie + # tolerance is meaningless in the hopeless (all-logits-very-negative) regime. These are what the + # "orders all N" claim must be read off. + 'prob_log_ties_at_max_exact_mean': float(_np.mean(_flat('prob_log_ties_at_max_exact'))) if 'prob_log_ties_at_max_exact' in plan_log[0] else None, + 'prob_log_distinct_mean': float(_np.mean(_flat('prob_log_distinct'))) if 'prob_log_distinct' in plan_log[0] else None, + # conformal read-out (plan_score=conformal_lcb): the per-particle lower quantile that ranks + 'lcb_quantile': plan_log[0].get('lcb_quantile'), + 'lcb_chosen_mean': float(_np.mean(_flat('lcb_chosen'))) if 'lcb_chosen' in plan_log[0] else None, + 'lcb_max_mean': float(_np.mean(_flat('lcb_max'))) if 'lcb_max' in plan_log[0] else None, + 'lcb_mean_mean': float(_np.mean(_flat('lcb_mean'))) if 'lcb_mean' in plan_log[0] else None, + 'lcb_ties_at_max_mean': float(_np.mean(_flat('lcb_ties_at_max'))) if 'lcb_ties_at_max' in plan_log[0] else None, + 't_sample_s': float(sum(st['t_sample'] for st in plan_log)), + 't_score_s': float(sum(st['t_score'] for st in plan_log)), + 'idx': [int(v) for st in plan_log for v in st['idx']], + } + + +# ---- rsm_rise (orchestrator 15:51): episode-level resume ----------------------------------------------------- +# A preempted eval cell used to restart at episode 0, so on `preemptable` a long cell could never finish. +# eval.py writes ".partial" after EVERY episode and eval_cell.sh keeps the furthest attempt as +# ".partial_best"; on start we reload whichever of the two got furthest and continue from the next +# episode index. Resume is refused unless the run is the SAME cell (seed / horizon / policy / planner config), +# so a partial can never be blended into a different recipe. +_RESUME_N = 0 # episodes restored from a partial in this process (recorded in the results JSON) +# NOTE: exp.model_path is the per-attempt mktemp symlink dir of eval_cell.sh, so it is NOT an identity key; +# the checkpoint is compared through exp.eval_ckpt (the real model_epoch_*.pth), which eval_cell.sh passes. +_RESUME_KEYS = ('eval_seed', 'rollout_horizon', 'end_on_success', 'policy_mode', 'success_criterion', 'cell', + 'reset_states_file', 'eval_ckpt') + + +def _resume_fingerprint(config: EvaluationConfig): + fp = { + 'eval_seed': int(config.exp.eval_seed), + 'rollout_horizon': int(config.exp.rollout_horizon), + 'end_on_success': bool(config.exp.get('end_on_success', False)), + 'policy_mode': str(config.exp.get('policy_mode', 'idql')), + 'success_criterion': {'mug': os.environ.get('RSM_RISE_MUG_SUCCESS', 'stock') or 'stock', 'thread': os.environ.get('RSM_RISE_THREAD_SUCCESS', 'stock') or 'stock', 'piece_dz_tol': os.environ.get('RSM_RISE_PIECE_DZ_TOL', '') or None}, # rsm_rise: which env success rule this cell used (#267: 'thread' defaults to stock) + 'cell': str(config.exp.get('eval_cell', '') or ''), + 'eval_ckpt': str(config.exp.get('eval_ckpt', '') or ''), + 'reset_states_file': getattr(config.env, 'reset_states_file', None), + } + try: + from sim_pipeline.configs.training._imitation_learning._offline_rl.iql_diffusion import planner_kwargs + fp['planner_overrides'] = {k: (v if isinstance(v, (int, float, str, bool)) or v is None else str(v)) + for k, v in planner_kwargs(config.training).items()} + except Exception: + fp['planner_overrides'] = None + return fp + + +def _rng_state_dump(): + """Serialize the GLOBAL numpy RNG state (robosuite's placement samplers draw from np.random).""" + try: + st = np.random.get_state() + return {'name': str(st[0]), 'keys': [int(x) for x in st[1]], 'pos': int(st[2]), + 'has_gauss': int(st[3]), 'cached_gaussian': float(st[4])} + except Exception as ex: + print(f'[rsm_rise] resume: cannot snapshot the numpy RNG state ({ex!r})') + return None + + +def _rng_state_load(d): + """Restore a state written by _rng_state_dump. True on success.""" + try: + if not isinstance(d, dict) or d.get('name') != 'MT19937' or len(d.get('keys') or []) != 624: + return False + np.random.set_state((d['name'], np.array(d['keys'], dtype=np.uint32), int(d['pos']), + int(d['has_gauss']), float(d['cached_gaussian']))) + return True + except Exception as ex: + print(f'[rsm_rise] resume: cannot restore the numpy RNG state ({ex!r})') + return False + + +def _resume_load(config: EvaluationConfig): + """(n_done, episodes, np_rng_state) of the furthest COMPATIBLE partial of this cell, else (0, [], None).""" + import os + path = config.exp.get('results_json', None) + if not path or not bool(config.exp.get('resume_partial', True)): + return 0, [], None + fp = _resume_fingerprint(config) + best = (0, [], None, None) + for cand in (str(path) + '.partial', str(path) + '.partial_best'): + if not os.path.exists(cand): + continue + try: + with open(cand) as f: + d = json.load(f) + except Exception as ex: + print(f'[rsm_rise] resume: cannot read {cand} ({ex!r}) -- ignored') + continue + # a key missing from the partial = written before that key existed -> not a mismatch, just unverifiable + # rsm_rise #267: `success_criterion` is a DICT that gains sub-keys over time (mug 2026-09-21, + # thread 2026-09-21), so it is compared SUB-KEY-WISE over the sub-keys the partial actually has. + # Comparing the whole dict would declare every partial written before a new sub-key existed "a + # different cell" and silently throw away its finished episodes. + bad = [] + for k in _RESUME_KEYS: + if k not in d: + continue + if k == 'success_criterion' and isinstance(d.get(k), dict) and isinstance(fp[k], dict): + if any(d[k].get(sk) != fp[k].get(sk) for sk in d[k]): + bad.append(k) + continue + if d.get(k) != fp[k]: + bad.append(k) + missing = [k for k in _RESUME_KEYS if k not in d] + if missing: + print(f'[rsm_rise] resume: {cand} predates {",".join(missing)} -- identity taken from its path') + if fp['planner_overrides'] is not None and d.get('planner_overrides') != fp['planner_overrides']: + bad.append('planner_overrides') + if bad: + print(f'[rsm_rise] resume: {cand} is a DIFFERENT cell ({",".join(bad)} differ) -- ignored') + continue + eps = d.get('episodes') or [] + n = min(int(d.get('num_episodes', 0)), len(eps)) + if n > best[0]: + best = (n, eps[:n], cand, d.get('np_rng_state')) + if best[0]: + print(f'[rsm_rise] resume: {best[2]} has {best[0]} finished episodes -> continuing at episode {best[0]}') + return best[0], best[1], best[3] + + +def _resume_restore(rollout_stats: RolloutStats, episodes): + """Replay finished episodes into a fresh RolloutStats (+ their wall times and planner summaries).""" + ep_times, ep_plans = [], [] + for e in episodes: + rollout_stats.all_reward.append(float(e.get('return', 0.0))) + rollout_stats.all_successes.append(1.0 if e.get('success') else 0.0) + rollout_stats.all_final_successes.append(1.0 if e.get('final_success') else 0.0) + rollout_stats.all_lengths.append(int(e.get('length', 0))) + rollout_stats.all_first_success.append(int(e.get('first_success_step', -1))) + rollout_stats.num_episodes += 1 + ep_times.append(float(e.get('wall_time_s', 0.0))) + ep_plans.append(e.get('plan') or []) + rollout_stats.compute_statistics() + return ep_times, ep_plans + + +def _write_results_json(config: EvaluationConfig, rollout_stats: RolloutStats, policy=None, ep_times=None, + ep_plans=None, t_start=None, partial=False, np_rng_state=None): + # rsm_rise: per-episode results for the planning grid (stream A) + planner config / timing (stream D) + import os, time as _time + n = rollout_stats.num_episodes + episodes = [ + { + 'episode': i, + 'success': bool(rollout_stats.all_successes[i] > 0.5), + 'final_success': bool(rollout_stats.all_final_successes[i] > 0.5), + 'return': float(rollout_stats.all_reward[i]), + 'length': int(rollout_stats.all_lengths[i]), + 'first_success_step': int(rollout_stats.all_first_success[i]), + } + for i in range(n) + ] + out = { + 'num_episodes': n, + 'success_rate': float(np.mean([e['success'] for e in episodes])) if n else None, + 'final_success_rate': float(np.mean([e['final_success'] for e in episodes])) if n else None, + 'mean_length': float(np.mean([e['length'] for e in episodes])) if n else None, + 'mean_return': float(np.mean([e['return'] for e in episodes])) if n else None, + 'model_path': str(config.exp.model_path), + 'env': OmegaConf.to_container(config.env, resolve=True, enum_to_str=True), + 'rollout_horizon': int(config.exp.rollout_horizon), + 'end_on_success': bool(config.exp.get('end_on_success', False)), + 'policy_mode': str(config.exp.get('policy_mode', 'idql')), + 'success_criterion': {'mug': os.environ.get('RSM_RISE_MUG_SUCCESS', 'stock') or 'stock', 'thread': os.environ.get('RSM_RISE_THREAD_SUCCESS', 'stock') or 'stock', 'piece_dz_tol': os.environ.get('RSM_RISE_PIECE_DZ_TOL', '') or None}, # rsm_rise: which env success rule this cell used (#267: 'thread' defaults to stock) + 'eval_seed': int(config.exp.eval_seed), + 'eval_ckpt': str(config.exp.get('eval_ckpt', '') or ''), + 'reset_states_file': getattr(config.env, 'reset_states_file', None), + 'episodes': episodes, + } + # ---- stream D: planner config, per-episode planner summary, timing, Wilson CI ------------------ + if ep_times is not None: + for i, e in enumerate(episodes[:len(ep_times)]): + e['wall_time_s'] = float(ep_times[i]) + if ep_plans is not None: + for i, e in enumerate(episodes[:len(ep_plans)]): + e['plan'] = _plan_summary(ep_plans[i]) + algo = getattr(getattr(policy, 'policy', None), 'policy', None) + if hasattr(algo, 'planner_describe'): + try: + out['planner'] = algo.planner_describe() + except Exception as ex: + out['planner'] = {'error': repr(ex)} + try: + from sim_pipeline.configs.training._imitation_learning._offline_rl.iql_diffusion import planner_kwargs + out['planner_overrides'] = {k: (v if isinstance(v, (int, float, str, bool)) or v is None else str(v)) + for k, v in planner_kwargs(config.training).items()} + except Exception: + pass + out['cell'] = str(config.exp.get('eval_cell', '') or '') + out['task'] = str(config.exp.get('eval_task', '') or config.exp.get('task', '') or '') + out['algo_name'] = getattr(algo, 'algo_name', None) if algo is not None else None + out['num_rollouts_requested'] = int(config.exp.num_rollouts) + out['partial'] = bool(partial) + out['resumed_from_episode'] = int(_RESUME_N) + if np_rng_state is not None: + out['np_rng_state'] = np_rng_state + if n: + p_hat = out['success_rate']; z = 1.96 + den = 1 + z * z / n + centre = (p_hat + z * z / (2 * n)) / den + half = z * np.sqrt(p_hat * (1 - p_hat) / n + z * z / (4 * n * n)) / den + out['success_ci95'] = [float(centre - half), float(centre + half)] + if t_start is not None: + out['wall_time_s'] = float(_time.time() - t_start) + out['wall_time_per_episode_s'] = float(out['wall_time_s'] / max(n, 1)) + plans = [e.get('plan') for e in episodes if e.get('plan')] + if plans: + out['planner_time'] = { + 'steps_total': int(sum(p['steps'] for p in plans)), + 't_sample_s': float(sum(p['t_sample_s'] for p in plans)), + 't_score_s': float(sum(p['t_score_s'] for p in plans)), + 'score_chosen_mean': float(np.mean([p['score_chosen_mean'] for p in plans])), + 'score_max_mean': float(np.mean([p['score_max_mean'] for p in plans])), + 'score_mean_mean': float(np.mean([p['score_mean_mean'] for p in plans])), + 'gap_chosen_minus_mean': float(np.mean([p['gap_chosen_minus_mean'] for p in plans])), + 'ties_at_max_mean': float(np.mean([p['ties_at_max_mean'] for p in plans if p.get('ties_at_max_mean') is not None] or [np.nan])), + 'frac_saturated_mean': float(np.mean([p['frac_saturated_mean'] for p in plans if p.get('frac_saturated_mean') is not None] or [np.nan])), + # gen_q#266: the log-space read-out's tie count, rolled up to the cell so the table can print + # it beside the score without opening the per-episode plans. + 'prob_log_ties_at_max_mean': float(np.mean([p['prob_log_ties_at_max_mean'] for p in plans if p.get('prob_log_ties_at_max_mean') is not None] or [np.nan])), + 'prob_log_std_mean': float(np.mean([p['prob_log_std_mean'] for p in plans if p.get('prob_log_std_mean') is not None] or [np.nan])), + 'prob_ties_at_max_mean': float(np.mean([p['prob_ties_at_max_mean'] for p in plans if p.get('prob_ties_at_max_mean') is not None] or [np.nan])), + 'prob_log_ties_at_max_exact_mean': float(np.mean([p['prob_log_ties_at_max_exact_mean'] for p in plans if p.get('prob_log_ties_at_max_exact_mean') is not None] or [np.nan])), + 'prob_log_distinct_mean': float(np.mean([p['prob_log_distinct_mean'] for p in plans if p.get('prob_log_distinct_mean') is not None] or [np.nan])), + 'prob_ties_at_max_exact_mean': float(np.mean([p['prob_ties_at_max_exact_mean'] for p in plans if p.get('prob_ties_at_max_exact_mean') is not None] or [np.nan])), + 'prob_distinct_mean': float(np.mean([p['prob_distinct_mean'] for p in plans if p.get('prob_distinct_mean') is not None] or [np.nan])), + } + path = str(config.exp.results_json) + os.makedirs(os.path.dirname(os.path.abspath(path)), exist_ok=True) + target = path + '.partial' if partial else path + tmp = target + '.tmp' + with open(tmp, 'w') as f: + json.dump(out, f, indent=2) + os.replace(tmp, target) + if not partial: + for stale in (path + '.partial', path + '.partial_best'): + try: + os.remove(stale) + except OSError: + pass + print(f'[rsm_rise] wrote {path}: success_rate={out["success_rate"]} over {n} episodes') + + +@hydra.main(version_base=None, config_path='../configs', config_name="eval_robomimic") +def eval(config: EvaluationConfig): + config.env.horizon = config.exp.rollout_horizon + env, policy, render_mode, video_writers = setup_eval(config) + + save_dataset = config.exp.save_to_dataset + rollout_stats = RolloutStats() + # rsm_rise: episode-level resume -- reload the furthest compatible partial of THIS cell and continue + global _RESUME_N + _RESUME_N, _resume_eps, _resume_rng = _resume_load(config) + _resume_times, _resume_plans = _resume_restore(rollout_stats, _resume_eps) + + if save_dataset: + dataset_name = f'{config.exp.dataset_name}.hdf5' + if not ROLLOUT_DATA_DIR.exists(): + ROLLOUT_DATA_DIR.mkdir() + dataset_path = ROLLOUT_DATA_DIR / dataset_name + total_samples = 0 + demo_num = 0 + + if config.exp.reset_to_data: + ref_dataset_path = get_dataset(config.data) + else: + ref_dataset_path = None + # rsm_rise: fixed initial-state pool (env.reset_states_file), one state per episode drawn with the eval seed + _reset_pool = None + if getattr(config.env, 'reset_states_file', None): + with open(config.env.reset_states_file) as _f: + _reset_pool = [np.array(e['state0'], dtype=np.float64) for e in json.load(_f)['episodes']] + _reset_rng = np.random.RandomState(int(config.exp.eval_seed)) + _reset_idx = [int(_reset_rng.randint(len(_reset_pool))) for _ in range(int(config.exp.num_rollouts))] + print(f"[rsm_rise] resetting every episode to one of {len(_reset_pool)} pooled initial states from {config.env.reset_states_file}") + + try: + with ( + video_writer_manager(video_writers) as video_writers, + (h5py.File(dataset_path, 'w') if save_dataset else nullcontext()) as dataset_file, + (h5py.File(ref_dataset_path, 'r') if ref_dataset_path is not None else nullcontext()) as ref_dataset_file + ): + if save_dataset: + data_grp = dataset_file.create_group('data') + + import time as _time + # rsm_rise: wall time and planner log per episode (pre-filled by an episode-level resume) + _ep_times, _ep_plans = list(_resume_times), list(_resume_plans) + _t_eval0 = _time.time() + if _RESUME_N and _reset_pool is None and _rng_state_load(_resume_rng): + # rsm_rise 23:20 UTC: the partial carries the exact global-numpy RNG state as of the reset of + # episode _RESUME_N, so the resumed tail gets the SAME initial states a fresh run would have + # given it without replaying _RESUME_N env.reset() calls (~1 s each -> up to 100 s per attempt + # on a crashy cell, which is what made the 100-rollout TEST evals of a degenerate job miss the + # deadline). Strictly more faithful than the replay: the replay only matched a fresh run if + # nothing inside a rollout drew from np.random. + print(f'[rsm_rise] resume: restored the numpy RNG state of episode {_RESUME_N} ' + f'(no reset replay needed)') + elif _RESUME_N and _reset_pool is None: + # No fixed init-state pool: episode i's initial state is the i-th draw of the env RNG (seeded with + # eval_seed at creation). Burn _RESUME_N resets so the resumed episodes get the SAME initial states + # a fresh run would have given them -- otherwise the resumed tail would repeat the init states of + # the finished head and the estimate would be built on duplicated inits. + _t_warm = _time.time() + for _ in range(_RESUME_N): + env.reset() + print(f'[rsm_rise] resume: advanced the env RNG by {_RESUME_N} resets ' + f'in {_time.time() - _t_warm:.1f}s') + for i in range(_RESUME_N, config.exp.num_rollouts): + _t_ep0 = _time.time() + if ref_dataset_file is not None: + ind = 9 + + eef_pos = ref_dataset_file['data'][f'demo_{ind}']['obs']['robot0_eef_pos'] + # find first index where z < 0.5 + try: + idx = np.where(eef_pos[:, 2] < 0.835)[0][0] + except IndexError: + idx = 0 + + reset_state = ref_dataset_file['data'][f'demo_{ind}']['states'][idx] + elif _reset_pool is not None: + reset_state = _reset_pool[_reset_idx[i]] + else: + reset_state = None + + traj = rollout( + policy=policy, + eval_envs=env, + rollout_stats=rollout_stats, + reset_state=reset_state, + logger=None, + total_steps=config.exp.rollout_horizon, + render_mode=render_mode, + log_video=config.exp.log_video, + video_writers=video_writers, + render_dims=config.exp.video_dims, + video_skip=config.exp.video_skip, + return_trajectory=save_dataset, + end_on_success=bool(config.exp.get('end_on_success', False)), + ) + if save_dataset: + # save traj + demo_num, added_samples = add_trajectory_to_dataset( + demo_num, + traj, + dataset_file + ) + total_samples += added_samples + + rollout_stats.compute_statistics() + _ep_times.append(_time.time() - _t_ep0) + _algo = getattr(getattr(policy, 'policy', None), 'policy', None) + _ep_plans.append(_algo.pop_plan_log() if hasattr(_algo, 'pop_plan_log') else []) + if config.exp.get('results_json', None): + # snapshot taken here = the RNG state the NEXT episode's env.reset() will consume + _write_results_json(config, rollout_stats, policy=policy, ep_times=_ep_times, + ep_plans=_ep_plans, t_start=_t_eval0, partial=True, + np_rng_state=_rng_state_dump()) + + if config.exp.verbose: + rollout_stats.print_stats(i, total=config.exp.num_rollouts) + + if save_dataset: + data_grp.attrs['total'] = total_samples + + hydra_config = HydraConfig.get() + config_name = hydra_config.job.config_name + data_grp.attrs['config_name'] = config_name + + env_args = env.serialize() + if "placement_initializer" in env_args['env_kwargs']: + env_args['env_kwargs']["placement_initializer"] = None + data_grp.attrs['env_args'] = json.dumps(env_args, indent=4) + + fill_metadata( + dataset_file, + dataset_id=str(uuid.uuid4()), + dataset_type=DatasetType.RL, + action_type=ActionType.RELATIVE, + env_type=EnvType.ROBOMIMIC, + env_name=config.env.env_name.value, + is_real=False, + include_date=True, + include_creator=True, + ) + + print(f"Dataset saved to {dataset_path}") + print(f"Total samples added to dataset: {total_samples}") + if save_dataset: + edit_dataset_description(dataset_path) + if config.exp.get('results_json', None): + _write_results_json(config, rollout_stats, policy=policy, ep_times=_ep_times, + ep_plans=_ep_plans, t_start=_t_eval0, partial=False) + except Exception as e: + # remove partially completed dataset if it was created + if save_dataset: + dataset_path.unlink() + raise e diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_code/sim_pipeline/eval/rollout_policies/ifql_rollout_policy.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_code/sim_pipeline/eval/rollout_policies/ifql_rollout_policy.py new file mode 100644 index 0000000000000000000000000000000000000000..877927ba80867dfa5fa9905d2516e089ac6b6f24 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_code/sim_pipeline/eval/rollout_policies/ifql_rollout_policy.py @@ -0,0 +1,141 @@ +"""IFQL as published: its own flow actor proposing N candidates, its own critic picking one (gen_q#264). + +This is column (a) of the flagship's IFQL pair. Column (b) -- the IFQL critic ranking the RISE actor's +128 chunks -- needs no rollout policy at all: it is `training.rsm_backend=ifql` in the existing best-of-N +planner (robomimic/algo/rsm_planner.IFQLCriticBackend). + +Per control step: + 1. the current frame's pooled frozen-DINOv2 state is computed exactly as the RSM scorer computes it + (robomimic/algo/rsm_scorer.PooledDinoState on agentview_image + robot0_eye_in_hand_image + proprio, + z-scored with the task cache's feat_stats.npz); + 2. `num_samples` unit normals are integrated through the behavioural flow with `flow_steps` Euler steps + and clipped to [-1, 1]; + 3. the IFQL critic scores all of them and the arg-max is executed -- one 7-d action per env step, which + is what the published agent does (its flow actor is a per-step actor, not a chunked one). + +RANDOMNESS. The candidate noise comes from a torch.Generator seeded with `exp.eval_seed`, so a cell's +action draws are reproducible and are driven by the same knob that drives the env's initial conditions, +matching the fairness rule the rest of the table follows. It is a dedicated generator, so it never +perturbs the env's own RNG stream. + +The per-step selection log has the same shape the RSM/IQL planner writes (`score_*`, `ties_at_max`, +`t_sample`, `t_score`), so eval.py's `_plan_summary` and the results-JSON `planner_time` block work +unchanged: `pop_plan_log` is exposed here and eval.py finds it through `policy.policy.policy`. +""" +import time + +import numpy as np +import torch + +from sim_pipeline.eval.rollout_policies.rollout_policy import RolloutPolicy + + +class _IFQLInner: + """What eval.py reaches as `policy.policy.policy`: holds the agent, the log and the description.""" + + algo_name = "ifql" + + def __init__(self, agent, state, ckpt, feat_stats, num_samples, eval_seed, device, + img_layout="chw"): + self.agent = agent + self._state = state + self.img_layout = img_layout + self.ckpt = ckpt + self.feat_stats = feat_stats + self.num_samples = int(num_samples) + self.eval_seed = int(eval_seed) + self.device = device + self.generator = torch.Generator(device="cpu").manual_seed(int(eval_seed)) + self._plan_log = [] + + @property + def state(self): + """The pooled-DINO state encoder, built on first use (see IFQLRolloutPolicy.__init__).""" + if self._state is None: + from robomimic.algo.rsm_scorer import PooledDinoState, CAMS, PROPRIO_KEYS + self._state = PooledDinoState(self.feat_stats, cams=CAMS, proprio_keys=PROPRIO_KEYS, + img_layout=self.img_layout).to(self.device) + return self._state + + def pop_plan_log(self): + log, self._plan_log = self._plan_log, [] + return log + + def planner_describe(self): + d = {"plan_n": self.num_samples, "plan_rule": "argmax", "rsm_backend": "ifql", + "rsm_ckpt": self.ckpt, "rsm_feat_stats": self.feat_stats, + "proposer": "ifql flow actor (its own)", "eval_seed": self.eval_seed, + "state_encoder_built": self._state is not None} + try: + d["scorer"] = self.agent.describe() + except Exception as e: # a description must never break an eval + d["scorer"] = {"error": repr(e)} + return d + + @torch.no_grad() + def act(self, obs_t): + t0 = time.time() + x = self.state(obs_t) # [B, 1545] + B, N, A = x.shape[0], self.num_samples, self.agent.action_dim + noise = torch.randn(B, N, A, generator=self.generator, device="cpu").to(self.device) + cand = self.agent.flow_candidates(x, num_samples=N, noise=noise) + t_sample = time.time() - t0 + t1 = time.time() + q = self.agent.q(x.repeat_interleave(N, 0), cand.reshape(B * N, A)).reshape(B, N) + t_score = time.time() - t1 + idx = q.argmax(1) + act = cand[torch.arange(B, device=cand.device), idx] + s = q.detach().float().cpu() + ar = torch.arange(B, device="cpu") + idx_cpu = idx.detach().to("cpu") + self._plan_log.append({ + "n": N, "rule": "argmax", "idx": idx_cpu.tolist(), "score_kind": "prob", + "score_chosen": s[ar, idx_cpu].tolist(), "score_max": s.max(1).values.tolist(), + "score_mean": s.mean(1).tolist(), "score_min": s.min(1).values.tolist(), + "score_std": s.std(1).tolist() if N > 1 else [0.0] * B, + "ties_at_max": (s >= s.max(1, keepdim=True).values - 1e-6).sum(1).tolist(), + "frac_saturated": (s >= 0.999).float().mean(1).tolist(), + "prob_chosen": s[ar, idx_cpu].tolist(), "prob_max": s.max(1).values.tolist(), + "prob_mean": s.mean(1).tolist(), + "t_sample": t_sample, "t_score": t_score, + }) + return act + + +class IFQLRolloutPolicy(RolloutPolicy): + """`predict(obs) -> [B, 7]`. `obs` is the env's processed dict (images float CHW in [0, 1]).""" + + def __init__(self, ckpt, feat_stats, device, num_samples=128, eval_seed=0, img_layout="chw"): + from robomimic.algo.ifql_torch import IFQLTorch + from robomimic.algo.rsm_scorer import CAMS, PROPRIO_KEYS + agent = IFQLTorch(ckpt, device=device) + feat_stats = feat_stats or agent.feat_stats + if not feat_stats: + raise RuntimeError("the IFQL policy needs feat_stats (the task cache's feat_stats.npz)") + # The DINO encoder is built on FIRST USE, not here. This policy is constructed inside + # eval.get_policy, i.e. BEFORE setup_eval calls initialize_obs_utils_with_obs_specs and before the + # env exists; the RSM scorer builds its own copy lazily on the first planner call and therefore + # never depended on that ordering. Matching it keeps the IFQL path independent of when ObsUtils + # is initialised. + inner = _IFQLInner(agent, None, str(ckpt), str(feat_stats), num_samples, eval_seed, device, + img_layout=img_layout) + # RolloutPolicy stores its argument as `.policy`; eval.py reads `policy.policy.policy`, so the + # inner object is nested one level deeper, the way a robomimic RolloutPolicy nests its algo. + super().__init__(type("_IFQLWrap", (), {"policy": inner})(), action_chunking=False, n_obs_steps=None) + self.inner = inner + self.device = device + self.cams = CAMS + self.proprio_keys = PROPRIO_KEYS + + def reset(self): + pass + + def predict(self, obs, *args, **kwargs): + obs_t = {} + for k in list(self.cams) + list(self.proprio_keys): + if k not in obs: + raise KeyError(f"the IFQL policy needs obs key {k!r}; env gave {sorted(obs)}") + v = obs[k] + obs_t[k] = torch.as_tensor(np.asarray(v), dtype=torch.float32, device=self.device) + act = self.inner.act(obs_t) + return act.detach().cpu().numpy() diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/ifql_torch.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/ifql_torch.py new file mode 100644 index 0000000000000000000000000000000000000000..587dc8d9fb6acc504a5fcaa265d1377e4752fdb8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/ifql_torch.py @@ -0,0 +1,233 @@ +"""Torch re-implementation of the IFQL critic and flow actor, reading a JAX/flax training bundle. + +gen_q#264. IFQL (implicit flow Q-learning, the flow variant of IDQL) is trained in JAX by +rsm_rise/code/ifql/train_ifql.py, which exports every flax parameter as a plain numpy array into +`ifql_bundle.pt`. Eval happens inside the RISE robomimic/MuJoCo process, whose python (rsm_rise/env, +3.10) has no JAX at all, so the two things eval needs -- Q(s, a) for ranking candidates, and the flow +actor for the "IFQL as published" column -- are re-implemented here in torch and fed those arrays. + +What is replicated, exactly (upstream files vendored under rsm_rise/code/ifql/impls): + * utils/networks.ResidualMLP / ResidualMLPBlock: Dense -> gelu -> LayerNorm entry projection, then + `len(hidden_dims)` blocks of (Dense, gelu, LayerNorm, Dense, +residual, gelu, LayerNorm), then a + Dense to the output width. flax's nn.gelu is the TANH approximation and flax's nn.LayerNorm uses + epsilon 1e-6, both of which torch has to be told explicitly. + * utils/networks.CategoricalValue: [obs (| action)] -> num_bins logits; `num_ensembles` > 1 is flax + nn.vmap with the parameter axis leading, i.e. kernels are [E, d_in, d_out] and every member sees the + same input. + * utils/loss_utils.hl_gauss_from_logits: softmax over 101 bins whose centres tile [0, 1], dotted with + those centres -- so a Q is already on the "discounted average provenance label" scale (see + train_ifql.py's VALUE SCALE note). + * utils/networks.ActorVectorField: [obs | action | time embedding] -> action-dim velocity, where the + time embedding is [t, cos(2 pi t k), sin(2 pi t k)] for k = 1..32. + * agents/ifql.IFQLAgent.sample_actions: `num_samples` unit normals, `flow_steps` Euler steps at + t = i / flow_steps, clip to [-1, 1], then arg-max of the `q_agg` aggregation of the critic ensemble. + +Parity against the JAX original is asserted by rsm_rise/scripts/ifql_parity.py (max abs difference over +random states/actions; the tolerance it enforces is 1e-4 on Q and on the sampled action). +""" +from __future__ import annotations + +import numpy as np +import torch +import torch.nn.functional as F + +LN_EPS = 1e-6 # flax.linen.LayerNorm default epsilon (torch's default is 1e-5) + + +def _gelu(x): + """flax.linen.gelu == jax.nn.gelu(approximate=True) == torch's tanh approximation.""" + return F.gelu(x, approximate="tanh") + + +def hl_gauss_from_logits(logits, lo=0.0, hi=1.0): + """[..., B] logits -> scalar value, the HL-Gauss two-hot read-out over bins tiling [lo, hi].""" + nb = logits.shape[-1] + edges = torch.linspace(lo, hi, nb + 1, device=logits.device, dtype=logits.dtype) + centres = (edges[:-1] + edges[1:]) / 2 + return (torch.softmax(logits, dim=-1) * centres).sum(-1) + + +class _Params: + """Flat {'a/b/c': tensor} bundle with dotted access helpers.""" + + def __init__(self, params, device, dtype=torch.float32): + self.p = {k: torch.as_tensor(np.asarray(v), dtype=dtype, device=device) if not torch.is_tensor(v) + else v.to(device=device, dtype=dtype) for k, v in params.items()} + + def has(self, key): + return key in self.p + + def __getitem__(self, key): + if key not in self.p: + raise KeyError(f"{key} not in the IFQL bundle; have e.g. {sorted(self.p)[:6]}") + return self.p[key] + + +def _dense(P, prefix, x, ens): + """flax nn.Dense. ens: None (plain) or the ensemble size (kernel [E, d_in, d_out], x [E, ..., d_in]).""" + k, b = P[f"{prefix}/kernel"], P[f"{prefix}/bias"] + if ens is None: + return x @ k + b + return torch.einsum("e...i,eio->e...o", x, k) + b.reshape(ens, *([1] * (x.dim() - 2)), -1) + + +def _layer_norm(P, prefix, x, ens): + s, b = P[f"{prefix}/scale"], P[f"{prefix}/bias"] + y = (x - x.mean(-1, keepdim=True)) / torch.sqrt(x.var(-1, unbiased=False, keepdim=True) + LN_EPS) + if ens is None: + return y * s + b + shape = (ens, *([1] * (x.dim() - 2)), -1) + return y * s.reshape(shape) + b.reshape(shape) + + +def _residual_mlp(P, prefix, x, n_blocks, layer_norm, ens): + """utils/networks.ResidualMLP forward (hidden widths are constant, so n_blocks is all we need).""" + x = _dense(P, f"{prefix}/Dense_0", x, ens) + x = _gelu(x) + if layer_norm: + x = _layer_norm(P, f"{prefix}/LayerNorm_0", x, ens) + for i in range(n_blocks): + bp = f"{prefix}/ResidualMLPBlock_{i}" + res = x + x = _dense(P, f"{bp}/Dense_0", x, ens) + x = _gelu(x) + if layer_norm: + x = _layer_norm(P, f"{bp}/LayerNorm_0", x, ens) + x = _dense(P, f"{bp}/Dense_1", x, ens) + x = res + x + x = _gelu(x) + if layer_norm: + x = _layer_norm(P, f"{bp}/LayerNorm_1", x, ens) + return _dense(P, f"{prefix}/Dense_1", x, ens) + + +def _plain_mlp(P, prefix, x, n_hidden, layer_norm, ens): + """utils/networks.MLP forward with hidden_dims = (*hidden, out) and activate_final=False.""" + n = n_hidden + 1 + for i in range(n): + x = _dense(P, f"{prefix}/Dense_{i}", x, ens) + if i + 1 < n: + x = _gelu(x) + if layer_norm: + x = _layer_norm(P, f"{prefix}/LayerNorm_{i}", x, ens) + return x + + +def _embed_times(t, n_freq=32): + """utils/networks.ActorVectorField._embed_times: [t, cos(2 pi t k), sin(2 pi t k)] for k = 1..n_freq.""" + freqs = torch.arange(1, n_freq + 1, device=t.device, dtype=t.dtype) + ang = 2 * np.pi * t * freqs + return torch.cat([t, torch.cos(ang), torch.sin(ang)], dim=-1) + + +class IFQLTorch: + """One trained IFQL agent, in torch. `q(obs, actions)` and `sample_actions(obs, generator)`.""" + + def __init__(self, bundle, device="cpu"): + if isinstance(bundle, (str, bytes)) or hasattr(bundle, "__fspath__"): + self.path = str(bundle) + bundle = torch.load(bundle, map_location="cpu", weights_only=False) + else: + self.path = bundle.get("path", "") + if bundle.get("kind") != "ifql_bundle_v1": + raise RuntimeError(f"not an IFQL bundle: kind={bundle.get('kind')!r}") + self.device = torch.device(device) + self.P = _Params(bundle["params"], self.device) + c = dict(bundle["config"]) + self.cfg = c + self.feat_stats = bundle.get("feat_stats", "") + self.task = bundle.get("task", "") + self.seed = int(bundle.get("seed", -1)) + self.step = int(bundle.get("step", -1)) + self.obs_mode = bundle.get("obs_mode", "dino") + if c.get("encoder"): + raise NotImplementedError("the torch port covers the vector-observation variant (encoder=None); " + f"this bundle was trained with encoder={c['encoder']!r}") + self.mlp_class = c.get("mlp_class", "resmlp") + self.layer_norm = bool(c.get("layer_norm", True)) + self.actor_layer_norm = bool(c.get("actor_layer_norm", True)) + self.action_dim = int(c["action_dim"]) + self.num_samples = int(c.get("num_samples", 128)) + self.flow_steps = int(c.get("flow_steps", 10)) + self.q_agg = c.get("q_agg", "mean") + self.n_value_blocks = len(c["value_hidden_dims"]) + self.n_actor_blocks = len(c["actor_hidden_dims"]) + # critic ensemble size, read off the parameter shapes rather than assumed + k = self.P["modules_critic/value_net/Dense_0/kernel"] + self.n_critics = int(k.shape[0]) if k.dim() == 3 else None + + # ---- read-outs --------------------------------------------------------- + def _value_net(self, prefix, x, ens): + if self.mlp_class == "resmlp": + return _residual_mlp(self.P, prefix, x, self.n_value_blocks, self.layer_norm, ens) + return _plain_mlp(self.P, prefix, x, self.n_value_blocks, self.layer_norm, ens) + + @torch.no_grad() + def q(self, obs, actions, aggregate=True): + """obs [B, d], actions [B, adim] -> Q [B] (aggregated with q_agg) or [E, B].""" + obs = torch.as_tensor(obs, dtype=torch.float32, device=self.device) + actions = torch.as_tensor(actions, dtype=torch.float32, device=self.device) + inp = torch.cat([obs, actions], -1) + ens = self.n_critics + if ens is not None: + inp = inp.unsqueeze(0).expand(ens, *inp.shape) + logits = self._value_net("modules_critic/value_net", inp, ens) + qs = hl_gauss_from_logits(logits) + if ens is None or not aggregate: + return qs + return qs.min(dim=0).values if self.q_agg == "min" else qs.mean(dim=0) + + @torch.no_grad() + def v(self, obs): + """obs [B, d] -> V [B] (the expectile value head; num_ensembles=1, so no ensemble axis).""" + obs = torch.as_tensor(obs, dtype=torch.float32, device=self.device) + return hl_gauss_from_logits(self._value_net("modules_value/value_net", obs, None)) + + @torch.no_grad() + def flow_velocity(self, obs, actions, t): + inp = torch.cat([obs, actions, _embed_times(t)], -1) + if self.mlp_class == "resmlp": + return _residual_mlp(self.P, "modules_actor_flow/mlp", inp, self.n_actor_blocks, + self.actor_layer_norm, None) + return _plain_mlp(self.P, "modules_actor_flow/mlp", inp, self.n_actor_blocks, + self.actor_layer_norm, None) + + @torch.no_grad() + def flow_candidates(self, obs, num_samples=None, generator=None, noise=None): + """obs [B, d] -> candidate actions [B, N, adim]: N unit normals pushed through `flow_steps` Euler + steps of the behavioural flow, clipped to [-1, 1] (agents/ifql.py sample_actions, verbatim).""" + obs = torch.as_tensor(obs, dtype=torch.float32, device=self.device) + B = obs.shape[0] + N = int(num_samples if num_samples is not None else self.num_samples) + if noise is None: + # A torch.Generator is bound to one device, and callers seed a CPU one (it is the eval seed, + # which must give the same draws wherever the job lands), so draw on the generator's own + # device and move. Passing a CPU generator with device="cuda" is a hard error. + dev = self.device if generator is None else torch.device(getattr(generator, "device", "cpu")) + noise = torch.randn(B, N, self.action_dim, generator=generator, device=dev) + a = noise.to(device=self.device, dtype=torch.float32).reshape(B, N, self.action_dim) + o = obs.unsqueeze(1).expand(B, N, obs.shape[-1]) + for i in range(self.flow_steps): + t = torch.full((B, N, 1), i / self.flow_steps, device=self.device, dtype=torch.float32) + a = a + self.flow_velocity(o, a, t) / self.flow_steps + return torch.clamp(a, -1.0, 1.0) + + @torch.no_grad() + def sample_actions(self, obs, num_samples=None, generator=None, noise=None, return_all=False): + """IFQL's action: arg-max Q over `num_samples` flow samples. obs [B, d] -> [B, adim].""" + cand = self.flow_candidates(obs, num_samples=num_samples, generator=generator, noise=noise) + B, N, A = cand.shape + q = self.q(obs.repeat_interleave(N, 0) if torch.is_tensor(obs) else + torch.as_tensor(obs, dtype=torch.float32, device=self.device).repeat_interleave(N, 0), + cand.reshape(B * N, A)).reshape(B, N) + idx = q.argmax(1) + act = cand[torch.arange(B, device=cand.device), idx] + return (act, cand, q, idx) if return_all else act + + def describe(self): + return {"backend": "ifql", "ckpt": self.path, "task": self.task, "seed": self.seed, + "train_step": self.step, "obs_mode": self.obs_mode, "n_critics": self.n_critics, + "q_agg": self.q_agg, "num_samples": self.num_samples, "flow_steps": self.flow_steps, + "mlp_class": self.mlp_class, "action_dim": self.action_dim, + "feat_stats": self.feat_stats, + "scored": "first action of the chunk, HL-Gauss Q, mean over the critic ensemble"} diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/rsm_planner.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/rsm_planner.py new file mode 100644 index 0000000000000000000000000000000000000000..b241aec7c7c5b745d34c7478dd663da7224b8b5b --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/rsm_planner.py @@ -0,0 +1,507 @@ +"""Best-of-N planning over RISE's diffusion policy with a successor-model scorer (rsm_rise E1). + +Mixed into IDQL (robomimic/algo/idql.py, the class RISE's `-cn iql_diffusion +training=` recipe +actually trains: `IQLDiffusionTrainingConfig.algo` defaults to `idql`) and IQLDiffusion +(iql_diffusion.py, the advantage-weighted class, E2). Both classes expose +`_sample_action_chunks(obs_dict, goal_dict) -> naction [B, Tp, ac]` (their released DDPM/DDIM sampler, +unchanged) and route `get_action` through `plan_get_action` below. + +Per control step with plan_n = N > 1: + 1. the obs dict ([B, To, ...]) is repeated N times (candidate n of env b sits at row b*N + n); + 2. the sampler runs ONCE on the B*N batch -> N 16-step chunks per env; + 3. the scorer gets the CURRENT frame (index To-1 == -1 of the obs stack) and the first `plan_chunk` + actions of the executed window naction[:, To-1 : To-1+plan_chunk] (the 8 actions that would run); + 4. a rule picks one candidate per env; its executed window naction[:, To-1 : To-1+Ta] goes to the + rollout loop's action queue exactly as the released path's single sample does. +plan_n = 1 (or None) is the released behaviour, bit for bit. + +Rules: argmax | softmax (temperature plan_temp on Q̄) | topk_uniform (uniform among the plan_topk best) +| random (S3H2: ignores Q̄) | permuted (S3H3: Q̄ shuffled across candidates, then argmax) | argmin. + +Backends: mlp / dwm / mc (rsm_scorer.RSMScorer on the pooled DINO state), ifql (gen_q#264: an IFQL +critic -- the flow variant of IDQL -- trained by rsm_rise/code/ifql/train_ifql.py on the same provenance +reward and the same pooled DINO state, read through the torch port robomimic/algo/ifql_torch.py) and iql (S3H4: the fork's own +IQL critic nets, min over the ensemble, on the first action of the chunk, as +sim_pipeline.eval.rollout_policies.robomimic_sampling_rollout_policy does at N=128). With backend iql, +`rsm_ckpt` may be an S0A robomimic .pth whose critics are used, or "" for the loaded policy's own. + +Config keys (algo config, all with released-behaviour defaults; hydra: training.=): + plan_n, plan_rule, plan_temp, plan_topk, plan_chunk, plan_particles, plan_mode {d1,fold,recursive}, + plan_depth, plan_beta, plan_gamma, plan_flow_steps, plan_seed (-1: no reseed; >=0: CRN seed reused at + every step, i.e. the same particle noise at every state), rsm_backend {mlp,dwm,mc,iql}, rsm_ckpt, + rsm_hop_ckpt, rsm_feat_stats, rsm_img_layout {chw,rise_t}, rsm_dwm_module, rsm_backend also accepts + `ifql` (rsm_ckpt = an ifql_bundle.pt, rsm_feat_stats = the task's cache feat_stats.npz), + plan_score {prob,logit,prob_log,conformal_lcb} (prob: rank by mean σ = released; logit: rank by the mean + raw logit over particles; prob_log: rank by the SAME quantity as prob, folded in the log-complement domain + so it does not tie ~half the candidates at exactly 1.0 when σ saturates (mlp backend, d1/fold only); + conformal_lcb: rank by the plan_lcb_quantile quantile over particles of the per-particle + success probability — a pessimistic read-out that prefers candidates whose future is reliably good), + plan_rescore_top / plan_particles_rescore (both > 0: two-stage screening, the top-K candidates of the + ranking array are rescored with M particles), plan_temperature (0: the checkpoint's calib.json T if present + else 1; > 0 overrides; enters the sigmoid only, the logit ranking is T-free). +The per-step log records the ranking array (`score_*`, `ties_at_max`) and every read-out the backend produced +(`prob_*`, `logit_*`, `prob_log_*`, `lcb_*`). +""" +from __future__ import annotations + +import math +import time +from collections import OrderedDict + +import numpy as np +import torch + +PLANNER_DEFAULTS = OrderedDict( + plan_n=None, + plan_rule="argmax", + plan_temp=0.2, + plan_topk=8, + plan_chunk=8, + plan_particles=16, + plan_mode="fold", + plan_depth=2, + plan_beta=0.95, + plan_gamma=0.99, + plan_flow_steps=8, + plan_seed=-1, + rsm_backend="mlp", # mlp | dwm | mc | iql | ifql + rsm_ckpt="", + rsm_hop_ckpt="", + rsm_feat_stats="", + rsm_img_layout="chw", + rsm_dwm_module="dwm_readout", + plan_score="prob", # prob | logit | prob_log | conformal_lcb + plan_rescore_top=0, # two-stage screening: rescore the top-K (0 = off) + plan_particles_rescore=0, # ... with M particles (0 = off) + plan_temperature=0.0, # 0: checkpoint's calib.json T (else 1.0); > 0 overrides + plan_lcb_quantile=0.1, # plan_score=conformal_lcb: the particle quantile that ranks (0.1 = 10th pct) + plan_max_rows=0, # >0: override the scorer row-slice width (rsm_scorer.MAX_ROWS, 65536). + plan_chain_cap=0, # coin chain (gen_q#267): 0 = compute the cap from the 1e-3 tail + plan_chain_tail_eps=1e-3, # P(walk longer than cap) <= this; the cap is a guard, not a tuning knob + plan_chain_seed=-1, # <0 = follow the cell's eval seed + # Candidates x particles per read-out slice. The CRN noise is drawn + # once up front and indexed by particle, so the estimate is invariant + # to this -- it is purely a memory knob, unlike plan_sample_batch. + # 65536 is 8x what the grid ever hit (128 cand x 64 part = 8192) and + # OOMs an 80 GB card at plan_n=2048 in _q_fold_logit. + plan_sample_batch=0, # >0: run the DDPM sampler over at most this many candidate rows at a + # time and concatenate. 0 = off (one call, released behaviour, bit for + # bit). The sampler is what caps N: at plan_n=2048 the released path + # builds a [B*N, Tp, ac] denoising batch and OOMs an 80 GB card (75 GB + # allocated) in idql._sample_action_chunks, long before the RSM scorer + # is reached. Chunking changes how much noise the sampler draws per + # call, so it is OFF by default: every existing cell stays identical. +) +# E2 (training-time advantage) keys, IQLDiffusion only +ADV_DEFAULTS = OrderedDict( + rsm_adv_v_expectile=0.5, + rsm_adv_v_samples=16, + rsm_adv_scale="td", # td: Q̄/(1-γ), V̄/(1-γ); std: batch-standardised advantage + rsm_adv_permute=False, # S3H6: permute the advantage within each batch +) +RULES = ("argmax", "softmax", "topk_uniform", "random", "permuted", "argmin") + + +def _cfg_get(algo_config, key, default): + try: + v = algo_config[key] + except (KeyError, RuntimeError, AttributeError): + return default + if v is None: + return default if key != "plan_n" else None + return v + + +def select(scores, rule, temp=0.2, topk=8, generator=None): + """scores [B, N] (cpu float) -> chosen index [B] (long, cpu) under `rule`. + Every tensor is created with an explicit device: sim_pipeline's setup_experiment sets the default tensor + type to CUDA, so a bare torch.arange / randint would land on the GPU and break the cpu indexing.""" + B, N = scores.shape + # float64 in -> float64 through: plan_score=prob_log ranks by log(1 - Q̄), whose values sit near + # -depth * logit (~ -490 at depth 4 on threading). A .float() here would have quietly undone the + # whole point of that read-out by putting the comparison back at 6e-5 resolution. Every other + # read-out arrives as float32 and is unaffected. + scores = scores.detach().cpu() + scores = scores.double() if scores.dtype == torch.float64 else scores.float() + if rule == "argmax": + return scores.argmax(1) + if rule == "argmin": + return scores.argmin(1) + if rule == "random": + return torch.randint(0, N, (B,), generator=generator, device="cpu") + if rule == "permuted": + perm = torch.stack([torch.randperm(N, generator=generator, device="cpu") for _ in range(B)]) + return torch.gather(scores, 1, perm).argmax(1) + if rule == "softmax": + p = torch.softmax(scores / max(float(temp), 1e-6), dim=1) + return torch.multinomial(p, 1, generator=generator)[:, 0] + if rule == "topk_uniform": + k = min(int(topk), N) + top = scores.topk(k, dim=1).indices # [B, k] + pick = torch.randint(0, k, (B,), generator=generator, device="cpu") + return top[torch.arange(B, device="cpu"), pick] + raise ValueError(f"unknown plan_rule {rule}; choose from {RULES}") + + +class IQLCriticBackend: + """S3H4: score candidates with RISE's own IQL critic ensemble (min over critics) on the first + action, on the current (unstacked) obs dict, like RobomimicSamplingRolloutPolicy.""" + + def __init__(self, critics, own=True, ckpt=""): + self.critics = critics + self.own = own + self.ckpt = ckpt + + @classmethod + def from_checkpoint(cls, ckpt_path, device): + import robomimic.utils.file_utils as FileUtils + policy, _ = FileUtils.policy_from_checkpoint(ckpt_path=ckpt_path, device=device, verbose=False) + algo = policy.policy + # RISE's own eval (sim_pipeline/eval/rollout_policies/robomimic_sampling_rollout_policy.py:96) scores with + # nets["critic"], the ONLINE ensemble, not the target copy. Default to that; RSM_IQL_TARGET=1 restores the + # old behaviour so the two can be compared. + import os as _os + _want_target = _os.environ.get("RSM_IQL_TARGET", "0") == "1" + if _want_target and "critic_target" in algo.nets: + critics = algo.nets["critic_target"] + else: + critics = algo.nets["critic"] if "critic" in algo.nets else algo.nets["critic_target"] + return cls(list(critics), own=False, ckpt=ckpt_path) + + @torch.no_grad() + def score(self, obs_t, chunks, goal_dict=None): + a0 = chunks[:, 0] + qs = [critic(obs_dict=obs_t, acts=a0, goal_dict=goal_dict) for critic in self.critics] + return torch.cat(qs, 1).min(dim=1).values + + def describe(self): + return {"backend": "iql", "n_critics": len(self.critics), "own_critic": self.own, "ckpt": self.ckpt, + "scored": "first action, min over ensemble"} + + +class IFQLCriticBackend: + """gen_q#264: score candidates with an IFQL critic -- the flagship's second value-function baseline. + + IFQL (implicit flow Q-learning, the flow variant of IDQL) is trained by rsm_rise/code/ifql/train_ifql.py + on the SAME binary data-provenance reward every other column uses, over the SAME observation the RSM + scorer sees (the pooled frozen-DINOv2 state of the current frame, z-scored with the Stage-1 cache's + feat_stats.npz). Its critic is an HL-Gauss two-hot Q, so a score is already on the [0, 1] + "discounted average provenance label" scale. + + Like the `iql` backend, and for the same reason, the Q is read on the FIRST action of the candidate + chunk (an IFQL critic is a single-step Q over (s, a), so the chunk beyond a_0 is not part of its input) + and the ensemble is aggregated the way IFQL itself aggregates it at action time (`q_agg`, mean by + default -- min for the RISE/IQL critic is that method's own convention, not ours to impose here). + + Configured through the usual planner keys: `rsm_backend=ifql`, `rsm_ckpt=<...>/ifql_bundle.pt`, + `rsm_feat_stats=/feat_stats.npz`. The successor-model knobs (plan_beta, plan_depth, + plan_particles, plan_score, ...) are carried by the launcher but never read, exactly as for `iql`. + """ + + def __init__(self, ckpt, feat_stats, device, img_layout="chw", cams=None, proprio_keys=None): + from robomimic.algo.ifql_torch import IFQLTorch + from robomimic.algo.rsm_scorer import PooledDinoState, CAMS, PROPRIO_KEYS + self.ckpt = ckpt + self.agent = IFQLTorch(ckpt, device=device) + if not feat_stats: + feat_stats = self.agent.feat_stats + if not feat_stats: + raise RuntimeError("rsm_backend=ifql needs rsm_feat_stats (or a bundle that records one)") + self.state = PooledDinoState(feat_stats, cams=cams or CAMS, + proprio_keys=proprio_keys or PROPRIO_KEYS, + img_layout=img_layout).to(device) + self.feat_stats = feat_stats + + @torch.no_grad() + def state_from_obs(self, obs_t): + return self.state(obs_t) + + @torch.no_grad() + def score(self, x, chunks, goal_dict=None): + """x [B*N, d] z-scored DINO states, chunks [B*N, chunk, adim] -> Q [B*N].""" + return self.agent.q(x, chunks[:, 0]) + + def describe(self): + d = self.agent.describe() + d.update({"feat_stats": self.feat_stats, "state_dim": int(self.state.d)}) + return d + + +class RSMPlannerMixin: + """See module docstring. Requires `self.algo_config`, `self.nets`, `self.device`, `self.ac_dim` + and `_sample_action_chunks` on the host class.""" + + # ---- configuration ----------------------------------------------------- + def configure_planner(self, **kw): + """Override planner keys at run time (the eval config, not the checkpoint, decides the planner).""" + unknown = set(kw) - set(PLANNER_DEFAULTS) - set(ADV_DEFAULTS) + if unknown: + raise KeyError(f"unknown planner keys {sorted(unknown)}") + ov = getattr(self, "_planner_overrides", None) or {} + ov.update(kw) + self._planner_overrides = ov + self._planner_scorer = None + self._planner_cfg_cache = None + + def planner_cfg(self): + cache = getattr(self, "_planner_cfg_cache", None) + if cache is not None: + return cache + cfg = {} + for k, d in list(PLANNER_DEFAULTS.items()) + list(ADV_DEFAULTS.items()): + cfg[k] = _cfg_get(self.algo_config, k, d) + cfg.update(getattr(self, "_planner_overrides", None) or {}) + if cfg["plan_n"] is not None: + cfg["plan_n"] = int(cfg["plan_n"]) + cfg["plan_sample_batch"] = int(cfg["plan_sample_batch"] or 0) + cfg["plan_max_rows"] = int(cfg["plan_max_rows"] or 0) + if cfg["plan_rule"] not in RULES: + raise ValueError(f"plan_rule={cfg['plan_rule']} not in {RULES}") + self._planner_cfg_cache = cfg + return cfg + + @property + def planning_enabled(self): + n = self.planner_cfg()["plan_n"] + return n is not None and n > 1 + + def _get_scorer(self): + sc = getattr(self, "_planner_scorer", None) + if sc is not None: + return sc + cfg = self.planner_cfg() + if cfg["rsm_backend"] == "iql": + if cfg["rsm_ckpt"]: + sc = IQLCriticBackend.from_checkpoint(cfg["rsm_ckpt"], self.device) + else: + if "critic" not in self.nets or len(self.nets["critic"]) == 0: + raise RuntimeError("rsm_backend=iql needs a checkpoint with critic nets") + sc = IQLCriticBackend(list(self.nets["critic"]), own=True) + elif cfg["rsm_backend"] == "ifql": + if not cfg["rsm_ckpt"]: + raise RuntimeError("rsm_backend=ifql needs rsm_ckpt (an ifql_bundle.pt)") + sc = IFQLCriticBackend(cfg["rsm_ckpt"], cfg["rsm_feat_stats"], self.device, + img_layout=cfg["rsm_img_layout"]) + else: + from robomimic.algo.rsm_scorer import RSMScorer, MAX_ROWS as _SCORER_MAX_ROWS + if not cfg["rsm_ckpt"] or not cfg["rsm_feat_stats"]: + raise RuntimeError("rsm_backend=%s needs rsm_ckpt and rsm_feat_stats" % cfg["rsm_backend"]) + # TAIL ALARM (2026-09-21): one hop is a Geom(1-beta) draw of mean 1/(1-beta) frames, discounted by + # gamma**(1/(1-beta)); after plan_depth hops the fold DROPS gamma**(depth/(1-beta)) of the gamma-mass. + # Nothing ever checked it (depth was swept and picked by success); say so loudly when most of the + # mass is dropped, so the read-out is understood as a short-horizon predictor, not a gamma-value. + # The TAIL ALARM measures the DETERMINISTIC fold's dropped gamma-mass. The coin chain drops + # nothing by construction (its cap is set so P(truncation) <= 1e-3), so firing it there would be + # a false alarm; the chain prints its own banner from RSMScorer.__init__ and its own CAP ALARM. + _tail = (0.0 if cfg["plan_mode"] in ("chain", "chain_rb") else + float(cfg["plan_gamma"]) ** (int(cfg["plan_depth"]) / (1.0 - float(cfg["plan_beta"])))) + if _tail > 0.5: + import sys as _sys + print(f"[rsm_planner] TAIL ALARM: depth={cfg['plan_depth']} beta={cfg['plan_beta']} gamma={cfg['plan_gamma']} " + f"drops {_tail:.0%} of the gamma-mass -- the read-out covers ~{int(cfg['plan_depth'])/(1-float(cfg['plan_beta'])):.0f} frames", file=_sys.stderr) + sc = RSMScorer(backend=cfg["rsm_backend"], ckpt=cfg["rsm_ckpt"], hop_ckpt=cfg["rsm_hop_ckpt"], + feat_stats=cfg["rsm_feat_stats"], mode=cfg["plan_mode"], depth=cfg["plan_depth"], + beta=cfg["plan_beta"], gamma=cfg["plan_gamma"], n_particles=cfg["plan_particles"], + flow_steps=cfg["plan_flow_steps"], device=self.device, + img_layout=cfg["rsm_img_layout"], dwm_module=cfg["rsm_dwm_module"], + score_kind=cfg["plan_score"], lcb_quantile=cfg["plan_lcb_quantile"], + rescore_top=cfg["plan_rescore_top"], + n_particles_rescore=cfg["plan_particles_rescore"], + temperature=cfg["plan_temperature"], + max_rows=cfg["plan_max_rows"] or _SCORER_MAX_ROWS, + chain_cap=int(cfg.get("plan_chain_cap", 0) or 0), + chain_tail_eps=float(cfg.get("plan_chain_tail_eps", 1e-3) or 1e-3), + chain_seed=(None if int(cfg.get("plan_chain_seed", -1) or -1) < 0 + else int(cfg["plan_chain_seed"]))) + if sc.chunk != int(cfg["plan_chunk"]): + raise RuntimeError(f"plan_chunk={cfg['plan_chunk']} but the RSM was trained on chunk {sc.chunk}") + self._planner_scorer = sc + return sc + + def planner_describe(self): + cfg = dict(self.planner_cfg()) + if self.planning_enabled or cfg["rsm_ckpt"]: + try: + cfg["scorer"] = self._get_scorer().describe() + except Exception as e: # description must never break an eval + cfg["scorer"] = {"error": repr(e)} + return cfg + + # ---- logging ----------------------------------------------------------- + def pop_plan_log(self): + log = getattr(self, "_plan_log", None) or [] + self._plan_log = [] + return log + + # ---- the action -------------------------------------------------------- + def _executed_window(self, naction): + To = self.algo_config.horizon.observation_horizon + Ta = self.algo_config.horizon.action_horizon + Tp = self.algo_config.horizon.prediction_horizon + start = To - 1 + if Tp == 1: # IQLDiffusion's no-chunking quirk + start -= 1 + return naction[:, start:start + Ta], start + + def _sample_chunked(self, rep, rep_goal, sample_batch): + """`_sample_action_chunks` over at most `sample_batch` rows at a time, concatenated. + + sample_batch <= 0 is the released path: a single call on the whole [B*N, ...] batch. The split is + purely a memory measure -- rows are independent under the sampler -- but it does change the order in + which the DDPM chain consumes the RNG, so it is opt-in via `training.plan_sample_batch`.""" + rows = rep[next(iter(rep))].shape[0] + if sample_batch <= 0 or rows <= sample_batch: + return self._sample_action_chunks(rep, rep_goal) + out = [] + for lo in range(0, rows, sample_batch): + hi = min(lo + sample_batch, rows) + sl = {k: v[lo:hi] for k, v in rep.items()} + sl_goal = None if rep_goal is None else {k: v[lo:hi] for k, v in rep_goal.items()} + out.append(self._sample_action_chunks(sl, sl_goal)) + return torch.cat(out, dim=0) + + @torch.no_grad() # the rollout path has NO no_grad anywhere (sim_pipeline/eval/rollout.py + # -> robomimic_rollout_policy.predict -> get_action), so the released + # DDPM sampler retained an autograd graph across all 100 inference + # timesteps: ~75 GB of live activations at plan_n=2048, which is what + # actually capped the candidate-count ladder. Forward numerics and RNG + # draws are identical under no_grad, so every cell already on disk is + # unchanged; this only stops the graph being built. + def plan_get_action(self, obs_dict, goal_dict=None): + cfg = self.planner_cfg() + N = cfg["plan_n"] or 1 + if N <= 1: + naction = self._sample_action_chunks(obs_dict, goal_dict) + action, _ = self._executed_window(naction) + return action + + t0 = time.time() + keys = list(obs_dict.keys()) + B = obs_dict[keys[0]].shape[0] + rep = {k: v.repeat_interleave(N, 0) for k, v in obs_dict.items()} + rep_goal = None if goal_dict is None else {k: v.repeat_interleave(N, 0) for k, v in goal_dict.items()} + naction = self._sample_chunked(rep, rep_goal, cfg["plan_sample_batch"]) # [B*N, Tp, ac] + t_sample = time.time() - t0 + + _, start = self._executed_window(naction) + chunk = int(cfg["plan_chunk"]) + cand = naction[:, start:start + chunk] # [B*N, chunk, ac] + obs_t = {k: v[:, -1] for k, v in obs_dict.items()} # current frame (To-1) + + t1 = time.time() + rule = cfg["plan_rule"] + scorer = None + q_prob = q_logit = q_lcb = q_problog = None # every read-out of the RSM scorer (for the log) + if rule == "random": + scores = torch.zeros(B * N, device=naction.device) + else: + scorer = self._get_scorer() + if isinstance(scorer, IQLCriticBackend): + obs_rep_t = {k: v[:, -1] for k, v in rep.items()} + scores = scorer.score(obs_rep_t, cand, goal_dict=rep_goal) + elif isinstance(scorer, IFQLCriticBackend): + # DINO is the expensive part, so encode the B current frames ONCE and repeat the state + # across the N candidates (the same thing the RSM path does below). + x = scorer.state_from_obs(obs_t).repeat_interleave(N, 0) + scores = scorer.score(x, cand) + else: + st = scorer.state_from_obs(obs_t) # B states + # The SCORER repeats its own state (gen_q#268). This line used to rebuild the + # namespace here as (x, tok, pr) and dropped the pixel backends' `img`: + # state_from_obs built LeWM's frames and the next line threw them away, so _inputs + # saw img=None and _rows died on `None.shape[0]` -- which is why no LeWM eval cell + # ever landed. A field list maintained in the caller goes stale; RSMScorer.repeat_state + # repeats whatever the state carries. + st_rep = scorer.repeat_state(st, N) + seed = cfg["plan_seed"] + scores = scorer.score(st_rep, cand, seed=None if seed is None or int(seed) < 0 else int(seed)) + q_prob = getattr(scorer, "last_q", None) + q_logit = getattr(scorer, "last_q_logit", None) + q_lcb = getattr(scorer, "last_q_lcb", None) + q_problog = getattr(scorer, "last_q_problog", None) + t_score = time.time() - t1 + + # plan_score=prob_log hands back a float64 array whose values sit near -depth * logit (about -490 at + # depth 4 on threading, where the reward logits are ~121). float32's spacing at that magnitude is + # 6e-5, which is still far below the O(1) gaps between candidates, but casting down would put the + # ranking back in the regime of "distinct candidates collapse to one float" that this read-out + # exists to leave -- and would make the 1e-6 tie tolerance below narrower than one ULP. So keep + # float64 when that is what the scorer produced; every other read-out is float32 exactly as before. + _sc = scores.detach().cpu() + s = (_sc.double() if _sc.dtype == torch.float64 else _sc.float()).view(B, N) + p = s if q_prob is None else q_prob.detach().float().cpu().view(B, N) + lg = None if q_logit is None else q_logit.detach().float().cpu().view(B, N) + lc = None if q_lcb is None else q_lcb.detach().float().cpu().view(B, N) + pl = None if q_problog is None else q_problog.detach().double().cpu().view(B, N) + gen = getattr(self, "_plan_generator", None) + if gen is None and cfg["plan_seed"] is not None and int(cfg["plan_seed"]) >= 0: + gen = torch.Generator().manual_seed(int(cfg["plan_seed"])) + self._plan_generator = gen + idx = select(s, rule, temp=cfg["plan_temp"], topk=cfg["plan_topk"], generator=gen) + + ar_dev = torch.arange(B, device=naction.device) + chosen = naction.view(B, N, *naction.shape[1:])[ar_dev, idx.to(naction.device)] + ar = torch.arange(B, device="cpu") + action, _ = self._executed_window(chosen) + + log = getattr(self, "_plan_log", None) + if log is None: + log = self._plan_log = [] + entry = { + "n": N, "rule": rule, "idx": idx.tolist(), + "score_kind": cfg["plan_score"] if q_prob is not None else ("none" if rule == "random" else "prob"), + # the RANKING array (Q̄ or Q̄_logit per plan_score; the IQL critic's Q for backend iql) + "score_chosen": s[ar, idx].tolist(), + "score_max": s.max(1).values.tolist(), "score_mean": s.mean(1).tolist(), + "score_std": s.std(1).tolist() if N > 1 else [0.0] * B, + "score_min": s.min(1).values.tolist(), + # ties at the max of the ranking array (argmax picks the first of them = uniform over the tied set since + # candidates are exchangeable) and saturation of the probability read-out (Q̄ >= 0.999): both are 1 when + # the ranking carries nothing + "ties_at_max": (s >= s.max(1, keepdim=True).values - 1e-6).sum(1).tolist(), + "frac_saturated": (p >= 0.999).float().mean(1).tolist(), + # both read-outs of the RSM scorer, whichever one ranks + "prob_chosen": p[ar, idx].tolist(), "prob_max": p.max(1).values.tolist(), "prob_mean": p.mean(1).tolist(), + # gen_q#266: ties of the PROBABILITY array itself, regardless of which array ranks. `ties_at_max` + # above is the ranking array's, so under plan_score=prob_log it is prob_log's (~1) and says + # nothing about prob. This one makes "prob would have tied ~60 of 128 here, prob_log ties 1" a + # WITHIN-CELL comparison on the same states, instead of a comparison across two sweeps. + # (With a backend that has no probability read-out, p is the ranking array and this equals + # `ties_at_max` by construction.) + "prob_ties_at_max": (p >= p.max(1, keepdim=True).values - 1e-6).sum(1).tolist(), + "prob_ties_at_max_exact": (p == p.max(1, keepdim=True).values).sum(1).tolist(), + "prob_distinct": [int(torch.unique(p[b]).numel()) for b in range(B)], + "t_sample": t_sample, "t_score": t_score, + } + if lc is not None: + entry.update({"lcb_chosen": lc[ar, idx].tolist(), "lcb_max": lc.max(1).values.tolist(), + "lcb_mean": lc.mean(1).tolist(), + "lcb_std": lc.std(1).tolist() if N > 1 else [0.0] * B, + "lcb_quantile": float(getattr(scorer, "lcb_quantile", float("nan"))), + "lcb_ties_at_max": (lc >= lc.max(1, keepdim=True).values - 1e-6).sum(1).tolist()}) + if pl is not None: + # gen_q#266: prob_log is `prob` folded in the log-complement domain, so its tie count is the + # health number that makes the "prob ties ~60 of 128, prob_log ties 1" claim checkable from the + # eval JSON alone -- no re-scoring. Recorded beside `ties_at_max` / `logit_ties_at_max` and + # with the same 1e-6 absolute tolerance, on the float64 array (see the dtype note above). + entry.update({"prob_log_chosen": pl[ar, idx].tolist(), "prob_log_max": pl.max(1).values.tolist(), + "prob_log_mean": pl.mean(1).tolist(), + "prob_log_std": pl.std(1).tolist() if N > 1 else [0.0] * B, + "prob_log_ties_at_max": (pl >= pl.max(1, keepdim=True).values - 1e-6).sum(1).tolist(), + # The 1e-6 ABSOLUTE tolerance above is the convention the other read-outs use, + # but it is not a tie count for this one: prob_log = -log(1 - Q̄) ranges over 40+ + # orders of magnitude (about 124 where every candidate succeeds, about 1e-44 in a + # hopeless state where every logit is -100), so in the hopeless regime 1e-6 + # swallows the whole candidate set and reports 128 ties where the float64 values + # are in fact distinct. These two are tolerance-free and are what the ordering + # claim should be read off: exact bitwise equality, and the count of DISTINCT + # values in the array. + "prob_log_ties_at_max_exact": (pl == pl.max(1, keepdim=True).values).sum(1).tolist(), + "prob_log_distinct": [int(torch.unique(pl[b]).numel()) for b in range(B)]}) + if lg is not None: + entry.update({"logit_chosen": lg[ar, idx].tolist(), "logit_max": lg.max(1).values.tolist(), + "logit_mean": lg.mean(1).tolist(), + "logit_std": lg.std(1).tolist() if N > 1 else [0.0] * B, + "logit_ties_at_max": (lg >= lg.max(1, keepdim=True).values - 1e-6).sum(1).tolist()}) + log.append(entry) + return action diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/rsm_scorer.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/rsm_scorer.py new file mode 100644 index 0000000000000000000000000000000000000000..508b50e1c8cd46bfc2d0ae43b4552f2970a962f5 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/robomimic/algo/rsm_scorer.py @@ -0,0 +1,1575 @@ +"""RSM (successor-model) scorer for RISE policy extraction (rsm_rise Stage 3). + +One object, two jobs: + + score(state, A) -> Q̄[N] E1: rank N candidate 8-step chunks at one state (common random + numbers across the N rows: particle i of every candidate uses the + same flow noise / hop-head noise / restart coin, so the arg-max is a + paired comparison). + advantage(state, A) -> Q̄, V̄_τ E2: Q̄ of the logged (kNN-swapped) chunk and the τ-expectile of Q̄ + over M hop-head chunks at the same state. + +State = the pooled DINO vector RISE's `DinoV2Core(concatenate=True)` produces for the CURRENT frame: +[agentview CLS|GeM (768) | wrist CLS|GeM (768) | eef_pos(3) eef_quat(4) gripper_qpos(2)] = 1545, z-scored +with the Stage-1 cache's feat_stats.npz (mu/sd over all frames, sd floored at 1e-3). Images arrive in the +policy's format (float CHW in [0,1], robomimic ObsUtils.process_frame), which is exactly what +scripts/relabel_dino.py fed DINO when it built the cache (NOT the H/W-transposed layout of RISE's +offline relabel_dino_features.py; `img_layout="rise_t"` reproduces that one if a cache ever needs it). + +Backends + mlp the rsm_libero MLP flow (train_rsm.py blob: enc/rew/flow/rms/config/d_act/enc_kind/d_in), + read-outs d1 / fold / recursive via is_ope.q_fold / q_recursive (crn=True). + dwm the token successor model (stream C): `dwm_readout.load_critic_dwm(path, device)` (module name + `rsm_dwm_module`, default `dwm_readout`), scoring RAW [B,514,384] tokens + RAW proprio; d1 / fold. + mc MC return-to-go MLP on [x | A] (S3H5 control), blob {"net", "config":{"d_in","d_act","width","depth"}}. +The IQL-critic backend (S3H4) lives in rsm_planner.py because it scores the raw obs dict with the +fork's own critic nets, not a DINO state. + +All read-outs return Q̄ on the success-probability scale ([0,1] for d1/fold; recursive is rescaled by +(1-γ) from is_ope's Q/(1-γ)). The E2 caller rescales (1/(1-γ) "td" or batch-standardised "std"). + +Logit read-out (stream E, orchestrator 13:05): d1 / fold also expose Q̄_logit = mean over particles of the +reward head's RAW logit at the last hop state (the DWM read-out's `q_logit` convention), which does not +saturate / tie at 1.0 the way mean-sigmoid does. `score_kind="logit"` ranks by it; `.last_q` / `.last_q_logit` +hold both arrays after every score() call. Temperature T (calib.json next to the checkpoint, or an explicit +override) enters only the sigmoid: q = mean_i σ(logit_i / T); the logit ranking is T-free. Two-stage screening +(rescore_top=K, n_particles_rescore=M): every candidate is scored with n_particles, the top-K by the ranking +array are rescored with M particles and written back (DWM: inside dwm_readout; MLP: here, second draw of the +seeded stream). Log-complement read-out (gen_q#266): `score_kind="prob_log"` ranks by the SAME quantity as "prob" -- the whole +product fold, averaged over particles -- but folded as log(1 - Q) so it never rounds to 1.0. `prob`'s ties are +numerical, not structural: threading cells record reward logits near +121, where σ is exactly 1.0 in float64 +and Q collapses to exactly 1.0 for ~60 of 128 candidates, so the arg-max there is a uniform draw inside the +tied set. `prob_log` is a strictly monotone transform of `prob`'s infinite-precision value, so it keeps the +fold (unlike "logit", which reports only the LAST hop's logit and discards hops 0..L-2) and still totally +orders the candidates. It needs the per-hop reward logits, so it is mlp-backend / d1-fold only, and +`.last_q_problog` holds it after every score() call. Rows of the MLP read-out are processed in slices of at most `max_rows` (65536) with the CRN +noise drawn ONCE for all particles, so plan_particles up to 32768 at N=128 fits and results do not depend on +the slicing. +""" +from __future__ import annotations + +import contextlib +import math +import importlib +import os +import sys +from types import SimpleNamespace + +import numpy as np +import torch +import torch.nn as nn + +RSM_LIBERO_DIR = os.environ.get( + "RSM_LIBERO_DIR", "/proj/dmfexp/zwhong/rsm_rise/code/gen_q/rsm_libero") + +CAMS = ("agentview_image", "robot0_eye_in_hand_image") +PROPRIO_KEYS = ("robot0_eef_pos", "robot0_eef_quat", "robot0_gripper_qpos") +D_TOK, N_PATCH = 384, 256 +STATE_DIM = 2 * 2 * D_TOK + 9 # 1545 + +# "chain"/"chain_rb" (gen_q#267): the coin-terminated beta chain, the ogbench_genq/rsm.py read-out. +# ADDED, never substituted -- d1/fold/recursive are byte-for-byte the code they were. +_MODES = ("d1", "fold", "recursive", "chain", "chain_rb") +# Backends whose state is the RAW token frame + raw proprio rather than the pooled 1545-d vector, and +# whose q() takes the dwm read-out's kwargs (crn_seed, internal two-stage rescore). gen_q#268 adds +# `dinowm`: the same token state and the same read-out interface, with DINO-WM's deterministic latent +# dynamics in place of the occupancy flow (rsm_libero/dinowm_readout.py). +TOKEN_BACKENDS = ("dwm", "dinowm") +# Default read-out module per backend; `rsm_dwm_module` overrides it (that is how stream C injects an +# alternative DWM read-out). Keyed by backend so `rsm_backend=dinowm` needs no extra hydra override +# and the eval JSON records WHICH scorer ran in `rsm_backend` itself -- which is what +# scripts/verdict_table.py classifies the arm on. +READOUT_MODULE = {"dwm": "dwm_readout", "dinowm": "dinowm_readout"} +_SCORE_KINDS = ("prob", "logit", "prob_log", "conformal_lcb") +MAX_ROWS = 65536 # rows (candidates x particles) per slice of the MLP read-out +# coin-terminated beta chain: the cap is chosen so P(walk longer than cap) <= this. The reference +# (ogbench_genq/rsm.py:76) documents exactly this rule -- its REC_MAX_DEPTH = 10 is the ~1e-3 tail at +# beta = 0.98. Never hard-code a cap; call chain_cap(beta, gamma). +CHAIN_TAIL_EPS = 1e-3 + + +def read_calib_temperature(ckpt): + """calib.json next to a checkpoint (rsm_libero/calib_dwm.py: {"T": ...}) -> T, or None if absent/unreadable.""" + try: + cj = os.path.join(os.path.dirname(os.path.abspath(ckpt)), "calib.json") + if os.path.exists(cj): + import json + return float(json.load(open(cj))["T"]) + except Exception as e: # a broken calib file must not break the scorer; T = 1 + print(f"[rsm_scorer] calib.json next to {ckpt} unreadable ({e}); T=1", flush=True) + return None + + +def _rsm_modules(): + """Import rsm_libero's model / train_rsm / is_ope lazily (they are plain top-level modules).""" + if RSM_LIBERO_DIR not in sys.path: + sys.path.insert(0, RSM_LIBERO_DIR) + model = importlib.import_module("model") + train_rsm = importlib.import_module("train_rsm") + is_ope = importlib.import_module("is_ope") + return model, train_rsm, is_ope + + +@contextlib.contextmanager +def seeded(seed, device=None): + """Fork the RNG state and seed it, so a scorer call is reproducible without disturbing the + caller's stream (the diffusion sampler's noise must stay independent of the scorer's).""" + if seed is None or int(seed) < 0: + yield + return + devices = [] + if device is not None and torch.device(device).type == "cuda" and torch.cuda.is_available(): + devices = [torch.device(device)] + with torch.random.fork_rng(devices=devices): + torch.manual_seed(int(seed)) + yield + + +def gem_pool(patch_tokens): + """DinoV2Core's GeM: [B,256,384] -> [B,384] (clamp 1e-6, pow 4, mean over the 16x16 grid, pow 1/4).""" + B = patch_tokens.shape[0] + pd = int(np.sqrt(patch_tokens.shape[-2])) + p = patch_tokens.reshape(B, pd, pd, -1).clamp(min=1e-6).permute(0, 3, 1, 2) + return nn.functional.avg_pool2d(p.pow(4), (pd, pd)).pow(1 / 4).reshape(B, -1) + + +def pooled_from_tokens(tok): + """[B,514,384] (agentview CLS, 256 patches, wrist CLS, 256 patches) -> [B,1536] = z.f16.npy layout.""" + out = [] + for c in range(2): + cls = tok[:, c * (1 + N_PATCH)] + pt = tok[:, c * (1 + N_PATCH) + 1:(c + 1) * (1 + N_PATCH)] + out.append(torch.cat([cls, gem_pool(pt)], -1)) + return torch.cat(out, -1) + + +def expectile(q, tau, iters=50): + """tau-expectile of each row of q [B,M] (tau=0.5 is exactly the mean). + Fixed-point iteration of the asymmetric-least-squares stationarity condition.""" + tau = float(tau) + v = q.mean(1, keepdim=True) + if abs(tau - 0.5) < 1e-12: + return v[:, 0] + for _ in range(iters): + w = torch.where(q > v, torch.full_like(q, tau), torch.full_like(q, 1.0 - tau)) + v_new = (w * q).sum(1, keepdim=True) / w.sum(1, keepdim=True) + if torch.allclose(v_new, v, atol=1e-7, rtol=0): + v = v_new + break + v = v_new + return v[:, 0] + + +# --------------------------------------------------------------------------- # +# state: pooled DINO vector / tokens from the policy's obs dict +# --------------------------------------------------------------------------- # +class PooledDinoState(nn.Module): + """obs dict at ONE time step (values [B, ...], images float CHW in [0,1]) -> z-scored 1545-d state. + + `dino` may be any module with `.backbone_model` (a dinov2 hub model) and `.transform`; by default + RISE's DinoV2Core (frozen, concatenate=True) is instantiated, which is what the cache used.""" + + def __init__(self, feat_stats, cams=CAMS, proprio_keys=PROPRIO_KEYS, backbone="dinov2_vits14", + img_layout="chw", dino=None): + super().__init__() + self.cams = tuple(cams) + self.proprio_keys = tuple(proprio_keys) + self.img_layout = img_layout + if dino is None: + from robomimic.models.obs_core import DinoV2Core + dino = DinoV2Core(input_shape=(3, 84, 84), backbone_name=backbone, frozen=True, concatenate=True) + self.dino = dino.eval() + for p in self.dino.parameters(): + p.requires_grad_(False) + # STATE DEFINITION (Stage 1, final): x = clip((feat - mu) / max(sd, sd_floor), -z_clip, z_clip). + # sd_floor / z_clip come from feat_stats.npz (relabel_dino.py writes them), else PACK.json next + # to it, else the defaults 0.01 / 10 -- identical to rsm_libero data.py._feat. + st = np.load(feat_stats) + mu = np.asarray(st["mu"], np.float32) + sd = np.asarray(st["sd"], np.float32) + sd_floor, z_clip = None, None + if "sd_floor" in st.files: + sd_floor = float(st["sd_floor"]) + if "z_clip" in st.files: + z_clip = float(st["z_clip"]) + pack = os.path.join(os.path.dirname(os.path.abspath(feat_stats)), "PACK.json") + if (sd_floor is None or z_clip is None) and os.path.exists(pack): + import json + pk = json.load(open(pack)) + sd_floor = float(pk.get("sd_floor", 0.01)) if sd_floor is None else sd_floor + z_clip = float(pk.get("z_clip", 10.0)) if z_clip is None else z_clip + self.sd_floor = 0.01 if sd_floor is None else sd_floor + self.z_clip = 10.0 if z_clip is None else z_clip + sd = np.maximum(sd, self.sd_floor).astype(np.float32) + self.register_buffer("mu", torch.as_tensor(mu)) + self.register_buffer("sd", torch.as_tensor(sd)) + self.d = int(mu.shape[0]) + + def normalize(self, feat): + """[B, d] raw [z | proprio] -> the trainer's state (z-score with floored sd, then clip).""" + x = (feat - self.mu) / self.sd + if self.z_clip and self.z_clip > 0: + x = x.clamp(-self.z_clip, self.z_clip) + return x + + def _images(self, obs_t): + ims = [] + for c in self.cams: + im = obs_t[c].float() + if im.dim() == 3: + im = im[None] + if self.img_layout == "rise_t": # RISE's offline relabel: (N,H,W,C)->(N,C,W,H) + im = im.transpose(-1, -2) + ims.append(im) + return ims + + def _proprio(self, obs_t, B): + pr = [obs_t[k].float().reshape(B, -1) for k in self.proprio_keys] + return torch.cat(pr, -1) + + @torch.no_grad() + def forward(self, obs_t): + ims = self._images(obs_t) + feats = [self.dino(im) for im in ims] # each [B, 768] + B = feats[0].shape[0] + x = torch.cat(feats + [self._proprio(obs_t, B)], -1) + if x.shape[1] != self.d: + raise RuntimeError(f"pooled state is {x.shape[1]}-d but feat_stats has {self.d} dims") + return self.normalize(x) + + @torch.no_grad() + def raw_features(self, obs_t): + """Un-normalised [z(1536) | proprio(9)] -- what the cache stores (z as fp16).""" + ims = self._images(obs_t) + feats = [self.dino(im) for im in ims] + B = feats[0].shape[0] + return torch.cat(feats + [self._proprio(obs_t, B)], -1) + + @torch.no_grad() + def tokens(self, obs_t): + """[B,514,384] raw (un-normalised) DINO tokens in the cache's token order, plus the pooled state.""" + ims = self._images(obs_t) + toks, pooled = [], [] + for im in ims: + f = self.dino.backbone_model.forward_features(self.dino.transform(im)) + cls, pt = f["x_norm_clstoken"], f["x_norm_patchtokens"] + toks.append(torch.cat([cls[:, None], pt], 1)) + pooled.append(torch.cat([cls, gem_pool(pt)], -1)) + B = toks[0].shape[0] + tok = torch.cat(toks, 1) + x = torch.cat(pooled + [self._proprio(obs_t, B)], -1) + return tok, self.normalize(x) + + +# --------------------------------------------------------------------------- # +# hop head (Stage 2, bc_arm.py policy_r1.pt) +# --------------------------------------------------------------------------- # +class HopPolicy(nn.Module): + """Wraps a bc_arm.py policy so q_fold / q_recursive can call sample_eps(z, task, eps) on the + z-scored state. bc_arm's `--policy-features raw --feat-scale center` rescales the input by + sd / mean(sd) over the visual block (RawFeat); `zscore` is the identity.""" + + def __init__(self, pol, scale): + super().__init__() + self.pol = pol + self.d_act = int(pol.d_act) if hasattr(pol, "d_act") else int(pol.mu.out_features) + self.register_buffer("scale", torch.as_tensor(scale, dtype=torch.float32)) + + def sample_eps(self, z, task, eps): + z = z * self.scale + if hasattr(self.pol, "sample_eps"): # BCHead, ConcatFlowPolicy + return self.pol.sample_eps(z, task, eps) + # FlowPolicy: its Euler loop started from the supplied noise (CRN) + a = eps + steps = int(getattr(self.pol, "steps", 8)) + for s in range(steps): + k = torch.full((z.shape[0],), 1.0 - s / steps, device=z.device) + a = a + self.pol.velocity(z, task, a, k) / steps + return a + + def sample(self, z, task): + return self.pol.sample(z * self.scale, task) + + +def load_hop_head(path, d_z, n_task, device, feat_sd=None): + model, _, _ = _rsm_modules() + ck = torch.load(path, map_location=device, weights_only=False) + c = ck["config"] + sd_ = ck["pol"] + fam = c.get("policy_family", "concat") + if c.get("policy_features", "raw") != "raw": + raise RuntimeError("hop head must read raw (z-scored) features; got policy_features=" + f"{c.get('policy_features')}") + if fam == "gauss": + d_act = sd_["mu.weight"].shape[0] + pol = model.BCHead(d_z, d_act, n_task) + elif fam == "flow": + d_act = sd_["out.weight"].shape[0] + pol = model.FlowPolicy(d_z, d_act, n_task) + else: + last = max(int(k.split(".")[1]) for k in sd_ if k.startswith("net.") and k.endswith(".weight")) + d_act = sd_[f"net.{last}.weight"].shape[0] + pol = model.ConcatFlowPolicy(d_z, d_act, n_task, width=int(c.get("pol_width", 1024) or 1024), + depth=int(c.get("pol_depth", 4) or 4)) + pol.load_state_dict(sd_) + pol = pol.to(device).eval() + for p in pol.parameters(): + p.requires_grad_(False) + scale = np.ones(d_z, np.float32) + if c.get("feat_scale", "zscore") == "center": + if feat_sd is None: + raise RuntimeError("hop head trained with --feat-scale center needs feat_stats sd") + n_z = d_z - 9 + scale[:n_z] = feat_sd[:n_z] / max(float(feat_sd[:n_z].mean()), 1e-6) + return HopPolicy(pol, scale).to(device), int(c.get("chunk", 8)) + + +def _particle_quantile(qp, p): + """p-quantile over the particle axis of a [B, n] per-particle score matrix (the conformal read-out's + lower confidence bound). torch.quantile caps its input at 2**24 elements, so it is applied row-blockwise.""" + qp = qp.float() + p = float(p) + if not 0.0 < p < 1.0: + raise ValueError(f"plan_lcb_quantile must be in (0, 1), got {p}") + n = qp.shape[1] + if n < 2: + return qp[:, 0].clone() + rows = max(1, (2 ** 24) // n) + if rows >= qp.shape[0]: + return torch.quantile(qp, p, dim=1) + return torch.cat([torch.quantile(qp[i:i + rows], p, dim=1) for i in range(0, qp.shape[0], rows)], 0) + + +# --------------------------------------------------------------------------- # +# MLP read-out with the raw logit (is_ope.q_fold re-implemented; is_ope.py belongs to another stream) +# --------------------------------------------------------------------------- # +@torch.no_grad() +def _q_fold_logit(enc_z, a_chunk, task, *, rew, flow, rms, pol, beta, gamma, depth=1, n_particles=16, + flow_steps=8, temperature=1.0, max_rows=MAX_ROWS, return_particles=False, + return_problog=False, return_trace=False): + """is_ope.q_fold (crn=True) with the reward head's RAW logit collected at the read-out states. + + Returns (q_mean [B], logit_mean [B]): q_mean = the product fold Q_k = c_k + (1 - c_k) γ^h Q_{k+1} with + c_k = σ(R(z_k) / T), Monte-Carlo mean over particles (== q_fold's first output when T = 1); logit_mean = + mean over particles of R(z_L) at the LAST hop (the DWM read-out's q_logit convention; at depth 1 it is the + logit of the d1 read-out). CRN exactly as q_fold: the noise for hop k (x0 [n, D]) and the hop-head noise + (eps [n, d_act]) are drawn from the current torch stream in q_fold's order and tiled over the candidates + (row b*n + i = candidate b, particle i). All of it is drawn ONCE up front, then the B*n rows are processed + in slices of at most `max_rows` rows (whole candidates; particles are sliced too when one candidate alone + exceeds max_rows), so the estimate does not depend on the slicing. + + return_particles=True appends the per-particle fold values q [B, n] (whose mean over dim 1 is q_mean); the + conformal read-out ranks by a low quantile of that row instead of its mean. + + return_trace=True appends a VISUALISATION-ONLY dict of the intermediate quantities the fold already + computes and throws away (gen_q#270, the successor-stitching figure): per hop k in 0..depth-1 the + successor SAMPLES z_k [depth, B, n, D] (fp16), the raw reward logits lg [depth, B, n], the membership + c_k = sigmoid(lg/T) [depth, B, n], the hop-head action chunk that PRODUCED each z_k [depth, B, n, d_act] + (fp16; hop 0's is the candidate itself), and the backward fold's partial values q_k [depth+1, B, n] with + q_k[depth] = 0 and q_k[0] == the per-particle q that q_mean averages. It draws NOTHING extra from the + RNG and writes into preallocated buffers after each existing computation, so q_mean / logit_mean / + prob_log are bit-identical with the flag on and off (tests/test_rsm_trace.py asserts exactly that). + + return_problog=True appends the `prob_log` ranking array [B] (higher is better): the SAME quantity as + q_mean, computed in the log-complement domain so it does not collapse when σ saturates. Derivation + (gen_q#266) -- with G = γ^h, q_L = 0 and q_k = c_k + (1 - c_k) G q_{k+1}: + + 1 - q_k = (1 - c_k) (1 - G q_{k+1}) (exact) + u_k := log(1 - q_k) = logσ(-lg_k / T) + log1p(G expm1(u_{k+1})), u_L = 0 (*) + + using 1 - G q_{k+1} = 1 - G(1 - e^{u_{k+1}}) = 1 + G expm1(u_{k+1}), so the recursion is closed in the + log domain and never reads the float32 q (which is a DENORMAL in a hopeless state and corrupted the + ranking at depth >= 2 when it was used; see the comment in the loop). + + NOTE this is a one-step RECURSION, not a sum over hops. The issue's summed form + `u_0 = Σ_k [log(1-c_k) + log(1 - G q_{k+1})]` double-counts, because log(1 - G q_{k+1}) is not + log(1 - q_{k+1}) unless G = 1, so each term is short a -log(1 - q_{k+1}). Counterexample: L = 2, + c = (0.5, 0.5), G = 0.5 -> q_0 = 0.625, u_0 = -0.98083, while the sum gives -1.67398 (1 - q_0 = 0.1875 + instead of 0.375). (*) is what is implemented, and the test asserts it against a float64 loop. + + Both terms of (*) are well conditioned where the probability form is not: logσ(-lg/T) returns about -121 + for lg/T = 121 instead of log(0) = -inf, and q_{k+1} in [0, 1] with G < 1 gives 1 - G q_{k+1} >= 1 - G + (0.182 at beta=0.95, gamma=0.99), so reusing the fold's own float q_{k+1} there costs only a relative + O(eps) error. The per-particle mean is taken in the SAME domain, so the order is exactly the order of + the infinite-precision q_mean: since mean_i q_i = 1 - mean_i (1 - q_i), ranking by mean_i q_i descending + is ranking by log(mean_i exp(u_i)) ascending, and the array returned is its negation. That mean is + taken as m + log1p(mean_i expm1(u_i - m)) with m = max_i u_i, NOT as logsumexp_i(u_i) - log n; see the + comment at the return for why the logsumexp form collapses in the hopeless regime.""" + _, train_rsm, _ = _rsm_modules() + sample_future = train_rsm.sample_future + dev = enc_z.device + B, D = enc_z.shape + n, depth = int(n_particles), int(depth) + if depth >= 2 and pol is None: + raise RuntimeError(f"fold at depth {depth} needs a hop head (rsm_hop_ckpt)") + beta, gamma = float(beta), float(gamma) + h = 1.0 / (1.0 - beta) + T = float(temperature) if temperature else 1.0 + x0s, epss = [], [] + for k in range(depth): # same draw order as q_fold(crn=True) + x0s.append(torch.randn(n, D, device=dev)) + if k < depth - 1: + epss.append(torch.randn(n, int(pol.d_act), device=dev)) + max_rows = max(int(max_rows), 1) + cand_per = max(1, max_rows // n) + part_per = n if n <= max_rows else max_rows + q_out = torch.empty(B, n, device=dev, dtype=torch.float32) + lg_out = torch.empty(B, n, device=dev, dtype=torch.float32) + # log(1 - q) per particle, accumulated in float64: the saturated values sit near -121 * depth, where + # float32's absolute resolution (1e-5 at that magnitude) is still far below the O(0.1) logit gaps we + # need to order, but float64 costs one [B, n] buffer and removes the question. + lq_out = torch.empty(B, n, device=dev, dtype=torch.float64) if return_problog else None + # visualisation-only buffers (gen_q#270); None unless return_trace + tr = None + if return_trace: + tr = {"z": torch.empty(depth, B, n, D, device=dev, dtype=torch.float16), + "a": torch.empty(depth, B, n, a_chunk.shape[1], device=dev, dtype=torch.float16), + "lg": torch.empty(depth, B, n, device=dev, dtype=torch.float32), + "c": torch.empty(depth, B, n, device=dev, dtype=torch.float32), + "q": torch.zeros(depth + 1, B, n, device=dev, dtype=torch.float32)} + G = gamma ** h + # G capped strictly below 1 for the log-domain fold only: at G == 1 (gamma == 1) the term + # log1p(G * expm1(u)) would be log(0) = -inf for a fully saturated hop. q_out's fold keeps the + # uncapped G, so `prob` and `logit` stay bit-identical. + G_l = min(G, 1.0 - 1e-12) + for b0 in range(0, B, cand_per): + b1 = min(B, b0 + cand_per); nb = b1 - b0 + for p0 in range(0, n, part_per): + p1 = min(n, p0 + part_per); npp = p1 - p0 + z = enc_z[b0:b1].repeat_interleave(npp, 0) + a = a_chunk[b0:b1].repeat_interleave(npp, 0) + tk = task[b0:b1].repeat_interleave(npp, 0) + bq = torch.full((z.shape[0],), beta, device=dev) + cs, lcs, lg = [], [], None + for k in range(depth): + x0 = x0s[k][p0:p1].repeat(nb, 1) + if tr is not None: + tr["a"][k, b0:b1, p0:p1] = a.detach().view(nb, npp, -1).half() + z = sample_future(flow, z, a, tk, bq, rms, flow_steps, n=1, x0=x0) + lg = rew(z, tk).float() + cs.append(torch.sigmoid(lg / T)) + if tr is not None: + tr["z"][k, b0:b1, p0:p1] = z.detach().view(nb, npp, -1).half() + tr["lg"][k, b0:b1, p0:p1] = lg.detach().view(nb, npp) + tr["c"][k, b0:b1, p0:p1] = cs[-1].detach().view(nb, npp) + if return_problog: + # log(1 - c_k) = log σ(-lg_k / T), exact for large positive logits + lcs.append(nn.functional.logsigmoid(-(lg.double() / T))) + if k == depth - 1: + break + a = pol.sample_eps(z, tk, epss[k][p0:p1].repeat(nb, 1)) + q = torch.zeros_like(cs[-1]) + lq = None if not return_problog else torch.zeros_like(lcs[-1]) # u_L = log(1 - q_L) = 0 + for k in range(depth - 1, -1, -1): # backward fold + c = cs[k] + if return_problog: + # u_k = log(1 - c_k) + log(1 - G q_{k+1}), with the second term written WITHOUT q: + # 1 - G q_{k+1} = 1 - G(1 - e^{u_{k+1}}) = 1 + G expm1(u_{k+1}). + # Using the fold's own float32 q_{k+1} here was wrong at the bottom of the range and a + # 90-digit reference caught it: in a hopeless state c_k = sigmoid(-100) = 3.7e-44 is a + # float32 DENORMAL with 2-3 bits of mantissa, and log1p(-G q) is then the same + # magnitude as log(1 - c_k) itself, so the quantisation corrupted the ranking at every + # depth >= 2 (depth 1 was unaffected, which is why the preflight cell looked fine). + # This form is closed in float64: expm1 is exact for tiny u, log1p for tiny arguments, + # and the saturated end is unchanged (u -> -inf gives log1p(-G) = log(1 - G)). + lq = lcs[k] + torch.log1p(G_l * torch.expm1(lq)) + q = c + (1.0 - c) * G * q + if tr is not None: + tr["q"][k, b0:b1, p0:p1] = q.detach().view(nb, npp) + q_out[b0:b1, p0:p1] = torch.nan_to_num(q, nan=0.0).clamp(0.0, 1.0).view(nb, npp) + lg_out[b0:b1, p0:p1] = torch.nan_to_num(lg, nan=0.0).view(nb, npp) + if return_problog: + # nan -> 0.0 is the SAME fallback as q's (q = 0 <-> log(1 - q) = 0), and clamp_max(0) + # mirrors q.clamp(0, 1)'s upper end (q >= 0 <-> u <= 0). + lq_out[b0:b1, p0:p1] = torch.nan_to_num(lq, nan=0.0).clamp(max=0.0).view(nb, npp) + out = [q_out.mean(1), lg_out.mean(1)] + if return_particles: + out.append(q_out) + if return_problog: + # rank = -log(mean_i (1 - q_i)) = -log(mean_i exp(u_i)): monotone in the exact q_mean, higher better. + # + # NOT `logsumexp_i(u_i) - log n`. That form is algebraically right and numerically WRONG at the + # bottom of the range, and it cost a preflight to find out. In a hopeless state every reward logit + # is about -100, so u_i = logsigmoid(-lg_i/T) is about -3.7e-44: distinct per candidate and + # perfectly representable, but `logsumexp` returns m + log(sum exp(u - m)) = m + log n, and adding + # -3.7e-44 to log 16 = 2.7726 loses it completely. Subtracting log n then gives EXACTLY -0.0 for + # all 128 candidates -- measured: 1 distinct value out of 128, i.e. a total collapse, and strictly + # WORSE than `prob` itself (24-95 distinct there). It is the same failure as `prob`'s, mirrored to + # the other end of the range. + # + # So the mean is taken as m + log1p(mean_i expm1(u_i - m)), m = max_i u_i: exactly the same + # quantity, but every step is conditioned for small arguments. expm1 is exact for tiny u_i - m + # (where `exp` would return 1.0 and drop the difference), log1p is exact for tiny means, and log n + # never appears, so nothing is added to an O(1) constant and cancelled back out. Behaviour at the + # saturated-high end is unchanged: there u_i - m spans O(10) and every term is O(1). + m = lq_out.max(dim=1, keepdim=True).values # <= 0 + rel = torch.expm1(lq_out - m).mean(dim=1) # in (-1, 0] + out.append(-(m[:, 0] + torch.log1p(rel.clamp(min=-1.0 + 1e-300)))) + if return_trace: + out.append(tr) + return tuple(out) + + +# --------------------------------------------------------------------------- # +# coin-terminated beta chain (gen_q#267; the reference read-out) +# --------------------------------------------------------------------------- # +# Reference: ogbench_genq/rsm.py (worktree agent-a0467d92d2631bf34) +# rsm.py:113 rec_p = (GAMMA - rec_beta) / (GAMMA * (1 - rec_beta)) +# rsm.py:76 REC_MAX_DEPTH = 10 # "P(depth > 10) ~ 1e-3 at beta = 0.98" +# rsm.py:532 chain_prob(): each level, ALIVE rows flip the coin at rec_p, sample ONE beta-horizon +# midpoint and re-decide the action there; dead rows freeze. After the scan, ONE goal +# read at each row's frozen node. Expectation form -- no max, no per-hop accumulation. +# +# WHY THIS COIN AND NOT gamma**h. A single beta-occupancy draw lands at a frame offset ~ Geom(1-beta) +# (PGF G(z) = (1-beta)/(1-beta z)). The walk composes M = N+1 of them with N ~ Geom(1-p) +# (PGF H(u) = u(1-p)/(1-p u)). Then +# H(G(z)) = (1-beta)(1-p) / (1 - p(1-beta) - beta z), +# a geometric with ratio beta / (1 - p(1-beta)). Demanding that ratio == gamma gives +# p = (gamma - beta) / (gamma (1 - beta)) [rsm.py:113] +# and the normaliser then collapses to exactly (1-gamma). So the composed frame offset is EXACTLY +# Geom(1-gamma): "sampling at beta" reproduces "sampling at gamma" in distribution, not approximately. +# gamma**h with h = 1/(1-beta) is a DIFFERENT number (0.6050 vs 0.5051 at beta=0.98, gamma=0.99) and does +# not satisfy the identity; it also fails the reference's own sanity comment, since 0.6050**10 = 7.0e-3 +# while 0.5051**10 = 1.08e-3 -- the "~1e-3" the reference documents. +# +# HOW IT DIFFERS FROM `_q_fold_logit` (the defect this fixes). The fold computes the ABSORBING hitting +# probability q_k = c_k + (1-c_k) gamma**h q_{k+1}, i.e. "did membership fire anywhere inside a +# gamma**h-geometric window". The chain computes the DISCOUNTED OCCUPANCY read +# Q_gamma = E[ c at a Geom(1-gamma) offset ]. These are different functionals: for constant c the fold +# returns c / (1 - gamma**h (1-c)) and the chain returns c -- a factor ~1/(1-gamma**h) apart (5.5x at +# beta=0.95). They are NOT expected to agree, and the chain is not verified against the fold; it is +# verified against its own exact Rao-Blackwellised form (`chain_rb` below), which is a true identity. + +def chain_continuation_p(beta, gamma): + """The reference's coin (rsm.py:113). Requires beta <= gamma; at beta == gamma the chain degenerates + to a single read (p = 0), which is correct -- one beta-draw already has the gamma horizon.""" + beta, gamma = float(beta), float(gamma) + if not (0.0 <= beta <= gamma < 1.0): + raise ValueError(f"coin chain needs 0 <= beta <= gamma < 1, got beta={beta}, gamma={gamma}") + return (gamma - beta) / (gamma * (1.0 - beta)) + + +def chain_cap(beta, gamma, tail_eps=CHAIN_TAIL_EPS): + """Smallest L with P(N > L) = p**L <= tail_eps. The cap is a TRUNCATION GUARD, not a tuning knob: + the reference's 10 is exactly this rule at beta=0.98 with tail ~1e-3. Never hard-code it.""" + p = chain_continuation_p(beta, gamma) + if p <= 0.0: + return 0 + return int(math.ceil(math.log(float(tail_eps)) / math.log(p))) + + +# alias: RSMScorer has an ATTRIBUTE named chain_cap (the override), so the function needs a +# non-colliding name at the call site inside the class. +chain_cap_fn = chain_cap + + +def _q_chain_logit(enc_z, a_chunk, task, *, rew, flow, rms, pol, beta, gamma, cap=None, + n_particles=16, flow_steps=8, temperature=1.0, max_rows=MAX_ROWS, + tail_eps=CHAIN_TAIL_EPS, rb=False, return_particles=False, seed=None): + """Coin-terminated beta chain, the rsm.py read-out. Returns (q_mean [B], lg_mean [B], + [q_particles [B,n] if return_particles], stats dict). + + Per particle: walk N hops, each gated by an independent Bernoulli(p) coin; at a hop, sample ONE + beta-horizon successor with the trained flow and let the hop head re-decide the action there (the + reference's `occ_bits` + actor re-decide). When the coin fails -- or the cap binds -- the row freezes + and takes ONE more beta-occupancy draw as its goal read, exactly as rsm.py takes one `gl` at the frozen + node. The estimate is the mean over particles of the membership at that read. N+1 beta-draws compose + to a Geom(1-gamma) frame offset (see the module comment). + + Dead rows are PRUNED from the network call, so the expected cost is 1/(1-p) levels of work per row + rather than `cap` levels -- the chain is cheaper than a deterministic depth-L fold whenever + 1/(1-p) < L. CRN: the flow noise for level k and the hop-head noise for level k are drawn ONCE per + particle index and shared across candidates, exactly as `_q_fold_logit` does, so candidate comparisons + stay paired. The coins are likewise shared across candidates per (particle, level), so every candidate + is scored on the SAME set of walk lengths -- otherwise the coin noise alone would reorder candidates. + + rb=True replaces the coin with its exact conditional expectation (Rao-Blackwell): the full depth-(cap+1) + trajectory is run and read k is weighted by the coin's own law, w_k = (1-p) p**k for k < cap and + p**cap for k == cap. E[chain] == chain_rb exactly, so chain_rb is the analytic target the sampled + chain is verified against. It costs `cap+1` levels (no pruning), so it is a TEST path, not the + read-out.""" + _, train_rsm, _ = _rsm_modules() # same lazy import as _q_fold_logit (rsm_libero is not a package) + sample_future = train_rsm.sample_future + dev = enc_z.device + B, D = enc_z.shape + n = int(n_particles) + beta, gamma = float(beta), float(gamma) + p_cont = chain_continuation_p(beta, gamma) + L = int(chain_cap(beta, gamma, tail_eps) if cap is None else cap) + if L >= 1 and pol is None: + raise RuntimeError(f"coin chain at cap {L} needs a hop head (rsm_hop_ckpt)") + T = float(temperature) if temperature else 1.0 + g = None + if seed is not None: # reproducible coins/noise without touching global RNG + g = torch.Generator(device=dev); g.manual_seed(int(seed)) + rnd = lambda *s: torch.randn(*s, device=dev, generator=g) + # CRN draws, per particle index, shared across candidates -- same contract as _q_fold_logit + x0s = [rnd(n, D) for _ in range(L + 1)] # flow noise per level + epss = [rnd(n, int(pol.d_act)) for _ in range(L)] if L >= 1 else [] # hop-head noise per level + coins = torch.rand(L, n, device=dev, generator=g) if L >= 1 else None # the coin, per (level, particle) + + max_rows = max(int(max_rows), 1) + cand_per = max(1, max_rows // n) + part_per = n if n <= max_rows else max_rows + q_out = torch.empty(B, n, device=dev, dtype=torch.float32) + lg_out = torch.empty(B, n, device=dev, dtype=torch.float32) + hops_out = torch.zeros(B, n, device=dev, dtype=torch.int32) + capped_out = torch.zeros(B, n, device=dev, dtype=torch.bool) + levels_run = 0 # measured network levels, for the cost claim + + for b0 in range(0, B, cand_per): + b1 = min(B, b0 + cand_per); nb = b1 - b0 + for p0 in range(0, n, part_per): + p1 = min(n, p0 + part_per); npp = p1 - p0 + R = nb * npp + z = enc_z[b0:b1].repeat_interleave(npp, 0) + a = a_chunk[b0:b1].repeat_interleave(npp, 0) + tk = task[b0:b1].repeat_interleave(npp, 0) + bq = torch.full((R,), beta, device=dev) + # particle index of each row, so the per-particle CRN draws line up after pruning + pid = torch.arange(p0, p1, device=dev).repeat(nb) + + if rb: + # ---- analytic path: full trajectory, coin replaced by its law ----------------- + w = torch.tensor([(1.0 - p_cont) * p_cont ** k for k in range(L)] + [p_cont ** L], + device=dev, dtype=torch.float64) + q = torch.zeros(R, device=dev, dtype=torch.float64) + lg = None + for k in range(L + 1): + z = sample_future(flow, z, a, tk, bq, rms, flow_steps, n=1, x0=x0s[k][pid]) + lg = rew(z, tk).float() + q = q + w[k] * torch.sigmoid(lg / T).double() + levels_run += R + if k < L: + a = pol.sample_eps(z, tk, epss[k][pid]) + q_out[b0:b1, p0:p1] = torch.nan_to_num(q.float(), nan=0.0).clamp(0.0, 1.0).view(nb, npp) + lg_out[b0:b1, p0:p1] = torch.nan_to_num(lg, nan=0.0).view(nb, npp) + hops_out[b0:b1, p0:p1] = L + continue + + # ---- sampled path: coin-terminated walk with row pruning ------------------------- + alive = torch.ones(R, dtype=torch.bool, device=dev) + hops = torch.zeros(R, dtype=torch.int32, device=dev) + for k in range(L): + cont = alive & (coins[k][pid] < p_cont) + idx = cont.nonzero(as_tuple=True)[0] + alive = cont + if idx.numel() == 0: + break + sub = pid[idx] + z_new = sample_future(flow, z[idx], a[idx], tk[idx], bq[idx], rms, flow_steps, + n=1, x0=x0s[k][sub]) + a_new = pol.sample_eps(z_new, tk[idx], epss[k][sub]) + z = z.index_copy(0, idx, z_new) + a = a.index_copy(0, idx, a_new) + hops = hops.index_add(0, idx, torch.ones_like(idx, dtype=torch.int32)) + levels_run += idx.numel() + # ONE goal read at each row's frozen node (rsm.py:559-561), for EVERY row + z = sample_future(flow, z, a, tk, bq, rms, flow_steps, n=1, x0=x0s[L][pid]) + lg = rew(z, tk).float() + levels_run += R + # same NaN fallback and clamp as _q_fold_logit's q_out, so the two read-outs degrade + # identically on a pathological state instead of one of them emitting NaN into the ranking + q_out[b0:b1, p0:p1] = torch.nan_to_num(torch.sigmoid(lg / T), + nan=0.0).clamp(0.0, 1.0).view(nb, npp) + lg_out[b0:b1, p0:p1] = torch.nan_to_num(lg, nan=0.0).view(nb, npp) + hops_out[b0:b1, p0:p1] = hops.view(nb, npp) + capped_out[b0:b1, p0:p1] = alive.view(nb, npp) # still alive after L levels == capped + + hf = hops_out.float() + capped_frac = float(capped_out.float().mean()) + exp_hops = hf[~capped_out].mean() if (~capped_out).any() else torch.tensor(float("nan")) + stats = { + "mode": "chain_rb" if rb else "chain", + "beta": beta, "gamma": gamma, "p_cont": p_cont, "cap": L, "tail_eps": float(tail_eps), + "tail_prob_at_cap": p_cont ** L, "n_particles": n, + # reference values the measurement must reproduce + "E_hops_expected": p_cont / (1.0 - p_cont) if p_cont < 1.0 else float("inf"), + "E_beta_reads_expected": 1.0 / (1.0 - p_cont) if p_cont < 1.0 else float("inf"), + "L_star_tab_discounts": (1.0 - beta) / (1.0 - gamma), + "frame_offset_mean_expected": gamma / (1.0 - gamma), + # measured + "hops_mean": float(hf.mean()), "hops_median": float(hf.median()), + "hops_p90": float(hf.flatten().quantile(0.90)), + "hops_mean_expired": float(exp_hops), + "capped_frac": capped_frac, + # the reference chain has NO absorbing event: membership is READ once at the frozen node and never + # terminates the walk (that is the OLD fold's behaviour). Recorded explicitly so the share is not + # mistaken for "not measured". + "absorbed_frac": 0.0, "expired_frac": 1.0 - capped_frac, + "absorbed_note": "reference chain has no absorbing event; termination is the coin or the cap", + "levels_run": int(levels_run), "levels_per_row": levels_run / max(B * n, 1), + # chain_rb runs the full cap-length trajectory BY CONSTRUCTION (it replaces the coin with its + # law, so there is nothing to terminate); its hops_mean is always the cap and the alarm would be a + # guaranteed false positive. The alarm is a property of the SAMPLED chain only. + # PER-CALL alarm, and it must NOT use the aggregate 1e-2 rule directly: one decision scores + # `n` particles, so its capped fraction is QUANTISED to multiples of 1/n and the smallest + # nonzero value at n=16 is 0.0625 > 1e-2. With P(cap) = p^L <= 1e-3 per particle, ~1.4 % of + # decisions legitimately cap one particle, so the aggregate rule applied per call fires on a + # perfectly healthy cell (~28 times in the first mug cell -- exactly the 1.4 % predicted). + # Per call the real signal is TWO or more particles capping, or a mean walk length near the + # cap; the cell-level verdict is computed from the pooled fractions in chain_hop_summary(). + "cap_binding": (False if rb else + bool(capped_frac * n >= 2.0 or float(hf.mean()) > 0.9 * max(L, 1))), + } + if stats["cap_binding"]: + sys.stderr.write( + f"[CAP ALARM] chain cap is BINDING: beta={beta} gamma={gamma} cap={L} " + f"capped_frac={capped_frac:.4f} hops_mean={stats['hops_mean']:.3f} " + f"(alarm if capped_frac > 1e-2 or hops_mean > 0.9*cap) -- this cell is TRUNCATED and must not " + f"be quoted as a chain number without the flag\n") + sys.stderr.flush() + out = [q_out.mean(1), lg_out.mean(1)] + if return_particles: + out.append(q_out) + out.append(stats) + return tuple(out) + +# --------------------------------------------------------------------------- # +# backends +# --------------------------------------------------------------------------- # +class MLPBackend: + """rsm_libero MLP successor (train_rsm.py). Uses is_ope.load_critic (identity or MLP encoder).""" + + def __init__(self, ckpt, device, d_in=STATE_DIM, hop_ckpt="", feat_sd=None, max_rows=MAX_ROWS): + model, train_rsm, is_ope = _rsm_modules() + self.is_ope = is_ope + self.device = device + self.max_rows = int(max_rows) + self.temperature = read_calib_temperature(ckpt) or 1.0 # calib.json next to the blob, else 1 + self.enc, self.rew, self.flow, self.rms, self.cfg = is_ope.load_critic( + ckpt, d_in, 1, device, data=None) + ck = torch.load(ckpt, map_location="cpu", weights_only=False) + self.n_task = max(1, len(ck.get("tasks", ["task"]))) + self.d_act = int(ck["d_act"]) + self.q_action_winrate = ck.get("q_action_winrate", None) + self.step = ck.get("step", None) + self.chunk = int(self.cfg.get("chunk", 8)) + self.adim = self.d_act // self.chunk + self.d_z = int(self.cfg["d_z"]) + self.hop, self.hop_chunk = None, None + if hop_ckpt: + self.hop, self.hop_chunk = load_hop_head(hop_ckpt, self.d_z, self.n_task, device, feat_sd=feat_sd) + if self.hop.d_act != self.d_act: + raise RuntimeError(f"hop head emits {self.hop.d_act}-d chunks, RSM expects {self.d_act}") + + def latent(self, x): + return self.enc(x) + + def q(self, z, a, *, mode, depth, beta, gamma, n_particles, flow_steps, return_logit=False, + temperature=None, return_lcb=None, return_problog=False, return_trace=False): + """Q̄ [B] (return_logit=False, the historic contract) or (Q̄, Q̄_logit) [B] each; with return_lcb=

+ a third array, the p-quantile over particles of the per-particle Q (the conformal read-out), and with + return_problog=True a further array, the `prob_log` ranking (Q̄ itself, computed in the log-complement + domain so it does not tie when σ saturates). The returned tuple is + (Q̄, Q̄_logit [, LCB if return_lcb] [, prob_log if return_problog]). d1 / fold go through + `_q_fold_logit` (== is_ope.q_fold(crn=True) at T=1, plus the raw logit, row-sliced); recursive keeps + is_ope.q_recursive and has neither a logit nor a prob_log (it has no per-hop c_k). + temperature=None -> the checkpoint's calib.json T (or 1).""" + task = torch.zeros(z.shape[0], dtype=torch.long, device=z.device) + if mode == "d1": + depth = 1 + if depth >= 2 and self.hop is None: + raise RuntimeError(f"read-out {mode} at depth {depth} needs a hop head (rsm_hop_ckpt)") + T = self.temperature if temperature is None else float(temperature) + if mode in ("chain", "chain_rb"): + # coin-terminated beta chain (gen_q#267). ADDITIVE: no existing mode reaches this branch, so + # d1/fold/recursive stay bit-identical. `depth` is IGNORED here on purpose -- the chain's only + # length parameter is the truncation cap, computed from (beta, gamma) by chain_cap(); a caller + # may override it with chain_cap_override for the cap sweep, never to tune success. + out = list(_q_chain_logit(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, pol=self.hop, + beta=beta, gamma=gamma, + cap=getattr(self, "chain_cap_override", None), + n_particles=n_particles, flow_steps=flow_steps, temperature=T, + max_rows=self.max_rows, + tail_eps=getattr(self, "chain_tail_eps", CHAIN_TAIL_EPS), + rb=(mode == "chain_rb"), + return_particles=return_lcb is not None, + seed=getattr(self, "chain_seed", None))) + q, ql = out.pop(0), out.pop(0) + res = [q, ql] + if return_lcb is not None: + res.append(_particle_quantile(out.pop(0), return_lcb)) + # hop accounting rides on the instance, so the tuple contract above is untouched + self.last_chain_stats = out.pop(0) + if return_problog: + raise RuntimeError("plan_score=prob_log is a fold-only ranking (it folds per-hop c_k in the " + "log-complement domain); the chain reads membership ONCE at the frozen " + "node, so use plan_score=prob") + if return_trace: + raise RuntimeError("return_trace needs the d1 / fold read-out (the chain freezes rows at " + "different depths, so there is no rectangular per-hop c_k trace)") + if len(res) > 2: + return tuple(res) + return (q, ql) if return_logit else q + if mode in ("d1", "fold"): + out = list(_q_fold_logit(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, pol=self.hop, + beta=beta, gamma=gamma, depth=depth, n_particles=n_particles, + flow_steps=flow_steps, temperature=T, max_rows=self.max_rows, + return_particles=return_lcb is not None, + return_problog=bool(return_problog), + return_trace=bool(return_trace))) + q, ql = out.pop(0), out.pop(0) + res = [q, ql] + if return_lcb is not None: + res.append(_particle_quantile(out.pop(0), return_lcb)) + if return_problog: + res.append(out.pop(0)) + if return_trace: # always LAST, so no existing position moves (gen_q#270) + res.append(out.pop(0)) + if len(res) > 2: + return tuple(res) + return (q, ql) if return_logit else q + if mode == "recursive": + q, _ess = self.is_ope.q_recursive(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, + pol=self.hop, wend=None, beta=beta, gamma=gamma, depth=depth, + n_particles=n_particles, flow_steps=flow_steps, + use_is=False, crn=True) + q = q * (1.0 - gamma) # back to the success-probability scale + if return_lcb is not None: + raise RuntimeError("plan_score=conformal_lcb needs the d1 / fold read-out (recursive has no " + "per-particle success probability)") + if return_problog: + raise RuntimeError("plan_score=prob_log needs the d1 / fold read-out (recursive has no " + "per-hop reward logits to fold in the log-complement domain)") + if return_trace: + raise RuntimeError("return_trace needs the d1 / fold read-out (recursive's stochastic stop " + "keeps no per-hop c_k to trace)") + return (q, None) if return_logit else q + raise ValueError(mode) + + def q_fold_reference(self, z, a, *, depth, beta, gamma, n_particles, flow_steps): + """is_ope.q_fold itself (crn=True), for tests against `_q_fold_logit`.""" + task = torch.zeros(z.shape[0], dtype=torch.long, device=z.device) + q, _ = self.is_ope.q_fold(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, pol=self.hop, + beta=beta, gamma=gamma, depth=depth, n_particles=n_particles, + flow_steps=flow_steps, crn=True) + return q + + def hop_sample(self, z, eps): + task = torch.zeros(z.shape[0], dtype=torch.long, device=z.device) + return self.hop.sample_eps(z, task, eps) + + +class DWMBackend: + """Token successor model, stream C's shipped interface (rsm_libero/dwm_readout.py, status/C_dwm.md): + crit = load_critic_dwm(path, device); crit.q(x_tokens RAW [B,514,384], a_chunk [B,56], beta, + n_particles, crn_seed, depth, mode in {d1, fold}, proprio RAW [B,9], + hop_policy(pooled_raw [R,1545], eps [R,d_act]) -> [R,56], gamma, flow_steps) -> Q̄ [B] + The critic normalises tokens/proprio itself (cache//tokens/tok_stats.npz). The hop head runs on the + z-scored pooled state, so the callable applies our feat_stats rule (`normalize`) to pooled_raw first. + `q()` takes inp = (tokens_raw, proprio_raw). mode "recursive" is not offered by the DWM read-out.""" + + def __init__(self, ckpt, device, module="dwm_readout", hop_ckpt="", feat_sd=None, d_in=STATE_DIM, + normalize=None): + _rsm_modules() + try: + mod = importlib.import_module(module) + except ImportError as e: + raise RuntimeError(f"DWM backend needs module '{module}' with load_critic_dwm (stream C): {e}") + self.core = mod.load_critic_dwm(ckpt, device=device) + self.d_act = int(self.core.d_act) + self.chunk = int(self.core.config.get("chunk", 8)) + self.adim = self.d_act // self.chunk + self.d_z = d_in + self.normalize = normalize if normalize is not None else (lambda x: x) + self.q_action_winrate = getattr(self.core, "q_action_winrate", None) + self.step = getattr(self.core, "step", None) + self.hop = None + if hop_ckpt: + self.hop, _ = load_hop_head(hop_ckpt, d_in, 1, device, feat_sd=feat_sd) + + def _hop_callable(self): + if self.hop is None: + return None + hop, norm = self.hop, self.normalize + + class _Hop: + d_act = hop.d_act + + def __call__(self, pooled_raw, eps): + x = norm(pooled_raw.float()) + task = torch.zeros(x.shape[0], dtype=torch.long, device=x.device) + return hop.sample_eps(x, task, eps) + return _Hop() + + @property + def temperature(self): + return float(getattr(self.core, "temperature", 1.0)) + + def q(self, inp, a, *, mode, depth, beta, gamma, n_particles, flow_steps, crn_seed=None, + return_logit=False, temperature=None, rescore_top=0, n_particles_rescore=0, return_lcb=None): + """Q̄ [B] or (Q̄, Q̄_logit) with return_logit=True; temperature=None -> the critic's own (calib.json); + rescore_top=K / n_particles_rescore=M -> dwm_readout's two-stage screening (top-K by q_logit). + + return_lcb=

additionally returns the p-quantile over particles of the per-particle Q. dwm_readout + returns only the MEAN, so the per-particle values are rebuilt from its `return_hops=True` output (the + per-hop c_k [B, n], folded exactly as _q_once does). Those hops belong to the STAGE-1 pass, so the + conformal read-out is incompatible with the internal two-stage screening and raises instead of + silently ranking rescored candidates by their stage-1 spread.""" + tok, pr = inp + if mode == "recursive": + raise RuntimeError("the DWM read-out offers d1 / fold only (rsm_libero/dwm_readout.py)") + if mode == "d1": + depth = 1 + if crn_seed is None: # fresh CRN draw per call, shared by all rows + crn_seed = int(torch.randint(0, 2 ** 31 - 1, (1,), device="cpu")) + kw = {} + if temperature is not None: + kw["temperature"] = float(temperature) + if rescore_top and n_particles_rescore: + kw["rescore_top"] = int(rescore_top) + kw["n_particles_rescore"] = int(n_particles_rescore) + if return_lcb is None: + return self.core.q(tok, a, float(beta), n_particles=int(n_particles), crn_seed=int(crn_seed), + depth=int(depth), mode=mode, proprio=pr, hop_policy=self._hop_callable(), + gamma=float(gamma), flow_steps=int(flow_steps), + return_logit=bool(return_logit), **kw) + if "rescore_top" in kw: + raise RuntimeError("plan_score=conformal_lcb cannot be combined with the DWM two-stage screening " + "(plan_rescore_top / plan_particles_rescore): dwm_readout only exposes the " + "stage-1 per-particle values") + (q, ql), cs = self.core.q(tok, a, float(beta), n_particles=int(n_particles), crn_seed=int(crn_seed), + depth=int(depth), mode=mode, proprio=pr, hop_policy=self._hop_callable(), + gamma=float(gamma), flow_steps=int(flow_steps), return_logit=True, + return_hops=True, **kw) + qp = torch.zeros_like(cs[-1]) # per-particle fold, same recursion as dwm_readout + if mode == "d1" or len(cs) == 1: + qp = cs[0] + else: + h = 1.0 / (1.0 - float(beta)) + for c in reversed(cs): + qp = c + (1.0 - c) * (float(gamma) ** h) * qp + qp = torch.nan_to_num(qp, nan=0.0).clamp(0.0, 1.0) + return q, ql, _particle_quantile(qp, return_lcb) + + def hop_sample(self, x, eps): + task = torch.zeros(x.shape[0], dtype=torch.long, device=x.device) + return self.hop.sample_eps(x, task, eps) + + +class LeWMBackend: + """LeWM (gen_q#268): rsm_libero/lewm_readout.py, a JEPA world model with a membership probe. + + crit = load_critic_lewm(path, device) + crit.q(inp = (frames [B,6,84,84] uint8-or-float, proprio (ignored)), a_chunk [B,56], + depth=L, mode in {d1, fold}, gamma) -> Q [B] + + Its state is PIXELS -- the two RISE cameras stacked as 6 channels -- because LeWM predicts its + OWN encoder's embeddings; feeding it frozen DINO features would make it DINO-WM. The scorer + therefore hands it the planner's frames and still computes the pooled DINO state alongside, so + the hop head and every other consumer are unaffected and DINO still runs once per frame. + Deterministic, so there is no particle dimension: it is the cheapest scorer in the table. + """ + + def __init__(self, ckpt, device, module="lewm_readout", hop_ckpt="", feat_sd=None, + d_in=STATE_DIM, normalize=None): + _rsm_modules() + try: + mod = importlib.import_module(module) + except ImportError as e: + raise RuntimeError(f"LeWM backend needs module '{module}' with load_critic_lewm: {e}") + self.core = mod.load_critic_lewm(ckpt, device=device) + self.d_act = int(self.core.d_act) + self.chunk = int(self.core.chunk) + self.adim = self.d_act // self.chunk + self.d_z = d_in + self.res, self.in_ch = int(self.core.res), int(self.core.in_ch) + self.cams = tuple(self.core.cams) + self.normalize = normalize if normalize is not None else (lambda x: x) + self.q_action_winrate = getattr(self.core, "q_action_winrate", None) + self.step = getattr(self.core, "step", None) + # No hop head: LeWM rolls the SAME candidate chunk (see lewm_readout's deviation 2), so a hop + # policy would never be called. Kept as None rather than loaded, so an E2 advantage() call + # fails loudly instead of silently scoring something else. + self.hop = None + + @property + def temperature(self): + return float(getattr(self.core, "temperature", 1.0)) + + def q(self, inp, a, *, mode, depth, beta, gamma, n_particles, flow_steps, crn_seed=None, + return_logit=False, temperature=None, rescore_top=0, n_particles_rescore=0, + return_lcb=None): + return self.core.q(inp, a, beta=beta, n_particles=1, crn_seed=crn_seed, depth=depth, + mode=mode, gamma=gamma, flow_steps=flow_steps, + return_logit=return_logit, temperature=temperature, + return_lcb=return_lcb) + + def hop_sample(self, x, eps): + return self.core.hop_sample(x, eps) + + +class MCBackend: + """MC return-to-go critic on the pooled state (S3H5). blob: {"net": state_dict, + "config": {"d_in": 1545, "d_act": 56, "width": 1024, "depth": 3, "scale": 1.0}}, net = MLP([x|A]) -> R.""" + + def __init__(self, ckpt, device, hop_ckpt="", feat_sd=None): + ck = torch.load(ckpt, map_location=device, weights_only=False) + c = ck["config"] + self.d_act, self.chunk = int(c["d_act"]), int(c.get("chunk", 8)) + self.adim = self.d_act // self.chunk + self.d_z = int(c["d_in"]) + w, dp = int(c.get("width", 1024)), int(c.get("depth", 3)) + layers, ind = [], self.d_z + self.d_act + for i in range(dp): + layers += [nn.Linear(ind if i == 0 else w, w), nn.SiLU()] + layers += [nn.Linear(w, 1)] + self.net = nn.Sequential(*layers).to(device) + self.net.load_state_dict(ck["net"]) + self.net.eval() + self.scale = float(c.get("scale", 1.0)) + self.hop = None + if hop_ckpt: + self.hop, _ = load_hop_head(hop_ckpt, self.d_z, 1, device, feat_sd=feat_sd) + + def q(self, x, a, return_logit=False, **_): + with torch.no_grad(): + q = self.net(torch.cat([x, a], -1))[:, 0] * self.scale + return (q, None) if return_logit else q # a return-to-go has no logit + + def hop_sample(self, x, eps): + task = torch.zeros(x.shape[0], dtype=torch.long, device=x.device) + return self.hop.sample_eps(x, task, eps) + + +# --------------------------------------------------------------------------- # +# the scorer +# --------------------------------------------------------------------------- # +class RSMScorer: + """score(state, A[N,chunk,adim]) -> Q̄[N]; advantage(state, A[B,...]) -> (Q̄[B], V̄[B], Qm[B,M]).""" + + def __init__(self, backend="mlp", ckpt="", hop_ckpt="", feat_stats="", mode="fold", depth=2, + beta=0.95, gamma=0.99, n_particles=16, flow_steps=8, device="cpu", state=None, + img_layout="chw", cams=CAMS, proprio_keys=PROPRIO_KEYS, dwm_module="dwm_readout", + dino=None, score_kind="prob", rescore_top=0, n_particles_rescore=0, temperature=0.0, + max_rows=MAX_ROWS, lcb_quantile=0.1, chain_cap=0, chain_tail_eps=CHAIN_TAIL_EPS, + chain_seed=None): + """score_kind: "prob" (mean σ, the historic ranking) | "logit" (mean raw logit, d1/fold only) | + "prob_log" (gen_q#266: the SAME quantity as "prob" -- the whole product fold, mean over particles -- + but folded in the log-complement domain, so it is a strictly monotone transform of prob's + infinite-precision value and gives a total order over the candidates where prob ties ~half of them + at exactly 1.0; mlp backend, d1/fold only, since it needs the per-hop reward logits) | + "conformal_lcb" (the `lcb_quantile` quantile — 0.1 by default — over particles of the per-particle + success probability instead of its mean: a pessimistic read-out that prefers candidates whose future + is reliably good over candidates with one lucky particle). + rescore_top=K, n_particles_rescore=M (both > 0 to enable): two-stage particle screening in score(). + temperature: 0 -> the checkpoint's calib.json T if present else 1.0; > 0 overrides.""" + assert mode in _MODES, mode + assert score_kind in _SCORE_KINDS, score_kind + self.backend_name = backend + self.mode, self.depth = mode, int(depth) + self.beta, self.gamma = float(beta), float(gamma) + self.n_particles, self.flow_steps = int(n_particles), int(flow_steps) + self.score_kind = score_kind + self.rescore_top = int(rescore_top or 0) + self.n_particles_rescore = int(n_particles_rescore or 0) + self.temperature = float(temperature or 0.0) + self.lcb_quantile = float(lcb_quantile) + self.last_q = self.last_q_logit = self.last_q_lcb = self.last_q_problog = None + # coin chain (gen_q#267). chain_cap=0 means "compute it from (beta, gamma) and the 1e-3 tail", + # which is the ONLY legitimate way to set it; a non-zero override exists solely so the cap can be + # SWEPT as a truncation guard (and so the reference's own 10 can be reproduced), never to tune + # success. Recorded in describe() either way so every cell says which cap it ran. + self.chain_cap = int(chain_cap or 0) + self.chain_tail_eps = float(chain_tail_eps) + self.chain_seed = chain_seed + self.chain_hop_acc = None + if mode in ("chain", "chain_rb"): + if backend != "mlp": + raise ValueError(f"the coin chain is implemented on the mlp backend (got backend={backend}); " + f"the token read-outs have no per-row freeze") + # fail loudly at construction, not 400 decisions in + _p = chain_continuation_p(self.beta, self.gamma) + _cap = self.chain_cap or chain_cap_fn(self.beta, self.gamma, self.chain_tail_eps) + # P(N > cap) = p**cap, except that Python's 0**0 is 1: at beta == gamma the coin never + # continues, so a cap of 0 truncates nothing and the tail is 0, not 1. + _tail = 0.0 if _p == 0.0 else _p ** _cap + sys.stderr.write( + f"[rsm_scorer] COIN CHAIN: beta={self.beta} gamma={self.gamma} p={_p:.6f} cap={_cap} " + f"tail=P(N>cap)={_tail:.2e} E[hops]={_p / (1 - _p):.3f} " + f"E[beta-reads]={1 / (1 - _p):.3f} (L*=(1-beta)/(1-gamma)={(1 - self.beta) / (1 - self.gamma):.1f})\n") + sys.stderr.flush() + if score_kind in ("logit", "conformal_lcb", "prob_log") and (mode == "recursive" or backend == "mc"): + raise ValueError(f"plan_score={score_kind} needs the d1 / fold read-out of the mlp / dwm / dinowm backend " + f"(got backend={backend}, mode={mode})") + # prob_log folds log(1 - c_k) = logσ(-lg_k/T) hop by hop, so it needs the per-hop reward LOGITS. + # The token read-outs (dwm / dinowm) expose only the per-hop c_k (return_hops), already through the + # sigmoid -- a saturated c_k = 1.0 there gives log(0) = -inf and the read-out would silently lose + # exactly the resolution it exists to recover. So it is restricted to the mlp backend, which owns + # `_q_fold_logit` and has the raw logits in hand. LeWM has no per-hop logit interface either. + if score_kind == "prob_log" and backend != "mlp": + raise ValueError(f"plan_score=prob_log needs the per-hop reward logits of the mlp backend's fold " + f"(got backend={backend}); the token read-outs expose only the post-sigmoid c_k") + if score_kind == "conformal_lcb" and not 0.0 < self.lcb_quantile < 1.0: + raise ValueError(f"plan_lcb_quantile must be in (0, 1), got {self.lcb_quantile}") + self.device = torch.device(device) + self.state = state + if self.state is None and feat_stats: + self.state = PooledDinoState(feat_stats, cams=cams, proprio_keys=proprio_keys, + img_layout=img_layout, dino=dino).to(self.device) + feat_sd = None if self.state is None else self.state.sd.cpu().numpy() + d_in = STATE_DIM if self.state is None else self.state.d + if backend == "mlp": + self.backend = MLPBackend(ckpt, self.device, d_in=d_in, hop_ckpt=hop_ckpt, feat_sd=feat_sd, + max_rows=max_rows) + elif backend in TOKEN_BACKENDS: + # `dwm_module` defaults to "dwm_readout", so only override it when the caller left it at + # that default: an explicit --rsm_dwm_module still wins. + _mod = dwm_module if dwm_module not in (None, "", "dwm_readout") \ + else READOUT_MODULE[backend] + self.backend = DWMBackend(ckpt, self.device, module=_mod, hop_ckpt=hop_ckpt, + feat_sd=feat_sd, d_in=d_in, + normalize=None if self.state is None else self.state.normalize) + elif backend == "lewm": + self.backend = LeWMBackend(ckpt, self.device, hop_ckpt=hop_ckpt, feat_sd=feat_sd, + d_in=d_in, + normalize=None if self.state is None else self.state.normalize) + elif backend == "mc": + self.backend = MCBackend(ckpt, self.device, hop_ckpt=hop_ckpt, feat_sd=feat_sd) + else: + raise ValueError(f"unknown backend {backend}") + self.chunk, self.adim, self.d_act = self.backend.chunk, self.backend.adim, self.backend.d_act + # the coin chain's knobs live on the BACKEND (that is where _q_chain_logit reads them). Set + # unconditionally so a backend can never carry a stale value from a previous scorer. + self.backend.chain_cap_override = self.chain_cap or None + self.backend.chain_tail_eps = self.chain_tail_eps + self.backend.chain_seed = self.chain_seed + self.backend.last_chain_stats = None + + # ---- state ------------------------------------------------------------ + @torch.no_grad() + def state_from_obs(self, obs_t): + """obs dict at the current frame -> SimpleNamespace(x [B,1545], tok [B,514,384] or None).""" + if self.state is None: + raise RuntimeError("scorer built without feat_stats; pass states directly") + if self.backend_name in TOKEN_BACKENDS: + tok, x = self.state.tokens(obs_t) + pr = self.state._proprio(obs_t, tok.shape[0]) + return SimpleNamespace(x=x, tok=tok, pr=pr) + if self.backend_name == "lewm": + # PIXELS, through the SAME transform train_lewm.py used (lewm_data.frames_from_obs), plus + # the pooled DINO state so nothing else in the planner changes. + _rsm_modules() + img = importlib.import_module("lewm_data").frames_from_obs( + obs_t, cams=self.backend.cams, res=self.backend.res).to(self.device) + # DINO is deliberately NOT run here. LeWM scores from pixels and never reads the pooled + # state, and the flagship table discloses each scorer's search cost -- charging LeWM for + # a DINOv2 forward it does not use would overstate that cost. `x` is None as a result, + # which only advantage() (E2) would have wanted, and that path raises for LeWM anyway + # because it has no hop head. + pr = self.state._proprio(obs_t, img.shape[0]) + return SimpleNamespace(x=None, tok=None, pr=pr, img=img) + return SimpleNamespace(x=self.state(obs_t), tok=None, pr=None) + + @staticmethod + def as_state(s): + if isinstance(s, torch.Tensor): + return SimpleNamespace(x=s, tok=None, pr=None) + if not hasattr(s, "pr"): + s.pr = None + return s + + @staticmethod + def repeat_state(s, N): + """B states -> B*N states, repeat_interleave'd, for one state per candidate chunk. + + Lives here, not in the caller, because the SCORER decides which fields its backend reads: + rsm_planner used to rebuild the namespace itself as (x, tok, pr) and silently dropped the + pixel backends' `img` (gen_q#268), so every LeWM eval cell died in _rows on a None input. + Repeating whatever vars(s) holds cannot go stale when a backend adds a field.""" + s = RSMScorer.as_state(s) + if int(N) == 1: + return s + return type(s)(**{k: (v.repeat_interleave(int(N), 0) if torch.is_tensor(v) else v) + for k, v in vars(s).items()}) + + def _flat_chunk(self, A): + A = torch.as_tensor(A, dtype=torch.float32, device=self.device) + if A.dim() == 3: + if A.shape[1] < self.chunk: + raise RuntimeError(f"need {self.chunk} actions per chunk, got {A.shape[1]}") + A = A[:, :self.chunk].reshape(A.shape[0], -1) + if A.shape[1] != self.d_act: + raise RuntimeError(f"chunk is {A.shape[1]}-d, RSM expects {self.d_act}") + return A + + def _inputs(self, s): + # Every branch names the field it needs and raises if the caller did not carry it. A missing + # field used to surface as `'NoneType' object has no attribute 'shape'` from _rows, three + # frames away from the caller that dropped it (gen_q#268: rsm_planner's st_rep rebuilt the + # namespace from a hardcoded (x, tok, pr) list and lost `img`), which is exactly the kind of + # silent degradation this pipeline keeps paying for. + if self.backend_name in TOKEN_BACKENDS: + return (self._need(s, "tok"), s.pr) + if self.backend_name == "lewm": + return (self._need(s, "img"), s.pr) + return self.backend.latent(self._need(s, "x")) if hasattr(self.backend, "latent") \ + else self._need(s, "x") + + def _need(self, s, field): + """The state field this backend scores from, or a RuntimeError naming backend AND field.""" + v = getattr(s, field, None) + if v is None: + have = sorted(k for k, t in vars(s).items() if t is not None) if hasattr(s, "__dict__") else [] + raise RuntimeError( + f"backend={self.backend_name} scores from state field '{field}', but it is None " + f"(state carries {have or 'nothing'}). The caller built the state without it -- see " + f"rsm_planner.plan_get_action's st_rep, which must repeat every field of " + f"RSMScorer.state_from_obs's output.") + return v + + @staticmethod + def _rows(inp): + return inp[0].shape[0] if isinstance(inp, tuple) else inp.shape[0] + + @staticmethod + def _expand(inp, N): + if isinstance(inp, tuple): + return tuple(None if t is None else t.expand(N, *t.shape[1:]) for t in inp) + return inp.expand(N, *inp.shape[1:]) + + @staticmethod + def _repeat(inp, M): + if isinstance(inp, tuple): + return tuple(None if t is None else t.repeat_interleave(M, 0) for t in inp) + return inp.repeat_interleave(M, 0) + + @staticmethod + def _cat(a, b): + if isinstance(a, tuple): + return tuple(None if x is None else torch.cat([x, y], 0) for x, y in zip(a, b)) + return torch.cat([a, b], 0) + + @staticmethod + def _index(inp, idx): + if isinstance(inp, tuple): + return tuple(None if t is None else t[idx] for t in inp) + return inp[idx] + + def effective_temperature(self): + """The T the sigmoid uses: the override if > 0, else the checkpoint's (calib.json or 1.0).""" + if self.temperature > 0: + return self.temperature + return float(getattr(self.backend, "temperature", 1.0)) + + # ---- E1 ---------------------------------------------------------------- + @torch.no_grad() + # ---- hop accounting for the coin chain (gen_q#267) --------------------------------------- + # The cheapest proof the chain does what the maths says: the number of hops the walk ACTUALLY takes + # must match E[N] = p/(1-p) = the same quantity tab:discounts calls L* = (1-beta)/(1-gamma). Summed + # over every decision of a cell, then written into the eval JSON by the planner. + def _accum_chain_stats(self): + st = getattr(self.backend, "last_chain_stats", None) + if st is None: + return + self.backend.last_chain_stats = None # consume, so a fold decision cannot inherit it + a = getattr(self, "chain_hop_acc", None) + if a is None: + a = self.chain_hop_acc = {"decisions": 0, "hops_sum": 0.0, "hops_sq_sum": 0.0, + "capped_sum": 0.0, "expired_sum": 0.0, "levels_run": 0, + "cap_binding_decisions": 0, "hops_p90_sum": 0.0, + "levels_per_row_sum": 0.0, + "hops_median_sum": 0.0, "hops_mean_expired_sum": 0.0, + "hops_mean_expired_n": 0} + for k in ("mode", "beta", "gamma", "p_cont", "cap", "tail_eps", "tail_prob_at_cap", + "n_particles", "E_hops_expected", "E_beta_reads_expected", + "L_star_tab_discounts", "frame_offset_mean_expected", "absorbed_note"): + a[k] = st[k] + a["decisions"] += 1 + a["hops_sum"] += st["hops_mean"] + a["hops_sq_sum"] += st["hops_mean"] ** 2 + a["hops_median_sum"] += st["hops_median"] + a["hops_p90_sum"] += st["hops_p90"] + a["capped_sum"] += st["capped_frac"] + a["expired_sum"] += st["expired_frac"] + a["levels_run"] += st["levels_run"] + a["levels_per_row_sum"] += st["levels_per_row"] + a["cap_binding_decisions"] += int(st["cap_binding"]) + if st["hops_mean_expired"] == st["hops_mean_expired"]: # not NaN + a["hops_mean_expired_sum"] += st["hops_mean_expired"] + a["hops_mean_expired_n"] += 1 + + def chain_hop_summary(self): + """Per-cell hop accounting, or None if no chain decision was scored. Goes into the eval JSON.""" + a = getattr(self, "chain_hop_acc", None) + if not a or not a["decisions"]: + return None + d = float(a["decisions"]) + s = {k: a[k] for k in ("mode", "beta", "gamma", "p_cont", "cap", "tail_eps", + "tail_prob_at_cap", "n_particles", "E_hops_expected", + "E_beta_reads_expected", "L_star_tab_discounts", + "frame_offset_mean_expected", "absorbed_note")} + s.update({ + "decisions": int(a["decisions"]), + "hops_mean": a["hops_sum"] / d, + "hops_median": a["hops_median_sum"] / d, + "hops_p90": a["hops_p90_sum"] / d, + "hops_mean_expired": (a["hops_mean_expired_sum"] / a["hops_mean_expired_n"] + if a["hops_mean_expired_n"] else None), + "capped_frac": a["capped_sum"] / d, + "expired_frac": a["expired_sum"] / d, + "absorbed_frac": 0.0, + # Averaged from the PER-CALL value, which divides by rows = candidates x particles. The + # cell-level version used to divide the summed level count by decisions x particles only, + # dropping the 128 candidates, so it read ~670 ("levels per row") where the walk runs ~5: + # cells written before 2026-09-22 18:30Z carry that inflated value -- divide by 128. + "levels_per_row": a["levels_per_row_sum"] / d, + "levels_per_row_legacy_denominator": a["levels_run"] / max(a["decisions"] * a["n_particles"], 1), + "cap_binding_decisions": int(a["cap_binding_decisions"]), + # THE FLAG the loader reads: a cell whose cap binds is truncated and must not be quoted + # as a chain number without it. + # THE CELL-LEVEL RULE IS THE AGGREGATE ONE ONLY. It used to also fire on + # `cap_binding_decisions > 0`, i.e. on a single decision in which one particle of 16 + # reached the cap -- which happens on ~1.4 % of decisions BY DESIGN at a 1e-3 per-particle + # tail, so every healthy chain cell was flagged as truncated. A flag that is always on + # carries no information and would have put a truncation warning on every row. The + # per-decision count is kept as a diagnostic beside it. + "cap_binding": bool(a["capped_sum"] / d > 1e-2 + or a["hops_sum"] / d > 0.9 * max(a["cap"], 1)), + }) + # the hop-accounting check itself: mean hops among EXPIRED particles must match E[N]. The + # OVERALL mean is the same number here (the reference chain has no absorbing event), so a + # mismatch is a real defect, not a membership-density artefact. + e = s["E_hops_expected"] + s["hops_rel_err"] = abs(s["hops_mean"] - e) / max(e, 1e-9) + return s + + def score(self, state, A, seed=None, mode=None, depth=None, beta=None, rescore_top=None, + n_particles_rescore=None): + """Ranking array [N]: Q̄ for score_kind="prob", Q̄_logit for "logit", the per-particle + `lcb_quantile` quantile of Q for "conformal_lcb". All three are kept in `.last_q` / `.last_q_logit` / + `.last_q_lcb` (the logit is None for recursive / mc, the LCB None unless conformal). Two-stage + screening: every candidate with n_particles, then the top-K of the RANKING array rescored with M + particles and written back.""" + s = self.as_state(state) + A = self._flat_chunk(A) + N = A.shape[0] + inp = self._inputs(s) + R = self._rows(inp) + if R == 1 and N > 1: + inp = self._expand(inp, N) + elif R != N: + raise RuntimeError(f"{R} states for {N} chunks") + mode = mode or self.mode + depth = depth or self.depth + beta = self.beta if beta is None else beta + K = self.rescore_top if rescore_top is None else int(rescore_top or 0) + M = self.n_particles_rescore if n_particles_rescore is None else int(n_particles_rescore or 0) + two_stage = bool(K and M and K < N) + conformal = self.score_kind == "conformal_lcb" + problog = self.score_kind == "prob_log" + kw = dict(mode=mode, depth=depth, beta=beta, gamma=self.gamma, flow_steps=self.flow_steps, + return_logit=True) + if conformal: + kw["return_lcb"] = self.lcb_quantile + if problog: + kw["return_problog"] = True + if self.backend_name != "mc": + kw["temperature"] = self.temperature if self.temperature > 0 else None + if self.backend_name in TOKEN_BACKENDS: + kw["crn_seed"] = None if (seed is None or int(seed) < 0) else int(seed) + if two_stage: # dwm_readout screens internally (top-K by q_logit) + kw["rescore_top"], kw["n_particles_rescore"] = K, M + def _unpack(out): + """(Q̄, Q̄_logit [, LCB] [, prob_log]) -> (q, ql, lcb, plg) with the absent ones None.""" + o = list(out) if isinstance(out, tuple) else [out] + q_, ql_ = o.pop(0), (o.pop(0) if o else None) + lcb_ = o.pop(0) if (conformal and o) else None + plg_ = o.pop(0) if (problog and o) else None + return q_, ql_, lcb_, plg_ + + with seeded(seed, self.device): + q, ql, lcb, plg = _unpack(self.backend.q(inp, A, n_particles=self.n_particles, **kw)) + q = q.float() + ql = None if ql is None else ql.float() + lcb = None if lcb is None else lcb.float() + plg = None if plg is None else plg.double() + rank = self._rank_of(q, ql, lcb, plg) + if two_stage and self.backend_name not in TOKEN_BACKENDS: + top = torch.topk(rank, K).indices + q2, ql2, lcb2, plg2 = _unpack( + self.backend.q(self._index(inp, top), A[top], n_particles=M, **kw)) + q = q.clone(); q[top] = q2.float() + if ql is not None and ql2 is not None: + ql = ql.clone(); ql[top] = ql2.float() + if lcb is not None and lcb2 is not None: + lcb = lcb.clone(); lcb[top] = lcb2.float() + if plg is not None and plg2 is not None: + plg = plg.clone(); plg[top] = plg2.double() + rank = self._rank_of(q, ql, lcb, plg) + self.last_q, self.last_q_logit, self.last_q_lcb = q, ql, lcb + self.last_q_problog = plg + self._accum_chain_stats() + return rank + + @torch.no_grad() + def score_trace(self, state, A, seed=None, mode=None, depth=None, beta=None): + """VISUALISATION ONLY (gen_q#270). Same call as `score()` for the mlp backend's d1/fold read-out, + but returns (rank [N], trace) where trace exposes what the fold already computes internally and + normally discards: + + trace["z"] [L, N, P, D] fp16 the successor SAMPLES at each hop (z-scored state space) + trace["a"] [L, N, P, d_act] the chunk that produced each z (hop 0 = the candidate itself) + trace["lg"] [L, N, P] raw reward logits R(z) + trace["c"] [L, N, P] c_k = sigmoid(R(z)/T) -- the GREEN/RED membership + trace["q"] [L+1, N, P] the backward fold's partials; q[0].mean(1) == .last_q + + It does NOT go through the two-stage rescreening path (rescore_top is ignored) so that the trace and + the returned rank describe ONE pass with `n_particles` particles; for the flagship cells + rescore_top=0 anyway, and `score()` itself is untouched. Every RNG draw is the fold's own, so with + the same `seed` the q values here equal `score()`'s bit for bit (tests/test_rsm_trace.py).""" + if self.backend_name != "mlp": + raise RuntimeError(f"score_trace needs the mlp backend (got {self.backend_name})") + s_ = self.as_state(state) + A = self._flat_chunk(A) + N = A.shape[0] + inp = self._inputs(s_) + R = self._rows(inp) + if R == 1 and N > 1: + inp = self._expand(inp, N) + elif R != N: + raise RuntimeError(f"{R} states for {N} chunks") + mode = mode or self.mode + depth = depth or self.depth + beta = self.beta if beta is None else beta + conformal = self.score_kind == "conformal_lcb" + problog = self.score_kind == "prob_log" + kw = dict(mode=mode, depth=depth, beta=beta, gamma=self.gamma, flow_steps=self.flow_steps, + return_logit=True, return_trace=True, + temperature=self.temperature if self.temperature > 0 else None) + if conformal: + kw["return_lcb"] = self.lcb_quantile + if problog: + kw["return_problog"] = True + with seeded(seed, self.device): + out = list(self.backend.q(inp, A, n_particles=self.n_particles, **kw)) + trace = out.pop() + q, ql = out.pop(0).float(), (out.pop(0) if out else None) + ql = None if ql is None else ql.float() + lcb = out.pop(0).float() if (conformal and out) else None + plg = out.pop(0).double() if (problog and out) else None + self.last_q, self.last_q_logit, self.last_q_lcb, self.last_q_problog = q, ql, lcb, plg + return self._rank_of(q, ql, lcb, plg), trace + + def _rank_of(self, q, ql, lcb, plg=None): + """the array the selection rule sees, per score_kind (falling back to Q̄ when a backend has none).""" + if self.score_kind == "logit" and ql is not None: + return ql + if self.score_kind == "conformal_lcb" and lcb is not None: + return lcb + if self.score_kind == "prob_log" and plg is not None: + return plg + return q + + # ---- E2 ---------------------------------------------------------------- + @torch.no_grad() + def advantage(self, state, A, v_samples=16, v_expectile=0.5, seed=None): + """Q̄(x, A) and V̄_τ(x) = τ-expectile over M hop-head chunks of Q̄(x, a^(m)); all B×(1+M) rows are + scored in ONE batched call so the CRN noise is shared across the logged chunk and its baselines.""" + s = self.as_state(state) + A = self._flat_chunk(A) + B, M = A.shape[0], int(v_samples) + if self.backend.hop is None: + raise RuntimeError("advantage needs a hop head (rsm_hop_ckpt) to draw baseline chunks") + inp = self._inputs(s) + if self._rows(inp) != B: + raise RuntimeError(f"{self._rows(inp)} states for {B} chunks") + kw = {} + if self.backend_name in TOKEN_BACKENDS: + kw["crn_seed"] = None if (seed is None or int(seed) < 0) else int(seed) + with seeded(seed, self.device): + eps = torch.randn(M, self.d_act, device=self.device).repeat(B, 1) # CRN over rows + x_rep = s.x.repeat_interleave(M, 0) + a_hop = self.backend.hop_sample(x_rep, eps) # [B*M, d_act] + a_all = torch.cat([A, a_hop], 0) + inp_all = self._cat(inp, self._repeat(inp, M)) + q_all = self.backend.q(inp_all, a_all, mode=self.mode, depth=self.depth, beta=self.beta, + gamma=self.gamma, n_particles=self.n_particles, flow_steps=self.flow_steps, **kw) + q = q_all[:B].float() + qm = q_all[B:].float().view(B, M) + v = expectile(qm, v_expectile) + return q, v, qm + + def effective_horizon(self): + _, _, is_ope = _rsm_modules() + if self.mode == "recursive" and self.backend_name not in TOKEN_BACKENDS: + return is_ope.effective_horizon(self.beta, self.gamma, self.depth) + L = 1 if self.mode == "d1" else self.depth + # A DINO-WM hop is ONE ACTION CHUNK (the step it was trained on), not 1/(1-beta) frames: it + # has no beta. Reporting the beta horizon for it would overstate its reach by ~2.5x at + # beta=0.95 and is exactly the kind of mismatch the flagship table has to get right. + if self.backend_name in ("dinowm", "lewm"): + hf = float(getattr(getattr(self.backend, "core", None), "hop_frames", self.chunk)) + return {"mean_hops": float(L), "effective_frames": L * hf, "gamma_nominal": self.gamma, + "hop_frames": hf} + return {"mean_hops": float(L), "effective_frames": L / (1.0 - self.beta), "gamma_nominal": self.gamma} + + def describe(self): + state = None + if self.state is not None: + state = {"dim": self.state.d, "sd_floor": self.state.sd_floor, "z_clip": self.state.z_clip, + "img_layout": self.state.img_layout, "cams": list(self.state.cams), + "proprio_keys": list(self.state.proprio_keys)} + return {"backend": self.backend_name, "mode": self.mode, "depth": self.depth, "beta": self.beta, + "state": state, + "gamma": self.gamma, "n_particles": self.n_particles, "flow_steps": self.flow_steps, + "chunk": self.chunk, "adim": self.adim, "hop": self.backend.hop is not None, + "score_kind": self.score_kind, "rescore_top": self.rescore_top, + "n_particles_rescore": self.n_particles_rescore, "temperature_override": self.temperature, + "lcb_quantile": self.lcb_quantile if self.score_kind == "conformal_lcb" else None, + "temperature": self.effective_temperature(), + "horizon": self.effective_horizon(), + # coin chain (gen_q#267): None for every non-chain cell, so an archived describe() is + # unchanged and the loader can tell a chain cell from a fold cell by this key alone. + "chain": (None if self.mode not in ("chain", "chain_rb") else { + "p_cont": chain_continuation_p(self.beta, self.gamma), + "cap": self.chain_cap or chain_cap_fn(self.beta, self.gamma, self.chain_tail_eps), + "cap_source": "override" if self.chain_cap else "computed from the 1e-3 tail", + "tail_eps": self.chain_tail_eps, + "E_hops_expected": (lambda p: p / (1 - p))(chain_continuation_p(self.beta, self.gamma)), + "reference": "ogbench_genq/rsm.py:113 rec_p=(gamma-beta)/(gamma*(1-beta)); :532 chain_prob"}), + "chain_hops": self.chain_hop_summary()} + + +# --------------------------------------------------------------------------- # +# test helpers: random checkpoints in the real blob formats +# --------------------------------------------------------------------------- # +def save_random_rsm_ckpt(path, d_in=STATE_DIM, chunk=8, adim=7, flow_width=64, flow_depth=2, seed=0): + """Randomly initialised identity-encoder MLP successor in train_rsm.py's blob format.""" + model, _, _ = _rsm_modules() + torch.manual_seed(seed) + d_act = chunk * adim + enc = model.IdentityEncoder(d_in) + rew = model.RewardHead(d_in, 1) + flow = model.OccFlow(d_in, d_act, 1, width=flow_width, depth=flow_depth) + blob = {"enc": enc.state_dict(), "enc_t": enc.state_dict(), "rew": rew.state_dict(), + "flow": flow.state_dict(), "rms": torch.ones(d_in), "n_pr": 0, "tasks": ["task"], + "d_act": d_act, "step": 0, "enc_kind": "identity", "d_in": d_in, "d_lat": d_in, + "config": {"enc": "identity", "d_z": d_in, "enc_width": 1024, "flow_width": flow_width, + "flow_depth": flow_depth, "chunk": chunk, "beta_lo": 0.9, "beta_hi": 0.995}} + torch.save(blob, path) + return path + + +def save_random_hop_ckpt(path, d_in=STATE_DIM, chunk=8, adim=7, family="gauss", seed=0): + model, _, _ = _rsm_modules() + torch.manual_seed(seed) + d_act = chunk * adim + if family == "gauss": + pol = model.BCHead(d_in, d_act, 1) + elif family == "flow": + pol = model.FlowPolicy(d_in, d_act, 1) + else: + pol = model.ConcatFlowPolicy(d_in, d_act, 1, width=64, depth=2) + torch.save({"pol": pol.state_dict(), "round": 1, + "config": {"policy_family": family, "chunk": chunk, "policy_features": "raw", + "feat_scale": "zscore", "pol_width": 64, "pol_depth": 2}}, path) + return path + + +def save_feat_stats(path, d=STATE_DIM, seed=0): + rng = np.random.default_rng(seed) + np.savez(path, mu=rng.normal(size=d).astype(np.float32), + sd=np.maximum(rng.uniform(0.5, 2.0, size=d), 1e-3).astype(np.float32), dim=d, n=1000) + return path diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/rsm_scorer.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/rsm_scorer.py new file mode 100644 index 0000000000000000000000000000000000000000..9612985ca6a1d7b7a0601a8b8c60588b061acdbd --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/rsm_scorer.py @@ -0,0 +1,1120 @@ +"""RSM (successor-model) scorer for RISE policy extraction (rsm_rise Stage 3). + +One object, two jobs: + + score(state, A) -> Q̄[N] E1: rank N candidate 8-step chunks at one state (common random + numbers across the N rows: particle i of every candidate uses the + same flow noise / hop-head noise / restart coin, so the arg-max is a + paired comparison). + advantage(state, A) -> Q̄, V̄_τ E2: Q̄ of the logged (kNN-swapped) chunk and the τ-expectile of Q̄ + over M hop-head chunks at the same state. + +State = the pooled DINO vector RISE's `DinoV2Core(concatenate=True)` produces for the CURRENT frame: +[agentview CLS|GeM (768) | wrist CLS|GeM (768) | eef_pos(3) eef_quat(4) gripper_qpos(2)] = 1545, z-scored +with the Stage-1 cache's feat_stats.npz (mu/sd over all frames, sd floored at 1e-3). Images arrive in the +policy's format (float CHW in [0,1], robomimic ObsUtils.process_frame), which is exactly what +scripts/relabel_dino.py fed DINO when it built the cache (NOT the H/W-transposed layout of RISE's +offline relabel_dino_features.py; `img_layout="rise_t"` reproduces that one if a cache ever needs it). + +Backends + mlp the rsm_libero MLP flow (train_rsm.py blob: enc/rew/flow/rms/config/d_act/enc_kind/d_in), + read-outs d1 / fold / recursive via is_ope.q_fold / q_recursive (crn=True). + dwm the token successor model (stream C): `dwm_readout.load_critic_dwm(path, device)` (module name + `rsm_dwm_module`, default `dwm_readout`), scoring RAW [B,514,384] tokens + RAW proprio; d1 / fold. + mc MC return-to-go MLP on [x | A] (S3H5 control), blob {"net", "config":{"d_in","d_act","width","depth"}}. +The IQL-critic backend (S3H4) lives in rsm_planner.py because it scores the raw obs dict with the +fork's own critic nets, not a DINO state. + +All read-outs return Q̄ on the success-probability scale ([0,1] for d1/fold; recursive is rescaled by +(1-γ) from is_ope's Q/(1-γ)). The E2 caller rescales (1/(1-γ) "td" or batch-standardised "std"). + +Logit read-out (stream E, orchestrator 13:05): d1 / fold also expose Q̄_logit = mean over particles of the +reward head's RAW logit at the last hop state (the DWM read-out's `q_logit` convention), which does not +saturate / tie at 1.0 the way mean-sigmoid does. `score_kind="logit"` ranks by it; `.last_q` / `.last_q_logit` +hold both arrays after every score() call. Temperature T (calib.json next to the checkpoint, or an explicit +override) enters only the sigmoid: q = mean_i σ(logit_i / T); the logit ranking is T-free. Two-stage screening +(rescore_top=K, n_particles_rescore=M): every candidate is scored with n_particles, the top-K by the ranking +array are rescored with M particles and written back (DWM: inside dwm_readout; MLP: here, second draw of the +seeded stream). Log-complement read-out (gen_q#266): `score_kind="prob_log"` ranks by the SAME quantity as "prob" -- the whole +product fold, averaged over particles -- but folded as log(1 - Q) so it never rounds to 1.0. `prob`'s ties are +numerical, not structural: threading cells record reward logits near +121, where σ is exactly 1.0 in float64 +and Q collapses to exactly 1.0 for ~60 of 128 candidates, so the arg-max there is a uniform draw inside the +tied set. `prob_log` is a strictly monotone transform of `prob`'s infinite-precision value, so it keeps the +fold (unlike "logit", which reports only the LAST hop's logit and discards hops 0..L-2) and still totally +orders the candidates. It needs the per-hop reward logits, so it is mlp-backend / d1-fold only, and +`.last_q_problog` holds it after every score() call. Rows of the MLP read-out are processed in slices of at most `max_rows` (65536) with the CRN +noise drawn ONCE for all particles, so plan_particles up to 32768 at N=128 fits and results do not depend on +the slicing. +""" +from __future__ import annotations + +import contextlib +import importlib +import os +import sys +from types import SimpleNamespace + +import numpy as np +import torch +import torch.nn as nn + +RSM_LIBERO_DIR = os.environ.get( + "RSM_LIBERO_DIR", "/proj/dmfexp/zwhong/rsm_rise/code/gen_q/rsm_libero") + +CAMS = ("agentview_image", "robot0_eye_in_hand_image") +PROPRIO_KEYS = ("robot0_eef_pos", "robot0_eef_quat", "robot0_gripper_qpos") +D_TOK, N_PATCH = 384, 256 +STATE_DIM = 2 * 2 * D_TOK + 9 # 1545 + +_MODES = ("d1", "fold", "recursive") +# Backends whose state is the RAW token frame + raw proprio rather than the pooled 1545-d vector, and +# whose q() takes the dwm read-out's kwargs (crn_seed, internal two-stage rescore). gen_q#268 adds +# `dinowm`: the same token state and the same read-out interface, with DINO-WM's deterministic latent +# dynamics in place of the occupancy flow (rsm_libero/dinowm_readout.py). +TOKEN_BACKENDS = ("dwm", "dinowm") +# Default read-out module per backend; `rsm_dwm_module` overrides it (that is how stream C injects an +# alternative DWM read-out). Keyed by backend so `rsm_backend=dinowm` needs no extra hydra override +# and the eval JSON records WHICH scorer ran in `rsm_backend` itself -- which is what +# scripts/verdict_table.py classifies the arm on. +READOUT_MODULE = {"dwm": "dwm_readout", "dinowm": "dinowm_readout"} +_SCORE_KINDS = ("prob", "logit", "prob_log", "conformal_lcb") +MAX_ROWS = 65536 # rows (candidates x particles) per slice of the MLP read-out + + +def read_calib_temperature(ckpt): + """calib.json next to a checkpoint (rsm_libero/calib_dwm.py: {"T": ...}) -> T, or None if absent/unreadable.""" + try: + cj = os.path.join(os.path.dirname(os.path.abspath(ckpt)), "calib.json") + if os.path.exists(cj): + import json + return float(json.load(open(cj))["T"]) + except Exception as e: # a broken calib file must not break the scorer; T = 1 + print(f"[rsm_scorer] calib.json next to {ckpt} unreadable ({e}); T=1", flush=True) + return None + + +def _rsm_modules(): + """Import rsm_libero's model / train_rsm / is_ope lazily (they are plain top-level modules).""" + if RSM_LIBERO_DIR not in sys.path: + sys.path.insert(0, RSM_LIBERO_DIR) + model = importlib.import_module("model") + train_rsm = importlib.import_module("train_rsm") + is_ope = importlib.import_module("is_ope") + return model, train_rsm, is_ope + + +@contextlib.contextmanager +def seeded(seed, device=None): + """Fork the RNG state and seed it, so a scorer call is reproducible without disturbing the + caller's stream (the diffusion sampler's noise must stay independent of the scorer's).""" + if seed is None or int(seed) < 0: + yield + return + devices = [] + if device is not None and torch.device(device).type == "cuda" and torch.cuda.is_available(): + devices = [torch.device(device)] + with torch.random.fork_rng(devices=devices): + torch.manual_seed(int(seed)) + yield + + +def gem_pool(patch_tokens): + """DinoV2Core's GeM: [B,256,384] -> [B,384] (clamp 1e-6, pow 4, mean over the 16x16 grid, pow 1/4).""" + B = patch_tokens.shape[0] + pd = int(np.sqrt(patch_tokens.shape[-2])) + p = patch_tokens.reshape(B, pd, pd, -1).clamp(min=1e-6).permute(0, 3, 1, 2) + return nn.functional.avg_pool2d(p.pow(4), (pd, pd)).pow(1 / 4).reshape(B, -1) + + +def pooled_from_tokens(tok): + """[B,514,384] (agentview CLS, 256 patches, wrist CLS, 256 patches) -> [B,1536] = z.f16.npy layout.""" + out = [] + for c in range(2): + cls = tok[:, c * (1 + N_PATCH)] + pt = tok[:, c * (1 + N_PATCH) + 1:(c + 1) * (1 + N_PATCH)] + out.append(torch.cat([cls, gem_pool(pt)], -1)) + return torch.cat(out, -1) + + +def expectile(q, tau, iters=50): + """tau-expectile of each row of q [B,M] (tau=0.5 is exactly the mean). + Fixed-point iteration of the asymmetric-least-squares stationarity condition.""" + tau = float(tau) + v = q.mean(1, keepdim=True) + if abs(tau - 0.5) < 1e-12: + return v[:, 0] + for _ in range(iters): + w = torch.where(q > v, torch.full_like(q, tau), torch.full_like(q, 1.0 - tau)) + v_new = (w * q).sum(1, keepdim=True) / w.sum(1, keepdim=True) + if torch.allclose(v_new, v, atol=1e-7, rtol=0): + v = v_new + break + v = v_new + return v[:, 0] + + +# --------------------------------------------------------------------------- # +# state: pooled DINO vector / tokens from the policy's obs dict +# --------------------------------------------------------------------------- # +class PooledDinoState(nn.Module): + """obs dict at ONE time step (values [B, ...], images float CHW in [0,1]) -> z-scored 1545-d state. + + `dino` may be any module with `.backbone_model` (a dinov2 hub model) and `.transform`; by default + RISE's DinoV2Core (frozen, concatenate=True) is instantiated, which is what the cache used.""" + + def __init__(self, feat_stats, cams=CAMS, proprio_keys=PROPRIO_KEYS, backbone="dinov2_vits14", + img_layout="chw", dino=None): + super().__init__() + self.cams = tuple(cams) + self.proprio_keys = tuple(proprio_keys) + self.img_layout = img_layout + if dino is None: + from robomimic.models.obs_core import DinoV2Core + dino = DinoV2Core(input_shape=(3, 84, 84), backbone_name=backbone, frozen=True, concatenate=True) + self.dino = dino.eval() + for p in self.dino.parameters(): + p.requires_grad_(False) + # STATE DEFINITION (Stage 1, final): x = clip((feat - mu) / max(sd, sd_floor), -z_clip, z_clip). + # sd_floor / z_clip come from feat_stats.npz (relabel_dino.py writes them), else PACK.json next + # to it, else the defaults 0.01 / 10 -- identical to rsm_libero data.py._feat. + st = np.load(feat_stats) + mu = np.asarray(st["mu"], np.float32) + sd = np.asarray(st["sd"], np.float32) + sd_floor, z_clip = None, None + if "sd_floor" in st.files: + sd_floor = float(st["sd_floor"]) + if "z_clip" in st.files: + z_clip = float(st["z_clip"]) + pack = os.path.join(os.path.dirname(os.path.abspath(feat_stats)), "PACK.json") + if (sd_floor is None or z_clip is None) and os.path.exists(pack): + import json + pk = json.load(open(pack)) + sd_floor = float(pk.get("sd_floor", 0.01)) if sd_floor is None else sd_floor + z_clip = float(pk.get("z_clip", 10.0)) if z_clip is None else z_clip + self.sd_floor = 0.01 if sd_floor is None else sd_floor + self.z_clip = 10.0 if z_clip is None else z_clip + sd = np.maximum(sd, self.sd_floor).astype(np.float32) + self.register_buffer("mu", torch.as_tensor(mu)) + self.register_buffer("sd", torch.as_tensor(sd)) + self.d = int(mu.shape[0]) + + def normalize(self, feat): + """[B, d] raw [z | proprio] -> the trainer's state (z-score with floored sd, then clip).""" + x = (feat - self.mu) / self.sd + if self.z_clip and self.z_clip > 0: + x = x.clamp(-self.z_clip, self.z_clip) + return x + + def _images(self, obs_t): + ims = [] + for c in self.cams: + im = obs_t[c].float() + if im.dim() == 3: + im = im[None] + if self.img_layout == "rise_t": # RISE's offline relabel: (N,H,W,C)->(N,C,W,H) + im = im.transpose(-1, -2) + ims.append(im) + return ims + + def _proprio(self, obs_t, B): + pr = [obs_t[k].float().reshape(B, -1) for k in self.proprio_keys] + return torch.cat(pr, -1) + + @torch.no_grad() + def forward(self, obs_t): + ims = self._images(obs_t) + feats = [self.dino(im) for im in ims] # each [B, 768] + B = feats[0].shape[0] + x = torch.cat(feats + [self._proprio(obs_t, B)], -1) + if x.shape[1] != self.d: + raise RuntimeError(f"pooled state is {x.shape[1]}-d but feat_stats has {self.d} dims") + return self.normalize(x) + + @torch.no_grad() + def raw_features(self, obs_t): + """Un-normalised [z(1536) | proprio(9)] -- what the cache stores (z as fp16).""" + ims = self._images(obs_t) + feats = [self.dino(im) for im in ims] + B = feats[0].shape[0] + return torch.cat(feats + [self._proprio(obs_t, B)], -1) + + @torch.no_grad() + def tokens(self, obs_t): + """[B,514,384] raw (un-normalised) DINO tokens in the cache's token order, plus the pooled state.""" + ims = self._images(obs_t) + toks, pooled = [], [] + for im in ims: + f = self.dino.backbone_model.forward_features(self.dino.transform(im)) + cls, pt = f["x_norm_clstoken"], f["x_norm_patchtokens"] + toks.append(torch.cat([cls[:, None], pt], 1)) + pooled.append(torch.cat([cls, gem_pool(pt)], -1)) + B = toks[0].shape[0] + tok = torch.cat(toks, 1) + x = torch.cat(pooled + [self._proprio(obs_t, B)], -1) + return tok, self.normalize(x) + + +# --------------------------------------------------------------------------- # +# hop head (Stage 2, bc_arm.py policy_r1.pt) +# --------------------------------------------------------------------------- # +class HopPolicy(nn.Module): + """Wraps a bc_arm.py policy so q_fold / q_recursive can call sample_eps(z, task, eps) on the + z-scored state. bc_arm's `--policy-features raw --feat-scale center` rescales the input by + sd / mean(sd) over the visual block (RawFeat); `zscore` is the identity.""" + + def __init__(self, pol, scale): + super().__init__() + self.pol = pol + self.d_act = int(pol.d_act) if hasattr(pol, "d_act") else int(pol.mu.out_features) + self.register_buffer("scale", torch.as_tensor(scale, dtype=torch.float32)) + + def sample_eps(self, z, task, eps): + z = z * self.scale + if hasattr(self.pol, "sample_eps"): # BCHead, ConcatFlowPolicy + return self.pol.sample_eps(z, task, eps) + # FlowPolicy: its Euler loop started from the supplied noise (CRN) + a = eps + steps = int(getattr(self.pol, "steps", 8)) + for s in range(steps): + k = torch.full((z.shape[0],), 1.0 - s / steps, device=z.device) + a = a + self.pol.velocity(z, task, a, k) / steps + return a + + def sample(self, z, task): + return self.pol.sample(z * self.scale, task) + + +def load_hop_head(path, d_z, n_task, device, feat_sd=None): + model, _, _ = _rsm_modules() + ck = torch.load(path, map_location=device, weights_only=False) + c = ck["config"] + sd_ = ck["pol"] + fam = c.get("policy_family", "concat") + if c.get("policy_features", "raw") != "raw": + raise RuntimeError("hop head must read raw (z-scored) features; got policy_features=" + f"{c.get('policy_features')}") + if fam == "gauss": + d_act = sd_["mu.weight"].shape[0] + pol = model.BCHead(d_z, d_act, n_task) + elif fam == "flow": + d_act = sd_["out.weight"].shape[0] + pol = model.FlowPolicy(d_z, d_act, n_task) + else: + last = max(int(k.split(".")[1]) for k in sd_ if k.startswith("net.") and k.endswith(".weight")) + d_act = sd_[f"net.{last}.weight"].shape[0] + pol = model.ConcatFlowPolicy(d_z, d_act, n_task, width=int(c.get("pol_width", 1024) or 1024), + depth=int(c.get("pol_depth", 4) or 4)) + pol.load_state_dict(sd_) + pol = pol.to(device).eval() + for p in pol.parameters(): + p.requires_grad_(False) + scale = np.ones(d_z, np.float32) + if c.get("feat_scale", "zscore") == "center": + if feat_sd is None: + raise RuntimeError("hop head trained with --feat-scale center needs feat_stats sd") + n_z = d_z - 9 + scale[:n_z] = feat_sd[:n_z] / max(float(feat_sd[:n_z].mean()), 1e-6) + return HopPolicy(pol, scale).to(device), int(c.get("chunk", 8)) + + +def _particle_quantile(qp, p): + """p-quantile over the particle axis of a [B, n] per-particle score matrix (the conformal read-out's + lower confidence bound). torch.quantile caps its input at 2**24 elements, so it is applied row-blockwise.""" + qp = qp.float() + p = float(p) + if not 0.0 < p < 1.0: + raise ValueError(f"plan_lcb_quantile must be in (0, 1), got {p}") + n = qp.shape[1] + if n < 2: + return qp[:, 0].clone() + rows = max(1, (2 ** 24) // n) + if rows >= qp.shape[0]: + return torch.quantile(qp, p, dim=1) + return torch.cat([torch.quantile(qp[i:i + rows], p, dim=1) for i in range(0, qp.shape[0], rows)], 0) + + +# --------------------------------------------------------------------------- # +# MLP read-out with the raw logit (is_ope.q_fold re-implemented; is_ope.py belongs to another stream) +# --------------------------------------------------------------------------- # +@torch.no_grad() +def _q_fold_logit(enc_z, a_chunk, task, *, rew, flow, rms, pol, beta, gamma, depth=1, n_particles=16, + flow_steps=8, temperature=1.0, max_rows=MAX_ROWS, return_particles=False, + return_problog=False): + """is_ope.q_fold (crn=True) with the reward head's RAW logit collected at the read-out states. + + Returns (q_mean [B], logit_mean [B]): q_mean = the product fold Q_k = c_k + (1 - c_k) γ^h Q_{k+1} with + c_k = σ(R(z_k) / T), Monte-Carlo mean over particles (== q_fold's first output when T = 1); logit_mean = + mean over particles of R(z_L) at the LAST hop (the DWM read-out's q_logit convention; at depth 1 it is the + logit of the d1 read-out). CRN exactly as q_fold: the noise for hop k (x0 [n, D]) and the hop-head noise + (eps [n, d_act]) are drawn from the current torch stream in q_fold's order and tiled over the candidates + (row b*n + i = candidate b, particle i). All of it is drawn ONCE up front, then the B*n rows are processed + in slices of at most `max_rows` rows (whole candidates; particles are sliced too when one candidate alone + exceeds max_rows), so the estimate does not depend on the slicing. + + return_particles=True appends the per-particle fold values q [B, n] (whose mean over dim 1 is q_mean); the + conformal read-out ranks by a low quantile of that row instead of its mean. + + return_problog=True appends the `prob_log` ranking array [B] (higher is better): the SAME quantity as + q_mean, computed in the log-complement domain so it does not collapse when σ saturates. Derivation + (gen_q#266) -- with G = γ^h, q_L = 0 and q_k = c_k + (1 - c_k) G q_{k+1}: + + 1 - q_k = (1 - c_k) (1 - G q_{k+1}) (exact) + u_k := log(1 - q_k) = logσ(-lg_k / T) + log1p(G expm1(u_{k+1})), u_L = 0 (*) + + using 1 - G q_{k+1} = 1 - G(1 - e^{u_{k+1}}) = 1 + G expm1(u_{k+1}), so the recursion is closed in the + log domain and never reads the float32 q (which is a DENORMAL in a hopeless state and corrupted the + ranking at depth >= 2 when it was used; see the comment in the loop). + + NOTE this is a one-step RECURSION, not a sum over hops. The issue's summed form + `u_0 = Σ_k [log(1-c_k) + log(1 - G q_{k+1})]` double-counts, because log(1 - G q_{k+1}) is not + log(1 - q_{k+1}) unless G = 1, so each term is short a -log(1 - q_{k+1}). Counterexample: L = 2, + c = (0.5, 0.5), G = 0.5 -> q_0 = 0.625, u_0 = -0.98083, while the sum gives -1.67398 (1 - q_0 = 0.1875 + instead of 0.375). (*) is what is implemented, and the test asserts it against a float64 loop. + + Both terms of (*) are well conditioned where the probability form is not: logσ(-lg/T) returns about -121 + for lg/T = 121 instead of log(0) = -inf, and q_{k+1} in [0, 1] with G < 1 gives 1 - G q_{k+1} >= 1 - G + (0.182 at beta=0.95, gamma=0.99), so reusing the fold's own float q_{k+1} there costs only a relative + O(eps) error. The per-particle mean is taken in the SAME domain, so the order is exactly the order of + the infinite-precision q_mean: since mean_i q_i = 1 - mean_i (1 - q_i), ranking by mean_i q_i descending + is ranking by log(mean_i exp(u_i)) ascending, and the array returned is its negation. That mean is + taken as m + log1p(mean_i expm1(u_i - m)) with m = max_i u_i, NOT as logsumexp_i(u_i) - log n; see the + comment at the return for why the logsumexp form collapses in the hopeless regime.""" + _, train_rsm, _ = _rsm_modules() + sample_future = train_rsm.sample_future + dev = enc_z.device + B, D = enc_z.shape + n, depth = int(n_particles), int(depth) + if depth >= 2 and pol is None: + raise RuntimeError(f"fold at depth {depth} needs a hop head (rsm_hop_ckpt)") + beta, gamma = float(beta), float(gamma) + h = 1.0 / (1.0 - beta) + T = float(temperature) if temperature else 1.0 + x0s, epss = [], [] + for k in range(depth): # same draw order as q_fold(crn=True) + x0s.append(torch.randn(n, D, device=dev)) + if k < depth - 1: + epss.append(torch.randn(n, int(pol.d_act), device=dev)) + max_rows = max(int(max_rows), 1) + cand_per = max(1, max_rows // n) + part_per = n if n <= max_rows else max_rows + q_out = torch.empty(B, n, device=dev, dtype=torch.float32) + lg_out = torch.empty(B, n, device=dev, dtype=torch.float32) + # log(1 - q) per particle, accumulated in float64: the saturated values sit near -121 * depth, where + # float32's absolute resolution (1e-5 at that magnitude) is still far below the O(0.1) logit gaps we + # need to order, but float64 costs one [B, n] buffer and removes the question. + lq_out = torch.empty(B, n, device=dev, dtype=torch.float64) if return_problog else None + G = gamma ** h + # G capped strictly below 1 for the log-domain fold only: at G == 1 (gamma == 1) the term + # log1p(G * expm1(u)) would be log(0) = -inf for a fully saturated hop. q_out's fold keeps the + # uncapped G, so `prob` and `logit` stay bit-identical. + G_l = min(G, 1.0 - 1e-12) + for b0 in range(0, B, cand_per): + b1 = min(B, b0 + cand_per); nb = b1 - b0 + for p0 in range(0, n, part_per): + p1 = min(n, p0 + part_per); npp = p1 - p0 + z = enc_z[b0:b1].repeat_interleave(npp, 0) + a = a_chunk[b0:b1].repeat_interleave(npp, 0) + tk = task[b0:b1].repeat_interleave(npp, 0) + bq = torch.full((z.shape[0],), beta, device=dev) + cs, lcs, lg = [], [], None + for k in range(depth): + x0 = x0s[k][p0:p1].repeat(nb, 1) + z = sample_future(flow, z, a, tk, bq, rms, flow_steps, n=1, x0=x0) + lg = rew(z, tk).float() + cs.append(torch.sigmoid(lg / T)) + if return_problog: + # log(1 - c_k) = log σ(-lg_k / T), exact for large positive logits + lcs.append(nn.functional.logsigmoid(-(lg.double() / T))) + if k == depth - 1: + break + a = pol.sample_eps(z, tk, epss[k][p0:p1].repeat(nb, 1)) + q = torch.zeros_like(cs[-1]) + lq = None if not return_problog else torch.zeros_like(lcs[-1]) # u_L = log(1 - q_L) = 0 + for k in range(depth - 1, -1, -1): # backward fold + c = cs[k] + if return_problog: + # u_k = log(1 - c_k) + log(1 - G q_{k+1}), with the second term written WITHOUT q: + # 1 - G q_{k+1} = 1 - G(1 - e^{u_{k+1}}) = 1 + G expm1(u_{k+1}). + # Using the fold's own float32 q_{k+1} here was wrong at the bottom of the range and a + # 90-digit reference caught it: in a hopeless state c_k = sigmoid(-100) = 3.7e-44 is a + # float32 DENORMAL with 2-3 bits of mantissa, and log1p(-G q) is then the same + # magnitude as log(1 - c_k) itself, so the quantisation corrupted the ranking at every + # depth >= 2 (depth 1 was unaffected, which is why the preflight cell looked fine). + # This form is closed in float64: expm1 is exact for tiny u, log1p for tiny arguments, + # and the saturated end is unchanged (u -> -inf gives log1p(-G) = log(1 - G)). + lq = lcs[k] + torch.log1p(G_l * torch.expm1(lq)) + q = c + (1.0 - c) * G * q + q_out[b0:b1, p0:p1] = torch.nan_to_num(q, nan=0.0).clamp(0.0, 1.0).view(nb, npp) + lg_out[b0:b1, p0:p1] = torch.nan_to_num(lg, nan=0.0).view(nb, npp) + if return_problog: + # nan -> 0.0 is the SAME fallback as q's (q = 0 <-> log(1 - q) = 0), and clamp_max(0) + # mirrors q.clamp(0, 1)'s upper end (q >= 0 <-> u <= 0). + lq_out[b0:b1, p0:p1] = torch.nan_to_num(lq, nan=0.0).clamp(max=0.0).view(nb, npp) + out = [q_out.mean(1), lg_out.mean(1)] + if return_particles: + out.append(q_out) + if return_problog: + # rank = -log(mean_i (1 - q_i)) = -log(mean_i exp(u_i)): monotone in the exact q_mean, higher better. + # + # NOT `logsumexp_i(u_i) - log n`. That form is algebraically right and numerically WRONG at the + # bottom of the range, and it cost a preflight to find out. In a hopeless state every reward logit + # is about -100, so u_i = logsigmoid(-lg_i/T) is about -3.7e-44: distinct per candidate and + # perfectly representable, but `logsumexp` returns m + log(sum exp(u - m)) = m + log n, and adding + # -3.7e-44 to log 16 = 2.7726 loses it completely. Subtracting log n then gives EXACTLY -0.0 for + # all 128 candidates -- measured: 1 distinct value out of 128, i.e. a total collapse, and strictly + # WORSE than `prob` itself (24-95 distinct there). It is the same failure as `prob`'s, mirrored to + # the other end of the range. + # + # So the mean is taken as m + log1p(mean_i expm1(u_i - m)), m = max_i u_i: exactly the same + # quantity, but every step is conditioned for small arguments. expm1 is exact for tiny u_i - m + # (where `exp` would return 1.0 and drop the difference), log1p is exact for tiny means, and log n + # never appears, so nothing is added to an O(1) constant and cancelled back out. Behaviour at the + # saturated-high end is unchanged: there u_i - m spans O(10) and every term is O(1). + m = lq_out.max(dim=1, keepdim=True).values # <= 0 + rel = torch.expm1(lq_out - m).mean(dim=1) # in (-1, 0] + out.append(-(m[:, 0] + torch.log1p(rel.clamp(min=-1.0 + 1e-300)))) + return tuple(out) + + +# --------------------------------------------------------------------------- # +# backends +# --------------------------------------------------------------------------- # +class MLPBackend: + """rsm_libero MLP successor (train_rsm.py). Uses is_ope.load_critic (identity or MLP encoder).""" + + def __init__(self, ckpt, device, d_in=STATE_DIM, hop_ckpt="", feat_sd=None, max_rows=MAX_ROWS): + model, train_rsm, is_ope = _rsm_modules() + self.is_ope = is_ope + self.device = device + self.max_rows = int(max_rows) + self.temperature = read_calib_temperature(ckpt) or 1.0 # calib.json next to the blob, else 1 + self.enc, self.rew, self.flow, self.rms, self.cfg = is_ope.load_critic( + ckpt, d_in, 1, device, data=None) + ck = torch.load(ckpt, map_location="cpu", weights_only=False) + self.n_task = max(1, len(ck.get("tasks", ["task"]))) + self.d_act = int(ck["d_act"]) + self.q_action_winrate = ck.get("q_action_winrate", None) + self.step = ck.get("step", None) + self.chunk = int(self.cfg.get("chunk", 8)) + self.adim = self.d_act // self.chunk + self.d_z = int(self.cfg["d_z"]) + self.hop, self.hop_chunk = None, None + if hop_ckpt: + self.hop, self.hop_chunk = load_hop_head(hop_ckpt, self.d_z, self.n_task, device, feat_sd=feat_sd) + if self.hop.d_act != self.d_act: + raise RuntimeError(f"hop head emits {self.hop.d_act}-d chunks, RSM expects {self.d_act}") + + def latent(self, x): + return self.enc(x) + + def q(self, z, a, *, mode, depth, beta, gamma, n_particles, flow_steps, return_logit=False, + temperature=None, return_lcb=None, return_problog=False): + """Q̄ [B] (return_logit=False, the historic contract) or (Q̄, Q̄_logit) [B] each; with return_lcb=

+ a third array, the p-quantile over particles of the per-particle Q (the conformal read-out), and with + return_problog=True a further array, the `prob_log` ranking (Q̄ itself, computed in the log-complement + domain so it does not tie when σ saturates). The returned tuple is + (Q̄, Q̄_logit [, LCB if return_lcb] [, prob_log if return_problog]). d1 / fold go through + `_q_fold_logit` (== is_ope.q_fold(crn=True) at T=1, plus the raw logit, row-sliced); recursive keeps + is_ope.q_recursive and has neither a logit nor a prob_log (it has no per-hop c_k). + temperature=None -> the checkpoint's calib.json T (or 1).""" + task = torch.zeros(z.shape[0], dtype=torch.long, device=z.device) + if mode == "d1": + depth = 1 + if depth >= 2 and self.hop is None: + raise RuntimeError(f"read-out {mode} at depth {depth} needs a hop head (rsm_hop_ckpt)") + T = self.temperature if temperature is None else float(temperature) + if mode in ("d1", "fold"): + out = list(_q_fold_logit(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, pol=self.hop, + beta=beta, gamma=gamma, depth=depth, n_particles=n_particles, + flow_steps=flow_steps, temperature=T, max_rows=self.max_rows, + return_particles=return_lcb is not None, + return_problog=bool(return_problog))) + q, ql = out.pop(0), out.pop(0) + res = [q, ql] + if return_lcb is not None: + res.append(_particle_quantile(out.pop(0), return_lcb)) + if return_problog: + res.append(out.pop(0)) + if len(res) > 2: + return tuple(res) + return (q, ql) if return_logit else q + if mode == "recursive": + q, _ess = self.is_ope.q_recursive(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, + pol=self.hop, wend=None, beta=beta, gamma=gamma, depth=depth, + n_particles=n_particles, flow_steps=flow_steps, + use_is=False, crn=True) + q = q * (1.0 - gamma) # back to the success-probability scale + if return_lcb is not None: + raise RuntimeError("plan_score=conformal_lcb needs the d1 / fold read-out (recursive has no " + "per-particle success probability)") + if return_problog: + raise RuntimeError("plan_score=prob_log needs the d1 / fold read-out (recursive has no " + "per-hop reward logits to fold in the log-complement domain)") + return (q, None) if return_logit else q + raise ValueError(mode) + + def q_fold_reference(self, z, a, *, depth, beta, gamma, n_particles, flow_steps): + """is_ope.q_fold itself (crn=True), for tests against `_q_fold_logit`.""" + task = torch.zeros(z.shape[0], dtype=torch.long, device=z.device) + q, _ = self.is_ope.q_fold(z, a, task, rew=self.rew, flow=self.flow, rms=self.rms, pol=self.hop, + beta=beta, gamma=gamma, depth=depth, n_particles=n_particles, + flow_steps=flow_steps, crn=True) + return q + + def hop_sample(self, z, eps): + task = torch.zeros(z.shape[0], dtype=torch.long, device=z.device) + return self.hop.sample_eps(z, task, eps) + + +class DWMBackend: + """Token successor model, stream C's shipped interface (rsm_libero/dwm_readout.py, status/C_dwm.md): + crit = load_critic_dwm(path, device); crit.q(x_tokens RAW [B,514,384], a_chunk [B,56], beta, + n_particles, crn_seed, depth, mode in {d1, fold}, proprio RAW [B,9], + hop_policy(pooled_raw [R,1545], eps [R,d_act]) -> [R,56], gamma, flow_steps) -> Q̄ [B] + The critic normalises tokens/proprio itself (cache//tokens/tok_stats.npz). The hop head runs on the + z-scored pooled state, so the callable applies our feat_stats rule (`normalize`) to pooled_raw first. + `q()` takes inp = (tokens_raw, proprio_raw). mode "recursive" is not offered by the DWM read-out.""" + + def __init__(self, ckpt, device, module="dwm_readout", hop_ckpt="", feat_sd=None, d_in=STATE_DIM, + normalize=None): + _rsm_modules() + try: + mod = importlib.import_module(module) + except ImportError as e: + raise RuntimeError(f"DWM backend needs module '{module}' with load_critic_dwm (stream C): {e}") + self.core = mod.load_critic_dwm(ckpt, device=device) + self.d_act = int(self.core.d_act) + self.chunk = int(self.core.config.get("chunk", 8)) + self.adim = self.d_act // self.chunk + self.d_z = d_in + self.normalize = normalize if normalize is not None else (lambda x: x) + self.q_action_winrate = getattr(self.core, "q_action_winrate", None) + self.step = getattr(self.core, "step", None) + self.hop = None + if hop_ckpt: + self.hop, _ = load_hop_head(hop_ckpt, d_in, 1, device, feat_sd=feat_sd) + + def _hop_callable(self): + if self.hop is None: + return None + hop, norm = self.hop, self.normalize + + class _Hop: + d_act = hop.d_act + + def __call__(self, pooled_raw, eps): + x = norm(pooled_raw.float()) + task = torch.zeros(x.shape[0], dtype=torch.long, device=x.device) + return hop.sample_eps(x, task, eps) + return _Hop() + + @property + def temperature(self): + return float(getattr(self.core, "temperature", 1.0)) + + def q(self, inp, a, *, mode, depth, beta, gamma, n_particles, flow_steps, crn_seed=None, + return_logit=False, temperature=None, rescore_top=0, n_particles_rescore=0, return_lcb=None): + """Q̄ [B] or (Q̄, Q̄_logit) with return_logit=True; temperature=None -> the critic's own (calib.json); + rescore_top=K / n_particles_rescore=M -> dwm_readout's two-stage screening (top-K by q_logit). + + return_lcb=

additionally returns the p-quantile over particles of the per-particle Q. dwm_readout + returns only the MEAN, so the per-particle values are rebuilt from its `return_hops=True` output (the + per-hop c_k [B, n], folded exactly as _q_once does). Those hops belong to the STAGE-1 pass, so the + conformal read-out is incompatible with the internal two-stage screening and raises instead of + silently ranking rescored candidates by their stage-1 spread.""" + tok, pr = inp + if mode == "recursive": + raise RuntimeError("the DWM read-out offers d1 / fold only (rsm_libero/dwm_readout.py)") + if mode == "d1": + depth = 1 + if crn_seed is None: # fresh CRN draw per call, shared by all rows + crn_seed = int(torch.randint(0, 2 ** 31 - 1, (1,), device="cpu")) + kw = {} + if temperature is not None: + kw["temperature"] = float(temperature) + if rescore_top and n_particles_rescore: + kw["rescore_top"] = int(rescore_top) + kw["n_particles_rescore"] = int(n_particles_rescore) + if return_lcb is None: + return self.core.q(tok, a, float(beta), n_particles=int(n_particles), crn_seed=int(crn_seed), + depth=int(depth), mode=mode, proprio=pr, hop_policy=self._hop_callable(), + gamma=float(gamma), flow_steps=int(flow_steps), + return_logit=bool(return_logit), **kw) + if "rescore_top" in kw: + raise RuntimeError("plan_score=conformal_lcb cannot be combined with the DWM two-stage screening " + "(plan_rescore_top / plan_particles_rescore): dwm_readout only exposes the " + "stage-1 per-particle values") + (q, ql), cs = self.core.q(tok, a, float(beta), n_particles=int(n_particles), crn_seed=int(crn_seed), + depth=int(depth), mode=mode, proprio=pr, hop_policy=self._hop_callable(), + gamma=float(gamma), flow_steps=int(flow_steps), return_logit=True, + return_hops=True, **kw) + qp = torch.zeros_like(cs[-1]) # per-particle fold, same recursion as dwm_readout + if mode == "d1" or len(cs) == 1: + qp = cs[0] + else: + h = 1.0 / (1.0 - float(beta)) + for c in reversed(cs): + qp = c + (1.0 - c) * (float(gamma) ** h) * qp + qp = torch.nan_to_num(qp, nan=0.0).clamp(0.0, 1.0) + return q, ql, _particle_quantile(qp, return_lcb) + + def hop_sample(self, x, eps): + task = torch.zeros(x.shape[0], dtype=torch.long, device=x.device) + return self.hop.sample_eps(x, task, eps) + + +class LeWMBackend: + """LeWM (gen_q#268): rsm_libero/lewm_readout.py, a JEPA world model with a membership probe. + + crit = load_critic_lewm(path, device) + crit.q(inp = (frames [B,6,84,84] uint8-or-float, proprio (ignored)), a_chunk [B,56], + depth=L, mode in {d1, fold}, gamma) -> Q [B] + + Its state is PIXELS -- the two RISE cameras stacked as 6 channels -- because LeWM predicts its + OWN encoder's embeddings; feeding it frozen DINO features would make it DINO-WM. The scorer + therefore hands it the planner's frames and still computes the pooled DINO state alongside, so + the hop head and every other consumer are unaffected and DINO still runs once per frame. + Deterministic, so there is no particle dimension: it is the cheapest scorer in the table. + """ + + def __init__(self, ckpt, device, module="lewm_readout", hop_ckpt="", feat_sd=None, + d_in=STATE_DIM, normalize=None): + _rsm_modules() + try: + mod = importlib.import_module(module) + except ImportError as e: + raise RuntimeError(f"LeWM backend needs module '{module}' with load_critic_lewm: {e}") + self.core = mod.load_critic_lewm(ckpt, device=device) + self.d_act = int(self.core.d_act) + self.chunk = int(self.core.chunk) + self.adim = self.d_act // self.chunk + self.d_z = d_in + self.res, self.in_ch = int(self.core.res), int(self.core.in_ch) + self.cams = tuple(self.core.cams) + self.normalize = normalize if normalize is not None else (lambda x: x) + self.q_action_winrate = getattr(self.core, "q_action_winrate", None) + self.step = getattr(self.core, "step", None) + # No hop head: LeWM rolls the SAME candidate chunk (see lewm_readout's deviation 2), so a hop + # policy would never be called. Kept as None rather than loaded, so an E2 advantage() call + # fails loudly instead of silently scoring something else. + self.hop = None + + @property + def temperature(self): + return float(getattr(self.core, "temperature", 1.0)) + + def q(self, inp, a, *, mode, depth, beta, gamma, n_particles, flow_steps, crn_seed=None, + return_logit=False, temperature=None, rescore_top=0, n_particles_rescore=0, + return_lcb=None): + return self.core.q(inp, a, beta=beta, n_particles=1, crn_seed=crn_seed, depth=depth, + mode=mode, gamma=gamma, flow_steps=flow_steps, + return_logit=return_logit, temperature=temperature, + return_lcb=return_lcb) + + def hop_sample(self, x, eps): + return self.core.hop_sample(x, eps) + + +class MCBackend: + """MC return-to-go critic on the pooled state (S3H5). blob: {"net": state_dict, + "config": {"d_in": 1545, "d_act": 56, "width": 1024, "depth": 3, "scale": 1.0}}, net = MLP([x|A]) -> R.""" + + def __init__(self, ckpt, device, hop_ckpt="", feat_sd=None): + ck = torch.load(ckpt, map_location=device, weights_only=False) + c = ck["config"] + self.d_act, self.chunk = int(c["d_act"]), int(c.get("chunk", 8)) + self.adim = self.d_act // self.chunk + self.d_z = int(c["d_in"]) + w, dp = int(c.get("width", 1024)), int(c.get("depth", 3)) + layers, ind = [], self.d_z + self.d_act + for i in range(dp): + layers += [nn.Linear(ind if i == 0 else w, w), nn.SiLU()] + layers += [nn.Linear(w, 1)] + self.net = nn.Sequential(*layers).to(device) + self.net.load_state_dict(ck["net"]) + self.net.eval() + self.scale = float(c.get("scale", 1.0)) + self.hop = None + if hop_ckpt: + self.hop, _ = load_hop_head(hop_ckpt, self.d_z, 1, device, feat_sd=feat_sd) + + def q(self, x, a, return_logit=False, **_): + with torch.no_grad(): + q = self.net(torch.cat([x, a], -1))[:, 0] * self.scale + return (q, None) if return_logit else q # a return-to-go has no logit + + def hop_sample(self, x, eps): + task = torch.zeros(x.shape[0], dtype=torch.long, device=x.device) + return self.hop.sample_eps(x, task, eps) + + +# --------------------------------------------------------------------------- # +# the scorer +# --------------------------------------------------------------------------- # +class RSMScorer: + """score(state, A[N,chunk,adim]) -> Q̄[N]; advantage(state, A[B,...]) -> (Q̄[B], V̄[B], Qm[B,M]).""" + + def __init__(self, backend="mlp", ckpt="", hop_ckpt="", feat_stats="", mode="fold", depth=2, + beta=0.95, gamma=0.99, n_particles=16, flow_steps=8, device="cpu", state=None, + img_layout="chw", cams=CAMS, proprio_keys=PROPRIO_KEYS, dwm_module="dwm_readout", + dino=None, score_kind="prob", rescore_top=0, n_particles_rescore=0, temperature=0.0, + max_rows=MAX_ROWS, lcb_quantile=0.1): + """score_kind: "prob" (mean σ, the historic ranking) | "logit" (mean raw logit, d1/fold only) | + "prob_log" (gen_q#266: the SAME quantity as "prob" -- the whole product fold, mean over particles -- + but folded in the log-complement domain, so it is a strictly monotone transform of prob's + infinite-precision value and gives a total order over the candidates where prob ties ~half of them + at exactly 1.0; mlp backend, d1/fold only, since it needs the per-hop reward logits) | + "conformal_lcb" (the `lcb_quantile` quantile — 0.1 by default — over particles of the per-particle + success probability instead of its mean: a pessimistic read-out that prefers candidates whose future + is reliably good over candidates with one lucky particle). + rescore_top=K, n_particles_rescore=M (both > 0 to enable): two-stage particle screening in score(). + temperature: 0 -> the checkpoint's calib.json T if present else 1.0; > 0 overrides.""" + assert mode in _MODES, mode + assert score_kind in _SCORE_KINDS, score_kind + self.backend_name = backend + self.mode, self.depth = mode, int(depth) + self.beta, self.gamma = float(beta), float(gamma) + self.n_particles, self.flow_steps = int(n_particles), int(flow_steps) + self.score_kind = score_kind + self.rescore_top = int(rescore_top or 0) + self.n_particles_rescore = int(n_particles_rescore or 0) + self.temperature = float(temperature or 0.0) + self.lcb_quantile = float(lcb_quantile) + self.last_q = self.last_q_logit = self.last_q_lcb = self.last_q_problog = None + if score_kind in ("logit", "conformal_lcb", "prob_log") and (mode == "recursive" or backend == "mc"): + raise ValueError(f"plan_score={score_kind} needs the d1 / fold read-out of the mlp / dwm / dinowm backend " + f"(got backend={backend}, mode={mode})") + # prob_log folds log(1 - c_k) = logσ(-lg_k/T) hop by hop, so it needs the per-hop reward LOGITS. + # The token read-outs (dwm / dinowm) expose only the per-hop c_k (return_hops), already through the + # sigmoid -- a saturated c_k = 1.0 there gives log(0) = -inf and the read-out would silently lose + # exactly the resolution it exists to recover. So it is restricted to the mlp backend, which owns + # `_q_fold_logit` and has the raw logits in hand. LeWM has no per-hop logit interface either. + if score_kind == "prob_log" and backend != "mlp": + raise ValueError(f"plan_score=prob_log needs the per-hop reward logits of the mlp backend's fold " + f"(got backend={backend}); the token read-outs expose only the post-sigmoid c_k") + if score_kind == "conformal_lcb" and not 0.0 < self.lcb_quantile < 1.0: + raise ValueError(f"plan_lcb_quantile must be in (0, 1), got {self.lcb_quantile}") + self.device = torch.device(device) + self.state = state + if self.state is None and feat_stats: + self.state = PooledDinoState(feat_stats, cams=cams, proprio_keys=proprio_keys, + img_layout=img_layout, dino=dino).to(self.device) + feat_sd = None if self.state is None else self.state.sd.cpu().numpy() + d_in = STATE_DIM if self.state is None else self.state.d + if backend == "mlp": + self.backend = MLPBackend(ckpt, self.device, d_in=d_in, hop_ckpt=hop_ckpt, feat_sd=feat_sd, + max_rows=max_rows) + elif backend in TOKEN_BACKENDS: + # `dwm_module` defaults to "dwm_readout", so only override it when the caller left it at + # that default: an explicit --rsm_dwm_module still wins. + _mod = dwm_module if dwm_module not in (None, "", "dwm_readout") \ + else READOUT_MODULE[backend] + self.backend = DWMBackend(ckpt, self.device, module=_mod, hop_ckpt=hop_ckpt, + feat_sd=feat_sd, d_in=d_in, + normalize=None if self.state is None else self.state.normalize) + elif backend == "lewm": + self.backend = LeWMBackend(ckpt, self.device, hop_ckpt=hop_ckpt, feat_sd=feat_sd, + d_in=d_in, + normalize=None if self.state is None else self.state.normalize) + elif backend == "mc": + self.backend = MCBackend(ckpt, self.device, hop_ckpt=hop_ckpt, feat_sd=feat_sd) + else: + raise ValueError(f"unknown backend {backend}") + self.chunk, self.adim, self.d_act = self.backend.chunk, self.backend.adim, self.backend.d_act + + # ---- state ------------------------------------------------------------ + @torch.no_grad() + def state_from_obs(self, obs_t): + """obs dict at the current frame -> SimpleNamespace(x [B,1545], tok [B,514,384] or None).""" + if self.state is None: + raise RuntimeError("scorer built without feat_stats; pass states directly") + if self.backend_name in TOKEN_BACKENDS: + tok, x = self.state.tokens(obs_t) + pr = self.state._proprio(obs_t, tok.shape[0]) + return SimpleNamespace(x=x, tok=tok, pr=pr) + if self.backend_name == "lewm": + # PIXELS, through the SAME transform train_lewm.py used (lewm_data.frames_from_obs), plus + # the pooled DINO state so nothing else in the planner changes. + _rsm_modules() + img = importlib.import_module("lewm_data").frames_from_obs( + obs_t, cams=self.backend.cams, res=self.backend.res).to(self.device) + # DINO is deliberately NOT run here. LeWM scores from pixels and never reads the pooled + # state, and the flagship table discloses each scorer's search cost -- charging LeWM for + # a DINOv2 forward it does not use would overstate that cost. `x` is None as a result, + # which only advantage() (E2) would have wanted, and that path raises for LeWM anyway + # because it has no hop head. + pr = self.state._proprio(obs_t, img.shape[0]) + return SimpleNamespace(x=None, tok=None, pr=pr, img=img) + return SimpleNamespace(x=self.state(obs_t), tok=None, pr=None) + + @staticmethod + def as_state(s): + if isinstance(s, torch.Tensor): + return SimpleNamespace(x=s, tok=None, pr=None) + if not hasattr(s, "pr"): + s.pr = None + return s + + @staticmethod + def repeat_state(s, N): + """B states -> B*N states, repeat_interleave'd, for one state per candidate chunk. + + Lives here, not in the caller, because the SCORER decides which fields its backend reads: + rsm_planner used to rebuild the namespace itself as (x, tok, pr) and silently dropped the + pixel backends' `img` (gen_q#268), so every LeWM eval cell died in _rows on a None input. + Repeating whatever vars(s) holds cannot go stale when a backend adds a field.""" + s = RSMScorer.as_state(s) + if int(N) == 1: + return s + return type(s)(**{k: (v.repeat_interleave(int(N), 0) if torch.is_tensor(v) else v) + for k, v in vars(s).items()}) + + def _flat_chunk(self, A): + A = torch.as_tensor(A, dtype=torch.float32, device=self.device) + if A.dim() == 3: + if A.shape[1] < self.chunk: + raise RuntimeError(f"need {self.chunk} actions per chunk, got {A.shape[1]}") + A = A[:, :self.chunk].reshape(A.shape[0], -1) + if A.shape[1] != self.d_act: + raise RuntimeError(f"chunk is {A.shape[1]}-d, RSM expects {self.d_act}") + return A + + def _inputs(self, s): + # Every branch names the field it needs and raises if the caller did not carry it. A missing + # field used to surface as `'NoneType' object has no attribute 'shape'` from _rows, three + # frames away from the caller that dropped it (gen_q#268: rsm_planner's st_rep rebuilt the + # namespace from a hardcoded (x, tok, pr) list and lost `img`), which is exactly the kind of + # silent degradation this pipeline keeps paying for. + if self.backend_name in TOKEN_BACKENDS: + return (self._need(s, "tok"), s.pr) + if self.backend_name == "lewm": + return (self._need(s, "img"), s.pr) + return self.backend.latent(self._need(s, "x")) if hasattr(self.backend, "latent") \ + else self._need(s, "x") + + def _need(self, s, field): + """The state field this backend scores from, or a RuntimeError naming backend AND field.""" + v = getattr(s, field, None) + if v is None: + have = sorted(k for k, t in vars(s).items() if t is not None) if hasattr(s, "__dict__") else [] + raise RuntimeError( + f"backend={self.backend_name} scores from state field '{field}', but it is None " + f"(state carries {have or 'nothing'}). The caller built the state without it -- see " + f"rsm_planner.plan_get_action's st_rep, which must repeat every field of " + f"RSMScorer.state_from_obs's output.") + return v + + @staticmethod + def _rows(inp): + return inp[0].shape[0] if isinstance(inp, tuple) else inp.shape[0] + + @staticmethod + def _expand(inp, N): + if isinstance(inp, tuple): + return tuple(None if t is None else t.expand(N, *t.shape[1:]) for t in inp) + return inp.expand(N, *inp.shape[1:]) + + @staticmethod + def _repeat(inp, M): + if isinstance(inp, tuple): + return tuple(None if t is None else t.repeat_interleave(M, 0) for t in inp) + return inp.repeat_interleave(M, 0) + + @staticmethod + def _cat(a, b): + if isinstance(a, tuple): + return tuple(None if x is None else torch.cat([x, y], 0) for x, y in zip(a, b)) + return torch.cat([a, b], 0) + + @staticmethod + def _index(inp, idx): + if isinstance(inp, tuple): + return tuple(None if t is None else t[idx] for t in inp) + return inp[idx] + + def effective_temperature(self): + """The T the sigmoid uses: the override if > 0, else the checkpoint's (calib.json or 1.0).""" + if self.temperature > 0: + return self.temperature + return float(getattr(self.backend, "temperature", 1.0)) + + # ---- E1 ---------------------------------------------------------------- + @torch.no_grad() + def score(self, state, A, seed=None, mode=None, depth=None, beta=None, rescore_top=None, + n_particles_rescore=None): + """Ranking array [N]: Q̄ for score_kind="prob", Q̄_logit for "logit", the per-particle + `lcb_quantile` quantile of Q for "conformal_lcb". All three are kept in `.last_q` / `.last_q_logit` / + `.last_q_lcb` (the logit is None for recursive / mc, the LCB None unless conformal). Two-stage + screening: every candidate with n_particles, then the top-K of the RANKING array rescored with M + particles and written back.""" + s = self.as_state(state) + A = self._flat_chunk(A) + N = A.shape[0] + inp = self._inputs(s) + R = self._rows(inp) + if R == 1 and N > 1: + inp = self._expand(inp, N) + elif R != N: + raise RuntimeError(f"{R} states for {N} chunks") + mode = mode or self.mode + depth = depth or self.depth + beta = self.beta if beta is None else beta + K = self.rescore_top if rescore_top is None else int(rescore_top or 0) + M = self.n_particles_rescore if n_particles_rescore is None else int(n_particles_rescore or 0) + two_stage = bool(K and M and K < N) + conformal = self.score_kind == "conformal_lcb" + problog = self.score_kind == "prob_log" + kw = dict(mode=mode, depth=depth, beta=beta, gamma=self.gamma, flow_steps=self.flow_steps, + return_logit=True) + if conformal: + kw["return_lcb"] = self.lcb_quantile + if problog: + kw["return_problog"] = True + if self.backend_name != "mc": + kw["temperature"] = self.temperature if self.temperature > 0 else None + if self.backend_name in TOKEN_BACKENDS: + kw["crn_seed"] = None if (seed is None or int(seed) < 0) else int(seed) + if two_stage: # dwm_readout screens internally (top-K by q_logit) + kw["rescore_top"], kw["n_particles_rescore"] = K, M + def _unpack(out): + """(Q̄, Q̄_logit [, LCB] [, prob_log]) -> (q, ql, lcb, plg) with the absent ones None.""" + o = list(out) if isinstance(out, tuple) else [out] + q_, ql_ = o.pop(0), (o.pop(0) if o else None) + lcb_ = o.pop(0) if (conformal and o) else None + plg_ = o.pop(0) if (problog and o) else None + return q_, ql_, lcb_, plg_ + + with seeded(seed, self.device): + q, ql, lcb, plg = _unpack(self.backend.q(inp, A, n_particles=self.n_particles, **kw)) + q = q.float() + ql = None if ql is None else ql.float() + lcb = None if lcb is None else lcb.float() + plg = None if plg is None else plg.double() + rank = self._rank_of(q, ql, lcb, plg) + if two_stage and self.backend_name not in TOKEN_BACKENDS: + top = torch.topk(rank, K).indices + q2, ql2, lcb2, plg2 = _unpack( + self.backend.q(self._index(inp, top), A[top], n_particles=M, **kw)) + q = q.clone(); q[top] = q2.float() + if ql is not None and ql2 is not None: + ql = ql.clone(); ql[top] = ql2.float() + if lcb is not None and lcb2 is not None: + lcb = lcb.clone(); lcb[top] = lcb2.float() + if plg is not None and plg2 is not None: + plg = plg.clone(); plg[top] = plg2.double() + rank = self._rank_of(q, ql, lcb, plg) + self.last_q, self.last_q_logit, self.last_q_lcb = q, ql, lcb + self.last_q_problog = plg + return rank + + def _rank_of(self, q, ql, lcb, plg=None): + """the array the selection rule sees, per score_kind (falling back to Q̄ when a backend has none).""" + if self.score_kind == "logit" and ql is not None: + return ql + if self.score_kind == "conformal_lcb" and lcb is not None: + return lcb + if self.score_kind == "prob_log" and plg is not None: + return plg + return q + + # ---- E2 ---------------------------------------------------------------- + @torch.no_grad() + def advantage(self, state, A, v_samples=16, v_expectile=0.5, seed=None): + """Q̄(x, A) and V̄_τ(x) = τ-expectile over M hop-head chunks of Q̄(x, a^(m)); all B×(1+M) rows are + scored in ONE batched call so the CRN noise is shared across the logged chunk and its baselines.""" + s = self.as_state(state) + A = self._flat_chunk(A) + B, M = A.shape[0], int(v_samples) + if self.backend.hop is None: + raise RuntimeError("advantage needs a hop head (rsm_hop_ckpt) to draw baseline chunks") + inp = self._inputs(s) + if self._rows(inp) != B: + raise RuntimeError(f"{self._rows(inp)} states for {B} chunks") + kw = {} + if self.backend_name in TOKEN_BACKENDS: + kw["crn_seed"] = None if (seed is None or int(seed) < 0) else int(seed) + with seeded(seed, self.device): + eps = torch.randn(M, self.d_act, device=self.device).repeat(B, 1) # CRN over rows + x_rep = s.x.repeat_interleave(M, 0) + a_hop = self.backend.hop_sample(x_rep, eps) # [B*M, d_act] + a_all = torch.cat([A, a_hop], 0) + inp_all = self._cat(inp, self._repeat(inp, M)) + q_all = self.backend.q(inp_all, a_all, mode=self.mode, depth=self.depth, beta=self.beta, + gamma=self.gamma, n_particles=self.n_particles, flow_steps=self.flow_steps, **kw) + q = q_all[:B].float() + qm = q_all[B:].float().view(B, M) + v = expectile(qm, v_expectile) + return q, v, qm + + def effective_horizon(self): + _, _, is_ope = _rsm_modules() + if self.mode == "recursive" and self.backend_name not in TOKEN_BACKENDS: + return is_ope.effective_horizon(self.beta, self.gamma, self.depth) + L = 1 if self.mode == "d1" else self.depth + # A DINO-WM hop is ONE ACTION CHUNK (the step it was trained on), not 1/(1-beta) frames: it + # has no beta. Reporting the beta horizon for it would overstate its reach by ~2.5x at + # beta=0.95 and is exactly the kind of mismatch the flagship table has to get right. + if self.backend_name in ("dinowm", "lewm"): + hf = float(getattr(getattr(self.backend, "core", None), "hop_frames", self.chunk)) + return {"mean_hops": float(L), "effective_frames": L * hf, "gamma_nominal": self.gamma, + "hop_frames": hf} + return {"mean_hops": float(L), "effective_frames": L / (1.0 - self.beta), "gamma_nominal": self.gamma} + + def describe(self): + state = None + if self.state is not None: + state = {"dim": self.state.d, "sd_floor": self.state.sd_floor, "z_clip": self.state.z_clip, + "img_layout": self.state.img_layout, "cams": list(self.state.cams), + "proprio_keys": list(self.state.proprio_keys)} + return {"backend": self.backend_name, "mode": self.mode, "depth": self.depth, "beta": self.beta, + "state": state, + "gamma": self.gamma, "n_particles": self.n_particles, "flow_steps": self.flow_steps, + "chunk": self.chunk, "adim": self.adim, "hop": self.backend.hop is not None, + "score_kind": self.score_kind, "rescore_top": self.rescore_top, + "n_particles_rescore": self.n_particles_rescore, "temperature_override": self.temperature, + "lcb_quantile": self.lcb_quantile if self.score_kind == "conformal_lcb" else None, + "temperature": self.effective_temperature(), + "horizon": self.effective_horizon()} + + +# --------------------------------------------------------------------------- # +# test helpers: random checkpoints in the real blob formats +# --------------------------------------------------------------------------- # +def save_random_rsm_ckpt(path, d_in=STATE_DIM, chunk=8, adim=7, flow_width=64, flow_depth=2, seed=0): + """Randomly initialised identity-encoder MLP successor in train_rsm.py's blob format.""" + model, _, _ = _rsm_modules() + torch.manual_seed(seed) + d_act = chunk * adim + enc = model.IdentityEncoder(d_in) + rew = model.RewardHead(d_in, 1) + flow = model.OccFlow(d_in, d_act, 1, width=flow_width, depth=flow_depth) + blob = {"enc": enc.state_dict(), "enc_t": enc.state_dict(), "rew": rew.state_dict(), + "flow": flow.state_dict(), "rms": torch.ones(d_in), "n_pr": 0, "tasks": ["task"], + "d_act": d_act, "step": 0, "enc_kind": "identity", "d_in": d_in, "d_lat": d_in, + "config": {"enc": "identity", "d_z": d_in, "enc_width": 1024, "flow_width": flow_width, + "flow_depth": flow_depth, "chunk": chunk, "beta_lo": 0.9, "beta_hi": 0.995}} + torch.save(blob, path) + return path + + +def save_random_hop_ckpt(path, d_in=STATE_DIM, chunk=8, adim=7, family="gauss", seed=0): + model, _, _ = _rsm_modules() + torch.manual_seed(seed) + d_act = chunk * adim + if family == "gauss": + pol = model.BCHead(d_in, d_act, 1) + elif family == "flow": + pol = model.FlowPolicy(d_in, d_act, 1) + else: + pol = model.ConcatFlowPolicy(d_in, d_act, 1, width=64, depth=2) + torch.save({"pol": pol.state_dict(), "round": 1, + "config": {"policy_family": family, "chunk": chunk, "policy_features": "raw", + "feat_scale": "zscore", "pol_width": 64, "pol_depth": 2}}, path) + return path + + +def save_feat_stats(path, d=STATE_DIM, seed=0): + rng = np.random.default_rng(seed) + np.savez(path, mu=rng.normal(size=d).astype(np.float32), + sd=np.maximum(rng.uniform(0.5, 2.0, size=d), 1e-3).astype(np.float32), dim=d, n=1000) + return path diff --git a/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/tests/test_rsm_trace.py b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/tests/test_rsm_trace.py new file mode 100644 index 0000000000000000000000000000000000000000..219e0d1f7f518e227d18c48250754551573f0846 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/code/rise_robomimic/tests/test_rsm_trace.py @@ -0,0 +1,149 @@ +"""gen_q#270: the additive `return_trace` / `score_trace` visualisation hook must not move any number. + + (a) bit-identity: score() and score_trace() with the same seed return the SAME ranking array and the same + .last_q / .last_q_logit, at depth 1 and depth 8, for score_kind prob / logit / prob_log / conformal_lcb; + (b) internal consistency: trace["q"][0].mean(1) == .last_q, trace["c"] == sigmoid(trace["lg"]/T), + trace["q"][depth] == 0, and the backward recursion q_k = c_k + (1-c_k) G q_{k+1} holds hop by hop; + (c) shapes / dtypes: z [L,N,P,D], a [L,N,P,d_act], lg/c [L,N,P], q [L+1,N,P]; hop 0's action == the candidate; + (d) the flag is OFF by default: _q_fold_logit's tuple length is unchanged without it, and every existing + scorer/planner test still passes (run by scripts/rr_cpu_test_trace.sh alongside this file). +Run as an LSF CPU job (scripts/rr_cpu_test_trace.sh); `python ` works too. +""" +import os +import sys + +import torch + +ROOT = "/proj/dmfexp/zwhong/rsm_rise" +RSM = f"{ROOT}/code/gen_q/rsm_libero" +os.environ.setdefault("RSM_LIBERO_DIR", RSM) +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, RSM) + +from test_rsm_planner import FakeDino, D, CHUNK, ADIM, _tmpdir, _ckpts # noqa: E402 +from robomimic.algo import rsm_scorer as S # noqa: E402 + + +def _mlp_scorer(d, mode="fold", depth=2, n_particles=8, **kw): + ck, hop, fs = _ckpts(d) + return S.RSMScorer(backend="mlp", ckpt=ck, hop_ckpt=hop, feat_stats=fs, mode=mode, depth=depth, beta=0.95, + gamma=0.99, n_particles=n_particles, flow_steps=8, device="cpu", dino=FakeDino(), **kw) + + +def _xa(n=6, seed=0): + g = torch.Generator().manual_seed(seed) + return torch.randn(1, D, generator=g), torch.randn(n, CHUNK, ADIM, generator=g) + + +# --------------------------------------------------------------------------- # +# (a) score() and score_trace() agree bit for bit +# --------------------------------------------------------------------------- # +def test_trace_does_not_change_the_numbers(): + d = _tmpdir() + x, A = _xa(9) + for kind in ("prob", "logit", "prob_log", "conformal_lcb"): + for mode, depth in (("d1", 1), ("fold", 2), ("fold", 8)): + sc = _mlp_scorer(d, mode=mode, depth=depth, score_kind=kind) + r0 = sc.score(x, A, seed=7) + q0, l0 = sc.last_q.clone(), sc.last_q_logit.clone() + p0 = None if sc.last_q_problog is None else sc.last_q_problog.clone() + c0 = None if sc.last_q_lcb is None else sc.last_q_lcb.clone() + r1, tr = sc.score_trace(x, A, seed=7) + assert torch.equal(r0, r1), (kind, mode, depth, (r0 - r1).abs().max().item()) + assert torch.equal(q0, sc.last_q), (kind, mode, depth, "q") + assert torch.equal(l0, sc.last_q_logit), (kind, mode, depth, "logit") + if p0 is not None: + assert torch.equal(p0, sc.last_q_problog), (kind, mode, depth, "problog") + if c0 is not None: + assert torch.equal(c0, sc.last_q_lcb), (kind, mode, depth, "lcb") + + +# --------------------------------------------------------------------------- # +# (b) the trace is consistent with the fold it came from +# --------------------------------------------------------------------------- # +def test_trace_is_internally_consistent(): + d = _tmpdir() + x, A = _xa(5) + for depth in (1, 2, 4): + sc = _mlp_scorer(d, mode="fold", depth=depth, n_particles=8) + _r, tr = sc.score_trace(x, A, seed=3) + T = sc.effective_temperature() + G = sc.gamma ** (1.0 / (1.0 - sc.beta)) + assert torch.allclose(tr["q"][0].mean(1), sc.last_q, atol=0, rtol=0), depth + assert torch.equal(tr["q"][depth], torch.zeros_like(tr["q"][depth])), depth + c = torch.sigmoid(tr["lg"] / T) + assert (c - tr["c"]).abs().max().item() < 1e-6, depth + for k in range(depth - 1, -1, -1): # q_k = c_k + (1 - c_k) G q_{k+1} + want = tr["c"][k] + (1.0 - tr["c"][k]) * G * tr["q"][k + 1] + assert (want - tr["q"][k]).abs().max().item() < 1e-5, (depth, k) + # the last hop's mean logit is what .last_q_logit reports + assert (tr["lg"][depth - 1].mean(1) - sc.last_q_logit).abs().max().item() < 1e-5, depth + + +# --------------------------------------------------------------------------- # +# (c) shapes, dtypes, and hop 0's action +# --------------------------------------------------------------------------- # +def test_trace_shapes(): + d = _tmpdir() + x, A = _xa(7) + N, P, depth = 7, 8, 3 + sc = _mlp_scorer(d, mode="fold", depth=depth, n_particles=P) + _r, tr = sc.score_trace(x, A, seed=1) + d_act = CHUNK * ADIM + assert tr["z"].shape == (depth, N, P, sc.backend.d_z), tr["z"].shape + assert tr["a"].shape == (depth, N, P, d_act), tr["a"].shape + assert tr["lg"].shape == tr["c"].shape == (depth, N, P) + assert tr["q"].shape == (depth + 1, N, P) + assert tr["z"].dtype == torch.float16 and tr["a"].dtype == torch.float16 + # hop 0's chunk is the CANDIDATE itself, tiled over the particles + cand = sc._flat_chunk(A).half() + assert (tr["a"][0] - cand[:, None, :]).abs().max().item() == 0.0 + # The slicing must not MOVE the trace: max_rows=3 forces the fold through several row slices, which + # changes the batch size of every matmul inside the flow and so perturbs the last bits (the same + # float-reassociation the existing sliced-vs-unsliced read-out test allows for q and the logit). So + # this is a tolerance, not an equality, and the tolerance is reported when it fails. + sc2 = _mlp_scorer(d, mode="fold", depth=depth, n_particles=P, max_rows=3) + _r2, tr2 = sc2.score_trace(x, A, seed=1) + assert (tr["a"][0] - tr2["a"][0]).abs().max().item() == 0.0 # hop 0 is pure tiling + tols = {"z": 0.05, "a": 0.05, "lg": 2e-2, "c": 2e-3, "q": 2e-3} # z/a are stored fp16 + for k, tol in tols.items(): + err = (tr[k].float() - tr2[k].float()).abs().max().item() + assert err < tol, (k, err, tol) + + +# --------------------------------------------------------------------------- # +# (d) default off +# --------------------------------------------------------------------------- # +def test_flag_is_off_by_default(): + d = _tmpdir() + x, A = _xa(4) + sc = _mlp_scorer(d, mode="fold", depth=2) + z = sc.backend.latent(x).expand(4, -1) + Af = sc._flat_chunk(A) + task = torch.zeros(4, dtype=torch.long) + kw = dict(rew=sc.backend.rew, flow=sc.backend.flow, rms=sc.backend.rms, pol=sc.backend.hop, + beta=0.95, gamma=0.99, depth=2, n_particles=8, flow_steps=8) + with S.seeded(5): + out = S._q_fold_logit(z, Af, task, **kw) + assert len(out) == 2, len(out) + with S.seeded(5): + out_t = S._q_fold_logit(z, Af, task, return_trace=True, **kw) + assert len(out_t) == 3 and isinstance(out_t[2], dict), len(out_t) + assert torch.equal(out[0], out_t[0]) and torch.equal(out[1], out_t[1]) + # and score() itself never asks for a trace + r = sc.score(x, A, seed=5) + assert r.shape == (4,) + + +if __name__ == "__main__": + names = [n for n in dir() if n.startswith("test_")] + failed = 0 + for n in names: + try: + globals()[n](); print(f"PASS {n}", flush=True) + except Exception as e: + failed += 1 + import traceback; traceback.print_exc() + print(f"FAIL {n}: {e!r}", flush=True) + print(f"{len(names) - failed}/{len(names)} passed") + sys.exit(1 if failed else 0) diff --git a/gen_q_rsm/rsm_rise/pipeline/config/bad_eval_hosts.txt b/gen_q_rsm/rsm_rise/pipeline/config/bad_eval_hosts.txt new file mode 100644 index 0000000000000000000000000000000000000000..faa547c312476433acbfcb928a762742d70f621e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/config/bad_eval_hosts.txt @@ -0,0 +1,65 @@ +p1-r21-n2 +p2-r01-n3 +p2-r03-n1 +p2-r04-n3 +p2-r08-n2 +p2-r09-n1 +p2-r10-n2 +p2-r10-n3 +p2-r11-n4 +p2-r14-n3 +p2-r14-n4 +p2-r15-n4 +p2-r16-n2 +p2-r16-n3 +p2-r17-n3 +p2-r19-n1 +p2-r21-n3 +p2-r24-n4 +p2-r25-n1 +p2-r25-n4 +p2-r29-n2 +p2-r31-n3 +p2-r32-n1 +p3-r05-n4 +p3-r06-n1 +p3-r06-n4 +p3-r09-n1 +p3-r18-n3 +p3-r18-n4 +p3-r27-n4 +p3-r30-n3 +p3-r32-n2 +p4-r03-n3 +p4-r04-n4 +p4-r09-n3 +p4-r09-n4 +p4-r17-n3 +p4-r18-n2 +p4-r19-n1 +p4-r22-n3 +p4-r22-n4 +p4-r24-n2 +p4-r28-n3 +p4-r28-n4 +p4-r31-n2 +p4-r32-n4 +p5-r08-n2 +p5-r11-n2 +p5-r12-n1 +p5-r12-n3 +p5-r12-n4 +p5-r15-n2 +p5-r18-n1 +p5-r18-n2 +p5-r25-n1 +p5-r25-n4 +p5-r32-n2 +p6-r01-n1 +p6-r04-n4 +p6-r08-n1 +p6-r11-n2 +p6-r16-n3 +p6-r23-n2 +p6-r31-n1 +p6-r32-n2 diff --git a/gen_q_rsm/rsm_rise/pipeline/config/stage1_config.env b/gen_q_rsm/rsm_rise/pipeline/config/stage1_config.env new file mode 100644 index 0000000000000000000000000000000000000000..891cc092db394f501e19590db9b8da9bb6f0ab6d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/config/stage1_config.env @@ -0,0 +1,3 @@ +# STAGE 1 CONFIG (final), chosen 2026-09-18 12:20 UTC from the 20k probe grid (status/B_stage1.md, "STAGE 1 CONFIG (final)"). +# Appended to every train_rsm.py call by scripts/rr_rsm.sh (M / L40 / M_s1 on all tasks). +STAGE1_EXTRA="--flow-norm 1 --x-noise 0.3 --flow-dropout 0.1 --wd 0.1" diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/DEFERRED_plain_bcu.md b/gen_q_rsm/rsm_rise/pipeline/docs/DEFERRED_plain_bcu.md new file mode 100644 index 0000000000000000000000000000000000000000..141f902b8945511a82190422c85df380439c361d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/DEFERRED_plain_bcu.md @@ -0,0 +1,55 @@ +# DROPPED: the "plain BCU" (`S0Bplain`) cells are not needed — the released code's BCU is `S0B` + +Decided 2026-09-21 with the owner, judged by the released RISE codebase rather than the paper's prose. + +`code/rise_code/sim_pipeline/configs/training/_imitation_learning/_offline_rl/iql_diffusion.py` has the +base defaults `use_bc: False`, `spectral_norm_policy: False`, `action_augmentation: False`, +`advanced_augmentation: False`. Every per-task experiment config under +`.../_offline_rl/_experiments/{square,threading,mug}.py` switches on `spectral_norm_policy=True`, +`action_augmentation=True`, `advanced_augmentation=True`, a `policy_bottleneck_beta` (0.1 / 0.1 / 0.001) and +a per-task `distance_threshold` (0.15 / 0.08 / 0.05). **No released config or script turns any of these off +for a BC or BCU run.** So in the codebase, BCU = `use_bc=True` on the task config, which keeps RISE's actor +ingredients and only skips critic training. That is precisely our `S0B` family. The variant I built with all +four ingredients off was a stricter reading of the paper's sentence ("similar to behavior cloning, but on +the union") than the code implements, and it is not the paper's baseline. + +Consequences: +- `S0B` stays the BC-u column and is labelled the codebase's BCU. Nothing in the flagship changes. +- The 21 `S0Bplain` cells are **dropped, not deferred**. `S0Bplain` stays in `status/deferred_families.txt` + so the rescue never resubmits it; the mis-routed runs stay quarantined under + `runs//_mislabelled_plain_as_s0b/` for the audit trail only. +- The same standard applies to **BC**: the codebase's BC is `use_bc=True` on expert-only data with the task + config's augmentation left on, i.e. the `S3H1aug` family, whereas the flagship's BC column is `S3H1` + (augmentation off). Whether to switch the BC column to `S3H1aug` is the consistent next question. +- The run_train.sh case-order fix and the family-routing test remain correct and stay. + +## Resolved the same evening: the codebase's "BC with augmentation on" is not a runnable configuration + +All six `S3H1aug` cells (expert-only data, task config's augmentation left on) died at the augmentation step: + + sklearn ... InvalidParameterError: The 'n_neighbors' parameter of NearestNeighbors must be an int in + the range [1, inf) or None. Got 0 instead. + +RISE's kNN augmentation pairs non-expert observations with neighbouring expert actions; with no non-expert +frames the neighbour count is 0 and sklearn refuses. So the released code **cannot** train an expert-only +policy with its augmentation on, and its BC must de facto run with augmentation off. That is the flagship's +existing BC column, `S3H1` (`use_bc=True`, expert-only, `action_augmentation=False`, +`advanced_augmentation=False`, spectral norm and bottleneck left at the task config's values). **No decision +is needed and the BC column stays `S3H1`.** `S3H1aug` is dropped; it stays in `deferred_families.txt` only +so nothing resubmits it. + +## REVERSED by the owner, 2026-09-21 late: plain BCU and plain BC are the baselines after all + +Owner: "train bcu with rise actor off and bc with rise actor off." So the flagship's BC-u and BC columns +become the paper-recipe families with all four RISE actor ingredients off (kNN augmentation, advanced +augmentation, spectral-norm Lipschitz penalty, policy bottleneck): + +- **BC-u = `S0Bplain`** (union data). 0 of 3 seeds at epoch 5000 anywhere (the 27 earlier runs were + mis-routed as `S0B` and stay quarantined). Launched on all seven flagship tasks, 3 seeds each. +- **BC = `S3H1plain`** (expert-only data). Already 3/3 at epoch 5000 on square-Sub, square-Cov, mug and + threading; launched on the three piece-assembly tasks, 3 seeds each. + +`S0Bplain` is removed from `deferred_families.txt` so the rescue keeps these cells alive. `S3H1aug` stays +deferred (not runnable). The columns switch to the plain families only once they are fully seeded; until +then `S0B`/`S3H1` remain, labelled as the codebase's flag-only variants. The earlier "dropped" paragraph +above is superseded by this decision, and is kept so the reasoning trail is visible. diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/MASTER_TABLE.md b/gen_q_rsm/rsm_rise/pipeline/docs/MASTER_TABLE.md new file mode 100644 index 0000000000000000000000000000000000000000..13a2e30db72e36914a4b82fad67dc5994fea6532 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/MASTER_TABLE.md @@ -0,0 +1,164 @@ +# Master results table + +## 0. Single-actor flagship — RSM proposes from the RISE actor on every task + +RISE and RSM differ only in the scorer (same S0A candidates, N=128); IDQL uses its own co-trained actor. No per-task proposer choice. mean ± SE across seeds (subscript = seed count); Δ = margin over the strongest baseline (* p<0.05). RISE-g = the RISE actor sampled once. Every flagship task has RISE-actor RSM cells. **RSM is the coin-terminated β-chain read-out** (gen_q#267), the same column the paper's `tab:flagship` prints; a row whose chain cells have not all landed prints its launch state rather than a fold number. The last column is the RETIRED deterministic truncated fold, the maximum over that read-out's arms, shown only so the change is visible -- it is not a flagship number and its per-row (β, L) and retained mass are in `tab:flagship_fold`. The two columns are different estimators on the same checkpoints, so they are not comparable as seeds of one method. + +| Task | BC | BC-u | RISE-g | IDQL | RISE | IFQL | RSM (ours, RISE actor) | Δ | RSM-fold (retired) | +|---|---|---|---|---|---|---|---|---|---| +| Square (Sub.) | 14.4±2.2₍3₎ | 48.0±1.4₍3₎ | 48.7±1.9₍3₎ | -- | 43.6±1.2₍3₎ | n/a | **54.0±1.3₍3₎** | +5.3 | 51.3±1.4₍3₎ | +| Square (Cov.) | 11.0±1.0₍3₎ | 3.1±0.6₍3₎ | 7.3±1.3₍3₎ | -- | 3.7±0.2₍3₎ | n/a | **20.9±2.6₍3₎** | +9.9* | 17.6±1.2₍3₎ | +| Piece (Sub.) | 13.8±2.0₍3₎ | 33.0±1.7₍3₎ | 30.7±2.2₍3₎ | 24.2±3.6₍3₎ | 22.9±6.1₍3₎ | n/a | **47.1±3.5₍3₎** | +14.5* | 45.9±3.6₍3₎ | +| Piece (Cov.) | 18.9±1.2₍3₎ | 25.3±2.2₍3₎ | 31.2±1.6₍3₎ | 12.8±1.5₍2₎ | 6.0±1.7₍3₎ | n/a | **48.7±0.7₍3₎** | +17.8* | 50.1±1.9₍3₎ | +| Mug (Sub.) | 14.9±1.7₍3₎ | 4.9±0.2₍3₎ | 4.4±0.2₍3₎ | 5.3±0.0₍2₎ | 5.8±1.6₍3₎ | n/a | **23.1±2.1₍3₎** | +8.2* | 20.0±0.4₍3₎ | +| Thread (Cov.) | **26.3±1.2₍3₎** | 1.3±0.2₍3₎ | 1.2±0.3₍3₎ | 11.8±1.4₍3₎ | 3.5±1.1₍3₎ | n/a | 25.8±1.1₍3₎ | -0.6 | 32.7±0.5₍3₎ | +| Piece-tip (Cov.) | 2.0±1.0₍3₎ | 1.0±0.2₍3₎ | 1.0±0.5₍3₎ | -- | 2.9±0.6₍3₎ | n/a | **7.3±0.4₍3₎** | +4.4* | 6.9±0.8₍3₎ | + +**Same-actor margins** (paired cells, RISE-actor proposer): greedy / RISE critic / RSM / vs greedy / vs RISE. RSM here is the SAME chain read-out as the column above, but recomputed on the cells the three columns share, so it can differ from the headline number wherever greedy or the RISE critic is missing a seed. + +| Task | RISE-g | RISE | RSM (chain) | vs. RISE-g | vs. RISE | +|---|---|---|---|---|---| +| Square (Sub.) | 48.7 | 43.6 | **54.0**₍3₎ | +5.3 | +10.4 | +| Square (Cov.) | 7.3 | 3.7 | **20.9**₍3₎ | +13.6 | +17.2 | +| Piece (Sub.) | 30.7 | 22.9 | **47.1**₍3₎ | +16.4 | +24.2 | +| Piece (Cov.) | 30.8 | 6.0 | **48.7**₍3₎ | +17.8 | +42.7 | +| Mug (Sub.) | 14.5 | 16.2 | **23.1**₍3₎ | +8.6 | +6.9 | +| Thread (Cov.) | 4.7 | 12.2 | **25.8**₍3₎ | +21.1 | +13.6 | +| Piece-tip (Cov.) | 1.0 | 2.9 | **7.3**₍3₎ | +6.4 | +4.4 | + +*horizon* is the rollout budget in environment steps, with the median expert demonstration length in parentheses: a policy slower than its demonstrator times out. **Column meanings.** *vs same policy, no selection* is the paired difference against that very policy rolled out greedily, i.e. what best-of-N selection adds. *vs random-candidate control* draws the same N candidates from the same proposer and picks one at random (permuted scores); it separates a real value ranking from the benefit of merely drawing N candidates. NOTE (audit 2026-09-21): on 6/7 flagship rows the permuted run used a different successor configuration from the reported arm, so it is a random-candidate control, not a shuffle of the reported arm's own scores. *IDQL critic, same proposer* is IDQL's own critic scoring candidates drawn from the SAME policy the RSM arm selects from, so only the scorer differs -- RISE by contrast keeps its own policy, because its proposer is part of that method. *vs BEST baseline* compares against the strongest of BC, BCU, IDQL and RISE on that task. Every row states the **evaluation region**: the box the object is randomly placed in at reset. Success rates are only comparable within a region -- square-peg BC-expert is 2.6 % over the coverage box and 10.9 % over the much smaller `square_image_ood` box -- so the loaders never pool two regions and `docs/REGIONS.md` lists every region any number was measured in. All cells are policy epoch 5000, horizon 400, on our data, 3 training seeds x 3 eval seeds unless the n says otherwise. **BC** = diffusion policy on the expert demonstrations; **BCU** = on expert + non-expert; **RISE** = RISE's policy + its IQL critic choosing among 128 candidates; **IDQL** = RISE without augmentation or the Lipschitz penalty. **RSM** = our successor-model value choosing among N candidates from the named proposer. *head* is the reward the successor model scores: `membership` is RISE's own 0/1 expert label (what every baseline also trains on), `progress` is our shaped label from privileged sim state. *beta* is the geometric horizon parameter of the successor flow and *hops* the number of composed flow steps in the read-out. Deltas are exact paired McNemar tests against the same proposer's greedy rollouts and against the random-candidate control; a **win** needs both below p = 0.05. + + +## 0. Upper bound --- what the table becomes if the single-seed winners reproduce + +**Today** is the best arm verified at three policy seeds. **Ceiling** is the best *mean* over any arm, pooled across whatever seeds that arm actually has (1, 2 or 3) -- so a ceiling at 3/3 seeds is already verified and equals today, while a ceiling at 1/3 is a candidate the top-up is testing. The seed and episode counts behind the ceiling are given so a 50-episode single-seed number is never mistaken for a 450-episode verified one. **The ceiling also admits arms whose 3x3 cell grid is only partly landed**, which `today` does not: since 2026-09-23 the headline prefers a COMPLETE 9-cell arm to any partial one however high it scores (`flagship_latex._seed_tier_key`, now shared by this file), because an in-flight arm's episode-pooled rate is weighted towards whichever policy seed happened to land more cells. `scripts/chain_grid_census.py` prints the gap per task; where the ceiling exceeds today, check it there before quoting the ceiling. + +This is an UPPER BOUND, not a forecast. Each ceiling rests on 50-100 episodes at one policy seed, picked as the maximum over 27-119 arms, so it is upward biased twice over: by selection and by small n. Every time a single-seed maximum on this project was actually verified it fell: -7.2, -7.6, -10.2 points. + +**Every RSM number in the first nine columns is the coin-terminated β-chain read-out** (gen_q#267) — the same estimator as the flagship column at the top of this file. The last two columns are the RETIRED deterministic truncated fold, kept only so the change is visible; they are not this section's numbers and no verdict is computed from them. + +| task | best baseline | today, chain (3 seeds) | verdict | ceiling, chain | ceiling seeds | ceiling episodes | margin at ceiling | verdict at ceiling | today, fold (retired) | ceiling, fold (retired) | +|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 48.7 | 54.0 (450 ep) | win | 54.0 | 3/3 | 450 | +5.3 | win | 51.3 | 58.0 | +| square-peg (Coverage) | 11.0 | 20.9 (450 ep) | win | 20.9 | 3/3 | 450 | +9.9 | win | 17.6 | 17.6 | +| piece-assembly (Suboptimal) | 32.6 | 47.1 (450 ep) | win | 47.1 | 3/3 | 450 | +14.5 | win | 46.6 | 54.0 | +| piece-assembly (Coverage) | 30.8 | 48.7 (450 ep) | win | 48.7 | 3/3 | 450 | +17.8 | win | 50.1 | 52.0 | +| mug-cleanup (Suboptimal) | 20.7 | 23.1 (450 ep) | win | 23.1 | 3/3 | 450 | +2.4 | win | 22.2 | 22.2 | +| threading (Coverage) | 26.3 | 25.8 (450 ep) | tie | 25.8 | 3/3 | 450 | -0.6 | still loses | 32.7 | 32.7 | +| piece-assembly tip (Coverage) | 2.0 | 7.3 (450 ep) | win | 7.3 | 3/3 | 450 | +5.3 | win | 6.9 | 6.9 | + +**6 of 7 rows win today on the chain read-out; 6 of 7 would win at the ceiling.** 7 ceiling(s) are already verified at 3 seeds and will not move. + +## 1. Flagship comparison --- RISE-faithful reward (reward-matched) + +**Reward structure is matched across every column.** RISE's reward is data PROVENANCE, not outcome: `relabel_rewards.py` writes a constant over every frame of an episode (1 for the expert file, 0 for the non-expert file) and `iql_diffusion.py` consumes that field unchanged. So BC and BCU use no reward, the RISE and IDQL critics use the provenance label, and the RSM arm below uses the *same* provenance label (`membership` head). Nothing here sees a signal the others do not. + +One row per task: the strongest membership-head RSM arm in that task's canonical evaluation region, against every baseline. Where the strongest arm is not yet verified on three training seeds it is shown as a **TEMPORARY flagship**; quote such a row only with its seed count. + +**The RSM column is the coin-terminated β-chain read-out only** (gen_q#267), the same estimator as section 0 and as the paper's `tab:flagship`. Until 2026-09-23 this section ranged over BOTH read-outs, so it printed the retired deterministic fold under this heading with its own `verdict` — on threading it printed 33.0 at `hops 1`, four hours after that number was publicly retracted on #267, and marked it **win**. 865 fold arm(s) across 8 row(s) were excluded from this maximum for that reason; they remain in section 0's columns that name them retired and in the paper's `tab:ablation_betarec`. A FURTHER 63 arm(s) across 7 row(s) carry the chain tag but are NOT this paper's chain -- either at an evaluation-time γ other than 0.99 (the cap does not match the 1e-3 truncation tail its β implies) or at cap 0, where β ≥ γ makes the continuation probability exactly 0 and the walk is one successor draw with no recursion. They are excluded from EVERY column of this document, not moved to the retired fold ones (best excluded score 51.6; 543 further such arm(s) were kept out of section 0's retired columns). A task with no chain arm prints dashes; a fold number never stands in for a chain number. + +**Selection verdict across the 7 flagship rows: 6 beat both controls, 0 score BELOW their own no-selection control, 1 are undecided (mostly 50-episode single-seed cells).** A row can beat every baseline and still be carried by its proposer rather than by the scorer; the two control columns are what separate those cases, and the verdict column now always reports them. + +| task | expert / non-expert traj | horizon (median expert demo) | eval region (object start box) | BC | BCU | IDQL | RISE | **RSM** | throughput | mean steps | seeds (train x eval) | per seed | episodes/cell | n total | proposer | head | beta | hops | N | IDQL critic, same proposer | vs same policy, no selection | vs shuffled-score control | vs BEST baseline | verdict | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 20 / 100 | 400 (173) | nut [0,0.12],[-0.225,0] | 10.4 | 48.0 | 52.0 @ep3000 *(interim)* | 43.6 | **54.0** | -- | -- | 3x3 | 51/55/55 | 50 | 450 | RISE policy | membership | 0.98 | cap 11 P16 logit | 128 | -- | +5.3 (p=0.070) | +1.1 (p=0.748) | +5.3 vs RISEg | no gain | +| square-peg (Coverage) | 200 / 224 | 400 (374) | nut [-0.115,-0.09],[-0.12,0.11] | 9.2 | 3.1 | 5.0 @ep3000 *(interim)* | 3.7 | **20.9** | -- | -- | 3x3 | 26/17/19 | 50 | 450 | RISE policy | membership | 0.9 | cap 73 P16 prob | 128 | -- | +14.7 (p=0.000) | +14.7 (p=0.000) | +11.7 vs BC | **win** | +| piece-assembly (Suboptimal) | 20 / 100 | 400 (317) | piece1 [-0.22,-0],[0,0.22] | 13.8 | 32.6 | 26.2 | 30.7 | **47.1** | -- | -- | 3x3 | 53/48/41 | 50 | 450 | RISE policy | membership | 0.95 | cap 33 P8 prob | 128 | 25.7 | +16.2 (p=0.000) | +17.3 (p=0.000) | +14.5 vs BCU | **win** | +| piece-assembly (Coverage) | 200 / 199 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 16.4 | 25.6 | 12.8 | 6.0 | **48.7** | -- | -- | 3x3 | 49/47/49 | 50 | 450 | RISE policy | membership | 0.98 | cap 11 P16 prob | 128 | 6.3 | +15.8 (p=0.000) | +15.3 (p=0.000) | +17.8 vs RISEg | **win** | +| mug-cleanup (Suboptimal) | 20 / 100 | 400 (356) | nut [0,0.12],[-0.225,0] | 14.5 | 4.9 | 5.3 | 5.8 | **23.1** | -- | -- | 3x3 | 21/21/27 | 50 | 450 | BC-expert | membership | 0.98 | cap 11 P16 logit | 128 | -- | +8.7 (p=0.001) | +5.6 (p=0.038) | +8.6 vs BC | **win** | +| threading (Coverage) | 250 / 200 | 400 (215) | needle [-0.2,0.12],[0.05,0.25] | 13.2 | 1.4 | 11.8 | 3.5 | **25.8** | -- | -- | 3x3 | 28/25/25 | 50 | 450 | IDQL policy@500 | membership | 0.98 | cap 11 P8 prob | 128 | -- | +21.6 (p=0.000) | +22.2 (p=0.000) | +12.6 vs BC | **win** | +| piece-assembly tip (Coverage) | 200 / 504 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 0.9 | 1.0 | 1.0 @ep3000 *(interim)* | 3.3 | **7.3** | -- | -- | 3x3 | 8/7/7 | 50 | 450 | RISE policy | membership | 0.95 | cap 33 P16 prob F4 | 128 | 2.7 | +6.2 (p=0.000) | +6.7 (p=0.000) | +4.0 vs RISE | **win** | + +## 2. Alternative reward --- per-frame environment success (backup flagship) + +The `completion` head scores per-frame task success recovered by state replay, rather than data provenance. This is **not a correction to RISE, it is a different reward**: the paper never uses outcome labels. It is reported here as a legitimate alternative and would become the headline only if it beats section 1. Reward matching still requires the RISE and IDQL critics to be retrained on the same per-frame label, which has NOT been done, so a win here is not yet a matched win. + +Known defect: `train_goal_head.py` defaults to the PRE-settle label (`goal.npz`), which overcounts success by 1.85x to 2.86x against the corrected `goal_settle.npz`. Every existing completion checkpoint records `from goal.npz`, i.e. the uncorrected detector. These rows are provisional until retrained. + +*No completion-head arm has reached two training seeds yet, so there is nothing to report here.* + + +## 3. DISQUALIFIED --- dense privileged reward (oracle) + +**Do not quote.** The `progress` head regresses a dense hand-designed potential over privileged simulator state (end-effector-to-object and object-to-target distances; 4315 distinct values over 13973 grasped frames on piece-assembly). No other method sees it, so these rows are not reward-matched to anything printed beside them. Retired 2026-09-20; kept only so existing artefacts remain traceable. + +| task | expert / non-expert traj | horizon (median expert demo) | eval region (object start box) | BC | BCU | IDQL | RISE | **RSM** | throughput | mean steps | seeds (train x eval) | per seed | episodes/cell | n total | proposer | head | beta | hops | N | IDQL critic, same proposer | vs same policy, no selection | vs shuffled-score control | vs BEST baseline | verdict | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 20 / 100 | 400 (173) | nut [0,0.12],[-0.225,0] | 10.4 | 48.0 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **50.7** | -- | -- | 3x3 | 47/50/55 | 50 | 450 | RISE policy | tdflow | 0.9 | cap 150 P16 prob | 128 | -- | +2.0 (p=0.523) | +1.3 (p=0.696) | +2.0 vs RISEg | no gain; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| square-peg (Coverage) | 200 / 224 | 400 (374) | nut [-0.115,-0.09],[-0.12,0.11] | 9.2 | 3.1 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **14.7** | -- | -- | 3x3 | 19/12/13 | 50 | 450 | RISE policy | tdflow | 0.98 | 4 | 128 | -- | +8.4 (p=0.000) | +8.2 (p=0.000) | +5.4 vs BC | **win**; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| piece-assembly (Suboptimal) | 20 / 100 | 400 (317) | piece1 [-0.22,-0],[0,0.22] | 13.8 | 32.6 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **42.4** | -- | -- | 3x3 | 46/41/41 | 105 | 950 | BC-unified | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | -- | +8.6 (p=0.000) | -- | +9.8 vs BCU | control undecided; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| piece-assembly (Coverage) | 200 / 199 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 16.4 | 25.6 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **43.0** | -- | -- | 3x3 | 41/47/44 | 122 | 1100 | RISE policy | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | 6.3 | +12.6 (p=0.000) | -- | +12.2 vs RISEg | control undecided; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| mug-cleanup (Suboptimal) | 20 / 100 | 400 (356) | nut [0,0.12],[-0.225,0] | 14.5 | 4.9 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **20.7** | -- | -- | 3x3 | 20/25/17 | 50 | 450 | BC-expert | tdflow | 0.98 | 8 | 128 | -- | +6.2 (p=0.012) | +5.3 (p=0.029) | +6.2 vs BC | **win**; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| threading (Coverage) | 250 / 200 | 400 (215) | needle [-0.2,0.12],[0.05,0.25] | 13.2 | 1.4 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **14.0** | -- | -- | 3x3 | 11/19/13 | 50 | 450 | IDQL policy@500 | tdflow | 0.9 | 1 | 128 | -- | +9.8 (p=0.000) | +11.1 (p=0.000) | +0.8 vs BC | **win**; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| piece-assembly tip (Coverage) | 200 / 504 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 0.9 | 1.0 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **30.9** | -- | -- | 3x3 | 27/29/37 | 50 | 450 | RISE policy | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | 2.7 | +29.8 (p=0.000) | -- | +27.6 vs RISE | control undecided; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| square-peg (Coverage) — full-table region | 200 / 224 | 400 (374) | nut [-0.16,0.16],[-0.2,0.2] | 2.6 | 2.3 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **6.0** | -- | -- | 1x1 | 6 | 50 | 50 | RISE policy | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | -- | +6.0 (p=0.250) | +2.0 (p=1.000) | -- | no gain | + +## 4. Secondary results --- RISE-faithful reward (same regime as section 1) + +**Same reward regime as section 1**, so every column here is matched: BC/BCU use no reward, the RISE and IDQL critics and the RSM arm all use the provenance label. Rows land here for reasons of *evidence*, not reward: single-seed arms awaiting verification, alternate evaluation regions, and task variants whose trainings have not finished. Any row whose reward is not the provenance label is routed to section 2 or 3 instead, whichever code path produced it. + +| task | expert / non-expert traj | horizon (median expert demo) | eval region (object start box) | BC | BCU | IDQL | RISE | **RSM** | throughput | mean steps | seeds (train x eval) | per seed | episodes/cell | n total | proposer | head | beta | hops | N | IDQL critic, same proposer | vs same policy, no selection | vs shuffled-score control | vs BEST baseline | verdict | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) — released file, 5x the expert data of the flagship variant | 100 / 100 | 400 (173) | nut [0,0.12],[-0.225,0] | 60.2 | 55.9 | 71.3 | 47.9 | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | +| square-peg (Suboptimal) — Table IV data regime | 20 / 80 | 400 (--) | nut [0,0.12],[-0.225,0] | *not launched* | *not launched* | *not launched* | *not launched* | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | + +## 5. Top-up plan --- which under-seeded arms are being verified + +A **valid top-up candidate** beats the best baseline AND has fewer than three policy seeds, i.e. it was never verified. An arm already at three seeds has been tested: its three-seed mean is the answer even if that mean fell below its seed-0 value, and re-running it only chases noise. Those are excluded by construction. + +Each top-up runs the arm at 3 policy seeds x 3 eval seeds, 50 episodes per cell, so a single 50-episode cell is replaced by 450 episodes. **Multiplicity warning:** these candidates were chosen by taking the maximum over 27-119 arms per row, so the reported maximum is upward biased; the top-up measures whether a specific arm holds, it does not remove the selection bias in how it was picked. + +Candidates are ordered **chain first**: the flagship prints the coin-terminated chain read-out, so a `fold (retired)` nomination would spend GPU seeding an estimator that appears only in the ablation table. The read-out is a column so that choice is visible. + +A **second class** of candidate carries `3/3 seeds, k/9 cells`: all three policy seeds but only one or two eval seeds each, so it has never been measured on the full grid. Since 2026-09-23 the printed tables prefer a complete arm to any partial one, so these arms score above the headline and are excluded from it; the missing cells are what would settle them, and this class asks for exactly those. It does not reopen the ruling above, which is about re-running an arm already measured on the full 3x3 grid. + +| task | best baseline | arm's 1-seed score | read-out | proposer | recipe | seeds | eps so far | cells to run | +|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 48.7 | 58.0 | **fold (retired)** | BC-unified | M@best b0.9 L1 N128 P16 prob | 1/3 | 50 | 6 | +| square-peg (Suboptimal) | | | | | *+0 more candidates (0 chain / 1 fold); 51 arm(s) already at 3 seeds ON THE FULL 3x3 GRID and therefore NOT candidates* | | | | +| square-peg (Suboptimal) | 48.7 | 51.1 | **fold (retired)** | BC-unified | M@best b0.9 L3 N128 P16 prob | 3/3 seeds, **7/9 cells** | 350 | 2 | +| square-peg (Suboptimal) | 48.7 | 50.5 | **fold (retired)** | RISE policy | M@best b0.9 L4 N128 P16 prob | 3/3 seeds, **8/9 cells** | 400 | 1 | +| square-peg (Coverage) | | | | | *6 candidate(s) dropped: they carry the chain tag but are not this paper's chain (cap 0, or a cap that is not the 1e-3 tail their beta implies at gamma=0.99), so no column can print them and GPU spent on them buys nothing* | | | | +| square-peg (Coverage) | 11.0 | 14.0 | **fold (retired)** | BC-expert | L40@best b0.9 L2 N128 P16 prob | 3/3 seeds, **6/9 cells** | 300 | 3 | +| piece-assembly (Suboptimal) | 32.6 | 54.0 | **fold (retired)** | BC-unified | M@s100000 b0.98 L2 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Suboptimal) | 32.6 | 48.0 | **fold (retired)** | RISE policy | M@s100000 b0.95 L2 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Suboptimal) | 32.6 | 48.0 | **fold (retired)** | BC-unified | M_bcap@s100000 b0.99 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Suboptimal) | | | | | *3 candidate(s) dropped: they carry the chain tag but are not this paper's chain (cap 0, or a cap that is not the 1e-3 tail their beta implies at gamma=0.99), so no column can print them and GPU spent on them buys nothing* | | | | +| piece-assembly (Suboptimal) | | | | | *+53 more candidates (0 chain / 56 fold); 35 arm(s) already at 3 seeds ON THE FULL 3x3 GRID and therefore NOT candidates* | | | | +| piece-assembly (Coverage) | 30.8 | 52.0 | **fold (retired)** | BC-unified | M@s100000 b0.99 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Coverage) | 30.8 | 46.0 | **fold (retired)** | BC-unified | L40@best b0.95 L3 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Coverage) | 30.8 | 46.0 | **fold (retired)** | BC-unified | L40@best b0.95 L15 N128 P16 prob | 1/3 | 150 | 6 | +| piece-assembly (Coverage) | | | | | *5 candidate(s) dropped: they carry the chain tag but are not this paper's chain (cap 0, or a cap that is not the 1e-3 tail their beta implies at gamma=0.99), so no column can print them and GPU spent on them buys nothing* | | | | +| piece-assembly (Coverage) | | | | | *+46 more candidates (0 chain / 49 fold); 56 arm(s) already at 3 seeds ON THE FULL 3x3 GRID and therefore NOT candidates* | | | | +| piece-assembly (Coverage) | 30.8 | 48.0 | **fold (retired)** | RISE policy | L40@best b0.9 L8 N128 P16 prob | 3/3 seeds, **8/9 cells** | 400 | 1 | +| piece-assembly (Coverage) | 30.8 | 38.3 | **fold (retired)** | BC-unified | L40@best b0.99 L3 N128 P16 prob | 3/3 seeds, **7/9 cells** | 350 | 2 | +| piece-assembly tip (Coverage) | 2.0 | 6.0 | **fold (retired)** | BC-unified | M@best b0.98 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly tip (Coverage) | 2.0 | 6.0 | **fold (retired)** | BC-unified | M@best b0.98 L1 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly tip (Coverage) | 2.0 | 4.0 | **fold (retired)** | BC-unified | M@best b0.98 L3 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly tip (Coverage) | | | | | *+4 more candidates (0 chain / 7 fold); 46 arm(s) already at 3 seeds ON THE FULL 3x3 GRID and therefore NOT candidates* | | | | + +**How the flagship arm was chosen.** Each row reports the best-scoring arm with at least two training seeds, where an arm is (successor model, reward head, beta, hops, read-out, candidate count, proposer). The table below states how many arms that maximum ranged over and what the runner-up scored. Best-to-runner-up gaps are small, i.e. the top of the distribution is a plateau rather than a spike, which is what a real effect looks like; but the baselines receive no equivalent search, each contributing one fixed configuration. See `docs/PROPOSER_SELECTION.md`, which also shows that the proposer choice survives held-out validation on a disjoint eval seed. + +| task | arms searched | best | runner-up | +|---|---|---|---| +| square-peg (Coverage) | 20 | 20.9 | 19.8 (gap +1.1) | +| piece-assembly (Suboptimal) | 20 | 47.1 | 46.7 (gap +0.4) | +| piece-assembly (Coverage) | 20 | 48.7 | 46.0 (gap +2.7) | +| mug-cleanup (Suboptimal) | 23 | 23.1 | 21.1 (gap +2.0) | +| threading (Coverage) | 33 | 25.8 | 24.4 (gap +1.3) | +| piece-assembly tip (Coverage) | 20 | 7.3 | 6.0 (gap +1.3) | + +Mean over the 7 tasks with an RSM arm: best baseline 21.8, RSM **32.4**, margin **+10.7**. + + +For orientation only, the paper's Table I on the same task rows (different data mix and, on the piece tasks, a different success criterion, so NOT comparable to the columns above): + +| task | BC | BCU | IDQL | RISE | +|---|---|---|---|---| +| square-peg (Suboptimal) | 8.0 | 34.0 | 41.3 | 56.0 | +| square-peg (Coverage) | 18.7 | 0.0 | 19.6 | 50.7 | +| piece-assembly (Suboptimal) | 20.0 | 23.3 | 35.7 | 36.0 | +| piece-assembly (Coverage) | 14.7 | 2.0 | 16.3 | 70.7 | +| mug-cleanup (Suboptimal) | 31.3 | 32.7 | 36.7 | 40.7 | +| threading (Coverage) | 17.3 | 0.0 | 9.8 | 22.7 | +| piece-assembly tip (Coverage) | 0.0 | 0.0 | 8.0 | 51.3 | diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/README_mislabelled_plain.md b/gen_q_rsm/rsm_rise/pipeline/docs/README_mislabelled_plain.md new file mode 100644 index 0000000000000000000000000000000000000000..568a071de00cf4a0150d583a7c2bb6293b63cf62 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/README_mislabelled_plain.md @@ -0,0 +1,27 @@ +# `_mislabelled_plain_as_s0b/` — why these runs are quarantined + +`scripts/run_train.sh` selects per-family hydra overrides with a bash `case`, which is **first match wins**. +`S0Bplain` contains `S0B`, so it matched the `*S0B*` arm and never reached the plain arm: it received only +`use_bc=True` and silently kept RISE's kNN augmentation, spectral-norm Lipschitz penalty and policy +bottleneck. It was therefore **identical to `S0B` except for the RNG seed**, while being named and intended +as the paper's verbatim BCU baseline ("similar to behavior cloning, but on the union", with none of RISE's +own ingredients). + +Found 2026-09-21 by gen_q#265 noticing an `S0Bplain` training log that reported a 570-row kNN augmentation +pool — which a plain cell cannot build — and confirmed by diffing the built configs against `S0B` on nine +recipe keys across three tasks, where nothing differed. + +`S3H1plain` was **never affected**: it matches neither `*S0A*` nor `*S0B*`, so it reached the plain arm and +is genuinely plain (verified `action_augmentation=False`, `advanced_augmentation=False`, +`spectral_norm_policy=False`, `policy_bottleneck_beta=0.0`). + +**No published number was wrong**, because `verdict_table.POL` had no `S0Bplain` key, so these cells were +dropped by the loader rather than mislabelled in a table. The flagship's BC-u column uses `S0B`, the +recipe'd and therefore *stronger* variant, so margins computed against it are conservative: a genuinely +plain BCU is a weaker baseline and cannot increase any reported margin, since the margin is taken against +the strongest baseline on each task. + +These directories are kept rather than deleted so the wasted compute is auditable, and moved out of +`runs//policy/` so no future `POL` entry can pick them up as plain. The case order is fixed. The retraining was then DROPPED, not resumed: judged by the released codebase +(see status/DEFERRED_plain_bcu.md), BCU is `use_bc=True` on the task config with RISE's actor ingredients +left on -- which is `S0B` -- so a plain variant is not the paper's baseline. diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/STITCH_UNSEEN_FIGURES.md b/gen_q_rsm/rsm_rise/pipeline/docs/STITCH_UNSEEN_FIGURES.md new file mode 100644 index 0000000000000000000000000000000000000000..67f270b713500cb3f5504e79cf28d240c9f579d0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/STITCH_UNSEEN_FIGURES.md @@ -0,0 +1,66 @@ +# Stitching from UNSEEN (held-out) states — figure index (gen_q#270) + +Generated by `scripts/viz/make_unseen_index.py` from `UNSEEN_FIGREPORT.json` and +`UNSEEN_ANCHORS_*.json`; no number here is typed by hand. Re-run it after any re-render. + +Read-out shown in every figure: the `gamma**h` fold `q_k = c_k + (1-c_k) gamma^h q_{k+1}` with `h = 1/(1-beta) = 20` frames, `gamma^h = 0.8179` — **not** the coin-terminated chain the flagship table reports. +Columns of every figure, per hop `k = 0..8`: TRUE future | CHOSEN (argmax) decode with `c_k` | +its nearest TRAINING frame | REJECTED (min-Q) decode with `c_k` | its nearest TRAINING frame. +Both decoded columns use the same particle under common random numbers, so they differ only +by the action chunk. + +## Decoder and split, per task + +| task | regime | cell | decoder fidelity (256 px, 512 held-out frames) | train / val rows | +|---|---|---|---|---| +| `square_expert_play` | COVERAGE | `L40best` | 23.00 dB / LPIPS 0.135 | 138,913 / 15,533 | +| `two_piece_expert_play` | COVERAGE | `L40best` | 26.30 dB / LPIPS 0.080 | 109,588 / 12,221 | +| `square_sub_20100` | SUBOPTIMAL | `Mbest` | 20.12 dB / LPIPS 0.186 | 35,692 / 3,781 | +| `two_piece_expert_suboptimal` | SUBOPTIMAL | `Mproghead` | 26.03 dB / LPIPS 0.080 | 24,792 / 3,067 | + +Decoder: `runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt`, step 60000, res 256, 10 tasks. +`square_sub_20100` carries the worst fidelity of the ten and its panels must be read with that. + +## The 12 figures + +`held_out` is membership of the anchor's episode in the RSM trainer's own `val_eps`, read off +`LiberoRSMData` at the cell's seed rather than re-derived. `1-cos to train` is the anchor's +distance to the nearest TRAINING frame; `root dB` is the decoder's PSNR on this very state. + +| task | figure | anchor | held out | 1-cos to train | root dB | Q range | argmax / rejected | NN cos-sim chosen / rejected | +|---|---|---|---|---|---|---|---|---| +| `square_expert_play` | [`unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png) | `demo_198:110` of 476 | yes | 0.4664 | 20.5 | [0, 0.3119] | 64 / 29 | 0.462 / 0.553 | +| `square_expert_play` | [`unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png) | `demo_54:122` of 423 | yes | 0.4662 | 23.5 | [0, 0.01728] | 50 / 15 | 0.606 / 0.581 | +| `square_expert_play` | [`unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png) | `demo_181:135` of 314 | yes | 0.4044 | 23.8 | [7.293e-14, 0.8515] | 29 / 33 | 0.504 / 0.574 | +| `two_piece_expert_play` | [`unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png) | `demo_38:67` of 461 | yes | 0.4285 | 23.1 | [4.966e-05, 0.04319] | 93 / 117 | 0.551 / 0.556 | +| `two_piece_expert_play` | [`unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png) | `demo_18:96` of 183 | yes | 0.4117 | 26.7 | [0.001395, 0.9206] | 82 / 85 | 0.458 / 0.457 | +| `two_piece_expert_play` | [`unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png) | `demo_128:115` of 378 | yes | 0.4018 | 23.8 | [0.04492, 0.09217] | 73 / 114 | 0.441 / 0.439 | +| `square_sub_20100` | [`unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png) | `demo_147:234` of 771 | yes | 0.5358 | 23.2 | [2.628e-15, 1.512e-08] (degenerate) | 86 / 24 | 0.301 / 0.313 | +| `square_sub_20100` | [`unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png) | `demo_181:252` of 357 | yes | 0.4993 | 22.2 | [6.233e-12, 3.873e-08] (degenerate) | 70 / 91 | 0.320 / 0.335 | +| `square_sub_20100` | [`unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png) | `demo_116:62` of 428 | yes | 0.4758 | 23.6 | [1.717e-31, 4.811e-13] (degenerate) | 2 / 96 | 0.322 / 0.301 | +| `two_piece_expert_suboptimal` | [`unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png) | `demo_5:159` of 206 | yes | 0.4272 | 23.5 | [0.03773, 0.9159] | 125 / 31 | 0.413 / 0.631 | +| `two_piece_expert_suboptimal` | [`unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png) | `demo_1:70` of 211 | yes | 0.3862 | 28.0 | [0.06332, 0.7067] | 56 / 61 | 0.369 / 0.643 | +| `two_piece_expert_suboptimal` | [`unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png`](docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png) | `demo_27:156` of 252 | yes | 0.3521 | 26.7 | [0.01146, 0.8901] | 72 / 6 | 0.326 / 0.644 | + +## Retrieval control — is it imagining or retrieving? + +Reference = the cosine similarity a TRAINING frame already has to its nearest neighbour in a +DIFFERENT training episode. If a decoded hop were a retrieval it would meet or beat this. + +| task | max NN cos-sim over all decoded hops | train-self median | verdict | +|---|---|---|---| +| `square_expert_play` | 0.699 | 0.849 | BELOW -> imagining | +| `two_piece_expert_play` | 0.728 | 0.828 | BELOW -> imagining | +| `square_sub_20100` | 0.410 | 0.769 | BELOW -> imagining | +| `two_piece_expert_suboptimal` | 0.704 | 0.780 | BELOW -> imagining | + +## Audit + +`runs/pixdec/TRACE_FOLD_CHECK_unseen.json` — 12/12 traces PASS against the `gamma^h` fold: +fitted per-hop discount 0.817907 on the 9 traces with support, `c == sigmoid(lg)` to 8.9e-08, +`q_L == 0`, `Q == mean_p q_0` to 1.2e-07, stored `argmax == Q.argmax()` on all 12. +The three `square_sub_20100` traces have no hop with support (`q == 0` everywhere), recorded as +`G_fit_has_support: false` rather than silently passing the tolerance. + +Traces: `runs//stitchviz_unseen/*.npz` (+ `MANIFEST_*.json` carrying the split, the rule +and the anchor distances). Anchors: `runs//stitchviz/UNSEEN_ANCHORS_*.json`. diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/SUCCESSOR_VIZ_FIGURES.md b/gen_q_rsm/rsm_rise/pipeline/docs/SUCCESSOR_VIZ_FIGURES.md new file mode 100644 index 0000000000000000000000000000000000000000..383b94954a11807d6690eb4362730f45726b3c9e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/SUCCESSOR_VIZ_FIGURES.md @@ -0,0 +1,891 @@ +# Successor-model stitching figures (gen_q #270) + +Index of the qualitative deliverable: what each figure shows, which checkpoint and state it came +from, and how to rebuild it. Generated by `scripts/viz/make_fig_index.py` from the pipeline's own +JSON -- do not hand-edit. Full write-up and every caption: **`docs/successor_stitching.pdf`**. + +## What the figure is + +Root = a **failure state** (a frame of a play episode that does not reach success). The RISE actor +proposes N=128 action chunks; the RSM scorer rolls each one forward for L hops with P particles and +folds `q_k = c_k + (1-c_k) * gamma^h * q_{k+1}` with `c_k = sigmoid(R(z_k)/T)`, where +**`h = 1/(1-beta)`** is the expected hop length in env frames, NOT the action-chunk length +(`rsm_scorer.py:410-411,435`) -- so at the flagship beta 0.95 / gamma 0.99 the effective per-hop +discount is `gamma^h = 0.99^20 = 0.8179`, and it is not the chain probability +`(gamma-beta)/(gamma*(1-beta))` the same file derives at `rsm_scorer.py:539-561`. Every sampled +successor state is rendered and outlined **GREEN when `c(z) >= 0.5`** (i.e. `R(z) >= 0` at T=1) and +**RED otherwise**; the per-candidate Q is printed next to each branch and the argmax is marked. +Each tile is `[ retrieval | decoded ]`: left = nearest cached frame by cosine in z-scored DINOv2 +feature space (the exactness reference, with its cosine printed), right = the trained pixel decoder +at 256 px. Agentview with the wrist camera inset. + +Every number below is re-derivable from the dumped trace buffers alone: +`scripts/viz/verify_trace_fold.py` re-fits the per-hop discount out of `q` and `c`, checks +`c == sigmoid(logit)`, `q_L == 0`, `Q == mean_p q_0` and the stored argmax, for all 12 traces +(report `runs/pixdec/TRACE_FOLD_CHECK.json`; rebuild with +`bash scripts/bsub_cpu.sh rr_cpu_270fold bash scripts/viz/rr_cpu_verify_trace_fold.sh`). + +## Square-Cov (square_expert_play) + +- successor `/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt` (model L40, ckpt best) +- hop head `/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt` +- proposer `/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth` (seed 0) +- fold: beta 0.95, L 8, gamma 0.99 (h = 1/(1-beta) = 20.0 frames, gamma^h = 0.8179), T 1.0, read-out `prob`, N 128, P 16, chunk 8 (To 2, Ta 8), plan seed 0 +- features `/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz`, frames from `/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5` re-rendered at 256 px +- retrieval calibration (n=4000): adjacent-frame cosine mean 0.933 (p05 0.868), random-pair mean -0.003 (p95 0.412) -- read every figure's cosine against these +- decoder `runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt` step 60000, res 256, task index 2 of 10 + +| figure (`docs/figs/stitching/square_expert_play/`) | episode | frame | Q range | argmax | Q(argmax) | green frac | retrieval cos (mean/min) | +|---|---|---|---|---|---|---|---| +| `tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.png` | demo_36 | 56 / 387 | 6.5e-28 .. 0.607 | 38 | 0.607 | 19.2 % | 0.63 / 0.46 | +| `tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.png` | demo_110 | 104 / 369 | 0 .. 6.6e-07 | 7 | 6.6e-07 | 0.0 % | 0.64 / 0.42 | +| `tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.png` | demo_102 | 145 / 349 | 0 .. 0.0247 | 125 | 0.0247 | 0.1 % | 0.58 / 0.34 | +| `tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.png` | demo_160 | 165 / 301 | 0 .. 0.0465 | 103 | 0.0465 | 0.6 % | 0.62 / 0.38 | +| `tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.png` | demo_84 | 390 / 561 | 2.9e-25 .. 0.269 | 104 | 0.269 | 2.7 % | 0.59 / 0.44 | +| `tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.png` | demo_221 | 249 / 305 | 1.1e-05 .. 0.0653 | 16 | 0.0653 | 0.2 % | 0.60 / 0.48 | + +## Piece-Cov (two_piece_expert_play) + +- successor `/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt` (model L40, ckpt best) +- hop head `/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt` +- proposer `/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth` (seed 0) +- fold: beta 0.95, L 8, gamma 0.99 (h = 1/(1-beta) = 20.0 frames, gamma^h = 0.8179), T 1.0, read-out `prob`, N 128, P 16, chunk 8 (To 2, Ta 8), plan seed 0 +- features `/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz`, frames from `/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5` re-rendered at 256 px +- retrieval calibration (n=4000): adjacent-frame cosine mean 0.913 (p05 0.835), random-pair mean 0.001 (p95 0.411) -- read every figure's cosine against these +- decoder `runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt` step 60000, res 256, task index 4 of 10 + +| figure (`docs/figs/stitching/two_piece_expert_play/`) | episode | frame | Q range | argmax | Q(argmax) | green frac | retrieval cos (mean/min) | +|---|---|---|---|---|---|---|---| +| `tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.png` | demo_106 | 35 / 246 | 0.0191 .. 0.0824 | 125 | 0.0824 | 2.0 % | 0.52 / 0.34 | +| `tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.png` | demo_99 | 57 / 208 | 0.112 .. 0.17 | 2 | 0.17 | 4.2 % | 0.54 / 0.30 | +| `tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.png` | demo_129 | 84 / 208 | 4.4e-07 .. 0.235 | 100 | 0.235 | 8.9 % | 0.50 / 0.32 | +| `tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.png` | demo_143 | 154 / 282 | 0.221 .. 0.314 | 94 | 0.314 | 16.7 % | 0.55 / 0.42 | +| `tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.png` | demo_102 | 198 / 291 | 1.5e-22 .. 0.0346 | 110 | 0.0346 | 1.1 % | 0.54 / 0.30 | +| `tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.png` | demo_171 | 244 / 299 | 3.8e-06 .. 0.0233 | 123 | 0.0233 | 0.0 % | 0.52 / 0.35 | + +## Which failure roots actually show the split (candidate-level measurement) + +The 12 shipped trees were picked by eye. `scripts/viz/cand_green_stats.py` re-measures every +root at the **candidate** level and `scripts/viz/rank_split_roots.py` ranks the whole scanned +pool (`runs/pixdec/SPLIT_ROOT_RANK.json`). `cand_any_green` = fraction of the 128 candidates +with at least one green sampled state anywhere in their L hops; at **1.000 no candidate is +entirely red**, so such a root cannot illustrate "some candidates lead to success and some do +not" however good its other numbers look. `Q spread` = Q_max - Q_min. `hop rise` = mean +green fraction over the second half of the hops minus the first half: **positive** means the +futures *chain into* the success set, negative means the root merely starts green and decays, +which is the opposite of what the figure must show. Selecting on `frac_green` instead is what +previously recommended square `demo_181` (frac_green 0.207 but rise -0.289) for that claim. + +| task | root | frame | frac_green | cand_any_green | Q spread | hop 1 | hop L | hop rise | argmax green | +|---|---|---|---|---|---|---|---|---|---| +| Square-Cov | `demo_36` | 56 | 0.192 | 0.414 | 0.607 | 0.02 | 0.30 | +0.167 | yes | +| Square-Cov | `demo_181` | 135 | 0.207 | 0.961 | 0.850 | 0.68 | 0.03 | -0.289 | yes | +| Square-Cov | `demo_172` | 38 | 0.127 | 0.992 | 0.521 | 0.17 | 0.04 | -0.064 | yes | +| Piece-Cov | `demo_18` | 96 | 0.120 | 0.828 | 0.919 | 0.25 | 0.05 | -0.074 | yes | +| Piece-Cov | `demo_64` | 192 | 0.054 | 0.883 | 0.704 | 0.25 | 0.01 | -0.083 | yes | +| Piece-Cov | `demo_198` | 166 | 0.052 | 0.961 | 0.385 | 0.00 | 0.04 | -0.046 | yes | +| Piece-Cov | `demo_153` | 112 | 0.154 | 0.984 | 0.323 | 0.02 | 0.07 | +0.017 | yes | +| Piece-Cov | `demo_129` | 84 | 0.089 | 0.992 | 0.235 | 0.00 | 0.16 | +0.079 | yes | +| Piece-Cov | `demo_80` | 25 | 0.256 | 1.000 | 0.367 | 0.01 | 0.28 | +0.177 | yes | +| Piece-Cov | `demo_6` | 180 | 0.166 | 1.000 | 0.202 | 0.09 | 0.09 | -0.162 | yes | +| Piece-Cov | `demo_136` | 154 | 0.149 | 1.000 | 0.359 | 0.01 | 0.11 | +0.026 | yes | + +**Q is near zero exactly when no sampled future reaches the success set.** Over these +11 roots the largest Q given to a candidate with *no* green state anywhere is **0.115** +(smallest 4.4e-07), and the argmax candidate has a green future in **11/11** roots. + +- **Square-Cov (square_expert_play)** (3 roots measured): use `demo_36` t56 for *the planner discriminates* + (most balanced cand_any_green 0.414 of 3 roots, Q spread 0.607); it is also the only/best rising root, so one figure carries both claims. +- **Piece-Cov (two_piece_expert_play)** (8 roots measured): use `demo_18` t96 for *the planner discriminates* + (most balanced cand_any_green 0.828 of 8 roots, Q spread 0.919), and `demo_80` t25 for *futures chain green* (hop rise +0.177, 0.01 -> 0.28; frac_green 0.256). + +**The counts above are the curated pool.** Which roots were curated was decided by a +`frac_green` ranking, so `runs/pixdec/CAND_GREEN_CENSUS.json` +(`scripts/viz/cand_green_census.py`) re-measures **every** flagship-setting failure-root +trace on disk -- **171 captures over 46 distinct roots** -- and the picks above survive it: + +**No single statistic settles the choice.** Applying the balance criterion to the +*whole* census does **not** return the shipped picks: it prefers square `demo_212` +(balance 0.491) and two-piece `demo_159` (0.297), both of which clear the floors. But +both buy that balance by trading an order of magnitude of the other two requirements +away, so the honest object is the **Pareto frontier** over (balance, frac_green, Q +spread), not a scalar argmax: + +- **Square-Cov (square_expert_play)**: 21 roots in the census (vs 3 curated), **6 Pareto-optimal**; `demo_36_t0056` is **on the frontier**. + + | root | balance | frac_green | Q spread | captures | cand_any_green range | + |---|---|---|---|---|---| + | `demo_212` t141 | 0.491 | 0.030 | 0.234 | 5 | 0.172 | + | **`demo_36` t56** | 0.414 | 0.192 | 0.607 | 3 | 0.000 | + | `demo_148` t138 | 0.392 | 0.013 | 0.864 | 5 | 0.258 | + | `demo_13` t48 | 0.049 | 0.317 | 0.618 | 4 | 0.039 | + | `demo_181` t135 | 0.040 | 0.207 | 0.850 | 13 | 0.078 | + | `demo_10` t79 | 0.020 | 0.569 | 0.848 | 4 | 0.039 | + + The shipped pick (bold) is the frontier member strong on all three at once; the + others maximise one dimension while giving up another by an order of magnitude. + +- **Piece-Cov (two_piece_expert_play)**: 25 roots in the census (vs 8 curated), **7 Pareto-optimal**; `demo_18_t0096` is **on the frontier**. + + | root | balance | frac_green | Q spread | captures | cand_any_green range | + |---|---|---|---|---|---| + | `demo_83` t280 | 0.432 | 0.008 | 0.073 | 3 | 0.594 | + | `demo_159` t413 | 0.297 | 0.021 | 0.129 | 3 | 0.016 | + | **`demo_18` t96** | 0.214 | 0.120 | 0.919 | 11 | 0.148 | + | `demo_153` t112 | 0.016 | 0.154 | 0.323 | 1 | 0.000 | + | `demo_136` t154 | 0.003 | 0.149 | 0.359 | 5 | 0.016 | + | `demo_174` t479 | 0.003 | 0.160 | 0.277 | 3 | 0.008 | + | `demo_75` t199 | 0.000 | 0.562 | 0.905 | 4 | 0.000 | + + The shipped pick (bold) is the frontier member strong on all three at once; the + others maximise one dimension while giving up another by an order of magnitude. + +- **Caveat.** Repeat captures on the same device and seed agree to the last bit, but + across device (GPU vs CPU) or capture batch `cand_any_green` moves by up to **0.594** + (`demo_83` t280, 3 captures) -- larger than the gap between the best and second-best + root, so this ranking is only meaningful within one capture configuration. Every + `cand_any_green` 0.000 root reads 0.000 in every capture. + +**Does the frontier survive the capture noise it was measured with?** +For the two shipped roots it could not be asked: square `demo_36`'s three census draws +(`stitchviz`, `_split`, `_split2`) are the **same file**, md5 +`ef66050c9320363622d46efdb6849b7b` -- the curated split dirs hold copies, not re-captures -- +and two-piece `demo_80` had exactly one. Collapsing draws by md5 turns 202 draws into +**173 distinct captures** (29 copies dropped). `scripts/viz/xdev_capture.sh` then re-captures +the five decisive roots in five arms (cpuA = the shipped protocol; cpuB = one root per +process; cpuS = `--proposer-seed 0`; gpuA/gpuS = those last two on an H100 -- all five +have run, so each decisive root has 5-13 distinct captures spanning both devices), and +`scripts/viz/frontier_stability.py` scores every (shipped, rival) capture pair +(`runs/pixdec/FRONTIER_STABILITY.json`). + +| task | axis | shipped | rival | shipped wins | verdict | +|---|---|---|---|---|---| +| Square-Cov (square_expert_play) | `balance` | +0.376 | +0.424 | 0.22 (paired 0.40) | ORDERING FLIPS between captures -- within noise | +| Square-Cov (square_expert_play) | `frac_green` | +0.169 | +0.025 | 1.00 (paired 1.00) | shipped ALWAYS ahead | +| Square-Cov (square_expert_play) | `Q_spread` | +0.640 | +0.176 | 1.00 (paired 1.00) | shipped ALWAYS ahead | +| Square-Cov (square_expert_play) | `hop_rise` | +0.132 | +0.031 | 1.00 (paired 1.00) | shipped ALWAYS ahead | +| Piece-Cov (two_piece_expert_play) | `balance` | +0.225 | +0.280 | 0.21 (paired 0.40) | ORDERING FLIPS between captures -- within noise | +| Piece-Cov (two_piece_expert_play) | `frac_green` | +0.101 | +0.026 | 1.00 (paired 1.00) | shipped ALWAYS ahead | +| Piece-Cov (two_piece_expert_play) | `Q_spread` | +0.921 | +0.149 | 1.00 (paired 1.00) | shipped ALWAYS ahead | +| Piece-Cov (two_piece_expert_play) | `hop_rise` | -0.098 | +0.010 | 0.00 (paired 0.00) | rival ALWAYS ahead | + +**The balance axis cannot order these pairs; the other two can.** On `balance` the +ordering flips between captures on both tasks and the ranges overlap, so the preference +for `demo_212` and `demo_159` stated above is **within capture noise**. On `frac_green` +and Q spread the shipped picks lead in **every** cross-capture comparison with no range +overlap, so the published choice rests on the axes that are stable. The chaining figure +is selected on a third axis: `demo_80`'s hop rise is +0.175 with a range of 0.004, while +`demo_18`'s is negative -- the two two-piece figures carry different claims. + +**What this costs the square figure.** Over all 6 distinct captures `demo_36`'s balance +spans 0.320-0.461 and its `frac_green` 0.156-0.192. The four CPU captures alone put the +published capture at the top of the balance range, but the unseeded GPU capture is +higher, so on that axis it is not the extreme it looked like on CPU. The figure does +not move -- on the axes that order it the margin is an order of magnitude -- but no +such statement can be made from one capture. + +**Which factor actually moves the number.** Each row varies one factor and holds the +others fixed; the entry is the largest |delta| over the decisive roots. + +| factor | varied | held fixed | `balance` | `frac_green` | `Q_spread` | +|---|---|---|---|---|---| +| device | CPU -> H100 | `--proposer-seed 0`, batched | **0.180** | 0.037 | 0.099 | +| batch | all roots in one process -> one per process | device, unseeded | 0.078 | 0.006 | 0.170 | +| RNG | unseeded -> `--proposer-seed 0` | device, batched | 0.039 | 0.013 | 0.079 | + +On `balance` the device term is 2.3x the batch term, 4.6x the RNG term: the dominant source of capture-to-capture movement is +**float arithmetic on a different device**, not the unseeded candidate draw the protocol was blamed for. +It flips the ordering on its own: with the candidate draw held fixed, CPU -> GPU +takes `demo_212` from 0.469 to 0.289 while `demo_36` goes 0.352 -> 0.383, so *the rival +wins this axis on CPU and loses it on GPU with every other input identical*. +Seeding the proposer does not make a balance ranking portable; reporting the +device does. + +**Is each published figure reproducible, and is its caption number typical?** +`scripts/viz/fig_repro.py` -> `runs/pixdec/FIG_REPRO.json`. *seeded* = the published +capture recorded `proposer_seed: 0`; *bit-identical* compares its trace md5 with the +`cpuS` re-capture, run days later on a different host. Rank 1 = the published capture is +the **highest** of that root's distinct captures on that axis. + +| figure | captures | seeded | bit-identical | published capture's rank in its own spread | +|---|---|---|---|---| +| Square-Cov (square_expert_play) `demo_36_t0056` | 6 | no | no | `balance` 2/6, `frac_green` 1/6, `Q_spread` 6/6, `hop_rise` 1/6 | +| Piece-Cov (two_piece_expert_play) `demo_18_t0096` | 13 | no | no | `balance` 12/13, `frac_green` 3/13, `Q_spread` 9/13, `hop_rise` 1/13 | +| Piece-Cov (two_piece_expert_play) `demo_80_t0025` | 5 | yes | **yes** | `balance` 1/5, `frac_green` 2/5, `Q_spread` 2/5, `hop_rise` 1/5 | + +1 of 3 figures regenerates **exactly** from the settings printed in their captions +(`demo_80_t0025`, md5 `ca4ce6e148ad5c45597d3276f0cd73a4`). The others were captured before `--proposer-seed` existed +(`proposer_seed: null` in their manifests), so they reproduce only in distribution; +re-capturing them under a seed would change the published images, so the ranges +stand in place of a bit-exact claim. + +**Are the caption numbers the optimistic end of their own spread?** Counted, not +asserted: over the 11 (figure, axis) cells with a non-degenerate spread (1 further +cell is a tie across all captures), the published capture is the *highest* of its +replicates in **4**, against 1.6 expected if it were a random draw. So the published +numbers do lean optimistic -- which is what picking a root from one capture per root +does. The lean is not uniform: `Q_spread` on `demo_36_t0056` (6/6) sits at the *bottom* of its spread. +The figures are kept because on `frac_green` and Q spread the margin over the rival +roots is an order of magnitude, far outside any of these spreads. + +## Decoder fidelity -- 256 px decoder + +`runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt`, step 60000, res 256, 10 tasks, 512 held-out frames per task, episode-level split (`runs/pixdec/FIDELITY.json`). + +| task | PSNR | LPIPS | L1 | val episodes | +|---|---|---|---|---| +| square_expert_suboptimal | 20.98 | 0.178 | 0.0310 | 180,181,182,183 | +| square_sub_20100 | 20.12 | 0.186 | 0.0347 | 108,109,110,111 | +| square_expert_play | 23.00 | 0.135 | 0.0204 | 382,383,384,385 | +| two_piece_expert_suboptimal | 26.03 | 0.080 | 0.0134 | 108,109,110,111 | +| two_piece_expert_play | 26.30 | 0.080 | 0.0129 | 359,360,361,362 | +| two_piece_expert_play_tipping | 24.96 | 0.097 | 0.0157 | 634,635,636,637 | +| mug_expert_suboptimal | 23.15 | 0.123 | 0.0192 | 108,109,110,111 | +| threading_expert_play | 23.65 | 0.112 | 0.0180 | 405,406,407,408 | +| mug_mgen | 22.28 | 0.151 | 0.0253 | 202,203,204,205 | +| threading_mgen | 23.31 | 0.121 | 0.0216 | 405,406,407,408 | + +Pages: `docs/figs/pixdec/fidelity_.png` + +## Decoder fidelity -- 84 px decoder (reference) + +`runs/pixdec_multitask/pixdec/r84_mt10/ckpt.pt`, step 44001, res 84, 10 tasks, 512 held-out frames per task, episode-level split (`runs/pixdec/FIDELITY_r84_mt10.json`). + +| task | PSNR | LPIPS | L1 | val episodes | +|---|---|---|---|---| +| square_expert_suboptimal | 22.52 | 0.083 | 0.0272 | 180,181,182,183 | +| square_sub_20100 | 21.25 | 0.094 | 0.0313 | 108,109,110,111 | +| square_expert_play | 24.44 | 0.061 | 0.0189 | 382,383,384,385 | +| two_piece_expert_suboptimal | 28.91 | 0.017 | 0.0102 | 108,109,110,111 | +| two_piece_expert_play | 29.09 | 0.018 | 0.0099 | 359,360,361,362 | +| two_piece_expert_play_tipping | 27.36 | 0.026 | 0.0126 | 634,635,636,637 | +| mug_expert_suboptimal | 24.63 | 0.087 | 0.0164 | 108,109,110,111 | +| threading_expert_play | 25.34 | 0.061 | 0.0147 | 405,406,407,408 | +| mug_mgen | 23.56 | 0.092 | 0.0219 | 202,203,204,205 | +| threading_mgen | 24.51 | 0.078 | 0.0195 | 405,406,407,408 | + +Pages: `docs/figs/pixdec/r84/fidelity_.png` + +## How far to trust a decoded panel (run 22, `runs/pixdec/DECODER_COLLAPSE_PUBLISHED.json`) + +The PSNR above is measured on **real encoded latents** from held-out episodes. The panels +decode **successor-sampled** latents, which sit off that distribution, so the table is an +optimistic bound on panel fidelity rather than a measurement of it. The brief named the +failure mode to check -- *a decoder that blurs everything into the dataset mean produces +beautiful, meaningless panels* -- and it needs no ground truth: decode each root's 8 chosen +hops and compare them with the **true-future frames of the same root at the same offsets** +`t0 + k*20` (the column the figures already render), on distance to the dataset-mean image +and on diversity *among* the hops. Ratios are hop/real, so 1.0 = indistinguishable from real +frames and low = collapsed. Thresholds (`<0.60` collapse, `>=0.80` ok) and the rule were +pre-registered in `status/SUCCESSOR_VIZ.md` run 22 before the numbers existed. + +| task | dist-to-mean | pairwise (diversity) | cell = min | verdict | unseen-anchor cell | +|---|---|---|---|---|---| +| Square-Cov (square_expert_play) | 0.812 | 0.776 | **0.776** | PARTIAL | 0.679 | +| Piece-Cov (two_piece_expert_play) | 1.011 | 0.850 | **0.850** | OK | 0.439 | + +**Task-level verdict: `PARTIAL`** (0 of 2 tasks below 0.60). The last column is the same +statistic measured by `scripts/viz/decoder_transfer.py` on the **unseen** anchors, where it +returned `COLLAPSE`. On the roots these figures actually use it is consistently *higher*: +the published trees are rooted in **seen** episodes, and the mean-collapse the unseen run +found does not transfer to them at full strength. That is a difference in subject, not a +contradiction -- both numbers stand, for different sets of latents. + +**Per panel, which is the question a reader actually has** (exact all-pairs within each +root's 8 hops, so these are not sampled): **2 of 12** panels collapse, 2 partial, 8 ok. + +| figure | dist-to-mean | pairwise | cell | verdict | +|---|---|---|---|---| +| Piece-Cov `demo_143_t0154` | 1.060 | 0.502 | 0.502 | COLLAPSE | +| Piece-Cov `demo_99_t0057` | 1.024 | 0.555 | 0.555 | COLLAPSE | +| Square-Cov `demo_102_t0145` | 0.635 | 0.702 | 0.635 | PARTIAL | +| Square-Cov `demo_84_t0390` | 0.701 | 2.003 | 0.701 | PARTIAL | +| Square-Cov `demo_160_t0165` | 0.830 | 1.357 | 0.830 | OK | +| Piece-Cov `demo_106_t0035` | 1.159 | 0.848 | 0.848 | OK | +| Piece-Cov `demo_171_t0244` | 0.867 | 4.039 | 0.867 | OK | +| Square-Cov `demo_221_t0249` | 0.901 | 1.514 | 0.901 | OK | +| Square-Cov `demo_36_t0056` | 0.965 | 0.902 | 0.902 | OK | +| Square-Cov `demo_110_t0104` | 0.908 | 1.295 | 0.908 | OK | +| Piece-Cov `demo_129_t0084` | 0.967 | 0.954 | 0.954 | OK | +| Piece-Cov `demo_102_t0198` | 0.993 | 1.228 | 0.993 | OK | + +So the caveat is **per panel, not global**. `demo_143_t0154` (pairwise 0.502); `demo_99_t0057` (pairwise 0.555) +have hop-to-hop diversity below 0.60 of the matched real control, so those figures' panels should be +read for **route shape only** -- which candidate chains toward green -- and not for +per-hop pixel detail, which is largely decoder prior there. The remaining panels carry +hop diversity comparable to real frames at the same offsets. + +Caveats: distance-to-mean *rising* above 1.0 on some roots means those decodes sit further +from the dataset mean than the real control, i.e. the panels are not being flattened toward +the mean image; what varies is diversity between hops. True-future controls are clipped at +the episode end (Square-Cov 8 of 48, Piece-Cov 15 of 48), and a clipped control repeats its last frame, which deflates its own +diversity and so flatters the hop ratio. LPIPS is not reported: `lpips` is not importable here. + +## The curated paper figures, measured on their own capture (run 23, `runs/pixdec/DECODER_COLLAPSE_PAPERFIGS.json`) + +The three trees this document recommends are rendered from `runs//stitchviz_split2/`, not from the +capture the section above measures, and a root's trace `name` is **identical across captures**. +A name-keyed lookup would therefore print one capture's number under another capture's image, so +`make_stitch_tex.py` keys the caption note on `(variant, name)` and prints **nothing** for an +unmeasured capture -- there is no fallback to a sibling capture. Same instrument, same +thresholds (`<0.60` collapse, `>=0.80` ok), same pre-registration. + +| figure | dist-to-mean | pairwise | cell | verdict | also in the other capture | +|---|---|---|---|---|---| +| Piece-Cov `demo_6_t0180` | 1.018 | 3.615 | 1.018 | OK | no | +| Piece-Cov `demo_153_t0112` | 0.988 | 2.592 | 0.988 | OK | no | +| Square-Cov `demo_172_t0038` | 0.979 | 0.985 | 0.979 | OK | no | +| Piece-Cov `demo_80_t0025` | 1.061 | 0.968 | 0.968 | OK | no | +| Piece-Cov `demo_129_t0084` | 0.980 | 0.954 | 0.954 | OK | yes, **the same `.npz`** (cell 0.954) | +| Square-Cov `demo_36_t0056` | 0.950 | 0.902 | 0.902 | OK | yes, **the same `.npz`** (cell 0.902) | +| Square-Cov `demo_181_t0135` | 0.749 | 1.265 | 0.749 | PARTIAL | no | +| Piece-Cov `demo_136_t0154` | 0.965 | 0.644 | 0.644 | PARTIAL | no | +| Piece-Cov `demo_18_t0096` | 0.960 | 0.619 | 0.619 | PARTIAL | no | +| Piece-Cov `demo_198_t0166` | 1.087 | 0.425 | 0.425 | COLLAPSE | no | +| Piece-Cov `demo_64_t0192` | 1.127 | 0.305 | 0.305 | COLLAPSE | no | + +**The overlap is not a replicate.** 2 of 11 of these roots resolve to a trace file that is +byte-identical to the one the section above measured (`curate_split_manifest.py:60` populates +the curated directory with **symlinks**), so their two cells agree exactly by construction and +say nothing about capture-to-capture stability. That question is answered below. + +## How much of a panel's fidelity number is the root, and how much is the draw? (run 24, `runs/pixdec/DCP_NOISE.json`) + +Every cell above is measured on **one** capture. The shipped protocol leaves the proposer +unseeded (`stitch_trace.py --proposer-seed` defaults to `None`), so a re-capture redraws the +128 candidates and can pick a different argmax candidate -- a different chain of hops. Run 20's +`scripts/viz/xdev_capture.sh` re-captured five roots in arms that **separate the sources**: +unseeded arms (`cpuA`, `cpuB`, `gpuA`) reproduce the shipped protocol, `--proposer-seed 0` arms +(`cpuS`, `gpuS`) hold the draw fixed so the residual is device numerics. Re-measuring them with +the same instrument gives the stability of the statistic. Thresholds (resolved `<0.02`, +unresolvable `>=0.10`) were pre-registered in `status/SUCCESSOR_VIZ.md` run 24 before the +numbers existed. Replicates are deduped by `trace_md5`, so a symlinked copy cannot be counted +as a second sample -- the exact trap the section above describes. + +| root | re-captures (unseeded) | spread | device only | published | published inside range? | +|---|---|---|---|---|---| +| `Square-Cov demo_36_t0056` | 0.21, 0.53, 0.58 | 0.368 | 0.002 | 0.902 | **no** | +| `Piece-Cov demo_159_t0413` | 0.82, 1.10, 1.10 | 0.288 | 0.299 | -- | -- | +| `Square-Cov demo_212_t0141` | 0.66, 0.70, 0.75 | 0.098 | 0.085 | -- | -- | +| `Piece-Cov demo_80_t0025` | 0.91, 0.96, 0.99 | 0.077 | 0.067 | 0.968 | yes | +| `Piece-Cov demo_18_t0096` | 0.60, 0.60, 0.61 | 0.011 | 0.108 | 0.619 | **no** | + +**Verdict: `MARGINAL`** -- median re-capture spread 0.098 against a collapse/ok band of width 0.20. +A per-panel cell is therefore **not a stable property of the root**; it is a property of the +capture the panel was rendered from. Two consequences, stated plainly: + +1. **1 of 5 re-captured roots change verdict across draws.** The one that does is `demo_36_t0056`, this stream's #1 recommended figure: it publishes an `OK` cell while its three re-captures all land in `COLLAPSE`. +2. **On 2 of the 3 published roots the published cell falls outside the range of its own + re-captures.** Device numerics alone (draw held fixed) move the cell by a median of 0.085 and + up to 0.299 -- the same order as redrawing, because a tiny floating-point difference can flip + which candidate is argmax and the whole chain follows it. + +**One obvious explanation was tested and did not hold.** The shipped figures were chosen +(run 19) from 171 captures on a frontier built from `cand_any_green`, so a published +capture could be a selected maximum that regresses on re-capture. Over 48 paired captures +the rank correlation between `cand_any_green` and the fidelity cell is rho=0.32 (rho=0.02 +for `frac_green`): **`NO_SELECTION_SIGNAL`**. The figure with the largest gap is itself a *low*- +`cand_any_green` capture, so its high fidelity number was not bought by the selection. The +honest reading is draw variance. n is small and captures are not independent across roots, +so this is a direction check, not an estimate; no p-value is claimed. + +**What this does not change.** Every printed cell is a correct measurement of the trace its own +panel was rendered from, so a reader judging *the image in front of them* is correctly informed. +What it changes is the generalisation: a panel's number must not be read as "this root decodes +well", and a verdict within about 0.05 of a threshold is indicative only. Per the rule +pre-registered before these numbers existed, no figure, capture, threshold or printed verdict +was changed by this measurement. + +## Then is any statistic stable enough to *choose* a figure on? (run 25, `runs/pixdec/STAT_STABILITY.json`) + +The section above says a per-capture number moves. The prior question is whether the +**selection** of these roots is reproducible at all: a statistic can only order roots if its +re-capture noise is small against its between-root spread. Over the 202 draws of 46 distinct +roots in `CAND_GREEN_CENSUS_xdev.json` (**173** after de-duplicating traces by md5 -- the +curated dirs hold symlinks, and counting a copy as a replicate would deflate the noise and +make every statistic look stable), **30 roots** carry >= 2 genuinely distinct captures. +Thresholds and the statistic list were pre-registered in `status/SUCCESSOR_VIZ.md` run 25. + +| statistic | ICC | split-half rho | top-3 overlap | top-1 agree | median re-capture range | verdict | +|---|---|---|---|---|---|---| +| `frac_green` | 0.994 | 0.983 | 1.000 | 0.394 | 0.0073 | **STABLE** | +| `q_of_greenless` | 0.804 | 0.848 | 0.797 | 0.429 | 0.0072 | **STABLE** | +| `hop_green_last` | 0.965 | 0.948 | 0.762 | 1.000 | 0.0117 | **STABLE** | +| `Q_max` | 0.978 | 0.981 | 0.720 | 1.000 | 0.0247 | **STABLE** | +| `hop_rise` | 0.974 | 0.917 | 0.717 | 0.358 | 0.0076 | **STABLE** | +| `Q_spread` | 0.968 | 0.972 | 0.631 | 0.377 | 0.0363 | MARGINAL | +| `top_cand_share` | 0.430 | 0.766 | 0.570 | 0.263 | 0.0076 | MARGINAL | +| `cand_any_green` | 0.965 | 0.918 | 0.328 | 0.107 | 0.0391 | MARGINAL | +| `argmax_is_green` | 0.848 | 0.877 | 0.122 | 0.040 | 0.0000 | MARGINAL | + +**Verdict: `STABLE_STAT_EXISTS`.** 5 statistics are `STABLE`, none is `UNUSABLE` -- a defensible selection is +possible. But the statistic these figures were *actually* selected on (run 19), `cand_any_green`, is not +one of them, and how it fails is the point: it ranks the roots almost perfectly (ICC 0.965, +rho 0.918) yet reproduces only **0.33** of its own top 3 across captures, and names the same +single best root **11%** of the time. The ordering is reproducible everywhere *except at +the top* -- the only part a figure choice reads. The leading roots are bunched inside the +capture noise. `frac_green` by contrast reproduces its top 3 exactly (1.000) at a median +re-capture range of 0.0073, so it is the statistic a future re-pick should use *if the* +*criterion is fixed first* -- the paragraphs below measure why that proviso is not a formality. + +Two cautions. A reproducible *set* is not a reproducible *order*: `frac_green` returns the +same three roots every time but the same single winner only 39% of the time, so these +figures are exemplars, not "the best". And the top-k columns break ties independently at +random per half; under a deterministic tie-break the binary `argmax_is_green` scored a +perfect top 3 from the tie-break alone, which is how it first appeared before the instrument +was corrected (`runs/pixdec/STAT_STABILITY_v1_dettie.json` keeps that version). + +**Nothing was re-picked.** Every figure, capture, checkpoint, caption setting and scoring +numeric is exactly as before this measurement, per the rule pre-registered with it. Whether +to re-select on `frac_green` is the owner's call and is open. + +**But a stable statistic is only half of what a defensible choice needs** (run 26, +`runs/pixdec/STAT_AGREEMENT.json`). The table above holds the statistic fixed and varies the +capture. The complementary term -- hold the capture fixed and vary the *statistic* -- had +never been measured here, and it is the one that decides whether naming `frac_green` settles +anything. `scripts/viz/stat_agreement.py` draws one capture per root and reads **both** +statistics of a pair off **that same** capture (2000 draws per pair), so only the statistic +differs; computing it from per-root means would average the capture noise away and inflate +the agreement, so that variant is in the JSON but is not the verdict. + +| | median top-3 overlap | what varies | +|---|---|---| +| `W` within-statistic (run 25) | **0.762** | the capture | +| `B` between-statistic, same capture (run 26) | **0.367** | the statistic | +| chance at 30 roots | 0.100 | -- | + +**Verdict: `STATISTIC_CHOICE_DOMINATES`** over the 6 pairs of the `STABLE` statistics `frac_green`, `hop_rise`, `hop_green_last`, `Q_max` -- +*which statistic you pick moves the chosen figures about twice as far as re-capturing them does.* + +Two consequences. The two statistics that each reproduced their *own* single best root 100% +of the time, `hop_green_last` and `Q_max`, name the same root as **each other 0% of the +time** -- that perfect self-agreement was self-consistency, not evidence that a single best +figure exists, and it retires the suggestion run 25 left open. And the `STABLE` statistics +are not one construct but three: `Q_max`/`Q_spread` overlap 0.916, `frac_green`/`hop_green_last` +0.743, while `hop_rise` agrees with none of the others above 0.000, i.e. at chance. So "pick a +stable statistic" does not remove the arbitrariness; it moves it from the draw to the metric. +A selection becomes defensible only once the *criterion* -- what makes a tree a good +illustration -- is fixed first, which is a judgement about the paper, not a measurement. + +`q_of_greenless` is `STABLE` above but excluded here: it is undefined on 10 of the 30 roots +and a paired same-capture comparison needs a common root set. As an instrument check, the +constant statistic `cand_all_green` lands at exactly the 0.100 chance level against every +partner, as it must. **Nothing was re-picked and no number in this document changed.** + +## Do these panels illustrate the read-out the paper reports? (run 27, `runs/pixdec/READOUT_AUDIT.json`) + +Every panel here is captured and captioned at the **fold** read-out +`q_k = c_k + (1-c_k) gamma^h q_{k+1}`, `q_L = 0` (beta 0.95, L 8, `prob`). The paper has since +**retired** that read-out -- `docs/tex/flagship_paper.tex:162`: *"it folded a FIXED L hops with +q_L=0, which is an absorbing hitting probability over a truncated horizon rather than the +gamma-discounted occupancy ... the corrected read-out is the coin-terminated chain"* -- and +`docs/MASTER_TABLE.md:58` excludes 865 fold arms from its RSM column for the same reason. So the +**Q printed next to each branch and the argmax marker are the retired estimator's**, and whether +they survive the correction had never been checked. + +`scripts/viz/readout_audit.py` recomputes the chain's analytic form `chain_rb` +(`code/rise_robomimic/robomimic/algo/rsm_scorer.py:658-672`), `Q = sum_k w_k c_k` with +`w_k = (1-p) p^k` and `p = (gamma-beta)/(gamma(1-beta)) = 0.808`, from the **same committed +captures** -- the fold walk and the chain walk have the same structure, so no new sampling is +needed. Gate first: the published fold Q is reproduced from the captured memberships to +max |dev| 9.8e-08 over the 12 panels and `c == sigmoid(lg)` to 8.8e-08, confirming the captions' T = 1. +Limit, stated up front: the captures are 8 hops deep, so the deepest computable cap is 7 while +the flagship cap at these settings is **33** (the tail mass 0.225 lands on hop 7 instead of being +spread over hops 7..33). Hops beyond 7 were never sampled by these panels; nothing below +extrapolates past cap 7. + +**1. The argmax marker is a real value decision, not a tie-break: `ARGMAX_UNIQUE`.** +All 12 panels have exactly one candidate bit-exactly at the maximum. This had to be checked -- +`flagship_paper.tex:178` reports 35-50 of 128 *bit-identical* candidates at the maximum on Pc-C, +one of the two tasks here -- and it does not reproduce on these roots, which are deliberately +chosen **failure** states where memberships sit far from 1 and the fold never saturates. That is +a property of the states this document picked, not a refutation of the paper's diagnostic. +One panel must still be read with care: on `square_expert_play demo_110 t0104` all 128 candidates lie within 1e-6 of +the maximum (Q_max 0.000), so its winner is settled by float noise even though it is +bit-exactly unique. + +**2. The corrected read-out moves the top of the ranking: `READOUT_PARTIAL` at cap 7.** +Median Spearman rho between the fold and the chain ordering of the 128 candidates is **0.975**, but +the median top-3 overlap is **0.667** and **5 of the 12 panels mark a candidate the chain does not +choose**. The disagreement sits exactly where a figure reads the estimator -- at the top -- which +is the same failure mode run 25 found for the selection statistic. It splits by task: +- `square_expert_play`: argmax kept 5/6, rho 0.963..0.996 +- `two_piece_expert_play`: argmax kept 2/6, rho -0.250..1.000 + +Two independent audits now land on the same panel: **`two_piece_expert_play demo_143 t0154`**, this document's second +recommended figure, is both the lowest-fidelity panel (run 22) and the one whose chain ordering is +*anti*-correlated with the published fold ordering (rho -0.250, top-3 overlap 0.000). + +The verdict is **not depth-stable**, and that is reported rather than smoothed: at cap 3 and cap 5 +it is `READOUT_REORDERS` (rho 0.655 / 0.823, 3/12 argmaxes kept), i.e. agreement rises monotonically with depth +across the computable range. Whether it keeps rising to the flagship cap 33 cannot be measured +from these captures and is not guessed here. + +**What does not change.** The green/red outlines are `c_k >= 0.5` from the reward head alone and +are identical under both read-outs, so every panel's success/failure structure -- the thing these +figures were made to show -- is untouched. What a reader should *not* do is read the printed Q or +the argmax marker as the number the paper's flagship estimator would produce. **Nothing was +re-rendered, re-captured or re-picked**; re-rendering the panels under the chain is a figure +decision and is open. + +## Does that disagreement survive at the flagship cap? (run 28, `runs/pixdec/DEPTH_READOUT.json`) + +The audit above stops at cap 7 because every capture here is 8 hops deep, and it found agreement +rising monotonically over caps 3/5/7 -- which invites the reading that cap 7 is a truncation +artefact and the flagship cap 33 would agree. `scripts/viz/depth_readout.py` measures the rest of +the curve. The published clouds cannot be regenerated (`runs/pixdec/FIG_REPRO.json`: +`published_was_seeded: false`), so the same 12 **roots** are captured twice into +`runs//stitchviz_cap33/` under an explicit proposer seed, at depth 8 and at depth 34. +The fold draws its flow noise sequentially (`rsm_scorer.py:413-417`), so with the candidates +pinned the deep capture's first 8 hops must be the shallow one's bit for bit -- and they are +(candidate arrays and memberships both to max|dev| = 0; the shallow capture's stored Q is +reproduced from the deep capture's own memberships to 8.6e-08). +That is what makes fold@L=8 and chain@cap 33 comparable on ONE trajectory set, not two. +The family also replicates the section above -- at cap 7 it gives rho 0.949 with 7/12 argmaxes +kept, against 0.975 and 7/12 on the published trees (`REPLICATES`) -- so what follows transfers. + +**The trend does not continue: `DEPTH_REVERSES`.** Median Spearman rho against the fold, by cap: +**3** 0.662, **5** 0.834, **7** 0.949, **11** 0.904, **15** 0.851, **23** 0.864, **33** 0.851. +It *peaks at cap 7* and then falls: at the flagship cap 33 it is **0.851**, *below* cap 7's 0.949. +Argmaxes kept follow the same shape: 3 4/12, 5 5/12, 7 7/12, 11 7/12, 15 6/12, 23 6/12, 33 6/12. +Run 27's monotone rise was the approach to a maximum, not convergence to the paper's estimator, +and the maximum sits where it does for a structural reason: the chain at cap 7 integrates exactly +the hops 0..7 that the fold at L=8 folds, so cap 7 is the **horizon-matched** cap. Past it the +chain weights hops these panels never show, and the two estimators drift apart. + +At the flagship cap the disagreement is where it always was -- at the top. Median top-3 overlap is +**0.667** and **6 of the 12 roots** have a fold argmax the chain does not choose: +- `square_expert_play`: argmax kept 3/6 at cap 33 (4/6 at cap 7) +- `two_piece_expert_play`: argmax kept 3/6 at cap 33 (3/6 at cap 7) + +So the task split run 27 reports does **not** survive the correction. Nor is cap 7 a usable proxy +for cap 33 in its own right: chain@cap 7 and chain@cap 33 rank the 128 candidates at median rho +0.805 and agree on the argmax on only 7 of 12 roots. +The added hops explain the drift: the sampled membership rate has median 0.0158 over hops 0-7 but +0.0060 over hops 8-33, so the extra chain mass sits almost entirely on states the reward head calls +failures -- the same decay-with-depth the anchoring section reports, seen through the estimator. + +**So the previous section's caveat stands at the flagship cap, and is slightly stronger there:** +read the printed Q and the argmax marker as the retired fold's, not the paper's, and do not assume +the gap closes with depth. Worst root of this family: `two_piece_expert_play demo_102 t0198` (rho -0.168 at cap 33). +**Limit, stated:** these are new candidate clouds, so this re-measures the *estimator*, not the +twelve published panels' own numbers, which stay exactly as the section above reports them; the +green/red outlines, the images and every fidelity number are untouched by either read-out. + +## Does that cap-7 peak generalise? (run 29, `runs/pixdec/DEPTH_UNSEEN.json`) + +The section above explains its peak *structurally* -- cap 7 is the horizon-matched cap, where the +chain integrates exactly the hops the fold at L=8 folds. A structural explanation has to survive a +different family, so `scripts/viz/depth_readout_unseen.py` runs the same recipe on the **unseen** +family: 32 held-out anchors (`unseen_anchors.py`, 8 per task) over 4 tasks, captured twice into +`runs//stitchviz_cap33_unseen/` at depth 8 and 34 under proposer seed 270029. Two of those +tasks -- `square_sub_20100` (`Mbest`), `two_piece_expert_suboptimal` (`Mproghead`) -- the published family never used, and they carry a *different successor checkpoint and +reward head*, so this varies the roots, the split and the model at once. Same gates, both passed: +candidate arrays and hop-0..7 memberships bit-identical between the two depths (max|dev| = 0), +and the shallow stored Q reproduced from the deep capture's own memberships to 1.1e-07. + +**Verdict `PEAK_ELSEWHERE_STILL_REVERSES` -- and the pre-registered statistic it replaces said `PEAK_AT_HORIZON_MATCH`.** + +**The degeneracy that decides it.** 10 of the 32 roots -- including **all 8 of `square_sub_20100`** -- never +have the reward head fire once over the whole depth-34 rollout: `c >= 0.5` is never true, which is +exactly the GREEN/RED rule the panels outline with, so such a tree would be drawn entirely red. +On those roots the fold and the chain are both monotone functions of the same underflowing +`(1-c)` product (fold spans reach 1e-40), so their ranks agree *trivially* and they score rho = +1.000 at every cap. Screening them out moves the pooled peak from cap **7** to cap **11** and +drops the cap-7 median from 0.982 to 0.896, so run 28's cap-7 peak is best read as a property of +those twelve published roots, *not* a structural property of the estimator pair. Degenerate does +not always mean tiny Q: the largest fold Q among them is 0.338, a root where `c` accumulates but +never crosses the 0.5 outline threshold -- the outline and the magnitude of Q are different things. +The screen is **additive**: re-running the patched instrument reproduced every pre-registered +field byte-identically (`DEPTH_UNSEEN.json.prereg_only.bak`). + +Median Spearman rho against the fold, by cap: +**3** 0.922, **5** 0.920, **7** 0.982, **11** 0.973, **15** 0.966, **23** 0.967, **33** 0.967. +The pooled curve peaks at cap **7** (run 28, published family: cap 7, 3 0.662, 5 0.834, 7 0.949, 11 0.904, 15 0.851, 23 0.864, 33 0.851). +Argmaxes kept: 3 15/32, 5 19/32, 7 16/32, 11 16/32, 15 15/32, 23 15/32, 33 15/32. +Degeneracy-screened (n=22), the same curve reads **3** 0.782, **5** 0.853, **7** 0.896, **11** 0.897, **15** 0.860, **23** 0.871, **33** 0.871, peaking at cap **11**. +Per task, where the median-rho curve peaks and what it costs at the flagship cap: + +| task | ckpt | n | peak cap (all) | peak (screened) | rho@7 | rho@33 | argmax kept @7 | @33 | +|---|---|---|---|---|---|---|---|---| +| `square_expert_play` | `L40best` | 8 | **7** | 7 | 0.995 | 0.911 | 4/8 | 3/8 | +| `square_sub_20100` (all 8 degenerate) | `Mbest` | 8 | **3** | n/a | 1.000 | 1.000 | 8/8 | 7/8 | +| `two_piece_expert_play` (7 scorable) | `L40best` | 8 | **11** | 11 | 0.862 | 0.871 | 2/8 | 2/8 | +| `two_piece_expert_suboptimal` (7 scorable) | `Mproghead` | 8 | **3** | 3 | 0.785 | 0.859 | 2/8 | 3/8 | + +1 of the 4 tasks peak at the horizon-matched cap and 1 of 4 fall from cap 7 to cap 33. +The sampled membership rate again decays with depth: median 0.0079 over hops 0-7 against 0.0009 over +hops 8-33, so the extra chain mass again lands on states the reward head calls failures. + +**Limit, stated:** this is a second family measured with the same instrument, so it speaks to the +*estimator pair*, not to the twelve published panels, whose per-panel numbers stay exactly as the +two sections above report them. Nothing here re-renders a figure or changes a caption. + +## Is that all-red tree the successor's doing or the reward head's? (run 31, `runs/pixdec/HEAD_RECALL.json`) + +The section above turns on roots where the reward head never fires. Two very different things produce +that and only one is a finding: the successor's samples may never reach the success set from those +anchors (an all-red tree then *means* something), or the head may never return `c >= 0.5` on **any** +real state, in which case the outline carries no information on that task. `scripts/viz/head_recall.py` +decides it **without a rollout**: the outline rule `c = sigmoid(R(z)/T) >= 0.5` is exactly `R(z) >= 0` +for any `T > 0` (`rsm_scorer.py:351`), so each checkpoint's own encoder and reward head are run over +*every* frame of its cache -- on-manifold real states -- and the green rate read off. Positives are the +head's own training target, rebuilt from the checkpoint's stored `config` (`train_rsm.py:1170`; all four +cells are `reward_mode=dense`, `data.py:241-320`). + +**Verdict `ROLLOUT_NOT_HEAD`.** On `square_sub_20100` (`M/ckpt_best`, step 100000) -- the task whose held-out roots were *all* +degenerate -- the head fires on **84.9%** of its own 3725 real positive frames, max logit **+46.2**, +3342 of 39473 cached frames green. The head works; the walk does not reach it. + +| task | ckpt | green@pos | green@neg | train | val | max R | verdict | +|---|---|---|---|---|---|---|---| +| `square_expert_play` | `L40/best` | 0.998 | 0.011 | 1.000 | 0.976 | +129.3 | `HEAD_FIRES_ON_SUCCESS` | +| `two_piece_expert_play` | `L40/best` | 0.988 | 0.014 | 1.000 | 0.891 | +234.3 | `HEAD_FIRES_ON_SUCCESS` | +| `square_sub_20100` | `M/best` | 0.849 | 0.005 | 1.000 | 0.311 | +46.2 | `HEAD_FIRES_ON_SUCCESS` | +| `two_piece_expert_suboptimal` | `M/proghead` | 0.570 | 0.401 | 0.566 | 0.588 | +57.8 | `HEAD_FIRES_ON_SUCCESS` | + +Positive control passes with room (`square_expert_play` 0.998, `two_piece_expert_play` 0.988) and no cell is anti-ordered (0 of 4). +Two further findings, both caption-worthy if either task is rendered: + +1. **The head memorises on the cell under test**: positive-set green rate 1.000 on training episodes + vs 0.311 held out, a gap of 0.689, against 0.024 / 0.109 on the published cells. The unseen family is held out + by construction, so the head is in its weak regime there -- but 0.311 is far from zero, which is why + the rollout and not the head remains the explanation. +2. **The two success labels disagree on 2 of the 4 cells.** On `square_sub_20100` the environment's replayed + success (`goal.npz`, `label = env_success_replay`) fires in **all 120** episodes while RISE's own + reward -- the label the head trains on -- marks only 20, so a raw env-goal recall reads 0.155 and + looks like a broken head; restricted to the 20 episodes where the labels agree it is **0.90**. + The green outline on that task is RISE's reward, not the simulator's, and on 100 of 120 episodes + those are different claims. + +**Limit, stated:** this measures the head on cached real states; it re-renders nothing and revisits no +published per-panel number. Its consequence is narrow: an all-red tree on `square_sub_20100` would be honest +rather than broken, and would need the label caveat printed next to it. + +## Which read-out is safe to outline a tree with? (run 32, `runs/pixdec/HEAD_CKPT_ABLATE.json`) + +The table above records one cell whose head is barely ordered: `two_piece_expert_suboptimal` +`M/proghead` greens 0.570 of its positives but also 0.401 of its negatives, a margin of only 0.168, so a +tree it outlines is close to a coin flip. `ckpt_best.pt` and `ckpt_proghead.pt` both exist for 6 +tasks, so the confound resolves exactly -- same cache, same frames, same rebuilt target, only the +checkpoint differs. The statistic is the AUROC of the logit against the head's own positive set, +which is threshold-free and so does not rest on where `R` crosses 0. + +**Verdict `CHECKPOINT_KIND`: it is the read-out, on every one of the 6 pairs.** + +| task | AUROC `best` | AUROC `proghead` | delta | margin `best` | margin `proghead` | +|---|---|---|---|---|---| +| `square_expert_play` | 0.9981 | 0.5766 | +0.4215 | 0.986 | 0.181 | +| `square_expert_suboptimal` | 0.9963 | 0.4864 | +0.5099 | 0.962 | -0.013 | +| `two_piece_expert_play` | 0.9981 | 0.6551 | +0.3430 | 0.977 | 0.244 | +| `two_piece_expert_suboptimal` | 0.9804 | 0.6497 | +0.3306 | 0.906 | 0.168 | +| `two_piece_expert_play_tipping` | 0.9999 | 0.7124 | +0.2875 | 0.993 | 0.434 | +| `mug_expert_suboptimal` | 0.9983 | 0.7305 | +0.2678 | 0.984 | 0.357 | + +Every `best` head is above 0.980 and every `proghead` head below 0.730. The worst `best` cell is `two_piece_expert_suboptimal` +at 0.9804, still 0.3306 above its own `proghead` twin. One is *anti*-ordered: `square_expert_suboptimal` at 0.4864, below chance. Gate G2 required an identical frame count and +positive set on both sides of every pair; 0 of 6 pairs were dropped. The `proghead` logits sit in a +band around zero (median +0.315 on positives vs -0.615 on negatives for the cell under test), which is +exactly what a near-random outline looks like. + +**Consequence for the figure set, stated plainly:** the three +`unseen_two_piece_expert_suboptimal_*_Mproghead_*` panels are outlined by a head with AUROC 0.6497. +Their geometry, their Q values and their fidelity numbers are unaffected -- those come from the +successor and the decoder -- but their **green/red** is close to uninformative, and the `M/best` head +on the same task and the same cache reaches 0.9804. Either those panels carry this caveat or they are +re-rendered under `M/best`; that is the owner's call and nothing here changes them. + +## Whose success is the green outline? (run 32, `runs/pixdec/LABEL_CENSUS.json`) + +Run 31 found by accident that the caches carry two different success labels and that they are not the +same claim. It measured four cells; the family has 10. `scripts/viz/label_census.py` reads both labels +for every one of them -- `goal.npz:goal_at_state` (the environment replayed) against +`meta.npz:ep_success` (RISE's own reward, `PACK.json: rewards.max() > 0`, *the label every reward head +trains on and therefore the one every green outline means*) -- with no checkpoint loaded, so the +numbers are exact. + +| task | n_ep | RISE success | env goal | both | Jaccard | agreement | `goal.npz` label | +|---|---|---|---|---|---|---|---| +| `square_expert_suboptimal` | 200 | 100 | 200 | 100 | 0.500 | 0.500 | `env_success_replay` | +| `square_sub_20100` | 120 | 20 | 120 | 20 | 0.167 | 0.167 | `env_success_replay` | +| `square_expert_play` | 424 | 200 | 200 | 200 | 1.000 | 1.000 | `env_success_replay` | +| `two_piece_expert_suboptimal` | 120 | 20 | 3 | 0 | 0.000 | 0.808 | `placed_and_settle` | +| `two_piece_expert_play` | 399 | 200 | 1 | 1 | 0.005 | 0.501 | `placed_and_settle` | +| `two_piece_expert_play_tipping` | 704 | 200 | 1 | 1 | 0.005 | 0.717 | `placed_and_settle` | +| `mug_expert_suboptimal` | 120 | 20 | 14 | 14 | 0.700 | 0.950 | `env_success_replay` | +| `threading_expert_play` | 450 | 250 | 234 | 234 | 0.936 | 0.964 | `env_success_replay` | +| `mug_mgen` | 224 | 124 | -- | -- | -- | -- | *not_measurable* | +| `threading_mgen` | 450 | 300 | -- | -- | -- | -- | *not_measurable* | + +**7 of the 8 measurable tasks disagree**, and the reason is structural rather than noisy: `goal.npz` +is not one instrument. On the `square*`, `mug*` and `threading*` caches its `label` is +`env_success_replay`; on all three `two_piece*` caches it is `placed_and_settle`, a stricter criterion +that fires in 1 of 399 episodes on `two_piece_expert_play` against RISE's 200. Two extremes are worth +naming. **`square_expert_play` is the only task where the two labels agree exactly** (Jaccard 1.000; +all 2211 of its env-goal frames sit inside RISE-success episodes) -- and that is a published figure +task, so its green outline is the simulator's success as well as RISE's. At the other end `square_sub_20100` +agrees on only 0.167 of its episodes. +The 2 `*_mgen` caches carry no `goal.npz` at all, so there the environment's own label does not +exist and RISE's reward is the only one available. + +**Caption rule this settles,** for every panel in this index and the unseen one: a green outline means +*RISE's reward would have fired*, not *the simulator reached the goal*. On `square_expert_play` those +coincide. On the other 7 measurable tasks they do not, and the original brief's suggestion of drawing +the environment's success as a second outline style is only available where that label is dense enough +to draw -- which the table shows it is not on the `two_piece*` family. + +## The same trees under the FLAGSHIP read-out (run 33, `runs/pixdec/CHAIN_PANELS.json`) + +Every figure in the tables above prints a per-candidate `Q` and an arg-max marker from the **fold**, +which `docs/tex/flagship_paper.tex:162` retired. `stitch_figure.py --readout chain` (additive, +default `fold`) re-derives both from the SAME committed depth-34 captures under the coin-terminated +beta chain at the flagship cap **33** (`p=0.8081`, `rsm_scorer.py:658-672`) -- no new sampling, +no change to the scoring path. New family: `docs/figs/stitching_chain//`; the fold family is +untouched, so the pair shows what a read-out choice does to a qualitative figure. + +Gates: **G1** `--readout fold` reproduces the published `FIGREPORT_dec256.json` arg-max / `Q` / +green fraction on 12 of 12 figures (the flag is inert when off); **G2** the +renderer's chain `Q` matches `DEPTH_READOUT.json`'s independent cap-33 numbers to +max|dev| = 0.0e+00 with every arg-max index equal (one implementation of the estimator); +**G3** the green fraction is identical fold-vs-chain on the same capture, 12 of +12 -- the outline rule `c_k >= 0.5` never sees `Q`. + +| figure (`docs/figs/stitching_chain//`) | episode | frame | chain Q(argmax) | fold Q(argmax) | chain argmax | fold argmax @L8 (published) | fold argmax @L34 | fold rank of chain argmax | moved vs L8 / L34 | green frac | +|---|---|---|---|---|---|---|---|---|---|---| +| `tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_102` | 145 | 0.00829 | 0.0361 | 11 | 14 | 21 | 56/128 | yes / yes | 0.0106 | +| `tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_110` | 104 | 0.00951 | 0.0183 | 98 | 126 | 15 | 11/128 | yes / yes | 0.0079 | +| `tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_160` | 165 | 0.0114 | 0.0552 | 64 | 71 | 64 | 0/128 | yes / no | 0.0016 | +| `tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_221` | 249 | 0.0142 | 0.0726 | 123 | 123 | 123 | 0/128 | no / no | 0.0032 | +| `tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_36` | 56 | 0.439 | 0.642 | 45 | 45 | 45 | 0/128 | no / no | 0.0430 | +| `tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_84` | 390 | 0.214 | 0.305 | 27 | 27 | 27 | 0/128 | no / no | 0.0301 | +| `tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_102` | 198 | 0.00947 | 0.0339 | 9 | 41 | 9 | 0/128 | yes / no | 0.0075 | +| `tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_106` | 35 | 0.0277 | 0.0715 | 52 | 53 | 53 | 1/128 | yes / yes | 0.0091 | +| `tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_129` | 84 | 0.078 | 0.229 | 27 | 27 | 27 | 0/128 | no / no | 0.0236 | +| `tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_143` | 154 | 0.155 | 0.301 | 27 | 27 | 27 | 0/128 | no / no | 0.0481 | +| `tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_171` | 244 | 0.00185 | 0.00986 | 97 | 97 | 97 | 0/128 | no / no | 0.0000 | +| `tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png` | `demo_99` | 57 | 0.0361 | 0.17 | 58 | 72 | 58 | 0/128 | yes / no | 0.0100 | + +Against the fold at L=8 -- what the published panels mark -- the arg-max marker moves on +**6 of 12** panels, exactly run 28's cap-33 count through a +different code path. Against the deep capture's OWN fold at L=34 it moves on only +3 of 12, so part of that disagreement is a horizon disagreement; both +references are reported rather than one being called *the* comparison. The printed value moves much +further than the ranking: the chain `Q_max` is below the fold's on 12 of +12 roots at a median ratio of 0.310 (the fold saturates +towards 1 once one hop fires; the chain is a weighted average over 34 hops and the membership +rate past hop 7 is near zero), so a `Q` from one family must not be compared against a `Q` from the +other. Unchanged in both families: images, per-hop `c_k`, the green/red outlines and every fidelity +number. + +Two pre-registered predictions were **wrong, both informatively**. The chain does not reach far down +the fold's list -- the deepest fold rank any chain argmax has is 56 +of 128 and **none** of the 12 falls below the fold's median, so this is a permutation of the +top of the ranking, not a different answer to the planning question. And it *breaks* rather than +inherits the one degenerate root: on `square_expert_play demo_110 t0104`, where run 27 found all 128 +fold candidates within 1e-6 of the max and called that winner float noise, the chain spreads the +candidates over 0.0095; the smallest +chain spread over all 12 roots is 0.0018. Under the flagship read-out +every one of these panels marks a genuine value decision. + +Caveat this does NOT lift: the clouds here are the seeded re-capture (proposer seed 270028), not the +unreproducible published draw (`FIG_REPRO.json: published_was_seeded false`), so a panel is the same +*root* as its twin above and not the same *draw*; and the figure-SELECTION question is untouched. + +## The run-34 regression, explained and repaired (run 35, `runs/pixdec/RUN35_REPAIR.json`) + +Run 34 held the document back: three rebuilds printed **15**, **9** and **3** +`Panel fidelity` notes on the published pages, deterministically within a job and differently +across jobs, and the cause was not identified. It is now, and the notes were only a symptom. + +* **What broke.** LSF job `1904966` (`rr_pack4_chaintrace2`) ran `scripts/viz/stitch_trace.py` + into the shared `runs//stitchviz/` with the legacy manifest overwrite, replacing the + **12** published records with + **12** `_chain` ones at + 2026-09-24T20:42:52Z and 2026-09-24T20:43:05Z. +* **Why it looked like a note problem.** `make_stitch_tex.py:caption()` returns the bare figure + name when a figure has no manifest record, and the fidelity note is appended inside that + function -- so **12** published + captions lost their settings, checkpoint, Q range and green fraction, not just a sentence. +* **Why three different counts.** A race: the generator reads the two tasks' manifests 13 s + apart in wall clock and writes the tex minutes later, so the build started at 20:43:01Z + straddled the two clobbers (20:42:52Z, 20:43:05Z) and saw one task repaired, one not. The + replay reproduces all three counts exactly (15, 9, 3). +* **The repair.** Published records restored from the branch (asserted byte-identical) and + unioned with the chain entries; `stitch_trace.py` now defaults to a non-destructive union + (`--manifest-collide merge|error|clobber`); `RR_TEX_STRICT=1` makes the generator refuse a + build with any degraded caption. All **12** published captions are whole and + every printed fidelity value equals the pre-clobber document's (`scripts/viz/rr_cpu_pdf35.sh`). + +## A third task, at the cap its own paper row reports (run 34, `runs/pixdec/THIRD_TASK.json`) + +Every figure above is drawn on one of two tasks. `two_piece_expert_play_tipping` is added because its OWN flagship row +(`flagship_paper.tex tab:discounts`, Piece-tip (Cov.)) is beta=0.95, cap **33** -- the setting +the chain family already renders under. The two published figure tasks are beta=0.9/cap 73 and +beta=0.98/cap 11, so for them cap 33 is transferred from the capture rather than read off the +row; here the two coincide, which makes these the first panels whose printed `Q` is the paper's +estimator **at the paper's horizon**. It is also a planning win (RSM 7.3+-0.4 vs BC 2.9+-0.6, +4.4, +`docs/MASTER_TABLE.md`), its `M/best` read-out is the best-ordered of the six paired checkpoints +(AUROC 0.9999, margin 0.993, `HEAD_CKPT_ABLATE.json`), and the multitask decoder already covers it +at val PSNR 24.8 dB -- between the two published tasks' 23.0 and 26.0. Nothing was retrained. + +Gates: **G1** the depth-34 capture's first 8 hops equal the depth-8 capture's `c`/`lg`/`z` to +max|dev| = 0 (6/6); **G2** the fold recursion +recomputed from the stored memberships reproduces the stored `Q` to 8.3e-08 +(6/6); **G3** the renderer's chain `Q` matches an +evaluation made outside the renderer to 0.0e+00 with every arg-max index equal; **G5** all +6/6 roots sit in `meta.npz:ep_success == False` +episodes, asserted rather than assumed. + +| figure | episode | frame | chain Q(argmax) | fold Q(argmax) @L8 | chain argmax | fold argmax @L8 | moved | green frac | +|---|---|---|---|---|---|---|---|---| +| `tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png` | `demo_209` | 155 | 1.2e-14 | 2.3e-15 | 115 | 10 | yes | 0.0000 | +| `tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png` | `demo_239` | 258 | 0.00311 | 0.00114 | 36 | 106 | yes | 0.0001 | +| `tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png` | `demo_433` | 82 | 0.352 | 0.72 | 33 | 90 | yes | 0.1258 | +| `tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png` | `demo_459` | 32 | 0.0545 | 0.0914 | 39 | 74 | yes | 0.0383 | +| `tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png` | `demo_510` | 54 | 8.2e-07 | 4.3e-06 | 36 | 36 | no | 0.0000 | +| `tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png` | `demo_695` | 99 | 1.3e-04 | 3.9e-05 | 99 | 60 | yes | 0.0000 | + +**2 of the 6 roots are ALL RED** -- not one of the N x P x L sampled states +crosses `c_k >= 0.5`, so there is no green to chain towards and every candidate's `Q` is 0 +(`demo_209`, `demo_510`). That is the same degeneracy the depth study found on held-out roots, +reproduced on the task with the best-ordered read-out we have measured, which is the evidence that +it is the successor's REACH and not the membership head. The richest root is +`demo_433` at green fraction 0.126, and it is the one panel here +that shows what the figure is for: from one failure state, some sampled futures land in the success +set and some do not. On the all-red roots the arg-max marker is NOT a value decision -- their +candidate spreads are 1.2e-14 and 5.2e-07, so the marker is settled by the tie-break. + +**This corrects a generalisation made one section above.** There the chain `Q_max` was below the +fold's on 12 of 12 roots at a median ratio of 0.310, read as *the fold saturates towards 1 once a +hop fires while the chain averages over 34 hops*. On this task the sign **splits**: the +chain is below the fold on 3 of 6 roots and ABOVE it on 3, at a median +ratio of 1.664. The split is not random -- the chain is +smaller exactly on the roots where the membership fires early, and larger on the roots where +nothing crosses `c_k >= 0.5` by hop 8 but something does deeper in the walk. So the chain does not +shrink the printed value, it RE-WEIGHTS it, and the sign depends on where in the horizon the +membership sits. The part that survives: a `Q` from one family must not be compared against a `Q` +from the other. + +**Whose success the green outline is here:** this cache's `goal.npz` label is `placed_and_settle`, +which fires in **1 of 704** episodes against RISE's 200 (`LABEL_CENSUS.json`). So green means +*RISE's reward would have fired* and says nothing about the simulator, and the second outline style +the brief asked for is not drawable on this task at all. + +Selection caveat, unchanged: these roots come from `pick_failure_states` with the same arbitrariness +the selection section measures, so they are exemplars, not a ranked choice. + +LPIPS at 256 px is **not** comparable to the 84 px number for the same task (16x larger target). + +## Rebuild + +```sh +# the PDF, from whatever figures are on disk (regenerates the tex first) +bash scripts/bsub_cpu.sh rr_cpu_stitchpdf bash scripts/viz/rr_cpu_build_stitch_pdf.sh +# prove the PDF rebuilds from committed blobs only (asserts every figure resolves inside the scratch root) +bash scripts/bsub_cpu.sh rr_cpu_270repro bash scripts/viz/rr_cpu_repro_stitch_pdf.sh +# this index +python3 scripts/viz/make_fig_index.py +``` + +Re-rendering a tree needs the hi-res retrieval source `runs/pixdec_frames//` (see its +`KEEP_README.md`); the PDF itself does not. diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/VERDICT.md b/gen_q_rsm/rsm_rise/pipeline/docs/VERDICT.md new file mode 100644 index 0000000000000000000000000000000000000000..b3c53eb8875843f15a6b7bceb60f043d509d0299 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/VERDICT.md @@ -0,0 +1,222 @@ +# Does RSM beat the baselines? (policy epoch 5000, horizon 400, our data) + +Each task's strongest RSM arm with at least two training seeds, tested against the rollouts it selects from. **vs greedy** and **vs permuted** are exact McNemar tests on the same (training seed, eval seed) cells; *permuted* re-uses the identical scores with the candidate order shuffled, so it isolates the value ranking from the benefit of merely drawing N candidates. **vs best baseline** is an unpaired two-proportion test. A win is claimed only when both paired tests clear p < 0.05. Every IFQL row carries its **value resolution** -- the spread of its HL-Gauss Q in units of the head's 101 bins, across states and over the 128 candidates at a single state. A critic whose per-state spread is a fraction of one bin cannot order candidates however well it classifies provenance, so that row must be read as a random-of-128 until its own permuted control says otherwise (RISE's IQL critic ranks at chance in sim and anti-selects on the real data). + +## square_expert_suboptimal — square-peg (Suboptimal) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 60.2 | - | 1350 | - | - | - | | +| baseline | BC-unified | - | 55.9 | - | 1750 | - | - | - | | +| baseline | RISE policy | - | 59.8 | - | 1200 | - | - | - | | +| baseline | IDQL policy | - | 64.8 | - | 600 | - | - | - | ← best baseline | +| baseline | RISE flagship | - | 47.9 | - | 2250 | - | - | - | | +| RSM (MC occupancy), membership reward, retired fold | IDQL policy@3000 | L40@w2 b0.9 L3 N128 P256 logit | **75.1** | 3 | 900 | +6.6, p=0.000 | - | +10.3 vs IDQL policy, p=0.000 | beats greedy, not its control | + +**Proposer matrix** — the headline recipe (`L40@w2 b0.9 L3 N128 P256 logit`, membership reward) on each proposer: + +| proposer | RSM | its greedy | gain | seeds | +|---|---|---|---|---| +| BC-expert | 65.1 (n=450) | 59.8 | +5.3, p=0.035 | 3 | +| BC-unified | 71.7 (n=1150) | 55.8 | +15.9, p=0.000 | 3 | +| RISE policy | 70.4 (n=1650) | 59.8 | +12.0, p=0.000 | 3 | +| IDQL policy | 71.8 (n=600) | 64.8 | +7.0, p=0.003 | 2 | + +## square_expert_play — square-peg (Coverage) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 9.2 | - | 900 | - | - | - | ← best baseline | +| baseline | BC-unified | - | 3.1 | - | 450 | - | - | - | | +| baseline | RISE policy | - | 7.3 | - | 900 | - | - | - | | +| baseline | RISE flagship | - | 3.7 | - | 900 | - | - | - | | +| baseline | IFQL (published) | expert-action rank 56/44/54th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 6.3/-20.3/8.7pp; per-state spread 6.0e-04/5.8e-04/7.2e-04 bins [context only: global Q range 43.1/42.5/41.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.0 | - | 450 | - | - | - | | +| baseline | IFQL critic / RISE actor | expert-action rank 56/44/54th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 6.3/-20.3/8.7pp; per-state spread 6.0e-04/5.8e-04/7.2e-04 bins [context only: global Q range 43.1/42.5/41.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.7 | - | 450 | - | - | - | | + +*IFQL value resolution (square_expert_play, per training seed): expert-action rank 56/44/54th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 6.3/-20.3/8.7pp; per-state spread 6.0e-04/5.8e-04/7.2e-04 bins [context only: global Q range 43.1/42.5/41.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128*** + +| RSM (MC occupancy), membership reward, coin chain | RISE policy | L40@best b0.9 CH73 N128 P16 prob | **20.9** | 3 | 450 | +14.7, p=0.000 | - | +11.7 vs BC-expert, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), membership reward, retired fold | RISE policy | L40@best b0.95 L8 N128 P16 prob | **17.6** | 3 | 450 | +11.3, p=0.000 | - | +8.3 vs BC-expert, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), progress reward | BC-expert | L40@best b0.95 L3 N128 P256 logit | **12.2** | 3 | 450 | +1.3, p=0.461 | - | +3.0 vs BC-expert, p=0.086 | no gain | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, coin chain | RISE policy | TDF_L40@best b0.95 CH33 N128 P16 prob | **7.1** | 3 | 450 | +0.9, p=0.665 | - | -2.1 vs BC-expert, p=0.190 | no gain | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, retired fold | RISE policy | TDF_L40@best b0.98 L4 N128 P16 prob | **14.7** | 3 | 450 | +8.4, p=0.000 | - | +5.4 vs BC-expert, p=0.003 | beats greedy, not its control | +| LeWM world model + reward probe | RISE policy | H200 mpc N128 | **3.3** | 3 | 450 | -2.9, p=0.066 | -2.0, p=0.188 | -5.9 vs BC-expert, p=0.000 | no gain | +| DINO-WM + reward probe | BC-expert | H10 mpc N128 | **14.4** | 3 | 450 | +3.6, p=0.014 | - | +5.2 vs BC-expert, p=0.004 | beats greedy, not its control | + +## two_piece_expert_suboptimal — piece-assembly (Suboptimal) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 13.8 | - | 1350 | - | - | - | | +| baseline | BC-unified | - | 32.6 | - | 2060 | - | - | - | ← best baseline | +| baseline | RISE policy | - | 30.7 | - | 1350 | - | - | - | | +| baseline | IDQL policy | - | 25.7 | - | 900 | - | - | - | | +| baseline | RISE flagship | - | 22.9 | - | 2550 | - | - | - | | +| baseline | IFQL (published) | expert-action rank 43/44/41th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -0.9/4.0/-6.3pp; per-state spread 3.0e-05/4.2e-05/3.9e-05 bins [context only: global Q range 28.3/26.0/26.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.4 | - | 450 | - | - | - | | +| baseline | IFQL critic / RISE actor | expert-action rank 43/44/41th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -0.9/4.0/-6.3pp; per-state spread 3.0e-05/4.2e-05/3.9e-05 bins [context only: global Q range 28.3/26.0/26.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 17.8 | - | 450 | - | - | - | | + +*IFQL value resolution (two_piece_expert_suboptimal, per training seed): expert-action rank 43/44/41th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -0.9/4.0/-6.3pp; per-state spread 3.0e-05/4.2e-05/3.9e-05 bins [context only: global Q range 28.3/26.0/26.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128*** + +| RSM (MC occupancy), membership reward, coin chain | RISE policy | M@s100000 b0.95 CH33 N128 P8 prob | **47.1** | 3 | 450 | +16.2, p=0.000 | - | +14.5 vs BC-unified, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), membership reward, retired fold | RISE policy | M@s100000 b0.9 L3 N128 P256 logit | **46.6** | 3 | 500 | +15.6, p=0.000 | - | +14.0 vs BC-unified, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), progress reward | BC-unified | M@best b0.95 L1 N128 P256 logit | **42.4** | 3 | 950 | +8.6, p=0.000 | - | +9.8 vs BC-unified, p=0.000 | beats greedy, not its control | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, coin chain | RISE policy | TDF_M@s100000 b0.9 CH73 N128 P16 prob | **30.2** | 3 | 450 | -0.7, p=0.884 | - | -2.4 vs BC-unified, p=0.324 | no gain | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, retired fold | RISE policy | TDF_M@s100000 b0.9 L8 N128 P16 prob | **28.2** | 3 | 450 | -2.7, p=0.410 | - | -4.4 vs BC-unified, p=0.070 | no gain | +| LeWM world model + reward probe | RISE policy | H200 mpc N128 | **32.4** | 3 | 450 | +1.6, p=0.656 | +0.4, p=0.942 | -0.2 vs BC-unified, p=0.942 | no gain | +| DINO-WM + reward probe | RISE policy | H100 mpc N128 | **41.8** | 3 | 450 | +10.9, p=0.001 | +10.7, p=0.001 | +9.2 vs BC-unified, p=0.000 | **win** | + +**Proposer matrix** — the headline recipe (`H100 mpc N128`, dinowm reward) on each proposer: + +| proposer | RSM | its greedy | gain | seeds | +|---|---|---|---|---| +| BC-expert | 14.0 (n=450) | 12.4 | +1.6, p=0.510 | 3 | +| RISE policy | 41.8 (n=450) | 30.9 | +10.9, p=0.001 | 3 | + +## two_piece_expert_play — piece-assembly (Coverage) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 16.4 | - | 1350 | - | - | - | | +| baseline | BC-unified | - | 25.6 | - | 1650 | - | - | - | | +| baseline | RISE policy | - | 30.8 | - | 1950 | - | - | - | ← best baseline | +| baseline | IDQL policy | - | 17.8 | - | 600 | - | - | - | | +| baseline | IFQL policy | expert-action rank 50/51/44th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.5/-1.7/-8.2pp; per-state spread 2.9e-04/2.9e-04/2.5e-04 bins [context only: global Q range 50.3/10.0/49.3/26.7/48.6/45.0 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.7 | - | 150 | - | - | - | | +| baseline | RISE flagship | - | 6.0 | - | 2550 | - | - | - | | +| baseline | IFQL (published) | expert-action rank 50/51/44th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.5/-1.7/-8.2pp; per-state spread 2.9e-04/2.9e-04/2.5e-04 bins [context only: global Q range 50.3/10.0/49.3/26.7/48.6/45.0 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.2 | - | 450 | - | - | - | | +| baseline | IFQL critic / RISE actor | expert-action rank 50/51/44th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.5/-1.7/-8.2pp; per-state spread 2.9e-04/2.9e-04/2.5e-04 bins [context only: global Q range 50.3/10.0/49.3/26.7/48.6/45.0 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 21.1 | - | 450 | - | - | - | | + +*IFQL value resolution (two_piece_expert_play, per training seed): expert-action rank 50/51/44th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.5/-1.7/-8.2pp; per-state spread 2.9e-04/2.9e-04/2.5e-04 bins [context only: global Q range 50.3/10.0/49.3/26.7/48.6/45.0 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128*** + +| RSM (MC occupancy), membership reward, coin chain | RISE policy | L40@best b0.98 CH11 N128 P16 prob | **48.7** | 3 | 450 | +15.8, p=0.000 | - | +17.8 vs RISE policy, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), membership reward, retired fold | RISE policy | L40@best b0.98 L4 N128 P16 prob_log | **49.8** | 3 | 450 | +16.9, p=0.000 | - | +19.0 vs RISE policy, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), progress reward | RISE policy | M@best b0.95 L1 N128 P256 logit | **43.0** | 3 | 1100 | +12.6, p=0.000 | +14.2, p=0.000 | +12.2 vs RISE policy, p=0.000 | **win** | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, coin chain | RISE policy | TDF_L40@best b0.95 CH33 N128 P16 prob | **16.0** | 3 | 450 | -16.9, p=0.000 | - | -14.8 vs RISE policy, p=0.000 | no gain | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, retired fold | RISE policy | TDF_L40@best b0.9 L4 N128 P16 prob | **27.1** | 3 | 450 | -5.8, p=0.022 | - | -3.7 vs RISE policy, p=0.122 | no gain | +| LeWM world model + reward probe | RISE policy | H200 mpc N128 | **18.9** | 3 | 450 | -14.0, p=0.000 | -12.9, p=0.000 | -11.9 vs RISE policy, p=0.000 | no gain | +| DINO-WM + reward probe | RISE policy | L8 N128 | **39.6** | 3 | 450 | +6.7, p=0.013 | +8.7, p=0.001 | +8.7 vs RISE policy, p=0.000 | **win** | + +**Proposer matrix** — the headline recipe (`M@best b0.95 L1 N128 P256 logit`, progress reward) on each proposer: + +| proposer | RSM | its greedy | gain | seeds | +|---|---|---|---|---| +| BC-expert | 21.6 (n=450) | 18.2 | +3.3, p=0.049 | 3 | +| BC-unified | 37.1 (n=1850) | 25.8 | +11.9, p=0.000 | 3 | +| RISE policy | 43.0 (n=1100) | 30.4 | +12.6, p=0.000 | 3 | + +## mug_expert_suboptimal — mug-cleanup (Suboptimal) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 14.5 | - | 1000 | - | - | - | ← best baseline | +| baseline | BC-unified | - | 4.9 | - | 450 | - | - | - | | +| baseline | RISE policy | - | 4.4 | - | 1200 | - | - | - | | +| baseline | IDQL policy | - | 6.7 | - | 300 | - | - | - | | +| baseline | RISE flagship | - | 5.8 | - | 900 | - | - | - | | +| baseline | IFQL (published) | expert-action rank 36/53/50th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -12.9/-8.5/0.8pp; per-state spread 1.3e-04/1.6e-04/1.8e-04 bins [context only: global Q range 34.0/33.4/28.9 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 2.2 | - | 450 | - | - | - | | +| baseline | IFQL critic / RISE actor | expert-action rank 36/53/50th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -12.9/-8.5/0.8pp; per-state spread 1.3e-04/1.6e-04/1.8e-04 bins [context only: global Q range 34.0/33.4/28.9 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 4.9 | - | 450 | - | - | - | | + +*IFQL value resolution (mug_expert_suboptimal, per training seed): expert-action rank 36/53/50th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -12.9/-8.5/0.8pp; per-state spread 1.3e-04/1.6e-04/1.8e-04 bins [context only: global Q range 34.0/33.4/28.9 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128*** + +| RSM (MC occupancy), membership reward, coin chain | BC-expert | M_s1@best b0.98 CH11 N128 P16 logit | **23.1** | 3 | 450 | +8.7, p=0.001 | - | +8.6 vs BC-expert, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), membership reward, retired fold | BC-expert (paper recipe) | M_s1@best b0.98 L2 N128 P16 prob | **22.2** | 3 | 450 | +6.9, p=0.005 | - | +7.7 vs BC-expert, p=0.000 | beats greedy, not its control | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, coin chain | BC-expert | TDF_M_s1@best b0.95 CH33 N128 P16 prob | **19.8** | 3 | 450 | +5.3, p=0.032 | - | +5.3 vs BC-expert, p=0.011 | beats greedy, not its control | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, retired fold | BC-expert | TDF_M_s1@best b0.98 L8 N128 P16 prob | **20.7** | 3 | 450 | +6.2, p=0.012 | - | +6.2 vs BC-expert, p=0.003 | beats greedy, not its control | +| LeWM world model + reward probe | BC-expert | H50 mpc N128 | **18.7** | 3 | 450 | +4.2, p=0.093 | +5.1, p=0.069 | +4.2 vs BC-expert, p=0.044 | no gain | +| DINO-WM + reward probe | BC-expert | H100 mpc N128 | **21.1** | 3 | 450 | +6.7, p=0.006 | +7.0, p=0.006 | +6.6 vs BC-expert, p=0.002 | **win** | + +## threading_expert_play — threading (Coverage) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 13.2 | - | 1800 | - | - | - | ← best baseline | +| baseline | BC-unified | - | 1.4 | - | 1650 | - | - | - | | +| baseline | RISE policy | - | 1.2 | - | 1650 | - | - | - | | +| baseline | IDQL policy | - | 1.6 | - | 450 | - | - | - | | +| baseline | IFQL policy | expert-action rank 52/47/43th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 4.6/-7.2/-16.3pp; per-state spread 4.2e-04/3.8e-04/3.4e-04 bins [context only: global Q range 43.2/38.4/41.6 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 5.3 | - | 150 | - | - | - | | +| baseline | RISE flagship | - | 3.5 | - | 2400 | - | - | - | | +| baseline | IFQL (published) | expert-action rank 52/47/43th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 4.6/-7.2/-16.3pp; per-state spread 4.2e-04/3.8e-04/3.4e-04 bins [context only: global Q range 43.2/38.4/41.6 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 8.7 | - | 450 | - | - | - | | +| baseline | IFQL critic / RISE actor | expert-action rank 52/47/43th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 4.6/-7.2/-16.3pp; per-state spread 4.2e-04/3.8e-04/3.4e-04 bins [context only: global Q range 43.2/38.4/41.6 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.9 | - | 450 | - | - | - | | + +*IFQL value resolution (threading_expert_play, per training seed): expert-action rank 52/47/43th pct of the actor's own 128 (50 = chance); rank gap expert-subopt 4.6/-7.2/-16.3pp; per-state spread 4.2e-04/3.8e-04/3.4e-04 bins [context only: global Q range 43.2/38.4/41.6 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128*** + +| RSM (MC occupancy), membership reward, coin chain | IDQL policy@500 | M@best b0.98 CH11 N128 P8 prob | **25.8** | 3 | 450 | +21.6, p=0.000 | - | +12.6 vs BC-expert, p=0.000 | beats greedy, not its control | +| RSM (MC occupancy), membership reward, retired fold | IDQL policy@500 | M@best b0.9 L1 N128 P16 prob | **32.7** | 3 | 2300 | +29.0, p=0.000 | - | +19.5 vs BC-expert, p=0.000 | beats greedy, not its control | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, coin chain | IDQL policy@500 | TDF_M@best b0.9 CH73 N128 P16 prob | **7.1** | 3 | 450 | +2.9, p=0.079 | - | -6.1 vs BC-expert, p=0.000 | no gain | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, retired fold | IDQL policy@500 | TDF_M@best b0.9 L1 N128 P16 prob | **14.0** | 3 | 450 | +9.8, p=0.000 | - | +0.8 vs BC-expert, p=0.642 | beats greedy, not its control | +| LeWM world model + reward probe | IDQL policy@500 | H50 mpcd N128 | **9.6** | 3 | 450 | +5.3, p=0.001 | +4.2, p=0.014 | -3.6 vs BC-expert, p=0.038 | **win** | +| DINO-WM + reward probe | IDQL policy@500 | H200 mpcd N128 | **31.6** | 3 | 450 | +27.3, p=0.000 | +25.3, p=0.000 | +18.4 vs BC-expert, p=0.000 | **win** | + +## two_piece_expert_play_tipping — piece-assembly tip (Coverage) + +| arm | policy | recipe | SR % | seeds | n | vs greedy | vs permuted | vs best baseline | verdict | +|---|---|---|---|---|---|---|---|---|---| +| baseline | BC-expert | - | 0.9 | - | 1150 | - | - | - | | +| baseline | BC-unified | - | 1.0 | - | 1050 | - | - | - | | +| baseline | RISE policy | - | 1.0 | - | 1350 | - | - | - | | +| baseline | RISE flagship | - | 2.9 | - | 2550 | - | - | - | | +| baseline | IFQL (published) | expert-action rank 48/47/50th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.2/-1.5/-1.7pp; per-state spread 7.4e-04/7.9e-04/7.8e-04 bins [context only: global Q range 64.7/64.6/64.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 0.0 | - | 450 | - | - | - | | +| baseline | IFQL critic / RISE actor | expert-action rank 48/47/50th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.2/-1.5/-1.7pp; per-state spread 7.4e-04/7.9e-04/7.8e-04 bins [context only: global Q range 64.7/64.6/64.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128** | 3.3 | - | 450 | - | - | - | ← best baseline | + +*IFQL value resolution (two_piece_expert_play_tipping, per training seed): expert-action rank 48/47/50th pct of the actor's own 128 (50 = chance); rank gap expert-subopt -5.2/-1.5/-1.7pp; per-state spread 7.4e-04/7.9e-04/7.8e-04 bins [context only: global Q range 64.7/64.6/64.1 bins, provenance AUC 1.00/1.00/1.00] **WARNING: the recorded expert action sits below the 55th percentile of the actor's own samples -- at or near chance selection (RISE's IQL critic anti-selects on real data despite AUC 0.81-1.00), so do NOT read this column as a value baseline on the strength of its AUC** **WARNING: median per-state spread < 0.2 of one HL-Gauss bin -- this critic cannot order 128 candidates at a state; the column is a random-of-128*** + +| RSM (MC occupancy), membership reward, coin chain | RISE policy | M@best b0.95 CH33 N128 P16 prob F4 | **7.3** | 3 | 450 | +6.2, p=0.000 | - | +4.0 vs IFQL critic / RISE actor, p=0.008 | beats greedy, not its control | +| RSM (MC occupancy), membership reward, retired fold | RISE policy | M@best b0.9 L1 N128 P16 prob | **6.9** | 3 | 450 | +5.8, p=0.000 | - | +3.6 vs IFQL critic / RISE actor, p=0.015 | beats greedy, not its control | +| RSM (MC occupancy), progress reward | RISE policy | M@best b0.95 L1 N128 P256 logit | **30.9** | 3 | 450 | +29.8, p=0.000 | +30.0, p=0.000 | +27.6 vs IFQL critic / RISE actor, p=0.000 | **win** | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, coin chain | RISE policy | TDF_M@best b0.95 CH33 N128 P16 prob | **1.1** | 3 | 450 | +0.0, p=1.000 | - | -2.2 vs IFQL critic / RISE actor, p=0.024 | no gain | +| TD-Flow (TD occupancy, td-cfm(c)), membership reward, retired fold | RISE policy | TDF_M@best b0.9 L2 N128 P16 prob | **2.0** | 3 | 450 | +0.9, p=0.388 | - | -1.3 vs IFQL critic / RISE actor, p=0.214 | no gain | +| LeWM world model + reward probe | RISE policy | L2 N128 | **3.1** | 3 | 450 | +2.0, p=0.064 | +1.6, p=0.167 | -0.2 vs IFQL critic / RISE actor, p=0.850 | no gain | +| DINO-WM + reward probe | RISE policy | H200 mpcd N128 | **5.1** | 3 | 450 | +4.0, p=0.001 | +4.4, p=0.000 | +1.8 vs IFQL critic / RISE actor, p=0.185 | **win** | + +**Proposer matrix** — the headline recipe (`M@best b0.95 L1 N128 P256 logit`, progress reward) on each proposer: + +| proposer | RSM | its greedy | gain | seeds | +|---|---|---|---|---| +| BC-expert | 2.0 (n=100) | 1.0 | +1.0, p=1.000 | 2 | +| BC-unified | 13.0 (n=100) | 0.0 | +13.0, p=0.000 | 2 | +| RISE policy | 30.9 (n=450) | 1.1 | +29.8, p=0.000 | 3 | + +## Summary + +| task | reward head | RSM | best baseline | verdict | +|---|---|---|---|---| +| square_expert_suboptimal | membership:fold | 75.1 (IDQL policy@3000) | 64.8 (IDQL policy) | beats greedy, not its control | +| square_expert_play | membership:chain | 20.9 (RISE policy) | 9.2 (BC-expert) | beats greedy, not its control | +| square_expert_play | membership:fold | 17.6 (RISE policy) | 9.2 (BC-expert) | beats greedy, not its control | +| square_expert_play | progress | 12.2 (BC-expert) | 9.2 (BC-expert) | no gain | +| square_expert_play | tdflow:chain | 7.1 (RISE policy) | 9.2 (BC-expert) | no gain | +| square_expert_play | tdflow:fold | 14.7 (RISE policy) | 9.2 (BC-expert) | beats greedy, not its control | +| square_expert_play | wm:lewm | 3.3 (RISE policy) | 9.2 (BC-expert) | no gain | +| square_expert_play | wm:dinowm | 14.4 (BC-expert) | 9.2 (BC-expert) | beats greedy, not its control | +| two_piece_expert_suboptimal | membership:chain | 47.1 (RISE policy) | 32.6 (BC-unified) | beats greedy, not its control | +| two_piece_expert_suboptimal | membership:fold | 46.6 (RISE policy) | 32.6 (BC-unified) | beats greedy, not its control | +| two_piece_expert_suboptimal | progress | 42.4 (BC-unified) | 32.6 (BC-unified) | beats greedy, not its control | +| two_piece_expert_suboptimal | tdflow:chain | 30.2 (RISE policy) | 32.6 (BC-unified) | no gain | +| two_piece_expert_suboptimal | tdflow:fold | 28.2 (RISE policy) | 32.6 (BC-unified) | no gain | +| two_piece_expert_suboptimal | wm:lewm | 32.4 (RISE policy) | 32.6 (BC-unified) | no gain | +| two_piece_expert_suboptimal | wm:dinowm | 41.8 (RISE policy) | 32.6 (BC-unified) | **win** | +| two_piece_expert_play | membership:chain | 48.7 (RISE policy) | 30.8 (RISE policy) | beats greedy, not its control | +| two_piece_expert_play | membership:fold | 49.8 (RISE policy) | 30.8 (RISE policy) | beats greedy, not its control | +| two_piece_expert_play | progress | 43.0 (RISE policy) | 30.8 (RISE policy) | **win** | +| two_piece_expert_play | tdflow:chain | 16.0 (RISE policy) | 30.8 (RISE policy) | no gain | +| two_piece_expert_play | tdflow:fold | 27.1 (RISE policy) | 30.8 (RISE policy) | no gain | +| two_piece_expert_play | wm:lewm | 18.9 (RISE policy) | 30.8 (RISE policy) | no gain | +| two_piece_expert_play | wm:dinowm | 39.6 (RISE policy) | 30.8 (RISE policy) | **win** | +| mug_expert_suboptimal | membership:chain | 23.1 (BC-expert) | 14.5 (BC-expert) | beats greedy, not its control | +| mug_expert_suboptimal | membership:fold | 22.2 (BC-expert (paper recipe)) | 14.5 (BC-expert) | beats greedy, not its control | +| mug_expert_suboptimal | tdflow:chain | 19.8 (BC-expert) | 14.5 (BC-expert) | beats greedy, not its control | +| mug_expert_suboptimal | tdflow:fold | 20.7 (BC-expert) | 14.5 (BC-expert) | beats greedy, not its control | +| mug_expert_suboptimal | wm:lewm | 18.7 (BC-expert) | 14.5 (BC-expert) | no gain | +| mug_expert_suboptimal | wm:dinowm | 21.1 (BC-expert) | 14.5 (BC-expert) | **win** | +| threading_expert_play | membership:chain | 25.8 (IDQL policy@500) | 13.2 (BC-expert) | beats greedy, not its control | +| threading_expert_play | membership:fold | 32.7 (IDQL policy@500) | 13.2 (BC-expert) | beats greedy, not its control | +| threading_expert_play | tdflow:chain | 7.1 (IDQL policy@500) | 13.2 (BC-expert) | no gain | +| threading_expert_play | tdflow:fold | 14.0 (IDQL policy@500) | 13.2 (BC-expert) | beats greedy, not its control | +| threading_expert_play | wm:lewm | 9.6 (IDQL policy@500) | 13.2 (BC-expert) | **win** | +| threading_expert_play | wm:dinowm | 31.6 (IDQL policy@500) | 13.2 (BC-expert) | **win** | +| two_piece_expert_play_tipping | membership:chain | 7.3 (RISE policy) | 3.3 (IFQL critic / RISE actor) | beats greedy, not its control | +| two_piece_expert_play_tipping | membership:fold | 6.9 (RISE policy) | 3.3 (IFQL critic / RISE actor) | beats greedy, not its control | +| two_piece_expert_play_tipping | progress | 30.9 (RISE policy) | 3.3 (IFQL critic / RISE actor) | **win** | +| two_piece_expert_play_tipping | tdflow:chain | 1.1 (RISE policy) | 3.3 (IFQL critic / RISE actor) | no gain | +| two_piece_expert_play_tipping | tdflow:fold | 2.0 (RISE policy) | 3.3 (IFQL critic / RISE actor) | no gain | +| two_piece_expert_play_tipping | wm:lewm | 3.1 (RISE policy) | 3.3 (IFQL critic / RISE actor) | no gain | +| two_piece_expert_play_tipping | wm:dinowm | 5.1 (RISE policy) | 3.3 (IFQL critic / RISE actor) | **win** | diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity.png new file mode 100644 index 0000000000000000000000000000000000000000..6a04a62ab87122acca3fd140e645c1274de8f252 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:198fd862c764dee0fd0ba3ac17840a9d32476905a762f5d8dd9f65d86a813e8b +size 1032078 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_expert_suboptimal.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_expert_suboptimal.png new file mode 100644 index 0000000000000000000000000000000000000000..458820438ab6ab4ed09a758c8f4499cac735d172 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_expert_suboptimal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52cffeabe09d0c239c528ad6c07feef5202267a3828edd6b5e1266411a69614c +size 869171 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_mgen.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_mgen.png new file mode 100644 index 0000000000000000000000000000000000000000..c3242188b1a07f8c0dcdbf9d83625ff1c3ee60ce --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_mug_mgen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:114d0e95740fde2ea35b4e8a640ba5d6dd1160fed3cb239277385045b7c49f57 +size 863385 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_play.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_play.png new file mode 100644 index 0000000000000000000000000000000000000000..e02aff8d26d0e8be39295ea649ed0ce1a68fb612 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc87de823e1cb9e0f356f5ff022818ed09b4e80296340b78f71a752fb5fb9255 +size 825575 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_suboptimal.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_suboptimal.png new file mode 100644 index 0000000000000000000000000000000000000000..3d902adb737528437c2395387645cc8bf11248df --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_expert_suboptimal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35e350aeb75cec2b7fde2703b3b0fc379f26b55389c8994a1e01894aee1d0c6c +size 919171 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_sub_20100.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_sub_20100.png new file mode 100644 index 0000000000000000000000000000000000000000..90c0d6351bdc5d48ed665ac1db8404f99b752cc4 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_square_sub_20100.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e420fb1edd9933cedca6abd2fc6b94ad5b45223a41d95e199e459efb18870b9 +size 853922 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_expert_play.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_expert_play.png new file mode 100644 index 0000000000000000000000000000000000000000..c8c3b117ca32d7f2a349fdd013c278d82a73da53 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_expert_play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cca3a13cec12e3828eeec9681100f5604d0fa715011c4d61201fcd24d3fe338a +size 801643 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_mgen.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_mgen.png new file mode 100644 index 0000000000000000000000000000000000000000..a06cceb20628bc28dd80edac57b256507a35684f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_threading_mgen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3950f3bc52a06b8b437aba70796087b0cde6478d57d8dcff1c6fb16570dd48f +size 723935 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play.png new file mode 100644 index 0000000000000000000000000000000000000000..6f43a8705daf85f0d555cbe2d6f7684ccc9f2a16 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc8c8142b1ff52d2b932bdbc9029e12573762d167c97bf2d8060b72f39cd4479 +size 785098 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play_tipping.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play_tipping.png new file mode 100644 index 0000000000000000000000000000000000000000..26bfc6c64fbcb5db85008a7f6d7959dcc89bea75 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_play_tipping.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:efadb565d52c26b642d9b024462e418ee969dd7d56797cc6a6d5c1265807fa9a +size 817314 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_suboptimal.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_suboptimal.png new file mode 100644 index 0000000000000000000000000000000000000000..069936e9e69b0876b403db5b77a17c1b7b98bbb2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/fidelity_two_piece_expert_suboptimal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f54ce6390d9647aa8b2b5ef3fb3fd5843d4d8dbf78ffe6c936ef727f976923d4 +size 811026 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_expert_suboptimal.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_expert_suboptimal.png new file mode 100644 index 0000000000000000000000000000000000000000..491171448e032185f3b4afb6ee9d681dbe30757c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_expert_suboptimal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af3315f055da579e8c13ba05c2fcb1455dca8f2a1263f4b4701ac9729a5ff44f +size 501406 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_mgen.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_mgen.png new file mode 100644 index 0000000000000000000000000000000000000000..e6ac1c2c23e2c77f9ab1d8637801713ca88e4be5 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_mug_mgen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0e4c47b836bf5932ba09f776347952f49c2ef3259684a693868039df4ad3efb +size 524177 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_play.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_play.png new file mode 100644 index 0000000000000000000000000000000000000000..3a64af60f4356b376fff6aa0a87ffac32008d605 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9ff0c07e21ca2f10d7c1a8783f5ab3d26126f79f18b2e34880a357d692ff228 +size 520905 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_suboptimal.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_suboptimal.png new file mode 100644 index 0000000000000000000000000000000000000000..9d7c0b6b6b49e7aeb91cd6026927dc813b204479 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_expert_suboptimal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07f612bce979d0d0060916c1353b31770024b72763aae0a34f3f910b282cee08 +size 579858 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_sub_20100.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_sub_20100.png new file mode 100644 index 0000000000000000000000000000000000000000..c05e811f08f269697013341f3d89a3e3e7633b14 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_square_sub_20100.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bae94a9e93cbff8c1d1db310c52142781b4f54f80374fbad51654c9859cf3b7 +size 509035 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_expert_play.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_expert_play.png new file mode 100644 index 0000000000000000000000000000000000000000..c47d07bb03b97ced68752e1c6cc4111ba14ad0c4 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_expert_play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e8eb9b99c57538bbfd3c1f87f53a33296bc7309338ac103f4e84fdabcaf9b37 +size 460050 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_mgen.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_mgen.png new file mode 100644 index 0000000000000000000000000000000000000000..1871eed94619cea09d16249d83146c52a3f57d9a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_threading_mgen.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7a4e7833c8175a69140b7cfad686ecee57e8ba55739d37cb68a73c2af21b194 +size 412041 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play.png new file mode 100644 index 0000000000000000000000000000000000000000..39366ca72b42ffe6c2105fc63ac3d6ef49918f25 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5217d8cf1e0fbd10cea37af516b74e0d07769488fdf01c1b3c82054e6f56f49c +size 463931 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play_tipping.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play_tipping.png new file mode 100644 index 0000000000000000000000000000000000000000..984feb749a9f81a0f0c551567e4403594f1706a2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_play_tipping.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f242ab0c6bd5fe26e66bc8c8999cec96143416eb01f95c5f3c001188e8a766a2 +size 475686 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_suboptimal.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_suboptimal.png new file mode 100644 index 0000000000000000000000000000000000000000..806886de59f46a66a97c13414b9ec28c73f67f40 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/pixdec/r84/fidelity_two_piece_expert_suboptimal.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f66bb382f4f8840bec026a6a0b70cd59ceee77fe9171229d551c651ab1de27a +size 474745 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_proposal_curves.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_proposal_curves.png new file mode 100644 index 0000000000000000000000000000000000000000..bddddeaf5c58dec326dfa23dadd0b7e39e470026 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_proposal_curves.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18fb0eaf5e2421e08a35c62dae6a0fab80c79e3fd708ca826511c40e6762e5ef +size 160282 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..cb558370ac60949d2ba829d6ba6f42e84d87d30d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_combo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c3c1bf734dd80cd3505d52b894d15d819f05e579305d83283f66a447c3938b0 +size 132129 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_global.png new file mode 100644 index 0000000000000000000000000000000000000000..1974b7f332ebf8b83e952fddec910285eab9f1f8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_global.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c5cbcbcaa3a94ce7483bc91503743ab942353c265a98b35cd7bccb48f44bae7 +size 116612 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..b7686161205987751946c108d27c1ed2ad577272 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage1_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3541aa5c68c67b7d2d691ea57d8e7d6468abfd2d130f1f3758dac1086b28035f +size 139589 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..702518cf4bdaa498af1274f087f8999d0aa274a7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_combo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d160902ee99cdf52c497e857e8899c06f60e81399e548931a87ee71d8ee0a47 +size 143484 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_global.png new file mode 100644 index 0000000000000000000000000000000000000000..49675618ad2a962e276dddf7f1798270e263cd87 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_global.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce1d2fad6e5f68ddf7589f995317d4396a1fc27f41b40d7aeaca1999915972e7 +size 121873 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..058e1db3fe3eb933948e459a561d915d909f6912 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage2_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c755d212ed643e64d0e9924c9e75fc96b7b8e0678053dbf68062a27c4b3ee781 +size 171136 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..934ef3c64bb5c6ad5bd783433197d3efc6cecd44 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_combo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9bdc6cb034ba08c054cd30e206aeccee2f7bf0015c1907397b4381b0f98d317e +size 106981 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_global.png new file mode 100644 index 0000000000000000000000000000000000000000..a72542f190b8950d1775d2cdf4a9abe877f082c1 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_global.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..a9004bb7dcad21a23eb5b98c485f0dc7b1a43943 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage3_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d2b70d6e256cc9ed8764b7a9257a2b52fb90b206858e9e5ab18d1ace198a93 +size 160513 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..4cba0941e81fe18ccf982dcc37b3d30d1ff66f5c Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_combo.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_global.png new file mode 100644 index 0000000000000000000000000000000000000000..817610a8a968bd2d9dc51a396b2543aa9fc257a5 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_global.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..397cdbebcf1bd7b8777bc341087db2d9c0728f9c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage4_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:100c8069bc773658c3f2eced5599b8a7c0ae681ca0993fc78d8acca30129e47d +size 121425 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..7716c24495388ad25504374fb85082d03ea1712c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_combo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46a9cb891683a2f6954a20644055e8a19afd6d1fa44055994b99ee3129420b20 +size 114252 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_global.png new file mode 100644 index 0000000000000000000000000000000000000000..ac1faab612faa6394cb2ac45bd276e3e391c58f5 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_global.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..c472d599578b3f32f261c96fea1ea697b4d4f3a7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage5_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e854a096f0cf00d8dc6bf665ca485eeaae3274c2c4d9b58d8aa3ea60fb95963 +size 132369 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..620033d935af52ca1ba78d1c6eebdc1d88082068 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_combo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bdd8e7c7ba8070decebaab85e0445c6170332ccc67c94579d9fbef5547059fae +size 116722 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_global.png new file mode 100644 index 0000000000000000000000000000000000000000..201af4e96dea7aee6af77aaabc8a526fd22aa5eb Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_global.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..56ee42170c946be53c4be70d1b28abfceb5e424e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/end_stage6_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cb56188368a847e74a3fba13e44ef2ece596506091396c11c0be8416615ead4 +size 143250 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/pour_strip_ep148.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/pour_strip_ep148.png new file mode 100644 index 0000000000000000000000000000000000000000..5cade614932e62d43c56c9211a6dffdea3aa8a70 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/pour_strip_ep148.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd92e2c48709b0a2171524ba068165cbb7d6dae14018a27c5b9852b966d4314a +size 481724 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_counts.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_counts.png new file mode 100644 index 0000000000000000000000000000000000000000..fe800be01cc92b38c1bd7305d565dc4c8e70cdcb Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_counts.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_subopt.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_subopt.png new file mode 100644 index 0000000000000000000000000000000000000000..6577d6f84f19ddcb5e2c9a26885d8f610768c35f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_subopt.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50abc23a427f270ee7f9ba58983be4619b2d58f3a17f5daff023bb3e91ce7e8f +size 619782 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_success.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_success.png new file mode 100644 index 0000000000000000000000000000000000000000..a3743ebc83cadc45278655210bf4081b8315deec --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_strip_success.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c796e3971464fa2ab572e4e9d1e45076e1a54de2075921b43cbf382ecfbecfc +size 551695 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_timelines.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_timelines.png new file mode 100644 index 0000000000000000000000000000000000000000..4f596aa5097db64b509214098ff2ebddf30de194 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/reward_timelines.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ecba200b0828bb29ce3c65cabf0b005c9b1f6988fa125b7bfe4cfa47e728376 +size 241977 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_global_start.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_global_start.png new file mode 100644 index 0000000000000000000000000000000000000000..b7d78fc7f739ec4acf1f93621de37412a33b10cd Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_global_start.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_wrist_start.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_wrist_start.png new file mode 100644 index 0000000000000000000000000000000000000000..beca628d7450fe110fae9328e6d655c99707e077 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep000_wrist_start.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e0eadcf3ad2b34180edc087b8985ee21985afb58535df5d1f31f7db71000096 +size 158561 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_global_start.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_global_start.png new file mode 100644 index 0000000000000000000000000000000000000000..fd8afdf37df1d6027046b36ea3d7a9cef830238a Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_global_start.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_wrist_start.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_wrist_start.png new file mode 100644 index 0000000000000000000000000000000000000000..cfbcf77567a805cc5cf3d40a29fbd6d78b66370a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage0_ep001_wrist_start.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94f4dfd1bda836e0c8a594caa71958458c979b3c549a44091178a14f22289bd0 +size 147344 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..1974b7f332ebf8b83e952fddec910285eab9f1f8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_global_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c5cbcbcaa3a94ce7483bc91503743ab942353c265a98b35cd7bccb48f44bae7 +size 116612 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..b7686161205987751946c108d27c1ed2ad577272 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep050_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3541aa5c68c67b7d2d691ea57d8e7d6468abfd2d130f1f3758dac1086b28035f +size 139589 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..10e75b052fb47ae5b97f9b27b017884ee1c63dfe --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_global_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:667955b03f7f89ab02b92e6b7a87b42550f0e253b82f1fd4e7f9638fe3afea19 +size 113033 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..c9f4b2bd6ec174729a0ac10ef0803dda7a76e077 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage1_ep051_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7f1f8e4d5a98b179483a3ecda93bba31fa2392cc9d6ba00bef971a5f3a7681b +size 122650 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..49675618ad2a962e276dddf7f1798270e263cd87 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_global_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce1d2fad6e5f68ddf7589f995317d4396a1fc27f41b40d7aeaca1999915972e7 +size 121873 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..058e1db3fe3eb933948e459a561d915d909f6912 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep100_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c755d212ed643e64d0e9924c9e75fc96b7b8e0678053dbf68062a27c4b3ee781 +size 171136 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..5f2175f517122104fe20890bf43f263c0a414c0f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_global_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c7389630d24d095baf46f3c0bc0f4c91f7fa84f3ebc2e759aad6cdff5190fb8 +size 111787 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..ea9d0776e48093b8335536880c07220176a487be --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep101_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2fc4a2cead43c8e74efa31d4593028f4e0609124e9971337734ad0ae5c45528 +size 219863 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_global_start.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_global_start.png new file mode 100644 index 0000000000000000000000000000000000000000..9eb2e02cbe69bf58a7f1b3063a9a254fb8e6ebf3 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_global_start.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_wrist_start.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_wrist_start.png new file mode 100644 index 0000000000000000000000000000000000000000..cc2e1b341e9b9ae4d675e2f7595b440f2c054b43 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage2_ep148_wrist_start.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc7c546ae9131041d881b5f115fd5fee29a5d4d77cf218a60cd441adcafd41d9 +size 120086 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..479b941e129d839ba7fe5b6062ba08d6ae767bd2 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..f553b22a0ae56cdf131906f33fc56279d63618e0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep050_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74b9d90ab658089a3b8f86be1d25828026b71ee639af6052c9206162a3396cdf +size 177723 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..d15f38b1354d07227873874736240a52534a871b Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..c1356db2d4ace08a249c94dcb62f94af6182ef71 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage3_ep051_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a65c779a5dbcb3a66b944eabc9e256f120de0c0800aaf971b0eadcc8c9414f5b +size 186426 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..817610a8a968bd2d9dc51a396b2543aa9fc257a5 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..397cdbebcf1bd7b8777bc341087db2d9c0728f9c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep148_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:100c8069bc773658c3f2eced5599b8a7c0ae681ca0993fc78d8acca30129e47d +size 121425 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..f0e5925a906ead7d5d70aa8998c36521b07d1612 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..c1c9d17dabaeb61b84de01985203fa983736cecd --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage4_ep149_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:270827f1ecbef9bab8876cc2711ca95529fe93a3f52827fb0c9bca94b6169a72 +size 136803 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..ac1faab612faa6394cb2ac45bd276e3e391c58f5 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..c472d599578b3f32f261c96fea1ea697b4d4f3a7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep000_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e854a096f0cf00d8dc6bf665ca485eeaae3274c2c4d9b58d8aa3ea60fb95963 +size 132369 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..75d4e5375768ab7def8d35a8832f636c25656e43 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..f807b1654a177734f707ebde74008f2f586dd473 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage5_ep001_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa6bef458b251555f1dfd68b4189a380cf22037ee3bcd79151e89f3c8c50929d +size 120766 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..201af4e96dea7aee6af77aaabc8a526fd22aa5eb Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..56ee42170c946be53c4be70d1b28abfceb5e424e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep198_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cb56188368a847e74a3fba13e44ef2ece596506091396c11c0be8416615ead4 +size 143250 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_global_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_global_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..1fa24de70f93de7e9e84f1d70097d6061f2bbe76 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_global_arrival.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_wrist_arrival.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_wrist_arrival.png new file mode 100644 index 0000000000000000000000000000000000000000..9928f8464b0fcb61a0be4774da8327ad44d56c1b --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage6_ep199_wrist_arrival.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1714dd04a1882168e30618313bf1b618d47b1484645428172be10b86cf1d4e57 +size 138141 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_global.png new file mode 100644 index 0000000000000000000000000000000000000000..6d0f4fdacf528a8cb9c1cf1d85a50b3801ac74e2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_global.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67a5ea82ec48574cb4b154672e741efc6ac84336c5d98fd89e56e08c28f8e5bf +size 698025 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_wrist.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_wrist.png new file mode 100644 index 0000000000000000000000000000000000000000..818270cffaa4e941a5c3dac172a693ae08a9a3b7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/stage_grid_wrist.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81b389c909fd5145f4ae4b9c16d503ad5322331df665c17af20c97d0582d4ed0 +size 975054 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_grid_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_grid_global.png new file mode 100644 index 0000000000000000000000000000000000000000..f194cd093ecc77ab9f6347046a05c4f8c01f0618 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_grid_global.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57c0d7c0e0bd5945f6494df23c02d5d6cac5d33c285ebf194157372783355cfb +size 268631 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_combo.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_combo.png new file mode 100644 index 0000000000000000000000000000000000000000..904f5983659e45f04d20a48e280254ba72578a48 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_combo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3961a4903bc7d3e5111d9ad9aaa972b19df070ebc70281423664dc2ccc0ee763 +size 117884 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_global.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_global.png new file mode 100644 index 0000000000000000000000000000000000000000..9eb2e02cbe69bf58a7f1b3063a9a254fb8e6ebf3 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/story_start_global.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep148.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep148.png new file mode 100644 index 0000000000000000000000000000000000000000..817610a8a968bd2d9dc51a396b2543aa9fc257a5 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep148.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep149.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep149.png new file mode 100644 index 0000000000000000000000000000000000000000..f0e5925a906ead7d5d70aa8998c36521b07d1612 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep149.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep150.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep150.png new file mode 100644 index 0000000000000000000000000000000000000000..b1ebcf7c39bf3dc306b85606952aa13eeab33f0d Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep150.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep151.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep151.png new file mode 100644 index 0000000000000000000000000000000000000000..02be0ddb253716ed439da8c2e134487616304ed0 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep151.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep152.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep152.png new file mode 100644 index 0000000000000000000000000000000000000000..758ae6fc094dbbd7a0dac1135e743daa96ae0d35 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep152.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep153.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep153.png new file mode 100644 index 0000000000000000000000000000000000000000..32af3872314fe645a61e8594216bd81335d63bf0 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_ep153.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_grid.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_grid.png new file mode 100644 index 0000000000000000000000000000000000000000..14a2a949ebfc50eadc0e4522d5fb91b064093c81 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_final_grid.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88128e819e909cc61b0cbd4db459e27aae19a3933a07e65ccd71e35a9e1be313 +size 187285 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep148.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep148.png new file mode 100644 index 0000000000000000000000000000000000000000..817610a8a968bd2d9dc51a396b2543aa9fc257a5 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep148.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep149.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep149.png new file mode 100644 index 0000000000000000000000000000000000000000..f0e5925a906ead7d5d70aa8998c36521b07d1612 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep149.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep150.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep150.png new file mode 100644 index 0000000000000000000000000000000000000000..b1ebcf7c39bf3dc306b85606952aa13eeab33f0d Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep150.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep151.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep151.png new file mode 100644 index 0000000000000000000000000000000000000000..02be0ddb253716ed439da8c2e134487616304ed0 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep151.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep152.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep152.png new file mode 100644 index 0000000000000000000000000000000000000000..758ae6fc094dbbd7a0dac1135e743daa96ae0d35 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep152.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep153.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep153.png new file mode 100644 index 0000000000000000000000000000000000000000..32af3872314fe645a61e8594216bd81335d63bf0 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_ep153.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep148.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep148.png new file mode 100644 index 0000000000000000000000000000000000000000..95999151036b6483c8497491a4bb8599344d7091 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep148.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep149.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep149.png new file mode 100644 index 0000000000000000000000000000000000000000..e3d320ae62ad7504b756f366a3f02e7458810461 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep149.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep150.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep150.png new file mode 100644 index 0000000000000000000000000000000000000000..373b236e45ae77f7cf6ffc6f62ef197637797131 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep150.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep151.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep151.png new file mode 100644 index 0000000000000000000000000000000000000000..f9956b5650b8b771140680e72b409349ff2f2390 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep151.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep152.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep152.png new file mode 100644 index 0000000000000000000000000000000000000000..682d6294b3ecb4f1abf13e67ff8f3fe1e3639055 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep152.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep153.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep153.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc65837eeb3ff9341fb6b57e86d218971df2e8e Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stages/success_marker_vs_final_ep153.png differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/ENDPOINTS_hop4.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/ENDPOINTS_hop4.json new file mode 100644 index 0000000000000000000000000000000000000000..5f23307d5a98b87dfeb385970cbb94bc9c5033ec --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/ENDPOINTS_hop4.json @@ -0,0 +1,331 @@ +{ + "diag": "/proj/dmfexp/zwhong/rsm_rise/status/real/REWARD_HEAD_DIAG_STITCH.json", + "hop": "4", + "hop_frames": 100, + "n_cand": 128, + "read_out": { + "mode": "d1", + "depth": 1, + "beta": 0.99, + "score_kind": "prob", + "temperature": 25.0, + "particles": 16 + }, + "endpoint_flow": "/proj/dmfexp/zwhong/rsm_rise/runs/real_cooking_v5/rsm/R_M/ckpt_s100000.pt", + "policy": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921193225/models/model_epoch_2000.pth", + "note": "endpoint rows are indices into cache/real_cooking_v5; row->(ep,frame) by ep_from", + "heads": { + "B": { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_B.png", + "auc_pooled": 0.6862193496288995, + "anchors": [ + { + "episode": 225, + "anchor_cache_row": 170119, + "best_cand": 110, + "best_q": 0.13341927528381348, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 49, + "worst_q": 0.11850325763225555, + "worst_endpoint_row": 167388, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 216, + "anchor_cache_row": 167038, + "best_cand": 81, + "best_q": 0.09296873956918716, + "best_endpoint_row": 117462, + "best_endpoint_edge_to": 4, + "worst_cand": 26, + "worst_q": 0.08436717092990875, + "worst_endpoint_row": 167040, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 212, + "anchor_cache_row": 165506, + "best_cand": 121, + "best_q": 0.20926326513290405, + "best_endpoint_row": 117468, + "best_endpoint_edge_to": 4, + "worst_cand": 15, + "worst_q": 0.20490717887878418, + "worst_endpoint_row": 164772, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 240, + "anchor_cache_row": 177774, + "best_cand": 67, + "best_q": 0.03847402334213257, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 3, + "worst_q": 0.034447081387043, + "worst_endpoint_row": 177816, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 221, + "anchor_cache_row": 168758, + "best_cand": 109, + "best_q": 0.1070212572813034, + "best_endpoint_row": 159582, + "best_endpoint_edge_to": 4, + "worst_cand": 3, + "worst_q": 0.10454796254634857, + "worst_endpoint_row": 167070, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 233, + "anchor_cache_row": 174259, + "best_cand": 84, + "best_q": 0.04750152677297592, + "best_endpoint_row": 120738, + "best_endpoint_edge_to": 4, + "worst_cand": 100, + "worst_q": 0.04650891199707985, + "worst_endpoint_row": 178392, + "worst_endpoint_edge_to": 6 + } + ] + }, + "A": { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_A.png", + "auc_pooled": 0.6140188363769163, + "anchors": [ + { + "episode": 198, + "anchor_cache_row": 160339, + "best_cand": 97, + "best_q": 0.10448645800352097, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 32, + "worst_q": 0.09392259269952774, + "worst_endpoint_row": 173676, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 227, + "anchor_cache_row": 171057, + "best_cand": 122, + "best_q": 0.020446259528398514, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 10, + "worst_q": 0.0147152841091156, + "worst_endpoint_row": 164100, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 241, + "anchor_cache_row": 178281, + "best_cand": 39, + "best_q": 0.01471631694585085, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 3, + "worst_q": 0.010223116725683212, + "worst_endpoint_row": 171612, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 240, + "anchor_cache_row": 177774, + "best_cand": 67, + "best_q": 0.007389691658318043, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 4, + "worst_q": 0.00535905547440052, + "worst_endpoint_row": 171618, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 201, + "anchor_cache_row": 161305, + "best_cand": 48, + "best_q": 0.18950743973255157, + "best_endpoint_row": 168474, + "best_endpoint_edge_to": 6, + "worst_cand": 124, + "worst_q": 0.10750177502632141, + "worst_endpoint_row": 130836, + "worst_endpoint_edge_to": 3 + }, + { + "episode": 216, + "anchor_cache_row": 166938, + "best_cand": 108, + "best_q": 0.17227521538734436, + "best_endpoint_row": 166950, + "best_endpoint_edge_to": 2, + "worst_cand": 35, + "worst_q": 0.09082001447677612, + "worst_endpoint_row": 130836, + "worst_endpoint_edge_to": 3 + } + ] + }, + "C3": { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_C3.png", + "auc_pooled": 0.6796195998882976, + "anchors": [ + { + "episode": 198, + "anchor_cache_row": 160339, + "best_cand": 97, + "best_q": 0.11904704570770264, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 32, + "worst_q": 0.10645772516727448, + "worst_endpoint_row": 173676, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 227, + "anchor_cache_row": 171057, + "best_cand": 122, + "best_q": 0.03561313450336456, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 10, + "worst_q": 0.025249719619750977, + "worst_endpoint_row": 164100, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 232, + "anchor_cache_row": 173640, + "best_cand": 63, + "best_q": 0.026117751374840736, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 10, + "worst_q": 0.019603796303272247, + "worst_endpoint_row": 173688, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 240, + "anchor_cache_row": 177774, + "best_cand": 67, + "best_q": 0.0205063559114933, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 4, + "worst_q": 0.015664827078580856, + "worst_endpoint_row": 171618, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 233, + "anchor_cache_row": 174259, + "best_cand": 84, + "best_q": 0.029269153252243996, + "best_endpoint_row": 120738, + "best_endpoint_edge_to": 4, + "worst_cand": 114, + "worst_q": 0.028490979224443436, + "worst_endpoint_row": 178392, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 226, + "anchor_cache_row": 170474, + "best_cand": 36, + "best_q": 0.18081092834472656, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 28, + "worst_q": 0.09727655351161957, + "worst_endpoint_row": 130836, + "worst_endpoint_edge_to": 3 + } + ] + }, + "v0lit": { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_v0lit.png", + "auc_pooled": 0.6971831722105302, + "anchors": [ + { + "episode": 227, + "anchor_cache_row": 171007, + "best_cand": 4, + "best_q": 0.29831749200820923, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 88, + "worst_q": 0.290264368057251, + "worst_endpoint_row": 177816, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 232, + "anchor_cache_row": 173640, + "best_cand": 63, + "best_q": 0.1808839738368988, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 16, + "worst_q": 0.17778709530830383, + "worst_endpoint_row": 175902, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 243, + "anchor_cache_row": 179217, + "best_cand": 54, + "best_q": 0.16899409890174866, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 26, + "worst_q": 0.1668364405632019, + "worst_endpoint_row": 179292, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 231, + "anchor_cache_row": 173014, + "best_cand": 99, + "best_q": 0.2018517553806305, + "best_endpoint_row": 122808, + "best_endpoint_edge_to": 4, + "worst_cand": 14, + "worst_q": 0.20003238320350647, + "worst_endpoint_row": 172110, + "worst_endpoint_edge_to": 6 + }, + { + "episode": 207, + "anchor_cache_row": 163585, + "best_cand": 76, + "best_q": 0.22496414184570312, + "best_endpoint_row": 169446, + "best_endpoint_edge_to": 6, + "worst_cand": 103, + "worst_q": 0.21013349294662476, + "worst_endpoint_row": 130836, + "worst_endpoint_edge_to": 3 + }, + { + "episode": 205, + "anchor_cache_row": 162902, + "best_cand": 21, + "best_q": 0.17715264856815338, + "best_endpoint_row": 164448, + "best_endpoint_edge_to": 6, + "worst_cand": 7, + "worst_q": 0.16637632250785828, + "worst_endpoint_row": 130836, + "worst_endpoint_edge_to": 3 + } + ] + } + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_A.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_A.png new file mode 100644 index 0000000000000000000000000000000000000000..1ff6dbd614907d4c8d6beca91608e609220d94bd --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_A.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ae1cdf8f1f7fd2a467cbde57171619cffc77b25bf650774d12bdc1c4de6fda3 +size 1050205 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_B.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_B.png new file mode 100644 index 0000000000000000000000000000000000000000..44ab39f150024f4a591502f83f4e10ba36df870e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_B.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c423d87a40b8a68092c925600a27f96563de2876f95e8082f54312de0dc25cd7 +size 1050690 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_C3.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_C3.png new file mode 100644 index 0000000000000000000000000000000000000000..9c2def43cdc7b0d5d6b335fe318929562f5b2363 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_C3.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b73cc25db33a55dad784dc748fd1690f2a7894745265ea99432b830b3dc06e02 +size 1034061 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_v0lit.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_v0lit.png new file mode 100644 index 0000000000000000000000000000000000000000..23df83d1b905d2747f58d991edf64648c3a7e391 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/real_stitch/endpoints_hop4_v0lit.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e33deb77654a49816d728bf2aab1c9f7ee531e89dc6c96d8f37c7ae93fba5972 +size 1048459 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/UNSEEN_FIGREPORT.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/UNSEEN_FIGREPORT.json new file mode 100644 index 0000000000000000000000000000000000000000..46405483872594d879693ee78139c0e635a1ae93 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/UNSEEN_FIGREPORT.json @@ -0,0 +1,369 @@ +{ + "task": "square_expert_play", + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 2, + "fidelity": { + "psnr": 22.99894905090332, + "lpips": 0.13460793578997254, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "n_train_rows": 138913, + "n_val_rows": 15533, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png", + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "regime": "coverage", + "episode": "demo_198", + "frame": 110, + "ep_len": 476, + "held_out": true, + "argmax": 64, + "rejected": 29, + "particle": 0, + "Q_argmax": 0.31185004115104675, + "Q_rejected": 0.0, + "Q_min": 0.0, + "Q_max": 0.31185004115104675, + "anchor_nn_train_cos_dist": 0.46639013290405273, + "anchor_nn_train_l2": 35.95292663574219, + "c_chosen": [ + 1.7327544293063019e-13, + 3.9664459450250433e-07, + 0.42848891019821167, + 0.0009105513454414904, + 0.39803582429885864, + 0.9754114747047424, + 1.0, + 0.9999998807907104 + ], + "c_rejected": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "q_chosen": [ + 0.5138903260231018, + 0.6282992959022522, + 0.7681792974472046, + 0.7266993522644043, + 0.8881820440292358, + 0.9955226182937622, + 1.0, + 0.9999998807907104, + 0.0 + ], + "nn_train_cos_root": 0.5324699282646179, + "nn_train_cos_chosen": { + "cos_mean": 0.4622034728527069, + "cos_max": 0.5068854689598083, + "cos_min": 0.422351598739624 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.552628755569458, + "cos_max": 0.5689992308616638, + "cos_min": 0.479740709066391 + }, + "nn_train_cos_chosen_per_hop": [ + 0.5068854689598083, + 0.49939674139022827, + 0.4836955666542053, + 0.4742017388343811, + 0.43901026248931885, + 0.43777239322662354, + 0.4343140125274658, + 0.422351598739624 + ], + "nn_train_cos_rejected_per_hop": [ + 0.479740709066391, + 0.5446814298629761, + 0.5581313371658325, + 0.5650891661643982, + 0.5676175355911255, + 0.5689992308616638, + 0.568354606628418, + 0.5684163570404053 + ], + "nn_train_cos_all_hops": 0.5074161291122437, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 22.99894905090332, + "lpips": 0.13460793578997254, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 20.525182805569436, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.00738525390625 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png", + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "regime": "coverage", + "episode": "demo_54", + "frame": 122, + "ep_len": 423, + "held_out": true, + "argmax": 50, + "rejected": 15, + "particle": 0, + "Q_argmax": 0.01727997325360775, + "Q_rejected": 0.0, + "Q_min": 0.0, + "Q_max": 0.01727997325360775, + "anchor_nn_train_cos_dist": 0.46615177392959595, + "anchor_nn_train_l2": 31.817819595336914, + "c_chosen": [ + 5.1473848141151556e-30, + 3.595721606192669e-27, + 5.341086296792671e-25, + 5.087616462586893e-35, + 5.773438772231348e-25, + 2.073377025624268e-09, + 0.9225241541862488, + 0.015494858846068382 + ], + "c_rejected": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "q_chosen": [ + 0.276479572057724, + 0.3380330502986908, + 0.4132903516292572, + 0.5053024291992188, + 0.6177994012832642, + 0.7553419470787048, + 0.9235060214996338, + 0.015494858846068382, + 0.0 + ], + "nn_train_cos_root": 0.5340985655784607, + "nn_train_cos_chosen": { + "cos_mean": 0.6062449216842651, + "cos_max": 0.6992923021316528, + "cos_min": 0.37364524602890015 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.581114649772644, + "cos_max": 0.5923194885253906, + "cos_min": 0.5363894701004028 + }, + "nn_train_cos_chosen_per_hop": [ + 0.6626635193824768, + 0.6992923021316528, + 0.67826247215271, + 0.6526116132736206, + 0.6304200291633606, + 0.6217551231384277, + 0.5313092470169067, + 0.37364524602890015 + ], + "nn_train_cos_rejected_per_hop": [ + 0.5363894701004028, + 0.5869287252426147, + 0.5910062193870544, + 0.5923194885253906, + 0.5894261598587036, + 0.5868948698043823, + 0.5843207240104675, + 0.5816313624382019 + ], + "nn_train_cos_all_hops": 0.5936797857284546, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 22.99894905090332, + "lpips": 0.13460793578997254, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.470071078485184, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.0003662109375 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png", + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "regime": "coverage", + "episode": "demo_181", + "frame": 135, + "ep_len": 314, + "held_out": true, + "argmax": 29, + "rejected": 33, + "particle": 0, + "Q_argmax": 0.8514546751976013, + "Q_rejected": 7.292697533096276e-14, + "Q_min": 7.292697533096276e-14, + "Q_max": 0.8514546751976013, + "anchor_nn_train_cos_dist": 0.40436023473739624, + "anchor_nn_train_l2": 26.96146011352539, + "c_chosen": [ + 0.9999996423721313, + 6.545852215822379e-08, + 2.356836059647094e-09, + 5.92501117613331e-11, + 1.2236287083946563e-14, + 3.613330321121334e-15, + 1.1668107452456056e-11, + 1.1798046178739898e-21 + ], + "c_rejected": [ + 2.236176277193131e-23, + 9.171345802720071e-29, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "q_chosen": [ + 0.9999996423721313, + 6.743010771970148e-08, + 2.4105291096532255e-09, + 6.564682131227073e-11, + 7.820825584370361e-12, + 9.547039374335764e-12, + 1.1668107452456056e-11, + 1.1798046178739898e-21, + 0.0 + ], + "nn_train_cos_root": 0.5962226390838623, + "nn_train_cos_chosen": { + "cos_mean": 0.5035935640335083, + "cos_max": 0.6856423616409302, + "cos_min": 0.37021946907043457 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.5743247866630554, + "cos_max": 0.5974011421203613, + "cos_min": 0.48871785402297974 + }, + "nn_train_cos_chosen_per_hop": [ + 0.6856423616409302, + 0.4844858646392822, + 0.5154263973236084, + 0.5280313491821289, + 0.4670294523239136, + 0.442330002784729, + 0.37021946907043457, + 0.5355837941169739 + ], + "nn_train_cos_rejected_per_hop": [ + 0.48871785402297974, + 0.5636259913444519, + 0.5910580158233643, + 0.5974011421203613, + 0.5942420363426208, + 0.5904756784439087, + 0.5858036875724792, + 0.5832739472389221 + ], + "nn_train_cos_all_hops": 0.5389591455459595, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 22.99894905090332, + "lpips": 0.13460793578997254, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.809404324619237, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.19854736328125 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..c3feccab9d067500297ca137d5736221ef5ae405 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a58fbb82c38a91cc5da6339203338f5770408daa77ddedc4dd47fd15f02c7af +size 2004874 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..1e9533d3c41aa8871fbeeb474b196507b1aba3ff --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70d448c7764edaf90ff37a21a8f9f77becfc7d091bd11f0ac3aef5eeb5f48257 +size 2091420 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..84f0aa602a5e763c85308494d5cd9915e6dceaa7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_expert_play/unseen_square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:168f7cac5f986ca82658d4f464b8be61fda3f1755163a12e31726eef51b1a601 +size 2027129 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/UNSEEN_FIGREPORT.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/UNSEEN_FIGREPORT.json new file mode 100644 index 0000000000000000000000000000000000000000..ac577a062343a97529162f23012dcd1c6d4ab378 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/UNSEEN_FIGREPORT.json @@ -0,0 +1,369 @@ +{ + "task": "square_sub_20100", + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 1, + "fidelity": { + "psnr": 20.120403289794922, + "lpips": 0.18614485883153975, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "n_train_rows": 35692, + "n_val_rows": 3781, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png", + "name": "square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "regime": "suboptimal", + "episode": "demo_147", + "frame": 234, + "ep_len": 771, + "held_out": true, + "argmax": 86, + "rejected": 24, + "particle": 0, + "Q_argmax": 1.5120242835564568e-08, + "Q_rejected": 2.62849104257939e-15, + "Q_min": 2.62849104257939e-15, + "Q_max": 1.5120242835564568e-08, + "anchor_nn_train_cos_dist": 0.535770058631897, + "anchor_nn_train_l2": 43.83781814575195, + "c_chosen": [ + 1.2641991553188809e-17, + 1.4334651521341613e-10, + 7.656982686787828e-11, + 5.874231101543614e-10, + 4.324364192383765e-35, + 0.0, + 0.0, + 0.0 + ], + "c_rejected": [ + 1.1589224583931091e-24, + 1.1082220786938577e-14, + 1.779442580427098e-14, + 3.854045988599397e-14, + 1.6348784247444006e-32, + 0.0, + 0.0, + 0.0 + ], + "q_chosen": [ + 4.8987958134461e-10, + 5.989429507913258e-10, + 5.570272576527202e-10, + 5.874231101543614e-10, + 4.324364192383765e-35, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "nn_train_cos_root": 0.46307995915412903, + "nn_train_cos_chosen": { + "cos_mean": 0.3008754849433899, + "cos_max": 0.3545709550380707, + "cos_min": 0.24251191318035126 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.31321120262145996, + "cos_max": 0.3404403626918793, + "cos_min": 0.27806180715560913 + }, + "nn_train_cos_chosen_per_hop": [ + 0.26626139879226685, + 0.28864654898643494, + 0.3061581552028656, + 0.24251191318035126, + 0.3545709550380707, + 0.3357652425765991, + 0.3126133680343628, + 0.3004762530326843 + ], + "nn_train_cos_rejected_per_hop": [ + 0.29353243112564087, + 0.3177582621574402, + 0.3317151665687561, + 0.27806180715560913, + 0.3404403626918793, + 0.3321116268634796, + 0.311582088470459, + 0.3004879355430603 + ], + "nn_train_cos_all_hops": 0.30704331398010254, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 20.120403289794922, + "lpips": 0.18614485883153975, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.226182073865775, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.0 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png", + "name": "square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "regime": "suboptimal", + "episode": "demo_181", + "frame": 252, + "ep_len": 357, + "held_out": true, + "argmax": 70, + "rejected": 91, + "particle": 0, + "Q_argmax": 3.8730100015982316e-08, + "Q_rejected": 6.232957292656716e-12, + "Q_min": 6.232957292656716e-12, + "Q_max": 3.8730100015982316e-08, + "anchor_nn_train_cos_dist": 0.4993113875389099, + "anchor_nn_train_l2": 36.77060317993164, + "c_chosen": [ + 2.425997346150679e-21, + 1.4585243277888404e-13, + 1.4597448175625392e-15, + 2.8517329550451447e-17, + 1.1864919233202756e-31, + 0.0, + 0.0, + 0.0 + ], + "c_rejected": [ + 2.813941420930796e-26, + 5.112738846102485e-18, + 3.099127290700362e-19, + 1.8206036871551867e-20, + 4.29226614101739e-28, + 0.0, + 0.0, + 0.0 + ], + "q_chosen": [ + 1.202858477969762e-13, + 1.4706545172198798e-13, + 1.483069352072844e-15, + 2.8517329550451447e-17, + 1.1864919233202756e-31, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "nn_train_cos_root": 0.5009185075759888, + "nn_train_cos_chosen": { + "cos_mean": 0.31954440474510193, + "cos_max": 0.3366343080997467, + "cos_min": 0.2999960482120514 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.3353521227836609, + "cos_max": 0.35650962591171265, + "cos_min": 0.31087613105773926 + }, + "nn_train_cos_chosen_per_hop": [ + 0.32145488262176514, + 0.3366343080997467, + 0.3330879509449005, + 0.31167906522750854, + 0.3221479058265686, + 0.32155266404151917, + 0.309802383184433, + 0.2999960482120514 + ], + "nn_train_cos_rejected_per_hop": [ + 0.33536407351493835, + 0.35100606083869934, + 0.35650962591171265, + 0.33801475167274475, + 0.3420153260231018, + 0.32880449295043945, + 0.32022663950920105, + 0.31087613105773926 + ], + "nn_train_cos_all_hops": 0.3274482488632202, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + false, + false, + false + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 20.120403289794922, + "lpips": 0.18614485883153975, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 22.218343927607084, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.0 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png", + "name": "square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "regime": "suboptimal", + "episode": "demo_116", + "frame": 62, + "ep_len": 428, + "held_out": true, + "argmax": 2, + "rejected": 96, + "particle": 0, + "Q_argmax": 4.811029504468711e-13, + "Q_rejected": 1.7168506416782297e-31, + "Q_min": 1.7168506416782297e-31, + "Q_max": 4.811029504468711e-13, + "anchor_nn_train_cos_dist": 0.47579145431518555, + "anchor_nn_train_l2": 39.785282135009766, + "c_chosen": [ + 1.1656635856394193e-21, + 9.000634466350717e-32, + 7.00170720439818e-33, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "c_rejected": [ + 1.9413246959501846e-33, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "q_chosen": [ + 1.1656635856394193e-21, + 9.573308865448442e-32, + 7.00170720439818e-33, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "nn_train_cos_root": 0.5251969695091248, + "nn_train_cos_chosen": { + "cos_mean": 0.32210859656333923, + "cos_max": 0.4095260202884674, + "cos_min": 0.28169646859169006 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.3013734519481659, + "cos_max": 0.38345664739608765, + "cos_min": 0.2722497582435608 + }, + "nn_train_cos_chosen_per_hop": [ + 0.4095260202884674, + 0.32281702756881714, + 0.3300805389881134, + 0.3303642272949219, + 0.31367355585098267, + 0.3002609610557556, + 0.2884500026702881, + 0.28169646859169006 + ], + "nn_train_cos_rejected_per_hop": [ + 0.38345664739608765, + 0.3244631588459015, + 0.29957520961761475, + 0.2877318859100342, + 0.2851089835166931, + 0.2824089825153351, + 0.2759929299354553, + 0.2722497582435608 + ], + "nn_train_cos_all_hops": 0.31174102425575256, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 20.120403289794922, + "lpips": 0.18614485883153975, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.55844423084004, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.0 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..ad29823e5cbc6127f7b0b54b90c1476abb5cf6da --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b4f4893a2c8266c6a2ecd5dfe357ba4699fcf922d4b45e1bc6547e491532621 +size 1911286 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..56c18849876f1771dc6b36d999f6952427c3128d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea1c4ca795d38155b130037667849f367682d7e2691f7ef31f80c39db30c5d64 +size 1865223 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..3079e9eb507261f4144fc3a5bdec8cc1e5d60f3f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/square_sub_20100/unseen_square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:347eee3c231fea8ee710fa0945e2bbb70d1495e46f4f877ee814f5ed2d2041f9 +size 1895590 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/UNSEEN_FIGREPORT.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/UNSEEN_FIGREPORT.json new file mode 100644 index 0000000000000000000000000000000000000000..8994cb453912d14cbfd64b034268811f75d1a258 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/UNSEEN_FIGREPORT.json @@ -0,0 +1,369 @@ +{ + "task": "two_piece_expert_play", + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 4, + "fidelity": { + "psnr": 26.296754837036133, + "lpips": 0.08036620542407036, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "n_train_rows": 109588, + "n_val_rows": 12221, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png", + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "regime": "coverage", + "episode": "demo_38", + "frame": 67, + "ep_len": 461, + "held_out": true, + "argmax": 93, + "rejected": 117, + "particle": 0, + "Q_argmax": 0.04319200664758682, + "Q_rejected": 4.965724656358361e-05, + "Q_min": 4.965724656358361e-05, + "Q_max": 0.04319200664758682, + "anchor_nn_train_cos_dist": 0.4285218119621277, + "anchor_nn_train_l2": 38.19707489013672, + "c_chosen": [ + 0.0, + 0.0, + 0.0, + 2.873381599929198e-13, + 0.0010916469618678093, + 1.3931456805948983e-06, + 1.7667167728774302e-10, + 5.0347046123477024e-17 + ], + "c_rejected": [ + 0.0, + 0.0, + 0.0, + 5.791954118600966e-15, + 0.0009512160322628915, + 9.570043175699539e-07, + 3.011259575025349e-10, + 1.4623411058947716e-16 + ], + "q_chosen": [ + 0.0004890466807410121, + 0.0005979246343486011, + 0.0007310424116440117, + 0.0008937966194935143, + 0.001092785270884633, + 1.3932901765656425e-06, + 1.7667171892110645e-10, + 5.0347046123477024e-17, + 0.0 + ], + "nn_train_cos_root": 0.5697985291481018, + "nn_train_cos_chosen": { + "cos_mean": 0.550724446773529, + "cos_max": 0.7276080250740051, + "cos_min": 0.3771175444126129 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.5562039017677307, + "cos_max": 0.7281069159507751, + "cos_min": 0.3866381347179413 + }, + "nn_train_cos_chosen_per_hop": [ + 0.6706294417381287, + 0.7001193165779114, + 0.7276080250740051, + 0.3771175444126129, + 0.432962030172348, + 0.4843810796737671, + 0.5009462237358093, + 0.5120317935943604 + ], + "nn_train_cos_rejected_per_hop": [ + 0.7027949094772339, + 0.7020997405052185, + 0.7281069159507751, + 0.3866381347179413, + 0.4340619146823883, + 0.4841308891773224, + 0.5004876255989075, + 0.5113112926483154 + ], + "nn_train_cos_all_hops": 0.5534641742706299, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 26.296754837036133, + "lpips": 0.08036620542407036, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.061788094069072, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.0074462890625 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png", + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "regime": "coverage", + "episode": "demo_18", + "frame": 96, + "ep_len": 183, + "held_out": true, + "argmax": 82, + "rejected": 85, + "particle": 0, + "Q_argmax": 0.920602560043335, + "Q_rejected": 0.00139467918779701, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "anchor_nn_train_cos_dist": 0.4116707444190979, + "anchor_nn_train_l2": 29.66008758544922, + "c_chosen": [ + 0.9999998807907104, + 3.984479917562567e-06, + 6.86676106601003e-12, + 2.0200401715123138e-15, + 3.1076511284187793e-19, + 1.8448172939601484e-24, + 1.7364954750573073e-29, + 1.008094771715578e-34 + ], + "c_rejected": [ + 0.021846774965524673, + 1.1190498305779784e-08, + 1.0945465623538476e-14, + 6.63223850869185e-20, + 1.1081742474993362e-24, + 1.0901919795514772e-29, + 1.4645888193077975e-34, + 4.1404880387622176e-39 + ], + "q_chosen": [ + 0.9999998807907104, + 3.984485374530777e-06, + 6.868413390120898e-12, + 2.02029428139649e-15, + 3.107666121067382e-19, + 1.8448314934564423e-24, + 1.736503750537537e-29, + 1.008094771715578e-34, + 0.0 + ], + "nn_train_cos_root": 0.5873196125030518, + "nn_train_cos_chosen": { + "cos_mean": 0.4583876430988312, + "cos_max": 0.5595383048057556, + "cos_min": 0.3599647879600525 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.45726412534713745, + "cos_max": 0.49436330795288086, + "cos_min": 0.34260454773902893 + }, + "nn_train_cos_chosen_per_hop": [ + 0.5595383048057556, + 0.3599647879600525, + 0.39848437905311584, + 0.4423537254333496, + 0.46536025404930115, + 0.4736054837703705, + 0.4798767566680908, + 0.48791757225990295 + ], + "nn_train_cos_rejected_per_hop": [ + 0.34260454773902893, + 0.4273729920387268, + 0.45410192012786865, + 0.47675368189811707, + 0.48593419790267944, + 0.48751580715179443, + 0.4894666373729706, + 0.49436330795288086 + ], + "nn_train_cos_all_hops": 0.4578258991241455, + "true_future_available": [ + true, + true, + true, + true, + true, + false, + false, + false, + false + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 26.296754837036133, + "lpips": 0.08036620542407036, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 26.713773752910544, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.12005615234375 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png", + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "regime": "coverage", + "episode": "demo_128", + "frame": 115, + "ep_len": 378, + "held_out": true, + "argmax": 73, + "rejected": 114, + "particle": 0, + "Q_argmax": 0.09216669201850891, + "Q_rejected": 0.04491756856441498, + "Q_min": 0.04491756856441498, + "Q_max": 0.09216669201850891, + "anchor_nn_train_cos_dist": 0.40183407068252563, + "anchor_nn_train_l2": 32.24315643310547, + "c_chosen": [ + 0.04115748032927513, + 1.4802853343098832e-07, + 2.40962429351422e-15, + 8.370166172168957e-19, + 3.349493558584319e-22, + 2.1311749504096225e-27, + 1.614414537464523e-32, + 1.0998654319235985e-38 + ], + "c_rejected": [ + 1.1960161749868803e-09, + 4.738562431327864e-09, + 2.3741483831612824e-16, + 3.2375164166380733e-19, + 4.568303599554466e-23, + 2.8744997939527744e-28, + 1.9631745645380785e-33, + 0.0 + ], + "q_chosen": [ + 0.041157595813274384, + 1.4802853343098832e-07, + 2.410309119652075e-15, + 8.372905690960156e-19, + 3.3495109766331062e-22, + 2.1311882393262388e-27, + 1.6144154190852862e-32, + 1.0998654319235985e-38, + 0.0 + ], + "nn_train_cos_root": 0.5984864830970764, + "nn_train_cos_chosen": { + "cos_mean": 0.4412316679954529, + "cos_max": 0.49113449454307556, + "cos_min": 0.34550657868385315 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.43936681747436523, + "cos_max": 0.4965108633041382, + "cos_min": 0.3222123980522156 + }, + "nn_train_cos_chosen_per_hop": [ + 0.48702678084373474, + 0.34550657868385315, + 0.3604087233543396, + 0.4286291301250458, + 0.46123549342155457, + 0.47383540868759155, + 0.4820766746997833, + 0.49113449454307556 + ], + "nn_train_cos_rejected_per_hop": [ + 0.4965108633041382, + 0.3222123980522156, + 0.37013688683509827, + 0.42689248919487, + 0.4587037265300751, + 0.47131961584091187, + 0.4798838496208191, + 0.48927465081214905 + ], + "nn_train_cos_all_hops": 0.44029921293258667, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 26.296754837036133, + "lpips": 0.08036620542407036, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.819352136655638, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.01348876953125 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..e0d984d23c712a3000278bcb6504840751a7e585 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3979f43d2cb711612199ca7c9819d51b9cd57854dc133cf09d14bb4ce04ab491 +size 1876176 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..ead01b7475771a8d14d676cd84b1e6fa175a98d8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4de72992d5d6b7b4902c0bb89f6666c2f6de9f2fea7b6c5d1195d2718f70a92 +size 1836283 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..7b486a15f95ee0678f4e33ed7614d253a345f1f5 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_play/unseen_two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e36a56c1112705976c8e6b84fd2c482dae8b1aeeb7777807a4a17cc64f8bc1c +size 1967809 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/UNSEEN_FIGREPORT.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/UNSEEN_FIGREPORT.json new file mode 100644 index 0000000000000000000000000000000000000000..13d8f0d1c11b13371cdebcc6c3f5eb641f07136b --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/UNSEEN_FIGREPORT.json @@ -0,0 +1,369 @@ +{ + "task": "two_piece_expert_suboptimal", + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 3, + "fidelity": { + "psnr": 26.031949996948242, + "lpips": 0.07967323658522218, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "n_train_rows": 24792, + "n_val_rows": 3067, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png", + "name": "two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "regime": "suboptimal", + "episode": "demo_5", + "frame": 159, + "ep_len": 206, + "held_out": true, + "argmax": 125, + "rejected": 31, + "particle": 0, + "Q_argmax": 0.9158510565757751, + "Q_rejected": 0.0377330482006073, + "Q_min": 0.0377330482006073, + "Q_max": 0.9158510565757751, + "anchor_nn_train_cos_dist": 0.4271807074546814, + "anchor_nn_train_l2": 33.24647903442383, + "c_chosen": [ + 0.7106455564498901, + 0.6522843837738037, + 0.3484309911727905, + 0.3392081558704376, + 0.36644792556762695, + 0.10270091891288757, + 0.2081013321876526, + 0.04231051355600357 + ], + "c_rejected": [ + 0.0316707119345665, + 0.000938400742597878, + 0.00013033968571107835, + 2.0998490072088316e-05, + 3.3591381907172035e-06, + 4.278851406525064e-07, + 7.358197251505771e-08, + 8.029356735050897e-09 + ], + "q_chosen": [ + 0.9105097055435181, + 0.8445023894309998, + 0.6758744120597839, + 0.6144293546676636, + 0.5092292428016663, + 0.275540292263031, + 0.2355058193206787, + 0.04231051355600357, + 0.0 + ], + "nn_train_cos_root": 0.5739016532897949, + "nn_train_cos_chosen": { + "cos_mean": 0.41280597448349, + "cos_max": 0.5073605179786682, + "cos_min": 0.30092543363571167 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.631396472454071, + "cos_max": 0.690295934677124, + "cos_min": 0.46903499960899353 + }, + "nn_train_cos_chosen_per_hop": [ + 0.5073605179786682, + 0.44013822078704834, + 0.4306730628013611, + 0.3716673254966736, + 0.3454318642616272, + 0.4808519184589386, + 0.30092543363571167, + 0.42539963126182556 + ], + "nn_train_cos_rejected_per_hop": [ + 0.46903499960899353, + 0.579825758934021, + 0.6249195337295532, + 0.6538798809051514, + 0.6676902770996094, + 0.6792844533920288, + 0.6862410306930542, + 0.690295934677124 + ], + "nn_train_cos_all_hops": 0.5221012234687805, + "true_future_available": [ + true, + true, + true, + false, + false, + false, + false, + false, + false + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 26.031949996948242, + "lpips": 0.07967323658522218, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 23.540616969430367, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.10589599609375 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png", + "name": "two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "regime": "suboptimal", + "episode": "demo_1", + "frame": 70, + "ep_len": 211, + "held_out": true, + "argmax": 56, + "rejected": 61, + "particle": 0, + "Q_argmax": 0.7066577672958374, + "Q_rejected": 0.06331731379032135, + "Q_min": 0.06331731379032135, + "Q_max": 0.7066577672958374, + "anchor_nn_train_cos_dist": 0.38624584674835205, + "anchor_nn_train_l2": 28.140241622924805, + "c_chosen": [ + 0.31994399428367615, + 0.3510039448738098, + 0.5026650428771973, + 0.42416268587112427, + 0.40193983912467957, + 0.3798154294490814, + 0.3471413552761078, + 0.2939852774143219 + ], + "c_rejected": [ + 0.051126252859830856, + 0.005647646728903055, + 0.0005806969129480422, + 7.786569040035829e-05, + 1.1582196748349816e-05, + 1.4938789263396757e-06, + 2.5397653757863736e-07, + 3.8122745849022976e-08 + ], + "q_chosen": [ + 0.7548568248748779, + 0.7819044589996338, + 0.811766505241394, + 0.7598856091499329, + 0.7128157615661621, + 0.6355333924293518, + 0.5041229128837585, + 0.2939852774143219, + 0.0 + ], + "nn_train_cos_root": 0.6146647930145264, + "nn_train_cos_chosen": { + "cos_mean": 0.3693690299987793, + "cos_max": 0.530053973197937, + "cos_min": 0.23144713044166565 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.6425602436065674, + "cos_max": 0.7043442726135254, + "cos_min": 0.4871005415916443 + }, + "nn_train_cos_chosen_per_hop": [ + 0.530053973197937, + 0.5080002546310425, + 0.3598807752132416, + 0.3926492929458618, + 0.3659285008907318, + 0.3046417236328125, + 0.2623506784439087, + 0.23144713044166565 + ], + "nn_train_cos_rejected_per_hop": [ + 0.4871005415916443, + 0.5708856582641602, + 0.6327303647994995, + 0.6638796925544739, + 0.6816231608390808, + 0.6973148584365845, + 0.7026034593582153, + 0.7043442726135254 + ], + "nn_train_cos_all_hops": 0.5059646368026733, + "true_future_available": [ + true, + true, + true, + true, + true, + true, + true, + true, + false + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 26.031949996948242, + "lpips": 0.07967323658522218, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 28.042074278746277, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.14752197265625 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png", + "name": "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "regime": "suboptimal", + "episode": "demo_27", + "frame": 156, + "ep_len": 252, + "held_out": true, + "argmax": 72, + "rejected": 6, + "particle": 0, + "Q_argmax": 0.8900830745697021, + "Q_rejected": 0.011463155038654804, + "Q_min": 0.011463155038654804, + "Q_max": 0.8900830745697021, + "anchor_nn_train_cos_dist": 0.35205137729644775, + "anchor_nn_train_l2": 35.802268981933594, + "c_chosen": [ + 0.6134648323059082, + 0.6476191282272339, + 0.7843258380889893, + 0.2935362458229065, + 0.2811369001865387, + 0.2772773504257202, + 0.1350678950548172, + 0.16825558245182037 + ], + "c_rejected": [ + 0.00914231687784195, + 0.0010177153162658215, + 0.00014189693320076913, + 1.9500967027852312e-05, + 2.824638613674324e-06, + 3.843821048121754e-07, + 6.713325007012827e-08, + 7.099193233273127e-09 + ], + "q_chosen": [ + 0.8993401527404785, + 0.9042400121688843, + 0.890380859375, + 0.6012141704559326, + 0.5324790477752686, + 0.42747950553894043, + 0.2540976107120514, + 0.16825558245182037, + 0.0 + ], + "nn_train_cos_root": 0.6493762731552124, + "nn_train_cos_chosen": { + "cos_mean": 0.3261023163795471, + "cos_max": 0.4631314277648926, + "cos_min": 0.1852312833070755 + }, + "nn_train_cos_rejected": { + "cos_mean": 0.6442948579788208, + "cos_max": 0.691574215888977, + "cos_min": 0.545684814453125 + }, + "nn_train_cos_chosen_per_hop": [ + 0.4631314277648926, + 0.35574865341186523, + 0.42378219962120056, + 0.2356649935245514, + 0.23068712651729584, + 0.1852312833070755, + 0.3644309341907501, + 0.35014188289642334 + ], + "nn_train_cos_rejected_per_hop": [ + 0.545684814453125, + 0.5953318476676941, + 0.6309989094734192, + 0.6544288396835327, + 0.6656718254089355, + 0.6821672916412354, + 0.6885011196136475, + 0.691574215888977 + ], + "nn_train_cos_all_hops": 0.48519858717918396, + "true_future_available": [ + true, + true, + true, + true, + true, + false, + false, + false, + false + ], + "offsets": [ + 0, + 20, + 40, + 60, + 80, + 100, + 120, + 140, + 160 + ], + "hires_gap_frames": 1, + "res": 256, + "fidelity": { + "psnr": 26.031949996948242, + "lpips": 0.07967323658522218, + "n": 512, + "src": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FIDELITY.json", + "res": 256 + }, + "root_decode_psnr": 26.689260857179562, + "gamma_pow_h": 0.8179069375972309, + "h_frames": 19.999999999999982, + "frac_green": 0.064453125 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..8fae2221eaeb9916083167732dadef0a32e40b6c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:966704b10d6c7e81cd3031e5253b077d30aa34d7a28a7afff9e44cd17b5bc6b1 +size 1984769 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..0a4828d0505b7ca9e6e91c93193fa45f12a54fea --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81cd78f462a228dcc519d110a4e93541b4c1ea76eddcc276844b1b2009d21edc +size 2016803 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..cd971cd0aab791bf7c964bcf620cde09570a0038 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitch_unseen/two_piece_expert_suboptimal/unseen_two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59c2b637b23c443829c37977b1b32fdf757fafb4423261590f43f4bdee737bae +size 1947276 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT.json new file mode 100644 index 0000000000000000000000000000000000000000..d095f22d7fe56237c7019b1cd21986628cbcd9e5 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT.json @@ -0,0 +1,83 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.6323050856590271, + "cos_min": 0.45796769857406616, + "Q_argmax": 0.6069021821022034, + "argmax": 38, + "frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.6379711031913757, + "cos_min": 0.4213436543941498, + "Q_argmax": 6.59219892895635e-07, + "argmax": 7, + "frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "episode": "demo_110", + "frame": 104 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5815402865409851, + "cos_min": 0.34454384446144104, + "Q_argmax": 0.024722615256905556, + "argmax": 125, + "frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 145 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.61673903465271, + "cos_min": 0.3787424564361572, + "Q_argmax": 0.04654752463102341, + "argmax": 103, + "frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "episode": "demo_160", + "frame": 165 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5858869552612305, + "cos_min": 0.4423654079437256, + "Q_argmax": 0.2687058746814728, + "argmax": 104, + "frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "episode": "demo_84", + "frame": 390 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5993218421936035, + "cos_min": 0.4830125570297241, + "Q_argmax": 0.06528710573911667, + "argmax": 16, + "frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "episode": "demo_221", + "frame": 249 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_dec.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_dec.json new file mode 100644 index 0000000000000000000000000000000000000000..ccbe352721e6180050ee5388d2db19acb9e7a004 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_dec.json @@ -0,0 +1,97 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6323050856590271, + "cos_min": 0.45796769857406616, + "Q_argmax": 0.6069021821022034, + "argmax": 38, + "frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6379711031913757, + "cos_min": 0.4213436543941498, + "Q_argmax": 6.59219892895635e-07, + "argmax": 7, + "frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "episode": "demo_110", + "frame": 104 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5815402865409851, + "cos_min": 0.34454384446144104, + "Q_argmax": 0.024722615256905556, + "argmax": 125, + "frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 145 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.61673903465271, + "cos_min": 0.3787424564361572, + "Q_argmax": 0.04654752463102341, + "argmax": 103, + "frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "episode": "demo_160", + "frame": 165 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5858869552612305, + "cos_min": 0.4423654079437256, + "Q_argmax": 0.2687058746814728, + "argmax": 104, + "frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "episode": "demo_84", + "frame": 390 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5993218421936035, + "cos_min": 0.4830125570297241, + "Q_argmax": 0.06528710573911667, + "argmax": 16, + "frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "episode": "demo_221", + "frame": 249 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r84_mt2/ckpt.pt", + "pixdec_step": 40000, + "pixdec_res": 84, + "pixdec_task_index": 1, + "pixdec_tasks": [ + "two_piece_expert_play", + "square_expert_play" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_dec256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_dec256.json new file mode 100644 index 0000000000000000000000000000000000000000..366668e96d8d4f01497cbd60ca34cdeddfae6396 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_dec256.json @@ -0,0 +1,117 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6323050856590271, + "cos_min": 0.45796769857406616, + "Q_argmax": 0.6069021821022034, + "argmax": 38, + "frac_green": 0.192138671875, + "root_res": 256, + "root_frame_gap": 0, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6379711031913757, + "cos_min": 0.4213436543941498, + "Q_argmax": 6.59219892895635e-07, + "argmax": 7, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "episode": "demo_110", + "frame": 104 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5815402865409851, + "cos_min": 0.34454384446144104, + "Q_argmax": 0.024722615256905556, + "argmax": 125, + "frac_green": 0.0013427734375, + "root_res": 256, + "root_frame_gap": 1, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 145 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.61673903465271, + "cos_min": 0.3787424564361572, + "Q_argmax": 0.04654752463102341, + "argmax": 103, + "frac_green": 0.00592041015625, + "root_res": 256, + "root_frame_gap": 1, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "episode": "demo_160", + "frame": 165 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5858869552612305, + "cos_min": 0.4423654079437256, + "Q_argmax": 0.2687058746814728, + "argmax": 104, + "frac_green": 0.0267333984375, + "root_res": 256, + "root_frame_gap": 0, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "episode": "demo_84", + "frame": 390 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5993218421936035, + "cos_min": 0.4830125570297241, + "Q_argmax": 0.06528710573911667, + "argmax": 16, + "frac_green": 0.00164794921875, + "root_res": 256, + "root_frame_gap": 1, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "episode": "demo_221", + "frame": 249 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 2, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_r256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_r256.json new file mode 100644 index 0000000000000000000000000000000000000000..c902fafe910794197c77ec15e4fcf7c4fb299d68 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_r256.json @@ -0,0 +1,89 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.6323050856590271, + "cos_min": 0.45796769857406616, + "Q_argmax": 0.6069021821022034, + "argmax": 38, + "frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.6379711031913757, + "cos_min": 0.4213436543941498, + "Q_argmax": 6.59219892895635e-07, + "argmax": 7, + "frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "episode": "demo_110", + "frame": 104 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5815402865409851, + "cos_min": 0.34454384446144104, + "Q_argmax": 0.024722615256905556, + "argmax": 125, + "frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 145 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.61673903465271, + "cos_min": 0.3787424564361572, + "Q_argmax": 0.04654752463102341, + "argmax": 103, + "frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "episode": "demo_160", + "frame": 165 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5858869552612305, + "cos_min": 0.4423654079437256, + "Q_argmax": 0.2687058746814728, + "argmax": 104, + "frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "episode": "demo_84", + "frame": 390 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5993218421936035, + "cos_min": 0.4830125570297241, + "Q_argmax": 0.06528710573911667, + "argmax": 16, + "frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "episode": "demo_221", + "frame": 249 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_split256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_split256.json new file mode 100644 index 0000000000000000000000000000000000000000..3347e12caa4fba829b94a3422ae6270ef4360c95 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_split256.json @@ -0,0 +1,57 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6323050856590271, + "cos_min": 0.45796769857406616, + "Q_argmax": 0.6069021821022034, + "argmax": 38, + "frac_green": 0.192138671875, + "root_res": 256, + "root_frame_gap": 0, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5820013880729675, + "cos_min": 0.41684091091156006, + "Q_argmax": 0.849848747253418, + "argmax": 98, + "frac_green": 0.207275390625, + "root_res": 256, + "root_frame_gap": 1, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "episode": "demo_181", + "frame": 135 + } + ], + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 2, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_split2b256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_split2b256.json new file mode 100644 index 0000000000000000000000000000000000000000..920dd8ffaadd4e8c413837ab51be9e4ee9493f05 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/FIGREPORT_split2b256.json @@ -0,0 +1,72 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6323050856590271, + "cos_min": 0.45796769857406616, + "Q_argmax": 0.6069021821022034, + "argmax": 38, + "frac_green": 0.192138671875, + "root_res": 256, + "root_frame_gap": 0, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6490607261657715, + "cos_min": 0.512186586856842, + "Q_argmax": 0.5210829973220825, + "argmax": 73, + "frac_green": 0.12725830078125, + "root_res": 256, + "root_frame_gap": 0, + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "episode": "demo_172", + "frame": 38 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5820013880729675, + "cos_min": 0.41684091091156006, + "Q_argmax": 0.849848747253418, + "argmax": 98, + "frac_green": 0.207275390625, + "root_res": 256, + "root_frame_gap": 1, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "episode": "demo_181", + "frame": 135 + } + ], + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 2, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..9b7d7d4b2bdca68b62998342f590cad50ffff883 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfc4918f37a71534bbfbbbd0cef6caa84f7b215bc23759944027112658e2c29a +size 910542 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..4d24d4829176eefcb80347de008910fabb6d883f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6390b0912331ee499a8208005285ce858b2d9f6e5fe1c83f529027374302d2f +size 2085034 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..31ba4bbf67b39a4d08099da7bd36e0707b741510 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1a4f6fe3e4eb438cf1051076cd81a8e79eaeee19257967fb69eb0cf789dec8c +size 3113670 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..b276498938f752001539d85da9d89deba0daea97 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c4ad9a215e927a6b83888ce7af59d6693d2399ba3152cee37f85e6e371364a6 +size 1208287 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..f65d26e6cb31bf572a18c818b54d1179d4150e44 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a820e31f992d4bc0c9b013e2871adc214e9d26f0ed55327a0774f7b8276715c0 +size 944076 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..9801e2c7ca44b1cfd172b9fabe93a6a6f6065d98 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e62c27f3d7349b85cee39a87233910768334007811cf41caf3d27778160605f8 +size 2104736 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..02f9651c964a2e5e82a6ad6ce46918f91736847f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14981f2e0e76276787bef8ee7d93afa2bd4acd7468c2aa22fc57faad31ccfacd +size 3089156 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..cc8f98f96f2c8c622ab1f65cd34cb1486577607f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4b0f1f3cf11f5f6ac78a74bdd2b5ef8ceb6b59f2e68ca415f715c91b9166d18 +size 1233958 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..7f8f5046df75f1df7c4549cc54f3f34d0a4db204 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bb05bbc0453a0e66970341dbe34ad36cc38d86464106ecb1f2f45b6b96239fd +size 901824 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..61d2cbd47f75986895450fc401289ab986e9bf05 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf210a9c852fdf8441f6987faaca00b7871d875971631588164cfa627ffbd363 +size 2091676 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..e0e63a039232067241053dec24a94030c5284b07 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1dbf152cf1feb0ed0b32ebc0e27324640c87c6c28a5f36340677265cec8a318 +size 2989420 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..3b40e3b16442462d50ff913ceb2984dbba99b45f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1e74bc627a1d4bd214edddc6f7a9f5642b4906b7bc0e2b3fce277897e30cdc3 +size 1190675 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..6c9d1e800e1ff840536f42f31e0bd3128d71582c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa1be329664f7ef1d6408d7c03466468bba640f5258f8526ed59ad4de502d54d +size 3178495 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split256.png new file mode 100644 index 0000000000000000000000000000000000000000..7427e45eb3c2c8ec3a04ff1b79d89e215d7e9e0f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e58bf44d85b3df7681a733fa8c1309e854db8b802ad6082bafd7cceedf585f5 +size 2979381 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..7427e45eb3c2c8ec3a04ff1b79d89e215d7e9e0f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e58bf44d85b3df7681a733fa8c1309e854db8b802ad6082bafd7cceedf585f5 +size 2979381 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..e99cc99ee3b3ad974e613f21b4fe4bf253205778 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bda0e7b588cea11876ebc45c21cc525f04fd543cd4000a1f51c26c04872755b9 +size 1038571 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..a6d24faa7fd5bbc8949f97404332124c1d1688f1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d528e9b0abc5ddb743cce4502df85e566061785456e4536d36379790d62db9ed +size 2131676 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..a2493f7fa9ae9cbd74ce79fc1542a00f5ff0744c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38a939ba6574ec24fc9e8ad71a6f12ac0c924687d9feefd9c08f06aa91c6800f +size 3129256 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..18d79bcbb1309fdd919ea621b3ea21445abc9dc3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01ddaeacd3beec2dce8f874b97a7994429c0514b25749b643ca8c1aae6bfbe8b +size 1359081 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..ebdfc0526eaf78ae246f670b2bc1af5603ff687e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9fe752eaca1cd6880bf51bea642899bdfa6ca5f8ac2eadce7274477dd5f7c25 +size 851525 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..8015c6059271a685fd682b97fb0d92f9c2006a51 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8237069e0f3cd52faa124acea9a4fb9987bf2618f5ade9a0c4da444e78529db9 +size 1930249 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..9dfcd706e47231a845c55e3859982ee99ff64045 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff526092708cb9a5c2274803d0ada31f9c73ee48a38cb4753c76d3c720a93fff +size 2789969 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..3d782efd4b5e5a032a4ac6ab0a51cf72bff5432c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:622ec8bc1e2d1c0130ce3a54b6d78b09a8238fc7e204b9a26c0279a212175715 +size 1066916 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..9dfcd706e47231a845c55e3859982ee99ff64045 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff526092708cb9a5c2274803d0ada31f9c73ee48a38cb4753c76d3c720a93fff +size 2789969 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..0bbe3e759aca9aee8793437c4fd300fe29d6aa46 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6029bcbd2ce045779865a9024d23c02198ce2670883e4729b878cb662fc0d4e +size 715736 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..2137986de3d2d1c7a6aae021721f8bfc2ee35f0f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be147216576707250032db1fe128f745a528e7425b0cb38edc355fc2b17a35f6 +size 1755573 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..f6d8087c4db60f097dda55794e6f0189efd7af3d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba2af5e2a8b225ea7d3358a1768d68a32da1dd6803827811dfc96d5a3439912c +size 2687475 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..1c93b927fc662bd981b4a5a7abb43b11e93fcaf6 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:502bcbf633c842a826f5c4b5dec89e9355a30c1a640040cc6da27560c6640aae +size 916957 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT.json new file mode 100644 index 0000000000000000000000000000000000000000..2f657d536dae0f18257a13fb4f520c6b3308d709 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT.json @@ -0,0 +1,83 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.524867832660675, + "cos_min": 0.3377029001712799, + "Q_argmax": 0.08237418532371521, + "argmax": 125, + "frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "episode": "demo_106", + "frame": 35 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5365025401115417, + "cos_min": 0.299778550863266, + "Q_argmax": 0.1695835292339325, + "argmax": 2, + "frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "episode": "demo_99", + "frame": 57 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.4966520369052887, + "cos_min": 0.3244275450706482, + "Q_argmax": 0.23481276631355286, + "argmax": 100, + "frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5494895577430725, + "cos_min": 0.41706663370132446, + "Q_argmax": 0.3141687214374542, + "argmax": 94, + "frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5404185652732849, + "cos_min": 0.30233705043792725, + "Q_argmax": 0.03459713235497475, + "argmax": 110, + "frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 198 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.png", + "n_states_rendered": 48, + "cos_mean": 0.5216715931892395, + "cos_min": 0.35494279861450195, + "Q_argmax": 0.02326813153922558, + "argmax": 123, + "frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "episode": "demo_171", + "frame": 244 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_dec.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_dec.json new file mode 100644 index 0000000000000000000000000000000000000000..9404e097e446a2747d1f69080f13a44ccac4b969 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_dec.json @@ -0,0 +1,97 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.524867832660675, + "cos_min": 0.3377029001712799, + "Q_argmax": 0.08237418532371521, + "argmax": 125, + "frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "episode": "demo_106", + "frame": 35 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5365025401115417, + "cos_min": 0.299778550863266, + "Q_argmax": 0.1695835292339325, + "argmax": 2, + "frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "episode": "demo_99", + "frame": 57 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4966520369052887, + "cos_min": 0.3244275450706482, + "Q_argmax": 0.23481276631355286, + "argmax": 100, + "frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5494895577430725, + "cos_min": 0.41706663370132446, + "Q_argmax": 0.3141687214374542, + "argmax": 94, + "frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5404185652732849, + "cos_min": 0.30233705043792725, + "Q_argmax": 0.03459713235497475, + "argmax": 110, + "frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 198 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5216715931892395, + "cos_min": 0.35494279861450195, + "Q_argmax": 0.02326813153922558, + "argmax": 123, + "frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "episode": "demo_171", + "frame": 244 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r84_mt2/ckpt.pt", + "pixdec_step": 40000, + "pixdec_res": 84, + "pixdec_task_index": 0, + "pixdec_tasks": [ + "two_piece_expert_play", + "square_expert_play" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_dec256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_dec256.json new file mode 100644 index 0000000000000000000000000000000000000000..a371bcdfb23ba6b47c04ff20c5dc2910b751c500 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_dec256.json @@ -0,0 +1,117 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.524867832660675, + "cos_min": 0.3377029001712799, + "Q_argmax": 0.08237418532371521, + "argmax": 125, + "frac_green": 0.01983642578125, + "root_res": 256, + "root_frame_gap": 1, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "episode": "demo_106", + "frame": 35 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5365025401115417, + "cos_min": 0.299778550863266, + "Q_argmax": 0.1695835292339325, + "argmax": 2, + "frac_green": 0.04156494140625, + "root_res": 256, + "root_frame_gap": 1, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "episode": "demo_99", + "frame": 57 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4966520369052887, + "cos_min": 0.3244275450706482, + "Q_argmax": 0.23481276631355286, + "argmax": 100, + "frac_green": 0.0885009765625, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5494895577430725, + "cos_min": 0.41706663370132446, + "Q_argmax": 0.3141687214374542, + "argmax": 94, + "frac_green": 0.167236328125, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5404185652732849, + "cos_min": 0.30233705043792725, + "Q_argmax": 0.03459713235497475, + "argmax": 110, + "frac_green": 0.01068115234375, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 198 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5216715931892395, + "cos_min": 0.35494279861450195, + "Q_argmax": 0.02326813153922558, + "argmax": 123, + "frac_green": 0.0001220703125, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "episode": "demo_171", + "frame": 244 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 4, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_r256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_r256.json new file mode 100644 index 0000000000000000000000000000000000000000..9950b8a74bc0c22689479a3e7230ef9a50ef3d52 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_r256.json @@ -0,0 +1,89 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.524867832660675, + "cos_min": 0.3377029001712799, + "Q_argmax": 0.08237418532371521, + "argmax": 125, + "frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "episode": "demo_106", + "frame": 35 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5365025401115417, + "cos_min": 0.299778550863266, + "Q_argmax": 0.1695835292339325, + "argmax": 2, + "frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "episode": "demo_99", + "frame": 57 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.4966520369052887, + "cos_min": 0.3244275450706482, + "Q_argmax": 0.23481276631355286, + "argmax": 100, + "frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5494895577430725, + "cos_min": 0.41706663370132446, + "Q_argmax": 0.3141687214374542, + "argmax": 94, + "frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5404185652732849, + "cos_min": 0.30233705043792725, + "Q_argmax": 0.03459713235497475, + "argmax": 110, + "frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "episode": "demo_102", + "frame": 198 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_r256.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5216715931892395, + "cos_min": 0.35494279861450195, + "Q_argmax": 0.02326813153922558, + "argmax": 123, + "frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "episode": "demo_171", + "frame": 244 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_split256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_split256.json new file mode 100644 index 0000000000000000000000000000000000000000..20e8567275859cb38e84d5c5a48d3e494d433f89 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_split256.json @@ -0,0 +1,87 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_split256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4966520369052887, + "cos_min": 0.3244275450706482, + "Q_argmax": 0.23481276631355286, + "argmax": 100, + "frac_green": 0.0885009765625, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_split256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5494895577430725, + "cos_min": 0.41706663370132446, + "Q_argmax": 0.3141687214374542, + "argmax": 94, + "frac_green": 0.167236328125, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4840308129787445, + "cos_min": 0.3590397238731384, + "Q_argmax": 0.920602560043335, + "argmax": 82, + "frac_green": 0.12005615234375, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "episode": "demo_18", + "frame": 96 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16_split256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5298522114753723, + "cos_min": 0.38784247636795044, + "Q_argmax": 0.5130337476730347, + "argmax": 64, + "frac_green": 0.14874267578125, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_136", + "frame": 154 + } + ], + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 4, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_split2b256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_split2b256.json new file mode 100644 index 0000000000000000000000000000000000000000..a28a1c4f4a85df0c968d64923e15487e75628b43 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/FIGREPORT_split2b256.json @@ -0,0 +1,147 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4966520369052887, + "cos_min": 0.3244275450706482, + "Q_argmax": 0.23481276631355286, + "argmax": 100, + "frac_green": 0.0885009765625, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6325943470001221, + "cos_min": 0.4796748459339142, + "Q_argmax": 0.624505877494812, + "argmax": 100, + "frac_green": 0.255859375, + "root_res": 256, + "root_frame_gap": 1, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "episode": "demo_80", + "frame": 25 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5188260078430176, + "cos_min": 0.44011572003364563, + "Q_argmax": 0.38457581400871277, + "argmax": 43, + "frac_green": 0.051513671875, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "episode": "demo_198", + "frame": 166 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4826529920101166, + "cos_min": 0.3411238491535187, + "Q_argmax": 0.704879105091095, + "argmax": 86, + "frac_green": 0.05419921875, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "episode": "demo_64", + "frame": 192 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5568655133247375, + "cos_min": 0.4303973913192749, + "Q_argmax": 0.32301434874534607, + "argmax": 77, + "frac_green": 0.15411376953125, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "episode": "demo_153", + "frame": 112 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.571831464767456, + "cos_min": 0.48536521196365356, + "Q_argmax": 0.5868167877197266, + "argmax": 34, + "frac_green": 0.1658935546875, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "episode": "demo_6", + "frame": 180 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4840308129787445, + "cos_min": 0.3590397238731384, + "Q_argmax": 0.920602560043335, + "argmax": 82, + "frac_green": 0.12005615234375, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "episode": "demo_18", + "frame": 96 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16_split2b256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5298522114753723, + "cos_min": 0.38784247636795044, + "Q_argmax": 0.5130337476730347, + "argmax": 64, + "frac_green": 0.14874267578125, + "root_res": 256, + "root_frame_gap": 0, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_136", + "frame": 154 + } + ], + "pixdec_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 4, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..7367defe00342cd0e6fc5fa0878e6b5fbc01bfa9 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fa2ed80d7fea7d50613e9700015eeac0370ef320e3513345146a9de3f36a56f +size 1047769 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..37ddef30735a25e885faf6d58b78d481cf2bba75 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1641eb6ece4a22bace56054bb8407c3a5fd326f718f021d745f5bb9bab19063 +size 2358140 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..5e683573cede43cc1c3e618d158704eaebbc9b1f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5973d997cbfa16e17957500a59dd373b4c3381d2e45270c9317d8f6dcbd75670 +size 3445569 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..1f200dbacf46eaf15ace7756c0483eab0032ab4a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b951845bba92f931f665c922d2700c269d3f7126c8b6e13e6026a42bded5ab21 +size 1290872 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..cd938ee9c2004befe646f4f8a852136a88ab1bb3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcb76b66b76c61a4a44b97794b9991f3c0a984e36bf3cc3f838ae614b79a2ba6 +size 1128722 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..373ac9c7df4c93b8e90cca5a0f4e4e4adb35368d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0b6c2969e8b1889915e8048b332319a2fef637a1b011273aa9bf984a9775f5a +size 2445928 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..c21b726533b8bea70c8527be8cdad669fe81af62 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcdbcff9a162e0ecf15c056ab1505278584d9d5ea832b9e9c33a4822ecd65f92 +size 3591762 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..5c37fa39e73ba66575a223e3370ee45d8f79d7f8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7f9d292658138563533965a10df432624b95370bf95680f24f8fec1dfc4aa461 +size 1391501 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..50ce7b64d307f1a718c452b298d31426597ae907 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90dbb4636e317c28d047af717d2cf2c9a2ab90ca6f65d10250804976574abf0d +size 1005703 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..1aa92560e07a95f986e4e34613a03585c5c8529a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b9ff2cf6738133f9986e54474da56263bcf623cde5c0b00c9377f48568f8a7e +size 2236278 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..f5eea2352926f1a8651633f0a82fa578915c2cdd --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3f3a51a6c7d90e8410d3209ad33871ca390aa72b090d2308395b76bdaac8e29 +size 3341502 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..778d93733c0abea046af355d765b206500a5dc14 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:341bd482dc35a9b69786ba8d64cc4b9d513b7a326f5b22c1838d02dba3c91f70 +size 1246443 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16_split256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16_split256.png new file mode 100644 index 0000000000000000000000000000000000000000..0c3773786c3772a19fe3d16959652088cc6b1f33 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16_split256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0daf805040126c664fcdd8dad1a8da073a4c6a3757d9c86f389d49a489df176 +size 3566355 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..222a8b904f31c97e912203925a0d072a85127911 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:087a826bde3fad7b517652dcb51ed5127d1a439bca702e576d9a27aa032f9006 +size 1102455 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..95f907c0f39661c9e5d887d682d9c5d6abff08b4 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a45563c07a9481bc4af0a9bcfc694d707fd0fd73367edd7cb41772da1ee311e +size 2340111 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..ee7b07e5fbf2ed9636503b24da9230f7a332f2ae --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abaf2635a303c11f41fad11ba0fd1977bcac3ba44dc3b5d0f5e1f60a86f599d4 +size 3406538 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..4b016819c49e9fb327c3635f08a065c467282546 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:529edeab5ba48240c6894b129422e7095572b29af42ec8d699ac9ff4db7b7143 +size 1363096 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..92d1fc2fed6f2a0ee243d1d59cf7d862ee7f35ab --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75dc91a79b83f42133f1effc330e7fb21d17ce2be3f9e08eab4bbd9f0a81bd21 +size 3559334 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..0d83378d84029466709d1ecb7abbc3d06f367ede --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff3ff15c1c1fde2532b2a9d4bec63cf33a2a9ffb26b00fc84561139645ac9400 +size 948203 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..daad1fe030c4b160af21e873c2cdb36de56b89cf --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75f4a4efd69c4b85a9053daec18c4ea854cceec9275c3d1bc767b131181ca72a +size 2211170 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..2672f3be6c82d489638b83a99e181474161649d9 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d08faf356e95ba3699a1c0088259e596f8196041e92889908ea5fca1c714df0e +size 3242247 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..0945f6a4caab1762538e0f23413c3e48b3bacc12 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5609f1692a24fd9d9bcc4004b6a7ad02617ea936ba589999c0c58fb0e1b5c517 +size 1187282 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split256.png new file mode 100644 index 0000000000000000000000000000000000000000..e712b09debfce03bb45aba5361df0d5610d10b14 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:109994cf162045e3a7000ac610ed8d244268706f165a5df803af4eb9302197b0 +size 3043158 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..8e60a1e1019a01d73544c6defb6474d2210e9260 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a463c1eb1f507fa299cf9271daa73b272a73213e68e22b404361790283e50b5 +size 2944609 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..6892e1a10498b5dfde762a4d936c52824fb3aed7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:781792e2d2c4040979d18e76b1e026848dc54c2f954c2fbe838f9d7db8e14676 +size 2975699 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..44b590956a0a561847db33aedc0054e5168953c8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0051d0534b525d880e9c390ea89645863af5210c99688ae7308b5b6270d7cb6b +size 3475139 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16_split2b256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16_split2b256.png new file mode 100644 index 0000000000000000000000000000000000000000..725c471a7028bf94902aab2534e2a3d62002a7b5 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16_split2b256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7ae0659aff79c5e654268dc7484b626434cfd939bf160f41ef541a880e872ae9 +size 3901737 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.png new file mode 100644 index 0000000000000000000000000000000000000000..30339d8742e0baf4a39dedf875757a839be7f3ad --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f1adf3db58562623fa79cfd8b1620e890f8526aea0c4bb39bb10efcc0b5c921 +size 1160544 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec.png new file mode 100644 index 0000000000000000000000000000000000000000..8ac29ae3c5a684e5ac82be41664dd243d222fd13 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc9937a125d2307581b56fb50e7068843fca71d9040766b2e1daeded89144d5d +size 2532512 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..2b8c73d5860ec889731ca8e02525a4132ab960c0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f07ab4631ee08073e8588b5f41fcd7abab7587f7d9fcd91326a02f69221eea7c +size 3740622 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_r256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_r256.png new file mode 100644 index 0000000000000000000000000000000000000000..ac5906e9dd51c87e049c085252520e9364756c51 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_r256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28bf718f8cab07ecd06299db5bebf002eac2e9d7c3fcac486e18d21c4719f5d6 +size 1465807 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/FIGREPORT_dec256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/FIGREPORT_dec256.json new file mode 100644 index 0000000000000000000000000000000000000000..b9793407faaa6ba03b53fc075d61c2f305382696 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/FIGREPORT_dec256.json @@ -0,0 +1,126 @@ +{ + "calibration": { + "random_mean": 0.0006704948027618229, + "random_p95": 0.43318495750427244, + "adjacent_mean": 0.9152112007141113, + "adjacent_p05": 0.8387983560562133, + "n": 4000 + }, + "readout": "fold", + "chain_cap": 0, + "show_hops": "", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4646516740322113, + "cos_min": 0.31158554553985596, + "Q_argmax": 0.09135352820158005, + "argmax": 74, + "frac_green": 0.0179443359375, + "root_res": 256, + "root_frame_gap": 0, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16", + "episode": "demo_459", + "frame": 32 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.44933438301086426, + "cos_min": 0.3743894398212433, + "Q_argmax": 4.292724042898044e-06, + "argmax": 36, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 0, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16", + "episode": "demo_510", + "frame": 54 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.38801082968711853, + "cos_min": 0.19910570979118347, + "Q_argmax": 0.7203031182289124, + "argmax": 90, + "frac_green": 0.28790283203125, + "root_res": 256, + "root_frame_gap": 0, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16", + "episode": "demo_433", + "frame": 82 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.37519755959510803, + "cos_min": 0.27375656366348267, + "Q_argmax": 3.890599691658281e-05, + "argmax": 60, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 1, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16", + "episode": "demo_695", + "frame": 99 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.4851588308811188, + "cos_min": 0.3083924949169159, + "Q_argmax": 2.3087155644419205e-15, + "argmax": 10, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 1, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16", + "episode": "demo_209", + "frame": 155 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.500406801700592, + "cos_min": 0.3622310757637024, + "Q_argmax": 0.001139413914643228, + "argmax": 106, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 0, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16", + "episode": "demo_239", + "frame": 258 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 5, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..99524f3ba40112cc94b61ffee3f4b77baea5603c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27cacf175493bf62948966f21bb8747a911159e8c5853c5590579cc6a09205f6 +size 3832296 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..ebb88667b2efe3a7296b959c8b2c723cec53f3a7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c661578ba85126528b6f64f7a9400e3459ebc8e5483ba1ea6fdc8487959291e4 +size 3965258 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..6f169d414acf1aae9f005fdaef54bcfc48a7822f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd56ca0e0864f71df466ede41c5e7557cf044f1672aa499f2ee3ac461fe48c63 +size 3595851 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..168e03c20fba91215565851af2ef4bb7aa22a158 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6a2507e2dc6f7e4127a872fb7a9657be1824040b07425c62ad55d9dd642a522 +size 3383077 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..bf194486ad071aa86c4f60752776d74b03fc617e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88006308e40def4e868894b0d70f5e74cfdb8876b992cde63790ec154169ec9f +size 3264061 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..9e9c7a0fbc4e9ec85751e86e5c4ce405490970f3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c01b65c4a041fe15d7dd1bc8e9bee3f14f665b935022710a566593f6e209f64c +size 3689624 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/FIGREPORT_dec256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/FIGREPORT_dec256.json new file mode 100644 index 0000000000000000000000000000000000000000..c3a048f12c2dda40f9a9beb53197d7904f72bcb3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/FIGREPORT_dec256.json @@ -0,0 +1,180 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "readout": "chain", + "chain_cap": 0, + "show_hops": "0,1,2,3,4,5,6,7", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5777202248573303, + "cos_min": 0.3440057337284088, + "Q_argmax": 0.00829036387444866, + "argmax": 11, + "frac_green": 0.010627297794117647, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 21, + "Q_fold_max": 0.03605642542243004, + "Q_fold_at_chain_argmax": 0.015075964853167534, + "Q_chain_max": 0.00829036387444866, + "Q_chain_min": 0.0, + "argmax_changed": true, + "fold_rank_of_chain_argmax": 56, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "episode": "demo_102", + "frame": 145 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.637362003326416, + "cos_min": 0.44993269443511963, + "Q_argmax": 0.009514686738628882, + "argmax": 98, + "frac_green": 0.007927389705882353, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 15, + "Q_fold_max": 0.0183305311948061, + "Q_fold_at_chain_argmax": 0.018118781968951225, + "Q_chain_max": 0.009514686738628882, + "Q_chain_min": 0.0, + "argmax_changed": true, + "fold_rank_of_chain_argmax": 11, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16", + "episode": "demo_110", + "frame": 104 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.612116813659668, + "cos_min": 0.3927253186702728, + "Q_argmax": 0.011413072618303363, + "argmax": 64, + "frac_green": 0.0016371783088235295, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 64, + "Q_fold_max": 0.055225882679224014, + "Q_fold_at_chain_argmax": 0.055225882679224014, + "Q_chain_max": 0.011413072618303363, + "Q_chain_min": 1.178636411386598e-17, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "episode": "demo_160", + "frame": 165 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5871084928512573, + "cos_min": 0.47005027532577515, + "Q_argmax": 0.014179221622859011, + "argmax": 123, + "frac_green": 0.0032312729779411763, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 123, + "Q_fold_max": 0.07260427623987198, + "Q_fold_at_chain_argmax": 0.07260427623987198, + "Q_chain_max": 0.014179221622859011, + "Q_chain_min": 0.0, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "episode": "demo_221", + "frame": 249 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.6470097899436951, + "cos_min": 0.5655526518821716, + "Q_argmax": 0.4385806195537324, + "argmax": 45, + "frac_green": 0.04299747242647059, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 45, + "Q_fold_max": 0.6419798135757446, + "Q_fold_at_chain_argmax": 0.6419798135757446, + "Q_chain_max": 0.4385806195537324, + "Q_chain_min": 8.056578183321293e-27, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5852065682411194, + "cos_min": 0.44085973501205444, + "Q_argmax": 0.2136088127247271, + "argmax": 27, + "frac_green": 0.030086741727941176, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 27, + "Q_fold_max": 0.30500614643096924, + "Q_fold_at_chain_argmax": 0.30500614643096924, + "Q_chain_max": 0.2136088127247271, + "Q_chain_min": 9.933510680700101e-26, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "episode": "demo_84", + "frame": 390 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 2, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/FIGREPORT_foldsame.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/FIGREPORT_foldsame.json new file mode 100644 index 0000000000000000000000000000000000000000..947b9ea8e00e18b39a6b8c653f45dde98b62df5e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/FIGREPORT_foldsame.json @@ -0,0 +1,110 @@ +{ + "calibration": { + "random_mean": -0.0027384082786738873, + "random_p95": 0.4123949319124221, + "adjacent_mean": 0.9334986805915833, + "adjacent_p05": 0.8684449046850204, + "n": 4000 + }, + "readout": "fold", + "chain_cap": 0, + "show_hops": "0,1,2,3,4,5,6,7", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5800162553787231, + "cos_min": 0.3440057337284088, + "Q_argmax": 0.03605642542243004, + "argmax": 21, + "frac_green": 0.010627297794117647, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "episode": "demo_102", + "frame": 145 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.6379320025444031, + "cos_min": 0.449512243270874, + "Q_argmax": 0.0183305311948061, + "argmax": 15, + "frac_green": 0.007927389705882353, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16", + "episode": "demo_110", + "frame": 104 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.6123597621917725, + "cos_min": 0.3938414454460144, + "Q_argmax": 0.055225882679224014, + "argmax": 64, + "frac_green": 0.0016371783088235295, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "episode": "demo_160", + "frame": 165 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5835912823677063, + "cos_min": 0.47005027532577515, + "Q_argmax": 0.07260427623987198, + "argmax": 123, + "frac_green": 0.0032312729779411763, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "episode": "demo_221", + "frame": 249 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.6470097899436951, + "cos_min": 0.5655526518821716, + "Q_argmax": 0.6419798135757446, + "argmax": 45, + "frac_green": 0.04299747242647059, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "episode": "demo_36", + "frame": 56 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5813038945198059, + "cos_min": 0.4542798399925232, + "Q_argmax": 0.30500614643096924, + "argmax": 27, + "frac_green": 0.030086741727941176, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "episode": "demo_84", + "frame": 390 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..886a11e8060b83c6e911dc999eb265419661a7af --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8802f77a4ea9cd1f270194b090391fb2f347a13df03863589f6c0b0b6f3d9f1e +size 3177839 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..2db38e4f78ed222bcada96a321d98dff52e3768e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fdfdddce399024e39d52a948c78e244432a11f5f10c614bf25fb3718a53f426 +size 3144621 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..ed4ef6312938caf778e82e7d275a05379c05c4f7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3145f9622b9752015b9ffb3cae8adf50831bf0035a92a8060be17d630ac874b +size 2998326 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..dc985f2ab3dd4ee377104a83e3b53f0123ba2153 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ba4cb210e36ed608155db5e7fb2a94faedf1f47659cc39b8c7d5358ffafb87b1 +size 2873880 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..0a6e42398767aa6d28f6981a0b687ac26ce1f9b1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e3926a148096db89142b4812e7642a18a66f12a7dab018c31ebfad1b7f5894e +size 2885933 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..4a13c757ed9460c6347ade93b473a6c9060ddb98 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7041275b4d23947f7b03f3da22a44e32c3b779a11fc7b56cc86c58b63584c26 +size 2707907 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/FIGREPORT_dec256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/FIGREPORT_dec256.json new file mode 100644 index 0000000000000000000000000000000000000000..ee76fddb897da02c99eb0961f3562be0124255e0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/FIGREPORT_dec256.json @@ -0,0 +1,180 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "readout": "chain", + "chain_cap": 0, + "show_hops": "0,1,2,3,4,5,6,7", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5510827898979187, + "cos_min": 0.30709487199783325, + "Q_argmax": 0.009471912863120619, + "argmax": 9, + "frac_green": 0.007510914522058824, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 9, + "Q_fold_max": 0.033906303346157074, + "Q_fold_at_chain_argmax": 0.033906303346157074, + "Q_chain_max": 0.009471912863120619, + "Q_chain_min": 1.7553465932336537e-21, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16", + "episode": "demo_102", + "frame": 198 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5245897769927979, + "cos_min": 0.35297536849975586, + "Q_argmax": 0.027697024873664756, + "argmax": 52, + "frac_green": 0.009061925551470588, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 53, + "Q_fold_max": 0.07148945331573486, + "Q_fold_at_chain_argmax": 0.06864148378372192, + "Q_chain_max": 0.027697024873664756, + "Q_chain_min": 0.008783467248844488, + "argmax_changed": true, + "fold_rank_of_chain_argmax": 1, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "episode": "demo_106", + "frame": 35 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.528193473815918, + "cos_min": 0.40487977862358093, + "Q_argmax": 0.07801508557984022, + "argmax": 27, + "frac_green": 0.023566750919117647, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 27, + "Q_fold_max": 0.22942568361759186, + "Q_fold_at_chain_argmax": 0.22942568361759186, + "Q_chain_max": 0.07801508557984022, + "Q_chain_min": 0.02708719599288887, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5491414666175842, + "cos_min": 0.4673139452934265, + "Q_argmax": 0.15502184900486554, + "argmax": 27, + "frac_green": 0.048095703125, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 27, + "Q_fold_max": 0.3009323179721832, + "Q_fold_at_chain_argmax": 0.3009323179721832, + "Q_chain_max": 0.15502184900486554, + "Q_chain_min": 0.11124101522189014, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5124043822288513, + "cos_min": 0.3608575165271759, + "Q_argmax": 0.0018476361945262093, + "argmax": 97, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 97, + "Q_fold_max": 0.009862987324595451, + "Q_fold_at_chain_argmax": 0.009862987324595451, + "Q_chain_max": 0.0018476361945262093, + "Q_chain_min": 4.059427951735848e-07, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16", + "episode": "demo_171", + "frame": 244 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5366660952568054, + "cos_min": 0.32871001958847046, + "Q_argmax": 0.03605255015170039, + "argmax": 58, + "frac_green": 0.009952320772058824, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 58, + "Q_fold_max": 0.17017507553100586, + "Q_fold_at_chain_argmax": 0.17017507553100586, + "Q_chain_max": 0.03605255015170039, + "Q_chain_min": 0.01699233471006449, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16", + "episode": "demo_99", + "frame": 57 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 4, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/FIGREPORT_foldsame.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/FIGREPORT_foldsame.json new file mode 100644 index 0000000000000000000000000000000000000000..16c8369f54b8e26edba63cee623d438475df563f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/FIGREPORT_foldsame.json @@ -0,0 +1,110 @@ +{ + "calibration": { + "random_mean": 0.0007000681362114847, + "random_p95": 0.4114921122789375, + "adjacent_mean": 0.9132151007652283, + "adjacent_p05": 0.8353208065032959, + "n": 4000 + }, + "readout": "fold", + "chain_cap": 0, + "show_hops": "0,1,2,3,4,5,6,7", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5425707101821899, + "cos_min": 0.30709487199783325, + "Q_argmax": 0.033906303346157074, + "argmax": 9, + "frac_green": 0.007510914522058824, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16", + "episode": "demo_102", + "frame": 198 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5274612307548523, + "cos_min": 0.35781750082969666, + "Q_argmax": 0.07148945331573486, + "argmax": 53, + "frac_green": 0.009061925551470588, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "episode": "demo_106", + "frame": 35 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5260270237922668, + "cos_min": 0.4152446389198303, + "Q_argmax": 0.22942568361759186, + "argmax": 27, + "frac_green": 0.023566750919117647, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "episode": "demo_129", + "frame": 84 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.544492244720459, + "cos_min": 0.4146212935447693, + "Q_argmax": 0.3009323179721832, + "argmax": 27, + "frac_green": 0.048095703125, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "episode": "demo_143", + "frame": 154 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5124043822288513, + "cos_min": 0.3608575165271759, + "Q_argmax": 0.009862987324595451, + "argmax": 97, + "frac_green": 0.0, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16", + "episode": "demo_171", + "frame": 244 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5380250811576843, + "cos_min": 0.32871001958847046, + "Q_argmax": 0.17017507553100586, + "argmax": 58, + "frac_green": 0.009952320772058824, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16", + "episode": "demo_99", + "frame": 57 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..d9ce11fd885cb003317fdc237b7288b109ac0e03 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:555cb591e03a907cd6559c28118638868533ffe0dcfc2c6868192c765dd9e66d +size 3511186 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..671002c2dc566117aae60c42a1ffab08b27ce858 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f42839d8eb3086b85cbbdbb571a91e477a39cdfc7e6753a337fa855016da6cff +size 3682080 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..95731433f4c7189f8fae92cff6446bccadd62a93 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64218a2a3f1905d524eea1009d4d5aa291c4d829d3a46ad5b2f035a3e7190c19 +size 3492376 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..10acca114545929f5dc512c826b7f4fc8cc48231 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f0c110ef50c1919a20a6482938f10b9845dbbfb9d27f33c3a65bae71ae491e3 +size 3319758 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..05058c9b2ec5eecfe3ae21a139670887b6225749 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:719926b1c04c0593c3b4deed1c8661d598c34c491624952311b1b33064903c75 +size 3254683 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..2854891aad3b233d25cd69aa3725cb22a52f61e2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c73f5f807d392d0543600d643ccaf4cd2b796c2c6ebd98bf0f09229b3f1f5486 +size 3753393 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/FIGREPORT_dec256.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/FIGREPORT_dec256.json new file mode 100644 index 0000000000000000000000000000000000000000..5f92d11837074f7e2d4ff96a20dbabd385a2ec26 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/FIGREPORT_dec256.json @@ -0,0 +1,180 @@ +{ + "calibration": { + "random_mean": 0.0006704948027618229, + "random_p95": 0.43318495750427244, + "adjacent_mean": 0.9152112007141113, + "adjacent_p05": 0.8387983560562133, + "n": 4000 + }, + "readout": "chain", + "chain_cap": 0, + "show_hops": "0,1,2,3,4,5,6,7", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.45725297927856445, + "cos_min": 0.31158554553985596, + "Q_argmax": 0.05448394466283268, + "argmax": 39, + "frac_green": 0.03825827205882353, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 74, + "Q_fold_max": 0.10974343866109848, + "Q_fold_at_chain_argmax": 0.09725961089134216, + "Q_chain_max": 0.05448394466283268, + "Q_chain_min": 0.0052138442083202894, + "argmax_changed": true, + "fold_rank_of_chain_argmax": 42, + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16", + "episode": "demo_459", + "frame": 32 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.44933438301086426, + "cos_min": 0.3743894398212433, + "Q_argmax": 8.238552090063737e-07, + "argmax": 36, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 36, + "Q_fold_max": 4.292724042898044e-06, + "Q_fold_at_chain_argmax": 4.292724042898044e-06, + "Q_chain_max": 8.238552090063737e-07, + "Q_chain_min": 3.066650252621425e-07, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16", + "episode": "demo_510", + "frame": 54 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.38691532611846924, + "cos_min": 0.2007880061864853, + "Q_argmax": 0.35196247345979537, + "argmax": 33, + "frac_green": 0.12583295036764705, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 90, + "Q_fold_max": 0.7207865118980408, + "Q_fold_at_chain_argmax": 0.71656733751297, + "Q_chain_max": 0.35196247345979537, + "Q_chain_min": 0.235066574306464, + "argmax_changed": true, + "fold_rank_of_chain_argmax": 5, + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16", + "episode": "demo_433", + "frame": 82 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.3928144872188568, + "cos_min": 0.2589797079563141, + "Q_argmax": 0.00013123682328650618, + "argmax": 99, + "frac_green": 4.3083639705882356e-05, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 99, + "Q_fold_max": 0.0005022355471737683, + "Q_fold_at_chain_argmax": 0.0005022355471737683, + "Q_chain_max": 0.00013123682328650618, + "Q_chain_min": 1.0253198231200892e-19, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16", + "episode": "demo_695", + "frame": 99 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.467327356338501, + "cos_min": 0.30832764506340027, + "Q_argmax": 1.2287171202468881e-14, + "argmax": 115, + "frac_green": 0.0, + "root_res": 256, + "root_frame_gap": 1, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 115, + "Q_fold_max": 8.725619781834587e-14, + "Q_fold_at_chain_argmax": 8.725619781834587e-14, + "Q_chain_max": 1.2287171202468881e-14, + "Q_chain_min": 1.816697432878746e-37, + "argmax_changed": false, + "fold_rank_of_chain_argmax": 0, + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16", + "episode": "demo_209", + "frame": 155 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png", + "renderer": "retrieval+decoder", + "n_states_rendered": 48, + "cos_mean": 0.5193117260932922, + "cos_min": 0.36785152554512024, + "Q_argmax": 0.0031123731311620195, + "argmax": 36, + "frac_green": 0.00014361213235294118, + "root_res": 256, + "root_frame_gap": 0, + "readout": "chain", + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_fold_argmax": 83, + "Q_fold_max": 0.012296292930841446, + "Q_fold_at_chain_argmax": 0.012114141136407852, + "Q_chain_max": 0.0031123731311620195, + "Q_chain_min": 1.6621967234329734e-27, + "argmax_changed": true, + "fold_rank_of_chain_argmax": 3, + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16", + "episode": "demo_239", + "frame": 258 + } + ], + "pixdec_ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "pixdec_step": 60000, + "pixdec_res": 256, + "pixdec_task_index": 5, + "pixdec_tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/FIGREPORT_foldsame.json b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/FIGREPORT_foldsame.json new file mode 100644 index 0000000000000000000000000000000000000000..8084e232d833e5efb8d7ecc35c8a0eb517e0a2ef --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/FIGREPORT_foldsame.json @@ -0,0 +1,110 @@ +{ + "calibration": { + "random_mean": 0.0006704948027618229, + "random_p95": 0.43318495750427244, + "adjacent_mean": 0.9152112007141113, + "adjacent_p05": 0.8387983560562133, + "n": 4000 + }, + "readout": "fold", + "chain_cap": 0, + "show_hops": "0,1,2,3,4,5,6,7", + "figures": [ + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.4646516740322113, + "cos_min": 0.31158554553985596, + "Q_argmax": 0.10974343866109848, + "argmax": 74, + "frac_green": 0.03825827205882353, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16", + "episode": "demo_459", + "frame": 32 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.44933438301086426, + "cos_min": 0.3743894398212433, + "Q_argmax": 4.292724042898044e-06, + "argmax": 36, + "frac_green": 0.0, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16", + "episode": "demo_510", + "frame": 54 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.3882337808609009, + "cos_min": 0.19910570979118347, + "Q_argmax": 0.7207865118980408, + "argmax": 90, + "frac_green": 0.12583295036764705, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16", + "episode": "demo_433", + "frame": 82 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.38762402534484863, + "cos_min": 0.2829619348049164, + "Q_argmax": 0.0005022355471737683, + "argmax": 99, + "frac_green": 4.3083639705882356e-05, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16", + "episode": "demo_695", + "frame": 99 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.46718716621398926, + "cos_min": 0.3089591860771179, + "Q_argmax": 8.725619781834587e-14, + "argmax": 115, + "frac_green": 0.0, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16", + "episode": "demo_209", + "frame": 155 + }, + { + "png": "/proj/dmfexp/zwhong/rsm_rise/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_foldsame.png", + "renderer": "retrieval", + "n_states_rendered": 48, + "cos_mean": 0.5141634941101074, + "cos_min": 0.3319961428642273, + "Q_argmax": 0.012296292930841446, + "argmax": 83, + "frac_green": 0.00014361213235294118, + "root_res": 84, + "root_frame_gap": null, + "readout": "fold", + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16", + "episode": "demo_239", + "frame": 258 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..3bc6223efec131765017c0cd3a2b64dbd08eb712 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e165390fca6dd5b3fef7961cd3d0239c44adb3403e4107b6acf182a23e5cc11d +size 3824825 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_foldsame.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_foldsame.png new file mode 100644 index 0000000000000000000000000000000000000000..cc7920411c23c3a96e7a679941e5f938a501c3a3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_foldsame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:365cf0cd5da7ac5df689f71f13e09ee21d31bb9bc5365d4cfd7b4cf4dcdbefce +size 1159504 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..86d3f742b2e032c18dfc6cfc6478fb63c17f14d7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be96e78a24c369c20bb28c844e461cab38ad44de18221de0d78d677bc7ae59f9 +size 4044583 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_foldsame.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_foldsame.png new file mode 100644 index 0000000000000000000000000000000000000000..14a5d659f076fad520838afbeda01dc6690c5ef0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_foldsame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c6fc67cbc852c606f5595621993426badfd2e71132a9c323ca9bae115dc1821 +size 1281007 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..552c143b76af44f286871cc6dd197064d3acaa44 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91d6e301d6289baeede533c5c168b0265d12a9d5ffa14912ec65ec1ee01b0637 +size 3587627 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_foldsame.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_foldsame.png new file mode 100644 index 0000000000000000000000000000000000000000..26e8ebb3a7930957a775c31fbb7e8162f1a66721 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_foldsame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7efdc4d4088b7f597abb9866a1095e287a529677ee5a55c474c6f538022e4d4 +size 1094218 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..9827d3b56c9d077f30584e27239c7bd7ffb83dc1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7dde4fe8613bc2d55ec9499b3b6196ff04f605d933af00edb0414b00fd0d895 +size 3427789 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_foldsame.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_foldsame.png new file mode 100644 index 0000000000000000000000000000000000000000..183304a76626421dfa79b022144e6c3b925baff2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_foldsame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3449f7a4b5dad6ab036eaa20259b8c90f30ece2da6893a9c3539638b55981f6e +size 1065726 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..f786fdf5bc68fd3da9ab0db439eac566239b02e0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7be7664ffa068b507e1959c2ef6abf27eb60ce70df1da8781236cf2f560160b +size 3298538 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_foldsame.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_foldsame.png new file mode 100644 index 0000000000000000000000000000000000000000..978d11df60ce11dea433fdd01bce4e7581fbdbcc --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_foldsame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce75b757e6416d64a5fb912845a65fcd201ca6d46a70421474637510e258a95a +size 954459 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png new file mode 100644 index 0000000000000000000000000000000000000000..2cd5ef4c120ea3464f5c29e69477705b60179864 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5699cc605a1ec7cff67bf7e13889f8d25f663c5a3a29ebb8506c9262e1d931d +size 3893623 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_foldsame.png b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_foldsame.png new file mode 100644 index 0000000000000000000000000000000000000000..aa113747b19b0223aefc315c8f7ebb4f37ca8bd1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/figs/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_foldsame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ac826e294dd82cfa5c4f4a4d67a0f22f09ccd61a0e24f04d9474371cae5fe79 +size 1166448 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/notes/RSM_PLANNING_SPEC.tex b/gen_q_rsm/rsm_rise/pipeline/docs/notes/RSM_PLANNING_SPEC.tex new file mode 100644 index 0000000000000000000000000000000000000000..916041fb608affd4fbc82bd50f5a5fe1c04fe36a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/notes/RSM_PLANNING_SPEC.tex @@ -0,0 +1,28 @@ +% OWNER-SUPPLIED SPEC (2026-09-22 20:45 UTC). This is the reference statement of the planning algorithm that our +% implementations must conform to. Janner et al. 2020 (gamma-models) Theorem 1, strictly-future convention. +% +% M_eta^pi := (1-eta) sum_{t>=1} eta^{t-1} (P^pi)^t [strictly future: t >= 1] +% M_gamma^pi = sum_{k>=1} w_k (M_beta^pi)^k, w_k = (1-gamma)(gamma-beta)^{k-1} / (1-beta)^k +% => geometric stopping with CONTINUATION probability +% p = (gamma - beta) / (1 - beta), 1 - p = (1 - gamma)/(1 - beta) [strictly future] +% E[J] = (1-beta)/(1-gamma) queries. +% +% RecursiveSample(s,a; beta,gamma,L): +% x <- s, u <- a +% repeat: x' ~ dhat_theta(. | x, u, beta) +% with prob 1-p: RETURN x' +% else: x <- x', u ~ pi(. | x) [pi = the policy represented by the successor model] +% cap at L queries; if the cap is reached RETURN THE LAST SAMPLED STATE. +% Stopping decisions are independent of the model samples. +% +% Action selection: draw N candidates a_1..a_N ~ pi_prop(.|s); for each candidate run M INDEPENDENT chains, each +% restarted from (s,a_j): Z_ij <- RecursiveSample(s,a_j; beta,gamma,L) +% S(s,a_j) = 1/(M (1-gamma)) * sum_i rhat(Z_ij) [ONLY the returned state's reward; no sum over hops] +% a* = argmax_j S(s,a_j); execute, replan, successor model fixed. +% +% OWNER'S NOTE ON THE CONVENTION DIFFERENCE (accepted, not a defect): +% "it's okay if we basically did this but the stopping probability is different by /gamma because we included +% s_t instead of starting at s_t+1" +% i.e. our time-zero convention (the successor draw admits k = 0) gives p = (gamma-beta)/(gamma(1-beta)), +% exactly 1/gamma times the strictly-future p above. Both are correct IN THEIR OWN CONVENTION; what must be +% verified is that the TRAINING target and the EVAL chain use the SAME convention. diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/real_proposal_report.pdf b/gen_q_rsm/rsm_rise/pipeline/docs/real_proposal_report.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cb0b967596d59097a210bda205fae5cb58c781db --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/real_proposal_report.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb9c0d58c98465979bec649cd1763c370611f1759191f7d48746a8c37e759e46 +size 213956 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/real_reward_study.pdf b/gen_q_rsm/rsm_rise/pipeline/docs/real_reward_study.pdf new file mode 100644 index 0000000000000000000000000000000000000000..540cef6171203b35f97545cf73bc536f0acc156c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/real_reward_study.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f269b0d6745425c364f36bfbdfb00a51014ed653663c17025d617044e775846 +size 2642139 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/real_successor_report.pdf b/gen_q_rsm/rsm_rise/pipeline/docs/real_successor_report.pdf new file mode 100644 index 0000000000000000000000000000000000000000..55fdbe76d5e6172eed6c7b857c78a7e9587376eb Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/docs/real_successor_report.pdf differ diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_d3_2x2.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_d3_2x2.tex new file mode 100644 index 0000000000000000000000000000000000000000..d22a780ef3637a264ee6aa9baa57598194490b6f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_d3_2x2.tex @@ -0,0 +1,24 @@ +\begin{tabular}{lrrrrr}\hline +head & draw & top1-rew. & per-anchor AUC & frac$>$0.5 & pooled AUC\\\hline +ft\_v5 (trunk s0 x rng s0) & 12345 & 0.094 & 0.420 & 0.266 & 0.464\\ +ft\_v5 (trunk s0 x rng s0) & 777 & 0.094 & 0.457 & 0.406 & 0.471\\ +ft\_v5 (trunk s0 x rng s0) & 999 & 0.094 & 0.434 & 0.438 & 0.464\\ +ft\_v5\_x10 (trunk s0 x rng s1) & 12345 & 0.125 & 0.287 & 0.109 & 0.391\\ +ft\_v5\_x10 (trunk s0 x rng s1) & 777 & 0.031 & 0.339 & 0.234 & 0.392\\ +ft\_v5\_x10 (trunk s0 x rng s1) & 999 & 0.047 & 0.276 & 0.141 & 0.376\\ +ft\_v5\_x01 (trunk s1 x rng s0) & 12345 & 0.719 & 0.814 & 0.891 & 0.647\\ +ft\_v5\_x01 (trunk s1 x rng s0) & 777 & 0.703 & 0.799 & 0.953 & 0.632\\ +ft\_v5\_x01 (trunk s1 x rng s0) & 999 & 0.688 & 0.782 & 0.891 & 0.654\\ +ft\_v5\_s1 (trunk s1 x rng s1) & 12345 & 0.578 & 0.867 & 0.984 & 0.571\\ +ft\_v5\_s1 (trunk s1 x rng s1) & 777 & 0.594 & 0.830 & 0.969 & 0.560\\ +ft\_v5\_s1 (trunk s1 x rng s1) & 999 & 0.562 & 0.769 & 0.938 & 0.554\\ +R\_M shipped (provenance, no ft) & 12345 & 0.203 & 0.399 & 0.312 & 0.445\\ +R\_M shipped (provenance, no ft) & 777 & 0.312 & 0.400 & 0.344 & 0.434\\ +R\_M shipped (provenance, no ft) & 999 & 0.344 & 0.384 & 0.328 & 0.408\\ +R\_M\_s1 shipped & 12345 & 0.172 & 0.326 & 0.156 & 0.407\\ +R\_M\_s1 shipped & 777 & 0.344 & 0.327 & 0.172 & 0.419\\ +R\_M\_s1 shipped & 999 & 0.328 & 0.310 & 0.219 & 0.400\\ +R\_RW\_v0 from scratch (dataset rule) & 12345 & 0.328 & 0.758 & 0.953 & 0.539\\ +R\_RW\_v0 from scratch (dataset rule) & 777 & 0.375 & 0.695 & 0.922 & 0.526\\ +R\_RW\_v0 from scratch (dataset rule) & 999 & 0.469 & 0.681 & 0.906 & 0.521\\ +\hline\end{tabular} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_decisive.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_decisive.tex new file mode 100644 index 0000000000000000000000000000000000000000..3a6118d3d81e5f1d9792ea880c3eeaa5520dfe68 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_decisive.tex @@ -0,0 +1,134 @@ +\clearpage +\section{The decisive test: can stitching be shown under this reward?}\label{sec:decisive} +The corpus has exactly the structure a stitching demonstration needs. State 2 (\emph{pan on stove, +tomato at its initial position}) is visited by three different routes: route 2 (\texttt{0->2->3}), route 3 +(\texttt{2->3->4}, the \emph{only} rewarded route) and route 4 (\texttt{0->2->6}, a failure). So from one +junction state the data contains both a rewarded continuation and a failure continuation, and the two +terminals differ only in where the pan ends up (Fig.~\ref{fig:success} vs Fig.~\ref{fig:stage6}). What was +never established is whether the \emph{trained reward head} can tell those apart --- and if it cannot, every +green/red marking in a stitching figure is decoration. Three diagnostics answer that, all on cached features +with no new training. + +\subsection{D1 --- can the head separate the two terminals?} +$R(z)$ evaluated on every frame whose \texttt{annot.edge\_to} is 4 (rewarded: pan on grate, +tomato in bowl) versus 6 (failure: pan on the stove, tomato in bowl), and on the last 30 frames of each such +episode. 0.5 is chance. \texttt{scripts/real/decisive\_reward.py} $\to$ +\texttt{status/real/DECISIVE\_REWARD.json}. +\begin{table}[htbp]\centering\small +\caption{\textbf{D1/D2 --- what each reward head can actually discriminate.} AUC of $R(z)$; 0.5 is chance. \emph{4 vs 6} is the decisive column: those two states differ only in where the pan ends. \emph{4 vs 3} asks whether the head can tell the finished state from the mid-task cooking state. \emph{junction} is D2: frames in the first 30 after leaving state 2, rewarded continuation (route 3) versus failure continuation (route 4) --- physically the same situation, so a provenance head should sit near chance or, worse, be confidently wrong.}\label{tab:decisive} +\begin{tabular}{lrrrrr}\toprule +head & 4 vs 6 (all) & 4 vs 6 (tail 30) & 4 vs 3 (tail) & 4 vs 5 (tail) & junction r3 vs r4 \\\midrule +shipped\_R\_M & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ +shipped\_R\_M\_s1 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ +ft\_v0 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ +ft\_v0\_s1 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ +scratch\_v0 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ +ft\_v1 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 0.7553 \\ +ft\_v1\_s1 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 0.9986 \\ +scratch\_v1 & 1.0000 & 1.0000 & 1.0000 & 1.0000 & 0.7013 \\ +ft\_v2 & 0.1131 & 0.5474 & 0.8681 & 0.7066 & 0.7098 \\ +ft\_v2\_s1 & 0.3307 & 0.9452 & 0.8129 & 0.9458 & 0.6983 \\ +scratch\_v2 & 0.2002 & 0.6870 & 0.6785 & 0.8121 & 0.2028 \\ +ft\_v3 & 0.7118 & 0.2387 & 0.7527 & 0.1799 & 0.0000 \\ +ft\_v3\_s1 & 0.4436 & 0.0181 & 0.5969 & 0.1487 & 0.0000 \\ +scratch\_v3 & 0.8397 & 0.5191 & 0.8019 & 0.5360 & 0.0000 \\ +\bottomrule\end{tabular}\end{table} + +\subsection{D3 --- the demonstration number} +Standing at a junction state \emph{as it is actually visited on the failure route} (the last 40 +frames before route-4 episodes leave state 2), 128 candidate action chunks are scored: 64 drawn from the +rewarded continuation (route 3, segment $2\to3$) and 64 from the failure continuation (route 4, segment +$2\to6$). Logged chunks are used rather than proposer samples precisely so that the label ``this candidate +continues toward the goal'' is ground truth. The read-out is the flagship one --- \texttt{d1}, $\beta=0.99$, +16 particles, probability, $T=25$, argmax over 128 --- identical to +\texttt{status/real/openloop\_*/scorer\_openloop.json}. Chance is 0.5 for both columns. +\texttt{scripts/real/stitch\_feasibility.py} $\to$ \texttt{status/real/STITCH\_FEASIBILITY.json}. +\begin{table}[htbp]\centering\small +\caption{\textbf{D3 --- does $Q$ separate the rewarded continuation from the failure continuation at the shared junction state?} \emph{AUC} pooled over all anchors and averaged per anchor; \emph{top-1} is how often the argmax of 128 is a rewarded-continuation chunk (chance $0.5$); \emph{spread} is the mean max$-$min of the 128 scores, i.e.\ how much dynamic range the ranking has at all.}\label{tab:d3} +\begin{tabular}{lrrrrr}\toprule +head & AUC (pooled) & AUC (per anchor) & frac anchors $>0.5$ & top-1 rewarded & score spread \\\midrule +shipped\_R\_M & 0.4284 & 0.4635 & 0.531 & 0.094 & 7.88e-02 \\ +ft\_v0 & 0.4656 & 0.5609 & 0.625 & 0.281 & 6.37e-02 \\ +ft\_v1 & 0.4273 & 0.2164 & 0.000 & 0.031 & 2.51e-01 \\ +ft\_v2 & 0.4646 & 0.3883 & 0.281 & 0.125 & 1.70e-01 \\ +ft\_v3 & 0.3839 & 0.1242 & 0.000 & 0.062 & 3.46e-01 \\ +ft\_v1\_s1 & 0.3931 & 0.3859 & 0.188 & 0.125 & 5.71e-02 \\ +\bottomrule\end{tabular}\end{table} + +\subsection{A correction: the reward RISE trains on is not the reward the dataset defines} +The robomimic conversion labels an episode \emph{expert} when its final state is in $\{3,4\}$ +(\texttt{scripts/real/convert\_cooking\_hdf5.py:100}) and writes $+1$ on every frame of those episodes +(\texttt{:150}), also storing that flag as the hdf5 attribute \texttt{success} (\texttt{:158}). The dataset +card is narrower: \textbf{``Reward state IDs: [4]''}, with +\texttt{reward = float(goal\_reached == 1 and reached\_state\_id in reward\_states)}, and its state table +marks state 3 as \emph{``[Cooking state] Pan on stove, Tomato in the pan --- Terminal in task: False --- +Rewarded arrival: False''}. State 3 is therefore not a second success terminal; it is the mid-task state +with the tomato still in the pan, where routes 1 and 2 simply stop. +\begin{center}\small\begin{tabular}{rrrcc}\toprule +terminal & episodes & frames & RISE calls it expert & dataset rewards it \\\midrule +3 & 98 & 78983 & yes & no \\ +4 & 50 & 53367 & yes & yes \\ +5 & 50 & 27743 & no & no \\ +6 & 50 & 21437 & no & no \\ +\bottomrule\end{tabular}\end{center} +\noindent So RISE's critic is trained with $+1$ on every frame of 148 of 248 episodes (132350 frames, 72.9\% of the corpus), and 98 of those episodes never put the tomato in the bowl. The successor's own \texttt{v0} uses the dataset rule instead (50 episodes). No successor cell had ever been trained on RISE's labels, so they were added as \texttt{v5} (\texttt{scripts/real/make\_v5\_reward.py} $\to$ \texttt{cache/real\_cooking\_v5/reward\_v5\_riseprov.f32.npy}, counts in \texttt{status/real/V5\_REWARD.json}). + +\subsection{The open-loop screen re-cut by episode provenance} +A natural defence of the open-loop numbers is that only 5 of the 25 held-out episodes reach the goal, so on the rest ``agreeing with the logged chunk'' is agreeing with a failure. That defence is testable and it fails: every learned scorer ranks \emph{below} chance on the rewarded episodes too. \texttt{scripts/real/openloop\_by\_provenance.py} $\to$ \texttt{status/real/OPENLOOP\_BY\_PROVENANCE.json}, cell \texttt{FT\_S0Aidql\_s1\_e2500\_d1\_T25}, 705 paired decisions, nothing re-scored. +\begin{table}[htbp]\centering\small +\caption{\textbf{Oracle rank percentile split by whether the episode reaches the goal.} $1.0$ = the oracle's own pick, $0.0$ = the worst of 128; a plain sample (\texttt{greedy}) and the permutation controls sit at $0.5$ by construction. Lower than $0.5$ means the scorer systematically prefers candidates the oracle ranks badly.}\label{tab:provsplit} +\begin{tabular}{lrrrr}\toprule +scorer & all & rewarded eps & failure eps & route 3 only \\\midrule +idql & 0.4114 & 0.4066 & 0.4134 & 0.4066 \\ +permuted\_idql & 0.4858 & 0.4862 & 0.4857 & 0.4862 \\ +rsm & 0.3714 & 0.3473 & 0.3814 & 0.3473 \\ +permuted\_rsm & 0.5055 & 0.5148 & 0.5016 & 0.5148 \\ +rsm@ft\_v0 & 0.3663 & 0.3636 & 0.3675 & 0.3636 \\ +rsm@ft\_v1 & 0.3489 & 0.3803 & 0.3360 & 0.3803 \\ +rsm@ft\_v2 & 0.3956 & 0.4153 & 0.3875 & 0.4153 \\ +rsm@ft\_v3 & 0.3783 & 0.4057 & 0.3669 & 0.4057 \\ +rsm@ft\_v0\_s1 & 0.3838 & 0.3659 & 0.3912 & 0.3659 \\ +rsm@ft\_v1\_s1 & 0.3549 & 0.3786 & 0.3451 & 0.3786 \\ +rsm@ft\_v2\_s1 & 0.3514 & 0.4100 & 0.3272 & 0.4100 \\ +rsm@ft\_v3\_s1 & 0.4037 & 0.4151 & 0.3990 & 0.4151 \\ +oracle & 1.0000 & 1.0000 & 1.0000 & 1.0000 \\ +greedy & 0.5138 & 0.4829 & 0.5266 & 0.4829 \\ +\bottomrule\end{tabular}\end{table} + +\subsection{Verdict, and the smallest fix} +\textbf{No head passes.} D1 looks perfect for v0/v1 --- AUC $1.000$ separating state 4 from state 6 +--- but D2 shows what that AUC is made of: the \emph{same} head separates the \emph{junction} frames of +route 3 from those of route 4 with AUC $1.000$ as well, and route 3's junction frames are its \emph{first} +frames, before the pan has been touched. The shipped head reads $R(z)=+24.4$ there and $-24.8$ on route 4, +the same $\pm25$ it reads at the terminals (Table~\ref{tab:decisive}, logit means in +\texttt{status/real/DECISIVE\_REWARD.json}). Sharper still: routes 2 and 3 both contain the physical edge +$2\to3$, labelled $0$ in one recording and $+1$ in the other, and the head separates those two copies of the +same transition with AUC $1.000$. The head has learned \emph{which recording a frame belongs to}. +And D3, which is the demonstration itself, comes out below chance for every head: the top-ranked of 128 +candidates is a rewarded-continuation chunk $3$--$28\%$ of the time (chance $50\%$), and for the shipped +head the chain from the \emph{top} candidate retrieves a state-6 failure frame ($0\%$ of particles in the +goal region) while the chain from the \emph{bottom} candidate retrieves a state-4 goal frame ($100\%$). + +\textbf{Why this is structural, not a training failure.} Only route 3 is rewarded, and route 3 is +also the only route that \emph{starts} at state 2 (\texttt{cache/real\_cooking\_v5/SEGMENTS.json}: route 3 is +\texttt{2->3->4}, two segments, no \texttt{0->2} prefix). So within this corpus ``this state is on the way to +the goal'' and ``this frame was recorded in a route-3 session'' are the same predicate, and a per-frame label +that is constant over the recording cannot distinguish them. No amount of relabelling inside the existing +episodes fixes that; v1, v2 and v3 are three different ways of slicing the same 50 recordings. + +\textbf{The smallest fix}, in increasing cost: +\begin{enumerate}\itemsep1pt +\item \textbf{Record route 5.} The dataset card already declares route 5 $=$ \texttt{1->3->4} with a target + of 50 episodes and none collected. Route 5 and route 1 (\texttt{0->1->3}) share state 1, and route 5 + reaches the goal --- a second junction with a success and a non-success continuation, recorded in the + \emph{same} session style. Two junctions instead of one also breaks the ``route 3 is special'' cue. +\item \textbf{Record a failure continuation out of state 3 in a route-3 session} (pour, then leave the pan on + the stove $=$ state 6). That puts both terminals inside the \emph{same} recording family, which is the + only thing that makes the reward a function of the scene rather than of the session. +\item \textbf{Replace the provenance label with a state-based one:} the dataset's own rule + \texttt{reward = float(goal\_reached == 1 and reached\_state\_id in [4])} is exactly v2 and is already + state-based --- but it fires on 50 frames in 181{,}530, and the v2 heads measured here are the worst of + the set (D1 AUC $0.11$--$0.33$). A detector-style label (``pan on grate'' from the scene, applied to + every frame of every recording) is the version of v2 that would have enough positives to train on. +\end{enumerate} + diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_status.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_status.tex new file mode 100644 index 0000000000000000000000000000000000000000..9aa77221b9ea1c05c9c051e947fca51e342ab2cb --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_status.tex @@ -0,0 +1,46 @@ +\paragraph{Proposal-policy trainings.} All four robomimic cells are configured for +\texttt{num\_epochs}$=5000$ (read back from the running job's own config dump, e.g.\ +\path{logs/lsf/rr_cook_idql_s0.1822735.out}). State at the time of writing (2026-09-22 03:4xZ): + +\begin{table}[htbp]\centering\small +\begin{tabular}{@{}lllll@{}}\toprule +cell & LSF job & state & epoch & note \\ \midrule +\texttt{S0Aidql} s0 & 1822735 & RUN & 3022 / 5000 & resumed after an admin kill, see below \\ +\texttt{S0Aidql} s1 & 1818505 & RUN & 3319 / 5000 & running since 2026-09-21 07:22Z \\ +\texttt{S0B} s0 & 1838320 & RUN & 5001 / 5000 & finished; the resubmit is a no-op \\ +\texttt{S0B} s1 & 1835427 & RUN & 5001 / 5000 & finished; the resubmit is a no-op \\ +pi0.5 stock/rise/riseadv & (rolling) & -- & 30000 / 30000 & all five runs complete \\ +\bottomrule\end{tabular}\end{table} + +\paragraph{Why \texttt{S0Aidql} looked stopped.} The earlier \texttt{S0Aidql} s0 job \textbf{1819098} was killed by +the cluster administrator, not by a crash or by the trainer: \texttt{bhist -a -l 1819098} reports +\emph{``Mon Sep 21 12:50:03 2026: Signal \texttt{} requested by user or administrator''} and +\emph{``Completed \texttt{}; \textbf{TERM\_ADMIN}: job killed by root or an administrator''}, exit code 143, +at epoch $\approx\!2500$ --- well short of the configured 5000. It did not need a manual resubmit: the durable +watcher \texttt{scripts/real/replay\_watcher.sh} detects a training cell that is neither queued nor running and +resubmits it with the exact original command (\texttt{scripts/run\_train.sh}, which resumes from +\texttt{rolling/}); it fired at 12:51Z and that resubmit is the job 1822735 above, now 500 epochs past where the +kill happened. The same mechanism explains the many dated run directories per seed in Table~\ref{tab:ckpt} --- each +is one resume, and the latest epoch across them is the checkpoint. The resubmit log is +\path{status/real/replay_watcher.log}. No training needed to be relaunched by hand for this report. + +\paragraph{Replay evaluations launched for this report.} The per-epoch grid in Table~\ref{tab:perepoch} was +completed by submitting \texttt{scripts/real/rise\_replay\_eval.py} through \texttt{scripts/bsub\_gpu.sh} on the +preemptable queue for every checkpoint that had no \texttt{replay\_e/} directory --- in particular the latest +checkpoints \texttt{S0Aidql} s1@3000 and \texttt{S0B} s1@\{2000,4000,5000\}, which the watcher does not cover +(it only walks seed~0). A recurring \texttt{RuntimeError: CUDA unknown error} at +\texttt{torch.\_C.\_cuda\_init()} killed a fraction of these jobs on whatever GPU host they landed on; each was +resubmitted until it succeeded. One cell never did: \texttt{S0B} s1@1500 failed five times in a row (jobs +1839609, 1839768, 1839825, 1840059 on the preemptable queue and 1840221 on \texttt{normal}), all with that same +CUDA-init error before the checkpoint is even read, so it is left blank in Table~\ref{tab:perepoch}. It is an +interior point of a curve whose endpoints are both measured, so nothing in this report depends on it. + +\paragraph{Open-loop cells.} Of the four fixed-harness cells (jobs 1835430--1835434, submitted 2026-09-22 00:23Z), +\texttt{S0Aidql\_s0\_e2000\_fold\_d4\_T25} (job 1835434) has completed and is in Table~\ref{tab:openloop}. Jobs +1835430 (\texttt{s1\_e2500\_d1\_d1\_T25}) and 1835433 (\texttt{s0\_e2000\_d1\_d1\_T25}) have since landed and +are in the table too. Only job \textbf{1835432} (\texttt{s1\_e2500\_fold\_d4\_T25}) was still RUNNING when this +PDF was built; its result will appear at +\path{status/real/openloop_S0Aidql_s1_e2500_fold_d4_T25/scorer_openloop.json}. Its sibling cell on the same +checkpoint (\texttt{s1\_e2500\_d1\_d1\_T25}) is in Table~\ref{tab:openloop}, and on seed~0 the two scorer +configurations agreed to within 0.003~cm, so it is not expected to change the reading in +Sec.~\ref{sec:openloop}. diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_tables.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_tables.tex new file mode 100644 index 0000000000000000000000000000000000000000..e639cabe11437b07e0501889ac964cdae61f0c22 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_tables.tex @@ -0,0 +1,70 @@ +% generated by scripts/real/build_real_report_tables.py -- do not edit by hand +\newcommand{\holdfirst}{0.81} +\newcommand{\holdchunk}{1.53} +\newcommand{\holdstep}{0.22} +\begin{table}[htbp]\centering\small +\caption{Real-world (\texttt{rsm\_cooking\_v5}) proposal policies: role, recipe, seed, training length, absolute checkpoint path and W\&B run. \emph{BC} rows are plain behaviour cloning; \emph{RISE actor} rows carry the RISE/IDQL actor recipe. The robomimic epochs are the latest on disk at the time of writing; \texttt{S0Aidql} is still training (Sec.~\ref{sec:trainstatus}).} +\label{tab:ckpt} +\begin{tabular}{@{}lllp{15mm}p{56mm}l@{}}\toprule +role & policy & seed & length & checkpoint (absolute) & W\&B \\ \midrule +BC & pi0.5 stock & 0 & 29999 steps & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak openpi/\allowbreak checkpoints/\allowbreak pi05\_\allowbreak cooking\_\allowbreak stock/\allowbreak stock\_\allowbreak s0/\allowbreak 29999}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/jrjlyj9u}{run} \\[2pt] +BC & pi0.5 stock & 1 & 29999 steps & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak openpi/\allowbreak checkpoints/\allowbreak pi05\_\allowbreak cooking\_\allowbreak stock/\allowbreak stock\_\allowbreak s1/\allowbreak 29999}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/63h0zi0h}{run} \\[2pt] +RISE actor & pi0.5 rise & 0 & 29999 steps & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak openpi/\allowbreak checkpoints/\allowbreak pi05\_\allowbreak cooking\_\allowbreak rise/\allowbreak rise\_\allowbreak s0/\allowbreak 29999}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/8559gx2w}{run} \\[2pt] +RISE actor & pi0.5 rise & 1 & 29999 steps & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak openpi/\allowbreak checkpoints/\allowbreak pi05\_\allowbreak cooking\_\allowbreak rise/\allowbreak rise\_\allowbreak s1/\allowbreak 29999}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/i32p3c9u}{run} \\[2pt] +RISE actor & pi0.5 riseadv & 0 & 29999 steps & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak openpi/\allowbreak checkpoints/\allowbreak pi05\_\allowbreak cooking\_\allowbreak riseadv/\allowbreak riseadv\_\allowbreak s0/\allowbreak 29999}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/21pdo7s4}{run} \\[2pt] +BC & robomimic S0B & 0 & epoch 5000 & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0B\_\allowbreak seed0/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal\_\allowbreak S0B\_\allowbreak s0/\allowbreak 20260921074624/\allowbreak models/\allowbreak model\_\allowbreak epoch\_\allowbreak 5000.pth}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/4ni99fj6}{run} \\[2pt] +BC & robomimic S0B & 1 & epoch 5000 & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0B\_\allowbreak seed1/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal\_\allowbreak S0B\_\allowbreak s1/\allowbreak 20260921072245/\allowbreak models/\allowbreak model\_\allowbreak epoch\_\allowbreak 5000.pth}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/2fptaa08}{run} \\[2pt] +RISE actor & robomimic S0Aidql & 0 & epoch 3000 & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0Aidql\_\allowbreak seed0/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal\_\allowbreak S0Aidql\_\allowbreak s0/\allowbreak 20260921193225/\allowbreak models/\allowbreak model\_\allowbreak epoch\_\allowbreak 3000.pth}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/b4bwu06r}{run} \\[2pt] +RISE actor & robomimic S0Aidql & 1 & epoch 3000 & {\tiny \texttt{/\allowbreak proj/\allowbreak dmfexp/\allowbreak zwhong/\allowbreak rsm\_\allowbreak rise/\allowbreak runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0Aidql\_\allowbreak seed1/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal\_\allowbreak S0Aidql\_\allowbreak s1/\allowbreak 20260921235824/\allowbreak models/\allowbreak model\_\allowbreak epoch\_\allowbreak 3000.pth}} & \href{https://wandb.ai/richardrl/rsm_rise/runs/gblb2rs2}{run} \\[2pt] +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Held-out fit on the 25 validation episodes, quoted as a ratio to the hold-still predictor (copy the current end-effector xyz: \holdfirst~cm first action, \holdchunk~cm 8-step chunk mean; per-step motion \holdstep~cm). Ratio $>1$ means better than hold-still. pi0.5 rows are the run's own \texttt{EVAL step} lines at the last step; robomimic rows are \texttt{replay\_eval.json:pooled\_episode\_mean} (stride 10, 25 episodes).} +\label{tab:fit} +\begin{tabular}{@{}llrrrrp{38mm}@{}}\toprule +policy & at & first (cm) & chunk (cm) & first ratio & chunk ratio & source \\ \midrule +hold-still & -- & 0.81 & 1.53 & 1.00 & 1.00 & \texttt{action\_norms\_real.py} \\ \midrule +pi0.5 rise\_s0 & 30000 steps & 0.94 & 1.30 & 0.86$\times$ & 1.18$\times$ & {\tiny \texttt{logs/\allowbreak lsf/\allowbreak rr\_\allowbreak openpi\_\allowbreak rise\_\allowbreak s0.*.out}} \\ +pi0.5 rise\_s1 & 30000 steps & 0.92 & 1.29 & 0.88$\times$ & 1.19$\times$ & {\tiny \texttt{logs/\allowbreak lsf/\allowbreak rr\_\allowbreak openpi\_\allowbreak rise\_\allowbreak s1.*.out}} \\ +pi0.5 riseadv\_s0 & 30000 steps & 1.13 & 1.50 & 0.72$\times$ & 1.02$\times$ & {\tiny \texttt{logs/\allowbreak lsf/\allowbreak rr\_\allowbreak openpi\_\allowbreak riseadv\_\allowbreak s0.*.out}} \\ +pi0.5 stock\_s0 & 30000 steps & 0.84 & 1.18 & 0.96$\times$ & 1.30$\times$ & {\tiny \texttt{logs/\allowbreak lsf/\allowbreak rr\_\allowbreak openpi\_\allowbreak stock\_\allowbreak s0.*.out}} \\ +pi0.5 stock\_s1 & 30000 steps & 0.83 & 1.16 & 0.98$\times$ & 1.32$\times$ & {\tiny \texttt{logs/\allowbreak lsf/\allowbreak rr\_\allowbreak openpi\_\allowbreak stock\_\allowbreak s1.*.out}} \\ +robomimic S0Aidql\_seed0 & epoch 3000 & 0.43 & 0.53 & 1.90$\times$ & 2.87$\times$ & {\tiny \texttt{runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0Aidql\_\allowbreak seed0/\allowbreak replay\_\allowbreak e3000/\allowbreak replay\_\allowbreak eval.json}} \\ +robomimic S0Aidql\_seed1 & epoch 3000 & 0.40 & 0.49 & 2.04$\times$ & 3.13$\times$ & {\tiny \texttt{runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0Aidql\_\allowbreak seed1/\allowbreak replay\_\allowbreak e3000/\allowbreak replay\_\allowbreak eval.json}} \\ +robomimic S0B\_seed0 & epoch 5000 & 1.69 & 1.78 & 0.48$\times$ & 0.86$\times$ & {\tiny \texttt{runs/\allowbreak cooking\_\allowbreak v5\_\allowbreak expert\_\allowbreak suboptimal/\allowbreak policy/\allowbreak S0B\_\allowbreak seed0/\allowbreak replay\_\allowbreak e5000/\allowbreak replay\_\allowbreak eval.json}} \\ +robomimic S0B\_seed1 & epoch 5000 & 1.75 & 1.86 & 0.46$\times$ & 0.82$\times$ & {\tiny \texttt{runs/\allowbreak real/\allowbreak replay/\allowbreak S0B\_\allowbreak s1\_\allowbreak e5000/\allowbreak replay\_\allowbreak eval.json}} \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Per-epoch held-out fit of the robomimic actors (\texttt{replay\_eval.json}, stride 10, 25 validation episodes). Empty cells have no replay eval on disk.} +\label{tab:perepoch} +\begin{tabular}{@{}lrrrrrrrrrr@{}}\toprule +policy (first / chunk cm) & 500 & 1000 & 1500 & 2000 & 2500 & 3000 & 3500 & 4000 & 4500 & 5000 \\ \midrule +S0Aidql\_seed0 & \tiny 0.82/1.11 & \tiny 0.60/0.83 & \tiny 0.59/0.74 & \tiny 0.58/0.70 & \tiny 0.48/0.57 & \tiny 0.43/0.53 & -- & -- & -- & -- \\ +S0Aidql\_seed1 & \tiny 0.80/1.04 & \tiny 0.78/0.96 & \tiny 0.54/0.72 & \tiny 0.50/0.65 & \tiny 0.39/0.51 & \tiny 0.40/0.49 & -- & -- & -- & -- \\ +S0B\_seed0 & \tiny 3.21/3.37 & \tiny 2.17/2.34 & \tiny 2.42/2.53 & \tiny 2.33/2.46 & \tiny 2.17/2.22 & \tiny 1.69/1.79 & \tiny 1.96/2.04 & \tiny 1.45/1.56 & \tiny 2.16/2.24 & \tiny 1.69/1.78 \\ +S0B\_seed1 & \tiny 2.80/2.98 & \tiny 2.27/2.39 & -- & \tiny 1.70/1.88 & \tiny 1.59/1.74 & \tiny 1.53/1.67 & \tiny 1.40/1.52 & \tiny 1.46/1.62 & \tiny 1.42/1.55 & \tiny 1.75/1.86 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Open-loop selection on the \texttt{S0Aidql} proposers' 128 candidates (fixed harness, \texttt{scorer\_openloop.py}; stride 25, 25 episodes). \emph{greedy} is the proposer's own first sample; \emph{permuted} rows are the score-shuffling controls. Lower is better.} +\label{tab:openloop} +\begin{tabular}{@{}llrrrr@{}}\toprule +cell & scorer & first (cm) & chunk (cm) & $\Delta$ vs greedy & win rate \\ \midrule +S0Aidql\_s0\_e2000\_d1\_d1\_T25 & greedy & 0.570 & 0.681 & +0.000 & 0.000 \\ + & idql & 0.527 & 0.688 & -0.043 & 0.580 \\ + & rsm & 0.612 & 0.797 & +0.043 & 0.445 \\ + & permuted:idql & 0.562 & 0.669 & -0.007 & 0.499 \\ + & permuted:rsm & 0.571 & 0.682 & +0.002 & 0.489 \\ +\midrule +S0Aidql\_s0\_e2000\_fold\_d4\_T25 & greedy & 0.568 & 0.682 & +0.000 & 0.000 \\ + & idql & 0.522 & 0.680 & -0.045 & 0.577 \\ + & rsm & 0.613 & 0.786 & +0.046 & 0.458 \\ + & permuted:idql & 0.569 & 0.682 & +0.001 & 0.501 \\ + & permuted:rsm & 0.578 & 0.699 & +0.010 & 0.474 \\ +\midrule +S0Aidql\_s1\_e2500\_d1\_d1\_T25 & greedy & 0.398 & 0.526 & +0.000 & 0.000 \\ + & idql & 0.456 & 0.603 & +0.058 & 0.401 \\ + & rsm & 0.462 & 0.627 & +0.065 & 0.379 \\ + & permuted:idql & 0.393 & 0.519 & -0.004 & 0.477 \\ + & permuted:rsm & 0.391 & 0.515 & -0.007 & 0.487 \\ +\midrule +\bottomrule\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_wandb.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_wandb.tex new file mode 100644 index 0000000000000000000000000000000000000000..bf170140e590da553add7c51cbda4938ff5fc601 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_real_wandb.tex @@ -0,0 +1,47 @@ +The project is \href{https://wandb.ai/richardrl/rsm_rise}{\texttt{richardrl/rsm\_rise}}. +The project's \texttt{access} field read back \texttt{USER\_READ} \emph{before} this run and \texttt{USER\_READ} \emph{after}. \texttt{USER\_READ} is W\&B's \emph{public: anyone with the link can view}, so the project was \textbf{already public} and needed no change. The reader/mutation script is \texttt{scripts/tmp/wandb\_public\_and\_list.py} (run on a CPU node; it issues \texttt{upsertModel(access: USER\_READ)} only when the project is not already public, and it was, so no mutation was sent). +All 41 cooking runs and their URLs are listed in \path{status/real/wandb_runs.json}; the per-policy links are in Table~\ref{tab:ckpt}. +\begin{table}[htbp]\centering\small\caption{Every \texttt{cooking} run in the project.}\label{tab:wandb}\begin{tabular}{@{}llll@{}}\toprule +run & state & created & URL \\ \midrule +{\tiny cooking\_v5\_expert\_suboptimal/S0Aidql\_seed0} & crashed & 2026-09-21T04:34 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/687mz7tn}{687mz7tn}} \\ +{\tiny cooking\_v5\_expert\_suboptimal/S0Aidql\_seed0} & running & 2026-09-21T04:36 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/b4bwu06r}{b4bwu06r}} \\ +{\tiny cooking\_v5\_expert\_suboptimal/S0Aidql\_seed1} & running & 2026-09-21T07:22 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/gblb2rs2}{gblb2rs2}} \\ +{\tiny cooking\_v5\_expert\_suboptimal/S0B\_seed0} & crashed & 2026-09-21T04:33 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/9ts6gdrx}{9ts6gdrx}} \\ +{\tiny cooking\_v5\_expert\_suboptimal/S0B\_seed0} & crashed & 2026-09-21T04:36 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/voo1gg7d}{voo1gg7d}} \\ +{\tiny cooking\_v5\_expert\_suboptimal/S0B\_seed0} & finished & 2026-09-21T04:56 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/4ni99fj6}{4ni99fj6}} \\ +{\tiny cooking\_v5\_expert\_suboptimal/S0B\_seed1} & running & 2026-09-21T07:24 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/2fptaa08}{2fptaa08}} \\ +{\tiny dryrun} & crashed & 2026-09-21T04:31 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/t3xvoa18}{t3xvoa18}} \\ +{\tiny dryrun} & failed & 2026-09-21T04:33 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/8g2f44uy}{8g2f44uy}} \\ +{\tiny dryrun} & failed & 2026-09-21T04:36 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/i64sh2d5}{i64sh2d5}} \\ +{\tiny dryrun} & failed & 2026-09-21T04:38 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/vcce4gis}{vcce4gis}} \\ +{\tiny dryrun} & finished & 2026-09-21T04:39 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/z8b9nx1q}{z8b9nx1q}} \\ +{\tiny dryrun} & failed & 2026-09-21T04:44 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/nw2avlas}{nw2avlas}} \\ +{\tiny dryrun} & crashed & 2026-09-21T04:45 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/v2icvs8k}{v2icvs8k}} \\ +{\tiny dryrun} & finished & 2026-09-21T04:45 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/4j15fd6s}{4j15fd6s}} \\ +{\tiny dryrun} & finished & 2026-09-21T05:26 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/rjetm0cv}{rjetm0cv}} \\ +{\tiny real\_cooking\_v5/hop/flow} & finished & 2026-09-21T09:35 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/820a893f607aad64}{820a893f607aad64}} \\ +{\tiny real\_cooking\_v5/hop/gauss} & finished & 2026-09-21T09:34 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/86e1bfad201301a4}{86e1bfad201301a4}} \\ +{\tiny real\_cooking\_v5/rsm/R\_L40} & finished & 2026-09-21T05:07 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/2b937e092fd6e1bd}{2b937e092fd6e1bd}} \\ +{\tiny real\_cooking\_v5/rsm/R\_L40\_notrunc} & finished & 2026-09-21T05:06 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/a04d4f2d81d3c268}{a04d4f2d81d3c268}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M} & finished & 2026-09-21T05:07 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/4e6f56148cd80f58}{4e6f56148cd80f58}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_chunk20} & finished & 2026-09-21T05:07 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/2b54a724b2ab44df}{2b54a724b2ab44df}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_notrunc} & finished & 2026-09-21T05:06 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/d37fb62fc406cb9b}{d37fb62fc406cb9b}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_notrunc\_s1} & finished & 2026-09-21T09:06 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/4df9f838227d899d}{4df9f838227d899d}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_rterm120} & finished & 2026-09-21T10:09 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/5298fdfc68179666}{5298fdfc68179666}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_rterm40} & finished & 2026-09-21T10:06 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/e76fc56d072b7ac3}{e76fc56d072b7ac3}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_rterm40st} & finished & 2026-09-21T10:42 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/0042c325f6059e99}{0042c325f6059e99}} \\ +{\tiny real\_cooking\_v5/rsm/R\_M\_s1} & finished & 2026-09-21T09:05 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/c13cbda5e9e3cb6b}{c13cbda5e9e3cb6b}} \\ +{\tiny real\_cooking\_v5/rsm/R\_XL} & finished & 2026-09-21T05:07 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/26b079eadd888e90}{26b079eadd888e90}} \\ +{\tiny real\_cooking\_v5/rsm/R\_XL\_notrunc} & finished & 2026-09-21T05:07 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/061ec9fb1495bd36}{061ec9fb1495bd36}} \\ +{\tiny rise\_s0} & crashed & 2026-09-21T04:49 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/o42diaic}{o42diaic}} \\ +{\tiny rise\_s0} & crashed & 2026-09-21T04:59 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/qx0lq72j}{qx0lq72j}} \\ +{\tiny rise\_s0} & finished & 2026-09-21T05:03 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/8559gx2w}{8559gx2w}} \\ +{\tiny rise\_s1} & finished & 2026-09-21T07:24 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/i32p3c9u}{i32p3c9u}} \\ +{\tiny riseadv\_s0} & finished & 2026-09-21T11:34 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/21pdo7s4}{21pdo7s4}} \\ +{\tiny stock\_s0} & crashed & 2026-09-21T04:44 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/6oytw6yb}{6oytw6yb}} \\ +{\tiny stock\_s0} & crashed & 2026-09-21T04:45 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/gdro0hso}{gdro0hso}} \\ +{\tiny stock\_s0} & running & 2026-09-21T05:01 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/jrjlyj9u}{jrjlyj9u}} \\ +{\tiny stock\_s1} & crashed & 2026-09-21T07:23 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/nz9lttur}{nz9lttur}} \\ +{\tiny stock\_s1} & crashed & 2026-09-21T07:39 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/vs5372lv}{vs5372lv}} \\ +{\tiny stock\_s1} & finished & 2026-09-21T08:02 & {\tiny \href{https://wandb.ai/richardrl/rsm_rise/runs/63h0zi0h}{63h0zi0h}} \\ +\bottomrule\end{tabular}\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_reward_tables.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_reward_tables.tex new file mode 100644 index 0000000000000000000000000000000000000000..b7fc3f10a43efd4d3b0c28c4f57453848f32eb5a --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_reward_tables.tex @@ -0,0 +1,112 @@ +\begin{table}[htbp]\centering\small +\caption{The four reward labels, counted on \texttt{cache/real\_cooking\_v5} (181{,}530 frames, 248 episodes). \emph{train}/\emph{val} use the SAME split every cell trains on (\texttt{LiberoRSMData} seed 0, \texttt{val\_frac} 0.1, unstratified: 24 validation episodes, of which 2 are rewarded). Source: \texttt{status/real/GOAL\_REWARD.json}, produced by \texttt{scripts/real/make\_goal\_reward.py}.} +\label{tab:labels} +\begin{tabular}{lrrrrrr}\toprule +label & pos.\ frames & \% of frames & train & val & eps.\ with a pos. & of which suboptimal \\\midrule +v0 provenance (dense) & 53367 & 29.398 & 51223 & 2144 & 50/248 & 0 \\ +v1 goal transition & 30292 & 16.687 & 29129 & 1163 & 50/248 & 0 \\ +v2 arrival only & 50 & 0.028 & 48 & 2 & 50/248 & 0 \\ +v3 final segment (all eps) & 109110 & 60.106 & 100196 & 8914 & 248/248 & 198 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Positive frames by route. Route 3 (\texttt{2->3->4}) is the ONLY route that reaches the goal state 4, and it is exactly the set of 50 episodes the cache marks \texttt{ep\_success}. Source: \texttt{status/real/GOAL\_REWARD.json}, \texttt{by\_route}.} +\label{tab:byroute} +\begin{tabular}{lllrrrr}\toprule +route & path & eps & v0 provenance (dense) & v1 goal transition & v2 arrival only & v3 final segment (all eps) \\\midrule +0 & \texttt{0->5} & 50 & 0 & 0 & 0 & 27743 \\ +1 & \texttt{0->1->3} & 50 & 0 & 0 & 0 & 22858 \\ +2 & \texttt{0->2->3} & 48 & 0 & 0 & 0 & 19895 \\ +3 & \texttt{2->3->4} & 50 & 53367 & 30292 & 50 & 30292 \\ +4 & \texttt{0->2->6} & 50 & 0 & 0 & 0 & 8322 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{FINE-TUNED reward heads (the run-2 recipe) and the two un-fine-tuned flagship successors they start from. Each \texttt{R\_M\_ft\_v*} cell loads \texttt{R\_M}'s (resp.\ \texttt{R\_M\_s1}'s) step-100000 checkpoint -- weights, EMA target and optimiser state -- swaps in the new per-frame label and runs 10{,}000 further steps at the same learning rate ($3\times10^{-4}$; \texttt{train\_rsm.py} has no LR schedule, so `the checkpoint's final learning rate' and `the training learning rate' are the same number). Seed is matched to the source cell, so the validation split is the source's. Numbers read from each cell's own \texttt{runs/real\_cooking\_v5/rsm//history.json}.} +\label{tab:fthealth} +\begin{tabular}{llrrrrrr}\toprule +cell & label & step & r-auc val & r-mae val & pos rate & nnl1 ratio & vs stay \\\midrule +\texttt{R\_M} & flagship, provenance label (not fine-tuned) & 100000 & 1.0000 & 1.14e-09 & 0.1255 & 0.6668 & 1.4986 \\ +\texttt{R\_M\_s1} & flagship seed 1 (not fine-tuned) & 100000 & 1.0000 & 2.68e-10 & 0.1304 & 0.6759 & 1.4907 \\ +\texttt{R\_M\_ft\_v0} & v0 provenance (control) & 110000 & 1.0000 & 1.86e-09 & 0.1211 & 0.6886 & 1.4971 \\ +\texttt{R\_M\_ft\_v1} & v1 goal transition & 110000 & 1.0000 & 2.91e-03 & 0.0938 & 0.6878 & 1.4955 \\ +\texttt{R\_M\_ft\_v2} & v2 arrival only & 110000 & --- & 3.59e-11 & 0.0000 & 0.6890 & 1.4980 \\ +\texttt{R\_M\_ft\_v3} & v3 final segment (all eps) & 110000 & 0.9994 & 1.42e-02 & 0.6211 & 0.6878 & 1.4954 \\ +\texttt{R\_M\_ft\_v0\_s1} & v0 provenance (control), seed 1 & 110000 & 1.0000 & 1.96e-10 & 0.1142 & 0.6843 & 1.4855 \\ +\texttt{R\_M\_ft\_v1\_s1} & v1 goal transition, seed 1 & 110000 & 1.0000 & 3.00e-04 & 0.0512 & 0.6802 & 1.4966 \\ +\texttt{R\_M\_ft\_v2\_s1} & v2 arrival only, seed 1 & 110000 & --- & 3.59e-15 & 0.0000 & 0.6779 & 1.4915 \\ +\texttt{R\_M\_ft\_v3\_s1} & v3 final segment, seed 1 & 110000 & 0.9997 & 1.25e-02 & 0.6260 & 0.6801 & 1.4964 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Chained-hop / stitch control re-measured on every fine-tuned checkpoint (\texttt{scripts/real/stitch\_multihop.py}, $\beta_{hi}{=}0.99$, hop $=100$ frames, 256 anchors). The reward changed, so this control cannot be inherited from \texttt{R\_M}. Sources: \texttt{status/real/stitch\_multihop\_R\_M\_ft\_*.json}.} +\label{tab:ftchain} +\begin{tabular}{lrrrrr}\toprule +cell & splice ratio & rhead @1 hop & @2 & @4 & @8 \\\midrule +\texttt{R\_M\_ft\_v0} & 0.8531 & 3.03e-10 & 4.19e-10 & 6.30e-14 & 8.95e-29 \\ +\texttt{R\_M\_ft\_v1} & 0.8531 & 4.95e-31 & 2.37e-18 & 1.15e-35 & 0.00e+00 \\ +\texttt{R\_M\_ft\_v2} & 0.8531 & 1.71e-11 & 3.59e-12 & 5.95e-39 & 0.00e+00 \\ +\texttt{R\_M\_ft\_v3} & 0.8531 & 6.63e-03 & 9.82e-03 & 5.65e-03 & 4.88e-25 \\ +\texttt{R\_M\_ft\_v0\_s1} & 0.8531 & 4.38e-10 & 1.97e-10 & 3.48e-17 & 3.29e-24 \\ +\texttt{R\_M\_ft\_v1\_s1} & 0.8531 & 3.06e-10 & 3.56e-12 & 5.17e-26 & 0.00e+00 \\ +\texttt{R\_M\_ft\_v2\_s1} & 0.8531 & 2.56e-18 & 2.05e-26 & 1.14e-36 & 0.00e+00 \\ +\texttt{R\_M\_ft\_v3\_s1} & 0.8531 & 5.42e-03 & 2.06e-01 & 8.60e-01 & 1.00e+00 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Open-loop best-of-128 selection with the RISE recipe, fine-tuned reward heads. Every column in a block ranks the SAME 128 candidate chunks at the SAME state (one proposal pass per proposer; \texttt{scorer\_openloop.py --rsm-ckpt-extra}), so the comparison is paired decision by decision. Settings are exactly the flagship read-out of \texttt{status/real/openloop\_S0Aidql\_*}: $N{=}128$, argmax, prob read-out, $T{=}25$, mode d1 depth 1, $\beta{=}0.99$, 16 particles, stride 25, horizon 8, the 25 held-out episodes. \texttt{rsm} is the un-fine-tuned flagship \texttt{R\_M}, i.e. the tie-back control. Errors are the first-action xyz error in cm (lower is better); $\Delta$ is against greedy; \emph{rank pct} is where the pick lands in the oracle's ordering (0.5 = the sampling null). Sources: \texttt{status/real/openloop\_FT\_*/scorer\_openloop.json}.} +\label{tab:ftopenloop} +\begin{tabular}{llrrrr}\toprule +proposer & scorer & first (cm) & $\Delta$ (cm) & win vs greedy & rank pct \\\midrule +FT\_S0Aidql\_s0\_e2000\_d1\_T25\_ep6 & greedy & 0.5713 & +0.0000 & 0.000 & 0.449 \\ + & idql & 0.5358 & -0.0355 & 0.559 & 0.528 \\ + & permuted:idql & 0.5155 & -0.0558 & 0.621 & 0.573 \\ + & rsm & 0.5536 & -0.0178 & 0.517 & 0.493 \\ + & permuted:rsm & 0.5341 & -0.0372 & 0.593 & 0.547 \\ + & rsm@ft\_v0 & 0.5466 & -0.0247 & 0.545 & 0.514 \\ + & rsm@ft\_v0\_s1 & 0.5496 & -0.0217 & 0.559 & 0.530 \\ + & rsm@ft\_v1 & 0.5603 & -0.0110 & 0.559 & 0.539 \\ + & rsm@ft\_v1\_s1 & 0.5849 & +0.0136 & 0.455 & 0.481 \\ + & rsm@ft\_v2 & 0.5596 & -0.0118 & 0.538 & 0.523 \\ + & rsm@ft\_v2\_s1 & 0.5180 & -0.0534 & 0.655 & 0.603 \\ + & rsm@ft\_v3 & 0.6002 & +0.0289 & 0.434 & 0.404 \\ + & rsm@ft\_v3\_s1 & 0.5913 & +0.0200 & 0.448 & 0.439 \\ + & oracle & 0.2342 & -0.3371 & 0.993 & 1.000 \\ +\midrule +FT\_S0Aidql\_s1\_e2500\_d1\_T25 & greedy & 0.3838 & +0.0000 & 0.000 & 0.514 \\ + & idql & 0.4498 & +0.0660 & 0.406 & 0.411 \\ + & permuted:idql & 0.4031 & +0.0194 & 0.455 & 0.486 \\ + & rsm & 0.4657 & +0.0820 & 0.348 & 0.371 \\ + & permuted:rsm & 0.3902 & +0.0065 & 0.467 & 0.505 \\ + & rsm@ft\_v0 & 0.4700 & +0.0862 & 0.350 & 0.366 \\ + & rsm@ft\_v0\_s1 & 0.4580 & +0.0742 & 0.379 & 0.384 \\ + & rsm@ft\_v1 & 0.4816 & +0.0978 & 0.357 & 0.349 \\ + & rsm@ft\_v1\_s1 & 0.4761 & +0.0924 & 0.335 & 0.355 \\ + & rsm@ft\_v2 & 0.4565 & +0.0727 & 0.369 & 0.396 \\ + & rsm@ft\_v2\_s1 & 0.4886 & +0.1048 & 0.356 & 0.351 \\ + & rsm@ft\_v3 & 0.4664 & +0.0826 & 0.377 & 0.378 \\ + & rsm@ft\_v3\_s1 & 0.4511 & +0.0673 & 0.397 & 0.404 \\ + & oracle & 0.1088 & -0.2750 & 0.996 & 1.000 \\ +\midrule +FT\_S0Aidql\_s1\_e2500\_d1\_T25\_ep6 & greedy & 0.3089 & +0.0000 & 0.000 & 0.485 \\ + & idql & 0.3569 & +0.0480 & 0.386 & 0.396 \\ + & permuted:idql & 0.3158 & +0.0068 & 0.497 & 0.462 \\ + & rsm & 0.3556 & +0.0467 & 0.366 & 0.382 \\ + & permuted:rsm & 0.3173 & +0.0084 & 0.434 & 0.443 \\ + & rsm@ft\_v0 & 0.3705 & +0.0616 & 0.331 & 0.362 \\ + & rsm@ft\_v0\_s1 & 0.3696 & +0.0607 & 0.366 & 0.361 \\ + & rsm@ft\_v1 & 0.3886 & +0.0797 & 0.317 & 0.333 \\ + & rsm@ft\_v1\_s1 & 0.4200 & +0.1111 & 0.228 & 0.278 \\ + & rsm@ft\_v2 & 0.3484 & +0.0395 & 0.386 & 0.417 \\ + & rsm@ft\_v2\_s1 & 0.3515 & +0.0426 & 0.379 & 0.406 \\ + & rsm@ft\_v3 & 0.3728 & +0.0638 & 0.386 & 0.367 \\ + & rsm@ft\_v3\_s1 & 0.3479 & +0.0389 & 0.421 & 0.411 \\ + & oracle & 0.0791 & -0.2298 & 0.993 & 1.000 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{FROM-SCRATCH control runs (\texttt{R\_RW\_v*}, 100k steps from random init). Health of each reward version at its last evaluated step, read from that cell's own \texttt{runs/real\_cooking\_v5/rsm/R\_RW\_v*/history.json}. Architecture, cache, optimiser, $\beta$ band, chunk, seed and step budget are identical to \texttt{R\_M}; ONLY the per-frame reward label differs. \texttt{pos rate} is the fraction of validation anchors the label marks positive, and is the denominator the AUC has to be read against.} +\label{tab:rwhealth} +\begin{tabular}{llrrrrrr}\toprule +cell & label & step & r-auc val & r-mae val & pos rate & nnl1 ratio & vs stay \\\midrule +\texttt{R\_RW\_v0} & v0 provenance (dense) & 70000 & 1.0000 & 4.26e-10 & 0.1211 & 0.6706 & 1.4793 \\ +\texttt{R\_RW\_v1} & v1 goal transition & 65000 & 1.0000 & 1.04e-09 & 0.0588 & 0.6839 & 1.4796 \\ +\texttt{R\_RW\_v2} & v2 arrival only & 65000 & --- & 1.07e-09 & 0.0000 & 0.6863 & 1.5207 \\ +\texttt{R\_RW\_v3} & v3 final segment (all eps) & 65000 & 0.9986 & 2.36e-02 & 0.6078 & 0.6835 & 1.4787 \\ +\bottomrule\end{tabular}\end{table} +\emph{The open-loop selection comparison had not landed when this PDF was built; the cells are listed in Sec.~\ref{sec:rwstatus}.} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_reward_tables2.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_reward_tables2.tex new file mode 100644 index 0000000000000000000000000000000000000000..306f03bc16616617873e6ffaef7e8342e2cf74f1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_reward_tables2.tex @@ -0,0 +1,56 @@ +\begin{table}[htbp]\centering\footnotesize +\caption{\textbf{The reward rule, in one sentence per variant.} Counts over the whole cache (181{,}530 frames / 248 episodes, of which 50 succeed). \texttt{status/real/GOAL\_REWARD.json}; v4 in \texttt{status/real/SUCCESS\_TAIL.json}.}\label{tab:rewardrule} +\begin{tabular}{p{0.10\linewidth}p{0.52\linewidth}rrr}\toprule +variant & which frames are $+1$ & $+1$ frames & \% & eps.\ with a $+1$ \\\midrule +v0 provenance & +1 on EVERY frame of a successful episode, 0 on every frame of a failed one & 53367 & 29.398 & 50/248 \\ +v1 goal transition & +1 on every frame of the last run heading into state 4 (the whole 3$\to$4 segment: approach, pour, pan return) & 30292 & 16.687 & 50/248 \\ +v2 arrival & +1 only on the single frame where the operator declares state 4 (the last frame of the episode) & 50 & 0.028 & 50/248 \\ +v3 final segment & +1 on the final segment of EVERY episode, successful or not & 109110 & 60.106 & 248/248 \\ +v4 success tail & $+1$ from the success marker to the end of a successful episode --- \emph{identically equal to v2 here}: the marker IS the last frame in all 50 (\texttt{SUCCESS\_TAIL.json}, tail $=1$ frame for every episode) & 50 & 0.028 & 50/248 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\footnotesize +\caption{\textbf{Reward head after the 10k-step warm-start fine-tune} (step 110000; \texttt{runs/real\_cooking\_v5/rsm/R\_M\_ft\_[\_s1]/history.json}, last entry). \emph{AUC} = held-out separation of $+1$ from $0$ frames by $R(z)$; \emph{pos}/\emph{neg} are its mean predictions on those two sets; \emph{succ AUC} is the value's separation of successful from failed episodes --- 1.000 for v0 only because v0's label IS episode success.}\label{tab:rheadcal} +\begin{tabular}{lrrrrrr}\toprule +cell & $R$ AUC (val) & $R$ MAE & mean $R$ on $+1$ & mean $R$ on $0$ & succ AUC & CFM val \\\midrule +R\_M\_ft\_v0 & 1.0000 & 0.0000 & 1.0000 & 0.0000 & 1.0000 & 1.0526 \\ +R\_M\_ft\_v0\_s1 & 1.0000 & 0.0000 & 1.0000 & 0.0000 & 1.0000 & 1.0648 \\ +R\_M\_ft\_v1 & 1.0000 & 0.0029 & 0.9999 & 0.0032 & 0.7677 & 1.0490 \\ +R\_M\_ft\_v1\_s1 & 1.0000 & 0.0003 & 1.0000 & 0.0003 & 0.7785 & 1.0418 \\ +R\_M\_ft\_v2 & nan & 0.0000 & nan & 0.0000 & 0.3316 & 1.0560 \\ +R\_M\_ft\_v2\_s1 & nan & 0.0000 & nan & 0.0000 & 0.6694 & 1.0358 \\ +R\_M\_ft\_v3 & 0.9994 & 0.0142 & 0.9921 & 0.0245 & 0.4187 & 1.0480 \\ +R\_M\_ft\_v3\_s1 & 0.9997 & 0.0125 & 0.9937 & 0.0230 & 0.4111 & 1.0598 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\footnotesize +\caption{\textbf{Stitch control and the reward head on rolled-out states} (\texttt{scripts/real/stitch\_multihop.py} $\to$ \texttt{status/real/stitch\_multihop\_R\_M\_ft\_.json}). \emph{ratio} = splice jump / one-hop motion at the cross-trajectory splice; its control is the same measurement inside a single route (\texttt{route1\_control\_median}, $\approx 1$ means the splice is not special. Columns 4--6 are one 100-frame hop from held-out states: distance to the model's own future, to the goal region, and to a random pool. \emph{sat} = fraction of rolled-out states on which the reward logit is saturated.}\label{tab:stitchft} +\begin{tabular}{lrrrrrrr}\toprule +cell & ratio & control & own fut. & goal reg. & rand.\ pool & mean $R$ & sat \\\midrule +R\_M\_ft\_v0 & 0.8531 & 1.0189 & 0.595 & 1.011 & 0.654 & 3.03e-10 & 1.00 \\ +R\_M\_ft\_v0\_s1 & 0.8531 & 1.0189 & 0.589 & 1.021 & 0.652 & 4.38e-10 & 1.00 \\ +R\_M\_ft\_v1 & 0.8531 & 1.0189 & 0.594 & 1.012 & 0.654 & 4.95e-31 & 1.00 \\ +R\_M\_ft\_v1\_s1 & 0.8531 & 1.0189 & 0.588 & 1.017 & 0.649 & 3.06e-10 & 1.00 \\ +R\_M\_ft\_v2 & 0.8531 & 1.0189 & 0.593 & 1.011 & 0.652 & 1.71e-11 & 1.00 \\ +R\_M\_ft\_v2\_s1 & 0.8531 & 1.0189 & 0.587 & 1.019 & 0.648 & 2.56e-18 & 1.00 \\ +R\_M\_ft\_v3 & 0.8531 & 1.0189 & 0.595 & 1.012 & 0.654 & 6.63e-03 & 0.96 \\ +R\_M\_ft\_v3\_s1 & 0.8531 & 1.0189 & 0.586 & 1.021 & 0.649 & 5.42e-03 & 0.93 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\footnotesize +\caption{\textbf{Open-loop best-of-128 screen, S0Aidql seed 1 @ epoch 2500} (\texttt{scripts/real/scorer\_openloop.py}, N=128 diffusion candidates, argmax, prob read-out, $T{=}25$, d1, $\beta{=}0.99$; 25 held-out episodes, 705 decisions). Every scorer ranks the SAME 128 candidates at the SAME state, so the comparison is paired. \emph{first} = cm between the chosen first action and the logged expert action (lower is closer to the demonstrator); \emph{$\Delta$ vs ft\_v0} is the paired mean difference $\pm$ s.e.; \emph{rank} is the chosen candidate's percentile in the oracle ordering (0.5 = chance). Source: \texttt{status/real/openloop\_FT\_S0Aidql\_s1\_e2500\_d1\_T25/}.}\label{tab:olFTS0Aidqls1e2500d1T25} +\begin{tabular}{lrrrrr}\toprule +scorer & first (cm) & $\Delta$ vs ft\_v0 (cm) & win vs ft\_v0 & win vs greedy & rank pct \\\midrule +greedy (plain sample) & 0.3838 & -0.0862 $\pm$ 0.0117 & 0.644 & 0.000 & 0.5138 \\ +IDQL critic & 0.4498 & -0.0202 $\pm$ 0.0129 & 0.513 & 0.406 & 0.4114 \\ +\quad permuted control & 0.4031 & -0.0669 $\pm$ 0.0105 & 0.635 & 0.455 & 0.4858 \\ +RSM flagship R\_M (100k, v0 labels) & 0.4657 & -0.0043 $\pm$ 0.0066 & 0.187 & 0.348 & 0.3714 \\ +\quad permuted control & 0.3902 & -0.0798 $\pm$ 0.0109 & 0.635 & 0.467 & 0.5055 \\ +\midrule +RSM ft v0 & 0.4700 & +0.0000 $\pm$ 0.0000 & 0.000 & 0.350 & 0.3663 \\ +RSM ft v0\_s1 & 0.4580 & -0.0121 $\pm$ 0.0083 & 0.284 & 0.379 & 0.3838 \\ +RSM ft v1 & 0.4816 & +0.0116 $\pm$ 0.0102 & 0.400 & 0.357 & 0.3489 \\ +RSM ft v1\_s1 & 0.4761 & +0.0061 $\pm$ 0.0110 & 0.418 & 0.335 & 0.3549 \\ +RSM ft v2 & 0.4565 & -0.0135 $\pm$ 0.0113 & 0.468 & 0.369 & 0.3956 \\ +RSM ft v2\_s1 & 0.4886 & +0.0186 $\pm$ 0.0110 & 0.427 & 0.356 & 0.3514 \\ +RSM ft v3 & 0.4664 & -0.0036 $\pm$ 0.0117 & 0.460 & 0.377 & 0.3783 \\ +RSM ft v3\_s1 & 0.4511 & -0.0190 $\pm$ 0.0123 & 0.511 & 0.397 & 0.4037 \\ +oracle (best of the 128) & 0.1088 & --- & --- & 0.996 & 1.0000 \\ +\bottomrule\end{tabular}\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_selected_params.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_selected_params.tex new file mode 100644 index 0000000000000000000000000000000000000000..fc79dff232edfa33b11146cd405aeba1ac8189ac --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_selected_params.tex @@ -0,0 +1,41 @@ +\begin{table}[t] +\centering +\caption{\textbf{What was swept for the RSM column.} Values evaluated on that task, with the number of cells behind each in parentheses; the \textbf{bold} entry is the arm Table~\ref{tab:flagship} reports. A value needs 9 cells (3 policy $\times$ 3 evaluation seeds) to be a complete arm, so a value with fewer was TOUCHED, not swept. $\beta$ is genuinely swept: all three values carry 57--185 cells on every row. $\gamma$ is not: 180--295 cells sit at $0.99$ on every row while the alternatives carry 3--23, so our $\gamma$ coverage is effectively ONE fully-seeded point per row against five horizons for both world models -- and Thread (Cov.), the row we lose, is one of those rows.} +\label{tab:selected} +\footnotesize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{@{}lp{3.1cm}p{3.4cm}p{1.9cm}c@{}} +\toprule +Task & $\beta$ grid & $\gamma$ grid & $P$ grid & read-out \\ +\midrule +Square (Sub.) & 0.9\,{\scriptsize(81)}, 0.95\,{\scriptsize(90)}, \textbf{0.98\,{\scriptsize(63)}} & 0.95\,{\scriptsize(9)}, 0.98\,{\scriptsize(18)}, \textbf{0.99\,{\scriptsize(180)}}, 0.995\,{\scriptsize(27)} & 8\,{\scriptsize(54)}, \textbf{16\,{\scriptsize(126)}}, 64\,{\scriptsize(54)} & \textbf{logit}, prob \\ +Square (Cov.) & \textbf{0.9\,{\scriptsize(77)}}, 0.95\,{\scriptsize(87)}, 0.98\,{\scriptsize(60)} & 0.95\,{\scriptsize(8)}, 0.98\,{\scriptsize(18)}, \textbf{0.99\,{\scriptsize(180)}}, 0.995\,{\scriptsize(18)} & 8\,{\scriptsize(54)}, \textbf{16\,{\scriptsize(116)}}, 64\,{\scriptsize(54)} & logit, \textbf{prob} \\ +Piece (Sub.) & 0.9\,{\scriptsize(79)}, \textbf{0.95\,{\scriptsize(89)}}, 0.98\,{\scriptsize(62)} & 0.95\,{\scriptsize(9)}, 0.98\,{\scriptsize(18)}, \textbf{0.99\,{\scriptsize(180)}}, 0.995\,{\scriptsize(23)} & \textbf{8\,{\scriptsize(54)}}, 16\,{\scriptsize(122)}, 64\,{\scriptsize(54)} & logit, \textbf{prob} \\ +Piece (Cov.) & 0.9\,{\scriptsize(78)}, 0.95\,{\scriptsize(88)}, \textbf{0.98\,{\scriptsize(62)}} & 0.95\,{\scriptsize(9)}, 0.98\,{\scriptsize(16)}, \textbf{0.99\,{\scriptsize(180)}}, 0.995\,{\scriptsize(23)} & 8\,{\scriptsize(54)}, \textbf{16\,{\scriptsize(120)}}, 64\,{\scriptsize(54)} & logit, \textbf{prob} \\ +Mug (Sub.) & 0.9\,{\scriptsize(90)}, 0.95\,{\scriptsize(99)}, \textbf{0.98\,{\scriptsize(72)}} & 0.95\,{\scriptsize(9)}, 0.98\,{\scriptsize(18)}, \textbf{0.99\,{\scriptsize(207)}}, 0.995\,{\scriptsize(27)} & 8\,{\scriptsize(54)}, \textbf{16\,{\scriptsize(153)}}, 64\,{\scriptsize(54)} & \textbf{logit}, prob \\ +Thread (Cov.) & 0.9\,{\scriptsize(90)}, 0.95\,{\scriptsize(189)}, \textbf{0.98\,{\scriptsize(72)}} & 0.95\,{\scriptsize(9)}, 0.98\,{\scriptsize(18)}, \textbf{0.99\,{\scriptsize(297)}}, 0.995\,{\scriptsize(27)} & \textbf{8\,{\scriptsize(90)}}, 16\,{\scriptsize(171)}, 64\,{\scriptsize(90)} & logit, \textbf{prob} \\ +Piece-tip (Cov.) & 0.9\,{\scriptsize(81)}, \textbf{0.95\,{\scriptsize(90)}}, 0.98\,{\scriptsize(63)} & 0.95\,{\scriptsize(9)}, 0.98\,{\scriptsize(18)}, \textbf{0.99\,{\scriptsize(180)}}, 0.995\,{\scriptsize(27)} & 8\,{\scriptsize(54)}, \textbf{16\,{\scriptsize(126)}}, 64\,{\scriptsize(54)} & logit, \textbf{prob} \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{The selected setting, and what the chain actually did.} $p$ is the continuation probability at the chosen $(\beta,\gamma)$: the walk stops with probability $1-p$ at each step, so the hop count is geometric with $E[N]=p/(1-p)$. \emph{Hops (meas.)} is the mean the walk ACTUALLY took, recorded per decision by the scorer rather than configured; it agrees with $E[N]$ to within a few per cent on every row, which is the evidence that the sampler implements the walk it claims. \emph{Cap} is the depth at which the coin leaves a $10^{-3}$ tail and is derived from $(\beta,\gamma)$ rather than chosen; the capped fraction is below $1$\% on every reported row. Note that four of seven rows select a continuation probability near $0.5$ and therefore run about ONE hop, so on those rows the recursion barely engages.} +\label{tab:selected_chain} +\small +\setlength{\tabcolsep}{5pt} +\begin{tabular}{@{}lccccc@{}} +\toprule +Task & $p$ & Hops (meas.) & $E[N]$ & Cap \\ +\midrule +Square (Sub.) & $0.505$ & $1.02$ & $1.02$ & $11$ \\ +Square (Cov.) & $0.909$ & $9.98$ & $10.00$ & $73$ \\ +Piece (Sub.) & $0.808$ & $4.21$ & $4.21$ & $33$ \\ +Piece (Cov.) & $0.505$ & $1.01$ & $1.02$ & $11$ \\ +Mug (Sub.) & $0.505$ & $1.00$ & $1.02$ & $11$ \\ +Thread (Cov.) & $0.505$ & $1.03$ & $1.02$ & $11$ \\ +Piece-tip (Cov.) & $0.808$ & $4.20$ & $4.21$ & $33$ \\ +\bottomrule +\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_stitch_and_cal.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_stitch_and_cal.tex new file mode 100644 index 0000000000000000000000000000000000000000..9fe8449bdb3dd035fc389e8fcf642844d9b53d32 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_stitch_and_cal.tex @@ -0,0 +1,16 @@ +\begin{table}[htbp]\centering\small +\caption{\textbf{Health of every fine-tuned reward head}, from \texttt{status/real/REWARD\_FT\_NUMBERS.json}. \emph{R-head AUC} separates that variant's own positive frames from its negatives on the held-out episodes --- it says the head learned the labels it was given, nothing more. \emph{CFM} is the flow-matching loss and \emph{nnl1 vs stay} the chained-sample distance divided by the hold-still control ($>1$ = worse than standing still). The stitch columns are the cross-trajectory control of \texttt{scripts/real/stitch\_multihop.py} (\texttt{status/real/stitch\_multihop\_R\_M\_ft\_*.json}): \emph{ratio} is the route-2 $\to$ route-3 splice distance over the within-route reference and \emph{control} the same quantity for the route-1 splice, which must be worse.}\label{tab:rheadcal} +\begin{tabular}{lrrrrrrr}\toprule +variant & step & R-head AUC & CFM & nnl1 vs stay & stitch ratio & control & $R$ logit \\\midrule +v0 & 110000 & 1.0000 & 1.053 & 1.497 & 0.853 & 1.019 & -24.2 \\ +v0\_s1 & 110000 & 1.0000 & 1.065 & 1.485 & 0.853 & 1.019 & -24.7 \\ +v1 & 110000 & 1.0000 & 1.049 & 1.496 & 0.853 & 1.019 & -124.1 \\ +v1\_s1 & 110000 & 1.0000 & 1.042 & 1.497 & 0.853 & 1.019 & -44.5 \\ +v2 & 110000 & -- & 1.056 & 1.498 & 0.853 & 1.019 & -44.8 \\ +v2\_s1 & 110000 & -- & 1.036 & 1.492 & 0.853 & 1.019 & -151.7 \\ +v3 & 110000 & 0.9994 & 1.048 & 1.495 & 0.853 & 1.019 & -33.4 \\ +v3\_s1 & 110000 & 0.9997 & 1.060 & 1.496 & 0.853 & 1.019 & -26.2 \\ +\bottomrule\end{tabular}\end{table} + +\noindent\textbf{Read the AUC column with care.} An AUC of 1.000 means the head reproduces \emph{its own} labels perfectly; for v0 those labels are ``this episode succeeded'', which is decidable from provenance alone. v2's AUC is \texttt{NaN} because its 50 positive frames all fall in the training split (2 in validation, both in one episode). What the head can actually \emph{discriminate} is the subject of the next section. + diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_succ_tables.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_succ_tables.tex new file mode 100644 index 0000000000000000000000000000000000000000..39450096c492bc11e0acf12a7921de623c92385c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_succ_tables.tex @@ -0,0 +1,91 @@ +\begin{table}[htbp]\centering\small +\caption{Successor-model register on \texttt{cache/real\_cooking\_v5}. Every cell is \texttt{rsm\_libero/train\_rsm.py} launched through \texttt{scripts/rr\_rsm.sh}; the knobs are read back from each checkpoint's own \texttt{config} blob, not from the launcher. Checkpoint paths are absolute. Source: \texttt{status/real/SUCCESSOR\_NUMBERS.json}.} +\label{tab:cells} +\begin{tabular}{llrrrrrl}\toprule +cell & reward & width & chunk & trunc & seed & step & W\&B \\\midrule +\texttt{R\_M} & dense & 1024 & 8 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/4e6f56148cd80f58}{4e6f5614} \\ +\texttt{R\_M\_s1} & dense & 1024 & 8 & 0.02 & 1 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/c13cbda5e9e3cb6b}{c13cbda5} \\ +\texttt{R\_M\_notrunc} & dense & 1024 & 8 & 0.99 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/d37fb62fc406cb9b}{d37fb62f} \\ +\texttt{R\_M\_notrunc\_s1} & dense & 1024 & 8 & 0.99 & 1 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/4df9f838227d899d}{4df9f838} \\ +\texttt{R\_M\_chunk20} & dense & 1024 & 20 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/2b54a724b2ab44df}{2b54a724} \\ +\texttt{R\_M\_rterm40} & terminal k=40 & 1024 & 8 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/e76fc56d072b7ac3}{e76fc56d} \\ +\texttt{R\_M\_rterm40st} & terminal k=40 & 1024 & 8 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/0042c325f6059e99}{0042c325} \\ +\texttt{R\_M\_rterm120} & terminal k=120 & 1024 & 8 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/5298fdfc68179666}{5298fdfc} \\ +\texttt{R\_L40} & dense & 1536 & 8 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/2b937e092fd6e1bd}{2b937e09} \\ +\texttt{R\_L40\_notrunc} & dense & 1536 & 8 & 0.99 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/a04d4f2d81d3c268}{a04d4f2d} \\ +\texttt{R\_XL} & dense & 2048 & 8 & 0.02 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/26b079eadd888e90}{26b079ea} \\ +\texttt{R\_XL\_notrunc} & dense & 2048 & 8 & 0.99 & 0 & 100000 & \href{https://wandb.ai/richardrl/rsm_rise/runs/061ec9fb1495bd36}{061ec9fb} \\ +\texttt{R\_RW\_v0} & v0\_provenance & 1024 & 8 & 0.02 & 0 & 70000 & --- \\ +\texttt{R\_RW\_v1} & v1\_goaltrans & 1024 & 8 & 0.02 & 0 & 65000 & --- \\ +\texttt{R\_RW\_v2} & v2\_arrival & 1024 & 8 & 0.02 & 0 & 65000 & --- \\ +\texttt{R\_RW\_v3} & v3\_finalseg & 1024 & 8 & 0.02 & 0 & 65000 & --- \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Health numbers at the final step of each cell, all read from that cell's own \texttt{history.json} (the trainer's held-out evaluation). \texttt{cfm} is the flow matching validation loss; \texttt{r-auc}/\texttt{r-mae} the reward head on the validation episodes; \texttt{nnl1 ratio} the successor sample's nearest-neighbour $L_1$ to the episode's own future divided by the same distance to a random pool (lower is better, $1.0$ = no better than random); \texttt{vs stay} the same ratio against the hold-still predictor (>1 means the sample is FARTHER from the future than simply staying put); \texttt{win} the fraction of validation anchors where the logged action outranks a random one.} +\label{tab:health} +\begin{tabular}{lrrrrrrr}\toprule +cell & cfm val & r-auc val & r-mae val & nnl1 ratio & vs stay & minmse & win \\\midrule +\texttt{R\_M} & 1.0618 & 1.0000 & 1.14e-09 & 0.6668 & 1.4986 & 0.6911 & 0.9326 \\ +\texttt{R\_M\_s1} & 1.0498 & 1.0000 & 2.68e-10 & 0.6759 & 1.4907 & 0.6776 & 0.9922 \\ +\texttt{R\_M\_notrunc} & 1.0565 & 1.0000 & 5.57e-11 & 0.6797 & 1.5155 & 0.6960 & 0.9912 \\ +\texttt{R\_M\_notrunc\_s1} & 1.0276 & 1.0000 & 6.66e-10 & 0.6893 & 1.4934 & 0.6996 & 0.9316 \\ +\texttt{R\_M\_chunk20} & 1.0461 & 1.0000 & 7.65e-10 & 0.6701 & 1.4778 & 0.6866 & 0.9922 \\ +\texttt{R\_M\_rterm40} & 1.0494 & nan & 3.72e-03 & 0.6796 & 1.5151 & 0.6850 & 0.9805 \\ +\texttt{R\_M\_rterm40st} & 1.0955 & nan & 1.95e-06 & 0.6812 & 1.5289 & 0.7197 & 0.9951 \\ +\texttt{R\_M\_rterm120} & 1.0458 & 1.0000 & 1.18e-02 & 0.6730 & 1.4729 & 0.6884 & 0.9922 \\ +\texttt{R\_L40} & 0.8407 & 1.0000 & 8.05e-11 & 0.6270 & 1.3453 & 0.4742 & 0.8916 \\ +\texttt{R\_L40\_notrunc} & 0.8368 & 1.0000 & 1.26e-10 & 0.6270 & 1.3823 & 0.4811 & 0.9697 \\ +\texttt{R\_XL} & 0.7914 & 1.0000 & 4.60e-10 & 0.5873 & 1.2720 & 0.4267 & 0.4932 \\ +\texttt{R\_XL\_notrunc} & 0.7835 & 1.0000 & 1.54e-09 & 0.5914 & 1.2942 & 0.4421 & 0.9893 \\ +\texttt{R\_RW\_v0} & 1.0557 & 1.0000 & 4.26e-10 & 0.6706 & 1.4793 & 0.6929 & 0.9297 \\ +\texttt{R\_RW\_v1} & 1.0611 & 1.0000 & 1.04e-09 & 0.6839 & 1.4796 & 0.6821 & 0.6494 \\ +\texttt{R\_RW\_v2} & 1.0664 & nan & 1.07e-09 & 0.6863 & 1.5207 & 0.6965 & 0.5273 \\ +\texttt{R\_RW\_v3} & 1.0650 & 0.9986 & 2.36e-02 & 0.6835 & 1.4787 & 0.6811 & 0.7490 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Open-loop selection on the \texttt{S0Aidql} proposers, 128 candidates per decision, 705 decisions over the 25 validation episodes, \emph{after} the frame-history fix (\#263 comment 5769487243). Errors are the xyz $L_2$ of the chosen first action against the logged one, in cm. $\Delta$ is against greedy (negative = better). \texttt{rank} is the mean oracle-rank percentile of the chosen candidate (0.5 = blind). Source files: \texttt{status/real/openloop\_*/scorer\_openloop.json}.} +\label{tab:openloop} +\begin{tabular}{llrrrr}\toprule +cell & scorer & first (cm) & $\Delta$ (cm) & win vs greedy & rank pct \\\midrule +S0Aidql\_s0\_e2000\_d1\_d1\_T25 & greedy & 0.5697 & +0.0000 & 0.000 & 0.504 \\ + & idql & 0.5269 & -0.0427 & 0.580 & 0.590 \\ + & permuted:idql & 0.5624 & -0.0073 & 0.499 & 0.517 \\ + & rsm & 0.6123 & +0.0426 & 0.445 & 0.468 \\ + & permuted:rsm & 0.5714 & +0.0017 & 0.489 & 0.502 \\ + & oracle & 0.1960 & -0.3736 & 0.983 & 1.000 \\ +\midrule +S0Aidql\_s0\_e2000\_fold\_d4\_T25 & greedy & 0.5678 & +0.0000 & 0.000 & 0.507 \\ + & idql & 0.5224 & -0.0454 & 0.577 & 0.592 \\ + & permuted:idql & 0.5687 & +0.0009 & 0.501 & 0.497 \\ + & rsm & 0.6134 & +0.0456 & 0.458 & 0.461 \\ + & permuted:rsm & 0.5779 & +0.0102 & 0.474 & 0.490 \\ + & oracle & 0.1968 & -0.3710 & 0.990 & 1.000 \\ +\midrule +S0Aidql\_s1\_e2500\_d1\_d1\_T25 & greedy & 0.3975 & +0.0000 & 0.000 & 0.492 \\ + & idql & 0.4556 & +0.0581 & 0.401 & 0.400 \\ + & permuted:idql & 0.3933 & -0.0043 & 0.477 & 0.489 \\ + & rsm & 0.4622 & +0.0647 & 0.379 & 0.376 \\ + & permuted:rsm & 0.3907 & -0.0069 & 0.487 & 0.489 \\ + & oracle & 0.1081 & -0.2894 & 0.994 & 1.000 \\ +\midrule +S0Aidql\_s1\_e2500\_fold\_d4\_T25 & greedy & 0.3978 & +0.0000 & 0.000 & 0.492 \\ + & idql & 0.4495 & +0.0517 & 0.400 & 0.410 \\ + & permuted:idql & 0.3982 & +0.0004 & 0.477 & 0.486 \\ + & rsm & 0.4601 & +0.0623 & 0.387 & 0.378 \\ + & permuted:rsm & 0.3858 & -0.0120 & 0.526 & 0.514 \\ + & oracle & 0.1086 & -0.2892 & 0.996 & 1.000 \\ +\bottomrule\end{tabular}\end{table} +\begin{table}[htbp]\centering\small +\caption{Ties in the ranking array, computed here from the per-decision score matrices \texttt{status/real/openloop\_*/scores.npz} ($705\times128$ float32). \emph{tied argmax} is the fraction of decisions where more than one candidate attains the maximum; \emph{unique} the mean number of distinct score values among the 128 candidates; \emph{range} the mean max$-$min of the score array. A saturated \texttt{prob} read-out shows itself as a small unique count and a near-zero range.} +\label{tab:ties} +\begin{tabular}{llrrrr}\toprule +cell & scorer & tied argmax & mean at max & unique / 128 & range \\\midrule +S0Aidql\_s0\_e2000\_d1\_d1\_T25 & rsm & 0.000 & 1.00 & 127.6 & 2.040e-03 \\ +S0Aidql\_s0\_e2000\_d1\_d1\_T25 & idql & 0.000 & 1.00 & 127.3 & 2.601e-01 \\ +S0Aidql\_s0\_e2000\_fold\_d4\_T25 & rsm & 0.000 & 1.00 & 127.4 & 2.155e-03 \\ +S0Aidql\_s0\_e2000\_fold\_d4\_T25 & idql & 0.000 & 1.00 & 127.2 & 2.520e-01 \\ +S0Aidql\_s1\_e2500\_d1\_d1\_T25 & rsm & 0.000 & 1.00 & 127.5 & 1.780e-03 \\ +S0Aidql\_s1\_e2500\_d1\_d1\_T25 & idql & 0.000 & 1.00 & 127.2 & 2.367e-01 \\ +S0Aidql\_s1\_e2500\_fold\_d4\_T25 & rsm & 0.000 & 1.00 & 127.4 & 1.669e-03 \\ +S0Aidql\_s1\_e2500\_fold\_d4\_T25 & idql & 0.001 & 1.00 & 127.0 & 2.326e-01 \\ +\bottomrule\end{tabular}\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/_sweeps.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_sweeps.tex new file mode 100644 index 0000000000000000000000000000000000000000..95bb9dc01944f8de1b12d88d9917750b6cfb0117 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/_sweeps.tex @@ -0,0 +1,21 @@ +\begin{table}[t] +\centering +\caption{\textbf{Search actually performed, per method per task.} Distinct evaluated arms, counted from the evaluation archive rather than asserted, so this table cannot drift from the numbers it describes. An arm is one setting of that method's knobs; each arm is run at 3 training $\times$ 3 evaluation seeds. The asymmetry is large and it does not run one way: RSM has the most arms on the rows it wins and also on Thr, which it loses, while LeWM and DINO-WM were searched far less on Sq and Pc. Each cell is \emph{arms (distinct discounts evaluated)}. Those are DIFFERENT axes and must not be read as one: the $R$ field of an arm label is $\beta$, not $\gamma$, so a method can carry hundreds of arms at a single discount --- which is what RSM and TD-Flow did until 2026-09-23, both pinned to the config default $\gamma=0.99$. \textbf{IDQL/RISE remains the starkest gap}, and for a structural reason: its discount is a TRAINING parameter, so each point is a full retrain (27--35 GPU-h, measured) rather than a re-score of a frozen model (minutes). That asymmetry, not a lack of effort, is why its column is thin; the $\gamma$ grid for it is in training and this table is regenerated from disk, never asserted. \textbf{A 4 is not always a gap.} TD-Flow reads 4 on Pc-C, Mug and Pc-tip because its pinned recipe there has $\beta=0.95$, and a $\beta$-chain needs $\beta<\gamma$ for a positive continuation probability $p=(\gamma-\beta)/(\gamma(1-\beta))$; at $\gamma=0.90$, $p=-1.11<0$ and the chain degenerates to a single draw. The launcher refuses the point on all three tasks at all three evaluation seeds (measured, not assumed), so 4 is the WHOLE admissible grid there. The fair discount grid for a $\beta$-chain estimator is narrower than for a world model, which reaches all five everywhere.} +\label{tab:sweeps} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{@{}lcccccccp{5.4cm}@{}} +\toprule +Method & Sq-S & Sq-C & Pc-S & Pc-C & Mug & Thr & Pc-tip & Axes swept \\ +\midrule +RSM & 50 (5) & 50 (5) & 37 (5) & 50 (5) & 276 (5) & 302 (5) & 50 (5) & $\beta$ $\times$ particles $\times$ read-out (prob/logit) $\times$ flow steps $\times$ $\gamma$ (\emph{evaluation-only}: the successor is discount-conditioned, so a point is a re-score); cap derived from the $10^{-3}$ tail, not chosen \\ +TD-Flow & 25 (5) & 24 (5) & 24 (5) & 22 (5) & 138 (5) & 140 (5) & 23 (5) & the RSM chain settings transferred unchanged, plus its own $\beta$ grid and the same evaluation-only $\gamma$ grid \\ +DINO-WM & 20 (5) & 20 (5) & 20 (5) & 20 (5) & 129 (5) & 134 (5) & 20 (5) & rollout horizon $H\in\{10,20,50,100,200\}$ via $\gamma$ $\times$ read-out (terminal latent / discounted sum) \\ +LeWM & 15 (5) & 15 (5) & 15 (5) & 15 (5) & 132 (5) & 134 (5) & 15 (5) & same grid as DINO-WM \\ +IDQL / RISE & 3 (1) & 2 (1) & 3 (1) & 3 (1) & 8 (1) & 42 (1) & 3 (1) & $\gamma$ only, and it is a \textbf{training} parameter: the released critic is pinned to $0.99$ (\texttt{iql\_diffusion\_config.py:75}), so every extra point is a retrain \\ +IFQL & -- & -- & -- & -- & -- & -- & -- & none --- published schedule; \textbf{dropped from the sweeps 2026-09-23} \\ +TD-MPC2 & -- & -- & -- & -- & 18 (5) & 26 (5) & -- & $\gamma$/$H$ (a \textbf{training} parameter here) $\times$ configuration (a) shared candidates / (b) own MPPI \\ +DF & -- & -- & -- & -- & 31 (5) & 41 (5) & -- & guidance scale $\times$ candidate count $\times$ horizon \\ +\bottomrule +\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.pdf b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6ed118a1da7f0166cc4673b791a64e3a69911638 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:738f5144e9b131e7ea000ac6adc51c58fc17ab6ed3ed1b4109ef5870b4039561 +size 139502 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.tex new file mode 100644 index 0000000000000000000000000000000000000000..9e3c2dd0fa29f5fde97c38c50b64a781c09c5754 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_paper.tex @@ -0,0 +1,376 @@ +% The flagship table. Generated by scripts/flagship_latex.py -- regenerate, do not edit. +% Requires only \usepackage{booktabs}; sized for ICLR's 5.5in (397.5pt) text block. + +\begin{table}[t] +\centering +\caption{\textbf{Offline RL comparison over suboptimal and play data.} RSM performs better or on-par with BC baselines and SOTA world-model-based planning and offline RL algorithms. The two methods with a horizon read-out (RSM, TD-Flow) share the coin-terminated $\beta$ chain: a walk of stochastic length with continuation $p=(\gamma-\beta)/(\gamma(1-\beta))$ and one membership read at the frozen node, whose composed frame offset is exactly $\mathrm{Geom}(1-\gamma)$, capped at the $10^{-3}$ truncation tail. It replaces the deterministic truncated fold these columns previously reported, which is kept in Table~\ref{tab:flagship_fold}; a cell whose chain re-score has not landed prints its launch state rather than the superseded number. The chain settings were selected on RSM and transferred unchanged to TD-Flow, so TD-Flow received the smaller search budget: the per-row chain search is 20--30 arms per row (particles $\times$ prob or logit read-out $\times$ the $\beta$ grid $\times$ the successor sampler's Euler-step count $\in\{4,8,16\}$, default $8$), the cap is not a hyper-parameter but the $10^{-3}$ truncation tail of the continuation coin, and $\beta$ is swept over the grid the rows already used, which training supports because the successor is $\beta$-conditioned over $[0.90,0.995]$. The reward is RISE's binary data-provenance membership label for every value estimator. \TODO{MC-value is low priority. Maybe sweep gamma in ifql}} +\label{tab:flagship} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcc|cccccc} +\toprule +% & \multicolumn{2}{c|}{no planning} & \multicolumn{6}{c}{value estimators, one proposer per row, same 128 candidates} \\ +% \cmidrule(lr){2-3} \cmidrule(lr){4-9} +Task & BC & BC-u & IDQL & IFQL & TD-Flow & LeWM & DINO-WM & RSM \\ +\midrule +Square (Sub.) & $14.4{\pm}2.2$ & $48.0{\pm}1.4$ & $43.6{\pm}1.2$ & $46.7{\pm}1.3$ & $50.0{\pm}4.8$ & $48.9{\pm}1.6$ & $50.7{\pm}2.0$ & $\mathbf{54.0{\pm}1.3}$ \\ +Square (Cov.) & $11.0{\pm}1.0$ & $3.1{\pm}0.6$ & $3.7{\pm}0.2$ & $0.7{\pm}0.4$ & $7.1{\pm}1.1$ & $3.3{\pm}0.4$ & $13.3{\pm}3.3$ & $\mathbf{20.9{\pm}2.6}$ \\ +Piece (Sub.) & $13.8{\pm}2.0$ & $33.0{\pm}1.7$ & $22.9{\pm}6.1$ & $17.8{\pm}3.1$ & $30.2{\pm}1.9$ & $32.4{\pm}1.4$ & $41.8{\pm}2.7$ & $\mathbf{47.1{\pm}3.5}$ \\ +Piece (Cov.) & $18.9{\pm}1.2$ & $25.3{\pm}2.2$ & $6.0{\pm}1.7$ & $21.1{\pm}1.9$ & $16.0{\pm}1.4$ & $18.9{\pm}1.0$ & $39.6{\pm}1.2$ & $\mathbf{48.7{\pm}0.7}$ \\ +Mug (Sub.) & $14.9{\pm}1.7$ & $4.9{\pm}0.2$ & $16.2{\pm}1.0$ & $18.4{\pm}1.0$ & $19.8{\pm}0.9$ & $18.7{\pm}2.5$ & $21.1{\pm}0.8$ & $\mathbf{23.1{\pm}2.1}$ \\ +Thread (Cov.) & $26.3{\pm}1.2$ & $1.3{\pm}0.2$ & $12.2{\pm}1.4$ & $8.4{\pm}1.2$ & $7.1{\pm}1.4$ & $9.6{\pm}1.0$ & $\mathbf{31.6{\pm}1.6}$ & $25.8{\pm}1.1$ \\ +Piece-tip (Cov.) & $2.0{\pm}1.0$ & $1.0{\pm}0.2$ & $2.9{\pm}0.6$ & $3.3{\pm}0.4$ & $1.1{\pm}0.6$ & $2.9{\pm}0.9$ & $5.1{\pm}0.6$ & $\mathbf{7.3{\pm}0.4}$ \\ +\midrule +Mean & $14.5{\pm}2.8$ & $16.7{\pm}7.1$ & $15.4{\pm}5.4$ & $16.6{\pm}5.8$ & $18.8{\pm}6.4$ & $19.2{\pm}6.3$ & $29.0{\pm}6.2$ & $\mathbf{32.4{\pm}6.6}$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Ablation: the $\beta$-recursion read-out.} The same checkpoints as Table~\ref{tab:flagship}, scored with our deterministic truncated fold instead of each method's own read-out. These are the numbers this paper reported before the read-out was corrected. The fold computed $q_k = c_k + (1-c_k)\gamma^{h} q_{k+1}$ over a FIXED $L$ hops with $q_L = 0$ ($h = 1/(1-\beta)$), which is an absorbing hitting probability over a truncated horizon, not the $\gamma$-discounted occupancy read the method claims. $L$ was chosen per row BY EVALUATION SUCCESS rather than set as a truncation guard, and on three rows it was $L=1$, where the estimator collapses to $q_0 = c_0$ -- membership at a single sampled successor state, with no chain at all. The retained-mass column is the fraction $1 - \gamma^{L h}$ of the $\gamma$-horizon that $L$ hops can see; the rest was dropped. Retained mass runs from $0.10$ to $0.98$ across the rows. RSM and TD-Flow shared the read-out, so both are shown: the correction moves both columns, which is why the chain was run for both. THE WORLD MODELS ARE HERE FOR A DIFFERENT REASON: the fold is not their planner at all, and LeWM additionally has no hop head, so it re-rolls one action sequence rather than composing hops. The $(\beta, L)$ columns describe the RSM arm; each method selected its own $L$ under the same rule. THE TWO READ-OUTS DID NOT GET THE SAME SEARCH, and the asymmetry runs AGAINST the fold shown here: the fold grid is FOUR arms per row ($L \in \{1,2,4,8\}$), while the trajectory (MPC) read-out the world-model columns carry in Table~\ref{tab:flagship} is TEN ($H \in \{10,20,50,100,200\}$ frames $\times$ terminal-state or discounted-sum read-out). So wherever a world model scores HIGHER in this table than in Table~\ref{tab:flagship}, the larger search is on the LOSING side, which strengthens the gap rather than explaining it. Nor is the horizon axis saturated: the selected $H$ is $200$ frames -- the TOP of the grid -- on three of LeWM's five non-Mug/Thread rows and on four of DINO-WM's seven, so the trajectory read-out has NOT been searched to exhaustion; the next grid point is $500$ frames ($\gamma = 0.998$) and it would have to be added for BOTH world models or the two columns stop being comparable. Any read-out comparison drawn from this table is per column and per row and does not generalise: the two world models do not agree about which read-out is better, and DINO-WM's trajectory arms are what win it Mug and Thread. This is an ablation of the READ-OUT, not a baseline table: no number in it is a claim about any method as its authors specify it. Subscripts are policy seeds.} +\label{tab:ablation_betarec} +\label{tab:flagship_fold} +\scriptsize +\begin{tabular}{lcccrrrr} +\toprule +Task & $\beta$ & $L$ & retained mass & RSM & TD-Flow & DINO-WM & LeWM \\ +\midrule +Square (Sub.) & $0.95$ & $2$ & $0.33$ & $51.3_{(3)}$ & $48.7_{(3)}$ & $47.1_{(3)}$ & $52.2_{(3)}$ \\ +Square (Cov.) & $0.95$ & $8$ & $0.80$ & $17.6_{(3)}$ & $14.7_{(3)}$ & $7.1_{(3)}$ & $2.0_{(3)}$ \\ +Piece (Sub.) & $0.90$ & $3$ & $0.26$ & $46.6_{(3)}$ & $28.2_{(3)}$ & $30.4_{(3)}$ & $19.8_{(3)}$ \\ +Piece (Cov.) & $0.98$ & $8$ & $0.98$ & $50.1_{(3)}$ & $27.1_{(3)}$ & $39.6_{(3)}$ & $13.8_{(3)}$ \\ +Mug (Sub.) & $0.90$ & $1$ & $0.10$ & $20.0_{(3)}$ & $20.7_{(3)}$ & $18.2_{(3)}$ & $15.8_{(3)}$ \\ +Thread (Cov.) & $0.90$ & $1$ & $0.10$ & $32.7_{(3)}$ & $14.0_{(3)}$ & $23.6_{(3)}$ & $8.0_{(3)}$ \\ +Piece-tip (Cov.) & $0.90$ & $1$ & $0.10$ & $6.9_{(3)}$ & $2.0_{(3)}$ & $2.6_{(3)}$ & $3.1_{(3)}$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{What Table~\ref{tab:flagship} holds fixed across methods.} Each line is enforced by the evaluation pipeline or filtered on by the table loader; the last line is the one factor that differs between value estimators and is therefore part of what the comparison measures. The read-out is held IDENTICAL across the two methods that have one (RSM and TD-Flow); the reward for every value estimator is RISE's binary data-provenance membership label, and the retired oracle progress head appears in no table in this paper.} +\label{tab:controls} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{@{}p{2.25cm}p{10.7cm}@{}} +\toprule +Controlled factor & Setting \\ +\midrule +Proposer & one actor per row, shared by every planning column: the RISE actor on every row except Mug (Sub.): BC-expert; Thread (Cov.): IDQL policy@500; chosen by planning performance and disclosed \\ +Candidate set & $128$ action chunks per decision step from that proposer; every value estimator ranks the same draws (common random numbers per evaluation seed), argmax selection \\ +Reward & RISE's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on every frame of a suboptimal one), unchanged, for every value estimator; BC/BC-u use none \\ +Training data & the row's released expert$+$suboptimal file for every learned component (BC: its expert half; BC-u and all value estimators: the union); no extra data unless the row says regenerated \\ +Evaluation & same simulator, same canonical initial-state region, same success criterion (the paper's relaxed mug criterion), horizon $400$, $50$ episodes per cell \\ +Seeds & $3$ policy $\times$ $3$ evaluation seeds per cell; an evaluation seed varies the action draws and the environment initial conditions \\ +Scorer budget & RSM, TD-Flow, LeWM, DINO-WM: $100$k gradient steps on the same cache; IDQL/RISE critic co-trained with the actor; IFQL its published schedule \\ +Read-out & RSM and TD-Flow share the coin-terminated $\beta$ chain: per particle the walk hops a $\mathrm{Bernoulli}(p)$ number of times with $p = (\gamma-\beta)/(\gamma(1-\beta))$ and membership is read once at the frozen node, so the composed frame offset is exactly $\mathrm{Geom}(1-\gamma)$; the loop cap is set by the $10^{-3}$ truncation tail ($p^{L}\le 10^{-3}$), not tuned. The world models are read as MPC and not through our fold: from each candidate the model is rolled open-loop for $H = 1/(1-\gamma)$ frames -- $\lceil H/8 \rceil$ chunks, the action sequence past the first chunk being the proposer's own continuation -- and scored with the same reward head every other column uses (terminal-state and discounted-sum read-out). $H$ was swept through the discount, $\gamma \in \{0.90,0.95,0.98,0.99,0.995\}$ giving $H \in \{10,20,50,100,200\}$ frames; the selected $H$ is DINO-WM $\in\{10,100,200\}$, LeWM $\in\{10,50,200\}$ (\texttt{status/q273/wm\_mpc\_arm\_dump.json}). The superseded $R\beta$-$L$ cells, which folded $L \in \{1,2,4,8\}$ open-loop chunks with the per-hop discount $\gamma^{8}$ and selected $L$ per row by success, are retired into Table~\ref{tab:ablation_betarec}. The critics (IDQL/RISE, IFQL) have no horizon read-out at all \\ +\emph{Not controlled} & the observation each value estimator scores: frozen DINOv2 features of the two camera frames (RSM, IFQL, TD-Flow, DINO-WM), raw $84$ px frames (LeWM), the actor's own image encoder (IDQL/RISE critic) \\ +Proposer (new baselines) & Diffusion Forcing and TD-MPC2 configuration (b) are $\emph{planners}$: they propose their own actions and therefore do NOT share the $128$-candidate draw, so their search budget is their own and is disclosed in Table~\ref{tab:searchsize}. TD-MPC2 configuration (a) does share it: it ranks the same $128$ chunks from the same actor with common random numbers, and is the only one of the three that is a drop-in value estimator -- which makes it close to DINO-WM with a value head, and it is reported as such \\ +Reward (new baselines) & unchanged -- RISE's binary data-provenance label. DF's guidance is computed from its own predicted reward channel trained on that label; TD-MPC2's learned reward head is trained on it. No other signal (goal, progress, distance) enters either method \\ +Training data (new baselines) & the same task cache as DINO-WM: the pooled DINOv2 state ($z$ plus proprioception, normalised by the cache's own \texttt{feat\_stats}) and the $7$-d OSC action, same episode split. Neither new baseline saw pixels and neither saw an episode the other columns did not \\ +Health (new baselines) & every new-baseline score is printed beside a rollout-fidelity number at its OWN row horizon, read against the stay-put predictor on the same pairs. The two fidelities are NOT comparable with each other and are never put in one column: DF predicts observations, so its number is an observation-space RMSE; TD-MPC2's world model is implicit and has no decoder, so its number is the latent analogue. A row whose rollout is no better than standing still carries that flag next to its score \\ +\bottomrule +\end{tabular} +\end{table} +\begin{table}[t] +\centering +\caption{\textbf{Search size per decision, disclosed.} A planning column's score is a joint result of its value estimate AND how much search it is allowed; these are not interchangeable and the table states both. ``Candidates'' is how many distinct action sequences the column evaluates per decision; ``model rollouts'' is how many times a learned dynamics model is rolled. A column that proposes its own actions is marked \emph{planner} and is not a $128$-candidate column in any sense. Per $400$-frame episode at the defaults the shared-candidate columns evaluate $50 \times 128 = 6\,400$ action sequences, Diffusion Forcing diffuses $50$ plans of $n_{\mathrm{plans}}$, and TD-MPC2 configuration (b) rolls $134 \times 3\,072 \approx 4.1\times10^{5}$ latent trajectories while re-committing every $3$ frames rather than every $8$.} +\label{tab:searchsize} +\scriptsize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{@{}p{1.95cm}p{2.25cm}p{2.25cm}p{1.85cm}p{4.2cm}@{}} +\toprule +Column & Proposer & Candidates / decision & Model rollouts / decision & Note \\ +\midrule +RSM, TD-Flow & shared actor & $128$ & $128 \times M$ particles & the $\beta$ chain; cap from the $10^{-3}$ truncation tail \\ +DINO-WM, LeWM & shared actor & $128$ & $128 \times L$ chunks & $L$ selected per row by success \\ +IDQL / RISE, IFQL & shared actor & $128$ & $0$ (critic, no rollout) & \\ +TD-MPC2 (a) & shared actor & $128$ & $128 \times 1$ & deterministic latent model: particles do nothing, so this column spends LESS than the RSM column at the same nominal particle count \\ +Diffusion Forcing & \emph{planner} & $n_{\mathrm{plans}}$ diffused plans & one per plan & guidance scale swept; the swept values are part of this budget and are listed beside the score \\ +TD-MPC2 (b) & \emph{planner}, RISE actor as prior & $S$ samples $\times$ $I$ iterations & $S \times I$ & defaults $S{=}512$, $I{=}6$, $H_p{=}3$, $24$ prior trajectories from the shared actor: $3072$ rollouts per plan, replanned every $\min(8,H_p){=}3$ frames \\ +\bottomrule +\end{tabular} +\end{table} +\begin{table}[t] +\centering +\caption{\textbf{Search actually performed, per method per task.} Distinct evaluated arms, counted from the evaluation archive rather than asserted, so this table cannot drift from the numbers it describes. An arm is one setting of that method's knobs; each arm is run at 3 training $\times$ 3 evaluation seeds. The asymmetry is large and it does not run one way: RSM has the most arms on the rows it wins and also on Thr, which it loses, while LeWM and DINO-WM were searched far less on Sq and Pc. Each cell is \emph{arms (distinct discounts evaluated)}. Those are DIFFERENT axes and must not be read as one: the $R$ field of an arm label is $\beta$, not $\gamma$, so a method can carry hundreds of arms at a single discount --- which is what RSM and TD-Flow did until 2026-09-23, both pinned to the config default $\gamma=0.99$. \textbf{IDQL/RISE remains the starkest gap}, and for a structural reason: its discount is a TRAINING parameter, so each point is a full retrain (27--35 GPU-h, measured) rather than a re-score of a frozen model (minutes). That asymmetry, not a lack of effort, is why its column is thin; the $\gamma$ grid for it is in training and this table is regenerated from disk, never asserted. \textbf{A 4 is not always a gap.} TD-Flow reads 4 on Pc-C, Mug and Pc-tip because its pinned recipe there has $\beta=0.95$, and a $\beta$-chain needs $\beta<\gamma$ for a positive continuation probability $p=(\gamma-\beta)/(\gamma(1-\beta))$; at $\gamma=0.90$, $p=-1.11<0$ and the chain degenerates to a single draw. The launcher refuses the point on all three tasks at all three evaluation seeds (measured, not assumed), so 4 is the WHOLE admissible grid there. The fair discount grid for a $\beta$-chain estimator is narrower than for a world model, which reaches all five everywhere.} +\label{tab:sweeps} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{@{}lcccccccp{5.4cm}@{}} +\toprule +Method & Sq-S & Sq-C & Pc-S & Pc-C & Mug & Thr & Pc-tip & Axes swept \\ +\midrule +RSM & 50 (5) & 50 (5) & 37 (5) & 50 (5) & 276 (5) & 302 (5) & 50 (5) & $\beta$ $\times$ particles $\times$ read-out (prob/logit) $\times$ flow steps $\times$ $\gamma$ (\emph{evaluation-only}: the successor is discount-conditioned, so a point is a re-score); cap derived from the $10^{-3}$ tail, not chosen \\ +TD-Flow & 25 (5) & 24 (5) & 24 (5) & 22 (5) & 138 (5) & 140 (5) & 23 (5) & the RSM chain settings transferred unchanged, plus its own $\beta$ grid and the same evaluation-only $\gamma$ grid \\ +DINO-WM & 20 (5) & 20 (5) & 20 (5) & 20 (5) & 129 (5) & 134 (5) & 20 (5) & rollout horizon $H\in\{10,20,50,100,200\}$ via $\gamma$ $\times$ read-out (terminal latent / discounted sum) \\ +LeWM & 15 (5) & 15 (5) & 15 (5) & 15 (5) & 132 (5) & 134 (5) & 15 (5) & same grid as DINO-WM \\ +IDQL / RISE & 3 (1) & 2 (1) & 3 (1) & 3 (1) & 8 (1) & 42 (1) & 3 (1) & $\gamma$ only, and it is a \textbf{training} parameter: the released critic is pinned to $0.99$ (\texttt{iql\_diffusion\_config.py:75}), so every extra point is a retrain \\ +IFQL & -- & -- & -- & -- & -- & -- & -- & none --- published schedule; \textbf{dropped from the sweeps 2026-09-23} \\ +TD-MPC2 & -- & -- & -- & -- & 18 (5) & 26 (5) & -- & $\gamma$/$H$ (a \textbf{training} parameter here) $\times$ configuration (a) shared candidates / (b) own MPPI \\ +DF & -- & -- & -- & -- & 31 (5) & 41 (5) & -- & guidance scale $\times$ candidate count $\times$ horizon \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Discount factors and horizons.} Top: what each method discounts. Bottom: the coin-terminated $\beta$-chain read-out per row, for the arm Table~\ref{tab:flagship} actually prints (the chain-only selection; a retired fold arm can no longer stand in for it here). One hop of the successor model is one draw $k\sim\mathrm{Geom}(1{-}\beta)$, mean $\beta/(1{-}\beta)$ frames in our time-zero convention; after each hop the walk continues with probability $p=(\gamma{-}\beta)/(\gamma(1{-}\beta))$, so it takes $1/(1{-}p)=\gamma(1{-}\beta)/(\beta(1{-}\gamma))$ successor reads on average and the composed frame offset has mean $\gamma/(1{-}\gamma)=100$ frames for EVERY $\beta$ -- that identity is the point of the read-out, and Table~\ref{tab:chainhops} measures both quantities on the flagship cells. The cap is not a hyper-parameter: it is the smallest depth whose truncation tail $p^{\mathrm{cap}}$ is at most $10^{-3}$ (last column), and Table~\ref{tab:chainhops} reports the measured capped fraction. The retired deterministic fold's per-row $(\beta,L)$ and its retained $\gamma$-mass $\gamma^{L/(1-\beta)}$ are in Table~\ref{tab:ablation_betarec}, where $L$ was swept by success rather than set as a truncation guard; the shorthand $L^{*}=(1{-}\beta)/(1{-}\gamma)$ used there is exact only where $\gamma=\beta(2{-}\beta)$ -- at $\gamma=0.99$ that is $\beta=0.90$ -- and overstates elsewhere (5 against the exact 4.21 at $\beta=0.95$). $\gamma=0.99$ is the discount of EVERY value-estimator number this paper prints (the robomimic default of the RISE critic), so the cross-method comparison is at one horizon. It was not, however, left unswept: an evaluation-only $\gamma$ grid was run on the frozen checkpoints for RSM and TD-Flow and Table~\ref{tab:sweeps} counts it. None of those arms reaches a table -- the arm key carries $\beta$ and the cap but not $\gamma$, so the loader identifies an off-$\gamma$ arm by the cap its $\beta$ implies at the $10^{-3}$ tail ($0.90\to73$, $0.95\to33$, $0.98\to11$), excludes it from the chain pool and aborts the build if one is selected anyway. For the chain, $\beta$ is swept over the grid training supports and the cap follows from it; the retired fold additionally swept $L$ ($\beta\in\{0.9,0.95,0.98\}$, $L\in\{1,2,3,4,8\}$) and chose it by success, with no consistency check, so on its rows with $L0.5$ & \textbf{PASS} & \texttt{rsm\_planner.py:304} computes exactly the quantity Table~\ref{tab:discounts} prints and warns above $0.5$; the log carries the warning for each of the 5 rows whose tail exceeds $0.5$ and for none of the others \\ +B6 & The flagship cells ran the $(\beta,L)$ Table~\ref{tab:discounts} claims & \textbf{PASS} & read back from the 231 cell \textsc{json}s (11{,}550 episodes) that make up the RSM column, not from a config: every cell of a row records the same $(\beta,L,\gamma)$ and it is that row's, with $\gamma=0.99$ throughout \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Numerical tests behind Table~\ref{tab:audit}.} Composition: $2\times10^{5}$ chains of $L$ hops drawn from the deployed sampler (\texttt{data.py:11-23}) at each row's flagship $(\beta,L)$, against $\mathrm{NegBin}(L,1{-}\beta)$ counting failures (mean $L\beta/(1{-}\beta)$). The last two columns repeat the draw on the \emph{real} episode lengths of that row's corpus, where the episode end truncates the chain: the shortfall is how much shorter the realised horizon is than the untruncated one, and it is the reason a large $L\cdot h$ in Table~\ref{tab:discounts} is an upper bound.} +\label{tab:auditnum} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{lcc|cc|cc|c|cc} +\toprule +& & & \multicolumn{2}{c|}{mean} & \multicolumn{2}{c|}{variance} & & \multicolumn{2}{c}{on real episodes} \\ +\cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){9-10} +Row & $\beta$ & $L$ & sampler & NegBin & sampler & NegBin & KS & frames & short \\ +\midrule +Sq-S & 0.95 & 2 & 37.92 & 38.00 & 754 & 760 & 0.0017 & 32.7 & 14 \\ +Sq-C & 0.95 & 8 & 152.03 & 152.00 & 3043 & 3040 & 0.0018 & 113.1 & 26 \\ +Pc-S & 0.9 & 3 & 26.98 & 27.00 & 270 & 270 & 0.0018 & 24.2 & 10 \\ +Pc-C & 0.95 & 8 & 152.05 & 152.00 & 3046 & 3040 & 0.0010 & 104.5 & 31 \\ +Mug & 0.9 & 1 & 8.99 & 9.00 & 90 & 90 & 0.0019 & 8.5 & 5 \\ +Thr & 0.9 & 1 & 8.98 & 9.00 & 90 & 90 & 0.0015 & 8.4 & 6 \\ +Pc-tip & 0.9 & 1 & 9.00 & 9.00 & 89 & 90 & 0.0017 & 8.4 & 6 \\ +\bottomrule +\end{tabular} +\smallskip + +\footnotesize +One chain by hand, on the trace \texttt{square\_expert\_play\_demo\_102\_t0145\_L40best\_b0.95\_L8\_N128\_P16.npz} (candidate 67, particle 6, $\beta=0.95$, $L=8$, $G=\gamma^{h}=0.817907$): $c=(0.0000,\,0.0000,\,0.0000,\,0.0140,\,0.0089,\,0.9759,\,0.0001,\,0.0000)$ folds to $q_0=0.3606741644$ against the implementation's $0.3606741428$ ($|\Delta|=2.2\times10^{-8}$). +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{How many $\beta$-hops approximate the $\gamma$ horizon?} A geometric number of $\mathrm{Geom}(1{-}\beta)$ hops is again geometric in the frame domain, so the chain the fold takes an expectation over \emph{is} the $\gamma$ horizon; only its truncation at a fixed $L$ is an approximation. $4\times10^{5}$ chains of the deployed sampler (\texttt{data.py:11-23}) per cell. \textsc{keep}: the fraction of the $\gamma$ mass a depth-$L$ fold retains, $1-\gamma^{L/(1-\beta)}$ (one minus the tail of Table~\ref{tab:discounts}). \textsc{fixed}: exactly $L$ hops. \textsc{fold}: the fold's own mixture -- continue after each hop with probability $\gamma^{h}$, truncated at $L$; chains still alive at $L$ are dropped and that defect enters $\mathrm{KS}$ (the last column conditions on stopping instead). Both are compared against the target $\mathrm{Geom}(1{-}\gamma)$, mean $99$ frames. $^{*}$ marks a flagship $L$.} +\label{tab:auditgamma} +\scriptsize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{cc|c|cc|ccc} +\toprule +& & keep & \multicolumn{2}{c|}{fixed $L$} & \multicolumn{3}{c}{fold truncated at $L$} \\ +\cmidrule(lr){4-5} \cmidrule(lr){6-8} +$\beta$ & $L$ & \% & mean & KS & mean & KS & KS$|$kept \\ +\midrule +$0.9$ & $1$\textbf{*} & 10 & 9.0 & 0.706 & 8.9 & 0.512 & 0.707 \\ + & $2$ & 18 & 18.0 & 0.596 & 13.2 & 0.510 & 0.640 \\ + & $4$ & 33 & 36.0 & 0.439 & 21.3 & 0.457 & 0.530 \\ + & $8$ & 55 & 72.0 & 0.246 & 35.8 & 0.360 & 0.371 \\ + & $15$ & 78 & 135.0 & 0.507 & 55.6 & 0.189 & 0.203 \\ + & $30$ & 95 & 270.0 & 0.808 & 80.2 & 0.043 & 0.058 \\ +$0.95$ & $1$ & 18 & 18.9 & 0.542 & 19.0 & 0.744 & 0.542 \\ + & $2$\textbf{*} & 33 & 37.9 & 0.372 & 27.6 & 0.595 & 0.442 \\ + & $4$ & 55 & 75.9 & 0.179 & 42.8 & 0.414 & 0.300 \\ + & $8$\textbf{*} & 80 & 151.9 & 0.485 & 66.3 & 0.192 & 0.136 \\ + & $15$ & 95 & 284.9 & 0.775 & 89.8 & 0.048 & 0.030 \\ + & $30$ & 100 & 569.9 & 0.961 & 103.1 & 0.020 & 0.019 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Hop accounting of the coin-terminated chain, measured inside the flagship evaluations.} $\mathrm{E}[N]=p/(1-p)$ with $p=(\gamma-\beta)/(\gamma(1-\beta))$ is what the composition-to-$\mathrm{Geom}(1-\gamma)$ identity fixes; \textsc{taken} is the measured mean over all particles of all decisions of every landed chain cell of that row, and \textsc{expired} restricts to walks the coin ended rather than the cap. The cap is computed per $\beta$ from $p^{L}\le 10^{-3}$ and is not a tuned depth. A row whose pooled capped fraction exceeded $10^{-2}$, or whose mean hop count came within $10\%$ of its cap, would be marked \textbf{!} and could not be quoted as a chain number; none is. The final row is the real robot (rsm\_real replay through the rig's live DINOv2 path, its own $\beta$ and $\gamma$); it is reported beside the simulated rows but is not pooled into the figures quoted in the text, which are about the flagship cells. \textbf{One line per $(\mathrm{row},\beta)$ measured}, not one per task: the chain sweep landed several $\beta$ per task and all of them are shown. $\star$ marks the $(\mathrm{row},\beta)$ whose arm Table~\ref{tab:flagship} selects, so the reader can see that the audited walk is the walk the flagship column was scored with.} +\label{tab:chainhops} +\scriptsize +\setlength{\tabcolsep}{3.5pt} +\begin{tabular}{lcc|ccc|cc|cc|cr} +\toprule +& & & \multicolumn{3}{c|}{hops taken} & \multicolumn{2}{c|}{shape} & \multicolumn{2}{c|}{why it stopped} & & \\ +\cmidrule(lr){4-6} \cmidrule(lr){7-8} \cmidrule(lr){9-10} +Row & $\beta$ & cap & $\mathrm{E}[N]$ & taken & $\Delta$\% & expired & p90 & coin \% & capped & cells & decisions \\ +\midrule +Sq-S & $0.9$ & $73$ & $10.00$ & $10.02$ & $+0.2$ & $9.96$ & $25.4$ & $99.9$ & $9.8\times10^{-4}$ & $72$ & 146{,}400 \\ +Sq-S & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.2$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $76$ & 174{,}800 \\ +Sq-S\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $6.0\times10^{-4}$ & $48$ & 112{,}100 \\ +Sq-C\,$\star$ & $0.9$ & $73$ & $10.00$ & $10.00$ & $+0.0$ & $9.95$ & $25.4$ & $99.9$ & $9.2\times10^{-4}$ & $72$ & 128{,}850 \\ +Sq-C & $0.95$ & $33$ & $4.21$ & $4.21$ & $+0.1$ & $4.19$ & $10.9$ & $99.9$ & $1.0\times10^{-3}$ & $81$ & 195{,}200 \\ +Sq-C & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $5.8\times10^{-4}$ & $54$ & 128{,}050 \\ +Pc-S & $0.9$ & $73$ & $10.00$ & $10.03$ & $+0.3$ & $9.97$ & $24.9$ & $99.9$ & $9.5\times10^{-4}$ & $63$ & 109{,}703 \\ +Pc-S\,$\star$ & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.1$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $42$ & 81{,}944 \\ +Pc-S & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $5.9\times10^{-4}$ & $34$ & 71{,}786 \\ +Pc-C & $0.9$ & $73$ & $10.00$ & $10.00$ & $-0.0$ & $9.94$ & $25.6$ & $99.9$ & $9.0\times10^{-4}$ & $48$ & 99{,}925 \\ +Pc-C & $0.95$ & $33$ & $4.21$ & $4.22$ & $+0.2$ & $4.19$ & $10.9$ & $99.9$ & $1.0\times10^{-3}$ & $90$ & 151{,}355 \\ +Pc-C\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.2$ & $99.9$ & $5.9\times10^{-4}$ & $48$ & 98{,}902 \\ +Mug & $0.9$ & $73$ & $10.00$ & $10.02$ & $+0.2$ & $9.95$ & $25.4$ & $99.9$ & $1.0\times10^{-3}$ & $54$ & 99{,}941 \\ +Mug & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.3$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $85$ & 166{,}535 \\ +Mug\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $6.0\times10^{-4}$ & $47$ & 101{,}680 \\ +Thr & $0.9$ & $73$ & $10.00$ & $10.01$ & $+0.1$ & $9.94$ & $25.3$ & $99.9$ & $1.0\times10^{-3}$ & $72$ & 140{,}700 \\ +Thr & $0.95$ & $33$ & $4.21$ & $4.22$ & $+0.2$ & $4.19$ & $11.1$ & $99.9$ & $8.5\times10^{-4}$ & $162$ & 364{,}050 \\ +Thr\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $+0.2$ & $1.02$ & $3.1$ & $99.9$ & $5.5\times10^{-4}$ & $54$ & 118{,}600 \\ +Pc-tip & $0.9$ & $73$ & $10.00$ & $10.01$ & $+0.1$ & $9.95$ & $25.4$ & $99.9$ & $9.9\times10^{-4}$ & $45$ & 101{,}958 \\ +Pc-tip\,$\star$ & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.2$ & $4.18$ & $10.9$ & $99.9$ & $7.8\times10^{-4}$ & $84$ & 167{,}994 \\ +Pc-tip & $0.98$ & $11$ & $1.02$ & $1.01$ & $-0.6$ & $1.01$ & $3.2$ & $99.9$ & $5.9\times10^{-4}$ & $36$ & 87{,}337 \\ +\midrule +Real (rig) & $0.96$ & $54$ & $7.29$ & $7.37$ & $+1.1$ & $7.34$ & $17.9$ & $99.9$ & $8.0\times10^{-4}$ & -- & 156 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{The flagship rows re-scored at honest depth.} Same RSM checkpoint, same proposer, same $128$ candidates per step, same evaluation-seed grid; the only thing that moves is the fold's depth $L$. \textsc{keep} is the fraction of the $\gamma$ mass that depth retains (Table~\ref{tab:auditgamma}); the honest depth is the $L$ whose dropped tail is $5\%$ ($30$ at $\beta{=}0.9$, $15$ at $0.95$). Success is over the episodes listed. The flagship column is MATCHED: it pools only the flagship cells whose (policy seed, evaluation seed) pairs the row's DEEPEST line actually re-scored, so a partial grid cannot flatter either side; $p$ is a two-proportion test of that line against it. All lines use the retired fold read-out, which is the estimator whose truncation this test is about.} +\label{tab:audithonest} +\scriptsize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lcc|c|cc|cc} +\toprule +Row & $\beta$ & $L$ & keep \% & success \% & $n$ & flagship \% & $p$ \\ +\midrule +Sq-S & $0.95$ & $5$ & 63 & $53.3$ & $300$ & $48.7$ & \\ + & & $15$ & 95 & $52.3$ & $300$ & & $0.369$ \\ +Sq-C & $0.95$ & $11$ & 89 & $6.3$ & $300$ & $15.3$ & \\ + & & $15$ & 95 & $6.0$ & $300$ & & \textbf{$<$0.001} \\ +Pc-S & $0.9$ & $9$ & 60 & $42.7$ & $300$ & $51.6$ & \\ + & & $30$ & 95 & $7.5$ & $200$\dag & & \textbf{$<$0.001} \\ +Pc-C & $0.95$ & $11$ & 89 & $50.0$ & $300$ & $49.2$ & \\ + & & $15$ & 95 & $46.0$ & $300$ & & $0.370$ \\ +Mug & $0.9$ & $5$ & 39 & $16.7$ & $300$ & $21.3$ & \\ + & & $30$ & 95 & $16.3$ & $300$ & & $0.117$ \\ +Thr & $0.9$ & $5$ & 39 & $25.7$ & $300$ & $31.4$ & \\ + & & $30$ & 95 & $21.3$ & $300$ & & \textbf{$0.004$} \\ +Pc-tip & $0.9$ & $5$ & 39 & $5.3$ & $300$ & $7.0$ & \\ + & & $30$ & 95 & $4.3$ & $300$ & & $0.158$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Why the deeper fold does not win: the planner's own diagnostics.} Decision-count-weighted pools of the cells' \texttt{planner\_time}, at each row's flagship depth and at its deepest audited depth (the same cells as Table~\ref{tab:audithonest}). \textsc{gap} is the chosen candidate's score minus the mean over the $128$ candidates, \textsc{ties}$_{1e{-}6}$ the number of candidates within $10^{-6}$ of the max of the ranking array (about $8$ float32 ulps at a probability near $1$) and \textsc{ties}$_{=}$ the BIT-EXACT count on the probability array, which is the one the degeneracy claim is made from -- on Sq-S the tolerance reports $64.7$ tied candidates where only $3.7$ are identical. \textsc{ties}$_{=}$ is absent from cells written before it was logged (gen\_q\#266). \textsc{sat} is the fraction of scored candidates at a saturated value. A degeneracy story would need ties and saturation to RISE with depth; instead ties do not rise (to within $1$\%) on $7$ of the $7$ rows and saturation falls on $6$ while success does not improve, so the short fold was not winning by being better separated -- it was ranking differently. Where the exact count exists, Mug, Thr and Pc-C carry $35$--$50$ bit-identical candidates at the maximum of $128$ at BOTH depths, i.e. their arg-max is settled largely by the tie-break; \texttt{logit} (Pc-S) ranks without ties at all and still collapses.} +\label{tab:auditdiag} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{llc|cccc|c} +\toprule +Row & read-out & $L$ & gap & ties$_{1e{-}6}$ & ties$_{=}$ & sat \% & success \% \\ +\midrule +Sq-S & \texttt{prob} & $2$ $\to$ $15$ & $0.02$ $\to$ $0.03$ & $64.7$ $\to$ $44.0$ & $3.7$ $\to$ $3.4$ & $1.8$ $\to$ $1.6$ & $48.7$ $\to$ $52.3$ \\ +Sq-C & \texttt{prob} & $8$ $\to$ $15$ & $0.14$ $\to$ $0.11$ & $27.3$ $\to$ $24.4$ & -- $\to$ $9.5$ & $15.1$ $\to$ $9.9$ & $15.3$ $\to$ $6.0$ \\ +Pc-S & \texttt{logit} & $3$ $\to$ $30$ & $5.06$ $\to$ $16.19$ & $1.0$ $\to$ $1.0$ & -- $\to$ $2.4$ & $13.5$ $\to$ $2.2$ & $51.6$ $\to$ $7.5$ \\ +Pc-C & \texttt{prob} & $8$ $\to$ $15$ & $0.09$ $\to$ $0.09$ & $41.7$ $\to$ $40.3$ & $37.9$ $\to$ $34.7$ & $36.6$ $\to$ $34.2$ & $49.2$ $\to$ $46.0$ \\ +Mug & \texttt{prob} & $1$ $\to$ $30$ & $0.04$ $\to$ $0.02$ & $67.8$ $\to$ $52.5$ & $46.7$ $\to$ $47.6$ & $46.4$ $\to$ $47.3$ & $21.3$ $\to$ $16.3$ \\ +Thr & \texttt{prob} & $1$ $\to$ $30$ & $0.09$ $\to$ $0.08$ & $85.1$ $\to$ $53.7$ & $49.9$ $\to$ $39.8$ & $41.9$ $\to$ $33.6$ & $31.4$ $\to$ $21.3$ \\ +Pc-tip & \texttt{prob} & $1$ $\to$ $30$ & $0.02$ $\to$ $0.03$ & $96.6$ $\to$ $43.8$ & -- $\to$ $12.9$ & $11.4$ $\to$ $9.4$ & $7.0$ $\to$ $4.3$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Conformance of three implementations against the reference planning algorithm} (\texttt{docs/notes/RSM\_PLANNING\_SPEC.tex}). `Sim' is the planner that produced the RSM and TD-Flow columns of Table~\ref{tab:flagship}; `twin' is the scorer shipped to the real robot. Every verdict cites the line of code it was read from.} +\label{tab:conformance} +\scriptsize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{p{2.9cm}p{1.7cm}p{1.9cm}p{1.3cm}p{4.9cm}} +\toprule +Spec item & Sim & Twin (\texttt{rsm\_real}) & Verdict & Evidence \\ +\midrule +Continuation coin $p=(\gamma-\beta)/(\gamma(1-\beta))$ & yes & yes (same function, imported) & conforms & \texttt{rsm\_scorer.py:547}; \texttt{rise\_stack/scorers.py:196} \\ +Time-zero convention matches the TRAINING target & eval admits $k{=}0$ & same scorer & conforms & training hop \texttt{data.py:21--22} clips the offset at $0$, so $k{=}0$ is admitted, as the eval coin assumes; our $p$ is $1/\gamma$ times the spec's strictly-future $p$ \\ +Cap $L$ = smallest $L$ with $p^{L}\le10^{-3}$, computed & computed & computed (yaml: 0) & conforms & \texttt{rsm\_scorer.py:556}; \texttt{configs/baselines.yaml} \\ +At the cap, RETURN the last sampled state & yes & yes (same code path) & conforms & capped rows still take the final read, \texttt{rsm\_scorer.py:670--672} \\ +Reward read ONLY at the returned state & yes & yes & conforms & one \texttt{rew()} call, \texttt{rsm\_scorer.py:671}; the retired fold instead accumulated over hops (\texttt{:453}) \\ +$M$ chains independent, each restarted from $(s,a_j)$ & yes & yes & conforms & per-particle noise and coins, \texttt{rsm\_scorer.py:611--613}, chains restart at \texttt{:629--631}; common random numbers are shared ACROSS candidates only (by design, so candidate comparisons are paired), never within a candidate's $M$ chains \\ +Intermediate action $u\sim\pi(\cdot|x)$ at every hop & hop head & hop head (required) & conforms & \texttt{rsm\_scorer.py:666} \\ +Stopping independent of the model samples & yes & yes & conforms & coins drawn before any sampling, \texttt{rsm\_scorer.py:613} \\ +$1/(1-\gamma)$ score factor & omitted & omitted & conforms (constant) & a constant per state cannot change the arg-max; we say so rather than leave it implicit \\ +$\beta<\gamma$, so the recursion is live & yes ($\beta\in\{0.90,0.95\}$, $\gamma{=}0.99$) & \textbf{NO until 2026-09-23} & \textbf{defect, fixed} & the twin shipped $\beta=\gamma=0.99$, i.e. $p=0$: the coin never fired and the planner was a SINGLE successor draw. Now $\beta{=}0.96$, $\gamma{=}0.995$ ($p=0.879$, cap $54$, expected queries $8.3$); every twin number measured before that date is a one-draw score \\ +Fixed-depth fold present in the shipped planner & kept as the retired control (Table~\ref{tab:flagship_fold}) & \textbf{deleted} & conforms & the \texttt{fold}/\texttt{fold\_d1}/\texttt{d1} paths, the \texttt{rsm\_depth} knob and the \texttt{--rsm-mode} flag were removed from the twin on 2026-09-23; the reproduction path lives in the research repository only \\ +World models: no $\beta$-geometric stopping leaked in & n/a & n/a & conforms, but see below & LeWM / DINO-WM use no coin; they roll out $L$ open-loop $8$-frame chunks and fold them with $\gamma^{8}$ per chunk, with $L$ swept in $\{1,2,4,8\}$ and selected per row by success (\texttt{status/chain/wm\_arm\_dump.json}) -- a per-row depth search the corrected RSM and TD-Flow columns no longer have. Table~\ref{tab:controls} said `a fixed $4$-chunk rollout'; that sentence was wrong and is corrected there \\ +Real open-loop harnesses in THIS repository & n/a & defaulted to the fold at depth $2$ & \textbf{fixed} & \texttt{scripts/real/scorer\_openloop.py:42} and \texttt{twin\_rollout.py:225} now default to the chain; every \texttt{status/real/openloop\_*} number already on record is fold-scored and is labelled as such \\ +\bottomrule +\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_single_actor.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_single_actor.tex new file mode 100644 index 0000000000000000000000000000000000000000..cf975f604a8fff415c594141d7758decd87e07f8 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_single_actor.tex @@ -0,0 +1,620 @@ +% Flagship comparison under the RISE-faithful (data-provenance) reward. +% Generated by scripts/flagship_latex.py -- regenerate rather than editing by hand. +% Preamble: \usepackage{booktabs} <- the ONLY package this table needs. +% Sized for ICLR's 5.5in (397.5pt) text block; verified with scripts/check_iclr_fit.sh. + +\begin{table}[t] +\centering +\caption{\textbf{Offline RL comparison over suboptimal and play data.} RSM performs better or on-par with BC baselines and SOTA world-model-based planning and offline RL algorithms. The two methods with a horizon read-out (RSM, TD-Flow) share the coin-terminated $\beta$ chain: a walk of stochastic length with continuation $p=(\gamma-\beta)/(\gamma(1-\beta))$ and one membership read at the frozen node, whose composed frame offset is exactly $\mathrm{Geom}(1-\gamma)$, capped at the $10^{-3}$ truncation tail. It replaces the deterministic truncated fold these columns previously reported, which is kept in Table~\ref{tab:flagship_fold}; a cell whose chain re-score has not landed prints its launch state rather than the superseded number. The chain settings were selected on RSM and transferred unchanged to TD-Flow, so TD-Flow received the smaller search budget: the per-row chain search is 20--30 arms per row (particles $\times$ prob or logit read-out $\times$ the $\beta$ grid $\times$ the successor sampler's Euler-step count $\in\{4,8,16\}$, default $8$), the cap is not a hyper-parameter but the $10^{-3}$ truncation tail of the continuation coin, and $\beta$ is swept over the grid the rows already used, which training supports because the successor is $\beta$-conditioned over $[0.90,0.995]$. The reward is RISE's binary data-provenance membership label for every value estimator. \TODO{MC-value is low priority. Maybe sweep gamma in ifql}} +\label{tab:flagship} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcc|cccccc} +\toprule +% & \multicolumn{2}{c|}{no planning} & \multicolumn{6}{c}{value estimators, one proposer per row, same 128 candidates} \\ +% \cmidrule(lr){2-3} \cmidrule(lr){4-9} +Task & BC & BC-u & IDQL & IFQL & TD-Flow & LeWM & DINO-WM & RSM \\ +\midrule +Square (Sub.) & $14.4{\pm}2.2$ & $48.0{\pm}1.4$ & $43.6{\pm}1.2$ & $46.7{\pm}1.3$ & $50.0{\pm}4.8$ & $48.9{\pm}1.6$ & $50.7{\pm}2.0$ & $\mathbf{54.0{\pm}1.3}$ \\ +Square (Cov.) & $11.0{\pm}1.0$ & $3.1{\pm}0.6$ & $3.7{\pm}0.2$ & $0.7{\pm}0.4$ & $7.1{\pm}1.1$ & $3.3{\pm}0.4$ & $13.3{\pm}3.3$ & $\mathbf{20.9{\pm}2.6}$ \\ +Piece (Sub.) & $13.8{\pm}2.0$ & $33.0{\pm}1.7$ & $22.9{\pm}6.1$ & $17.8{\pm}3.1$ & $30.2{\pm}1.9$ & $32.4{\pm}1.4$ & $41.8{\pm}2.7$ & $\mathbf{47.1{\pm}3.5}$ \\ +Piece (Cov.) & $18.9{\pm}1.2$ & $25.3{\pm}2.2$ & $6.0{\pm}1.7$ & $21.1{\pm}1.9$ & $16.0{\pm}1.4$ & $18.9{\pm}1.0$ & $39.6{\pm}1.2$ & $\mathbf{48.7{\pm}0.7}$ \\ +Mug (Sub.) & $14.9{\pm}1.7$ & $4.9{\pm}0.2$ & $16.2{\pm}1.0$ & $18.4{\pm}1.0$ & $19.8{\pm}0.9$ & $18.7{\pm}2.5$ & $21.1{\pm}0.8$ & $\mathbf{23.1{\pm}2.1}$ \\ +Thread (Cov.) & $26.3{\pm}1.2$ & $1.3{\pm}0.2$ & $12.2{\pm}1.4$ & $8.4{\pm}1.2$ & $7.1{\pm}1.4$ & $9.6{\pm}1.0$ & $\mathbf{31.6{\pm}1.6}$ & $25.8{\pm}1.1$ \\ +Piece-tip (Cov.) & $2.0{\pm}1.0$ & $1.0{\pm}0.2$ & $2.9{\pm}0.6$ & $3.3{\pm}0.4$ & $1.1{\pm}0.6$ & $2.9{\pm}0.9$ & $5.1{\pm}0.6$ & $\mathbf{7.3{\pm}0.4}$ \\ +\midrule +Mean & $14.5{\pm}2.8$ & $16.7{\pm}7.1$ & $15.4{\pm}5.4$ & $16.6{\pm}5.8$ & $18.8{\pm}6.4$ & $19.2{\pm}6.3$ & $29.0{\pm}6.2$ & $\mathbf{32.4{\pm}6.6}$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Ablation: the $\beta$-recursion read-out.} The same checkpoints as Table~\ref{tab:flagship}, scored with our deterministic truncated fold instead of each method's own read-out. These are the numbers this paper reported before the read-out was corrected. The fold computed $q_k = c_k + (1-c_k)\gamma^{h} q_{k+1}$ over a FIXED $L$ hops with $q_L = 0$ ($h = 1/(1-\beta)$), which is an absorbing hitting probability over a truncated horizon, not the $\gamma$-discounted occupancy read the method claims. $L$ was chosen per row BY EVALUATION SUCCESS rather than set as a truncation guard, and on three rows it was $L=1$, where the estimator collapses to $q_0 = c_0$ -- membership at a single sampled successor state, with no chain at all. The retained-mass column is the fraction $1 - \gamma^{L h}$ of the $\gamma$-horizon that $L$ hops can see; the rest was dropped. Retained mass runs from $0.10$ to $0.98$ across the rows. RSM and TD-Flow shared the read-out, so both are shown: the correction moves both columns, which is why the chain was run for both. THE WORLD MODELS ARE HERE FOR A DIFFERENT REASON: the fold is not their planner at all, and LeWM additionally has no hop head, so it re-rolls one action sequence rather than composing hops. The $(\beta, L)$ columns describe the RSM arm; each method selected its own $L$ under the same rule. THE TWO READ-OUTS DID NOT GET THE SAME SEARCH, and the asymmetry runs AGAINST the fold shown here: the fold grid is FOUR arms per row ($L \in \{1,2,4,8\}$), while the trajectory (MPC) read-out the world-model columns carry in Table~\ref{tab:flagship} is TEN ($H \in \{10,20,50,100,200\}$ frames $\times$ terminal-state or discounted-sum read-out). So wherever a world model scores HIGHER in this table than in Table~\ref{tab:flagship}, the larger search is on the LOSING side, which strengthens the gap rather than explaining it. Nor is the horizon axis saturated: the selected $H$ is $200$ frames -- the TOP of the grid -- on three of LeWM's five non-Mug/Thread rows and on four of DINO-WM's seven, so the trajectory read-out has NOT been searched to exhaustion; the next grid point is $500$ frames ($\gamma = 0.998$) and it would have to be added for BOTH world models or the two columns stop being comparable. Any read-out comparison drawn from this table is per column and per row and does not generalise: the two world models do not agree about which read-out is better, and DINO-WM's trajectory arms are what win it Mug and Thread. This is an ablation of the READ-OUT, not a baseline table: no number in it is a claim about any method as its authors specify it. Subscripts are policy seeds.} +\label{tab:ablation_betarec} +\label{tab:flagship_fold} +\scriptsize +\begin{tabular}{lcccrrrr} +\toprule +Task & $\beta$ & $L$ & retained mass & RSM & TD-Flow & DINO-WM & LeWM \\ +\midrule +Square (Sub.) & $0.95$ & $2$ & $0.33$ & $51.3_{(3)}$ & $48.7_{(3)}$ & $47.1_{(3)}$ & $52.2_{(3)}$ \\ +Square (Cov.) & $0.95$ & $8$ & $0.80$ & $17.6_{(3)}$ & $14.7_{(3)}$ & $7.1_{(3)}$ & $2.0_{(3)}$ \\ +Piece (Sub.) & $0.90$ & $3$ & $0.26$ & $46.6_{(3)}$ & $28.2_{(3)}$ & $30.4_{(3)}$ & $19.8_{(3)}$ \\ +Piece (Cov.) & $0.98$ & $8$ & $0.98$ & $50.1_{(3)}$ & $27.1_{(3)}$ & $39.6_{(3)}$ & $13.8_{(3)}$ \\ +Mug (Sub.) & $0.90$ & $1$ & $0.10$ & $20.0_{(3)}$ & $20.7_{(3)}$ & $18.2_{(3)}$ & $15.8_{(3)}$ \\ +Thread (Cov.) & $0.90$ & $1$ & $0.10$ & $32.7_{(3)}$ & $14.0_{(3)}$ & $23.6_{(3)}$ & $8.0_{(3)}$ \\ +Piece-tip (Cov.) & $0.90$ & $1$ & $0.10$ & $6.9_{(3)}$ & $2.0_{(3)}$ & $2.6_{(3)}$ & $3.1_{(3)}$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{What Table~\ref{tab:flagship} holds fixed across methods.} Each line is enforced by the evaluation pipeline or filtered on by the table loader; the last line is the one factor that differs between value estimators and is therefore part of what the comparison measures. The read-out is held IDENTICAL across the two methods that have one (RSM and TD-Flow); the reward for every value estimator is RISE's binary data-provenance membership label, and the retired oracle progress head appears in no table in this paper.} +\label{tab:controls} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{@{}p{2.25cm}p{10.7cm}@{}} +\toprule +Controlled factor & Setting \\ +\midrule +Proposer & one actor per row, shared by every planning column: the RISE actor on every row except Mug (Sub.): BC-expert; Thread (Cov.): IDQL policy@500; chosen by planning performance and disclosed \\ +Candidate set & $128$ action chunks per decision step from that proposer; every value estimator ranks the same draws (common random numbers per evaluation seed), argmax selection \\ +Reward & RISE's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on every frame of a suboptimal one), unchanged, for every value estimator; BC/BC-u use none \\ +Training data & the row's released expert$+$suboptimal file for every learned component (BC: its expert half; BC-u and all value estimators: the union); no extra data unless the row says regenerated \\ +Evaluation & same simulator, same canonical initial-state region, same success criterion (the paper's relaxed mug criterion), horizon $400$, $50$ episodes per cell \\ +Seeds & $3$ policy $\times$ $3$ evaluation seeds per cell; an evaluation seed varies the action draws and the environment initial conditions \\ +Scorer budget & RSM, TD-Flow, LeWM, DINO-WM: $100$k gradient steps on the same cache; IDQL/RISE critic co-trained with the actor; IFQL its published schedule \\ +Read-out & RSM and TD-Flow share the coin-terminated $\beta$ chain: per particle the walk hops a $\mathrm{Bernoulli}(p)$ number of times with $p = (\gamma-\beta)/(\gamma(1-\beta))$ and membership is read once at the frozen node, so the composed frame offset is exactly $\mathrm{Geom}(1-\gamma)$; the loop cap is set by the $10^{-3}$ truncation tail ($p^{L}\le 10^{-3}$), not tuned. The world models are read as MPC and not through our fold: from each candidate the model is rolled open-loop for $H = 1/(1-\gamma)$ frames -- $\lceil H/8 \rceil$ chunks, the action sequence past the first chunk being the proposer's own continuation -- and scored with the same reward head every other column uses (terminal-state and discounted-sum read-out). $H$ was swept through the discount, $\gamma \in \{0.90,0.95,0.98,0.99,0.995\}$ giving $H \in \{10,20,50,100,200\}$ frames; the selected $H$ is DINO-WM $\in\{10,100,200\}$, LeWM $\in\{10,50,200\}$ (\texttt{status/q273/wm\_mpc\_arm\_dump.json}). The superseded $R\beta$-$L$ cells, which folded $L \in \{1,2,4,8\}$ open-loop chunks with the per-hop discount $\gamma^{8}$ and selected $L$ per row by success, are retired into Table~\ref{tab:ablation_betarec}. The critics (IDQL/RISE, IFQL) have no horizon read-out at all \\ +\emph{Not controlled} & the observation each value estimator scores: frozen DINOv2 features of the two camera frames (RSM, IFQL, TD-Flow, DINO-WM), raw $84$ px frames (LeWM), the actor's own image encoder (IDQL/RISE critic) \\ +Proposer (new baselines) & Diffusion Forcing and TD-MPC2 configuration (b) are $\emph{planners}$: they propose their own actions and therefore do NOT share the $128$-candidate draw, so their search budget is their own and is disclosed in Table~\ref{tab:searchsize}. TD-MPC2 configuration (a) does share it: it ranks the same $128$ chunks from the same actor with common random numbers, and is the only one of the three that is a drop-in value estimator -- which makes it close to DINO-WM with a value head, and it is reported as such \\ +Reward (new baselines) & unchanged -- RISE's binary data-provenance label. DF's guidance is computed from its own predicted reward channel trained on that label; TD-MPC2's learned reward head is trained on it. No other signal (goal, progress, distance) enters either method \\ +Training data (new baselines) & the same task cache as DINO-WM: the pooled DINOv2 state ($z$ plus proprioception, normalised by the cache's own \texttt{feat\_stats}) and the $7$-d OSC action, same episode split. Neither new baseline saw pixels and neither saw an episode the other columns did not \\ +Health (new baselines) & every new-baseline score is printed beside a rollout-fidelity number at its OWN row horizon, read against the stay-put predictor on the same pairs. The two fidelities are NOT comparable with each other and are never put in one column: DF predicts observations, so its number is an observation-space RMSE; TD-MPC2's world model is implicit and has no decoder, so its number is the latent analogue. A row whose rollout is no better than standing still carries that flag next to its score \\ +\bottomrule +\end{tabular} +\end{table} +\begin{table}[t] +\centering +\caption{\textbf{Search size per decision, disclosed.} A planning column's score is a joint result of its value estimate AND how much search it is allowed; these are not interchangeable and the table states both. ``Candidates'' is how many distinct action sequences the column evaluates per decision; ``model rollouts'' is how many times a learned dynamics model is rolled. A column that proposes its own actions is marked \emph{planner} and is not a $128$-candidate column in any sense. Per $400$-frame episode at the defaults the shared-candidate columns evaluate $50 \times 128 = 6\,400$ action sequences, Diffusion Forcing diffuses $50$ plans of $n_{\mathrm{plans}}$, and TD-MPC2 configuration (b) rolls $134 \times 3\,072 \approx 4.1\times10^{5}$ latent trajectories while re-committing every $3$ frames rather than every $8$.} +\label{tab:searchsize} +\scriptsize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{@{}p{1.95cm}p{2.25cm}p{2.25cm}p{1.85cm}p{4.2cm}@{}} +\toprule +Column & Proposer & Candidates / decision & Model rollouts / decision & Note \\ +\midrule +RSM, TD-Flow & shared actor & $128$ & $128 \times M$ particles & the $\beta$ chain; cap from the $10^{-3}$ truncation tail \\ +DINO-WM, LeWM & shared actor & $128$ & $128 \times L$ chunks & $L$ selected per row by success \\ +IDQL / RISE, IFQL & shared actor & $128$ & $0$ (critic, no rollout) & \\ +TD-MPC2 (a) & shared actor & $128$ & $128 \times 1$ & deterministic latent model: particles do nothing, so this column spends LESS than the RSM column at the same nominal particle count \\ +Diffusion Forcing & \emph{planner} & $n_{\mathrm{plans}}$ diffused plans & one per plan & guidance scale swept; the swept values are part of this budget and are listed beside the score \\ +TD-MPC2 (b) & \emph{planner}, RISE actor as prior & $S$ samples $\times$ $I$ iterations & $S \times I$ & defaults $S{=}512$, $I{=}6$, $H_p{=}3$, $24$ prior trajectories from the shared actor: $3072$ rollouts per plan, replanned every $\min(8,H_p){=}3$ frames \\ +\bottomrule +\end{tabular} +\end{table} +\begin{table}[t] +\centering +\caption{\textbf{Search actually performed, per method per task.} Distinct evaluated arms, counted from the evaluation archive rather than asserted, so this table cannot drift from the numbers it describes. An arm is one setting of that method's knobs; each arm is run at 3 training $\times$ 3 evaluation seeds. The asymmetry is large and it does not run one way: RSM has the most arms on the rows it wins and also on Thr, which it loses, while LeWM and DINO-WM were searched far less on Sq and Pc. Each cell is \emph{arms (distinct discounts evaluated)}. Those are DIFFERENT axes and must not be read as one: the $R$ field of an arm label is $\beta$, not $\gamma$, so a method can carry hundreds of arms at a single discount --- which is what RSM and TD-Flow did until 2026-09-23, both pinned to the config default $\gamma=0.99$. \textbf{IDQL/RISE remains the starkest gap}, and for a structural reason: its discount is a TRAINING parameter, so each point is a full retrain (27--35 GPU-h, measured) rather than a re-score of a frozen model (minutes). That asymmetry, not a lack of effort, is why its column is thin; the $\gamma$ grid for it is in training and this table is regenerated from disk, never asserted. \textbf{A 4 is not always a gap.} TD-Flow reads 4 on Pc-C, Mug and Pc-tip because its pinned recipe there has $\beta=0.95$, and a $\beta$-chain needs $\beta<\gamma$ for a positive continuation probability $p=(\gamma-\beta)/(\gamma(1-\beta))$; at $\gamma=0.90$, $p=-1.11<0$ and the chain degenerates to a single draw. The launcher refuses the point on all three tasks at all three evaluation seeds (measured, not assumed), so 4 is the WHOLE admissible grid there. The fair discount grid for a $\beta$-chain estimator is narrower than for a world model, which reaches all five everywhere.} +\label{tab:sweeps} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{@{}lcccccccp{5.4cm}@{}} +\toprule +Method & Sq-S & Sq-C & Pc-S & Pc-C & Mug & Thr & Pc-tip & Axes swept \\ +\midrule +RSM & 50 (5) & 50 (5) & 37 (5) & 50 (5) & 276 (5) & 302 (5) & 50 (5) & $\beta$ $\times$ particles $\times$ read-out (prob/logit) $\times$ flow steps $\times$ $\gamma$ (\emph{evaluation-only}: the successor is discount-conditioned, so a point is a re-score); cap derived from the $10^{-3}$ tail, not chosen \\ +TD-Flow & 25 (5) & 24 (5) & 24 (5) & 22 (5) & 138 (5) & 140 (5) & 23 (5) & the RSM chain settings transferred unchanged, plus its own $\beta$ grid and the same evaluation-only $\gamma$ grid \\ +DINO-WM & 20 (5) & 20 (5) & 20 (5) & 20 (5) & 129 (5) & 134 (5) & 20 (5) & rollout horizon $H\in\{10,20,50,100,200\}$ via $\gamma$ $\times$ read-out (terminal latent / discounted sum) \\ +LeWM & 15 (5) & 15 (5) & 15 (5) & 15 (5) & 132 (5) & 134 (5) & 15 (5) & same grid as DINO-WM \\ +IDQL / RISE & 3 (1) & 2 (1) & 3 (1) & 3 (1) & 8 (1) & 42 (1) & 3 (1) & $\gamma$ only, and it is a \textbf{training} parameter: the released critic is pinned to $0.99$ (\texttt{iql\_diffusion\_config.py:75}), so every extra point is a retrain \\ +IFQL & -- & -- & -- & -- & -- & -- & -- & none --- published schedule; \textbf{dropped from the sweeps 2026-09-23} \\ +TD-MPC2 & -- & -- & -- & -- & 18 (5) & 26 (5) & -- & $\gamma$/$H$ (a \textbf{training} parameter here) $\times$ configuration (a) shared candidates / (b) own MPPI \\ +DF & -- & -- & -- & -- & 31 (5) & 41 (5) & -- & guidance scale $\times$ candidate count $\times$ horizon \\ +\bottomrule +\end{tabular} +\end{table} + + + +\begin{table}[t] +\centering +\caption{\textbf{Preliminary results under the RISE-faithful reward.} \textbf{One proposer per row, shared by every scorer.} Unlisted rows propose from the RISE actor; Mug (Sub.): BC-expert; Thread (Cov.): IDQL policy@500 (chosen by planning performance, a disclosed search; unrun scorers on such a row print \textit{pending}/\textit{launched}). All methods see the same +reward: the dataset's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on +every frame of a suboptimal one), which is what RISE's \texttt{relabel\_rewards.py} writes and its IQL +critic consumes unchanged; BC and BC-u use no reward by construction. RISE-g samples the RISE actor +once with no critic ranking, i.e.\ the RISE policy without its selection step. \textbf{IFQL} (implicit flow Q-learning) as published --- its own flow actor ranked by its expectile critic --- did not yield a functional policy in this observation space (a per-step flow actor against a chunked diffusion proposer, frozen DINO features in place of its native encoder; with ranking off it already scores $5.3$ and $0.7\,\%$ against $9.0$ and $0.2\,\%$ with the critic), so its column reads ``n/a'' and its critic is compared on the common proposer in Table~\ref{tab:flagship} and Table~\ref{tab:matched_actor}, with ranking diagnostics in \S\ref{sec:value-selection-impossible}. \textbf{Bold} marks the best +method on each task. Entries are mean\,$\pm$\,standard error \emph{across seeds}, with the seed +count as a subscript; a seed varies the policy action draw and the environment initial conditions with +the network initialisation held fixed, and the seed is the unit of replication +(\S\ref{sec:seed-semantics}). $\dagger$ marks +a single-seed entry, where no seed variance is measurable and the interval shown is binomial over that +seed's episodes; read those rows as provisional. $\\circ$ marks an entry whose arm has not yet +landed on the full $3\\times3$ policy\\,$\\times$\\,eval-seed grid; the subscript counts policy seeds only, +so without this mark a partly-landed arm is indistinguishable from a complete one. An arm on the +complete grid is always preferred to a partly-landed one however high the latter scores, so this mark +can appear only where no arm on that row has finished. $\Delta$ is the margin of RSM over the strongest baseline on that task, +with $^{*}$ marking $p<0.05$ under a two-proportion $z$-test. Tasks: Square $=$ square-peg, +Piece $=$ piece-assembly, Piece-tip $=$ piece-assembly with tipped initialisation, Thread $=$ threading; +(Sub.) and (Cov.) are the suboptimal and coverage data regimes; demonstration counts are in +Table~\ref{tab:data}. The RSM column reads the coin-terminated $\beta$-chain cells \emph{only}, as in +Table~\ref{tab:flagship}: a task whose chain re-score has not landed prints its launch state rather +than the superseded deterministic-fold number, and the retired fold numbers are in +Table~\ref{tab:ablation_betarec}. The RSM entry on each task is the best of the successor-model chain +configurations (model size, discount, particles, read-out, candidate count) evaluated +there -- 20/20/20/20/20/30/20 configurations per task in row order, single-seed ones included -- so it is a maximum +over a search, whereas each baseline is a single configuration; the held-out analysis +(\texttt{scripts/heldout\_table.py}) selects on one seed +and scores on the others. Because a maximum over a search carries the winner's curse even when the search +is disclosed, we also give the \\emph{median} over every fully seeded chain configuration of the same family, a +number that does not depend on picking a winner: 50.4/14.1/42.4/39.1/18.9/14.1/3.2 per task in row order, over 20/20/20/20/20/30/20 such +configurations. Where the median still exceeds every baseline the row is robust to that choice. Episodes behind each column: BC 4500, BCU 7760, RISEg 8850, IDQL 2200, RISE 12300, IFQL 0 across the baselines (every epoch-5000 +evaluation of that policy is pooled), 5450 behind the RSM entries (50 per seed).} +\label{tab:flagship_single_actor} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Sub.) & $14.4{\pm}2.2_{(3)}$ & $48.0{\pm}1.4_{(3)}$ & $48.7{\pm}1.9_{(3)}$ & -- & $43.6{\pm}1.2_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{54.0{\pm}1.3_{(3)}}$ & $+5.3$ \\ +Square (Cov.) & $11.0{\pm}1.0_{(3)}$ & $3.1{\pm}0.6_{(3)}$ & $7.3{\pm}1.3_{(3)}$ & -- & $3.7{\pm}0.2_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{20.9{\pm}2.6_{(3)}}$ & $+9.9^{*}$ \\ +Piece (Sub.) & $13.8{\pm}2.0_{(3)}$ & $33.0{\pm}1.7_{(3)}$ & $30.7{\pm}2.2_{(3)}$ & $24.2{\pm}3.6_{(3)}$ & $22.9{\pm}6.1_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{47.1{\pm}3.5_{(3)}}$ & $+14.5^{*}$ \\ +Piece (Cov.) & $18.9{\pm}1.2_{(3)}$ & $25.3{\pm}2.2_{(3)}$ & $31.2{\pm}1.6_{(3)}$ & $12.8{\pm}1.5_{(2)}$ & $6.0{\pm}1.7_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{48.7{\pm}0.7_{(3)}}$ & $+17.8^{*}$ \\ +Mug (Sub.) & $14.9{\pm}1.7_{(3)}$ & $4.9{\pm}0.2_{(3)}$ & $4.4{\pm}0.2_{(3)}$ & $5.3{\pm}0.0_{(2)}$ & $5.8{\pm}1.6_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{23.1{\pm}2.1_{(3)}}$ & $+8.2^{*}$ \\ +Thread (Cov.) & $\mathbf{26.3{\pm}1.2_{(3)}}$ & $1.3{\pm}0.2_{(3)}$ & $1.2{\pm}0.3_{(3)}$ & $11.8{\pm}1.4_{(3)}$ & $3.5{\pm}1.1_{(3)}$ & $\mathrm{n/a}$ & $25.8{\pm}1.1_{(3)}$ & $-0.6$ \\ +Piece-tip (Cov.) & $2.0{\pm}1.0_{(3)}$ & $1.0{\pm}0.2_{(3)}$ & $1.0{\pm}0.5_{(3)}$ & -- & $2.9{\pm}0.6_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{7.3{\pm}0.4_{(3)}}$ & $+4.4^{*}$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Planning methods on one proposer per row.} Every column right of the rule ranks the identical $128$ candidates drawn from the identical actor, so only the value estimate differs: \emph{P-greedy} is that proposer sampled once (no selection), \emph{rand-128} picks uniformly among the same candidates, \emph{P-critic} is the proposer's own co-trained IQL critic --- RISE's and IDQL's value estimate on this actor --- and then the added scorers and RSM. BC and BC-u are standalone policies that neither propose nor rank, so they are reported left of the rule as the bar to clear and excluded from $\Delta$, which is the margin over the strongest planning comparator; a row where BC or BC-u exceeds RSM carries $^{\dagger}$. Published-method columns that plan from their own proposer (IDQL, RISE) are in Table~\ref{tab:flagship_single_actor}; paired significance tests against the two controls are in Table~\ref{tab:matched_actor}. Protocol and seeds as in Table~\ref{tab:flagship_single_actor}. Every column right of the rule reads the coin-terminated $\beta$-chain cells only, RSM and TD-Flow included: a row whose chain re-score has not landed prints its launch state rather than the superseded deterministic-fold number, which is never substituted for it. The retired fold numbers for every method scored that way are in Table~\ref{tab:ablation_betarec}. \textbf{Bold} is the best number printed in the row, reference policies included --- this table has planning comparators the single-actor table does not, so a cell is bolded here only if it leads THIS row. Rows are Sq-S square-Sub, Sq-C square-Cov, Pc-S piece-Sub, Pc-C piece-Cov, Mug, Thr threading, Pc-tip piece-tip. A cell reads \textit{pend k/9} when fewer than the $3{\times}3$ seed cells have landed, \textit{launched} when its jobs are queued on that proposer, \textit{queued} when the model is trained and its evaluation has not landed, \textit{trn} with the checkpoint step or seeds done while the model is still training, \textit{n/a} where the method does not exist for that proposer (a BC actor has no co-trained critic), and -- when nothing exists for it. Status words are derived from the run artefacts at generation time.} +\label{tab:flagship_all} +\scriptsize +\setlength{\tabcolsep}{1.5pt} +\begin{tabular}{lcc|ccccccccc} +\toprule +& \multicolumn{2}{c|}{no planning} & \multicolumn{8}{c}{one proposer per row, same 128 candidates} & \\ +\cmidrule(lr){2-3} \cmidrule(lr){4-11} +Task & BC & BC-u & P-greedy & rand-128 & P-critic & IFQL & TD-Flow & LeWM & DINO-WM & RSM & $\Delta$ \\ +\midrule +Sq-S & $14.4_{(3)}$ & $48.0_{(3)}$ & $48.7_{(3)}$ & $49.3$ & $43.6_{(3)}$ & $46.7_{(3)}$ & $50.0_{(3)}$ & $48.9_{(3)}$ & $50.7_{(3)}$ & $\mathbf{54.0{\pm}1.3_{(3)}}$ & $+3.3$ \\ +Sq-C & $11.0_{(3)}$ & $3.1_{(3)}$ & $7.3_{(3)}$ & $6.4$ & $3.7_{(3)}$ & $0.7_{(3)}$ & $7.1_{(3)}$ & $3.3_{(3)}$ & $13.3_{(3)}$ & $\mathbf{20.9{\pm}2.6_{(3)}}$ & $+7.6$ \\ +Pc-S & $13.8_{(3)}$ & $33.0_{(3)}$ & $30.7_{(3)}$ & $29.1$ & $22.9_{(3)}$ & $17.8_{(3)}$ & $30.2_{(3)}$ & $32.4_{(3)}$ & $41.8_{(3)}$ & $\mathbf{47.1{\pm}3.5_{(3)}}$ & $+5.3$ \\ +Pc-C & $18.9_{(3)}$ & $25.3_{(3)}$ & $31.2_{(3)}$ & $30.1$ & $6.0_{(3)}$ & $21.1_{(3)}$ & $16.0_{(3)}$ & $18.9_{(3)}$ & $39.6_{(3)}$ & $\mathbf{48.7{\pm}0.7_{(3)}}$ & $+9.1$ \\ +Mug & $14.9_{(3)}$ & $4.9_{(3)}$ & $14.5$ & $14.9$ & $16.2$ & $18.4_{(3)}$ & $19.8_{(3)}$ & $18.7_{(3)}$ & $21.1_{(3)}$ & $\mathbf{23.1{\pm}2.1_{(3)}}$ & $+2.0$ \\ +Thr & $26.3_{(3)}$ & $1.3_{(3)}$ & $4.7$ & $5.2$ & $12.2$ & $8.4_{(3)}$ & $7.1_{(3)}$ & $9.6_{(3)}$ & $\mathbf{31.6_{(3)}}$ & $25.8{\pm}1.1_{(3)}$ & $-5.8$$^{\dagger}$ \\ +Pc-tip & $2.0_{(3)}$ & $1.0_{(3)}$ & $1.0_{(3)}$ & $0.8$ & $2.9_{(3)}$ & $3.3_{(3)}$ & $1.1_{(3)}$ & $2.9_{(3)}$ & $5.1_{(3)}$ & $\mathbf{7.3{\pm}0.4_{(3)}}$ & $+2.2$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Discount factors and horizons.} Top: what each method discounts. Bottom: the coin-terminated $\beta$-chain read-out per row, for the arm Table~\ref{tab:flagship} actually prints (the chain-only selection; a retired fold arm can no longer stand in for it here). One hop of the successor model is one draw $k\sim\mathrm{Geom}(1{-}\beta)$, mean $\beta/(1{-}\beta)$ frames in our time-zero convention; after each hop the walk continues with probability $p=(\gamma{-}\beta)/(\gamma(1{-}\beta))$, so it takes $1/(1{-}p)=\gamma(1{-}\beta)/(\beta(1{-}\gamma))$ successor reads on average and the composed frame offset has mean $\gamma/(1{-}\gamma)=100$ frames for EVERY $\beta$ -- that identity is the point of the read-out, and Table~\ref{tab:chainhops} measures both quantities on the flagship cells. The cap is not a hyper-parameter: it is the smallest depth whose truncation tail $p^{\mathrm{cap}}$ is at most $10^{-3}$ (last column), and Table~\ref{tab:chainhops} reports the measured capped fraction. The retired deterministic fold's per-row $(\beta,L)$ and its retained $\gamma$-mass $\gamma^{L/(1-\beta)}$ are in Table~\ref{tab:ablation_betarec}, where $L$ was swept by success rather than set as a truncation guard; the shorthand $L^{*}=(1{-}\beta)/(1{-}\gamma)$ used there is exact only where $\gamma=\beta(2{-}\beta)$ -- at $\gamma=0.99$ that is $\beta=0.90$ -- and overstates elsewhere (5 against the exact 4.21 at $\beta=0.95$). $\gamma=0.99$ is the discount of EVERY value-estimator number this paper prints (the robomimic default of the RISE critic), so the cross-method comparison is at one horizon. It was not, however, left unswept: an evaluation-only $\gamma$ grid was run on the frozen checkpoints for RSM and TD-Flow and Table~\ref{tab:sweeps} counts it. None of those arms reaches a table -- the arm key carries $\beta$ and the cap but not $\gamma$, so the loader identifies an off-$\gamma$ arm by the cap its $\beta$ implies at the $10^{-3}$ tail ($0.90\to73$, $0.95\to33$, $0.98\to11$), excludes it from the chain pool and aborts the build if one is selected anyway. For the chain, $\beta$ is swept over the grid training supports and the cap follows from it; the retired fold additionally swept $L$ ($\beta\in\{0.9,0.95,0.98\}$, $L\in\{1,2,3,4,8\}$) and chose it by success, with no consistency check, so on its rows with $L0.5$ & \textbf{PASS} & \texttt{rsm\_planner.py:304} computes exactly the quantity Table~\ref{tab:discounts} prints and warns above $0.5$; the log carries the warning for each of the 5 rows whose tail exceeds $0.5$ and for none of the others \\ +B6 & The flagship cells ran the $(\beta,L)$ Table~\ref{tab:discounts} claims & \textbf{PASS} & read back from the 231 cell \textsc{json}s (11{,}550 episodes) that make up the RSM column, not from a config: every cell of a row records the same $(\beta,L,\gamma)$ and it is that row's, with $\gamma=0.99$ throughout \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Numerical tests behind Table~\ref{tab:audit}.} Composition: $2\times10^{5}$ chains of $L$ hops drawn from the deployed sampler (\texttt{data.py:11-23}) at each row's flagship $(\beta,L)$, against $\mathrm{NegBin}(L,1{-}\beta)$ counting failures (mean $L\beta/(1{-}\beta)$). The last two columns repeat the draw on the \emph{real} episode lengths of that row's corpus, where the episode end truncates the chain: the shortfall is how much shorter the realised horizon is than the untruncated one, and it is the reason a large $L\cdot h$ in Table~\ref{tab:discounts} is an upper bound.} +\label{tab:auditnum} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{lcc|cc|cc|c|cc} +\toprule +& & & \multicolumn{2}{c|}{mean} & \multicolumn{2}{c|}{variance} & & \multicolumn{2}{c}{on real episodes} \\ +\cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){9-10} +Row & $\beta$ & $L$ & sampler & NegBin & sampler & NegBin & KS & frames & short \\ +\midrule +Sq-S & 0.95 & 2 & 37.92 & 38.00 & 754 & 760 & 0.0017 & 32.7 & 14 \\ +Sq-C & 0.95 & 8 & 152.03 & 152.00 & 3043 & 3040 & 0.0018 & 113.1 & 26 \\ +Pc-S & 0.9 & 3 & 26.98 & 27.00 & 270 & 270 & 0.0018 & 24.2 & 10 \\ +Pc-C & 0.95 & 8 & 152.05 & 152.00 & 3046 & 3040 & 0.0010 & 104.5 & 31 \\ +Mug & 0.9 & 1 & 8.99 & 9.00 & 90 & 90 & 0.0019 & 8.5 & 5 \\ +Thr & 0.9 & 1 & 8.98 & 9.00 & 90 & 90 & 0.0015 & 8.4 & 6 \\ +Pc-tip & 0.9 & 1 & 9.00 & 9.00 & 89 & 90 & 0.0017 & 8.4 & 6 \\ +\bottomrule +\end{tabular} +\smallskip + +\footnotesize +One chain by hand, on the trace \texttt{square\_expert\_play\_demo\_102\_t0145\_L40best\_b0.95\_L8\_N128\_P16.npz} (candidate 67, particle 6, $\beta=0.95$, $L=8$, $G=\gamma^{h}=0.817907$): $c=(0.0000,\,0.0000,\,0.0000,\,0.0140,\,0.0089,\,0.9759,\,0.0001,\,0.0000)$ folds to $q_0=0.3606741644$ against the implementation's $0.3606741428$ ($|\Delta|=2.2\times10^{-8}$). +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{How many $\beta$-hops approximate the $\gamma$ horizon?} A geometric number of $\mathrm{Geom}(1{-}\beta)$ hops is again geometric in the frame domain, so the chain the fold takes an expectation over \emph{is} the $\gamma$ horizon; only its truncation at a fixed $L$ is an approximation. $4\times10^{5}$ chains of the deployed sampler (\texttt{data.py:11-23}) per cell. \textsc{keep}: the fraction of the $\gamma$ mass a depth-$L$ fold retains, $1-\gamma^{L/(1-\beta)}$ (one minus the tail of Table~\ref{tab:discounts}). \textsc{fixed}: exactly $L$ hops. \textsc{fold}: the fold's own mixture -- continue after each hop with probability $\gamma^{h}$, truncated at $L$; chains still alive at $L$ are dropped and that defect enters $\mathrm{KS}$ (the last column conditions on stopping instead). Both are compared against the target $\mathrm{Geom}(1{-}\gamma)$, mean $99$ frames. $^{*}$ marks a flagship $L$.} +\label{tab:auditgamma} +\scriptsize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{cc|c|cc|ccc} +\toprule +& & keep & \multicolumn{2}{c|}{fixed $L$} & \multicolumn{3}{c}{fold truncated at $L$} \\ +\cmidrule(lr){4-5} \cmidrule(lr){6-8} +$\beta$ & $L$ & \% & mean & KS & mean & KS & KS$|$kept \\ +\midrule +$0.9$ & $1$\textbf{*} & 10 & 9.0 & 0.706 & 8.9 & 0.512 & 0.707 \\ + & $2$ & 18 & 18.0 & 0.596 & 13.2 & 0.510 & 0.640 \\ + & $4$ & 33 & 36.0 & 0.439 & 21.3 & 0.457 & 0.530 \\ + & $8$ & 55 & 72.0 & 0.246 & 35.8 & 0.360 & 0.371 \\ + & $15$ & 78 & 135.0 & 0.507 & 55.6 & 0.189 & 0.203 \\ + & $30$ & 95 & 270.0 & 0.808 & 80.2 & 0.043 & 0.058 \\ +$0.95$ & $1$ & 18 & 18.9 & 0.542 & 19.0 & 0.744 & 0.542 \\ + & $2$\textbf{*} & 33 & 37.9 & 0.372 & 27.6 & 0.595 & 0.442 \\ + & $4$ & 55 & 75.9 & 0.179 & 42.8 & 0.414 & 0.300 \\ + & $8$\textbf{*} & 80 & 151.9 & 0.485 & 66.3 & 0.192 & 0.136 \\ + & $15$ & 95 & 284.9 & 0.775 & 89.8 & 0.048 & 0.030 \\ + & $30$ & 100 & 569.9 & 0.961 & 103.1 & 0.020 & 0.019 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Hop accounting of the coin-terminated chain, measured inside the flagship evaluations.} $\mathrm{E}[N]=p/(1-p)$ with $p=(\gamma-\beta)/(\gamma(1-\beta))$ is what the composition-to-$\mathrm{Geom}(1-\gamma)$ identity fixes; \textsc{taken} is the measured mean over all particles of all decisions of every landed chain cell of that row, and \textsc{expired} restricts to walks the coin ended rather than the cap. The cap is computed per $\beta$ from $p^{L}\le 10^{-3}$ and is not a tuned depth. A row whose pooled capped fraction exceeded $10^{-2}$, or whose mean hop count came within $10\%$ of its cap, would be marked \textbf{!} and could not be quoted as a chain number; none is. The final row is the real robot (rsm\_real replay through the rig's live DINOv2 path, its own $\beta$ and $\gamma$); it is reported beside the simulated rows but is not pooled into the figures quoted in the text, which are about the flagship cells. \textbf{One line per $(\mathrm{row},\beta)$ measured}, not one per task: the chain sweep landed several $\beta$ per task and all of them are shown. $\star$ marks the $(\mathrm{row},\beta)$ whose arm Table~\ref{tab:flagship} selects, so the reader can see that the audited walk is the walk the flagship column was scored with.} +\label{tab:chainhops} +\scriptsize +\setlength{\tabcolsep}{3.5pt} +\begin{tabular}{lcc|ccc|cc|cc|cr} +\toprule +& & & \multicolumn{3}{c|}{hops taken} & \multicolumn{2}{c|}{shape} & \multicolumn{2}{c|}{why it stopped} & & \\ +\cmidrule(lr){4-6} \cmidrule(lr){7-8} \cmidrule(lr){9-10} +Row & $\beta$ & cap & $\mathrm{E}[N]$ & taken & $\Delta$\% & expired & p90 & coin \% & capped & cells & decisions \\ +\midrule +Sq-S & $0.9$ & $73$ & $10.00$ & $10.02$ & $+0.2$ & $9.96$ & $25.4$ & $99.9$ & $9.8\times10^{-4}$ & $72$ & 146{,}400 \\ +Sq-S & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.2$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $76$ & 174{,}800 \\ +Sq-S\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $6.0\times10^{-4}$ & $48$ & 112{,}100 \\ +Sq-C\,$\star$ & $0.9$ & $73$ & $10.00$ & $10.00$ & $+0.0$ & $9.95$ & $25.4$ & $99.9$ & $9.2\times10^{-4}$ & $72$ & 128{,}850 \\ +Sq-C & $0.95$ & $33$ & $4.21$ & $4.21$ & $+0.1$ & $4.19$ & $10.9$ & $99.9$ & $1.0\times10^{-3}$ & $81$ & 195{,}200 \\ +Sq-C & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $5.8\times10^{-4}$ & $54$ & 128{,}050 \\ +Pc-S & $0.9$ & $73$ & $10.00$ & $10.03$ & $+0.3$ & $9.97$ & $24.9$ & $99.9$ & $9.5\times10^{-4}$ & $63$ & 109{,}703 \\ +Pc-S\,$\star$ & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.1$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $42$ & 81{,}944 \\ +Pc-S & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $5.9\times10^{-4}$ & $34$ & 71{,}786 \\ +Pc-C & $0.9$ & $73$ & $10.00$ & $10.00$ & $-0.0$ & $9.94$ & $25.6$ & $99.9$ & $9.0\times10^{-4}$ & $48$ & 99{,}925 \\ +Pc-C & $0.95$ & $33$ & $4.21$ & $4.22$ & $+0.2$ & $4.19$ & $10.9$ & $99.9$ & $1.0\times10^{-3}$ & $90$ & 151{,}355 \\ +Pc-C\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.2$ & $99.9$ & $5.9\times10^{-4}$ & $48$ & 98{,}902 \\ +Mug & $0.9$ & $73$ & $10.00$ & $10.02$ & $+0.2$ & $9.95$ & $25.4$ & $99.9$ & $1.0\times10^{-3}$ & $54$ & 99{,}941 \\ +Mug & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.3$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $85$ & 166{,}535 \\ +Mug\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $6.0\times10^{-4}$ & $47$ & 101{,}680 \\ +Thr & $0.9$ & $73$ & $10.00$ & $10.01$ & $+0.1$ & $9.94$ & $25.3$ & $99.9$ & $1.0\times10^{-3}$ & $72$ & 140{,}700 \\ +Thr & $0.95$ & $33$ & $4.21$ & $4.22$ & $+0.2$ & $4.19$ & $11.1$ & $99.9$ & $8.5\times10^{-4}$ & $162$ & 364{,}050 \\ +Thr\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $+0.2$ & $1.02$ & $3.1$ & $99.9$ & $5.5\times10^{-4}$ & $54$ & 118{,}600 \\ +Pc-tip & $0.9$ & $73$ & $10.00$ & $10.01$ & $+0.1$ & $9.95$ & $25.4$ & $99.9$ & $9.9\times10^{-4}$ & $45$ & 101{,}958 \\ +Pc-tip\,$\star$ & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.2$ & $4.18$ & $10.9$ & $99.9$ & $7.8\times10^{-4}$ & $84$ & 167{,}994 \\ +Pc-tip & $0.98$ & $11$ & $1.02$ & $1.01$ & $-0.6$ & $1.01$ & $3.2$ & $99.9$ & $5.9\times10^{-4}$ & $36$ & 87{,}337 \\ +\midrule +Real (rig) & $0.96$ & $54$ & $7.29$ & $7.37$ & $+1.1$ & $7.34$ & $17.9$ & $99.9$ & $8.0\times10^{-4}$ & -- & 156 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{The flagship rows re-scored at honest depth.} Same RSM checkpoint, same proposer, same $128$ candidates per step, same evaluation-seed grid; the only thing that moves is the fold's depth $L$. \textsc{keep} is the fraction of the $\gamma$ mass that depth retains (Table~\ref{tab:auditgamma}); the honest depth is the $L$ whose dropped tail is $5\%$ ($30$ at $\beta{=}0.9$, $15$ at $0.95$). Success is over the episodes listed. The flagship column is MATCHED: it pools only the flagship cells whose (policy seed, evaluation seed) pairs the row's DEEPEST line actually re-scored, so a partial grid cannot flatter either side; $p$ is a two-proportion test of that line against it. All lines use the retired fold read-out, which is the estimator whose truncation this test is about.} +\label{tab:audithonest} +\scriptsize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lcc|c|cc|cc} +\toprule +Row & $\beta$ & $L$ & keep \% & success \% & $n$ & flagship \% & $p$ \\ +\midrule +Sq-S & $0.95$ & $5$ & 63 & $53.3$ & $300$ & $48.7$ & \\ + & & $15$ & 95 & $52.3$ & $300$ & & $0.369$ \\ +Sq-C & $0.95$ & $11$ & 89 & $6.3$ & $300$ & $15.3$ & \\ + & & $15$ & 95 & $6.0$ & $300$ & & \textbf{$<$0.001} \\ +Pc-S & $0.9$ & $9$ & 60 & $42.7$ & $300$ & $51.6$ & \\ + & & $30$ & 95 & $7.5$ & $200$\dag & & \textbf{$<$0.001} \\ +Pc-C & $0.95$ & $11$ & 89 & $50.0$ & $300$ & $49.2$ & \\ + & & $15$ & 95 & $46.0$ & $300$ & & $0.370$ \\ +Mug & $0.9$ & $5$ & 39 & $16.7$ & $300$ & $21.3$ & \\ + & & $30$ & 95 & $16.3$ & $300$ & & $0.117$ \\ +Thr & $0.9$ & $5$ & 39 & $25.7$ & $300$ & $31.4$ & \\ + & & $30$ & 95 & $21.3$ & $300$ & & \textbf{$0.004$} \\ +Pc-tip & $0.9$ & $5$ & 39 & $5.3$ & $300$ & $7.0$ & \\ + & & $30$ & 95 & $4.3$ & $300$ & & $0.158$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Why the deeper fold does not win: the planner's own diagnostics.} Decision-count-weighted pools of the cells' \texttt{planner\_time}, at each row's flagship depth and at its deepest audited depth (the same cells as Table~\ref{tab:audithonest}). \textsc{gap} is the chosen candidate's score minus the mean over the $128$ candidates, \textsc{ties}$_{1e{-}6}$ the number of candidates within $10^{-6}$ of the max of the ranking array (about $8$ float32 ulps at a probability near $1$) and \textsc{ties}$_{=}$ the BIT-EXACT count on the probability array, which is the one the degeneracy claim is made from -- on Sq-S the tolerance reports $64.7$ tied candidates where only $3.7$ are identical. \textsc{ties}$_{=}$ is absent from cells written before it was logged (gen\_q\#266). \textsc{sat} is the fraction of scored candidates at a saturated value. A degeneracy story would need ties and saturation to RISE with depth; instead ties do not rise (to within $1$\%) on $7$ of the $7$ rows and saturation falls on $6$ while success does not improve, so the short fold was not winning by being better separated -- it was ranking differently. Where the exact count exists, Mug, Thr and Pc-C carry $35$--$50$ bit-identical candidates at the maximum of $128$ at BOTH depths, i.e. their arg-max is settled largely by the tie-break; \texttt{logit} (Pc-S) ranks without ties at all and still collapses.} +\label{tab:auditdiag} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{llc|cccc|c} +\toprule +Row & read-out & $L$ & gap & ties$_{1e{-}6}$ & ties$_{=}$ & sat \% & success \% \\ +\midrule +Sq-S & \texttt{prob} & $2$ $\to$ $15$ & $0.02$ $\to$ $0.03$ & $64.7$ $\to$ $44.0$ & $3.7$ $\to$ $3.4$ & $1.8$ $\to$ $1.6$ & $48.7$ $\to$ $52.3$ \\ +Sq-C & \texttt{prob} & $8$ $\to$ $15$ & $0.14$ $\to$ $0.11$ & $27.3$ $\to$ $24.4$ & -- $\to$ $9.5$ & $15.1$ $\to$ $9.9$ & $15.3$ $\to$ $6.0$ \\ +Pc-S & \texttt{logit} & $3$ $\to$ $30$ & $5.06$ $\to$ $16.19$ & $1.0$ $\to$ $1.0$ & -- $\to$ $2.4$ & $13.5$ $\to$ $2.2$ & $51.6$ $\to$ $7.5$ \\ +Pc-C & \texttt{prob} & $8$ $\to$ $15$ & $0.09$ $\to$ $0.09$ & $41.7$ $\to$ $40.3$ & $37.9$ $\to$ $34.7$ & $36.6$ $\to$ $34.2$ & $49.2$ $\to$ $46.0$ \\ +Mug & \texttt{prob} & $1$ $\to$ $30$ & $0.04$ $\to$ $0.02$ & $67.8$ $\to$ $52.5$ & $46.7$ $\to$ $47.6$ & $46.4$ $\to$ $47.3$ & $21.3$ $\to$ $16.3$ \\ +Thr & \texttt{prob} & $1$ $\to$ $30$ & $0.09$ $\to$ $0.08$ & $85.1$ $\to$ $53.7$ & $49.9$ $\to$ $39.8$ & $41.9$ $\to$ $33.6$ & $31.4$ $\to$ $21.3$ \\ +Pc-tip & \texttt{prob} & $1$ $\to$ $30$ & $0.02$ $\to$ $0.03$ & $96.6$ $\to$ $43.8$ & -- $\to$ $12.9$ & $11.4$ $\to$ $9.4$ & $7.0$ $\to$ $4.3$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Conformance of three implementations against the reference planning algorithm} (\texttt{docs/notes/RSM\_PLANNING\_SPEC.tex}). `Sim' is the planner that produced the RSM and TD-Flow columns of Table~\ref{tab:flagship}; `twin' is the scorer shipped to the real robot. Every verdict cites the line of code it was read from.} +\label{tab:conformance} +\scriptsize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{p{2.9cm}p{1.7cm}p{1.9cm}p{1.3cm}p{4.9cm}} +\toprule +Spec item & Sim & Twin (\texttt{rsm\_real}) & Verdict & Evidence \\ +\midrule +Continuation coin $p=(\gamma-\beta)/(\gamma(1-\beta))$ & yes & yes (same function, imported) & conforms & \texttt{rsm\_scorer.py:547}; \texttt{rise\_stack/scorers.py:196} \\ +Time-zero convention matches the TRAINING target & eval admits $k{=}0$ & same scorer & conforms & training hop \texttt{data.py:21--22} clips the offset at $0$, so $k{=}0$ is admitted, as the eval coin assumes; our $p$ is $1/\gamma$ times the spec's strictly-future $p$ \\ +Cap $L$ = smallest $L$ with $p^{L}\le10^{-3}$, computed & computed & computed (yaml: 0) & conforms & \texttt{rsm\_scorer.py:556}; \texttt{configs/baselines.yaml} \\ +At the cap, RETURN the last sampled state & yes & yes (same code path) & conforms & capped rows still take the final read, \texttt{rsm\_scorer.py:670--672} \\ +Reward read ONLY at the returned state & yes & yes & conforms & one \texttt{rew()} call, \texttt{rsm\_scorer.py:671}; the retired fold instead accumulated over hops (\texttt{:453}) \\ +$M$ chains independent, each restarted from $(s,a_j)$ & yes & yes & conforms & per-particle noise and coins, \texttt{rsm\_scorer.py:611--613}, chains restart at \texttt{:629--631}; common random numbers are shared ACROSS candidates only (by design, so candidate comparisons are paired), never within a candidate's $M$ chains \\ +Intermediate action $u\sim\pi(\cdot|x)$ at every hop & hop head & hop head (required) & conforms & \texttt{rsm\_scorer.py:666} \\ +Stopping independent of the model samples & yes & yes & conforms & coins drawn before any sampling, \texttt{rsm\_scorer.py:613} \\ +$1/(1-\gamma)$ score factor & omitted & omitted & conforms (constant) & a constant per state cannot change the arg-max; we say so rather than leave it implicit \\ +$\beta<\gamma$, so the recursion is live & yes ($\beta\in\{0.90,0.95\}$, $\gamma{=}0.99$) & \textbf{NO until 2026-09-23} & \textbf{defect, fixed} & the twin shipped $\beta=\gamma=0.99$, i.e. $p=0$: the coin never fired and the planner was a SINGLE successor draw. Now $\beta{=}0.96$, $\gamma{=}0.995$ ($p=0.879$, cap $54$, expected queries $8.3$); every twin number measured before that date is a one-draw score \\ +Fixed-depth fold present in the shipped planner & kept as the retired control (Table~\ref{tab:flagship_fold}) & \textbf{deleted} & conforms & the \texttt{fold}/\texttt{fold\_d1}/\texttt{d1} paths, the \texttt{rsm\_depth} knob and the \texttt{--rsm-mode} flag were removed from the twin on 2026-09-23; the reproduction path lives in the research repository only \\ +World models: no $\beta$-geometric stopping leaked in & n/a & n/a & conforms, but see below & LeWM / DINO-WM use no coin; they roll out $L$ open-loop $8$-frame chunks and fold them with $\gamma^{8}$ per chunk, with $L$ swept in $\{1,2,4,8\}$ and selected per row by success (\texttt{status/chain/wm\_arm\_dump.json}) -- a per-row depth search the corrected RSM and TD-Flow columns no longer have. Table~\ref{tab:controls} said `a fixed $4$-chunk rollout'; that sentence was wrong and is corrected there \\ +Real open-loop harnesses in THIS repository & n/a & defaulted to the fold at depth $2$ & \textbf{fixed} & \texttt{scripts/real/scorer\_openloop.py:42} and \texttt{twin\_rollout.py:225} now default to the chain; every \texttt{status/real/openloop\_*} number already on record is fold-scored and is labelled as such \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer: same candidates, different scorer.} All three columns sample the +\emph{same} 128 candidates from the \emph{same} BC-union policy under the same data-provenance +reward; only the ranking function differs. \textbf{greedy} takes one sample without ranking, +\textbf{IQL} ranks with the IQL critic (the mechanism RISE and IDQL share), \textbf{RSM} ranks with +our successor model. Fixing the proposal policy is what makes this comparison fair -- RISE is IDQL with +a different policy, so a margin obtained by also changing the proposer would not isolate the scorer. +Read the \textbf{vs.\ greedy} column as what selection buys: the IQL critic is a weak ranker in this +setting, scoring \emph{below} greedy on several tasks and on its own proposer, so the margin over it +alone would overstate the contribution of our scorer. All three columns of a row are read on the +same set of (policy seed, evaluation seed) cells -- cells per task in row order, 50 episodes +each -- and the RSM subscript is the number of policy seeds behind it; the RSM configuration is the +best configuration on that proposer with at least two seeds, or the single-seed best where none exists.} +\label{tab:matched} +\footnotesize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lccccc} +\toprule +& \multicolumn{3}{c}{Scorer (BC-union proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-4} \cmidrule(lr){5-6} +Task & greedy & IQL & RSM & vs.\ greedy & vs.\ IQL \\ +\midrule + +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer, RISE's own actor.} The same protocol as Table~\ref{tab:matched} +with RISE's policy as the proposer: RISE's actor, RISE's reward, and only the ranking function swapped. +\textbf{RISE-g} is that actor sampled once, \textbf{RISE} is its released critic-ranked rollout +(128 samples, argmax of the co-trained IQL critic), \textbf{RSM} ranks the same 128 samples with our +successor model. The three added scorers (\textbf{TD-Flow}, \textbf{LeWM}, \textbf{DINO-WM}) and +\textbf{IFQL} are defined in \S\ref{sec:added-scorers}; whether IFQL orders the $128$ candidates at +all (\S\ref{sec:value-selection-impossible}) is reported with it, in row order: recorded-action rank pct.\ ($50$ = chance) 40/49/44; 56/44/54; 43/44/41; 50/51/44; 36/53/50; 52/47/43; 48/47/50; per-state $Q$ spread 6.0e-05/9.0e-05/5.6e-05; 6.0e-04/5.8e-04/7.2e-04; 3.0e-05/4.2e-05/3.9e-05; 2.9e-04/2.9e-04/2.5e-04; 1.3e-04/1.6e-04/1.8e-04; 4.2e-04/3.8e-04/3.4e-04; 7.4e-04/7.9e-04/7.8e-04 bins; global range (context only) 14.0/14.7/18.1; 43.1/42.5/41.1; 28.3/26.0/26.1; 50.3/10.0/49.3/26.7/48.6/45.0; 34.0/33.4/28.9; 43.2/38.4/41.6; 64.7/64.6/64.1 bins \textbf{On Square (Sub.), Square (Cov.), Piece (Sub.), Piece (Cov.), Mug (Sub.), Thread (Cov.), Piece-tip (Cov.) the IFQL critic selects at or near chance, so that entry is a random-of-128 rather than a value baseline.}. +\textbf{rand} is the random-candidate control: it draws the same $N{=}128$ candidates and executes +one of them uniformly, so $\textrm{RSM}-\textrm{rand}$ is the part of the margin attributable to +\emph{ranking} rather than to sampling breadth. Every column ranks the \emph{same} 128 candidates at every decision step. Same (policy seed, +evaluation seed) cells across a row -- 9/9/9/9/9/9/9 cells per task in row order, 9/9/9/9/9/9/9 for the +control; a $\dagger$ marks a column that has not yet run all of them, with the scorers' own counts +TD-Flow 9/9/9/9/9/9/9; IFQL 9/9/9/9/9/9/9; LeWM 9/9/9/9/9/9/9; DINO-WM 9/9/9/9/9/9/9; DF 0/0/0/0/9/9/0. Each scorer column is the best of the +configurations evaluated for it on this proposer -- TD-Flow 20/19/19/17/15/3/18; IFQL 1/1/1/1/1/1/1; LeWM 14/14/14/14/14/11/14; DINO-WM 14/14/14/14/14/14/14; DF 0/0/0/0/4/9/0 configurations per task in row order -- +so the budgets differ between columns and are stated rather than assumed equal. Every scorer's health numbers (rank percentile, read-out spread, ties at the arg-max, dispersion ratio, action win rate) are in Table~\ref{tab:scorer_health}; $\ddagger$ $=$ no health number, so not reportable by our own rule. \textbf{Tied at the arg-max on some rows (DINO-WM on 4 of 7 rows, IFQL on 5 of 7 rows, LeWM on 4 of 7 rows, RSM on 5 of 7 rows, TD-Flow on 4 of 7 rows; worst 101 of 128 on Mug (Sub.)): there the arg-max is a uniform draw among the tied candidates, a coarse filter plus resampling rather than a ranking. Note this does not by itself mean the column ranks worse -- the fully-ordering logit read-out ties $1$ candidate and scores lower in simulation, since it reads only the terminal hop and drops the product fold.} +Cells differing only in particle count or in the probability-vs-logit read-out are +\emph{different scorers} and are never pooled into one arm; the read-out is instead part of the +disclosed per-column search counted above.} +\label{tab:matched_actor} +\scriptsize +\setlength{\tabcolsep}{1.5pt} +\begin{tabular}{lccccccccccc} +\toprule +& \multicolumn{9}{c}{Scorer (RISE-actor proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-10} \cmidrule(lr){11-12} +Task & RISE-g & RISE & rand & RSM & TD-Flow & IFQL & LeWM & DINO-WM & DF & vs.\ RISE-g & vs.\ RISE \\ +\midrule +Square (Sub.) & $48.7$ & $43.6$ & $49.3$ & $\mathbf{54.0}_{(3)}$ & $50.0_{(3)}$ & $46.7_{(3)}$ & $48.9_{(3)}$ & $50.7_{(3)}$ & \textit{queued} & $+5.3$ & $+10.4$ \\ +Square (Cov.) & $7.3$ & $3.7$ & $6.4$ & $\mathbf{20.9}_{(3)}$ & $7.1_{(3)}$ & $0.7_{(3)}$ & $3.3_{(3)}$ & $13.3_{(3)}$ & \textit{queued} & $+13.6$ & $+17.2$ \\ +Piece (Sub.) & $30.7$ & $22.9$ & $29.1$ & $\mathbf{47.1}_{(3)}$ & $30.2_{(3)}$ & $17.8_{(3)}$ & $32.4_{(3)}$ & $41.8_{(3)}$ & \textit{queued} & $+16.4$ & $+24.2$ \\ +Piece (Cov.) & $30.8$ & $6.0$ & $30.1$ & $\mathbf{48.7}_{(3)}$ & $16.0_{(3)}$ & $21.1_{(3)}$ & $18.9_{(3)}$ & $39.6_{(3)}$ & \textit{queued} & $+17.8$ & $+42.7$ \\ +Mug (Sub.) & $14.5$ & $16.2$ & $14.9$ & $\mathbf{23.1}_{(3)}$ & $19.8_{(3)}$ & $18.4_{(3)}$ & $18.7_{(3)}$ & $21.1_{(3)}$ & $17.1_{(3)}$ & $+8.6$ & $+6.9$ \\ +Thread (Cov.) & $4.7$ & $12.2$ & $5.2$ & $\mathbf{25.8}_{(3)}$ & $7.1_{(3)}$ & $8.4_{(3)}$ & $9.6_{(3)}$ & $31.6_{(3)}$ & $4.2_{(3)}$ & $+21.1$ & $+13.6$ \\ +Piece-tip (Cov.) & $1.0$ & $2.9$ & $0.8$ & $\mathbf{7.3}_{(3)}$ & $1.1_{(3)}$ & $3.3_{(3)}$ & $2.9_{(3)}$ & $5.1_{(3)}$ & \textit{queued} & $+6.4$ & $+4.4$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Scorer health, matched-actor table.} Columns are the flagship rows in order (Sq-S square-Sub, Sq-C square-Cov, Pc-S piece-Sub, Pc-C piece-Cov, Mug, Thr threading, Pc-tip piece-tip), independently checkable from the eval artefacts: the recorded action's rank percentile among the 128 candidates on one shared candidate set; the read-out's spread over the 128 candidates at a state; how many of the 128 tie at the arg-max (an arg-max over $k$ tied candidates is a uniform draw among those $k$ -- a coarse filter plus resampling -- and in simulation the read-out that ties most candidates outperforms the one that orders all 128, so a high count is not by itself evidence of worse ranking); TD-Flow's target-dispersion ratio against the measured Monte-Carlo reference; and the checkpoint's held-out true-vs-shuffled action win rate, a two-candidate percentile. A scorer absent here has no health number and is marked $\ddagger$ in Table~\ref{tab:matched_actor}: not reportable by our own rule.} +\label{tab:scorer_health} +\scriptsize +\setlength{\tabcolsep}{2.5pt} +\begin{tabular}{llccccccc} +\toprule +Scorer & metric & Sq-S & Sq-C & Pc-S & Pc-C & Mug & Thr & Pc-tip \\ +\midrule +RSM & rank pct & -- & 58.6 & 45 & 49.4 & 40.7 & -- & -- \\ + & spread & -- & 0.0378 & 3.31 & 1.13 & 0.0406 & -- & 1.58 \\ + & ties/128 & -- & 44.4 & 4.47 & 33.8 & 56.3 & -- & 62 \\ + & win rate & -- & 0.854 & 0.756 & 0.699 & 0.604 & -- & 0.765 \\ +\addlinespace[2pt] +TD-Flow & rank pct & -- & 56.1 & -- & 44.3 & 51.7 & -- & 42.2 \\ + & spread & -- & 2.45 & 0.0203 & 0.0263 & 0.0231 & -- & 0.0202 \\ + & ties/128 & -- & 55.4 & 21.2 & 37.6 & 56.8 & -- & 37.8 \\ + & disp. ratio & -- & 28.4 & 3.34 & 7.97 & 5.44 & -- & 15.5 \\ + & win rate & -- & 0.812 & 0.563 & 0.717 & 0.79 & -- & 0.92 \\ +\addlinespace[2pt] +IFQL & rank pct & -- & 49.1 & 36 & 40.6 & 53.1 & -- & 36.6 \\ + & spread & -- & 0.00155 & 0.000125 & 0.000461 & 0.000153 & -- & 0.000427 \\ + & ties/128 & -- & 1.52 & 19.9 & 1.45 & 11 & -- & 2.43 \\ +\addlinespace[2pt] +LeWM & spread & -- & 0.0174 & 0.0191 & 0.00621 & 0.00882 & -- & 0.00785 \\ + & ties/128 & -- & 39.3 & 31.9 & 55.7 & 33.3 & -- & 73.4 \\ + & win rate & -- & 0.547 & 0.574 & 0.574 & 0.512 & -- & 0.531 \\ +\addlinespace[2pt] +DINO-WM & spread & -- & 0.0395 & 0.0311 & 0.0118 & 0.0092 & -- & -- \\ + & ties/128 & -- & 69.4 & 78.5 & 88.8 & 101 & -- & -- \\ + & win rate & -- & 0.475 & 0.411 & 0.469 & 0.445 & -- & -- \\ +\addlinespace[2pt] +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Data regime.} Demonstration counts per task, and the median length of an expert +demonstration against the 400-step evaluation horizon (the horizon enters the throughput definition in +Table~\ref{tab:throughput}). ``Expert'' and ``Suboptimal'' are the two files RISE's reward labels +distinguish: every frame of an expert episode carries reward $1$ and every frame of a suboptimal one +carries $0$.} +\label{tab:data} +\footnotesize +\setlength{\tabcolsep}{6pt} +\begin{tabular}{lccc} +\toprule +Task & Expert & Suboptimal & Median expert demo (of 400) \\ +\midrule +Square (Sub.) & 20 & 100 & 173 \\ +Square (Cov.) & 200 & 224 & 374 \\ +Piece (Sub.) & 20 & 100 & 317 \\ +Piece (Cov.) & 200 & 199 & 311 \\ +Mug (Sub.) & 20 & 100 & 356 \\ +Thread (Cov.) & 250 & 200 & 215 \\ +Piece-tip (Cov.) & 200 & 504 & 311 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Throughput.} Success rate $\times$ horizon $/$ mean steps-to-success, i.e.\ successes +per 400 environment steps, on exactly the columns, rows and episodes of +Table~\ref{tab:flagship_single_actor} -- a method that succeeds as often but sooner scores higher here, which the +success rate alone cannot show. The RSM row is the same coin-chain arm that table prints, not the +retired fold; a task with no chain arm reads ``--'' rather than borrowing the fold's timing. Reported separately because the two tables together exceed the +397.5pt text block. $\Delta$ is again the margin over the strongest baseline on that task.} +\label{tab:throughput} +\scriptsize +\setlength{\tabcolsep}{1.2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Sub.) & $0.110{\pm}0.011$ & $0.570{\pm}0.018$ & $\mathbf{0.575{\pm}0.027}$ & -- & $0.507{\pm}0.016$ & $\mathrm{n/a}$ & -- & -- \\ +Square (Cov.) & $\mathbf{0.093{\pm}0.021}$ & $0.031{\pm}0.006$ & $0.074{\pm}0.014$ & -- & $0.037{\pm}0.002$ & $\mathrm{n/a}$ & -- & -- \\ +Piece (Sub.) & $0.127{\pm}0.014$ & $\mathbf{0.371{\pm}0.034}$ & $0.338{\pm}0.028$ & $0.263{\pm}0.043$ & $0.256{\pm}0.063$ & $\mathrm{n/a}$ & -- & -- \\ +Piece (Cov.) & $0.189{\pm}0.003$ & $0.275{\pm}0.021$ & $\mathbf{0.330{\pm}0.018}$ & $0.131{\pm}0.016$ & $0.063{\pm}0.011$ & $\mathrm{n/a}$ & -- & -- \\ +Mug (Sub.) & $\mathbf{0.153{\pm}0.006}$ & $0.049{\pm}0.002$ & $0.045{\pm}0.002$ & $0.054{\pm}0.000$ & $0.059{\pm}0.016$ & $\mathrm{n/a}$ & -- & -- \\ +Thread (Cov.) & $\mathbf{0.141{\pm}0.001}$ & $0.015{\pm}0.004$ & $0.012{\pm}0.003$ & $0.121{\pm}0.014$ & $0.034{\pm}0.013$ & $\mathrm{n/a}$ & -- & -- \\ +Piece-tip (Cov.) & $0.003{\pm}0.003$ & $0.013^{\dagger}$ & $0.010{\pm}0.005$ & -- & $\mathbf{0.025{\pm}0.008}$ & $\mathrm{n/a}$ & -- & -- \\ +\bottomrule +\end{tabular} +\end{table} + diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_table.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_table.tex new file mode 100644 index 0000000000000000000000000000000000000000..e1b0edcea4a7cdeddab524759671b246bf259ad4 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_table.tex @@ -0,0 +1,619 @@ +% Flagship comparison under the RISE-faithful (data-provenance) reward. +% Generated by scripts/flagship_latex.py -- regenerate rather than editing by hand. +% Preamble: \usepackage{booktabs} <- the ONLY package this table needs. +% Sized for ICLR's 5.5in (397.5pt) text block; verified with scripts/check_iclr_fit.sh. + +\begin{table}[t] +\centering +\caption{\textbf{Offline RL comparison over suboptimal and play data.} RSM performs better or on-par with BC baselines and SOTA world-model-based planning and offline RL algorithms. The two methods with a horizon read-out (RSM, TD-Flow) share the coin-terminated $\beta$ chain: a walk of stochastic length with continuation $p=(\gamma-\beta)/(\gamma(1-\beta))$ and one membership read at the frozen node, whose composed frame offset is exactly $\mathrm{Geom}(1-\gamma)$, capped at the $10^{-3}$ truncation tail. It replaces the deterministic truncated fold these columns previously reported, which is kept in Table~\ref{tab:flagship_fold}; a cell whose chain re-score has not landed prints its launch state rather than the superseded number. The chain settings were selected on RSM and transferred unchanged to TD-Flow, so TD-Flow received the smaller search budget: the per-row chain search is 20--30 arms per row (particles $\times$ prob or logit read-out $\times$ the $\beta$ grid $\times$ the successor sampler's Euler-step count $\in\{4,8,16\}$, default $8$), the cap is not a hyper-parameter but the $10^{-3}$ truncation tail of the continuation coin, and $\beta$ is swept over the grid the rows already used, which training supports because the successor is $\beta$-conditioned over $[0.90,0.995]$. The reward is RISE's binary data-provenance membership label for every value estimator. \TODO{MC-value is low priority. Maybe sweep gamma in ifql}} +\label{tab:flagship} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcc|cccccc} +\toprule +% & \multicolumn{2}{c|}{no planning} & \multicolumn{6}{c}{value estimators, one proposer per row, same 128 candidates} \\ +% \cmidrule(lr){2-3} \cmidrule(lr){4-9} +Task & BC & BC-u & IDQL & IFQL & TD-Flow & LeWM & DINO-WM & RSM \\ +\midrule +Square (Sub.) & $14.4{\pm}2.2$ & $48.0{\pm}1.4$ & $43.6{\pm}1.2$ & $46.7{\pm}1.3$ & $50.0{\pm}4.8$ & $48.9{\pm}1.6$ & $50.7{\pm}2.0$ & $\mathbf{54.0{\pm}1.3}$ \\ +Square (Cov.) & $11.0{\pm}1.0$ & $3.1{\pm}0.6$ & $3.7{\pm}0.2$ & $0.7{\pm}0.4$ & $7.1{\pm}1.1$ & $3.3{\pm}0.4$ & $13.3{\pm}3.3$ & $\mathbf{20.9{\pm}2.6}$ \\ +Piece (Sub.) & $13.8{\pm}2.0$ & $33.0{\pm}1.7$ & $22.9{\pm}6.1$ & $17.8{\pm}3.1$ & $30.2{\pm}1.9$ & $32.4{\pm}1.4$ & $41.8{\pm}2.7$ & $\mathbf{47.1{\pm}3.5}$ \\ +Piece (Cov.) & $18.9{\pm}1.2$ & $25.3{\pm}2.2$ & $6.0{\pm}1.7$ & $21.1{\pm}1.9$ & $16.0{\pm}1.4$ & $18.9{\pm}1.0$ & $39.6{\pm}1.2$ & $\mathbf{48.7{\pm}0.7}$ \\ +Mug (Sub.) & $14.9{\pm}1.7$ & $4.9{\pm}0.2$ & $16.2{\pm}1.0$ & $18.4{\pm}1.0$ & $19.8{\pm}0.9$ & $18.7{\pm}2.5$ & $21.1{\pm}0.8$ & $\mathbf{23.1{\pm}2.1}$ \\ +Thread (Cov.) & $26.3{\pm}1.2$ & $1.3{\pm}0.2$ & $12.2{\pm}1.4$ & $8.4{\pm}1.2$ & $7.1{\pm}1.4$ & $9.6{\pm}1.0$ & $\mathbf{31.6{\pm}1.6}$ & $25.8{\pm}1.1$ \\ +Piece-tip (Cov.) & $2.0{\pm}1.0$ & $1.0{\pm}0.2$ & $2.9{\pm}0.6$ & $3.3{\pm}0.4$ & $1.1{\pm}0.6$ & $2.9{\pm}0.9$ & $5.1{\pm}0.6$ & $\mathbf{7.3{\pm}0.4}$ \\ +\midrule +Mean & $14.5{\pm}2.8$ & $16.7{\pm}7.1$ & $15.4{\pm}5.4$ & $16.6{\pm}5.8$ & $18.8{\pm}6.4$ & $19.2{\pm}6.3$ & $29.0{\pm}6.2$ & $\mathbf{32.4{\pm}6.6}$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Ablation: the $\beta$-recursion read-out.} The same checkpoints as Table~\ref{tab:flagship}, scored with our deterministic truncated fold instead of each method's own read-out. These are the numbers this paper reported before the read-out was corrected. The fold computed $q_k = c_k + (1-c_k)\gamma^{h} q_{k+1}$ over a FIXED $L$ hops with $q_L = 0$ ($h = 1/(1-\beta)$), which is an absorbing hitting probability over a truncated horizon, not the $\gamma$-discounted occupancy read the method claims. $L$ was chosen per row BY EVALUATION SUCCESS rather than set as a truncation guard, and on three rows it was $L=1$, where the estimator collapses to $q_0 = c_0$ -- membership at a single sampled successor state, with no chain at all. The retained-mass column is the fraction $1 - \gamma^{L h}$ of the $\gamma$-horizon that $L$ hops can see; the rest was dropped. Retained mass runs from $0.10$ to $0.98$ across the rows. RSM and TD-Flow shared the read-out, so both are shown: the correction moves both columns, which is why the chain was run for both. THE WORLD MODELS ARE HERE FOR A DIFFERENT REASON: the fold is not their planner at all, and LeWM additionally has no hop head, so it re-rolls one action sequence rather than composing hops. The $(\beta, L)$ columns describe the RSM arm; each method selected its own $L$ under the same rule. THE TWO READ-OUTS DID NOT GET THE SAME SEARCH, and the asymmetry runs AGAINST the fold shown here: the fold grid is FOUR arms per row ($L \in \{1,2,4,8\}$), while the trajectory (MPC) read-out the world-model columns carry in Table~\ref{tab:flagship} is TEN ($H \in \{10,20,50,100,200\}$ frames $\times$ terminal-state or discounted-sum read-out). So wherever a world model scores HIGHER in this table than in Table~\ref{tab:flagship}, the larger search is on the LOSING side, which strengthens the gap rather than explaining it. Nor is the horizon axis saturated: the selected $H$ is $200$ frames -- the TOP of the grid -- on three of LeWM's five non-Mug/Thread rows and on four of DINO-WM's seven, so the trajectory read-out has NOT been searched to exhaustion; the next grid point is $500$ frames ($\gamma = 0.998$) and it would have to be added for BOTH world models or the two columns stop being comparable. Any read-out comparison drawn from this table is per column and per row and does not generalise: the two world models do not agree about which read-out is better, and DINO-WM's trajectory arms are what win it Mug and Thread. This is an ablation of the READ-OUT, not a baseline table: no number in it is a claim about any method as its authors specify it. Subscripts are policy seeds.} +\label{tab:ablation_betarec} +\label{tab:flagship_fold} +\scriptsize +\begin{tabular}{lcccrrrr} +\toprule +Task & $\beta$ & $L$ & retained mass & RSM & TD-Flow & DINO-WM & LeWM \\ +\midrule +Square (Sub.) & $0.95$ & $2$ & $0.33$ & $51.3_{(3)}$ & $48.7_{(3)}$ & $47.1_{(3)}$ & $52.2_{(3)}$ \\ +Square (Cov.) & $0.95$ & $8$ & $0.80$ & $17.6_{(3)}$ & $14.7_{(3)}$ & $7.1_{(3)}$ & $2.0_{(3)}$ \\ +Piece (Sub.) & $0.90$ & $3$ & $0.26$ & $46.6_{(3)}$ & $28.2_{(3)}$ & $30.4_{(3)}$ & $19.8_{(3)}$ \\ +Piece (Cov.) & $0.98$ & $8$ & $0.98$ & $50.1_{(3)}$ & $27.1_{(3)}$ & $39.6_{(3)}$ & $13.8_{(3)}$ \\ +Mug (Sub.) & $0.90$ & $1$ & $0.10$ & $20.0_{(3)}$ & $20.7_{(3)}$ & $18.2_{(3)}$ & $15.8_{(3)}$ \\ +Thread (Cov.) & $0.90$ & $1$ & $0.10$ & $32.7_{(3)}$ & $14.0_{(3)}$ & $23.6_{(3)}$ & $8.0_{(3)}$ \\ +Piece-tip (Cov.) & $0.90$ & $1$ & $0.10$ & $6.9_{(3)}$ & $2.0_{(3)}$ & $2.6_{(3)}$ & $3.1_{(3)}$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{What Table~\ref{tab:flagship} holds fixed across methods.} Each line is enforced by the evaluation pipeline or filtered on by the table loader; the last line is the one factor that differs between value estimators and is therefore part of what the comparison measures. The read-out is held IDENTICAL across the two methods that have one (RSM and TD-Flow); the reward for every value estimator is RISE's binary data-provenance membership label, and the retired oracle progress head appears in no table in this paper.} +\label{tab:controls} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{@{}p{2.25cm}p{10.7cm}@{}} +\toprule +Controlled factor & Setting \\ +\midrule +Proposer & one actor per row, shared by every planning column: the RISE actor on every row except Mug (Sub.): BC-expert; Thread (Cov.): IDQL policy@500; chosen by planning performance and disclosed \\ +Candidate set & $128$ action chunks per decision step from that proposer; every value estimator ranks the same draws (common random numbers per evaluation seed), argmax selection \\ +Reward & RISE's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on every frame of a suboptimal one), unchanged, for every value estimator; BC/BC-u use none \\ +Training data & the row's released expert$+$suboptimal file for every learned component (BC: its expert half; BC-u and all value estimators: the union); no extra data unless the row says regenerated \\ +Evaluation & same simulator, same canonical initial-state region, same success criterion (the paper's relaxed mug criterion), horizon $400$, $50$ episodes per cell \\ +Seeds & $3$ policy $\times$ $3$ evaluation seeds per cell; an evaluation seed varies the action draws and the environment initial conditions \\ +Scorer budget & RSM, TD-Flow, LeWM, DINO-WM: $100$k gradient steps on the same cache; IDQL/RISE critic co-trained with the actor; IFQL its published schedule \\ +Read-out & RSM and TD-Flow share the coin-terminated $\beta$ chain: per particle the walk hops a $\mathrm{Bernoulli}(p)$ number of times with $p = (\gamma-\beta)/(\gamma(1-\beta))$ and membership is read once at the frozen node, so the composed frame offset is exactly $\mathrm{Geom}(1-\gamma)$; the loop cap is set by the $10^{-3}$ truncation tail ($p^{L}\le 10^{-3}$), not tuned. The world models are read as MPC and not through our fold: from each candidate the model is rolled open-loop for $H = 1/(1-\gamma)$ frames -- $\lceil H/8 \rceil$ chunks, the action sequence past the first chunk being the proposer's own continuation -- and scored with the same reward head every other column uses (terminal-state and discounted-sum read-out). $H$ was swept through the discount, $\gamma \in \{0.90,0.95,0.98,0.99,0.995\}$ giving $H \in \{10,20,50,100,200\}$ frames; the selected $H$ is DINO-WM $\in\{10,100,200\}$, LeWM $\in\{10,50,200\}$ (\texttt{status/q273/wm\_mpc\_arm\_dump.json}). The superseded $R\beta$-$L$ cells, which folded $L \in \{1,2,4,8\}$ open-loop chunks with the per-hop discount $\gamma^{8}$ and selected $L$ per row by success, are retired into Table~\ref{tab:ablation_betarec}. The critics (IDQL/RISE, IFQL) have no horizon read-out at all \\ +\emph{Not controlled} & the observation each value estimator scores: frozen DINOv2 features of the two camera frames (RSM, IFQL, TD-Flow, DINO-WM), raw $84$ px frames (LeWM), the actor's own image encoder (IDQL/RISE critic) \\ +Proposer (new baselines) & Diffusion Forcing and TD-MPC2 configuration (b) are $\emph{planners}$: they propose their own actions and therefore do NOT share the $128$-candidate draw, so their search budget is their own and is disclosed in Table~\ref{tab:searchsize}. TD-MPC2 configuration (a) does share it: it ranks the same $128$ chunks from the same actor with common random numbers, and is the only one of the three that is a drop-in value estimator -- which makes it close to DINO-WM with a value head, and it is reported as such \\ +Reward (new baselines) & unchanged -- RISE's binary data-provenance label. DF's guidance is computed from its own predicted reward channel trained on that label; TD-MPC2's learned reward head is trained on it. No other signal (goal, progress, distance) enters either method \\ +Training data (new baselines) & the same task cache as DINO-WM: the pooled DINOv2 state ($z$ plus proprioception, normalised by the cache's own \texttt{feat\_stats}) and the $7$-d OSC action, same episode split. Neither new baseline saw pixels and neither saw an episode the other columns did not \\ +Health (new baselines) & every new-baseline score is printed beside a rollout-fidelity number at its OWN row horizon, read against the stay-put predictor on the same pairs. The two fidelities are NOT comparable with each other and are never put in one column: DF predicts observations, so its number is an observation-space RMSE; TD-MPC2's world model is implicit and has no decoder, so its number is the latent analogue. A row whose rollout is no better than standing still carries that flag next to its score \\ +\bottomrule +\end{tabular} +\end{table} +\begin{table}[t] +\centering +\caption{\textbf{Search size per decision, disclosed.} A planning column's score is a joint result of its value estimate AND how much search it is allowed; these are not interchangeable and the table states both. ``Candidates'' is how many distinct action sequences the column evaluates per decision; ``model rollouts'' is how many times a learned dynamics model is rolled. A column that proposes its own actions is marked \emph{planner} and is not a $128$-candidate column in any sense. Per $400$-frame episode at the defaults the shared-candidate columns evaluate $50 \times 128 = 6\,400$ action sequences, Diffusion Forcing diffuses $50$ plans of $n_{\mathrm{plans}}$, and TD-MPC2 configuration (b) rolls $134 \times 3\,072 \approx 4.1\times10^{5}$ latent trajectories while re-committing every $3$ frames rather than every $8$.} +\label{tab:searchsize} +\scriptsize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{@{}p{1.95cm}p{2.25cm}p{2.25cm}p{1.85cm}p{4.2cm}@{}} +\toprule +Column & Proposer & Candidates / decision & Model rollouts / decision & Note \\ +\midrule +RSM, TD-Flow & shared actor & $128$ & $128 \times M$ particles & the $\beta$ chain; cap from the $10^{-3}$ truncation tail \\ +DINO-WM, LeWM & shared actor & $128$ & $128 \times L$ chunks & $L$ selected per row by success \\ +IDQL / RISE, IFQL & shared actor & $128$ & $0$ (critic, no rollout) & \\ +TD-MPC2 (a) & shared actor & $128$ & $128 \times 1$ & deterministic latent model: particles do nothing, so this column spends LESS than the RSM column at the same nominal particle count \\ +Diffusion Forcing & \emph{planner} & $n_{\mathrm{plans}}$ diffused plans & one per plan & guidance scale swept; the swept values are part of this budget and are listed beside the score \\ +TD-MPC2 (b) & \emph{planner}, RISE actor as prior & $S$ samples $\times$ $I$ iterations & $S \times I$ & defaults $S{=}512$, $I{=}6$, $H_p{=}3$, $24$ prior trajectories from the shared actor: $3072$ rollouts per plan, replanned every $\min(8,H_p){=}3$ frames \\ +\bottomrule +\end{tabular} +\end{table} +\begin{table}[t] +\centering +\caption{\textbf{Search actually performed, per method per task.} Distinct evaluated arms, counted from the evaluation archive rather than asserted, so this table cannot drift from the numbers it describes. An arm is one setting of that method's knobs; each arm is run at 3 training $\times$ 3 evaluation seeds. The asymmetry is large and it does not run one way: RSM has the most arms on the rows it wins and also on Thr, which it loses, while LeWM and DINO-WM were searched far less on Sq and Pc. Each cell is \emph{arms (distinct discounts evaluated)}. Those are DIFFERENT axes and must not be read as one: the $R$ field of an arm label is $\beta$, not $\gamma$, so a method can carry hundreds of arms at a single discount --- which is what RSM and TD-Flow did until 2026-09-23, both pinned to the config default $\gamma=0.99$. \textbf{IDQL/RISE remains the starkest gap}, and for a structural reason: its discount is a TRAINING parameter, so each point is a full retrain (27--35 GPU-h, measured) rather than a re-score of a frozen model (minutes). That asymmetry, not a lack of effort, is why its column is thin; the $\gamma$ grid for it is in training and this table is regenerated from disk, never asserted. \textbf{A 4 is not always a gap.} TD-Flow reads 4 on Pc-C, Mug and Pc-tip because its pinned recipe there has $\beta=0.95$, and a $\beta$-chain needs $\beta<\gamma$ for a positive continuation probability $p=(\gamma-\beta)/(\gamma(1-\beta))$; at $\gamma=0.90$, $p=-1.11<0$ and the chain degenerates to a single draw. The launcher refuses the point on all three tasks at all three evaluation seeds (measured, not assumed), so 4 is the WHOLE admissible grid there. The fair discount grid for a $\beta$-chain estimator is narrower than for a world model, which reaches all five everywhere.} +\label{tab:sweeps} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{@{}lcccccccp{5.4cm}@{}} +\toprule +Method & Sq-S & Sq-C & Pc-S & Pc-C & Mug & Thr & Pc-tip & Axes swept \\ +\midrule +RSM & 50 (5) & 50 (5) & 37 (5) & 50 (5) & 276 (5) & 302 (5) & 50 (5) & $\beta$ $\times$ particles $\times$ read-out (prob/logit) $\times$ flow steps $\times$ $\gamma$ (\emph{evaluation-only}: the successor is discount-conditioned, so a point is a re-score); cap derived from the $10^{-3}$ tail, not chosen \\ +TD-Flow & 25 (5) & 24 (5) & 24 (5) & 22 (5) & 138 (5) & 140 (5) & 23 (5) & the RSM chain settings transferred unchanged, plus its own $\beta$ grid and the same evaluation-only $\gamma$ grid \\ +DINO-WM & 20 (5) & 20 (5) & 20 (5) & 20 (5) & 129 (5) & 134 (5) & 20 (5) & rollout horizon $H\in\{10,20,50,100,200\}$ via $\gamma$ $\times$ read-out (terminal latent / discounted sum) \\ +LeWM & 15 (5) & 15 (5) & 15 (5) & 15 (5) & 132 (5) & 134 (5) & 15 (5) & same grid as DINO-WM \\ +IDQL / RISE & 3 (1) & 2 (1) & 3 (1) & 3 (1) & 8 (1) & 42 (1) & 3 (1) & $\gamma$ only, and it is a \textbf{training} parameter: the released critic is pinned to $0.99$ (\texttt{iql\_diffusion\_config.py:75}), so every extra point is a retrain \\ +IFQL & -- & -- & -- & -- & -- & -- & -- & none --- published schedule; \textbf{dropped from the sweeps 2026-09-23} \\ +TD-MPC2 & -- & -- & -- & -- & 18 (5) & 26 (5) & -- & $\gamma$/$H$ (a \textbf{training} parameter here) $\times$ configuration (a) shared candidates / (b) own MPPI \\ +DF & -- & -- & -- & -- & 31 (5) & 41 (5) & -- & guidance scale $\times$ candidate count $\times$ horizon \\ +\bottomrule +\end{tabular} +\end{table} + + + +\begin{table}[t] +\centering +\caption{\textbf{Preliminary results under the RISE-faithful reward.} \textbf{One proposer per row, shared by every scorer.} Unlisted rows propose from the RISE actor; Mug (Sub.): BC-expert; Thread (Cov.): IDQL policy@500 (chosen by planning performance, a disclosed search; unrun scorers on such a row print \textit{pending}/\textit{launched}). All methods see the same +reward: the dataset's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on +every frame of a suboptimal one), which is what RISE's \texttt{relabel\_rewards.py} writes and its IQL +critic consumes unchanged; BC and BC-u use no reward by construction. RISE-g samples the RISE actor +once with no critic ranking, i.e.\ the RISE policy without its selection step. \textbf{IFQL} (implicit flow Q-learning) as published --- its own flow actor ranked by its expectile critic --- did not yield a functional policy in this observation space (a per-step flow actor against a chunked diffusion proposer, frozen DINO features in place of its native encoder; with ranking off it already scores $5.3$ and $0.7\,\%$ against $9.0$ and $0.2\,\%$ with the critic), so its column reads ``n/a'' and its critic is compared on the common proposer in Table~\ref{tab:flagship} and Table~\ref{tab:matched_actor}, with ranking diagnostics in \S\ref{sec:value-selection-impossible}. \textbf{Bold} marks the best +method on each task. Entries are mean\,$\pm$\,standard error \emph{across seeds}, with the seed +count as a subscript; a seed varies the policy action draw and the environment initial conditions with +the network initialisation held fixed, and the seed is the unit of replication +(\S\ref{sec:seed-semantics}). $\dagger$ marks +a single-seed entry, where no seed variance is measurable and the interval shown is binomial over that +seed's episodes; read those rows as provisional. $\\circ$ marks an entry whose arm has not yet +landed on the full $3\\times3$ policy\\,$\\times$\\,eval-seed grid; the subscript counts policy seeds only, +so without this mark a partly-landed arm is indistinguishable from a complete one. An arm on the +complete grid is always preferred to a partly-landed one however high the latter scores, so this mark +can appear only where no arm on that row has finished. $\Delta$ is the margin of RSM over the strongest baseline on that task, +with $^{*}$ marking $p<0.05$ under a two-proportion $z$-test. Tasks: Square $=$ square-peg, +Piece $=$ piece-assembly, Piece-tip $=$ piece-assembly with tipped initialisation, Thread $=$ threading; +(Sub.) and (Cov.) are the suboptimal and coverage data regimes; demonstration counts are in +Table~\ref{tab:data}. The RSM column reads the coin-terminated $\beta$-chain cells \emph{only}, as in +Table~\ref{tab:flagship}: a task whose chain re-score has not landed prints its launch state rather +than the superseded deterministic-fold number, and the retired fold numbers are in +Table~\ref{tab:ablation_betarec}. The RSM entry on each task is the best of the successor-model chain +configurations (model size, discount, particles, read-out, candidate count) evaluated +there -- 20/20/20/20/20/30/20 configurations per task in row order, single-seed ones included -- so it is a maximum +over a search, whereas each baseline is a single configuration; the held-out analysis +(\texttt{scripts/heldout\_table.py}) selects on one seed +and scores on the others. Because a maximum over a search carries the winner's curse even when the search +is disclosed, we also give the \\emph{median} over every fully seeded chain configuration of the same family, a +number that does not depend on picking a winner: 50.4/14.1/42.4/39.1/18.9/14.1/3.2 per task in row order, over 20/20/20/20/20/30/20 such +configurations. Where the median still exceeds every baseline the row is robust to that choice. Episodes behind each column: BC 4500, BCU 7760, RISEg 8850, IDQL 2200, RISE 12300, IFQL 0 across the baselines (every epoch-5000 +evaluation of that policy is pooled), 5450 behind the RSM entries (50 per seed).} +\label{tab:flagship_single_actor} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Sub.) & $14.4{\pm}2.2_{(3)}$ & $48.0{\pm}1.4_{(3)}$ & $48.7{\pm}1.9_{(3)}$ & -- & $43.6{\pm}1.2_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{54.0{\pm}1.3_{(3)}}$ & $+5.3$ \\ +Square (Cov.) & $11.0{\pm}1.0_{(3)}$ & $3.1{\pm}0.6_{(3)}$ & $7.3{\pm}1.3_{(3)}$ & -- & $3.7{\pm}0.2_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{20.9{\pm}2.6_{(3)}}$ & $+9.9^{*}$ \\ +Piece (Sub.) & $13.8{\pm}2.0_{(3)}$ & $33.0{\pm}1.7_{(3)}$ & $30.7{\pm}2.2_{(3)}$ & $24.2{\pm}3.6_{(3)}$ & $22.9{\pm}6.1_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{47.1{\pm}3.5_{(3)}}$ & $+14.5^{*}$ \\ +Piece (Cov.) & $18.9{\pm}1.2_{(3)}$ & $25.3{\pm}2.2_{(3)}$ & $31.2{\pm}1.6_{(3)}$ & $12.8{\pm}1.5_{(2)}$ & $6.0{\pm}1.7_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{48.7{\pm}0.7_{(3)}}$ & $+17.8^{*}$ \\ +Mug (Sub.) & $14.9{\pm}1.7_{(3)}$ & $4.9{\pm}0.2_{(3)}$ & $4.4{\pm}0.2_{(3)}$ & $5.3{\pm}0.0_{(2)}$ & $5.8{\pm}1.6_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{23.1{\pm}2.1_{(3)}}$ & $+8.2^{*}$ \\ +Thread (Cov.) & $\mathbf{26.3{\pm}1.2_{(3)}}$ & $1.3{\pm}0.2_{(3)}$ & $1.2{\pm}0.3_{(3)}$ & $11.8{\pm}1.4_{(3)}$ & $3.5{\pm}1.1_{(3)}$ & $\mathrm{n/a}$ & $25.8{\pm}1.1_{(3)}$ & $-0.6$ \\ +Piece-tip (Cov.) & $2.0{\pm}1.0_{(3)}$ & $1.0{\pm}0.2_{(3)}$ & $1.0{\pm}0.5_{(3)}$ & -- & $2.9{\pm}0.6_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{7.3{\pm}0.4_{(3)}}$ & $+4.4^{*}$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Planning methods on one proposer per row.} Every column right of the rule ranks the identical $128$ candidates drawn from the identical actor, so only the value estimate differs: \emph{P-greedy} is that proposer sampled once (no selection), \emph{rand-128} picks uniformly among the same candidates, \emph{P-critic} is the proposer's own co-trained IQL critic --- RISE's and IDQL's value estimate on this actor --- and then the added scorers and RSM. BC and BC-u are standalone policies that neither propose nor rank, so they are reported left of the rule as the bar to clear and excluded from $\Delta$, which is the margin over the strongest planning comparator; a row where BC or BC-u exceeds RSM carries $^{\dagger}$. Published-method columns that plan from their own proposer (IDQL, RISE) are in Table~\ref{tab:flagship_single_actor}; paired significance tests against the two controls are in Table~\ref{tab:matched_actor}. Protocol and seeds as in Table~\ref{tab:flagship_single_actor}. Every column right of the rule reads the coin-terminated $\beta$-chain cells only, RSM and TD-Flow included: a row whose chain re-score has not landed prints its launch state rather than the superseded deterministic-fold number, which is never substituted for it. The retired fold numbers for every method scored that way are in Table~\ref{tab:ablation_betarec}. \textbf{Bold} is the best number printed in the row, reference policies included --- this table has planning comparators the single-actor table does not, so a cell is bolded here only if it leads THIS row. Rows are Sq-S square-Sub, Sq-C square-Cov, Pc-S piece-Sub, Pc-C piece-Cov, Mug, Thr threading, Pc-tip piece-tip. A cell reads \textit{pend k/9} when fewer than the $3{\times}3$ seed cells have landed, \textit{launched} when its jobs are queued on that proposer, \textit{queued} when the model is trained and its evaluation has not landed, \textit{trn} with the checkpoint step or seeds done while the model is still training, \textit{n/a} where the method does not exist for that proposer (a BC actor has no co-trained critic), and -- when nothing exists for it. Status words are derived from the run artefacts at generation time.} +\label{tab:flagship_all} +\scriptsize +\setlength{\tabcolsep}{1.5pt} +\begin{tabular}{lcc|ccccccccc} +\toprule +& \multicolumn{2}{c|}{no planning} & \multicolumn{8}{c}{one proposer per row, same 128 candidates} & \\ +\cmidrule(lr){2-3} \cmidrule(lr){4-11} +Task & BC & BC-u & P-greedy & rand-128 & P-critic & IFQL & TD-Flow & LeWM & DINO-WM & RSM & $\Delta$ \\ +\midrule +Sq-S & $14.4_{(3)}$ & $48.0_{(3)}$ & $48.7_{(3)}$ & $49.3$ & $43.6_{(3)}$ & $46.7_{(3)}$ & $50.0_{(3)}$ & $48.9_{(3)}$ & $50.7_{(3)}$ & $\mathbf{54.0{\pm}1.3_{(3)}}$ & $+3.3$ \\ +Sq-C & $11.0_{(3)}$ & $3.1_{(3)}$ & $7.3_{(3)}$ & $6.4$ & $3.7_{(3)}$ & $0.7_{(3)}$ & $7.1_{(3)}$ & $3.3_{(3)}$ & $13.3_{(3)}$ & $\mathbf{20.9{\pm}2.6_{(3)}}$ & $+7.6$ \\ +Pc-S & $13.8_{(3)}$ & $33.0_{(3)}$ & $30.7_{(3)}$ & $29.1$ & $22.9_{(3)}$ & $17.8_{(3)}$ & $30.2_{(3)}$ & $32.4_{(3)}$ & $41.8_{(3)}$ & $\mathbf{47.1{\pm}3.5_{(3)}}$ & $+5.3$ \\ +Pc-C & $18.9_{(3)}$ & $25.3_{(3)}$ & $31.2_{(3)}$ & $30.1$ & $6.0_{(3)}$ & $21.1_{(3)}$ & $16.0_{(3)}$ & $18.9_{(3)}$ & $39.6_{(3)}$ & $\mathbf{48.7{\pm}0.7_{(3)}}$ & $+9.1$ \\ +Mug & $14.9_{(3)}$ & $4.9_{(3)}$ & $14.5$ & $14.9$ & $16.2$ & $18.4_{(3)}$ & $19.8_{(3)}$ & $18.7_{(3)}$ & $21.1_{(3)}$ & $\mathbf{23.1{\pm}2.1_{(3)}}$ & $+2.0$ \\ +Thr & $26.3_{(3)}$ & $1.3_{(3)}$ & $4.7$ & $5.2$ & $12.2$ & $8.4_{(3)}$ & $7.1_{(3)}$ & $9.6_{(3)}$ & $\mathbf{31.6_{(3)}}$ & $25.8{\pm}1.1_{(3)}$ & $-5.8$$^{\dagger}$ \\ +Pc-tip & $2.0_{(3)}$ & $1.0_{(3)}$ & $1.0_{(3)}$ & $0.8$ & $2.9_{(3)}$ & $3.3_{(3)}$ & $1.1_{(3)}$ & $2.9_{(3)}$ & $5.1_{(3)}$ & $\mathbf{7.3{\pm}0.4_{(3)}}$ & $+2.2$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Discount factors and horizons.} Top: what each method discounts. Bottom: the coin-terminated $\beta$-chain read-out per row, for the arm Table~\ref{tab:flagship} actually prints (the chain-only selection; a retired fold arm can no longer stand in for it here). One hop of the successor model is one draw $k\sim\mathrm{Geom}(1{-}\beta)$, mean $\beta/(1{-}\beta)$ frames in our time-zero convention; after each hop the walk continues with probability $p=(\gamma{-}\beta)/(\gamma(1{-}\beta))$, so it takes $1/(1{-}p)=\gamma(1{-}\beta)/(\beta(1{-}\gamma))$ successor reads on average and the composed frame offset has mean $\gamma/(1{-}\gamma)=100$ frames for EVERY $\beta$ -- that identity is the point of the read-out, and Table~\ref{tab:chainhops} measures both quantities on the flagship cells. The cap is not a hyper-parameter: it is the smallest depth whose truncation tail $p^{\mathrm{cap}}$ is at most $10^{-3}$ (last column), and Table~\ref{tab:chainhops} reports the measured capped fraction. The retired deterministic fold's per-row $(\beta,L)$ and its retained $\gamma$-mass $\gamma^{L/(1-\beta)}$ are in Table~\ref{tab:ablation_betarec}, where $L$ was swept by success rather than set as a truncation guard; the shorthand $L^{*}=(1{-}\beta)/(1{-}\gamma)$ used there is exact only where $\gamma=\beta(2{-}\beta)$ -- at $\gamma=0.99$ that is $\beta=0.90$ -- and overstates elsewhere (5 against the exact 4.21 at $\beta=0.95$). $\gamma=0.99$ is the discount of EVERY value-estimator number this paper prints (the robomimic default of the RISE critic), so the cross-method comparison is at one horizon. It was not, however, left unswept: an evaluation-only $\gamma$ grid was run on the frozen checkpoints for RSM and TD-Flow and Table~\ref{tab:sweeps} counts it. None of those arms reaches a table -- the arm key carries $\beta$ and the cap but not $\gamma$, so the loader identifies an off-$\gamma$ arm by the cap its $\beta$ implies at the $10^{-3}$ tail ($0.90\to73$, $0.95\to33$, $0.98\to11$), excludes it from the chain pool and aborts the build if one is selected anyway. For the chain, $\beta$ is swept over the grid training supports and the cap follows from it; the retired fold additionally swept $L$ ($\beta\in\{0.9,0.95,0.98\}$, $L\in\{1,2,3,4,8\}$) and chose it by success, with no consistency check, so on its rows with $L0.5$ & \textbf{PASS} & \texttt{rsm\_planner.py:304} computes exactly the quantity Table~\ref{tab:discounts} prints and warns above $0.5$; the log carries the warning for each of the 5 rows whose tail exceeds $0.5$ and for none of the others \\ +B6 & The flagship cells ran the $(\beta,L)$ Table~\ref{tab:discounts} claims & \textbf{PASS} & read back from the 231 cell \textsc{json}s (11{,}550 episodes) that make up the RSM column, not from a config: every cell of a row records the same $(\beta,L,\gamma)$ and it is that row's, with $\gamma=0.99$ throughout \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Numerical tests behind Table~\ref{tab:audit}.} Composition: $2\times10^{5}$ chains of $L$ hops drawn from the deployed sampler (\texttt{data.py:11-23}) at each row's flagship $(\beta,L)$, against $\mathrm{NegBin}(L,1{-}\beta)$ counting failures (mean $L\beta/(1{-}\beta)$). The last two columns repeat the draw on the \emph{real} episode lengths of that row's corpus, where the episode end truncates the chain: the shortfall is how much shorter the realised horizon is than the untruncated one, and it is the reason a large $L\cdot h$ in Table~\ref{tab:discounts} is an upper bound.} +\label{tab:auditnum} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{lcc|cc|cc|c|cc} +\toprule +& & & \multicolumn{2}{c|}{mean} & \multicolumn{2}{c|}{variance} & & \multicolumn{2}{c}{on real episodes} \\ +\cmidrule(lr){4-5} \cmidrule(lr){6-7} \cmidrule(lr){9-10} +Row & $\beta$ & $L$ & sampler & NegBin & sampler & NegBin & KS & frames & short \\ +\midrule +Sq-S & 0.95 & 2 & 37.92 & 38.00 & 754 & 760 & 0.0017 & 32.7 & 14 \\ +Sq-C & 0.95 & 8 & 152.03 & 152.00 & 3043 & 3040 & 0.0018 & 113.1 & 26 \\ +Pc-S & 0.9 & 3 & 26.98 & 27.00 & 270 & 270 & 0.0018 & 24.2 & 10 \\ +Pc-C & 0.95 & 8 & 152.05 & 152.00 & 3046 & 3040 & 0.0010 & 104.5 & 31 \\ +Mug & 0.9 & 1 & 8.99 & 9.00 & 90 & 90 & 0.0019 & 8.5 & 5 \\ +Thr & 0.9 & 1 & 8.98 & 9.00 & 90 & 90 & 0.0015 & 8.4 & 6 \\ +Pc-tip & 0.9 & 1 & 9.00 & 9.00 & 89 & 90 & 0.0017 & 8.4 & 6 \\ +\bottomrule +\end{tabular} +\smallskip + +\footnotesize +One chain by hand, on the trace \texttt{square\_expert\_play\_demo\_102\_t0145\_L40best\_b0.95\_L8\_N128\_P16.npz} (candidate 67, particle 6, $\beta=0.95$, $L=8$, $G=\gamma^{h}=0.817907$): $c=(0.0000,\,0.0000,\,0.0000,\,0.0140,\,0.0089,\,0.9759,\,0.0001,\,0.0000)$ folds to $q_0=0.3606741644$ against the implementation's $0.3606741428$ ($|\Delta|=2.2\times10^{-8}$). +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{How many $\beta$-hops approximate the $\gamma$ horizon?} A geometric number of $\mathrm{Geom}(1{-}\beta)$ hops is again geometric in the frame domain, so the chain the fold takes an expectation over \emph{is} the $\gamma$ horizon; only its truncation at a fixed $L$ is an approximation. $4\times10^{5}$ chains of the deployed sampler (\texttt{data.py:11-23}) per cell. \textsc{keep}: the fraction of the $\gamma$ mass a depth-$L$ fold retains, $1-\gamma^{L/(1-\beta)}$ (one minus the tail of Table~\ref{tab:discounts}). \textsc{fixed}: exactly $L$ hops. \textsc{fold}: the fold's own mixture -- continue after each hop with probability $\gamma^{h}$, truncated at $L$; chains still alive at $L$ are dropped and that defect enters $\mathrm{KS}$ (the last column conditions on stopping instead). Both are compared against the target $\mathrm{Geom}(1{-}\gamma)$, mean $99$ frames. $^{*}$ marks a flagship $L$.} +\label{tab:auditgamma} +\scriptsize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{cc|c|cc|ccc} +\toprule +& & keep & \multicolumn{2}{c|}{fixed $L$} & \multicolumn{3}{c}{fold truncated at $L$} \\ +\cmidrule(lr){4-5} \cmidrule(lr){6-8} +$\beta$ & $L$ & \% & mean & KS & mean & KS & KS$|$kept \\ +\midrule +$0.9$ & $1$\textbf{*} & 10 & 9.0 & 0.706 & 8.9 & 0.512 & 0.707 \\ + & $2$ & 18 & 18.0 & 0.596 & 13.2 & 0.510 & 0.640 \\ + & $4$ & 33 & 36.0 & 0.439 & 21.3 & 0.457 & 0.530 \\ + & $8$ & 55 & 72.0 & 0.246 & 35.8 & 0.360 & 0.371 \\ + & $15$ & 78 & 135.0 & 0.507 & 55.6 & 0.189 & 0.203 \\ + & $30$ & 95 & 270.0 & 0.808 & 80.2 & 0.043 & 0.058 \\ +$0.95$ & $1$ & 18 & 18.9 & 0.542 & 19.0 & 0.744 & 0.542 \\ + & $2$\textbf{*} & 33 & 37.9 & 0.372 & 27.6 & 0.595 & 0.442 \\ + & $4$ & 55 & 75.9 & 0.179 & 42.8 & 0.414 & 0.300 \\ + & $8$\textbf{*} & 80 & 151.9 & 0.485 & 66.3 & 0.192 & 0.136 \\ + & $15$ & 95 & 284.9 & 0.775 & 89.8 & 0.048 & 0.030 \\ + & $30$ & 100 & 569.9 & 0.961 & 103.1 & 0.020 & 0.019 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Hop accounting of the coin-terminated chain, measured inside the flagship evaluations.} $\mathrm{E}[N]=p/(1-p)$ with $p=(\gamma-\beta)/(\gamma(1-\beta))$ is what the composition-to-$\mathrm{Geom}(1-\gamma)$ identity fixes; \textsc{taken} is the measured mean over all particles of all decisions of every landed chain cell of that row, and \textsc{expired} restricts to walks the coin ended rather than the cap. The cap is computed per $\beta$ from $p^{L}\le 10^{-3}$ and is not a tuned depth. A row whose pooled capped fraction exceeded $10^{-2}$, or whose mean hop count came within $10\%$ of its cap, would be marked \textbf{!} and could not be quoted as a chain number; none is. The final row is the real robot (rsm\_real replay through the rig's live DINOv2 path, its own $\beta$ and $\gamma$); it is reported beside the simulated rows but is not pooled into the figures quoted in the text, which are about the flagship cells. \textbf{One line per $(\mathrm{row},\beta)$ measured}, not one per task: the chain sweep landed several $\beta$ per task and all of them are shown. $\star$ marks the $(\mathrm{row},\beta)$ whose arm Table~\ref{tab:flagship} selects, so the reader can see that the audited walk is the walk the flagship column was scored with.} +\label{tab:chainhops} +\scriptsize +\setlength{\tabcolsep}{3.5pt} +\begin{tabular}{lcc|ccc|cc|cc|cr} +\toprule +& & & \multicolumn{3}{c|}{hops taken} & \multicolumn{2}{c|}{shape} & \multicolumn{2}{c|}{why it stopped} & & \\ +\cmidrule(lr){4-6} \cmidrule(lr){7-8} \cmidrule(lr){9-10} +Row & $\beta$ & cap & $\mathrm{E}[N]$ & taken & $\Delta$\% & expired & p90 & coin \% & capped & cells & decisions \\ +\midrule +Sq-S & $0.9$ & $73$ & $10.00$ & $10.02$ & $+0.2$ & $9.96$ & $25.4$ & $99.9$ & $9.8\times10^{-4}$ & $72$ & 146{,}400 \\ +Sq-S & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.2$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $76$ & 174{,}800 \\ +Sq-S\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $6.0\times10^{-4}$ & $48$ & 112{,}100 \\ +Sq-C\,$\star$ & $0.9$ & $73$ & $10.00$ & $10.00$ & $+0.0$ & $9.95$ & $25.4$ & $99.9$ & $9.2\times10^{-4}$ & $72$ & 128{,}850 \\ +Sq-C & $0.95$ & $33$ & $4.21$ & $4.21$ & $+0.1$ & $4.19$ & $10.9$ & $99.9$ & $1.0\times10^{-3}$ & $81$ & 195{,}200 \\ +Sq-C & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $5.8\times10^{-4}$ & $54$ & 128{,}050 \\ +Pc-S & $0.9$ & $73$ & $10.00$ & $10.03$ & $+0.3$ & $9.97$ & $24.9$ & $99.9$ & $9.5\times10^{-4}$ & $63$ & 109{,}703 \\ +Pc-S\,$\star$ & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.1$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $42$ & 81{,}944 \\ +Pc-S & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $5.9\times10^{-4}$ & $34$ & 71{,}786 \\ +Pc-C & $0.9$ & $73$ & $10.00$ & $10.00$ & $-0.0$ & $9.94$ & $25.6$ & $99.9$ & $9.0\times10^{-4}$ & $48$ & 99{,}925 \\ +Pc-C & $0.95$ & $33$ & $4.21$ & $4.22$ & $+0.2$ & $4.19$ & $10.9$ & $99.9$ & $1.0\times10^{-3}$ & $90$ & 151{,}355 \\ +Pc-C\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.2$ & $99.9$ & $5.9\times10^{-4}$ & $48$ & 98{,}902 \\ +Mug & $0.9$ & $73$ & $10.00$ & $10.02$ & $+0.2$ & $9.95$ & $25.4$ & $99.9$ & $1.0\times10^{-3}$ & $54$ & 99{,}941 \\ +Mug & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.3$ & $4.18$ & $10.9$ & $99.9$ & $7.9\times10^{-4}$ & $85$ & 166{,}535 \\ +Mug\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $-0.5$ & $1.01$ & $3.1$ & $99.9$ & $6.0\times10^{-4}$ & $47$ & 101{,}680 \\ +Thr & $0.9$ & $73$ & $10.00$ & $10.01$ & $+0.1$ & $9.94$ & $25.3$ & $99.9$ & $1.0\times10^{-3}$ & $72$ & 140{,}700 \\ +Thr & $0.95$ & $33$ & $4.21$ & $4.22$ & $+0.2$ & $4.19$ & $11.1$ & $99.9$ & $8.5\times10^{-4}$ & $162$ & 364{,}050 \\ +Thr\,$\star$ & $0.98$ & $11$ & $1.02$ & $1.02$ & $+0.2$ & $1.02$ & $3.1$ & $99.9$ & $5.5\times10^{-4}$ & $54$ & 118{,}600 \\ +Pc-tip & $0.9$ & $73$ & $10.00$ & $10.01$ & $+0.1$ & $9.95$ & $25.4$ & $99.9$ & $9.9\times10^{-4}$ & $45$ & 101{,}958 \\ +Pc-tip\,$\star$ & $0.95$ & $33$ & $4.21$ & $4.20$ & $-0.2$ & $4.18$ & $10.9$ & $99.9$ & $7.8\times10^{-4}$ & $84$ & 167{,}994 \\ +Pc-tip & $0.98$ & $11$ & $1.02$ & $1.01$ & $-0.6$ & $1.01$ & $3.2$ & $99.9$ & $5.9\times10^{-4}$ & $36$ & 87{,}337 \\ +\midrule +Real (rig) & $0.96$ & $54$ & $7.29$ & $7.37$ & $+1.1$ & $7.34$ & $17.9$ & $99.9$ & $8.0\times10^{-4}$ & -- & 156 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{The flagship rows re-scored at honest depth.} Same RSM checkpoint, same proposer, same $128$ candidates per step, same evaluation-seed grid; the only thing that moves is the fold's depth $L$. \textsc{keep} is the fraction of the $\gamma$ mass that depth retains (Table~\ref{tab:auditgamma}); the honest depth is the $L$ whose dropped tail is $5\%$ ($30$ at $\beta{=}0.9$, $15$ at $0.95$). Success is over the episodes listed. The flagship column is MATCHED: it pools only the flagship cells whose (policy seed, evaluation seed) pairs the row's DEEPEST line actually re-scored, so a partial grid cannot flatter either side; $p$ is a two-proportion test of that line against it. All lines use the retired fold read-out, which is the estimator whose truncation this test is about.} +\label{tab:audithonest} +\scriptsize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lcc|c|cc|cc} +\toprule +Row & $\beta$ & $L$ & keep \% & success \% & $n$ & flagship \% & $p$ \\ +\midrule +Sq-S & $0.95$ & $5$ & 63 & $53.3$ & $300$ & $48.7$ & \\ + & & $15$ & 95 & $52.3$ & $300$ & & $0.369$ \\ +Sq-C & $0.95$ & $11$ & 89 & $6.3$ & $300$ & $15.3$ & \\ + & & $15$ & 95 & $6.0$ & $300$ & & \textbf{$<$0.001} \\ +Pc-S & $0.9$ & $9$ & 60 & $42.7$ & $300$ & $51.6$ & \\ + & & $30$ & 95 & $7.5$ & $200$\dag & & \textbf{$<$0.001} \\ +Pc-C & $0.95$ & $11$ & 89 & $50.0$ & $300$ & $49.2$ & \\ + & & $15$ & 95 & $46.0$ & $300$ & & $0.370$ \\ +Mug & $0.9$ & $5$ & 39 & $16.7$ & $300$ & $21.3$ & \\ + & & $30$ & 95 & $16.3$ & $300$ & & $0.117$ \\ +Thr & $0.9$ & $5$ & 39 & $25.7$ & $300$ & $31.4$ & \\ + & & $30$ & 95 & $21.3$ & $300$ & & \textbf{$0.004$} \\ +Pc-tip & $0.9$ & $5$ & 39 & $5.3$ & $300$ & $7.0$ & \\ + & & $30$ & 95 & $4.3$ & $300$ & & $0.158$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Why the deeper fold does not win: the planner's own diagnostics.} Decision-count-weighted pools of the cells' \texttt{planner\_time}, at each row's flagship depth and at its deepest audited depth (the same cells as Table~\ref{tab:audithonest}). \textsc{gap} is the chosen candidate's score minus the mean over the $128$ candidates, \textsc{ties}$_{1e{-}6}$ the number of candidates within $10^{-6}$ of the max of the ranking array (about $8$ float32 ulps at a probability near $1$) and \textsc{ties}$_{=}$ the BIT-EXACT count on the probability array, which is the one the degeneracy claim is made from -- on Sq-S the tolerance reports $64.7$ tied candidates where only $3.7$ are identical. \textsc{ties}$_{=}$ is absent from cells written before it was logged (gen\_q\#266). \textsc{sat} is the fraction of scored candidates at a saturated value. A degeneracy story would need ties and saturation to RISE with depth; instead ties do not rise (to within $1$\%) on $7$ of the $7$ rows and saturation falls on $6$ while success does not improve, so the short fold was not winning by being better separated -- it was ranking differently. Where the exact count exists, Mug, Thr and Pc-C carry $35$--$50$ bit-identical candidates at the maximum of $128$ at BOTH depths, i.e. their arg-max is settled largely by the tie-break; \texttt{logit} (Pc-S) ranks without ties at all and still collapses.} +\label{tab:auditdiag} +\scriptsize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{llc|cccc|c} +\toprule +Row & read-out & $L$ & gap & ties$_{1e{-}6}$ & ties$_{=}$ & sat \% & success \% \\ +\midrule +Sq-S & \texttt{prob} & $2$ $\to$ $15$ & $0.02$ $\to$ $0.03$ & $64.7$ $\to$ $44.0$ & $3.7$ $\to$ $3.4$ & $1.8$ $\to$ $1.6$ & $48.7$ $\to$ $52.3$ \\ +Sq-C & \texttt{prob} & $8$ $\to$ $15$ & $0.14$ $\to$ $0.11$ & $27.3$ $\to$ $24.4$ & -- $\to$ $9.5$ & $15.1$ $\to$ $9.9$ & $15.3$ $\to$ $6.0$ \\ +Pc-S & \texttt{logit} & $3$ $\to$ $30$ & $5.06$ $\to$ $16.19$ & $1.0$ $\to$ $1.0$ & -- $\to$ $2.4$ & $13.5$ $\to$ $2.2$ & $51.6$ $\to$ $7.5$ \\ +Pc-C & \texttt{prob} & $8$ $\to$ $15$ & $0.09$ $\to$ $0.09$ & $41.7$ $\to$ $40.3$ & $37.9$ $\to$ $34.7$ & $36.6$ $\to$ $34.2$ & $49.2$ $\to$ $46.0$ \\ +Mug & \texttt{prob} & $1$ $\to$ $30$ & $0.04$ $\to$ $0.02$ & $67.8$ $\to$ $52.5$ & $46.7$ $\to$ $47.6$ & $46.4$ $\to$ $47.3$ & $21.3$ $\to$ $16.3$ \\ +Thr & \texttt{prob} & $1$ $\to$ $30$ & $0.09$ $\to$ $0.08$ & $85.1$ $\to$ $53.7$ & $49.9$ $\to$ $39.8$ & $41.9$ $\to$ $33.6$ & $31.4$ $\to$ $21.3$ \\ +Pc-tip & \texttt{prob} & $1$ $\to$ $30$ & $0.02$ $\to$ $0.03$ & $96.6$ $\to$ $43.8$ & -- $\to$ $12.9$ & $11.4$ $\to$ $9.4$ & $7.0$ $\to$ $4.3$ \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Conformance of three implementations against the reference planning algorithm} (\texttt{docs/notes/RSM\_PLANNING\_SPEC.tex}). `Sim' is the planner that produced the RSM and TD-Flow columns of Table~\ref{tab:flagship}; `twin' is the scorer shipped to the real robot. Every verdict cites the line of code it was read from.} +\label{tab:conformance} +\scriptsize +\setlength{\tabcolsep}{3pt} +\begin{tabular}{p{2.9cm}p{1.7cm}p{1.9cm}p{1.3cm}p{4.9cm}} +\toprule +Spec item & Sim & Twin (\texttt{rsm\_real}) & Verdict & Evidence \\ +\midrule +Continuation coin $p=(\gamma-\beta)/(\gamma(1-\beta))$ & yes & yes (same function, imported) & conforms & \texttt{rsm\_scorer.py:547}; \texttt{rise\_stack/scorers.py:196} \\ +Time-zero convention matches the TRAINING target & eval admits $k{=}0$ & same scorer & conforms & training hop \texttt{data.py:21--22} clips the offset at $0$, so $k{=}0$ is admitted, as the eval coin assumes; our $p$ is $1/\gamma$ times the spec's strictly-future $p$ \\ +Cap $L$ = smallest $L$ with $p^{L}\le10^{-3}$, computed & computed & computed (yaml: 0) & conforms & \texttt{rsm\_scorer.py:556}; \texttt{configs/baselines.yaml} \\ +At the cap, RETURN the last sampled state & yes & yes (same code path) & conforms & capped rows still take the final read, \texttt{rsm\_scorer.py:670--672} \\ +Reward read ONLY at the returned state & yes & yes & conforms & one \texttt{rew()} call, \texttt{rsm\_scorer.py:671}; the retired fold instead accumulated over hops (\texttt{:453}) \\ +$M$ chains independent, each restarted from $(s,a_j)$ & yes & yes & conforms & per-particle noise and coins, \texttt{rsm\_scorer.py:611--613}, chains restart at \texttt{:629--631}; common random numbers are shared ACROSS candidates only (by design, so candidate comparisons are paired), never within a candidate's $M$ chains \\ +Intermediate action $u\sim\pi(\cdot|x)$ at every hop & hop head & hop head (required) & conforms & \texttt{rsm\_scorer.py:666} \\ +Stopping independent of the model samples & yes & yes & conforms & coins drawn before any sampling, \texttt{rsm\_scorer.py:613} \\ +$1/(1-\gamma)$ score factor & omitted & omitted & conforms (constant) & a constant per state cannot change the arg-max; we say so rather than leave it implicit \\ +$\beta<\gamma$, so the recursion is live & yes ($\beta\in\{0.90,0.95\}$, $\gamma{=}0.99$) & \textbf{NO until 2026-09-23} & \textbf{defect, fixed} & the twin shipped $\beta=\gamma=0.99$, i.e. $p=0$: the coin never fired and the planner was a SINGLE successor draw. Now $\beta{=}0.96$, $\gamma{=}0.995$ ($p=0.879$, cap $54$, expected queries $8.3$); every twin number measured before that date is a one-draw score \\ +Fixed-depth fold present in the shipped planner & kept as the retired control (Table~\ref{tab:flagship_fold}) & \textbf{deleted} & conforms & the \texttt{fold}/\texttt{fold\_d1}/\texttt{d1} paths, the \texttt{rsm\_depth} knob and the \texttt{--rsm-mode} flag were removed from the twin on 2026-09-23; the reproduction path lives in the research repository only \\ +World models: no $\beta$-geometric stopping leaked in & n/a & n/a & conforms, but see below & LeWM / DINO-WM use no coin; they roll out $L$ open-loop $8$-frame chunks and fold them with $\gamma^{8}$ per chunk, with $L$ swept in $\{1,2,4,8\}$ and selected per row by success (\texttt{status/chain/wm\_arm\_dump.json}) -- a per-row depth search the corrected RSM and TD-Flow columns no longer have. Table~\ref{tab:controls} said `a fixed $4$-chunk rollout'; that sentence was wrong and is corrected there \\ +Real open-loop harnesses in THIS repository & n/a & defaulted to the fold at depth $2$ & \textbf{fixed} & \texttt{scripts/real/scorer\_openloop.py:42} and \texttt{twin\_rollout.py:225} now default to the chain; every \texttt{status/real/openloop\_*} number already on record is fold-scored and is labelled as such \\ +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer: same candidates, different scorer.} All three columns sample the +\emph{same} 128 candidates from the \emph{same} BC-union policy under the same data-provenance +reward; only the ranking function differs. \textbf{greedy} takes one sample without ranking, +\textbf{IQL} ranks with the IQL critic (the mechanism RISE and IDQL share), \textbf{RSM} ranks with +our successor model. Fixing the proposal policy is what makes this comparison fair -- RISE is IDQL with +a different policy, so a margin obtained by also changing the proposer would not isolate the scorer. +Read the \textbf{vs.\ greedy} column as what selection buys: the IQL critic is a weak ranker in this +setting, scoring \emph{below} greedy on several tasks and on its own proposer, so the margin over it +alone would overstate the contribution of our scorer. All three columns of a row are read on the +same set of (policy seed, evaluation seed) cells -- cells per task in row order, 50 episodes +each -- and the RSM subscript is the number of policy seeds behind it; the RSM configuration is the +best configuration on that proposer with at least two seeds, or the single-seed best where none exists.} +\label{tab:matched} +\footnotesize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lccccc} +\toprule +& \multicolumn{3}{c}{Scorer (BC-union proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-4} \cmidrule(lr){5-6} +Task & greedy & IQL & RSM & vs.\ greedy & vs.\ IQL \\ +\midrule + +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer, RISE's own actor.} The same protocol as Table~\ref{tab:matched} +with RISE's policy as the proposer: RISE's actor, RISE's reward, and only the ranking function swapped. +\textbf{RISE-g} is that actor sampled once, \textbf{RISE} is its released critic-ranked rollout +(128 samples, argmax of the co-trained IQL critic), \textbf{RSM} ranks the same 128 samples with our +successor model. The three added scorers (\textbf{TD-Flow}, \textbf{LeWM}, \textbf{DINO-WM}) and +\textbf{IFQL} are defined in \S\ref{sec:added-scorers}; whether IFQL orders the $128$ candidates at +all (\S\ref{sec:value-selection-impossible}) is reported with it, in row order: recorded-action rank pct.\ ($50$ = chance) 40/49/44; 56/44/54; 43/44/41; 50/51/44; 36/53/50; 52/47/43; 48/47/50; per-state $Q$ spread 6.0e-05/9.0e-05/5.6e-05; 6.0e-04/5.8e-04/7.2e-04; 3.0e-05/4.2e-05/3.9e-05; 2.9e-04/2.9e-04/2.5e-04; 1.3e-04/1.6e-04/1.8e-04; 4.2e-04/3.8e-04/3.4e-04; 7.4e-04/7.9e-04/7.8e-04 bins; global range (context only) 14.0/14.7/18.1; 43.1/42.5/41.1; 28.3/26.0/26.1; 50.3/10.0/49.3/26.7/48.6/45.0; 34.0/33.4/28.9; 43.2/38.4/41.6; 64.7/64.6/64.1 bins \textbf{On Square (Sub.), Square (Cov.), Piece (Sub.), Piece (Cov.), Mug (Sub.), Thread (Cov.), Piece-tip (Cov.) the IFQL critic selects at or near chance, so that entry is a random-of-128 rather than a value baseline.}. +\textbf{rand} is the random-candidate control: it draws the same $N{=}128$ candidates and executes +one of them uniformly, so $\textrm{RSM}-\textrm{rand}$ is the part of the margin attributable to +\emph{ranking} rather than to sampling breadth. Every column ranks the \emph{same} 128 candidates at every decision step. Same (policy seed, +evaluation seed) cells across a row -- 9/9/9/9/9/9/9 cells per task in row order, 9/9/9/9/9/9/9 for the +control; a $\dagger$ marks a column that has not yet run all of them, with the scorers' own counts +TD-Flow 9/9/9/9/9/9/9; IFQL 9/9/9/9/9/9/9; LeWM 9/9/9/9/9/9/9; DINO-WM 9/9/9/9/9/9/9; DF 0/0/0/0/9/9/0. Each scorer column is the best of the +configurations evaluated for it on this proposer -- TD-Flow 20/19/19/17/15/3/18; IFQL 1/1/1/1/1/1/1; LeWM 14/14/14/14/14/11/14; DINO-WM 14/14/14/14/14/14/14; DF 0/0/0/0/4/9/0 configurations per task in row order -- +so the budgets differ between columns and are stated rather than assumed equal. Every scorer's health numbers (rank percentile, read-out spread, ties at the arg-max, dispersion ratio, action win rate) are in Table~\ref{tab:scorer_health}; $\ddagger$ $=$ no health number, so not reportable by our own rule. \textbf{Tied at the arg-max on some rows (DINO-WM on 4 of 7 rows, IFQL on 5 of 7 rows, LeWM on 4 of 7 rows, RSM on 5 of 7 rows, TD-Flow on 4 of 7 rows; worst 101 of 128 on Mug (Sub.)): there the arg-max is a uniform draw among the tied candidates, a coarse filter plus resampling rather than a ranking. Note this does not by itself mean the column ranks worse -- the fully-ordering logit read-out ties $1$ candidate and scores lower in simulation, since it reads only the terminal hop and drops the product fold.} +Cells differing only in particle count or in the probability-vs-logit read-out are +\emph{different scorers} and are never pooled into one arm; the read-out is instead part of the +disclosed per-column search counted above.} +\label{tab:matched_actor} +\scriptsize +\setlength{\tabcolsep}{1.5pt} +\begin{tabular}{lccccccccccc} +\toprule +& \multicolumn{9}{c}{Scorer (RISE-actor proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-10} \cmidrule(lr){11-12} +Task & RISE-g & RISE & rand & RSM & TD-Flow & IFQL & LeWM & DINO-WM & DF & vs.\ RISE-g & vs.\ RISE \\ +\midrule +Square (Sub.) & $48.7$ & $43.6$ & $49.3$ & $\mathbf{54.0}_{(3)}$ & $50.0_{(3)}$ & $46.7_{(3)}$ & $48.9_{(3)}$ & $50.7_{(3)}$ & \textit{queued} & $+5.3$ & $+10.4$ \\ +Square (Cov.) & $7.3$ & $3.7$ & $6.4$ & $\mathbf{20.9}_{(3)}$ & $7.1_{(3)}$ & $0.7_{(3)}$ & $3.3_{(3)}$ & $13.3_{(3)}$ & \textit{queued} & $+13.6$ & $+17.2$ \\ +Piece (Sub.) & $30.7$ & $22.9$ & $29.1$ & $\mathbf{47.1}_{(3)}$ & $30.2_{(3)}$ & $17.8_{(3)}$ & $32.4_{(3)}$ & $41.8_{(3)}$ & \textit{queued} & $+16.4$ & $+24.2$ \\ +Piece (Cov.) & $30.8$ & $6.0$ & $30.1$ & $\mathbf{48.7}_{(3)}$ & $16.0_{(3)}$ & $21.1_{(3)}$ & $18.9_{(3)}$ & $39.6_{(3)}$ & \textit{queued} & $+17.8$ & $+42.7$ \\ +Mug (Sub.) & $14.5$ & $16.2$ & $14.9$ & $\mathbf{23.1}_{(3)}$ & $19.8_{(3)}$ & $18.4_{(3)}$ & $18.7_{(3)}$ & $21.1_{(3)}$ & $17.1_{(3)}$ & $+8.6$ & $+6.9$ \\ +Thread (Cov.) & $4.7$ & $12.2$ & $5.2$ & $\mathbf{25.8}_{(3)}$ & $7.1_{(3)}$ & $8.4_{(3)}$ & $9.6_{(3)}$ & $31.6_{(3)}$ & $4.2_{(3)}$ & $+21.1$ & $+13.6$ \\ +Piece-tip (Cov.) & $1.0$ & $2.9$ & $0.8$ & $\mathbf{7.3}_{(3)}$ & $1.1_{(3)}$ & $3.3_{(3)}$ & $2.9_{(3)}$ & $5.1_{(3)}$ & \textit{queued} & $+6.4$ & $+4.4$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Scorer health, matched-actor table.} Columns are the flagship rows in order (Sq-S square-Sub, Sq-C square-Cov, Pc-S piece-Sub, Pc-C piece-Cov, Mug, Thr threading, Pc-tip piece-tip), independently checkable from the eval artefacts: the recorded action's rank percentile among the 128 candidates on one shared candidate set; the read-out's spread over the 128 candidates at a state; how many of the 128 tie at the arg-max (an arg-max over $k$ tied candidates is a uniform draw among those $k$ -- a coarse filter plus resampling -- and in simulation the read-out that ties most candidates outperforms the one that orders all 128, so a high count is not by itself evidence of worse ranking); TD-Flow's target-dispersion ratio against the measured Monte-Carlo reference; and the checkpoint's held-out true-vs-shuffled action win rate, a two-candidate percentile. A scorer absent here has no health number and is marked $\ddagger$ in Table~\ref{tab:matched_actor}: not reportable by our own rule.} +\label{tab:scorer_health} +\scriptsize +\setlength{\tabcolsep}{2.5pt} +\begin{tabular}{llccccccc} +\toprule +Scorer & metric & Sq-S & Sq-C & Pc-S & Pc-C & Mug & Thr & Pc-tip \\ +\midrule +RSM & rank pct & -- & 58.6 & 45 & 49.4 & 40.7 & -- & -- \\ + & spread & -- & 0.0378 & 3.31 & 1.13 & 0.0406 & -- & 1.58 \\ + & ties/128 & -- & 44.4 & 4.47 & 33.8 & 56.3 & -- & 62 \\ + & win rate & -- & 0.854 & 0.756 & 0.699 & 0.604 & -- & 0.765 \\ +\addlinespace[2pt] +TD-Flow & rank pct & -- & 56.1 & -- & 44.3 & 51.7 & -- & 42.2 \\ + & spread & -- & 2.45 & 0.0203 & 0.0263 & 0.0231 & -- & 0.0202 \\ + & ties/128 & -- & 55.4 & 21.2 & 37.6 & 56.8 & -- & 37.8 \\ + & disp. ratio & -- & 28.4 & 3.34 & 7.97 & 5.44 & -- & 15.5 \\ + & win rate & -- & 0.812 & 0.563 & 0.717 & 0.79 & -- & 0.92 \\ +\addlinespace[2pt] +IFQL & rank pct & -- & 49.1 & 36 & 40.6 & 53.1 & -- & 36.6 \\ + & spread & -- & 0.00155 & 0.000125 & 0.000461 & 0.000153 & -- & 0.000427 \\ + & ties/128 & -- & 1.52 & 19.9 & 1.45 & 11 & -- & 2.43 \\ +\addlinespace[2pt] +LeWM & spread & -- & 0.0174 & 0.0191 & 0.00621 & 0.00882 & -- & 0.00785 \\ + & ties/128 & -- & 39.3 & 31.9 & 55.7 & 33.3 & -- & 73.4 \\ + & win rate & -- & 0.547 & 0.574 & 0.574 & 0.512 & -- & 0.531 \\ +\addlinespace[2pt] +DINO-WM & spread & -- & 0.0395 & 0.0311 & 0.0118 & 0.0092 & -- & -- \\ + & ties/128 & -- & 69.4 & 78.5 & 88.8 & 101 & -- & -- \\ + & win rate & -- & 0.475 & 0.411 & 0.469 & 0.445 & -- & -- \\ +\addlinespace[2pt] +\bottomrule +\end{tabular} +\end{table} + + +\begin{table}[t] +\centering +\caption{\textbf{Data regime.} Demonstration counts per task, and the median length of an expert +demonstration against the 400-step evaluation horizon (the horizon enters the throughput definition in +Table~\ref{tab:throughput}). ``Expert'' and ``Suboptimal'' are the two files RISE's reward labels +distinguish: every frame of an expert episode carries reward $1$ and every frame of a suboptimal one +carries $0$.} +\label{tab:data} +\footnotesize +\setlength{\tabcolsep}{6pt} +\begin{tabular}{lccc} +\toprule +Task & Expert & Suboptimal & Median expert demo (of 400) \\ +\midrule +Square (Sub.) & 20 & 100 & 173 \\ +Square (Cov.) & 200 & 224 & 374 \\ +Piece (Sub.) & 20 & 100 & 317 \\ +Piece (Cov.) & 200 & 199 & 311 \\ +Mug (Sub.) & 20 & 100 & 356 \\ +Thread (Cov.) & 250 & 200 & 215 \\ +Piece-tip (Cov.) & 200 & 504 & 311 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Throughput.} Success rate $\times$ horizon $/$ mean steps-to-success, i.e.\ successes +per 400 environment steps, on exactly the columns, rows and episodes of +Table~\ref{tab:flagship_single_actor} -- a method that succeeds as often but sooner scores higher here, which the +success rate alone cannot show. The RSM row is the same coin-chain arm that table prints, not the +retired fold; a task with no chain arm reads ``--'' rather than borrowing the fold's timing. Reported separately because the two tables together exceed the +397.5pt text block. $\Delta$ is again the margin over the strongest baseline on that task.} +\label{tab:throughput} +\scriptsize +\setlength{\tabcolsep}{1.2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Sub.) & $0.110{\pm}0.011$ & $0.570{\pm}0.018$ & $\mathbf{0.575{\pm}0.027}$ & -- & $0.507{\pm}0.016$ & $\mathrm{n/a}$ & -- & -- \\ +Square (Cov.) & $\mathbf{0.093{\pm}0.021}$ & $0.031{\pm}0.006$ & $0.074{\pm}0.014$ & -- & $0.037{\pm}0.002$ & $\mathrm{n/a}$ & -- & -- \\ +Piece (Sub.) & $0.127{\pm}0.014$ & $\mathbf{0.371{\pm}0.034}$ & $0.338{\pm}0.028$ & $0.263{\pm}0.043$ & $0.256{\pm}0.063$ & $\mathrm{n/a}$ & -- & -- \\ +Piece (Cov.) & $0.189{\pm}0.003$ & $0.275{\pm}0.021$ & $\mathbf{0.330{\pm}0.018}$ & $0.131{\pm}0.016$ & $0.063{\pm}0.011$ & $\mathrm{n/a}$ & -- & -- \\ +Mug (Sub.) & $\mathbf{0.153{\pm}0.006}$ & $0.049{\pm}0.002$ & $0.045{\pm}0.002$ & $0.054{\pm}0.000$ & $0.059{\pm}0.016$ & $\mathrm{n/a}$ & -- & -- \\ +Thread (Cov.) & $\mathbf{0.141{\pm}0.001}$ & $0.015{\pm}0.004$ & $0.012{\pm}0.003$ & $0.121{\pm}0.014$ & $0.034{\pm}0.013$ & $\mathrm{n/a}$ & -- & -- \\ +Piece-tip (Cov.) & $0.003{\pm}0.003$ & $0.013^{\dagger}$ & $0.010{\pm}0.005$ & -- & $\mathbf{0.025{\pm}0.008}$ & $\mathrm{n/a}$ & -- & -- \\ +\bottomrule +\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_tables_latest.pdf b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_tables_latest.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e4157b9200a1f738c7e621353ff612a25c9accac --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/flagship_tables_latest.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e382c85ed19a36ddeb155e408537f3987fa128ee3d707b7f07a8b3abb1ffa734 +size 166027 diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_proposal_report.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_proposal_report.tex new file mode 100644 index 0000000000000000000000000000000000000000..d428fb9f1b0f3200b2e5fae62826c059aa98ac13 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_proposal_report.tex @@ -0,0 +1,182 @@ +\documentclass[11pt]{article} +\usepackage[margin=18mm]{geometry} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{url} +\usepackage[hidelinks,breaklinks]{hyperref} +\usepackage{times} +\setlength{\parskip}{3pt} +\sloppy +\emergencystretch=3em +\title{Real-world proposal policies on \texttt{rsm\_cooking\_v5}\\[2pt] + \large checkpoints, held-out fit, and the open-loop selection test} +\author{rsm\_rise real-world stream --- gen\_q issue \#263} +\date{2026-09-22} +\begin{document} +\maketitle + +\section{What this report covers} +\texttt{rsm\_cooking\_v5} is the real Franka cooking dataset (HF \texttt{jmarangola/rsm\_cooking\_v5}, converted by +\texttt{scripts/real/convert\_cooking\_hdf5.py}): 248 episodes, 181{,}530 frames, absolute end-effector setpoints, +split 223 train / 25 validation episodes. No closed-loop number appears here: the robot computer +(\texttt{rsm\_real}) is not reachable from this account, so every result below is \emph{open-loop} --- replay of the +held-out episodes and selection among a proposer's own candidates. + +Two policy stacks were fine-tuned on this data. The \textbf{pi0.5} stack (openpi) gives three recipes: \texttt{stock} +(plain BC), \texttt{rise} (kNN-augmented, the RISE data recipe) and \texttt{riseadv} (advantage-weighted). The +\textbf{RISE stack} gives the \emph{BC-union} policy \texttt{S0B} (BC on the expert$\cup$suboptimal union, the +codebase recipe) and the \emph{RISE actor} \texttt{S0Aidql} (a plain IDQL actor with spectral norm, the policy +bottleneck and both augmentations disabled, carrying its co-trained IQL critic in the same file).\footnote{These +two are \texttt{robomimic}-format checkpoints, \texttt{robomimic} being the training framework RISE ships in. That +is a file format, not a data source: like the pi0.5 rows, both are fine-tuned on \texttt{rsm\_cooking\_v5}, this +project's own FR3 data.} Table~\ref{tab:ckpt} is the checkpoint register; Sec.~\ref{sec:hf} records the Hugging +Face mirror the collaborator pulls them from. + +\input{_real_tables.tex} + +\section{Held-out fit, read against the hold-still predictor} +The logged actions are \emph{absolute} setpoints, so their raw norm ($53$\,cm) only says where the arm is. The +quantity a policy has to predict is how far the next setpoint is from the current end-effector position, and on the +validation split (25 episodes, 17{,}287 frames; \texttt{scripts/tmp/action\_norms\_real.py}, output +\texttt{logs/lsf/rr\_cpu\_actnorm.1836483.out}) that distance is \holdfirst~cm for the first action and +\holdchunk~cm for the 8-step chunk mean, with \holdstep~cm of motion between consecutive actions. + +A policy that simply outputs \emph{stay where you are} therefore scores \holdfirst\,/\,\holdchunk~cm and passes any +absolute ``$<1$~cm first action'' gate. That gate is vacuous, so Table~\ref{tab:fit} quotes every fit as the +\textbf{ratio to hold-still} (higher is better, $1.0\times$ = no better than doing nothing). + +The reading is unchanged from the \#263 comment of 2026-09-22 01:01Z: the pi0.5 fine-tunes have essentially not +learned the first action beyond hold-still ($\approx\!1.0\times$) and beat it only on the chunk mean; the +RISE actors (\texttt{S0Aidql}) are the only proposers that fit the held-out motion on both metrics. Within the pi0.5 stack +the ordering is \texttt{stock} $>$ \texttt{rise} $>$ \texttt{riseadv}: every RISE actor ingredient makes the fit +worse, the same recipe effect the simulation rows show. + +\section{Training curves} +Figure~\ref{fig:curves} is regenerated from everything on disk at the time of writing +(\texttt{scripts/real/plot\_proposal\_curves.py}). The left panel is the pi0.5 held-out error against fine-tune step, +taken from each run's own \texttt{EVAL step N:} log lines; all five runs reached openpi's default +\texttt{num\_train\_steps}$=30$k and are flat from 25k on (the last 5k steps buy $<0.05$~cm). The right panel is the +RISE-stack training loss against epoch, read from W\&B, since those runs log nothing per-epoch to disk. +Table~\ref{tab:perepoch} is the corresponding per-epoch \emph{held-out} fit for those actors, which the loss +curve does not show. + +\begin{figure}[htbp]\centering +\includegraphics[width=\textwidth]{figs/real_proposal_curves.png} +\caption{Training curves of the real-data proposal policies. Left: pi0.5 fine-tunes, held-out xyz L2 of the first +action (thick) and of the 8-step chunk mean (thin) vs.\ step, with the (vacuous, see Sec.~2) 1\,cm line. Right: +RISE-stack actors (RISE actor / BC-union), training loss vs.\ epoch from W\&B. Source: +\texttt{docs/figs/real\_proposal\_curves.png}.} +\label{fig:curves} +\end{figure} + +\section{Open-loop scorer comparison on the \texttt{S0Aidql} proposers} +\label{sec:openloop} +The question this test asks is whether a value function can pick a better action than the proposer's own first +sample, out of 128 candidates the proposer draws, scored open-loop on the held-out episodes. + +\paragraph{A harness defect invalidated the first attempt.} \texttt{twin\_rollout.RobomimicPolicy} keeps a +$T_o{=}2$ frame history internally, and \texttt{scorer\_openloop.py} called it once per decision at stride 25, so +the actor's ``previous frame'' was 25 frames stale --- a frame pair it never saw in training. The proposer's own +error came back at 2.15--2.25~cm on checkpoints whose replay fit is 0.39--0.58~cm. The critic scorer itself was +unaffected (\texttt{rm\_obs\_single} uses the current frame only), but the candidate set it ranked was degraded: +spread 0.21--0.25~cm, oracle only 1.8~cm, and every scorer within 0.04~cm of greedy. Those numbers are not results; +they are quarantined in \texttt{status/real/\_invalid\_stale\_history/} and nothing from that directory is quoted +here. The same defect affects every earlier RISE-stack-proposer open-loop cell +(\texttt{status/real/scorer\_openloop\_s0b\_*} and the 41 \texttt{scorer\_ol\_RM\_*} hop-depth / beta-band cells), +which are being re-run; the pi0.5 proposer has no history and is unaffected, and the successor's stitch control does +not go through this path. The fix passes the true preceding frames as \texttt{obs["history"]}; the closed-loop path, +where consecutive calls are consecutive frames, is unchanged (\#263 comment 5769487243). + +\paragraph{On the fixed harness} the first check is that greedy first-action error lands near the replay fit +before any scorer column is read, and it does: 0.57~cm greedy against a 0.58~cm replay fit on \texttt{s0@2000}, +0.40 against 0.39 on \texttt{s1@2500}. The harness is now measuring what it claims to. +Table~\ref{tab:openloop} reports the cells that have landed; cells still running are listed in +Sec.~\ref{sec:trainstatus}. + +\paragraph{The result is negative for the successor, and it is not close.} On the landed cells: +\begin{itemize}\itemsep1pt +\item \textbf{The RSM scorer is worse than greedy on both seeds} ($+0.043$ and $+0.046$~cm on \texttt{s0@2000}, + $+0.065$~cm on \texttt{s1@2500}; win rate against greedy 0.38--0.46, i.e.\ below chance) and it is also worse + than its own permutation control, whose $\Delta$ is $+0.002$ to $-0.007$~cm. A scorer that loses to a shuffle + of its own scores is ranking anti-correlated with fit, not merely uninformative: its mean oracle-rank + percentile is 0.46--0.38 against 0.49--0.50 for the shuffled control. +\item \textbf{The IDQL critic does not replicate across seeds.} It helps on \texttt{s0@2000} + ($-0.043$/$-0.045$~cm, win rate 0.58, oracle rank 0.59 vs 0.50 for its control) and hurts by about the same + margin on \texttt{s1@2500} ($+0.058$~cm, win rate 0.40). One seed each way is not an effect. +\item \textbf{There is real headroom, so this is not a ceiling artefact.} The oracle --- picking, per decision, the + candidate that is actually closest to the logged action --- reaches 0.11--0.20~cm against greedy's + 0.40--0.57, a $2.9$--$3.7\times$ gap, with a win rate of 0.98--0.99. The candidates do contain much better + actions than the proposer's first sample; neither value function finds them. +\item Both scorer configurations tried on \texttt{s0} (one-step \texttt{d1\_d1} and folded depth-4) give the same + answer to within 0.003~cm, so the conclusion is not a hop-depth setting. +\end{itemize} +The honest summary is that on this dataset, at these checkpoints, \emph{the successor model does not select better +real actions than the proposal policy's own first sample}, and the strongest real-world result so far is a fit +result, not a selection result: the plain IDQL actor (Table~\ref{tab:fit}) is the only proposer that beats the +hold-still predictor on both metrics, by $\approx\!2\times$ on the first action and $\approx\!3\times$ on the chunk. + + +\section{Training and job status} +\label{sec:trainstatus} +\input{_real_status.tex} + +\section{W\&B} +\label{sec:wandb} +\input{_real_wandb.tex} + +\section{Provenance} +Every number in this report comes from a file named in the table note or the surrounding text. The collector is +\texttt{scripts/real/build\_real\_report\_tables.py} (it writes \texttt{docs/tex/\_real\_tables.tex} and a machine-readable +\texttt{status/real/report\_numbers.json}); the PDF is built by \texttt{scripts/tmp/build\_real\_report\_pdf.sh} with +tectonic on a CPU node. Held-out replay numbers come from \texttt{scripts/real/rise\_replay\_eval.py} (stride 10, the +25 validation episodes) and pi0.5 numbers from each run's \texttt{EVAL step} log lines, parsed by +\texttt{scripts/real/plot\_proposal\_curves.py}. The hold-still baseline comes from +\texttt{scripts/tmp/action\_norms\_real.py}. + +\section{Hugging Face mirror of the checkpoints} +\label{sec:hf} +All six checkpoints are mirrored on Hugging Face at +\href{https://huggingface.co/rli14/rsm_cooking_v5_checkpoints}{\texttt{rli14/rsm\_cooking\_v5\_checkpoints}}, +under names that state the role and the data rather than the framework: +\texttt{rise\_actor\_rsm\_real\_s1\_e3000.pth} and \texttt{\dots s0\dots} (the RISE actor together with its +co-trained IQL critic), \texttt{bc\_union\_rsm\_real\_s0\_e5000.pth} (the in-stack BC control), +\texttt{pi05\_bc\_rsm\_real\_stock\_s1\_29999/} (pi0.5 BC, params-only export), +\texttt{successor\_rsm\_real\_RM\_s0\_100k.pt} and \texttt{\dots s1\dots} (the RSM successor, two seeds), plus +\texttt{hop\_head\_rsm\_real\_gauss\_r1.pt} and \texttt{successor\_rsm\_real\_feat\_stats.json}. The upload is +complete and was verified against the cluster copies, every binary by \textbf{sha256} (the Hub's LFS object id +against a fresh hash of the source) and every params folder file by file, with zero mismatches. + +The repo has since grown beyond these six: it also carries the three screened \textbf{pi0.5 RISE proposers} +(\texttt{pi05\_rise\_actor\_rsm\_real\_\{rise\_s0,rise\_s1,riseadv\_s0\}\_29999/}, gen\_q \#269) and \textbf{five +reward heads} (\texttt{successor\_rsm\_real\_A\_110000.pt}, \texttt{\dots\_A\_s1\dots} and the three screened +\texttt{B} heads of gen\_q \#271), uploaded by the pi0.5 and successor streams. As re-verified at revision +\texttt{5e9b100} (2026-09-22 08:26\,UTC) the tree is \textbf{124 files, 55.73\,GiB}; \textbf{123 of the 124 +objects are sha256-verified} against their source, the 124th being the Hub's own \texttt{.gitattributes}. That +verification now reaches \emph{inside} the pi0.5 folders --- every params binary there is hashed, not merely +size-matched, which earlier revisions of this paragraph claimed more broadly than the check then performed. The +four pi0.5 folders are 46.35\,GiB of the total, so \texttt{-{}-exclude "pi05\_*"} fetches the rest in +9.38\,GiB. + +\paragraph{The repo is public, which was not the original intent.} +It was created \emph{private}. The \texttt{rli14} account is on the free plan (\texttt{isPro: false}, +\texttt{canPay: false}) and its private storage was full --- \textbf{97.9\,GB of the 100\,GB} allowance --- so +the Hub refused every binary with +\begin{quote}\ttfamily\small +403 Forbidden: Private repository storage limit reached, please upgrade your plan to increase your private +storage limit. +\end{quote} +That limit is \emph{reached} rather than exceeded by the large files: the smallest binary we have, the +18.7\,MiB hop head, was refused with the identical 403 as a 3\,GiB actor, while plain \texttt{.json} and +\texttt{.md} committed normally (they are not LFS patterns). It was therefore switched to \textbf{public}, +which lifted the restriction --- public storage is unrestricted on the free plan --- and the binaries went up. +Consequently the checkpoints and the model card are \textbf{world-readable}, not access-controlled. + +\paragraph{Measured throughput, with a caveat.} +Per-file wall time on the accepting commit: hop head 18.7\,MiB in 1.3\,s (14.1\,MiB/s), each successor +75.5\,MiB in 1.0--1.1\,s (71--73\,MiB/s), each 2.95\,GiB actor in 3.6--4.0\,s (759--851\,MiB/s), and the +11.59\,GiB pi0.5 folder in 30.7\,s (387\,MiB/s). These are \emph{not} cold-transfer rates. The earlier +refused attempts had already pushed the same bytes into Hugging Face's Xet content-addressed store before +being rejected at the commit step, so the accepted commits were largely deduplicated; the numbers are +commit throughput against a warm CAS, and a first upload from a cold cache would be slower. + +\end{document} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_reward_study.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_reward_study.tex new file mode 100644 index 0000000000000000000000000000000000000000..ede6d48f4f9bde9eff1197b2a8ca1a5bbe5b06d0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_reward_study.tex @@ -0,0 +1,333 @@ +\documentclass[11pt]{article} +\usepackage[margin=18mm]{geometry} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{amsmath} +\usepackage{url} +\usepackage{listings} +\usepackage[hidelinks,breaklinks]{hyperref} +\usepackage{times} +\usepackage{framed} +\setlength{\parskip}{3pt} +\sloppy +\emergencystretch=3em +\graphicspath{{figs/real_stages/}{docs/figs/real_stages/}} +\lstset{basicstyle=\ttfamily\scriptsize,frame=single,breaklines=true,columns=fullflexible, + xleftmargin=4pt,framexleftmargin=2pt} +\title{The successor's reward head, in pictures\\[2pt] + \large what a stage looks like, what ``success'' looks like, which frames get $+1$, + and which head to ship} +\author{rsm\_rise real-world stream --- gen\_q issue \#261 (cross-ref \#263)} +\date{2026-09-22} +\begin{document} +\maketitle + +\begin{framed}\noindent\textbf{Read this first --- the short answer.} +\begin{enumerate}\itemsep2pt +\item \textbf{The owner's question was ``how can we show stitching across trajectories, and can it be shown + under the reward given?''\ The measured answer is NO --- for every reward head tried, including the + shipped one.} At the junction state that a failure trajectory passes through, the successor's $Q$ + ranks action chunks drawn from the \emph{rewarded} continuation \emph{below} chunks drawn from the + \emph{failure} continuation: the argmax of 128 is a rewarded-continuation chunk in $3$--$28\%$ of + decisions against a chance rate of $50\%$ (Table~\ref{tab:d3}). Section~\ref{sec:decisive} gives the + number, the control that explains it, and the smallest fix. +\item \textbf{Why.} The reward label on this corpus is constant over a whole recording, and the only + rewarded route (route 3, \texttt{2->3->4}) is also the only route that \emph{starts} at the junction + state. ``Reaches the goal'' and ``is a route-3 recording'' are therefore the same event in this data, + and the head fits the cheaper of the two: the shipped head already scores $R(z)=+24$ on route-3 + frames \emph{at the junction, before anything has happened}, and $-25$ on route-4 frames of the same + state (Table~\ref{tab:decisive}). It is a recording detector, not a progress signal. +\item \textbf{The goal is state 4, not state 5}, and state 4 $=$ the tomato is in the bowl \emph{and} the pan + is back on the grate --- verified by eye on the final frame of six successful episodes + (Fig.~\ref{fig:success}) and by contrast with state 6, the same scene with the pan left on the table + (Fig.~\ref{fig:stage6}). Success is declared on the \emph{last} frame of the episode in all 50 + successful episodes (\texttt{status/real/SUCCESS\_TAIL.json}), so the proposed + \texttt{v4\_success\_tail} is \emph{identically} v2 here and no separate v4 was trained. +\item \textbf{State 3 is not a second success terminal.} Our conversion into the RISE stack's + robomimic-format HDF5\footnote{\texttt{robomimic} is the training \emph{framework} RISE ships in --- it + supplies the HDF5 layout and the \texttt{.pth} container. It is not a data source: every checkpoint in + this study is trained on this project's own FR3 corpus \texttt{rsm\_cooking\_v5}.} calls final state + $\in\{3,4\}$ ``expert'' and writes $+1$ on all of it (148/248 episodes); the dataset's own rule is + \textbf{``Reward state IDs: [4]''} and lists state 3 as the mid-task \emph{cooking} state with the + tomato still in the pan. So RISE's critic is trained with $+1$ on 98 episodes that never reach the + bowl (Sec.~\ref{sec:decisive}). +\item \textbf{What to ship today.} Nothing here beats the head that is already inside + \texttt{R\_M/ckpt\_s100000.pt} (v0, provenance) on the open-loop screen, and no head passes the + stitching test, so \textbf{ship v0} and treat the value as unvalidated for selection. + \textbf{The reward head travels inside the successor checkpoint} (\texttt{state\_dict} key + \texttt{"rew"}); there is nothing separate to train or download (Sec.~\ref{sec:ships}). +\end{enumerate} +\end{framed} + +\input{_decisive.tex} + +\clearpage +\section{The task, one picture per stage} +The task: \emph{put the tomato into the bowl by rotating the pan, then put the pan back on the grate.} +Every frame of the corpus carries an annotation edge \texttt{edge\_from->edge\_to} +(\texttt{cache/real\_cooking\_v5/edge\_from.i16.npy}, \texttt{edge\_to.i16.npy}, written by +\texttt{scripts/real/add\_segment\_labels.py}). The picture below a stage is the frame at which that stage is +declared \textbf{reached} --- the last frame of the segment whose \texttt{edge\_to} is that state, i.e. the +last frame before the stage index changes. Global camera, wrist camera inset bottom-right. Frame provenance +for every picture: \texttt{status/real/STORY\_FRAMES.json} (written by \texttt{scripts/real/render\_story.py}). + +\begin{figure}[htbp]\centering +\includegraphics[width=0.62\linewidth]{story_start_combo.png} +\caption{\textbf{Start.} Episode 148, frame 0 (the episode the rest of this section follows; it is one of the +50 successful ones, route \texttt{2->3->4}). The pan sits empty on the black grate at the left, the green bowl +is empty, the tomato is loose on the table.}\label{fig:start}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.62\linewidth]{end_stage3_combo.png} +\caption{\textbf{End of the first stage --- state 3 reached.} Episode 148, frame 570 of 1583, edge +\texttt{2->3}. The robot has picked the tomato off the table and dropped it into the pan; the pan is on the +grate. This is the state from which the pour is possible.}\label{fig:stage3}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.62\linewidth]{end_stage4_combo.png} +\caption{\textbf{End of the second stage --- state 4 reached: THE GOAL.} Episode 148, frame 1582, the +\emph{last} frame of the episode, edge \texttt{3->4}. The robot has lifted the pan, rotated it to tip the +tomato into the bowl, and \textbf{put the pan back down on the grate}: the tomato is in the bowl and the pan +is on the grate, gripper still on the handle. \texttt{PACK.json} states the same in words: ``state 4 = pan on +grate, tomato in bowl''.}\label{fig:stage4}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.62\linewidth]{end_stage6_combo.png} +\caption{\textbf{The near-miss, state 6.} Episode 198, frame 420, edge \texttt{2->6}. The tomato \emph{is} in +the bowl --- but the pan has been left on the table instead of on the grate, and this episode is scored a +failure. State 4 and state 6 differ by exactly one thing: whether the pan went back on the +grate.}\label{fig:stage6}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.62\linewidth]{end_stage5_combo.png} +\caption{\textbf{The other failure terminal, state 5.} Episode 0, frame 313, edge \texttt{0->5}. The pan has +been taken off the grate and parked on the table, the tomato is on the grate and the bowl is empty. 50 +episodes (route \texttt{0->5}) end here; none is rewarded --- which is why the task brief's ``the goal is +stage 5'' is wrong for this corpus.}\label{fig:stage5}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.46\linewidth]{end_stage1_combo.png}\hfill +\includegraphics[width=0.46\linewidth]{end_stage2_combo.png} +\caption{\textbf{The two intermediate ids, 1 (left, episode 50 frame 266, edge \texttt{0->1}) and 2 (right, +episode 100 frame 310, edge \texttt{0->2}).} Both show the tomato in the pan with the pan on the table rather +than on the grate, and the two are hard to tell apart in the global camera. \emph{Caveat, stated because the +reward does not depend on it:} the ids are per-route annotation ids --- episode 148 is labelled as +\emph{starting} in state 2 (Fig.~\ref{fig:start}) yet looks nothing like this picture. Only states 4 and 6 have +a visual definition that is consistent everywhere it was checked, and those are the two the reward +uses.}\label{fig:stage12}\end{figure} + +\clearpage +\section{What a success looks like at the end} +\begin{figure}[htbp]\centering +\includegraphics[width=0.98\linewidth]{success_final_grid.png} +\caption{\textbf{The final frame of the first six successful episodes} (148, 149, 150, 151, 152, 153; top row +left to right, then bottom row; global camera; local frames 1582, 1265, 1143, 1202, 1577, 1124 --- each is the +last frame of its episode, \texttt{status/real/STORY\_FRAMES.json}). In \emph{every} one the tomato is in the +bowl \textbf{and the pan is back flat on the grate}. Success does not end at the pour; it ends after the pan +is returned.}\label{fig:success}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.98\linewidth]{pour_strip_ep148.png} +\caption{\textbf{Pour $\to$ pan return $\to$ end}, episode 148, frames 943 to 1582 at stride 40, row-major +(\texttt{scripts/real/render\_pour.py} $\to$ \texttt{status/real/POUR\_STRIP.json}). Top row: the pan is +lifted and tilted with the tomato still in it. Middle row: the arm occludes the camera while it carries the +pan over the bowl; by frame 1223 the tomato is in the bowl. Bottom row: the pan is lowered back onto the +grate and the episode ends at frame 1582. \textbf{The pour happens between frames 1143 and 1223}, i.e. +roughly $400$ frames ($\approx 10$~s at the cache's effective $38.7$~fps, \texttt{PACK.json} +\texttt{effective\_fps\_retained}) before the episode ends --- and every one of those frames carries the +\emph{same} annotation edge \texttt{3->4} (all 17 sampled frames, \texttt{POUR\_STRIP.json} +\texttt{edge\_at\_frames}). The annotation marks no separate ``pour'' event.}\label{fig:pour}\end{figure} + +\noindent\textbf{Frame counts.} In all 50 successful episodes the operator's arrival marker +(\texttt{cache/real\_cooking\_v5/reward.f32.npy} $>0$) is the \emph{last} frame of the episode: tail +$=1$ frame, min $=$ median $=$ max $=1$ (\texttt{status/real/SUCCESS\_TAIL.json}, +\texttt{episodes\_where\_marker\_is\_last\_frame} $=50$). The stage index does stay on \texttt{3->4} from the +pour to the end, but there are \emph{no} frames after the marker. The whole $3\to4$ segment --- approach, pour +and pan return together --- has a median length of $576.5$ frames (\texttt{cache/real\_cooking\_v5/SEGMENTS.json}, +edge \texttt{3->4}). + +\clearpage +\section{Which frames get \texorpdfstring{$+1$}{+1}} +Each variant changes \emph{only} the per-frame label array handed to the trainer +(\texttt{train\_rsm.py --reward-npy}); architecture, cache, optimiser, $\beta$ band, chunk, seed and step +budget are identical to the flagship \texttt{R\_M}. The arrays are built by +\texttt{scripts/real/make\_goal\_reward.py} (v0--v3) and \texttt{scripts/real/make\_v4\_reward.py} (v4). + +\input{_reward_tables2.tex} + +\clearpage +\section{The \#271 schemes, stated mathematically}\label{sec:s271} +gen\_q \#271 specifies the reward by the annotated state graph rather than by episode provenance. Fix the +notation: $t$ is a frame of episode $i$; $\mathrm{to}(t)$ is the annotation's \texttt{edge\_to}, the state the +\emph{segment containing $t$} leads into; $k(t)$ is the annotation's \texttt{reached\_state\_id}; $a_i$ is the +frame at which episode $i$ reaches $S_4$ (undefined if it never does); $f_i$ is episode $i$'s final state; and +$S_4 = $ ``pan on grate, tomato in the bowl'' is the goal. The per-frame label handed to +\texttt{train\_rsm.py --reward-npy} is then +\begin{align} +\textbf{$v_0$ (control)}\quad & r_t = \mathbf{1}\!\left[f_i \in \{S_3,S_4\}\right], \label{eq:v0}\\ +\textbf{A (default)}\quad & r_t = \mathbf{1}\!\left[\mathrm{to}(t) = S_4\right], \label{eq:A}\\ +\textbf{B}\quad & r_t = \mathbf{1}\!\left[0 \le a_i - t \le H\right],\qquad + H = \frac{L}{1-\beta},\ \ \beta = 0.99, \label{eq:B}\\ +\textbf{C}\quad & r_t = \mathbf{1}\!\left[k(t) = S_4\right]\ \ \text{with the weighted loss}\ \ + \mathcal{L}_R = \frac{\sum_t w_t\,\ell\!\left(R(z_t), r_t\right)}{\sum_t w_t},\ \ + w_t = \begin{cases} w_{\mathrm{neg}} & \mathrm{to}(t) \in \{S_5,S_6\}\\ 1 & \text{otherwise,}\end{cases} + \label{eq:C} +\end{align} +with $r_t = 0$ in \eqref{eq:B} for every episode that never reaches $S_4$, $\ell$ the per-frame binary +cross-entropy, and $w_{\mathrm{neg}} \in \{3, 10\}$ swept. $L$ in \eqref{eq:B} is the number of successor hops +the read-out chains: the flagship read-out is \texttt{--rsm-mode d1 --rsm-beta 0.99}, one hop, so +$H = 1/(1-0.99) = 100$ frames; the fold-4 read-out gives $H = 4/(1-0.99) = 400$, built and trained as a second +$B$ cell. The normalisation by $\sum_t w_t$ in \eqref{eq:C} is deliberate: it keeps the \emph{scale} of the +reward term fixed as $w_{\mathrm{neg}}$ moves, so a difference between $w_{\mathrm{neg}}=3$ and $10$ is a +difference in emphasis and not in effective learning rate. With no weight array the implementation reduces +bit-for-bit to the unweighted \texttt{binary\_cross\_entropy\_with\_logits} the earlier cells used. + +\input{_scheme271.tex} + +\paragraph{Three corrections the corpus forces, and the mapping onto the earlier cells.} +\begin{enumerate}\itemsep2pt +\item \textbf{A was already trained.} On this corpus $\mathbf{1}[\mathrm{to}(t)=S_4]$ is \emph{bit-identical} +to the earlier \texttt{reward\_v1\_goaltrans.f32.npy} (asserted in +\texttt{scripts/real/make\_goal\_reward.py}, and the assertion passes), so the cells +\texttt{R\_M\_ft\_v1} and \texttt{R\_M\_ft\_v1\_s1} at step 110000 \emph{are} the scheme-A heads. No GPU was +spent re-deriving them, and nothing is double-counted: throughout this document +\texttt{R\_M\_ft\_v0} is the provenance control \emph{as shipped}, +\texttt{R\_M\_ft\_v1} is \textbf{A}, \texttt{R\_M\_ft\_v2} is arrival-only, and \texttt{R\_M\_ft\_v3} is the +final-segment-of-every-episode control. +\item \textbf{The shipped $v_0$ is not \#271's $v_0$.} \#271 writes $\mathbf{1}[f_i \in \{S_3,S_4\}]$, which is +$148$ of $248$ episodes and $72.9\%$ of frames; the head that actually shipped is +$\mathbf{1}[f_i = S_4]$ --- episode success --- which is $50$ episodes and $29.4\%$ of frames. Both arrays are +built; the literal one trains as \texttt{R\_M\_ft\_v0lit}. +\item \textbf{$k(t)$ is a sparse arrival marker, not a per-frame state.} +\texttt{annotation.reached\_state\_id} is $-1$ on $181{,}084$ of $181{,}530$ frames; the $446$ non-negative +entries are one-frame segment-arrival markers, and the $S_4$ marker is the \emph{last frame} of the episode in +all $50$ cases. So the literal reading of \eqref{eq:C} has $50$ positives against $100$ hard negatives and is +degenerate --- it is the arrival-only cell $v_2$ with a weight. C is therefore realised as \#271's own +description of it (``the cheapest change \dots\ sample weights only''): the label of \eqref{eq:A} with the +weights of \eqref{eq:C}, which makes A vs.\ C exactly the hard-negative-weighting ablation the scheme is for. +The literal array is kept on disk (\texttt{reward\_C\_literal\_marker.f32.npy}) so the reading can be +re-examined. +\end{enumerate} + + +\begin{figure}[htbp]\centering +\includegraphics[width=0.66\linewidth]{reward_strip_success.png} +\caption{\textbf{A successful episode (148) seen by each reward head.} Rows top to bottom: v0, v1, v2, v3, v4. +Columns: frames 126 (reaching for the tomato), 1077 (pan lifted, mid $3\to4$ segment) and 1582 (the last +frame, tomato in bowl, pan on grate). \textbf{Green outline $=$ this frame is labelled $+1$}, red $=0$. +v0 rewards all three; v1 and v3 reward the last two; v2 and v4 reward only the final frame. +Labels read from the label arrays themselves (\texttt{status/real/STORY\_FRAMES.json}, +field \texttt{labels}).}\label{fig:stripsucc}\end{figure} + +\begin{figure}[htbp]\centering +\includegraphics[width=0.66\linewidth]{reward_strip_subopt.png} +\caption{\textbf{A failed episode (0, route \texttt{0->5}) seen by each reward head}, frames 25, 157, 313 +(the last). Same row order. Only v3 --- ``the final segment of every episode'' --- puts any $+1$ on a failed +episode; v0, v1, v2 and v4 give it nothing anywhere. That is the whole reason v3 exists: it is the only one +of the five whose positives are not a function of episode success.}\label{fig:stripsub}\end{figure} + +\clearpage +\section{The reward head ships inside the successor checkpoint}\label{sec:ships} +There is no separate reward model to train, host or download. $R(z)$ is a head trained jointly with the +successor and saved in the \emph{same} file: +\begin{itemize}\itemsep1pt +\item \textbf{saved} at \texttt{rsm\_libero/train\_rsm.py:1094} --- the blob is + \texttt{\{"enc", "enc\_t", "rew": rew.state\_dict(), "flow", "rms", "config", \dots\}}; + confirmed present as the top-level key \texttt{"rew"} in + \texttt{runs/real\_cooking\_v5/rsm/R\_M\_ft\_v0/ckpt\_s110000.pt}. +\item \textbf{loaded} for scoring at \texttt{code/rise\_robomimic/robomimic/algo/rsm\_scorer.py:518} + ($\to$ \texttt{is\_ope.load\_critic}), which does + \texttt{rew.load\_state\_dict(ck["rew"])} at \texttt{code/gen\_q/rsm\_libero/is\_ope.py:117}; + \texttt{scripts/real/stitch\_multihop.py:102} and \texttt{scripts/real/score\_nnl1.py:45} load it the + same way, and \texttt{train\_rsm.py:662} reloads it on \texttt{--resume}. +\item \textbf{used} inside the value: \texttt{\_q\_fold\_logit(\dots, rew=self.rew, \dots)}, + \texttt{rsm\_scorer.py:340,442}. Choosing a reward head therefore means choosing \emph{which + checkpoint file} to point \texttt{--rsm-ckpt} at --- one file, one download. +\end{itemize} + +\paragraph{Where to get the shipped head.} The recommended head is the one already inside the flagship +successor checkpoint, mirrored public and token-free as +\texttt{successor\_rsm\_real\_RM\_s0\_100k.pt} (79{,}192{,}735\,B) at +\url{https://huggingface.co/rli14/rsm_cooking_v5_checkpoints}; its seed partner is +\texttt{successor\_rsm\_real\_RM\_s1\_100k.pt}, the Gaussian hop head the folded read-out chains through is +\texttt{hop\_head\_rsm\_real\_gauss\_r1.pt}, and the cache statistics the scorer needs are +\texttt{successor\_rsm\_real\_feat\_stats.json}. None of the four fine-tunes studied here is mirrored, +deliberately: none of them earned it --- see the open-loop screen below and Sec.~\ref{sec:decisive}. Downloading the +flagship file therefore downloads the v0 provenance reward head, and there is no second name for it in the +mirror. + +\section{How the variants were made, and their health} +\textbf{Recipe (RISE recipe, warm start).} Each variant starts from the flagship +\texttt{runs/real\_cooking\_v5/rsm/R\_M/ckpt\_s100000.pt} (seed 0) or +\texttt{R\_M\_s1/ckpt\_s100000.pt} (seed 1), swaps in the new label array and fine-tunes for +\textbf{10k further steps} at the same constant learning rate ($3\times10^{-4}$; \texttt{train\_rsm.py} has no +LR schedule) to step 110000, trunk \emph{not} frozen. Cells \texttt{R\_M\_ft\_v0..v3} and +\texttt{R\_M\_ft\_v0..v3\_s1} in \texttt{scripts/rr\_rsm.sh}; LSF jobs 1840555--1840562, 17--26 minutes each on +one H100. Four \emph{from-scratch} controls (\texttt{R\_RW\_v0..v3}, jobs 1840034--1840037) are still training +and are reported when they land. + +\input{_stitch_and_cal.tex} + +\section{The open-loop screen, and what to ship} +Every scorer ranks the \textbf{same} 128 diffusion candidates at the same state of the same held-out episode, +so the comparison is paired decision by decision. Settings are the flagship read-out of +\texttt{status/real/openloop\_S0Aidql\_*}: $N=128$, argmax, probability read-out, $T=25$, \texttt{d1}, +$\beta=0.99$, 16 particles, chunk 8. + +\vspace{4pt}\noindent\textbf{What the numbers say.} +\begin{itemize}\itemsep1pt +\item \textbf{No reward variant separates from the v0 control.} The largest paired difference is + $+0.019$~cm (\texttt{ft\_v2\_s1}) against a standard error of $0.011$~cm, and the two seeds disagree in + sign for both v2 and v3. On 705 paired decisions that is noise. +\item \textbf{The real effect is much larger and is not about the reward:} a plain sample (\texttt{greedy}) + and \emph{both} permutation controls land $0.07$--$0.09$~cm \emph{closer} to the logged expert action + than any value-ranked choice, at $6$--$8$ standard errors. Best-of-128 by the successor value (and by + the IDQL critic, $-0.020\pm0.013$) currently moves the chosen action \emph{away} from the + demonstrator. Changing the reward label does not fix that; it is the same conclusion the successor + report reaches from the stitch and tie diagnostics. +\item \textbf{So: ship v0}, and do not rely on the value for selection yet. v0 is the head already inside + \texttt{R\_M/ckpt\_s100000.pt}; it has the cleanest reward-head calibration; nothing beats it here; and + the stitching test in Sec.~\ref{sec:decisive} rules out all five heads equally, so there is no reason + to prefer a fine-tune. If the rig later wants a head whose positives are not a restatement of ``this + episode succeeded'', v1 (the goal transition, the whole $3\to4$ segment including the pan return) is + the principled choice --- but on this corpus it can only ever fire on the same 50 episodes, which is + exactly the limitation Sec.~\ref{sec:decisive} measures. +\end{itemize} + +\section{Still open} +\begin{itemize}\itemsep1pt +\item The second RISE-actor (rsm\_real) proposer (\texttt{S0Aidql} seed 0 @ epoch 2000, job 1840570) was still running at the time + of writing; its table is added when it lands. +\item The four from-scratch controls \texttt{R\_RW\_v0..v3} (jobs 1840034--1840037) test whether 10k of + fine-tuning is enough to express a label change; the fine-tunes' reward-head AUCs + (Table~\ref{tab:rheadcal}) say the head itself relearns within that budget. At 06:45 UTC + \texttt{R\_RW\_v2} and \texttt{R\_RW\_v3} have \emph{finished} at step 100000 and \texttt{v0}/\texttt{v1} + are at 95000/65000 (\texttt{runs/real\_cooking\_v5/rsm/R\_RW\_v*/history.json}). The finished two + reproduce the fine-tunes' pattern rather than overturning it: from scratch, \texttt{v2} (arrival only) + reads \texttt{q\_success\_auc} $=0.418$ and \texttt{v3} (final segment of every episode) $0.464$ --- both + at or below chance on ``did this episode succeed'', where the provenance label \texttt{v0} reads $1.000$. +\item Nothing here is a closed-loop result. Every number is open-loop ranking against logged actions on the + \texttt{real\_cooking\_v5} held-out episodes. +\item \texttt{R\_M\_ft\_v5} / \texttt{\_s1} --- the successor fine-tuned on \emph{RISE's own} 148-episode + provenance labels (Sec.~\ref{sec:decisive}) --- \textbf{landed} at step 110000 (LSF 1841764, 1841765; + training log \texttt{logs/lsf/rr\_ft\_v5.1841764.out}: \texttt{mean r=0.729081, 132350 positive frames + of 181530}). Their diagnostics were resubmitted over all 16 heads (LSF 1842855 $\to$ + \texttt{status/real/DECISIVE\_REWARD2.json}, 1842825 $\to$ \texttt{STITCH\_FEASIBILITY2.json}, 1842826 + stitch control, 1842828 the open-loop screen). One number already distinguishes them: widening the + reward from the dataset's 50 rewarded episodes to RISE's 148 drops the successor's + \texttt{q\_success\_auc} from $1.000$ (\texttt{R\_M\_ft\_v0}) to $0.724$ / $0.730$ + (\texttt{runs/real\_cooking\_v5/rsm/R\_M\_ft\_v5\{,\_s1\}/history.json}) --- the folded value can no + longer tell a success from a failure, because under RISE's labels 98 of the 148 ``successes'' never + put the tomato in the bowl. They do not change the stitching verdict either: their labels are + constant over a recording like v0's, which is the property Sec.~\ref{sec:decisive} shows to be the + blocker. +\item The label array \texttt{reward\_v5\_riseprov.f32.npy} (this study) is \emph{bit-identical} to + \texttt{reward\_v0lit\_finalS3S4.f32.npy} built for \#271 (both 181530 frames, both summing to 132350; + checked with \texttt{numpy.array\_equal}), so \#271's \texttt{v0lit} cells and these \texttt{v5} cells + are the same head under two names --- see \texttt{status/real/NOTE\_v5\_equals\_v0lit.md}. +\item The stitching figure itself (\#270, worker SUCCESSOR\_VIZ) should \emph{not} be built with a + green/red reward overlay until a head passes D1 \emph{and} D3. Under the heads measured here the + overlay would show the successor preferring the failure branch. +\end{itemize} + +\end{document} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_successor_report.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_successor_report.tex new file mode 100644 index 0000000000000000000000000000000000000000..54f9ebd170870303aee4078849b5061002fd8145 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/real_successor_report.tex @@ -0,0 +1,416 @@ +\documentclass[11pt]{article} +\usepackage[margin=18mm]{geometry} +\usepackage{graphicx} +\usepackage{booktabs} +\usepackage{amsmath} +\usepackage{url} +\usepackage[hidelinks,breaklinks]{hyperref} +\usepackage{times} +\setlength{\parskip}{3pt} +\sloppy +\emergencystretch=3em +\title{The real-world successor model on \texttt{rsm\_cooking\_v5}\\[2pt] + \large every variant, its knobs, its health numbers, and the open-loop selection result} +\author{rsm\_rise real-world stream --- gen\_q issue \#261 (cross-ref \#263)} +\date{2026-09-22} +\begin{document} +\maketitle + +\section{What this report covers} +This is the successor-model companion to \texttt{docs/real\_proposal\_report.pdf}, which covers the +\emph{proposal} policies on the same corpus. \texttt{rsm\_cooking\_v5} is the real Franka cooking dataset +(HF \texttt{jmarangola/rsm\_cooking\_v5}); the successor is trained not on the raw video but on the DINO cache +\texttt{cache/real\_cooking\_v5}, built by \texttt{scripts/real/relabel\_dino\_lerobot.py}: 248 episodes, +181{,}530 frames, 1536-d \texttt{dinov2\_vits14} CLS$+$GeM features over the \texttt{global} and \texttt{wrist} +cameras concatenated with a 10-d proprio vector, z-scored and clipped to $\pm10$ +(\texttt{cache/real\_cooking\_v5/PACK.json}, field \texttt{state\_formula}). The trainer is +\texttt{rsm\_libero/train\_rsm.py}, launched by \texttt{scripts/rr\_rsm.sh}. + +As in the proposal report, \textbf{no closed-loop number appears here}: the robot computer +(\texttt{rsm\_real}) is not reachable from this account (\texttt{scripts/real/README\_TWIN.md}~\S1), so every +result is open-loop --- held-out prediction, structural controls on the feature space, and selection among a +proposer's own candidates. + +\section{The variants and what each knob means} +\label{sec:cells} +Table~\ref{tab:cells} is the register. Every row's knobs are read back out of that checkpoint's own +\texttt{config} blob (\texttt{torch.load(ckpt.pt)["config"]}), not from the launcher, so the table cannot +drift from what actually ran. All twelve pre-existing cells reached the full +\texttt{--steps 100000}. Shared across every row: \texttt{--enc identity} (the 1546-d state is used directly, +no learned encoder), \texttt{--flow-depth 4}, \texttt{--batch 4096}, \texttt{--lr 3e-4}, \texttt{--ema 0.995}, +\texttt{--w-actcon 0.5}, \texttt{--reward-loss bce}, \texttt{--flow-dropout 0.1}, \texttt{--flow-norm 1}, +\texttt{--wd 0.1}, \texttt{--sample-clip 10}, \texttt{--x-noise 0.3}, \texttt{--eval-every 5000}, +\texttt{--save-every 10000}. + +\begin{description}\itemsep1pt +\item[\texttt{width}] \texttt{--flow-width}: the hidden width of the flow field that generates the successor + sample. The ladder is 1024 (\texttt{R\_M}) / 1536 (\texttt{R\_L40}) / 2048 (\texttt{R\_XL}). Depth is held at + 4 across the ladder on the simulation finding that nearly all of the small-model penalty is depth $2\to4$, + not width, so width is the hypothesis under test (\texttt{scripts/rr\_rsm.sh}, \texttt{R\_*} block). +\item[\texttt{chunk}] \texttt{--chunk}: how many logged frames of action the successor is conditioned on. 8 + frames is $0.16$\,s at this corpus's 50\,Hz, against $0.40$\,s at simulation's 20\,Hz; + \texttt{R\_M\_chunk20} restores the $0.40$\,s real-time window and is otherwise identical to \texttt{R\_M}. +\item[\texttt{trunc}] \texttt{--beta-trunc-eps}: \texttt{data.py} caps the drawn $\beta$ per anchor at + $\epsilon^{1/L}$, where $L$ is the number of frames left in that episode, so a nominal $\beta$ always leaves a + constant $\epsilon$ tail. $0.02$ is the cap ON. Setting it to $0.99 \ge \beta_{hi}$ makes the cap + non-binding for every $L$, which is the pre-fix behaviour where a drawn $\beta{=}0.99$ at an anchor with 80 + frames left silently meant a $\sim$30-frame horizon. The \texttt{\_notrunc} rows are that A/B. +\item[\texttt{seed}] \texttt{--seed}. Note it also reseeds \texttt{data.py}'s episode permutation, so seed 1 + has a \emph{different} validation split; the truncation A/B must be read \emph{within} a seed, never as an + absolute across seeds. +\item[\texttt{reward}] \texttt{--reward-mode}. \texttt{dense} puts $r{=}1$ on every frame of every episode with + \texttt{ep\_success}, 0 elsewhere (\texttt{rsm\_libero/data.py:185--186}). \texttt{terminal} puts $r{=}1$ only + on the last \texttt{--k-success} frames of a rewarded episode (\texttt{data.py:194}); $k{=}40$ is $0.8$\,s / + 2000 positives, $k{=}120$ is $2.4$\,s / 6000. \texttt{R\_M\_rterm40st} additionally sets + \texttt{--stratify-success 1}, which holds out the same \emph{fraction} of rewarded and unrewarded episodes; + that changes the validation split, so it is a new baseline rather than a drop-in replacement for + \texttt{R\_M\_rterm40}. The reward axis is the subject of the companion study, + \texttt{docs/real\_reward\_study.pdf}. +\end{description} + +\paragraph{The $\beta$ band was derived from this corpus, not copied from simulation.} +\texttt{scripts/real/beta\_band.py} $\to$ \texttt{status/real\_cooking\_beta.json}: episodes are +$314 / 625 / 1943$ frames (min/median/max) and the modal inter-frame $\Delta t$ is exactly $20$\,ms (50\,Hz), +with a heavy pause tail giving an episode-averaged $38.72$ retained frames/s. At $\epsilon{=}0.02$ the nominal +$\beta$ is only exercised by anchors with $L \ge \ln\epsilon/\ln\beta$: $\beta{=}0.99$ needs $L\ge389$ and is +reached by $47.5\%$ of anchors and $89\%$ of episodes, while $\beta{=}0.995$ needs $L\ge780$ and is reached by +only $14.3\%$ / $35\%$. The median per-anchor cap is $0.9894$, so $\beta_{hi}{=}0.99$ makes nominal +$\approx$ effective; hence the band $[0.95, 0.99]$, i.e.\ a one-hop horizon of $20$--$100$ frames +$=0.40$--$2.00$\,s local, $0.52$--$2.58$\,s in retained time. \textbf{One hop cannot span a task segment} +($\sim$300--600 frames, $6$--$12$\,s); that would need $\beta\approx0.9967$, supported by $\sim$2\% of anchors. +Chaining is mandatory on this corpus, which is what makes the hop heads below load-bearing. + +\paragraph{The hop heads.} \texttt{runs/real\_cooking\_v5/hop/} holds the Stage-2 hop heads that the folded +read-out chains through: \texttt{gauss/policy\_r1.pt} (the Gaussian head, the one actually used in the +open-loop cells below, see the \texttt{rsm\_hop\_ckpt} field of +\texttt{status/real/openloop\_S0Aidql\_s0\_e2000\_fold\_d4\_T25/scorer\_openloop.json}) and \texttt{flow/} +(\texttt{policy\_r1.pt}, \texttt{bc\_resume.pt}, W\&B run \texttt{820a893f607aad64}). They are +\emph{one-round} heads (\texttt{\_r1}): the depth-4 fold composes four applications of the same head. The flow +head's \texttt{gauss} sibling directory carries no checkpoint of its own beyond \texttt{policy\_r1.pt}, so the +folded read-out has exactly one configuration on this corpus today. + +\input{_succ_tables.tex} + +\section{Health numbers} +\label{sec:health} +Table~\ref{tab:health} is the final-step evaluation each cell wrote into its own \texttt{history.json}. Four +things in it deserve to be read carefully. + +\paragraph{The reward head is saturated under the provenance label, and that is a data fact, not a fit.} +Every \texttt{dense} cell reports validation reward AUC $=1.0000$ with MAE $\sim10^{-10}$. That is not a good +reward head; it is the label being decided by the initial scene. On this corpus the only rewarded route +(route 3) is also the only route that \emph{starts} at state 2, so \texttt{ep\_success} is predictable from +frame 0 and is constant within an episode. The consequence for planning is measured in +Sec.~\ref{sec:stitch}. The two \texttt{terminal} cells break the saturation --- \texttt{R\_M\_rterm40} MAE +$3.7\times10^{-3}$, \texttt{R\_M\_rterm120} $1.2\times10^{-2}$ --- but their validation AUC is +\texttt{nan}/degenerate because the unstratified $10\%$ split put only 2 of the 50 rewarded episodes in +validation, i.e.\ 80 positive frames; that is exactly why \texttt{R\_M\_rterm40st} exists. + +\paragraph{The successor sample is closer to the episode's own future than to a random pool, but it is +farther from that future than simply standing still.} \texttt{nnl1 ratio} (own future / random pool) is +$0.59$--$0.69$ across the ladder, so the sample does carry trajectory information. But \texttt{vs stay} +(own future / hold-still) is $1.27$--$1.53$ \emph{everywhere}: on this corpus, predicting ``the state does not +change'' is a better one-hop successor than the model's own sample. This is the same vacuous-baseline problem +the proposal report finds for actions (\texttt{docs/real\_proposal\_report.pdf}~\S2), and it is the single +most important negative number in this report. + +\paragraph{Width helps the generative fit monotonically and does not fix the ratio.} +$\text{cfm}_{val}$ falls $1.062 \to 0.841 \to 0.791$ and $\text{minmse}_{val}$ falls +$0.691 \to 0.474 \to 0.427$ from \texttt{R\_M} to \texttt{R\_L40} to \texttt{R\_XL}, and \texttt{vs stay} +improves from $1.50$ to $1.27$ --- but never crosses $1.0$. Scaling the flow width by $2\times$ buys a better +sample, not a useful one. + +\paragraph{The truncation A/B is inside the seed noise.} Within seed 0, \texttt{R\_M} vs +\texttt{R\_M\_notrunc} is $0.6668$ vs $0.6797$ on the nnl1 ratio (cap better by $0.013$); within seed 1 it is +$0.6759$ vs $0.6893$ ($0.013$, same sign). At width 1536 and 2048 the two arms differ by $0.0000$ and +$0.0041$. So the cap is a small consistent win at width 1024 and indistinguishable above it. + +\subsection{The cross-trajectory stitch control} +\label{sec:stitch} +This corpus contains \textbf{no episode that runs $0 \to \cdots \to 3 \to 4$}. The four-stage path exists only +by composing a $0\to x\to3$ episode (routes 1 and 2) with the $3\to4$ segment, which lives only inside route 3 +(\texttt{scripts/real/check\_stitch.py}, docstring). Whether that composition is even representable is a +property of the features, so it is testable without any model. + +\texttt{scripts/real/check\_stitch.py} (LSF job 1816574, log +\texttt{logs/lsf/rr\_cpu\_stitch.1816574.out}) takes the arrival frames at state 3 from each route and measures +the nearest-neighbour $L_1$ from a route-1/2 arrival to the nearest route-3 arrival, relative to how far +route-3 arrivals sit from each other (reference $0.5298$, $n{=}50$): +\begin{center}\small +\begin{tabular}{lrr}\toprule +comparison & NN-$L_1$ & ratio to reference \\\midrule +route1 $\to$ route3 arrivals at state 3 (the stitch point) & 1.0135 & 1.913 \\ +route2 $\to$ route3 arrivals at state 3 (the stitch point) & 0.7831 & 1.478 \\ +\textbf{control A} route1 $\to$ route3 at episode MIDPOINT (non-stitch time) & 0.9230 & 1.538 \\ +\textbf{control A} route2 $\to$ route3 at episode MIDPOINT & 0.9391 & 1.565 \\ +\textbf{control B} state-5 arrivals $\to$ route3 state-3 arrivals & 1.0377 & 1.959 \\ +\textbf{control B} state-6 arrivals $\to$ route3 state-3 arrivals & 1.0550 & 1.991 \\ +\bottomrule\end{tabular} +\end{center} +\textbf{Read:} the stitch point is not clean. Route~2's arrival at state 3 (ratio $1.478$) is barely closer to +route~3's state-3 arrivals than an \emph{unrelated} route-2 midpoint is ($1.565$), and route~1's is +\emph{farther} ($1.913$, essentially the failure-state control at $1.959$/$1.991$). A successor trained on +route 3's $3\to4$ segment is therefore queried off-support when it is handed a route-1 terminal state. +The corrected version of the same measurement agrees, and it is the one to quote. The dataset card warns +that the operator's \texttt{g} marker attaches to the last \emph{retained} row, which may precede the actual +arrival image, and that the true arrival observation is stored separately as +\texttt{meta/collection/arrivals//arrival-XX.npz}. +\texttt{scripts/real/check\_stitch\_arrivals.py} re-encodes those snapshots with the identical encoder and +crop and repeats the analysis (\texttt{status/real\_cooking\_stitch\_arrivals.json}): against a route-3 +within-group reference of $0.5000$, route~1 sits at ratio $2.020$ and route~2 at $1.503$, while arrivals at +the \emph{unrelated} states 1/2/4/5/6 sit at $1.918$--$2.062$. It also quantifies how wrong the proxy was: +the last-retained-row stand-in is $0.572$ mean / $0.565$ median / $0.687$ p95 from the true arrival frame +($n{=}446$), about one within-route reference distance, which is why the proxy form of this probe is +superseded. + +\subsection{Chaining, and where the reward signal dies} +\texttt{scripts/real/stitch\_multihop.py} (\texttt{status/real\_cooking\_stitch\_multihop.json}, on +\texttt{R\_M}'s \texttt{ckpt\_s100000.pt} at $\beta_{hi}{=}0.99$, hop $=100$ frames) chains the hop head and +asks, at each depth, how far the chained sample lands from the anchor's own future, from the goal region, and +from a random pool. At 1 hop the sample is at $0.589$ from its own future against $0.570$ from a random pool +--- i.e.\ \textbf{already no better than random at one hop} --- and by 3 hops the three columns are +$3.499 / 3.488 / 3.405$, indistinguishable. The splice control is the cleanest number: a route-2 end spliced +onto a route-3 second segment produces a feature jump of median $0.786$ against $0.921$ of motion in one +model hop (ratio $0.853$), so the splice is almost as large as everything the model moves in a hop, and the +route-1 control is $1.019$, i.e.\ larger than a whole hop. + +Most decisively, the \emph{reward head evaluated along the chain collapses}: \texttt{rhead\_mean} is +$1.9\times10^{-10}$ at 1 hop, $7.1\times10^{-11}$ at 2, $2.8\times10^{-11}$ at 3, $7.3\times10^{-18}$ at 4 and +$4.7\times10^{-25}$ at 5. Under the provenance reward, a planner that chains from a non-route-3 anchor reads +exactly zero at every depth and has no gradient to follow. That is the finding the reward-head study in +\texttt{docs/real\_reward\_study.pdf} was commissioned to attack. + +\subsection{Calibration and ties in the read-out} +There is \textbf{no \texttt{calib.json} on disk for any real cell} --- the temperature argument of +\texttt{scripts/real/scorer\_openloop.py} (\texttt{--rsm-temperature}, default 0 meaning ``read the +checkpoint's \texttt{calib.json}, else 1.0'') was never populated for this corpus, and all four landed +open-loop cells were therefore run with an \emph{explicit} \texttt{--rsm-temperature 25} +(\texttt{rsm\_temperature: 25.0} in each \texttt{scorer\_openloop.json}). The calibration evidence available +is the trainer's own reward head fit, which is Table~\ref{tab:health}'s \texttt{r-auc}/\texttt{r-mae} pair and +is saturated for every \texttt{dense} cell. + +Table~\ref{tab:ties} measures the ties directly from the $705\times128$ score matrices in +\texttt{status/real/openloop\_*/scores.npz}. The result is that the \texttt{prob} read-out at $T{=}25$ is +\emph{not} literally tied --- the argmax is unique in $100\%$ of decisions and $127.2$--$127.6$ of the 128 +candidate scores are distinct --- but it is nearly flat: the mean max$-$min of the RSM score array is +$1.8$--$2.2\times10^{-3}$, against $0.24$--$0.26$ for the IDQL critic on the identical candidates, i.e.\ two +orders of magnitude less dynamic range. $T{=}25$ bought de-saturation of the equality test without buying a +usable spread. + +\section{Open-loop selection on the RISE actor (rsm\_real) proposers (\texttt{S0Aidql})} +\label{sec:openloop} +The proposers are the RISE actors of the companion proposal report: IDQL actor $+$ IQL critic trained on +\emph{this project's own} FR3 corpus \texttt{rsm\_cooking\_v5}, launcher family \texttt{S0Aidql}.\footnote{% +\texttt{robomimic} appears in this document only as the training \emph{framework} that RISE ships in (it +supplies the \texttt{.pth} container, the \texttt{twin\_rollout.RobomimicPolicy} loader and the +\texttt{robomimic.algo.rsm\_scorer} module). It is not a data source: every checkpoint named here is trained +on \texttt{rsm\_cooking\_v5}.} +\paragraph{What is and is not quotable.} \texttt{twin\_rollout.RobomimicPolicy} keeps a $T_o{=}2$ frame history +internally and \texttt{scorer\_openloop.py} called it once per decision at stride 25, so the actor's +``previous frame'' was 25 frames stale. Every earlier RISE-actor open-loop cell ran that way: the 41 +\texttt{status/real/scorer\_ol\_*} hop-depth / beta-band / read-out cells and everything quarantined in +\texttt{status/real/\_invalid\_stale\_history/}. \textbf{Nothing from either source is quoted in this report.} +The fix passes the true preceding frames as \texttt{obs["history"]} (\#263 comment 5769487243); the four +re-runs are LSF jobs 1835430, 1835432, 1835433, 1835434, and three of the four have landed +(\texttt{S0Aidql\_s1\_e2500\_fold\_d4\_T25}, job 1835432, was still running at the time of writing). + +The sanity check before reading any scorer column is that greedy's first-action error lands near the +checkpoint's replay fit, and it does: $0.570$\,cm greedy against a $0.58$\,cm replay fit on \texttt{s0@2000}, +$0.398$ against $0.39$ on \texttt{s1@2500}. + +\paragraph{The result.} Table~\ref{tab:openloop}. The successor loses. +\begin{itemize}\itemsep1pt +\item \textbf{The RSM scorer is worse than greedy on every landed cell} ($+0.043$, $+0.046$, $+0.065$\,cm), + with win rates against greedy of $0.379$--$0.458$, i.e.\ below chance, and mean oracle-rank percentiles + of $0.376$--$0.468$ against $0.5$ for a blind pick. +\item \textbf{It is also worse than its own permutation control}, whose $\Delta$ is $+0.002$ to $-0.007$\,cm + and whose rank percentile is $0.489$--$0.502$. A scorer that loses to a shuffle of its own scores is + ranking \emph{anti}-correlated with fit, not merely uninformative. +\item \textbf{Depth is not the explanation.} One-step (\texttt{d1\_d1}) and folded depth-4 through the + Gaussian hop head give the same answer on \texttt{s0} to within $0.003$\,cm ($+0.0426$ vs $+0.0456$). +\item \textbf{The IDQL critic does not replicate across seeds}: it helps on \texttt{s0@2000} + ($-0.043$/$-0.045$\,cm, win $0.58$, rank $0.59$) and hurts by about the same margin on + \texttt{s1@2500} ($+0.058$\,cm, win $0.40$, rank $0.40$). One seed each way is not an effect. +\item \textbf{There is real headroom, so this is not a ceiling artefact}: the oracle reaches + $0.108$--$0.197$\,cm against greedy's $0.398$--$0.570$, a $2.9$--$3.7\times$ gap, at win rate + $0.98$--$0.99$. The 128 candidates \emph{do} contain much better actions; neither value function finds + them. +\end{itemize} + +\section{Which variant is the flagship, and what is still open} +\textbf{\texttt{R\_M} at step 100000} is the flagship --- +\texttt{runs/real\_cooking\_v5/rsm/R\_M/ckpt\_s100000.pt} --- and it is the checkpoint every landed open-loop +cell and every stitch/chaining control in this report was run against (the \texttt{rsm\_ckpt} field of each +\texttt{scorer\_openloop.json} and of \texttt{status/real\_cooking\_stitch\_multihop.json}). It is the flagship +for procedural reasons rather than because it wins a metric: it is the only real cell with a seed partner +(\texttt{R\_M\_s1}), a truncation partner (\texttt{R\_M\_notrunc}) and a chunk partner +(\texttt{R\_M\_chunk20}) at matched width, so it is the only row where a difference can be read against a +control. On raw held-out fit \texttt{R\_XL} is better on every column of Table~\ref{tab:health} +($\text{cfm}_{val}$ $0.791$ vs $1.062$, \texttt{vs stay} $1.27$ vs $1.50$), and if the open-loop test is ever +re-run per width, \texttt{R\_XL} is the row to run it on. + +\paragraph{Where to get it.} Every checkpoint this report rests on is mirrored, public and +token-free, at \url{https://huggingface.co/rli14/rsm_cooking_v5_checkpoints} (verified byte-for-byte and by +LFS \texttt{sha256} against the source, \texttt{status/real/hf\_sha.json}): + +\begin{center}\small +\begin{tabular}{llr} +\toprule +what & file in the mirror & bytes \\ +\midrule +\texttt{R\_M} flagship, step 100000 & \texttt{successor\_rsm\_real\_RM\_s0\_100k.pt} & 79{,}192{,}735 \\ +\texttt{R\_M\_s1} seed partner & \texttt{successor\_rsm\_real\_RM\_s1\_100k.pt} & 79{,}192{,}927 \\ +Gaussian hop head \texttt{policy\_r1} & \texttt{hop\_head\_rsm\_real\_gauss\_r1.pt} & 19{,}563{,}355 \\ +cache $\mu$/$\sigma$/$z_{clip}$ $+$ \texttt{PACK.json} recipe & \texttt{successor\_rsm\_real\_feat\_stats.json} & 21{,}787 \\ +\bottomrule +\end{tabular} +\end{center} + +\noindent There is no separate \texttt{calib.json} for the real cells --- the scorer's parameters are the +cache statistics above (\texttt{scorer\_openloop.py}:80--100), not a calibration file. The three RISE-actor / +BC-union proposers and the pi0.5 BC params are in the same repo; the proposal report's register lists them. + +\paragraph{Which reward head ships, and the caveat.} \textbf{The reward head is inside the successor +checkpoint}, \texttt{state\_dict} key \texttt{rew} (written \texttt{rsm\_libero/train\_rsm.py}:1094, loaded +\texttt{rsm\_libero/is\_ope.py}:117 via \texttt{robomimic/algo/rsm\_scorer.py}:518, used in the value at +\texttt{rsm\_scorer.py}:340 and :442) --- one file, one download, no separate reward artefact. The head that +ships is \textbf{v0 provenance}: dense $+1$ on every frame of the 50 episodes that reach state 4. It is the +head recommended for the rig by the companion study, which found that none of its four 10{,}000-step +fine-tunes beats it on the open-loop screen. \textbf{That recommendation is relative, not a validation:} the +same study shows the value is not usable for selection on this corpus --- at a junction visited by a failure +trajectory, top-1 of 128 is a rewarded continuation in $0.094$ of decisions against a chance rate of $0.50$, +and the head separates route-3 from route-4 junction frames with AUC $1.000$, i.e.\ it reads \emph{which +recording} a frame came from. Ship it as a proposer-side artefact and do not gate actions on its value until +the corpus gains a route that traverses $0\to\cdots\to3\to4$ (\texttt{docs/real\_reward\_study.pdf}, +\#261 comment 5771720298). + +\paragraph{And do not ship RISE's own reward label instead.} RISE trains its critic from the +provenance flag \texttt{convert\_cooking\_hdf5.py}:158, which is $+1$ on every frame of every episode whose +final state is in $\{3,4\}$ --- 148 of 248 episodes, $132{,}350$ of $181{,}530$ frames ($72.9\,\%$), +98 of which never put the tomato in the bowl (\texttt{status/real/V5\_REWARD.json}). That label had never been +trained into a successor, so it was added as \texttt{R\_M\_ft\_v5} / \texttt{\_s1}: the flagship warm-started +and fine-tuned for $10{,}000$ steps on exactly those labels (LSF 1841764/1841765, step 110000, +\texttt{logs/lsf/rr\_ft\_v5.1841764.out}: \texttt{mean r=0.729081, 132350 positive frames of 181530}). The +resulting head is \emph{inverted on the goal}, measured on the 16-head sweep +\texttt{status/real/DECISIVE\_REWARD2.json} (LSF 1842855): + +\begin{center}\small +\begin{tabular}{lrrrr} +\toprule +head & $R$ logit, last 30 frames & \multicolumn{2}{c}{AUC} & $q_{\text{success}}$ AUC \\ + & state 3 \quad state 4 & 4 vs 3 & 4 vs 6 & (history.json) \\ +\midrule +\texttt{R\_M} (shipped, v0 provenance) & $-27.6$ \quad $+24.3$ & $1.000$ & $1.000$ & $1.000$ \\ +\texttt{R\_M\_ft\_v5} (RISE's label) & $+131.1$ \quad $+92.7$ & $0.088$ & $1.000$ & $0.724$ \\ +\texttt{R\_M\_ft\_v5\_s1} & $+166.3$ \quad $+91.4$ & $0.041$ & $1.000$ & $0.730$ \\ +\bottomrule +\end{tabular} +\end{center} + +\noindent Under RISE's label the reward head scores the \emph{mid-task} state 3 (``pan on stove, tomato +still in the pan'') \emph{above} the goal state 4 (``pan on grate, tomato in the bowl'') --- AUC $0.088$ and +$0.041$, i.e.\ almost perfectly the wrong way round --- and at the state-2 junction it prefers route 2, which +stops at state 3, ($+110.7$) over route 3, which finishes the task, ($+75.9$). It also loses the folded +value's ability to tell a successful episode from a failed one ($q_{\text{success}}$ AUC $1.000 \to 0.724$). +Both seeds agree. So the dataset's own rule (reward state ids $=[4]$, which is what the shipped \texttt{v0} +head implements) is the label to keep; RISE's provenance flag is \emph{not} interchangeable with it on this +corpus, even though it is what RISE's critic is trained on. + +\paragraph{The inversion is a property of the label, not of a seed (the crossed $2\times2$).} +Two further fine-tunes were run to separate ``RISE's label inverts the head'' from ``one training seed +inverted the head'': \texttt{R\_M\_ft\_v5\_x10} (seed-0 trunk $\times$ seed-1 RNG/split) and +\texttt{R\_M\_ft\_v5\_x01} (seed-1 trunk $\times$ seed-0 RNG/split), LSF 1843448 / 1843449, both at step +110000, all four cells agreeing on training fit ($q_{\text{success}}$ AUC $0.724$ / $0.730$ / $0.733$ / +$0.725$, each cell's \texttt{history.json}). D1/D2 re-run over the crossed set +(\texttt{status/real/DECISIVE\_REWARD\_X.json}, LSF 1843981, runner \texttt{scripts/real/run\_decisive\_x.sh}): + +\begin{center}\small +\begin{tabular}{lrrrr} +\toprule +head & $R$ logit, last 30 frames & \multicolumn{2}{c}{AUC} & junction \\ + & state 3 \quad state 4 & 4 vs 3 & 4 vs 6 & r3 vs r2 \\ +\midrule +\texttt{R\_M} (shipped, dataset rule) & $-27.6$ \quad $+24.3$ & $1.000$ & $1.000$ & $1.000$ \\ +\texttt{R\_M\_s1} (shipped, seed 1) & $-28.9$ \quad $+24.6$ & $1.000$ & $1.000$ & $1.000$ \\ +\texttt{ft\_v5} \ \ (trunk s0 $\times$ rng s0) & $+131.1$ \quad $+92.7$ & $0.088$ & $1.000$ & $0.057$ \\ +\texttt{ft\_v5\_x10} (trunk s0 $\times$ rng s1) & $+134.8$ \quad $+70.4$ & $0.032$ & $1.000$ & $0.058$ \\ +\texttt{ft\_v5\_x01} (trunk s1 $\times$ rng s0) & $+182.9$ \quad $+92.8$ & $0.003$ & $1.000$ & $0.029$ \\ +\texttt{ft\_v5\_s1} \ (trunk s1 $\times$ rng s1) & $+166.3$ \quad $+91.4$ & $0.041$ & $1.000$ & $0.073$ \\ +\bottomrule +\end{tabular} +\end{center} + +\noindent All four cells put the mid-task state 3 above the goal state 4 and all four prefer route 2 (which +stops at state 3) to route 3 (which finishes the task) at the junction, while every head keeps +$4$ vs $6$ at AUC $1.000$. So RISE's provenance flag does not weaken the goal ordering by accident of a +seed --- it reverses it, reproducibly, in every cell of the crossed design. What it does \emph{not} destroy +is the head's knowledge of where the pan ended: $4$ vs $6$ stays perfect everywhere. + +\paragraph{One head-seed ranks stitch candidates above chance, and the $2\times2$ says it is the trunk, not +the label.} The same four cells plus the two shipped heads and the from-scratch dataset-rule control were +put through D3 (the stitch-feasibility test of the companion study: at a junction visited by a failure +trajectory, 128 candidate chunks --- 64 logged from the rewarded continuation, 64 from the failure one --- +ranked with the flagship read-out, 64 anchors, three independent candidate draws; +\texttt{scripts/real/run\_d3\_2x2.sh}, LSF 1843979, \texttt{status/real/STITCH\_FEASIBILITY\_2x2\_seed*.json}, +collected by \texttt{scripts/real/build\_2x2\_table.py}): + +\begin{center}\footnotesize +\input{_d3_2x2.tex} +\end{center} + +\noindent Chance is $0.50$ in both the top-1 and the per-anchor AUC column. The two cells with the +\emph{seed-1 trunk} pass and the two with the seed-0 trunk fail, with the RNG/split seed making no +difference --- but the seed-1 trunk with its \emph{own} (provenance) head fails as well +(\texttt{R\_M\_s1}). The passing configuration is therefore the interaction (seed-1 trunk) $\times$ (RISE +label), now replicated across both RNG seeds and three candidate draws, and still $n=1$ in trunk seeds. +The honest reading is the one to carry forward: \textbf{no reward head ranks the stitch above chance +reproducibly across training seeds}, and the single configuration that does is the one whose reward head is +inverted on the goal by the table above --- so it cannot be recommended for the rig. +Separately, the from-scratch dataset-rule control \texttt{R\_RW\_v0} (100000 steps, no warm start) orders +the candidates well above chance on the per-anchor statistic while still failing top-1, which is the +cleanest evidence that the 10{,}000-step warm-start schedule, not the label alone, limits what these +fine-tunes can show. + +\paragraph{Open.} +\begin{enumerate}\itemsep1pt +\item \textbf{The provenance reward is the prime suspect and is now under test.} It is saturated + (Table~\ref{tab:health}), it is decided by the initial scene, and it collapses to $10^{-10}$ under + chaining. The companion study \texttt{docs/real\_reward\_study.pdf} takes \emph{this} checkpoint and + fine-tunes it for 10{,}000 further steps on four different per-frame reward labels --- everything + else (architecture, cache, optimiser state, $\beta$ band, chunk, seed, split) held identical --- and + then ranks all of them on one shared candidate set. Read the two documents together: this one fixes + the flagship and its controls, that one varies the single knob. +\item \textbf{The successor sample is worse than hold-still at one hop} (\texttt{vs stay} $>1$ everywhere). + Until that crosses $1.0$ no selection result should be expected to work, and no width in the + current ladder crosses it. +\item \textbf{The stitch the task requires is not representable} at the measured ratios + (Sec.~\ref{sec:stitch}). This is a property of the DINO feature space and of the corpus's route + structure, not of any successor checkpoint, so no amount of successor training fixes it; it needs + either different features or episodes that actually traverse $0\to\cdots\to3\to4$. +\item \textbf{One cell of the open-loop re-run is still in flight} (job 1835432). +\item \textbf{Two cluster faults were hit while producing the companion study and are worth knowing about + here, because they can silently corrupt any result in this programme.} (i) The GPFS fileset + \texttt{ess6000-1} is at its hard limit --- \texttt{mmlsquota} reports 348.6\,T of 350\,T --- and large + \texttt{torch.save} calls fail intermittently with + \texttt{[enforce fail at inline\_container.cc:672] unexpected pos}. Because \texttt{train\_rsm.py} + wrote the big resume blob \emph{before} the small scoring blob, one such failure destroyed a run that + had already trained 5{,}000 good steps (job 1840346). Both saves are now wrapped so a write error + warns and the run continues (\texttt{train\_rsm.py}, backup \texttt{.bak.20260922\_savefail}). + (ii) Host \texttt{p2-r03-n1} hands out GPUs on which CUDA cannot initialise + (\texttt{CUDA unknown error \dots{} Setting the available devices to be zero}); three jobs silently + fell back to CPU and made no progress for eight minutes. Submit with + \texttt{RR\_EXCL\_HOSTS=p2-r03-n1} until it is fixed. +\item \textbf{No closed-loop number exists or can exist from this account} (\S1). +\end{enumerate} + +\section{Provenance} +Every number above comes from a file named next to it. The collector is +\texttt{scripts/real/build\_successor\_tables.py}, which writes \texttt{docs/tex/\_succ\_tables.tex} and the +machine-readable \texttt{status/real/SUCCESSOR\_NUMBERS.json}; the PDF is built by +\texttt{scripts/tmp/build\_successor\_pdf.sh} with \texttt{tectonic} on a CPU node. Checkpoint knobs come from +each \texttt{ckpt.pt["config"]}; health numbers from each \texttt{history.json}; stitch numbers from +\texttt{logs/lsf/rr\_cpu\_stitch.1816574.out}, \texttt{status/real\_cooking\_stitch\_arrivals.json} and +\texttt{status/real\_cooking\_stitch\_multihop.json}; the $\beta$ band from +\texttt{status/real\_cooking\_beta.json}; open-loop numbers and tie counts from +\texttt{status/real/openloop\_*/\{scorer\_openloop.json, scores.npz\}}. +\end{document} diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/successor_stitching.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/successor_stitching.tex new file mode 100644 index 0000000000000000000000000000000000000000..42bb56aea661173240685701c0d22f0996c660e3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/successor_stitching.tex @@ -0,0 +1,746 @@ + +\documentclass[10pt]{article} +\usepackage[margin=0.7in,landscape]{geometry} +\usepackage{graphicx,amsmath,amssymb,booktabs,hyperref,xcolor} +\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue} +\newcommand{\code}[1]{\texttt{\small #1}} +\title{Visualising the RSM successor model: proposal clouds, sampled futures and the fold's Monte-Carlo $Q$} +\author{gen\_q \#270 (cross-links \#267) --- rsm\_rise} +\date{\today} +\begin{document}\maketitle + +\section{What the figure shows} +Each figure starts from a \textbf{failure state}: a frame of a play/suboptimal episode that the dataset +labels unsuccessful (\code{cache//meta.npz:ep\_success == False}), i.e.\ RISE's per-frame reward never +fires in that episode. At that state the planner +(\code{robomimic/algo/rsm\_planner.py:plan\_get\_action}) samples $N=128$ candidate action chunks from the +RISE actor and ranks them with the successor model. The figure draws, in order: +\begin{enumerate} +\item the root frame (both cameras); +\item the \textbf{action-proposal cloud}: all $N$ candidates, drawn as the end-effector paths their + OSC\_POSE deltas imply ($\text{eef}_0 + \text{cumsum}(a_{:, :3}) \times 0.05$\,m), coloured by that + candidate's $Q$, with the \textcolor{red}{argmax} in crimson; +\item the \textbf{tree}: for candidates spanning the $Q$ range, the successor model's sampled next states + $z_1, z_2, \dots, z_L$, each rendered as pixels and outlined + \textcolor[HTML]{1a9850}{\textbf{GREEN}} when the reward head puts it in the success set + ($c_k = \sigma(R(z_k)/T) \ge 0.5$) and \textcolor[HTML]{d73027}{\textbf{RED}} otherwise; +\item the \textbf{ensemble} panel: every one of the $N \times P$ sampled states at every hop, coloured by + $c_k$, with the mean per hop --- the Monte-Carlo average that \emph{is} the planner's $Q$. +\end{enumerate} +The fold the numbers come from is +$q_k = c_k + (1-c_k)\,\gamma^{h} q_{k+1}$, $q_L = 0$, and the per-candidate +$Q = \frac{1}{P}\sum_{p} q_0^{(p)}$ --- exactly \code{scorer.last\_q}, the array the planner argmaxes. +Here $h = 1/(1-\beta)$ is the \emph{expected} length of one successor hop in environment frames, not the +action-chunk length (\code{rsm\_scorer.py:410--411} \code{h = 1.0/(1.0-beta)}, \code{:435} +\code{G = gamma ** h}). At the flagship $\beta=0.95$, $\gamma=0.99$ this makes the effective per-hop +discount $\gamma^{h} = 0.99^{20} = 0.8179$ --- worth stating explicitly, because $\gamma^{h}$ is +\emph{not} the discounted-occupancy chain probability $(\gamma-\beta)/(\gamma(1-\beta))$ that the same file +derives at \code{rsm\_scorer.py:539--561}; the flagship cells, and therefore every figure here, use the +$\gamma^{h}$ read-out. + +\section{Where the numbers come from (and what was not touched)} +\begin{itemize} +\item Fold: \code{code/rise\_robomimic/robomimic/algo/rsm\_scorer.py:340} (\code{\_q\_fold\_logit}). +\item Visualisation hook: the same function, \code{return\_trace=False} by default + (\code{rsm\_scorer.py:342,415,501}); the trace dict is appended \emph{last} to the output tuple + (\code{rsm\_scorer.py:566}) so no existing return position moves, and it is filled \emph{after} each + existing computation, so the scoring numerics are untouched. Entry point + \code{RSMScorer.score\_trace} (\code{rsm\_scorer.py:1044}); \code{RSMScorer.score} is unchanged. +\item Proof: \code{code/rise\_robomimic/tests/test\_rsm\_trace.py} --- + \code{test\_trace\_does\_not\_change\_the\_numbers} compares rank / last\_q / last\_q\_logit / + problog / lcb \emph{bit for bit} at depth $1,2,8$ across the prob / logit / prob\_log / + conformal\_lcb read-outs; \code{test\_trace\_is\_internally\_consistent} re-derives the fold hop by + hop from the dumped buffers; \code{test\_flag\_is\_off\_by\_default}. The scorer/planner regression + suites (\code{test\_rsm\_scorer\_logit.py}, \code{test\_rsm\_conformal.py}, + \code{test\_rsm\_planner.py}, \code{test\_rsm\_e2.py}) all pass unchanged. +\item Audit of the \emph{shipped} buffers (not only the unit tests): + \code{scripts/viz/verify\_trace\_fold.py} re-derives, from each of the twelve + \code{runs//stitchviz/*.npz} the figures are drawn from and without importing the scorer, + that $c_k = \sigma(\ell_k)$, that $q_L = 0$, that the per-hop discount fitted out of $q$ and $c$ is + $\gamma^{1/(1-\beta)}$, that $Q = \frac{1}{P}\sum_p q_0^{(p)}$ and that the stored argmax is + $\arg\max Q$. Report: \code{runs/pixdec/TRACE\_FOLD\_CHECK.json}. +\item Temperature: there is no \code{calib.json} beside either flagship checkpoint, so + \code{read\_calib\_temperature} (\code{rsm\_scorer.py:84}) returns $T=1$; GREEN therefore means + $R(z) \ge 0$. +\item State space: \code{cache//PACK.json} pins + $x = \mathrm{clip}((\text{feat}-\mu)/\max(\sigma, 0.01), -10, 10)$ with + $\text{feat} = [z_{\text{DINOv2}}(1536) \mid \text{proprio}(9)]$, i.e.\ \textbf{1545} dimensions + (\code{scripts/viz/nn\_render.py} reproduces it; it matches + \code{PooledDinoState.normalize}, \code{rsm\_scorer.py:201}). Both flagship checkpoints use the + \emph{identity} encoder, so the successor's latent \emph{is} that 1545-d vector and is decodable. +\end{itemize} + +\section{The renderers} +\textbf{(a) Nearest-neighbour retrieval} (\code{scripts/viz/nn\_render.py}) --- for a sampled $z$, the +closest cached frame by cosine in the same z-scored space, printed as \code{cos} under every tile. It is +exact for on-data states and degrades gracefully off-manifold; the printed cosine is the honest measure of +which case a tile is in. Cache rows map to \code{(episode, frame)} through \code{meta.npz} +(\code{ep\_from/ep\_to/ep\_src}, stride 1), so the retrieval is frame-exact. +\textbf{(b) Pixel decoder} (\code{scripts/viz/train\_pixdec.py}) --- a conditional decoder from the +1545-d state (plus a learned task embedding) to both camera images, trained on the union of our sim tasks +with an episode-level train/val split. Concretely +(\code{train\_pixdec.py:153} \code{build\_decoder}): $[x \mid e_\text{task}]$ with $x$ the z-scored 1545-d +successor state and $e_\text{task} \in \mathbb{R}^{32}$ a learned per-task embedding, an MLP stem to a +$512 \times 4 \times 4$ field, then nearest-neighbour upsampling blocks (Conv--GroupNorm--SiLU $\times 2$) +to the target resolution, and \emph{one $3\times3$ output head per camera}, so both views are decoded from +one shared trunk. Loss $= \text{L1} + \text{MSE} + 0.1 \times$ VGG16 perceptual +(\code{train\_pixdec.py:206,340}), AdamW $2{\times}10^{-4}$ with cosine decay, AMP, gradient clip 1.0. +The DINOv2 features in \code{cache/} were computed from the 84 px frames, so at 256 px the decoder +maps those \emph{same} features to the higher-resolution re-render --- the conditioning information is +unchanged, only the output raster is finer. Training is preemptable and resumable: the checkpoint is +written to a temp file and \code{os.replace}d into position with the previous one kept as +\code{ckpt\_prev.pt} (\code{train\_pixdec.py:382}), after a mid-save preemption truncated the only +checkpoint of an earlier 256 px run and cost it 34\,000 steps. + +\section{Decoder fidelity} +\noindent Checkpoint \code{runs/pixdec\_multitask/pixdec/r256\_mt10/ckpt.pt}, step 60000, res 256, 512 held-out frames per task.\\[4pt] +\begin{tabular}{lrrr}\toprule task & val PSNR & val L1 & val LPIPS \\ \midrule +\code{mug\_expert\_suboptimal} & 23.15 & 0.0192 & 0.123 \\ +\code{mug\_mgen} & 22.28 & 0.0253 & 0.151 \\ +\code{square\_expert\_play} & 23.00 & 0.0204 & 0.135 \\ +\code{square\_expert\_suboptimal} & 20.98 & 0.0310 & 0.178 \\ +\code{square\_sub\_20100} & 20.12 & 0.0347 & 0.186 \\ +\code{threading\_expert\_play} & 23.65 & 0.0180 & 0.112 \\ +\code{threading\_mgen} & 23.31 & 0.0216 & 0.121 \\ +\code{two\_piece\_expert\_play} & 26.30 & 0.0129 & 0.080 \\ +\code{two\_piece\_expert\_play\_tipping} & 24.96 & 0.0157 & 0.097 \\ +\code{two\_piece\_expert\_suboptimal} & 26.03 & 0.0134 & 0.080 \\ +\bottomrule\end{tabular} + +\vspace{8pt}\noindent Reference: the same decoder trained at res 84 (\code{r84\_mt10}, step 44001, 512 held-out frames per task).\\[4pt] +\begin{tabular}{lrrr}\toprule task & val PSNR & val L1 & val LPIPS \\ \midrule +\code{mug\_expert\_suboptimal} & 24.63 & 0.0164 & 0.087 \\ +\code{mug\_mgen} & 23.56 & 0.0219 & 0.092 \\ +\code{square\_expert\_play} & 24.44 & 0.0189 & 0.061 \\ +\code{square\_expert\_suboptimal} & 22.52 & 0.0272 & 0.083 \\ +\code{square\_sub\_20100} & 21.25 & 0.0313 & 0.094 \\ +\code{threading\_expert\_play} & 25.34 & 0.0147 & 0.061 \\ +\code{threading\_mgen} & 24.51 & 0.0195 & 0.078 \\ +\code{two\_piece\_expert\_play} & 29.09 & 0.0099 & 0.018 \\ +\code{two\_piece\_expert\_play\_tipping} & 27.36 & 0.0126 & 0.026 \\ +\code{two\_piece\_expert\_suboptimal} & 28.91 & 0.0102 & 0.017 \\ +\bottomrule\end{tabular} + + +\clearpage\subsection*{Decoder fidelity --- \code{mug\_expert\_suboptimal}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_mug_expert_suboptimal.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{mug\_mgen}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_mug_mgen.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{square\_expert\_play}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_square_expert_play.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{square\_expert\_suboptimal}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_square_expert_suboptimal.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{square\_sub\_20100}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_square_sub_20100.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{threading\_expert\_play}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_threading_expert_play.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{threading\_mgen}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_threading_mgen.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{two\_piece\_expert\_play}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_two_piece_expert_play.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{two\_piece\_expert\_play\_tipping}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_two_piece_expert_play_tipping.png} + + +\clearpage\subsection*{Decoder fidelity --- \code{two\_piece\_expert\_suboptimal}} +\includegraphics[width=\linewidth]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/pixdec/fidelity_two_piece_expert_suboptimal.png} + + +\clearpage\subsection*{How far to trust a decoded panel} +Every number on the previous pages is measured on \emph{real encoded latents} from held-out episodes. The panels in this document decode \emph{successor-sampled} latents, which sit off that distribution, so those pages are an optimistic bound on panel fidelity rather than a measurement of it. The task brief named the failure mode to test --- \emph{a decoder that blurs everything into the dataset mean produces beautiful, meaningless panels} --- and testing it needs no ground truth. \code{scripts/viz/decoder\_collapse\_published.py} decodes each root's $L$ chosen hops and compares them against the \textbf{true-future frames of the same root at the same offsets} $t_0 + k\cdot20$ (the column the trees already render), on distance to the dataset-mean image and on diversity \emph{among} the hops. Ratios are hop/real: $1.0$ means indistinguishable from real frames, low means collapsed. The thresholds ($<0.60$ collapse, $\ge0.80$ ok) and the verdict rule were pre-registered in \code{status/SUCCESSOR\_VIZ.md} run 22 before the numbers existed (\code{runs/pixdec/DECODER\_COLLAPSE\_PUBLISHED.json}). + +\begin{center}\small\begin{tabular}{lrrrll}\toprule +task & dist-to-mean & pairwise & cell & verdict & unseen anchors \\\midrule +Square-Cov & 0.812 & 0.776 & 0.776 & PARTIAL & 0.679 \\ +Piece-Cov & 1.011 & 0.850 & 0.850 & OK & 0.439 \\ +\bottomrule\end{tabular}\end{center} + +\textbf{Task-level verdict: \code{PARTIAL}} --- 0 of 2 tasks below $0.60$. The last column is the same statistic that \code{scripts/viz/decoder\_transfer.py} measured on the \emph{unseen} anchors, where it returned \code{COLLAPSE}. On the roots these figures actually use it is consistently higher: the published trees are rooted in \emph{seen} episodes. The mean-collapse found on unseen anchors therefore does not transfer to these panels at full strength --- a difference in subject, not a contradiction; both numbers stand, for different sets of latents. + +The question a reader actually has is per panel, so the same statistic is computed for each published tree with \emph{exact} all-pairs over its hops (not sampled): \textbf{2 of 12} panels collapse, 2 partial, 8 ok. Each tree's own number is printed in its caption. + +\begin{center}\small\begin{tabular}{llrrrl}\toprule +task & root & dist-to-mean & pairwise & cell & verdict \\\midrule +Piece-Cov & \code{demo\_143\_t0154} & 1.060 & 0.502 & 0.502 & COLLAPSE \\ +Piece-Cov & \code{demo\_99\_t0057} & 1.024 & 0.555 & 0.555 & COLLAPSE \\ +Square-Cov & \code{demo\_102\_t0145} & 0.635 & 0.702 & 0.635 & PARTIAL \\ +Square-Cov & \code{demo\_84\_t0390} & 0.701 & 2.003 & 0.701 & PARTIAL \\ +Square-Cov & \code{demo\_160\_t0165} & 0.830 & 1.357 & 0.830 & OK \\ +Piece-Cov & \code{demo\_106\_t0035} & 1.159 & 0.848 & 0.848 & OK \\ +Piece-Cov & \code{demo\_171\_t0244} & 0.867 & 4.039 & 0.867 & OK \\ +Square-Cov & \code{demo\_221\_t0249} & 0.901 & 1.514 & 0.901 & OK \\ +Square-Cov & \code{demo\_36\_t0056} & 0.965 & 0.902 & 0.902 & OK \\ +Square-Cov & \code{demo\_110\_t0104} & 0.908 & 1.295 & 0.908 & OK \\ +Piece-Cov & \code{demo\_129\_t0084} & 0.967 & 0.954 & 0.954 & OK \\ +Piece-Cov & \code{demo\_102\_t0198} & 0.993 & 1.228 & 0.993 & OK \\ +\bottomrule\end{tabular}\end{center} + +So the caveat is \textbf{per panel, not global}: \code{demo\_143\_t0154} (0.502), \code{demo\_99\_t0057} (0.555) below $0.60$ of the matched real control on hop-to-hop diversity. Those panels should be read for \emph{route shape} --- which candidate chains toward green, which is what the figure is for --- and not for per-hop pixel detail, which is largely decoder prior there. The remaining panels carry hop diversity comparable to real frames at the same offsets. + +Two caveats on the instrument itself. A distance-to-mean ratio \emph{above} $1.0$ on some roots means those decodes sit further from the dataset-mean image than the real control, so the panels are not being flattened toward the mean image; what varies between roots is diversity between hops. And the true-future control is clipped at the episode end (Square-Cov 8 of 48, Piece-Cov 15 of 48), where a clipped control repeats its last frame, deflating its own diversity and so flattering the hop ratio. LPIPS is not reported: \code{lpips} is not importable in this environment. + +\paragraph{The curated figures this document recommends.} They are the \code{\_split2b256} trees, captured in \code{runs//stitchviz\_split2/} rather than in the directory the table above reads, and a root's trace name is \emph{identical} across captures --- so a name-keyed caption would print one capture's number under another capture's image. The note is therefore keyed on (variant, name) and prints nothing for an unmeasured capture. Same instrument, same pre-registered thresholds. + +\begin{center}\small\begin{tabular}{llrrrl}\toprule +task & root & dist-to-mean & pairwise & cell & verdict \\\midrule +Piece-Cov & \code{demo\_6\_t0180} & 1.018 & 3.615 & 1.018 & OK \\ +Piece-Cov & \code{demo\_153\_t0112} & 0.988 & 2.592 & 0.988 & OK \\ +Square-Cov & \code{demo\_172\_t0038} & 0.979 & 0.985 & 0.979 & OK \\ +Piece-Cov & \code{demo\_80\_t0025} & 1.061 & 0.968 & 0.968 & OK \\ +Piece-Cov & \code{demo\_129\_t0084} & 0.980 & 0.954 & 0.954 & OK \\ +Square-Cov & \code{demo\_36\_t0056} & 0.950 & 0.902 & 0.902 & OK \\ +Square-Cov & \code{demo\_181\_t0135} & 0.749 & 1.265 & 0.749 & PARTIAL \\ +Piece-Cov & \code{demo\_136\_t0154} & 0.965 & 0.644 & 0.644 & PARTIAL \\ +Piece-Cov & \code{demo\_18\_t0096} & 0.960 & 0.619 & 0.619 & PARTIAL \\ +Piece-Cov & \code{demo\_198\_t0166} & 1.087 & 0.425 & 0.425 & COLLAPSE \\ +Piece-Cov & \code{demo\_64\_t0192} & 1.127 & 0.305 & 0.305 & COLLAPSE \\ +\bottomrule\end{tabular}\end{center} + +2 of these 11 roots resolve to a trace file that is \emph{byte-identical} to one measured in the table above (the curated directory is populated with symlinks), so where the two tables agree on a root they agree by construction and say nothing about capture-to-capture stability of this statistic. That stability is measured below. + + +\subsection*{How much of that number is the root, and how much is the draw?} +The numbers above are each measured on \emph{one} capture. The shipped capture protocol leaves the proposer unseeded (\code{stitch\_trace.py --proposer-seed} defaults to \code{None}), so re-running it redraws the $N$ candidate chunks and can select a different argmax candidate, i.e.\ a different chain of hops. Five roots were re-captured independently (\code{scripts/viz/xdev\_capture.sh}, run 20) in arms that separate the two sources: \emph{unseeded} arms reproduce the shipped protocol, while \code{--proposer-seed 0} arms hold the candidate draw fixed so that what is left is device numerics. Re-measuring all of them with the same instrument (\code{runs/pixdec/DCP\_NOISE.json}) gives the stability of the statistic itself. The threshold for calling it resolvable ($<0.02$) or not ($\ge0.10$) was pre-registered in \code{status/SUCCESSOR\_VIZ.md} run 24 before these numbers existed. + +\begin{center}\small\begin{tabular}{llrrrl}\toprule +root & re-captures (unseeded) & spread & device only & published & inside? \\\midrule +\code{Square-Cov demo\_36\_t0056} & 0.21, 0.53, 0.58 & 0.368 & 0.002 & 0.902 & \textbf{no} \\ +\code{Piece-Cov demo\_159\_t0413} & 0.82, 1.10, 1.10 & 0.288 & 0.299 & --- & --- \\ +\code{Square-Cov demo\_212\_t0141} & 0.66, 0.70, 0.75 & 0.098 & 0.085 & --- & --- \\ +\code{Piece-Cov demo\_80\_t0025} & 0.91, 0.96, 0.99 & 0.077 & 0.067 & 0.968 & yes \\ +\code{Piece-Cov demo\_18\_t0096} & 0.60, 0.60, 0.61 & 0.011 & 0.108 & 0.619 & \textbf{no} \\ +\bottomrule\end{tabular}\end{center} + +\textbf{Verdict: \code{MARGINAL}} --- the median re-capture spread is $0.098$, against a collapse/ok band of width $0.20$. So a per-panel cell is \emph{not} a stable property of the root: it is a property of the capture the panel was rendered from. Two consequences, stated plainly. First, 1 of 5 re-captured roots change verdict across draws, and it is \code{demo\_36\_t0056}. Second, on 2 of the 3 roots that are also published, the published cell falls \emph{outside} the range of its own re-captures --- \code{demo\_36\_t0056} prints $0.902$ while its three re-captures give $0.21$--$0.58$. Device numerics alone (draw held fixed) move the cell by a median of $0.085$ and by up to $0.299$, which is the same order as redrawing --- a tiny floating-point difference can flip which candidate is argmax, and the chain follows. + +One obvious explanation was tested and did \emph{not} hold. The shipped figures were chosen (run 19) from 171 captures on a frontier built from \code{cand\_any\_green}, so a published capture could be a selected maximum that regresses on re-capture. Over 48 paired captures the rank correlation between \code{cand\_any\_green} and the fidelity cell is $\rho=0.32$ (and $\rho=0.02$ for \code{frac\_green}): \code{NO\_SELECTION\_SIGNAL}. The figure with the largest gap is itself a low-\code{cand\_any\_green} capture, so its high fidelity number was not bought by the selection. The honest reading is draw variance. $n$ is small and the captures are not independent across roots, so this is a direction check, not an estimate; no $p$-value is claimed. + +What this does \emph{not} change: every printed cell is a correct measurement of the trace its own panel was rendered from, so a reader judging \emph{the image in front of them} is correctly informed. What it changes is the generalisation --- a panel's number should not be read as `this root decodes well', and a verdict within roughly $0.05$ of a threshold should be treated as indicative. Per the rule pre-registered before these numbers existed, no figure, capture, threshold or printed verdict was changed by this measurement. + + +\subsection*{Then is any statistic stable enough to \emph{choose} a figure on?} +The measurement above says a per-capture number moves. That raises the prior question for anyone reading these figures as evidence: the roots shown here were \emph{selected}, so is the selection reproducible? A statistic can only order roots if its re-capture noise is small against its spread \emph{between} roots. Over the 202 draws of 46 distinct roots in \code{runs/pixdec/CAND\_GREEN\_CENSUS\_xdev.json} (173 after de-duplicating traces by md5 --- the curated directories hold symlinks, and counting a copy as a replicate would deflate the noise and make every statistic look stable), 30 roots carry two or more genuinely distinct captures. For each statistic we report \code{ICC} (the share of the variance that is between-root rather than between-capture), the split-half rank correlation over roots (draw one capture per root into each half, 2000 times), and the overlap of the top 3 --- which is the part a figure choice actually uses. Thresholds and the statistic list were pre-registered in \code{status/SUCCESSOR\_VIZ.md} run 25 before the numbers existed. + +\begin{center}\small\begin{tabular}{lrrrrl}\toprule +statistic & ICC & split-half $\rho$ & top-3 & top-1 & verdict \\\midrule +\code{frac\_green} & 0.994 & 0.983 & 1.000 & 0.394 & \textbf{STABLE} \\ +\code{q\_of\_greenless} & 0.804 & 0.848 & 0.797 & 0.429 & \textbf{STABLE} \\ +\code{hop\_green (last)} & 0.965 & 0.948 & 0.762 & 1.000 & \textbf{STABLE} \\ +\code{Q\_max} & 0.978 & 0.981 & 0.720 & 1.000 & \textbf{STABLE} \\ +\code{hop\_rise} & 0.974 & 0.917 & 0.717 & 0.358 & \textbf{STABLE} \\ +\code{Q\_spread} & 0.968 & 0.972 & 0.631 & 0.377 & MARGINAL \\ +\code{top\_cand\_share} & 0.430 & 0.766 & 0.570 & 0.263 & MARGINAL \\ +\code{cand\_any\_green} & 0.965 & 0.918 & 0.328 & 0.107 & MARGINAL \\ +\code{argmax\_is\_green} & 0.848 & 0.877 & 0.122 & 0.040 & MARGINAL \\ +\bottomrule\end{tabular}\end{center} + +\textbf{Verdict: \code{STABLE\_STAT\_EXISTS}.} 5 of the statistics are \code{STABLE} and none is \code{UNUSABLE}, so a defensible selection is possible. But the statistic these figures were \emph{actually} selected on, \code{cand\_any\_green}, is not one of them, and the way it fails is the interesting part: it ranks the roots almost perfectly ($\mathrm{ICC}=0.965$, $\rho=0.918$) and still only reproduces $0.33$ of its own top~3 across captures, with the single best root agreeing $11\%$ of the time. The ordering is reproducible everywhere \emph{except} at the top, which is the only place a figure choice reads it: the leading roots are bunched within the capture noise. By contrast \code{frac\_green} reproduces its top~3 exactly ($1.000$) with a median re-capture range of $0.0073$. + +Two cautions on reading the table. A \emph{set} being reproducible does not make its \emph{order} reproducible: \code{frac\_green} returns the same three roots every time but names the same single winner only $39\%$ of the time, so these figures are best presented as exemplars rather than as `the best'. And the top-$k$ columns break ties independently at random in each half; with a deterministic tie-break a binary statistic such as \code{argmax\_is\_green} scores a perfect top~3 purely from the tie-break, which is how it first appeared here before the instrument was corrected. + +What this does \emph{not} change: nothing was re-picked. Every figure, capture, checkpoint, caption setting and scoring numeric in this document is exactly as it was before this measurement, per the rule pre-registered with it. Whether to re-select the figures on \code{frac\_green} is left open. + +\textbf{But a stable statistic is only half of what a defensible choice needs.} The measurement above holds the statistic fixed and varies the capture. The complementary term --- hold the capture fixed and vary the \emph{statistic} --- had never been measured here, and it is the one that decides whether naming \code{frac\_green} settles anything. \code{scripts/viz/stat\_agreement.py} draws one capture per root and reads \emph{both} statistics of a pair off \emph{that same} capture, so the only thing differing is the statistic (2000 draws per pair; computing this from per-root means instead would average the capture noise away and inflate the agreement, so that variant is reported in the JSON but is not the verdict). Over the 6 pairs of the \code{STABLE} statistics the median same-capture top-3 overlap is $B=0.367$, against the within-statistic $W=0.762$ of the table above and a chance level of $0.100$ at 30 roots. Pre-registered verdict: \textbf{\code{STATISTIC\_CHOICE\_DOMINATES}} --- \emph{which statistic you pick moves the chosen figures about twice as far as re-capturing them does.} + +Two consequences for how this document should be read. First, the two statistics that each reproduced their \emph{own} single best root $100\%$ of the time, \code{hop\_green (last)} and \code{Q\_max}, name the same root \textbf{$0\%$} of the time as each other: that perfect self-agreement was self-consistency, not evidence that a single best figure exists. Second, the \code{STABLE} statistics are not one construct but three --- \code{Q\_max} with \code{Q\_spread} overlap $0.916$, \code{frac\_green} with \code{hop\_green (last)} $0.743$, while \code{hop\_rise} agrees with none of the others above $0.000$, i.e.\ at chance. So `pick a stable statistic' does not remove the arbitrariness from the selection; it moves it from the draw to the metric. A selection is defensible only once the \emph{criterion} --- what makes a tree a good illustration --- is fixed first, which is a judgement about the paper and not a measurement. (\code{q\_of\_greenless} is \code{STABLE} above but is excluded here: it is undefined on 10 of the 30 roots, and a paired same-capture comparison needs a common root set.) As a check on the instrument, the constant statistic \code{cand\_all\_green} lands at exactly the $0.100$ chance level against every partner, as it must. Again nothing was re-picked and no number in this document changed. + + +\subsection*{Do these panels illustrate the read-out the paper reports?} +Every panel in this document is captured and captioned at the \textbf{fold} read-out $q_k = c_k + (1-c_k)\gamma^h q_{k+1}$, $q_L = 0$ ($\beta=0.95$, $L=8$, \code{prob}). The paper has since \textbf{retired} that read-out (\code{docs/tex/flagship\_paper.tex:162}: \emph{``it folded a FIXED $L$ hops with $q_L{=}0$, which is an absorbing hitting probability over a truncated horizon rather than the $\gamma$-discounted occupancy \ldots{} the corrected read-out is the coin-terminated chain''}), and \code{docs/MASTER\_TABLE.md:58} excludes 865 fold arms from its RSM column for the same reason. So the $Q$ printed next to every branch below, and the arg-max marker, are the \emph{retired} estimator's --- and whether they survive the correction had never been checked. + +\code{scripts/viz/readout\_audit.py} recomputes the chain's analytic form \code{chain\_rb} (\code{rsm\_scorer.py:658--672}), $Q = \sum_k w_k c_k$ with $w_k = (1-p)p^k$ and $p = (\gamma-\beta)/(\gamma(1-\beta)) = 0.808$, from the SAME committed captures: the fold walk and the chain walk have the same structure, so the correction needs no new sampling. Gate first --- the published fold $Q$ is reproduced from the captured memberships to $\max|\mathrm{dev}| = 9.8e-08$ over the 12 panels and $c = \sigma(\mathrm{lg})$ to 8.8e-08, which confirms the captions' $T=1$. The honest limit, stated before the numbers: these captures are 8 hops deep, so the deepest computable cap is 7 while the flagship cap at these settings is \textbf{33}; cap 7 lumps the tail mass 0.225 onto hop 7 instead of spreading it over hops 7--33, and hops beyond 7 were never sampled by these panels, so nothing here extrapolates past cap 7. + +\textbf{1. The arg-max marker is a real value decision, not a tie-break: \code{ARGMAX\_UNIQUE}.} All 12 panels carry exactly one candidate bit-exactly at the maximum. This had to be checked: \code{flagship\_paper.tex:178} reports 35--50 of the 128 candidates \emph{bit-identical} at the maximum on Pc-C, one of the two tasks shown here. It does not reproduce on these roots, which are deliberately chosen \emph{failure} states where the memberships sit far from 1 and the fold never saturates --- a property of the states this document picked, not a refutation of the paper's diagnostic. One panel must still be read with care: on \code{square\_expert\_play demo\_110 t0104} all 128 candidates lie within $10^{-6}$ of the maximum ($Q_{\max} = 0.000$), so its winner is settled by float noise even though it is bit-exactly unique. + +\textbf{2. The corrected read-out moves the top of the ranking: \code{READOUT\_PARTIAL} at cap 7.} The median Spearman $\rho$ between the fold ordering and the chain ordering of the 128 candidates is \textbf{0.975}, but the median top-3 overlap is \textbf{0.667} and \textbf{5 of the 12 panels mark a candidate the chain does not choose}. The disagreement sits exactly where a figure reads the estimator --- at the top --- the same failure mode the selection statistic shows above. It splits by task: arg-max kept \code{square\_expert\_play} 5/6, $\rho\in[0.963,0.996]$; \code{two\_piece\_expert\_play} 2/6, $\rho\in[-0.250,1.000]$. Two independent audits now land on the same panel: \code{two\_piece\_expert\_play demo\_143 t0154}, this document's second recommended figure, is both the lowest-fidelity panel and the one whose chain ordering is \emph{anti}-correlated with the published fold ordering ($\rho = -0.250$, top-3 overlap 0.000). + +The verdict is \textbf{not depth-stable}, which is reported rather than smoothed: at cap 3 and cap 5 it reads \code{READOUT\_REORDERS} ($\rho = 0.655$ and $0.823$, 3/12 arg-maxes kept), so agreement rises monotonically with depth across the computable range; whether it keeps rising to the flagship cap 33 cannot be measured from these captures and is not guessed. \textbf{What does not change:} the green/red outlines are $c_k \ge 0.5$ from the reward head alone and are identical under both read-outs, so every panel's success/failure structure --- the thing these figures were made to show --- is untouched. What a reader should \emph{not} do is read the printed $Q$ or the arg-max marker as the number the paper's flagship estimator would produce. Nothing was re-rendered, re-captured or re-picked; re-rendering under the chain is a figure decision and is open. + + +\subsection*{Does that disagreement survive at the flagship cap?} +The audit above stops at cap 7, because every capture in this document is 8 hops deep, and it found agreement rising monotonically over caps 3/5/7 --- which invites the reading that cap 7 is a truncation artefact and the flagship cap 33 would agree. \code{scripts/viz/depth\_readout.py} measures the rest of the curve. The published clouds cannot be regenerated (\code{runs/pixdec/FIG\_REPRO.json}: \code{published\_was\_seeded: false}), so the same 12 \emph{roots} are captured twice into \code{runs//stitchviz\_cap33/} under an explicit proposer seed --- once at depth 8, once at depth 34. The fold draws its flow noise sequentially (\code{rsm\_scorer.py:413--417}), so with the candidates pinned the deep capture's first 8 hops must be the shallow one's bit for bit; they are (candidate arrays and memberships both to $\max|\mathrm{dev}| = 0$, and the shallow capture's stored $Q$ is reproduced from the deep capture's own memberships to 8.6e-08). That is what makes fold@$L{=}8$ and chain@cap $33$ comparable on ONE trajectory set rather than two. The family also replicates the previous subsection: at cap 7 it gives $\rho = 0.949$ with 7/12 arg-maxes kept against 0.975 and 7/12 on the published trees (\code{REPLICATES}), so what follows transfers. + +\textbf{The trend does not continue --- \code{DEPTH\_REVERSES}.} Median Spearman $\rho$ against the fold, by cap: 3: 0.662, 5: 0.834, 7: 0.949, 11: 0.904, 15: 0.851, 23: 0.864, 33: 0.851. It \emph{peaks at cap 7} and then falls: at the flagship cap 33 it is \textbf{0.851}, \emph{below} cap 7's 0.949, and the arg-max count follows the same shape (3: 4/12, 5: 5/12, 7: 7/12, 11: 7/12, 15: 6/12, 23: 6/12, 33: 6/12). Run 27's monotone rise was therefore the approach to a maximum, not convergence to the paper's estimator --- and the maximum sits where it does for a structural reason: the chain at cap 7 integrates exactly the hops $0..7$ that the fold at $L=8$ folds, so cap 7 is the \emph{horizon-matched} cap. Past it the chain weights hops this document's panels never show, and the two estimators drift apart. + +At the flagship cap the disagreement is where it always was --- at the top. Median top-3 overlap is \textbf{0.667} and \textbf{6 of the 12 roots} have a fold arg-max the chain does not choose (\code{square\_expert\_play} 3/6; \code{two\_piece\_expert\_play} 3/6); the task split the previous subsection reports does \emph{not} survive the correction (at cap 7 this family splits \code{square\_expert\_play} 4/6; \code{two\_piece\_expert\_play} 3/6, at cap 33 it is even). Nor is cap 7 a usable proxy for cap 33 in its own right: chain@cap 7 and chain@cap 33 rank the 128 candidates at median $\rho = 0.805$ and agree on the arg-max on only 7 of 12 roots. The added hops explain the drift: the sampled membership rate has median 0.0158 over hops 0--7 but 0.0060 over hops 8--33, so the extra chain mass sits almost entirely on states the reward head calls failures --- the same decay-with-depth the anchoring section reports, now seen through the estimator. + +So the caveat in the previous subsection \textbf{stands at the flagship cap, and is slightly stronger there}: read the printed $Q$ and the arg-max marker as the retired fold's, not the paper's, and do not assume the gap closes with depth. Worst root of this family: \code{two\_piece\_expert\_play demo\_102 t0198} ($\rho = -0.168$ at cap 33). \textbf{Limit, stated:} these are new candidate clouds, so this re-measures the \emph{estimator}, not the twelve published panels' own numbers, which stay exactly as the previous subsection reports them; and the green/red outlines, the images and every fidelity number are untouched by either read-out. + + +\subsection*{Does that cap-7 peak generalise?} +The subsection above explains its peak \emph{structurally}: cap 7 is the horizon-matched cap, where the chain integrates exactly the hops the fold at $L{=}8$ folds. A structural explanation has to survive a different family, so \code{scripts/viz/depth\_readout\_unseen.py} runs the same recipe on the \textbf{unseen} family: 32 held-out anchors (\code{unseen\_anchors.py}, 8 per task) over 4 tasks, captured twice into \code{runs//stitchviz\_cap33\_unseen/} at depth 8 and 34 under proposer seed 270029. Two of those tasks --- \code{square\_sub\_20100} (\code{Mbest}), \code{two\_piece\_expert\_suboptimal} (\code{Mproghead}) --- the published family never used, and they carry a \emph{different successor checkpoint and reward head}, so this varies the roots, the episode split and the model at once. Same two gates, both passed: candidate arrays and hop-$0..7$ memberships bit-identical between the depths ($\max|\mathrm{dev}| = 0$), and the shallow capture's stored $Q$ reproduced from the deep capture's own memberships to 1.1e-07. + +\textbf{Verdict \code{PEAK\_ELSEWHERE\_STILL\_REVERSES}}, replacing the pre-registered \code{PEAK\_AT\_HORIZON\_MATCH}. Median Spearman $\rho$ against the fold, by cap: 3: 0.922, 5: 0.920, 7: 0.982, 11: 0.973, 15: 0.966, 23: 0.967, 33: 0.967; the pooled curve peaks at cap \textbf{7}, against cap 7 on the published family (3: 0.662, 5: 0.834, 7: 0.949, 11: 0.904, 15: 0.851, 23: 0.864, 33: 0.851). Arg-maxes kept: 3: 15/32, 5: 19/32, 7: 16/32, 11: 16/32, 15: 15/32, 23: 15/32, 33: 15/32. + +\textbf{The degeneracy that decides it.} 10 of the 32 roots --- including \emph{all} of \code{square\_sub\_20100} --- never have the reward head fire once over the whole depth-34 rollout: $c \ge 0.5$ is never true, which is exactly the green/red rule the panels outline with, so such a tree would be drawn entirely red. On those roots the fold and the chain are both monotone functions of the same underflowing $(1-c)$ product (fold spans reach $10^{-40}$), so their ranks agree \emph{trivially} and they score $\rho = 1.000$ at every cap. Screened out, the curve reads 3: 0.782, 5: 0.853, 7: 0.896, 11: 0.897, 15: 0.860, 23: 0.871, 33: 0.871 over $n=22$ and peaks at cap \textbf{11} rather than 7, and only 1 of 3 scorable tasks peak at the horizon-matched cap. Run 28's cap-7 peak is therefore best read as a property of those twelve published roots, \emph{not} a structural property of the estimator pair. Degenerate does not always mean a tiny $Q$: the largest fold $Q$ among them is 0.338, a root where $c$ accumulates but never crosses the 0.5 outline threshold --- the outline and the magnitude of $Q$ are different things. The screen is \emph{additive}: re-running the patched instrument reproduced every pre-registered field byte-identically. + +Per task, where the median-$\rho$ curve peaks and what it costs at the flagship cap (\emph{scr.} = degeneracy-screened): + +\begin{center}\small +\begin{tabular}{llrrlrrrr} +\hline +task & ckpt & $n$ & peak & scr. & $\rho@7$ & $\rho@33$ & kept@7 & kept@33 \\ +\hline +\code{square\_expert\_play} & \code{L40best} & 8 & \textbf{7} & 7 & 0.995 & 0.911 & 4/8 & 3/8 \\ +\code{square\_sub\_20100}$^{\dagger}$ & \code{Mbest} & 8 & \textbf{3} & --- & 1.000 & 1.000 & 8/8 & 7/8 \\ +\code{two\_piece\_expert\_play}$^{*}$ & \code{L40best} & 8 & \textbf{11} & 11 & 0.862 & 0.871 & 2/8 & 2/8 \\ +\code{two\_piece\_expert\_suboptimal}$^{*}$ & \code{Mproghead} & 8 & \textbf{3} & 3 & 0.785 & 0.859 & 2/8 & 3/8 \\ +\hline +\end{tabular}\end{center} + +{\footnotesize $^{\dagger}$ every root degenerate (reward head never fires), so the task is unscorable for this comparison; $^{*}$ some roots degenerate and screened out.\par} + +1 of the 4 tasks peak at the horizon-matched cap and 1 of 4 fall from cap 7 to cap 33. The sampled membership rate decays with depth here too --- median 0.0079 over hops $0..7$ against 0.0009 over hops $8..33$ --- so the extra chain mass again lands on states the reward head calls failures. \textbf{Limit, stated:} this is a second family measured with the same instrument, so it speaks to the \emph{estimator pair}, not to the twelve published panels, whose per-panel numbers stay exactly as the two subsections above report them; nothing here re-renders a figure or changes a caption. + + +\subsection*{Is that all-red tree the successor's doing or the reward head's?} +The subsection above turns on roots where the reward head never fires. Two very different things produce that, and only one of them is a finding: the successor's samples may never reach the success set from those anchors (an all-red tree then \emph{means} something), or the head may never return $c \ge 0.5$ on \emph{any} real state, in which case the green/red outline carries no information on that task at all. \code{scripts/viz/head\_recall.py} decides between them \emph{without a rollout}: the outline rule is $c = \sigma(R(z)/T) \ge 0.5$, which for any $T > 0$ is exactly $R(z) \ge 0$ (\code{rsm\_scorer.py:351}), so each checkpoint's own encoder and reward head are run over \emph{every} frame of its cache --- on-manifold real states --- and the green rate read off directly. Positives are the head's own training target, rebuilt by instantiating \code{LiberoRSMData} from the checkpoint's stored \code{config} (\code{train\_rsm.py:1170}; all four cells \code{reward\_mode=dense}, so a positive is any frame of an episode RISE's reward marks successful, \code{data.py:241--320}). + +\textbf{Verdict \code{ROLLOUT\_NOT\_HEAD}.} On \code{square\_sub\_20100} (\code{M/ckpt\_best}, step 100000) --- the task whose held-out roots were \emph{all} degenerate --- the head fires on \textbf{84.9\%} of its own 3725 real positive frames, with a maximum logit of $+46.2$ and 3342 of 39473 cached frames green. The head works. What fails is the walk: over $34 \times 128 \times 16$ sampled states from those anchors it never once crossed the same threshold, so the all-red trees are the \emph{successor's} reach, not a broken read-out, and they are the same anchoring decay the pixel-space subsections measure, seen through the membership instead of the images. + +Every cell, with the two published figure tasks as the positive control: + +\begin{center}\small +\begin{tabular}{llrrrrr} +\hline +task & ckpt & green@pos & green@neg & train & val & max $R$ \\ +\hline +\code{square\_expert\_play} & \code{L40/best} & 0.998 & 0.011 & 1.000 & 0.976 & $+129.3$ \\ +\code{two\_piece\_expert\_play} & \code{L40/best} & 0.988 & 0.014 & 1.000 & 0.891 & $+234.3$ \\ +\code{square\_sub\_20100} & \code{M/best} & 0.849 & 0.005 & 1.000 & 0.311 & $+46.2$ \\ +\code{two\_piece\_expert\_suboptimal} & \code{M/proghead} & 0.570 & 0.401 & 0.566 & 0.588 & $+57.8$ \\ +\hline +\end{tabular}\end{center} + +The control passes with room --- \code{square\_expert\_play} 0.998, \code{two\_piece\_expert\_play} 0.988 --- and no cell is anti-ordered (0 of 4), so the instrument is reading the head the captures read. Two further things it found, both worth a caption if either task is ever rendered. \textbf{(i) The head memorises on the cell under test:} its positive-set green rate is 1.000 on training episodes and 0.311 on held-out ones, a gap of 0.689, against 0.024 and 0.109 on the two published cells. The unseen family is held-out by construction, so the head is in its weak regime there --- though 0.311 is still far from zero, which is why the rollout, not the head, remains the explanation. \textbf{(ii) The two success labels disagree on 2 of the 4 cells.} On \code{square\_sub\_20100} the environment's replayed success (\code{goal.npz}, \code{label = env\_success\_replay}) fires in \emph{all 120} episodes while RISE's own reward --- the label the head trains on --- marks only 20, so a raw env-goal recall reads 0.155 and looks like a broken head. Restricted to the 20 episodes where the two labels agree it is \textbf{0.90}. The green outline on that task is RISE's reward, not the simulator's, and on 100 of 120 episodes those are different claims. + +\textbf{Limit, stated:} this measures the head on cached real states; it re-renders nothing and revisits no published per-panel number. Its consequence for the figure set is narrow and specific --- an all-red tree on \code{square\_sub\_20100} would be honest rather than broken, and would need the label caveat above printed next to it. + +\subsection*{Which read-out is safe to outline a tree with?} +The table above records one cell whose head is barely ordered: \code{two\_piece\_expert\_suboptimal} \code{M/proghead} greens 0.570 of its positives but also 0.401 of its negatives, a margin of only 0.168. A tree outlined by that head is close to a coin flip, so it matters whether the weakness belongs to the \code{proghead} read-out or to the task. Both \code{ckpt\_best.pt} and \code{ckpt\_proghead.pt} exist for 6 tasks, so the confound resolves exactly: same cache, same frames, same rebuilt target, only the checkpoint differs. The ordering statistic is the AUROC of the logit against the head's own positive set, which is threshold-free and so does not rest on where $R$ crosses $0$. + +\textbf{Verdict \code{CHECKPOINT\_KIND}: it is the read-out, on every one of the 6 pairs.} + +\begin{center}\small +\begin{tabular}{lrrrrr} +\hline +task & AUROC \code{best} & AUROC \code{proghead} & $\Delta$ & margin \code{best} & margin \code{proghead} \\ +\hline +\code{square\_expert\_play} & 0.9981 & 0.5766 & $+0.4215$ & 0.986 & 0.181 \\ +\code{square\_expert\_suboptimal} & 0.9963 & 0.4864 & $+0.5099$ & 0.962 & -0.013 \\ +\code{two\_piece\_expert\_play} & 0.9981 & 0.6551 & $+0.3430$ & 0.977 & 0.244 \\ +\code{two\_piece\_expert\_suboptimal} & 0.9804 & 0.6497 & $+0.3306$ & 0.906 & 0.168 \\ +\code{two\_piece\_expert\_play\_tipping} & 0.9999 & 0.7124 & $+0.2875$ & 0.993 & 0.434 \\ +\code{mug\_expert\_suboptimal} & 0.9983 & 0.7305 & $+0.2678$ & 0.984 & 0.357 \\ +\hline +\end{tabular}\end{center} + +Every \code{best} head is above 0.980 and every \code{proghead} head below 0.730; the worst \code{best} cell is \code{two\_piece\_expert\_suboptimal} at 0.9804, which is still 0.3306 above its own \code{proghead} twin. One is \emph{anti}-ordered --- \code{square\_expert\_suboptimal} at 0.4864, below chance. Gate G2 required an identical frame count and identical positive set on both sides of each pair, and 0 of 6 pairs were dropped. The \code{proghead} logits sit in a band around zero (median +0.315 on positives against -0.615 on negatives for the cell under test), which is exactly what a near-random outline looks like. + +\textbf{Consequence for the figure set, stated plainly:} the three \code{unseen\_two\_piece\_expert\_suboptimal\_*\_Mproghead\_*} panels are outlined by a head with AUROC 0.6497. Their geometry, their $Q$ values and their fidelity numbers are unaffected --- those come from the successor and the decoder --- but their \emph{green/red} is close to uninformative, and the \code{M/best} head on the same task and the same cache reaches 0.9804. Either those panels carry this caveat or they are re-rendered under \code{M/best}; that is the owner's call and nothing here changes them. + +\subsection*{Whose success is the green outline? A census over the figure family} +Run 31 found by accident that the caches carry two different success labels and that they are not the same claim. It measured four cells; the family has 10. \code{scripts/viz/label\_census.py} reads both labels for every one of them --- \code{goal.npz:goal\_at\_state} (the environment replayed) against \code{meta.npz:ep\_success} (RISE's own reward, \code{PACK.json}: \code{rewards.max() > 0}, \emph{the label every reward head trains on and therefore the one every green outline means}) --- with no checkpoint loaded, so the numbers are exact. + +\begin{center}\small +\begin{tabular}{lrrrrrl} +\hline +task & $n_{ep}$ & RISE & env & both & Jaccard & \code{goal.npz} label \\ +\hline +\code{square\_expert\_suboptimal} & 200 & 100 & 200 & 100 & 0.500 & \code{env\_success\_replay} \\ +\code{square\_sub\_20100} & 120 & 20 & 120 & 20 & 0.167 & \code{env\_success\_replay} \\ +\code{square\_expert\_play} & 424 & 200 & 200 & 200 & 1.000 & \code{env\_success\_replay} \\ +\code{two\_piece\_expert\_suboptimal} & 120 & 20 & 3 & 0 & 0.000 & \code{placed\_and\_settle} \\ +\code{two\_piece\_expert\_play} & 399 & 200 & 1 & 1 & 0.005 & \code{placed\_and\_settle} \\ +\code{two\_piece\_expert\_play\_tipping} & 704 & 200 & 1 & 1 & 0.005 & \code{placed\_and\_settle} \\ +\code{mug\_expert\_suboptimal} & 120 & 20 & 14 & 14 & 0.700 & \code{env\_success\_replay} \\ +\code{threading\_expert\_play} & 450 & 250 & 234 & 234 & 0.936 & \code{env\_success\_replay} \\ +\code{mug\_mgen} & 224 & 124 & --- & --- & --- & \emph{not\_measurable} \\ +\code{threading\_mgen} & 450 & 300 & --- & --- & --- & \emph{not\_measurable} \\ +\hline +\end{tabular}\end{center} + +\textbf{7 of the 8 measurable tasks disagree}, and the reason is structural rather than noisy: \code{goal.npz} is not one instrument. On the \code{square*}, \code{mug*} and \code{threading*} caches its \code{label} is \code{env\_success\_replay}; on all three \code{two\_piece*} caches it is \code{placed\_and\_settle}, a stricter criterion which fires in 1 of 399 episodes on \code{two\_piece\_expert\_play} against RISE's 200. The two extremes are worth naming. \textbf{\code{square\_expert\_play} is the only task where the two labels agree exactly} (Jaccard $1.000$; all 2211 env-goal frames sit in RISE-success episodes) --- which is the published figure task, so its green outline is the simulator's success as well as RISE's. At the other end \code{square\_sub\_20100} agrees on only 0.167 of its episodes. The 2 \code{*\_mgen} caches carry no \code{goal.npz} at all, so on those tasks the environment's own label does not exist and RISE's reward is the only one available. + +\textbf{Caption rule this settles,} for every panel in this document and the unseen one: a green outline means \emph{RISE's reward would have fired}, not \emph{the simulator reached the goal}. On \code{square\_expert\_play} those coincide. On the other 7 measurable tasks they do not, and the original brief's suggestion of drawing the environment's success as a second outline style is only available where that label is dense enough to draw --- which the table shows it is not on the \code{two\_piece*} family. + + +\clearpage\subsection*{The same trees, drawn with the estimator the paper reports} +The three subsections above establish a defect in the panels of this document and then stop at it: every published tree prints a per-candidate $Q$ and an arg-max marker taken from the \emph{fold}, and \code{docs/tex/flagship\_paper.tex:162} retired the fold in favour of the coin-terminated $\beta$ chain. Re-rendering was left as a figure decision. It is now made, \emph{additively}: \code{scripts/viz/stitch\_figure.py} gained \code{--readout chain} (default \code{fold}, so nothing above moved) and the same 12 roots are drawn a second time into \code{docs/figs/stitching\_chain/}, with $Q$ and the arg-max from $Q_b = \mathrm{mean}_p \sum_{k=0}^{33} w_k c_k$, $w_k = (1-p)p^k$ and $w_{33} = p^{33}$, $p = (\gamma-\beta)/(\gamma(1-\beta)) = 0.8081$ (\code{rsm\_scorer.py:658--672}), at the flagship cap 33. \textbf{No new sampling and no change to the scoring path:} this is arithmetic over the depth-34 captures the previous subsection already gated, so the two families differ in exactly one thing --- which estimator reads the memberships. + +\textbf{Gates.} \code{--readout fold} on the published manifests reproduces this document's \code{FIGREPORT\_dec256.json} arg-max, $Q$ and green fraction on 12 of 12 figures, so the flag is inert when off (G1). The chain $Q$ computed inside the renderer matches \code{runs/pixdec/DEPTH\_READOUT.json}'s independent cap-33 numbers to $\max|\mathrm{dev}| = 0.0e+00$ with every arg-max index equal, so the figures and the audit share one implementation of the estimator (G2). And the green fraction is identical between the fold and chain renders of the \emph{same} capture on 12 of 12 roots (G3) --- as it must be, because the outline rule $c_k \ge 0.5$ never sees $Q$. + +\textbf{What the read-out change actually does to a figure.} Against the fold at $L{=}8$ --- the estimator the published panels mark --- the arg-max marker moves on \textbf{6 of the 12} panels (\code{square\_expert\_play} 3/6; \code{two\_piece\_expert\_play} 3/6), which is exactly the previous subsection's cap-33 count arrived at through a different code path. Against the deep capture's \emph{own} fold at $L{=}34$ it moves on only 3 of 12, so part of what looked like a read-out disagreement is a horizon disagreement, and the two references are reported separately rather than one being called \emph{the} comparison. The printed \emph{value} moves much further than the ranking does: the chain's $Q_{\max}$ is below the fold's on 12 of 12 roots, at a median ratio of 0.310, because the fold saturates towards 1 as soon as a single hop fires whereas the chain is a weighted \emph{average} of memberships over 34 hops and the sampled membership rate past hop 7 is near zero. The two numbers are therefore not on a common scale and a $Q$ printed in one family must not be compared against a $Q$ printed in the other. + +Two things the chain does \emph{not} do, both pre-registered as predictions and both missed in the informative direction. It does not reach far down the fold's list: the deepest fold rank any chain arg-max has is 56 of 128 and \textbf{none} of the 12 falls below the fold's median, so this is a permutation of the top of the ranking, not a different answer to the planning question. And it \emph{breaks} rather than inherits the one degenerate root: on \code{square\_expert\_play demo\_110 t0104}, where the audit above found all 128 fold candidates within $10^{-6}$ of the max and called that winner float noise, the chain spreads the candidates over 0.0095, and the smallest chain spread over all 12 roots is 0.0018. Under the flagship read-out every one of these panels marks a genuine value decision. + +\textbf{What is unchanged, and what this does not settle.} Both families draw the same green/red structure from the same reward head, the same retrieved and decoded images and the same per-hop $c_k$; only the $Q$ column, the cloud's colour scale and the arg-max marker differ, and the per-tile second line prints the chain's running partial $\sum_{j\le k} w_j c_j$ in place of the fold's $q_k$. The caveat the earlier subsections raise is therefore \emph{discharged for the new family and still stands for the old one}, which is why both are printed: the pair is the honest picture of how much a read-out choice moves a qualitative figure. Two things this does not settle: the clouds here come from the seeded re-capture (proposer seed 270028), not from the unreproducible published draw (\code{runs/pixdec/FIG\_REPRO.json}: \code{published\_was\_seeded: false}), so a panel in one family is the same \emph{root} as its twin and not the same \emph{cloud}; and the figure-\emph{selection} question --- which roots deserve to be figures --- is untouched, so these remain exemplars on the criterion the selection subsection reports. + + +\clearpage\section{Stitching figures --- Piece-Cov (two\_piece\_expert\_play)} +What a retrieval cosine means in this space: a \emph{random} pair of cached frames scores 0.001 (p95 0.411) and two \emph{adjacent} frames of one episode score 0.913 (p05 0.835); the cosines printed under the tiles should be read against those two ends. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_102} frame 198/291 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0346]$, argmax candidate 110 with $Q$=0.0346; 1.1\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.540 (min 0.302). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 1.23 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.99; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_106} frame 35/246 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0191, 0.0824]$, argmax candidate 125 with $Q$=0.0824; 2.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.525 (min 0.338). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 0.85 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 1.16; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_129} frame 84/208 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.2348]$, argmax candidate 100 with $Q$=0.2348; 8.9\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.497 (min 0.324). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 0.95 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.97; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_143} frame 154/282 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.2211, 0.3142]$, argmax candidate 94 with $Q$=0.3142; 16.7\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.549 (min 0.417). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 0.50 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 1.06; exact all-pairs over 8 hops). That is below the pre-registered $0.60$, so read this panel for \emph{route shape} --- which candidate chains toward green --- not for per-hop pixel detail. Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_171} frame 244/299 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0233]$, argmax candidate 123 with $Q$=0.0233; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.522 (min 0.355). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 4.04 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.87; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_99} frame 57/208 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.1116, 0.1696]$, argmax candidate 2 with $Q$=0.1696; 4.2\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.537 (min 0.300). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 0.55 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 1.02; exact all-pairs over 8 hops). That is below the pre-registered $0.60$, so read this panel for \emph{route shape} --- which candidate chains toward green --- not for per-hop pixel detail. Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage + +\clearpage\section{Stitching figures --- Square-Cov (square\_expert\_play)} +What a retrieval cosine means in this space: a \emph{random} pair of cached frames scores -0.003 (p95 0.412) and two \emph{adjacent} frames of one episode score 0.933 (p05 0.868); the cosines printed under the tiles should be read against those two ends. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_102} frame 145/349 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0247]$, argmax candidate 125 with $Q$=0.0247; 0.1\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.582 (min 0.345). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 0.70 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.64; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_110} frame 104/369 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0000]$, argmax candidate 7 with $Q$=0.0000; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.638 (min 0.421). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 1.29 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.91; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_160} frame 165/301 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0465]$, argmax candidate 103 with $Q$=0.0465; 0.6\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.617 (min 0.379). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 1.36 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.83; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_221} frame 249/305 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0653]$, argmax candidate 16 with $Q$=0.0653; 0.2\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.599 (min 0.483). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 1.51 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.90; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_36} frame 56/387 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.6069]$, argmax candidate 38 with $Q$=0.6069; 19.2\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.632 (min 0.458). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 0.90 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.96; exact all-pairs over 8 hops). Capture noise: 3 independent re-captures of this root under the same (unseeded) protocol give $0.21$--$0.58$, so read the figure above as this \emph{capture}, not as a stable property of the root. This capture's value lies outside that range.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_84} frame 390/561 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.2687]$, argmax candidate 104 with $Q$=0.2687; 2.7\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.586 (min 0.442). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Panel fidelity:} decoded hops of this root carry 2.00 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.70; exact all-pairs over 8 hops). Capture noise: re-capturing five roots moved this statistic by a median of $0.10$ (\code{runs/pixdec/DCP\_NOISE.json}), so treat a value within about $0.05$ of a threshold as indicative.}\end{figure} +\clearpage + +\clearpage\section{Stitching figures under the flagship read-out --- Piece-Cov (two\_piece\_expert\_play)} +Same roots as the section above, same successor, same reward head and the same renderer; the per-candidate $Q$, the cloud colour and the arg-max marker come from the coin-terminated $\beta$ chain at cap 33 instead of the fold. The clouds are the seeded re-capture, so each panel is the same \emph{root} as its twin above and not the same \emph{draw}. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_102} frame 198/291 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0095]$, argmax candidate 9 with $Q$=0.0095; 0.8\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.551 (min 0.307). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 9, this marks 9 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_106} frame 35/246 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0088, 0.0277]$, argmax candidate 52 with $Q$=0.0277; 0.9\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.525 (min 0.353). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 53, this marks 52. The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_129} frame 84/208 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0271, 0.0780]$, argmax candidate 27 with $Q$=0.0780; 2.4\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.528 (min 0.405). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 27, this marks 27 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_143} frame 154/282 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.1112, 0.1550]$, argmax candidate 27 with $Q$=0.1550; 4.8\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.549 (min 0.467). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 27, this marks 27 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_171} frame 244/299 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0018]$, argmax candidate 97 with $Q$=0.0018; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.512 (min 0.361). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 97, this marks 97 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play/tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play}, failure state \code{demo\_99} frame 57/208 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0170, 0.0361]$, argmax candidate 58 with $Q$=0.0361; 1.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.537 (min 0.329). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 58, this marks 58 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage + +\clearpage\section{Stitching figures under the flagship read-out --- Square-Cov (square\_expert\_play)} +Same roots as the section above, same successor, same reward head and the same renderer; the per-candidate $Q$, the cloud colour and the arg-max marker come from the coin-terminated $\beta$ chain at cap 33 instead of the fold. The clouds are the seeded re-capture, so each panel is the same \emph{root} as its twin above and not the same \emph{draw}. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/square_expert_play/tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_102} frame 145/349 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0083]$, argmax candidate 11 with $Q$=0.0083; 1.1\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.578 (min 0.344). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 21, this marks 11. The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/square_expert_play/tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_110} frame 104/369 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0095]$, argmax candidate 98 with $Q$=0.0095; 0.8\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.637 (min 0.450). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 15, this marks 98. The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/square_expert_play/tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_160} frame 165/301 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0114]$, argmax candidate 64 with $Q$=0.0114; 0.2\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.612 (min 0.393). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 64, this marks 64 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/square_expert_play/tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_221} frame 249/305 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0142]$, argmax candidate 123 with $Q$=0.0142; 0.3\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.587 (min 0.470). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 123, this marks 123 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_36} frame 56/387 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.4386]$, argmax candidate 45 with $Q$=0.4386; 4.3\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.647 (min 0.566). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 45, this marks 45 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/square_expert_play/tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{square\_expert\_play}, failure state \code{demo\_84} frame 390/561 (episode labelled UNSUCCESSFUL). Successor \code{L40/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.2136]$, argmax candidate 27 with $Q$=0.2136; 3.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.585 (min 0.441). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s). \textbf{Read-out:} flagship coin chain at cap 33 ($p=0.8081$), so the $Q$ above and the marker are the paper's estimator, not the fold; hops 1--8 of a depth-34 capture are drawn. The fold on this same capture would mark candidate 27, this marks 27 (unchanged). The green/red outlines are identical either way.}\end{figure} +\clearpage + +\clearpage\subsection*{Why the previous revision of this document was held back, and what was actually broken} +The revision built with the third task was \emph{not} published, because its rebuild gate caught 6 of the 15 \textbf{Panel fidelity} notes on the already-published \code{square\_expert\_play} pages disappearing, and three successive rebuilds printed 15, 9 and 3 of them. That is recorded here because the explanation is a lesson about this pipeline rather than about the successor model. The notes were a \emph{symptom}: \code{make\_stitch\_tex.py}'s \code{caption()} returns the bare figure name when a figure has no record in \code{runs//stitchviz/MANIFEST\_\_L40best\_b0.95\_L8.json}, and the fidelity note is appended \emph{inside} that function --- so a missing manifest record costs the \emph{whole} caption (settings, checkpoint, $Q$ range, green fraction) and the gate was only counting the last sentence of it. 6 published captions had been reduced to one word each. + +The cause is a \emph{shared file}, not the generator. LSF job \code{1904966} (\code{rr\_pack4\_chaintrace2}) ran \code{scripts/viz/stitch\_trace.py} into the same \code{stitchviz/} directory with the legacy overwrite and replaced the 12 published records with its own 12 \code{\_chain} ones, at 2026-09-24T20:42:52Z and 2026-09-24T20:43:05Z. Nothing failed at the time. And the three different counts were a \emph{race}: the generator reads the two tasks' manifests seconds apart and writes the tex minutes later, so the build that straddled the two writes saw one task repaired and one not. Replaying the lookup over the three manifest states reproduces all three counts exactly (15, 9, 3 notes; 0, 6, 12 captions reduced to a bare name), which is what closes the question; \code{runs/pixdec/RUN35\_REPAIR.json}, \code{scripts/viz/run35\_cause.py}. + +The repair, and why this revision \emph{is} published: the 12 published records were restored from the branch (byte-identical to the committed manifest, asserted), unioned with the chain capture's entries so neither family can be lost again; \code{stitch\_trace.py}'s manifest write now defaults to that \emph{non-destructive union} (\code{--manifest-collide merge|error|clobber}), which differs from the legacy write only in the cases that previously destroyed records; and the generator now refuses to write a document in which any caption lost its manifest record (\code{RR\_TEX\_STRICT=1}, set by \code{scripts/viz/rr\_cpu\_pdf35.sh}) instead of degrading it silently. Every printed fidelity value in this revision is identical to the pre-clobber document's, and all 12 published captions are whole. + + +\clearpage\section{A third task, at the cap its own paper row reports --- Piece-tip-Cov (two\_piece\_expert\_play\_tipping)} +Every panel above is drawn on one of two tasks. This section adds a third, and it was chosen for a reason the two cannot supply: \textbf{its own flagship row is the setting this document's chain family already renders under}. \code{flagship\_paper.tex} \code{tab:discounts} prints Piece-tip (Cov.) at $\beta=0.95$, cap 33 --- while the two published figure tasks are Square (Cov.) at $\beta=0.9$, cap 73 and Piece (Cov.) at $\beta=0.98$, cap 11, so for them cap 33 is a setting transferred from the capture rather than read off the row. Here the two coincide, which makes these the first panels in this document whose printed $Q$ is the estimator the paper reports \emph{at the horizon the paper reports}. The task is also a planning win (RSM $7.3\pm0.4$ vs BC $2.9\pm0.6$, $+4.4$, \code{docs/MASTER\_TABLE.md}), its read-out is the best-ordered of the six checkpoints the read-out audit paired (\code{M/best} AUROC $0.9999$, green-rate margin $0.993$, \code{runs/pixdec/HEAD\_CKPT\_ABLATE.json}) so the outlines carry information, and the multitask decoder already covers it at val PSNR $24.8$\,dB --- between the two published tasks' $23.0$ and $26.0$. Nothing was retrained: 6 failure roots were captured at \code{--depth 8} and \code{--depth 34} under one proposer seed (270034) and rendered by the same two read-outs as above. + +\textbf{Gates.} The depth-34 capture's first 8 hops equal the depth-8 capture's $c$, $lg$ and $z$ to $\max|\mathrm{dev}| = 0$, so the deep capture is a bit-exact superset and a chain panel may be compared against its fold twin (G1, 6/6). The fold recursion recomputed from the stored memberships reproduces the stored $Q$ to $8.3e-08$ (G2, 6/6). The renderer's chain $Q$ matches an evaluation of $Q_b=\mathrm{mean}_p\sum_{k\le33}w_kc_k$ made outside the renderer to $0.0e+00$ with every arg-max index equal (G3). And all 6 roots sit in episodes \code{meta.npz:ep\_success == False}, asserted rather than assumed (G5, 6/6). + +\textbf{What the panels show, including the half that show nothing.} 2 of the 6 roots are \emph{all red}: not one of the $N\times P\times L$ sampled states crosses $c_k\ge0.5$, so the tree has no green to chain towards and the per-candidate $Q$ is $0$ for every candidate (\code{demo\_209}, \code{demo\_510}). That is the same degeneracy the depth study reported on held-out roots, reproduced here on a task whose read-out is the best-ordered we have measured --- which is the evidence that it is the successor's \emph{reach} and not the membership head. The richest root is \code{demo\_433} at a green fraction of 0.126, and it is the one panel of this section that shows the thing the figure is for: from one failure state, some sampled futures land in the success set and some do not. On the all-red roots the arg-max marker should not be read as a value decision at all: their candidate spread is $1.2e-14$ and $5.2e-07$, so the marker is settled by the tie-break. \textbf{A selection caveat, unchanged from the selection subsection:} these roots come from \code{pick\_failure\_states} with the same arbitrariness measured there, so they are exemplars, not a ranked choice. + +\textbf{And a result that corrects a generalisation made one section above.} There the chain's $Q_{\max}$ was below the fold's on 12 of 12 roots at a median ratio of $0.310$, and the reading offered was that the fold saturates towards $1$ once a hop fires while the chain averages over 34 hops whose membership rate past hop 7 is near zero. On this task the sign \emph{splits}: the chain is below the fold on 3 of 6 roots and \emph{above} it on 3, at a median ratio of 1.664. The split is not random --- the chain is smaller exactly on the roots where the membership fires early (\code{\code{demo\_433}, \code{demo\_459}}, green fractions 0.126, 0.038), and larger on the roots where nothing crosses $c_k\ge0.5$ by hop 8 but something does deeper in the walk. So the correct statement is not that the chain shrinks the printed value; it is that the chain \emph{re-weights} it, and the sign of the change depends on where in the horizon the membership sits. A $Q$ from one family still must not be compared against a $Q$ from the other, which is the part that survives. + +\textbf{Whose success is the green outline here.} On this task the cache's \code{goal.npz} label is \code{placed\_and\_settle}, which fires in \textbf{1 of 704} episodes against RISE's 200 (\code{runs/pixdec/LABEL\_CENSUS.json}). So a green outline in this section means \emph{RISE's reward would have fired} and nothing about the simulator, and the second outline style the brief asked for is not drawable here at all --- there is essentially no environment-success label to draw. + + +\clearpage\subsection*{Piece-tip-Cov (two\_piece\_expert\_play\_tipping) --- the retired fold at $L=8$} +The fold read-out the first figures in this document use, at the same $L=8$, so this panel is comparable to every panel above. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_209} frame 155/231 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0000]$, argmax candidate 10 with $Q$=0.0000; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.485 (min 0.308). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_239} frame 258/316 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0011]$, argmax candidate 106 with $Q$=0.0011; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.500 (min 0.362). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_433} frame 82/203 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.5460, 0.7203]$, argmax candidate 90 with $Q$=0.7203; 28.8\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.388 (min 0.199). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_459} frame 32/222 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0914]$, argmax candidate 74 with $Q$=0.0914; 1.8\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.465 (min 0.312). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_510} frame 54/199 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0000]$, argmax candidate 36 with $Q$=0.0000; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.449 (min 0.374). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_695} frame 99/185 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=8, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out prob, plan seed 0. $Q \in [0.0000, 0.0000]$, argmax candidate 60 with $Q$=0.0000; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.375 (min 0.274). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage + +\clearpage\subsection*{Piece-tip-Cov (two\_piece\_expert\_play\_tipping) --- the flagship coin chain at cap 33} +The same roots under the estimator the paper reports, at this task's own cap. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_209} frame 155/231 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0000]$, argmax candidate 115 with $Q$=0.0000; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.467 (min 0.308). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_239} frame 258/316 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0031]$, argmax candidate 36 with $Q$=0.0031; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.519 (min 0.368). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_433} frame 82/203 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.2351, 0.3520]$, argmax candidate 33 with $Q$=0.3520; 12.6\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.387 (min 0.201). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_459} frame 32/222 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0052, 0.0545]$, argmax candidate 39 with $Q$=0.0545; 3.8\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.457 (min 0.312). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_510} frame 54/199 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0000]$, argmax candidate 36 with $Q$=0.0000; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.449 (min 0.374). The root tile is the 256 px re-render of the same state. Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching_chain/two_piece_expert_play_tipping/tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.jpg} +\caption{\textbf{two\_piece\_expert\_play\_tipping}, failure state \code{demo\_695} frame 99/185 (episode labelled UNSUCCESSFUL). Successor \code{M/ckpt\_best.pt}, hop head \code{gauss}, proposer \code{model\_epoch\_5000.pth} (S0A seed 0); $\beta$=0.95, $L$=34, $\gamma$=0.99, $N$=128, $P$=16, $T$=1.0, read-out flagship coin chain, cap 33, plan seed 0. $Q \in [0.0000, 0.0001]$, argmax candidate 99 with $Q$=0.0001; 0.0\% of all $N\times P\times L$ sampled states are in the success set ($c_k\ge0.5$). Renderer: nearest-neighbour retrieval, mean cosine 0.393 (min 0.259). The root tile is the 256 px re-render of the same state, taken from the nearest stored frame (1 frame of sim time away: the hi-res frames are stored at stride 2). Each tile is \textbf{retrieval (left) $|$ decoder (right)}; the decoder is \code{r256\_mt10} at step 60000, res 256, trained on 10 task(s).}\end{figure} +\clearpage + +\clearpage\section{Which failure roots actually show the split} +The figures above were chosen by eye. That is not good enough for a paper claim, so every root was re-measured at the \emph{candidate} level and the whole pool of failure roots was scanned (\code{scripts/viz/rank\_split\_roots.py}, \code{scripts/viz/cand\_green\_stats.py}; numbers in \code{runs/pixdec/CAND\_GREEN\_STATS.json} and \code{runs/pixdec/SPLIT\_ROOT\_RANK.json}). Two statistics decide it. \textbf{cand\_any\_green} is the fraction of the $N=128$ candidates that have at least one green sampled state anywhere in their $L$ hops: a figure can only show \emph{``some candidates lead to success and some do not''} when this is well below 1, because at $1.000$ not one candidate is entirely red. \textbf{Q spread} ($Q_{\max}-Q_{\min}$) is how far the planner separates its best candidate from its worst. \textbf{hop rise} is the mean green fraction over the second half of the hops minus the mean over the first half: \emph{positive} means the sampled futures \emph{chain into} the success set, negative means the root merely starts green and decays, which is the opposite of what the figure must show. Ranking on \code{frac\_green} instead picks the decaying roots: square \code{demo\_181} has the highest \code{frac\_green} of its task (0.207) and the most strongly \emph{falling} profile of all eleven roots (rise $-0.289$). + +\begin{center}\small\begin{tabular}{llrrrrrr}\toprule +task & root & frac\_green & cand\_any\_green & $Q$ spread & hop 1 & hop $L$ & hop rise \\\midrule +Square-Cov & \code{demo\_36} t56 & 0.192 & 0.414 & 0.607 & 0.02 & 0.30 & +0.167 \\ +Square-Cov & \code{demo\_181} t135 & 0.207 & 0.961 & 0.850 & 0.68 & 0.03 & -0.289 \\ +Square-Cov & \code{demo\_172} t38 & 0.127 & 0.992 & 0.521 & 0.17 & 0.04 & -0.064 \\ +Piece-Cov & \code{demo\_18} t96 & 0.120 & 0.828 & 0.919 & 0.25 & 0.05 & -0.074 \\ +Piece-Cov & \code{demo\_64} t192 & 0.054 & 0.883 & 0.704 & 0.25 & 0.01 & -0.083 \\ +Piece-Cov & \code{demo\_198} t166 & 0.052 & 0.961 & 0.385 & 0.00 & 0.04 & -0.046 \\ +Piece-Cov & \code{demo\_153} t112 & 0.154 & 0.984 & 0.323 & 0.02 & 0.07 & +0.017 \\ +Piece-Cov & \code{demo\_129} t84 & 0.089 & 0.992 & 0.235 & 0.00 & 0.16 & +0.079 \\ +Piece-Cov & \code{demo\_80} t25 & 0.256 & 1.000 & 0.367 & 0.01 & 0.28 & +0.177 \\ +Piece-Cov & \code{demo\_6} t180 & 0.166 & 1.000 & 0.202 & 0.09 & 0.09 & -0.162 \\ +Piece-Cov & \code{demo\_136} t154 & 0.149 & 1.000 & 0.359 & 0.01 & 0.11 & +0.026 \\ +\bottomrule\end{tabular}\end{center} + +\paragraph{$Q$ is near zero exactly when no sampled future reaches the success set.} Across these 11 roots, the largest $Q$ given to a candidate with \emph{no} green state anywhere is 0.115 (smallest 4.4e-07), and the argmax candidate has a green future in 11/11 roots. So the fold is not assigning its score for some reason orthogonal to membership: a candidate whose Monte-Carlo ensemble never enters the success set is scored at the floor. + + +\subsection*{The pick, defended against every failure root on disk} +The table above is the \emph{curated} pool, and which roots were curated was decided by a \code{frac\_green} ranking --- the statistic the previous paragraph shows is the wrong one. So the selection of what to measure was made by a criterion we do not trust. \code{scripts/viz/cand\_green\_census.py} closes that by re-measuring \emph{every} flagship-setting failure-root trace on disk: \textbf{171 captures over 46 distinct failure roots} (\code{runs/pixdec/CAND\_GREEN\_CENSUS.json}). + +Two things follow. First, \textbf{argmin \code{cand\_any\_green} is the wrong selector}, for the same reason \code{frac\_green} was: \code{cand\_any\_green}$=0$ means not one of the 128 candidates has a green state anywhere --- an all-red cloud, which fails to show \emph{``some lead to success and some do not''} exactly as badly as $1.000$ does. The census finds such degenerate roots (1 on Piece-Cov, 4 on Square-Cov), so argmin over the true pool would have selected the worst available figure. The criterion is therefore \textbf{balance}, $\min(x, 1-x)$ maximised, behind a green-mass floor (\code{frac\_green} $\ge$ 0.01) and a $Q$-spread floor ($\ge$ 0.1); on the curated pool it is a no-op, and the shipped figures do not move. + +\begin{center}\small\begin{tabular}{llrrrrr}\toprule +task & root & cand\_any\_green & balance & frac\_green & $Q$ spread & captures \\\midrule +Piece-Cov & \code{demo\_83} t280 & 0.568 & 0.432 & 0.008 & 0.073 & 3 \\ +Piece-Cov & \code{demo\_159} t413 & 0.703 & 0.297 & 0.021 & 0.129 & 3 \\ +Piece-Cov & \code{demo\_185} t256 & 0.784 & 0.216 & 0.011 & 0.052 & 3 \\ +Piece-Cov & \code{demo\_18} t96 & 0.786 & 0.214 & 0.120 & 0.919 & 11 \\ +Piece-Cov & \code{demo\_38} t67 & 0.799 & 0.201 & 0.010 & 0.071 & 9 \\ +Piece-Cov & \code{demo\_64} t192 & 0.883 & 0.117 & 0.054 & 0.704 & 1 \\ +\midrule +Square-Cov & \code{demo\_212} t141 & 0.491 & 0.491 & 0.030 & 0.234 & 5 \\ +Square-Cov & \code{demo\_36} t56 & 0.414 & 0.414 & 0.192 & 0.607 & 3 \\ +Square-Cov & \code{demo\_148} t138 & 0.608 & 0.392 & 0.013 & 0.864 & 5 \\ +Square-Cov & \code{demo\_84} t390 & 0.344 & 0.344 & 0.027 & 0.269 & 1 \\ +Square-Cov & \code{demo\_160} t165 & 0.703 & 0.297 & 0.006 & 0.047 & 1 \\ +Square-Cov & \code{demo\_164} t93 & 0.792 & 0.208 & 0.006 & 0.019 & 5 \\ +\midrule +\bottomrule\end{tabular}\end{center} +\begin{center}\footnotesize Top six roots per task by balance. Degenerate roots (\code{cand\_any\_green} $=0$, balance $0$) and all-green roots ($=1$) sit at the bottom by construction.\end{center} + +\paragraph{No single statistic settles the choice.} Applying the balance criterion to the \emph{whole} census does \emph{not} return the shipped picks: it prefers square \code{demo\_212} (balance 0.491) and two-piece \code{demo\_159} (0.297), both of which clear the floors. But both buy that balance by trading an order of magnitude of the other two requirements away --- \code{demo\_212} has 6$\times$ less green mass and 2.6$\times$ less $Q$ spread than \code{demo\_36}; \code{demo\_159} has 6$\times$ less green mass and 7$\times$ less $Q$ spread than \code{demo\_18}. A figure needs all three at once, so the honest object is the \textbf{Pareto frontier} over (balance, \code{frac\_green}, $Q$ spread), not a scalar argmax. + +\paragraph{Piece-Cov: the shipped pick is on the frontier.} Of the 25 failure roots in the census (against 8 in the curated table), 7 are Pareto-optimal, and \code{demo\_18\_t0096} is one of them. It is the frontier member that is strong on all three at once: the others are there by maximising one dimension while giving up another by an order of magnitude. + +\begin{center}\small\begin{tabular}{lrrrrr}\toprule +root & balance & frac\_green & $Q$ spread & captures & \code{cand\_any\_green} range \\\midrule +\mbox{\code{demo\_83} t280} & 0.432 & 0.008 & 0.073 & 3 & 0.594 \\ +\mbox{\code{demo\_159} t413} & 0.297 & 0.021 & 0.129 & 3 & 0.016 \\ +\textbf{\code{demo\_18} t96} & 0.214 & 0.120 & 0.919 & 11 & 0.148 \\ +\mbox{\code{demo\_153} t112} & 0.016 & 0.154 & 0.323 & 1 & 0.000 \\ +\mbox{\code{demo\_136} t154} & 0.003 & 0.149 & 0.359 & 5 & 0.016 \\ +\mbox{\code{demo\_174} t479} & 0.003 & 0.160 & 0.277 & 3 & 0.008 \\ +\mbox{\code{demo\_75} t199} & 0.000 & 0.562 & 0.905 & 4 & 0.000 \\ +\bottomrule\end{tabular}\end{center} +\begin{center}\footnotesize The shipped pick is in bold.\end{center} + +\paragraph{Square-Cov: the shipped pick is on the frontier.} Of the 21 failure roots in the census (against 3 in the curated table), 6 are Pareto-optimal, and \code{demo\_36\_t0056} is one of them. It is the frontier member that is strong on all three at once: the others are there by maximising one dimension while giving up another by an order of magnitude. + +\begin{center}\small\begin{tabular}{lrrrrr}\toprule +root & balance & frac\_green & $Q$ spread & captures & \code{cand\_any\_green} range \\\midrule +\mbox{\code{demo\_212} t141} & 0.491 & 0.030 & 0.234 & 5 & 0.172 \\ +\textbf{\code{demo\_36} t56} & 0.414 & 0.192 & 0.607 & 3 & 0.000 \\ +\mbox{\code{demo\_148} t138} & 0.392 & 0.013 & 0.864 & 5 & 0.258 \\ +\mbox{\code{demo\_13} t48} & 0.049 & 0.317 & 0.618 & 4 & 0.039 \\ +\mbox{\code{demo\_181} t135} & 0.040 & 0.207 & 0.850 & 13 & 0.078 \\ +\mbox{\code{demo\_10} t79} & 0.020 & 0.569 & 0.848 & 4 & 0.039 \\ +\bottomrule\end{tabular}\end{center} +\begin{center}\footnotesize The shipped pick is in bold.\end{center} + +\paragraph{How far can this ranking be trusted?} Many roots were captured more than once. Repeat captures on the \emph{same} device and seed agree to the last bit, but captures that differ in device (GPU vs CPU) or in the batch the anchor was captured in do \emph{not}: the largest \code{cand\_any\_green} range over the repeats of one root is \textbf{0.594} (\code{demo\_83} t280, 3 captures). That is larger than the gap between the best and second-best root, so \textbf{a ranking on \code{cand\_any\_green} is only meaningful within one capture configuration} and this document names it throughout. The degenerate classification is robust: every $0.000$ root reads $0.000$ in every capture. + + +\subsection*{Does the frontier survive the capture noise it was measured with?} +The paragraph above says two things that were never confronted: that \code{cand\_any\_green} moves by up to $0.594$ between capture configurations, and that the frontier ordering between the shipped picks and their rivals turns on gaps far smaller than that. It could not confront them, because the two shipped roots had no cross-configuration replicate: square \code{demo\_36}'s three census draws (\code{stitchviz}, \code{\_split}, \code{\_split2}) are the \emph{same file} --- md5 \code{ef66050c9320363622d46efdb6849b7b} --- because the curated split directories hold copies, not re-captures, and two-piece \code{demo\_80} had exactly one. Collapsing draws by file md5 turns the census's 202 draws into 173 distinct captures (29 dropped as copies). + +\code{scripts/viz/xdev\_capture.sh} re-captures the five roots the choice turns on in five arms --- \code{cpuA} (the shipped protocol: unseeded proposer, batched), \code{cpuB} (one root per process, isolating the capture batch), \code{cpuS} (\code{--proposer-seed 0}, the candidate draw held fixed), and \code{gpuA}/\code{gpuS} (those last two protocols on an H100, so a seeded CPU/GPU difference is float arithmetic alone) --- at the flagship setting used by every figure in this document. All five have run, so each decisive root carries 5--13 distinct captures spanning both devices. \code{scripts/viz/frontier\_stability.py} then asks, per axis, what fraction of cross-capture comparisons the shipped pick wins (\code{runs/pixdec/FRONTIER\_STABILITY.json}). + +\begin{center}\small\begin{tabular}{llrrrl}\toprule +task & axis & shipped & rival & shipped wins & verdict \\\midrule +Square-Cov & \code{balance} & +0.376 & +0.424 & 0.22 & \footnotesize ORDERING FLIPS between captures --- within noise \\ +Square-Cov & \code{frac\_green} & +0.169 & +0.025 & 1.00 & \footnotesize shipped ALWAYS ahead \\ +Square-Cov & \code{Q\_spread} & +0.640 & +0.176 & 1.00 & \footnotesize shipped ALWAYS ahead \\ +Square-Cov & \code{hop\_rise} & +0.132 & +0.031 & 1.00 & \footnotesize shipped ALWAYS ahead \\ +\midrule +Piece-Cov & \code{balance} & +0.225 & +0.280 & 0.21 & \footnotesize ORDERING FLIPS between captures --- within noise \\ +Piece-Cov & \code{frac\_green} & +0.101 & +0.026 & 1.00 & \footnotesize shipped ALWAYS ahead \\ +Piece-Cov & \code{Q\_spread} & +0.921 & +0.149 & 1.00 & \footnotesize shipped ALWAYS ahead \\ +Piece-Cov & \code{hop\_rise} & -0.098 & +0.010 & 0.00 & \footnotesize rival ALWAYS ahead \\ +\midrule +\bottomrule\end{tabular}\end{center} +\begin{center}\footnotesize Mean over the distinct captures of each root; ``shipped wins'' is the fraction of all (shipped capture, rival capture) pairs in which the shipped pick is ahead on that axis. Square compares \code{demo\_36} with \code{demo\_212}, two-piece \code{demo\_18} with \code{demo\_159} --- the two rivals the balance criterion preferred --- over 6 vs 9 distinct captures (54 cross pairs) on Square-Cov; 13 vs 8 distinct captures (104 cross pairs) on Piece-Cov.\end{center} + +\paragraph{The balance axis cannot order these pairs; the other two can.} On \code{balance} the ordering \textbf{flips between captures} on both tasks (the shipped pick wins 0.22 on Square-Cov and 0.21 on Piece-Cov, and of the PAIRED comparisons --- same arm on both roots, so device, seeding and batch are all held fixed --- 0.40 on Square-Cov and 0.40 on Piece-Cov), and the two roots' ranges overlap. So the preference for \code{demo\_212} and \code{demo\_159} stated above is \textbf{within capture noise} and the balance axis does not rank them at all. On \code{frac\_green} and $Q$ spread the shipped picks are ahead in \textbf{every} cross-capture comparison with no overlap of ranges, so the published choice rests on the two axes that are stable, not on the one that is not. The chaining figure is selected on a different axis again: two-piece \code{demo\_80} has hop rise $+0.175$ with a range of $0.004$ over its captures, while \code{demo\_18}'s is negative --- the two two-piece figures carry different claims and neither substitutes for the other. + +\paragraph{What this costs the square figure.} Over all 6 distinct captures \code{demo\_36}'s balance spans 0.320--0.461 and its \code{frac\_green} 0.156--0.192. The four CPU captures alone put the published one at the top of the balance range, but the unseeded GPU capture is higher, so on that axis the published number is not the extreme it looked like on CPU. The figure does not move --- on the axes that order it the margin is an order of magnitude --- but no such statement can be made from one capture. + +\paragraph{Which factor actually moves the number.} The arms separate three factors that the shipped protocol confounds. Each row varies one and holds the others fixed; the entry is the largest $|\Delta|$ over the decisive roots (\code{runs/pixdec/FRONTIER\_STABILITY.json}). + +\begin{center}\small\begin{tabular}{lllrrr}\toprule +factor & varied & held fixed & \code{balance} & \code{frac\_green} & \code{Q\_spread} \\\midrule +device & \footnotesize CPU $\to$ H100 & \footnotesize \code{--proposer-seed 0}, batched & \textbf{0.180} & 0.037 & 0.099 \\ +batch & \footnotesize all roots in one process $\to$ one per process & \footnotesize device, unseeded & 0.078 & 0.006 & 0.170 \\ +RNG & \footnotesize unseeded $\to$ \code{--proposer-seed 0} & \footnotesize device, batched & 0.039 & 0.013 & 0.079 \\ +\bottomrule\end{tabular}\end{center} + +\noindent On \code{balance} the device term is 2.3$\times$ the batch term, 4.6$\times$ the RNG term: the dominant source of capture-to-capture movement is \textbf{float arithmetic on a different device}, not the unseeded candidate draw the protocol was blamed for. It is large enough to flip the ordering on its own: with the candidate draw held fixed, moving CPU $\to$ GPU takes \code{demo\_212}'s balance from 0.469 to 0.289 while \code{demo\_36}'s goes 0.352 to 0.383 --- \emph{the rival wins this axis on CPU and loses it on GPU with every other input identical}. Seeding the proposer therefore does not make a balance ranking portable; only reporting the device does. On \code{frac\_green} and $Q$ spread every term stays an order of magnitude below the shipped-versus-rival gaps, which is why those axes order the roots identically in every cross-capture comparison. + +\paragraph{Is each published figure reproducible, and is its caption number typical?} The re-captures answer both per figure (\code{scripts/viz/fig\_repro.py} $\to$ \code{runs/pixdec/FIG\_REPRO.json}). ``Seeded'' is whether the published capture recorded \code{proposer\_seed: 0}; ``bit-identical'' compares its trace md5 with the \code{cpuS} re-capture, run days later on a different host. + +\begin{center}\small\begin{tabular}{llccl}\toprule +figure & captures & seeded & bit-identical & published capture's rank within its own spread \\\midrule +Square-Cov \code{demo\_36\_t0056} & 6 & no & no & \footnotesize \code{balance} 2/6, \code{frac\_green} 1/6, \code{Q\_spread} 6/6, \code{hop\_rise} 1/6 \\ +Piece-Cov \code{demo\_18\_t0096} & 13 & no & no & \footnotesize \code{balance} 12/13, \code{frac\_green} 3/13, \code{Q\_spread} 9/13, \code{hop\_rise} 1/13 \\ +Piece-Cov \code{demo\_80\_t0025} & 5 & yes & \textbf{yes} & \footnotesize \code{balance} 1/5, \code{frac\_green} 2/5, \code{Q\_spread} 2/5, \code{hop\_rise} 1/5 \\ +\bottomrule\end{tabular}\end{center} +\begin{center}\footnotesize Rank 1 = the published capture is the \emph{highest} of that root's distinct captures on that axis.\end{center} + +\noindent 1 of 3 figures regenerates \textbf{exactly} from the settings printed in their captions --- \code{demo\_80\_t0025}'s trace md5 \code{ca4ce6e148ad5c45\ldots} is reproduced bit-for-bit by an independent re-capture. The others were captured before \code{--proposer-seed} existed (\code{proposer\_seed: null} in their manifests), so they reproduce only in distribution; re-capturing them under a seed would change the published images, so the ranges above stand in place of a bit-exact claim. + +\noindent \textbf{Are the caption numbers the optimistic end of their own spread?} Counted rather than asserted, over the 11 (figure, axis) cells with a non-degenerate spread (1 further cell is a tie across all captures): the published capture is the \emph{highest} of its replicates in \textbf{4} of them, against 1.6 expected if it were a random draw from its own captures. So yes, on balance the published numbers lean optimistic --- which is what picking a root from one capture per root does: the root is chosen because that capture scored high. But the lean is not uniform, and the exceptions matter as much: \code{Q\_spread} on \code{demo\_36\_t0056} (6/6) sits at the \emph{bottom} of its spread. The figures are kept because on \code{frac\_green} and $Q$ spread the margin over the rival roots is an order of magnitude, far outside any of these spreads; the ranges, not the single numbers, are the honest form of every statistic in this section. + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16_split2b256.jpg} +\caption{Piece-Cov (two\_piece\_expert\_play), failure root \code{demo\_18} frame 96 --- the sharpest candidate-level split (\code{cand\_any\_green} 0.828, the most BALANCED of 8 measured roots). \code{cand\_any\_green} 0.828, \code{frac\_green} 0.120, $Q\in[0.0014,0.9206]$ (spread 0.919), argmax candidate 82 (green future: yes), green fraction 0.25 at hop 1 $\to$ 0.05 at hop 8 (hop rise -0.074). Settings identical to every figure above (successor \code{runs//rsm/L40/ckpt\_best.pt}, hop head \code{gauss}, $\beta$=0.95, $L$=8, $\gamma$=0.99, $T$=1, $N$=128, $P$=16, proposer \code{model\_epoch\_5000.pth}); tiles are \code{[retrieval $|$ decoded]} at 256\,px. \textbf{Panel fidelity:} decoded hops of this root carry 0.62 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.96; exact all-pairs over 8 hops). Capture noise: 3 independent re-captures of this root under the same (unseeded) protocol give $0.60$--$0.61$, so read the figure above as this \emph{capture}, not as a stable property of the root. This capture's value lies outside that range.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/two_piece_expert_play/tree_two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16_split2b256.jpg} +\caption{Piece-Cov (two\_piece\_expert\_play), failure root \code{demo\_80} frame 25 --- the futures chaining into the success set (largest positive hop rise, +0.177, of 8 measured roots). \code{cand\_any\_green} 1.000, \code{frac\_green} 0.256, $Q\in[0.2571,0.6245]$ (spread 0.367), argmax candidate 100 (green future: yes), green fraction 0.01 at hop 1 $\to$ 0.28 at hop 8 (hop rise +0.177). Settings identical to every figure above (successor \code{runs//rsm/L40/ckpt\_best.pt}, hop head \code{gauss}, $\beta$=0.95, $L$=8, $\gamma$=0.99, $T$=1, $N$=128, $P$=16, proposer \code{model\_epoch\_5000.pth}); tiles are \code{[retrieval $|$ decoded]} at 256\,px. \textbf{Panel fidelity:} decoded hops of this root carry 0.97 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 1.06; exact all-pairs over 8 hops). Capture noise: 3 independent re-captures of this root under the same (unseeded) protocol give $0.91$--$0.99$, so read the figure above as this \emph{capture}, not as a stable property of the root.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/_pdfjpg/stitching/square_expert_play/tree_square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_split2b256.jpg} +\caption{Square-Cov (square\_expert\_play), failure root \code{demo\_36} frame 56 --- the sharpest candidate-level split (\code{cand\_any\_green} 0.414, the most BALANCED of 3 measured roots) and the futures chaining into the success set (largest positive hop rise, +0.167, of 3 measured roots) --- one root carries both claims. \code{cand\_any\_green} 0.414, \code{frac\_green} 0.192, $Q\in[0.0000,0.6069]$ (spread 0.607), argmax candidate 38 (green future: yes), green fraction 0.02 at hop 1 $\to$ 0.30 at hop 8 (hop rise +0.167). Settings identical to every figure above (successor \code{runs//rsm/L40/ckpt\_best.pt}, hop head \code{gauss}, $\beta$=0.95, $L$=8, $\gamma$=0.99, $T$=1, $N$=128, $P$=16, proposer \code{model\_epoch\_5000.pth}); tiles are \code{[retrieval $|$ decoded]} at 256\,px. \textbf{Panel fidelity:} decoded hops of this root carry 0.90 of the hop-to-hop diversity of the true-future frames of the same episode at the same offsets (distance-to-dataset-mean ratio 0.95; exact all-pairs over 8 hops). Capture noise: 3 independent re-captures of this root under the same (unseeded) protocol give $0.21$--$0.58$, so read the figure above as this \emph{capture}, not as a stable property of the root. This capture's value lies outside that range.}\end{figure} +\clearpage + +\clearpage\section{Appendix: real-robot chain endpoints (gen\_q\#271)} +On the real \code{rsm\_cooking\_v5} data there is no simulator to re-render from, so the only renderer is retrieval --- but there the retrieval is \emph{exact}: the endpoint index the diagnostic reports is a row of \code{cache/real\_cooking\_v5}, which is packed 1:1 from the LeRobot parquet/mp4, so the row \emph{is} a recorded video frame. Each page shows, per anchor, the anchor state and the states the best- and worst-scoring of the 128 candidate chains reach after 4 hops of 100 frames. There are no green/red outlines here: on the real data the segment edge printed under each tile is the operator annotation, which is ground truth, whereas the success set in the sim figures is the reward head's own decision. + +\textbf{Read these as illustration, not as evidence.} The anchors on each page were \emph{selected} to be contrastive --- the best chain's endpoint on the arrival edge $\rightarrow$4, the worst chain's on the failure terminal $\rightarrow$6 --- so the pattern they show is true of those anchors by construction. The evidence is the pooled AUC in each caption, and the $\Delta Q$ printed under the worst tile is the honest scale of the effect: the best and worst of 128 candidate chains are separated by $\sim$0.001--0.015 in $Q$, i.e.\ the candidates are nearly tied. gen\_q\#271 has since \emph{retracted} the claim that head B stitches; \code{STITCH\_REPRODUCIBILITY.json} is the file to quote on that, and these pages make no claim beyond showing what the chains' endpoints look like. + +\paragraph{The chains collapse onto a handful of frames.} Rendering the endpoints made something visible that the scalar diagnostics did not. Over 150 anchors and 16 reward heads, the best-scoring chain's endpoint lands on only 61--80 \emph{distinct} rows after 4 hops (against 132--142 after 1 hop), and a \emph{single} row takes 33--51\% of them (1--3\% at 1 hop). That row is the same one for all 16 heads --- episode 169 frame 55, edge \code{2->3} of a successful episode --- which is what one expects if the collapse belongs to the shared endpoint \emph{flow}, the heads only scoring what it produces. Across all heads the best-endpoint rows span 323 of a 30255-row retrieval pool. Caveat: an endpoint row is the \emph{nearest neighbour} of the endpoint state in that pool, so this is collapse at the pool's resolution --- but that is exactly the space the diagnostic labels endpoints in, so a statistic computed there cannot separate anchors whose endpoints it cannot separate. This bears directly on gen\_q\#271's open question of why a flat, episode-level label (\code{v0lit}) scores as well as the trained ones. Numbers: \code{status/real/ENDPOINT\_COLLAPSE.json} (\code{scripts/real/endpoint\_collapse.py}). + +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_A.png} +\caption{Real-robot chain endpoints, reward head \code{A} (pooled AUC 0.614 at hop 4). Endpoint flow \code{R\_M/ckpt\_s100000.pt}, proposer \code{model\_epoch\_2000.pth}, read-out d1 $\beta$=0.99, $T$=25.0, $P$=16, $N$=128 candidates. Source: \code{REWARD\_HEAD\_DIAG\_STITCH.json}.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_B.png} +\caption{Real-robot chain endpoints, reward head \code{B} (pooled AUC 0.686 at hop 4). Endpoint flow \code{R\_M/ckpt\_s100000.pt}, proposer \code{model\_epoch\_2000.pth}, read-out d1 $\beta$=0.99, $T$=25.0, $P$=16, $N$=128 candidates. Source: \code{REWARD\_HEAD\_DIAG\_STITCH.json}.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_C3.png} +\caption{Real-robot chain endpoints, reward head \code{C3} (pooled AUC 0.680 at hop 4). Endpoint flow \code{R\_M/ckpt\_s100000.pt}, proposer \code{model\_epoch\_2000.pth}, read-out d1 $\beta$=0.99, $T$=25.0, $P$=16, $N$=128 candidates. Source: \code{REWARD\_HEAD\_DIAG\_STITCH.json}.}\end{figure} +\clearpage +\begin{figure}[t]\centering +\includegraphics[width=\linewidth,height=0.80\textheight,keepaspectratio]{/proj/dmfexp/zwhong/rsm_rise/docs/figs/real_stitch/endpoints_hop4_v0lit.png} +\caption{Real-robot chain endpoints, reward head \code{v0lit} (pooled AUC 0.697 at hop 4). Endpoint flow \code{R\_M/ckpt\_s100000.pt}, proposer \code{model\_epoch\_2000.pth}, read-out d1 $\beta$=0.99, $T$=25.0, $P$=16, $N$=128 candidates. Source: \code{REWARD\_HEAD\_DIAG\_STITCH.json}.}\end{figure} +\clearpage +\end{document} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/docs/tex/tdflow_normaliser_note.tex b/gen_q_rsm/rsm_rise/pipeline/docs/tex/tdflow_normaliser_note.tex new file mode 100644 index 0000000000000000000000000000000000000000..569f45337a43f6b093fee1e0aad18c99765e9e32 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/docs/tex/tdflow_normaliser_note.tex @@ -0,0 +1,26 @@ +% Moved out of the tab:matched_actor caption (2026-09-21): the caption block exceeded tectonic's +% table-block size limit (5667 B; "Dimension too large" at flagship_table.tex:128), and this passage is +% a methods note rather than a reading aid for the table. +\subsection{TD-Flow: fitting the residual normaliser} +\label{sec:tdflow-normaliser} +The TD-Flow baseline shares the successor field, architecture, discount band and reward head with RSM and +differs only in fitting the occupancy by TD bootstrapping off an EMA twin instead of by Monte Carlo, so the +pair isolates the single clause the method claims. One implementation detail is load-bearing, and we report +it because we got it wrong first: the flow's residual normaliser must be fitted on the \emph{logged} +residual on both paths. Fitting it on the bootstrapped target makes the target's scale feed back into its +own normaliser, which has no fixed point short of the clip box; ours reached $15{\times}$ the dispersion the +occupancy actually has before the target-dispersion diagnostic caught it. A TD baseline broken that way +would have produced exactly the result the method predicts, which is why the diagnostic is reported beside +the baseline's score rather than only checked once. + +\subsection{The added best-of-$N$ scorers} +\label{sec:added-scorers} +All four rank the \emph{same} $128$ candidates drawn from the same RISE actor, so they differ from RSM only +in the ranking function. \textbf{TD-Flow} shares the successor field, architecture, discount band and reward +head with RSM and fits the occupancy by TD bootstrapping off an EMA twin instead of by Monte Carlo, so the +RSM/TD-Flow pair isolates the single clause the method claims; its residual-normaliser pitfall is +\S\ref{sec:tdflow-normaliser}. \textbf{LeWM} and \textbf{DINO-WM} are learned world models rolled forward +under the candidate action chunk with a reward probe on the same label. \textbf{IFQL} is the critic of +implicit flow Q-learning, a second value function trained on the same label. Each column is the best of the +configurations evaluated for it on this proposer, and those budgets differ between columns and are stated in +the table rather than assumed equal. diff --git a/gen_q_rsm/rsm_rise/pipeline/hf_ckpt.py b/gen_q_rsm/rsm_rise/pipeline/hf_ckpt.py new file mode 100644 index 0000000000000000000000000000000000000000..11a0cf051939061ae4fc61f1f3d56d8cd79d6733 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/hf_ckpt.py @@ -0,0 +1,69 @@ +"""Fetch rsm_rise checkpoints from Hugging Face (or use the cluster copy when it is present). + + from rsm_rise.pipeline.hf_ckpt import fetch, fetch_source + p = fetch("square_sub_20100/rsm/M/ckpt_best.pt") # sim repo, hf_path from manifest.tsv + p = fetch("openpi/checkpoints/pi05_cooking_stock/stock_s0/29999", repo=REAL, folder=True) # orbax dir + p = fetch_source("/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/M/ckpt_best.pt") # by cluster path + +Repos (all public): + rli14/rsm_rise_sim_checkpoints -- every sim checkpoint a paper table cell loads (+ rsmpi/), manifest.tsv + rli14/rsm_real_checkpoints -- real-robot cooking v6/v7/rw/pi0.5 checkpoints not in the v5 repo or bucket + rli14/rsm_cooking_v5_checkpoints -- curated real-robot v5 deliverable (renamed files, see its model card) + rli14/rsm_rise_code -- code snapshot +hf_path layout mirrors rsm_rise/runs/ ("///..."), plus "/cache/" (= rsm_rise/cache//) +and "rsmpi//round/..." (= runs//rsmpi/r/...). +""" +import csv +import os + +SIM = "rli14/rsm_rise_sim_checkpoints" +REAL = "rli14/rsm_real_checkpoints" +V5 = "rli14/rsm_cooking_v5_checkpoints" +CODE = "rli14/rsm_rise_code" +PROJ_ROOT = os.environ.get("RSM_RISE_ROOT", "/proj/dmfexp/zwhong/rsm_rise") + + +def local_path(hf_path, repo=SIM, root=PROJ_ROOT): + """Cluster location of an hf_path (may not exist off-cluster).""" + parts = hf_path.split("/") + if repo == SIM and len(parts) > 2 and parts[1] == "cache": + return os.path.join(root, "cache", parts[0], *parts[2:]) + if repo == SIM and parts[0] == "rsmpi": + return os.path.join(root, "runs", parts[1], "rsmpi", "r" + parts[2].replace("round", ""), *parts[3:]) + return os.path.join(root, "runs", hf_path) + + +def fetch(hf_path, repo=SIM, folder=False, prefer_local=True, cache_dir=None): + """Return a local path for hf_path: the cluster copy if it exists, else download (file or whole folder).""" + lp = local_path(hf_path, repo) + if prefer_local and os.path.exists(lp): + return lp + if folder: + from huggingface_hub import snapshot_download + d = snapshot_download(repo, allow_patterns=[hf_path.rstrip("/") + "/*"], cache_dir=cache_dir) + return os.path.join(d, hf_path) + from huggingface_hub import hf_hub_download + return hf_hub_download(repo, hf_path, cache_dir=cache_dir) + + +_MAN = {} + + +def manifest(repo=SIM): + """{source_path: row} from the repo's manifest.tsv (hf_path, source_path, bytes, sha256, n_cells, example_cell).""" + if repo not in _MAN: + from huggingface_hub import hf_hub_download + with open(hf_hub_download(repo, "manifest.tsv")) as f: + _MAN[repo] = {r["source_path"]: r for r in csv.DictReader(f, delimiter="\t")} + return _MAN[repo] + + +def fetch_source(source_path, repo=SIM, **kw): + """Map an absolute cluster checkpoint path (as printed in an eval cell JSON) to its HF copy.""" + if os.path.exists(source_path) and kw.get("prefer_local", True): + return source_path + m = manifest(repo) + r = m.get(source_path) or m.get(os.path.realpath(source_path)) + if r is None: + raise KeyError(f"{source_path} is not in {repo}/manifest.tsv") + return fetch(r["hf_path"], repo=repo, prefer_local=False, **kw) diff --git a/gen_q_rsm/rsm_rise/pipeline/output/ARM_STATUS.txt b/gen_q_rsm/rsm_rise/pipeline/output/ARM_STATUS.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0f09631303009de08d4ad09df9e7af633a887fc --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/ARM_STATUS.txt @@ -0,0 +1,7 @@ +square_sub_20100: TABLE 52.0% (1 seed(s), M@best b0.9 L2 N8) | TOPUP 1/9 cells on Mb b0.9 L2 N8 +square_expert_play: TABLE 12.4% (3 seed(s), L40@best b0.9 L2 N128) | TOPUP 9/9 cells on L40b b0.9 L2 N128 +two_piece_expert_suboptimal: TABLE 48.0% (1 seed(s), M@s100000 b0.95 L2 N128) | TOPUP 1/9 cells on Ms100k b0.95 L2 N128 +two_piece_expert_play: TABLE 50.8% (3 seed(s), L40@best b0.98 L8 N128) | TOPUP 8/9 cells on L40b b0.98 L8 N128 +mug_expert_suboptimal: TABLE 11.1% (3 seed(s), M_s1@best b0.95 L1 N128) | TOPUP 9/9 cells on Ms1b b0.95 L1 N128 +threading_expert_play: TABLE 18.5% (3 seed(s), M@s100000 b0.9 L1 N128) | TOPUP 9/9 cells on Ms100k b0.9 L1 N128 +two_piece_expert_play_tipping: TABLE 8.0% (1 seed(s), M@best b0.95 L4 N128) | TOPUP 1/9 cells on Mb b0.95 L4 N128 diff --git a/gen_q_rsm/rsm_rise/pipeline/output/FLAGSHIP_SINGLE_ACTOR.md b/gen_q_rsm/rsm_rise/pipeline/output/FLAGSHIP_SINGLE_ACTOR.md new file mode 100644 index 0000000000000000000000000000000000000000..a8f9b67f7cb471a88f4f89b581ee40a765bbc172 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/FLAGSHIP_SINGLE_ACTOR.md @@ -0,0 +1,33 @@ +**Flagship — RISE-faithful (data-provenance) reward.** mean ± SE across seeds (subscript = seed count; † = single seed, binomial SE); Δ = margin over strongest baseline (* p<0.05, two-proportion z). Bold = best in row. RISE-g = RISE actor sampled once, no critic ranking. + +| Task | BC | BC-u | RISE-g | IDQL | RISE | IFQL | RSM (ours) | Δ | +|---|---|---|---|---|---|---|---|---| +| Square (Cov.) | 9.2±2.0₍3₎ | 3.1±0.6₍3₎ | 7.3±1.3₍3₎ | -- | 3.7±0.2₍3₎ | n/a | **17.6±1.2₍3₎** | +8.3* | +| Piece (Sub.) | 13.8±1.3₍3₎ | 33.4±1.6₍3₎ | 30.7±2.2₍3₎ | 24.2±3.6₍3₎ | 22.4±6.1₍3₎ | n/a | **45.9±3.6₍3₎** | +13.7* | +| Piece (Cov.) | 16.4±0.5₍3₎ | 25.3±2.2₍3₎ | 29.9±1.3₍3₎ | 12.9±1.6₍2₎ | 6.0±1.6₍3₎ | n/a | **50.0±1.3₍3₎** | +20.3* | +| Mug (Sub.) | **14.4±0.6₍3₎** | 4.9±0.2₍3₎ | 4.5±0.5₍3₎ | -- | 5.8±1.6₍3₎ | n/a | 12.7±1.2₍3₎ | -1.5 | +| Thread (Cov.) | 12.9±1.0₍3₎ | 1.3±0.2₍3₎ | 1.2±0.3₍3₎ | -- | 3.5±1.1₍3₎ | n/a | **13.2±2.5₍3₎** | +0.1 | +| Piece-tip (Cov.) | 0.8±0.1₍3₎ | 1.0±0.2₍3₎ | 1.0±0.5₍3₎ | -- | 2.9±0.6₍3₎ | n/a | **6.9±0.8₍3₎** | +4.0* | + +**Throughput** = success rate × horizon / mean steps-to-success + +| Task | BC | BC-u | RISE-g | IDQL | RISE | IFQL | RSM | Δ | +|---|---|---|---|---|---|---|---|---| +| Square (Cov.) | **0.093±0.021** | 0.031±0.006 | 0.074±0.014 | -- | 0.037±0.002 | n/a | -- | -- | +| Piece (Sub.) | 0.127±0.014 | **0.378±0.029** | 0.338±0.028 | 0.263±0.043 | 0.249±0.062 | n/a | -- | -- | +| Piece (Cov.) | 0.189±0.003 | 0.275±0.021 | **0.315±0.015** | 0.132±0.016 | 0.065±0.009 | n/a | -- | -- | +| Mug (Sub.) | **0.151±0.007** | 0.049±0.002 | 0.046±0.005 | -- | 0.059±0.016 | n/a | -- | -- | +| Thread (Cov.) | **0.141±0.001** | 0.015±0.004 | 0.012±0.003 | -- | 0.034±0.013 | n/a | -- | -- | +| Piece-tip (Cov.) | 0.003±0.003 | 0.013† | 0.010±0.005 | -- | **0.024±0.008** | n/a | -- | -- | + +**Matched proposer (BC-union, N=128): same candidates, different scorer.** greedy = no ranking; IQL = IQL critic; RSM = ours. Read *vs. greedy* as what selection buys — the IQL critic is a weak ranker here. + +| Task | greedy | IQL | RSM | vs. greedy | vs. IQL | +|---|---|---|---|---|---| + +**Matched proposer, RISE's own actor (N=128): RISE's policy, RISE's reward, only the scorer swapped.** RISE-g = actor sampled once; RISE = its critic-ranked rollout; RSM = ours. + +| Task | RISE-g | RISE | RSM | vs. RISE-g | vs. RISE | +|---|---|---|---|---|---| + +Selection verdicts: 6 survive both controls, 0 below own no-selection control, 0 undecided. Total episodes: 3900. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/FLAGSHIP_TABLE.md b/gen_q_rsm/rsm_rise/pipeline/output/FLAGSHIP_TABLE.md new file mode 100644 index 0000000000000000000000000000000000000000..71bd22d627828fe13ceace05b1e066572e0c3396 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/FLAGSHIP_TABLE.md @@ -0,0 +1,35 @@ +**Flagship — RISE-faithful (data-provenance) reward.** mean ± SE across seeds (subscript = seed count; † = single seed, binomial SE); Δ = margin over strongest baseline (* p<0.05, two-proportion z). Bold = best in row. RISE-g = RISE actor sampled once, no critic ranking. + +| Task | BC | BC-u | RISE-g | IDQL | RISE | RSM (ours) | Δ | +|---|---|---|---|---|---|---|---| +| Square (Sub.) | 10.4±1.0₍3₎ | 48.0±1.4₍3₎ | -- | -- | -- | **51.8±2.1₍3₎** | +3.2 | +| Square (Cov.) | 9.2±2.0₍3₎ | 3.1±0.6₍3₎ | 6.2±1.7₍3₎ | -- | 2.9±0.6₍3₎ | **12.4±2.0₍3₎** | +3.2 | +| Piece (Sub.) | 13.8±1.3₍3₎ | 33.4±1.6₍3₎ | 30.7±2.2₍3₎ | 24.2±3.6₍3₎ | 22.4±6.1₍3₎ | **46.9±2.9₍3₎** | +13.6* | +| Piece (Cov.) | 16.4±0.5₍3₎ | 25.3±2.2₍3₎ | 29.9±1.3₍3₎ | 12.9±1.6₍2₎ | 6.0±1.6₍3₎ | **50.0±1.8₍3₎** | +20.3* | +| Mug (Sub.) | 7.0±0.9₍3₎ | 1.5±0.2₍3₎ | 1.5±0.6₍3₎ | -- | 1.2±0.3₍3₎ | **11.1±1.2₍3₎** | +4.2* | +| Thread (Cov.) | 12.9±1.0₍3₎ | 1.3±0.2₍3₎ | 1.0±0.3₍3₎ | -- | 3.4±1.0₍3₎ | **18.6±2.2₍3₎** | +5.4* | +| Piece-tip (Cov.) | 0.8±0.1₍3₎ | 1.0±0.2₍3₎ | 0.9±0.4₍3₎ | -- | 2.8±0.5₍3₎ | **6.7±1.3₍3₎** | +3.8* | + +**Throughput** = success rate × horizon / mean steps-to-success + +| Task | BC | BC-u | RISE-g | IDQL | RISE | RSM | Δ | +|---|---|---|---|---|---|---|---| +| Square (Sub.) | 0.110±0.011 | 0.570±0.018 | -- | -- | -- | **0.627±0.032** | +0.049 | +| Square (Cov.) | 0.093±0.021 | 0.031±0.006 | 0.063±0.018 | -- | 0.029±0.006 | **0.127±0.021** | +0.034 | +| Piece (Sub.) | 0.127±0.014 | 0.378±0.029 | 0.338±0.028 | 0.263±0.043 | 0.249±0.062 | **0.549±0.043** | +0.168 | +| Piece (Cov.) | 0.189±0.003 | 0.275±0.021 | 0.315±0.015 | 0.132±0.016 | 0.065±0.009 | **0.558±0.024** | +0.244 | +| Mug (Sub.) | 0.056±0.002 | 0.012±0.003 | 0.015±0.006 | -- | 0.015±0.003 | **0.113±0.012** | +0.058 | +| Thread (Cov.) | 0.139±0.002 | 0.015±0.004 | 0.010±0.003 | -- | 0.031±0.013 | **0.203±0.026** | +0.063 | +| Piece-tip (Cov.) | 0.003±0.003 | 0.013† | 0.009±0.004 | -- | 0.021±0.007 | **0.067±0.013** | +0.046 | + +**Matched proposer (BC-union, N=128): same candidates, different scorer.** greedy = no ranking; IQL = IQL critic; RSM = ours. Read *vs. greedy* as what selection buys — the IQL critic is a weak ranker here. + +| Task | greedy | IQL | RSM | vs. greedy | vs. IQL | +|---|---|---|---|---|---| +| Square (Sub.) | 48.0 | -- | **51.2**₍3₎ | +3.2 | -- | +| Piece (Sub.) | 32.3 | 16.0 | **44.3**₍3₎ | +12.0 | +28.3 | +| Piece (Cov.) | 25.8 | 5.3 | **27.8**₍2₎ | +2.0 | +22.5 | +| Thread (Cov.) | 1.5 | 4.7 | **5.0**₍2₎ | +3.5 | +0.3 | +| Piece-tip (Cov.) | 1.0 | 1.3 | **6.7**₍1₎ | +5.7 | +5.3 | + +Selection verdicts: 5 survive both controls, 0 below own no-selection control, 2 undecided. Total episodes: 5200. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/HELDOUT_AND_NULL.txt b/gen_q_rsm/rsm_rise/pipeline/output/HELDOUT_AND_NULL.txt new file mode 100644 index 0000000000000000000000000000000000000000..67423d7b9a00ac43c78fe957c839592ce7700314 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/HELDOUT_AND_NULL.txt @@ -0,0 +1,18 @@ +task arm (chosen on seed 0) sel held-out n base delta +square_sub_20100 M@best b0.9 L16 N8 53.3 47.7 300 48.0 -0.3 +square_expert_play L40@best b0.9 L2 N128 15.3 11.0 300 9.2 +1.8 +two_piece_expert_suboptim M@s100000 b0.9 L3 N128 52.5 43.8 450 32.9 +10.9* +two_piece_expert_play L40@best b0.95 L3 N16 50.0 35.7 300 25.6 +10.0* +mug_expert_suboptimal M_s1@best b0.95 L1 N16 12.0 10.0 300 6.9 +3.1 +threading_expert_play M@s100000 b0.9 L2 N128 18.0 -- 0 no held-out seed yet +two_piece_expert_play_tip M@best b0.95 L2 N128 8.0 3.2 250 2.1 +1.1 + +max-over-arms null (all arms share the task's pooled rate) +task arms observed max E[max] p95 +square_sub_20100 16 52.0 48.5 56.0 +square_expert_play 27 12.4 9.8 12.0 +two_piece_expert_suboptim 131 48.0 44.0 50.0 +two_piece_expert_play 79 50.8 42.6 48.0 +mug_expert_suboptimal 37 11.1 14.2 18.0 +threading_expert_play 82 18.5 18.6 22.0 +two_piece_expert_play_tip 35 8.0 7.9 11.0 diff --git a/gen_q_rsm/rsm_rise/pipeline/output/MASTER_TABLE.md b/gen_q_rsm/rsm_rise/pipeline/output/MASTER_TABLE.md new file mode 100644 index 0000000000000000000000000000000000000000..1cf5064e3ef9973e048effc21eed511725774a74 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/MASTER_TABLE.md @@ -0,0 +1,142 @@ +# Master results table + +## 0. Single-actor flagship — RSM proposes from the RISE actor on every task + +RISE and RSM differ only in the scorer (same S0A candidates, N=128); IDQL uses its own co-trained actor. No per-task proposer choice. mean ± SE across seeds (subscript = seed count); Δ = margin over the strongest baseline (* p<0.05). RISE-g = the RISE actor sampled once. Tasks missing here have no RISE-actor RSM cells yet (square Sub.: S0A policy training; mug: relaxed-criterion re-evaluation running). + +| Task | BC | BC-u | RISE-g | IDQL | RISE | RSM (ours, RISE actor) | Δ | +|---|---|---|---|---|---|---|---| +| Square (Cov.) | 9.2±2.0₍3₎ | 3.1±0.6₍3₎ | 7.3±1.3₍3₎ | -- | 3.7±0.2₍3₎ | -- | **17.6±1.2₍3₎** | +8.3* | +| Piece (Sub.) | 13.8±1.3₍3₎ | 33.4±1.6₍3₎ | 30.7±2.2₍3₎ | 24.2±3.6₍3₎ | 22.4±6.1₍3₎ | 0.0±0.0₍2₎ | **45.9±3.6₍3₎** | +13.7* | +| Piece (Cov.) | 16.4±0.5₍3₎ | 25.3±2.2₍3₎ | 29.9±1.3₍3₎ | 12.9±1.6₍2₎ | 6.0±1.6₍3₎ | 0.3±0.3₍2₎ | **50.0±1.8₍3₎** | +20.3* | +| Mug (Sub.) | **14.4±0.6₍3₎** | 4.9±0.2₍3₎ | 4.5±0.5₍3₎ | -- | 5.8±1.6₍3₎ | 2.0±1.1†₍1₎ | 12.7±1.2₍3₎ | -1.5 | +| Thread (Cov.) | 12.9±1.0₍3₎ | 1.3±0.2₍3₎ | 1.2±0.3₍3₎ | -- | 3.5±1.1₍3₎ | -- | **13.6±2.6₍3₎** | +0.4 | +| Piece-tip (Cov.) | 0.8±0.1₍3₎ | 1.0±0.2₍3₎ | 1.0±0.5₍3₎ | -- | 2.9±0.6₍3₎ | 0.0±0.0†₍1₎ | **6.9±0.8₍3₎** | +4.0* | + +**Same-actor margins** (paired cells, RISE-actor proposer): greedy / RISE critic / RSM / vs greedy / vs RISE + +| Task | RISE-g | RISE | RSM | vs. RISE-g | vs. RISE | +|---|---|---|---|---|---| + +*horizon* is the rollout budget in environment steps, with the median expert demonstration length in parentheses: a policy slower than its demonstrator times out. **Column meanings.** *vs same policy, no selection* is the paired difference against that very policy rolled out greedily, i.e. what best-of-N selection adds. *vs random-candidate control* draws the same N candidates from the same proposer and picks one at random (permuted scores); it separates a real value ranking from the benefit of merely drawing N candidates. NOTE (audit 2026-09-21): on 6/7 flagship rows the permuted run used a different successor configuration from the reported arm, so it is a random-candidate control, not a shuffle of the reported arm's own scores. *IDQL critic, same proposer* is IDQL's own critic scoring candidates drawn from the SAME policy the RSM arm selects from, so only the scorer differs -- RISE by contrast keeps its own policy, because its proposer is part of that method. *vs BEST baseline* compares against the strongest of BC, BCU, IDQL and RISE on that task. Every row states the **evaluation region**: the box the object is randomly placed in at reset. Success rates are only comparable within a region -- square-peg BC-expert is 2.6 % over the coverage box and 10.9 % over the much smaller `square_image_ood` box -- so the loaders never pool two regions and `docs/REGIONS.md` lists every region any number was measured in. All cells are policy epoch 5000, horizon 400, on our data, 3 training seeds x 3 eval seeds unless the n says otherwise. **BC** = diffusion policy on the expert demonstrations; **BCU** = on expert + non-expert; **RISE** = RISE's policy + its IQL critic choosing among 128 candidates; **IDQL** = RISE without augmentation or the Lipschitz penalty. **RSM** = our successor-model value choosing among N candidates from the named proposer. *head* is the reward the successor model scores: `membership` is RISE's own 0/1 expert label (what every baseline also trains on), `progress` is our shaped label from privileged sim state. *beta* is the geometric horizon parameter of the successor flow and *hops* the number of composed flow steps in the read-out. Deltas are exact paired McNemar tests against the same proposer's greedy rollouts and against the random-candidate control; a **win** needs both below p = 0.05. + + +## 0. Upper bound --- what the table becomes if the single-seed winners reproduce + +**Today** is the best arm verified at three policy seeds. **Ceiling** is the best *mean* over any arm, pooled across whatever seeds that arm actually has (1, 2 or 3) -- so a ceiling at 3/3 seeds is already verified and equals today, while a ceiling at 1/3 is a candidate the top-up is testing. The seed and episode counts behind the ceiling are given so a 50-episode single-seed number is never mistaken for a 450-episode verified one. + +This is an UPPER BOUND, not a forecast. Each ceiling rests on 50-100 episodes at one policy seed, picked as the maximum over 27-119 arms, so it is upward biased twice over: by selection and by small n. Every time a single-seed maximum on this project was actually verified it fell: -7.2, -7.6, -10.2 points. + +| task | best baseline | today (3 seeds) | verdict | ceiling (best mean) | ceiling seeds | ceiling episodes | margin at ceiling | verdict at ceiling | +|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 48.0 | 51.3 (450 ep) | win | 58.0 | 1/3 | 50 | +10.0 | win *(pending 2 seed(s))* | +| square-peg (Coverage) | 9.2 | 17.6 (450 ep) | win | 17.6 | 3/3 | 450 | +8.3 | win | +| piece-assembly (Suboptimal) | 32.9 | 46.6 (500 ep) | win | 54.0 | 1/3 | 50 | +21.1 | win *(pending 2 seed(s))* | +| piece-assembly (Coverage) | 29.7 | 50.0 (450 ep) | win | 52.0 | 1/3 | 50 | +22.3 | win *(pending 2 seed(s))* | +| mug-cleanup (Suboptimal) | 14.2 | 17.1 (450 ep) | win | 17.1 | 3/3 | 450 | +2.9 | win | +| threading (Coverage) | 13.2 | 18.5 (1950 ep) | win | 22.0 | 1/3 | 50 | +8.8 | win *(pending 2 seed(s))* | +| piece-assembly tip (Coverage) | 1.0 | 6.9 (450 ep) | win | 6.9 | 3/3 | 450 | +5.8 | win | + +**7 of 7 rows win today; 7 of 7 would win at the ceiling.** 3 ceiling(s) are already verified at 3 seeds and will not move. + +## 1. Flagship comparison --- RISE-faithful reward (reward-matched) + +**Reward structure is matched across every column.** RISE's reward is data PROVENANCE, not outcome: `relabel_rewards.py` writes a constant over every frame of an episode (1 for the expert file, 0 for the non-expert file) and `iql_diffusion.py` consumes that field unchanged. So BC and BCU use no reward, the RISE and IDQL critics use the provenance label, and the RSM arm below uses the *same* provenance label (`membership` head). Nothing here sees a signal the others do not. + +One row per task: the strongest membership-head RSM arm in that task's canonical evaluation region, against every baseline. Where the strongest arm is not yet verified on three training seeds it is shown as a **TEMPORARY flagship**; quote such a row only with its seed count. + +**Selection verdict across the 7 flagship rows: 5 beat both controls, 0 score BELOW their own no-selection control, 2 are undecided (mostly 50-episode single-seed cells).** A row can beat every baseline and still be carried by its proposer rather than by the scorer; the two control columns are what separate those cases, and the verdict column now always reports them. + +| task | expert / non-expert traj | horizon (median expert demo) | eval region (object start box) | BC | BCU | IDQL | RISE | **RSM** | throughput | mean steps | seeds (train x eval) | per seed | episodes/cell | n total | proposer | head | beta | hops | N | IDQL critic, same proposer | vs same policy, no selection | vs shuffled-score control | vs BEST baseline | verdict | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 20 / 100 | 400 (173) | nut [0,0.12],[-0.225,0] | 10.4 | 48.0 | 52.0 @ep3000 *(interim)* | 52.0 @ep3000 *(interim)* | **51.3** | -- | -- | 3x3 | 49/55/50 | 50 | 450 | BC-unified | membership | 0.9 | 3 | 128 | -- | +3.3 (p=0.248) | +2.0 (p=0.504) | +3.3 vs BCU | no gain | +| square-peg (Coverage) | 200 / 224 | 400 (374) | nut [-0.115,-0.09],[-0.12,0.11] | 9.2 | 3.1 | 5.0 @ep3000 *(interim)* | 3.7 | **17.6** | -- | -- | 3x3 | 17/16/20 | 50 | 450 | RISE policy | membership | 0.95 | 8 | 128 | -- | +11.3 (p=0.000) | +11.3 (p=0.000) | +8.3 vs BC | **win** | +| piece-assembly (Suboptimal) | 20 / 100 | 400 (317) | piece1 [-0.22,-0],[0,0.22] | 13.8 | 32.9 | 26.2 | 30.7 | **46.6** | -- | -- | 3x3 | 52/45/40 | 55 | 500 | RISE policy | membership | 0.9 | 3 | 128 | 20.7 | +15.6 (p=0.000) | +16.8 (p=0.000) | +13.7 vs BCU | **win** | +| piece-assembly (Coverage) | 200 / 199 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 16.4 | 25.6 | 12.6 | 6.1 | **50.0** | -- | -- | 3x3 | 49/47/53 | 50 | 450 | RISE policy | membership | 0.95 | 8 | 128 | 6.7 | +17.1 (p=0.000) | +15.1 (p=0.000) | +20.3 vs RISEg | **win** | +| mug-cleanup (Suboptimal) | 20 / 100 | 400 (356) | nut [0,0.12],[-0.225,0] | 14.2 | 4.9 | *training, ep 1845-4996/5000, 0 running* | 5.8 | **17.1** | -- | -- | 3x3 | 15/18/18 | 50 | 450 | BC-expert | membership | 0.95 | 1 | 128 | -- | +2.7 (p=0.276) | -0.4 (p=0.928) | +2.9 vs BC | no gain | +| threading (Coverage) | 250 / 200 | 400 (215) | needle [-0.2,0.12],[0.05,0.25] | 13.2 | 1.4 | 1.0 @ep3000 *(interim)* | 3.5 | **18.5** | -- | -- | 3x3 | 17/23/16 | 216 | 1950 | BC-expert | membership | 0.9 | 1 | 128 | 15.0 | +5.4 (p=0.000) | +4.2 (p=0.000) | +5.3 vs BC | **win** | +| piece-assembly tip (Coverage) | 200 / 504 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 0.9 | 1.0 | 1.0 @ep3000 *(interim)* | 3.3 | **6.9** | -- | -- | 3x3 | 8/7/5 | 50 | 450 | RISE policy | membership | 0.9 | 1 | 128 | 2.0 | +5.8 (p=0.000) | +6.2 (p=0.000) | +3.6 vs RISE | **win** | + +## 2. Alternative reward --- per-frame environment success (backup flagship) + +The `completion` head scores per-frame task success recovered by state replay, rather than data provenance. This is **not a correction to RISE, it is a different reward**: the paper never uses outcome labels. It is reported here as a legitimate alternative and would become the headline only if it beats section 1. Reward matching still requires the RISE and IDQL critics to be retrained on the same per-frame label, which has NOT been done, so a win here is not yet a matched win. + +Known defect: `train_goal_head.py` defaults to the PRE-settle label (`goal.npz`), which overcounts success by 1.85x to 2.86x against the corrected `goal_settle.npz`. Every existing completion checkpoint records `from goal.npz`, i.e. the uncorrected detector. These rows are provisional until retrained. + +*No completion-head arm has reached two training seeds yet, so there is nothing to report here.* + + +## 3. DISQUALIFIED --- dense privileged reward (oracle) + +**Do not quote.** The `progress` head regresses a dense hand-designed potential over privileged simulator state (end-effector-to-object and object-to-target distances; 4315 distinct values over 13973 grasped frames on piece-assembly). No other method sees it, so these rows are not reward-matched to anything printed beside them. Retired 2026-09-20; kept only so existing artefacts remain traceable. + +| task | expert / non-expert traj | horizon (median expert demo) | eval region (object start box) | BC | BCU | IDQL | RISE | **RSM** | throughput | mean steps | seeds (train x eval) | per seed | episodes/cell | n total | proposer | head | beta | hops | N | IDQL critic, same proposer | vs same policy, no selection | vs shuffled-score control | vs BEST baseline | verdict | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Coverage) | 200 / 224 | 400 (374) | nut [-0.115,-0.09],[-0.12,0.11] | 9.2 | 3.1 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **13.3** | -- | -- | 3x1 | 20/12/8 | 50 | 150 | BC-expert | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | -- | +3.3 (p=0.332) | -- | +4.1 vs BC | no gain; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| piece-assembly (Suboptimal) | 20 / 100 | 400 (317) | piece1 [-0.22,-0],[0,0.22] | 13.8 | 32.9 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **42.7** | -- | -- | 3x3 | 46/41/41 | 83 | 750 | BC-unified | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | -- | +9.7 (p=0.000) | -- | +9.8 vs BCU | control undecided; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| piece-assembly (Coverage) | 200 / 199 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 16.4 | 25.6 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **43.0** | -- | -- | 3x3 | 41/47/44 | 116 | 1050 | RISE policy | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | 6.7 | +12.6 (p=0.000) | -- | +13.3 vs RISEg | control undecided; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| piece-assembly tip (Coverage) | 200 / 504 | 400 (311) | piece1 [-0.22,0.22],[-0.22,0.22] | 0.9 | 1.0 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **29.5** | -- | -- | 3x3 | 27/29/34 | 44 | 400 | RISE policy | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | 2.0 | +28.5 (p=0.000) | -- | +26.2 vs RISE | control undecided; **DISQUALIFIED: dense privileged reward, not matched to any baseline** | +| square-peg (Coverage) — full-table region | 200 / 224 | 400 (374) | nut [-0.16,0.16],[-0.2,0.2] | 2.6 | 2.3 | *n/a: critic not retrained on this reward* | *n/a: critic not retrained on this reward* | **6.0** | -- | -- | 1x1 | 6 | 50 | 50 | RISE policy | progress **[ORACLE: dense privileged reward, NOT reward-matched, do not quote]** | 0.95 | 1 | 128 | -- | +6.0 (p=0.250) | +2.0 (p=1.000) | -- | no gain | + +## 4. Secondary results --- RISE-faithful reward (same regime as section 1) + +**Same reward regime as section 1**, so every column here is matched: BC/BCU use no reward, the RISE and IDQL critics and the RSM arm all use the provenance label. Rows land here for reasons of *evidence*, not reward: single-seed arms awaiting verification, alternate evaluation regions, and task variants whose trainings have not finished. Any row whose reward is not the provenance label is routed to section 2 or 3 instead, whichever code path produced it. + +| task | expert / non-expert traj | horizon (median expert demo) | eval region (object start box) | BC | BCU | IDQL | RISE | **RSM** | throughput | mean steps | seeds (train x eval) | per seed | episodes/cell | n total | proposer | head | beta | hops | N | IDQL critic, same proposer | vs same policy, no selection | vs shuffled-score control | vs BEST baseline | verdict | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) — released file, 5x the expert data of the flagship variant | 100 / 100 | 400 (173) | nut [0,0.12],[-0.225,0] | 60.2 | 55.9 | 71.3 | 47.9 | **72.7** | -- | -- | 3x3 | 79/75/64 | 50 | 450 | BC-unified | membership | 0.9 | 2 | 128 | 46.7 | +16.2 (p=0.000) | +17.8 (p=0.000) | +1.3 vs IDQL | **win** | +| square-peg (Suboptimal) — Table IV data regime | 20 / 80 | 400 (--) | nut [0,0.12],[-0.225,0] | *not launched* | *not launched* | *not launched* | *not launched* | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | + +## 5. Top-up plan --- which under-seeded arms are being verified + +A **valid top-up candidate** beats the best baseline AND has fewer than three policy seeds, i.e. it was never verified. An arm already at three seeds has been tested: its three-seed mean is the answer even if that mean fell below its seed-0 value, and re-running it only chases noise. Those are excluded by construction. + +Each top-up runs the arm at 3 policy seeds x 3 eval seeds, 50 episodes per cell, so a single 50-episode cell is replaced by 450 episodes. **Multiplicity warning:** these candidates were chosen by taking the maximum over 27-119 arms per row, so the reported maximum is upward biased; the top-up measures whether a specific arm holds, it does not remove the selection bias in how it was picked. + +| task | best baseline | arm's 1-seed score | proposer | recipe | seeds | eps so far | cells to run | +|---|---|---|---|---|---|---|---| +| square-peg (Suboptimal) | 48.0 | 58.0 | BC-unified | M@best b0.9 L1 N128 P16 prob | 1/3 | 50 | 6 | +| square-peg (Suboptimal) | | | | *+0 more candidates; 11 arm(s) already at 3 seeds and therefore NOT candidates* | | | | +| piece-assembly (Suboptimal) | 32.9 | 54.0 | BC-unified | M@s100000 b0.98 L2 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Suboptimal) | 32.9 | 48.0 | BC-unified | M_bcap@s100000 b0.99 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Suboptimal) | 32.9 | 48.0 | BC-unified | M@s100000 b0.99 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Suboptimal) | | | | *+50 more candidates; 8 arm(s) already at 3 seeds and therefore NOT candidates* | | | | +| piece-assembly (Coverage) | 29.7 | 52.0 | BC-unified | M@s100000 b0.99 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Coverage) | 29.7 | 46.0 | BC-unified | M@s100000 b0.98 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Coverage) | 29.7 | 46.0 | RISE policy | L40@best b0.95 L4 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly (Coverage) | | | | *+51 more candidates; 10 arm(s) already at 3 seeds and therefore NOT candidates* | | | | +| threading (Coverage) | 13.2 | 22.0 | BC-expert | L40@best b0.95 L3 N128 P256 logit | 1/3 | 50 | 6 | +| threading (Coverage) | 13.2 | 20.0 | BC-expert | M@s140000 b0.9 L3 N128 P256 logit | 1/3 | 50 | 6 | +| threading (Coverage) | 13.2 | 20.0 | BC-unified | M@s100000 b0.95 L1 N128 P16 prob | 1/3 | 50 | 6 | +| threading (Coverage) | | | | *+20 more candidates; 32 arm(s) already at 3 seeds and therefore NOT candidates* | | | | +| piece-assembly tip (Coverage) | 1.0 | 6.0 | BC-unified | M@best b0.98 L8 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly tip (Coverage) | 1.0 | 6.0 | BC-unified | M@best b0.98 L1 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly tip (Coverage) | 1.0 | 4.0 | BC-unified | M@best b0.98 L3 N128 P16 prob | 1/3 | 50 | 6 | +| piece-assembly tip (Coverage) | | | | *+8 more candidates; 15 arm(s) already at 3 seeds and therefore NOT candidates* | | | | + +**How the flagship arm was chosen.** Each row reports the best-scoring arm with at least two training seeds, where an arm is (successor model, reward head, beta, hops, read-out, candidate count, proposer). The table below states how many arms that maximum ranged over and what the runner-up scored. Best-to-runner-up gaps are small, i.e. the top of the distribution is a plateau rather than a spike, which is what a real effect looks like; but the baselines receive no equivalent search, each contributing one fixed configuration. See `docs/PROPOSER_SELECTION.md`, which also shows that the proposer choice survives held-out validation on a disjoint eval seed. + +| task | arms searched | best | runner-up | +|---|---|---|---| +| square-peg (Suboptimal) | 8 | 72.7 | 72.5 (gap +0.1) | +| square-peg (Coverage) | 41 | 17.6 | 16.0 (gap +1.6) | +| piece-assembly (Suboptimal) | 18 | 46.6 | 42.7 (gap +3.9) | +| piece-assembly (Coverage) | 12 | 50.0 | 50.0 (gap +0.0) | +| mug-cleanup (Suboptimal) | 23 | 17.1 | 12.7 (gap +4.4) | +| threading (Coverage) | 36 | 18.5 | 17.5 (gap +1.0) | +| piece-assembly tip (Coverage) | 17 | 6.9 | 6.3 (gap +0.6) | + +Mean over the 7 tasks with an RSM arm: best baseline 21.5, RSM **29.7**, margin **+8.2**. + + +For orientation only, the paper's Table I on the same task rows (different data mix and, on the piece tasks, a different success criterion, so NOT comparable to the columns above): + +| task | BC | BCU | IDQL | RISE | +|---|---|---|---|---| +| square-peg (Suboptimal) | 8.0 | 34.0 | 41.3 | 56.0 | +| square-peg (Coverage) | 18.7 | 0.0 | 19.6 | 50.7 | +| piece-assembly (Suboptimal) | 20.0 | 23.3 | 35.7 | 36.0 | +| piece-assembly (Coverage) | 14.7 | 2.0 | 16.3 | 70.7 | +| mug-cleanup (Suboptimal) | 31.3 | 32.7 | 36.7 | 40.7 | +| threading (Coverage) | 17.3 | 0.0 | 9.8 | 22.7 | +| piece-assembly tip (Coverage) | 0.0 | 0.0 | 8.0 | 51.3 | diff --git a/gen_q_rsm/rsm_rise/pipeline/output/SUCCESS_FUNCTIONS.md b/gen_q_rsm/rsm_rise/pipeline/output/SUCCESS_FUNCTIONS.md new file mode 100644 index 0000000000000000000000000000000000000000..89cd0509978c8031b835050ee41c5ba90c3d2f80 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/SUCCESS_FUNCTIONS.md @@ -0,0 +1,138 @@ +# Success criteria, per task + +What counts as a success in every task we evaluate, taken from the simulator source rather than from +documentation. Evaluation calls the environment's own `_check_success()` through +`sim_pipeline/envs/robosuite_wrapper.py:97`; RISE overrides it for no task, and the only custom success function +in the RISE repository is an unused one for a square *pushing* variant. + +An episode counts as a success if the criterion holds at **any** step, which is how +`sim_pipeline/eval/rollout_stats.py` aggregates (`avg_ep_success`). The same file also records success at the +final step, which we do not use. + +--- + +## square-peg (`square_expert_play`, `square_expert_suboptimal`, `square_sub_paper`) + +Environment `NutAssemblySquare`, criterion in robosuite `nut_assembly.py`. + +The square nut counts as placed when all three hold: + +| condition | threshold | +|---|---| +| horizontal distance from the peg, x | under 0.03 m | +| horizontal distance from the peg, y | under 0.03 m | +| nut height | below the table surface plus 0.05 m | + +plus a release condition: the gripper must be far enough away that `1 - tanh(10 * distance)` is under 0.6, +which is roughly 9 cm. So the nut has to be over the peg, dropped low, and no longer held. + +Unmodified. This is the stock robosuite criterion. + +## threading (`threading_expert_play`, `threading_paper`) + +Environment `Threading`, criterion in mimicgen `threading.py`. + +Success when the distance between the needle's tip geometry and the centre of the tripod's ring is less than the +ring's radius. The ring centre is the average of all the ring's surrounding geometries. There is no release or +height condition, so the criterion fires while the needle is still held. + +Unmodified. + +## mug-cleanup (`mug_expert_suboptimal`, `mug_paper`) + +Environment `MugCleanup`, criterion in mimicgen `mug_cleanup.py`. Three conditions, all required: + +| condition | test | +|---|---| +| the drawer is closed | drawer joint position above -0.01 | +| the mug is upright | 1 minus the z-component of the mug's z-axis is under 0.001 | +| the mug is in the drawer | the mug is in contact with the drawer's bottom geometry | + +The uprightness tolerance is strict, about 2.6 degrees of tilt. This is the longest task, and our policies reach +it late: successes first register around step 285 to 337 of a 400-step budget. + +**Modified 2026-09-21 (author communication to the owner):** the RISE authors scored mug-cleanup with the +RELAXED criterion -- the mug in the drawer only, neither upright nor drawer-closed required. Our evaluations +now use it (`RSM_RISE_MUG_SUCCESS=in_drawer`, exported by `scripts/eval_cell.sh`, gated in +`mimicgen_envs/envs/robosuite/mug_cleanup.py`, recorded per cell as `success_criterion.mug`). The +stock-criterion archive is quarantined in `runs/mug_expert_suboptimal/_stock_success/` and excluded by +`verdict_table.cells()`; it explains the 7-11 % BC-on-demos against the paper's 31.3. + +## two-piece assembly (`two_piece_expert_play`, `two_piece_expert_suboptimal`, `two_piece_expert_play_tipping`, `piecesub_paper`, `piecetip_paper`) + +Environment `ThreePieceAssembly`, criterion in mimicgen `three_piece_assembly.py`. **This is the one task where +we changed the criterion, and the change is necessary rather than optional.** + +The stock criterion requires all four of: + +1. horizontal distance from piece 1 to the base under 0.02 m, +2. horizontal distance from piece 1 to piece 2 under 0.02 m, +3. piece 2's height within 0.02 m of the base height plus four times piece 2's size, +4. the gripper not holding piece 2. + +The released RISE configuration never places piece 2. `RobomimicEnvType.get_object_names()` returns only +`['Base', 'Piece1']`, and the `Piece2` entry of the initial-range dictionary is commented out in +`configs/constants.py` and in all four three-piece environment configs, so no placement sampler is created for +it and it stays at the compiled model origin. Measured at reset: the base sits at height 0.839, piece 1 at 0.871 +and piece 2 at 0.0, which is about 0.74 m below where condition 3 needs it. The criterion is therefore +unreachable, and every episode scores zero regardless of what the policy does. Replaying expert demonstrations +confirms it: 0 of 5 succeed on both released piece files, against 5 of 5 for square and mug controls. + +With piece 2 absent, conditions 3 and 4 reference an object that is not in the world, and condition 2 becomes +numerically identical to condition 1, because piece 2 and the base both sit at horizontal position zero. On one +expert demonstration the two distances are 0.0032316738 and 0.0032315643. + +**Our criterion** drops exactly the terms that reference the absent object, leaving condition 1 plus the release +requirement, which the environment already exposes as `first_piece_assembled`. In words: piece 1 is seated in the +base and the gripper has let go. The patch activates only when piece 2 is inert, defined as sitting more than +0.2 m below the base, so a genuine three-piece scene is unaffected. + +An opt-in environment variable adds a vertical tolerance between piece 1 and the base, which the original never +applied to piece 1. On one checkpoint it moves the score from 46.7 to 13.3 percent against a paper value between +20 and 36. We did not adopt it, because choosing a stricter criterion on the grounds that it lands nearer the +published number would be fitting the metric to the target. It is reported as a footnote on final checkpoints. + +How the authors defined success for their piece-assembly rows is the second open question to them. + +--- + +## Provenance, verified rather than assumed + +Checked 2026-09-18 21:50 UTC against the local clones, so every line below is reproducible offline. + +**square-peg comes from robosuite, not mimicgen.** RISE requests the environment name `NutAssemblySquare` +(`sim_pipeline/configs/constants.py:71`). That class lives in robosuite at +`robosuite/environments/manipulation/nut_assembly.py:691` and subclasses `NutAssembly` with +`single_object_mode=2`; it does not override `_check_success`, so the criterion is `NutAssembly._check_success` +plus `on_peg` in the same file. mimicgen *also* ships a `nut_assembly.py`, but its classes are `Square_D0`, +`Square_D1`, `Square_D2` and `NutAssembly_D0`, none of which RISE asks for. The last commit touching robosuite's +`nut_assembly.py` is `874ce96`, an upstream formatting change; the UWRobotLearning fork never modified it. + +**threading, mug-cleanup and two-piece come from mimicgen.** RISE requests `Threading`, `MugCleanup` and +`ThreePieceAssembly`, which are the base classes at `threading.py:20`, `mug_cleanup.py:30` and +`three_piece_assembly.py:23` of `UWRobotLearning/mimicgen_environments` at commit `14d8eb5`. That repository is +a fork of NVlabs' mimicgen; its history contains the NVlabs merge commits, the most recent being `45db4b3`. + +**The fork did change two of those files, but not the success criteria.** Commit `14d8eb5` ("env update", by a +RISE author) edits `threading.py` and `three_piece_assembly.py`, adding a `placement_initializer` argument so an +external sampler can be injected, rewiring `_get_placement_initializer` to honour it, and adding a shaped +distance reward. Extracting the `_check_success` blocks from the pre-fork commit `45db4b3` and from `14d8eb5` +and diffing them gives: + +| file | success-function block | result | +|---|---|---| +| `three_piece_assembly.py` | 57 lines | identical | +| `threading.py` | 21 lines | identical | +| `mug_cleanup.py` | 24 lines | identical, and the file was never touched by the fork | + +So the criteria documented above are the original mimicgen and robosuite ones. The only modification anywhere in +the success path is ours, on the two-piece task, described in its section. + +--- + +## What this means when comparing to the paper + +Four of the five task families use the simulator's stock criterion untouched, so those numbers are directly +comparable. Every piece-assembly number we report carries the sentence "success = first piece assembled", and no +piece-assembly number produced before 2026-09-18 18:40 UTC is valid, because it predates the patch and was a +structural zero. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/critic_diagnostic.tex b/gen_q_rsm/rsm_rise/pipeline/output/critic_diagnostic.tex new file mode 100644 index 0000000000000000000000000000000000000000..711ab2b0931536be7d65b60c04b6ebf245810eef --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/critic_diagnostic.tex @@ -0,0 +1,28 @@ +% Diagnostic paragraph for the RISE / IDQL critic column. Kept OUT of the flagship caption on purpose: +% the caption is already at the length where tectonic refuses the float in our width check, and a +% mechanism this load-bearing belongs in the text. \input this next to Table~\ref{tab:flagship_single_actor}. +\paragraph{Why the critic column is weak.} +RISE and IDQL both rank candidate actions with an IQL critic trained on the data-provenance reward. That +critic separates \emph{states} almost perfectly --- the area under the ROC curve for expert versus +non-expert frames is $0.81$ to $1.00$ across our tasks --- but it does not rank \emph{actions}. At a fixed +state the values it assigns to the $128$ candidates differ by $0.02$ to $0.35$, while the same values vary by +$2$ to $40$ across states, and the action actually recorded by the demonstrator sits at the $40$th to $58$th +percentile of the proposal policy's own samples; on one task a randomly chosen non-expert action scores as +highly as the expert one. In other words $Q(s,a)\approx V(s)$, so taking the argmax over $N$ samples is close +to taking one at random. + +This is a property of the reward, not an implementation defect. A label that is constant over every frame of +a file, combined with exactly one recorded action per state, gives temporal-difference learning no +action-contrastive signal: $Q(s,a)=V(s)$ is a perfect fit to the data. The only action-contrastive pairs the +recipe constructs --- a non-expert state paired with a nearby expert's action --- are withheld from the critic +by construction, because the successor state stored with such a pair does not correspond to the substituted +action. We verified this diagnosis by repairing both halves: training the critic on the augmented pairs, and +treating episode ends as truncation rather than absorption. Both repairs work as intended at the state level +(frame-level AUC rises from $0.84$ to $0.97$, and the sign of the advantage between expert and non-expert +states inverts back to the expected direction), and neither moves the action ranking beyond chance. + +Two consequences for reading our tables. First, the honest comparison for a selection method is against the +\textbf{rand} column --- the same $N$ candidates from the same policy with one chosen uniformly --- and not +only against the critic. Second, a margin over this critic should not be read as a margin over a tuned +value baseline; it is a margin over a scorer that, in this reward setting, is close to uninformative about +actions. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/flagship_single_actor.tex b/gen_q_rsm/rsm_rise/pipeline/output/flagship_single_actor.tex new file mode 100644 index 0000000000000000000000000000000000000000..5e2a1dd1bd5c4f1e9418d9de68ff0f203c8fc283 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/flagship_single_actor.tex @@ -0,0 +1,186 @@ +% Flagship comparison under the RISE-faithful (data-provenance) reward. +% Generated by scripts/flagship_latex.py -- regenerate rather than editing by hand. +% Preamble: \usepackage{booktabs} <- the ONLY package this table needs. +% Sized for ICLR's 5.5in (397.5pt) text block; verified with scripts/check_iclr_fit.sh. + +\begin{table}[t] +\centering +\caption{\textbf{Preliminary results under the RISE-faithful reward.} \textbf{The RSM column proposes from the RISE actor on every task} -- the same actor whose samples RISE's own critic ranks -- so RISE and RSM differ only in the scorer; no per-task choice of proposer is made. All methods see the same +reward: the dataset's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on +every frame of a suboptimal one), which is what RISE's \texttt{relabel\_rewards.py} writes and its IQL +critic consumes unchanged; BC and BC-u use no reward by construction. RISE-g samples the RISE actor +once with no critic ranking, i.e.\ the RISE policy without its selection step. \textbf{IFQL} is +implicit flow Q-learning, the flow variant of IDQL: an unweighted flow-matching behavioural actor whose +own expectile critic ranks $128$ of its own samples at every step, trained on the same provenance +reward and the same observation as every other column; its \emph{critic} ranks the RISE actor's +candidates in Table~\ref{tab:matched_actor}, which is where we report it. Its \emph{published} +configuration did not yield a functional policy here, for two reasons that are adaptation choices of +ours and not properties of the method: a per-step flow actor against a chunked diffusion proposer, and +frozen DINO features in place of its native encoder. Its column therefore reads ``n/a'' --- no +functional policy in this observation space, as distinct from ``--'' for a baseline still training --- +and we compare only its critic, on a common actor. That attribution is measured: with ranking switched +off ($N{=}1$, $150$ episodes per task) it already scores $5.3$ and $0.7\,\%$ against $9.0$ and +$0.2\,\%$ with the critic, so the proposer is the binding constraint. Classifying provenance and +\emph{ranking actions} differ; the per-task ranking diagnostics for its critic are given with +Table~\ref{tab:matched_actor} and \S\ref{sec:value-selection-impossible}, where that critic is +actually reported. \textbf{Bold} marks the best +method on each task. Entries are mean\,$\pm$\,standard error \emph{across seeds}, with the seed +count as a subscript; a seed varies the policy action draw and the environment initial conditions with +the network initialisation held fixed, and the seed is the unit of replication +(\S\ref{sec:seed-semantics}). $\dagger$ marks +a single-seed entry, where no seed variance is measurable and the interval shown is binomial over that +seed's episodes; read those rows as provisional. $\Delta$ is the margin of RSM over the strongest baseline on that task, +with $^{*}$ marking $p<0.05$ under a two-proportion $z$-test. Tasks: Square $=$ square-peg, +Piece $=$ piece-assembly, Piece-tip $=$ piece-assembly with tipped initialisation, Thread $=$ threading; +(Sub.) and (Cov.) are the suboptimal and coverage data regimes; demonstration counts are in +Table~\ref{tab:data}. The RSM entry on each task is the best of the successor-model configurations +(model size, discount, hops, candidate count) evaluated there -- 12/35/11/30/33/16 configurations +per task in row order, single-seed ones included -- so it is a maximum over a search, whereas each +baseline is a single configuration; the held-out analysis of \S\ref{sec:heldout} selects on one seed +and scores on the others. Because a maximum over a search carries the winner's curse even when the search +is disclosed, we also give the \\emph{median} over every fully seeded configuration of the same family, a +number that does not depend on picking a winner: 13.1/35.0/49.0/8.2/8.6/5.3 per task in row order, over 12/4/4/21/29/14 such +configurations. Where the median still exceeds every baseline the row is robust to that choice. Episodes behind each column: BC 7100, BCU 7260, RISEg 7400, IDQL 1350, RISE 10400, IFQL 0 across the baselines (every epoch-5000 +evaluation of that policy is pooled), 3800 behind the RSM entries (50 per seed).} +\label{tab:flagship_single_actor} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Cov.) & $9.2{\pm}2.0_{(3)}$ & $3.1{\pm}0.6_{(3)}$ & $7.3{\pm}1.3_{(3)}$ & -- & $3.7{\pm}0.2_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{17.6{\pm}1.2_{(3)}}$ & $+8.3^{*}$ \\ +Piece (Sub.) & $13.8{\pm}1.3_{(3)}$ & $33.4{\pm}1.6_{(3)}$ & $30.7{\pm}2.2_{(3)}$ & $24.2{\pm}3.6_{(3)}$ & $22.4{\pm}6.1_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{45.9{\pm}3.6_{(3)}}$ & $+13.7^{*}$ \\ +Piece (Cov.) & $16.4{\pm}0.5_{(3)}$ & $25.3{\pm}2.2_{(3)}$ & $29.9{\pm}1.3_{(3)}$ & $12.9{\pm}1.6_{(2)}$ & $6.0{\pm}1.6_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{50.0{\pm}1.3_{(3)}}$ & $+20.3^{*}$ \\ +Mug (Sub.) & $\mathbf{14.4{\pm}0.6_{(3)}}$ & $4.9{\pm}0.2_{(3)}$ & $4.5{\pm}0.5_{(3)}$ & -- & $5.8{\pm}1.6_{(3)}$ & $\mathrm{n/a}$ & $12.7{\pm}1.2_{(3)}$ & $-1.5$ \\ +Thread (Cov.) & $\mathbf{12.9{\pm}1.0_{(3)}}$ & $1.3{\pm}0.2_{(3)}$ & $1.2{\pm}0.3_{(3)}$ & -- & $3.5{\pm}1.1_{(3)}$ & $\mathrm{n/a}$ & $13.0{\pm}2.5_{(3)}$ & $-0.2$ \\ +Piece-tip (Cov.) & $0.8{\pm}0.1_{(3)}$ & $1.0{\pm}0.2_{(3)}$ & $1.0{\pm}0.5_{(3)}$ & -- & $2.9{\pm}0.6_{(3)}$ & $\mathrm{n/a}$ & $\mathbf{6.9{\pm}0.8_{(3)}}$ & $+4.0^{*}$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer: same candidates, different scorer.} All three columns sample the +\emph{same} 128 candidates from the \emph{same} BC-union policy under the same data-provenance +reward; only the ranking function differs. \textbf{greedy} takes one sample without ranking, +\textbf{IQL} ranks with the IQL critic (the mechanism RISE and IDQL share), \textbf{RSM} ranks with +our successor model. Fixing the proposal policy is what makes this comparison fair -- RISE is IDQL with +a different policy, so a margin obtained by also changing the proposer would not isolate the scorer. +Read the \textbf{vs.\ greedy} column as what selection buys: the IQL critic is a weak ranker in this +setting, scoring \emph{below} greedy on several tasks and on its own proposer, so the margin over it +alone would overstate the contribution of our scorer. All three columns of a row are read on the +same set of (policy seed, evaluation seed) cells -- cells per task in row order, 50 episodes +each -- and the RSM subscript is the number of policy seeds behind it; the RSM configuration is the +best configuration on that proposer with at least two seeds, or the single-seed best where none exists.} +\label{tab:matched} +\footnotesize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lccccc} +\toprule +& \multicolumn{3}{c}{Scorer (BC-union proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-4} \cmidrule(lr){5-6} +Task & greedy & IQL & RSM & vs.\ greedy & vs.\ IQL \\ +\midrule + +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer, RISE's own actor.} The same protocol as Table~\ref{tab:matched} +with RISE's policy as the proposer: RISE's actor, RISE's reward, and only the ranking function swapped. +\textbf{RISE-g} is that actor sampled once, \textbf{RISE} is its released critic-ranked rollout +(128 samples, argmax of the co-trained IQL critic), \textbf{RSM} ranks the same 128 samples with our +successor model. \textbf{TD-Flow} is the same successor field, architecture, discount band and reward +head as RSM with the occupancy fitted by TD bootstrapping off an EMA twin instead of by Monte Carlo, so +the RSM/TD-Flow pair isolates the one clause the method claims. One implementation detail of that +baseline is load-bearing and is reported because we got it wrong first: the flow's residual +normaliser must be fitted on the \emph{logged} residual on both paths, since fitting it on the +bootstrapped target makes the target's scale feed back into its own normaliser and diverge --- ours +reached $15{\times}$ the dispersion the occupancy actually has before the target-dispersion ratio +below caught it, and a TD baseline broken that way would have produced exactly the result the method +predicts. Continuing: \textbf{LeWM} and \textbf{DINO-WM} +are learned world models rolled forward under the candidate chunk with a reward probe on the same +label; \textbf{IFQL} is the critic of implicit flow Q-learning, a second value function trained on the +same label. Whether it orders the $128$ candidates at all +(\S\ref{sec:value-selection-impossible}) is reported with it, in row order: recorded-action rank pct.\ ($50$ = chance) ; per-state $Q$ spread bins; global range (context only) bins. +\textbf{rand} is the random-candidate control: it draws the same $N{=}128$ candidates and executes +one of them uniformly, so $\textrm{RSM}-\textrm{rand}$ is the part of the margin attributable to +\emph{ranking} rather than to sampling breadth. Every column ranks the \emph{same} 128 candidates at every decision step. Same (policy seed, +evaluation seed) cells across a row -- cells per task in row order, for the +control; a $\dagger$ marks a column that has not yet run all of them, with the scorers' own counts +TD-Flow ; IFQL ; LeWM ; DINO-WM . Each scorer column is the best of the +configurations evaluated for it on this proposer -- TD-Flow ; IFQL ; LeWM ; DINO-WM configurations per task in row order -- +so the budgets differ between columns and are stated rather than assumed equal. No scorer has a health number yet, so every scorer entry carries $\ddagger$ and none is reportable. +A task is omitted when no configuration with the canonical read-out ($256$ particles, logit) was +evaluated on this proposer: cells that differ only in particle count or in the probability-vs-logit +read-out are \emph{different scorers} (on threading, $256{\to}16$ particles and logit$\to$prob moved +one recipe from $9.3$ to $2.2$), so they are not pooled into one arm and a task carrying only those +is dropped rather than reported at a mixed read-out.} +\label{tab:matched_actor} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcccccccccc} +\toprule +& \multicolumn{8}{c}{Scorer (RISE-actor proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-9} \cmidrule(lr){10-11} +Task & RISE-g & RISE & rand & RSM & TD-Flow & IFQL & LeWM & DINO-WM & vs.\ RISE-g & vs.\ RISE \\ +\midrule + +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Data regime.} Demonstration counts per task, and the median length of an expert +demonstration against the 400-step evaluation horizon (the horizon enters the throughput definition in +Table~\ref{tab:throughput}). ``Expert'' and ``Suboptimal'' are the two files RISE's reward labels +distinguish: every frame of an expert episode carries reward $1$ and every frame of a suboptimal one +carries $0$.} +\label{tab:data} +\footnotesize +\setlength{\tabcolsep}{6pt} +\begin{tabular}{lccc} +\toprule +Task & Expert & Suboptimal & Median expert demo (of 400) \\ +\midrule +Square (Cov.) & 200 & 224 & 374 \\ +Piece (Sub.) & 20 & 100 & 317 \\ +Piece (Cov.) & 200 & 199 & 311 \\ +Mug (Sub.) & 20 & 100 & 356 \\ +Thread (Cov.) & 250 & 200 & 215 \\ +Piece-tip (Cov.) & 200 & 504 & 311 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Throughput.} Success rate $\times$ horizon $/$ mean steps-to-success, i.e.\ successes +per 400 environment steps, on exactly the columns, rows and episodes of +Table~\ref{tab:flagship_single_actor} -- a method that succeeds as often but sooner scores higher here, which the +success rate alone cannot show. Reported separately because the two tables together exceed the +397.5pt text block. $\Delta$ is again the margin over the strongest baseline on that task.} +\label{tab:throughput} +\scriptsize +\setlength{\tabcolsep}{1.2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Cov.) & $\mathbf{0.093{\pm}0.021}$ & $0.031{\pm}0.006$ & $0.074{\pm}0.014$ & -- & $0.037{\pm}0.002$ & $\mathrm{n/a}$ & -- & -- \\ +Piece (Sub.) & $0.127{\pm}0.014$ & $\mathbf{0.378{\pm}0.029}$ & $0.338{\pm}0.028$ & $0.263{\pm}0.043$ & $0.249{\pm}0.062$ & $\mathrm{n/a}$ & -- & -- \\ +Piece (Cov.) & $0.189{\pm}0.003$ & $0.275{\pm}0.021$ & $\mathbf{0.315{\pm}0.015}$ & $0.132{\pm}0.016$ & $0.065{\pm}0.009$ & $\mathrm{n/a}$ & -- & -- \\ +Mug (Sub.) & $\mathbf{0.151{\pm}0.007}$ & $0.049{\pm}0.002$ & $0.046{\pm}0.005$ & -- & $0.059{\pm}0.016$ & $\mathrm{n/a}$ & -- & -- \\ +Thread (Cov.) & $\mathbf{0.141{\pm}0.001}$ & $0.015{\pm}0.004$ & $0.012{\pm}0.003$ & -- & $0.034{\pm}0.013$ & $\mathrm{n/a}$ & -- & -- \\ +Piece-tip (Cov.) & $0.003{\pm}0.003$ & $0.013^{\dagger}$ & $0.010{\pm}0.005$ & -- & $\mathbf{0.024{\pm}0.008}$ & $\mathrm{n/a}$ & -- & -- \\ +\bottomrule +\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/output/flagship_table.tex b/gen_q_rsm/rsm_rise/pipeline/output/flagship_table.tex new file mode 100644 index 0000000000000000000000000000000000000000..0206d8265901b2c2b3dcb3154a055d09cfd5e07b --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/flagship_table.tex @@ -0,0 +1,178 @@ +% Flagship comparison under the RISE-faithful (data-provenance) reward. +% Generated by scripts/flagship_latex.py -- regenerate rather than editing by hand. +% Preamble: \usepackage{booktabs} <- the ONLY package this table needs. +% Sized for ICLR's 5.5in (397.5pt) text block; verified with scripts/check_iclr_fit.sh. + +\begin{table}[t] +\centering +\caption{\textbf{Preliminary results under the RISE-faithful reward.} All methods see the same +reward: the dataset's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on +every frame of a suboptimal one), which is what RISE's \texttt{relabel\_rewards.py} writes and its IQL +critic consumes unchanged; BC and BC-u use no reward by construction. RISE-g samples the RISE actor +once with no critic ranking, i.e.\ the RISE policy without its selection step. \textbf{IFQL} is +implicit flow Q-learning, the flow variant of IDQL: an unweighted flow-matching behavioural actor whose +own expectile critic ranks $128$ of its own samples at every step, trained on the same provenance +reward and the same observation as every other column; its \emph{critic} appears separately in +Table~\ref{tab:matched_actor}, ranking the RISE actor's candidates. \textbf{Bold} marks the best +method on each task. Entries are mean\,$\pm$\,standard error \emph{across seeds}, with the seed +count as a subscript. A seed here varies the \emph{policy action draw and the environment initial +conditions}; the network initialisation is held fixed, so these bars measure run-to-run variation +under resampling rather than variation across independently initialised training runs. The seed is +still the unit of replication -- a binomial interval over pooled rollouts would treat correlated +episodes from one policy as independent and understate the spread by roughly a third. $\dagger$ marks +a single-seed entry, where no seed variance is measurable and the interval shown is binomial over that +seed's episodes; read those rows as provisional. $\Delta$ is the margin of RSM over the strongest baseline on that task, +with $^{*}$ marking $p<0.05$ under a two-proportion $z$-test. Tasks: Square $=$ square-peg, +Piece $=$ piece-assembly, Piece-tip $=$ piece-assembly with tipped initialisation, Thread $=$ threading; +(Sub.) and (Cov.) are the suboptimal and coverage data regimes; demonstration counts are in +Table~\ref{tab:data}. The RSM entry on each task is the best of the successor-model configurations +(model size, discount, hops, candidate count, proposer) evaluated there -- 16/40/161/115/26/119/38 configurations +per task in row order, single-seed ones included -- so it is a maximum over a search, whereas each +baseline is a single configuration; the held-out analysis of \S\ref{sec:heldout} selects on one seed +and scores on the others. Episodes behind each column: BC 7550, BCU 7710, RISEg 7350, IDQL 1350, RISE 10400, IFQL 0 across the baselines (every epoch-5000 +evaluation of that policy is pooled), 5650 behind the RSM entries (50 per seed).} +\label{tab:flagship} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Sub.) & $10.4{\pm}1.0_{(3)}$ & $48.0{\pm}1.4_{(3)}$ & -- & -- & -- & -- & $\mathbf{51.8{\pm}2.1_{(3)}}$ & $+3.2$ \\ +Square (Cov.) & $9.2{\pm}2.0_{(3)}$ & $3.1{\pm}0.6_{(3)}$ & $7.3{\pm}1.3_{(3)}$ & -- & $3.7{\pm}0.2_{(3)}$ & -- & $\mathbf{17.6{\pm}1.2_{(3)}}$ & $+8.3^{*}$ \\ +Piece (Sub.) & $13.8{\pm}1.3_{(3)}$ & $33.4{\pm}1.6_{(3)}$ & $30.7{\pm}2.2_{(3)}$ & $24.2{\pm}3.6_{(3)}$ & $22.4{\pm}6.1_{(3)}$ & -- & $\mathbf{46.9{\pm}2.9_{(3)}}$ & $+13.6^{*}$ \\ +Piece (Cov.) & $16.4{\pm}0.5_{(3)}$ & $25.3{\pm}2.2_{(3)}$ & $29.9{\pm}1.3_{(3)}$ & $12.9{\pm}1.6_{(2)}$ & $6.0{\pm}1.6_{(3)}$ & -- & $\mathbf{50.0{\pm}1.8_{(3)}}$ & $+20.3^{*}$ \\ +Mug (Sub.) & $14.4{\pm}0.6_{(3)}$ & $4.9{\pm}0.2_{(3)}$ & $4.7{\pm}0.4_{(3)}$ & -- & $5.8{\pm}1.6_{(3)}$ & -- & $\mathbf{17.1{\pm}0.9_{(3)}}$ & $+2.9$ \\ +Thread (Cov.) & $12.9{\pm}1.0_{(3)}$ & $1.3{\pm}0.2_{(3)}$ & $1.2{\pm}0.3_{(3)}$ & -- & $3.5{\pm}1.1_{(3)}$ & -- & $\mathbf{18.6{\pm}2.2_{(3)}}$ & $+5.3^{*}$ \\ +Piece-tip (Cov.) & $0.8{\pm}0.1_{(3)}$ & $1.0{\pm}0.2_{(3)}$ & $1.0{\pm}0.5_{(3)}$ & -- & $2.9{\pm}0.6_{(3)}$ & -- & $\mathbf{6.3{\pm}0.9_{(3)}}$ & $+3.5^{*}$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer: same candidates, different scorer.} All three columns sample the +\emph{same} 128 candidates from the \emph{same} BC-union policy under the same data-provenance +reward; only the ranking function differs. \textbf{greedy} takes one sample without ranking, +\textbf{IQL} ranks with the IQL critic (the mechanism RISE and IDQL share), \textbf{RSM} ranks with +our successor model. Fixing the proposal policy is what makes this comparison fair -- RISE is IDQL with +a different policy, so a margin obtained by also changing the proposer would not isolate the scorer. +Read the \textbf{vs.\ greedy} column as what selection buys: the IQL critic is a weak ranker in this +setting, scoring \emph{below} greedy on several tasks and on its own proposer, so the margin over it +alone would overstate the contribution of our scorer. All three columns of a row are read on the +same set of (policy seed, evaluation seed) cells -- 9/3/9/5/9/6/3 cells per task in row order, 50 episodes +each -- and the RSM subscript is the number of policy seeds behind it; the RSM configuration is the +best configuration on that proposer with at least two seeds, or the single-seed best where none exists.} +\label{tab:matched} +\footnotesize +\setlength{\tabcolsep}{5pt} +\begin{tabular}{lccccc} +\toprule +& \multicolumn{3}{c}{Scorer (BC-union proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-4} \cmidrule(lr){5-6} +Task & greedy & IQL & RSM & vs.\ greedy & vs.\ IQL \\ +\midrule +Square (Sub.) & $48.0$ & -- & $\mathbf{51.2}_{(3)}$ & $+3.2$ & -- \\ +Square (Cov.) & $4.0$ & $5.3$ & $\mathbf{12.7}_{(1)}$ & $+8.7$ & $+7.3$ \\ +Piece (Sub.) & $32.9$ & $15.6$ & $\mathbf{42.7}_{(3)}$ & $+9.8$ & $+27.1$ \\ +Piece (Cov.) & $26.7$ & $5.6$ & $\mathbf{41.0}_{(2)}$ & $+14.3$ & $+35.4$ \\ +Mug (Sub.) & $4.9$ & -- & $\mathbf{9.1}_{(3)}$ & $+4.2$ & -- \\ +Thread (Cov.) & $1.5$ & $4.7$ & $\mathbf{7.7}_{(2)}$ & $+6.2$ & $+3.0$ \\ +Piece-tip (Cov.) & $1.0$ & $1.3$ & $\mathbf{6.7}_{(1)}$ & $+5.7$ & $+5.3$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Matched proposer, RISE's own actor.} The same protocol as Table~\ref{tab:matched} +with RISE's policy as the proposer: RISE's actor, RISE's reward, and only the ranking function swapped. +\textbf{RISE-g} is that actor sampled once, \textbf{RISE} is its released critic-ranked rollout +(128 samples, argmax of the co-trained IQL critic), \textbf{RSM} ranks the same 128 samples with our +successor model. \textbf{TD-Flow} is the same successor field, architecture, discount band and reward +head as RSM with the occupancy fitted by TD bootstrapping off an EMA twin instead of by Monte Carlo, so +the RSM/TD-Flow pair isolates the one clause the method claims; \textbf{LeWM} and \textbf{DINO-WM} +are learned world models rolled forward under the candidate chunk with a reward probe on the same +label; \textbf{IFQL} is the critic of implicit flow Q-learning, a second value function trained on the +same label, which separates ``a better-trained critic'' from ``a different kind of estimator''. +\textbf{rand} is the random-candidate control: it draws the same $N{=}128$ candidates and executes +one of them uniformly, so $\textrm{RSM}-\textrm{rand}$ is the part of the margin attributable to +\emph{ranking} rather than to sampling breadth. Every column ranks the \emph{same} 128 candidates at every decision step. Same (policy seed, +evaluation seed) cells across a row -- 9/9/9/9/9/9 cells per task in row order, 9/9/8/9/9/9 for the +control; a $\dagger$ marks a column that has not yet run all of them, with the scorers' own counts +TD-Flow 0/0/0/0/0/0; IFQL 0/0/0/0/0/0; LeWM 0/0/0/0/0/0; DINO-WM 0/0/0/0/0/0. Each scorer column is the best of the +configurations evaluated for it on this proposer -- TD-Flow 0/0/0/0/0/0; IFQL 0/0/0/0/0/0; LeWM 0/0/0/0/0/0; DINO-WM 0/0/0/0/0/0 configurations per task in row order -- +so the budgets differ between columns and are stated rather than assumed equal. Tasks where no RSM +configuration was evaluated on this proposer are omitted.} +\label{tab:matched_actor} +\scriptsize +\setlength{\tabcolsep}{2pt} +\begin{tabular}{lcccccccccc} +\toprule +& \multicolumn{8}{c}{Scorer (RISE-actor proposer, $N{=}128$)} & \multicolumn{2}{c}{RSM margin} \\ +\cmidrule(lr){2-9} \cmidrule(lr){10-11} +Task & RISE-g & RISE & rand & RSM & TD-Flow & IFQL & LeWM & DINO-WM & vs.\ RISE-g & vs.\ RISE \\ +\midrule +Square (Cov.) & $7.3$ & $3.7$ & $6.4$ & $\mathbf{17.6}_{(3)}$ & -- & -- & -- & -- & $+10.2$ & $+13.9$ \\ +Piece (Sub.) & $30.7$ & $22.4$ & $28.0$ & $\mathbf{46.5}_{(3)}$ & -- & -- & -- & -- & $+15.8$ & $+24.0$ \\ +Piece (Cov.) & $29.7$ & $6.1$ & $28.4^{\dagger}$ & $\mathbf{50.0}_{(3)}$ & -- & -- & -- & -- & $+20.3$ & $+43.9$ \\ +Mug (Sub.) & $4.7$ & $5.8$ & $6.2$ & $\mathbf{12.2}_{(3)}$ & -- & -- & -- & -- & $+7.5$ & $+6.4$ \\ +Thread (Cov.) & $1.2$ & $3.5$ & $1.1$ & $\mathbf{13.1}_{(3)}$ & -- & -- & -- & -- & $+12.0$ & $+9.6$ \\ +Piece-tip (Cov.) & $1.0$ & $2.9$ & $0.8$ & $\mathbf{6.3}_{(3)}$ & -- & -- & -- & -- & $+5.4$ & $+3.5$ \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Data regime.} Demonstration counts per task, and the median length of an expert +demonstration against the 400-step evaluation horizon (the horizon enters the throughput definition in +Table~\ref{tab:throughput}). ``Expert'' and ``Suboptimal'' are the two files RISE's reward labels +distinguish: every frame of an expert episode carries reward $1$ and every frame of a suboptimal one +carries $0$.} +\label{tab:data} +\footnotesize +\setlength{\tabcolsep}{6pt} +\begin{tabular}{lccc} +\toprule +Task & Expert & Suboptimal & Median expert demo (of 400) \\ +\midrule +Square (Sub.) & 20 & 100 & 173 \\ +Square (Cov.) & 200 & 224 & 374 \\ +Piece (Sub.) & 20 & 100 & 317 \\ +Piece (Cov.) & 200 & 199 & 311 \\ +Mug (Sub.) & 20 & 100 & 356 \\ +Thread (Cov.) & 250 & 200 & 215 \\ +Piece-tip (Cov.) & 200 & 504 & 311 \\ +\bottomrule +\end{tabular} +\end{table} + +\begin{table}[t] +\centering +\caption{\textbf{Throughput.} Success rate $\times$ horizon $/$ mean steps-to-success, i.e.\ successes +per 400 environment steps, on exactly the columns, rows and episodes of +Table~\ref{tab:flagship} -- a method that succeeds as often but sooner scores higher here, which the +success rate alone cannot show. Reported separately because the two tables together exceed the +397.5pt text block. $\Delta$ is again the margin over the strongest baseline on that task.} +\label{tab:throughput} +\scriptsize +\setlength{\tabcolsep}{1.5pt} +\begin{tabular}{lcccccccc} +\toprule +& \multicolumn{6}{c}{Baselines} & & \\ +\cmidrule(lr){2-7} +Task & BC & BCU & RISEg & IDQL & RISE & IFQL & RSM (ours) & $\Delta$ \\ +\midrule +Square (Sub.) & $0.110{\pm}0.011$ & $0.570{\pm}0.018$ & -- & -- & -- & -- & $\mathbf{0.627{\pm}0.032}$ & $+0.049$ \\ +Square (Cov.) & $0.093{\pm}0.021$ & $0.031{\pm}0.006$ & $0.074{\pm}0.014$ & -- & $0.037{\pm}0.002$ & -- & $\mathbf{0.179{\pm}0.013}$ & $+0.086$ \\ +Piece (Sub.) & $0.127{\pm}0.014$ & $0.378{\pm}0.029$ & $0.338{\pm}0.028$ & $0.263{\pm}0.043$ & $0.249{\pm}0.062$ & -- & $\mathbf{0.549{\pm}0.043}$ & $+0.168$ \\ +Piece (Cov.) & $0.189{\pm}0.003$ & $0.275{\pm}0.021$ & $0.315{\pm}0.015$ & $0.132{\pm}0.016$ & $0.065{\pm}0.009$ & -- & $\mathbf{0.558{\pm}0.024}$ & $+0.244$ \\ +Mug (Sub.) & $0.151{\pm}0.007$ & $0.049{\pm}0.002$ & $0.047{\pm}0.004$ & -- & $0.059{\pm}0.016$ & -- & $\mathbf{0.180{\pm}0.010}$ & $+0.032$ \\ +Thread (Cov.) & $0.141{\pm}0.001$ & $0.015{\pm}0.004$ & $0.012{\pm}0.003$ & -- & $0.034{\pm}0.013$ & -- & $\mathbf{0.203{\pm}0.026}$ & $+0.061$ \\ +Piece-tip (Cov.) & $0.003{\pm}0.003$ & $0.013^{\dagger}$ & $0.010{\pm}0.005$ & -- & $0.024{\pm}0.008$ & -- & $\mathbf{0.064{\pm}0.009}$ & $+0.040$ \\ +\bottomrule +\end{tabular} +\end{table} diff --git a/gen_q_rsm/rsm_rise/pipeline/output/i262/bcap_paired.txt b/gen_q_rsm/rsm_rise/pipeline/output/i262/bcap_paired.txt new file mode 100644 index 0000000000000000000000000000000000000000..1ed115389fcc1ddd99514fdd0d54fb20a7fc4486 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/i262/bcap_paired.txt @@ -0,0 +1,6 @@ +two_piece_expert_suboptimal paired cells=16 uncapped wins 12 / capped wins 2 / ties 2 +two_piece_expert_play paired cells=16 uncapped wins 11 / capped wins 2 / ties 3 +threading_expert_play paired cells=15 uncapped wins 13 / capped wins 1 / ties 1 +mug_expert_suboptimal paired cells= 1 uncapped wins 0 / capped wins 0 / ties 1 + +POOLED paired cells=48 uncapped 36 / capped 5 / ties 7 one-sided sign test p=3.92e-07 diff --git a/gen_q_rsm/rsm_rise/pipeline/output/real/comment_263_report.md b/gen_q_rsm/rsm_rise/pipeline/output/real/comment_263_report.md new file mode 100644 index 0000000000000000000000000000000000000000..9a14cf66a4458f19b859efd8ccbcf0d0fbe429d3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/real/comment_263_report.md @@ -0,0 +1,84 @@ +## Real-world (`rsm_cooking_v5`) proposal-policy report -- PDF, checkpoints, W&B + +Full report (7 sections, 4 tables, the regenerated curve figure): +**`/proj/dmfexp/zwhong/rsm_rise/docs/real_proposal_report.pdf`** +(source `docs/tex/real_proposal_report.tex` + generated `docs/tex/_real_tables.tex`; built with tectonic on a CPU node by `scripts/tmp/build_real_report_pdf.sh`; every number is collected from disk by `scripts/real/build_real_report_tables.py`, which also writes the machine-readable `status/real/report_numbers.json`). + +### 1. Held-out fit, as a ratio to hold-still + +A policy that just copies the current EE xyz scores **0.81 / 1.53 cm** (first action / 8-step chunk mean) on the 25 validation episodes, so the absolute "< 1 cm" gate is vacuous. Ratios below are to that baseline; **> 1.0x is better than doing nothing**. + +| policy | at | first (cm) | chunk (cm) | first | chunk | +|---|---|---|---|---|---| +| hold-still | -- | 0.81 | 1.53 | 1.00x | 1.00x | +| **robomimic S0Aidql s1** | epoch 3000 | **0.40** | **0.49** | **2.04x** | **3.13x** | +| **robomimic S0Aidql s0** | epoch 3000 | **0.43** | **0.53** | **1.90x** | **2.87x** | +| pi0.5 stock s1 | 30k | 0.83 | 1.16 | 0.98x | 1.32x | +| pi0.5 stock s0 | 30k | 0.84 | 1.18 | 0.96x | 1.30x | +| pi0.5 rise s1 | 30k | 0.92 | 1.29 | 0.88x | 1.19x | +| pi0.5 rise s0 | 30k | 0.94 | 1.30 | 0.86x | 1.18x | +| pi0.5 riseadv s0 | 30k | 1.13 | 1.50 | 0.72x | 1.02x | +| robomimic S0B s0 | epoch 5000 | 1.69 | 1.78 | 0.48x | 0.86x | +| robomimic S0B s1 | epoch 5000 | 1.75 | 1.86 | 0.46x | 0.82x | + +Sources: pi0.5 rows are each run's own `EVAL step N:` lines in `logs/lsf/rr_openpi_.*.out`; robomimic rows are `pooled_episode_mean` in `/replay_e/replay_eval.json` (`scripts/real/rise_replay_eval.py`, stride 10, 25 episodes); hold-still is `scripts/tmp/action_norms_real.py` -> `logs/lsf/rr_cpu_actnorm.1836483.out`. + +Both `S0Aidql` seeds improved again at the epoch-3000 checkpoints (s0 0.58 -> 0.43, s1 0.39 -> 0.40 first; chunk 0.70 -> 0.53 and 0.51 -> 0.49) and the per-epoch curve is monotone, while `S0B` sits between 1.4 and 2.2 cm with no trend. Per-epoch grid (first/chunk cm), all newly computed for this report: + +| policy | 500 | 1000 | 1500 | 2000 | 2500 | 3000 | 3500 | 4000 | 4500 | 5000 | +|---|---|---|---|---|---|---|---|---|---|---| +| S0Aidql s0 | 0.82/1.11 | 0.60/0.83 | 0.59/0.74 | 0.58/0.70 | 0.48/0.57 | 0.43/0.53 | | | | | +| S0Aidql s1 | 0.80/1.04 | 0.78/0.96 | 0.54/0.72 | 0.50/0.65 | 0.39/0.51 | 0.40/0.49 | | | | | +| S0B s0 | 3.21/3.37 | 2.17/2.34 | 2.42/2.53 | 2.33/2.46 | 2.17/2.22 | 1.69/1.79 | 1.96/2.04 | 1.45/1.56 | 2.16/2.24 | 1.69/1.78 | +| S0B s1 | 2.80/2.98 | 2.27/2.39 | -- | 1.70/1.88 | 1.59/1.74 | 1.53/1.67 | 1.40/1.52 | 1.46/1.62 | 1.42/1.55 | 1.75/1.86 | + +(`S0B` s1@1500 failed five times with `RuntimeError: CUDA unknown error` at `torch._C._cuda_init()` on five different hosts across both queues -- jobs 1839609, 1839768, 1839825, 1840059, 1840221 -- so it is blank. Both endpoints of that curve are measured.) + +### 2. Checkpoints (absolute paths) and W&B runs + +| role | policy | seed | length | checkpoint | W&B | +|---|---|---|---|---|---| +| BC | pi0.5 stock | 0 | 29999 steps | `/proj/dmfexp/zwhong/rsm_rise/runs/openpi/checkpoints/pi05_cooking_stock/stock_s0/29999` | [jrjlyj9u](https://wandb.ai/richardrl/rsm_rise/runs/jrjlyj9u) | +| BC | pi0.5 stock | 1 | 29999 steps | `.../pi05_cooking_stock/stock_s1/29999` | [63h0zi0h](https://wandb.ai/richardrl/rsm_rise/runs/63h0zi0h) | +| RISE actor | pi0.5 rise | 0 | 29999 steps | `.../pi05_cooking_rise/rise_s0/29999` | [8559gx2w](https://wandb.ai/richardrl/rsm_rise/runs/8559gx2w) | +| RISE actor | pi0.5 rise | 1 | 29999 steps | `.../pi05_cooking_rise/rise_s1/29999` | [i32p3c9u](https://wandb.ai/richardrl/rsm_rise/runs/i32p3c9u) | +| RISE actor | pi0.5 riseadv | 0 | 29999 steps | `.../pi05_cooking_riseadv/riseadv_s0/29999` | [21pdo7s4](https://wandb.ai/richardrl/rsm_rise/runs/21pdo7s4) | +| BC | robomimic S0B | 0 | epoch 5000 | `/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_5000.pth` | [4ni99fj6](https://wandb.ai/richardrl/rsm_rise/runs/4ni99fj6) | +| BC | robomimic S0B | 1 | epoch 5000 | `.../S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_5000.pth` | [2fptaa08](https://wandb.ai/richardrl/rsm_rise/runs/2fptaa08) | +| RISE actor | robomimic S0Aidql | 0 | epoch 3000 | `.../S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921193225/models/model_epoch_3000.pth` | [b4bwu06r](https://wandb.ai/richardrl/rsm_rise/runs/b4bwu06r) | +| RISE actor | robomimic S0Aidql | 1 | epoch 3000 | `.../S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921235824/models/model_epoch_3000.pth` | [gblb2rs2](https://wandb.ai/richardrl/rsm_rise/runs/gblb2rs2) | + +Several dated run directories per robomimic seed are resumes after preemption/admin kills; the latest epoch across them is the checkpoint. Full absolute paths are in the PDF (Table 1). + +### 3. Open-loop scorer comparison on the fixed harness -- negative for the successor + +The stale-history defect (comment above) is fixed, and the validity check passes: greedy first-action error is now 0.57 cm on `s0@2000` against a 0.58 cm replay fit, and 0.40 against 0.39 on `s1@2500`. + +| cell | greedy | IDQL critic | RSM | perm:IDQL | perm:RSM | oracle | +|---|---|---|---|---|---|---| +| s0@2000 d1_d1 T25 | 0.570 | **0.527** (-0.043) | 0.612 (+0.043) | 0.562 | 0.571 | 0.196 | +| s0@2000 fold_d4 T25 | 0.568 | **0.522** (-0.045) | 0.613 (+0.046) | 0.569 | 0.578 | 0.197 | +| s1@2500 d1_d1 T25 | 0.398 | 0.456 (+0.058) | 0.462 (+0.065) | 0.393 | 0.391 | 0.108 | + +(first-action mean cm, 705 decisions, 25 episodes; `status/real/openloop_S0Aidql_*/scorer_openloop.json`. Job 1835432, `s1@2500 fold_d4`, is still RUNNING; its sibling `d1_d1` cell on the same checkpoint is above, and on seed 0 the two configurations agree to 0.003 cm.) + +Reading, stated plainly: +- **The RSM is worse than greedy on both seeds** (+0.043 to +0.065 cm, win rate 0.38-0.46) and **worse than its own permutation control** (which is +0.002 to -0.007). Mean oracle-rank percentile 0.38-0.46 vs 0.49-0.50 for the shuffle: it is ranking slightly anti-correlated with fit, not merely uninformative. +- **The IDQL critic does not replicate across seeds**: -0.044 cm on s0 (win 0.58), +0.058 cm on s1 (win 0.40). +- **Headroom is real**, so this is not a ceiling artefact: the oracle reaches 0.11-0.20 cm against greedy's 0.40-0.57 (2.9-3.7x) with win rate 0.98-0.99. The candidate sets contain much better actions; neither value function finds them. + +So the strongest real-world result so far is a **fit** result, not a selection result. Nothing from `status/real/_invalid_stale_history/` is quoted anywhere in the report. + +### 4. Training status + +All four robomimic cells are configured `num_epochs=5000`. `S0Aidql` s0 is at epoch 3022 (job **1822735**, RUN), s1 at 3319 (job **1818505**, RUN); `S0B` s0 and s1 are finished at 5000 (jobs 1838320 / 1835427 are no-op resumes). The earlier `S0Aidql` s0 job **1819098** did not crash -- `bhist -a -l 1819098` says *"Signal `` requested by user or administrator"* / *"Completed ``; **TERM_ADMIN**: job killed by root or an administrator"*, exit 143, at ~epoch 2500. It needed no manual relaunch: `scripts/real/replay_watcher.sh` detects a training cell that is neither queued nor running and resubmits it with the original `scripts/run_train.sh` command (which resumes from `rolling/`); it fired at 12:51Z and that resubmit is job 1822735, now 500 epochs past the kill. Log: `status/real/replay_watcher.log`. **No training had to be resubmitted by hand for this report.** + +### 5. W&B + +Project: **https://wandb.ai/richardrl/rsm_rise** + +The project's `access` field read back **`USER_READ` before and `USER_READ` after** -- `USER_READ` is W&B's *public: anyone can view*, so **the project was already public** and no mutation was sent. `scripts/tmp/wandb_public_and_list.py` had to be fixed first: wandb 0.30 has no vendored `wandb_gql` and no `api.client`, so it now goes through `wandb.Api()._service_api.execute_graphql(, )` (see `wandb/apis/public/service_api.py:135`), issuing `upsertModel(access: USER_READ)` only when the project is not already public. All 41 `cooking` runs with state, creation time and URL are in **`status/real/wandb_runs.json`** and in Table 5 of the PDF. + +### 6. Figure + +`docs/figs/real_proposal_curves.png`, regenerated on a CPU node so it includes every epoch now on disk. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/real/real_robot_setup.pdf b/gen_q_rsm/rsm_rise/pipeline/output/real/real_robot_setup.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3407b5c50b305295e101cee0b9d37cdc0fe7a2b0 Binary files /dev/null and b/gen_q_rsm/rsm_rise/pipeline/output/real/real_robot_setup.pdf differ diff --git a/gen_q_rsm/rsm_rise/pipeline/output/real/real_robot_setup.tex b/gen_q_rsm/rsm_rise/pipeline/output/real/real_robot_setup.tex new file mode 100644 index 0000000000000000000000000000000000000000..a433f4b4dd0107330a83ebe590b57bbc3e6555e7 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/real/real_robot_setup.tex @@ -0,0 +1,54 @@ +\documentclass[11pt]{article} +\usepackage[margin=1in]{geometry}\usepackage{booktabs}\usepackage{amsmath}\usepackage{hyperref}\usepackage{xcolor} +\title{RSM on real robot play data: \texttt{rsm\_cooking\_v5}\\ \large data characterisation, successor-model training setup, and sanity checks} +\author{gen\_q \#261 --- rsm\_rise}\date{2026-09-21} +\begin{document}\maketitle +\section{Dataset} +\textbf{Source.} \texttt{jmarangola/rsm\_cooking\_v5} (HuggingFace, LeRobot v2.1, public). Robot \texttt{fr3\_agilex}: one FR3 arm, one AgileX gripper. Play data collected by teleoperation along configured \emph{routes} through discrete task states; one task string. +\textbf{Observation / action.} \texttt{observation.state} and \texttt{action} are float32[10] $=[\,xyz(3),\ \mathrm{rot6d}(6),\ \mathrm{gripper}(1)\,]$; the action is an \emph{absolute} end-effector setpoint in the same layout (not a delta). Two RGB streams, \texttt{observation.images.global} and \texttt{observation.images.wrist}, $480{\times}640{\times}3$, stored as mp4. +\textbf{Recording contract (matters for time).} Only \emph{taken} transitions are stored; stationary control ticks are omitted. The nominal 50\,fps is a dataset timeline, so \textbf{row index is not wall-clock time}. Horizons below are in rows. +\subsection{Measured statistics} +\begin{center}\begin{tabular}{lr}\toprule +episodes & 248\\ rows (retained transitions) & 181{,}530\\ +episode length, rows: min / median / max & 314 / \textbf{626} / 1943\\ +mean rows per episode & 732 \emph{(do not use for the $\beta$ band)}\\ +segments per episode & 2-segment: 198;\quad 1-segment: 50\\ +routes collected (\texttt{route\_index} 0--4) & 50 / 50 / 48 / 50 / 50\\ +\bottomrule\end{tabular}\end{center} +\subsection{Task states and outcomes} +Seven states are defined in \texttt{tabletop.yaml}; two are deliberate terminal \emph{failures}. +\begin{center}\small\begin{tabular}{clc}\toprule +id & label & outcome\\\midrule +0 & initial: pan at start, tomato at start & ---\\ +1 & tomato in the pan (pan at start) & ---\\ +2 & pan on stove (tomato at start) & ---\\ +3 & \textbf{cooking}: pan on stove, tomato in pan & success subgoal\\ +4 & \textbf{finished}: pan on grate, tomato in bowl & success\\ +5 & tomato placed directly on the stove & \textcolor{red!70!black}{terminal failure}\\ +6 & pan on stove, tomato skipped to the bowl & \textcolor{red!70!black}{terminal failure}\\ +\bottomrule\end{tabular}\end{center} +Final reached state per episode: $3{:}\,98,\ 4{:}\,50,\ 5{:}\,50,\ 6{:}\,50$. \textbf{Failure-terminal episodes: $100/248 = 40.3\%$.} Note \texttt{annotation.goal\_reached} marks arrival at the \emph{prescribed} destination, including 5 and 6; it is not a success flag. +\subsection{The provenance reward} +RISE's reward is data provenance, not outcome: 1 on every frame of an expert episode, 0 on every frame of a suboptimal one. The route structure supplies exactly this split: \textbf{expert} $=$ episodes ending in $\{3,4\}$ ($148$), \textbf{suboptimal} $=$ ending in $\{5,6\}$ ($100$). Every reward-using method (IQL critics, RSM membership head) trains on this label; BC uses none. +\subsection{Structural finding: the full task is never demonstrated end to end} +Exactly one of the two configured $\rightarrow 4$ routes was collected, and it starts at state 1 or 2, never 0. Routes present: $0{\to}5$, $0{\to}1{\to}3$, $0{\to}2{\to}3$, $0{\to}2{\to}6$, and one of $\{1,2\}{\to}3{\to}4$. \textbf{No episode contains $0\to\cdots\to3\to4$.} The four-stage task from the initial condition exists only by stitching a $0{\to}x{\to}3$ episode with an $x{\to}3{\to}4$ one. This is the regime the successor model is meant for, and it means long-horizon targets across the stitch boundary are absent from any single trajectory---a fact the $\beta$ band and the sanity checks must respect. +\section{Successor-model training setup} +\subsection{Features} DINOv2 \texttt{dinov2\_vits14\_clsgem}, exactly as in simulation (1536-d per view), cached to the sim layout (\texttt{z.f16.npy}, \texttt{act.f32.npy}, \texttt{meta.npz}, \texttt{feat\_stats.npz}) so \texttt{train\_rsm.py} runs unchanged with \texttt{--enc identity}. Both cameras are encoded; concatenation (3072-d) is the default, per-camera an ablation. \textbf{No temporal subsampling}: the successor predicts one future state per sample, so denser rows give more valid (anchor, future) pairs. +\subsection{The $\beta$ band, derived from the data} +Pretraining draws $k\sim\mathrm{Geom}(1-\beta)$ truncated at the episode end. Since gen\_q\#262 the sampler caps $\beta$ per anchor so the truncated tail is a constant $\varepsilon$: $\beta_{\max}(L)=\varepsilon^{1/L}$ with $\varepsilon=0.02$, where $L$ is the remaining length. Rows of remaining episode needed: +\begin{center}\begin{tabular}{cccc}\toprule $\beta$ & 0.95 & 0.98 & 0.99 \\ rows needed & 76 & 194 & 389 \\\midrule $\beta$ & 0.995 & \multicolumn{2}{c}{~} \\ rows needed & 780 & \multicolumn{2}{c}{~}\\\bottomrule\end{tabular}\end{center} +Against the measured distribution: the median episode (626 rows) supports $\beta\le 0.9938$ at its start; the shortest (314) supports $\le 0.9876$; $0.995$ is reachable only in the longer episodes. Simulation runs at 20\,Hz and used $[0.90,\,0.995]$; at a nominal 50\,fps the same $\beta$ is a $2.5\times$ shorter real-time horizon, but because rows are not time here the honest statement is in rows: a band of $[\mathbf{0.96},\,\mathbf{0.994}]$ spans $25$--$170$ rows of mean horizon and stays within what the median episode can teach. The cap handles the rest per anchor. +\subsection{Model ladder and schedule} +Widths \textbf{M}$=1024$, \textbf{L40}$=1536$, \textbf{XL}$=2048$, depth fixed at 4. Sim evidence on matched recipes: M beats or ties L40 on 4 of 5 tasks; nearly all of the small-model penalty is depth $2{\to}4$ ($-18.9$) not width ($-1.6$), so the ladder varies width only. Larger-is-better is a hypothesis under test for $480{\times}640$ two-camera input, not an assumption. Schedule from the sim flagship: \texttt{--flow-depth 4 --chunk 8 --beta-q 0.98 --w-actcon 0.5 --batch 4096 --lr 3e-4 --ema 0.995 --steps 100000 --save-every 10000}, \texttt{--reward-mode dense --reward-loss bce} (``dense'' is the regression target shape, \emph{not} the disqualified progress head). Both with and without the truncation cap are trained (\#262 A/B). +\section{Sanity checks (budget $\le 1\%$ of wall time)} +At \texttt{--eval-every 5000} there are 20 evaluations; on a $\sim$4\,h run the whole budget is $\sim$2.4\,min, i.e.\ $\sim$7\,s each. The hook times itself and shrinks the sample, never the frequency, if it exceeds 1\%. +\begin{enumerate} +\item \textbf{Successor nearest-neighbour $L_1$.} For $B{=}256$ anchors, sample $K{=}16$ successors at the training $\beta$; report median and p90 of $\min_j\|z_{\text{samp}}-z_{t+j}\|_1/\text{dim}$ over the same trajectory's future. \textbf{Control}: the same statistic against a \emph{different} trajectory. If in- and cross-trajectory errors match, the model learned the marginal, not the conditional. Because the 4-stage task is only reachable by stitching, also report the statistic across a stitch boundary ($0{\to}x{\to}3$ anchor, $x{\to}3{\to}4$ pool). +\item \textbf{Reward-head calibration.} Predicted vs provenance label on training frames: MAE and AUC, reusing the same batch. +\end{enumerate} +Cost: one $(4096{\times}1536)\,@\,(1536{\times}20000)$ matmul against a fixed 20k-frame pool---milliseconds on an H100. +\section{Deployment target} +\texttt{rsm\_real} (\texttt{real/env.py}): \texttt{FR3RealEnv.step(action\_10d)} applies the absolute setpoint and returns \texttt{\{images\{global,wrist\}, state(10), task\}}; reward/done are always $0$/False, so episode management and success detection ($\{3,4\}$) live in the evaluation runner; start states reset to \texttt{states[i].qpos}. +\section*{Provenance of numbers} +\texttt{scripts/tmp/cooking\_routes.py} over all 248 parquet files (LSF job 1814742; the first run, 1814558, exited 0 with empty stdout and was discarded). Model/ladder evidence: gen\_q\#261 comments; $\beta$ reachability: gen\_q\#262. +\end{document} diff --git a/gen_q_rsm/rsm_rise/pipeline/output/real/report_numbers.json b/gen_q_rsm/rsm_rise/pipeline/output/real/report_numbers.json new file mode 100644 index 0000000000000000000000000000000000000000..c7e816ea620925c9ee53445dfb1bc28269882b60 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/real/report_numbers.json @@ -0,0 +1,489 @@ +{ + "hold": { + "first": 0.81, + "chunk": 1.53, + "step": 0.22 + }, + "openpi": { + "stock_s0": [ + 30000, + [ + 0.84, + 1.18, + 0.0076, + 0.973, + 0.49, + 0.64 + ] + ], + "stock_s1": [ + 30000, + [ + 0.83, + 1.16, + 0.0073, + 0.968, + 0.49, + 0.63 + ] + ], + "rise_s0": [ + 30000, + [ + 0.94, + 1.3, + 0.0066, + 0.97, + 0.63, + 0.91 + ] + ], + "rise_s1": [ + 30000, + [ + 0.92, + 1.29, + 0.0062, + 0.97, + 0.64, + 0.91 + ] + ], + "riseadv_s0": [ + 30000, + [ + 1.13, + 1.5, + 0.0079, + 0.967, + 0.8, + 1.07 + ] + ] + }, + "robomimic": { + "S0Aidql_seed0": { + "2500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e2500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921193225/models/model_epoch_2500.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.4767223129031201, + "chunk": 0.572434189946454, + "first_max": 1.3974961595220428, + "grip": 0.9687995913299433 + }, + "3000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e3000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921193225/models/model_epoch_3000.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.4266186435851367, + "chunk": 0.5339537522453337, + "first_max": 1.4228566756681318, + "grip": 0.9705401029509878 + }, + "2000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e2000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921193225/models/model_epoch_2000.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.5835062392895979, + "chunk": 0.6964703717352241, + "first_max": 1.457355765127963, + "grip": 0.9626117559469425 + }, + "100": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e100/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/rolling/model_epoch_100.pth", + "stride": 10, + "n_episodes": 5, + "first": 1.6351876172941011, + "chunk": 1.94402741875999, + "first_max": 3.3536845946276337, + "grip": 0.9513619010654114 + }, + "500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921080142/models/model_epoch_500.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.8169076536181685, + "chunk": 1.1056784656487597, + "first_max": 2.1278274723605572, + "grip": 0.9445354931637402 + }, + "1000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e1000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921104918/models/model_epoch_1000.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.5991385659212085, + "chunk": 0.8321056508367906, + "first_max": 1.6470824165495344, + "grip": 0.9519781453461471 + }, + "1500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/replay_e1500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921132109/models/model_epoch_1500.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.5876933373003387, + "chunk": 0.7393039829336869, + "first_max": 1.6088605224634778, + "grip": 0.9554657798803626 + } + }, + "S0Aidql_seed1": { + "3000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/replay_e3000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921235824/models/model_epoch_3000.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.39614248256384393, + "chunk": 0.48914993431610015, + "first_max": 1.3440328817202476, + "grip": 0.9732911727735265 + }, + "2000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/replay_e2000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921072249/models/model_epoch_2000.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.5042376417577803, + "chunk": 0.6515312010362829, + "first_max": 1.34116290669096, + "grip": 0.9628673754543885 + }, + "500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/replay_e500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921072249/models/model_epoch_500.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.7957008426891293, + "chunk": 1.040565098450472, + "first_max": 2.0324044900643043, + "grip": 0.9503346930314419 + }, + "1000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/replay_e1000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921072249/models/model_epoch_1000.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.7801204316232854, + "chunk": 0.9643857646910543, + "first_max": 1.8109050467167112, + "grip": 0.9579949619659248 + }, + "1500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/replay_e1500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921072249/models/model_epoch_1500.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.5370011868214756, + "chunk": 0.7212572365996188, + "first_max": 1.5692557447924287, + "grip": 0.9538048497301764 + }, + "2500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/real/replay/S0Aidql_s1_e2500/replay_eval.json", + "ckpt": "runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921072249/models/model_epoch_2500.pth", + "stride": 10, + "n_episodes": 25, + "first": 0.38747837046388484, + "chunk": 0.5138555212718142, + "first_max": 1.2753005983160852, + "grip": 0.963909606566143 + } + }, + "S0B_seed1": { + "4000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e4000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_4000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.4648206047825385, + "chunk": 1.6161320321815706, + "first_max": 4.218553009335667, + "grip": 0.9330432376332679 + }, + "2500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e2500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_2500.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.5882305651101274, + "chunk": 1.743724080824359, + "first_max": 4.3774328650641765, + "grip": 0.9435691571594682 + }, + "4500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e4500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_4500.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.4167717456240763, + "chunk": 1.5512425237923255, + "first_max": 4.124415549513389, + "grip": 0.9423683548281734 + }, + "3500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e3500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_3500.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.3957188615260392, + "chunk": 1.5191019147355127, + "first_max": 4.088074101125616, + "grip": 0.9432553735210601 + }, + "3000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e3000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_3000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.5254810292396388, + "chunk": 1.6705881242413536, + "first_max": 4.184616700485716, + "grip": 0.9439476688615465 + }, + "2000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e2000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_2000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.697193729038372, + "chunk": 1.8774607703215909, + "first_max": 4.719736219723785, + "grip": 0.9226440198547254 + }, + "500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_500.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.797217094117471, + "chunk": 2.9805063526962967, + "first_max": 5.986282082712271, + "grip": 0.9345779137055723 + }, + "1000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/replay_e1000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_1000.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.2732248783691116, + "chunk": 2.392631228925765, + "first_max": 5.4221207992458655, + "grip": 0.9245712940669876 + }, + "5000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/real/replay/S0B_s1_e5000/replay_eval.json", + "ckpt": "runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_5000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.7456874928117077, + "chunk": 1.8639204780041712, + "first_max": 4.566644692121131, + "grip": 0.9326916882931313 + } + }, + "S0B_seed0": { + "4000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e4000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_4000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.4548956736144836, + "chunk": 1.5636513450119247, + "first_max": 4.134867164009248, + "grip": 0.9512715586548153 + }, + "5000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e5000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_5000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.6890695415404722, + "chunk": 1.777741526092145, + "first_max": 4.351446765416842, + "grip": 0.9523778870451666 + }, + "2500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e2500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_2500.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.1668806713224287, + "chunk": 2.221480133926951, + "first_max": 5.154290562774683, + "grip": 0.9390524881937701 + }, + "4500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e4500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_4500.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.1572090700189097, + "chunk": 2.2444972149756044, + "first_max": 5.413614019016155, + "grip": 0.9418990904279668 + }, + "3500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e3500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_3500.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.9620710583292762, + "chunk": 2.0373867923744893, + "first_max": 5.074057375217824, + "grip": 0.9516328816148082 + }, + "3000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e3000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_3000.pth", + "stride": 10, + "n_episodes": 25, + "first": 1.687439302356722, + "chunk": 1.7906986275869403, + "first_max": 4.498974741135083, + "grip": 0.9424566049636668 + }, + "2000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e2000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_2000.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.3323275662274536, + "chunk": 2.455836423411752, + "first_max": 5.703560446542124, + "grip": 0.9372766717690797 + }, + "500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921045653/models/model_epoch_500.pth", + "stride": 10, + "n_episodes": 25, + "first": 3.2144736494757713, + "chunk": 3.370944764900437, + "first_max": 7.356004424021331, + "grip": 0.9287198564187689 + }, + "1000": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e1000/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_1000.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.1684330428072216, + "chunk": 2.3353674225858585, + "first_max": 5.43503297305166, + "grip": 0.9387639160087421 + }, + "1500": { + "path": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/replay_e1500/replay_eval.json", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_1500.pth", + "stride": 10, + "n_episodes": 25, + "first": 2.417502591137684, + "chunk": 2.528998965965538, + "first_max": 5.941818499887907, + "grip": 0.9409073936686327 + } + } + }, + "policies": [ + { + "role": "BC", + "policy": "pi0.5 stock", + "recipe": "pi05_cooking_stock", + "seed": "0", + "length": "29999 steps", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/openpi/checkpoints/pi05_cooking_stock/stock_s0/29999", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/jrjlyj9u" + }, + { + "role": "BC", + "policy": "pi0.5 stock", + "recipe": "pi05_cooking_stock", + "seed": "1", + "length": "29999 steps", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/openpi/checkpoints/pi05_cooking_stock/stock_s1/29999", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/63h0zi0h" + }, + { + "role": "RISE actor", + "policy": "pi0.5 rise", + "recipe": "pi05_cooking_rise", + "seed": "0", + "length": "29999 steps", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/openpi/checkpoints/pi05_cooking_rise/rise_s0/29999", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/8559gx2w" + }, + { + "role": "RISE actor", + "policy": "pi0.5 rise", + "recipe": "pi05_cooking_rise", + "seed": "1", + "length": "29999 steps", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/openpi/checkpoints/pi05_cooking_rise/rise_s1/29999", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/i32p3c9u" + }, + { + "role": "RISE actor", + "policy": "pi0.5 riseadv", + "recipe": "pi05_cooking_riseadv", + "seed": "0", + "length": "29999 steps", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/openpi/checkpoints/pi05_cooking_riseadv/riseadv_s0/29999", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/21pdo7s4" + }, + { + "role": "BC", + "policy": "robomimic S0B", + "recipe": "cooking_v5_expert_suboptimal", + "seed": "0", + "length": "epoch 5000", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed0/cooking_v5_expert_suboptimal_S0B_s0/20260921074624/models/model_epoch_5000.pth", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/4ni99fj6" + }, + { + "role": "BC", + "policy": "robomimic S0B", + "recipe": "cooking_v5_expert_suboptimal", + "seed": "1", + "length": "epoch 5000", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0B_seed1/cooking_v5_expert_suboptimal_S0B_s1/20260921072245/models/model_epoch_5000.pth", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/2fptaa08" + }, + { + "role": "RISE actor", + "policy": "robomimic S0Aidql", + "recipe": "cooking_v5_expert_suboptimal", + "seed": "0", + "length": "epoch 3000", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed0/cooking_v5_expert_suboptimal_S0Aidql_s0/20260921193225/models/model_epoch_3000.pth", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/b4bwu06r" + }, + { + "role": "RISE actor", + "policy": "robomimic S0Aidql", + "recipe": "cooking_v5_expert_suboptimal", + "seed": "1", + "length": "epoch 3000", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/cooking_v5_expert_suboptimal/policy/S0Aidql_seed1/cooking_v5_expert_suboptimal_S0Aidql_s1/20260921235824/models/model_epoch_3000.pth", + "wandb": "https://wandb.ai/richardrl/rsm_rise/runs/gblb2rs2" + } + ], + "openloop": [ + "S0Aidql_s0_e2000_d1_d1_T25", + "S0Aidql_s0_e2000_fold_d4_T25", + "S0Aidql_s1_e2500_d1_d1_T25" + ], + "wandb": { + "project": "richardrl/rsm_rise", + "project_url": "https://wandb.ai/richardrl/rsm_rise", + "access_before": "USER_READ", + "access_after": "USER_READ", + "upsert_error": null + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/output/real/wandb_runs.json b/gen_q_rsm/rsm_rise/pipeline/output/real/wandb_runs.json new file mode 100644 index 0000000000000000000000000000000000000000..4a84187cf0ac640739339a68b8e48e9a58240ea0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/real/wandb_runs.json @@ -0,0 +1,337 @@ +{ + "project": "richardrl/rsm_rise", + "project_url": "https://wandb.ai/richardrl/rsm_rise", + "access_before": "USER_READ", + "access_after": "USER_READ", + "upsert_error": null, + "runs": [ + { + "name": "cooking_v5_expert_suboptimal/S0Aidql_seed0", + "id": "687mz7tn", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/687mz7tn", + "state": "crashed", + "created": "2026-09-21T04:34", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "cooking_v5_expert_suboptimal/S0Aidql_seed0", + "id": "b4bwu06r", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/b4bwu06r", + "state": "running", + "created": "2026-09-21T04:36", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "cooking_v5_expert_suboptimal/S0Aidql_seed1", + "id": "gblb2rs2", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/gblb2rs2", + "state": "running", + "created": "2026-09-21T07:22", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "cooking_v5_expert_suboptimal/S0B_seed0", + "id": "9ts6gdrx", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/9ts6gdrx", + "state": "crashed", + "created": "2026-09-21T04:33", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "cooking_v5_expert_suboptimal/S0B_seed0", + "id": "voo1gg7d", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/voo1gg7d", + "state": "crashed", + "created": "2026-09-21T04:36", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "cooking_v5_expert_suboptimal/S0B_seed0", + "id": "4ni99fj6", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/4ni99fj6", + "state": "finished", + "created": "2026-09-21T04:56", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "cooking_v5_expert_suboptimal/S0B_seed1", + "id": "2fptaa08", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/2fptaa08", + "state": "running", + "created": "2026-09-21T07:24", + "group": "cooking_v5_expert_suboptimal" + }, + { + "name": "dryrun", + "id": "t3xvoa18", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/t3xvoa18", + "state": "crashed", + "created": "2026-09-21T04:31", + "group": null + }, + { + "name": "dryrun", + "id": "8g2f44uy", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/8g2f44uy", + "state": "failed", + "created": "2026-09-21T04:33", + "group": null + }, + { + "name": "dryrun", + "id": "i64sh2d5", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/i64sh2d5", + "state": "failed", + "created": "2026-09-21T04:36", + "group": null + }, + { + "name": "dryrun", + "id": "vcce4gis", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/vcce4gis", + "state": "failed", + "created": "2026-09-21T04:38", + "group": null + }, + { + "name": "dryrun", + "id": "z8b9nx1q", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/z8b9nx1q", + "state": "finished", + "created": "2026-09-21T04:39", + "group": null + }, + { + "name": "dryrun", + "id": "nw2avlas", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/nw2avlas", + "state": "failed", + "created": "2026-09-21T04:44", + "group": null + }, + { + "name": "dryrun", + "id": "v2icvs8k", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/v2icvs8k", + "state": "crashed", + "created": "2026-09-21T04:45", + "group": null + }, + { + "name": "dryrun", + "id": "4j15fd6s", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/4j15fd6s", + "state": "finished", + "created": "2026-09-21T04:45", + "group": null + }, + { + "name": "dryrun", + "id": "rjetm0cv", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/rjetm0cv", + "state": "finished", + "created": "2026-09-21T05:26", + "group": null + }, + { + "name": "real_cooking_v5/hop/flow", + "id": "820a893f607aad64", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/820a893f607aad64", + "state": "finished", + "created": "2026-09-21T09:35", + "group": null + }, + { + "name": "real_cooking_v5/hop/gauss", + "id": "86e1bfad201301a4", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/86e1bfad201301a4", + "state": "finished", + "created": "2026-09-21T09:34", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_L40", + "id": "2b937e092fd6e1bd", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/2b937e092fd6e1bd", + "state": "finished", + "created": "2026-09-21T05:07", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_L40_notrunc", + "id": "a04d4f2d81d3c268", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/a04d4f2d81d3c268", + "state": "finished", + "created": "2026-09-21T05:06", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M", + "id": "4e6f56148cd80f58", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/4e6f56148cd80f58", + "state": "finished", + "created": "2026-09-21T05:07", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_chunk20", + "id": "2b54a724b2ab44df", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/2b54a724b2ab44df", + "state": "finished", + "created": "2026-09-21T05:07", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_notrunc", + "id": "d37fb62fc406cb9b", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/d37fb62fc406cb9b", + "state": "finished", + "created": "2026-09-21T05:06", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_notrunc_s1", + "id": "4df9f838227d899d", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/4df9f838227d899d", + "state": "finished", + "created": "2026-09-21T09:06", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_rterm120", + "id": "5298fdfc68179666", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/5298fdfc68179666", + "state": "finished", + "created": "2026-09-21T10:09", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_rterm40", + "id": "e76fc56d072b7ac3", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/e76fc56d072b7ac3", + "state": "finished", + "created": "2026-09-21T10:06", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_rterm40st", + "id": "0042c325f6059e99", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/0042c325f6059e99", + "state": "finished", + "created": "2026-09-21T10:42", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_M_s1", + "id": "c13cbda5e9e3cb6b", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/c13cbda5e9e3cb6b", + "state": "finished", + "created": "2026-09-21T09:05", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_XL", + "id": "26b079eadd888e90", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/26b079eadd888e90", + "state": "finished", + "created": "2026-09-21T05:07", + "group": null + }, + { + "name": "real_cooking_v5/rsm/R_XL_notrunc", + "id": "061ec9fb1495bd36", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/061ec9fb1495bd36", + "state": "finished", + "created": "2026-09-21T05:07", + "group": null + }, + { + "name": "rise_s0", + "id": "o42diaic", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/o42diaic", + "state": "crashed", + "created": "2026-09-21T04:49", + "group": null + }, + { + "name": "rise_s0", + "id": "qx0lq72j", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/qx0lq72j", + "state": "crashed", + "created": "2026-09-21T04:59", + "group": null + }, + { + "name": "rise_s0", + "id": "8559gx2w", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/8559gx2w", + "state": "finished", + "created": "2026-09-21T05:03", + "group": null + }, + { + "name": "rise_s1", + "id": "i32p3c9u", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/i32p3c9u", + "state": "finished", + "created": "2026-09-21T07:24", + "group": null + }, + { + "name": "riseadv_s0", + "id": "21pdo7s4", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/21pdo7s4", + "state": "finished", + "created": "2026-09-21T11:34", + "group": null + }, + { + "name": "stock_s0", + "id": "6oytw6yb", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/6oytw6yb", + "state": "crashed", + "created": "2026-09-21T04:44", + "group": null + }, + { + "name": "stock_s0", + "id": "gdro0hso", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/gdro0hso", + "state": "crashed", + "created": "2026-09-21T04:45", + "group": null + }, + { + "name": "stock_s0", + "id": "jrjlyj9u", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/jrjlyj9u", + "state": "running", + "created": "2026-09-21T05:01", + "group": null + }, + { + "name": "stock_s1", + "id": "nz9lttur", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/nz9lttur", + "state": "crashed", + "created": "2026-09-21T07:23", + "group": null + }, + { + "name": "stock_s1", + "id": "vs5372lv", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/vs5372lv", + "state": "crashed", + "created": "2026-09-21T07:39", + "group": null + }, + { + "name": "stock_s1", + "id": "63h0zi0h", + "url": "https://wandb.ai/richardrl/rsm_rise/runs/63h0zi0h", + "state": "finished", + "created": "2026-09-21T08:02", + "group": null + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/output/scorer_rank_macros.tex b/gen_q_rsm/rsm_rise/pipeline/output/scorer_rank_macros.tex new file mode 100644 index 0000000000000000000000000000000000000000..63745a5b7cf5bed8e7d818ade448f30177a17f69 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/scorer_rank_macros.tex @@ -0,0 +1,36 @@ +% Generated by scripts/scorer_rank_table.py -- do not edit by hand. +% Consumed by docs/tex/value_selection_impossible.tex. + +\newcommand{\OracleIQL}{--} +\newcommand{\RankIQL}{$51.5$} +\newcommand{\SpreadIQL}{$0.0014$} +\newcommand{\AucIQL}{--} +\newcommand{\OracleIFQL}{--} +\newcommand{\RankIFQL}{$44.5$} +\newcommand{\SpreadIFQL}{$5.7e-06$} +\newcommand{\AucIFQL}{$\geq 1.000$} +\newcommand{\OracleRSM}{--} +\newcommand{\RankRSM}{--} +\newcommand{\SpreadRSM}{--} +\newcommand{\AucRSM}{--} +\newcommand{\OracleTDF}{--} +\newcommand{\RankTDF}{--} +\newcommand{\SpreadTDF}{--} +\newcommand{\AucTDF}{--} +\newcommand{\OracleLeWM}{--} +\newcommand{\RankLeWM}{--} +\newcommand{\SpreadLeWM}{--} +\newcommand{\AucLeWM}{--} +\newcommand{\OracleDINOWM}{--} +\newcommand{\RankDINOWM}{--} +\newcommand{\SpreadDINOWM}{--} +\newcommand{\AucDINOWM}{--} + +% aggregates quoted in the subsection's prose +\newcommand{\IFQLnCritics}{$21$} +\newcommand{\IFQLnTasks}{$7$} +\newcommand{\IFQLrankMean}{$46.9$} +\newcommand{\IFQLrankMin}{$35.7$} +\newcommand{\IFQLrankMax}{$55.8$} +\newcommand{\IFQLspreadMax}{$0.0008$} +\newcommand{\IFQLglobalRange}{$14$--$65$} diff --git a/gen_q_rsm/rsm_rise/pipeline/output/seed_semantics.tex b/gen_q_rsm/rsm_rise/pipeline/output/seed_semantics.tex new file mode 100644 index 0000000000000000000000000000000000000000..cbcebfb66520bbef76da8993102d79dd0d2fc9bb --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/seed_semantics.tex @@ -0,0 +1,16 @@ +% Seed semantics and the choice of replication unit. Moved out of the table captions: a caption in this +% project is at the size where tectonic aborts the table block, and this is methodology rather than a +% table-reading aid. \input this where \S\ref{sec:seed-semantics} is cited. +\subsection{Seeds and the unit of replication} +\label{sec:seed-semantics} +A seed in our tables varies two things: the stochastic action draw of the policy, and the initial +conditions sampled by the environment. The network initialisation is held fixed across seeds, so the error +bars measure run-to-run variation under resampling rather than variation across independently initialised +training runs; we state this rather than implying the stronger quantity. Every method in a given table is +evaluated on the same seed set, so the comparison is unaffected by the choice. + +We report the standard error \emph{across seeds} rather than a binomial interval over pooled rollouts. A +binomial interval would treat the correlated episodes produced by one policy at one seed as independent +draws and understate the spread by roughly a third. Where a single seed is all that exists, the entry is +marked and the interval shown is binomial over that seed's episodes; those entries are provisional and are +labelled as such. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/bad_eval_hosts.txt b/gen_q_rsm/rsm_rise/pipeline/output/status/bad_eval_hosts.txt new file mode 100644 index 0000000000000000000000000000000000000000..faa547c312476433acbfcb928a762742d70f621e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/bad_eval_hosts.txt @@ -0,0 +1,65 @@ +p1-r21-n2 +p2-r01-n3 +p2-r03-n1 +p2-r04-n3 +p2-r08-n2 +p2-r09-n1 +p2-r10-n2 +p2-r10-n3 +p2-r11-n4 +p2-r14-n3 +p2-r14-n4 +p2-r15-n4 +p2-r16-n2 +p2-r16-n3 +p2-r17-n3 +p2-r19-n1 +p2-r21-n3 +p2-r24-n4 +p2-r25-n1 +p2-r25-n4 +p2-r29-n2 +p2-r31-n3 +p2-r32-n1 +p3-r05-n4 +p3-r06-n1 +p3-r06-n4 +p3-r09-n1 +p3-r18-n3 +p3-r18-n4 +p3-r27-n4 +p3-r30-n3 +p3-r32-n2 +p4-r03-n3 +p4-r04-n4 +p4-r09-n3 +p4-r09-n4 +p4-r17-n3 +p4-r18-n2 +p4-r19-n1 +p4-r22-n3 +p4-r22-n4 +p4-r24-n2 +p4-r28-n3 +p4-r28-n4 +p4-r31-n2 +p4-r32-n4 +p5-r08-n2 +p5-r11-n2 +p5-r12-n1 +p5-r12-n3 +p5-r12-n4 +p5-r15-n2 +p5-r18-n1 +p5-r18-n2 +p5-r25-n1 +p5-r25-n4 +p5-r32-n2 +p6-r01-n1 +p6-r04-n4 +p6-r08-n1 +p6-r11-n2 +p6-r16-n3 +p6-r23-n2 +p6-r31-n1 +p6-r32-n2 diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/OWNERSHIP.md b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/OWNERSHIP.md new file mode 100644 index 0000000000000000000000000000000000000000..47eb5739c56b146ab322d60ebdc6b84c47ecc20c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/OWNERSHIP.md @@ -0,0 +1,56 @@ +# gen_q#268 handover state, 2026-09-21 17:45 UTC + +## What runs without anyone (LSF jobs, survive the session) +- rr_lewm_babysit2 1822861, rr_dinowm_babysit2 1822862, rr_tdflow_babysit2 1822863 (all on p3-r26-n4). + They were launched at 12:59 and run the FIRST version of scripts/wm_babysit2.py. They still do the + load-bearing thing -- progress = cells on disk, never a returned submit; loud STUCK/DETFAIL lines -- + but they predate four corrections now committed in the file on disk: + 1. a host-level GL failure is reported, not latched as deterministic; + 2. the deterministic-failure window is the CURRENT submission round (pre-fix logs cannot latch it); + 3. `hold` (a deliberate pause, printed as ON HOLD) is distinct from `stuck` (a failure); + 4. --proposer task=FAM keys every count to the proposer's tag. + Python reads its source once, so restarting them is the only way to pick these up: + bkill 1822861 1822862 1822863 + for f in lewm dinowm tdflow; do scripts/bsub_cpu.sh rr_${f}_babysit2 scripts/wm_babysit2.sh $f --iters 400 --nap 300 [--proposer task=FAM ...]; done + bkill was unavailable in the session that wrote this, which is why they were never restarted. + KNOWN CONSEQUENCE of the old rule: a task whose newest two logs for one cell name are both short + non-zero exits is frozen (no resubmission) -- including pairs that mix a pre-13:36 renderer-bug log + with a later failure. A frozen task self-heals when one good run lands; otherwise resubmit by hand: + venv_rsm/bin/python scripts/launch__on_actor.py # idempotent +- The old shell babysitters (wm_babysit.sh, tdflow_babysit.sh) are retired via their own markers; see + RETIRED_OLD_BABYSITTERS.md. Do not resurrect them. + +## Holds +- mug_expert_suboptimal and threading_expert_play carry `hold` (+ `stuck` for the old code) in all + three families' ledgers (status/wmb//.json). Reason: the #267 proposer screen. The + 16:33 / 17:10 login-node launches put every scorer on mug=S3H1 and threading=S0AnsnE500 through the + launchers' --proposer flag; those 84 world-model cells are NOT babysat until the hold is released + with the matching map, e.g. + scripts/wm_babysit2.sh lewm --proposer mug_expert_suboptimal=S3H1 --proposer threading_expert_play=S0AnsnE500 + after deleting the `hold` and `stuck` keys from the two ledgers. +- The DINOWM cells in those launches load wm/dinowm/ckpt_best.pt of a run at ~48k/100k (best-so-far + step 2500 on mug). That file is rewritten as training proceeds; the arms will pool cells scored by + different checkpoints of a 2.5%-trained model. Flagged on #268; not mine to kill. + +## Where each column stands (all on the RISE actor S0A ep5000 unless stated) +- LeWM: 312/315 cells. Four of five active tasks complete on every arm and posted; tipping has L1 + + control at 9/9 and three cells (L2/L4/L8, pol=1 es=0) inside packed job 1822937, preempted twice, + PEND. Result: at random-of-128 on square_sub_20100 (+0.2pp vs its own permuted control), BELOW + random-of-128 on square_expert_play, two_piece_expert_play, two_piece_expert_suboptimal (control + 1.9-2.6x the arg-max). Health numbers per arm in status/wmb/columns.json. +- TD-Flow: 250 cells. Fully seeded pairs: two_piece_expert_suboptimal b0.90 L3 (27.6 vs control 29.1, + dispersion 9.84), threading b0.90 L1 (4.0 vs 0.7, dispersion 5.00, RISE actor -- to be re-run). + square_sub_20100: flagship b0.90 L3 49.1 (9/9) vs control 48.3 (7/9); the table's "59.0" was the + b0.98 L8 arm at 2 cells (62, 56), now 51.5 at 7/9, dispersion 4.02 at ckpt_best step 17500. All + seven dispersion ratios (4.0-28.9 at the checkpoints the evals load; monotone rising with training) + in status/wmb/tdf_dispersion*.json. MC-vs-TD is not answerable on these targets. +- DINO-WM: training ~48k/100k (0.53 s/step); babysitter launches its grid when ckpt_s100000.pt + exists. Eval path smoked end to end (job 1823032). Caveat for the table: DINO-WM trains with the + action-contrastive auxiliary OFF (correct: it is our addition) while DWM has it ON at 0.5, so + DWM-vs-DINO-WM is confounded in DWM's favour. + +## Loader caveat +scripts/tmp/wm_column_report.py is a glob+regex reader of eval_onactor JSONs (the class of loader +this project has been burned by). It agreed with the regenerated table on every overlapping cell +(RISE critic 43.7 exactly) and reads only the canonical env dirs, but it applies no region/criterion/ +epoch filters; use verdict_table/flagship_latex for anything that goes in the paper. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/RETIRED_OLD_BABYSITTERS.md b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/RETIRED_OLD_BABYSITTERS.md new file mode 100644 index 0000000000000000000000000000000000000000..14afc50d0e162e0f8127d11c16a7fa4c409b26a3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/RETIRED_OLD_BABYSITTERS.md @@ -0,0 +1,14 @@ +# The `grid_*` / `flagship_*` markers in status/{lewm,dinowm,tdflow} are RETIREMENT markers + +2026-09-21, gen_q#268. `scripts/wm_babysit.sh` and `scripts/tdflow_babysit.sh` latch on "a submit +command returned" and printed `grid launched, 0 lewm cells on disk` for six of seven tasks for hours +while every cell was crashing in the planner and nothing was queued. They are replaced by +`scripts/wm_babysit2.py`, which measures cells ON DISK and never treats a submit as progress. + +Neither shell babysitter is `main()`-guarded, so editing them while their jobs were mid-`sleep` was +unsafe, and `bkill` was unavailable in that session. Writing every task's marker is their own +documented stop condition: they skip launching and exit with "every task launched; exiting" on their +next iteration. So these files mean "this family is owned by wm_babysit2.py now", NOT "this grid +was launched successfully". + +The live ledgers are status/wmb//.json. Do not resurrect the shell babysitters. diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/columns.json b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/columns.json new file mode 100644 index 0000000000000000000000000000000000000000..d5a82099056ff8f71396caad1db8bfd091371bef --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/columns.json @@ -0,0 +1,1029 @@ +{ + "TDF": { + "complete": [ + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/mug_expert_suboptimal/rsm/TDF_M_s1/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.06983228008628097, + "score_std": 0.04122402658196506, + "spread": 0.08872228262890192, + "success": 0.09333333333333332, + "task": "mug_expert_suboptimal", + "ties": 57.51400079585406 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/mug_expert_suboptimal/rsm/TDF_M_s1/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.039337946469346435, + "score_std": 0.030937487104859655, + "spread": 0.07198652307257143, + "success": 0.04666666666666666, + "task": "mug_expert_suboptimal", + "ties": 64.31579934405026 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.02611076388888889, + "score_std": 0.06417896188276272, + "spread": 0.17325038114691227, + "success": 0.022222222222222223, + "task": "square_expert_play", + "ties": 32.59102222222222 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.04257604166666667, + "score_std": 0.0723882633488482, + "spread": 0.19512402139856178, + "success": 0.06222222222222223, + "task": "square_expert_play", + "ties": 23.7876 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.030843055555555554, + "score_std": 0.07632138919077552, + "spread": 0.21067834809658162, + "success": 0.03777777777777778, + "task": "square_expert_play", + "ties": 15.7796 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.03856631944444444, + "score_std": 0.07748249727147892, + "spread": 0.21209676357694718, + "success": 0.044444444444444446, + "task": "square_expert_play", + "ties": 11.9176 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.5565034722222222, + "score_std": 0.15940283493568924, + "spread": 0.22936079343596838, + "success": 0.11555555555555556, + "task": "square_expert_play", + "ties": 72.76475555555555 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.5633809027777779, + "score_std": 0.1635156633694978, + "spread": 0.21053573642078868, + "success": 0.14, + "task": "square_expert_play", + "ties": 70.91617777777778 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.5849916666666667, + "score_std": 0.15575351951480923, + "spread": 0.20572947894392848, + "success": 0.12444444444444445, + "task": "square_expert_play", + "ties": 78.64066666666668 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.5860295138888889, + "score_std": 0.16022410090936387, + "spread": 0.19855174629933472, + "success": 0.10888888888888888, + "task": "square_expert_play", + "ties": 74.93431111111111 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.581440625, + "score_std": 0.1593728703535704, + "spread": 0.20031586221325848, + "success": 0.10444444444444445, + "task": "square_expert_play", + "ties": 74.2876888888889 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.027115277777777776, + "score_std": 0.04823630636165404, + "spread": 0.16255071418033534, + "success": 0.06444444444444446, + "task": "square_expert_play", + "ties": 26.14488888888889 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0002746527777777778, + "score_std": 0.009174368821198419, + "spread": 0.020269090854393695, + "success": 0.48666666666666664, + "task": "square_sub_20100", + "ties": 51.01182222222222 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 7.881944444444444e-05, + "score_std": 0.009722043679686414, + "spread": 0.022217885523737792, + "success": 0.46222222222222226, + "task": "square_sub_20100", + "ties": 45.28453333333333 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 3, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.00048020833333333336, + "score_std": 0.01136294159507494, + "spread": 0.025054328567442292, + "success": 0.4911111111111111, + "task": "square_sub_20100", + "ties": 40.79488888888889 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.00048680555555555554, + "score_std": 0.01145578003564994, + "spread": 0.025267505685114836, + "success": 0.47777777777777775, + "task": "square_sub_20100", + "ties": 41.16142222222223 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0002902777777777778, + "score_std": 0.012049835361576021, + "spread": 0.026572129633197113, + "success": 0.47555555555555556, + "task": "square_sub_20100", + "ties": 39.58155555555555 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0, + "score_std": 0.008014512029194086, + "spread": 0.01835400596816374, + "success": 0.47333333333333333, + "task": "square_sub_20100", + "ties": 52.144800000000004 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 2.638888888888889e-05, + "score_std": 0.01020383200782963, + "spread": 0.024136879384731844, + "success": 0.45333333333333337, + "task": "square_sub_20100", + "ties": 42.595555555555556 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0, + "score_std": 0.010768494089393973, + "spread": 0.02532238713595367, + "success": 0.4444444444444444, + "task": "square_sub_20100", + "ties": 39.85262222222222 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 8.888888888888889e-05, + "score_std": 0.01074813167056489, + "spread": 0.025087804388470962, + "success": 0.46222222222222226, + "task": "square_sub_20100", + "ties": 38.27444444444445 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 2.083333333333333e-06, + "score_std": 0.007769003590726363, + "spread": 0.017680764987282584, + "success": 0.4577777777777778, + "task": "square_sub_20100", + "ties": 52.73391111111111 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0, + "score_std": 0.008543578466275858, + "spread": 0.019540207219593417, + "success": 0.44, + "task": "square_sub_20100", + "ties": 44.53911111111111 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 6.631944444444444e-05, + "score_std": 0.008720984815418598, + "spread": 0.020345710486739776, + "success": 0.4311111111111111, + "task": "square_sub_20100", + "ties": 42.37404444444444 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0, + "score_std": 0.008827416853724493, + "spread": 0.021052819927015035, + "success": 0.48444444444444446, + "task": "square_sub_20100", + "ties": 40.9648 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 3, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.000125, + "score_std": 0.010677005964137346, + "spread": 0.024025166499558645, + "success": 0.4933333333333334, + "task": "square_sub_20100", + "ties": 39.163555555555554 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.1640638888888889, + "score_std": 0.048051956682364644, + "spread": 0.09152195401941483, + "success": 0.04, + "task": "threading_expert_play", + "ties": 40.27742222222222 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.03423888888888889, + "score_std": 0.02771029784659213, + "spread": 0.07794446914819476, + "success": 0.006666666666666666, + "task": "threading_expert_play", + "ties": 33.35808888888889 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.12241883448925282, + "score_std": 0.0522030777531251, + "spread": 0.13023824005957643, + "success": 0.2488888888888889, + "task": "two_piece_expert_play", + "ties": 31.60001888324128 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.1414076291864582, + "score_std": 0.04844804614646882, + "spread": 0.11355437319973749, + "success": 0.32, + "task": "two_piece_expert_play", + "ties": 34.19467000622506 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.3436666155297523, + "score_std": 0.04808910248142112, + "spread": 0.08651997433478409, + "success": 0.006666666666666666, + "task": "two_piece_expert_play_tipping", + "ties": 46.73972590060058 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.3426527772213319, + "score_std": 0.050699791974665516, + "spread": 0.09496601454713656, + "success": 0.0044444444444444444, + "task": "two_piece_expert_play_tipping", + "ties": 45.13319544159544 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.34235348093653495, + "score_std": 0.04570526989941705, + "spread": 0.08542062953713632, + "success": 0.013333333333333332, + "task": "two_piece_expert_play_tipping", + "ties": 48.000401994087305 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.10814353134762826, + "score_std": 0.055341631488691964, + "spread": 0.1206261020288801, + "success": 0.2488888888888889, + "task": "two_piece_expert_suboptimal", + "ties": 27.563503054475905 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.1279469740051858, + "score_std": 0.06272246772518776, + "spread": 0.12887849126773437, + "success": 0.2644444444444444, + "task": "two_piece_expert_suboptimal", + "ties": 22.746429175852587 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 3, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.11386702367212782, + "score_std": 0.06305185103352687, + "spread": 0.1374882905748894, + "success": 0.27555555555555555, + "task": "two_piece_expert_suboptimal", + "ties": 18.12021667807307 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.11120137808054831, + "score_std": 0.06559385791417853, + "spread": 0.14131108055111635, + "success": 0.25777777777777783, + "task": "two_piece_expert_suboptimal", + "ties": 16.849492393017712 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.1216759283461111, + "score_std": 0.06973912971295801, + "spread": 0.14689251632639078, + "success": 0.2822222222222222, + "task": "two_piece_expert_suboptimal", + "ties": 15.214317206118787 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.16636265051945395, + "score_std": 0.07000578174870631, + "spread": 0.17556520128938485, + "success": 0.16666666666666666, + "task": "two_piece_expert_suboptimal", + "ties": 46.53694167754715 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.17007935880952493, + "score_std": 0.07840747765039023, + "spread": 0.19514801461433343, + "success": 0.18222222222222223, + "task": "two_piece_expert_suboptimal", + "ties": 33.18996241977116 + }, + { + "beta": 0.95, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.18912133615587995, + "score_std": 0.08171081002576769, + "spread": 0.19745371506098383, + "success": 0.2, + "task": "two_piece_expert_suboptimal", + "ties": 27.855517285002378 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.34560223175905463, + "score_std": 0.12325780320622402, + "spread": 0.22141555712871774, + "success": 0.22444444444444445, + "task": "two_piece_expert_suboptimal", + "ties": 61.629718552194845 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.3481545243067448, + "score_std": 0.12445241100287936, + "spread": 0.2190185909704967, + "success": 0.21333333333333332, + "task": "two_piece_expert_suboptimal", + "ties": 59.37528334626016 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.350529329234697, + "score_std": 0.1281293413881539, + "spread": 0.22190453220664214, + "success": 0.21333333333333332, + "task": "two_piece_expert_suboptimal", + "ties": 56.65630368658104 + }, + { + "beta": 0.98, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.3476445111129412, + "score_std": 0.1321979290435816, + "spread": 0.22657641552397806, + "success": 0.24222222222222223, + "task": "two_piece_expert_suboptimal", + "ties": 53.65524591299207 + }, + { + "beta": 0.9, + "cells": 9, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": true, + "depth": 3, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "permuted", + "sat": 0.03605760379035237, + "score_std": 0.041538573157586, + "spread": 0.09585858624158489, + "success": 0.2911111111111111, + "task": "two_piece_expert_suboptimal", + "ties": 24.998489279786707 + } + ], + "incomplete": [ + { + "beta": 0.95, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": false, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.578429296875, + "score_std": 0.16164575798416358, + "spread": 0.20223167018953264, + "success": 0.12000000000000001, + "task": "square_expert_play", + "ties": 72.469 + }, + { + "beta": 0.95, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": false, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.558483203125, + "score_std": 0.1632570977662019, + "spread": 0.2118752649640367, + "success": 0.1325, + "task": "square_expert_play", + "ties": 70.2118 + }, + { + "beta": 0.98, + "cells": 7, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt", + "complete": false, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.5756861607142857, + "score_std": 0.1624857322084143, + "spread": 0.20435238151815951, + "success": 0.1542857142857143, + "task": "square_expert_play", + "ties": 73.43851428571429 + }, + { + "beta": 0.9, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.09353616042212042, + "score_std": 0.018575199226900575, + "spread": 0.04279883547548902, + "success": 0.01, + "task": "two_piece_expert_play_tipping", + "ties": 79.5026619009263 + }, + { + "beta": 0.9, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.0897398908652255, + "score_std": 0.018767607033726822, + "spread": 0.045577362922256996, + "success": 0.02, + "task": "two_piece_expert_play_tipping", + "ties": 69.78366074334863 + }, + { + "beta": 0.9, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.09530296540476986, + "score_std": 0.02092180806822413, + "spread": 0.04815845893812444, + "success": 0.0075, + "task": "two_piece_expert_play_tipping", + "ties": 62.844231026953494 + }, + { + "beta": 0.9, + "cells": 6, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.10097598542020975, + "score_std": 0.0214596886218871, + "spread": 0.04831705345946349, + "success": 0.006666666666666667, + "task": "two_piece_expert_play_tipping", + "ties": 56.42762316003324 + }, + { + "beta": 0.95, + "cells": 7, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.3467142857142857, + "score_std": 0.040084807263689, + "spread": 0.07280444136190264, + "success": 0.0, + "task": "two_piece_expert_play_tipping", + "ties": 66.57651428571428 + }, + { + "beta": 0.95, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.3442968631154924, + "score_std": 0.044378607381257526, + "spread": 0.08112366092613285, + "success": 0.005, + "task": "two_piece_expert_play_tipping", + "ties": 52.76692201761409 + }, + { + "beta": 0.98, + "cells": 7, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 1, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.21960638594552265, + "score_std": 0.0201264622902379, + "spread": 0.051835732196129254, + "success": 0.011428571428571429, + "task": "two_piece_expert_play_tipping", + "ties": 92.36031277109983 + }, + { + "beta": 0.98, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 2, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.21842441170933735, + "score_std": 0.017436908468634372, + "spread": 0.04646635611422319, + "success": 0.005, + "task": "two_piece_expert_play_tipping", + "ties": 92.28068634538153 + }, + { + "beta": 0.98, + "cells": 7, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 4, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.22202703815813754, + "score_std": 0.01733258738389234, + "spread": 0.04437265757587566, + "success": 0.005714285714285714, + "task": "two_piece_expert_play_tipping", + "ties": 91.545131160331 + }, + { + "beta": 0.98, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt", + "complete": false, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.21894987047216855, + "score_std": 0.018794065816441614, + "spread": 0.04884525121540012, + "success": 0.01, + "task": "two_piece_expert_play_tipping", + "ties": 91.1332689932549 + }, + { + "beta": 0.95, + "cells": 8, + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt", + "complete": false, + "depth": 8, + "n": 128, + "n_es": 3, + "n_pol": 3, + "rule": "argmax", + "sat": 0.18869383792871366, + "score_std": 0.08194189601589315, + "spread": 0.19269422131560537, + "success": 0.1675, + "task": "two_piece_expert_suboptimal", + "ties": 26.3870446342844 + } + ], + "n_cells": 520 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion.json b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion.json new file mode 100644 index 0000000000000000000000000000000000000000..51de924e0f616edc856c314ba6e89e6b793312ce --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion.json @@ -0,0 +1,122 @@ +{ + "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/TDF_M/ckpt_best.pt": { + "task": "square_sub_20100", + "step": 17500, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 2.456465244293213, + "mc_vs_mc": 0.6117092967033386, + "ratio_td_over_mc": 4.01573959645823, + "now_vs_mc": 0.5967923402786255, + "clip_frac": 1.4537823517457582e-05, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.5504004955291748, + "mc_std": 1.0036879777908325, + "mean_shift": 0.15408901870250702, + "boot_frac_expected": 0.9319192766649609, + "rms_mean": 0.7762984037399292 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt": { + "task": "square_expert_play", + "step": 45000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 15.511857032775879, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 28.919902294149463, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.015169902704656124, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.8254477977752686, + "mc_std": 1.0034021139144897, + "mean_shift": 0.684992790222168, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7249082922935486 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/TDF_L40/ckpt_best.pt": { + "task": "two_piece_expert_play", + "step": 22500, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 5.3434529304504395, + "mc_vs_mc": 0.6574915647506714, + "ratio_td_over_mc": 8.127028872951001, + "now_vs_mc": 0.6320461630821228, + "clip_frac": 0.0009639209019951522, + "mc_clip_frac": 0.0, + "td_absmax": 10.0, + "mc_absmax": 8.512594223022461, + "td_std": 2.1174910068511963, + "mc_std": 0.9957769513130188, + "mean_shift": 0.32005491852760315, + "boot_frac_expected": 0.9307370055226019, + "rms_mean": 0.8019979000091553 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/mug_expert_suboptimal/rsm/TDF_M_s1/ckpt_best.pt": { + "task": "mug_expert_suboptimal", + "step": 20000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 3.7206130027770996, + "mc_vs_mc": 0.6696966886520386, + "ratio_td_over_mc": 5.555668806226184, + "now_vs_mc": 0.6646969318389893, + "clip_frac": 5.24625793332234e-05, + "mc_clip_frac": 5.056634108768776e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.797516942024231, + "mc_std": 1.0072650909423828, + "mean_shift": 0.23426474630832672, + "boot_frac_expected": 0.9324476160359665, + "rms_mean": 0.8158304691314697 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_best.pt": { + "task": "threading_expert_play", + "step": 17500, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 3.3360865116119385, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 4.9966164742645915, + "now_vs_mc": 0.713172972202301, + "clip_frac": 5.056634108768776e-06, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.6808524131774902, + "mc_std": 0.9931513667106628, + "mean_shift": 0.24912314116954803, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8129637837409973 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/TDF_M/ckpt_best.pt": { + "task": "two_piece_expert_play_tipping", + "step": 70000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 9.750996589660645, + "mc_vs_mc": 0.6551135778427124, + "ratio_td_over_mc": 14.884436713662165, + "now_vs_mc": 0.6470116376876831, + "clip_frac": 0.006754398811608553, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.01792311668396, + "mc_std": 0.9998975992202759, + "mean_shift": 0.6115426421165466, + "boot_frac_expected": 0.9291060685825705, + "rms_mean": 0.7978020906448364 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion_tps.json b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion_tps.json new file mode 100644 index 0000000000000000000000000000000000000000..f3238b13c4fd83deb53ba83ca7900f246853d930 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion_tps.json @@ -0,0 +1,22 @@ +{ + "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/TDF_M/ckpt_s100000.pt": { + "task": "two_piece_expert_suboptimal", + "step": 100000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 6.608145713806152, + "mc_vs_mc": 0.6714845299720764, + "ratio_td_over_mc": 9.84109896631714, + "now_vs_mc": 0.6496365070343018, + "clip_frac": 0.002916413825005293, + "mc_clip_frac": 0.0, + "td_absmax": 10.0, + "mc_absmax": 9.487678527832031, + "td_std": 2.510788917541504, + "mc_std": 1.0030570030212402, + "mean_shift": 0.3782491981983185, + "boot_frac_expected": 0.92711805961742, + "rms_mean": 0.8110573291778564 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion_trend.json b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion_trend.json new file mode 100644 index 0000000000000000000000000000000000000000..5e86b8a6d896e5034bbcdf83869747b898eedc06 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/status/wmb/tdf_dispersion_trend.json @@ -0,0 +1,362 @@ +{ + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s10000.pt": { + "task": "square_expert_play", + "step": 10000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 2.0234107971191406, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 3.772394396748828, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 5.688713372364873e-06, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.468297004699707, + "mc_std": 1.0034021139144897, + "mean_shift": 0.12558652460575104, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7245226502418518 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s20000.pt": { + "task": "square_expert_play", + "step": 20000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 3.9400079250335693, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 7.345648170260034, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.0003052942920476198, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.9038102626800537, + "mc_std": 1.0034021139144897, + "mean_shift": 0.2506430745124817, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7240762114524841 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s30000.pt": { + "task": "square_expert_play", + "step": 30000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 8.662287712097168, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 16.149743628267043, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.0050522093661129475, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 2.8181989192962646, + "mc_std": 1.0034021139144897, + "mean_shift": 0.41446536779403687, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7244939208030701 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s40000.pt": { + "task": "square_expert_play", + "step": 40000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 13.437150955200195, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 25.05187431234246, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.011576531454920769, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.545727491378784, + "mc_std": 1.0034021139144897, + "mean_shift": 0.5958178639411926, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7246984839439392 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s50000.pt": { + "task": "square_expert_play", + "step": 50000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 17.248741149902344, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 32.15810381041038, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.01688852533698082, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 4.044965744018555, + "mc_std": 1.0034021139144897, + "mean_shift": 0.7303525805473328, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7247660756111145 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s60000.pt": { + "task": "square_expert_play", + "step": 60000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 21.056989669799805, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 39.258103176995895, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.023993097245693207, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 4.4893999099731445, + "mc_std": 1.0034021139144897, + "mean_shift": 0.9533187747001648, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7251787185668945 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_s70000.pt": { + "task": "square_expert_play", + "step": 70000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 23.328903198242188, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 43.49379959454806, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.028884125873446465, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 4.74531364440918, + "mc_std": 1.0034021139144897, + "mean_shift": 1.1974263191223145, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7236375212669373 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/TDF_L40/ckpt_best.pt": { + "task": "square_expert_play", + "step": 45000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 15.246285438537598, + "mc_vs_mc": 0.5363730788230896, + "ratio_td_over_mc": 28.424777529832433, + "now_vs_mc": 0.5192247629165649, + "clip_frac": 0.014585861004889011, + "mc_clip_frac": 1.264158527192194e-06, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.7939183712005615, + "mc_std": 1.0034021139144897, + "mean_shift": 0.6689720153808594, + "boot_frac_expected": 0.9330136499376476, + "rms_mean": 0.7249082922935486 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s10000.pt": { + "task": "threading_expert_play", + "step": 10000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 2.444051504135132, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 3.660572939882226, + "now_vs_mc": 0.713172972202301, + "clip_frac": 1.896237790788291e-06, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.4985491037368774, + "mc_std": 0.9931513667106628, + "mean_shift": 0.12415134906768799, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8129794001579285 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s20000.pt": { + "task": "threading_expert_play", + "step": 20000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 3.7757437229156494, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 5.655112126995101, + "now_vs_mc": 0.713172972202301, + "clip_frac": 4.8038025852292776e-05, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.784700870513916, + "mc_std": 0.9931513667106628, + "mean_shift": 0.314748615026474, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8130625486373901 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s30000.pt": { + "task": "threading_expert_play", + "step": 30000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 5.594733238220215, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 8.379499803108994, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.001267318963073194, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 2.2094368934631348, + "mc_std": 0.9931513667106628, + "mean_shift": 0.43077677488327026, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8127362132072449 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s40000.pt": { + "task": "threading_expert_play", + "step": 40000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 7.812865257263184, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 11.701702314904377, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.0037798339035362005, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 2.669649839401245, + "mc_std": 0.9931513667106628, + "mean_shift": 0.6557157635688782, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8125296831130981 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s50000.pt": { + "task": "threading_expert_play", + "step": 50000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 9.66914176940918, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 14.481936511198505, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.005643203854560852, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.0229861736297607, + "mc_std": 0.9931513667106628, + "mean_shift": 0.8714599609375, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8127961754798889 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s60000.pt": { + "task": "threading_expert_play", + "step": 60000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 10.874329566955566, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 16.287003970583207, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.007737914565950632, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.236442804336548, + "mc_std": 0.9931513667106628, + "mean_shift": 0.9780642986297607, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8129537105560303 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s70000.pt": { + "task": "threading_expert_play", + "step": 70000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 11.244455337524414, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 16.841359055901602, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.0077454992569983006, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.3063509464263916, + "mc_std": 0.9931513667106628, + "mean_shift": 0.9568386673927307, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8123131990432739 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s80000.pt": { + "task": "threading_expert_play", + "step": 80000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 10.883676528930664, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 16.301003362993008, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.0064004347659647465, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.24688458442688, + "mc_std": 0.9931513667106628, + "mean_shift": 0.8181911706924438, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8127971887588501 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_s90000.pt": { + "task": "threading_expert_play", + "step": 90000, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 11.09678840637207, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 16.62019122397287, + "now_vs_mc": 0.713172972202301, + "clip_frac": 0.006997117307037115, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 3.266101837158203, + "mc_std": 0.9931513667106628, + "mean_shift": 0.7454031705856323, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8131890892982483 + }, + "/proj/dmfexp/zwhong/rsm_rise/runs/threading_expert_play/rsm/TDF_M/ckpt_best.pt": { + "task": "threading_expert_play", + "step": 17500, + "occupancy_target": "td", + "variant": "td_c", + "sample_clip": 10.0, + "td_vs_mc": 3.328083038330078, + "mc_vs_mc": 0.6676691174507141, + "ratio_td_over_mc": 4.9846292891864215, + "now_vs_mc": 0.713172972202301, + "clip_frac": 1.2009506463073194e-05, + "mc_clip_frac": 6.32079263596097e-07, + "td_absmax": 10.0, + "mc_absmax": 10.0, + "td_std": 1.6805548667907715, + "mc_std": 0.9931513667106628, + "mean_shift": 0.25365832448005676, + "boot_frac_expected": 0.928472199286389, + "rms_mean": 0.8129637837409973 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/output/value_selection_impossible.tex b/gen_q_rsm/rsm_rise/pipeline/output/value_selection_impossible.tex new file mode 100644 index 0000000000000000000000000000000000000000..654ce7d3eab9b5f5b3eed41e48a4467077ad02ce --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/output/value_selection_impossible.tex @@ -0,0 +1,279 @@ +% Why value-based test-time selection cannot work under a data-provenance reward. +% Generated as a standalone subsection (gen_q#264); \input it into the paper. +% Preamble: \usepackage{booktabs} only. The measurement macros below are filled by +% scripts/scorer_rank_table.py --tex, so the numbers never have to be copied by hand. + +% The measurement macros are GENERATED by scripts/scorer_rank_table.py --tex into +% docs/tex/scorer_rank_macros.tex. \input that file in the preamble to fill them; the +% \providecommand defaults below only make this subsection compile standalone (showing `--`), +% and are overridden by the generated \newcommand definitions when they are present. +\providecommand{\OracleIQL}{--} +\providecommand{\OracleIFQL}{--} +\providecommand{\OracleRSM}{--} +\providecommand{\OracleTDF}{--} +\providecommand{\OracleLeWM}{--} +\providecommand{\OracleDINOWM}{--} +\providecommand{\RankIQL}{--} +\providecommand{\SpreadIQL}{--} +\providecommand{\AucIQL}{--} +\providecommand{\RankIFQL}{--} +\providecommand{\SpreadIFQL}{--} +\providecommand{\AucIFQL}{--} +\providecommand{\RankRSM}{--} +\providecommand{\SpreadRSM}{--} +\providecommand{\AucRSM}{--} +\providecommand{\RankTDF}{--} +\providecommand{\SpreadTDF}{--} +\providecommand{\AucTDF}{--} +\providecommand{\RankLeWM}{--} +\providecommand{\SpreadLeWM}{--} +\providecommand{\AucLeWM}{--} +\providecommand{\RankDINOWM}{--} +\providecommand{\SpreadDINOWM}{--} +\providecommand{\AucDINOWM}{--} +\providecommand{\IFQLnCritics}{--} +\providecommand{\IFQLnTasks}{--} +\providecommand{\IFQLrankMean}{--} +\providecommand{\IFQLrankMin}{--} +\providecommand{\IFQLrankMax}{--} +\providecommand{\IFQLspreadMax}{--} +\providecommand{\IFQLglobalRange}{--} + +\subsection{Why a value critic cannot select actions under a data-provenance reward} +\label{sec:value-selection-impossible} + +Every method in Table~\ref{tab:flagship} sees the same reward: the dataset's binary +data-provenance label, which is $1$ on every frame of an expert episode and $0$ on every frame of a +suboptimal one. That reward is what makes the comparison fair, and it is the reward RISE's own +pipeline writes. It also has a consequence for an entire family of test-time selection methods that, +to our knowledge, has not been stated: \emph{a state--action value function fitted to it is +action-independent at the optimum}, so ranking candidate actions with one is ranking by a constant. + +\paragraph{The argument.} +Write $r(s_t) \in \{0,1\}$ for the provenance label, which is constant along any trajectory in the +dataset because it is a property of the \emph{file} an episode came from, not of what happens inside +the episode. Consider the $n$-step bootstrapped target these methods train on, +% +\begin{equation} + y_t \;=\; \sum_{k=0}^{n-1} \gamma^{k}\, r(s_{t+k}) \;+\; \gamma^{n}\, V(s_{t+n}), + \label{eq:nstep} +\end{equation} +% +at the settings the published implementations use ($n = 200$, $\gamma = 0.9999$ for IFQL; $n=1$, +$\gamma = 0.99$ for IQL, whose $V$ then carries the same sum implicitly). Both terms of +(\ref{eq:nstep}) are determined by \emph{which episode region} $s_t$ lies in: the first because +$r$ is constant on the episode, the second because $s_{t+n}$ is reached by the behaviour policy from +$s_t$ and a single action $a_t$ cannot move the trajectory into a different provenance basin --- no +choice of $a_t$ turns a suboptimal episode into an expert one, because provenance is not a physical +property of the state. Hence $y_t$ is a function of $s_t$ alone, the Bellman-optimal solution is +% +\begin{equation} + Q^{*}(s,a) \;=\; V^{*}(s) \qquad \mbox{for all } a, + \label{eq:qv} +\end{equation} +% +and an action-blind critic is \emph{correct} rather than undertrained. Best-of-$N$ selection under +(\ref{eq:qv}) returns an arbitrary element of the candidate set: it is a random-of-$N$, and no amount +of training, capacity or tuning changes that, because there is nothing in the objective for the +action argument to explain. + +\paragraph{Why it is worse than a random-of-$N$, not equal to it.} +A fitted critic never attains (\ref{eq:qv}) exactly, so whatever action dependence it retains is +\emph{fitting noise} --- and $\arg\max$ over $N$ samples is precisely the operator that converts noise +into a systematic penalty, because it selects the extreme of that noise at every one of the $\sim\!50$ +decisions in an episode. A critic whose action dependence is either negligible or miscalibrated is therefore worse than no +critic at all, and we observe both shapes. The flow critic is \emph{action-blind}: its score moves by +$5.7{\times}10^{-6}$ of its own scale across the $128$ candidates at a state, and it ranks the logged +action \emph{higher} on suboptimal-provenance frames than on expert ones (rank gap $-12.9$ to +$+4.0$\,pp, negative on $9$ of $11$ critics). The IQL critic is instead \emph{miscalibrated}: on +held-out real-robot decisions its ordering is bimodal rather than flat, placing its pick in the oracle's +best decile more often than chance ($14.0\,\%$ against $8.1\,\%$) \emph{and} in the worst decile far +more often ($22.0\,\%$ against $12.1\,\%$; tenth percentile $0.031$ against $0.079$). It carries real +signal with a heavy bad tail. An $\arg\max$ over $128$ candidates punishes both shapes, and the +rollouts show the penalty: + +\begin{center} +\footnotesize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{lccc} +\toprule +On the \emph{same} actor and the same $128$ candidates & SR (\%) & $n$ & vs.\ no selection \\ +\midrule +No selection (one sample from the actor) & $29.7$ & $1400$ & --- \\ +Random-of-$128$ (ignore the scores) & $30.7$ & $150$ & $+1.0$ \\ +IFQL critic, $N{=}128$ & $17.3$ & $150$ & $-13.3$, $p=0.004$ \\ +IQL critic (RISE's own), $N{=}128$ & $6.8$ & $1400$ & $-22.9$, $p=1.4{\times}10^{-54}$ \\ +\bottomrule +\end{tabular} +\end{center} + +\noindent +\textbf{Both directions of the control matter.} Random-of-$128$ lands on no-selection ($30.7$ against +$29.7$), which establishes that the harness, the candidate set and the episode protocol are sound --- a +column below random invites the suspicion that the baseline was mis-run, and this is the measurement that +rules it out. Only the \emph{ranking} is broken. And the effect replicates across two independently +trained critics at very different sample sizes: RISE's released critic at $n=1400$ paired episodes +carries the claim, and our own IFQL critic at $n=150$ (one policy seed, three evaluation seeds) +reproduces it; we do not rest the argument on the smaller measurement. + +\paragraph{What the diagnostics can and cannot establish.} +Before the numbers, what each one tests, because two of the three are easy to over-read. +\textbf{Per-state spread} --- how much a scorer's output moves across the $128$ candidates at a single +state --- tests whether the scorer is a function of the action \emph{at all}. It is the quantity +(\ref{eq:qv}) makes a prediction about, and nothing more: it does not order the candidates and therefore +cannot indicate ranking \emph{quality}. \textbf{Recorded-action rank}, the percentile of the logged +chunk among the candidates, is scale-free and so cannot be confounded by the units of the score, but it +is a fair test only of action-blindness, not of quality: the recorded action is what the behaviour +policy did, and a scorer that reads a provenance label off a predicted future has no reason to prefer +the logged chunk over $127$ alternatives that lead somewhere equally expert-like. An \textbf{oracle-referenced} measure --- where a scorer's own pick falls in the ranking induced by +distance to the logged chunk, for which a uniform pick scores $50$ by construction --- speaks to quality +only if the oracle orders candidates by \emph{where the action leads}. We tried both. Ordering by +end-effector displacement does separate the families (below). Ordering by action-space distance does +not, and instructively so: all six scorers we measured, value critics and occupancy models alike, sit +between $31$ and $38$ against the uniform null of $50$. A depression that uniform across families is a +property of that oracle rather than of the scorers --- it rewards reproducing the logged chunk, which is +the same flaw the recorded-action rank has --- so we use only the displacement-referenced form for the +quality claim. We report all of these and hold each to what it supports. + +\paragraph{The measurements.} +On identical states and the identical $128$ candidate chunks drawn from the same actor: + +\begin{center} +\footnotesize +\setlength{\tabcolsep}{4pt} +\begin{tabular}{lcccc} +\toprule +Scorer & Oracle (pct.) & Rank (pct.) & Spread & AUC \\ +\midrule +IQL critic (RISE's) & \OracleIQL & \RankIQL & \SpreadIQL & \AucIQL \\ +IFQL critic & \OracleIFQL & \RankIFQL & \SpreadIFQL & \AucIFQL \\ +TD-Flow occupancy & \OracleTDF & \RankTDF & \SpreadTDF & \AucTDF \\ +RSM occupancy (ours) & \OracleRSM & \RankRSM & \SpreadRSM & \AucRSM \\ +\bottomrule +\end{tabular} +\end{center} + +\noindent +``Oracle'' is where the scorer's own pick falls in the ranking induced by distance to the logged +chunk, ``Rank'' the recorded action's percentile among the candidates, ``Spread'' the coefficient of +variation of the score across them at one state, and ``AUC'' the provenance separation, which is +context only. $50$ is a uniform pick for the first two; below $50$ is anti-selection. + +The spread column behaves exactly as (\ref{eq:qv}) predicts and separates the two families by four +orders of magnitude on identical inputs: the value critics move by $\sim\!10^{-6}$--$10^{-3}$ of their +own scale across the candidates at a state, the occupancy scorers by $\sim\!10^{-2}$. These are +raw-logit read-outs; we name the read-out with every spread figure because it changes the number by two +orders of magnitude, and an earlier comparison of ours across regimes was confounded by mixing the two +(under matched logit read-outs the simulation and real-corpus relative spreads agree to within a factor +of two). We take no position on which read-out is correct: the mean-sigmoid one is heavily saturated in +both regimes, and to a similar degree --- its arg-max is tied across $45$--$71$ of the $128$ candidates +in simulation and $\sim\!37$ on the real-robot corpus, against exactly one for the logit in both, so the +tie structure is a property of the read-out rather than of a corpus --- and yet it still wins on some +tasks, so a coarse filter over many survivors can beat a fine but misaligned ordering. Where a +saturated read-out is used, its arg-max is a near-uniform draw over roughly a third of the candidate +set, and any ordering claim made from it is really a claim about that filter. We note an open question +rather than resolving it: the tie structure is read-out-dependent and corpus-\emph{in}dependent, yet +which read-out wins is corpus-\emph{de}pendent --- the logit ordering is the better one on the +real-robot corpus and the worse one on one simulated task --- so the tie count cannot be the mechanism, +and something about how well the logit ordering aligns with task progress differs between the two +successor models. We therefore report the tie count and the +coefficient of variation per arm rather than prescribing a read-out. That is the +contrast the argument makes, and it falsified the IFQL critic exactly as intended. The +recorded-action rank, by contrast, is near chance for \emph{every} scorer including our own, and its +expert-minus-suboptimal gap is inconsistently signed for all of them --- which is what the paragraph +above anticipates, and which is why we do not read it as a result in either direction. We also do not +let spread stand in for quality: the highest spread in the table belongs to a scorer evaluated at +$5$--$18\,\%$ of its training budget, so spread cannot be what predicts rollout success either. The +efficacy evidence is the rollout margins, not these diagnostics. + +On the one per-decision measure that does speak to ranking \emph{quality} --- where each scorer's own +pick falls in the ordering induced by distance to the logged chunk, over $705$ held-out real-robot +decisions, with both shuffled-score controls landing on the null ($0.489$ and $0.473$) --- the two +families separate in opposite directions, and the effect is concentrated in the tails. At its best +single-hop setting the occupancy scorer means $0.616$ against a null of $0.490$ and lands in the oracle's +best decile $25.0\,\%$ of the time against $11.1\,\%$ for its own shuffled-score control; the IQL critic +means $0.470$ and lands in the \emph{worst} decile $22.0\,\%$ of the time against $12.1\,\%$. Because a +permuted control's own apparent ``headroom closed'' wanders between $-1.2\,\%$ and $+3.5\,\%$ across +cells, we report the paired bootstrap over decisions rather than any point estimate: the occupancy +scorer beats its control by $+0.357$\,cm, CI $[+0.251, +0.467]$ ($4000$ resamples), with a second +single-hop cell at a different discount reproducing it at $+0.314$\,cm, CI $[+0.198, +0.430]$. Both +intervals clear zero. On a greedy-to-oracle gap of $2.3$\,cm that is $20.2\,\%$ of the attainable +improvement --- small but not marginal, and it coexists with winning fewer than half of the individual +decisions. \textbf{This is the best cell of a disclosed search}: the read-out (mean-sigmoid or raw +logit), the discount and the number of hops were all swept --- $36$ configurations in all, $18$ in each +of the two read-outs --- and we quote the maximum, so it carries the same selection caveat as the main +table's own configuration search. The +weakest single-hop cell in that grid closes $5.1\,\%$ of the headroom and still clears zero. The mean understates it because a +scorer that avoids bad picks without finding the best one moves the tails more than the centre. The +supported claim is that its ordering carries usable information about candidate quality, concentrated in +the tails --- not that it ranks well. This is open-loop, single-decision, on the real corpus. + +\paragraph{The honest limits.} +None of this says the successor model is a good occupancy estimator in absolute terms. Under the +fixed-protocol evaluation it beats the corpus marginal --- in-trajectory $0.6339 \pm 0.0003$ against +cross-trajectory $0.9368 \pm 0.0018$ and random $0.9678 \pm 0.0007$, so the cross-trajectory control +passes --- but it does \emph{not} beat a trivial stay predictor ($\mathrm{vs\_stay}$ +$1.4706 \pm 0.0041$). Two further facts belong beside each other, because together they are the most +surprising thing here. The ordering above is extracted from a score that varies across the $128$ +candidates by a standard deviation of $1.9{\times}10^{-4}$ on a mean magnitude of $0.292$ --- about +$0.07\,\%$ relative, \emph{under the mean-sigmoid read-out}, where the same cell read as raw logits +gives $2.57$ on $27.7$ --- and the reward head's magnitude is itself degenerate under this reward mode, +reading $\sim\!10^{-10}$ at one hop and collapsing to $\sim\!10^{-35}$ by eight. That the +\emph{ordering} survives where the \emph{magnitude} does not is interesting in its own right. It also +bears on the depth response, where two earlier readings of ours are now \emph{retracted}. Under the +saturated read-out every multi-hop cell's advantage over its own control looked statistically +indistinguishable from zero. Repeating the identical $705$ decisions and candidate sets under the +raw-logit read-out makes \emph{all eighteen} cells clear zero: at the better discount the margin is +$20.2\,\%$ of headroom at one hop, $\sim\!13\,\%$ at two, and $3.5$--$12\,\%$ at four, six and eight, +every interval above zero and none beating one hop. Of the three outcomes we named in advance --- depth +collapses, depth recovers, or depth stays flat while every margin grows --- the third occurred. So +selection works at \emph{every} depth and chaining never adds reach: it costs part of the single-hop +margin while staying above chance. The two hop families agree closely at matched depth ($12.9$ against +$13.3\,\%$ at two hops, $8.9$ against $7.6\,\%$ at four, $9.9$ against $8.2\,\%$ at eight), which was +the point of sweeping both: the depth behaviour belongs to the successor model rather than to +hop-sample quality. Two limitations remain and they are not the same --- one hop outperforms more hops, +and the reward cannot vary along a composed route at all ($\sim\!10^{-10}$ at one hop, +$\sim\!10^{-35}$ by eight). Only the second is addressed by fixing the reward mode, so none of this is +yet a claim about stitching: it is selection, at every depth. + +The two value critics classify provenance +almost perfectly and rank actions at chance; across \IFQLnCritics{} independently trained IFQL +critics on \IFQLnTasks{} tasks the mean recorded-action rank is \IFQLrankMean{} (min \IFQLrankMin{}, +max \IFQLrankMax{}) while the per-state spread never exceeds \IFQLspreadMax{} of one bin of the +critic's own $101$-bin value head, against a \emph{global} range of \IFQLglobalRange{} bins --- the +global number being the one that looks impressive. RISE's released critic and IDQL's critic on our real-robot data show +the same pattern, the latter scoring \emph{below} a plain sample from its own actor. + +\paragraph{Why an occupancy scorer is not subject to this.} +The successor model is not a return. It is conditioned on the candidate action chunk through the +\emph{dynamics}: it predicts the distribution of states the chunk leads to and reads the provenance +label there. Formally it estimates $\mathrm{E}\left[r(s') \mid s, a\right]$ under a learned +discounted occupancy $\mu^{\beta}(s' \mid s, a)$ rather than $\mathrm{E}[\sum \gamma^k r]$, so the +action enters through $\mu^{\beta}$, which genuinely depends on it, instead of through a sum whose +value the action cannot change. The degeneracy of (\ref{eq:qv}) is therefore specific to the value +family, and the gap in the table above is a difference in \emph{what the scorer conditions on}, not +in how well either was tuned. + +\paragraph{The failure does not depend on the bootstrap length.} +If a value critic's action-blindness were merely an artefact of estimating a $200$-step return, then +shortening the bootstrap should recover it. We therefore swept $n \in \{1, 5, 20\}$ against the +published $n = 200$, retraining each to the same $500\,000$ gradient steps and measuring on the same +states and the same $128$ actor samples. It does not recover: the per-state spread is +$1.0{\times}10^{-4}$, $2.4{\times}10^{-5}$, $4.0{\times}10^{-4}$ and $2.9{\times}10^{-4}$ bins at +$n = 1, 5, 20, 200$ --- every one of them two to four orders of magnitude below the one-bin resolution +of the critic's own value head, with no monotone trend in $n$ --- while the provenance AUC stays at +$0.996$ or above throughout. Over a $200$-fold range of bootstrap length the critic remains an +essentially perfect state classifier and never becomes a ranker, which is what +(\ref{eq:qv}) implies: the action argument has nothing to explain at any horizon. We report this as an +insensitivity across a swept axis rather than as a trend, because none of the three diagnostics varies +monotonically with $n$. We also declined to promote the best cell ($n = 20$, the only one with a +positive expert-minus-suboptimal gap) to a full evaluation column: a $1.4\times$ improvement on a +quantity three orders of magnitude below threshold is not a steel-manned baseline. + +\paragraph{Consequence for the comparison.} +We report the faithful published configuration of each baseline, and separately a steel-manned +variant for any baseline whose published configuration is degenerate by +(\ref{eq:qv}) --- for IFQL, a shorter bootstrap (smaller $n$, equivalently a smaller discount), which +is the lever that gives the action something to explain without altering the reward. We do this because ``our method beats an action-blind scorer'' +is not a result worth reporting; the comparison that matters is against the best version of the +baseline family, and where no version of it can work, that impossibility is itself the finding. diff --git a/gen_q_rsm/rsm_rise/pipeline/patches/mimicgen_mug_cleanup.py b/gen_q_rsm/rsm_rise/pipeline/patches/mimicgen_mug_cleanup.py new file mode 100644 index 0000000000000000000000000000000000000000..c718e2270ecf36b4cfdffbc55e9d28193ced0379 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/patches/mimicgen_mug_cleanup.py @@ -0,0 +1,711 @@ +# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Licensed under the NVIDIA Source Code License [see LICENSE for details]. + +""" +Simpler object cleanup task (inspired by BUDS Hammer Place, see https://github.com/ARISE-Initiative/robosuite-task-zoo) +where a single object needs to be packed away into a drawer. The default task is to cleanup a +particular mug. +""" +import os +import random +from collections import OrderedDict +from copy import deepcopy +import numpy as np + +from robosuite.utils.mjcf_utils import CustomMaterial, add_material, find_elements, string_to_array + +import robosuite.utils.transform_utils as T + +from robosuite.models.arenas import TableArena +from robosuite.models.tasks import ManipulationTask +from robosuite.utils.placement_samplers import SequentialCompositeSampler, UniformRandomSampler +from robosuite.utils.observables import Observable, sensor + +import mimicgen_envs +from mimicgen_envs.models.robosuite.objects import BlenderObject, DrawerObject, LongDrawerObject +from mimicgen_envs.envs.robosuite.single_arm_env_mg import SingleArmEnv_MG + + +class MugCleanup(SingleArmEnv_MG): + """ + This class corresponds to the object cleanup task for a single robot arm. + + Args: + robots (str or list of str): Specification for specific robot arm(s) to be instantiated within this env + (e.g: "Sawyer" would generate one arm; ["Panda", "Panda", "Sawyer"] would generate three robot arms) + Note: Must be a single single-arm robot! + + env_configuration (str): Specifies how to position the robots within the environment (default is "default"). + For most single arm environments, this argument has no impact on the robot setup. + + controller_configs (str or list of dict): If set, contains relevant controller parameters for creating a + custom controller. Else, uses the default controller for this specific task. Should either be single + dict if same controller is to be used for all robots or else it should be a list of the same length as + "robots" param + + gripper_types (str or list of str): type of gripper, used to instantiate + gripper models from gripper factory. Default is "default", which is the default grippers(s) associated + with the robot(s) the 'robots' specification. None removes the gripper, and any other (valid) model + overrides the default gripper. Should either be single str if same gripper type is to be used for all + robots or else it should be a list of the same length as "robots" param + + initialization_noise (dict or list of dict): Dict containing the initialization noise parameters. + The expected keys and corresponding value types are specified below: + + :`'magnitude'`: The scale factor of uni-variate random noise applied to each of a robot's given initial + joint positions. Setting this value to `None` or 0.0 results in no noise being applied. + If "gaussian" type of noise is applied then this magnitude scales the standard deviation applied, + If "uniform" type of noise is applied then this magnitude sets the bounds of the sampling range + :`'type'`: Type of noise to apply. Can either specify "gaussian" or "uniform" + + Should either be single dict if same noise value is to be used for all robots or else it should be a + list of the same length as "robots" param + + :Note: Specifying "default" will automatically use the default noise settings. + Specifying None will automatically create the required dict with "magnitude" set to 0.0. + + table_full_size (3-tuple): x, y, and z dimensions of the table. + + table_friction (3-tuple): the three mujoco friction parameters for + the table. + + use_camera_obs (bool): if True, every observation includes rendered image(s) + + use_object_obs (bool): if True, include object (cube) information in + the observation. + + reward_scale (None or float): Scales the normalized reward function by the amount specified. + If None, environment reward remains unnormalized + + reward_shaping (bool): if True, use dense rewards. + + has_renderer (bool): If true, render the simulation state in + a viewer instead of headless mode. + + has_offscreen_renderer (bool): True if using off-screen rendering + + render_camera (str): Name of camera to render if `has_renderer` is True. Setting this value to 'None' + will result in the default angle being applied, which is useful as it can be dragged / panned by + the user using the mouse + + render_collision_mesh (bool): True if rendering collision meshes in camera. False otherwise. + + render_visual_mesh (bool): True if rendering visual meshes in camera. False otherwise. + + render_gpu_device_id (int): corresponds to the GPU device id to use for offscreen rendering. + Defaults to -1, in which case the device will be inferred from environment variables + (GPUS or CUDA_VISIBLE_DEVICES). + + control_freq (float): how many control signals to receive in every second. This sets the amount of + simulation time that passes between every action input. + + horizon (int): Every episode lasts for exactly @horizon timesteps. + + ignore_done (bool): True if never terminating the environment (ignore @horizon). + + hard_reset (bool): If True, re-loads model, sim, and render object upon a reset call, else, + only calls sim.reset and resets all robosuite-internal variables + + camera_names (str or list of str): name of camera to be rendered. Should either be single str if + same name is to be used for all cameras' rendering or else it should be a list of cameras to render. + + :Note: At least one camera must be specified if @use_camera_obs is True. + + :Note: To render all robots' cameras of a certain type (e.g.: "robotview" or "eye_in_hand"), use the + convention "all-{name}" (e.g.: "all-robotview") to automatically render all camera images from each + robot's camera list). + + camera_heights (int or list of int): height of camera frame. Should either be single int if + same height is to be used for all cameras' frames or else it should be a list of the same length as + "camera names" param. + + camera_widths (int or list of int): width of camera frame. Should either be single int if + same width is to be used for all cameras' frames or else it should be a list of the same length as + "camera names" param. + + camera_depths (bool or list of bool): True if rendering RGB-D, and RGB otherwise. Should either be single + bool if same depth setting is to be used for all cameras or else it should be a list of the same length as + "camera names" param. + + camera_segmentations (None or str or list of str or list of list of str): Camera segmentation(s) to use + for each camera. Valid options are: + + `None`: no segmentation sensor used + `'instance'`: segmentation at the class-instance level + `'class'`: segmentation at the class level + `'element'`: segmentation at the per-geom level + + If not None, multiple types of segmentations can be specified. A [list of str / str or None] specifies + [multiple / a single] segmentation(s) to use for all cameras. A list of list of str specifies per-camera + segmentation setting(s) to use. + + Raises: + AssertionError: [Invalid number of robots specified] + """ + + def __init__( + self, + robots, + env_configuration="default", + controller_configs=None, + gripper_types="default", + initialization_noise="default", + table_full_size=(0.8, 0.8, 0.05), + table_friction=(1., 5e-3, 1e-4), + use_camera_obs=True, + use_object_obs=True, + reward_scale=1.0, + reward_shaping=False, + has_renderer=False, + has_offscreen_renderer=True, + render_camera="frontview", + render_collision_mesh=False, + render_visual_mesh=True, + render_gpu_device_id=-1, + control_freq=20, + horizon=1000, + ignore_done=False, + hard_reset=True, + camera_names="agentview", + camera_heights=256, + camera_widths=256, + camera_depths=False, + camera_segmentations=None, # {None, instance, class, element} + renderer="mujoco", + renderer_config=None, + shapenet_id="3143a4ac", + shapenet_scale=0.8, + ): + # shapenet mug to use + self._shapenet_id = shapenet_id + self._shapenet_scale = shapenet_scale + + # settings for table top + self.table_full_size = table_full_size + self.table_friction = table_friction + self.table_offset = np.array((0, 0, 0.8)) + + # reward configuration + self.reward_scale = reward_scale + self.reward_shaping = reward_shaping + + # whether to use ground-truth object states + self.use_object_obs = use_object_obs + + super().__init__( + robots=robots, + env_configuration=env_configuration, + controller_configs=controller_configs, + mount_types="default", + gripper_types=gripper_types, + initialization_noise=initialization_noise, + use_camera_obs=use_camera_obs, + has_renderer=has_renderer, + has_offscreen_renderer=has_offscreen_renderer, + render_camera=render_camera, + render_collision_mesh=render_collision_mesh, + render_visual_mesh=render_visual_mesh, + render_gpu_device_id=render_gpu_device_id, + control_freq=control_freq, + horizon=horizon, + ignore_done=ignore_done, + hard_reset=hard_reset, + camera_names=camera_names, + camera_heights=camera_heights, + camera_widths=camera_widths, + camera_depths=camera_depths, + camera_segmentations=camera_segmentations, + renderer=renderer, + renderer_config=renderer_config, + ) + + def reward(self, action=None): + """ + Reward function for the task. + + Dense reward: TODO + + The sparse reward only consists of the threading component. + + Note that the final reward is normalized and scaled by + reward_scale / 2.0 as well so that the max score is equal to reward_scale + + Args: + action (np array): [NOT USED] + + Returns: + float: reward value + """ + reward = 0. + + # sparse completion reward + if self._check_success(): + reward = 1.0 + + # use a shaping reward + if self.reward_shaping: + pass + + if self.reward_scale is not None: + reward *= self.reward_scale + + return reward + + def _load_model(self): + """ + Loads an xml model, puts it in self.model + """ + super()._load_model() + + # Adjust base pose accordingly + xpos = self.robots[0].robot_model.base_xpos_offset["table"](self.table_full_size[0]) + self.robots[0].robot_model.set_base_xpos(xpos) + + # load model for table top workspace + mujoco_arena = TableArena( + table_full_size=self.table_full_size, + table_friction=self.table_friction, + table_offset=self.table_offset, + ) + + # Arena always gets set to zero origin + mujoco_arena.set_origin([0, 0, 0]) + + # Add camera with full tabletop perspective + self._add_agentview_full_camera(mujoco_arena) + + # Set default agentview camera to be "agentview_full" (and send old agentview camera to agentview_full) + old_agentview_camera = find_elements(root=mujoco_arena.worldbody, tags="camera", attribs={"name": "agentview"}, return_first=True) + old_agentview_camera_pose = (old_agentview_camera.get("pos"), old_agentview_camera.get("quat")) + old_agentview_full_camera = find_elements(root=mujoco_arena.worldbody, tags="camera", attribs={"name": "agentview_full"}, return_first=True) + old_agentview_full_camera_pose = (old_agentview_full_camera.get("pos"), old_agentview_full_camera.get("quat")) + mujoco_arena.set_camera( + camera_name="agentview", + pos=string_to_array(old_agentview_full_camera_pose[0]), + quat=string_to_array(old_agentview_full_camera_pose[1]), + ) + mujoco_arena.set_camera( + camera_name="agentview_full", + pos=string_to_array(old_agentview_camera_pose[0]), + quat=string_to_array(old_agentview_camera_pose[1]), + ) + + # initialize objects of interest + self._get_drawer_model() + self._get_object_model() + # objects = [self.drawer, self.cleanup_object] + objects = [self.drawer] + + # Create placement initializer + self._get_placement_initializer() + + # task includes arena, robot, and objects of interest + self.model = ManipulationTask( + mujoco_arena=mujoco_arena, + mujoco_robots=[robot.robot_model for robot in self.robots], + mujoco_objects=objects, + ) + # HACK: merge in mug afterwards because its number of geoms may change + # and this may break the generate_id_mappings function in task.py + self.model.merge_objects([self.cleanup_object]) # add cleanup object to model + + def _get_drawer_model(self): + """ + Allow subclasses to override which drawer to use - should load into @self.drawer. + """ + + # Create drawer object + tex_attrib = { + "type": "cube" + } + mat_attrib = { + "texrepeat": "1 1", + "specular": "0.4", + "shininess": "0.1" + } + redwood = CustomMaterial( + texture="WoodRed", + tex_name="redwood", + mat_name="MatRedWood", + tex_attrib=tex_attrib, + mat_attrib=mat_attrib, + ) + ceramic = CustomMaterial( + texture="Ceramic", + tex_name="ceramic", + mat_name="MatCeramic", + tex_attrib=tex_attrib, + mat_attrib=mat_attrib, + ) + lightwood = CustomMaterial( + texture="WoodLight", + tex_name="lightwood", + mat_name="MatLightWood", + tex_attrib={"type": "cube"}, + mat_attrib={"texrepeat": "3 3", "specular": "0.4","shininess": "0.1"} + ) + self.drawer = DrawerObject(name="DrawerObject") + obj_body = self.drawer + for material in [redwood, ceramic, lightwood]: + tex_element, mat_element, _, used = add_material(root=obj_body.worldbody, + naming_prefix=obj_body.naming_prefix, + custom_material=deepcopy(material)) + obj_body.asset.append(tex_element) + obj_body.asset.append(mat_element) + + def _get_object_model(self): + """ + Allow subclasses to override which object to pack into drawer - should load into @self.cleanup_object. + """ + base_mjcf_path = os.path.join(mimicgen_envs.__path__[0], "models/robosuite/assets/shapenet_core/mugs") + mjcf_path = os.path.join(base_mjcf_path, "{}/model.xml".format(self._shapenet_id)) + + self.cleanup_object = BlenderObject( + name="cleanup_object", + mjcf_path=mjcf_path, + scale=self._shapenet_scale, + solimp=(0.998, 0.998, 0.001), + solref=(0.001, 1), + density=100, + # friction=(0.95, 0.3, 0.1), + friction=(1, 1, 1), + margin=0.001, + ) + + def _get_initial_placement_bounds(self): + """ + Internal function to get bounds for randomization of initial placements of objects (e.g. + what happens when env.reset is called). Should return a dictionary with the following + structure: + object_name + x: 2-tuple for low and high values for uniform sampling of x-position + y: 2-tuple for low and high values for uniform sampling of y-position + z_rot: 2-tuple for low and high values for uniform sampling of z-rotation + reference: np array of shape (3,) for reference position in world frame (assumed to be static and not change) + """ + return dict( + drawer=dict( + x=(0., 0.), + y=(0.3, 0.3), + z_rot=(0., 0.), + reference=self.table_offset, + ), + object=dict( + x=(-0.15, 0.15), + y=(-0.25, -0.1), + z_rot=(0., 2. * np.pi), + reference=self.table_offset, + ), + ) + + def _get_placement_initializer(self): + bounds = self._get_initial_placement_bounds() + + self.placement_initializer = SequentialCompositeSampler(name="ObjectSampler") + self.placement_initializer.append_sampler( + sampler=UniformRandomSampler( + name="DrawerSampler", + mujoco_objects=self.drawer, + x_range=bounds["drawer"]["x"], + y_range=bounds["drawer"]["y"], + rotation=bounds["drawer"]["z_rot"], + rotation_axis='z', + ensure_object_boundary_in_range=False, + ensure_valid_placement=True, + reference_pos=bounds["drawer"]["reference"], + z_offset=0.03, + ) + ) + self.placement_initializer.append_sampler( + sampler=UniformRandomSampler( + name="ObjectSampler", + mujoco_objects=self.cleanup_object, + x_range=bounds["object"]["x"], + y_range=bounds["object"]["y"], + rotation=bounds["object"]["z_rot"], + rotation_axis='z', + ensure_object_boundary_in_range=False, + ensure_valid_placement=True, + reference_pos=bounds["object"]["reference"], + z_offset=0., + ) + ) + + def _setup_references(self): + """ + Sets up references to important components. A reference is typically an + index or a list of indices that point to the corresponding elements + in a flatten array, which is how MuJoCo stores physical simulation data. + """ + super()._setup_references() + + # Additional object references for this env + self.obj_body_id = dict( + object=self.sim.model.body_name2id(self.cleanup_object.root_body), + drawer=self.sim.model.body_name2id(self.drawer.root_body), + ) + self.drawer_qpos_addr = self.sim.model.get_joint_qpos_addr(self.drawer.joints[0]) + self.drawer_bottom_geom_id = self.sim.model.geom_name2id("DrawerObject_drawer_bottom") + + def _reset_internal(self): + """ + Resets simulation internal configurations. + """ + super()._reset_internal() + + # Reset all object positions using initializer sampler if we're not directly loading from an xml + if not self.deterministic_reset: + + # Sample from the placement initializer for all objects + object_placements = self.placement_initializer.sample() + + # Loop through all objects and reset their positions + for obj_pos, obj_quat, obj in object_placements.values(): + if obj is self.drawer: + # object is fixture - set pose in model + body_id = self.sim.model.body_name2id(obj.root_body) + obj_pos_to_set = np.array(obj_pos) + obj_pos_to_set[2] = 0.805 # hardcode z-value to make sure it lies on table surface + self.sim.model.body_pos[body_id] = obj_pos_to_set + self.sim.model.body_quat[body_id] = obj_quat + else: + # object has free joint - use it to set pose + self.sim.data.set_joint_qpos(obj.joints[0], np.concatenate([np.array(obj_pos), np.array(obj_quat)])) + + # Drawer should start closed (0.) but can set to open (-0.135) for debugging. + self.sim.data.qpos[self.drawer_qpos_addr] = 0. + # self.sim.data.qpos[self.drawer_qpos_addr] = -0.135 + self.sim.forward() + + def _setup_observables(self): + """ + Sets up observables to be used for this environment. Creates object-based observables if enabled + + Returns: + OrderedDict: Dictionary mapping observable names to its corresponding Observable object + """ + observables = super()._setup_observables() + + # low-level object information + if self.use_object_obs: + # Get robot prefix and define observables modality + pf = self.robots[0].robot_model.naming_prefix + modality = "object" + + # for conversion to relative gripper frame + @sensor(modality=modality) + def world_pose_in_gripper(obs_cache): + return T.pose_inv(T.pose2mat((obs_cache[f"{pf}eef_pos"], obs_cache[f"{pf}eef_quat"]))) if\ + f"{pf}eef_pos" in obs_cache and f"{pf}eef_quat" in obs_cache else np.eye(4) + sensors = [world_pose_in_gripper] + names = ["world_pose_in_gripper"] + actives = [False] + + # add ground-truth poses (absolute and relative to eef) for all objects + for obj_name in self.obj_body_id: + obj_sensors, obj_sensor_names = self._create_obj_sensors(obj_name=obj_name, modality=modality) + sensors += obj_sensors + names += obj_sensor_names + actives += [True] * len(obj_sensors) + + # add joint position of drawer + @sensor(modality=modality) + def drawer_joint_pos(obs_cache): + return np.array([self.sim.data.qpos[self.drawer_qpos_addr]]) + sensors += [drawer_joint_pos] + names += ["drawer_joint_pos"] + actives += [True] + + # Create observables + for name, s, active in zip(names, sensors, actives): + observables[name] = Observable( + name=name, + sensor=s, + sampling_rate=self.control_freq, + active=active, + ) + + return observables + + def _create_obj_sensors(self, obj_name, modality="object"): + """ + Helper function to create sensors for a given object. This is abstracted in a separate function call so that we + don't have local function naming collisions during the _setup_observables() call. + + Args: + obj_name (str): Name of object to create sensors for + modality (str): Modality to assign to all sensors + + Returns: + 2-tuple: + sensors (list): Array of sensors for the given obj + names (list): array of corresponding observable names + """ + + ### TODO: this was stolen from pick-place - do we want to move this into utils to share it? ### + pf = self.robots[0].robot_model.naming_prefix + + @sensor(modality=modality) + def obj_pos(obs_cache): + return np.array(self.sim.data.body_xpos[self.obj_body_id[obj_name]]) + + @sensor(modality=modality) + def obj_quat(obs_cache): + return T.convert_quat(self.sim.data.body_xquat[self.obj_body_id[obj_name]], to="xyzw") + + @sensor(modality=modality) + def obj_to_eef_pos(obs_cache): + # Immediately return default value if cache is empty + if any([name not in obs_cache for name in + [f"{obj_name}_pos", f"{obj_name}_quat", "world_pose_in_gripper"]]): + return np.zeros(3) + obj_pose = T.pose2mat((obs_cache[f"{obj_name}_pos"], obs_cache[f"{obj_name}_quat"])) + rel_pose = T.pose_in_A_to_pose_in_B(obj_pose, obs_cache["world_pose_in_gripper"]) + rel_pos, rel_quat = T.mat2pose(rel_pose) + obs_cache[f"{obj_name}_to_{pf}eef_quat"] = rel_quat + return rel_pos + + @sensor(modality=modality) + def obj_to_eef_quat(obs_cache): + return obs_cache[f"{obj_name}_to_{pf}eef_quat"] if \ + f"{obj_name}_to_{pf}eef_quat" in obs_cache else np.zeros(4) + + sensors = [obj_pos, obj_quat, obj_to_eef_pos, obj_to_eef_quat] + names = [f"{obj_name}_pos", f"{obj_name}_quat", f"{obj_name}_to_{pf}eef_pos", f"{obj_name}_to_{pf}eef_quat"] + + return sensors, names + + def _check_success(self): + """ + Check if task is complete. + """ + + # check for closed drawer + drawer_closed = self.sim.data.qpos[self.drawer_qpos_addr] > -0.01 + + # check that object is upright (it shouldn't fall over in the drawer) + + # check z-axis alignment by checking z unit-vector of obj pose and dot with (0, 0, 1) + # then take cosine dist (1 - dot-prod) + obj_rot = self.sim.data.body_xmat[self.obj_body_id["object"]].reshape(3, 3) + z_axis = obj_rot[:3, 2] + dist_to_z_axis = 1. - z_axis[2] + object_upright = (dist_to_z_axis < 1e-3) + + # easy way to check for object in drawer - check if object in contact with bottom drawer geom + drawer_bottom_geom = "DrawerObject_drawer_bottom" + object_in_drawer = self.check_contact(drawer_bottom_geom, self.cleanup_object) + + # rsm_rise 2026-09-21: the RISE authors evaluated mug-cleanup with a RELAXED criterion -- the mug + # placed in the drawer, without requiring it upright or the drawer closed (author communication to + # the owner). Stock MimicGen ANDs all three, which is why BC-on-demos read 7-11 % here against the + # paper's 31.3. RSM_RISE_MUG_SUCCESS=in_drawer selects the paper's criterion; unset = stock. + import os + if os.environ.get("RSM_RISE_MUG_SUCCESS", "") == "in_drawer": + return bool(object_in_drawer) + + return (object_in_drawer and object_upright and drawer_closed) + + def visualize(self, vis_settings): + """ + In addition to super call, visualize gripper site proportional to the distance to the coffee machine. + + Args: + vis_settings (dict): Visualization keywords mapped to T/F, determining whether that specific + component should be visualized. Should have "grippers" keyword as well as any other relevant + options specified. + """ + # Run superclass method first + super().visualize(vis_settings=vis_settings) + + # Color the gripper visualization site according to its distance to the cleanup object + if vis_settings["grippers"]: + self._visualize_gripper_to_target(gripper=self.robots[0].gripper, target=self.cleanup_object) + + +class MugCleanup_D0(MugCleanup): + """Rename base class for convenience.""" + pass + + +class MugCleanup_D1(MugCleanup_D0): + """ + Wider initialization for both drawer and object. + """ + def _get_initial_placement_bounds(self): + return dict( + drawer=dict( + x=(-0.15, 0.05), + y=(0.25, 0.35), + z_rot=(-np.pi / 6., np.pi / 6.), + reference=self.table_offset, + ), + object=dict( + x=(-0.25, 0.15), + y=(-0.3, -0.15), + z_rot=(0., 2. * np.pi), + reference=self.table_offset, + ), + ) + + +class MugCleanup_O1(MugCleanup_D0): + """ + Use different mug. + """ + def __init__( + self, + **kwargs, + ): + super(MugCleanup_O1, self).__init__( + shapenet_id="34ae0b61", + shapenet_scale=0.8, + **kwargs, + ) + + +class MugCleanup_O2(MugCleanup_D0): + """ + Use a random mug on each episode reset. + """ + def __init__( + self, + **kwargs, + ): + # list of tuples - (shapenet_id, shapenet_scale) + self._assets = [ + ("3143a4ac", 0.8), # beige round mug + ("34ae0b61", 0.8), # bronze mug with green inside + ("128ecbc1", 0.66666667), # light blue round mug, thicker boundaries + ("d75af64a", 0.66666667), # off-white cylindrical tapered mug + ("5fe74bab", 0.8), # brown mug, thin boundaries + ("345d3e72", 0.66666667), # black round mug + ("48e260a6", 0.66666667), # red round mug + ("8012f52d", 0.8), # yellow round mug with bigger base + ("b4ae56d6", 0.8), # yellow cylindrical mug + ("c2eacc52", 0.8), # wooden cylindrical mug + ("e94e46bc", 0.8), # dark blue cylindrical mug + ("fad118b3", 0.66666667), # tall green cylindrical mug + ] + self._base_mjcf_path = os.path.join(mimicgen_envs.__path__[0], "models/robosuite/assets/shapenet_core/mugs") + super(MugCleanup_O2, self).__init__(shapenet_id=None, shapenet_scale=None, **kwargs) + + def _get_object_model(self): + """ + Allow subclasses to override which object to pack into drawer - should load into @self.cleanup_object. + """ + self._shapenet_id, self._shapenet_scale = random.choice(self._assets) + mjcf_path = os.path.join(self._base_mjcf_path, "{}/model.xml".format(self._shapenet_id)) + + self.cleanup_object = BlenderObject( + name="cleanup_object", + mjcf_path=mjcf_path, + scale=self._shapenet_scale, + solimp=(0.998, 0.998, 0.001), + solref=(0.001, 1), + density=100, + # friction=(0.95, 0.3, 0.1), + friction=(1, 1, 1), + margin=0.001, + ) diff --git a/gen_q_rsm/rsm_rise/pipeline/patches/rise_eval.py b/gen_q_rsm/rsm_rise/pipeline/patches/rise_eval.py new file mode 100644 index 0000000000000000000000000000000000000000..a7dd9832e93c16d25c10067cebef9b9124b25b02 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/patches/rise_eval.py @@ -0,0 +1,956 @@ +import os +import numpy as np +import hydra +import torch +import cv2 +import h5py +import uuid +import json +import dill + +import robomimic.utils.file_utils as FileUtils +from omegaconf import open_dict, OmegaConf +from contextlib import nullcontext +from pathlib import Path +from hydra.core.hydra_config import HydraConfig +from hydra import compose + +from gym.vector.vector_env import VectorEnv +from stable_baselines3.common.vec_env import VecEnv + +import robomimic.utils.obs_utils as ObsUtils + +from sim_pipeline.eval.rollout_env import PossibleVecEnv +from sim_pipeline.eval.rollout_policies import * +from sim_pipeline.eval.rollout import rollout +from sim_pipeline.configs._evaluation.eval_base import EvaluationConfig +from sim_pipeline.configs.constants import PolicyType, CombinedPolicyType, ImitationAlgorithm, ROLLOUT_DATA_DIR +from sim_pipeline.envs.robosuite_wrapper import RobomimicObsWrapper +from sim_pipeline.envs.make_env import make_env, make_vec_env +from sim_pipeline.eval.rollout_stats import RolloutStats +from sim_pipeline.utils.rollout_utils import add_trajectory_to_dataset, merge_obs_specs +from sim_pipeline.utils.train_utils import get_latest_sb_policy, get_latest_robomimic_policy, get_latest_diffusion_policy, get_latest_ogbench_policy +from sim_pipeline.utils.experiment import setup_experiment +from sim_pipeline.utils.video_writer import video_writer_manager +from sim_pipeline.utils.diffusion_utils import get_policy_class, get_workspace +from sim_pipeline.data_manager.modify_dataset import fill_metadata +from sim_pipeline.data_manager.dataset_metadata_enums import * +from sim_pipeline.data_manager.edit_dataset_description import edit_dataset_description +from sim_pipeline.model_manager.get_model import get_model +from sim_pipeline.data_manager.get_dataset import get_dataset + +def get_env(policy_type: PolicyType, config: EvaluationConfig, obs_modality_specs=None, n_envs_override: int = None) -> RobomimicObsWrapper | VecEnv | VectorEnv: + if n_envs_override is not None: + n_envs = n_envs_override + else: + n_envs = config.exp.num_workers + if policy_type == PolicyType.ROBOMIMIC: + if n_envs > 1: + env: VectorEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + use_gym_vec_env=True, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + ) + elif policy_type == PolicyType.STABLE_BASELINES: + if n_envs > 1: + env: VecEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=True, + use_gym_vec_env=False, + mp_context='forkserver', + obs_modality_specs=obs_modality_specs, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=True, + ) + elif policy_type == PolicyType.DIFFUSION or policy_type == PolicyType.COMPOSITE or policy_type == PolicyType.OGBENCH: + if n_envs > 1: + env: VectorEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + use_gym_vec_env=True, + mp_context='forkserver', + obs_modality_specs=obs_modality_specs, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + ) + elif policy_type == PolicyType.PD: + if n_envs > 1: + env: VectorEnv = make_vec_env( + env_config=config.env, + num_workers=n_envs, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + use_gym_vec_env=True, + mp_context='forkserver', + obs_modality_specs=obs_modality_specs, + gymnasium_api=False, + ) + else: + env: RobomimicObsWrapper = make_env( + env_config=config.env, + seed=config.exp.eval_seed, + device_id=config.exp.device_id, + flatten_obs=False, + ) + else: + raise NotImplementedError + return env + + +def get_policy_dir(policy_type: PolicyType, config: EvaluationConfig) -> Path | None: + if config.exp.use_model_manager and not policy_type in [PolicyType.PD, PolicyType.COMPOSITE, PolicyType.STABLE_BASELINES, PolicyType.OGBENCH]: + identifier = config.exp.date_string + if identifier: + model_path = get_model(config.name, identifier) + else: + model_path = get_model(config.name) + return Path(model_path) + + if config.exp.model_path: + return Path(config.exp.model_path) + + log_path = config.exp.logdir + match policy_type: + case PolicyType.STABLE_BASELINES: + logdir = Path(log_path) / f'{config.name}' / f'{config.exp.seed}' + case PolicyType.ROBOMIMIC | PolicyType.DISCRIMINATOR: + logdir: Path = Path(log_path) / f'{config.name}' / config.exp.date_string + case PolicyType.DIFFUSION: + logdir: Path = Path(log_path) / f'{config.name}' / config.exp.date_string + case PolicyType.OGBENCH: + logdir: Path = Path(log_path) / f'{config.name}' + case PolicyType.PD: + logdir = None + case PolicyType.COMPOSITE: + logdir: Path = Path(log_path) / config.name + if not logdir.exists(): + logdir.mkdir() + case _: + raise NotImplementedError + return logdir + + +def load_policy(policy_type: PolicyType, config: EvaluationConfig, policy_dir: Path, env, device: torch.device): + match policy_type: + case PolicyType.STABLE_BASELINES: + algo = config.training.algo.get_algo() + ckpt_path = get_latest_sb_policy(policy_dir / 'policy' / '_step_') + model = algo.load(ckpt_path, device=device, env=env) + + return model + case PolicyType.ROBOMIMIC | PolicyType.DISCRIMINATOR: + if policy_dir.suffix == '.pth' and policy_dir.is_file(): # rsm_rise: a checkpoint file directly + ckpt_path = policy_dir + else: + ckpt_path = get_latest_robomimic_policy(policy_dir / 'models') + + policy, ckpt_dict = FileUtils.policy_from_checkpoint(ckpt_path=ckpt_path, device=device, verbose=True, + discriminator=policy_type == PolicyType.DISCRIMINATOR) + # rsm_rise (stream D): the eval config's planner keys (training.plan_* / rsm_*) override the + # checkpoint's algo config -> best-of-N over the diffusion sampler with the RSM scorer. + algo = getattr(policy, 'policy', None) + if hasattr(algo, 'configure_planner'): + from sim_pipeline.configs.training._imitation_learning._offline_rl.iql_diffusion import planner_kwargs + kw = planner_kwargs(config.training) + if kw: + algo.configure_planner(**kw) + print(f"[rsm_rise] planner configured: plan_n={kw.get('plan_n')} rule={kw.get('plan_rule')} " + f"backend={kw.get('rsm_backend')} mode={kw.get('plan_mode')} depth={kw.get('plan_depth')} " + f"beta={kw.get('plan_beta')} rsm_ckpt={kw.get('rsm_ckpt')!r}") + + return policy + case PolicyType.DIFFUSION: + ckpt_path = get_latest_diffusion_policy(policy_dir / 'checkpoints') + payload = torch.load(open(ckpt_path, 'rb'), pickle_module=dill) + diffusion_cfg = payload['cfg'] + + lowdim_keys = config.training.low_dim_keys + rgb_keys = config.training.rgb_keys + depth_keys = config.training.depth_keys + + # adapt old diffusion library configs + with open_dict(diffusion_cfg): + diffusion_cfg.debug = False + + workspace_cls = get_workspace(rgb_keys, lowdim_keys, depth_keys) + workspace = workspace_cls(diffusion_cfg, output_dir=policy_dir) + workspace.load_payload(payload) + + policy = workspace.model + if diffusion_cfg.training.use_ema: + policy = workspace.ema_model + policy.to(device) + policy.eval() + case PolicyType.OGBENCH: + from impls.utils.flax_utils import restore_agent + from diffusion_policy.dataset.robomimic_replay_image_dataset import RobomimicReplayImageDataset + from diffusion_policy.dataset.robomimic_replay_lowdim_dataset import RobomimicReplayLowdimDataset + from torch.utils.data import DataLoader + + dataset_path = get_dataset(config.data) + + if config.training.rgb_keys: + with h5py.File(dataset_path, 'r') as f: + data = f['data'] + ep_keys = list(data.keys()) + ep = data[ep_keys[0]] + action_shape = ep['actions'].shape[1:] + obs_shapes = {} + for key in config.training.low_dim_keys: + if key not in ep['obs'].keys(): + raise ValueError(f"Key {key} not found in dataset") + obs_shapes[key] = {'shape': ep['obs'][key].shape[1:]} + for key in config.training.rgb_keys: + if key not in ep['obs'].keys(): + raise ValueError(f"Key {key} not found in dataset") + # switch to channels first + obs_shapes[key] = ep['obs'][key].shape[1:] + obs_shapes[key] = { + 'shape': (obs_shapes[key][2], obs_shapes[key][0], obs_shapes[key][1]), + 'type': 'rgb', + } + + shape_meta = { + 'obs': obs_shapes, + 'action': { + 'shape': action_shape, + } + } + + dataset = RobomimicReplayImageDataset( + shape_meta=shape_meta, + dataset_path=dataset_path, + horizon=1, + pad_before=0, + pad_after=0, + n_obs_steps=1, + abs_action=False, + use_cache=True, + seed=config.exp.seed, + val_ratio=0.0, + extra_info=True, + sample_goals=True, + p_currgoal=config.training.p_currgoal, + squeeze=True, + ) + else: + dataset = RobomimicReplayLowdimDataset( + obs_keys=config.training.low_dim_keys, + dataset_path=dataset_path, + horizon=1, + pad_before=0, + pad_after=0, + abs_action=False, + seed=config.exp.seed, + val_ratio=0.0, + extra_info=True, + sample_goals=True, + p_currgoal=config.training.p_currgoal, + squeeze=True, + ) + + train_dataloader = DataLoader( + dataset, + batch_size=config.training.batch_size, + num_workers=0, + shuffle=True, + generator=torch.Generator(device=device), + ) + + example_batch = next(iter(train_dataloader)) + example_batch_np = { + 'observations': example_batch['obs'].numpy(), + 'actions': example_batch['action'].numpy(), + } + agent_class = config.training.algo.get_agent() + agent = agent_class.create( + seed=config.exp.seed, + ex_observations=example_batch_np['observations'], + ex_actions=example_batch_np['actions'], + config=OmegaConf.to_container(config.training), + ) + latest_epoch = get_latest_ogbench_policy(policy_dir / 'checkpoints', find_epoch=True) + policy = restore_agent(agent, str(policy_dir / 'checkpoints'), latest_epoch) + case PolicyType.PD: + policy = None + case _: + raise NotImplementedError + return policy + + +def create_combined_policy( + policies, + combined_policy_type: CombinedPolicyType, + n_envs: int, +): + match combined_policy_type: + case CombinedPolicyType.HEURISTIC_RESET: + policy = HeuristicResetPolicy( + policies=policies, + n_envs=n_envs + ) + case CombinedPolicyType.HEURISTIC_RESET_SPLIT: + policy = HeuristicResetSplitPolicy( + policies=policies, + n_envs=n_envs + ) + case _: + raise NotImplementedError + return policy + + +def create_rollout_policy( + policy, + policy_type: PolicyType, + config: EvaluationConfig, + n_obs_steps: int | None = None, + action_chunking: bool = False, + obs_keys: list[str] | None = None, + lowdim: bool = False, + manual_lookahead: bool = False, + opex: bool = False, + discriminator = None, + expert_policy = None, + ) -> RolloutPolicy: + match policy_type: + case PolicyType.STABLE_BASELINES: + return StableBaselinesRolloutPolicy( + policy, + ) + case PolicyType.ROBOMIMIC: + if opex: + return RobomimicOpexRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + if manual_lookahead: + return ManualLookaheadRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + plan_n = config.training.get('plan_n', None) if hasattr(config.training, 'get') else None + if plan_n is not None: + # rsm_rise (stream D): the planner lives in the algo's get_action; plain rollout policy + return RobomimicRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + if config.training.algo == ImitationAlgorithm.IDQL and config.exp.get('policy_mode', 'idql') != 'bc': + return RobomimicSamplingRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion(), + discriminator=discriminator, + expert_policy=expert_policy, + ) + return RobomimicRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + is_diffusion=config.training.algo.is_diffusion() + ) + case PolicyType.DIFFUSION: + return DiffusionRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + obs_keys=obs_keys, + lowdim=lowdim + ) + case PolicyType.OGBENCH: + return OGBenchRolloutPolicy( + policy, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + obs_keys=obs_keys, + lowdim=lowdim, + ) + case PolicyType.PD: + return PDRolloutPolicy( + policy=None, + target_pos=config.exp.target_pos, + ) + case _: + raise NotImplementedError + + +def get_policy_info(policy_type: PolicyType, config: EvaluationConfig) -> tuple: + action_chunking = True if policy_type in [PolicyType.DIFFUSION] else False + n_obs_steps = config.training.obs_horizon if policy_type in [PolicyType.DIFFUSION] else None + all_obs_keys = None + only_lowdim = False + obs_modality_specs = None + if policy_type == PolicyType.DIFFUSION or policy_type == PolicyType.OGBENCH: + lowdim_keys = OmegaConf.to_container(config.training.low_dim_keys) + rgb_keys = OmegaConf.to_container(config.training.rgb_keys) + depth_keys = OmegaConf.to_container(config.training.depth_keys) + all_obs_keys = [] + for key in lowdim_keys + rgb_keys + depth_keys: + if key in all_obs_keys: + raise ValueError(f"Duplicate obs key {key}") + all_obs_keys.append(key) + only_lowdim = lowdim_keys and not rgb_keys and not depth_keys + obs_modality_specs = RobomimicObsWrapper.get_specs_from_obs_keys(lowdim_keys, rgb_keys, depth_keys) + elif policy_type == PolicyType.ROBOMIMIC: + if config.training.algo in [ImitationAlgorithm.IQL_DIFFUSION, ImitationAlgorithm.IDQL, ImitationAlgorithm.IDQL_QSM]: + action_chunking = True + n_obs_steps = config.training.observation_horizon + elif policy_type == PolicyType.PD: + obs_modality_specs = {} + return action_chunking, n_obs_steps, all_obs_keys, only_lowdim, obs_modality_specs + + +def get_policy(policy_type: PolicyType, config: EvaluationConfig, device: torch.device, discriminator=None, expert_policy=None) -> tuple[RolloutPolicy, dict | None]: + if policy_type == PolicyType.COMPOSITE: + all_policies = [] + all_obs_modality_specs = [] + for policy_cfg_str in config.exp.policy_configs: + policy_cfg: EvaluationConfig = compose(policy_cfg_str) + rollout_policy, obs_modality_specs = get_policy(policy_cfg.exp.policy_type, policy_cfg, device) + if obs_modality_specs is not None: + all_obs_modality_specs.append(obs_modality_specs) + all_policies.append(rollout_policy) + + obs_modality_specs = merge_obs_specs(all_obs_modality_specs) + + rollout_policy = create_combined_policy( + policies=all_policies, + combined_policy_type=config.exp.combined_policy_type, + n_envs=config.exp.num_workers, + ) + + return rollout_policy, obs_modality_specs + + policy_dir = get_policy_dir(config.exp.policy_type, config) + action_chunking, n_obs_steps, all_obs_keys, lowdim, obs_modality_specs = get_policy_info(config.exp.policy_type, config) + + if policy_type == PolicyType.STABLE_BASELINES: + # we need env in order to load sb policy + temp_env = get_env(config.exp.policy_type, config, obs_modality_specs, n_envs_override=1) + else: + temp_env = None + + policy = load_policy( + policy_type=config.exp.policy_type, + config=config, + policy_dir=policy_dir, + env=temp_env, + device=device + ) + if policy_type == PolicyType.DISCRIMINATOR: + return policy, None + + if config.exp.use_discriminator: + assert discriminator is not None, "Discriminator policy not found" + + rollout_policy = create_rollout_policy( + policy, + policy_type=config.exp.policy_type, + config=config, + obs_keys=all_obs_keys, + lowdim=lowdim, + action_chunking=action_chunking, + n_obs_steps=n_obs_steps, + manual_lookahead=config.exp.manual_lookahead, + opex=config.exp.opex, + discriminator=discriminator, + expert_policy=expert_policy, + ) + + return rollout_policy, obs_modality_specs + + +def setup_eval(config: EvaluationConfig): + device = setup_experiment(config.exp, eval=True) + + log_video = config.exp.log_video + render = config.env.render + + policy_dir = get_policy_dir(config.exp.policy_type, config) + + if config.exp.use_discriminator: + import copy + discriminator_config = copy.deepcopy(config) + discriminator_config.exp.policy_type = PolicyType.DISCRIMINATOR + discriminator_config.name = config.exp.discriminator_name + discriminator, _ = get_policy(PolicyType.DISCRIMINATOR, discriminator_config, device) + + expert_config = copy.deepcopy(config) + expert_config.exp.policy_type = PolicyType.DIFFUSION + expert_config.exp.use_discriminator = False + expert_config.exp.discriminator_name = None + expert_policy, _ = get_policy(PolicyType.DIFFUSION, expert_config, device) + else: + discriminator = None + + policy, obs_modality_specs = get_policy(config.exp.policy_type, config, device, discriminator=discriminator) + + if obs_modality_specs is not None: + ObsUtils.initialize_obs_utils_with_obs_specs(obs_modality_specs) + env = get_env(config.exp.policy_type, config, obs_modality_specs) + env = PossibleVecEnv(env) + + # human render takes precedence over video recording + if log_video and not render: + video_dir: Path = policy_dir / 'videos_eval' + + if not video_dir.exists(): + video_dir.mkdir() + + default_size = tuple((s[0] if not env.is_vec_env else s[0][0]) for s in env.get_camera_sizes()) + size = default_size if config.exp.video_dims is None else config.exp.video_dims + fps = 20 + video_writers = [] + for i in range(config.exp.num_workers): + video_writer = cv2.VideoWriter(str(video_dir / f'rollout_video_{i}.mp4'), cv2.VideoWriter_fourcc(*'mp4v'), fps, size) + video_writers.append(video_writer) + + render_mode = 'rgb_array' + elif render: + render_mode = 'human' + video_writers = None + else: + render_mode = None + video_writers = None + + return env, policy, render_mode, video_writers + + +def _plan_summary(plan_log): + """Per-episode summary of the planner's per-step logs (rsm_planner.RSMPlannerMixin.pop_plan_log).""" + if not plan_log: + return None + if isinstance(plan_log, dict): + return plan_log # rsm_rise: a summary restored from a .partial on resume -- pass it through + import numpy as _np + def _flat(key): + return [float(v) for st in plan_log for v in (st[key] if isinstance(st[key], list) else [st[key]])] + chosen, smax, smean, sstd = _flat('score_chosen'), _flat('score_max'), _flat('score_mean'), _flat('score_std') + return { + 'steps': len(plan_log), 'n': plan_log[0]['n'], 'rule': plan_log[0]['rule'], + 'score_chosen_mean': float(_np.mean(chosen)), 'score_max_mean': float(_np.mean(smax)), + 'score_mean_mean': float(_np.mean(smean)), 'score_std_mean': float(_np.mean(sstd)), + 'gap_chosen_minus_mean': float(_np.mean(_np.array(chosen) - _np.array(smean))), + 'ties_at_max_mean': float(_np.mean(_flat('ties_at_max'))) if 'ties_at_max' in plan_log[0] else None, + 'frac_saturated_mean': float(_np.mean(_flat('frac_saturated'))) if 'frac_saturated' in plan_log[0] else None, + # rsm_rise (stream E): both read-outs of the RSM scorer, whichever one ranks (plan_score) + 'score_kind': plan_log[0].get('score_kind'), + 'prob_chosen_mean': float(_np.mean(_flat('prob_chosen'))) if 'prob_chosen' in plan_log[0] else None, + 'prob_max_mean': float(_np.mean(_flat('prob_max'))) if 'prob_max' in plan_log[0] else None, + 'logit_chosen_mean': float(_np.mean(_flat('logit_chosen'))) if 'logit_chosen' in plan_log[0] else None, + 'logit_max_mean': float(_np.mean(_flat('logit_max'))) if 'logit_max' in plan_log[0] else None, + 'logit_mean_mean': float(_np.mean(_flat('logit_mean'))) if 'logit_mean' in plan_log[0] else None, + 'logit_std_mean': float(_np.mean(_flat('logit_std'))) if 'logit_std' in plan_log[0] else None, + 'logit_ties_at_max_mean': float(_np.mean(_flat('logit_ties_at_max'))) if 'logit_ties_at_max' in plan_log[0] else None, + # conformal read-out (plan_score=conformal_lcb): the per-particle lower quantile that ranks + 'lcb_quantile': plan_log[0].get('lcb_quantile'), + 'lcb_chosen_mean': float(_np.mean(_flat('lcb_chosen'))) if 'lcb_chosen' in plan_log[0] else None, + 'lcb_max_mean': float(_np.mean(_flat('lcb_max'))) if 'lcb_max' in plan_log[0] else None, + 'lcb_mean_mean': float(_np.mean(_flat('lcb_mean'))) if 'lcb_mean' in plan_log[0] else None, + 'lcb_ties_at_max_mean': float(_np.mean(_flat('lcb_ties_at_max'))) if 'lcb_ties_at_max' in plan_log[0] else None, + 't_sample_s': float(sum(st['t_sample'] for st in plan_log)), + 't_score_s': float(sum(st['t_score'] for st in plan_log)), + 'idx': [int(v) for st in plan_log for v in st['idx']], + } + + +# ---- rsm_rise (orchestrator 15:51): episode-level resume ----------------------------------------------------- +# A preempted eval cell used to restart at episode 0, so on `preemptable` a long cell could never finish. +# eval.py writes ".partial" after EVERY episode and eval_cell.sh keeps the furthest attempt as +# ".partial_best"; on start we reload whichever of the two got furthest and continue from the next +# episode index. Resume is refused unless the run is the SAME cell (seed / horizon / policy / planner config), +# so a partial can never be blended into a different recipe. +_RESUME_N = 0 # episodes restored from a partial in this process (recorded in the results JSON) +# NOTE: exp.model_path is the per-attempt mktemp symlink dir of eval_cell.sh, so it is NOT an identity key; +# the checkpoint is compared through exp.eval_ckpt (the real model_epoch_*.pth), which eval_cell.sh passes. +_RESUME_KEYS = ('eval_seed', 'rollout_horizon', 'end_on_success', 'policy_mode', 'success_criterion', 'cell', + 'reset_states_file', 'eval_ckpt') + + +def _resume_fingerprint(config: EvaluationConfig): + fp = { + 'eval_seed': int(config.exp.eval_seed), + 'rollout_horizon': int(config.exp.rollout_horizon), + 'end_on_success': bool(config.exp.get('end_on_success', False)), + 'policy_mode': str(config.exp.get('policy_mode', 'idql')), + 'success_criterion': {'mug': os.environ.get('RSM_RISE_MUG_SUCCESS', 'stock') or 'stock', 'piece_dz_tol': os.environ.get('RSM_RISE_PIECE_DZ_TOL', '') or None}, # rsm_rise: which env success rule this cell used + 'cell': str(config.exp.get('eval_cell', '') or ''), + 'eval_ckpt': str(config.exp.get('eval_ckpt', '') or ''), + 'reset_states_file': getattr(config.env, 'reset_states_file', None), + } + try: + from sim_pipeline.configs.training._imitation_learning._offline_rl.iql_diffusion import planner_kwargs + fp['planner_overrides'] = {k: (v if isinstance(v, (int, float, str, bool)) or v is None else str(v)) + for k, v in planner_kwargs(config.training).items()} + except Exception: + fp['planner_overrides'] = None + return fp + + +def _rng_state_dump(): + """Serialize the GLOBAL numpy RNG state (robosuite's placement samplers draw from np.random).""" + try: + st = np.random.get_state() + return {'name': str(st[0]), 'keys': [int(x) for x in st[1]], 'pos': int(st[2]), + 'has_gauss': int(st[3]), 'cached_gaussian': float(st[4])} + except Exception as ex: + print(f'[rsm_rise] resume: cannot snapshot the numpy RNG state ({ex!r})') + return None + + +def _rng_state_load(d): + """Restore a state written by _rng_state_dump. True on success.""" + try: + if not isinstance(d, dict) or d.get('name') != 'MT19937' or len(d.get('keys') or []) != 624: + return False + np.random.set_state((d['name'], np.array(d['keys'], dtype=np.uint32), int(d['pos']), + int(d['has_gauss']), float(d['cached_gaussian']))) + return True + except Exception as ex: + print(f'[rsm_rise] resume: cannot restore the numpy RNG state ({ex!r})') + return False + + +def _resume_load(config: EvaluationConfig): + """(n_done, episodes, np_rng_state) of the furthest COMPATIBLE partial of this cell, else (0, [], None).""" + import os + path = config.exp.get('results_json', None) + if not path or not bool(config.exp.get('resume_partial', True)): + return 0, [], None + fp = _resume_fingerprint(config) + best = (0, [], None, None) + for cand in (str(path) + '.partial', str(path) + '.partial_best'): + if not os.path.exists(cand): + continue + try: + with open(cand) as f: + d = json.load(f) + except Exception as ex: + print(f'[rsm_rise] resume: cannot read {cand} ({ex!r}) -- ignored') + continue + # a key missing from the partial = written before that key existed -> not a mismatch, just unverifiable + bad = [k for k in _RESUME_KEYS if k in d and d.get(k) != fp[k]] + missing = [k for k in _RESUME_KEYS if k not in d] + if missing: + print(f'[rsm_rise] resume: {cand} predates {",".join(missing)} -- identity taken from its path') + if fp['planner_overrides'] is not None and d.get('planner_overrides') != fp['planner_overrides']: + bad.append('planner_overrides') + if bad: + print(f'[rsm_rise] resume: {cand} is a DIFFERENT cell ({",".join(bad)} differ) -- ignored') + continue + eps = d.get('episodes') or [] + n = min(int(d.get('num_episodes', 0)), len(eps)) + if n > best[0]: + best = (n, eps[:n], cand, d.get('np_rng_state')) + if best[0]: + print(f'[rsm_rise] resume: {best[2]} has {best[0]} finished episodes -> continuing at episode {best[0]}') + return best[0], best[1], best[3] + + +def _resume_restore(rollout_stats: RolloutStats, episodes): + """Replay finished episodes into a fresh RolloutStats (+ their wall times and planner summaries).""" + ep_times, ep_plans = [], [] + for e in episodes: + rollout_stats.all_reward.append(float(e.get('return', 0.0))) + rollout_stats.all_successes.append(1.0 if e.get('success') else 0.0) + rollout_stats.all_final_successes.append(1.0 if e.get('final_success') else 0.0) + rollout_stats.all_lengths.append(int(e.get('length', 0))) + rollout_stats.all_first_success.append(int(e.get('first_success_step', -1))) + rollout_stats.num_episodes += 1 + ep_times.append(float(e.get('wall_time_s', 0.0))) + ep_plans.append(e.get('plan') or []) + rollout_stats.compute_statistics() + return ep_times, ep_plans + + +def _write_results_json(config: EvaluationConfig, rollout_stats: RolloutStats, policy=None, ep_times=None, + ep_plans=None, t_start=None, partial=False, np_rng_state=None): + # rsm_rise: per-episode results for the planning grid (stream A) + planner config / timing (stream D) + import os, time as _time + n = rollout_stats.num_episodes + episodes = [ + { + 'episode': i, + 'success': bool(rollout_stats.all_successes[i] > 0.5), + 'final_success': bool(rollout_stats.all_final_successes[i] > 0.5), + 'return': float(rollout_stats.all_reward[i]), + 'length': int(rollout_stats.all_lengths[i]), + 'first_success_step': int(rollout_stats.all_first_success[i]), + } + for i in range(n) + ] + out = { + 'num_episodes': n, + 'success_rate': float(np.mean([e['success'] for e in episodes])) if n else None, + 'final_success_rate': float(np.mean([e['final_success'] for e in episodes])) if n else None, + 'mean_length': float(np.mean([e['length'] for e in episodes])) if n else None, + 'mean_return': float(np.mean([e['return'] for e in episodes])) if n else None, + 'model_path': str(config.exp.model_path), + 'env': OmegaConf.to_container(config.env, resolve=True, enum_to_str=True), + 'rollout_horizon': int(config.exp.rollout_horizon), + 'end_on_success': bool(config.exp.get('end_on_success', False)), + 'policy_mode': str(config.exp.get('policy_mode', 'idql')), + 'success_criterion': {'mug': os.environ.get('RSM_RISE_MUG_SUCCESS', 'stock') or 'stock', 'piece_dz_tol': os.environ.get('RSM_RISE_PIECE_DZ_TOL', '') or None}, # rsm_rise: which env success rule this cell used + 'eval_seed': int(config.exp.eval_seed), + 'eval_ckpt': str(config.exp.get('eval_ckpt', '') or ''), + 'reset_states_file': getattr(config.env, 'reset_states_file', None), + 'episodes': episodes, + } + # ---- stream D: planner config, per-episode planner summary, timing, Wilson CI ------------------ + if ep_times is not None: + for i, e in enumerate(episodes[:len(ep_times)]): + e['wall_time_s'] = float(ep_times[i]) + if ep_plans is not None: + for i, e in enumerate(episodes[:len(ep_plans)]): + e['plan'] = _plan_summary(ep_plans[i]) + algo = getattr(getattr(policy, 'policy', None), 'policy', None) + if hasattr(algo, 'planner_describe'): + try: + out['planner'] = algo.planner_describe() + except Exception as ex: + out['planner'] = {'error': repr(ex)} + try: + from sim_pipeline.configs.training._imitation_learning._offline_rl.iql_diffusion import planner_kwargs + out['planner_overrides'] = {k: (v if isinstance(v, (int, float, str, bool)) or v is None else str(v)) + for k, v in planner_kwargs(config.training).items()} + except Exception: + pass + out['cell'] = str(config.exp.get('eval_cell', '') or '') + out['task'] = str(config.exp.get('eval_task', '') or config.exp.get('task', '') or '') + out['algo_name'] = getattr(algo, 'algo_name', None) if algo is not None else None + out['num_rollouts_requested'] = int(config.exp.num_rollouts) + out['partial'] = bool(partial) + out['resumed_from_episode'] = int(_RESUME_N) + if np_rng_state is not None: + out['np_rng_state'] = np_rng_state + if n: + p_hat = out['success_rate']; z = 1.96 + den = 1 + z * z / n + centre = (p_hat + z * z / (2 * n)) / den + half = z * np.sqrt(p_hat * (1 - p_hat) / n + z * z / (4 * n * n)) / den + out['success_ci95'] = [float(centre - half), float(centre + half)] + if t_start is not None: + out['wall_time_s'] = float(_time.time() - t_start) + out['wall_time_per_episode_s'] = float(out['wall_time_s'] / max(n, 1)) + plans = [e.get('plan') for e in episodes if e.get('plan')] + if plans: + out['planner_time'] = { + 'steps_total': int(sum(p['steps'] for p in plans)), + 't_sample_s': float(sum(p['t_sample_s'] for p in plans)), + 't_score_s': float(sum(p['t_score_s'] for p in plans)), + 'score_chosen_mean': float(np.mean([p['score_chosen_mean'] for p in plans])), + 'score_max_mean': float(np.mean([p['score_max_mean'] for p in plans])), + 'score_mean_mean': float(np.mean([p['score_mean_mean'] for p in plans])), + 'gap_chosen_minus_mean': float(np.mean([p['gap_chosen_minus_mean'] for p in plans])), + 'ties_at_max_mean': float(np.mean([p['ties_at_max_mean'] for p in plans if p.get('ties_at_max_mean') is not None] or [np.nan])), + 'frac_saturated_mean': float(np.mean([p['frac_saturated_mean'] for p in plans if p.get('frac_saturated_mean') is not None] or [np.nan])), + } + path = str(config.exp.results_json) + os.makedirs(os.path.dirname(os.path.abspath(path)), exist_ok=True) + target = path + '.partial' if partial else path + tmp = target + '.tmp' + with open(tmp, 'w') as f: + json.dump(out, f, indent=2) + os.replace(tmp, target) + if not partial: + for stale in (path + '.partial', path + '.partial_best'): + try: + os.remove(stale) + except OSError: + pass + print(f'[rsm_rise] wrote {path}: success_rate={out["success_rate"]} over {n} episodes') + + +@hydra.main(version_base=None, config_path='../configs', config_name="eval_robomimic") +def eval(config: EvaluationConfig): + config.env.horizon = config.exp.rollout_horizon + env, policy, render_mode, video_writers = setup_eval(config) + + save_dataset = config.exp.save_to_dataset + rollout_stats = RolloutStats() + # rsm_rise: episode-level resume -- reload the furthest compatible partial of THIS cell and continue + global _RESUME_N + _RESUME_N, _resume_eps, _resume_rng = _resume_load(config) + _resume_times, _resume_plans = _resume_restore(rollout_stats, _resume_eps) + + if save_dataset: + dataset_name = f'{config.exp.dataset_name}.hdf5' + if not ROLLOUT_DATA_DIR.exists(): + ROLLOUT_DATA_DIR.mkdir() + dataset_path = ROLLOUT_DATA_DIR / dataset_name + total_samples = 0 + demo_num = 0 + + if config.exp.reset_to_data: + ref_dataset_path = get_dataset(config.data) + else: + ref_dataset_path = None + # rsm_rise: fixed initial-state pool (env.reset_states_file), one state per episode drawn with the eval seed + _reset_pool = None + if getattr(config.env, 'reset_states_file', None): + with open(config.env.reset_states_file) as _f: + _reset_pool = [np.array(e['state0'], dtype=np.float64) for e in json.load(_f)['episodes']] + _reset_rng = np.random.RandomState(int(config.exp.eval_seed)) + _reset_idx = [int(_reset_rng.randint(len(_reset_pool))) for _ in range(int(config.exp.num_rollouts))] + print(f"[rsm_rise] resetting every episode to one of {len(_reset_pool)} pooled initial states from {config.env.reset_states_file}") + + try: + with ( + video_writer_manager(video_writers) as video_writers, + (h5py.File(dataset_path, 'w') if save_dataset else nullcontext()) as dataset_file, + (h5py.File(ref_dataset_path, 'r') if ref_dataset_path is not None else nullcontext()) as ref_dataset_file + ): + if save_dataset: + data_grp = dataset_file.create_group('data') + + import time as _time + # rsm_rise: wall time and planner log per episode (pre-filled by an episode-level resume) + _ep_times, _ep_plans = list(_resume_times), list(_resume_plans) + _t_eval0 = _time.time() + if _RESUME_N and _reset_pool is None and _rng_state_load(_resume_rng): + # rsm_rise 23:20 UTC: the partial carries the exact global-numpy RNG state as of the reset of + # episode _RESUME_N, so the resumed tail gets the SAME initial states a fresh run would have + # given it without replaying _RESUME_N env.reset() calls (~1 s each -> up to 100 s per attempt + # on a crashy cell, which is what made the 100-rollout TEST evals of a degenerate job miss the + # deadline). Strictly more faithful than the replay: the replay only matched a fresh run if + # nothing inside a rollout drew from np.random. + print(f'[rsm_rise] resume: restored the numpy RNG state of episode {_RESUME_N} ' + f'(no reset replay needed)') + elif _RESUME_N and _reset_pool is None: + # No fixed init-state pool: episode i's initial state is the i-th draw of the env RNG (seeded with + # eval_seed at creation). Burn _RESUME_N resets so the resumed episodes get the SAME initial states + # a fresh run would have given them -- otherwise the resumed tail would repeat the init states of + # the finished head and the estimate would be built on duplicated inits. + _t_warm = _time.time() + for _ in range(_RESUME_N): + env.reset() + print(f'[rsm_rise] resume: advanced the env RNG by {_RESUME_N} resets ' + f'in {_time.time() - _t_warm:.1f}s') + for i in range(_RESUME_N, config.exp.num_rollouts): + _t_ep0 = _time.time() + if ref_dataset_file is not None: + ind = 9 + + eef_pos = ref_dataset_file['data'][f'demo_{ind}']['obs']['robot0_eef_pos'] + # find first index where z < 0.5 + try: + idx = np.where(eef_pos[:, 2] < 0.835)[0][0] + except IndexError: + idx = 0 + + reset_state = ref_dataset_file['data'][f'demo_{ind}']['states'][idx] + elif _reset_pool is not None: + reset_state = _reset_pool[_reset_idx[i]] + else: + reset_state = None + + traj = rollout( + policy=policy, + eval_envs=env, + rollout_stats=rollout_stats, + reset_state=reset_state, + logger=None, + total_steps=config.exp.rollout_horizon, + render_mode=render_mode, + log_video=config.exp.log_video, + video_writers=video_writers, + render_dims=config.exp.video_dims, + video_skip=config.exp.video_skip, + return_trajectory=save_dataset, + end_on_success=bool(config.exp.get('end_on_success', False)), + ) + if save_dataset: + # save traj + demo_num, added_samples = add_trajectory_to_dataset( + demo_num, + traj, + dataset_file + ) + total_samples += added_samples + + rollout_stats.compute_statistics() + _ep_times.append(_time.time() - _t_ep0) + _algo = getattr(getattr(policy, 'policy', None), 'policy', None) + _ep_plans.append(_algo.pop_plan_log() if hasattr(_algo, 'pop_plan_log') else []) + if config.exp.get('results_json', None): + # snapshot taken here = the RNG state the NEXT episode's env.reset() will consume + _write_results_json(config, rollout_stats, policy=policy, ep_times=_ep_times, + ep_plans=_ep_plans, t_start=_t_eval0, partial=True, + np_rng_state=_rng_state_dump()) + + if config.exp.verbose: + rollout_stats.print_stats(i, total=config.exp.num_rollouts) + + if save_dataset: + data_grp.attrs['total'] = total_samples + + hydra_config = HydraConfig.get() + config_name = hydra_config.job.config_name + data_grp.attrs['config_name'] = config_name + + env_args = env.serialize() + if "placement_initializer" in env_args['env_kwargs']: + env_args['env_kwargs']["placement_initializer"] = None + data_grp.attrs['env_args'] = json.dumps(env_args, indent=4) + + fill_metadata( + dataset_file, + dataset_id=str(uuid.uuid4()), + dataset_type=DatasetType.RL, + action_type=ActionType.RELATIVE, + env_type=EnvType.ROBOMIMIC, + env_name=config.env.env_name.value, + is_real=False, + include_date=True, + include_creator=True, + ) + + print(f"Dataset saved to {dataset_path}") + print(f"Total samples added to dataset: {total_samples}") + if save_dataset: + edit_dataset_description(dataset_path) + if config.exp.get('results_json', None): + _write_results_json(config, rollout_stats, policy=policy, ep_times=_ep_times, + ep_plans=_ep_plans, t_start=_t_eval0, partial=False) + except Exception as e: + # remove partially completed dataset if it was created + if save_dataset: + dataset_path.unlink() + raise e diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_CENSUS.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_CENSUS.json new file mode 100644 index 0000000000000000000000000000000000000000..4521bda84d3466f9c0d82071b77db5e247fd7f0c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_CENSUS.json @@ -0,0 +1,8910 @@ +{ + "generated_by": "scripts/viz/cand_green_census.py", + "note": "Candidate-level census over EVERY flagship-setting failure-root trace on disk. GREEN == c_k >= 0.5 at T=1; hop_rise = mean green fraction over the second half of the hops minus the first half. Additive: CAND_GREEN_STATS.json is not modified.", + "setting": "L40best_b0.95_L8_N128_P16", + "tasks": [ + "square_expert_play", + "two_piece_expert_play" + ], + "n_draws": 171, + "n_distinct_roots": 46, + "skipped": {}, + "verdict": { + "square_expert_play": { + "n_roots_in_census": 21, + "n_roots_in_published_stats": 3, + "shipped_split_pick": "demo_36_t0056", + "shipped_cand_any_green_mean": 0.4140625, + "roots_with_lower_cand_any_green": [ + "demo_110_t0104", + "demo_150_t0125", + "demo_73_t0114", + "demo_126_t0123", + "demo_151_t0194", + "demo_54_t0122", + "demo_88_t0144", + "demo_198_t0110", + "demo_102_t0145", + "demo_221_t0249", + "demo_84_t0390" + ], + "argmin_cand_any_green": "demo_110_t0104", + "argmin_value": 0.0, + "ranking_top5": [ + [ + "demo_110_t0104", + 0.0, + 1 + ], + [ + "demo_150_t0125", + 0.0, + 5 + ], + [ + "demo_73_t0114", + 0.0, + 3 + ], + [ + "demo_126_t0123", + 0.0, + 3 + ], + [ + "demo_151_t0194", + 0.0026, + 3 + ] + ], + "argmax_hop_rise": "demo_36_t0056", + "argmax_hop_rise_value": 0.16748046875, + "hop_rise_top5": [ + [ + "demo_36_t0056", + 0.1675, + 3 + ], + [ + "demo_13_t0048", + 0.1436, + 4 + ], + [ + "demo_212_t0141", + 0.0321, + 5 + ], + [ + "demo_164_t0093", + 0.0155, + 5 + ], + [ + "demo_84_t0390", + 0.0112, + 1 + ] + ], + "spearman_fracgreen_vs_candanygreen": 0.9089097753751246, + "replicate_spread": { + "n_roots_with_multiple_plan_seeds": 0, + "max_cand_any_green_range": null, + "per_root": [] + } + }, + "two_piece_expert_play": { + "n_roots_in_census": 25, + "n_roots_in_published_stats": 8, + "shipped_split_pick": "demo_18_t0096", + "shipped_cand_any_green_mean": 0.7855113636363636, + "roots_with_lower_cand_any_green": [ + "demo_189_t0338", + "demo_171_t0244", + "demo_83_t0280", + "demo_159_t0413", + "demo_185_t0256" + ], + "argmin_cand_any_green": "demo_189_t0338", + "argmin_value": 0.0, + "ranking_top5": [ + [ + "demo_189_t0338", + 0.0, + 3 + ], + [ + "demo_171_t0244", + 0.0156, + 1 + ], + [ + "demo_83_t0280", + 0.5677, + 3 + ], + [ + "demo_159_t0413", + 0.7031, + 3 + ], + [ + "demo_185_t0256", + 0.7839, + 3 + ] + ], + "argmax_hop_rise": "demo_80_t0025", + "argmax_hop_rise_value": 0.177001953125, + "hop_rise_top5": [ + [ + "demo_80_t0025", + 0.177, + 1 + ], + [ + "demo_174_t0479", + 0.1002, + 3 + ], + [ + "demo_129_t0084", + 0.0791, + 3 + ], + [ + "demo_19_t0067", + 0.069, + 3 + ], + [ + "demo_143_t0154", + 0.0649, + 2 + ] + ], + "spearman_fracgreen_vs_candanygreen": 0.6979877597580197, + "replicate_spread": { + "n_roots_with_multiple_plan_seeds": 0, + "max_cand_any_green_range": null, + "per_root": [] + } + } + }, + "roots": { + "square_expert_play/demo_36_t0056": { + "task": "square_expert_play", + "root": "demo_36_t0056", + "episode": "demo_36", + "frame": 56, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz", + "stitchviz_split", + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + "cand_any_green_min": 0.4140625, + "cand_any_green_mean": 0.4140625, + "cand_any_green_max": 0.4140625, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.16748046875, + "hop_rise_mean": 0.16748046875, + "hop_rise_max": 0.16748046875 + }, + "square_expert_play/demo_110_t0104": { + "task": "square_expert_play", + "root": "demo_110_t0104", + "episode": "demo_110", + "frame": 104, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "root": "demo_110_t0104", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 6.59219892895635e-07, + "Q_spread": 6.59219892895635e-07, + "argmax": 7, + "argmax_is_green": false, + "q_of_greenless": 6.59219892895635e-07 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_102_t0145": { + "task": "square_expert_play", + "root": "demo_102_t0145", + "episode": "demo_102", + "frame": 145, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "root": "demo_102_t0145", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.045454545454545456, + "frac_green": 0.0013427734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0029296875, + 0.0, + 0.0078125 + ], + "hop_rise": 0.002685546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.024722615256905556, + "Q_spread": 0.024722615256905556, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": 0.013053152710199356 + }, + "cand_any_green_min": 0.171875, + "cand_any_green_mean": 0.171875, + "cand_any_green_max": 0.171875, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.002685546875, + "hop_rise_mean": 0.002685546875, + "hop_rise_max": 0.002685546875 + }, + "square_expert_play/demo_160_t0165": { + "task": "square_expert_play", + "root": "demo_160_t0165", + "episode": "demo_160", + "frame": 165, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "root": "demo_160_t0165", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.703125, + "cand_all_green": 0.0, + "top_cand_share": 0.020618556701030927, + "frac_green": 0.00592041015625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.04345703125, + 0.0, + 0.0, + 0.0, + 0.00390625 + ], + "hop_rise": -0.0098876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.04654752463102341, + "Q_spread": 0.04654752463102341, + "argmax": 103, + "argmax_is_green": true, + "q_of_greenless": 8.725493535166606e-05 + }, + "cand_any_green_min": 0.703125, + "cand_any_green_mean": 0.703125, + "cand_any_green_max": 0.703125, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.0098876953125, + "hop_rise_mean": -0.0098876953125, + "hop_rise_max": -0.0098876953125 + }, + "square_expert_play/demo_84_t0390": { + "task": "square_expert_play", + "root": "demo_84_t0390", + "episode": "demo_84", + "frame": 390, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "root": "demo_84_t0390", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.34375, + "cand_all_green": 0.0, + "top_cand_share": 0.0593607305936073, + "frac_green": 0.0267333984375, + "hop_green": [ + 0.0, + 0.025390625, + 0.025390625, + 0.03369140625, + 0.0322265625, + 0.0341796875, + 0.03076171875, + 0.0322265625 + ], + "hop_rise": 0.01123046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "Q_spread": 0.2687058746814728, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": 0.03616061061620712 + }, + "cand_any_green_min": 0.34375, + "cand_any_green_mean": 0.34375, + "cand_any_green_max": 0.34375, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.01123046875, + "hop_rise_mean": 0.01123046875, + "hop_rise_max": 0.01123046875 + }, + "square_expert_play/demo_221_t0249": { + "task": "square_expert_play", + "root": "demo_221_t0249", + "episode": "demo_221", + "frame": 249, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "root": "demo_221_t0249", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.07407407407407407, + "frac_green": 0.00164794921875, + "hop_green": [ + 0.0, + 0.0, + 0.0126953125, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": -0.0030517578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.1423076102801133e-05, + "Q_max": 0.06528710573911667, + "Q_spread": 0.06527568399906158, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.03142651170492172 + }, + "cand_any_green_min": 0.171875, + "cand_any_green_mean": 0.171875, + "cand_any_green_max": 0.171875, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.0030517578125, + "hop_rise_mean": -0.0030517578125, + "hop_rise_max": -0.0030517578125 + }, + "square_expert_play/demo_198_t0110": { + "task": "square_expert_play", + "root": "demo_198_t0110", + "episode": "demo_198", + "frame": 110, + "n_draws": 11, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + "cand_any_green_min": 0.1328125, + "cand_any_green_mean": 0.1534090909090909, + "cand_any_green_max": 0.1640625, + "cand_any_green_range": 0.03125, + "hop_rise_min": 0.00537109375, + "hop_rise_mean": 0.009299538352272728, + "hop_rise_max": 0.0111083984375 + }, + "square_expert_play/demo_54_t0122": { + "task": "square_expert_play", + "root": "demo_54_t0122", + "episode": "demo_54", + "frame": 122, + "n_draws": 11, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.01065340909090909, + "cand_any_green_max": 0.0703125, + "cand_any_green_range": 0.0703125, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0001775568181818182, + "hop_rise_max": 0.001220703125 + }, + "square_expert_play/demo_181_t0135": { + "task": "square_expert_play", + "root": "demo_181_t0135", + "episode": "demo_181", + "frame": 135, + "n_draws": 13, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_split", + "stitchviz_split2", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + "cand_any_green_min": 0.921875, + "cand_any_green_mean": 0.9597355769230769, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.078125, + "hop_rise_min": -0.3211669921875, + "hop_rise_mean": -0.2960862379807692, + "hop_rise_max": -0.284912109375 + }, + "square_expert_play/demo_148_t0138": { + "task": "square_expert_play", + "root": "demo_148_t0138", + "episode": "demo_148", + "frame": 138, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5, + "cand_all_green": 0.0, + "top_cand_share": 0.0966183574879227, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.056640625, + 0.01513671875, + 0.005859375, + 0.01708984375, + 0.001953125, + 0.00244140625, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0220947265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "Q_spread": 0.8641209602355957, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 0.041483890265226364 + }, + "cand_any_green_min": 0.5, + "cand_any_green_mean": 0.6078125, + "cand_any_green_max": 0.7578125, + "cand_any_green_range": 0.2578125, + "hop_rise_min": -0.0516357421875, + "hop_rise_mean": -0.031494140625, + "hop_rise_max": -0.0220947265625 + }, + "square_expert_play/demo_164_t0093": { + "task": "square_expert_play", + "root": "demo_164_t0093", + "episode": "demo_164", + "frame": 93, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00634765625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8125, + "cand_all_green": 0.0, + "top_cand_share": 0.009615384615384616, + "frac_green": 0.00634765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.05078125, + 0.0 + ], + "hop_rise": 0.0126953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01870250329375267, + "Q_spread": 0.01870250329375267, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 1.1420300261022476e-09 + }, + "cand_any_green_min": 0.7265625, + "cand_any_green_mean": 0.7921875, + "cand_any_green_max": 0.828125, + "cand_any_green_range": 0.1015625, + "hop_rise_min": 0.01220703125, + "hop_rise_mean": 0.015478515625, + "hop_rise_max": 0.02685546875 + }, + "square_expert_play/demo_212_t0141": { + "task": "square_expert_play", + "root": "demo_212_t0141", + "episode": "demo_212", + "frame": 141, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + "cand_any_green_min": 0.40625, + "cand_any_green_mean": 0.490625, + "cand_any_green_max": 0.578125, + "cand_any_green_range": 0.171875, + "hop_rise_min": 0.0291748046875, + "hop_rise_mean": 0.0320556640625, + "hop_rise_max": 0.0361328125 + }, + "square_expert_play/demo_150_t0125": { + "task": "square_expert_play", + "root": "demo_150_t0125", + "episode": "demo_150", + "frame": 125, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 8.646483529162197e-10, + "Q_spread": 8.646483529162197e-10, + "argmax": 121, + "argmax_is_green": false, + "q_of_greenless": 8.646483529162197e-10 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_88_t0144": { + "task": "square_expert_play", + "root": "demo_88_t0144", + "episode": "demo_88", + "frame": 144, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": 0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0455165111794396e-31, + "Q_max": 0.010041126981377602, + "Q_spread": 0.010041126981377602, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.009240468963980675 + }, + "cand_any_green_min": 0.0078125, + "cand_any_green_mean": 0.10625, + "cand_any_green_max": 0.46875, + "cand_any_green_range": 0.4609375, + "hop_rise_min": 0.0001220703125, + "hop_rise_mean": 0.0018310546875, + "hop_rise_max": 0.0081787109375 + }, + "square_expert_play/demo_73_t0114": { + "task": "square_expert_play", + "root": "demo_73_t0114", + "episode": "demo_73", + "frame": 114, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 5.5906976097197525e-12, + "Q_spread": 5.5906976097197525e-12, + "argmax": 98, + "argmax_is_green": false, + "q_of_greenless": 5.5906976097197525e-12 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_151_t0194": { + "task": "square_expert_play", + "root": "demo_151_t0194", + "episode": "demo_151", + "frame": 194, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.017340686172246933, + "Q_spread": 0.017340686172246933, + "argmax": 52, + "argmax_is_green": false, + "q_of_greenless": 0.017340686172246933 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0026041666666666665, + "cand_any_green_max": 0.0078125, + "cand_any_green_range": 0.0078125, + "hop_rise_min": -0.0001220703125, + "hop_rise_mean": -4.0690104166666664e-05, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_126_t0123": { + "task": "square_expert_play", + "root": "demo_126_t0123", + "episode": "demo_126", + "frame": 123, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.9729482523398474e-05, + "Q_spread": 3.9729482523398474e-05, + "argmax": 104, + "argmax_is_green": false, + "q_of_greenless": 3.9729482523398474e-05 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_13_t0048": { + "task": "square_expert_play", + "root": "demo_13_t0048", + "episode": "demo_13", + "frame": 48, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.31689453125, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.013674884437596301, + "frac_green": 0.31689453125, + "hop_green": [ + 0.00146484375, + 0.18310546875, + 0.30322265625, + 0.48876953125, + 0.52099609375, + 0.43212890625, + 0.35595703125, + 0.24951171875 + ], + "hop_rise": 0.1455078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0123866748210773e-19, + "Q_max": 0.6181221604347229, + "Q_spread": 0.6181221604347229, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 2.1271082117912954e-11 + }, + "cand_any_green_min": 0.9296875, + "cand_any_green_mean": 0.951171875, + "cand_any_green_max": 0.96875, + "cand_any_green_range": 0.0390625, + "hop_rise_min": 0.1392822265625, + "hop_rise_mean": 0.143646240234375, + "hop_rise_max": 0.147216796875 + }, + "square_expert_play/demo_10_t0079": { + "task": "square_expert_play", + "root": "demo_10_t0079", + "episode": "demo_10", + "frame": 79, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5692138671875, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9765625, + "cand_all_green": 0.0, + "top_cand_share": 0.009114304096075488, + "frac_green": 0.5692138671875, + "hop_green": [ + 0.3603515625, + 0.55029296875, + 0.79931640625, + 0.6748046875, + 0.759765625, + 0.61474609375, + 0.40771484375, + 0.38671875 + ], + "hop_rise": -0.053955078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.471548136979233e-14, + "Q_max": 0.8480290174484253, + "Q_spread": 0.8480290174484253, + "argmax": 46, + "argmax_is_green": true, + "q_of_greenless": 2.946369190293119e-11 + }, + "cand_any_green_min": 0.9609375, + "cand_any_green_mean": 0.98046875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0390625, + "hop_rise_min": -0.0567626953125, + "hop_rise_mean": -0.05230712890625, + "hop_rise_max": -0.0491943359375 + }, + "square_expert_play/demo_202_t0096": { + "task": "square_expert_play", + "root": "demo_202_t0096", + "episode": "demo_202", + "frame": 96, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2430419921875, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.01054746358613762, + "frac_green": 0.2430419921875, + "hop_green": [ + 0.09912109375, + 0.30322265625, + 0.4501953125, + 0.37109375, + 0.26708984375, + 0.1396484375, + 0.1494140625, + 0.16455078125 + ], + "hop_rise": -0.125732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 9.829118042484902e-14, + "Q_max": 0.5578907132148743, + "Q_spread": 0.5578907132148743, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 8.636027448716277e-10 + }, + "cand_any_green_min": 0.9453125, + "cand_any_green_mean": 0.96484375, + "cand_any_green_max": 0.984375, + "cand_any_green_range": 0.0390625, + "hop_rise_min": -0.1318359375, + "hop_rise_mean": -0.12957763671875, + "hop_rise_max": -0.125732421875 + }, + "square_expert_play/demo_172_t0038": { + "task": "square_expert_play", + "root": "demo_172_t0038", + "episode": "demo_172", + "frame": 38, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "square_expert_play", + "episode": "demo_172", + "frame": 38, + "root": "demo_172_t0038", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12725830078125, + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014388489208633094, + "frac_green": 0.12725830078125, + "hop_green": [ + 0.1708984375, + 0.21142578125, + 0.15087890625, + 0.10400390625, + 0.1279296875, + 0.1396484375, + 0.078125, + 0.03515625 + ], + "hop_rise": -0.0640869140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "Q_spread": 0.5207490921020508, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 0.0003339288232382387 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.9921875, + "cand_any_green_max": 0.9921875, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.0640869140625, + "hop_rise_mean": -0.0640869140625, + "hop_rise_max": -0.0640869140625 + }, + "two_piece_expert_play/demo_106_t0035": { + "task": "two_piece_expert_play", + "root": "demo_106_t0035", + "episode": "demo_106", + "frame": 35, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "root": "demo_106_t0035", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.015384615384615385, + "frac_green": 0.01983642578125, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0009765625, + 0.0, + 0.02978515625, + 0.064453125, + 0.0625 + ], + "hop_rise": 0.0386962890625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.019061341881752014, + "Q_max": 0.08237418532371521, + "Q_spread": 0.0633128434419632, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0386962890625, + "hop_rise_mean": 0.0386962890625, + "hop_rise_max": 0.0386962890625 + }, + "two_piece_expert_play/demo_99_t0057": { + "task": "two_piece_expert_play", + "root": "demo_99_t0057", + "episode": "demo_99", + "frame": 57, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "root": "demo_99_t0057", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010279001468428781, + "frac_green": 0.04156494140625, + "hop_green": [ + 0.0, + 0.01220703125, + 0.0, + 0.068359375, + 0.06103515625, + 0.060546875, + 0.0625, + 0.06787109375 + ], + "hop_rise": 0.0428466796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.11163482069969177, + "Q_max": 0.1695835292339325, + "Q_spread": 0.05794870853424072, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0428466796875, + "hop_rise_mean": 0.0428466796875, + "hop_rise_max": 0.0428466796875 + }, + "two_piece_expert_play/demo_129_t0084": { + "task": "two_piece_expert_play", + "root": "demo_129_t0084", + "episode": "demo_129", + "frame": 84, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz", + "stitchviz_split", + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.9921875, + "cand_any_green_max": 0.9921875, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0791015625, + "hop_rise_mean": 0.0791015625, + "hop_rise_max": 0.0791015625 + }, + "two_piece_expert_play/demo_143_t0154": { + "task": "two_piece_expert_play", + "root": "demo_143_t0154", + "episode": "demo_143", + "frame": 154, + "n_draws": 2, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz", + "stitchviz_split" + ], + "representative_dir": "stitchviz_split", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "root": "demo_143_t0154", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009854014598540146, + "frac_green": 0.167236328125, + "hop_green": [ + 0.0, + 0.06494140625, + 0.18359375, + 0.29052734375, + 0.27587890625, + 0.1474609375, + 0.22119140625, + 0.154296875 + ], + "hop_rise": 0.06494140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_spread": 0.09305314719676971, + "argmax": 94, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.06494140625, + "hop_rise_mean": 0.06494140625, + "hop_rise_max": 0.06494140625 + }, + "two_piece_expert_play/demo_102_t0198": { + "task": "two_piece_expert_play", + "root": "demo_102_t0198", + "episode": "demo_102", + "frame": 198, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "root": "demo_102_t0198", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.011428571428571429, + "frac_green": 0.01068115234375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.05908203125, + 0.0, + 0.02587890625 + ], + "hop_rise": 0.0213623046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.504642619706563e-22, + "Q_max": 0.03459713235497475, + "Q_spread": 0.03459713235497475, + "argmax": 110, + "argmax_is_green": true, + "q_of_greenless": 3.8611986497016915e-07 + }, + "cand_any_green_min": 0.9453125, + "cand_any_green_mean": 0.9453125, + "cand_any_green_max": 0.9453125, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0213623046875, + "hop_rise_mean": 0.0213623046875, + "hop_rise_max": 0.0213623046875 + }, + "two_piece_expert_play/demo_171_t0244": { + "task": "two_piece_expert_play", + "root": "demo_171_t0244", + "episode": "demo_171", + "frame": 244, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "root": "demo_171_t0244", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.015625, + "cand_all_green": 0.0, + "top_cand_share": 0.5, + "frac_green": 0.0001220703125, + "hop_green": [ + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.7732108921773033e-06, + "Q_max": 0.02326813153922558, + "Q_spread": 0.023264357820153236, + "argmax": 123, + "argmax_is_green": true, + "q_of_greenless": 0.009346847422420979 + }, + "cand_any_green_min": 0.015625, + "cand_any_green_mean": 0.015625, + "cand_any_green_max": 0.015625, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "two_piece_expert_play/demo_38_t0067": { + "task": "two_piece_expert_play", + "root": "demo_38_t0067", + "episode": "demo_38", + "frame": 67, + "n_draws": 9, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0101318359375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024096385542168676, + "frac_green": 0.0101318359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01220703125, + 0.01220703125, + 0.00244140625, + 0.01708984375, + 0.037109375 + ], + "hop_rise": 0.01416015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0009374454384669662, + "Q_max": 0.07211869955062866, + "Q_spread": 0.07118125259876251, + "argmax": 127, + "argmax_is_green": true, + "q_of_greenless": 0.018065709620714188 + }, + "cand_any_green_min": 0.7578125, + "cand_any_green_mean": 0.7994791666666666, + "cand_any_green_max": 0.9140625, + "cand_any_green_range": 0.15625, + "hop_rise_min": 0.0106201171875, + "hop_rise_mean": 0.013604058159722222, + "hop_rise_max": 0.0157470703125 + }, + "two_piece_expert_play/demo_18_t0096": { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "episode": "demo_18", + "frame": 96, + "n_draws": 11, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_split", + "stitchviz_split2", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + "cand_any_green_min": 0.6796875, + "cand_any_green_mean": 0.7855113636363636, + "cand_any_green_max": 0.828125, + "cand_any_green_range": 0.1484375, + "hop_rise_min": -0.122802734375, + "hop_rise_mean": -0.09592507102272728, + "hop_rise_max": -0.0743408203125 + }, + "two_piece_expert_play/demo_128_t0115": { + "task": "two_piece_expert_play", + "root": "demo_128_t0115", + "episode": "demo_128", + "frame": 115, + "n_draws": 9, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01641845703125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.03345724907063197, + "frac_green": 0.01641845703125, + "hop_green": [ + 0.00439453125, + 0.052734375, + 0.0576171875, + 0.01025390625, + 0.0, + 0.00048828125, + 0.005859375, + 0.0 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015772078186273575, + "Q_max": 0.48050427436828613, + "Q_spread": 0.46473219990730286, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.05498268082737923 + }, + "cand_any_green_min": 0.890625, + "cand_any_green_mean": 0.9366319444444444, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.109375, + "hop_rise_min": -0.0296630859375, + "hop_rise_mean": -0.023356119791666668, + "hop_rise_max": -0.0050048828125 + }, + "two_piece_expert_play/demo_185_t0256": { + "task": "two_piece_expert_play", + "root": "demo_185_t0256", + "episode": "demo_185", + "frame": 256, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0108642578125, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028089887640449437, + "frac_green": 0.0108642578125, + "hop_green": [ + 0.0, + 0.0, + 0.00634765625, + 0.0029296875, + 0.00048828125, + 0.01318359375, + 0.01220703125, + 0.0517578125 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014911642065271735, + "Q_max": 0.05342011898756027, + "Q_spread": 0.05192895606160164, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.01908215507864952 + }, + "cand_any_green_min": 0.7109375, + "cand_any_green_mean": 0.7838541666666666, + "cand_any_green_max": 0.8515625, + "cand_any_green_range": 0.140625, + "hop_rise_min": 0.01708984375, + "hop_rise_mean": 0.019571940104166668, + "hop_rise_max": 0.0208740234375 + }, + "two_piece_expert_play/demo_174_t0479": { + "task": "two_piece_expert_play", + "root": "demo_174_t0479", + "episode": "demo_174", + "frame": 479, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.159912109375, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.009541984732824428, + "frac_green": 0.159912109375, + "hop_green": [ + 0.0, + 0.07861328125, + 0.14013671875, + 0.224609375, + 0.08349609375, + 0.26220703125, + 0.2822265625, + 0.2080078125 + ], + "hop_rise": 0.09814453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014558101538568735, + "Q_max": 0.27829867601394653, + "Q_spread": 0.27684286236763, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.0014558101538568735 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.9973958333333334, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0078125, + "hop_rise_min": 0.09814453125, + "hop_rise_mean": 0.10017903645833333, + "hop_rise_max": 0.1021728515625 + }, + "two_piece_expert_play/demo_117_t0077": { + "task": "two_piece_expert_play", + "root": "demo_117_t0077", + "episode": "demo_117", + "frame": 77, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.008544921875, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.02142857142857143, + "frac_green": 0.008544921875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0009765625, + 0.00927734375, + 0.01220703125, + 0.0458984375 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.004533246159553528, + "Q_max": 0.046014029532670975, + "Q_spread": 0.04148078337311745, + "argmax": 112, + "argmax_is_green": true, + "q_of_greenless": 0.015510505065321922 + }, + "cand_any_green_min": 0.9296875, + "cand_any_green_mean": 0.9322916666666666, + "cand_any_green_max": 0.9375, + "cand_any_green_range": 0.0078125, + "hop_rise_min": 0.0164794921875, + "hop_rise_mean": 0.016886393229166668, + "hop_rise_max": 0.01708984375 + }, + "two_piece_expert_play/demo_105_t0113": { + "task": "two_piece_expert_play", + "root": "demo_105_t0113", + "episode": "demo_105", + "frame": 113, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0098876953125, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.018518518518518517, + "frac_green": 0.0098876953125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00927734375, + 0.001953125, + 0.0, + 0.00439453125, + 0.0634765625 + ], + "hop_rise": 0.01513671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0025416151620447636, + "Q_max": 0.0513761043548584, + "Q_spread": 0.04883448779582977, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 0.0034241038374602795 + }, + "cand_any_green_min": 0.984375, + "cand_any_green_mean": 0.99609375, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.015625, + "hop_rise_min": 0.01513671875, + "hop_rise_mean": 0.015716552734375, + "hop_rise_max": 0.0164794921875 + }, + "two_piece_expert_play/demo_75_t0199": { + "task": "two_piece_expert_play", + "root": "demo_75_t0199", + "episode": "demo_75", + "frame": 199, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.56170654296875, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010648701510377051, + "frac_green": 0.56170654296875, + "hop_green": [ + 0.884765625, + 0.71044921875, + 0.65478515625, + 0.5712890625, + 0.48828125, + 0.46533203125, + 0.38330078125, + 0.33544921875 + ], + "hop_rise": -0.2872314453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.09469607472419739, + "Q_max": 0.9999012351036072, + "Q_spread": 0.9052051305770874, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.291015625, + "hop_rise_mean": -0.2845458984375, + "hop_rise_max": -0.279541015625 + }, + "two_piece_expert_play/demo_165_t0157": { + "task": "two_piece_expert_play", + "root": "demo_165_t0157", + "episode": "demo_165", + "frame": 157, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08221435546875, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014847809948032665, + "frac_green": 0.08221435546875, + "hop_green": [ + 0.01220703125, + 0.1064453125, + 0.1748046875, + 0.09130859375, + 0.14794921875, + 0.052734375, + 0.056640625, + 0.015625 + ], + "hop_rise": -0.0279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.5286317395512015e-06, + "Q_max": 0.30794060230255127, + "Q_spread": 0.3079380691051483, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 2.5286317395512015e-06 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.998046875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0078125, + "hop_rise_min": -0.0299072265625, + "hop_rise_mean": -0.027496337890625, + "hop_rise_max": -0.0224609375 + }, + "two_piece_expert_play/demo_136_t0154": { + "task": "two_piece_expert_play", + "root": "demo_136_t0154", + "episode": "demo_136", + "frame": 154, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split", + "stitchviz_split2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 0.984375, + "cand_any_green_mean": 0.996875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.015625, + "hop_rise_min": -0.06005859375, + "hop_rise_mean": -0.0065673828125, + "hop_rise_max": 0.0262451171875 + }, + "two_piece_expert_play/demo_80_t0025": { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "episode": "demo_80", + "frame": 25, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.255859375, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011927480916030535, + "frac_green": 0.255859375, + "hop_green": [ + 0.005859375, + 0.1103515625, + 0.3359375, + 0.21728515625, + 0.43017578125, + 0.41064453125, + 0.26123046875, + 0.275390625 + ], + "hop_rise": 0.177001953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "Q_spread": 0.36739271879196167, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.177001953125, + "hop_rise_mean": 0.177001953125, + "hop_rise_max": 0.177001953125 + }, + "two_piece_expert_play/demo_198_t0166": { + "task": "two_piece_expert_play", + "root": "demo_198_t0166", + "episode": "demo_198", + "frame": 166, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_198", + "frame": 166, + "root": "demo_198_t0166", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.051513671875, + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.03317535545023697, + "frac_green": 0.051513671875, + "hop_green": [ + 0.001953125, + 0.12548828125, + 0.11962890625, + 0.05029296875, + 0.04296875, + 0.01513671875, + 0.0126953125, + 0.0439453125 + ], + "hop_rise": -0.045654296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.769107858417556e-05, + "Q_max": 0.38457581400871277, + "Q_spread": 0.3845081329345703, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.017471471801400185 + }, + "cand_any_green_min": 0.9609375, + "cand_any_green_mean": 0.9609375, + "cand_any_green_max": 0.9609375, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.045654296875, + "hop_rise_mean": -0.045654296875, + "hop_rise_max": -0.045654296875 + }, + "two_piece_expert_play/demo_64_t0192": { + "task": "two_piece_expert_play", + "root": "demo_64_t0192", + "episode": "demo_64", + "frame": 192, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_64", + "frame": 192, + "root": "demo_64_t0192", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.05419921875, + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028153153153153154, + "frac_green": 0.05419921875, + "hop_green": [ + 0.24755859375, + 0.0859375, + 0.0263671875, + 0.0224609375, + 0.0166015625, + 0.009765625, + 0.01123046875, + 0.013671875 + ], + "hop_rise": -0.082763671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0006882615271024406, + "Q_max": 0.704879105091095, + "Q_spread": 0.7041908502578735, + "argmax": 86, + "argmax_is_green": true, + "q_of_greenless": 0.11513863503932953 + }, + "cand_any_green_min": 0.8828125, + "cand_any_green_mean": 0.8828125, + "cand_any_green_max": 0.8828125, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.082763671875, + "hop_rise_mean": -0.082763671875, + "hop_rise_max": -0.082763671875 + }, + "two_piece_expert_play/demo_153_t0112": { + "task": "two_piece_expert_play", + "root": "demo_153_t0112", + "episode": "demo_153", + "frame": 112, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_153", + "frame": 112, + "root": "demo_153_t0112", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.15411376953125, + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009900990099009901, + "frac_green": 0.15411376953125, + "hop_green": [ + 0.0166015625, + 0.12255859375, + 0.18701171875, + 0.25634765625, + 0.2099609375, + 0.22705078125, + 0.14697265625, + 0.06640625 + ], + "hop_rise": 0.0169677734375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.312361844924453e-07, + "Q_max": 0.32301434874534607, + "Q_spread": 0.3230136036872864, + "argmax": 77, + "argmax_is_green": true, + "q_of_greenless": 0.008339659310877323 + }, + "cand_any_green_min": 0.984375, + "cand_any_green_mean": 0.984375, + "cand_any_green_max": 0.984375, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0169677734375, + "hop_rise_mean": 0.0169677734375, + "hop_rise_max": 0.0169677734375 + }, + "two_piece_expert_play/demo_6_t0180": { + "task": "two_piece_expert_play", + "root": "demo_6_t0180", + "episode": "demo_6", + "frame": 180, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_6", + "frame": 180, + "root": "demo_6_t0180", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1658935546875, + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009565857247976454, + "frac_green": 0.1658935546875, + "hop_green": [ + 0.08740234375, + 0.2314453125, + 0.4189453125, + 0.25, + 0.0654296875, + 0.12109375, + 0.060546875, + 0.09228515625 + ], + "hop_rise": -0.162109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.3845299482345581, + "Q_max": 0.5868167877197266, + "Q_spread": 0.20228683948516846, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.162109375, + "hop_rise_mean": -0.162109375, + "hop_rise_max": -0.162109375 + }, + "two_piece_expert_play/demo_159_t0413": { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "episode": "demo_159", + "frame": 413, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02105712890625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028985507246376812, + "frac_green": 0.02105712890625, + "hop_green": [ + 0.0, + 0.02099609375, + 0.01171875, + 0.0390625, + 0.01513671875, + 0.0419921875, + 0.0302734375, + 0.00927734375 + ], + "hop_rise": 0.0062255859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.0167299175664084e-07, + "Q_max": 0.12913301587104797, + "Q_spread": 0.12913261353969574, + "argmax": 1, + "argmax_is_green": true, + "q_of_greenless": 0.02041761204600334 + }, + "cand_any_green_min": 0.6953125, + "cand_any_green_mean": 0.703125, + "cand_any_green_max": 0.7109375, + "cand_any_green_range": 0.015625, + "hop_rise_min": 0.0062255859375, + "hop_rise_mean": 0.009114583333333334, + "hop_rise_max": 0.0107421875 + }, + "two_piece_expert_play/demo_189_t0338": { + "task": "two_piece_expert_play", + "root": "demo_189_t0338", + "episode": "demo_189", + "frame": 338, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.94027550238585e-15, + "Q_max": 7.936003498798527e-08, + "Q_spread": 7.936003498798527e-08, + "argmax": 85, + "argmax_is_green": false, + "q_of_greenless": 7.936003498798527e-08 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "two_piece_expert_play/demo_83_t0280": { + "task": "two_piece_expert_play", + "root": "demo_83_t0280", + "episode": "demo_83", + "frame": 280, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00830078125, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.051470588235294115, + "frac_green": 0.00830078125, + "hop_green": [ + 0.0, + 0.0, + 0.00146484375, + 0.001953125, + 0.00146484375, + 0.00146484375, + 0.05908203125, + 0.0009765625 + ], + "hop_rise": 0.014892578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0842872377736512e-08, + "Q_max": 0.07263443619012833, + "Q_spread": 0.07263442873954773, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.012364218942821026 + }, + "cand_any_green_min": 0.359375, + "cand_any_green_mean": 0.5677083333333334, + "cand_any_green_max": 0.953125, + "cand_any_green_range": 0.59375, + "hop_rise_min": 0.010009765625, + "hop_rise_mean": 0.0118408203125, + "hop_rise_max": 0.014892578125 + }, + "two_piece_expert_play/demo_19_t0067": { + "task": "two_piece_expert_play", + "root": "demo_19_t0067", + "episode": "demo_19", + "frame": 67, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01129150390625, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.734375, + "cand_all_green": 0.0, + "top_cand_share": 0.02702702702702703, + "frac_green": 0.01129150390625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0283203125, + 0.0107421875, + 0.00341796875, + 0.0078125, + 0.0400390625 + ], + "hop_rise": 0.0084228515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.675629151686735e-07, + "Q_max": 0.08670267462730408, + "Q_spread": 0.08670200407505035, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": 0.01302293874323368 + }, + "cand_any_green_min": 0.734375, + "cand_any_green_mean": 0.9114583333333334, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.265625, + "hop_rise_min": 0.0084228515625, + "hop_rise_mean": 0.06901041666666667, + "hop_rise_max": 0.0994873046875 + } + }, + "draws": [ + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + { + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "root": "demo_110_t0104", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 6.59219892895635e-07, + "Q_spread": 6.59219892895635e-07, + "argmax": 7, + "argmax_is_green": false, + "q_of_greenless": 6.59219892895635e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "root": "demo_102_t0145", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.045454545454545456, + "frac_green": 0.0013427734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0029296875, + 0.0, + 0.0078125 + ], + "hop_rise": 0.002685546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.024722615256905556, + "Q_spread": 0.024722615256905556, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": 0.013053152710199356 + }, + { + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "root": "demo_160_t0165", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.703125, + "cand_all_green": 0.0, + "top_cand_share": 0.020618556701030927, + "frac_green": 0.00592041015625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.04345703125, + 0.0, + 0.0, + 0.0, + 0.00390625 + ], + "hop_rise": -0.0098876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.04654752463102341, + "Q_spread": 0.04654752463102341, + "argmax": 103, + "argmax_is_green": true, + "q_of_greenless": 8.725493535166606e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "root": "demo_84_t0390", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.34375, + "cand_all_green": 0.0, + "top_cand_share": 0.0593607305936073, + "frac_green": 0.0267333984375, + "hop_green": [ + 0.0, + 0.025390625, + 0.025390625, + 0.03369140625, + 0.0322265625, + 0.0341796875, + 0.03076171875, + 0.0322265625 + ], + "hop_rise": 0.01123046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "Q_spread": 0.2687058746814728, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": 0.03616061061620712 + }, + { + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "root": "demo_221_t0249", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.07407407407407407, + "frac_green": 0.00164794921875, + "hop_green": [ + 0.0, + 0.0, + 0.0126953125, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": -0.0030517578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.1423076102801133e-05, + "Q_max": 0.06528710573911667, + "Q_spread": 0.06527568399906158, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.03142651170492172 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5, + "cand_all_green": 0.0, + "top_cand_share": 0.0966183574879227, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.056640625, + 0.01513671875, + 0.005859375, + 0.01708984375, + 0.001953125, + 0.00244140625, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0220947265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "Q_spread": 0.8641209602355957, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 0.041483890265226364 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00634765625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8125, + "cand_all_green": 0.0, + "top_cand_share": 0.009615384615384616, + "frac_green": 0.00634765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.05078125, + 0.0 + ], + "hop_rise": 0.0126953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01870250329375267, + "Q_spread": 0.01870250329375267, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 1.1420300261022476e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 8.646483529162197e-10, + "Q_spread": 8.646483529162197e-10, + "argmax": 121, + "argmax_is_green": false, + "q_of_greenless": 8.646483529162197e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": 0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0455165111794396e-31, + "Q_max": 0.010041126981377602, + "Q_spread": 0.010041126981377602, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.009240468963980675 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5, + "cand_all_green": 0.0, + "top_cand_share": 0.0966183574879227, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.056640625, + 0.01513671875, + 0.005859375, + 0.01708984375, + 0.001953125, + 0.00244140625, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0220947265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "Q_spread": 0.8641209602355957, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 0.041483890265226364 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00634765625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8125, + "cand_all_green": 0.0, + "top_cand_share": 0.009615384615384616, + "frac_green": 0.00634765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.05078125, + 0.0 + ], + "hop_rise": 0.0126953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01870250329375267, + "Q_spread": 0.01870250329375267, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 1.1420300261022476e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 8.646483529162197e-10, + "Q_spread": 8.646483529162197e-10, + "argmax": 121, + "argmax_is_green": false, + "q_of_greenless": 8.646483529162197e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": 0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0455165111794396e-31, + "Q_max": 0.010041126981377602, + "Q_spread": 0.010041126981377602, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.009240468963980675 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00701904296875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.24347826086956523, + "frac_green": 0.00701904296875, + "hop_green": [ + 0.0, + 0.0, + 0.0029296875, + 0.00537109375, + 0.0068359375, + 0.01025390625, + 0.013671875, + 0.01708984375 + ], + "hop_rise": 0.0098876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.22966429591178894, + "Q_spread": 0.22966429591178894, + "argmax": 89, + "argmax_is_green": true, + "q_of_greenless": 0.022050779312849045 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.0027101896703243256, + "Q_spread": 0.0027101896703243256, + "argmax": 25, + "argmax_is_green": false, + "q_of_greenless": 0.0027101896703243256 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.21563720703125, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9765625, + "cand_all_green": 0.0, + "top_cand_share": 0.010189640532125671, + "frac_green": 0.21563720703125, + "hop_green": [ + 0.716796875, + 0.3974609375, + 0.220703125, + 0.14404296875, + 0.06591796875, + 0.07958984375, + 0.07666015625, + 0.02392578125 + ], + "hop_rise": -0.3082275390625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.838567468720914e-12, + "Q_max": 0.8509555459022522, + "Q_spread": 0.8509555459022522, + "argmax": 36, + "argmax_is_green": true, + "q_of_greenless": 6.46574844722636e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00531005859375, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1328125, + "cand_all_green": 0.0, + "top_cand_share": 0.20689655172413793, + "frac_green": 0.00531005859375, + "hop_green": [ + 0.0, + 0.0, + 0.00146484375, + 0.0087890625, + 0.00634765625, + 0.00634765625, + 0.009765625, + 0.009765625 + ], + "hop_rise": 0.0054931640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.1415252387523651, + "Q_spread": 0.1415252387523651, + "argmax": 101, + "argmax_is_green": true, + "q_of_greenless": 0.016218332573771477 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.0015912809176370502, + "Q_spread": 0.0015912809176370502, + "argmax": 45, + "argmax_is_green": false, + "q_of_greenless": 0.0015912809176370502 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2047119140625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.010137149672033392, + "frac_green": 0.2047119140625, + "hop_green": [ + 0.66455078125, + 0.369140625, + 0.21435546875, + 0.140625, + 0.06591796875, + 0.07470703125, + 0.076171875, + 0.0322265625 + ], + "hop_rise": -0.284912109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9796030551719477e-14, + "Q_max": 0.8534550666809082, + "Q_spread": 0.8534550666809082, + "argmax": 25, + "argmax_is_green": true, + "q_of_greenless": 1.4603423892367573e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.004638671875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.15625, + "cand_all_green": 0.0, + "top_cand_share": 0.2236842105263158, + "frac_green": 0.004638671875, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0029296875, + 0.0029296875, + 0.00830078125, + 0.01123046875, + 0.0107421875 + ], + "hop_rise": 0.00732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.18495695292949677, + "Q_spread": 0.18495695292949677, + "argmax": 77, + "argmax_is_green": true, + "q_of_greenless": 0.016612788662314415 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.00309074018150568, + "Q_spread": 0.00309074018150568, + "argmax": 29, + "argmax_is_green": false, + "q_of_greenless": 0.00309074018150568 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.20623779296875, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.010358094110683634, + "frac_green": 0.20623779296875, + "hop_green": [ + 0.68115234375, + 0.3837890625, + 0.20703125, + 0.1357421875, + 0.06298828125, + 0.072265625, + 0.07275390625, + 0.0341796875 + ], + "hop_rise": -0.2913818359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.065185976064771e-15, + "Q_max": 0.8634084463119507, + "Q_spread": 0.8634084463119507, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": 0.00012400942796375602 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 5.5906976097197525e-12, + "Q_spread": 5.5906976097197525e-12, + "argmax": 98, + "argmax_is_green": false, + "q_of_greenless": 5.5906976097197525e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.017340686172246933, + "Q_spread": 0.017340686172246933, + "argmax": 52, + "argmax_is_green": false, + "q_of_greenless": 0.017340686172246933 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.9729482523398474e-05, + "Q_spread": 3.9729482523398474e-05, + "argmax": 104, + "argmax_is_green": false, + "q_of_greenless": 3.9729482523398474e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 9.217325094981298e-32, + "Q_max": 3.785088995705843e-12, + "Q_spread": 3.785088995705843e-12, + "argmax": 9, + "argmax_is_green": false, + "q_of_greenless": 3.785088995705843e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": -0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.02370322495698929, + "Q_spread": 0.02370322495698929, + "argmax": 41, + "argmax_is_green": true, + "q_of_greenless": 0.01656409539282322 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 1.9001799955731258e-05, + "Q_spread": 1.9001799955731258e-05, + "argmax": 59, + "argmax_is_green": false, + "q_of_greenless": 1.9001799955731258e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.208173579828272e-32, + "Q_max": 5.092057851763254e-12, + "Q_spread": 5.092057851763254e-12, + "argmax": 72, + "argmax_is_green": false, + "q_of_greenless": 5.092057851763254e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.010140572674572468, + "Q_spread": 0.010140572674572468, + "argmax": 68, + "argmax_is_green": false, + "q_of_greenless": 0.010140572674572468 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 1.242512048804656e-08, + "Q_spread": 1.242512048804656e-08, + "argmax": 56, + "argmax_is_green": false, + "q_of_greenless": 1.242512048804656e-08 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.31689453125, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.013674884437596301, + "frac_green": 0.31689453125, + "hop_green": [ + 0.00146484375, + 0.18310546875, + 0.30322265625, + 0.48876953125, + 0.52099609375, + 0.43212890625, + 0.35595703125, + 0.24951171875 + ], + "hop_rise": 0.1455078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0123866748210773e-19, + "Q_max": 0.6181221604347229, + "Q_spread": 0.6181221604347229, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 2.1271082117912954e-11 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5692138671875, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9765625, + "cand_all_green": 0.0, + "top_cand_share": 0.009114304096075488, + "frac_green": 0.5692138671875, + "hop_green": [ + 0.3603515625, + 0.55029296875, + 0.79931640625, + 0.6748046875, + 0.759765625, + 0.61474609375, + 0.40771484375, + 0.38671875 + ], + "hop_rise": -0.053955078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.471548136979233e-14, + "Q_max": 0.8480290174484253, + "Q_spread": 0.8480290174484253, + "argmax": 46, + "argmax_is_green": true, + "q_of_greenless": 2.946369190293119e-11 + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2430419921875, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.01054746358613762, + "frac_green": 0.2430419921875, + "hop_green": [ + 0.09912109375, + 0.30322265625, + 0.4501953125, + 0.37109375, + 0.26708984375, + 0.1396484375, + 0.1494140625, + 0.16455078125 + ], + "hop_rise": -0.125732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 9.829118042484902e-14, + "Q_max": 0.5578907132148743, + "Q_spread": 0.5578907132148743, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 8.636027448716277e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.3134765625, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.014213395638629283, + "frac_green": 0.3134765625, + "hop_green": [ + 0.001953125, + 0.1787109375, + 0.30078125, + 0.47802734375, + 0.5107421875, + 0.4296875, + 0.35693359375, + 0.2509765625 + ], + "hop_rise": 0.147216796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.476865961680355e-14, + "Q_max": 0.6342390775680542, + "Q_spread": 0.6342390775680542, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 2.0527206743281567e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.58099365234375, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009454774661203908, + "frac_green": 0.58099365234375, + "hop_green": [ + 0.3623046875, + 0.55810546875, + 0.8095703125, + 0.6923828125, + 0.7783203125, + 0.6337890625, + 0.41845703125, + 0.39501953125 + ], + "hop_rise": -0.0491943359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.41986458648924e-10, + "Q_max": 0.8421441316604614, + "Q_spread": 0.8421441316604614, + "argmax": 56, + "argmax_is_green": true, + "q_of_greenless": 5.676301650936466e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.245849609375, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.00893743793445879, + "frac_green": 0.245849609375, + "hop_green": [ + 0.103515625, + 0.3037109375, + 0.46728515625, + 0.37255859375, + 0.2646484375, + 0.13720703125, + 0.15185546875, + 0.166015625 + ], + "hop_rise": -0.1318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.474593217993928e-13, + "Q_max": 0.5490685701370239, + "Q_spread": 0.5490685701370239, + "argmax": 108, + "argmax_is_green": true, + "q_of_greenless": 1.346560907222738e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.29876708984375, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.012257405515832482, + "frac_green": 0.29876708984375, + "hop_green": [ + 0.00048828125, + 0.1708984375, + 0.28662109375, + 0.45849609375, + 0.486328125, + 0.412109375, + 0.3388671875, + 0.236328125 + ], + "hop_rise": 0.1392822265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.561455492258806e-18, + "Q_max": 0.6099290251731873, + "Q_spread": 0.6099290251731873, + "argmax": 57, + "argmax_is_green": true, + "q_of_greenless": 9.946264256655013e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.56298828125, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.009865568083261058, + "frac_green": 0.56298828125, + "hop_green": [ + 0.35546875, + 0.54052734375, + 0.78466796875, + 0.669921875, + 0.76171875, + 0.61279296875, + 0.40087890625, + 0.3779296875 + ], + "hop_rise": -0.04931640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.322533712659919e-13, + "Q_max": 0.8547662496566772, + "Q_spread": 0.8547662496566772, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": 0.014029395766556263 + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.24835205078125, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009584664536741214, + "frac_green": 0.24835205078125, + "hop_green": [ + 0.1015625, + 0.30810546875, + 0.47021484375, + 0.376953125, + 0.27197265625, + 0.1416015625, + 0.14697265625, + 0.16943359375 + ], + "hop_rise": -0.1317138671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.011987513986062e-14, + "Q_max": 0.5534642338752747, + "Q_spread": 0.5534642338752747, + "argmax": 67, + "argmax_is_green": true, + "q_of_greenless": 3.290904942760027e-14 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.3056640625, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.009185303514376996, + "frac_green": 0.3056640625, + "hop_green": [ + 0.00048828125, + 0.17626953125, + 0.29296875, + 0.4677734375, + 0.49951171875, + 0.41650390625, + 0.34375, + 0.248046875 + ], + "hop_rise": 0.142578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.4246809622686613e-17, + "Q_max": 0.4813844859600067, + "Q_spread": 0.4813844859600067, + "argmax": 6, + "argmax_is_green": true, + "q_of_greenless": 8.366973958118251e-08 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.58099365234375, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.008929509402248135, + "frac_green": 0.58099365234375, + "hop_green": [ + 0.36865234375, + 0.560546875, + 0.81689453125, + 0.69140625, + 0.78564453125, + 0.623046875, + 0.4130859375, + 0.388671875 + ], + "hop_rise": -0.0567626953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25436291098594666, + "Q_max": 0.840471625328064, + "Q_spread": 0.5861086845397949, + "argmax": 12, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.23797607421875, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.00923313670171839, + "frac_green": 0.23797607421875, + "hop_green": [ + 0.103515625, + 0.2958984375, + 0.44775390625, + 0.36279296875, + 0.2587890625, + 0.130859375, + 0.14208984375, + 0.162109375 + ], + "hop_rise": -0.1290283203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.383786100991288e-14, + "Q_max": 0.5601746439933777, + "Q_spread": 0.5601746439933777, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 2.2616730710467436e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + { + "task": "square_expert_play", + "episode": "demo_172", + "frame": 38, + "root": "demo_172_t0038", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12725830078125, + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014388489208633094, + "frac_green": 0.12725830078125, + "hop_green": [ + 0.1708984375, + 0.21142578125, + 0.15087890625, + 0.10400390625, + 0.1279296875, + 0.1396484375, + 0.078125, + 0.03515625 + ], + "hop_rise": -0.0640869140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "Q_spread": 0.5207490921020508, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 0.0003339288232382387 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00738525390625, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1328125, + "cand_all_green": 0.0, + "top_cand_share": 0.2809917355371901, + "frac_green": 0.00738525390625, + "hop_green": [ + 0.0, + 0.00048828125, + 0.00244140625, + 0.00634765625, + 0.0068359375, + 0.01220703125, + 0.01611328125, + 0.0146484375 + ], + "hop_rise": 0.0101318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.31185004115104675, + "Q_spread": 0.31185004115104675, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": 0.003624454839155078 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0003662109375, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.046875, + "cand_all_green": 0.0, + "top_cand_share": 0.16666666666666666, + "frac_green": 0.0003662109375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.00146484375 + ], + "hop_rise": 0.000732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01727997325360775, + "Q_spread": 0.01727997325360775, + "argmax": 50, + "argmax_is_green": true, + "q_of_greenless": 0.0068954830057919025 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.19854736328125, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.010759299108515216, + "frac_green": 0.19854736328125, + "hop_green": [ + 0.69677734375, + 0.4150390625, + 0.2607421875, + 0.06396484375, + 0.04833984375, + 0.03515625, + 0.0390625, + 0.029296875 + ], + "hop_rise": -0.3211669921875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.292697533096276e-14, + "Q_max": 0.8514546751976013, + "Q_spread": 0.8514546751976013, + "argmax": 29, + "argmax_is_green": true, + "q_of_greenless": 0.00027320117806084454 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0057373046875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.140625, + "cand_all_green": 0.0, + "top_cand_share": 0.20212765957446807, + "frac_green": 0.0057373046875, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0029296875, + 0.00390625, + 0.00537109375, + 0.015625, + 0.01708984375 + ], + "hop_rise": 0.009521484375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.18752142786979675, + "Q_spread": 0.18752142786979675, + "argmax": 117, + "argmax_is_green": true, + "q_of_greenless": 0.002974910894408822 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0006103515625, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0703125, + "cand_all_green": 0.0, + "top_cand_share": 0.2, + "frac_green": 0.0006103515625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.00341796875 + ], + "hop_rise": 0.001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.017263323068618774, + "Q_spread": 0.017263323068618774, + "argmax": 121, + "argmax_is_green": true, + "q_of_greenless": 0.008443250320851803 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.19287109375, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010443037974683544, + "frac_green": 0.19287109375, + "hop_green": [ + 0.681640625, + 0.4052734375, + 0.2529296875, + 0.0625, + 0.04541015625, + 0.0302734375, + 0.03662109375, + 0.0283203125 + ], + "hop_rise": -0.3154296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 8.061052639198735e-14, + "Q_max": 0.8541646003723145, + "Q_spread": 0.8541646003723145, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 0.0019010601099580526 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02606201171875, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7578125, + "cand_all_green": 0.0, + "top_cand_share": 0.06323185011709602, + "frac_green": 0.02606201171875, + "hop_green": [ + 0.162109375, + 0.0439453125, + 0.0009765625, + 0.00048828125, + 0.0009765625, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": -0.0516357421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.165930322115543e-29, + "Q_max": 0.9360631704330444, + "Q_spread": 0.9360631704330444, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.05427815020084381 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.013427734375, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7265625, + "cand_all_green": 0.0, + "top_cand_share": 0.01818181818181818, + "frac_green": 0.013427734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.009765625, + 0.0, + 0.05224609375, + 0.04541015625 + ], + "hop_rise": 0.02685546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.04337342828512192, + "Q_spread": 0.04337342828512192, + "argmax": 116, + "argmax_is_green": true, + "q_of_greenless": 3.9107882912503555e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0184326171875, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.578125, + "cand_all_green": 0.0, + "top_cand_share": 0.046357615894039736, + "frac_green": 0.0184326171875, + "hop_green": [ + 0.0, + 0.0, + 0.00439453125, + 0.0068359375, + 0.01416015625, + 0.02978515625, + 0.048828125, + 0.04345703125 + ], + "hop_rise": 0.03125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.07390878391113e-20, + "Q_max": 0.13991853594779968, + "Q_spread": 0.13991853594779968, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.014133017510175705 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.3098228868766455e-07, + "Q_spread": 3.3098228868766455e-07, + "argmax": 3, + "argmax_is_green": false, + "q_of_greenless": 3.3098228868766455e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00408935546875, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.029850746268656716, + "frac_green": 0.00408935546875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.01513671875, + 0.017578125 + ], + "hop_rise": 0.0081787109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.021921638399362564, + "Q_spread": 0.021921638399362564, + "argmax": 19, + "argmax_is_green": true, + "q_of_greenless": 0.016050413250923157 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0042724609375, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.140625, + "cand_all_green": 0.0, + "top_cand_share": 0.3142857142857143, + "frac_green": 0.0042724609375, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00439453125, + 0.0029296875, + 0.0068359375, + 0.0087890625, + 0.00927734375 + ], + "hop_rise": 0.00537109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21100786328315735, + "Q_spread": 0.21100786328315735, + "argmax": 66, + "argmax_is_green": true, + "q_of_greenless": 0.013383802026510239 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.00024659704649820924, + "Q_spread": 0.00024659704649820924, + "argmax": 10, + "argmax_is_green": false, + "q_of_greenless": 0.00024659704649820924 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.21673583984375, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009856378484933821, + "frac_green": 0.21673583984375, + "hop_green": [ + 0.7001953125, + 0.396484375, + 0.2265625, + 0.15087890625, + 0.0703125, + 0.080078125, + 0.0810546875, + 0.0283203125 + ], + "hop_rise": -0.3035888671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.01606835424900055, + "Q_max": 0.8620303869247437, + "Q_spread": 0.8459620475769043, + "argmax": 102, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01727294921875, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.625, + "cand_all_green": 0.0, + "top_cand_share": 0.04240282685512368, + "frac_green": 0.01727294921875, + "hop_green": [ + 0.07568359375, + 0.02099609375, + 0.0087890625, + 0.021484375, + 0.00341796875, + 0.00439453125, + 0.00341796875, + 0.0 + ], + "hop_rise": -0.0289306640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.0578571684901877e-33, + "Q_max": 0.5977671146392822, + "Q_spread": 0.5977671146392822, + "argmax": 42, + "argmax_is_green": true, + "q_of_greenless": 0.04251008480787277 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.006103515625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.01, + "frac_green": 0.006103515625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.048828125, + 0.0 + ], + "hop_rise": 0.01220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.923361216074263e-35, + "Q_max": 0.018702391535043716, + "Q_spread": 0.018702391535043716, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": 5.481455289668702e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.033447265625, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.53125, + "cand_all_green": 0.0, + "top_cand_share": 0.025547445255474453, + "frac_green": 0.033447265625, + "hop_green": [ + 0.0, + 0.005859375, + 0.01513671875, + 0.04052734375, + 0.05859375, + 0.05908203125, + 0.04150390625, + 0.046875 + ], + "hop_rise": 0.0361328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.833088136732342e-20, + "Q_max": 0.17516286671161652, + "Q_spread": 0.17516286671161652, + "argmax": 108, + "argmax_is_green": true, + "q_of_greenless": 3.0182609407347627e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 1.5156671751004325e-10, + "Q_spread": 1.5156671751004325e-10, + "argmax": 1, + "argmax_is_green": false, + "q_of_greenless": 1.5156671751004325e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00018310546875, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0234375, + "cand_all_green": 0.0, + "top_cand_share": 0.3333333333333333, + "frac_green": 0.00018310546875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.0 + ], + "hop_rise": 0.0003662109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01985829323530197, + "Q_spread": 0.01985829323530197, + "argmax": 116, + "argmax_is_green": true, + "q_of_greenless": 0.009058521129190922 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00897216796875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.19047619047619047, + "frac_green": 0.00897216796875, + "hop_green": [ + 0.0, + 0.0009765625, + 0.00439453125, + 0.01025390625, + 0.0087890625, + 0.01611328125, + 0.0146484375, + 0.0166015625 + ], + "hop_rise": 0.0101318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.3072814643383026, + "Q_spread": 0.3072814643383026, + "argmax": 26, + "argmax_is_green": true, + "q_of_greenless": 0.029965028166770935 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 5.019014861318283e-05, + "Q_spread": 5.019014861318283e-05, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 5.019014861318283e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2059326171875, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.01037344398340249, + "frac_green": 0.2059326171875, + "hop_green": [ + 0.6826171875, + 0.3828125, + 0.20556640625, + 0.138671875, + 0.0634765625, + 0.07666015625, + 0.07470703125, + 0.02294921875 + ], + "hop_rise": -0.29296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.125977345557306e-13, + "Q_max": 0.8822919726371765, + "Q_spread": 0.8822919726371765, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": 0.0008873651386238635 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01806640625, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.65625, + "cand_all_green": 0.0, + "top_cand_share": 0.04391891891891892, + "frac_green": 0.01806640625, + "hop_green": [ + 0.0810546875, + 0.02392578125, + 0.009765625, + 0.02294921875, + 0.001953125, + 0.0029296875, + 0.001953125, + 0.0 + ], + "hop_rise": -0.03271484375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.5060675367795214e-31, + "Q_max": 0.5709527730941772, + "Q_spread": 0.5709527730941772, + "argmax": 63, + "argmax_is_green": true, + "q_of_greenless": 0.04087265580892563 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0064697265625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.009433962264150943, + "frac_green": 0.0064697265625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0517578125, + 0.0 + ], + "hop_rise": 0.012939453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.018702151253819466, + "Q_spread": 0.018702151253819466, + "argmax": 67, + "argmax_is_green": true, + "q_of_greenless": 8.800782151652253e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02410888671875, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.40625, + "cand_all_green": 0.0, + "top_cand_share": 0.030379746835443037, + "frac_green": 0.02410888671875, + "hop_green": [ + 0.0, + 0.0029296875, + 0.00830078125, + 0.02685546875, + 0.03857421875, + 0.04248046875, + 0.03662109375, + 0.037109375 + ], + "hop_rise": 0.0291748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.673880515174877e-21, + "Q_max": 0.1760268211364746, + "Q_spread": 0.1760268211364746, + "argmax": 25, + "argmax_is_green": true, + "q_of_greenless": 1.5778803117427742e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.3544500510629405e-10, + "Q_spread": 3.3544500510629405e-10, + "argmax": 104, + "argmax_is_green": false, + "q_of_greenless": 3.3544500510629405e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00018310546875, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0234375, + "cand_all_green": 0.0, + "top_cand_share": 0.3333333333333333, + "frac_green": 0.00018310546875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.0 + ], + "hop_rise": 0.0003662109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.763111173313519e-07, + "Q_max": 0.01973309926688671, + "Q_spread": 0.01973242312669754, + "argmax": 40, + "argmax_is_green": true, + "q_of_greenless": 0.007586801424622536 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "root": "demo_106_t0035", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.015384615384615385, + "frac_green": 0.01983642578125, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0009765625, + 0.0, + 0.02978515625, + 0.064453125, + 0.0625 + ], + "hop_rise": 0.0386962890625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.019061341881752014, + "Q_max": 0.08237418532371521, + "Q_spread": 0.0633128434419632, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "root": "demo_99_t0057", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010279001468428781, + "frac_green": 0.04156494140625, + "hop_green": [ + 0.0, + 0.01220703125, + 0.0, + 0.068359375, + 0.06103515625, + 0.060546875, + 0.0625, + 0.06787109375 + ], + "hop_rise": 0.0428466796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.11163482069969177, + "Q_max": 0.1695835292339325, + "Q_spread": 0.05794870853424072, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "root": "demo_143_t0154", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009854014598540146, + "frac_green": 0.167236328125, + "hop_green": [ + 0.0, + 0.06494140625, + 0.18359375, + 0.29052734375, + 0.27587890625, + 0.1474609375, + 0.22119140625, + 0.154296875 + ], + "hop_rise": 0.06494140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_spread": 0.09305314719676971, + "argmax": 94, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "root": "demo_102_t0198", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.011428571428571429, + "frac_green": 0.01068115234375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.05908203125, + 0.0, + 0.02587890625 + ], + "hop_rise": 0.0213623046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.504642619706563e-22, + "Q_max": 0.03459713235497475, + "Q_spread": 0.03459713235497475, + "argmax": 110, + "argmax_is_green": true, + "q_of_greenless": 3.8611986497016915e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "root": "demo_171_t0244", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.015625, + "cand_all_green": 0.0, + "top_cand_share": 0.5, + "frac_green": 0.0001220703125, + "hop_green": [ + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.7732108921773033e-06, + "Q_max": 0.02326813153922558, + "Q_spread": 0.023264357820153236, + "argmax": 123, + "argmax_is_green": true, + "q_of_greenless": 0.009346847422420979 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0101318359375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024096385542168676, + "frac_green": 0.0101318359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01220703125, + 0.01220703125, + 0.00244140625, + 0.01708984375, + 0.037109375 + ], + "hop_rise": 0.01416015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0009374454384669662, + "Q_max": 0.07211869955062866, + "Q_spread": 0.07118125259876251, + "argmax": 127, + "argmax_is_green": true, + "q_of_greenless": 0.018065709620714188 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09515380859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.765625, + "cand_all_green": 0.0, + "top_cand_share": 0.026298909557408594, + "frac_green": 0.09515380859375, + "hop_green": [ + 0.26220703125, + 0.134765625, + 0.12451171875, + 0.05615234375, + 0.07861328125, + 0.05224609375, + 0.0302734375, + 0.0224609375 + ], + "hop_rise": -0.0985107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00019940944912377745, + "Q_max": 0.9406136274337769, + "Q_spread": 0.9404141902923584, + "argmax": 60, + "argmax_is_green": true, + "q_of_greenless": 0.04701278358697891 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01641845703125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.03345724907063197, + "frac_green": 0.01641845703125, + "hop_green": [ + 0.00439453125, + 0.052734375, + 0.0576171875, + 0.01025390625, + 0.0, + 0.00048828125, + 0.005859375, + 0.0 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015772078186273575, + "Q_max": 0.48050427436828613, + "Q_spread": 0.46473219990730286, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.05498268082737923 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0101318359375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024096385542168676, + "frac_green": 0.0101318359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01220703125, + 0.01220703125, + 0.00244140625, + 0.01708984375, + 0.037109375 + ], + "hop_rise": 0.01416015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0009374454384669662, + "Q_max": 0.07211869955062866, + "Q_spread": 0.07118125259876251, + "argmax": 127, + "argmax_is_green": true, + "q_of_greenless": 0.018065709620714188 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09515380859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.765625, + "cand_all_green": 0.0, + "top_cand_share": 0.026298909557408594, + "frac_green": 0.09515380859375, + "hop_green": [ + 0.26220703125, + 0.134765625, + 0.12451171875, + 0.05615234375, + 0.07861328125, + 0.05224609375, + 0.0302734375, + 0.0224609375 + ], + "hop_rise": -0.0985107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00019940944912377745, + "Q_max": 0.9406136274337769, + "Q_spread": 0.9404141902923584, + "argmax": 60, + "argmax_is_green": true, + "q_of_greenless": 0.04701278358697891 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01641845703125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.03345724907063197, + "frac_green": 0.01641845703125, + "hop_green": [ + 0.00439453125, + 0.052734375, + 0.0576171875, + 0.01025390625, + 0.0, + 0.00048828125, + 0.005859375, + 0.0 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015772078186273575, + "Q_max": 0.48050427436828613, + "Q_spread": 0.46473219990730286, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.05498268082737923 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00970458984375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.031446540880503145, + "frac_green": 0.00970458984375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.017578125, + 0.0068359375, + 0.0009765625, + 0.0166015625, + 0.03564453125 + ], + "hop_rise": 0.0106201171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0004440488701220602, + "Q_max": 0.09887169301509857, + "Q_spread": 0.09842764586210251, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": 0.018300766125321388 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1005859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8046875, + "cand_all_green": 0.0, + "top_cand_share": 0.02487864077669903, + "frac_green": 0.1005859375, + "hop_green": [ + 0.28271484375, + 0.15087890625, + 0.140625, + 0.0556640625, + 0.08447265625, + 0.04931640625, + 0.02734375, + 0.013671875 + ], + "hop_rise": -0.11376953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00021297408966347575, + "Q_max": 0.9908179044723511, + "Q_spread": 0.9906049370765686, + "argmax": 41, + "argmax_is_green": true, + "q_of_greenless": 0.04449361562728882 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01702880859375, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.017921146953405017, + "frac_green": 0.01702880859375, + "hop_green": [ + 0.0, + 0.0546875, + 0.06103515625, + 0.009765625, + 0.00048828125, + 0.00390625, + 0.00634765625, + 0.0 + ], + "hop_rise": -0.0286865234375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.022601792588829994, + "Q_max": 0.16994653642177582, + "Q_spread": 0.14734473824501038, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 0.06686937063932419 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00970458984375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8046875, + "cand_all_green": 0.0, + "top_cand_share": 0.025157232704402517, + "frac_green": 0.00970458984375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00732421875, + 0.00830078125, + 0.00244140625, + 0.02099609375, + 0.03857421875 + ], + "hop_rise": 0.0157470703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0004408314707688987, + "Q_max": 0.06097593531012535, + "Q_spread": 0.06053510308265686, + "argmax": 18, + "argmax_is_green": true, + "q_of_greenless": 0.018501631915569305 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0986328125, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.022277227722772276, + "frac_green": 0.0986328125, + "hop_green": [ + 0.30810546875, + 0.13720703125, + 0.12353515625, + 0.05224609375, + 0.07666015625, + 0.04541015625, + 0.0263671875, + 0.01953125 + ], + "hop_rise": -0.11328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00022240701946429908, + "Q_max": 0.9282999038696289, + "Q_spread": 0.9280775189399719, + "argmax": 71, + "argmax_is_green": true, + "q_of_greenless": 0.054910093545913696 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.014892578125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.921875, + "cand_all_green": 0.0, + "top_cand_share": 0.020491803278688523, + "frac_green": 0.014892578125, + "hop_green": [ + 0.0, + 0.048828125, + 0.05615234375, + 0.0078125, + 0.00048828125, + 0.00048828125, + 0.00537109375, + 0.0 + ], + "hop_rise": -0.026611328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.020947592332959175, + "Q_max": 0.14504991471767426, + "Q_spread": 0.12410232424736023, + "argmax": 56, + "argmax_is_green": true, + "q_of_greenless": 0.05914219468832016 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01007080078125, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.030303030303030304, + "frac_green": 0.01007080078125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00927734375, + 0.0107421875, + 0.00341796875, + 0.0234375, + 0.03369140625 + ], + "hop_rise": 0.0155029296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.000509019591845572, + "Q_max": 0.08491256088018417, + "Q_spread": 0.08440354466438293, + "argmax": 115, + "argmax_is_green": true, + "q_of_greenless": 0.014964050613343716 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08929443359375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.734375, + "cand_all_green": 0.0, + "top_cand_share": 0.026657552973342446, + "frac_green": 0.08929443359375, + "hop_green": [ + 0.3076171875, + 0.1103515625, + 0.10009765625, + 0.0458984375, + 0.0625, + 0.0419921875, + 0.02734375, + 0.0185546875 + ], + "hop_rise": -0.1033935546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0001925603864947334, + "Q_max": 0.9327669739723206, + "Q_spread": 0.9325743913650513, + "argmax": 42, + "argmax_is_green": true, + "q_of_greenless": 0.042986854910850525 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01531982421875, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9375, + "cand_all_green": 0.0, + "top_cand_share": 0.01593625498007968, + "frac_green": 0.01531982421875, + "hop_green": [ + 0.0, + 0.05078125, + 0.056640625, + 0.01171875, + 0.0, + 0.00146484375, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0289306640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.02585091069340706, + "Q_max": 0.1552058607339859, + "Q_spread": 0.12935495376586914, + "argmax": 126, + "argmax_is_green": true, + "q_of_greenless": 0.04840202257037163 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0108642578125, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028089887640449437, + "frac_green": 0.0108642578125, + "hop_green": [ + 0.0, + 0.0, + 0.00634765625, + 0.0029296875, + 0.00048828125, + 0.01318359375, + 0.01220703125, + 0.0517578125 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014911642065271735, + "Q_max": 0.05342011898756027, + "Q_spread": 0.05192895606160164, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.01908215507864952 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.159912109375, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.009541984732824428, + "frac_green": 0.159912109375, + "hop_green": [ + 0.0, + 0.07861328125, + 0.14013671875, + 0.224609375, + 0.08349609375, + 0.26220703125, + 0.2822265625, + 0.2080078125 + ], + "hop_rise": 0.09814453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014558101538568735, + "Q_max": 0.27829867601394653, + "Q_spread": 0.27684286236763, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.0014558101538568735 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.008544921875, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.02142857142857143, + "frac_green": 0.008544921875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0009765625, + 0.00927734375, + 0.01220703125, + 0.0458984375 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.004533246159553528, + "Q_max": 0.046014029532670975, + "Q_spread": 0.04148078337311745, + "argmax": 112, + "argmax_is_green": true, + "q_of_greenless": 0.015510505065321922 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8515625, + "cand_all_green": 0.0, + "top_cand_share": 0.028985507246376812, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.0, + 0.0, + 0.00537109375, + 0.00341796875, + 0.00048828125, + 0.013671875, + 0.0126953125, + 0.0654296875 + ], + "hop_rise": 0.0208740234375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0015533649129793048, + "Q_max": 0.05688374862074852, + "Q_spread": 0.05533038452267647, + "argmax": 102, + "argmax_is_green": true, + "q_of_greenless": 0.01922977715730667 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.16375732421875, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.008945210585165859, + "frac_green": 0.16375732421875, + "hop_green": [ + 0.00048828125, + 0.08056640625, + 0.1396484375, + 0.22998046875, + 0.08740234375, + 0.265625, + 0.2900390625, + 0.21630859375 + ], + "hop_rise": 0.1021728515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.13952432572841644, + "Q_max": 0.25942450761795044, + "Q_spread": 0.119900181889534, + "argmax": 36, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.008544921875, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9375, + "cand_all_green": 0.0, + "top_cand_share": 0.02142857142857143, + "frac_green": 0.008544921875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.01171875, + 0.017578125, + 0.0390625 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.004907257854938507, + "Q_max": 0.04317096248269081, + "Q_spread": 0.038263704627752304, + "argmax": 109, + "argmax_is_green": true, + "q_of_greenless": 0.01715206727385521 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0120849609375, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.025252525252525252, + "frac_green": 0.0120849609375, + "hop_green": [ + 0.0, + 0.0, + 0.00341796875, + 0.00341796875, + 0.0, + 0.013671875, + 0.0146484375, + 0.0615234375 + ], + "hop_rise": 0.020751953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0011750860139727592, + "Q_max": 0.056373901665210724, + "Q_spread": 0.05519881471991539, + "argmax": 111, + "argmax_is_green": true, + "q_of_greenless": 0.021753884851932526 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.16290283203125, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009366804046459348, + "frac_green": 0.16290283203125, + "hop_green": [ + 0.0, + 0.083984375, + 0.13671875, + 0.23046875, + 0.080078125, + 0.26513671875, + 0.29150390625, + 0.21533203125 + ], + "hop_rise": 0.1002197265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.13944321870803833, + "Q_max": 0.2593776285648346, + "Q_spread": 0.11993440985679626, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00836181640625, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.021897810218978103, + "frac_green": 0.00836181640625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0009765625, + 0.00634765625, + 0.01171875, + 0.04736328125 + ], + "hop_rise": 0.0164794921875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0054939063265919685, + "Q_max": 0.0461905375123024, + "Q_spread": 0.040696632117033005, + "argmax": 86, + "argmax_is_green": true, + "q_of_greenless": 0.013945415616035461 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0098876953125, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.018518518518518517, + "frac_green": 0.0098876953125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00927734375, + 0.001953125, + 0.0, + 0.00439453125, + 0.0634765625 + ], + "hop_rise": 0.01513671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0025416151620447636, + "Q_max": 0.0513761043548584, + "Q_spread": 0.04883448779582977, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 0.0034241038374602795 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.56170654296875, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010648701510377051, + "frac_green": 0.56170654296875, + "hop_green": [ + 0.884765625, + 0.71044921875, + 0.65478515625, + 0.5712890625, + 0.48828125, + 0.46533203125, + 0.38330078125, + 0.33544921875 + ], + "hop_rise": -0.2872314453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.09469607472419739, + "Q_max": 0.9999012351036072, + "Q_spread": 0.9052051305770874, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08221435546875, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014847809948032665, + "frac_green": 0.08221435546875, + "hop_green": [ + 0.01220703125, + 0.1064453125, + 0.1748046875, + 0.09130859375, + 0.14794921875, + 0.052734375, + 0.056640625, + 0.015625 + ], + "hop_rise": -0.0279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.5286317395512015e-06, + "Q_max": 0.30794060230255127, + "Q_spread": 0.3079380691051483, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 2.5286317395512015e-06 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.022857142857142857, + "frac_green": 0.01068115234375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01171875, + 0.00439453125, + 0.0, + 0.0048828125, + 0.064453125 + ], + "hop_rise": 0.0155029296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015959888696670532, + "Q_max": 0.05745534598827362, + "Q_spread": 0.04149545729160309, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5657958984375, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010679611650485437, + "frac_green": 0.5657958984375, + "hop_green": [ + 0.8896484375, + 0.71142578125, + 0.66259765625, + 0.58154296875, + 0.48974609375, + 0.47119140625, + 0.38525390625, + 0.3349609375 + ], + "hop_rise": -0.291015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.18542072176933289, + "Q_max": 0.9998902082443237, + "Q_spread": 0.8144694566726685, + "argmax": 46, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08673095703125, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.013370865587614356, + "frac_green": 0.08673095703125, + "hop_green": [ + 0.0146484375, + 0.11572265625, + 0.17578125, + 0.10009765625, + 0.1650390625, + 0.05078125, + 0.0556640625, + 0.01611328125 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.1254429817199707, + "Q_max": 0.3364698886871338, + "Q_spread": 0.21102690696716309, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00933837890625, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.026143790849673203, + "frac_green": 0.00933837890625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00439453125, + 0.00146484375, + 0.0, + 0.00341796875, + 0.0654296875 + ], + "hop_rise": 0.0164794921875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.016007084399461746, + "Q_max": 0.061455462127923965, + "Q_spread": 0.04544837772846222, + "argmax": 112, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.58343505859375, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010147504969139031, + "frac_green": 0.58343505859375, + "hop_green": [ + 0.876953125, + 0.7333984375, + 0.68603515625, + 0.59814453125, + 0.509765625, + 0.49755859375, + 0.41015625, + 0.35546875 + ], + "hop_rise": -0.2803955078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.10745294392108917, + "Q_max": 0.99985271692276, + "Q_spread": 0.892399787902832, + "argmax": 19, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.092041015625, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.013925729442970823, + "frac_green": 0.092041015625, + "hop_green": [ + 0.0107421875, + 0.11083984375, + 0.17724609375, + 0.1142578125, + 0.18359375, + 0.0576171875, + 0.06689453125, + 0.01513671875 + ], + "hop_rise": -0.0224609375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.04944809898734093, + "Q_max": 0.2951880693435669, + "Q_spread": 0.24573996663093567, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00909423828125, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.020134228187919462, + "frac_green": 0.00909423828125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0048828125, + 0.00048828125, + 0.0, + 0.00341796875, + 0.06396484375 + ], + "hop_rise": 0.0157470703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015934905037283897, + "Q_max": 0.05053364112973213, + "Q_spread": 0.034598737955093384, + "argmax": 56, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5809326171875, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01029628073124606, + "frac_green": 0.5809326171875, + "hop_green": [ + 0.88330078125, + 0.72607421875, + 0.68017578125, + 0.59326171875, + 0.50732421875, + 0.49462890625, + 0.40625, + 0.3564453125 + ], + "hop_rise": -0.279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.06198078393936157, + "Q_max": 0.9999346733093262, + "Q_spread": 0.9379538893699646, + "argmax": 32, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08660888671875, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.015503875968992248, + "frac_green": 0.08660888671875, + "hop_green": [ + 0.0087890625, + 0.1103515625, + 0.17919921875, + 0.10791015625, + 0.16357421875, + 0.04833984375, + 0.05615234375, + 0.0185546875 + ], + "hop_rise": -0.0299072265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.1281203031539917, + "Q_max": 0.2960023581981659, + "Q_spread": 0.1678820550441742, + "argmax": 35, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "root": "demo_143_t0154", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009854014598540146, + "frac_green": 0.167236328125, + "hop_green": [ + 0.0, + 0.06494140625, + 0.18359375, + 0.29052734375, + 0.27587890625, + 0.1474609375, + 0.22119140625, + 0.154296875 + ], + "hop_rise": 0.06494140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_spread": 0.09305314719676971, + "argmax": 94, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.255859375, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011927480916030535, + "frac_green": 0.255859375, + "hop_green": [ + 0.005859375, + 0.1103515625, + 0.3359375, + 0.21728515625, + 0.43017578125, + 0.41064453125, + 0.26123046875, + 0.275390625 + ], + "hop_rise": 0.177001953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "Q_spread": 0.36739271879196167, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_198", + "frame": 166, + "root": "demo_198_t0166", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.051513671875, + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.03317535545023697, + "frac_green": 0.051513671875, + "hop_green": [ + 0.001953125, + 0.12548828125, + 0.11962890625, + 0.05029296875, + 0.04296875, + 0.01513671875, + 0.0126953125, + 0.0439453125 + ], + "hop_rise": -0.045654296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.769107858417556e-05, + "Q_max": 0.38457581400871277, + "Q_spread": 0.3845081329345703, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.017471471801400185 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_64", + "frame": 192, + "root": "demo_64_t0192", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.05419921875, + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028153153153153154, + "frac_green": 0.05419921875, + "hop_green": [ + 0.24755859375, + 0.0859375, + 0.0263671875, + 0.0224609375, + 0.0166015625, + 0.009765625, + 0.01123046875, + 0.013671875 + ], + "hop_rise": -0.082763671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0006882615271024406, + "Q_max": 0.704879105091095, + "Q_spread": 0.7041908502578735, + "argmax": 86, + "argmax_is_green": true, + "q_of_greenless": 0.11513863503932953 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_153", + "frame": 112, + "root": "demo_153_t0112", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.15411376953125, + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009900990099009901, + "frac_green": 0.15411376953125, + "hop_green": [ + 0.0166015625, + 0.12255859375, + 0.18701171875, + 0.25634765625, + 0.2099609375, + 0.22705078125, + 0.14697265625, + 0.06640625 + ], + "hop_rise": 0.0169677734375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.312361844924453e-07, + "Q_max": 0.32301434874534607, + "Q_spread": 0.3230136036872864, + "argmax": 77, + "argmax_is_green": true, + "q_of_greenless": 0.008339659310877323 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_6", + "frame": 180, + "root": "demo_6_t0180", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1658935546875, + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009565857247976454, + "frac_green": 0.1658935546875, + "hop_green": [ + 0.08740234375, + 0.2314453125, + 0.4189453125, + 0.25, + 0.0654296875, + 0.12109375, + 0.060546875, + 0.09228515625 + ], + "hop_rise": -0.162109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.3845299482345581, + "Q_max": 0.5868167877197266, + "Q_spread": 0.20228683948516846, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0074462890625, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.01639344262295082, + "frac_green": 0.0074462890625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0009765625, + 0.00146484375, + 0.00048828125, + 0.056640625 + ], + "hop_rise": 0.014892578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.965724656358361e-05, + "Q_max": 0.04319200664758682, + "Q_spread": 0.043142348527908325, + "argmax": 93, + "argmax_is_green": true, + "q_of_greenless": 0.0032913843169808388 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01348876953125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.03167420814479638, + "frac_green": 0.01348876953125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.06396484375, + 0.00048828125, + 0.0341796875, + 0.0078125, + 0.00146484375 + ], + "hop_rise": -0.0050048828125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.04491756856441498, + "Q_max": 0.09216669201850891, + "Q_spread": 0.04724912345409393, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00616455078125, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.019801980198019802, + "frac_green": 0.00616455078125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.00048828125, + 0.04736328125 + ], + "hop_rise": 0.0123291015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.6458745196578093e-05, + "Q_max": 0.026393426582217216, + "Q_spread": 0.02636696770787239, + "argmax": 41, + "argmax_is_green": true, + "q_of_greenless": 0.010613691061735153 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.11474609375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.025, + "frac_green": 0.11474609375, + "hop_green": [ + 0.27392578125, + 0.15185546875, + 0.1103515625, + 0.09326171875, + 0.09521484375, + 0.083984375, + 0.06787109375, + 0.04150390625 + ], + "hop_rise": -0.085205078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0008276841836050153, + "Q_max": 0.8403615355491638, + "Q_spread": 0.8395338654518127, + "argmax": 22, + "argmax_is_green": true, + "q_of_greenless": 0.028812099248170853 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01470947265625, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.05394190871369295, + "frac_green": 0.01470947265625, + "hop_green": [ + 0.001953125, + 0.00146484375, + 0.0009765625, + 0.06640625, + 0.00244140625, + 0.03466796875, + 0.0087890625, + 0.0009765625 + ], + "hop_rise": -0.0059814453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.04604080319404602, + "Q_max": 0.23029959201812744, + "Q_spread": 0.18425878882408142, + "argmax": 59, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02105712890625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028985507246376812, + "frac_green": 0.02105712890625, + "hop_green": [ + 0.0, + 0.02099609375, + 0.01171875, + 0.0390625, + 0.01513671875, + 0.0419921875, + 0.0302734375, + 0.00927734375 + ], + "hop_rise": 0.0062255859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.0167299175664084e-07, + "Q_max": 0.12913301587104797, + "Q_spread": 0.12913261353969574, + "argmax": 1, + "argmax_is_green": true, + "q_of_greenless": 0.02041761204600334 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.94027550238585e-15, + "Q_max": 7.936003498798527e-08, + "Q_spread": 7.936003498798527e-08, + "argmax": 85, + "argmax_is_green": false, + "q_of_greenless": 7.936003498798527e-08 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00830078125, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.051470588235294115, + "frac_green": 0.00830078125, + "hop_green": [ + 0.0, + 0.0, + 0.00146484375, + 0.001953125, + 0.00146484375, + 0.00146484375, + 0.05908203125, + 0.0009765625 + ], + "hop_rise": 0.014892578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0842872377736512e-08, + "Q_max": 0.07263443619012833, + "Q_spread": 0.07263442873954773, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.012364218942821026 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01129150390625, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.734375, + "cand_all_green": 0.0, + "top_cand_share": 0.02702702702702703, + "frac_green": 0.01129150390625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0283203125, + 0.0107421875, + 0.00341796875, + 0.0078125, + 0.0400390625 + ], + "hop_rise": 0.0084228515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.675629151686735e-07, + "Q_max": 0.08670267462730408, + "Q_spread": 0.08670200407505035, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": 0.01302293874323368 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00885009765625, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.020689655172413793, + "frac_green": 0.00885009765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0078125, + 0.0068359375, + 0.0029296875, + 0.0205078125, + 0.03271484375 + ], + "hop_rise": 0.0137939453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0002518524706829339, + "Q_max": 0.07879512012004852, + "Q_spread": 0.0785432681441307, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": 0.013751080259680748 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0841064453125, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.6796875, + "cand_all_green": 0.0, + "top_cand_share": 0.029753265602322207, + "frac_green": 0.0841064453125, + "hop_green": [ + 0.265625, + 0.11962890625, + 0.10205078125, + 0.04248046875, + 0.06005859375, + 0.041015625, + 0.02587890625, + 0.01611328125 + ], + "hop_rise": -0.0966796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00017631723312661052, + "Q_max": 0.9497786164283752, + "Q_spread": 0.9496023058891296, + "argmax": 13, + "argmax_is_green": true, + "q_of_greenless": 0.03984104096889496 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01593017578125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.90625, + "cand_all_green": 0.0, + "top_cand_share": 0.01532567049808429, + "frac_green": 0.01593017578125, + "hop_green": [ + 0.0, + 0.05322265625, + 0.05810546875, + 0.0078125, + 0.0, + 0.00390625, + 0.00439453125, + 0.0 + ], + "hop_rise": -0.0277099609375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.023758510127663612, + "Q_max": 0.1580413579940796, + "Q_spread": 0.13428284227848053, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": 0.06285262107849121 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02978515625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.6953125, + "cand_all_green": 0.0, + "top_cand_share": 0.018442622950819672, + "frac_green": 0.02978515625, + "hop_green": [ + 0.0, + 0.0390625, + 0.02197265625, + 0.03662109375, + 0.0595703125, + 0.0322265625, + 0.0244140625, + 0.0244140625 + ], + "hop_rise": 0.0107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0457875962165417e-06, + "Q_max": 0.1604074239730835, + "Q_spread": 0.16040538251399994, + "argmax": 91, + "argmax_is_green": true, + "q_of_greenless": 0.07561797648668289 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.377706828767244e-15, + "Q_max": 4.3708237029704833e-10, + "Q_spread": 4.3707798491610106e-10, + "argmax": 14, + "argmax_is_green": false, + "q_of_greenless": 4.3708237029704833e-10 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0067138671875, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.390625, + "cand_all_green": 0.0, + "top_cand_share": 0.06363636363636363, + "frac_green": 0.0067138671875, + "hop_green": [ + 0.0, + 0.00048828125, + 0.00439453125, + 0.001953125, + 0.001953125, + 0.01806640625, + 0.01806640625, + 0.0087890625 + ], + "hop_rise": 0.010009765625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.068455382366665e-05, + "Q_max": 0.09659223258495331, + "Q_spread": 0.09655154496431351, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": 0.018399706110358238 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.07366943359375, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0115990057995029, + "frac_green": 0.07366943359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.095703125, + 0.10888671875, + 0.09375, + 0.1328125, + 0.158203125 + ], + "hop_rise": 0.0994873046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.061933327466249466, + "Q_max": 0.16188396513462067, + "Q_spread": 0.0999506413936615, + "argmax": 113, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1397705078125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.013100436681222707, + "frac_green": 0.1397705078125, + "hop_green": [ + 0.00048828125, + 0.19921875, + 0.2265625, + 0.2529296875, + 0.17626953125, + 0.1484375, + 0.06103515625, + 0.05322265625 + ], + "hop_rise": -0.06005859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.31073206663131714, + "Q_max": 0.47339746356010437, + "Q_spread": 0.16266539692878723, + "argmax": 65, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00927734375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7578125, + "cand_all_green": 0.0, + "top_cand_share": 0.02631578947368421, + "frac_green": 0.00927734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0146484375, + 0.00634765625, + 0.00146484375, + 0.015625, + 0.0361328125 + ], + "hop_rise": 0.01123046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0003463784232735634, + "Q_max": 0.09087172150611877, + "Q_spread": 0.09052534401416779, + "argmax": 28, + "argmax_is_green": true, + "q_of_greenless": 0.019627872854471207 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09814453125, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.796875, + "cand_all_green": 0.0, + "top_cand_share": 0.0236318407960199, + "frac_green": 0.09814453125, + "hop_green": [ + 0.32421875, + 0.14404296875, + 0.123046875, + 0.046875, + 0.06591796875, + 0.0419921875, + 0.0244140625, + 0.0146484375 + ], + "hop_rise": -0.122802734375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0001964116672752425, + "Q_max": 0.9030880331993103, + "Q_spread": 0.9028916358947754, + "argmax": 50, + "argmax_is_green": true, + "q_of_greenless": 0.04863034188747406 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01544189453125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.890625, + "cand_all_green": 0.0, + "top_cand_share": 0.019762845849802372, + "frac_green": 0.01544189453125, + "hop_green": [ + 0.0, + 0.05224609375, + 0.05517578125, + 0.01025390625, + 0.0, + 0.0009765625, + 0.0048828125, + 0.0 + ], + "hop_rise": -0.0279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.01723499968647957, + "Q_max": 0.1639276146888733, + "Q_spread": 0.14669261872768402, + "argmax": 52, + "argmax_is_green": true, + "q_of_greenless": 0.0683753490447998 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02825927734375, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.703125, + "cand_all_green": 0.0, + "top_cand_share": 0.019438444924406047, + "frac_green": 0.02825927734375, + "hop_green": [ + 0.0, + 0.03857421875, + 0.017578125, + 0.0361328125, + 0.0576171875, + 0.03125, + 0.02197265625, + 0.02294921875 + ], + "hop_rise": 0.0103759765625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0011434555053710938, + "Q_max": 0.15640270709991455, + "Q_spread": 0.15525925159454346, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.09031453728675842 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.670417380778452e-16, + "Q_max": 3.4102917711997804e-10, + "Q_spread": 3.410287052751926e-10, + "argmax": 1, + "argmax_is_green": false, + "q_of_greenless": 3.4102917711997804e-10 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00677490234375, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.359375, + "cand_all_green": 0.0, + "top_cand_share": 0.036036036036036036, + "frac_green": 0.00677490234375, + "hop_green": [ + 0.0, + 0.0, + 0.00244140625, + 0.00341796875, + 0.00341796875, + 0.01611328125, + 0.0166015625, + 0.01220703125 + ], + "hop_rise": 0.0106201171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0006386518361978233, + "Q_max": 0.0793638601899147, + "Q_spread": 0.07872521132230759, + "argmax": 23, + "argmax_is_green": true, + "q_of_greenless": 0.01329739112406969 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0738525390625, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011570247933884297, + "frac_green": 0.0738525390625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.09716796875, + 0.1083984375, + 0.09765625, + 0.1328125, + 0.15478515625 + ], + "hop_rise": 0.09912109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.06170738488435745, + "Q_max": 0.16389822959899902, + "Q_spread": 0.10219084471464157, + "argmax": 14, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.141845703125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.012908777969018933, + "frac_green": 0.141845703125, + "hop_green": [ + 0.0, + 0.20166015625, + 0.22216796875, + 0.24658203125, + 0.1826171875, + 0.14794921875, + 0.0673828125, + 0.06640625 + ], + "hop_rise": -0.051513671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0001921014627441764, + "Q_max": 0.4584195613861084, + "Q_spread": 0.4582274556159973, + "argmax": 52, + "argmax_is_green": true, + "q_of_greenless": 0.011139456182718277 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_CENSUS_xdev.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_CENSUS_xdev.json new file mode 100644 index 0000000000000000000000000000000000000000..8270b636da2581fec15bfd6cbad10b5dfe1a874f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_CENSUS_xdev.json @@ -0,0 +1,10025 @@ +{ + "generated_by": "scripts/viz/cand_green_census.py", + "note": "Candidate-level census over EVERY flagship-setting failure-root trace on disk. GREEN == c_k >= 0.5 at T=1; hop_rise = mean green fraction over the second half of the hops minus the first half. Additive: CAND_GREEN_STATS.json is not modified.", + "setting": "L40best_b0.95_L8_N128_P16", + "tasks": [ + "square_expert_play", + "two_piece_expert_play" + ], + "n_draws": 202, + "n_distinct_roots": 46, + "skipped": {}, + "verdict": { + "square_expert_play": { + "n_roots_in_census": 21, + "n_roots_in_published_stats": 3, + "shipped_split_pick": "demo_36_t0056", + "shipped_cand_any_green_mean": 0.3857421875, + "roots_with_lower_cand_any_green": [ + "demo_110_t0104", + "demo_150_t0125", + "demo_73_t0114", + "demo_126_t0123", + "demo_151_t0194", + "demo_54_t0122", + "demo_88_t0144", + "demo_198_t0110", + "demo_102_t0145", + "demo_221_t0249", + "demo_84_t0390" + ], + "argmin_cand_any_green": "demo_110_t0104", + "argmin_value": 0.0, + "ranking_top5": [ + [ + "demo_110_t0104", + 0.0, + 1 + ], + [ + "demo_150_t0125", + 0.0, + 5 + ], + [ + "demo_73_t0114", + 0.0, + 4 + ], + [ + "demo_126_t0123", + 0.0, + 4 + ], + [ + "demo_151_t0194", + 0.0039, + 4 + ] + ], + "argmax_hop_rise": "demo_13_t0048", + "argmax_hop_rise_value": 0.143646240234375, + "hop_rise_top5": [ + [ + "demo_13_t0048", + 0.1436, + 4 + ], + [ + "demo_36_t0056", + 0.1412, + 8 + ], + [ + "demo_212_t0141", + 0.0311, + 10 + ], + [ + "demo_164_t0093", + 0.0155, + 5 + ], + [ + "demo_84_t0390", + 0.0112, + 1 + ] + ], + "spearman_fracgreen_vs_candanygreen": 0.9089097753751246, + "replicate_spread": { + "n_roots_with_multiple_plan_seeds": 0, + "max_cand_any_green_range": null, + "per_root": [] + } + }, + "two_piece_expert_play": { + "n_roots_in_census": 25, + "n_roots_in_published_stats": 8, + "shipped_split_pick": "demo_18_t0096", + "shipped_cand_any_green_mean": 0.78125, + "roots_with_lower_cand_any_green": [ + "demo_189_t0338", + "demo_171_t0244", + "demo_83_t0280", + "demo_159_t0413" + ], + "argmin_cand_any_green": "demo_189_t0338", + "argmin_value": 0.0, + "ranking_top5": [ + [ + "demo_189_t0338", + 0.0, + 3 + ], + [ + "demo_171_t0244", + 0.0156, + 1 + ], + [ + "demo_83_t0280", + 0.5677, + 3 + ], + [ + "demo_159_t0413", + 0.7197, + 8 + ], + [ + "demo_18_t0096", + 0.7812, + 16 + ] + ], + "argmax_hop_rise": "demo_80_t0025", + "argmax_hop_rise_value": 0.137939453125, + "hop_rise_top5": [ + [ + "demo_80_t0025", + 0.1379, + 6 + ], + [ + "demo_174_t0479", + 0.1015, + 4 + ], + [ + "demo_129_t0084", + 0.0791, + 3 + ], + [ + "demo_19_t0067", + 0.069, + 3 + ], + [ + "demo_143_t0154", + 0.0649, + 2 + ] + ], + "spearman_fracgreen_vs_candanygreen": 0.6979877597580197, + "replicate_spread": { + "n_roots_with_multiple_plan_seeds": 0, + "max_cand_any_green_range": null, + "per_root": [] + } + } + }, + "roots": { + "square_expert_play/demo_36_t0056": { + "task": "square_expert_play", + "root": "demo_36_t0056", + "episode": "demo_36", + "frame": 56, + "n_draws": 8, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz", + "stitchviz_split", + "stitchviz_split2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_36", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + "cand_any_green_min": 0.3203125, + "cand_any_green_mean": 0.3857421875, + "cand_any_green_max": 0.4609375, + "cand_any_green_range": 0.140625, + "hop_rise_min": 0.08935546875, + "hop_rise_mean": 0.141204833984375, + "hop_rise_max": 0.16748046875 + }, + "square_expert_play/demo_110_t0104": { + "task": "square_expert_play", + "root": "demo_110_t0104", + "episode": "demo_110", + "frame": 104, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "root": "demo_110_t0104", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 6.59219892895635e-07, + "Q_spread": 6.59219892895635e-07, + "argmax": 7, + "argmax_is_green": false, + "q_of_greenless": 6.59219892895635e-07 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_102_t0145": { + "task": "square_expert_play", + "root": "demo_102_t0145", + "episode": "demo_102", + "frame": 145, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "root": "demo_102_t0145", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.045454545454545456, + "frac_green": 0.0013427734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0029296875, + 0.0, + 0.0078125 + ], + "hop_rise": 0.002685546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.024722615256905556, + "Q_spread": 0.024722615256905556, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": 0.013053152710199356 + }, + "cand_any_green_min": 0.171875, + "cand_any_green_mean": 0.171875, + "cand_any_green_max": 0.171875, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.002685546875, + "hop_rise_mean": 0.002685546875, + "hop_rise_max": 0.002685546875 + }, + "square_expert_play/demo_160_t0165": { + "task": "square_expert_play", + "root": "demo_160_t0165", + "episode": "demo_160", + "frame": 165, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "root": "demo_160_t0165", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.703125, + "cand_all_green": 0.0, + "top_cand_share": 0.020618556701030927, + "frac_green": 0.00592041015625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.04345703125, + 0.0, + 0.0, + 0.0, + 0.00390625 + ], + "hop_rise": -0.0098876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.04654752463102341, + "Q_spread": 0.04654752463102341, + "argmax": 103, + "argmax_is_green": true, + "q_of_greenless": 8.725493535166606e-05 + }, + "cand_any_green_min": 0.703125, + "cand_any_green_mean": 0.703125, + "cand_any_green_max": 0.703125, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.0098876953125, + "hop_rise_mean": -0.0098876953125, + "hop_rise_max": -0.0098876953125 + }, + "square_expert_play/demo_84_t0390": { + "task": "square_expert_play", + "root": "demo_84_t0390", + "episode": "demo_84", + "frame": 390, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "root": "demo_84_t0390", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.34375, + "cand_all_green": 0.0, + "top_cand_share": 0.0593607305936073, + "frac_green": 0.0267333984375, + "hop_green": [ + 0.0, + 0.025390625, + 0.025390625, + 0.03369140625, + 0.0322265625, + 0.0341796875, + 0.03076171875, + 0.0322265625 + ], + "hop_rise": 0.01123046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "Q_spread": 0.2687058746814728, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": 0.03616061061620712 + }, + "cand_any_green_min": 0.34375, + "cand_any_green_mean": 0.34375, + "cand_any_green_max": 0.34375, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.01123046875, + "hop_rise_mean": 0.01123046875, + "hop_rise_max": 0.01123046875 + }, + "square_expert_play/demo_221_t0249": { + "task": "square_expert_play", + "root": "demo_221_t0249", + "episode": "demo_221", + "frame": 249, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "root": "demo_221_t0249", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.07407407407407407, + "frac_green": 0.00164794921875, + "hop_green": [ + 0.0, + 0.0, + 0.0126953125, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": -0.0030517578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.1423076102801133e-05, + "Q_max": 0.06528710573911667, + "Q_spread": 0.06527568399906158, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.03142651170492172 + }, + "cand_any_green_min": 0.171875, + "cand_any_green_mean": 0.171875, + "cand_any_green_max": 0.171875, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.0030517578125, + "hop_rise_mean": -0.0030517578125, + "hop_rise_max": -0.0030517578125 + }, + "square_expert_play/demo_198_t0110": { + "task": "square_expert_play", + "root": "demo_198_t0110", + "episode": "demo_198", + "frame": 110, + "n_draws": 11, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + "cand_any_green_min": 0.1328125, + "cand_any_green_mean": 0.1534090909090909, + "cand_any_green_max": 0.1640625, + "cand_any_green_range": 0.03125, + "hop_rise_min": 0.00537109375, + "hop_rise_mean": 0.009299538352272728, + "hop_rise_max": 0.0111083984375 + }, + "square_expert_play/demo_54_t0122": { + "task": "square_expert_play", + "root": "demo_54_t0122", + "episode": "demo_54", + "frame": 122, + "n_draws": 11, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.01065340909090909, + "cand_any_green_max": 0.0703125, + "cand_any_green_range": 0.0703125, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0001775568181818182, + "hop_rise_max": 0.001220703125 + }, + "square_expert_play/demo_181_t0135": { + "task": "square_expert_play", + "root": "demo_181_t0135", + "episode": "demo_181", + "frame": 135, + "n_draws": 13, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_split", + "stitchviz_split2", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + "cand_any_green_min": 0.921875, + "cand_any_green_mean": 0.9597355769230769, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.078125, + "hop_rise_min": -0.3211669921875, + "hop_rise_mean": -0.2960862379807692, + "hop_rise_max": -0.284912109375 + }, + "square_expert_play/demo_148_t0138": { + "task": "square_expert_play", + "root": "demo_148_t0138", + "episode": "demo_148", + "frame": 138, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5, + "cand_all_green": 0.0, + "top_cand_share": 0.0966183574879227, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.056640625, + 0.01513671875, + 0.005859375, + 0.01708984375, + 0.001953125, + 0.00244140625, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0220947265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "Q_spread": 0.8641209602355957, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 0.041483890265226364 + }, + "cand_any_green_min": 0.5, + "cand_any_green_mean": 0.6078125, + "cand_any_green_max": 0.7578125, + "cand_any_green_range": 0.2578125, + "hop_rise_min": -0.0516357421875, + "hop_rise_mean": -0.031494140625, + "hop_rise_max": -0.0220947265625 + }, + "square_expert_play/demo_164_t0093": { + "task": "square_expert_play", + "root": "demo_164_t0093", + "episode": "demo_164", + "frame": 93, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00634765625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8125, + "cand_all_green": 0.0, + "top_cand_share": 0.009615384615384616, + "frac_green": 0.00634765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.05078125, + 0.0 + ], + "hop_rise": 0.0126953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01870250329375267, + "Q_spread": 0.01870250329375267, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 1.1420300261022476e-09 + }, + "cand_any_green_min": 0.7265625, + "cand_any_green_mean": 0.7921875, + "cand_any_green_max": 0.828125, + "cand_any_green_range": 0.1015625, + "hop_rise_min": 0.01220703125, + "hop_rise_mean": 0.015478515625, + "hop_rise_max": 0.02685546875 + }, + "square_expert_play/demo_212_t0141": { + "task": "square_expert_play", + "root": "demo_212_t0141", + "episode": "demo_212", + "frame": 141, + "n_draws": 10, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_212", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + "cand_any_green_min": 0.40625, + "cand_any_green_mean": 0.50625, + "cand_any_green_max": 0.7109375, + "cand_any_green_range": 0.3046875, + "hop_rise_min": 0.0262451171875, + "hop_rise_mean": 0.031103515625, + "hop_rise_max": 0.0361328125 + }, + "square_expert_play/demo_150_t0125": { + "task": "square_expert_play", + "root": "demo_150_t0125", + "episode": "demo_150", + "frame": 125, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 8.646483529162197e-10, + "Q_spread": 8.646483529162197e-10, + "argmax": 121, + "argmax_is_green": false, + "q_of_greenless": 8.646483529162197e-10 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_88_t0144": { + "task": "square_expert_play", + "root": "demo_88_t0144", + "episode": "demo_88", + "frame": 144, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_seed0_r2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0_r1", + "representative": { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": 0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0455165111794396e-31, + "Q_max": 0.010041126981377602, + "Q_spread": 0.010041126981377602, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.009240468963980675 + }, + "cand_any_green_min": 0.0078125, + "cand_any_green_mean": 0.10625, + "cand_any_green_max": 0.46875, + "cand_any_green_range": 0.4609375, + "hop_rise_min": 0.0001220703125, + "hop_rise_mean": 0.0018310546875, + "hop_rise_max": 0.0081787109375 + }, + "square_expert_play/demo_73_t0114": { + "task": "square_expert_play", + "root": "demo_73_t0114", + "episode": "demo_73", + "frame": 114, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2", + "stitchviz_seedFAR3" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 5.5906976097197525e-12, + "Q_spread": 5.5906976097197525e-12, + "argmax": 98, + "argmax_is_green": false, + "q_of_greenless": 5.5906976097197525e-12 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_151_t0194": { + "task": "square_expert_play", + "root": "demo_151_t0194", + "episode": "demo_151", + "frame": 194, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2", + "stitchviz_seedFAR3" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.017340686172246933, + "Q_spread": 0.017340686172246933, + "argmax": 52, + "argmax_is_green": false, + "q_of_greenless": 0.017340686172246933 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.00390625, + "cand_any_green_max": 0.0078125, + "cand_any_green_range": 0.0078125, + "hop_rise_min": -0.0001220703125, + "hop_rise_mean": -6.103515625e-05, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_126_t0123": { + "task": "square_expert_play", + "root": "demo_126_t0123", + "episode": "demo_126", + "frame": 123, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2", + "stitchviz_seedFAR3" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.9729482523398474e-05, + "Q_spread": 3.9729482523398474e-05, + "argmax": 104, + "argmax_is_green": false, + "q_of_greenless": 3.9729482523398474e-05 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "square_expert_play/demo_13_t0048": { + "task": "square_expert_play", + "root": "demo_13_t0048", + "episode": "demo_13", + "frame": 48, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.31689453125, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.013674884437596301, + "frac_green": 0.31689453125, + "hop_green": [ + 0.00146484375, + 0.18310546875, + 0.30322265625, + 0.48876953125, + 0.52099609375, + 0.43212890625, + 0.35595703125, + 0.24951171875 + ], + "hop_rise": 0.1455078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0123866748210773e-19, + "Q_max": 0.6181221604347229, + "Q_spread": 0.6181221604347229, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 2.1271082117912954e-11 + }, + "cand_any_green_min": 0.9296875, + "cand_any_green_mean": 0.951171875, + "cand_any_green_max": 0.96875, + "cand_any_green_range": 0.0390625, + "hop_rise_min": 0.1392822265625, + "hop_rise_mean": 0.143646240234375, + "hop_rise_max": 0.147216796875 + }, + "square_expert_play/demo_10_t0079": { + "task": "square_expert_play", + "root": "demo_10_t0079", + "episode": "demo_10", + "frame": 79, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5692138671875, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9765625, + "cand_all_green": 0.0, + "top_cand_share": 0.009114304096075488, + "frac_green": 0.5692138671875, + "hop_green": [ + 0.3603515625, + 0.55029296875, + 0.79931640625, + 0.6748046875, + 0.759765625, + 0.61474609375, + 0.40771484375, + 0.38671875 + ], + "hop_rise": -0.053955078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.471548136979233e-14, + "Q_max": 0.8480290174484253, + "Q_spread": 0.8480290174484253, + "argmax": 46, + "argmax_is_green": true, + "q_of_greenless": 2.946369190293119e-11 + }, + "cand_any_green_min": 0.9609375, + "cand_any_green_mean": 0.98046875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0390625, + "hop_rise_min": -0.0567626953125, + "hop_rise_mean": -0.05230712890625, + "hop_rise_max": -0.0491943359375 + }, + "square_expert_play/demo_202_t0096": { + "task": "square_expert_play", + "root": "demo_202_t0096", + "episode": "demo_202", + "frame": 96, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2430419921875, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.01054746358613762, + "frac_green": 0.2430419921875, + "hop_green": [ + 0.09912109375, + 0.30322265625, + 0.4501953125, + 0.37109375, + 0.26708984375, + 0.1396484375, + 0.1494140625, + 0.16455078125 + ], + "hop_rise": -0.125732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 9.829118042484902e-14, + "Q_max": 0.5578907132148743, + "Q_spread": 0.5578907132148743, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 8.636027448716277e-10 + }, + "cand_any_green_min": 0.9453125, + "cand_any_green_mean": 0.96484375, + "cand_any_green_max": 0.984375, + "cand_any_green_range": 0.0390625, + "hop_rise_min": -0.1318359375, + "hop_rise_mean": -0.12957763671875, + "hop_rise_max": -0.125732421875 + }, + "square_expert_play/demo_172_t0038": { + "task": "square_expert_play", + "root": "demo_172_t0038", + "episode": "demo_172", + "frame": 38, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "square_expert_play", + "episode": "demo_172", + "frame": 38, + "root": "demo_172_t0038", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12725830078125, + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014388489208633094, + "frac_green": 0.12725830078125, + "hop_green": [ + 0.1708984375, + 0.21142578125, + 0.15087890625, + 0.10400390625, + 0.1279296875, + 0.1396484375, + 0.078125, + 0.03515625 + ], + "hop_rise": -0.0640869140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "Q_spread": 0.5207490921020508, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 0.0003339288232382387 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.9921875, + "cand_any_green_max": 0.9921875, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.0640869140625, + "hop_rise_mean": -0.0640869140625, + "hop_rise_max": -0.0640869140625 + }, + "two_piece_expert_play/demo_106_t0035": { + "task": "two_piece_expert_play", + "root": "demo_106_t0035", + "episode": "demo_106", + "frame": 35, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "root": "demo_106_t0035", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.015384615384615385, + "frac_green": 0.01983642578125, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0009765625, + 0.0, + 0.02978515625, + 0.064453125, + 0.0625 + ], + "hop_rise": 0.0386962890625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.019061341881752014, + "Q_max": 0.08237418532371521, + "Q_spread": 0.0633128434419632, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0386962890625, + "hop_rise_mean": 0.0386962890625, + "hop_rise_max": 0.0386962890625 + }, + "two_piece_expert_play/demo_99_t0057": { + "task": "two_piece_expert_play", + "root": "demo_99_t0057", + "episode": "demo_99", + "frame": 57, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "root": "demo_99_t0057", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010279001468428781, + "frac_green": 0.04156494140625, + "hop_green": [ + 0.0, + 0.01220703125, + 0.0, + 0.068359375, + 0.06103515625, + 0.060546875, + 0.0625, + 0.06787109375 + ], + "hop_rise": 0.0428466796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.11163482069969177, + "Q_max": 0.1695835292339325, + "Q_spread": 0.05794870853424072, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0428466796875, + "hop_rise_mean": 0.0428466796875, + "hop_rise_max": 0.0428466796875 + }, + "two_piece_expert_play/demo_129_t0084": { + "task": "two_piece_expert_play", + "root": "demo_129_t0084", + "episode": "demo_129", + "frame": 84, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz", + "stitchviz_split", + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.9921875, + "cand_any_green_max": 0.9921875, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0791015625, + "hop_rise_mean": 0.0791015625, + "hop_rise_max": 0.0791015625 + }, + "two_piece_expert_play/demo_143_t0154": { + "task": "two_piece_expert_play", + "root": "demo_143_t0154", + "episode": "demo_143", + "frame": 154, + "n_draws": 2, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz", + "stitchviz_split" + ], + "representative_dir": "stitchviz_split", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "root": "demo_143_t0154", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009854014598540146, + "frac_green": 0.167236328125, + "hop_green": [ + 0.0, + 0.06494140625, + 0.18359375, + 0.29052734375, + 0.27587890625, + 0.1474609375, + 0.22119140625, + 0.154296875 + ], + "hop_rise": 0.06494140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_spread": 0.09305314719676971, + "argmax": 94, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.06494140625, + "hop_rise_mean": 0.06494140625, + "hop_rise_max": 0.06494140625 + }, + "two_piece_expert_play/demo_102_t0198": { + "task": "two_piece_expert_play", + "root": "demo_102_t0198", + "episode": "demo_102", + "frame": 198, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "root": "demo_102_t0198", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.011428571428571429, + "frac_green": 0.01068115234375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.05908203125, + 0.0, + 0.02587890625 + ], + "hop_rise": 0.0213623046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.504642619706563e-22, + "Q_max": 0.03459713235497475, + "Q_spread": 0.03459713235497475, + "argmax": 110, + "argmax_is_green": true, + "q_of_greenless": 3.8611986497016915e-07 + }, + "cand_any_green_min": 0.9453125, + "cand_any_green_mean": 0.9453125, + "cand_any_green_max": 0.9453125, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0213623046875, + "hop_rise_mean": 0.0213623046875, + "hop_rise_max": 0.0213623046875 + }, + "two_piece_expert_play/demo_171_t0244": { + "task": "two_piece_expert_play", + "root": "demo_171_t0244", + "episode": "demo_171", + "frame": 244, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz" + ], + "representative_dir": "stitchviz", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "root": "demo_171_t0244", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.015625, + "cand_all_green": 0.0, + "top_cand_share": 0.5, + "frac_green": 0.0001220703125, + "hop_green": [ + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.7732108921773033e-06, + "Q_max": 0.02326813153922558, + "Q_spread": 0.023264357820153236, + "argmax": 123, + "argmax_is_green": true, + "q_of_greenless": 0.009346847422420979 + }, + "cand_any_green_min": 0.015625, + "cand_any_green_mean": 0.015625, + "cand_any_green_max": 0.015625, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "two_piece_expert_play/demo_38_t0067": { + "task": "two_piece_expert_play", + "root": "demo_38_t0067", + "episode": "demo_38", + "frame": 67, + "n_draws": 9, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0101318359375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024096385542168676, + "frac_green": 0.0101318359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01220703125, + 0.01220703125, + 0.00244140625, + 0.01708984375, + 0.037109375 + ], + "hop_rise": 0.01416015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0009374454384669662, + "Q_max": 0.07211869955062866, + "Q_spread": 0.07118125259876251, + "argmax": 127, + "argmax_is_green": true, + "q_of_greenless": 0.018065709620714188 + }, + "cand_any_green_min": 0.7578125, + "cand_any_green_mean": 0.7994791666666666, + "cand_any_green_max": 0.9140625, + "cand_any_green_range": 0.15625, + "hop_rise_min": 0.0106201171875, + "hop_rise_mean": 0.013604058159722222, + "hop_rise_max": 0.0157470703125 + }, + "two_piece_expert_play/demo_18_t0096": { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "episode": "demo_18", + "frame": 96, + "n_draws": 16, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_split", + "stitchviz_split2", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_18", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + "cand_any_green_min": 0.6796875, + "cand_any_green_mean": 0.78125, + "cand_any_green_max": 0.828125, + "cand_any_green_range": 0.1484375, + "hop_rise_min": -0.122802734375, + "hop_rise_mean": -0.09508514404296875, + "hop_rise_max": -0.0743408203125 + }, + "two_piece_expert_play/demo_128_t0115": { + "task": "two_piece_expert_play", + "root": "demo_128_t0115", + "episode": "demo_128", + "frame": 115, + "n_draws": 9, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed0dup", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_unseen", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_seed0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01641845703125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.03345724907063197, + "frac_green": 0.01641845703125, + "hop_green": [ + 0.00439453125, + 0.052734375, + 0.0576171875, + 0.01025390625, + 0.0, + 0.00048828125, + 0.005859375, + 0.0 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015772078186273575, + "Q_max": 0.48050427436828613, + "Q_spread": 0.46473219990730286, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.05498268082737923 + }, + "cand_any_green_min": 0.890625, + "cand_any_green_mean": 0.9366319444444444, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.109375, + "hop_rise_min": -0.0296630859375, + "hop_rise_mean": -0.023356119791666668, + "hop_rise_max": -0.0050048828125 + }, + "two_piece_expert_play/demo_185_t0256": { + "task": "two_piece_expert_play", + "root": "demo_185_t0256", + "episode": "demo_185", + "frame": 256, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2", + "stitchviz_seedFAR3" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0108642578125, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028089887640449437, + "frac_green": 0.0108642578125, + "hop_green": [ + 0.0, + 0.0, + 0.00634765625, + 0.0029296875, + 0.00048828125, + 0.01318359375, + 0.01220703125, + 0.0517578125 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014911642065271735, + "Q_max": 0.05342011898756027, + "Q_spread": 0.05192895606160164, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.01908215507864952 + }, + "cand_any_green_min": 0.7109375, + "cand_any_green_mean": 0.78515625, + "cand_any_green_max": 0.8515625, + "cand_any_green_range": 0.140625, + "hop_rise_min": 0.01708984375, + "hop_rise_mean": 0.020263671875, + "hop_rise_max": 0.0223388671875 + }, + "two_piece_expert_play/demo_174_t0479": { + "task": "two_piece_expert_play", + "root": "demo_174_t0479", + "episode": "demo_174", + "frame": 479, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2", + "stitchviz_seedFAR3" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.159912109375, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.009541984732824428, + "frac_green": 0.159912109375, + "hop_green": [ + 0.0, + 0.07861328125, + 0.14013671875, + 0.224609375, + 0.08349609375, + 0.26220703125, + 0.2822265625, + 0.2080078125 + ], + "hop_rise": 0.09814453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014558101538568735, + "Q_max": 0.27829867601394653, + "Q_spread": 0.27684286236763, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.0014558101538568735 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.998046875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0078125, + "hop_rise_min": 0.09814453125, + "hop_rise_mean": 0.10150146484375, + "hop_rise_max": 0.10546875 + }, + "two_piece_expert_play/demo_117_t0077": { + "task": "two_piece_expert_play", + "root": "demo_117_t0077", + "episode": "demo_117", + "frame": 77, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedFAR0", + "stitchviz_seedFAR1", + "stitchviz_seedFAR2", + "stitchviz_seedFAR3" + ], + "representative_dir": "stitchviz_seedFAR0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.008544921875, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.02142857142857143, + "frac_green": 0.008544921875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0009765625, + 0.00927734375, + 0.01220703125, + 0.0458984375 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.004533246159553528, + "Q_max": 0.046014029532670975, + "Q_spread": 0.04148078337311745, + "argmax": 112, + "argmax_is_green": true, + "q_of_greenless": 0.015510505065321922 + }, + "cand_any_green_min": 0.9296875, + "cand_any_green_mean": 0.94140625, + "cand_any_green_max": 0.96875, + "cand_any_green_range": 0.0390625, + "hop_rise_min": 0.0164794921875, + "hop_rise_mean": 0.017333984375, + "hop_rise_max": 0.0186767578125 + }, + "two_piece_expert_play/demo_105_t0113": { + "task": "two_piece_expert_play", + "root": "demo_105_t0113", + "episode": "demo_105", + "frame": 113, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0098876953125, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.018518518518518517, + "frac_green": 0.0098876953125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00927734375, + 0.001953125, + 0.0, + 0.00439453125, + 0.0634765625 + ], + "hop_rise": 0.01513671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0025416151620447636, + "Q_max": 0.0513761043548584, + "Q_spread": 0.04883448779582977, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 0.0034241038374602795 + }, + "cand_any_green_min": 0.984375, + "cand_any_green_mean": 0.99609375, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.015625, + "hop_rise_min": 0.01513671875, + "hop_rise_mean": 0.015716552734375, + "hop_rise_max": 0.0164794921875 + }, + "two_piece_expert_play/demo_75_t0199": { + "task": "two_piece_expert_play", + "root": "demo_75_t0199", + "episode": "demo_75", + "frame": 199, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.56170654296875, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010648701510377051, + "frac_green": 0.56170654296875, + "hop_green": [ + 0.884765625, + 0.71044921875, + 0.65478515625, + 0.5712890625, + 0.48828125, + 0.46533203125, + 0.38330078125, + 0.33544921875 + ], + "hop_rise": -0.2872314453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.09469607472419739, + "Q_max": 0.9999012351036072, + "Q_spread": 0.9052051305770874, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.291015625, + "hop_rise_mean": -0.2845458984375, + "hop_rise_max": -0.279541015625 + }, + "two_piece_expert_play/demo_165_t0157": { + "task": "two_piece_expert_play", + "root": "demo_165_t0157", + "episode": "demo_165", + "frame": 157, + "n_draws": 4, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_seedTYP0", + "stitchviz_seedTYP1", + "stitchviz_seedTYP2", + "stitchviz_seedTYP3" + ], + "representative_dir": "stitchviz_seedTYP0", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08221435546875, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014847809948032665, + "frac_green": 0.08221435546875, + "hop_green": [ + 0.01220703125, + 0.1064453125, + 0.1748046875, + 0.09130859375, + 0.14794921875, + 0.052734375, + 0.056640625, + 0.015625 + ], + "hop_rise": -0.0279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.5286317395512015e-06, + "Q_max": 0.30794060230255127, + "Q_spread": 0.3079380691051483, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 2.5286317395512015e-06 + }, + "cand_any_green_min": 0.9921875, + "cand_any_green_mean": 0.998046875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0078125, + "hop_rise_min": -0.0299072265625, + "hop_rise_mean": -0.027496337890625, + "hop_rise_max": -0.0224609375 + }, + "two_piece_expert_play/demo_136_t0154": { + "task": "two_piece_expert_play", + "root": "demo_136_t0154", + "episode": "demo_136", + "frame": 154, + "n_draws": 5, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split", + "stitchviz_split2", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 0.984375, + "cand_any_green_mean": 0.996875, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.015625, + "hop_rise_min": -0.06005859375, + "hop_rise_mean": -0.0065673828125, + "hop_rise_max": 0.0262451171875 + }, + "two_piece_expert_play/demo_80_t0025": { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "episode": "demo_80", + "frame": 25, + "n_draws": 6, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_80", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.255859375, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011927480916030535, + "frac_green": 0.255859375, + "hop_green": [ + 0.005859375, + 0.1103515625, + 0.3359375, + 0.21728515625, + 0.43017578125, + 0.41064453125, + 0.26123046875, + 0.275390625 + ], + "hop_rise": 0.177001953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "Q_spread": 0.36739271879196167, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0625, + "hop_rise_mean": 0.137939453125, + "hop_rise_max": 0.177001953125 + }, + "two_piece_expert_play/demo_198_t0166": { + "task": "two_piece_expert_play", + "root": "demo_198_t0166", + "episode": "demo_198", + "frame": 166, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_198", + "frame": 166, + "root": "demo_198_t0166", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.051513671875, + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.03317535545023697, + "frac_green": 0.051513671875, + "hop_green": [ + 0.001953125, + 0.12548828125, + 0.11962890625, + 0.05029296875, + 0.04296875, + 0.01513671875, + 0.0126953125, + 0.0439453125 + ], + "hop_rise": -0.045654296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.769107858417556e-05, + "Q_max": 0.38457581400871277, + "Q_spread": 0.3845081329345703, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.017471471801400185 + }, + "cand_any_green_min": 0.9609375, + "cand_any_green_mean": 0.9609375, + "cand_any_green_max": 0.9609375, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.045654296875, + "hop_rise_mean": -0.045654296875, + "hop_rise_max": -0.045654296875 + }, + "two_piece_expert_play/demo_64_t0192": { + "task": "two_piece_expert_play", + "root": "demo_64_t0192", + "episode": "demo_64", + "frame": 192, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_64", + "frame": 192, + "root": "demo_64_t0192", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.05419921875, + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028153153153153154, + "frac_green": 0.05419921875, + "hop_green": [ + 0.24755859375, + 0.0859375, + 0.0263671875, + 0.0224609375, + 0.0166015625, + 0.009765625, + 0.01123046875, + 0.013671875 + ], + "hop_rise": -0.082763671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0006882615271024406, + "Q_max": 0.704879105091095, + "Q_spread": 0.7041908502578735, + "argmax": 86, + "argmax_is_green": true, + "q_of_greenless": 0.11513863503932953 + }, + "cand_any_green_min": 0.8828125, + "cand_any_green_mean": 0.8828125, + "cand_any_green_max": 0.8828125, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.082763671875, + "hop_rise_mean": -0.082763671875, + "hop_rise_max": -0.082763671875 + }, + "two_piece_expert_play/demo_153_t0112": { + "task": "two_piece_expert_play", + "root": "demo_153_t0112", + "episode": "demo_153", + "frame": 112, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_153", + "frame": 112, + "root": "demo_153_t0112", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.15411376953125, + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009900990099009901, + "frac_green": 0.15411376953125, + "hop_green": [ + 0.0166015625, + 0.12255859375, + 0.18701171875, + 0.25634765625, + 0.2099609375, + 0.22705078125, + 0.14697265625, + 0.06640625 + ], + "hop_rise": 0.0169677734375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.312361844924453e-07, + "Q_max": 0.32301434874534607, + "Q_spread": 0.3230136036872864, + "argmax": 77, + "argmax_is_green": true, + "q_of_greenless": 0.008339659310877323 + }, + "cand_any_green_min": 0.984375, + "cand_any_green_mean": 0.984375, + "cand_any_green_max": 0.984375, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0169677734375, + "hop_rise_mean": 0.0169677734375, + "hop_rise_max": 0.0169677734375 + }, + "two_piece_expert_play/demo_6_t0180": { + "task": "two_piece_expert_play", + "root": "demo_6_t0180", + "episode": "demo_6", + "frame": 180, + "n_draws": 1, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_split2" + ], + "representative_dir": "stitchviz_split2", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_6", + "frame": 180, + "root": "demo_6_t0180", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1658935546875, + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009565857247976454, + "frac_green": 0.1658935546875, + "hop_green": [ + 0.08740234375, + 0.2314453125, + 0.4189453125, + 0.25, + 0.0654296875, + 0.12109375, + 0.060546875, + 0.09228515625 + ], + "hop_rise": -0.162109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.3845299482345581, + "Q_max": 0.5868167877197266, + "Q_spread": 0.20228683948516846, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": null + }, + "cand_any_green_min": 1.0, + "cand_any_green_mean": 1.0, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.0, + "hop_rise_min": -0.162109375, + "hop_rise_mean": -0.162109375, + "hop_rise_max": -0.162109375 + }, + "two_piece_expert_play/demo_159_t0413": { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "episode": "demo_159", + "frame": 413, + "n_draws": 8, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_159", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02105712890625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028985507246376812, + "frac_green": 0.02105712890625, + "hop_green": [ + 0.0, + 0.02099609375, + 0.01171875, + 0.0390625, + 0.01513671875, + 0.0419921875, + 0.0302734375, + 0.00927734375 + ], + "hop_rise": 0.0062255859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.0167299175664084e-07, + "Q_max": 0.12913301587104797, + "Q_spread": 0.12913261353969574, + "argmax": 1, + "argmax_is_green": true, + "q_of_greenless": 0.02041761204600334 + }, + "cand_any_green_min": 0.640625, + "cand_any_green_mean": 0.7197265625, + "cand_any_green_max": 0.7890625, + "cand_any_green_range": 0.1484375, + "hop_rise_min": 0.0062255859375, + "hop_rise_mean": 0.0096282958984375, + "hop_rise_max": 0.0147705078125 + }, + "two_piece_expert_play/demo_189_t0338": { + "task": "two_piece_expert_play", + "root": "demo_189_t0338", + "episode": "demo_189", + "frame": 338, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.94027550238585e-15, + "Q_max": 7.936003498798527e-08, + "Q_spread": 7.936003498798527e-08, + "argmax": 85, + "argmax_is_green": false, + "q_of_greenless": 7.936003498798527e-08 + }, + "cand_any_green_min": 0.0, + "cand_any_green_mean": 0.0, + "cand_any_green_max": 0.0, + "cand_any_green_range": 0.0, + "hop_rise_min": 0.0, + "hop_rise_mean": 0.0, + "hop_rise_max": 0.0 + }, + "two_piece_expert_play/demo_83_t0280": { + "task": "two_piece_expert_play", + "root": "demo_83_t0280", + "episode": "demo_83", + "frame": 280, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00830078125, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.051470588235294115, + "frac_green": 0.00830078125, + "hop_green": [ + 0.0, + 0.0, + 0.00146484375, + 0.001953125, + 0.00146484375, + 0.00146484375, + 0.05908203125, + 0.0009765625 + ], + "hop_rise": 0.014892578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0842872377736512e-08, + "Q_max": 0.07263443619012833, + "Q_spread": 0.07263442873954773, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.012364218942821026 + }, + "cand_any_green_min": 0.359375, + "cand_any_green_mean": 0.5677083333333334, + "cand_any_green_max": 0.953125, + "cand_any_green_range": 0.59375, + "hop_rise_min": 0.010009765625, + "hop_rise_mean": 0.0118408203125, + "hop_rise_max": 0.014892578125 + }, + "two_piece_expert_play/demo_19_t0067": { + "task": "two_piece_expert_play", + "root": "demo_19_t0067", + "episode": "demo_19", + "frame": 67, + "n_draws": 3, + "n_distinct_plan_seeds": 1, + "plan_seeds": [ + 0 + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2" + ], + "representative_dir": "stitchviz_unseen8", + "representative": { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01129150390625, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.734375, + "cand_all_green": 0.0, + "top_cand_share": 0.02702702702702703, + "frac_green": 0.01129150390625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0283203125, + 0.0107421875, + 0.00341796875, + 0.0078125, + 0.0400390625 + ], + "hop_rise": 0.0084228515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.675629151686735e-07, + "Q_max": 0.08670267462730408, + "Q_spread": 0.08670200407505035, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": 0.01302293874323368 + }, + "cand_any_green_min": 0.734375, + "cand_any_green_mean": 0.9114583333333334, + "cand_any_green_max": 1.0, + "cand_any_green_range": 0.265625, + "hop_rise_min": 0.0084228515625, + "hop_rise_mean": 0.06901041666666667, + "hop_rise_max": 0.0994873046875 + } + }, + "draws": [ + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + { + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "root": "demo_110_t0104", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 6.59219892895635e-07, + "Q_spread": 6.59219892895635e-07, + "argmax": 7, + "argmax_is_green": false, + "q_of_greenless": 6.59219892895635e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "root": "demo_102_t0145", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0013427734375, + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.045454545454545456, + "frac_green": 0.0013427734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0029296875, + 0.0, + 0.0078125 + ], + "hop_rise": 0.002685546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.024722615256905556, + "Q_spread": 0.024722615256905556, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": 0.013053152710199356 + }, + { + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "root": "demo_160_t0165", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00592041015625, + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.703125, + "cand_all_green": 0.0, + "top_cand_share": 0.020618556701030927, + "frac_green": 0.00592041015625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.04345703125, + 0.0, + 0.0, + 0.0, + 0.00390625 + ], + "hop_rise": -0.0098876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.04654752463102341, + "Q_spread": 0.04654752463102341, + "argmax": 103, + "argmax_is_green": true, + "q_of_greenless": 8.725493535166606e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "root": "demo_84_t0390", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0267333984375, + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.34375, + "cand_all_green": 0.0, + "top_cand_share": 0.0593607305936073, + "frac_green": 0.0267333984375, + "hop_green": [ + 0.0, + 0.025390625, + 0.025390625, + 0.03369140625, + 0.0322265625, + 0.0341796875, + 0.03076171875, + 0.0322265625 + ], + "hop_rise": 0.01123046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "Q_spread": 0.2687058746814728, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": 0.03616061061620712 + }, + { + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "root": "demo_221_t0249", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00164794921875, + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.171875, + "cand_all_green": 0.0, + "top_cand_share": 0.07407407407407407, + "frac_green": 0.00164794921875, + "hop_green": [ + 0.0, + 0.0, + 0.0126953125, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": -0.0030517578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.1423076102801133e-05, + "Q_max": 0.06528710573911667, + "Q_spread": 0.06527568399906158, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.03142651170492172 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5, + "cand_all_green": 0.0, + "top_cand_share": 0.0966183574879227, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.056640625, + 0.01513671875, + 0.005859375, + 0.01708984375, + 0.001953125, + 0.00244140625, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0220947265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "Q_spread": 0.8641209602355957, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 0.041483890265226364 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00634765625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8125, + "cand_all_green": 0.0, + "top_cand_share": 0.009615384615384616, + "frac_green": 0.00634765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.05078125, + 0.0 + ], + "hop_rise": 0.0126953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01870250329375267, + "Q_spread": 0.01870250329375267, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 1.1420300261022476e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 8.646483529162197e-10, + "Q_spread": 8.646483529162197e-10, + "argmax": 121, + "argmax_is_green": false, + "q_of_greenless": 8.646483529162197e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": 0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0455165111794396e-31, + "Q_max": 0.010041126981377602, + "Q_spread": 0.010041126981377602, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.009240468963980675 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5, + "cand_all_green": 0.0, + "top_cand_share": 0.0966183574879227, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.056640625, + 0.01513671875, + 0.005859375, + 0.01708984375, + 0.001953125, + 0.00244140625, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0220947265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "Q_spread": 0.8641209602355957, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 0.041483890265226364 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00634765625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8125, + "cand_all_green": 0.0, + "top_cand_share": 0.009615384615384616, + "frac_green": 0.00634765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.05078125, + 0.0 + ], + "hop_rise": 0.0126953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01870250329375267, + "Q_spread": 0.01870250329375267, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 1.1420300261022476e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 8.646483529162197e-10, + "Q_spread": 8.646483529162197e-10, + "argmax": 121, + "argmax_is_green": false, + "q_of_greenless": 8.646483529162197e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0 + ], + "hop_rise": 0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0455165111794396e-31, + "Q_max": 0.010041126981377602, + "Q_spread": 0.010041126981377602, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.009240468963980675 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00811767578125, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.17293233082706766, + "frac_green": 0.00811767578125, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00830078125, + 0.0087890625, + 0.0107421875, + 0.01611328125, + 0.01904296875 + ], + "hop_rise": 0.0111083984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "Q_spread": 0.21355515718460083, + "argmax": 88, + "argmax_is_green": true, + "q_of_greenless": 0.017855139449238777 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.005211064126342535, + "Q_spread": 0.005211064126342535, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 0.005211064126342535 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00701904296875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.24347826086956523, + "frac_green": 0.00701904296875, + "hop_green": [ + 0.0, + 0.0, + 0.0029296875, + 0.00537109375, + 0.0068359375, + 0.01025390625, + 0.013671875, + 0.01708984375 + ], + "hop_rise": 0.0098876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.22966429591178894, + "Q_spread": 0.22966429591178894, + "argmax": 89, + "argmax_is_green": true, + "q_of_greenless": 0.022050779312849045 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.0027101896703243256, + "Q_spread": 0.0027101896703243256, + "argmax": 25, + "argmax_is_green": false, + "q_of_greenless": 0.0027101896703243256 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.21563720703125, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9765625, + "cand_all_green": 0.0, + "top_cand_share": 0.010189640532125671, + "frac_green": 0.21563720703125, + "hop_green": [ + 0.716796875, + 0.3974609375, + 0.220703125, + 0.14404296875, + 0.06591796875, + 0.07958984375, + 0.07666015625, + 0.02392578125 + ], + "hop_rise": -0.3082275390625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.838567468720914e-12, + "Q_max": 0.8509555459022522, + "Q_spread": 0.8509555459022522, + "argmax": 36, + "argmax_is_green": true, + "q_of_greenless": 6.46574844722636e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00531005859375, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1328125, + "cand_all_green": 0.0, + "top_cand_share": 0.20689655172413793, + "frac_green": 0.00531005859375, + "hop_green": [ + 0.0, + 0.0, + 0.00146484375, + 0.0087890625, + 0.00634765625, + 0.00634765625, + 0.009765625, + 0.009765625 + ], + "hop_rise": 0.0054931640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.1415252387523651, + "Q_spread": 0.1415252387523651, + "argmax": 101, + "argmax_is_green": true, + "q_of_greenless": 0.016218332573771477 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.0015912809176370502, + "Q_spread": 0.0015912809176370502, + "argmax": 45, + "argmax_is_green": false, + "q_of_greenless": 0.0015912809176370502 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2047119140625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.010137149672033392, + "frac_green": 0.2047119140625, + "hop_green": [ + 0.66455078125, + 0.369140625, + 0.21435546875, + 0.140625, + 0.06591796875, + 0.07470703125, + 0.076171875, + 0.0322265625 + ], + "hop_rise": -0.284912109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9796030551719477e-14, + "Q_max": 0.8534550666809082, + "Q_spread": 0.8534550666809082, + "argmax": 25, + "argmax_is_green": true, + "q_of_greenless": 1.4603423892367573e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.004638671875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.15625, + "cand_all_green": 0.0, + "top_cand_share": 0.2236842105263158, + "frac_green": 0.004638671875, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0029296875, + 0.0029296875, + 0.00830078125, + 0.01123046875, + 0.0107421875 + ], + "hop_rise": 0.00732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.18495695292949677, + "Q_spread": 0.18495695292949677, + "argmax": 77, + "argmax_is_green": true, + "q_of_greenless": 0.016612788662314415 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.00309074018150568, + "Q_spread": 0.00309074018150568, + "argmax": 29, + "argmax_is_green": false, + "q_of_greenless": 0.00309074018150568 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.20623779296875, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.010358094110683634, + "frac_green": 0.20623779296875, + "hop_green": [ + 0.68115234375, + 0.3837890625, + 0.20703125, + 0.1357421875, + 0.06298828125, + 0.072265625, + 0.07275390625, + 0.0341796875 + ], + "hop_rise": -0.2913818359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.065185976064771e-15, + "Q_max": 0.8634084463119507, + "Q_spread": 0.8634084463119507, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": 0.00012400942796375602 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 5.5906976097197525e-12, + "Q_spread": 5.5906976097197525e-12, + "argmax": 98, + "argmax_is_green": false, + "q_of_greenless": 5.5906976097197525e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.017340686172246933, + "Q_spread": 0.017340686172246933, + "argmax": 52, + "argmax_is_green": false, + "q_of_greenless": 0.017340686172246933 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.9729482523398474e-05, + "Q_spread": 3.9729482523398474e-05, + "argmax": 104, + "argmax_is_green": false, + "q_of_greenless": 3.9729482523398474e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 9.217325094981298e-32, + "Q_max": 3.785088995705843e-12, + "Q_spread": 3.785088995705843e-12, + "argmax": 9, + "argmax_is_green": false, + "q_of_greenless": 3.785088995705843e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": -0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.02370322495698929, + "Q_spread": 0.02370322495698929, + "argmax": 41, + "argmax_is_green": true, + "q_of_greenless": 0.01656409539282322 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 1.9001799955731258e-05, + "Q_spread": 1.9001799955731258e-05, + "argmax": 59, + "argmax_is_green": false, + "q_of_greenless": 1.9001799955731258e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.208173579828272e-32, + "Q_max": 5.092057851763254e-12, + "Q_spread": 5.092057851763254e-12, + "argmax": 72, + "argmax_is_green": false, + "q_of_greenless": 5.092057851763254e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.010140572674572468, + "Q_spread": 0.010140572674572468, + "argmax": 68, + "argmax_is_green": false, + "q_of_greenless": 0.010140572674572468 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 1.242512048804656e-08, + "Q_spread": 1.242512048804656e-08, + "argmax": 56, + "argmax_is_green": false, + "q_of_greenless": 1.242512048804656e-08 + }, + { + "task": "square_expert_play", + "episode": "demo_73", + "frame": 114, + "root": "demo_73_t0114", + "dir": "stitchviz_seedFAR3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_73_t0114_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 8.854821209998447e-31, + "Q_max": 8.053687057529846e-12, + "Q_spread": 8.053687057529846e-12, + "argmax": 23, + "argmax_is_green": false, + "q_of_greenless": 8.053687057529846e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_151", + "frame": 194, + "root": "demo_151_t0194", + "dir": "stitchviz_seedFAR3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 6.103515625e-05, + "name": "square_expert_play_demo_151_t0194_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0078125, + "cand_all_green": 0.0, + "top_cand_share": 1.0, + "frac_green": 6.103515625e-05, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": -0.0001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.02520841546356678, + "Q_spread": 0.02520841546356678, + "argmax": 85, + "argmax_is_green": true, + "q_of_greenless": 0.01260585431009531 + }, + { + "task": "square_expert_play", + "episode": "demo_126", + "frame": 123, + "root": "demo_126_t0123", + "dir": "stitchviz_seedFAR3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_126_t0123_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.0989066868158943e-10, + "Q_spread": 3.0989066868158943e-10, + "argmax": 80, + "argmax_is_green": false, + "q_of_greenless": 3.0989066868158943e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.31689453125, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.013674884437596301, + "frac_green": 0.31689453125, + "hop_green": [ + 0.00146484375, + 0.18310546875, + 0.30322265625, + 0.48876953125, + 0.52099609375, + 0.43212890625, + 0.35595703125, + 0.24951171875 + ], + "hop_rise": 0.1455078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0123866748210773e-19, + "Q_max": 0.6181221604347229, + "Q_spread": 0.6181221604347229, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 2.1271082117912954e-11 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5692138671875, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9765625, + "cand_all_green": 0.0, + "top_cand_share": 0.009114304096075488, + "frac_green": 0.5692138671875, + "hop_green": [ + 0.3603515625, + 0.55029296875, + 0.79931640625, + 0.6748046875, + 0.759765625, + 0.61474609375, + 0.40771484375, + 0.38671875 + ], + "hop_rise": -0.053955078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.471548136979233e-14, + "Q_max": 0.8480290174484253, + "Q_spread": 0.8480290174484253, + "argmax": 46, + "argmax_is_green": true, + "q_of_greenless": 2.946369190293119e-11 + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2430419921875, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.01054746358613762, + "frac_green": 0.2430419921875, + "hop_green": [ + 0.09912109375, + 0.30322265625, + 0.4501953125, + 0.37109375, + 0.26708984375, + 0.1396484375, + 0.1494140625, + 0.16455078125 + ], + "hop_rise": -0.125732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 9.829118042484902e-14, + "Q_max": 0.5578907132148743, + "Q_spread": 0.5578907132148743, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 8.636027448716277e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.3134765625, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.014213395638629283, + "frac_green": 0.3134765625, + "hop_green": [ + 0.001953125, + 0.1787109375, + 0.30078125, + 0.47802734375, + 0.5107421875, + 0.4296875, + 0.35693359375, + 0.2509765625 + ], + "hop_rise": 0.147216796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.476865961680355e-14, + "Q_max": 0.6342390775680542, + "Q_spread": 0.6342390775680542, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 2.0527206743281567e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.58099365234375, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009454774661203908, + "frac_green": 0.58099365234375, + "hop_green": [ + 0.3623046875, + 0.55810546875, + 0.8095703125, + 0.6923828125, + 0.7783203125, + 0.6337890625, + 0.41845703125, + 0.39501953125 + ], + "hop_rise": -0.0491943359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.41986458648924e-10, + "Q_max": 0.8421441316604614, + "Q_spread": 0.8421441316604614, + "argmax": 56, + "argmax_is_green": true, + "q_of_greenless": 5.676301650936466e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.245849609375, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.00893743793445879, + "frac_green": 0.245849609375, + "hop_green": [ + 0.103515625, + 0.3037109375, + 0.46728515625, + 0.37255859375, + 0.2646484375, + 0.13720703125, + 0.15185546875, + 0.166015625 + ], + "hop_rise": -0.1318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.474593217993928e-13, + "Q_max": 0.5490685701370239, + "Q_spread": 0.5490685701370239, + "argmax": 108, + "argmax_is_green": true, + "q_of_greenless": 1.346560907222738e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.29876708984375, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.012257405515832482, + "frac_green": 0.29876708984375, + "hop_green": [ + 0.00048828125, + 0.1708984375, + 0.28662109375, + 0.45849609375, + 0.486328125, + 0.412109375, + 0.3388671875, + 0.236328125 + ], + "hop_rise": 0.1392822265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.561455492258806e-18, + "Q_max": 0.6099290251731873, + "Q_spread": 0.6099290251731873, + "argmax": 57, + "argmax_is_green": true, + "q_of_greenless": 9.946264256655013e-09 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.56298828125, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.009865568083261058, + "frac_green": 0.56298828125, + "hop_green": [ + 0.35546875, + 0.54052734375, + 0.78466796875, + 0.669921875, + 0.76171875, + 0.61279296875, + 0.40087890625, + 0.3779296875 + ], + "hop_rise": -0.04931640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.322533712659919e-13, + "Q_max": 0.8547662496566772, + "Q_spread": 0.8547662496566772, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": 0.014029395766556263 + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.24835205078125, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009584664536741214, + "frac_green": 0.24835205078125, + "hop_green": [ + 0.1015625, + 0.30810546875, + 0.47021484375, + 0.376953125, + 0.27197265625, + 0.1416015625, + 0.14697265625, + 0.16943359375 + ], + "hop_rise": -0.1317138671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.011987513986062e-14, + "Q_max": 0.5534642338752747, + "Q_spread": 0.5534642338752747, + "argmax": 67, + "argmax_is_green": true, + "q_of_greenless": 3.290904942760027e-14 + }, + { + "task": "square_expert_play", + "episode": "demo_13", + "frame": 48, + "root": "demo_13_t0048", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.3056640625, + "name": "square_expert_play_demo_13_t0048_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.009185303514376996, + "frac_green": 0.3056640625, + "hop_green": [ + 0.00048828125, + 0.17626953125, + 0.29296875, + 0.4677734375, + 0.49951171875, + 0.41650390625, + 0.34375, + 0.248046875 + ], + "hop_rise": 0.142578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.4246809622686613e-17, + "Q_max": 0.4813844859600067, + "Q_spread": 0.4813844859600067, + "argmax": 6, + "argmax_is_green": true, + "q_of_greenless": 8.366973958118251e-08 + }, + { + "task": "square_expert_play", + "episode": "demo_10", + "frame": 79, + "root": "demo_10_t0079", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.58099365234375, + "name": "square_expert_play_demo_10_t0079_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.008929509402248135, + "frac_green": 0.58099365234375, + "hop_green": [ + 0.36865234375, + 0.560546875, + 0.81689453125, + 0.69140625, + 0.78564453125, + 0.623046875, + 0.4130859375, + 0.388671875 + ], + "hop_rise": -0.0567626953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25436291098594666, + "Q_max": 0.840471625328064, + "Q_spread": 0.5861086845397949, + "argmax": 12, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "square_expert_play", + "episode": "demo_202", + "frame": 96, + "root": "demo_202_t0096", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.23797607421875, + "name": "square_expert_play_demo_202_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.00923313670171839, + "frac_green": 0.23797607421875, + "hop_green": [ + 0.103515625, + 0.2958984375, + 0.44775390625, + 0.36279296875, + 0.2587890625, + 0.130859375, + 0.14208984375, + 0.162109375 + ], + "hop_rise": -0.1290283203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.383786100991288e-14, + "Q_max": 0.5601746439933777, + "Q_spread": 0.5601746439933777, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 2.2616730710467436e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.192138671875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "frac_green": 0.192138671875, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "hop_rise": 0.16748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_spread": 0.6069021821022034, + "argmax": 38, + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + { + "task": "square_expert_play", + "episode": "demo_172", + "frame": 38, + "root": "demo_172_t0038", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12725830078125, + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014388489208633094, + "frac_green": 0.12725830078125, + "hop_green": [ + 0.1708984375, + 0.21142578125, + 0.15087890625, + 0.10400390625, + 0.1279296875, + 0.1396484375, + 0.078125, + 0.03515625 + ], + "hop_rise": -0.0640869140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "Q_spread": 0.5207490921020508, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": 0.0003339288232382387 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.207275390625, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "frac_green": 0.207275390625, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "hop_rise": -0.28857421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_spread": 0.849848747253418, + "argmax": 98, + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00738525390625, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1328125, + "cand_all_green": 0.0, + "top_cand_share": 0.2809917355371901, + "frac_green": 0.00738525390625, + "hop_green": [ + 0.0, + 0.00048828125, + 0.00244140625, + 0.00634765625, + 0.0068359375, + 0.01220703125, + 0.01611328125, + 0.0146484375 + ], + "hop_rise": 0.0101318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.31185004115104675, + "Q_spread": 0.31185004115104675, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": 0.003624454839155078 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0003662109375, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.046875, + "cand_all_green": 0.0, + "top_cand_share": 0.16666666666666666, + "frac_green": 0.0003662109375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.00146484375 + ], + "hop_rise": 0.000732421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01727997325360775, + "Q_spread": 0.01727997325360775, + "argmax": 50, + "argmax_is_green": true, + "q_of_greenless": 0.0068954830057919025 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.19854736328125, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.010759299108515216, + "frac_green": 0.19854736328125, + "hop_green": [ + 0.69677734375, + 0.4150390625, + 0.2607421875, + 0.06396484375, + 0.04833984375, + 0.03515625, + 0.0390625, + 0.029296875 + ], + "hop_rise": -0.3211669921875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.292697533096276e-14, + "Q_max": 0.8514546751976013, + "Q_spread": 0.8514546751976013, + "argmax": 29, + "argmax_is_green": true, + "q_of_greenless": 0.00027320117806084454 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0057373046875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.140625, + "cand_all_green": 0.0, + "top_cand_share": 0.20212765957446807, + "frac_green": 0.0057373046875, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0029296875, + 0.00390625, + 0.00537109375, + 0.015625, + 0.01708984375 + ], + "hop_rise": 0.009521484375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.18752142786979675, + "Q_spread": 0.18752142786979675, + "argmax": 117, + "argmax_is_green": true, + "q_of_greenless": 0.002974910894408822 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0006103515625, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0703125, + "cand_all_green": 0.0, + "top_cand_share": 0.2, + "frac_green": 0.0006103515625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.00341796875 + ], + "hop_rise": 0.001220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.017263323068618774, + "Q_spread": 0.017263323068618774, + "argmax": 121, + "argmax_is_green": true, + "q_of_greenless": 0.008443250320851803 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.19287109375, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010443037974683544, + "frac_green": 0.19287109375, + "hop_green": [ + 0.681640625, + 0.4052734375, + 0.2529296875, + 0.0625, + 0.04541015625, + 0.0302734375, + 0.03662109375, + 0.0283203125 + ], + "hop_rise": -0.3154296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 8.061052639198735e-14, + "Q_max": 0.8541646003723145, + "Q_spread": 0.8541646003723145, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 0.0019010601099580526 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02606201171875, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7578125, + "cand_all_green": 0.0, + "top_cand_share": 0.06323185011709602, + "frac_green": 0.02606201171875, + "hop_green": [ + 0.162109375, + 0.0439453125, + 0.0009765625, + 0.00048828125, + 0.0009765625, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": -0.0516357421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.165930322115543e-29, + "Q_max": 0.9360631704330444, + "Q_spread": 0.9360631704330444, + "argmax": 7, + "argmax_is_green": true, + "q_of_greenless": 0.05427815020084381 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.013427734375, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7265625, + "cand_all_green": 0.0, + "top_cand_share": 0.01818181818181818, + "frac_green": 0.013427734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.009765625, + 0.0, + 0.05224609375, + 0.04541015625 + ], + "hop_rise": 0.02685546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.04337342828512192, + "Q_spread": 0.04337342828512192, + "argmax": 116, + "argmax_is_green": true, + "q_of_greenless": 3.9107882912503555e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0184326171875, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.578125, + "cand_all_green": 0.0, + "top_cand_share": 0.046357615894039736, + "frac_green": 0.0184326171875, + "hop_green": [ + 0.0, + 0.0, + 0.00439453125, + 0.0068359375, + 0.01416015625, + 0.02978515625, + 0.048828125, + 0.04345703125 + ], + "hop_rise": 0.03125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.07390878391113e-20, + "Q_max": 0.13991853594779968, + "Q_spread": 0.13991853594779968, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.014133017510175705 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.3098228868766455e-07, + "Q_spread": 3.3098228868766455e-07, + "argmax": 3, + "argmax_is_green": false, + "q_of_greenless": 3.3098228868766455e-07 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00408935546875, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.029850746268656716, + "frac_green": 0.00408935546875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.01513671875, + 0.017578125 + ], + "hop_rise": 0.0081787109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.021921638399362564, + "Q_spread": 0.021921638399362564, + "argmax": 19, + "argmax_is_green": true, + "q_of_greenless": 0.016050413250923157 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0042724609375, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.140625, + "cand_all_green": 0.0, + "top_cand_share": 0.3142857142857143, + "frac_green": 0.0042724609375, + "hop_green": [ + 0.0, + 0.0, + 0.001953125, + 0.00439453125, + 0.0029296875, + 0.0068359375, + 0.0087890625, + 0.00927734375 + ], + "hop_rise": 0.00537109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.21100786328315735, + "Q_spread": 0.21100786328315735, + "argmax": 66, + "argmax_is_green": true, + "q_of_greenless": 0.013383802026510239 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.00024659704649820924, + "Q_spread": 0.00024659704649820924, + "argmax": 10, + "argmax_is_green": false, + "q_of_greenless": 0.00024659704649820924 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.21673583984375, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009856378484933821, + "frac_green": 0.21673583984375, + "hop_green": [ + 0.7001953125, + 0.396484375, + 0.2265625, + 0.15087890625, + 0.0703125, + 0.080078125, + 0.0810546875, + 0.0283203125 + ], + "hop_rise": -0.3035888671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.01606835424900055, + "Q_max": 0.8620303869247437, + "Q_spread": 0.8459620475769043, + "argmax": 102, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01727294921875, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.625, + "cand_all_green": 0.0, + "top_cand_share": 0.04240282685512368, + "frac_green": 0.01727294921875, + "hop_green": [ + 0.07568359375, + 0.02099609375, + 0.0087890625, + 0.021484375, + 0.00341796875, + 0.00439453125, + 0.00341796875, + 0.0 + ], + "hop_rise": -0.0289306640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.0578571684901877e-33, + "Q_max": 0.5977671146392822, + "Q_spread": 0.5977671146392822, + "argmax": 42, + "argmax_is_green": true, + "q_of_greenless": 0.04251008480787277 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.006103515625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.01, + "frac_green": 0.006103515625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.048828125, + 0.0 + ], + "hop_rise": 0.01220703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.923361216074263e-35, + "Q_max": 0.018702391535043716, + "Q_spread": 0.018702391535043716, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": 5.481455289668702e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.033447265625, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.53125, + "cand_all_green": 0.0, + "top_cand_share": 0.025547445255474453, + "frac_green": 0.033447265625, + "hop_green": [ + 0.0, + 0.005859375, + 0.01513671875, + 0.04052734375, + 0.05859375, + 0.05908203125, + 0.04150390625, + 0.046875 + ], + "hop_rise": 0.0361328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.833088136732342e-20, + "Q_max": 0.17516286671161652, + "Q_spread": 0.17516286671161652, + "argmax": 108, + "argmax_is_green": true, + "q_of_greenless": 3.0182609407347627e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 1.5156671751004325e-10, + "Q_spread": 1.5156671751004325e-10, + "argmax": 1, + "argmax_is_green": false, + "q_of_greenless": 1.5156671751004325e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00018310546875, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0234375, + "cand_all_green": 0.0, + "top_cand_share": 0.3333333333333333, + "frac_green": 0.00018310546875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.0 + ], + "hop_rise": 0.0003662109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.01985829323530197, + "Q_spread": 0.01985829323530197, + "argmax": 116, + "argmax_is_green": true, + "q_of_greenless": 0.009058521129190922 + }, + { + "task": "square_expert_play", + "episode": "demo_198", + "frame": 110, + "root": "demo_198_t0110", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00897216796875, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.1640625, + "cand_all_green": 0.0, + "top_cand_share": 0.19047619047619047, + "frac_green": 0.00897216796875, + "hop_green": [ + 0.0, + 0.0009765625, + 0.00439453125, + 0.01025390625, + 0.0087890625, + 0.01611328125, + 0.0146484375, + 0.0166015625 + ], + "hop_rise": 0.0101318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.3072814643383026, + "Q_spread": 0.3072814643383026, + "argmax": 26, + "argmax_is_green": true, + "q_of_greenless": 0.029965028166770935 + }, + { + "task": "square_expert_play", + "episode": "demo_54", + "frame": 122, + "root": "demo_54_t0122", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 5.019014861318283e-05, + "Q_spread": 5.019014861318283e-05, + "argmax": 38, + "argmax_is_green": false, + "q_of_greenless": 5.019014861318283e-05 + }, + { + "task": "square_expert_play", + "episode": "demo_181", + "frame": 135, + "root": "demo_181_t0135", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2059326171875, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.01037344398340249, + "frac_green": 0.2059326171875, + "hop_green": [ + 0.6826171875, + 0.3828125, + 0.20556640625, + 0.138671875, + 0.0634765625, + 0.07666015625, + 0.07470703125, + 0.02294921875 + ], + "hop_rise": -0.29296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.125977345557306e-13, + "Q_max": 0.8822919726371765, + "Q_spread": 0.8822919726371765, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": 0.0008873651386238635 + }, + { + "task": "square_expert_play", + "episode": "demo_148", + "frame": 138, + "root": "demo_148_t0138", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01806640625, + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.65625, + "cand_all_green": 0.0, + "top_cand_share": 0.04391891891891892, + "frac_green": 0.01806640625, + "hop_green": [ + 0.0810546875, + 0.02392578125, + 0.009765625, + 0.02294921875, + 0.001953125, + 0.0029296875, + 0.001953125, + 0.0 + ], + "hop_rise": -0.03271484375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.5060675367795214e-31, + "Q_max": 0.5709527730941772, + "Q_spread": 0.5709527730941772, + "argmax": 63, + "argmax_is_green": true, + "q_of_greenless": 0.04087265580892563 + }, + { + "task": "square_expert_play", + "episode": "demo_164", + "frame": 93, + "root": "demo_164_t0093", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0064697265625, + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.009433962264150943, + "frac_green": 0.0064697265625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0517578125, + 0.0 + ], + "hop_rise": 0.012939453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 0.018702151253819466, + "Q_spread": 0.018702151253819466, + "argmax": 67, + "argmax_is_green": true, + "q_of_greenless": 8.800782151652253e-12 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02410888671875, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.40625, + "cand_all_green": 0.0, + "top_cand_share": 0.030379746835443037, + "frac_green": 0.02410888671875, + "hop_green": [ + 0.0, + 0.0029296875, + 0.00830078125, + 0.02685546875, + 0.03857421875, + 0.04248046875, + 0.03662109375, + 0.037109375 + ], + "hop_rise": 0.0291748046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.673880515174877e-21, + "Q_max": 0.1760268211364746, + "Q_spread": 0.1760268211364746, + "argmax": 25, + "argmax_is_green": true, + "q_of_greenless": 1.5778803117427742e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_150", + "frame": 125, + "root": "demo_150_t0125", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0, + "Q_max": 3.3544500510629405e-10, + "Q_spread": 3.3544500510629405e-10, + "argmax": 104, + "argmax_is_green": false, + "q_of_greenless": 3.3544500510629405e-10 + }, + { + "task": "square_expert_play", + "episode": "demo_88", + "frame": 144, + "root": "demo_88_t0144", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00018310546875, + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0234375, + "cand_all_green": 0.0, + "top_cand_share": 0.3333333333333333, + "frac_green": 0.00018310546875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.0 + ], + "hop_rise": 0.0003662109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.763111173313519e-07, + "Q_max": 0.01973309926688671, + "Q_spread": 0.01973242312669754, + "argmax": 40, + "argmax_is_green": true, + "q_of_greenless": 0.007586801424622536 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_cpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1558837890625, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.328125, + "cand_all_green": 0.0, + "top_cand_share": 0.030540328895849646, + "frac_green": 0.1558837890625, + "hop_green": [ + 0.01953125, + 0.0625, + 0.134765625, + 0.12646484375, + 0.20703125, + 0.22119140625, + 0.2265625, + 0.2490234375 + ], + "hop_rise": 0.14013671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.1685416296945818e-28, + "Q_max": 0.6141054630279541, + "Q_spread": 0.6141054630279541, + "argmax": 71, + "argmax_is_green": true, + "q_of_greenless": 2.037808290167309e-11 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_cpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02874755859375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4453125, + "cand_all_green": 0.0, + "top_cand_share": 0.03184713375796178, + "frac_green": 0.02874755859375, + "hop_green": [ + 0.0, + 0.00732421875, + 0.01611328125, + 0.0390625, + 0.05322265625, + 0.05029296875, + 0.02880859375, + 0.03515625 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.3383433950132242e-21, + "Q_max": 0.15529954433441162, + "Q_spread": 0.15529954433441162, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": 2.238320121250581e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_cpuBdemo_212", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02557373046875, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.026252983293556086, + "frac_green": 0.02557373046875, + "hop_green": [ + 0.0, + 0.00537109375, + 0.0126953125, + 0.03076171875, + 0.044921875, + 0.04248046875, + 0.03369140625, + 0.03466796875 + ], + "hop_rise": 0.0267333984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 8.729295973202488e-22, + "Q_max": 0.1601223349571228, + "Q_spread": 0.1601223349571228, + "argmax": 1, + "argmax_is_green": true, + "q_of_greenless": 1.4723970025443123e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_cpuBdemo_36", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.15557861328125, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.3203125, + "cand_all_green": 0.0, + "top_cand_share": 0.03216947822675559, + "frac_green": 0.15557861328125, + "hop_green": [ + 0.0205078125, + 0.06494140625, + 0.13623046875, + 0.130859375, + 0.20556640625, + 0.216796875, + 0.22509765625, + 0.24462890625 + ], + "hop_rise": 0.1348876953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.9919604525305522e-29, + "Q_max": 0.6839041709899902, + "Q_spread": 0.6839041709899902, + "argmax": 118, + "argmax_is_green": true, + "q_of_greenless": 1.6956539796407488e-13 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_cpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1668701171875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.3515625, + "cand_all_green": 0.0, + "top_cand_share": 0.03035844915874177, + "frac_green": 0.1668701171875, + "hop_green": [ + 0.021484375, + 0.0693359375, + 0.1474609375, + 0.13818359375, + 0.22216796875, + 0.2373046875, + 0.23974609375, + 0.25927734375 + ], + "hop_rise": 0.1455078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.848491326444347e-27, + "Q_max": 0.6687449812889099, + "Q_spread": 0.6687449812889099, + "argmax": 23, + "argmax_is_green": true, + "q_of_greenless": 6.331094676292892e-11 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_cpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02972412109375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.46875, + "cand_all_green": 0.0, + "top_cand_share": 0.03285420944558522, + "frac_green": 0.02972412109375, + "hop_green": [ + 0.0, + 0.00341796875, + 0.015625, + 0.0361328125, + 0.05224609375, + 0.05126953125, + 0.03759765625, + 0.04150390625 + ], + "hop_rise": 0.0318603515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "Q_spread": 0.23395879566669464, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 4.332096978032496e-06 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_gpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.18768310546875, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.4609375, + "cand_all_green": 0.0, + "top_cand_share": 0.024390243902439025, + "frac_green": 0.18768310546875, + "hop_green": [ + 0.00244140625, + 0.13037109375, + 0.158203125, + 0.22509765625, + 0.27001953125, + 0.30419921875, + 0.23486328125, + 0.17626953125 + ], + "hop_rise": 0.1173095703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.596318239747959e-25, + "Q_max": 0.6247960329055786, + "Q_spread": 0.6247960329055786, + "argmax": 29, + "argmax_is_green": true, + "q_of_greenless": 5.1264605760307017e-14 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_gpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0169677734375, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.5703125, + "cand_all_green": 0.0, + "top_cand_share": 0.0683453237410072, + "frac_green": 0.0169677734375, + "hop_green": [ + 0.0, + 0.0, + 0.00439453125, + 0.00390625, + 0.01318359375, + 0.02294921875, + 0.05322265625, + 0.0380859375 + ], + "hop_rise": 0.02978515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.2471894526420409e-19, + "Q_max": 0.1738433539867401, + "Q_spread": 0.1738433539867401, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 0.01733560860157013 + }, + { + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_gpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1556396484375, + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.3828125, + "cand_all_green": 0.0, + "top_cand_share": 0.02627450980392157, + "frac_green": 0.1556396484375, + "hop_green": [ + 0.00439453125, + 0.1123046875, + 0.1435546875, + 0.18359375, + 0.21826171875, + 0.2509765625, + 0.189453125, + 0.142578125 + ], + "hop_rise": 0.08935546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9299438022295344e-27, + "Q_max": 0.6444095969200134, + "Q_spread": 0.6444095969200134, + "argmax": 124, + "argmax_is_green": true, + "q_of_greenless": 0.001641122973524034 + }, + { + "task": "square_expert_play", + "episode": "demo_212", + "frame": 141, + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_gpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.020263671875, + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.0391566265060241, + "frac_green": 0.020263671875, + "hop_green": [ + 0.0, + 0.0, + 0.00341796875, + 0.00537109375, + 0.0146484375, + 0.02783203125, + 0.06201171875, + 0.048828125 + ], + "hop_rise": 0.0361328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.7504579316826455e-21, + "Q_max": 0.13475771248340607, + "Q_spread": 0.13475771248340607, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.013355374336242676 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "root": "demo_106_t0035", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01983642578125, + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.015384615384615385, + "frac_green": 0.01983642578125, + "hop_green": [ + 0.0, + 0.0, + 0.0009765625, + 0.0009765625, + 0.0, + 0.02978515625, + 0.064453125, + 0.0625 + ], + "hop_rise": 0.0386962890625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.019061341881752014, + "Q_max": 0.08237418532371521, + "Q_spread": 0.0633128434419632, + "argmax": 125, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "root": "demo_99_t0057", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.04156494140625, + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010279001468428781, + "frac_green": 0.04156494140625, + "hop_green": [ + 0.0, + 0.01220703125, + 0.0, + 0.068359375, + 0.06103515625, + 0.060546875, + 0.0625, + 0.06787109375 + ], + "hop_rise": 0.0428466796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.11163482069969177, + "Q_max": 0.1695835292339325, + "Q_spread": 0.05794870853424072, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "root": "demo_143_t0154", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009854014598540146, + "frac_green": 0.167236328125, + "hop_green": [ + 0.0, + 0.06494140625, + 0.18359375, + 0.29052734375, + 0.27587890625, + 0.1474609375, + 0.22119140625, + 0.154296875 + ], + "hop_rise": 0.06494140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_spread": 0.09305314719676971, + "argmax": 94, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "root": "demo_102_t0198", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.011428571428571429, + "frac_green": 0.01068115234375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.05908203125, + 0.0, + 0.02587890625 + ], + "hop_rise": 0.0213623046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.504642619706563e-22, + "Q_max": 0.03459713235497475, + "Q_spread": 0.03459713235497475, + "argmax": 110, + "argmax_is_green": true, + "q_of_greenless": 3.8611986497016915e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "root": "demo_171_t0244", + "dir": "stitchviz", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0001220703125, + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.015625, + "cand_all_green": 0.0, + "top_cand_share": 0.5, + "frac_green": 0.0001220703125, + "hop_green": [ + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0, + 0.00048828125, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.7732108921773033e-06, + "Q_max": 0.02326813153922558, + "Q_spread": 0.023264357820153236, + "argmax": 123, + "argmax_is_green": true, + "q_of_greenless": 0.009346847422420979 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0101318359375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024096385542168676, + "frac_green": 0.0101318359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01220703125, + 0.01220703125, + 0.00244140625, + 0.01708984375, + 0.037109375 + ], + "hop_rise": 0.01416015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0009374454384669662, + "Q_max": 0.07211869955062866, + "Q_spread": 0.07118125259876251, + "argmax": 127, + "argmax_is_green": true, + "q_of_greenless": 0.018065709620714188 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09515380859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.765625, + "cand_all_green": 0.0, + "top_cand_share": 0.026298909557408594, + "frac_green": 0.09515380859375, + "hop_green": [ + 0.26220703125, + 0.134765625, + 0.12451171875, + 0.05615234375, + 0.07861328125, + 0.05224609375, + 0.0302734375, + 0.0224609375 + ], + "hop_rise": -0.0985107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00019940944912377745, + "Q_max": 0.9406136274337769, + "Q_spread": 0.9404141902923584, + "argmax": 60, + "argmax_is_green": true, + "q_of_greenless": 0.04701278358697891 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01641845703125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.03345724907063197, + "frac_green": 0.01641845703125, + "hop_green": [ + 0.00439453125, + 0.052734375, + 0.0576171875, + 0.01025390625, + 0.0, + 0.00048828125, + 0.005859375, + 0.0 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015772078186273575, + "Q_max": 0.48050427436828613, + "Q_spread": 0.46473219990730286, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.05498268082737923 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0101318359375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024096385542168676, + "frac_green": 0.0101318359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01220703125, + 0.01220703125, + 0.00244140625, + 0.01708984375, + 0.037109375 + ], + "hop_rise": 0.01416015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0009374454384669662, + "Q_max": 0.07211869955062866, + "Q_spread": 0.07118125259876251, + "argmax": 127, + "argmax_is_green": true, + "q_of_greenless": 0.018065709620714188 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09515380859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.765625, + "cand_all_green": 0.0, + "top_cand_share": 0.026298909557408594, + "frac_green": 0.09515380859375, + "hop_green": [ + 0.26220703125, + 0.134765625, + 0.12451171875, + 0.05615234375, + 0.07861328125, + 0.05224609375, + 0.0302734375, + 0.0224609375 + ], + "hop_rise": -0.0985107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00019940944912377745, + "Q_max": 0.9406136274337769, + "Q_spread": 0.9404141902923584, + "argmax": 60, + "argmax_is_green": true, + "q_of_greenless": 0.04701278358697891 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed0dup", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01641845703125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.03345724907063197, + "frac_green": 0.01641845703125, + "hop_green": [ + 0.00439453125, + 0.052734375, + 0.0576171875, + 0.01025390625, + 0.0, + 0.00048828125, + 0.005859375, + 0.0 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015772078186273575, + "Q_max": 0.48050427436828613, + "Q_spread": 0.46473219990730286, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.05498268082737923 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00970458984375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.031446540880503145, + "frac_green": 0.00970458984375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.017578125, + 0.0068359375, + 0.0009765625, + 0.0166015625, + 0.03564453125 + ], + "hop_rise": 0.0106201171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0004440488701220602, + "Q_max": 0.09887169301509857, + "Q_spread": 0.09842764586210251, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": 0.018300766125321388 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1005859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8046875, + "cand_all_green": 0.0, + "top_cand_share": 0.02487864077669903, + "frac_green": 0.1005859375, + "hop_green": [ + 0.28271484375, + 0.15087890625, + 0.140625, + 0.0556640625, + 0.08447265625, + 0.04931640625, + 0.02734375, + 0.013671875 + ], + "hop_rise": -0.11376953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00021297408966347575, + "Q_max": 0.9908179044723511, + "Q_spread": 0.9906049370765686, + "argmax": 41, + "argmax_is_green": true, + "q_of_greenless": 0.04449361562728882 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01702880859375, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9453125, + "cand_all_green": 0.0, + "top_cand_share": 0.017921146953405017, + "frac_green": 0.01702880859375, + "hop_green": [ + 0.0, + 0.0546875, + 0.06103515625, + 0.009765625, + 0.00048828125, + 0.00390625, + 0.00634765625, + 0.0 + ], + "hop_rise": -0.0286865234375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.022601792588829994, + "Q_max": 0.16994653642177582, + "Q_spread": 0.14734473824501038, + "argmax": 11, + "argmax_is_green": true, + "q_of_greenless": 0.06686937063932419 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00970458984375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8046875, + "cand_all_green": 0.0, + "top_cand_share": 0.025157232704402517, + "frac_green": 0.00970458984375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00732421875, + 0.00830078125, + 0.00244140625, + 0.02099609375, + 0.03857421875 + ], + "hop_rise": 0.0157470703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0004408314707688987, + "Q_max": 0.06097593531012535, + "Q_spread": 0.06053510308265686, + "argmax": 18, + "argmax_is_green": true, + "q_of_greenless": 0.018501631915569305 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0986328125, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.022277227722772276, + "frac_green": 0.0986328125, + "hop_green": [ + 0.30810546875, + 0.13720703125, + 0.12353515625, + 0.05224609375, + 0.07666015625, + 0.04541015625, + 0.0263671875, + 0.01953125 + ], + "hop_rise": -0.11328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00022240701946429908, + "Q_max": 0.9282999038696289, + "Q_spread": 0.9280775189399719, + "argmax": 71, + "argmax_is_green": true, + "q_of_greenless": 0.054910093545913696 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.014892578125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.921875, + "cand_all_green": 0.0, + "top_cand_share": 0.020491803278688523, + "frac_green": 0.014892578125, + "hop_green": [ + 0.0, + 0.048828125, + 0.05615234375, + 0.0078125, + 0.00048828125, + 0.00048828125, + 0.00537109375, + 0.0 + ], + "hop_rise": -0.026611328125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.020947592332959175, + "Q_max": 0.14504991471767426, + "Q_spread": 0.12410232424736023, + "argmax": 56, + "argmax_is_green": true, + "q_of_greenless": 0.05914219468832016 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01007080078125, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.030303030303030304, + "frac_green": 0.01007080078125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00927734375, + 0.0107421875, + 0.00341796875, + 0.0234375, + 0.03369140625 + ], + "hop_rise": 0.0155029296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.000509019591845572, + "Q_max": 0.08491256088018417, + "Q_spread": 0.08440354466438293, + "argmax": 115, + "argmax_is_green": true, + "q_of_greenless": 0.014964050613343716 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08929443359375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.734375, + "cand_all_green": 0.0, + "top_cand_share": 0.026657552973342446, + "frac_green": 0.08929443359375, + "hop_green": [ + 0.3076171875, + 0.1103515625, + 0.10009765625, + 0.0458984375, + 0.0625, + 0.0419921875, + 0.02734375, + 0.0185546875 + ], + "hop_rise": -0.1033935546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0001925603864947334, + "Q_max": 0.9327669739723206, + "Q_spread": 0.9325743913650513, + "argmax": 42, + "argmax_is_green": true, + "q_of_greenless": 0.042986854910850525 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_seed3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01531982421875, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9375, + "cand_all_green": 0.0, + "top_cand_share": 0.01593625498007968, + "frac_green": 0.01531982421875, + "hop_green": [ + 0.0, + 0.05078125, + 0.056640625, + 0.01171875, + 0.0, + 0.00146484375, + 0.001953125, + 0.0 + ], + "hop_rise": -0.0289306640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.02585091069340706, + "Q_max": 0.1552058607339859, + "Q_spread": 0.12935495376586914, + "argmax": 126, + "argmax_is_green": true, + "q_of_greenless": 0.04840202257037163 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0108642578125, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028089887640449437, + "frac_green": 0.0108642578125, + "hop_green": [ + 0.0, + 0.0, + 0.00634765625, + 0.0029296875, + 0.00048828125, + 0.01318359375, + 0.01220703125, + 0.0517578125 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014911642065271735, + "Q_max": 0.05342011898756027, + "Q_spread": 0.05192895606160164, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.01908215507864952 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.159912109375, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.009541984732824428, + "frac_green": 0.159912109375, + "hop_green": [ + 0.0, + 0.07861328125, + 0.14013671875, + 0.224609375, + 0.08349609375, + 0.26220703125, + 0.2822265625, + 0.2080078125 + ], + "hop_rise": 0.09814453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014558101538568735, + "Q_max": 0.27829867601394653, + "Q_spread": 0.27684286236763, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.0014558101538568735 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.008544921875, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.02142857142857143, + "frac_green": 0.008544921875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0009765625, + 0.00927734375, + 0.01220703125, + 0.0458984375 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.004533246159553528, + "Q_max": 0.046014029532670975, + "Q_spread": 0.04148078337311745, + "argmax": 112, + "argmax_is_green": true, + "q_of_greenless": 0.015510505065321922 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8515625, + "cand_all_green": 0.0, + "top_cand_share": 0.028985507246376812, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.0, + 0.0, + 0.00537109375, + 0.00341796875, + 0.00048828125, + 0.013671875, + 0.0126953125, + 0.0654296875 + ], + "hop_rise": 0.0208740234375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0015533649129793048, + "Q_max": 0.05688374862074852, + "Q_spread": 0.05533038452267647, + "argmax": 102, + "argmax_is_green": true, + "q_of_greenless": 0.01922977715730667 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.16375732421875, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.008945210585165859, + "frac_green": 0.16375732421875, + "hop_green": [ + 0.00048828125, + 0.08056640625, + 0.1396484375, + 0.22998046875, + 0.08740234375, + 0.265625, + 0.2900390625, + 0.21630859375 + ], + "hop_rise": 0.1021728515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.13952432572841644, + "Q_max": 0.25942450761795044, + "Q_spread": 0.119900181889534, + "argmax": 36, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.008544921875, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9375, + "cand_all_green": 0.0, + "top_cand_share": 0.02142857142857143, + "frac_green": 0.008544921875, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.01171875, + 0.017578125, + 0.0390625 + ], + "hop_rise": 0.01708984375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.004907257854938507, + "Q_max": 0.04317096248269081, + "Q_spread": 0.038263704627752304, + "argmax": 109, + "argmax_is_green": true, + "q_of_greenless": 0.01715206727385521 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0120849609375, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.025252525252525252, + "frac_green": 0.0120849609375, + "hop_green": [ + 0.0, + 0.0, + 0.00341796875, + 0.00341796875, + 0.0, + 0.013671875, + 0.0146484375, + 0.0615234375 + ], + "hop_rise": 0.020751953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0011750860139727592, + "Q_max": 0.056373901665210724, + "Q_spread": 0.05519881471991539, + "argmax": 111, + "argmax_is_green": true, + "q_of_greenless": 0.021753884851932526 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.16290283203125, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009366804046459348, + "frac_green": 0.16290283203125, + "hop_green": [ + 0.0, + 0.083984375, + 0.13671875, + 0.23046875, + 0.080078125, + 0.26513671875, + 0.29150390625, + 0.21533203125 + ], + "hop_rise": 0.1002197265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.13944321870803833, + "Q_max": 0.2593776285648346, + "Q_spread": 0.11993440985679626, + "argmax": 104, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00836181640625, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9296875, + "cand_all_green": 0.0, + "top_cand_share": 0.021897810218978103, + "frac_green": 0.00836181640625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00048828125, + 0.0009765625, + 0.00634765625, + 0.01171875, + 0.04736328125 + ], + "hop_rise": 0.0164794921875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0054939063265919685, + "Q_max": 0.0461905375123024, + "Q_spread": 0.040696632117033005, + "argmax": 86, + "argmax_is_green": true, + "q_of_greenless": 0.013945415616035461 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_185", + "frame": 256, + "root": "demo_185_t0256", + "dir": "stitchviz_seedFAR3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01263427734375, + "name": "two_piece_expert_play_demo_185_t0256_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.024154589371980676, + "frac_green": 0.01263427734375, + "hop_green": [ + 0.0, + 0.0, + 0.00390625, + 0.001953125, + 0.0, + 0.01318359375, + 0.01513671875, + 0.06689453125 + ], + "hop_rise": 0.0223388671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0010019965702667832, + "Q_max": 0.0576312318444252, + "Q_spread": 0.0566292367875576, + "argmax": 122, + "argmax_is_green": true, + "q_of_greenless": 0.020408568903803825 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_174", + "frame": 479, + "root": "demo_174_t0479", + "dir": "stitchviz_seedFAR3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1641845703125, + "name": "two_piece_expert_play_demo_174_t0479_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009665427509293681, + "frac_green": 0.1641845703125, + "hop_green": [ + 0.0, + 0.08056640625, + 0.13916015625, + 0.22607421875, + 0.087890625, + 0.2666015625, + 0.29345703125, + 0.2197265625 + ], + "hop_rise": 0.10546875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.14139467477798462, + "Q_max": 0.26251980662345886, + "Q_spread": 0.12112513184547424, + "argmax": 96, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_117", + "frame": 77, + "root": "demo_117_t0077", + "dir": "stitchviz_seedFAR3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00933837890625, + "name": "two_piece_expert_play_demo_117_t0077_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.96875, + "cand_all_green": 0.0, + "top_cand_share": 0.0196078431372549, + "frac_green": 0.00933837890625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00830078125, + 0.0166015625, + 0.0498046875 + ], + "hop_rise": 0.0186767578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.005635828245431185, + "Q_max": 0.04626983404159546, + "Q_spread": 0.04063400626182556, + "argmax": 32, + "argmax_is_green": true, + "q_of_greenless": 0.018221067264676094 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0098876953125, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.018518518518518517, + "frac_green": 0.0098876953125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00927734375, + 0.001953125, + 0.0, + 0.00439453125, + 0.0634765625 + ], + "hop_rise": 0.01513671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0025416151620447636, + "Q_max": 0.0513761043548584, + "Q_spread": 0.04883448779582977, + "argmax": 81, + "argmax_is_green": true, + "q_of_greenless": 0.0034241038374602795 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.56170654296875, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010648701510377051, + "frac_green": 0.56170654296875, + "hop_green": [ + 0.884765625, + 0.71044921875, + 0.65478515625, + 0.5712890625, + 0.48828125, + 0.46533203125, + 0.38330078125, + 0.33544921875 + ], + "hop_rise": -0.2872314453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.09469607472419739, + "Q_max": 0.9999012351036072, + "Q_spread": 0.9052051305770874, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP0", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08221435546875, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014847809948032665, + "frac_green": 0.08221435546875, + "hop_green": [ + 0.01220703125, + 0.1064453125, + 0.1748046875, + 0.09130859375, + 0.14794921875, + 0.052734375, + 0.056640625, + 0.015625 + ], + "hop_rise": -0.0279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.5286317395512015e-06, + "Q_max": 0.30794060230255127, + "Q_spread": 0.3079380691051483, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": 2.5286317395512015e-06 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01068115234375, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.022857142857142857, + "frac_green": 0.01068115234375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.01171875, + 0.00439453125, + 0.0, + 0.0048828125, + 0.064453125 + ], + "hop_rise": 0.0155029296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015959888696670532, + "Q_max": 0.05745534598827362, + "Q_spread": 0.04149545729160309, + "argmax": 3, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5657958984375, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010679611650485437, + "frac_green": 0.5657958984375, + "hop_green": [ + 0.8896484375, + 0.71142578125, + 0.66259765625, + 0.58154296875, + 0.48974609375, + 0.47119140625, + 0.38525390625, + 0.3349609375 + ], + "hop_rise": -0.291015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.18542072176933289, + "Q_max": 0.9998902082443237, + "Q_spread": 0.8144694566726685, + "argmax": 46, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP1", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08673095703125, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.013370865587614356, + "frac_green": 0.08673095703125, + "hop_green": [ + 0.0146484375, + 0.11572265625, + 0.17578125, + 0.10009765625, + 0.1650390625, + 0.05078125, + 0.0556640625, + 0.01611328125 + ], + "hop_rise": -0.0296630859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.1254429817199707, + "Q_max": 0.3364698886871338, + "Q_spread": 0.21102690696716309, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00933837890625, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.026143790849673203, + "frac_green": 0.00933837890625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.00439453125, + 0.00146484375, + 0.0, + 0.00341796875, + 0.0654296875 + ], + "hop_rise": 0.0164794921875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.016007084399461746, + "Q_max": 0.061455462127923965, + "Q_spread": 0.04544837772846222, + "argmax": 112, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.58343505859375, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010147504969139031, + "frac_green": 0.58343505859375, + "hop_green": [ + 0.876953125, + 0.7333984375, + 0.68603515625, + 0.59814453125, + 0.509765625, + 0.49755859375, + 0.41015625, + 0.35546875 + ], + "hop_rise": -0.2803955078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.10745294392108917, + "Q_max": 0.99985271692276, + "Q_spread": 0.892399787902832, + "argmax": 19, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.092041015625, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.013925729442970823, + "frac_green": 0.092041015625, + "hop_green": [ + 0.0107421875, + 0.11083984375, + 0.17724609375, + 0.1142578125, + 0.18359375, + 0.0576171875, + 0.06689453125, + 0.01513671875 + ], + "hop_rise": -0.0224609375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.04944809898734093, + "Q_max": 0.2951880693435669, + "Q_spread": 0.24573996663093567, + "argmax": 114, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_105", + "frame": 113, + "root": "demo_105_t0113", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00909423828125, + "name": "two_piece_expert_play_demo_105_t0113_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.020134228187919462, + "frac_green": 0.00909423828125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0048828125, + 0.00048828125, + 0.0, + 0.00341796875, + 0.06396484375 + ], + "hop_rise": 0.0157470703125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.015934905037283897, + "Q_max": 0.05053364112973213, + "Q_spread": 0.034598737955093384, + "argmax": 56, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_75", + "frame": 199, + "root": "demo_75_t0199", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.5809326171875, + "name": "two_piece_expert_play_demo_75_t0199_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01029628073124606, + "frac_green": 0.5809326171875, + "hop_green": [ + 0.88330078125, + 0.72607421875, + 0.68017578125, + 0.59326171875, + 0.50732421875, + 0.49462890625, + 0.40625, + 0.3564453125 + ], + "hop_rise": -0.279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.06198078393936157, + "Q_max": 0.9999346733093262, + "Q_spread": 0.9379538893699646, + "argmax": 32, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_165", + "frame": 157, + "root": "demo_165_t0157", + "dir": "stitchviz_seedTYP3", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08660888671875, + "name": "two_piece_expert_play_demo_165_t0157_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.015503875968992248, + "frac_green": 0.08660888671875, + "hop_green": [ + 0.0087890625, + 0.1103515625, + 0.17919921875, + 0.10791015625, + 0.16357421875, + 0.04833984375, + 0.05615234375, + 0.0185546875 + ], + "hop_rise": -0.0299072265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.1281203031539917, + "Q_max": 0.2960023581981659, + "Q_spread": 0.1678820550441742, + "argmax": 35, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "root": "demo_143_t0154", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.167236328125, + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009854014598540146, + "frac_green": 0.167236328125, + "hop_green": [ + 0.0, + 0.06494140625, + 0.18359375, + 0.29052734375, + 0.27587890625, + 0.1474609375, + 0.22119140625, + 0.154296875 + ], + "hop_rise": 0.06494140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_spread": 0.09305314719676971, + "argmax": 94, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_split", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "root": "demo_129_t0084", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0885009765625, + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "frac_green": 0.0885009765625, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "hop_rise": 0.0791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_spread": 0.23481233417987823, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.255859375, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011927480916030535, + "frac_green": 0.255859375, + "hop_green": [ + 0.005859375, + 0.1103515625, + 0.3359375, + 0.21728515625, + 0.43017578125, + 0.41064453125, + 0.26123046875, + 0.275390625 + ], + "hop_rise": 0.177001953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "Q_spread": 0.36739271879196167, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_198", + "frame": 166, + "root": "demo_198_t0166", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.051513671875, + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.03317535545023697, + "frac_green": 0.051513671875, + "hop_green": [ + 0.001953125, + 0.12548828125, + 0.11962890625, + 0.05029296875, + 0.04296875, + 0.01513671875, + 0.0126953125, + 0.0439453125 + ], + "hop_rise": -0.045654296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.769107858417556e-05, + "Q_max": 0.38457581400871277, + "Q_spread": 0.3845081329345703, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.017471471801400185 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_64", + "frame": 192, + "root": "demo_64_t0192", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.05419921875, + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028153153153153154, + "frac_green": 0.05419921875, + "hop_green": [ + 0.24755859375, + 0.0859375, + 0.0263671875, + 0.0224609375, + 0.0166015625, + 0.009765625, + 0.01123046875, + 0.013671875 + ], + "hop_rise": -0.082763671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0006882615271024406, + "Q_max": 0.704879105091095, + "Q_spread": 0.7041908502578735, + "argmax": 86, + "argmax_is_green": true, + "q_of_greenless": 0.11513863503932953 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_153", + "frame": 112, + "root": "demo_153_t0112", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.15411376953125, + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009900990099009901, + "frac_green": 0.15411376953125, + "hop_green": [ + 0.0166015625, + 0.12255859375, + 0.18701171875, + 0.25634765625, + 0.2099609375, + 0.22705078125, + 0.14697265625, + 0.06640625 + ], + "hop_rise": 0.0169677734375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 7.312361844924453e-07, + "Q_max": 0.32301434874534607, + "Q_spread": 0.3230136036872864, + "argmax": 77, + "argmax_is_green": true, + "q_of_greenless": 0.008339659310877323 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_6", + "frame": 180, + "root": "demo_6_t0180", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1658935546875, + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009565857247976454, + "frac_green": 0.1658935546875, + "hop_green": [ + 0.08740234375, + 0.2314453125, + 0.4189453125, + 0.25, + 0.0654296875, + 0.12109375, + 0.060546875, + 0.09228515625 + ], + "hop_rise": -0.162109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.3845299482345581, + "Q_max": 0.5868167877197266, + "Q_spread": 0.20228683948516846, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_split2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0074462890625, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.9140625, + "cand_all_green": 0.0, + "top_cand_share": 0.01639344262295082, + "frac_green": 0.0074462890625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0009765625, + 0.00146484375, + 0.00048828125, + 0.056640625 + ], + "hop_rise": 0.014892578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.965724656358361e-05, + "Q_max": 0.04319200664758682, + "Q_spread": 0.043142348527908325, + "argmax": 93, + "argmax_is_green": true, + "q_of_greenless": 0.0032913843169808388 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12005615234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "frac_green": 0.12005615234375, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "hop_rise": -0.0743408203125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "argmax": 82, + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01348876953125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.03167420814479638, + "frac_green": 0.01348876953125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.06396484375, + 0.00048828125, + 0.0341796875, + 0.0078125, + 0.00146484375 + ], + "hop_rise": -0.0050048828125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.04491756856441498, + "Q_max": 0.09216669201850891, + "Q_spread": 0.04724912345409393, + "argmax": 73, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00616455078125, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.019801980198019802, + "frac_green": 0.00616455078125, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.00146484375, + 0.00048828125, + 0.04736328125 + ], + "hop_rise": 0.0123291015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.6458745196578093e-05, + "Q_max": 0.026393426582217216, + "Q_spread": 0.02636696770787239, + "argmax": 41, + "argmax_is_green": true, + "q_of_greenless": 0.010613691061735153 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.11474609375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.025, + "frac_green": 0.11474609375, + "hop_green": [ + 0.27392578125, + 0.15185546875, + 0.1103515625, + 0.09326171875, + 0.09521484375, + 0.083984375, + 0.06787109375, + 0.04150390625 + ], + "hop_rise": -0.085205078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0008276841836050153, + "Q_max": 0.8403615355491638, + "Q_spread": 0.8395338654518127, + "argmax": 22, + "argmax_is_green": true, + "q_of_greenless": 0.028812099248170853 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01470947265625, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.05394190871369295, + "frac_green": 0.01470947265625, + "hop_green": [ + 0.001953125, + 0.00146484375, + 0.0009765625, + 0.06640625, + 0.00244140625, + 0.03466796875, + 0.0087890625, + 0.0009765625 + ], + "hop_rise": -0.0059814453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.04604080319404602, + "Q_max": 0.23029959201812744, + "Q_spread": 0.18425878882408142, + "argmax": 59, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02105712890625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7109375, + "cand_all_green": 0.0, + "top_cand_share": 0.028985507246376812, + "frac_green": 0.02105712890625, + "hop_green": [ + 0.0, + 0.02099609375, + 0.01171875, + 0.0390625, + 0.01513671875, + 0.0419921875, + 0.0302734375, + 0.00927734375 + ], + "hop_rise": 0.0062255859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.0167299175664084e-07, + "Q_max": 0.12913301587104797, + "Q_spread": 0.12913261353969574, + "argmax": 1, + "argmax_is_green": true, + "q_of_greenless": 0.02041761204600334 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.94027550238585e-15, + "Q_max": 7.936003498798527e-08, + "Q_spread": 7.936003498798527e-08, + "argmax": 85, + "argmax_is_green": false, + "q_of_greenless": 7.936003498798527e-08 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00830078125, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.953125, + "cand_all_green": 0.0, + "top_cand_share": 0.051470588235294115, + "frac_green": 0.00830078125, + "hop_green": [ + 0.0, + 0.0, + 0.00146484375, + 0.001953125, + 0.00146484375, + 0.00146484375, + 0.05908203125, + 0.0009765625 + ], + "hop_rise": 0.014892578125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 1.0842872377736512e-08, + "Q_max": 0.07263443619012833, + "Q_spread": 0.07263442873954773, + "argmax": 62, + "argmax_is_green": true, + "q_of_greenless": 0.012364218942821026 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01129150390625, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.734375, + "cand_all_green": 0.0, + "top_cand_share": 0.02702702702702703, + "frac_green": 0.01129150390625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0283203125, + 0.0107421875, + 0.00341796875, + 0.0078125, + 0.0400390625 + ], + "hop_rise": 0.0084228515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 6.675629151686735e-07, + "Q_max": 0.08670267462730408, + "Q_spread": 0.08670200407505035, + "argmax": 44, + "argmax_is_green": true, + "q_of_greenless": 0.01302293874323368 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.14874267578125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "frac_green": 0.14874267578125, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "hop_rise": 0.0262451171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_spread": 0.3587205410003662, + "argmax": 64, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00885009765625, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.020689655172413793, + "frac_green": 0.00885009765625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0078125, + 0.0068359375, + 0.0029296875, + 0.0205078125, + 0.03271484375 + ], + "hop_rise": 0.0137939453125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0002518524706829339, + "Q_max": 0.07879512012004852, + "Q_spread": 0.0785432681441307, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": 0.013751080259680748 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0841064453125, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.6796875, + "cand_all_green": 0.0, + "top_cand_share": 0.029753265602322207, + "frac_green": 0.0841064453125, + "hop_green": [ + 0.265625, + 0.11962890625, + 0.10205078125, + 0.04248046875, + 0.06005859375, + 0.041015625, + 0.02587890625, + 0.01611328125 + ], + "hop_rise": -0.0966796875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00017631723312661052, + "Q_max": 0.9497786164283752, + "Q_spread": 0.9496023058891296, + "argmax": 13, + "argmax_is_green": true, + "q_of_greenless": 0.03984104096889496 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01593017578125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.90625, + "cand_all_green": 0.0, + "top_cand_share": 0.01532567049808429, + "frac_green": 0.01593017578125, + "hop_green": [ + 0.0, + 0.05322265625, + 0.05810546875, + 0.0078125, + 0.0, + 0.00390625, + 0.00439453125, + 0.0 + ], + "hop_rise": -0.0277099609375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.023758510127663612, + "Q_max": 0.1580413579940796, + "Q_spread": 0.13428284227848053, + "argmax": 34, + "argmax_is_green": true, + "q_of_greenless": 0.06285262107849121 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02978515625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.6953125, + "cand_all_green": 0.0, + "top_cand_share": 0.018442622950819672, + "frac_green": 0.02978515625, + "hop_green": [ + 0.0, + 0.0390625, + 0.02197265625, + 0.03662109375, + 0.0595703125, + 0.0322265625, + 0.0244140625, + 0.0244140625 + ], + "hop_rise": 0.0107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.0457875962165417e-06, + "Q_max": 0.1604074239730835, + "Q_spread": 0.16040538251399994, + "argmax": 91, + "argmax_is_green": true, + "q_of_greenless": 0.07561797648668289 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.377706828767244e-15, + "Q_max": 4.3708237029704833e-10, + "Q_spread": 4.3707798491610106e-10, + "argmax": 14, + "argmax_is_green": false, + "q_of_greenless": 4.3708237029704833e-10 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0067138671875, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.390625, + "cand_all_green": 0.0, + "top_cand_share": 0.06363636363636363, + "frac_green": 0.0067138671875, + "hop_green": [ + 0.0, + 0.00048828125, + 0.00439453125, + 0.001953125, + 0.001953125, + 0.01806640625, + 0.01806640625, + 0.0087890625 + ], + "hop_rise": 0.010009765625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.068455382366665e-05, + "Q_max": 0.09659223258495331, + "Q_spread": 0.09655154496431351, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": 0.018399706110358238 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.07366943359375, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0115990057995029, + "frac_green": 0.07366943359375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.095703125, + 0.10888671875, + 0.09375, + 0.1328125, + 0.158203125 + ], + "hop_rise": 0.0994873046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.061933327466249466, + "Q_max": 0.16188396513462067, + "Q_spread": 0.0999506413936615, + "argmax": 113, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8cpu", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1397705078125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.013100436681222707, + "frac_green": 0.1397705078125, + "hop_green": [ + 0.00048828125, + 0.19921875, + 0.2265625, + 0.2529296875, + 0.17626953125, + 0.1484375, + 0.06103515625, + 0.05322265625 + ], + "hop_rise": -0.06005859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.31073206663131714, + "Q_max": 0.47339746356010437, + "Q_spread": 0.16266539692878723, + "argmax": 65, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_38", + "frame": 67, + "root": "demo_38_t0067", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00927734375, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7578125, + "cand_all_green": 0.0, + "top_cand_share": 0.02631578947368421, + "frac_green": 0.00927734375, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0146484375, + 0.00634765625, + 0.00146484375, + 0.015625, + 0.0361328125 + ], + "hop_rise": 0.01123046875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0003463784232735634, + "Q_max": 0.09087172150611877, + "Q_spread": 0.09052534401416779, + "argmax": 28, + "argmax_is_green": true, + "q_of_greenless": 0.019627872854471207 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09814453125, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.796875, + "cand_all_green": 0.0, + "top_cand_share": 0.0236318407960199, + "frac_green": 0.09814453125, + "hop_green": [ + 0.32421875, + 0.14404296875, + 0.123046875, + 0.046875, + 0.06591796875, + 0.0419921875, + 0.0244140625, + 0.0146484375 + ], + "hop_rise": -0.122802734375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0001964116672752425, + "Q_max": 0.9030880331993103, + "Q_spread": 0.9028916358947754, + "argmax": 50, + "argmax_is_green": true, + "q_of_greenless": 0.04863034188747406 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_128", + "frame": 115, + "root": "demo_128_t0115", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.01544189453125, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.890625, + "cand_all_green": 0.0, + "top_cand_share": 0.019762845849802372, + "frac_green": 0.01544189453125, + "hop_green": [ + 0.0, + 0.05224609375, + 0.05517578125, + 0.01025390625, + 0.0, + 0.0009765625, + 0.0048828125, + 0.0 + ], + "hop_rise": -0.0279541015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.01723499968647957, + "Q_max": 0.1639276146888733, + "Q_spread": 0.14669261872768402, + "argmax": 52, + "argmax_is_green": true, + "q_of_greenless": 0.0683753490447998 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02825927734375, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.703125, + "cand_all_green": 0.0, + "top_cand_share": 0.019438444924406047, + "frac_green": 0.02825927734375, + "hop_green": [ + 0.0, + 0.03857421875, + 0.017578125, + 0.0361328125, + 0.0576171875, + 0.03125, + 0.02197265625, + 0.02294921875 + ], + "hop_rise": 0.0103759765625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0011434555053710938, + "Q_max": 0.15640270709991455, + "Q_spread": 0.15525925159454346, + "argmax": 16, + "argmax_is_green": true, + "q_of_greenless": 0.09031453728675842 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_189", + "frame": 338, + "root": "demo_189_t0338", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0, + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.0, + "cand_all_green": 0.0, + "top_cand_share": 0.0, + "frac_green": 0.0, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0, + 0.0 + ], + "hop_rise": 0.0, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.670417380778452e-16, + "Q_max": 3.4102917711997804e-10, + "Q_spread": 3.410287052751926e-10, + "argmax": 1, + "argmax_is_green": false, + "q_of_greenless": 3.4102917711997804e-10 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_83", + "frame": 280, + "root": "demo_83_t0280", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.00677490234375, + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.359375, + "cand_all_green": 0.0, + "top_cand_share": 0.036036036036036036, + "frac_green": 0.00677490234375, + "hop_green": [ + 0.0, + 0.0, + 0.00244140625, + 0.00341796875, + 0.00341796875, + 0.01611328125, + 0.0166015625, + 0.01220703125 + ], + "hop_rise": 0.0106201171875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0006386518361978233, + "Q_max": 0.0793638601899147, + "Q_spread": 0.07872521132230759, + "argmax": 23, + "argmax_is_green": true, + "q_of_greenless": 0.01329739112406969 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_19", + "frame": 67, + "root": "demo_19_t0067", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.0738525390625, + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011570247933884297, + "frac_green": 0.0738525390625, + "hop_green": [ + 0.0, + 0.0, + 0.0, + 0.09716796875, + 0.1083984375, + 0.09765625, + 0.1328125, + 0.15478515625 + ], + "hop_rise": 0.09912109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.06170738488435745, + "Q_max": 0.16389822959899902, + "Q_spread": 0.10219084471464157, + "argmax": 14, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_136", + "frame": 154, + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8cpu2", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.141845703125, + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.012908777969018933, + "frac_green": 0.141845703125, + "hop_green": [ + 0.0, + 0.20166015625, + 0.22216796875, + 0.24658203125, + 0.1826171875, + 0.14794921875, + 0.0673828125, + 0.06640625 + ], + "hop_rise": -0.051513671875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0001921014627441764, + "Q_max": 0.4584195613861084, + "Q_spread": 0.4582274556159973, + "argmax": 52, + "argmax_is_green": true, + "q_of_greenless": 0.011139456182718277 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_cpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.082275390625, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7734375, + "cand_all_green": 0.0, + "top_cand_share": 0.026706231454005934, + "frac_green": 0.082275390625, + "hop_green": [ + 0.31494140625, + 0.10205078125, + 0.08544921875, + 0.04248046875, + 0.05029296875, + 0.0341796875, + 0.01806640625, + 0.0107421875 + ], + "hop_rise": -0.10791015625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00034680587123148143, + "Q_max": 0.933578372001648, + "Q_spread": 0.9332315921783447, + "argmax": 27, + "argmax_is_green": true, + "q_of_greenless": 0.05705001950263977 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.2598876953125, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.014795678722404886, + "frac_green": 0.2598876953125, + "hop_green": [ + 0.00439453125, + 0.1162109375, + 0.349609375, + 0.2236328125, + 0.4365234375, + 0.41259765625, + 0.255859375, + 0.2802734375 + ], + "hop_rise": 0.1728515625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.31745538115501404, + "Q_max": 0.7106689810752869, + "Q_spread": 0.3932135999202728, + "argmax": 35, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_cpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.03082275390625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.78125, + "cand_all_green": 0.0, + "top_cand_share": 0.01782178217821782, + "frac_green": 0.03082275390625, + "hop_green": [ + 0.0, + 0.044921875, + 0.02099609375, + 0.033203125, + 0.0625, + 0.03369140625, + 0.025390625, + 0.02587890625 + ], + "hop_rise": 0.0120849609375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.631770934793167e-06, + "Q_max": 0.1540881097316742, + "Q_spread": 0.1540834754705429, + "argmax": 87, + "argmax_is_green": true, + "q_of_greenless": 0.06836707890033722 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_cpuBdemo_159", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02984619140625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7890625, + "cand_all_green": 0.0, + "top_cand_share": 0.018404907975460124, + "frac_green": 0.02984619140625, + "hop_green": [ + 0.0, + 0.04296875, + 0.01806640625, + 0.02880859375, + 0.064453125, + 0.03466796875, + 0.02490234375, + 0.02490234375 + ], + "hop_rise": 0.0147705078125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.3044241004299693e-07, + "Q_max": 0.14898456633090973, + "Q_spread": 0.14898434281349182, + "argmax": 61, + "argmax_is_green": true, + "q_of_greenless": 0.029461156576871872 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_cpuBdemo_18", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.08367919921875, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.6953125, + "cand_all_green": 0.0, + "top_cand_share": 0.027716994894237783, + "frac_green": 0.08367919921875, + "hop_green": [ + 0.28125, + 0.11279296875, + 0.09814453125, + 0.04541015625, + 0.0537109375, + 0.03662109375, + 0.0244140625, + 0.01708984375 + ], + "hop_rise": -0.1014404296875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00018216353782918304, + "Q_max": 0.905847430229187, + "Q_spread": 0.9056652784347534, + "argmax": 68, + "argmax_is_green": true, + "q_of_greenless": 0.039778608828783035 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuBdemo_80", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.254150390625, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.00984630163304515, + "frac_green": 0.254150390625, + "hop_green": [ + 0.00244140625, + 0.1064453125, + 0.3359375, + 0.220703125, + 0.4306640625, + 0.40869140625, + 0.251953125, + 0.2763671875 + ], + "hop_rise": 0.175537109375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.30007094144821167, + "Q_max": 0.5228146910667419, + "Q_spread": 0.22274374961853027, + "argmax": 119, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_cpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.09515380859375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.765625, + "cand_all_green": 0.0, + "top_cand_share": 0.026298909557408594, + "frac_green": 0.09515380859375, + "hop_green": [ + 0.26220703125, + 0.134765625, + 0.12451171875, + 0.05615234375, + 0.07861328125, + 0.05224609375, + 0.0302734375, + 0.0224609375 + ], + "hop_rise": -0.0985107421875, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.00019940944912377745, + "Q_max": 0.9406136274337769, + "Q_spread": 0.9404141902923584, + "argmax": 60, + "argmax_is_green": true, + "q_of_greenless": 0.04701278358697891 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.255859375, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011927480916030535, + "frac_green": 0.255859375, + "hop_green": [ + 0.005859375, + 0.1103515625, + 0.3359375, + 0.21728515625, + 0.43017578125, + 0.41064453125, + 0.26123046875, + 0.275390625 + ], + "hop_rise": 0.177001953125, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "Q_spread": 0.36739271879196167, + "argmax": 100, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_cpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02789306640625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.7421875, + "cand_all_green": 0.0, + "top_cand_share": 0.019693654266958426, + "frac_green": 0.02789306640625, + "hop_green": [ + 0.0, + 0.04052734375, + 0.017578125, + 0.033203125, + 0.056640625, + 0.02880859375, + 0.02294921875, + 0.0234375 + ], + "hop_rise": 0.0101318359375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 4.815603460883722e-06, + "Q_max": 0.1560216248035431, + "Q_spread": 0.15601681172847748, + "argmax": 43, + "argmax_is_green": true, + "q_of_greenless": 0.032758451998233795 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_gpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.12396240234375, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8046875, + "cand_all_green": 0.0, + "top_cand_share": 0.023633677991137372, + "frac_green": 0.12396240234375, + "hop_green": [ + 0.25830078125, + 0.15576171875, + 0.12841796875, + 0.10888671875, + 0.11083984375, + 0.0966796875, + 0.08203125, + 0.05078125 + ], + "hop_rise": -0.0777587890625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0014176524709910154, + "Q_max": 0.9308630228042603, + "Q_spread": 0.9294453859329224, + "argmax": 83, + "argmax_is_green": true, + "q_of_greenless": 0.03944852575659752 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_gpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.180908203125, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.010121457489878543, + "frac_green": 0.180908203125, + "hop_green": [ + 0.0, + 0.111328125, + 0.1748046875, + 0.3125, + 0.21044921875, + 0.2529296875, + 0.21728515625, + 0.16796875 + ], + "hop_rise": 0.0625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.30042967200279236, + "Q_max": 0.4422576427459717, + "Q_spread": 0.14182797074317932, + "argmax": 27, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_gpuA", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02044677734375, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.6953125, + "cand_all_green": 0.0, + "top_cand_share": 0.01791044776119403, + "frac_green": 0.02044677734375, + "hop_green": [ + 0.0, + 0.01953125, + 0.013671875, + 0.03564453125, + 0.013671875, + 0.0400390625, + 0.02978515625, + 0.01123046875 + ], + "hop_rise": 0.0064697265625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 3.1942030886966677e-07, + "Q_max": 0.13978996872901917, + "Q_spread": 0.1397896558046341, + "argmax": 2, + "argmax_is_green": true, + "q_of_greenless": 0.01958686113357544 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_18", + "frame": 96, + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_gpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.13232421875, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.8203125, + "cand_all_green": 0.0, + "top_cand_share": 0.021217712177121772, + "frac_green": 0.13232421875, + "hop_green": [ + 0.27197265625, + 0.1708984375, + 0.1318359375, + 0.11572265625, + 0.11962890625, + 0.10546875, + 0.0888671875, + 0.05419921875 + ], + "hop_rise": -0.08056640625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.0007690415368415415, + "Q_max": 0.8577377200126648, + "Q_spread": 0.8569687008857727, + "argmax": 47, + "argmax_is_green": true, + "q_of_greenless": 0.04032230004668236 + }, + { + "task": "two_piece_expert_play", + "episode": "demo_80", + "frame": 25, + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_gpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.1795654296875, + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011896668932698844, + "frac_green": 0.1795654296875, + "hop_green": [ + 0.0, + 0.111328125, + 0.17333984375, + 0.30810546875, + 0.20458984375, + 0.25146484375, + 0.21533203125, + 0.17236328125 + ], + "hop_rise": 0.062744140625, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 0.29887813329696655, + "Q_max": 0.5452569723129272, + "Q_spread": 0.2463788390159607, + "argmax": 12, + "argmax_is_green": true, + "q_of_greenless": null + }, + { + "task": "two_piece_expert_play", + "episode": "demo_159", + "frame": 413, + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_gpuS", + "plan_seed": 0, + "policy_seed": 0, + "manifest_frac_green": 0.02008056640625, + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "cand_any_green": 0.640625, + "cand_all_green": 0.0, + "top_cand_share": 0.02127659574468085, + "frac_green": 0.02008056640625, + "hop_green": [ + 0.0, + 0.0234375, + 0.00927734375, + 0.03515625, + 0.01318359375, + 0.03759765625, + 0.029296875, + 0.0126953125 + ], + "hop_rise": 0.0062255859375, + "n_cand": 128, + "n_hops": 8, + "n_particles": 16, + "Q_min": 2.9533819656535343e-07, + "Q_max": 0.148711159825325, + "Q_spread": 0.14871086180210114, + "argmax": 31, + "argmax_is_green": true, + "q_of_greenless": 0.02306733839213848 + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_STATS.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_STATS.json new file mode 100644 index 0000000000000000000000000000000000000000..7e04157624bbcb6dcba2122080bbf6e23316e6b0 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CAND_GREEN_STATS.json @@ -0,0 +1,288 @@ +{ + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "episode": "demo_129", + "frame": 84, + "frac_green": 0.0885009765625, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "argmax": 100, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.010344827586206896, + "hop_green": [ + 0.0, + 0.009765625, + 0.123046875, + 0.06298828125, + 0.109375, + 0.11865234375, + 0.1201171875, + 0.1640625 + ], + "argmax_is_green": true, + "q_of_greenless": 4.3887592937608133e-07 + }, + "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "episode": "demo_80", + "frame": 25, + "frac_green": 0.255859375, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "argmax": 100, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.011927480916030535, + "hop_green": [ + 0.005859375, + 0.1103515625, + 0.3359375, + 0.21728515625, + 0.43017578125, + 0.41064453125, + 0.26123046875, + 0.275390625 + ], + "argmax_is_green": true, + "q_of_greenless": null + }, + "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "episode": "demo_198", + "frame": 166, + "frac_green": 0.051513671875, + "Q_min": 6.769107858417556e-05, + "Q_max": 0.38457581400871277, + "argmax": 43, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.03317535545023697, + "hop_green": [ + 0.001953125, + 0.12548828125, + 0.11962890625, + 0.05029296875, + 0.04296875, + 0.01513671875, + 0.0126953125, + 0.0439453125 + ], + "argmax_is_green": true, + "q_of_greenless": 0.017471471801400185 + }, + "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "episode": "demo_64", + "frame": 192, + "frac_green": 0.05419921875, + "Q_min": 0.0006882615271024406, + "Q_max": 0.704879105091095, + "argmax": 86, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.8828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028153153153153154, + "hop_green": [ + 0.24755859375, + 0.0859375, + 0.0263671875, + 0.0224609375, + 0.0166015625, + 0.009765625, + 0.01123046875, + 0.013671875 + ], + "argmax_is_green": true, + "q_of_greenless": 0.11513863503932953 + }, + "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "episode": "demo_153", + "frame": 112, + "frac_green": 0.15411376953125, + "Q_min": 7.312361844924453e-07, + "Q_max": 0.32301434874534607, + "argmax": 77, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.984375, + "cand_all_green": 0.0, + "top_cand_share": 0.009900990099009901, + "hop_green": [ + 0.0166015625, + 0.12255859375, + 0.18701171875, + 0.25634765625, + 0.2099609375, + 0.22705078125, + 0.14697265625, + 0.06640625 + ], + "argmax_is_green": true, + "q_of_greenless": 0.008339659310877323 + }, + "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "episode": "demo_6", + "frame": 180, + "frac_green": 0.1658935546875, + "Q_min": 0.3845299482345581, + "Q_max": 0.5868167877197266, + "argmax": 34, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.009565857247976454, + "hop_green": [ + 0.08740234375, + 0.2314453125, + 0.4189453125, + 0.25, + 0.0654296875, + 0.12109375, + 0.060546875, + 0.09228515625 + ], + "argmax_is_green": true, + "q_of_greenless": null + }, + "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "episode": "demo_18", + "frame": 96, + "frac_green": 0.12005615234375, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "argmax": 82, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.828125, + "cand_all_green": 0.0, + "top_cand_share": 0.028469750889679714, + "hop_green": [ + 0.24853515625, + 0.15283203125, + 0.11962890625, + 0.10791015625, + 0.1044921875, + 0.09716796875, + 0.07958984375, + 0.05029296875 + ], + "argmax_is_green": true, + "q_of_greenless": 0.030184485018253326 + }, + "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16": { + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "episode": "demo_136", + "frame": 154, + "frac_green": 0.14874267578125, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "argmax": 64, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 1.0, + "cand_all_green": 0.0, + "top_cand_share": 0.01600328272466147, + "hop_green": [ + 0.005859375, + 0.13916015625, + 0.14013671875, + 0.25732421875, + 0.18798828125, + 0.1982421875, + 0.14794921875, + 0.11328125 + ], + "argmax_is_green": true, + "q_of_greenless": null + }, + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16": { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "episode": "demo_36", + "frame": 56, + "frac_green": 0.192138671875, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "argmax": 38, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.4140625, + "cand_all_green": 0.0, + "top_cand_share": 0.02255400254129606, + "hop_green": [ + 0.0224609375, + 0.07568359375, + 0.17041015625, + 0.1650390625, + 0.25830078125, + 0.26708984375, + 0.27783203125, + 0.30029296875 + ], + "argmax_is_green": true, + "q_of_greenless": 0.0062977927736938 + }, + "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16": { + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "episode": "demo_172", + "frame": 38, + "frac_green": 0.12725830078125, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "argmax": 73, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.9921875, + "cand_all_green": 0.0, + "top_cand_share": 0.014388489208633094, + "hop_green": [ + 0.1708984375, + 0.21142578125, + 0.15087890625, + 0.10400390625, + 0.1279296875, + 0.1396484375, + 0.078125, + 0.03515625 + ], + "argmax_is_green": true, + "q_of_greenless": 0.0003339288232382387 + }, + "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16": { + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "episode": "demo_181", + "frame": 135, + "frac_green": 0.207275390625, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "argmax": 98, + "n_cand": 128, + "n_hops": 8, + "cand_any_green": 0.9609375, + "cand_all_green": 0.0, + "top_cand_share": 0.010306242638398116, + "hop_green": [ + 0.67529296875, + 0.37744140625, + 0.208984375, + 0.14453125, + 0.0654296875, + 0.08203125, + 0.078125, + 0.0263671875 + ], + "argmax_is_green": true, + "q_of_greenless": 0.019650794565677643 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CHAIN_PANELS.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CHAIN_PANELS.json new file mode 100644 index 0000000000000000000000000000000000000000..1b6e277f3222861accb6254aaacef40c10d37f20 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/CHAIN_PANELS.json @@ -0,0 +1,549 @@ +{ + "generated_by": "scripts/viz/chain_panels_gate.py", + "cap": 33, + "tasks": [ + "square_expert_play", + "two_piece_expert_play" + ], + "G1": [ + { + "task": "square_expert_play", + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "ok": true + } + ], + "G2": [ + { + "task": "square_expert_play", + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 11, + "fig_argmax": 11, + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 98, + "fig_argmax": 98, + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 64, + "fig_argmax": 64, + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 123, + "fig_argmax": 123, + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 45, + "fig_argmax": 45, + "ok": true + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 27, + "fig_argmax": 27, + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 9, + "fig_argmax": 9, + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 52, + "fig_argmax": 52, + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 27, + "fig_argmax": 27, + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 27, + "fig_argmax": 27, + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 97, + "fig_argmax": 97, + "ok": true + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 58, + "fig_argmax": 58, + "ok": true + } + ], + "G3": [ + { + "task": "square_expert_play", + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.010627297794117647 + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.007927389705882353 + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.0016371783088235295 + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.0032312729779411763 + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.04299747242647059 + }, + { + "task": "square_expert_play", + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.030086741727941176 + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.007510914522058824 + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.009061925551470588 + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.023566750919117647 + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.048095703125 + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.0 + }, + { + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16", + "ok": true, + "frac_green": 0.009952320772058824 + } + ], + "figures": [ + { + "fold_argmax_L8": 14, + "argmax_changed_vs_foldL8": true, + "task": "square_expert_play", + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "episode": "demo_102", + "frame": 145, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.00829036387444866, + "Q_chain_min": 0.0, + "chain_argmax": 11, + "fold_argmax": 21, + "Q_fold_max": 0.03605642542243004, + "Q_fold_at_chain_argmax": 0.015075964853167534, + "fold_rank_of_chain_argmax": 56, + "argmax_changed": true, + "frac_green": 0.010627297794117647, + "cos_mean": 0.5777202248573303, + "cos_min": 0.3440057337284088, + "png": "tree_square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.00829036387444866 + }, + { + "fold_argmax_L8": 126, + "argmax_changed_vs_foldL8": true, + "task": "square_expert_play", + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16", + "episode": "demo_110", + "frame": 104, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.009514686738628882, + "Q_chain_min": 0.0, + "chain_argmax": 98, + "fold_argmax": 15, + "Q_fold_max": 0.0183305311948061, + "Q_fold_at_chain_argmax": 0.018118781968951225, + "fold_rank_of_chain_argmax": 11, + "argmax_changed": true, + "frac_green": 0.007927389705882353, + "cos_mean": 0.637362003326416, + "cos_min": 0.44993269443511963, + "png": "tree_square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.009514686738628882 + }, + { + "fold_argmax_L8": 71, + "argmax_changed_vs_foldL8": true, + "task": "square_expert_play", + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "episode": "demo_160", + "frame": 165, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.011413072618303363, + "Q_chain_min": 1.178636411386598e-17, + "chain_argmax": 64, + "fold_argmax": 64, + "Q_fold_max": 0.055225882679224014, + "Q_fold_at_chain_argmax": 0.055225882679224014, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.0016371783088235295, + "cos_mean": 0.612116813659668, + "cos_min": 0.3927253186702728, + "png": "tree_square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.011413072618303351 + }, + { + "fold_argmax_L8": 123, + "argmax_changed_vs_foldL8": false, + "task": "square_expert_play", + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "episode": "demo_221", + "frame": 249, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.014179221622859011, + "Q_chain_min": 0.0, + "chain_argmax": 123, + "fold_argmax": 123, + "Q_fold_max": 0.07260427623987198, + "Q_fold_at_chain_argmax": 0.07260427623987198, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.0032312729779411763, + "cos_mean": 0.5871084928512573, + "cos_min": 0.47005027532577515, + "png": "tree_square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.014179221622859011 + }, + { + "fold_argmax_L8": 45, + "argmax_changed_vs_foldL8": false, + "task": "square_expert_play", + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "episode": "demo_36", + "frame": 56, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.4385806195537324, + "Q_chain_min": 8.056578183321293e-27, + "chain_argmax": 45, + "fold_argmax": 45, + "Q_fold_max": 0.6419798135757446, + "Q_fold_at_chain_argmax": 0.6419798135757446, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.04299747242647059, + "cos_mean": 0.6470097899436951, + "cos_min": 0.5655526518821716, + "png": "tree_square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.4385806195537324 + }, + { + "fold_argmax_L8": 27, + "argmax_changed_vs_foldL8": false, + "task": "square_expert_play", + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "episode": "demo_84", + "frame": 390, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.2136088127247271, + "Q_chain_min": 9.933510680700101e-26, + "chain_argmax": 27, + "fold_argmax": 27, + "Q_fold_max": 0.30500614643096924, + "Q_fold_at_chain_argmax": 0.30500614643096924, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.030086741727941176, + "cos_mean": 0.5852065682411194, + "cos_min": 0.44085973501205444, + "png": "tree_square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.2136088127247271 + }, + { + "fold_argmax_L8": 41, + "argmax_changed_vs_foldL8": true, + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16", + "episode": "demo_102", + "frame": 198, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.009471912863120619, + "Q_chain_min": 1.7553465932336537e-21, + "chain_argmax": 9, + "fold_argmax": 9, + "Q_fold_max": 0.033906303346157074, + "Q_fold_at_chain_argmax": 0.033906303346157074, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.007510914522058824, + "cos_mean": 0.5510827898979187, + "cos_min": 0.30709487199783325, + "png": "tree_two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.009471912863120619 + }, + { + "fold_argmax_L8": 53, + "argmax_changed_vs_foldL8": true, + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "episode": "demo_106", + "frame": 35, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.027697024873664756, + "Q_chain_min": 0.008783467248844488, + "chain_argmax": 52, + "fold_argmax": 53, + "Q_fold_max": 0.07148945331573486, + "Q_fold_at_chain_argmax": 0.06864148378372192, + "fold_rank_of_chain_argmax": 1, + "argmax_changed": true, + "frac_green": 0.009061925551470588, + "cos_mean": 0.5245897769927979, + "cos_min": 0.35297536849975586, + "png": "tree_two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.01891355762482027 + }, + { + "fold_argmax_L8": 27, + "argmax_changed_vs_foldL8": false, + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "episode": "demo_129", + "frame": 84, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.07801508557984022, + "Q_chain_min": 0.02708719599288887, + "chain_argmax": 27, + "fold_argmax": 27, + "Q_fold_max": 0.22942568361759186, + "Q_fold_at_chain_argmax": 0.22942568361759186, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.023566750919117647, + "cos_mean": 0.528193473815918, + "cos_min": 0.40487977862358093, + "png": "tree_two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.050927889586951346 + }, + { + "fold_argmax_L8": 27, + "argmax_changed_vs_foldL8": false, + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "episode": "demo_143", + "frame": 154, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.15502184900486554, + "Q_chain_min": 0.11124101522189014, + "chain_argmax": 27, + "fold_argmax": 27, + "Q_fold_max": 0.3009323179721832, + "Q_fold_at_chain_argmax": 0.3009323179721832, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.048095703125, + "cos_mean": 0.5491414666175842, + "cos_min": 0.4673139452934265, + "png": "tree_two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.0437808337829754 + }, + { + "fold_argmax_L8": 97, + "argmax_changed_vs_foldL8": false, + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16", + "episode": "demo_171", + "frame": 244, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.0018476361945262093, + "Q_chain_min": 4.059427951735848e-07, + "chain_argmax": 97, + "fold_argmax": 97, + "Q_fold_max": 0.009862987324595451, + "Q_fold_at_chain_argmax": 0.009862987324595451, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.0, + "cos_mean": 0.5124043822288513, + "cos_min": 0.3608575165271759, + "png": "tree_two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.0018472302517310358 + }, + { + "fold_argmax_L8": 72, + "argmax_changed_vs_foldL8": true, + "task": "two_piece_expert_play", + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16", + "episode": "demo_99", + "frame": 57, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.03605255015170039, + "Q_chain_min": 0.01699233471006449, + "chain_argmax": 58, + "fold_argmax": 58, + "Q_fold_max": 0.17017507553100586, + "Q_fold_at_chain_argmax": 0.17017507553100586, + "fold_rank_of_chain_argmax": 0, + "argmax_changed": false, + "frac_green": 0.009952320772058824, + "cos_mean": 0.5366660952568054, + "cos_min": 0.32871001958847046, + "png": "tree_two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16_dec256.png", + "Q_chain_spread": 0.0190602154416359 + } + ], + "n_figures": 12, + "n_argmax_changed": 3, + "n_chain_Qmax_below_fold": 12, + "n_argmax_changed_vs_foldL8": 6, + "n_argmax_changed_vs_foldL8_measurable": 12, + "max_fold_rank_of_chain_argmax": 56, + "median_Qmax_ratio_chain_over_fold": 0.3097003211324255, + "degenerate_roots_chain": [], + "min_chain_Q_spread": 0.0018472302517310358, + "n_chain_argmax_below_fold_median": 0, + "G1_n": 12, + "G1_ok": true, + "G2_n": 12, + "G2_ok": true, + "G3_n": 12, + "G3_ok": true, + "GATE_all_ok": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DCP_NOISE.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DCP_NOISE.json new file mode 100644 index 0000000000000000000000000000000000000000..a2797e518499a319336b37e54c2f2413818be9d3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DCP_NOISE.json @@ -0,0 +1,221 @@ +{ + "purpose": "gen_q#270 run 24: noise floor of the per-figure hop-diversity cell statistic.", + "pre_registration": "status/SUCCESSOR_VIZ.md run 24 (written before any compute)", + "capture_arms": { + "U_unseeded_shipped_protocol": [ + "published", + "cpuA", + "cpuB", + "gpuA" + ], + "S_fixed_draw": [ + "cpuS", + "gpuS" + ] + }, + "dedupe": "replicates deduped by trace_md5 (curated dirs are symlinks, curate_split_manifest.py:60)", + "thresholds": { + "resolved_lt": 0.02, + "unresolvable_ge": 0.1 + }, + "per_root": { + "square_expert_play::square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16": { + "task": "square_expert_play", + "U_cells": { + "cpuA": 0.7538281083106995, + "cpuB": 0.7048411965370178, + "gpuA": 0.6561228279358422 + }, + "n_U_distinct": 3, + "spread_U": 0.09770528037485726, + "sd_U": 0.04885270169501368, + "mean_U": 0.7049307109278532, + "S_cells": { + "cpuS": 0.8192453384399414, + "gpuS": 0.7338155508041382 + }, + "dev": 0.08542978763580322, + "batch": 0.04898691177368164, + "recapture_cells": { + "cpuA": 0.7538281083106995, + "cpuB": 0.7048411965370178, + "gpuA": 0.6561228279358422 + }, + "spread_recapture": 0.09770528037485726, + "recapture_range": [ + 0.6561228279358422, + 0.7538281083106995 + ], + "U_verdicts": { + "cpuA": "PARTIAL", + "cpuB": "PARTIAL", + "gpuA": "PARTIAL" + }, + "verdict_flips_across_U": false + }, + "square_expert_play::square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16": { + "task": "square_expert_play", + "U_cells": { + "published": 0.9024740193941972, + "cpuA": 0.20918776078894558, + "cpuB": 0.5329841747175561, + "gpuA": 0.5775359276868262 + }, + "n_U_distinct": 4, + "spread_U": 0.6932862586052517, + "sd_U": 0.2836169208567483, + "mean_U": 0.5555454706468812, + "S_cells": { + "cpuS": 0.5046662464034604, + "gpuS": 0.5029022349334864 + }, + "dev": 0.0017640114699739584, + "batch": 0.3237964139286105, + "recapture_cells": { + "cpuA": 0.20918776078894558, + "cpuB": 0.5329841747175561, + "gpuA": 0.5775359276868262 + }, + "spread_recapture": 0.3683481668978806, + "recapture_range": [ + 0.20918776078894558, + 0.5775359276868262 + ], + "published_cell": 0.9024740193941972, + "published_verdict": "OK", + "published_inside_recapture_range": false, + "published_minus_recapture_mean": 0.46257139832975464, + "U_verdicts": { + "published": "OK", + "cpuA": "COLLAPSE", + "cpuB": "COLLAPSE", + "gpuA": "COLLAPSE" + }, + "verdict_flips_across_U": true + }, + "two_piece_expert_play::two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16": { + "task": "two_piece_expert_play", + "U_cells": { + "cpuA": 1.0960906744003296, + "cpuB": 1.1040769815444946, + "gpuA": 0.8163277604036943 + }, + "n_U_distinct": 3, + "spread_U": 0.28774922114080037, + "sd_U": 0.16387529985572716, + "mean_U": 1.0054984721161728, + "S_cells": { + "cpuS": 1.0954416990280151, + "gpuS": 0.7959850290370863 + }, + "dev": 0.2994566699909288, + "batch": 0.007986307144165039, + "recapture_cells": { + "cpuA": 1.0960906744003296, + "cpuB": 1.1040769815444946, + "gpuA": 0.8163277604036943 + }, + "spread_recapture": 0.28774922114080037, + "recapture_range": [ + 0.8163277604036943, + 1.1040769815444946 + ], + "U_verdicts": { + "cpuA": "OK", + "cpuB": "OK", + "gpuA": "OK" + }, + "verdict_flips_across_U": false + }, + "two_piece_expert_play::two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16": { + "task": "two_piece_expert_play", + "U_cells": { + "published": 0.6186873840308346, + "cpuA": 0.6016450337730226, + "cpuB": 0.6128592611521084, + "gpuA": 0.6042960115857501 + }, + "n_U_distinct": 4, + "spread_U": 0.017042350257811978, + "sd_U": 0.00784026010230613, + "mean_U": 0.6093719226354289, + "S_cells": { + "cpuS": 0.6389969815929398, + "gpuS": 0.530817827719446 + }, + "dev": 0.10817915387349386, + "batch": 0.01121422737908584, + "recapture_cells": { + "cpuA": 0.6016450337730226, + "cpuB": 0.6128592611521084, + "gpuA": 0.6042960115857501 + }, + "spread_recapture": 0.01121422737908584, + "recapture_range": [ + 0.6016450337730226, + 0.6128592611521084 + ], + "published_cell": 0.6186873840308346, + "published_verdict": "PARTIAL", + "published_inside_recapture_range": false, + "published_minus_recapture_mean": 0.012420615193874163, + "U_verdicts": { + "published": "PARTIAL", + "cpuA": "PARTIAL", + "cpuB": "PARTIAL", + "gpuA": "PARTIAL" + }, + "verdict_flips_across_U": false + }, + "two_piece_expert_play::two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16": { + "task": "two_piece_expert_play", + "U_cells": { + "published": 0.9677560942379243, + "cpuA": 0.9910907532932851, + "cpuB": 0.9139074731161965, + "gpuA": 0.9649277048871009 + }, + "n_U_distinct": 4, + "spread_U": 0.07718328017708864, + "sd_U": 0.032528203130792625, + "mean_U": 0.9594205063836267, + "S_cells": { + "cpuS": 0.9677560942379243, + "gpuS": 1.0344796638808116 + }, + "dev": 0.06672356964288728, + "batch": 0.07718328017708864, + "recapture_cells": { + "cpuA": 0.9910907532932851, + "cpuB": 0.9139074731161965, + "gpuA": 0.9649277048871009 + }, + "spread_recapture": 0.07718328017708864, + "recapture_range": [ + 0.9139074731161965, + 0.9910907532932851 + ], + "published_cell": 0.9677560942379243, + "published_verdict": "OK", + "published_inside_recapture_range": true, + "published_minus_recapture_mean": 0.011114117139063517, + "U_verdicts": { + "published": "OK", + "cpuA": "OK", + "cpuB": "OK", + "gpuA": "OK" + }, + "verdict_flips_across_U": false + } + }, + "S_median_spread_U": 0.09770528037485726, + "S_median_spread_recapture": 0.09770528037485726, + "n_published_outside_recapture_range": 2, + "n_roots_with_U_replicates": 5, + "VERDICT": "MARGINAL", + "dev_median": 0.08542978763580322, + "dev_max": 0.2994566699909288, + "batch_median": 0.04898691177368164, + "n_roots_verdict_flips": 1, + "caption_band": 0.049 +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DCP_NOISE_SELECTION.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DCP_NOISE_SELECTION.json new file mode 100644 index 0000000000000000000000000000000000000000..beed26e1a6a17b21014fcec9ab4f364b9507f049 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DCP_NOISE_SELECTION.json @@ -0,0 +1,395 @@ +{ + "purpose": "gen_q#270 run 24: is the published panel-fidelity number a SELECTED maximum?", + "n_paired_captures": 48, + "rows": [ + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz", + "cand_any_green": 0.4140625, + "frac_green": 0.192138671875, + "cell": 0.9024740193941972 + }, + { + "task": "square_expert_play", + "root": "demo_110_t0104", + "dir": "stitchviz", + "cand_any_green": 0.0, + "frac_green": 0.0, + "cell": 0.9084791541099548 + }, + { + "task": "square_expert_play", + "root": "demo_102_t0145", + "dir": "stitchviz", + "cand_any_green": 0.171875, + "frac_green": 0.0013427734375, + "cell": 0.6352435350418091 + }, + { + "task": "square_expert_play", + "root": "demo_160_t0165", + "dir": "stitchviz", + "cand_any_green": 0.703125, + "frac_green": 0.00592041015625, + "cell": 0.8302635550498962 + }, + { + "task": "square_expert_play", + "root": "demo_84_t0390", + "dir": "stitchviz", + "cand_any_green": 0.34375, + "frac_green": 0.0267333984375, + "cell": 0.7006211876869202 + }, + { + "task": "square_expert_play", + "root": "demo_221_t0249", + "dir": "stitchviz", + "cand_any_green": 0.171875, + "frac_green": 0.00164794921875, + "cell": 0.9012800455093384 + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_split2", + "cand_any_green": 0.4140625, + "frac_green": 0.192138671875, + "cell": 0.9024740193941972 + }, + { + "task": "square_expert_play", + "root": "demo_172_t0038", + "dir": "stitchviz_split2", + "cand_any_green": 0.9921875, + "frac_green": 0.12725830078125, + "cell": 0.9789771437644958 + }, + { + "task": "square_expert_play", + "root": "demo_181_t0135", + "dir": "stitchviz_split2", + "cand_any_green": 0.9609375, + "frac_green": 0.207275390625, + "cell": 0.7492285966873169 + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_cpuA", + "cand_any_green": 0.328125, + "frac_green": 0.1558837890625, + "cell": 0.20918776078894558 + }, + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_cpuA", + "cand_any_green": 0.4453125, + "frac_green": 0.02874755859375, + "cell": 0.7538281083106995 + }, + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_cpuBdemo_212", + "cand_any_green": 0.4140625, + "frac_green": 0.02557373046875, + "cell": 0.7048411965370178 + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_cpuBdemo_36", + "cand_any_green": 0.3203125, + "frac_green": 0.15557861328125, + "cell": 0.5329841747175561 + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_cpuS", + "cand_any_green": 0.3515625, + "frac_green": 0.1668701171875, + "cell": 0.5046662464034604 + }, + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_cpuS", + "cand_any_green": 0.46875, + "frac_green": 0.02972412109375, + "cell": 0.8192453384399414 + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_gpuA", + "cand_any_green": 0.4609375, + "frac_green": 0.18768310546875, + "cell": 0.5775359276868262 + }, + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_gpuA", + "cand_any_green": 0.5703125, + "frac_green": 0.0169677734375, + "cell": 0.6561228279358422 + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_xdev_gpuS", + "cand_any_green": 0.3828125, + "frac_green": 0.1556396484375, + "cell": 0.5029022349334864 + }, + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "dir": "stitchviz_xdev_gpuS", + "cand_any_green": 0.7109375, + "frac_green": 0.020263671875, + "cell": 0.7338155508041382 + }, + { + "task": "two_piece_expert_play", + "root": "demo_106_t0035", + "dir": "stitchviz", + "cand_any_green": 1.0, + "frac_green": 0.01983642578125, + "cell": 0.8479114429744702 + }, + { + "task": "two_piece_expert_play", + "root": "demo_99_t0057", + "dir": "stitchviz", + "cand_any_green": 1.0, + "frac_green": 0.04156494140625, + "cell": 0.554523722102069 + }, + { + "task": "two_piece_expert_play", + "root": "demo_129_t0084", + "dir": "stitchviz", + "cand_any_green": 0.9921875, + "frac_green": 0.0885009765625, + "cell": 0.9544283728724794 + }, + { + "task": "two_piece_expert_play", + "root": "demo_143_t0154", + "dir": "stitchviz", + "cand_any_green": 1.0, + "frac_green": 0.167236328125, + "cell": 0.5018387427424988 + }, + { + "task": "two_piece_expert_play", + "root": "demo_102_t0198", + "dir": "stitchviz", + "cand_any_green": 0.9453125, + "frac_green": 0.01068115234375, + "cell": 0.9932074546813965 + }, + { + "task": "two_piece_expert_play", + "root": "demo_171_t0244", + "dir": "stitchviz", + "cand_any_green": 0.015625, + "frac_green": 0.0001220703125, + "cell": 0.8669617772102356 + }, + { + "task": "two_piece_expert_play", + "root": "demo_129_t0084", + "dir": "stitchviz_split2", + "cand_any_green": 0.9921875, + "frac_green": 0.0885009765625, + "cell": 0.9544283728724794 + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_split2", + "cand_any_green": 1.0, + "frac_green": 0.255859375, + "cell": 0.9677560942379243 + }, + { + "task": "two_piece_expert_play", + "root": "demo_198_t0166", + "dir": "stitchviz_split2", + "cand_any_green": 0.9609375, + "frac_green": 0.051513671875, + "cell": 0.4253833435250655 + }, + { + "task": "two_piece_expert_play", + "root": "demo_64_t0192", + "dir": "stitchviz_split2", + "cand_any_green": 0.8828125, + "frac_green": 0.05419921875, + "cell": 0.30477576605335754 + }, + { + "task": "two_piece_expert_play", + "root": "demo_153_t0112", + "dir": "stitchviz_split2", + "cand_any_green": 0.984375, + "frac_green": 0.15411376953125, + "cell": 0.988487184047699 + }, + { + "task": "two_piece_expert_play", + "root": "demo_6_t0180", + "dir": "stitchviz_split2", + "cand_any_green": 1.0, + "frac_green": 0.1658935546875, + "cell": 1.0177271366119385 + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_split2", + "cand_any_green": 0.828125, + "frac_green": 0.12005615234375, + "cell": 0.6186873840308346 + }, + { + "task": "two_piece_expert_play", + "root": "demo_136_t0154", + "dir": "stitchviz_split2", + "cand_any_green": 1.0, + "frac_green": 0.14874267578125, + "cell": 0.6444982811538358 + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_cpuA", + "cand_any_green": 0.7734375, + "frac_green": 0.082275390625, + "cell": 0.6016450337730226 + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuA", + "cand_any_green": 1.0, + "frac_green": 0.2598876953125, + "cell": 0.9910907532932851 + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_cpuA", + "cand_any_green": 0.78125, + "frac_green": 0.03082275390625, + "cell": 1.0960906744003296 + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_cpuBdemo_159", + "cand_any_green": 0.7890625, + "frac_green": 0.02984619140625, + "cell": 1.1040769815444946 + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_cpuBdemo_18", + "cand_any_green": 0.6953125, + "frac_green": 0.08367919921875, + "cell": 0.6128592611521084 + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuBdemo_80", + "cand_any_green": 1.0, + "frac_green": 0.254150390625, + "cell": 0.9139074731161965 + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_cpuS", + "cand_any_green": 0.765625, + "frac_green": 0.09515380859375, + "cell": 0.6389969815929398 + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuS", + "cand_any_green": 1.0, + "frac_green": 0.255859375, + "cell": 0.9677560942379243 + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_cpuS", + "cand_any_green": 0.7421875, + "frac_green": 0.02789306640625, + "cell": 1.0954416990280151 + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_gpuA", + "cand_any_green": 0.8046875, + "frac_green": 0.12396240234375, + "cell": 0.6042960115857501 + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_gpuA", + "cand_any_green": 1.0, + "frac_green": 0.180908203125, + "cell": 0.9649277048871009 + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_gpuA", + "cand_any_green": 0.6953125, + "frac_green": 0.02044677734375, + "cell": 0.8163277604036943 + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_xdev_gpuS", + "cand_any_green": 0.8203125, + "frac_green": 0.13232421875, + "cell": 0.530817827719446 + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_gpuS", + "cand_any_green": 1.0, + "frac_green": 0.1795654296875, + "cell": 1.0344796638808116 + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "dir": "stitchviz_xdev_gpuS", + "cand_any_green": 0.640625, + "frac_green": 0.02008056640625, + "cell": 0.7959850290370863 + } + ], + "spearman_cand_any_green_vs_cell": 0.3179173455315573, + "pearson_cand_any_green_vs_cell": 0.23205007713783854, + "spearman_frac_green_vs_cell": 0.019380055371586775, + "VERDICT": "NO_SELECTION_SIGNAL", + "note": "n is small and the captures are not independent across roots, so this is a direction check, not an estimate; no p-value is claimed." +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DECODER_COLLAPSE_PAPERFIGS.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DECODER_COLLAPSE_PAPERFIGS.json new file mode 100644 index 0000000000000000000000000000000000000000..37dbcb2900504d6fb3d5794bd758ee38402e270e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DECODER_COLLAPSE_PAPERFIGS.json @@ -0,0 +1,406 @@ +{ + "purpose": "mean-collapse instrument (decoder_transfer.py B) applied to the 12 PUBLISHED trees", + "pre_registration": "status/SUCCESSOR_VIZ.md run 22", + "sibling_result": "runs/pixdec/DECODER_TRANSFER.json (unseen anchors; VERDICT_B = COLLAPSE)", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "step": 60000, + "res": 256, + "rng_seed": 0, + "particle": 0, + "h_fold": 20, + "collapse_lo": 0.6, + "collapse_hi": 0.8, + "capture_dir_pattern": "runs//stitchviz_split2/", + "variant": "split2b256", + "per_task": { + "square_expert_play": { + "n_roots": 3, + "roots": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16" + ], + "task_index": 2, + "collapse": { + "groups": { + "hop": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.07744394817079107, + "p05": 0.06747168228030205, + "median": 0.07049734890460968, + "p95": 0.1167103074491024 + }, + "pairwise_l1": { + "n": 583, + "mean": 0.060114494028084275, + "p05": 0.008006646297872066, + "median": 0.05125032365322113, + "p95": 0.1347886949777603 + } + }, + "hop_matched": { + "n": 24, + "dist_to_mean": { + "n": 24, + "mean": 0.08481774261842172, + "p05": 0.06745205149054527, + "median": 0.07414677739143372, + "p95": 0.12158739753067493 + }, + "pairwise_l1": { + "n": 581, + "mean": 0.07994935896629131, + "p05": 0.021528838202357292, + "median": 0.06331294775009155, + "p95": 0.1399468630552292 + } + }, + "real_matched": { + "n": 24, + "dist_to_mean": { + "n": 24, + "mean": 0.09740386872241895, + "p05": 0.07129016667604446, + "median": 0.09037167578935623, + "p95": 0.13622641041874883 + }, + "pairwise_l1": { + "n": 569, + "mean": 0.09887646668981794, + "p05": 0.026654161512851715, + "median": 0.10807862877845764, + "p95": 0.15987807214260105 + } + }, + "real_broad": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.08922440946723025, + "p05": 0.06537547633051873, + "median": 0.07713911309838295, + "p95": 0.13549299910664558 + }, + "pairwise_l1": { + "n": 589, + "mean": 0.09788701562084422, + "p05": 0.026579171419143677, + "median": 0.09455864876508713, + "p95": 0.18445990085601807 + } + }, + "dim_shuffle": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.0755232567122827, + "p05": 0.06486392989754677, + "median": 0.07389649748802185, + "p95": 0.09040698260068894 + }, + "pairwise_l1": { + "n": 593, + "mean": 0.06565910027147244, + "p05": 0.04095962271094322, + "median": 0.06398089230060577, + "p95": 0.09918036758899687 + } + } + }, + "ratio_dist_to_mean": 0.8707841252192445, + "ratio_pairwise": 0.8085782354773838, + "ratio_dist_to_mean_broad": 0.867968178587208, + "ratio_pairwise_broad": 0.6141212258521793, + "cell": 0.8085782354773838, + "primary": "hop_matched vs real_matched (same roots, same offsets)", + "n_hop": 48, + "n_matched": 24, + "n_truefuture_clipped": 0 + }, + "per_figure": { + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "ef66050c9320363622d46efdb6849b7b", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.08923587948083878, + "real_dist_to_mean": 0.09397635608911514, + "hop_pairwise": 0.07243771954173488, + "real_pairwise": 0.08026571179340992, + "ratio_dist_to_mean": 0.9495567083358765, + "ratio_pairwise": 0.9024740193941972, + "cell": 0.9024740193941972, + "verdict": "OK" + }, + "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz_scan/seed3/square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "0a080718afdf5e74921cd2ded9e43018", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.07113374769687653, + "real_dist_to_mean": 0.07266129553318024, + "hop_pairwise": 0.026028836994165822, + "real_pairwise": 0.02641652095397668, + "ratio_dist_to_mean": 0.9789771437644958, + "ratio_pairwise": 0.9853241855547031, + "cell": 0.9789771437644958, + "verdict": "OK" + }, + "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz_seed0/square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "c62065ae184c4e2b497abc1f674edb23", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.09408359229564667, + "real_dist_to_mean": 0.12557394802570343, + "hop_pairwise": 0.08070299656329942, + "real_pairwise": 0.06380466351817761, + "ratio_dist_to_mean": 0.7492285966873169, + "ratio_pairwise": 1.2648447952445916, + "cell": 0.7492285966873169, + "verdict": "PARTIAL" + } + } + }, + "two_piece_expert_play": { + "n_roots": 8, + "roots": [ + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16" + ], + "task_index": 4, + "collapse": { + "groups": { + "hop": { + "n": 128, + "dist_to_mean": { + "n": 128, + "mean": 0.1052716969861649, + "p05": 0.09219089597463608, + "median": 0.10667918249964714, + "p95": 0.11580357439815997 + }, + "pairwise_l1": { + "n": 596, + "mean": 0.0643981220497556, + "p05": 0.014014112064614892, + "median": 0.06155876815319061, + "p95": 0.12792015075683594 + } + }, + "hop_matched": { + "n": 64, + "dist_to_mean": { + "n": 64, + "mean": 0.10438874992541969, + "p05": 0.09129686206579209, + "median": 0.10618481412529945, + "p95": 0.11581101752817628 + }, + "pairwise_l1": { + "n": 593, + "mean": 0.07432676787593388, + "p05": 0.013852091319859029, + "median": 0.08547434210777283, + "p95": 0.13093779981136322 + } + }, + "real_matched": { + "n": 64, + "dist_to_mean": { + "n": 64, + "mean": 0.10227899393066764, + "p05": 0.0842979058623314, + "median": 0.10303945094347, + "p95": 0.11885480731725692 + }, + "pairwise_l1": { + "n": 593, + "mean": 0.10002926471729529, + "p05": 0.05827012285590172, + "median": 0.10247097164392471, + "p95": 0.13917102515697477 + } + }, + "real_broad": { + "n": 128, + "dist_to_mean": { + "n": 128, + "mean": 0.09190310450503603, + "p05": 0.07163916788995266, + "median": 0.09266506507992744, + "p95": 0.11716121137142178 + }, + "pairwise_l1": { + "n": 596, + "mean": 0.10194767041025596, + "p05": 0.03864996042102575, + "median": 0.10680628567934036, + "p95": 0.14671632274985313 + } + }, + "dim_shuffle": { + "n": 128, + "dist_to_mean": { + "n": 128, + "mean": 0.08652187074767426, + "p05": 0.07266291938722133, + "median": 0.08336324989795685, + "p95": 0.10760912746191023 + }, + "pairwise_l1": { + "n": 593, + "mean": 0.08034926223212109, + "p05": 0.04266992583870888, + "median": 0.07859217375516891, + "p95": 0.12023997604846955 + } + } + }, + "ratio_dist_to_mean": 1.0206274613551851, + "ratio_pairwise": 0.7430502272109836, + "ratio_dist_to_mean_broad": 1.145463992246272, + "ratio_pairwise_broad": 0.6316782108959024, + "cell": 0.7430502272109836, + "primary": "hop_matched vs real_matched (same roots, same offsets)", + "n_hop": 128, + "n_matched": 64, + "n_truefuture_clipped": 23 + }, + "per_figure": { + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "cf081f324f948a85330edfaa6826e17e", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10848713666200638, + "real_dist_to_mean": 0.11066623032093048, + "hop_pairwise": 0.08246001034110252, + "real_pairwise": 0.0863972747299288, + "ratio_dist_to_mean": 0.9803093075752258, + "ratio_pairwise": 0.9544283728724794, + "cell": 0.9544283728724794, + "verdict": "OK" + }, + "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_scan/seed1/two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "ca4ce6e148ad5c45597d3276f0cd73a4", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.101801797747612, + "real_dist_to_mean": 0.09592041373252869, + "hop_pairwise": 0.08178507243948323, + "real_pairwise": 0.0845100050792098, + "ratio_dist_to_mean": 1.0613152980804443, + "ratio_pairwise": 0.9677560942379243, + "cell": 0.9677560942379243, + "verdict": "OK" + }, + "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_scan/seed2/two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "83042c87aa133a6d861c4b29bd3c48ca", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10581213235855103, + "real_dist_to_mean": 0.09733830392360687, + "hop_pairwise": 0.03207500756252557, + "real_pairwise": 0.07540259403841836, + "ratio_dist_to_mean": 1.0870554447174072, + "ratio_pairwise": 0.4253833435250655, + "cell": 0.4253833435250655, + "verdict": "COLLAPSE" + }, + "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_scan/seed3/two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "01f28d64b1eda80a16171e8fc77c546d", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10697760432958603, + "real_dist_to_mean": 0.09492094814777374, + "hop_pairwise": 0.02351204588610147, + "real_pairwise": 0.07714539180908885, + "ratio_dist_to_mean": 1.127017855644226, + "ratio_pairwise": 0.30477576605335754, + "cell": 0.30477576605335754, + "verdict": "COLLAPSE" + }, + "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_scan/seed3/two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "4fe751591e499ffa84048864d6091b50", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.09825437515974045, + "real_dist_to_mean": 0.09939873218536377, + "hop_pairwise": 0.09873898287436791, + "real_pairwise": 0.03809723337846143, + "ratio_dist_to_mean": 0.988487184047699, + "ratio_pairwise": 2.591762553818167, + "cell": 0.988487184047699, + "verdict": "OK" + }, + "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_scan/seed3/two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "d0ec12c4a7cc63e220c369aee02e2c39", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10575808584690094, + "real_dist_to_mean": 0.10391595959663391, + "hop_pairwise": 0.05171154953339802, + "real_pairwise": 0.01430577621795237, + "ratio_dist_to_mean": 1.0177271366119385, + "ratio_pairwise": 3.6147321715060112, + "cell": 1.0177271366119385, + "verdict": "OK" + }, + "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_unseen/two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "067fa64e3077b20e2488e28b9f29ed20", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10433915257453918, + "real_dist_to_mean": 0.10867948085069656, + "hop_pairwise": 0.044892540417744646, + "real_pairwise": 0.07256094366312027, + "ratio_dist_to_mean": 0.9600630402565002, + "ratio_pairwise": 0.6186873840308346, + "cell": 0.6186873840308346, + "verdict": "PARTIAL" + }, + "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz_unseen8/two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "622102449419f53052ef84a7acfe0040", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10367971658706665, + "real_dist_to_mean": 0.10739189386367798, + "hop_pairwise": 0.03522142506803253, + "real_pairwise": 0.054649370057242255, + "ratio_dist_to_mean": 0.9654333591461182, + "ratio_pairwise": 0.6444982811538358, + "cell": 0.6444982811538358, + "verdict": "PARTIAL" + } + } + } + }, + "verdict": "PARTIAL", + "verdict_counts": { + "n_tasks": 2, + "n_collapse": 0, + "n_ok": 1 + }, + "per_figure_counts": { + "n": 11, + "n_collapse": 2, + "n_partial": 3, + "n_ok": 6 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DECODER_COLLAPSE_PUBLISHED.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DECODER_COLLAPSE_PUBLISHED.json new file mode 100644 index 0000000000000000000000000000000000000000..ce77c9567a99841839c2c9f43217992ec82b0336 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DECODER_COLLAPSE_PUBLISHED.json @@ -0,0 +1,421 @@ +{ + "purpose": "mean-collapse instrument (decoder_transfer.py B) applied to the 12 PUBLISHED trees", + "pre_registration": "status/SUCCESSOR_VIZ.md run 22", + "sibling_result": "runs/pixdec/DECODER_TRANSFER.json (unseen anchors; VERDICT_B = COLLAPSE)", + "ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "step": 60000, + "res": 256, + "rng_seed": 0, + "particle": 0, + "h_fold": 20, + "collapse_lo": 0.6, + "collapse_hi": 0.8, + "capture_dir_pattern": "runs//stitchviz/", + "variant": "dec256", + "per_task": { + "square_expert_play": { + "n_roots": 6, + "roots": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16" + ], + "task_index": 2, + "collapse": { + "groups": { + "hop": { + "n": 96, + "dist_to_mean": { + "n": 96, + "mean": 0.08250042299429576, + "p05": 0.07039793394505978, + "median": 0.07501287758350372, + "p95": 0.1304519884288311 + }, + "pairwise_l1": { + "n": 595, + "mean": 0.052059775079060504, + "p05": 0.00689817015081644, + "median": 0.02880472131073475, + "p95": 0.13988109678030014 + } + }, + "hop_matched": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.09051300600791971, + "p05": 0.07000028789043426, + "median": 0.08209129422903061, + "p95": 0.13183776438236236 + }, + "pairwise_l1": { + "n": 593, + "mean": 0.07966929170637568, + "p05": 0.008512921445071698, + "median": 0.08850893378257751, + "p95": 0.14035121500492095 + } + }, + "real_matched": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.11144576997806628, + "p05": 0.07811598479747772, + "median": 0.11390823125839233, + "p95": 0.14051494896411895 + }, + "pairwise_l1": { + "n": 585, + "mean": 0.10271967880380077, + "p05": 0.031996868550777435, + "median": 0.10869258642196655, + "p95": 0.15372015237808223 + } + }, + "real_broad": { + "n": 96, + "dist_to_mean": { + "n": 96, + "mean": 0.09661689237691462, + "p05": 0.07248494774103165, + "median": 0.08172008022665977, + "p95": 0.13681412115693092 + }, + "pairwise_l1": { + "n": 597, + "mean": 0.10858510987493061, + "p05": 0.027525805309414866, + "median": 0.11428206413984299, + "p95": 0.19017200171947468 + } + }, + "dim_shuffle": { + "n": 96, + "dist_to_mean": { + "n": 96, + "mean": 0.0843088982316355, + "p05": 0.07067093439400196, + "median": 0.0820319652557373, + "p95": 0.1101500429213047 + }, + "pairwise_l1": { + "n": 595, + "mean": 0.07734421813437918, + "p05": 0.04613783732056618, + "median": 0.07422120124101639, + "p95": 0.11589545235037803 + } + } + }, + "ratio_dist_to_mean": 0.812170852475905, + "ratio_pairwise": 0.7755991124013114, + "ratio_dist_to_mean_broad": 0.8538923263278978, + "ratio_pairwise_broad": 0.4794375134769717, + "cell": 0.7755991124013114, + "primary": "hop_matched vs real_matched (same roots, same offsets)", + "n_hop": 96, + "n_matched": 48, + "n_truefuture_clipped": 8 + }, + "per_figure": { + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "ef66050c9320363622d46efdb6849b7b", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.09503182768821716, + "real_dist_to_mean": 0.09849011898040771, + "hop_pairwise": 0.07243771954173488, + "real_pairwise": 0.08026571179340992, + "ratio_dist_to_mean": 0.9648869037628174, + "ratio_pairwise": 0.9024740193941972, + "cell": 0.9024740193941972, + "verdict": "OK" + }, + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "e0ce3687f298c41063b779bf64c72d09", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.11331859230995178, + "real_dist_to_mean": 0.12473438680171967, + "hop_pairwise": 0.07283785881008953, + "real_pairwise": 0.05626493808813393, + "ratio_dist_to_mean": 0.9084791541099548, + "ratio_pairwise": 1.2945514788623, + "cell": 0.9084791541099548, + "verdict": "OK" + }, + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "c01b5864ff4d4e670bcf07c91ae0c8ee", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.08091644197702408, + "real_dist_to_mean": 0.12737861275672913, + "hop_pairwise": 0.04737071637230526, + "real_pairwise": 0.06743869125576955, + "ratio_dist_to_mean": 0.6352435350418091, + "ratio_pairwise": 0.7024263889203599, + "cell": 0.6352435350418091, + "verdict": "PARTIAL" + }, + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "c0529be23b0ee30db43a73b975b16351", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.09697205573320389, + "real_dist_to_mean": 0.11679671704769135, + "hop_pairwise": 0.06136906038903232, + "real_pairwise": 0.045231562573462725, + "ratio_dist_to_mean": 0.8302635550498962, + "ratio_pairwise": 1.3567751564929893, + "cell": 0.8302635550498962, + "verdict": "OK" + }, + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "d6602cb546cdc4433a87fc1d81ffcb27", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.0857742428779602, + "real_dist_to_mean": 0.12242598831653595, + "hop_pairwise": 0.0682905276272712, + "real_pairwise": 0.03409400332852134, + "ratio_dist_to_mean": 0.7006211876869202, + "ratio_pairwise": 2.0030070088643055, + "cell": 0.7006211876869202, + "verdict": "PARTIAL" + }, + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "75a3de2df73a58f54876f1ff2cf50aa4", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.07106485962867737, + "real_dist_to_mean": 0.07884880900382996, + "hop_pairwise": 0.022419234820907668, + "real_pairwise": 0.014809060143306851, + "ratio_dist_to_mean": 0.9012800455093384, + "ratio_pairwise": 1.513886404941122, + "cell": 0.9012800455093384, + "verdict": "OK" + } + } + }, + "two_piece_expert_play": { + "n_roots": 6, + "roots": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16" + ], + "task_index": 4, + "collapse": { + "groups": { + "hop": { + "n": 96, + "dist_to_mean": { + "n": 96, + "mean": 0.10854771127924323, + "p05": 0.087098877876997, + "median": 0.10400913283228874, + "p95": 0.1353508085012436 + }, + "pairwise_l1": { + "n": 589, + "mean": 0.07985955503403963, + "p05": 0.01510760821402073, + "median": 0.0959438681602478, + "p95": 0.1348807841539383 + } + }, + "hop_matched": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.10674488823860884, + "p05": 0.08673917725682259, + "median": 0.1037563644349575, + "p95": 0.1317512258887291 + }, + "pairwise_l1": { + "n": 589, + "mean": 0.08385621914592634, + "p05": 0.015234597213566306, + "median": 0.10102140158414841, + "p95": 0.1312712162733078 + } + }, + "real_matched": { + "n": 48, + "dist_to_mean": { + "n": 48, + "mean": 0.10561723184461395, + "p05": 0.08966069929301738, + "median": 0.10605640709400177, + "p95": 0.11936306431889535 + }, + "pairwise_l1": { + "n": 588, + "mean": 0.09870762416148926, + "p05": 0.056385766714811325, + "median": 0.10334502533078194, + "p95": 0.1320175677537918 + } + }, + "real_broad": { + "n": 96, + "dist_to_mean": { + "n": 96, + "mean": 0.08903342679453392, + "p05": 0.07013052143156528, + "median": 0.08985932171344757, + "p95": 0.1121810507029295 + }, + "pairwise_l1": { + "n": 589, + "mean": 0.09823130009694306, + "p05": 0.03596058785915375, + "median": 0.10205274075269699, + "p95": 0.1416025072336197 + } + }, + "dim_shuffle": { + "n": 96, + "dist_to_mean": { + "n": 96, + "mean": 0.08158850025696059, + "p05": 0.07068082876503468, + "median": 0.07990819960832596, + "p95": 0.1005965955555439 + }, + "pairwise_l1": { + "n": 594, + "mean": 0.07335375797517774, + "p05": 0.042119943164289, + "median": 0.07091138884425163, + "p95": 0.10966774001717568 + } + } + }, + "ratio_dist_to_mean": 1.0106768220895423, + "ratio_pairwise": 0.8495414600267809, + "ratio_dist_to_mean_broad": 1.2191793036310197, + "ratio_pairwise_broad": 0.8129746318660893, + "cell": 0.8495414600267809, + "primary": "hop_matched vs real_matched (same roots, same offsets)", + "n_hop": 96, + "n_matched": 48, + "n_truefuture_clipped": 15 + }, + "per_figure": { + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "6c1073b2eea7501c7baa083da5161581", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.1285184770822525, + "real_dist_to_mean": 0.11088239401578903, + "hop_pairwise": 0.08225093549117446, + "real_pairwise": 0.09700415789016656, + "ratio_dist_to_mean": 1.1590521335601807, + "ratio_pairwise": 0.8479114429744702, + "cell": 0.8479114429744702, + "verdict": "OK" + }, + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "49e862c3e3ffbd1276bf82de39312d9f", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10044363886117935, + "real_dist_to_mean": 0.09804387390613556, + "hop_pairwise": 0.046678983040952256, + "real_pairwise": 0.08417851424642972, + "ratio_dist_to_mean": 1.024476408958435, + "ratio_pairwise": 0.554523722102069, + "cell": 0.554523722102069, + "verdict": "COLLAPSE" + }, + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "cf081f324f948a85330edfaa6826e17e", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.1049380823969841, + "real_dist_to_mean": 0.10856576263904572, + "hop_pairwise": 0.08246001034110252, + "real_pairwise": 0.0863972747299288, + "ratio_dist_to_mean": 0.9665853977203369, + "ratio_pairwise": 0.9544283728724794, + "cell": 0.9544283728724794, + "verdict": "OK" + }, + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "a4ed75442046a7df374fb6f8130b339f", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.1018432229757309, + "real_dist_to_mean": 0.09606117010116577, + "hop_pairwise": 0.03944332746323198, + "real_pairwise": 0.07859761334423508, + "ratio_dist_to_mean": 1.0601913928985596, + "ratio_pairwise": 0.5018387427424988, + "cell": 0.5018387427424988, + "verdict": "COLLAPSE" + }, + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "b30dfc46d81ace510412799951855b2d", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.10907246917486191, + "real_dist_to_mean": 0.10981841385364532, + "hop_pairwise": 0.06685599806119821, + "real_pairwise": 0.054444060128714354, + "ratio_dist_to_mean": 0.9932074546813965, + "ratio_pairwise": 1.2279759794390808, + "cell": 0.9932074546813965, + "verdict": "OK" + }, + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16": { + "trace": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.npz", + "trace_md5": "ed1d560f0d168d831378e6e44e6d039f", + "n_hops": 8, + "n_pairs": 28, + "hop_dist_to_mean": 0.09565344452857971, + "real_dist_to_mean": 0.11033178865909576, + "hop_pairwise": 0.0775974061938801, + "real_pairwise": 0.019210110618067638, + "ratio_dist_to_mean": 0.8669617772102356, + "ratio_pairwise": 4.0394044436629954, + "cell": 0.8669617772102356, + "verdict": "OK" + } + } + } + }, + "verdict": "PARTIAL", + "verdict_counts": { + "n_tasks": 2, + "n_collapse": 0, + "n_ok": 1 + }, + "per_figure_counts": { + "n": 12, + "n_collapse": 2, + "n_partial": 2, + "n_ok": 8 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DEPTH_READOUT.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DEPTH_READOUT.json new file mode 100644 index 0000000000000000000000000000000000000000..19b496b6871c44341b5a335fb4f31351a57f39db --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DEPTH_READOUT.json @@ -0,0 +1,1484 @@ +{ + "generated_by": "scripts/viz/depth_readout.py (gen_q#270 run 28)", + "n_trees": 12, + "caps_measured": [ + 3, + 5, + 7, + 11, + 15, + 23, + 33 + ], + "headline_cap": 33, + "depth_shallow": 8, + "depth_deep": 34, + "n_tiebreak_draws": 200, + "run27_reference": { + "median_rho_cap7": 0.975, + "kept_argmax_cap7": 7, + "n_trees": 12 + }, + "GATE_all_ok": true, + "GATE_failures": [], + "chain_p": 0.8080808080808081, + "flagship_cap": 33, + "trees": [ + { + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 5.354480629715663e-09, + "G2_ok": true, + "Q_fold_max": 0.02600548043847084, + "Q_fold_min": 0.0, + "fold_argmax": 14, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.6689070004053005, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0012305135913905406, + "Q_chain_min": 0.0, + "Q_chain_argmax": 112, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.7929980271974586, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.02158481366930819, + "Q_chain_min": 0.0, + "Q_chain_argmax": 21, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9652935740179627, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.01328823583593431, + "Q_chain_min": 0.0, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.848344649402151, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.007128869662084257, + "Q_chain_min": 0.0, + "Q_chain_argmax": 14, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8060434301810662, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.009009279878621533, + "Q_chain_min": 0.0, + "Q_chain_argmax": 11, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8343121027408835, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.008242480393781145, + "Q_chain_min": 0.0, + "Q_chain_argmax": 11, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.7651339686162617, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.00829036387444866, + "Q_chain_min": 0.0, + "Q_chain_argmax": 11, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.7496892019687016, + "argmax_same": false, + "max_abs_dQ": 0.007907326952964073 + }, + "deep_green": { + "frac_green_hops_0_7": 0.00152587890625, + "frac_green_hops_8_33": 0.013427734375, + "frac_green_all": 0.010627297794117647 + } + }, + { + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.9364631902611332e-13, + "G2_ok": true, + "Q_fold_max": 6.420436875487212e-07, + "Q_fold_min": 0.0, + "fold_argmax": 126, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.3080057224606581, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 6.087174728732869e-14, + "Q_chain_min": 0.0, + "Q_chain_argmax": 48, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": -0.1255450643776824, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 3.28156100587036e-12, + "Q_chain_min": 0.0, + "Q_chain_argmax": 78, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9985979971387696, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 5.461055266886763e-07, + "Q_chain_min": 0.0, + "Q_chain_argmax": 112, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9531902718168812, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.005367428249203921, + "Q_chain_min": 0.0, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.44529327610872677, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.010212697406578108, + "Q_chain_min": 0.0, + "Q_chain_argmax": 81, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.4524864091559371, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.009492628645546371, + "Q_chain_min": 0.0, + "Q_chain_argmax": 98, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.05190844062947067, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.009514686738628882, + "Q_chain_min": 0.0, + "Q_chain_argmax": 98, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.05602861230329041, + "argmax_same": false, + "max_abs_dQ": 0.00951434357442875 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.010366586538461538, + "frac_green_all": 0.007927389705882353 + } + }, + { + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 7.620321249013351e-09, + "G2_ok": true, + "Q_fold_max": 0.04637071117758751, + "Q_fold_min": 0.0, + "fold_argmax": 71, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9359778428859183, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03307255772257242, + "Q_chain_min": 0.0, + "Q_chain_argmax": 22, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.852064640175792, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.009658788055747616, + "Q_chain_min": 0.0, + "Q_chain_argmax": 41, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9321724501007141, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.01746674417735684, + "Q_chain_min": 0.0, + "Q_chain_argmax": 71, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.962380974180553, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.011412423574368974, + "Q_chain_min": 1.154129299324348e-24, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9565097967405237, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.011412423574368974, + "Q_chain_min": 4.825009426035857e-18, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9577858908624794, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.011413072618303361, + "Q_chain_min": 4.8250206217094596e-18, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9538946621497895, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.011413072618303363, + "Q_chain_min": 1.178636411386598e-17, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9523896722212049, + "argmax_same": false, + "max_abs_dQ": 0.011127820104167912 + }, + "deep_green": { + "frac_green_hops_0_7": 0.00518798828125, + "frac_green_hops_8_33": 0.0005446213942307692, + "frac_green_all": 0.0016371783088235295 + } + }, + { + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.2912262842279532e-08, + "G2_ok": true, + "Q_fold_max": 0.06309670954942703, + "Q_fold_min": 0.0, + "fold_argmax": 123, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.6555232558139535, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.012084121186741962, + "Q_chain_min": 0.0, + "Q_chain_argmax": 57, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.6652742171763413, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.011849788224745056, + "Q_chain_min": 0.0, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9936824757370445, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.011848732367557494, + "Q_chain_min": 0.0, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.6474088994689617, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.01416619223630215, + "Q_chain_min": 0.0, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.6478838582677166, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.014179221453430702, + "Q_chain_min": 0.0, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.6478838582677166, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.014179221851322856, + "Q_chain_min": 0.0, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.6478838582677166, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.014179221622859011, + "Q_chain_min": 0.0, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.6535146951107855, + "argmax_same": true, + "max_abs_dQ": 0.004302560474774982 + }, + "deep_green": { + "frac_green_hops_0_7": 0.00225830078125, + "frac_green_hops_8_33": 0.0035306490384615385, + "frac_green_all": 0.0032312729779411763 + } + }, + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 8.617058777637965e-08, + "G2_ok": true, + "Q_fold_max": 0.6416629552841187, + "Q_fold_min": 4.197901120420655e-26, + "fold_argmax": 45, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9987582402490386, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4803958265802093, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9990271928218275, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.5316833133375145, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9990100256363303, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.5303005001087124, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9985636788134041, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4583766429774391, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9992160318622962, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4386700780525109, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9990558047976561, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4388880126036618, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9990558047976561, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4385806195537324, + "Q_chain_min": 8.056578183321293e-27, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9996165995238967, + "argmax_same": true, + "max_abs_dQ": 0.11065031403323289 + }, + "deep_green": { + "frac_green_hops_0_7": 0.13018798828125, + "frac_green_hops_8_33": 0.016169621394230768, + "frac_green_all": 0.04299747242647059 + } + }, + { + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.371429957959137e-08, + "G2_ok": true, + "Q_fold_max": 0.30500614643096924, + "Q_fold_min": 5.175882059945155e-25, + "fold_argmax": 27, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9929900659219923, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.20445298355118338, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9943004944149423, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.23098724411775548, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9918398644936824, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.21652887480551586, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9137291704815967, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.21498145443920869, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9172083867423548, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.2159202558059211, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9292139718000366, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.21385432570632526, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9291281358725508, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.2136088127247271, + "Q_chain_min": 9.933510680700101e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9381523530488921, + "argmax_same": true, + "max_abs_dQ": 0.014054405248223045 + }, + "deep_green": { + "frac_green_hops_0_7": 0.03131103515625, + "frac_green_hops_8_33": 0.029710036057692308, + "frac_green_all": 0.030086741727941176 + } + }, + { + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 7.015665218906841e-09, + "G2_ok": true, + "Q_fold_max": 0.027879871428012848, + "Q_fold_min": 9.146366254165407e-21, + "fold_argmax": 41, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": -0.5140656473173412, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 4.786352821240632e-08, + "Q_chain_min": 2.6337097550380454e-26, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8153840871635232, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0181183168671221, + "Q_chain_min": 1.755346593233813e-21, + "Q_chain_argmax": 74, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.4211625618018678, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.011609581894251193, + "Q_chain_min": 1.7553465932336537e-21, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": -0.16867904229994507, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.011978313366417926, + "Q_chain_min": 1.7553465932336537e-21, + "Q_chain_argmax": 9, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": -0.18781473173411464, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.010773486042979412, + "Q_chain_min": 1.7553465932336537e-21, + "Q_chain_argmax": 11, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": -0.16770623512177257, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.009471912863120619, + "Q_chain_min": 1.7553465932336537e-21, + "Q_chain_argmax": 9, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": -0.16770623512177257, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.009471912863120619, + "Q_chain_min": 1.7553465932336537e-21, + "Q_chain_argmax": 9, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.48924189708844534, + "argmax_same": false, + "max_abs_dQ": 0.006884330046546684 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0113525390625, + "frac_green_hops_8_33": 0.006328876201923077, + "frac_green_all": 0.007510914522058824 + } + }, + { + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.2583635168594842e-08, + "G2_ok": true, + "Q_fold_max": 0.054951541125774384, + "Q_fold_min": 0.019270235672593117, + "fold_argmax": 53, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.5252586522614906, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.011568052420475284, + "Q_chain_min": 0.00021640695836583386, + "Q_chain_argmax": 53, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8520245834096319, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.028039179472416333, + "Q_chain_min": 0.0005680974645232367, + "Q_chain_argmax": 52, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9041956601355063, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03889713517269355, + "Q_chain_min": 0.012918253331825695, + "Q_chain_argmax": 52, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.8939354056033694, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027697037420340707, + "Q_chain_min": 0.008783470365157194, + "Q_chain_argmax": 52, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8937465665629005, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027697024873664756, + "Q_chain_min": 0.008783467248844488, + "Q_chain_argmax": 52, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8934604468046146, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027697024873664756, + "Q_chain_min": 0.008783467248844488, + "Q_chain_argmax": 52, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.8934604468046146, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027697024873664756, + "Q_chain_min": 0.008783467248844488, + "Q_chain_argmax": 52, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9777169932246841, + "argmax_same": true, + "max_abs_dQ": 0.011200110299028797 + }, + "deep_green": { + "frac_green_hops_0_7": 0.020263671875, + "frac_green_hops_8_33": 0.005615234375, + "frac_green_all": 0.009061925551470588 + } + }, + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 3.603420717368522e-08, + "G2_ok": true, + "Q_fold_max": 0.22928565740585327, + "Q_fold_min": 0.12986499071121216, + "fold_argmax": 27, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.5302085240798389, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.1282134401996361, + "Q_chain_min": 0.016884500311412774, + "Q_chain_argmax": 17, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.6676318439846182, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.10559453771332138, + "Q_chain_min": 0.0201158724939329, + "Q_chain_argmax": 107, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.7092679912104011, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.10702459827467498, + "Q_chain_min": 0.041757993166506385, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.8076931880607947, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.07801512241719355, + "Q_chain_min": 0.027087219198096146, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8076931880607947, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.07801508557984022, + "Q_chain_min": 0.02708719599288887, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8076931880607947, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.07801508557984022, + "Q_chain_min": 0.02708719599288887, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.8076931880607947, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.07801508557984022, + "Q_chain_min": 0.02708719599288887, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.8335298022340231, + "argmax_same": true, + "max_abs_dQ": 0.03209471827844068 + }, + "deep_green": { + "frac_green_hops_0_7": 0.08941650390625, + "frac_green_hops_8_33": 0.0033052884615384615, + "frac_green_all": 0.023566750919117647 + } + }, + { + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 5.850732726075947e-08, + "G2_ok": true, + "Q_fold_max": 0.3009246587753296, + "Q_fold_min": 0.23572570085525513, + "fold_argmax": 27, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.8946564273942501, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.2304280889887453, + "Q_chain_min": 0.15833260090814086, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.09098036073979125, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.18308855893683104, + "Q_chain_min": 0.12582976410917404, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": -0.2817249587987548, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.1777692683518578, + "Q_chain_min": 0.12777787154034698, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": -0.12059947811756089, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.1528216212302656, + "Q_chain_min": 0.11035990596527295, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": -0.12478254898370261, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.15621790300821042, + "Q_chain_min": 0.11274423020493014, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": -0.12793558872001465, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.15502184900486554, + "Q_chain_min": 0.11124101522189014, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": -0.12795847830067753, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.15502184900486554, + "Q_chain_min": 0.11124101522189014, + "Q_chain_argmax": 27, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.7725977385094305, + "argmax_same": true, + "max_abs_dQ": 0.03715257464344457 + }, + "deep_green": { + "frac_green_hops_0_7": 0.16436767578125, + "frac_green_hops_8_33": 0.012319711538461538, + "frac_green_all": 0.048095703125 + } + }, + { + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 9.95945220391703e-10, + "G2_ok": true, + "Q_fold_max": 0.009862987324595451, + "Q_fold_min": 2.246875737910159e-06, + "fold_argmax": 97, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.8833661417322834, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.004394579731592423, + "Q_chain_min": 3.058918868406257e-08, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9069538546053836, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0018465411170700788, + "Q_chain_min": 2.2384710130930325e-08, + "Q_chain_argmax": 97, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9998512177256913, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0018476365572874095, + "Q_chain_min": 4.0600368792015147e-07, + "Q_chain_argmax": 97, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9998512177256913, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0018476361945262065, + "Q_chain_min": 4.0594279449621976e-07, + "Q_chain_argmax": 97, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9998512177256913, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0018476361945262065, + "Q_chain_min": 4.0594279449621976e-07, + "Q_chain_argmax": 97, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9998512177256913, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0018476361945262093, + "Q_chain_min": 4.059427951735848e-07, + "Q_chain_argmax": 97, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9998512177256913, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0018476361945262093, + "Q_chain_min": 4.059427951735848e-07, + "Q_chain_argmax": 97, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 6.930328777807269e-08 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + } + }, + { + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270028, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 3.0259065531001994e-08, + "G2_ok": true, + "Q_fold_max": 0.16261976957321167, + "Q_fold_min": 0.09178175032138824, + "fold_argmax": 72, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.6436321186595861, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.058560760803516604, + "Q_chain_min": 0.039862466371676425, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9292254165903681, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.05542481532603449, + "Q_chain_min": 0.012763328282464821, + "Q_chain_argmax": 14, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.7898335927485809, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.05226468343138618, + "Q_chain_min": 0.02703929456492709, + "Q_chain_argmax": 53, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.990191814685955, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.036052624685510175, + "Q_chain_min": 0.016992394966927903, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.990191814685955, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03605255015170039, + "Q_chain_min": 0.01699233471006449, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.990191814685955, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03605255015170039, + "Q_chain_min": 0.01699233471006449, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.990191814685955, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03605255015170039, + "Q_chain_min": 0.01699233471006449, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.7759338948910456, + "argmax_same": false, + "max_abs_dQ": 0.02258571420961311 + }, + "deep_green": { + "frac_green_hops_0_7": 0.04205322265625, + "frac_green_hops_8_33": 7.512019230769231e-05, + "frac_green_all": 0.009952320772058824 + } + } + ], + "cap3": { + "median_rho": 0.662215128109627, + "min_rho": -0.5140656473173412, + "max_rho": 0.9987582402490386, + "median_top3": 0.333333333333334, + "n_argmax_kept": 4, + "n": 12, + "kept": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 2, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 6 + }, + "cap5": { + "median_rho": 0.8337043352865776, + "min_rho": -0.1255450643776824, + "max_rho": 0.9990271928218275, + "median_top3": 0.500000000000001, + "n_argmax_kept": 5, + "n": 12, + "kept": [ + "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 3, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 6 + }, + "cap7": { + "median_rho": 0.9487330120593385, + "min_rho": -0.2817249587987548, + "max_rho": 0.9998512177256913, + "median_top3": 0.666666666666668, + "n_argmax_kept": 7, + "n": 12, + "kept": [ + "square_expert_play_demo_160_t0165_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 4, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 3, + "two_piece_expert_play_n": 6 + }, + "cap11": { + "median_rho": 0.9038322880424831, + "min_rho": -0.16867904229994507, + "max_rho": 0.9998512177256913, + "median_top3": 0.666666666666668, + "n_argmax_kept": 7, + "n": 12, + "kept": [ + "square_expert_play_demo_102_t0145_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 4, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 3, + "two_piece_expert_play_n": 6 + }, + "cap15": { + "median_rho": 0.8507198773118476, + "min_rho": -0.18781473173411464, + "max_rho": 0.9998512177256913, + "median_top3": 0.666666666666668, + "n_argmax_kept": 6, + "n": 12, + "kept": [ + "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 3, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 3, + "two_piece_expert_play_n": 6 + }, + "cap23": { + "median_rho": 0.863886274772749, + "min_rho": -0.16770623512177257, + "max_rho": 0.9998512177256913, + "median_top3": 0.666666666666668, + "n_argmax_kept": 6, + "n": 12, + "kept": [ + "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 3, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 3, + "two_piece_expert_play_n": 6 + }, + "cap33": { + "median_rho": 0.8505768174327046, + "min_rho": -0.16770623512177257, + "max_rho": 0.9998512177256913, + "median_top3": 0.666666666666668, + "n_argmax_kept": 6, + "n": 12, + "kept": [ + "square_expert_play_demo_221_t0249_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L34_N128_P16" + ], + "square_expert_play_kept": 3, + "square_expert_play_n": 6, + "two_piece_expert_play_kept": 3, + "two_piece_expert_play_n": 6 + }, + "median_rho_by_cap": { + "3": 0.662215128109627, + "5": 0.8337043352865776, + "7": 0.9487330120593385, + "11": 0.9038322880424831, + "15": 0.8507198773118476, + "23": 0.863886274772749, + "33": 0.8505768174327046 + }, + "n_argmax_kept_by_cap": { + "3": 4, + "5": 5, + "7": 7, + "11": 7, + "15": 6, + "23": 6, + "33": 6 + }, + "rho_monotone_in_cap": false, + "VERDICT_G3_replication": "REPLICATES", + "VERDICT_DEPTH": "DEPTH_REVERSES" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DEPTH_UNSEEN.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DEPTH_UNSEEN.json new file mode 100644 index 0000000000000000000000000000000000000000..80e5fe08eca3905fef6ab8b47de63a3b08194249 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/DEPTH_UNSEEN.json @@ -0,0 +1,4228 @@ +{ + "generated_by": "scripts/viz/depth_readout_unseen.py (gen_q#270 run 29)", + "family": "UNSEEN held-out anchors (unseen_anchors.py, 8 per task x 4 tasks)", + "tasks": { + "square_expert_play": "L40best", + "square_sub_20100": "Mbest", + "two_piece_expert_play": "L40best", + "two_piece_expert_suboptimal": "Mproghead" + }, + "n_trees": 32, + "caps_measured": [ + 3, + 5, + 7, + 11, + 15, + 23, + 33 + ], + "headline_cap": 33, + "horizon_matched_cap": 7, + "depth_shallow": 8, + "depth_deep": 34, + "n_tiebreak_draws": 200, + "run28_reference": { + "n_trees": 12, + "median_rho_by_cap": { + "3": 0.662, + "5": 0.834, + "7": 0.949, + "11": 0.904, + "15": 0.851, + "23": 0.864, + "33": 0.851 + }, + "n_argmax_kept_by_cap": { + "3": 4, + "5": 5, + "7": 7, + "11": 7, + "15": 6, + "23": 6, + "33": 6 + }, + "verdict": "DEPTH_REVERSES" + }, + "GATE_all_ok": true, + "GATE_failures": [], + "chain_p": 0.8080808080808081, + "flagship_cap": 33, + "trees": [ + { + "name": "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_148_t0138_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_148", + "frame": 138, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.746061961156343e-08, + "G2_ok": true, + "Q_fold_max": 0.545652449131012, + "Q_fold_min": 1.3961271173077856e-31, + "fold_argmax": 44, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.8762017029848013, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.15037021559040548, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9768014099981688, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12516002103446128, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9927611701153635, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12492270888953418, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9927611701153635, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12492270888953408, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9927611701153635, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12492270888953408, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9927611701153635, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12492270888953408, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9927611701153635, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12492270888953408, + "Q_chain_min": 2.6794357962017635e-32, + "Q_chain_argmax": 44, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 1.5354582324361016e-05 + }, + "deep_green": { + "frac_green_hops_0_7": 0.01580810546875, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0037195542279411763 + }, + "Q_fold_span": 0.545652449131012, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_expert_play_demo_150_t0125_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_150_t0125_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_150", + "frame": 125, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.8811827321009265e-16, + "G2_ok": true, + "Q_fold_max": 9.224838670718327e-10, + "Q_fold_min": 0.0, + "fold_argmax": 116, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.20083322841675155, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 4.429205402300212e-18, + "Q_chain_min": 0.0, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": -0.15328312598001625, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 2.1651735529222867e-14, + "Q_chain_min": 0.0, + "Q_chain_argmax": 40, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9993361641734672, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 7.198845248148862e-10, + "Q_chain_min": 0.0, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": -0.11714413249247461, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.004731724130503934, + "Q_chain_min": 0.0, + "Q_chain_argmax": 17, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": -0.11705829165283675, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0009121233452997932, + "Q_chain_min": 0.0, + "Q_chain_argmax": 17, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": -0.11705829165283675, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0009121233452997932, + "Q_chain_min": 0.0, + "Q_chain_argmax": 17, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": -0.11705661695843562, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0009121233452997932, + "Q_chain_min": 0.0, + "Q_chain_argmax": 17, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": -0.1156202341250664, + "argmax_same": false, + "max_abs_dQ": 0.0009121230182880819 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0015963040865384615, + "frac_green_all": 0.001220703125 + }, + "Q_fold_span": 9.224838670718327e-10, + "degenerate_no_green": false, + "degenerate_underflow": true + }, + { + "name": "square_expert_play_demo_164_t0093_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_164_t0093_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_164", + "frame": 93, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 7.261682581638507e-09, + "G2_ok": true, + "Q_fold_max": 0.01870311237871647, + "Q_fold_min": 0.0, + "fold_argmax": 71, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.5324698177310082, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 2.578913206936054e-14, + "Q_chain_min": 0.0, + "Q_chain_argmax": 49, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8481708948394504, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 5.026358637800694e-10, + "Q_chain_min": 0.0, + "Q_chain_argmax": 49, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.41186661574077865, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.003401162837077396, + "Q_chain_min": 0.0, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.44801524457389197, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.003403721243529776, + "Q_chain_min": 0.0, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.447786347129959, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0034037043576232284, + "Q_chain_min": 0.0, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.44770051058848415, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0034037043576232284, + "Q_chain_min": 0.0, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.4474716131445512, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0034037043576232284, + "Q_chain_min": 0.0, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9939227989459318, + "argmax_same": true, + "max_abs_dQ": 1.25978364964403e-05 + }, + "deep_green": { + "frac_green_hops_0_7": 0.006591796875, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0015510110294117646 + }, + "Q_fold_span": 0.01870311237871647, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_181", + "frame": 135, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 8.487573410764782e-08, + "G2_ok": true, + "Q_fold_max": 0.8743568658828735, + "Q_fold_min": 6.638434376857183e-13, + "fold_argmax": 81, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.5456990477934445, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3833519154026365, + "Q_chain_min": 4.831782852218615e-13, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.5627575077824575, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3341036268788675, + "Q_chain_min": 1.0356700857727525e-13, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.5784769273026918, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.31955059953380605, + "Q_chain_min": 1.922651928828823e-13, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.6029516114264787, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3121269446525783, + "Q_chain_min": 5.266165433401341e-11, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.5941162332906061, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3121269936568704, + "Q_chain_min": 5.181182774259877e-05, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.5931319813221022, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3121270125459492, + "Q_chain_min": 9.961457862592475e-06, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.5923880699505585, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3121270125459509, + "Q_chain_min": 1.1448422288062636e-05, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9842233565281084, + "argmax_same": true, + "max_abs_dQ": 0.00852678692431319 + }, + "deep_green": { + "frac_green_hops_0_7": 0.210205078125, + "frac_green_hops_8_33": 0.011512169471153846, + "frac_green_all": 0.05826344209558824 + }, + "Q_fold_span": 0.8743568658822097, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_198", + "frame": 110, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 3.2601265131937396e-08, + "G2_ok": true, + "Q_fold_max": 0.2663421928882599, + "Q_fold_min": 0.0, + "fold_argmax": 77, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.993820165031696, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.18996402357160083, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9947763572617487, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.20905727863278814, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9975504952131364, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.19701769788400003, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9921025604703049, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.17880859953193418, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.99403265219393, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.16976821904112677, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9962224504491742, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.17032777129402432, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9961988407644816, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.17032777129402432, + "Q_chain_min": 0.0, + "Q_chain_argmax": 77, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9968953264629151, + "argmax_same": true, + "max_abs_dQ": 0.02668992658997571 + }, + "deep_green": { + "frac_green_hops_0_7": 0.00531005859375, + "frac_green_hops_8_33": 0.012300931490384616, + "frac_green_all": 0.010656020220588236 + }, + "Q_fold_span": 0.2663421928882599, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_212_t0141_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_212", + "frame": 141, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 3.152383756810373e-08, + "G2_ok": true, + "Q_fold_max": 0.15955595672130585, + "Q_fold_min": 1.1460997342157424e-21, + "fold_argmax": 16, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9923319904779344, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.11482277475397773, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 45, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9608359274858085, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.13371058760285465, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.965596960263688, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.09730130646138271, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9558002197399743, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.09231230720948821, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9610190441311115, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.08914371545514435, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9626957059146677, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.08990663321461227, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9626957059146677, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.08990663320995892, + "Q_chain_min": 2.19958516879947e-22, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9956223676982238, + "argmax_same": true, + "max_abs_dQ": 0.015494218295898726 + }, + "deep_green": { + "frac_green_hops_0_7": 0.02984619140625, + "frac_green_hops_8_33": 0.01019756610576923, + "frac_green_all": 0.014820772058823529 + }, + "Q_fold_span": 0.15955595672130585, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_54", + "frame": 122, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.6777557899987023e-11, + "G2_ok": true, + "Q_fold_max": 0.00019812110986094922, + "Q_fold_min": 0.0, + "fold_argmax": 64, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9581344927270224, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 1.7924515852478051e-12, + "Q_chain_min": 0.0, + "Q_chain_argmax": 35, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9890675905107145, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0001865027814415619, + "Q_chain_min": 0.0, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9999139631991923, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.5793463105066706e-05, + "Q_chain_min": 0.0, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.914232781168265, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.579537225156839e-05, + "Q_chain_min": 0.0, + "Q_chain_argmax": 64, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9218212269994952, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0001718771000738435, + "Q_chain_min": 0.0, + "Q_chain_argmax": 63, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9180700224842839, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0009623127354026853, + "Q_chain_min": 0.0, + "Q_chain_argmax": 63, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9170777313816363, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0009623118608941225, + "Q_chain_min": 0.0, + "Q_chain_argmax": 63, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.916303400174368, + "argmax_same": false, + "max_abs_dQ": 0.0009623118586398577 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 5.6340144230769234e-05, + "frac_green_all": 4.3083639705882356e-05 + }, + "Q_fold_span": 0.00019812110986094922, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_expert_play_demo_88_t0144_L40best_b0.95_L34_N128_P16", + "shallow_name": "square_expert_play_demo_88_t0144_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "tag": "L40best", + "episode": "demo_88", + "frame": 144, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "n_val_eps": 42, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 4.25976441620346e-09, + "G2_ok": true, + "Q_fold_max": 0.020004522055387497, + "Q_fold_min": 2.508017189484235e-07, + "fold_argmax": 26, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.16689365500824024, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 1.7113418296953726e-05, + "Q_chain_min": 1.0474223685942327e-08, + "Q_chain_argmax": 107, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.4936881981322102, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 1.853063167373853e-05, + "Q_chain_min": 1.1694294876973343e-08, + "Q_chain_argmax": 5, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9998855520966856, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.006024716408629413, + "Q_chain_min": 4.498600173415228e-08, + "Q_chain_argmax": 115, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9749530763596411, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0040241571184404246, + "Q_chain_min": 2.525744960746003e-07, + "Q_chain_argmax": 115, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8736323475553928, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.004024196508617138, + "Q_chain_min": 2.52574493611696e-07, + "Q_chain_argmax": 115, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9049510162973814, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.004024196508617138, + "Q_chain_min": 2.52574493611696e-07, + "Q_chain_argmax": 115, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9049510162973814, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.004024196508617138, + "Q_chain_min": 2.52574493611696e-07, + "Q_chain_argmax": 115, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9052657480314961, + "argmax_same": true, + "max_abs_dQ": 0.002000519900012275 + }, + "deep_green": { + "frac_green_hops_0_7": 0.00018310546875, + "frac_green_hops_8_33": 0.00022536057692307694, + "frac_green_all": 0.00021541819852941176 + }, + "Q_fold_span": 0.02000427125366855, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_103_t0320_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_103", + "frame": 320, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.2467020310140695e-09, + "G2_ok": true, + "Q_fold_max": 0.009210404939949512, + "Q_fold_min": 4.692724542110227e-05, + "fold_argmax": 18, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.001725445882076606, + "Q_chain_min": 8.796321598484791e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0017254432197273825, + "Q_chain_min": 8.792056082594955e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0017254432197278406, + "Q_chain_min": 8.792056082611602e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0017254432197278255, + "Q_chain_min": 8.792056082598128e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0017254432197278255, + "Q_chain_min": 8.792056082598128e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0017254432197278255, + "Q_chain_min": 8.792056082598128e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0017254432197278255, + "Q_chain_min": 8.792056082598128e-06, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 6.286000908163614e-17 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 0.00916347769452841, + "degenerate_no_green": true, + "degenerate_underflow": false + }, + { + "name": "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_107_t0041_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_107", + "frame": 41, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 8.758115402030107e-47, + "G2_ok": true, + "Q_fold_max": 2.815516900490709e-40, + "Q_fold_min": 0.0, + "fold_argmax": 99, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 0.6700000000000013, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 0.6700000000000013, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 0.6700000000000013, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 0.6700000000000013, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 0.6683333333333347, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.403515602919617e-41, + "Q_chain_min": 0.0, + "Q_chain_argmax": 99, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 0.0 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 2.815516900490709e-40, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_116", + "frame": 62, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 5.9492345883930554e-24, + "G2_ok": true, + "Q_fold_max": 2.036522142264127e-17, + "Q_fold_min": 1.1751551501724142e-30, + "fold_argmax": 93, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 6.681653331988489e-20, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 6.834177294040352e-20, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.6397499953806226e-18, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.6397499953806226e-18, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.6397499953806226e-18, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.6397499953806226e-18, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.6397499953806226e-18, + "Q_chain_min": 2.2553480912820577e-31, + "Q_chain_argmax": 93, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 0.0 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 2.0365221422640095e-17, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_130_t0083_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_130", + "frame": 83, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.6828734911038826e-42, + "G2_ok": true, + "Q_fold_max": 5.066243472771673e-35, + "Q_fold_min": 9.212218612924927e-37, + "fold_argmax": 15, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.72309382210337e-36, + "Q_chain_min": 1.7680015919797313e-37, + "Q_chain_argmax": 15, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 0.0 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 4.974121286642424e-35, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "square_sub_20100_demo_147_t0234_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_147", + "frame": 234, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 4.674737480290774e-20, + "G2_ok": true, + "Q_fold_max": 1.3082690313026557e-12, + "Q_fold_min": 2.3415200122885567e-18, + "fold_argmax": 116, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9999656656290057, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.47125295639972e-13, + "Q_chain_min": 4.476738761446123e-19, + "Q_chain_argmax": 116, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9999656656290057, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.471245448592857e-13, + "Q_chain_min": 4.386313469710044e-19, + "Q_chain_argmax": 116, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9999713880241714, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.471245489919548e-13, + "Q_chain_min": 4.386313506354885e-19, + "Q_chain_argmax": 116, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9956738692547152, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 2.518554930111287e-09, + "Q_chain_min": 4.386313476742896e-19, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9955079197949094, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 2.5185540883911854e-09, + "Q_chain_min": 4.386313476742896e-19, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9955079197949094, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 2.5185540883911854e-09, + "Q_chain_min": 4.386313476742896e-19, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9955079197949094, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 2.5185540883911854e-09, + "Q_chain_min": 4.386313476742896e-19, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.995536531770738, + "argmax_same": false, + "max_abs_dQ": 2.518552789166467e-09 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 1.3082666897826434e-12, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_181", + "frame": 252, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.378831881738793e-23, + "G2_ok": true, + "Q_fold_max": 1.1509668975748645e-16, + "Q_fold_min": 3.3816771952998735e-20, + "fold_argmax": 79, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9006019959714338, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.1110257359745728e-17, + "Q_chain_min": 8.655295182327153e-23, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8421076725874382, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.133266148461087e-17, + "Q_chain_min": 2.4654832074714348e-20, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9998454953305256, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.1332307821369817e-17, + "Q_chain_min": 6.133367587488651e-21, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9998454953305256, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.133230782135924e-17, + "Q_chain_min": 6.133367587487809e-21, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9998454953305256, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.133230782135924e-17, + "Q_chain_min": 6.133367587487809e-21, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9998454953305256, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.133230782135924e-17, + "Q_chain_min": 6.133367587487809e-21, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9998454953305256, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 2.133230782135924e-17, + "Q_chain_min": 6.133367587487809e-21, + "Q_chain_argmax": 79, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 3.339925830992176e-26 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 1.1506287298553345e-16, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_187_t0049_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_187", + "frame": 49, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 7.006492321624085e-45, + "G2_ok": true, + "Q_fold_max": 8.837798837905473e-38, + "Q_fold_min": 0.0, + "fold_argmax": 90, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 1.6961433457832265e-38, + "Q_chain_min": 0.0, + "Q_chain_argmax": 90, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 0.0 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 8.837798837905473e-38, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "shallow_name": "square_sub_20100_demo_194_t0029_Mbest_b0.95_L8_N128_P16", + "task": "square_sub_20100", + "tag": "Mbest", + "episode": "demo_194", + "frame": 29, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 4.322928114587238e-19, + "G2_ok": true, + "Q_fold_max": 1.6333859265138528e-10, + "Q_fold_min": 2.4420840299705965e-19, + "fold_argmax": 58, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 3.134760751348485e-11, + "Q_chain_min": 4.6868278541533474e-20, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 0.0 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 1.6333859240717688e-10, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_128", + "frame": 115, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.006424157374731e-08, + "G2_ok": true, + "Q_fold_max": 0.15952111780643463, + "Q_fold_min": 0.028057554736733437, + "fold_argmax": 69, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.24781976744186046, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.07868839340951798, + "Q_chain_min": 0.014337463242195498, + "Q_chain_argmax": 10, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8754978483794177, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.04712329599919029, + "Q_chain_min": 0.005254331403184341, + "Q_chain_argmax": 69, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9008251693828969, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03077320793873803, + "Q_chain_min": 0.005258113563756085, + "Q_chain_argmax": 47, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9008251693828969, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03077320461124416, + "Q_chain_min": 0.005258113268444873, + "Q_chain_argmax": 47, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9008251693828969, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03077320461124416, + "Q_chain_min": 0.005258113268444873, + "Q_chain_argmax": 47, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9008251693828969, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03077320461124416, + "Q_chain_min": 0.005258113268444873, + "Q_chain_argmax": 47, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9008251693828969, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03077320461124416, + "Q_chain_min": 0.005258113268444873, + "Q_chain_argmax": 47, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 1.3834295575429478e-08 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0162353515625, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.003820082720588235 + }, + "Q_fold_span": 0.1314635630697012, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_136", + "frame": 154, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 7.946606750408591e-08, + "G2_ok": true, + "Q_fold_max": 0.4482004642486572, + "Q_fold_min": 0.3256511986255646, + "fold_argmax": 38, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.3261078557040835, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2340189156580702, + "Q_chain_min": 0.16405005303608997, + "Q_chain_argmax": 49, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.45871291887932614, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.22624307629145354, + "Q_chain_min": 0.10110191230272203, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.5324002014283098, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.1999033546777279, + "Q_chain_min": 0.0901196144881112, + "Q_chain_argmax": 37, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.5487948635780993, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.19388894960047431, + "Q_chain_min": 0.090005254499235, + "Q_chain_argmax": 37, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.5545458707196484, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.19388894398300416, + "Q_chain_min": 0.090005254499235, + "Q_chain_argmax": 37, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.5587403863761216, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.19015109347673398, + "Q_chain_min": 0.090005254499235, + "Q_chain_argmax": 37, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.5587804431422816, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.19015109347673398, + "Q_chain_min": 0.090005254499235, + "Q_chain_argmax": 37, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9604983061710309, + "argmax_same": true, + "max_abs_dQ": 0.023623548358529367 + }, + "deep_green": { + "frac_green_hops_0_7": 0.13995361328125, + "frac_green_hops_8_33": 0.010366586538461538, + "frac_green_all": 0.04085765165441176 + }, + "Q_fold_span": 0.12254926562309265, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_159", + "frame": 413, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.9728977507238454e-08, + "G2_ok": true, + "Q_fold_max": 0.1506459265947342, + "Q_fold_min": 2.9453485694830306e-06, + "fold_argmax": 58, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.7756019959714338, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.07748154196836174, + "Q_chain_min": 5.543606746008464e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8231207654275774, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.061168989630519414, + "Q_chain_min": 5.543603718306603e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.832425379967039, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.061164207527675915, + "Q_chain_min": 5.543603718302067e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.8320992034425929, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.05374380796783108, + "Q_chain_min": 5.543603718302067e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8337186412744918, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.05374380796781684, + "Q_chain_min": 5.543603718302067e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8337644204358177, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.05374380796781684, + "Q_chain_min": 5.543603718302067e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.8337644204358177, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.05374380796781684, + "Q_chain_min": 5.543603718302067e-07, + "Q_chain_argmax": 58, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9978083226515291, + "argmax_same": true, + "max_abs_dQ": 0.011363655633016612 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0291748046875, + "frac_green_hops_8_33": 0.0023287259615384615, + "frac_green_all": 0.00864545036764706 + }, + "Q_fold_span": 0.1506429812461647, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_18", + "frame": 96, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 8.784798022354323e-08, + "G2_ok": true, + "Q_fold_max": 0.9305424690246582, + "Q_fold_min": 0.0001804613129934296, + "fold_argmax": 59, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.8714406702069218, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.30285623415110413, + "Q_chain_min": 3.431870807920612e-05, + "Q_chain_argmax": 43, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8584222212049075, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.32113866653630885, + "Q_chain_min": 3.431837275572176e-05, + "Q_chain_argmax": 55, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.8911943783189892, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.29670720655900384, + "Q_chain_min": 3.431837269190653e-05, + "Q_chain_argmax": 55, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.8922988005859732, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2848692614360296, + "Q_chain_min": 3.431837269190653e-05, + "Q_chain_argmax": 43, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8980955868888482, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2848692614360296, + "Q_chain_min": 3.431837269190653e-05, + "Q_chain_argmax": 43, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8980326405420253, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.28381818507094664, + "Q_chain_min": 3.431837269190653e-05, + "Q_chain_argmax": 43, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.8980326405420253, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2837333592339433, + "Q_chain_min": 3.431837269190653e-05, + "Q_chain_argmax": 43, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9975794268449002, + "argmax_same": false, + "max_abs_dQ": 0.018828972034831193 + }, + "deep_green": { + "frac_green_hops_0_7": 0.094970703125, + "frac_green_hops_8_33": 0.007267878605769231, + "frac_green_all": 0.02790383731617647 + }, + "Q_fold_span": 0.9303620077116648, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_189", + "frame": 338, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.7279289051426366e-17, + "G2_ok": true, + "Q_fold_max": 4.817466425777184e-10, + "Q_fold_min": 2.4608225647362956e-15, + "fold_argmax": 2, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608266255e-11, + "Q_chain_min": 4.721538236444681e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608265959e-11, + "Q_chain_min": 4.721538236211128e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608265959e-11, + "Q_chain_min": 4.721538236211071e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608265959e-11, + "Q_chain_min": 4.721538236211071e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608265959e-11, + "Q_chain_min": 4.721538236211071e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608265959e-11, + "Q_chain_min": 4.721538236211071e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 1.0, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 9.245196608265959e-11, + "Q_chain_min": 4.721538236211071e-16, + "Q_chain_argmax": 2, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 1.0, + "argmax_same": true, + "max_abs_dQ": 0.0 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 4.817441817551536e-10, + "degenerate_no_green": true, + "degenerate_underflow": true + }, + { + "name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_19", + "frame": 67, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 2.969725074186691e-08, + "G2_ok": true, + "Q_fold_max": 0.16636240482330322, + "Q_fold_min": 0.06094413250684738, + "fold_argmax": 40, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.8447514191540011, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.10547126973562823, + "Q_chain_min": 0.03178602745845371, + "Q_chain_argmax": 40, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.644147134224501, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.07309111077496393, + "Q_chain_min": 0.0285261834746012, + "Q_chain_argmax": 40, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.8138619300494415, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.09835202171996736, + "Q_chain_min": 0.018558617228422218, + "Q_chain_argmax": 29, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.835618476469511, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.07250349503861862, + "Q_chain_min": 0.01776229992395239, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.8473551089544039, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0693746632428476, + "Q_chain_min": 0.01776229992395239, + "Q_chain_argmax": 54, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8442249587987548, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.06856721967682615, + "Q_chain_min": 0.01776229992395239, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.8446255264603553, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.06856721967682615, + "Q_chain_min": 0.01776229992395239, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9654767899652078, + "argmax_same": false, + "max_abs_dQ": 0.03698450673432463 + }, + "deep_green": { + "frac_green_hops_0_7": 0.07342529296875, + "frac_green_hops_8_33": 0.010723407451923076, + "frac_green_all": 0.025476792279411766 + }, + "Q_fold_span": 0.10541827231645584, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_38", + "frame": 67, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.2365451683427064e-08, + "G2_ok": true, + "Q_fold_max": 0.06312353909015656, + "Q_fold_min": 0.00021120051678735763, + "fold_argmax": 26, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.3711316608679729, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.032820910208727676, + "Q_chain_min": 2.088466849478915e-06, + "Q_chain_argmax": 50, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.6340184947811756, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.02438394629023356, + "Q_chain_min": 3.1410471907627997e-06, + "Q_chain_argmax": 101, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.7373191723127632, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03861902178047577, + "Q_chain_min": 5.9714321451964024e-05, + "Q_chain_argmax": 101, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9223528199963377, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.026516369974293227, + "Q_chain_min": 0.00274300615683096, + "Q_chain_argmax": 101, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.7705376762497711, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.02835098212509169, + "Q_chain_min": 0.0027430029596578974, + "Q_chain_argmax": 101, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.8180049441494232, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027374540149052412, + "Q_chain_min": 0.0027430029596578974, + "Q_chain_argmax": 101, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.8180049441494232, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027370197341979662, + "Q_chain_min": 0.0027430029596578974, + "Q_chain_argmax": 101, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.6658292895074163, + "argmax_same": true, + "max_abs_dQ": 0.022334195652718172 + }, + "deep_green": { + "frac_green_hops_0_7": 0.00921630859375, + "frac_green_hops_8_33": 0.009671724759615384, + "frac_green_all": 0.009564568014705883 + }, + "Q_fold_span": 0.0629123385733692, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "tag": "L40best", + "episode": "demo_83", + "frame": 280, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "coverage", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "n_val_eps": 39, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.184985257141058e-08, + "G2_ok": true, + "Q_fold_max": 0.0897306278347969, + "Q_fold_min": 1.3265523790551015e-08, + "fold_argmax": 82, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.5272386009888299, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.07121855576643646, + "Q_chain_min": 2.502747076052949e-09, + "Q_chain_argmax": 121, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8723333638527743, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.03224443447222212, + "Q_chain_min": 2.5027418359028254e-09, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9701805987914301, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03650985928759911, + "Q_chain_min": 2.50274183580143e-09, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9938541475920161, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027561033794463747, + "Q_chain_min": 2.50274183580143e-09, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9938541475920161, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027561033794393903, + "Q_chain_min": 2.50274183580143e-09, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9938541475920161, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027561033794393903, + "Q_chain_min": 2.50274183580143e-09, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9938541475920161, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027561033794393903, + "Q_chain_min": 2.50274183580143e-09, + "Q_chain_argmax": 96, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9814308276872368, + "argmax_same": true, + "max_abs_dQ": 0.011354500372266688 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0057373046875, + "frac_green_hops_8_33": 0.00030048076923076925, + "frac_green_all": 0.001579733455882353 + }, + "Q_fold_span": 0.08973061456927311, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_1", + "frame": 70, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.0709166731182052e-07, + "G2_ok": true, + "Q_fold_max": 0.6536963582038879, + "Q_fold_min": 0.12752185761928558, + "fold_argmax": 70, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9430507233107489, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2970359078232118, + "Q_chain_min": 0.026868134719932192, + "Q_chain_argmax": 26, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.7783144112799854, + "top3_overlap": 0.333333333333334, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2947736270881256, + "Q_chain_min": 0.028575557645202993, + "Q_chain_argmax": 115, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.5940075077824575, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.28250922905330766, + "Q_chain_min": 0.027417640835384796, + "Q_chain_argmax": 113, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.4077778795092474, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2837569518969458, + "Q_chain_min": 0.027649655135306303, + "Q_chain_argmax": 30, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.4195946255264604, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2814557436388464, + "Q_chain_min": 0.027748474877155836, + "Q_chain_argmax": 30, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.42407526094121956, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.28054823906012444, + "Q_chain_min": 0.027755887094791282, + "Q_chain_argmax": 30, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.4209451107855704, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2805677306100868, + "Q_chain_min": 0.02783160414218596, + "Q_chain_argmax": 30, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.8342508240249039, + "argmax_same": false, + "max_abs_dQ": 0.009734882140820439 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0946044921875, + "frac_green_hops_8_33": 0.15606219951923078, + "frac_green_all": 0.1416015625 + }, + "Q_fold_span": 0.5261745005846024, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_13_t0133_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_13_t0133_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_13", + "frame": 133, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.0354765200837335e-07, + "G2_ok": true, + "Q_fold_max": 0.932183027267456, + "Q_fold_min": 0.9237746000289917, + "fold_argmax": 117, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.06549853506683757, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5761765566501861, + "Q_chain_min": 0.5401863795319082, + "Q_chain_argmax": 48, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.2989207562717451, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5407245080081422, + "Q_chain_min": 0.5006956059006298, + "Q_chain_argmax": 40, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.02303264054202527, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.4921380054393407, + "Q_chain_min": 0.44995140432043945, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.02016572056399927, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.49069628217600775, + "Q_chain_min": 0.45180750492490557, + "Q_chain_argmax": 126, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.04515542025270097, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.4892411038999037, + "Q_chain_min": 0.4513699354268032, + "Q_chain_argmax": 126, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.04929271195751694, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.487120611473734, + "Q_chain_min": 0.4503937641364553, + "Q_chain_argmax": 126, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.04976767075627175, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.48714285119022993, + "Q_chain_min": 0.450499478581686, + "Q_chain_argmax": 126, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9765496246108771, + "argmax_same": false, + "max_abs_dQ": 0.014633275573957216 + }, + "deep_green": { + "frac_green_hops_0_7": 0.47955322265625, + "frac_green_hops_8_33": 0.10282076322115384, + "frac_green_all": 0.19146369485294118 + }, + "Q_fold_span": 0.008408427238464355, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_16", + "frame": 195, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 6.113687101017007e-08, + "G2_ok": true, + "Q_fold_max": 0.3383100628852844, + "Q_fold_min": 0.3210780620574951, + "fold_argmax": 70, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9997024354513825, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.12298144112627511, + "Q_chain_min": 0.11424041702835354, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9734938655923824, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.10958334201209888, + "Q_chain_min": 0.10332570426799913, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9009625068668742, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.09311252197869299, + "Q_chain_min": 0.0892617921637951, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9781576176524446, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.0918174458859906, + "Q_chain_min": 0.0865983793655987, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.983902902398828, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.09143029737018354, + "Q_chain_min": 0.08623437118058065, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.984744094488189, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.09100509027738093, + "Q_chain_min": 0.08576927563349221, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9848013184398462, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.09101168606539117, + "Q_chain_min": 0.08577527129734985, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9507130104376488, + "argmax_same": true, + "max_abs_dQ": 0.004280000121197183 + }, + "deep_green": { + "frac_green_hops_0_7": 0.0, + "frac_green_hops_8_33": 0.0, + "frac_green_all": 0.0 + }, + "Q_fold_span": 0.017232000827789307, + "degenerate_no_green": true, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_27", + "frame": 156, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 8.167838771999669e-08, + "G2_ok": true, + "Q_fold_max": 0.8741195797920227, + "Q_fold_min": 0.010762193240225315, + "fold_argmax": 85, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9990615271928218, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.44409496269255266, + "Q_chain_min": 0.0021296398105552284, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9992389214429591, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4509972266214834, + "Q_chain_min": 0.002064667639681172, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.999427760483428, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.42230806124872683, + "Q_chain_min": 0.0020628568894310207, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9994907068302509, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4190109941571683, + "Q_chain_min": 0.0020627984723152488, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9995135964109138, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.415341657129767, + "Q_chain_min": 0.0020627982688751524, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9994907068302509, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.413309616427579, + "Q_chain_min": 0.002062798267904832, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9994907068302509, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.4133638879521555, + "Q_chain_min": 0.0020627982679047845, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.999896996887017, + "argmax_same": true, + "max_abs_dQ": 0.013508880409057067 + }, + "deep_green": { + "frac_green_hops_0_7": 0.06964111328125, + "frac_green_hops_8_33": 0.045766977163461536, + "frac_green_all": 0.05138442095588235 + }, + "Q_fold_span": 0.8633573865517974, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_36_t0096_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_36_t0096_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_36", + "frame": 96, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.0410127515569911e-07, + "G2_ok": true, + "Q_fold_max": 0.8535131812095642, + "Q_fold_min": 0.12225037813186646, + "fold_argmax": 101, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.565032968196891, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5818511632400625, + "Q_chain_min": 0.02495411946826389, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": -0.1366910488737563, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.6062052126292676, + "Q_chain_min": 0.024017811338807926, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": -0.0656359664496163, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5527275236824516, + "Q_chain_min": 0.024015915719011793, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.7710309052706933, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5350052480570169, + "Q_chain_min": 0.024015910059583322, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.6677501083686967, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.524856319422624, + "Q_chain_min": 0.024015910059175728, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.5969668401037858, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5231858095394377, + "Q_chain_min": 0.024015910059175666, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.6113043217026972, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5234700979302342, + "Q_chain_min": 0.024015910059175666, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.48076130745284745, + "argmax_same": true, + "max_abs_dQ": 0.031916824450708425 + }, + "deep_green": { + "frac_green_hops_0_7": 0.5543212890625, + "frac_green_hops_8_33": 0.1773399939903846, + "frac_green_all": 0.26604147518382354 + }, + "Q_fold_span": 0.7312628030776978, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_5", + "frame": 159, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 9.996367089648572e-08, + "G2_ok": true, + "Q_fold_max": 0.9199628829956055, + "Q_fold_min": 0.03542378917336464, + "fold_argmax": 70, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9874736769822376, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.6088982809752854, + "Q_chain_min": 0.006901566650210762, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9949929042299945, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.56847740397366, + "Q_chain_min": 0.006814230466085313, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9930930690349753, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5434174539142054, + "Q_chain_min": 0.006811908069199287, + "Q_chain_argmax": 82, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9954793078190808, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5413071261668458, + "Q_chain_min": 0.0068118578215379845, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.996497894158579, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5396656843961061, + "Q_chain_min": 0.00681185776433448, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9964807269730819, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5385963236497113, + "Q_chain_min": 0.006811857764240372, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.996497894158579, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5388047897937309, + "Q_chain_min": 0.00681185776424037, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9983862845632668, + "argmax_same": false, + "max_abs_dQ": 0.008124403949855363 + }, + "deep_green": { + "frac_green_hops_0_7": 0.21923828125, + "frac_green_hops_8_33": 0.17810997596153846, + "frac_green_all": 0.18778722426470587 + }, + "Q_fold_span": 0.8845390938222408, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_50_t0063_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_50_t0063_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_50", + "frame": 63, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.068337225351712e-07, + "G2_ok": true, + "Q_fold_max": 0.7035567164421082, + "Q_fold_min": 0.09834130108356476, + "fold_argmax": 5, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.9806010803882073, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.328895649470869, + "Q_chain_min": 0.021608563764093192, + "Q_chain_argmax": 63, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9640347463834462, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3285479564980591, + "Q_chain_min": 0.019589415580144695, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9710732924372826, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.3007530827541851, + "Q_chain_min": 0.01935874277757275, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.9701119300494415, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.29961087851094426, + "Q_chain_min": 0.01933702893811127, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.9718286485991576, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.2951489684823245, + "Q_chain_min": 0.01933670045859851, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.9712621314777513, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.29265912669350475, + "Q_chain_min": 0.019336694165352157, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.9712449642922542, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.29261311418076985, + "Q_chain_min": 0.0193366941625693, + "Q_chain_argmax": 94, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9976137612158945, + "argmax_same": true, + "max_abs_dQ": 0.023133778759401924 + }, + "deep_green": { + "frac_green_hops_0_7": 0.1197509765625, + "frac_green_hops_8_33": 0.023043118990384616, + "frac_green_all": 0.04579790900735294 + }, + "Q_fold_span": 0.6052154153585434, + "degenerate_no_green": false, + "degenerate_underflow": false + }, + { + "name": "two_piece_expert_suboptimal_demo_67_t0125_Mproghead_b0.95_L34_N128_P16", + "shallow_name": "two_piece_expert_suboptimal_demo_67_t0125_Mproghead_b0.95_L8_N128_P16", + "task": "two_piece_expert_suboptimal", + "tag": "Mproghead", + "episode": "demo_67", + "frame": 125, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "unseen_regime": "suboptimal", + "unseen_anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json", + "n_val_eps": 12, + "episode_success": false, + "depth_shallow": 8, + "depth_deep": 34, + "n_cand": 128, + "particles": 16, + "proposer_seed": 270029, + "plan_seed": 0, + "G1_prefix_bitexact": true, + "G1_dev_cand": 0.0, + "G1_dev_c8": 0.0, + "G1_dev_lg8": 0.0, + "G2_fold_dev": 1.0094215041611676e-07, + "G2_ok": true, + "Q_fold_max": 0.7774664163589478, + "Q_fold_min": 0.06814415752887726, + "fold_argmax": 78, + "n_exact_ties_at_max": 1, + "chain": { + "3": { + "spearman_rho": 0.788643334554111, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.43460325297259783, + "Q_chain_min": 0.013182964090691881, + "Q_chain_argmax": 22, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8785993865592382, + "top3_overlap": 0.666666666666668, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.4020386121281075, + "Q_chain_min": 0.013170991662249127, + "Q_chain_argmax": 117, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.6694458432521516, + "top3_overlap": 0.0, + "top1_is_fold_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.36996249843126494, + "Q_chain_min": 0.013170981233275474, + "Q_chain_argmax": 76, + "n_exact_ties_at_max_chain": 1 + }, + "11": { + "spearman_rho": 0.7739768357443692, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.3594649399342702, + "Q_chain_min": 0.013170981184828123, + "Q_chain_argmax": 78, + "n_exact_ties_at_max_chain": 1 + }, + "15": { + "spearman_rho": 0.7445351126167369, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.3632489020393328, + "Q_chain_min": 0.01317098118482263, + "Q_chain_argmax": 78, + "n_exact_ties_at_max_chain": 1 + }, + "23": { + "spearman_rho": 0.7430530122688153, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.363330421967913, + "Q_chain_min": 0.013170981184822628, + "Q_chain_argmax": 78, + "n_exact_ties_at_max_chain": 1 + }, + "33": { + "spearman_rho": 0.7472532503204541, + "top3_overlap": 1.0, + "top1_is_fold_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.3634117712093436, + "Q_chain_min": 0.013170981184822628, + "Q_chain_argmax": 78, + "n_exact_ties_at_max_chain": 1 + } + }, + "truncation": { + "rho_cap7_vs_cap33": 0.9625068668741988, + "argmax_same": false, + "max_abs_dQ": 0.018700860645558037 + }, + "deep_green": { + "frac_green_hops_0_7": 0.16943359375, + "frac_green_hops_8_33": 0.09115835336538461, + "frac_green_all": 0.10957605698529412 + }, + "Q_fold_span": 0.7093222588300705, + "degenerate_no_green": false, + "degenerate_underflow": false + } + ], + "cap3": { + "median_rho": 0.9218263596410914, + "min_rho": 0.06549853506683757, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 15, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_147_t0234_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.7109503753891229, + "square_expert_play_kept": 2, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 8, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.6514202984801318, + "two_piece_expert_play_kept": 3, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.9618259018494781, + "two_piece_expert_suboptimal_kept": 2, + "two_piece_expert_suboptimal_n": 8 + }, + "cap5": { + "median_rho": 0.9197176570225234, + "min_rho": -0.15328312598001625, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 19, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_54_t0122_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_147_t0234_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_19_t0067_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_83_t0280_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.9045034111626294, + "square_expert_play_kept": 4, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 8, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.8407714933162425, + "two_piece_expert_play_kept": 5, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.9213170664713421, + "two_piece_expert_suboptimal_kept": 2, + "two_piece_expert_suboptimal_n": 8 + }, + "cap7": { + "median_rho": 0.981917231276323, + "min_rho": -0.0656359664496163, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 16, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_54_t0122_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_147_t0234_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.99515583266425, + "square_expert_play_kept": 4, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 8, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.8618098791430141, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.7852041750595129, + "two_piece_expert_suboptimal_kept": 2, + "two_piece_expert_suboptimal_n": 8 + }, + "cap11": { + "median_rho": 0.9725325032045413, + "min_rho": -0.11714413249247461, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 16, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_54_t0122_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_67_t0125_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.9350165004541197, + "square_expert_play_kept": 4, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 7, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.8965619849844351, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.8720443828969053, + "two_piece_expert_suboptimal_kept": 3, + "two_piece_expert_suboptimal_n": 8 + }, + "cap15": { + "median_rho": 0.9664238463651346, + "min_rho": -0.11705829165283675, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 15, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_67_t0125_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.8977267872774439, + "square_expert_play_kept": 3, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 7, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.872725347921626, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.8581818806079473, + "two_piece_expert_suboptimal_kept": 3, + "two_piece_expert_suboptimal_n": 8 + }, + "cap23": { + "median_rho": 0.9669789186962094, + "min_rho": -0.11705829165283675, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 15, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_67_t0125_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.9115105193908326, + "square_expert_play_kept": 3, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 7, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.87112879967039, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.8571575718732833, + "two_piece_expert_suboptimal_kept": 3, + "two_piece_expert_suboptimal_n": 8 + }, + "cap33": { + "median_rho": 0.9669703351034609, + "min_rho": -0.11705661695843562, + "max_rho": 1.0, + "median_top3": 0.666666666666668, + "n_argmax_kept": 15, + "n": 32, + "kept": [ + "square_expert_play_demo_148_t0138_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_198_t0110_L40best_b0.95_L34_N128_P16", + "square_expert_play_demo_212_t0141_L40best_b0.95_L34_N128_P16", + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_159_t0413_L40best_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_67_t0125_Mproghead_b0.95_L34_N128_P16" + ], + "square_expert_play_median_rho": 0.9110143738395089, + "square_expert_play_kept": 3, + "square_expert_play_n": 8, + "square_sub_20100_median_rho": 1.0, + "square_sub_20100_kept": 7, + "square_sub_20100_n": 8, + "two_piece_expert_play_median_rho": 0.8713290835011902, + "two_piece_expert_play_kept": 2, + "two_piece_expert_play_n": 8, + "two_piece_expert_suboptimal_median_rho": 0.8592491073063542, + "two_piece_expert_suboptimal_kept": 3, + "two_piece_expert_suboptimal_n": 8 + }, + "median_rho_by_cap": { + "3": 0.9218263596410914, + "5": 0.9197176570225234, + "7": 0.981917231276323, + "11": 0.9725325032045413, + "15": 0.9664238463651346, + "23": 0.9669789186962094, + "33": 0.9669703351034609 + }, + "n_argmax_kept_by_cap": { + "3": 15, + "5": 19, + "7": 16, + "11": 16, + "15": 15, + "23": 15, + "33": 15 + }, + "rho_monotone_in_cap": false, + "argmax_cap_pooled": 7, + "per_task": { + "square_expert_play": { + "n": 8, + "median_rho_by_cap": { + "3": 0.7109503753891229, + "5": 0.9045034111626294, + "7": 0.99515583266425, + "11": 0.9350165004541197, + "15": 0.8977267872774439, + "23": 0.9115105193908326, + "33": 0.9110143738395089 + }, + "argmax_cap": 7, + "peaks_at_match": true, + "rho_match": 0.99515583266425, + "rho_headline": 0.9110143738395089, + "reverses": true, + "kept_match": 4, + "kept_headline": 3 + }, + "square_sub_20100": { + "n": 8, + "median_rho_by_cap": { + "3": 1.0, + "5": 1.0, + "7": 1.0, + "11": 1.0, + "15": 1.0, + "23": 1.0, + "33": 1.0 + }, + "argmax_cap": 3, + "peaks_at_match": false, + "rho_match": 1.0, + "rho_headline": 1.0, + "reverses": false, + "kept_match": 8, + "kept_headline": 7 + }, + "two_piece_expert_play": { + "n": 8, + "median_rho_by_cap": { + "3": 0.6514202984801318, + "5": 0.8407714933162425, + "7": 0.8618098791430141, + "11": 0.8965619849844351, + "15": 0.872725347921626, + "23": 0.87112879967039, + "33": 0.8713290835011902 + }, + "argmax_cap": 11, + "peaks_at_match": false, + "rho_match": 0.8618098791430141, + "rho_headline": 0.8713290835011902, + "reverses": false, + "kept_match": 2, + "kept_headline": 2 + }, + "two_piece_expert_suboptimal": { + "n": 8, + "median_rho_by_cap": { + "3": 0.9618259018494781, + "5": 0.9213170664713421, + "7": 0.7852041750595129, + "11": 0.8720443828969053, + "15": 0.8581818806079473, + "23": 0.8571575718732833, + "33": 0.8592491073063542 + }, + "argmax_cap": 3, + "peaks_at_match": false, + "rho_match": 0.7852041750595129, + "rho_headline": 0.8592491073063542, + "reverses": false, + "kept_match": 2, + "kept_headline": 3 + } + }, + "n_tasks_peaking_at_match": 1, + "n_tasks_reversing": 1, + "VERDICT_GENERALISES": "PEAK_AT_HORIZON_MATCH", + "degeneracy": { + "rule": "degenerate_no_green: (c >= 0.5) never true over the full depth-34 rollout", + "n_degenerate": 10, + "n_clean": 22, + "tasks_with_any_degenerate": [ + "square_sub_20100", + "two_piece_expert_play", + "two_piece_expert_suboptimal" + ], + "tasks_fully_degenerate": [ + "square_sub_20100" + ], + "degenerate_names": [ + "square_sub_20100_demo_103_t0320_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_107_t0041_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_116_t0062_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_130_t0083_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_147_t0234_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_181_t0252_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_187_t0049_Mbest_b0.95_L34_N128_P16", + "square_sub_20100_demo_194_t0029_Mbest_b0.95_L34_N128_P16", + "two_piece_expert_play_demo_189_t0338_L40best_b0.95_L34_N128_P16", + "two_piece_expert_suboptimal_demo_16_t0195_Mproghead_b0.95_L34_N128_P16" + ], + "max_Q_fold_over_degenerate": 0.3383100628852844 + }, + "clean_median_rho_by_cap": { + "3": 0.7821226652627724, + "5": 0.853296558022179, + "7": 0.896009773850943, + "11": 0.8965619849844351, + "15": 0.8604937282548983, + "23": 0.87112879967039, + "33": 0.8713290835011902 + }, + "clean_n_argmax_kept_by_cap": { + "3": 5, + "5": 9, + "7": 6, + "11": 7, + "15": 6, + "23": 6, + "33": 6 + }, + "clean_argmax_cap_pooled": 11, + "clean_n_trees": 22, + "clean_per_task": { + "square_expert_play": { + "n": 8, + "median_rho_by_cap": { + "3": 0.7109503753891229, + "5": 0.9045034111626294, + "7": 0.99515583266425, + "11": 0.9350165004541197, + "15": 0.8977267872774439, + "23": 0.9115105193908326, + "33": 0.9110143738395089 + }, + "argmax_cap": 7, + "peaks_at_match": true + }, + "square_sub_20100": { + "n": 0 + }, + "two_piece_expert_play": { + "n": 7, + "median_rho_by_cap": { + "3": 0.5272386009888299, + "5": 0.8231207654275774, + "7": 0.832425379967039, + "11": 0.8922988005859732, + "15": 0.8473551089544039, + "23": 0.8442249587987548, + "33": 0.8446255264603553 + }, + "argmax_cap": 11, + "peaks_at_match": false + }, + "two_piece_expert_suboptimal": { + "n": 7, + "median_rho_by_cap": { + "3": 0.9430507233107489, + "5": 0.8785993865592382, + "7": 0.6694458432521516, + "11": 0.7739768357443692, + "15": 0.7445351126167369, + "23": 0.7430530122688153, + "33": 0.7472532503204541 + }, + "argmax_cap": 3, + "peaks_at_match": false + } + }, + "clean_n_tasks_peaking_at_match": 1, + "clean_n_tasks_scored": 3, + "VERDICT_GENERALISES_CLEAN": "PEAK_ELSEWHERE_STILL_REVERSES", + "CLEAN_DIFFERS_FROM_PREREG": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIDELITY.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIDELITY.json new file mode 100644 index 0000000000000000000000000000000000000000..293018d76ac74501f77b3fc2ae3de90489c98d06 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIDELITY.json @@ -0,0 +1,150 @@ +{ + "ckpt": "runs/pixdec_multitask/pixdec/r256_mt10/ckpt.pt", + "step": 60000, + "res": 256, + "tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ], + "n_metric": 512, + "per_task": { + "square_expert_suboptimal": { + "psnr": 20.98406410217285, + "l1": 0.030970247462391853, + "n": 512, + "n_val_frames": 3250, + "val_eps": [ + 180, + 181, + 182, + 183 + ], + "lpips": 0.17752452241256833 + }, + "square_sub_20100": { + "psnr": 20.120403289794922, + "l1": 0.03472510352730751, + "n": 512, + "n_val_frames": 2084, + "val_eps": [ + 108, + 109, + 110, + 111 + ], + "lpips": 0.18614485883153975 + }, + "square_expert_play": { + "psnr": 22.99894905090332, + "l1": 0.020357053726911545, + "n": 512, + "n_val_frames": 8011, + "val_eps": [ + 382, + 383, + 384, + 385 + ], + "lpips": 0.13460793578997254 + }, + "two_piece_expert_suboptimal": { + "psnr": 26.031949996948242, + "l1": 0.013398680835962296, + "n": 512, + "n_val_frames": 1933, + "val_eps": [ + 108, + 109, + 110, + 111 + ], + "lpips": 0.07967323658522218 + }, + "two_piece_expert_play": { + "psnr": 26.296754837036133, + "l1": 0.012938413769006729, + "n": 512, + "n_val_frames": 6577, + "val_eps": [ + 359, + 360, + 361, + 362 + ], + "lpips": 0.08036620542407036 + }, + "two_piece_expert_play_tipping": { + "psnr": 24.9555606842041, + "l1": 0.015747589990496635, + "n": 512, + "n_val_frames": 8599, + "val_eps": [ + 634, + 635, + 636, + 637 + ], + "lpips": 0.09676129720173776 + }, + "mug_expert_suboptimal": { + "psnr": 23.15156364440918, + "l1": 0.01920304447412491, + "n": 512, + "n_val_frames": 2376, + "val_eps": [ + 108, + 109, + 110, + 111 + ], + "lpips": 0.12268969672732055 + }, + "threading_expert_play": { + "psnr": 23.64679718017578, + "l1": 0.017988169565796852, + "n": 512, + "n_val_frames": 6603, + "val_eps": [ + 405, + 406, + 407, + 408 + ], + "lpips": 0.1123355336021632 + }, + "mug_mgen": { + "psnr": 22.281782150268555, + "l1": 0.025267496705055237, + "n": 512, + "n_val_frames": 3618, + "val_eps": [ + 202, + 203, + 204, + 205 + ], + "lpips": 0.15119977272115648 + }, + "threading_mgen": { + "psnr": 23.311609268188477, + "l1": 0.02157617174088955, + "n": 512, + "n_val_frames": 5437, + "val_eps": [ + 405, + 406, + 407, + 408 + ], + "lpips": 0.12123993155546486 + } + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIDELITY_r84_mt10.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIDELITY_r84_mt10.json new file mode 100644 index 0000000000000000000000000000000000000000..ae9de9c9f45d18f2d85f4563f76613c032ffa74b --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIDELITY_r84_mt10.json @@ -0,0 +1,150 @@ +{ + "ckpt": "runs/pixdec_multitask/pixdec/r84_mt10/ckpt.pt", + "step": 44001, + "res": 84, + "tasks": [ + "square_expert_suboptimal", + "square_sub_20100", + "square_expert_play", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play", + "mug_mgen", + "threading_mgen" + ], + "n_metric": 512, + "per_task": { + "square_expert_suboptimal": { + "psnr": 22.519779205322266, + "l1": 0.0272164698690176, + "n": 512, + "n_val_frames": 3250, + "val_eps": [ + 180, + 181, + 182, + 183 + ], + "lpips": 0.08316775830462575 + }, + "square_sub_20100": { + "psnr": 21.252059936523438, + "l1": 0.031309932470321655, + "n": 512, + "n_val_frames": 2084, + "val_eps": [ + 108, + 109, + 110, + 111 + ], + "lpips": 0.0938093027798459 + }, + "square_expert_play": { + "psnr": 24.443382263183594, + "l1": 0.018868817016482353, + "n": 512, + "n_val_frames": 8011, + "val_eps": [ + 382, + 383, + 384, + 385 + ], + "lpips": 0.06148486863821745 + }, + "two_piece_expert_suboptimal": { + "psnr": 28.911273956298828, + "l1": 0.010156753472983837, + "n": 512, + "n_val_frames": 1933, + "val_eps": [ + 108, + 109, + 110, + 111 + ], + "lpips": 0.01697431007050909 + }, + "two_piece_expert_play": { + "psnr": 29.088165283203125, + "l1": 0.00988847203552723, + "n": 512, + "n_val_frames": 6577, + "val_eps": [ + 359, + 360, + 361, + 362 + ], + "lpips": 0.017832095560152084 + }, + "two_piece_expert_play_tipping": { + "psnr": 27.36479377746582, + "l1": 0.012568559497594833, + "n": 512, + "n_val_frames": 8599, + "val_eps": [ + 634, + 635, + 636, + 637 + ], + "lpips": 0.025612029334297404 + }, + "mug_expert_suboptimal": { + "psnr": 24.62738037109375, + "l1": 0.016366073861718178, + "n": 512, + "n_val_frames": 2376, + "val_eps": [ + 108, + 109, + 110, + 111 + ], + "lpips": 0.08726179460063577 + }, + "threading_expert_play": { + "psnr": 25.336606979370117, + "l1": 0.014712899923324585, + "n": 512, + "n_val_frames": 6603, + "val_eps": [ + 405, + 406, + 407, + 408 + ], + "lpips": 0.0608004170935601 + }, + "mug_mgen": { + "psnr": 23.555461883544922, + "l1": 0.02190997079014778, + "n": 512, + "n_val_frames": 3618, + "val_eps": [ + 202, + 203, + 204, + 205 + ], + "lpips": 0.09242796758189797 + }, + "threading_mgen": { + "psnr": 24.507732391357422, + "l1": 0.019492145627737045, + "n": 512, + "n_val_frames": 5437, + "val_eps": [ + 405, + 406, + 407, + 408 + ], + "lpips": 0.07795826048823074 + } + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIG_REPRO.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIG_REPRO.json new file mode 100644 index 0000000000000000000000000000000000000000..b021b9fb6c28a5739b93cde8bccda5b3ebcccaef --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FIG_REPRO.json @@ -0,0 +1,191 @@ +{ + "generated_by": "scripts/viz/fig_repro.py (gen_q#270 run 21)", + "stability": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/FRONTIER_STABILITY.json", + "census": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/CAND_GREEN_CENSUS_xdev.json", + "seeded_recapture_arm": "stitchviz_xdev_cpuS", + "figures": [ + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "figure_claim": "sharpest candidate-level split", + "published_dirs": [ + "stitchviz", + "stitchviz_split", + "stitchviz_split2" + ], + "published_md5": [ + "ef66050c9320363622d46efdb6849b7b" + ], + "published_dirs_are_one_file": true, + "published_proposer_seed": { + "stitchviz": null, + "stitchviz_split": null, + "stitchviz_split2": null + }, + "recapture_dir": "stitchviz_xdev_cpuS", + "recapture_md5": "20531743ad25b7bd5fef61131305a457", + "bit_reproducible": false, + "published_was_seeded": false, + "consistent": true, + "n_distinct_captures": 6, + "axes": { + "balance": { + "published": 0.4140625, + "min": 0.3203125, + "max": 0.4609375, + "n": 6, + "rank_desc": 2, + "is_max": false, + "is_min": false + }, + "frac_green": { + "published": 0.192138671875, + "min": 0.15557861328125, + "max": 0.192138671875, + "n": 6, + "rank_desc": 1, + "is_max": true, + "is_min": false + }, + "Q_spread": { + "published": 0.6069021821022034, + "min": 0.6069021821022034, + "max": 0.6839041709899902, + "n": 6, + "rank_desc": 6, + "is_max": false, + "is_min": true + }, + "hop_rise": { + "published": 0.16748046875, + "min": 0.08935546875, + "max": 0.16748046875, + "n": 6, + "rank_desc": 1, + "is_max": true, + "is_min": false + } + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "figure_claim": "sharpest candidate-level split", + "published_dirs": [ + "stitchviz_split", + "stitchviz_split2" + ], + "published_md5": [ + "067fa64e3077b20e2488e28b9f29ed20" + ], + "published_dirs_are_one_file": true, + "published_proposer_seed": { + "stitchviz_split": null, + "stitchviz_split2": null + }, + "recapture_dir": "stitchviz_xdev_cpuS", + "recapture_md5": "aeb045649c006c070980839b0034c8e2", + "bit_reproducible": false, + "published_was_seeded": false, + "consistent": true, + "n_distinct_captures": 13, + "axes": { + "balance": { + "published": 0.171875, + "min": 0.171875, + "max": 0.3203125, + "n": 13, + "rank_desc": 12, + "is_max": false, + "is_min": true + }, + "frac_green": { + "published": 0.12005615234375, + "min": 0.082275390625, + "max": 0.13232421875, + "n": 13, + "rank_desc": 3, + "is_max": false, + "is_min": false + }, + "Q_spread": { + "published": 0.9192078709602356, + "min": 0.8395338654518127, + "max": 0.9906049370765686, + "n": 13, + "rank_desc": 9, + "is_max": false, + "is_min": false + }, + "hop_rise": { + "published": -0.0743408203125, + "min": -0.122802734375, + "max": -0.0743408203125, + "n": 13, + "rank_desc": 1, + "is_max": true, + "is_min": false + } + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "figure_claim": "futures chaining into the success set", + "published_dirs": [ + "stitchviz_split2" + ], + "published_md5": [ + "ca4ce6e148ad5c45597d3276f0cd73a4" + ], + "published_dirs_are_one_file": true, + "published_proposer_seed": { + "stitchviz_split2": 0 + }, + "recapture_dir": "stitchviz_xdev_cpuS", + "recapture_md5": "ca4ce6e148ad5c45597d3276f0cd73a4", + "bit_reproducible": true, + "published_was_seeded": true, + "consistent": true, + "n_distinct_captures": 5, + "axes": { + "balance": { + "published": 0.0, + "min": 0.0, + "max": 0.0, + "n": 5, + "rank_desc": 1, + "is_max": true, + "is_min": true + }, + "frac_green": { + "published": 0.255859375, + "min": 0.1795654296875, + "max": 0.2598876953125, + "n": 5, + "rank_desc": 2, + "is_max": false, + "is_min": false + }, + "Q_spread": { + "published": 0.36739271879196167, + "min": 0.14182797074317932, + "max": 0.3932135999202728, + "n": 5, + "rank_desc": 2, + "is_max": false, + "is_min": false + }, + "hop_rise": { + "published": 0.177001953125, + "min": 0.0625, + "max": 0.177001953125, + "n": 5, + "rank_desc": 1, + "is_max": true, + "is_min": false + } + } + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FRONTIER_STABILITY.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FRONTIER_STABILITY.json new file mode 100644 index 0000000000000000000000000000000000000000..38ef3254d295ae26e59de94e0c1410cb0303ee97 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/FRONTIER_STABILITY.json @@ -0,0 +1,920 @@ +{ + "generated_by": "scripts/viz/frontier_stability.py (gen_q#270 run 20)", + "census": "/proj/dmfexp/zwhong/rsm_rise/runs/pixdec/CAND_GREEN_CENSUS_xdev.json", + "n_draws_in_census": 202, + "n_dropped_as_same_file": 29, + "same_file_groups": [ + { + "task": "square_expert_play", + "root": "demo_198_t0110", + "dir": "stitchviz_seed0_r1", + "same_file_as": "stitchviz_seed0", + "md5": "413e008fba4b719e6299e54ced726b1e" + }, + { + "task": "square_expert_play", + "root": "demo_54_t0122", + "dir": "stitchviz_seed0_r1", + "same_file_as": "stitchviz_seed0", + "md5": "a6aa694a7ed0724db985750f509b4072" + }, + { + "task": "square_expert_play", + "root": "demo_181_t0135", + "dir": "stitchviz_seed0_r1", + "same_file_as": "stitchviz_seed0", + "md5": "c62065ae184c4e2b497abc1f674edb23" + }, + { + "task": "square_expert_play", + "root": "demo_198_t0110", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0", + "md5": "413e008fba4b719e6299e54ced726b1e" + }, + { + "task": "square_expert_play", + "root": "demo_54_t0122", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0", + "md5": "a6aa694a7ed0724db985750f509b4072" + }, + { + "task": "square_expert_play", + "root": "demo_181_t0135", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0", + "md5": "c62065ae184c4e2b497abc1f674edb23" + }, + { + "task": "square_expert_play", + "root": "demo_148_t0138", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0_r1", + "md5": "8139b3ec0fefc3c9ceb02730024eb7ce" + }, + { + "task": "square_expert_play", + "root": "demo_164_t0093", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0_r1", + "md5": "71ff22e5b59e6733e982723c633c2172" + }, + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0_r1", + "md5": "342c39119fdedf8ee65f038ae3dab342" + }, + { + "task": "square_expert_play", + "root": "demo_150_t0125", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0_r1", + "md5": "ef42a1df2a81d08415ce9d15c206a005" + }, + { + "task": "square_expert_play", + "root": "demo_88_t0144", + "dir": "stitchviz_seed0_r2", + "same_file_as": "stitchviz_seed0_r1", + "md5": "af51c72e566927017c4f741d54ff4d50" + }, + { + "task": "square_expert_play", + "root": "demo_198_t0110", + "dir": "stitchviz_seed0dup", + "same_file_as": "stitchviz_seed0", + "md5": "413e008fba4b719e6299e54ced726b1e" + }, + { + "task": "square_expert_play", + "root": "demo_54_t0122", + "dir": "stitchviz_seed0dup", + "same_file_as": "stitchviz_seed0", + "md5": "a6aa694a7ed0724db985750f509b4072" + }, + { + "task": "square_expert_play", + "root": "demo_181_t0135", + "dir": "stitchviz_seed0dup", + "same_file_as": "stitchviz_seed0", + "md5": "c62065ae184c4e2b497abc1f674edb23" + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_split", + "same_file_as": "stitchviz", + "md5": "ef66050c9320363622d46efdb6849b7b" + }, + { + "task": "square_expert_play", + "root": "demo_181_t0135", + "dir": "stitchviz_split", + "same_file_as": "stitchviz_seed0", + "md5": "c62065ae184c4e2b497abc1f674edb23" + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "dir": "stitchviz_split2", + "same_file_as": "stitchviz", + "md5": "ef66050c9320363622d46efdb6849b7b" + }, + { + "task": "square_expert_play", + "root": "demo_181_t0135", + "dir": "stitchviz_split2", + "same_file_as": "stitchviz_seed0", + "md5": "c62065ae184c4e2b497abc1f674edb23" + }, + { + "task": "two_piece_expert_play", + "root": "demo_38_t0067", + "dir": "stitchviz_seed0dup", + "same_file_as": "stitchviz_seed0", + "md5": "50295254a84ada2b4ea5f3a171e227d5" + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_seed0dup", + "same_file_as": "stitchviz_seed0", + "md5": "fa5d07e3374123c520c47ebfa8e391de" + }, + { + "task": "two_piece_expert_play", + "root": "demo_128_t0115", + "dir": "stitchviz_seed0dup", + "same_file_as": "stitchviz_seed0", + "md5": "3fec649e7352726c1d9371fb61e6a5e7" + }, + { + "task": "two_piece_expert_play", + "root": "demo_129_t0084", + "dir": "stitchviz_split", + "same_file_as": "stitchviz", + "md5": "cf081f324f948a85330edfaa6826e17e" + }, + { + "task": "two_piece_expert_play", + "root": "demo_143_t0154", + "dir": "stitchviz_split", + "same_file_as": "stitchviz", + "md5": "a4ed75442046a7df374fb6f8130b339f" + }, + { + "task": "two_piece_expert_play", + "root": "demo_129_t0084", + "dir": "stitchviz_split2", + "same_file_as": "stitchviz", + "md5": "cf081f324f948a85330edfaa6826e17e" + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_split2", + "same_file_as": "stitchviz_split", + "md5": "067fa64e3077b20e2488e28b9f29ed20" + }, + { + "task": "two_piece_expert_play", + "root": "demo_136_t0154", + "dir": "stitchviz_split2", + "same_file_as": "stitchviz_split", + "md5": "622102449419f53052ef84a7acfe0040" + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "dir": "stitchviz_unseen", + "same_file_as": "stitchviz_split", + "md5": "067fa64e3077b20e2488e28b9f29ed20" + }, + { + "task": "two_piece_expert_play", + "root": "demo_136_t0154", + "dir": "stitchviz_unseen8", + "same_file_as": "stitchviz_split", + "md5": "622102449419f53052ef84a7acfe0040" + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "dir": "stitchviz_xdev_cpuS", + "same_file_as": "stitchviz_split2", + "md5": "ca4ce6e148ad5c45597d3276f0cd73a4" + } + ], + "n_distinct_captures": 173, + "note": "A 'capture' here is a distinct trace FILE. Draws whose npz md5 matches one already counted for the same root are dropped: the curated split dirs hold COPIES, not re-captures, so counting them as replicates overstated the stability of the shipped picks.", + "roots": { + "square_expert_play/demo_36_t0056": { + "task": "square_expert_play", + "root": "demo_36_t0056", + "n_distinct_captures": 6, + "arms": [ + "legacy", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuB", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "dirs": [ + "stitchviz", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_36", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "balance": { + "min": 0.3203125, + "max": 0.4609375, + "mean": 0.3763020833333333, + "range": 0.140625 + }, + "frac_green": { + "min": 0.15557861328125, + "max": 0.192138671875, + "mean": 0.16896565755208334, + "range": 0.03656005859375 + }, + "Q_spread": { + "min": 0.6069021821022034, + "max": 0.6839041709899902, + "mean": 0.6404770712057749, + "range": 0.07700198888778687 + }, + "hop_rise": { + "min": 0.08935546875, + "max": 0.16748046875, + "mean": 0.1324462890625, + "range": 0.078125 + }, + "cand_any_green": { + "min": 0.3203125, + "max": 0.4609375, + "mean": 0.3763020833333333, + "range": 0.140625 + } + }, + "two_piece_expert_play/demo_18_t0096": { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "n_distinct_captures": 13, + "arms": [ + "legacy", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuB", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "dirs": [ + "stitchviz_seed0", + "stitchviz_seed1", + "stitchviz_seed2", + "stitchviz_seed3", + "stitchviz_split", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_18", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "balance": { + "min": 0.171875, + "max": 0.3203125, + "mean": 0.2247596153846154, + "range": 0.1484375 + }, + "frac_green": { + "min": 0.082275390625, + "max": 0.13232421875, + "mean": 0.1013934795673077, + "range": 0.050048828125 + }, + "Q_spread": { + "min": 0.8395338654518127, + "max": 0.9906049370765686, + "mean": 0.920663989507235, + "range": 0.15107107162475586 + }, + "hop_rise": { + "min": -0.122802734375, + "max": -0.0743408203125, + "mean": -0.09801307091346154, + "range": 0.0484619140625 + }, + "cand_any_green": { + "min": 0.6796875, + "max": 0.828125, + "mean": 0.7752403846153846, + "range": 0.1484375 + } + }, + "square_expert_play/demo_212_t0141": { + "task": "square_expert_play", + "root": "demo_212_t0141", + "n_distinct_captures": 9, + "arms": [ + "legacy", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuB", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "dirs": [ + "stitchviz_seed0_r1", + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_212", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "balance": { + "min": 0.2890625, + "max": 0.46875, + "mean": 0.4236111111111111, + "range": 0.1796875 + }, + "frac_green": { + "min": 0.0169677734375, + "max": 0.033447265625, + "mean": 0.025221082899305556, + "range": 0.0164794921875 + }, + "Q_spread": { + "min": 0.13475771248340607, + "max": 0.23395879566669464, + "mean": 0.1758943067656623, + "range": 0.09920108318328857 + }, + "hop_rise": { + "min": 0.0262451171875, + "max": 0.0361328125, + "mean": 0.031019422743055556, + "range": 0.0098876953125 + }, + "cand_any_green": { + "min": 0.40625, + "max": 0.7109375, + "mean": 0.5104166666666666, + "range": 0.3046875 + } + }, + "two_piece_expert_play/demo_159_t0413": { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "n_distinct_captures": 8, + "arms": [ + "legacy", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuB", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "dirs": [ + "stitchviz_unseen8", + "stitchviz_unseen8cpu", + "stitchviz_unseen8cpu2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_159", + "stitchviz_xdev_cpuS", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "balance": { + "min": 0.2109375, + "max": 0.359375, + "mean": 0.2802734375, + "range": 0.1484375 + }, + "frac_green": { + "min": 0.02008056640625, + "max": 0.03082275390625, + "mean": 0.02602386474609375, + "range": 0.0107421875 + }, + "Q_spread": { + "min": 0.12913261353969574, + "max": 0.16040538251399994, + "mean": 0.14904779940843582, + "range": 0.0312727689743042 + }, + "hop_rise": { + "min": 0.0062255859375, + "max": 0.0147705078125, + "mean": 0.0096282958984375, + "range": 0.008544921875 + }, + "cand_any_green": { + "min": 0.640625, + "max": 0.7890625, + "mean": 0.7197265625, + "range": 0.1484375 + } + }, + "two_piece_expert_play/demo_80_t0025": { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "n_distinct_captures": 5, + "arms": [ + "legacy", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuB", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "dirs": [ + "stitchviz_split2", + "stitchviz_xdev_cpuA", + "stitchviz_xdev_cpuBdemo_80", + "stitchviz_xdev_gpuA", + "stitchviz_xdev_gpuS" + ], + "balance": { + "min": 0.0, + "max": 0.0, + "mean": 0.0, + "range": 0.0 + }, + "frac_green": { + "min": 0.1795654296875, + "max": 0.2598876953125, + "mean": 0.22607421875, + "range": 0.080322265625 + }, + "Q_spread": { + "min": 0.14182797074317932, + "max": 0.3932135999202728, + "mean": 0.27431137561798097, + "range": 0.2513856291770935 + }, + "hop_rise": { + "min": 0.0625, + "max": 0.177001953125, + "mean": 0.130126953125, + "range": 0.114501953125 + }, + "cand_any_green": { + "min": 1.0, + "max": 1.0, + "mean": 1.0, + "range": 0.0 + } + } + }, + "shipped_vs_rival": [ + { + "task": "square_expert_play", + "shipped": "demo_36_t0056", + "rival": "demo_212_t0141", + "decides": "balance", + "n_captures_shipped": 6, + "n_captures_rival": 9, + "axes": { + "balance": { + "shipped_mean": 0.3763020833333333, + "rival_mean": 0.4236111111111111, + "shipped_range": 0.140625, + "rival_range": 0.1796875, + "n_cross": 54, + "shipped_win_frac": 0.2222222222222222, + "n_paired": 5, + "shipped_win_frac_paired": 0.4, + "overlap": true, + "verdict": "ORDERING FLIPS between captures -- within noise" + }, + "frac_green": { + "shipped_mean": 0.16896565755208334, + "rival_mean": 0.025221082899305556, + "shipped_range": 0.03656005859375, + "rival_range": 0.0164794921875, + "n_cross": 54, + "shipped_win_frac": 1.0, + "n_paired": 5, + "shipped_win_frac_paired": 1.0, + "overlap": false, + "verdict": "shipped ALWAYS ahead" + }, + "Q_spread": { + "shipped_mean": 0.6404770712057749, + "rival_mean": 0.1758943067656623, + "shipped_range": 0.07700198888778687, + "rival_range": 0.09920108318328857, + "n_cross": 54, + "shipped_win_frac": 1.0, + "n_paired": 5, + "shipped_win_frac_paired": 1.0, + "overlap": false, + "verdict": "shipped ALWAYS ahead" + }, + "hop_rise": { + "shipped_mean": 0.1324462890625, + "rival_mean": 0.031019422743055556, + "shipped_range": 0.078125, + "rival_range": 0.0098876953125, + "n_cross": 54, + "shipped_win_frac": 1.0, + "n_paired": 5, + "shipped_win_frac_paired": 1.0, + "overlap": false, + "verdict": "shipped ALWAYS ahead" + } + } + }, + { + "task": "two_piece_expert_play", + "shipped": "demo_18_t0096", + "rival": "demo_159_t0413", + "decides": "balance", + "n_captures_shipped": 13, + "n_captures_rival": 8, + "axes": { + "balance": { + "shipped_mean": 0.2247596153846154, + "rival_mean": 0.2802734375, + "shipped_range": 0.1484375, + "rival_range": 0.1484375, + "n_cross": 104, + "shipped_win_frac": 0.21153846153846154, + "n_paired": 5, + "shipped_win_frac_paired": 0.4, + "overlap": true, + "verdict": "ORDERING FLIPS between captures -- within noise" + }, + "frac_green": { + "shipped_mean": 0.1013934795673077, + "rival_mean": 0.02602386474609375, + "shipped_range": 0.050048828125, + "rival_range": 0.0107421875, + "n_cross": 104, + "shipped_win_frac": 1.0, + "n_paired": 5, + "shipped_win_frac_paired": 1.0, + "overlap": false, + "verdict": "shipped ALWAYS ahead" + }, + "Q_spread": { + "shipped_mean": 0.920663989507235, + "rival_mean": 0.14904779940843582, + "shipped_range": 0.15107107162475586, + "rival_range": 0.0312727689743042, + "n_cross": 104, + "shipped_win_frac": 1.0, + "n_paired": 5, + "shipped_win_frac_paired": 1.0, + "overlap": false, + "verdict": "shipped ALWAYS ahead" + }, + "hop_rise": { + "shipped_mean": -0.09801307091346154, + "rival_mean": 0.0096282958984375, + "shipped_range": 0.0484619140625, + "rival_range": 0.008544921875, + "n_cross": 104, + "shipped_win_frac": 0.0, + "n_paired": 5, + "shipped_win_frac_paired": 0.0, + "overlap": false, + "verdict": "rival ALWAYS ahead" + } + } + } + ], + "device_effect_candidate_draw_fixed": [ + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "md5_identical": false, + "balance": { + "cpu": 0.46875, + "gpu": 0.2890625, + "delta": -0.1796875 + }, + "frac_green": { + "cpu": 0.02972412109375, + "gpu": 0.020263671875, + "delta": -0.00946044921875 + }, + "Q_spread": { + "cpu": 0.23395879566669464, + "gpu": 0.13475771248340607, + "delta": -0.09920108318328857 + }, + "hop_rise": { + "cpu": 0.0318603515625, + "gpu": 0.0361328125, + "delta": 0.0042724609375 + } + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "md5_identical": false, + "balance": { + "cpu": 0.3515625, + "gpu": 0.3828125, + "delta": 0.03125 + }, + "frac_green": { + "cpu": 0.1668701171875, + "gpu": 0.1556396484375, + "delta": -0.01123046875 + }, + "Q_spread": { + "cpu": 0.6687449812889099, + "gpu": 0.6444095969200134, + "delta": -0.024335384368896484 + }, + "hop_rise": { + "cpu": 0.1455078125, + "gpu": 0.08935546875, + "delta": -0.05615234375 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "md5_identical": false, + "balance": { + "cpu": 0.2578125, + "gpu": 0.359375, + "delta": 0.1015625 + }, + "frac_green": { + "cpu": 0.02789306640625, + "gpu": 0.02008056640625, + "delta": -0.0078125 + }, + "Q_spread": { + "cpu": 0.15601681172847748, + "gpu": 0.14871086180210114, + "delta": -0.007305949926376343 + }, + "hop_rise": { + "cpu": 0.0101318359375, + "gpu": 0.0062255859375, + "delta": -0.00390625 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "md5_identical": false, + "balance": { + "cpu": 0.234375, + "gpu": 0.1796875, + "delta": -0.0546875 + }, + "frac_green": { + "cpu": 0.09515380859375, + "gpu": 0.13232421875, + "delta": 0.03717041015625 + }, + "Q_spread": { + "cpu": 0.9404141902923584, + "gpu": 0.8569687008857727, + "delta": -0.0834454894065857 + }, + "hop_rise": { + "cpu": -0.0985107421875, + "gpu": -0.08056640625, + "delta": 0.0179443359375 + } + } + ], + "rng_effect_same_device": [ + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "balance": { + "unseeded": 0.4453125, + "seeded": 0.46875, + "delta": -0.0234375 + }, + "frac_green": { + "unseeded": 0.02874755859375, + "seeded": 0.02972412109375, + "delta": -0.0009765625 + }, + "Q_spread": { + "unseeded": 0.15529954433441162, + "seeded": 0.23395879566669464, + "delta": -0.07865925133228302 + }, + "hop_rise": { + "unseeded": 0.0262451171875, + "seeded": 0.0318603515625, + "delta": -0.005615234375 + } + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "balance": { + "unseeded": 0.328125, + "seeded": 0.3515625, + "delta": -0.0234375 + }, + "frac_green": { + "unseeded": 0.1558837890625, + "seeded": 0.1668701171875, + "delta": -0.010986328125 + }, + "Q_spread": { + "unseeded": 0.6141054630279541, + "seeded": 0.6687449812889099, + "delta": -0.05463951826095581 + }, + "hop_rise": { + "unseeded": 0.14013671875, + "seeded": 0.1455078125, + "delta": -0.00537109375 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "balance": { + "unseeded": 0.21875, + "seeded": 0.2578125, + "delta": -0.0390625 + }, + "frac_green": { + "unseeded": 0.03082275390625, + "seeded": 0.02789306640625, + "delta": 0.0029296875 + }, + "Q_spread": { + "unseeded": 0.1540834754705429, + "seeded": 0.15601681172847748, + "delta": -0.0019333362579345703 + }, + "hop_rise": { + "unseeded": 0.0120849609375, + "seeded": 0.0101318359375, + "delta": 0.001953125 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "balance": { + "unseeded": 0.2265625, + "seeded": 0.234375, + "delta": -0.0078125 + }, + "frac_green": { + "unseeded": 0.082275390625, + "seeded": 0.09515380859375, + "delta": -0.01287841796875 + }, + "Q_spread": { + "unseeded": 0.9332315921783447, + "seeded": 0.9404141902923584, + "delta": -0.007182598114013672 + }, + "hop_rise": { + "unseeded": -0.10791015625, + "seeded": -0.0985107421875, + "delta": -0.0093994140625 + } + } + ], + "batch_effect_same_device": [ + { + "task": "square_expert_play", + "root": "demo_212_t0141", + "balance": { + "batched": 0.4453125, + "alone": 0.4140625, + "delta": -0.03125 + }, + "frac_green": { + "batched": 0.02874755859375, + "alone": 0.02557373046875, + "delta": -0.003173828125 + }, + "Q_spread": { + "batched": 0.15529954433441162, + "alone": 0.1601223349571228, + "delta": 0.004822790622711182 + }, + "hop_rise": { + "batched": 0.0262451171875, + "alone": 0.0267333984375, + "delta": 0.00048828125 + } + }, + { + "task": "square_expert_play", + "root": "demo_36_t0056", + "balance": { + "batched": 0.328125, + "alone": 0.3203125, + "delta": -0.0078125 + }, + "frac_green": { + "batched": 0.1558837890625, + "alone": 0.15557861328125, + "delta": -0.00030517578125 + }, + "Q_spread": { + "batched": 0.6141054630279541, + "alone": 0.6839041709899902, + "delta": 0.06979870796203613 + }, + "hop_rise": { + "batched": 0.14013671875, + "alone": 0.1348876953125, + "delta": -0.0052490234375 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_159_t0413", + "balance": { + "batched": 0.21875, + "alone": 0.2109375, + "delta": -0.0078125 + }, + "frac_green": { + "batched": 0.03082275390625, + "alone": 0.02984619140625, + "delta": -0.0009765625 + }, + "Q_spread": { + "batched": 0.1540834754705429, + "alone": 0.14898434281349182, + "delta": -0.005099132657051086 + }, + "hop_rise": { + "batched": 0.0120849609375, + "alone": 0.0147705078125, + "delta": 0.002685546875 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_18_t0096", + "balance": { + "batched": 0.2265625, + "alone": 0.3046875, + "delta": 0.078125 + }, + "frac_green": { + "batched": 0.082275390625, + "alone": 0.08367919921875, + "delta": 0.00140380859375 + }, + "Q_spread": { + "batched": 0.9332315921783447, + "alone": 0.9056652784347534, + "delta": -0.02756631374359131 + }, + "hop_rise": { + "batched": -0.10791015625, + "alone": -0.1014404296875, + "delta": 0.0064697265625 + } + }, + { + "task": "two_piece_expert_play", + "root": "demo_80_t0025", + "balance": { + "batched": 0.0, + "alone": 0.0, + "delta": 0.0 + }, + "frac_green": { + "batched": 0.2598876953125, + "alone": 0.254150390625, + "delta": -0.0057373046875 + }, + "Q_spread": { + "batched": 0.3932135999202728, + "alone": 0.22274374961853027, + "delta": -0.17046985030174255 + }, + "hop_rise": { + "batched": 0.1728515625, + "alone": 0.175537109375, + "delta": 0.002685546875 + } + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_CKPT_ABLATE.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_CKPT_ABLATE.json new file mode 100644 index 0000000000000000000000000000000000000000..b9f54ffeb3a19d73a5b3696c37129b984abd0a3f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_CKPT_ABLATE.json @@ -0,0 +1,1784 @@ +{ + "run": "gen_q#270 run 32 item 3 -- paired best-vs-proghead read-out ablation on real cached states", + "summary": { + "VERDICT": "NOT_MEASURED", + "n_cells": 12, + "n_cells_head_fires": 12, + "under_test": null, + "controls": {}, + "cells_with_label_disagreement": [ + "square_expert_suboptimal", + "square_expert_suboptimal", + "two_piece_expert_suboptimal", + "two_piece_expert_suboptimal" + ], + "n_cells_anti_ordered": 1, + "ckpt_ablation": { + "question": "is two_piece_expert_suboptimal M/proghead's near-random outline the CHECKPOINT KIND or the TASK? Same cache and same positive set on both sides of each pair.", + "n_pairs": 6, + "n_dropped": 0, + "dropped": [], + "n_pairs_best_beats_proghead": 6, + "VERDICT": "CHECKPOINT_KIND", + "tpes": { + "task": "two_piece_expert_suboptimal", + "n_frames": 27859, + "n_target_pos": 6531, + "auroc_best": 0.9803766506337195, + "auroc_proghead": 0.6497449106764518, + "auroc_delta": 0.3306317399572677, + "margin_best": 0.9060653068067201, + "margin_proghead": 0.16848773229136405, + "green_pos_best": 0.9150206706476803, + "green_pos_proghead": 0.5697442964323993, + "green_neg_best": 0.00895536384096024, + "green_neg_proghead": 0.4012565641410353, + "max_logit_best": 63.014427185058594, + "max_logit_proghead": 57.82029724121094, + "best_beats_proghead": true + }, + "worst_task_under_best": "two_piece_expert_suboptimal", + "worst_auroc_under_best": 0.9803766506337195, + "tpes_is_worst_under_best": true, + "n_best_auroc_above_0p90": 6, + "pairs": [ + { + "task": "square_expert_play", + "n_frames": 154446, + "n_target_pos": 76532, + "auroc_best": 0.9980817588473897, + "auroc_proghead": 0.5765977918688325, + "auroc_delta": 0.42148396697855717, + "margin_best": 0.9855993062404341, + "margin_proghead": 0.18056220016263433, + "green_pos_best": 0.9978179062353003, + "green_pos_proghead": 0.3931427376783568, + "green_neg_best": 0.012218599994866134, + "green_neg_proghead": 0.21258053751572245, + "max_logit_best": 100.53509521484375, + "max_logit_proghead": 46.7532844543457, + "best_beats_proghead": true + }, + { + "task": "square_expert_suboptimal", + "n_frames": 54275, + "n_target_pos": 18527, + "auroc_best": 0.9963398847919798, + "auroc_proghead": 0.4864263881643718, + "auroc_delta": 0.509913496627608, + "margin_best": 0.9621456288427754, + "margin_proghead": -0.01278634325056166, + "green_pos_best": 0.9833216386894802, + "green_pos_proghead": 0.41890214281858906, + "green_neg_best": 0.021176009846704712, + "green_neg_proghead": 0.4316884860691507, + "max_logit_best": 62.502052307128906, + "max_logit_proghead": 40.64192581176758, + "best_beats_proghead": true + }, + { + "task": "two_piece_expert_play", + "n_frames": 121809, + "n_target_pos": 63102, + "auroc_best": 0.9981089992049121, + "auroc_proghead": 0.6551116972811568, + "auroc_delta": 0.3429973019237553, + "margin_best": 0.976733576563275, + "margin_proghead": 0.24381493010450128, + "green_pos_best": 0.9913314950397769, + "green_pos_proghead": 0.5534372920034231, + "green_neg_best": 0.01459791847650195, + "green_neg_proghead": 0.3096223618989218, + "max_logit_best": 83.76219940185547, + "max_logit_proghead": 115.34323120117188, + "best_beats_proghead": true + }, + { + "task": "two_piece_expert_suboptimal", + "n_frames": 27859, + "n_target_pos": 6531, + "auroc_best": 0.9803766506337195, + "auroc_proghead": 0.6497449106764518, + "auroc_delta": 0.3306317399572677, + "margin_best": 0.9060653068067201, + "margin_proghead": 0.16848773229136405, + "green_pos_best": 0.9150206706476803, + "green_pos_proghead": 0.5697442964323993, + "green_neg_best": 0.00895536384096024, + "green_neg_proghead": 0.4012565641410353, + "max_logit_best": 63.014427185058594, + "max_logit_proghead": 57.82029724121094, + "best_beats_proghead": true + }, + { + "task": "two_piece_expert_play_tipping", + "n_frames": 189372, + "n_target_pos": 63102, + "auroc_best": 0.9998936526421776, + "auroc_proghead": 0.7124082483829213, + "auroc_delta": 0.2874854042592563, + "margin_best": 0.9927750459251472, + "margin_proghead": 0.43408195063908983, + "green_pos_best": 0.9955310449748027, + "green_pos_proghead": 0.5534531393616684, + "green_neg_best": 0.0027559990496555, + "green_neg_proghead": 0.1193711887225786, + "max_logit_best": 139.64678955078125, + "max_logit_proghead": 112.88203430175781, + "best_beats_proghead": true + }, + { + "task": "mug_expert_suboptimal", + "n_frames": 41739, + "n_target_pos": 6933, + "auroc_best": 0.9982664207721721, + "auroc_proghead": 0.7304724439971194, + "auroc_delta": 0.2677939767750527, + "margin_best": 0.9838500516667361, + "margin_proghead": 0.35661890809845354, + "green_pos_best": 0.9849992788114813, + "green_pos_proghead": 0.3579979806721477, + "green_neg_best": 0.0011492271447451588, + "green_neg_proghead": 0.0013790725736941907, + "max_logit_best": 77.8307113647461, + "max_logit_proghead": 20.304407119750977, + "best_beats_proghead": true + } + ] + } + }, + "question": "does the reward head that outlines the trees fire on REAL success frames? If not, square_sub_20100's all-red rollouts (run 30) are the HEAD's doing, not the successor's", + "green_rule": "c = sigmoid(R(z)/T) >= 0.5 <=> R(z) >= 0 for T > 0 (rsm_scorer.py:351)", + "pos_threshold": 0.5, + "strict_threshold": 0.9, + "gates": { + "G1_positive_control": false, + "G2_temperature_positive": true, + "G3_goal_label_sane": false, + "note": "G1 failing VOIDS the run: the published trees contain green states" + }, + "cells": [ + { + "task": "square_expert_play", + "model": "M", + "ckpt": "best", + "role": "ablate_best", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/M/ckpt_best.pt", + "step": 100000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 154446, + "n_ep": 424, + "n_ep_success": 200, + "sets": { + "all": { + "n": 154446, + "green_rate": 0.5006086269634694 + }, + "target_pos": { + "n": 76532, + "green_rate": 0.9978179062353003 + }, + "target_pos_strict": { + "n": 76532, + "green_rate": 0.9978179062353003 + }, + "target_neg": { + "n": 77914, + "green_rate": 0.012218599994866134 + }, + "env_goal": { + "n": 2211, + "green_rate": 1.0 + }, + "success_ep": { + "n": 76532, + "green_rate": 0.9978179062353003 + }, + "target_pos_train": { + "n": 69106, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 7426, + "green_rate": 0.9775114462698626 + }, + "env_goal_train": { + "n": 2001, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 210, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -206.07272338867188, + "0.01": -146.07108688354492, + "0.25": -53.80677318572998, + "0.5": 1.2275434136390686, + "0.75": 25.5321946144104, + "0.99": 48.41109466552726, + "0.999": 66.17058200836067, + "1.0": 100.53509521484375 + }, + "max_all": 100.53509521484375, + "max_target_pos": 100.53509521484375, + "max_env_goal": 32.33661651611328, + "min_all": -206.07272338867188, + "c_at_max_all": 1.0, + "n_green": 77317, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 14600 + }, + "target_stats": { + "mean": 0.4955259443430066, + "n_pos": 76532, + "n_strict": 76532, + "n_env_goal": 2211 + }, + "ordering": { + "auroc_target_pos": 0.9980817588473897, + "auroc_target_pos_strict": 0.9980817588473897, + "auroc_env_goal": 0.613496959527375, + "auroc_target_pos_val": 0.9732549843127991, + "green_margin": 0.9855993062404341, + "median_logit_target_pos": 25.59025764465332, + "median_logit_target_neg": -53.38656425476074, + "n_distinct_logits": 154080 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 200, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 2211, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "square_expert_play", + "model": "M", + "ckpt": "proghead", + "role": "ablate_proghead", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/M/ckpt_proghead.pt", + "step": 100000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 154446, + "n_ep": 424, + "n_ep_success": 200, + "sets": { + "all": { + "n": 154446, + "green_rate": 0.3020537922639628 + }, + "target_pos": { + "n": 76532, + "green_rate": 0.3931427376783568 + }, + "target_pos_strict": { + "n": 76532, + "green_rate": 0.3931427376783568 + }, + "target_neg": { + "n": 77914, + "green_rate": 0.21258053751572245 + }, + "env_goal": { + "n": 2211, + "green_rate": 1.0 + }, + "success_ep": { + "n": 76532, + "green_rate": 0.3931427376783568 + }, + "target_pos_train": { + "n": 69106, + "green_rate": 0.3929760078719648 + }, + "target_pos_val": { + "n": 7426, + "green_rate": 0.3946943172636682 + }, + "env_goal_train": { + "n": 2001, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 210, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -26.632007598876953, + "0.01": -4.508622455596924, + "0.25": -1.2360432147979736, + "0.5": -0.682606965303421, + "0.75": 0.23386897891759872, + "0.99": 22.149018383026114, + "0.999": 36.901117267608406, + "1.0": 46.7532844543457 + }, + "max_all": 46.7532844543457, + "max_target_pos": 46.7532844543457, + "max_env_goal": 46.7532844543457, + "min_all": -26.632007598876953, + "c_at_max_all": 1.0, + "n_green": 46651, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1 + }, + "target_stats": { + "mean": 0.4955259443430066, + "n_pos": 76532, + "n_strict": 76532, + "n_env_goal": 2211 + }, + "ordering": { + "auroc_target_pos": 0.5765977918688325, + "auroc_target_pos_strict": 0.5765977918688325, + "auroc_env_goal": 0.9999535787562841, + "auroc_target_pos_val": 0.5699117439846683, + "green_margin": 0.18056220016263433, + "median_logit_target_pos": -0.6754462420940399, + "median_logit_target_neg": -0.6892800033092499, + "n_distinct_logits": 153376 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 200, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 2211, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "square_expert_suboptimal", + "model": "M", + "ckpt": "best", + "role": "ablate_best", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_suboptimal/rsm/M/ckpt_best.pt", + "step": 75000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 54275, + "n_ep": 200, + "n_ep_success": 100, + "sets": { + "all": { + "n": 54275, + "green_rate": 0.34960847535697837 + }, + "target_pos": { + "n": 18527, + "green_rate": 0.9833216386894802 + }, + "target_pos_strict": { + "n": 18527, + "green_rate": 0.9833216386894802 + }, + "target_neg": { + "n": 35748, + "green_rate": 0.021176009846704712 + }, + "env_goal": { + "n": 805, + "green_rate": 0.5080745341614907 + }, + "success_ep": { + "n": 18527, + "green_rate": 0.9833216386894802 + }, + "target_pos_train": { + "n": 16855, + "green_rate": 0.9997626816968259 + }, + "target_pos_val": { + "n": 1672, + "green_rate": 0.8175837320574163 + }, + "env_goal_train": { + "n": 725, + "green_rate": 0.5103448275862069 + }, + "env_goal_val": { + "n": 80, + "green_rate": 0.4875 + } + }, + "logit": { + "q": { + "0.0": -120.04777526855469, + "0.01": -70.49072311401368, + "0.25": -34.73715591430664, + "0.5": -20.75841522216797, + "0.75": 15.758450508117676, + "0.99": 38.74024810791017, + "0.999": 50.90430008697513, + "1.0": 62.502052307128906 + }, + "max_all": 62.502052307128906, + "max_target_pos": 62.502052307128906, + "max_env_goal": 50.34262466430664, + "min_all": -120.04777526855469, + "c_at_max_all": 1.0, + "n_green": 18975, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 63 + }, + "target_stats": { + "mean": 0.34135421464762783, + "n_pos": 18527, + "n_strict": 18527, + "n_env_goal": 805 + }, + "ordering": { + "auroc_target_pos": 0.9963398847919798, + "auroc_target_pos_strict": 0.9963398847919798, + "auroc_env_goal": 0.6198756370031607, + "auroc_target_pos_val": 0.9165144999994732, + "green_margin": 0.9621456288427754, + "median_logit_target_pos": 19.85664939880371, + "median_logit_target_neg": -29.94419574737549, + "n_distinct_logits": 54225 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 200, + "n_ep_success_meta": 100, + "n_ep_env_goal_but_meta_failure": 100, + "labels_agree": false, + "env_goal_in_success_ep": { + "n": 402, + "green_rate": 0.9900497512437811 + }, + "env_goal_in_failure_ep": { + "n": 403, + "green_rate": 0.02729528535980149 + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 0.9900497512437811 + }, + { + "task": "square_expert_suboptimal", + "model": "M", + "ckpt": "proghead", + "role": "ablate_proghead", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "step": 75000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 54275, + "n_ep": 200, + "n_ep_success": 100, + "sets": { + "all": { + "n": 54275, + "green_rate": 0.4273238139106403 + }, + "target_pos": { + "n": 18527, + "green_rate": 0.41890214281858906 + }, + "target_pos_strict": { + "n": 18527, + "green_rate": 0.41890214281858906 + }, + "target_neg": { + "n": 35748, + "green_rate": 0.4316884860691507 + }, + "env_goal": { + "n": 805, + "green_rate": 1.0 + }, + "success_ep": { + "n": 18527, + "green_rate": 0.41890214281858906 + }, + "target_pos_train": { + "n": 16855, + "green_rate": 0.41880747552655 + }, + "target_pos_val": { + "n": 1672, + "green_rate": 0.41985645933014354 + }, + "env_goal_train": { + "n": 725, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 80, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -16.106508255004883, + "0.01": -2.9443388271331785, + "0.25": -0.8211213052272797, + "0.5": -0.6214563846588135, + "0.75": 2.1871646642684937, + "0.99": 21.687614212036152, + "0.999": 32.77518375396732, + "1.0": 40.64192581176758 + }, + "max_all": 40.64192581176758, + "max_target_pos": 40.64192581176758, + "max_env_goal": 40.64192581176758, + "min_all": -16.106508255004883, + "c_at_max_all": 1.0, + "n_green": 23193, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1 + }, + "target_stats": { + "mean": 0.34135421464762783, + "n_pos": 18527, + "n_strict": 18527, + "n_env_goal": 805 + }, + "ordering": { + "auroc_target_pos": 0.4864263881643718, + "auroc_target_pos_strict": 0.4864263881643718, + "auroc_env_goal": 0.9994650509312124, + "auroc_target_pos_val": 0.44166783447778823, + "green_margin": -0.01278634325056166, + "median_logit_target_pos": -0.6485525369644165, + "median_logit_target_neg": -0.6197045743465424, + "n_distinct_logits": 53192 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 200, + "n_ep_success_meta": 100, + "n_ep_env_goal_but_meta_failure": 100, + "labels_agree": false, + "env_goal_in_success_ep": { + "n": 402, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 403, + "green_rate": 1.0 + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "two_piece_expert_play", + "model": "M", + "ckpt": "best", + "role": "ablate_best", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/M/ckpt_best.pt", + "step": 240000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 121809, + "n_ep": 399, + "n_ep_success": 200, + "sets": { + "all": { + "n": 121809, + "green_rate": 0.5205855068180512 + }, + "target_pos": { + "n": 63102, + "green_rate": 0.9913314950397769 + }, + "target_pos_strict": { + "n": 63102, + "green_rate": 0.9913314950397769 + }, + "target_neg": { + "n": 58707, + "green_rate": 0.01459791847650195 + }, + "env_goal": { + "n": 43, + "green_rate": 1.0 + }, + "success_ep": { + "n": 63102, + "green_rate": 0.9913314950397769 + }, + "target_pos_train": { + "n": 56353, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 6749, + "green_rate": 0.9189509556971404 + }, + "env_goal_train": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -563.5210571289062, + "0.01": -404.19580932617185, + "0.25": -63.57224655151367, + "0.5": 12.001276016235352, + "0.75": 29.24042320251465, + "0.99": 59.780719451904275, + "0.999": 69.67688690185533, + "1.0": 83.76219940185547 + }, + "max_all": 83.76219940185547, + "max_target_pos": 83.76219940185547, + "max_env_goal": 41.224586486816406, + "min_all": -563.5210571289062, + "c_at_max_all": 1.0, + "n_green": 63412, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 14025 + }, + "target_stats": { + "mean": 0.5180405388764378, + "n_pos": 63102, + "n_strict": 63102, + "n_env_goal": 43 + }, + "ordering": { + "auroc_target_pos": 0.9981089992049121, + "auroc_target_pos_strict": 0.9981089992049121, + "auroc_env_goal": 0.7890708407929964, + "auroc_target_pos_val": 0.9492085247197115, + "green_margin": 0.976733576563275, + "median_logit_target_pos": 28.62001895904541, + "median_logit_target_neg": -66.36129760742188, + "n_distinct_logits": 121663 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 1, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "two_piece_expert_play", + "model": "M", + "ckpt": "proghead", + "role": "ablate_proghead", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/M/ckpt_proghead.pt", + "step": 95000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 121809, + "n_ep": 399, + "n_ep_success": 200, + "sets": { + "all": { + "n": 121809, + "green_rate": 0.4359283796763786 + }, + "target_pos": { + "n": 63102, + "green_rate": 0.5534372920034231 + }, + "target_pos_strict": { + "n": 63102, + "green_rate": 0.5534372920034231 + }, + "target_neg": { + "n": 58707, + "green_rate": 0.3096223618989218 + }, + "env_goal": { + "n": 43, + "green_rate": 1.0 + }, + "success_ep": { + "n": 63102, + "green_rate": 0.5534372920034231 + }, + "target_pos_train": { + "n": 56353, + "green_rate": 0.5541852252763828 + }, + "target_pos_val": { + "n": 6749, + "green_rate": 0.5471921766187583 + }, + "env_goal_train": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -37.895538330078125, + "0.01": -24.062644653320312, + "0.25": -0.9990758895874023, + "0.5": -0.17603302001953125, + "0.75": 0.8778829574584961, + "0.99": 82.91292755126952, + "0.999": 97.05082263183589, + "1.0": 115.34323120117188 + }, + "max_all": 115.34323120117188, + "max_target_pos": 115.34323120117188, + "max_env_goal": 61.172672271728516, + "min_all": -37.895538330078125, + "c_at_max_all": 1.0, + "n_green": 53100, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 7419 + }, + "target_stats": { + "mean": 0.5180405388764378, + "n_pos": 63102, + "n_strict": 63102, + "n_env_goal": 43 + }, + "ordering": { + "auroc_target_pos": 0.6551116972811568, + "auroc_target_pos_strict": 0.6551116972811568, + "auroc_env_goal": 0.8508410527397383, + "auroc_target_pos_val": 0.6483622844493314, + "green_margin": 0.24381493010450128, + "median_logit_target_pos": 0.18429934978485107, + "median_logit_target_neg": -0.40310749411582947, + "n_distinct_logits": 121590 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 1, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "two_piece_expert_suboptimal", + "model": "M", + "ckpt": "best", + "role": "ablate_best", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/M/ckpt_best.pt", + "step": 30000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 27859, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 27859, + "green_rate": 0.2213647295308518 + }, + "target_pos": { + "n": 6531, + "green_rate": 0.9150206706476803 + }, + "target_pos_strict": { + "n": 6531, + "green_rate": 0.9150206706476803 + }, + "target_neg": { + "n": 21328, + "green_rate": 0.00895536384096024 + }, + "env_goal": { + "n": 25, + "green_rate": 0.0 + }, + "success_ep": { + "n": 6531, + "green_rate": 0.9150206706476803 + }, + "target_pos_train": { + "n": 5416, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 1115, + "green_rate": 0.5022421524663677 + }, + "env_goal_train": { + "n": 25, + "green_rate": 0.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -156.23580932617188, + "0.01": -101.71052825927734, + "0.25": -43.69467353820801, + "0.5": -27.62023162841797, + "0.75": -13.372401237487793, + "0.99": 42.61828880310058, + "0.999": 52.664346290588355, + "1.0": 63.014427185058594 + }, + "max_all": 63.014427185058594, + "max_target_pos": 63.014427185058594, + "max_env_goal": -74.81021118164062, + "min_all": -156.23580932617188, + "c_at_max_all": 1.0, + "n_green": 6167, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 25893 + }, + "target_stats": { + "mean": 0.23443052514447754, + "n_pos": 6531, + "n_strict": 6531, + "n_env_goal": 25 + }, + "ordering": { + "auroc_target_pos": 0.9803766506337195, + "auroc_target_pos_strict": 0.9803766506337195, + "auroc_env_goal": 0.03695049220377955, + "auroc_target_pos_val": 0.8357196022936118, + "green_margin": 0.9060653068067201, + "median_logit_target_pos": 23.419902801513672, + "median_logit_target_neg": -33.50364875793457, + "n_distinct_logits": 27852 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 3, + "n_ep_success_meta": 20, + "n_ep_env_goal_but_meta_failure": 3, + "labels_agree": false, + "env_goal_in_success_ep": { + "n": 0, + "green_rate": null + }, + "env_goal_in_failure_ep": { + "n": 25, + "green_rate": 0.0 + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": null + }, + { + "task": "two_piece_expert_suboptimal", + "model": "M", + "ckpt": "proghead", + "role": "ablate_proghead", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "step": 30000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 27859, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 27859, + "green_rate": 0.44075523170250186 + }, + "target_pos": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_pos_strict": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_neg": { + "n": 21328, + "green_rate": 0.4012565641410353 + }, + "env_goal": { + "n": 25, + "green_rate": 1.0 + }, + "success_ep": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_pos_train": { + "n": 5416, + "green_rate": 0.5659158050221565 + }, + "target_pos_val": { + "n": 1115, + "green_rate": 0.5883408071748879 + }, + "env_goal_train": { + "n": 25, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -12.365499496459961, + "0.01": -3.8188617610931397, + "0.25": -1.3340780138969421, + "0.5": -0.4242510497570038, + "0.75": 1.1736012697219849, + "0.99": 40.80726051330566, + "0.999": 48.75685725402826, + "1.0": 57.82029724121094 + }, + "max_all": 57.82029724121094, + "max_target_pos": 57.82029724121094, + "max_env_goal": 21.647140502929688, + "min_all": -12.365499496459961, + "c_at_max_all": 1.0, + "n_green": 12279, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1910 + }, + "target_stats": { + "mean": 0.23443052514447754, + "n_pos": 6531, + "n_strict": 6531, + "n_env_goal": 25 + }, + "ordering": { + "auroc_target_pos": 0.6497449106764518, + "auroc_target_pos_strict": 0.6497449106764518, + "auroc_env_goal": 0.7916519364805633, + "auroc_target_pos_val": 0.6715457987208704, + "green_margin": 0.16848773229136405, + "median_logit_target_pos": 0.31508490443229675, + "median_logit_target_neg": -0.6149341762065887, + "n_distinct_logits": 27839 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 3, + "n_ep_success_meta": 20, + "n_ep_env_goal_but_meta_failure": 3, + "labels_agree": false, + "env_goal_in_success_ep": { + "n": 0, + "green_rate": null + }, + "env_goal_in_failure_ep": { + "n": 25, + "green_rate": 1.0 + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": null + }, + { + "task": "two_piece_expert_play_tipping", + "model": "M", + "ckpt": "best", + "role": "ablate_best", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/M/ckpt_best.pt", + "step": 10000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 189372, + "n_ep": 704, + "n_ep_success": 200, + "sets": { + "all": { + "n": 189372, + "green_rate": 0.3335656802484 + }, + "target_pos": { + "n": 63102, + "green_rate": 0.9955310449748027 + }, + "target_pos_strict": { + "n": 63102, + "green_rate": 0.9955310449748027 + }, + "target_neg": { + "n": 126270, + "green_rate": 0.0027559990496555 + }, + "env_goal": { + "n": 43, + "green_rate": 1.0 + }, + "success_ep": { + "n": 63102, + "green_rate": 0.9955310449748027 + }, + "target_pos_train": { + "n": 56563, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 6539, + "green_rate": 0.9568741397767243 + }, + "env_goal_train": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -317.3299560546875, + "0.01": -215.5294937133789, + "0.25": -83.36794853210449, + "0.5": -38.63241958618164, + "0.75": 24.261703491210938, + "0.99": 79.66397956848154, + "0.999": 104.28477888488766, + "1.0": 139.64678955078125 + }, + "max_all": 139.64678955078125, + "max_target_pos": 139.64678955078125, + "max_env_goal": 62.27288818359375, + "min_all": -317.3299560546875, + "c_at_max_all": 1.0, + "n_green": 63168, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 6212 + }, + "target_stats": { + "mean": 0.33321715987580003, + "n_pos": 63102, + "n_strict": 63102, + "n_env_goal": 43 + }, + "ordering": { + "auroc_target_pos": 0.9998936526421776, + "auroc_target_pos_strict": 0.9998936526421776, + "auroc_env_goal": 0.9159506639543543, + "auroc_target_pos_val": 0.9961408591567746, + "green_margin": 0.9927750459251472, + "median_logit_target_pos": 35.455875396728516, + "median_logit_target_neg": -66.64875030517578, + "n_distinct_logits": 188999 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 1, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "two_piece_expert_play_tipping", + "model": "M", + "ckpt": "proghead", + "role": "ablate_proghead", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play_tipping/rsm/M/ckpt_proghead.pt", + "step": 10000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 189372, + "n_ep": 704, + "n_ep_success": 200, + "sets": { + "all": { + "n": 189372, + "green_rate": 0.26401474346788334 + }, + "target_pos": { + "n": 63102, + "green_rate": 0.5534531393616684 + }, + "target_pos_strict": { + "n": 63102, + "green_rate": 0.5534531393616684 + }, + "target_neg": { + "n": 126270, + "green_rate": 0.1193711887225786 + }, + "env_goal": { + "n": 43, + "green_rate": 1.0 + }, + "success_ep": { + "n": 63102, + "green_rate": 0.5534531393616684 + }, + "target_pos_train": { + "n": 56563, + "green_rate": 0.5546558704453441 + }, + "target_pos_val": { + "n": 6539, + "green_rate": 0.5430493959320997 + }, + "env_goal_train": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -45.57500076293945, + "0.01": -34.89410930633545, + "0.25": -1.2077702581882477, + "0.5": -0.6149555444717407, + "0.75": 0.030746676959097385, + "0.99": 75.65768699645996, + "0.999": 91.26080622863762, + "1.0": 112.88203430175781 + }, + "max_all": 112.88203430175781, + "max_target_pos": 112.88203430175781, + "max_env_goal": 56.819149017333984, + "min_all": -45.57500076293945, + "c_at_max_all": 1.0, + "n_green": 49997, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 7992 + }, + "target_stats": { + "mean": 0.33321715987580003, + "n_pos": 63102, + "n_strict": 63102, + "n_env_goal": 43 + }, + "ordering": { + "auroc_target_pos": 0.7124082483829213, + "auroc_target_pos_strict": 0.7124082483829213, + "auroc_env_goal": 0.93232010182349, + "auroc_target_pos_val": 0.7159120416197943, + "green_margin": 0.43408195063908983, + "median_logit_target_pos": 0.1824372634291649, + "median_logit_target_neg": -0.6274392008781433, + "n_distinct_logits": 188755 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 1, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "mug_expert_suboptimal", + "model": "M", + "ckpt": "best", + "role": "ablate_best", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/mug_expert_suboptimal/rsm/M/ckpt_best.pt", + "step": 85000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 41739, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 41739, + "green_rate": 0.16457030594887276 + }, + "target_pos": { + "n": 6933, + "green_rate": 0.9849992788114813 + }, + "target_pos_strict": { + "n": 6933, + "green_rate": 0.9849992788114813 + }, + "target_neg": { + "n": 34806, + "green_rate": 0.0011492271447451588 + }, + "env_goal": { + "n": 18, + "green_rate": 1.0 + }, + "success_ep": { + "n": 6933, + "green_rate": 0.9849992788114813 + }, + "target_pos_train": { + "n": 5525, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 1408, + "green_rate": 0.9261363636363636 + }, + "env_goal_train": { + "n": 16, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 2, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -76.6640853881836, + "0.01": -54.132350311279296, + "0.25": -32.42742729187012, + "0.5": -25.1949462890625, + "0.75": -17.945090293884277, + "0.99": 56.09015625000001, + "0.999": 68.78145774841313, + "1.0": 77.8307113647461 + }, + "max_all": 77.8307113647461, + "max_target_pos": 77.8307113647461, + "max_env_goal": 51.27634048461914, + "min_all": -76.6640853881836, + "c_at_max_all": 1.0, + "n_green": 6869, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 722 + }, + "target_stats": { + "mean": 0.16610364407388772, + "n_pos": 6933, + "n_strict": 6933, + "n_env_goal": 18 + }, + "ordering": { + "auroc_target_pos": 0.9982664207721721, + "auroc_target_pos_strict": 0.9982664207721721, + "auroc_env_goal": 0.8991634908079864, + "auroc_target_pos_val": 0.9861700009370314, + "green_margin": 0.9838500516667361, + "median_logit_target_pos": 34.226192474365234, + "median_logit_target_neg": -27.423669815063477, + "n_distinct_logits": 41693 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 14, + "n_ep_success_meta": 20, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 18, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "mug_expert_suboptimal", + "model": "M", + "ckpt": "proghead", + "role": "ablate_proghead", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/mug_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "step": 85000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 41739, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 41739, + "green_rate": 0.06061477275449819 + }, + "target_pos": { + "n": 6933, + "green_rate": 0.3579979806721477 + }, + "target_pos_strict": { + "n": 6933, + "green_rate": 0.3579979806721477 + }, + "target_neg": { + "n": 34806, + "green_rate": 0.0013790725736941907 + }, + "env_goal": { + "n": 18, + "green_rate": 1.0 + }, + "success_ep": { + "n": 6933, + "green_rate": 0.3579979806721477 + }, + "target_pos_train": { + "n": 5525, + "green_rate": 0.35800904977375564 + }, + "target_pos_val": { + "n": 1408, + "green_rate": 0.35795454545454547 + }, + "env_goal_train": { + "n": 16, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 2, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -29.467775344848633, + "0.01": -25.4923823928833, + "0.25": -8.102222442626953, + "0.5": -1.2411906719207764, + "0.75": -0.909090667963028, + "0.99": 0.584517117738727, + "0.999": 2.5492259593011, + "1.0": 20.304407119750977 + }, + "max_all": 20.304407119750977, + "max_target_pos": 20.304407119750977, + "max_env_goal": 20.304407119750977, + "min_all": -29.467775344848633, + "c_at_max_all": 0.9999999984797745, + "n_green": 2530, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1 + }, + "target_stats": { + "mean": 0.16610364407388772, + "n_pos": 6933, + "n_strict": 6933, + "n_env_goal": 18 + }, + "ordering": { + "auroc_target_pos": 0.7304724439971194, + "auroc_target_pos_strict": 0.7304724439971194, + "auroc_env_goal": 0.9999067882148345, + "auroc_target_pos_val": 0.7357134642905819, + "green_margin": 0.35661890809845354, + "median_logit_target_pos": -0.8717291951179504, + "median_logit_target_neg": -1.2955105900764465, + "n_distinct_logits": 41686 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 14, + "n_ep_success_meta": 20, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 18, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + } + ], + "cell_set": "ckpt_ablate", + "extra_ordering": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_RECALL.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_RECALL.json new file mode 100644 index 0000000000000000000000000000000000000000..20a6f365ad37bf11b92ce831b2ab1fa4eea0d527 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_RECALL.json @@ -0,0 +1,558 @@ +{ + "run": "gen_q#270 run 31 -- reward-head recall on real cached states", + "summary": { + "VERDICT": "ROLLOUT_NOT_HEAD", + "n_cells": 4, + "n_cells_head_fires": 4, + "under_test": { + "task": "square_sub_20100", + "model": "M", + "ckpt": "best", + "step": 100000, + "green_rate_target_pos": 0.8488590604026846, + "n_target_pos": 3725, + "green_rate_train": 1.0, + "green_rate_val": 0.3108935128518972, + "train_val_gap": 0.6891064871481027, + "max_logit": 46.22023391723633, + "n_green": 3342, + "n_frames": 39473, + "env_goal_recall_raw": 0.15527950310559005, + "env_goal_recall_where_labels_agree": 0.9, + "n_ep_env_goal_but_meta_failure": 100, + "n_ep": 120, + "n_ep_success_meta": 20 + }, + "controls": { + "square_expert_play": { + "green_rate_target_pos": 0.9976611090785554, + "max_logit": 129.2616424560547, + "green_rate_target_neg": 0.011204661549914008, + "train_val_gap": 0.024104497710746076 + }, + "two_piece_expert_play": { + "green_rate_target_pos": 0.9883363443313999, + "max_logit": 234.32164001464844, + "green_rate_target_neg": 0.01432537857495699, + "train_val_gap": 0.10905319306563932 + } + }, + "cells_with_label_disagreement": [ + "square_sub_20100", + "two_piece_expert_suboptimal" + ], + "n_cells_anti_ordered": 0 + }, + "question": "does the reward head that outlines the trees fire on REAL success frames? If not, square_sub_20100's all-red rollouts (run 30) are the HEAD's doing, not the successor's", + "green_rule": "c = sigmoid(R(z)/T) >= 0.5 <=> R(z) >= 0 for T > 0 (rsm_scorer.py:351)", + "pos_threshold": 0.5, + "strict_threshold": 0.9, + "gates": { + "G1_positive_control": true, + "G2_temperature_positive": true, + "G3_goal_label_sane": false, + "note": "G1 failing VOIDS the run: the published trees contain green states" + }, + "cells": [ + { + "task": "square_expert_play", + "model": "L40", + "ckpt": "best", + "role": "published_control", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "step": 60000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 154446, + "n_ep": 424, + "n_ep_success": 200, + "sets": { + "all": { + "n": 154446, + "green_rate": 0.5000194242647916 + }, + "target_pos": { + "n": 76532, + "green_rate": 0.9976611090785554 + }, + "target_pos_strict": { + "n": 76532, + "green_rate": 0.9976611090785554 + }, + "target_neg": { + "n": 77914, + "green_rate": 0.011204661549914008 + }, + "env_goal": { + "n": 2211, + "green_rate": 1.0 + }, + "success_ep": { + "n": 76532, + "green_rate": 0.9976611090785554 + }, + "target_pos_train": { + "n": 69106, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 7426, + "green_rate": 0.9758955022892539 + }, + "env_goal_train": { + "n": 2001, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 210, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -221.4112548828125, + "0.01": -151.3333297729492, + "0.25": -48.047691345214844, + "0.5": 0.07872657477855682, + "0.75": 28.564026832580566, + "0.99": 60.171923828124974, + "0.999": 78.74097347259509, + "1.0": 129.2616424560547 + }, + "max_all": 129.2616424560547, + "max_target_pos": 129.2616424560547, + "max_env_goal": 60.3072395324707, + "min_all": -221.4112548828125, + "c_at_max_all": 1.0, + "n_green": 77226, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1518 + }, + "target_stats": { + "mean": 0.4955259443430066, + "n_pos": 76532, + "n_strict": 76532, + "n_env_goal": 2211 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 200, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 2211, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "two_piece_expert_play", + "model": "L40", + "ckpt": "best", + "role": "published_control", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "step": 30000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 121809, + "n_ep": 399, + "n_ep_success": 200, + "sets": { + "all": { + "n": 121809, + "green_rate": 0.5189025441469842 + }, + "target_pos": { + "n": 63102, + "green_rate": 0.9883363443313999 + }, + "target_pos_strict": { + "n": 63102, + "green_rate": 0.9883363443313999 + }, + "target_neg": { + "n": 58707, + "green_rate": 0.01432537857495699 + }, + "env_goal": { + "n": 43, + "green_rate": 1.0 + }, + "success_ep": { + "n": 63102, + "green_rate": 0.9883363443313999 + }, + "target_pos_train": { + "n": 56353, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 6749, + "green_rate": 0.8909468069343607 + }, + "env_goal_train": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -611.2372436523438, + "0.01": -450.88661010742186, + "0.25": -80.00428771972656, + "0.5": 12.943055152893066, + "0.75": 38.15717315673828, + "0.99": 134.87345703124998, + "0.999": 171.12369128417964, + "1.0": 234.32164001464844 + }, + "max_all": 234.32164001464844, + "max_target_pos": 234.32164001464844, + "max_env_goal": 69.91463470458984, + "min_all": -611.2372436523438, + "c_at_max_all": 1.0, + "n_green": 63207, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 12911 + }, + "target_stats": { + "mean": 0.5180405388764378, + "n_pos": 63102, + "n_strict": 63102, + "n_env_goal": 43 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 1, + "n_ep_success_meta": 200, + "n_ep_env_goal_but_meta_failure": 0, + "labels_agree": true, + "env_goal_in_success_ep": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_in_failure_ep": { + "n": 0, + "green_rate": null + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 1.0 + }, + { + "task": "square_sub_20100", + "model": "M", + "ckpt": "best", + "role": "degenerate_under_test", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/M/ckpt_best.pt", + "step": 100000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 39473, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 39473, + "green_rate": 0.0846654675347706 + }, + "target_pos": { + "n": 3725, + "green_rate": 0.8488590604026846 + }, + "target_pos_strict": { + "n": 3725, + "green_rate": 0.8488590604026846 + }, + "target_neg": { + "n": 35748, + "green_rate": 0.005035246727089627 + }, + "env_goal": { + "n": 483, + "green_rate": 0.15527950310559005 + }, + "success_ep": { + "n": 3725, + "green_rate": 0.8488590604026846 + }, + "target_pos_train": { + "n": 2908, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 817, + "green_rate": 0.3108935128518972 + }, + "env_goal_train": { + "n": 435, + "green_rate": 0.1471264367816092 + }, + "env_goal_val": { + "n": 48, + "green_rate": 0.22916666666666666 + } + }, + "logit": { + "q": { + "0.0": -98.51761627197266, + "0.01": -72.06173858642578, + "0.25": -44.19245147705078, + "0.5": -33.498817443847656, + "0.75": -23.226152420043945, + "0.99": 27.974528503417964, + "0.999": 35.96257638549796, + "1.0": 46.22023391723633 + }, + "max_all": 46.22023391723633, + "max_target_pos": 46.22023391723633, + "max_env_goal": 34.21127700805664, + "min_all": -98.51761627197266, + "c_at_max_all": 1.0, + "n_green": 3342, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 71 + }, + "target_stats": { + "mean": 0.09436830238390799, + "n_pos": 3725, + "n_strict": 3725, + "n_env_goal": 483 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 120, + "n_ep_success_meta": 20, + "n_ep_env_goal_but_meta_failure": 100, + "labels_agree": false, + "env_goal_in_success_ep": { + "n": 80, + "green_rate": 0.9 + }, + "env_goal_in_failure_ep": { + "n": 403, + "green_rate": 0.007444168734491315 + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": 0.9 + }, + { + "task": "two_piece_expert_suboptimal", + "model": "M", + "ckpt": "proghead", + "role": "unseen_family", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "step": 30000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 27859, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 27859, + "green_rate": 0.44075523170250186 + }, + "target_pos": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_pos_strict": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_neg": { + "n": 21328, + "green_rate": 0.4012565641410353 + }, + "env_goal": { + "n": 25, + "green_rate": 1.0 + }, + "success_ep": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_pos_train": { + "n": 5416, + "green_rate": 0.5659158050221565 + }, + "target_pos_val": { + "n": 1115, + "green_rate": 0.5883408071748879 + }, + "env_goal_train": { + "n": 25, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -12.365499496459961, + "0.01": -3.8188617610931397, + "0.25": -1.3340780138969421, + "0.5": -0.4242510497570038, + "0.75": 1.1736012697219849, + "0.99": 40.80726051330566, + "0.999": 48.75685725402826, + "1.0": 57.82029724121094 + }, + "max_all": 57.82029724121094, + "max_target_pos": 57.82029724121094, + "max_env_goal": 21.647140502929688, + "min_all": -12.365499496459961, + "c_at_max_all": 1.0, + "n_green": 12279, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1910 + }, + "target_stats": { + "mean": 0.23443052514447754, + "n_pos": 6531, + "n_strict": 6531, + "n_env_goal": 25 + }, + "label_audit": { + "why": "goal.npz = the environment replayed (env_success_replay); meta.npz ep_success = RISE's reward (PACK.json: rewards.max() > 0). The head trains on the latter.", + "n_ep_with_env_goal": 3, + "n_ep_success_meta": 20, + "n_ep_env_goal_but_meta_failure": 3, + "labels_agree": false, + "env_goal_in_success_ep": { + "n": 0, + "green_rate": null + }, + "env_goal_in_failure_ep": { + "n": 25, + "green_rate": 1.0 + } + }, + "verdict": "HEAD_FIRES_ON_SUCCESS", + "env_goal_recall_where_labels_agree": null + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_RECALL.json.prereg_only.bak b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_RECALL.json.prereg_only.bak new file mode 100644 index 0000000000000000000000000000000000000000..d50b334ea923d72944c41301b6858a7ec1dc5d2e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/HEAD_RECALL.json.prereg_only.bak @@ -0,0 +1,451 @@ +{ + "run": "gen_q#270 run 31 -- reward-head recall on real cached states", + "question": "does the reward head that outlines the trees fire on REAL success frames? If not, square_sub_20100's all-red rollouts (run 30) are the HEAD's doing, not the successor's", + "green_rule": "c = sigmoid(R(z)/T) >= 0.5 <=> R(z) >= 0 for T > 0 (rsm_scorer.py:351)", + "pos_threshold": 0.5, + "strict_threshold": 0.9, + "gates": { + "G1_positive_control": true, + "G2_temperature_positive": true, + "G3_goal_label_sane": false, + "note": "G1 failing VOIDS the run: the published trees contain green states" + }, + "cells": [ + { + "task": "square_expert_play", + "model": "L40", + "ckpt": "best", + "role": "published_control", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "step": 60000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 154446, + "n_ep": 424, + "n_ep_success": 200, + "sets": { + "all": { + "n": 154446, + "green_rate": 0.5000194242647916 + }, + "target_pos": { + "n": 76532, + "green_rate": 0.9976611090785554 + }, + "target_pos_strict": { + "n": 76532, + "green_rate": 0.9976611090785554 + }, + "target_neg": { + "n": 77914, + "green_rate": 0.011204661549914008 + }, + "env_goal": { + "n": 2211, + "green_rate": 1.0 + }, + "success_ep": { + "n": 76532, + "green_rate": 0.9976611090785554 + }, + "target_pos_train": { + "n": 69106, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 7426, + "green_rate": 0.9758955022892539 + }, + "env_goal_train": { + "n": 2001, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 210, + "green_rate": 1.0 + } + }, + "logit": { + "q": { + "0.0": -221.4112548828125, + "0.01": -151.3333297729492, + "0.25": -48.047691345214844, + "0.5": 0.07872657477855682, + "0.75": 28.564026832580566, + "0.99": 60.171923828124974, + "0.999": 78.74097347259509, + "1.0": 129.2616424560547 + }, + "max_all": 129.2616424560547, + "max_target_pos": 129.2616424560547, + "max_env_goal": 60.3072395324707, + "min_all": -221.4112548828125, + "c_at_max_all": 1.0, + "n_green": 77226, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1518 + }, + "target_stats": { + "mean": 0.4955259443430066, + "n_pos": 76532, + "n_strict": 76532, + "n_env_goal": 2211 + }, + "verdict": "HEAD_FIRES_ON_SUCCESS" + }, + { + "task": "two_piece_expert_play", + "model": "L40", + "ckpt": "best", + "role": "published_control", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "step": 30000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": true, + "n_frames": 121809, + "n_ep": 399, + "n_ep_success": 200, + "sets": { + "all": { + "n": 121809, + "green_rate": 0.5189025441469842 + }, + "target_pos": { + "n": 63102, + "green_rate": 0.9883363443313999 + }, + "target_pos_strict": { + "n": 63102, + "green_rate": 0.9883363443313999 + }, + "target_neg": { + "n": 58707, + "green_rate": 0.01432537857495699 + }, + "env_goal": { + "n": 43, + "green_rate": 1.0 + }, + "success_ep": { + "n": 63102, + "green_rate": 0.9883363443313999 + }, + "target_pos_train": { + "n": 56353, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 6749, + "green_rate": 0.8909468069343607 + }, + "env_goal_train": { + "n": 43, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -611.2372436523438, + "0.01": -450.88661010742186, + "0.25": -80.00428771972656, + "0.5": 12.943055152893066, + "0.75": 38.15717315673828, + "0.99": 134.87345703124998, + "0.999": 171.12369128417964, + "1.0": 234.32164001464844 + }, + "max_all": 234.32164001464844, + "max_target_pos": 234.32164001464844, + "max_env_goal": 69.91463470458984, + "min_all": -611.2372436523438, + "c_at_max_all": 1.0, + "n_green": 63207, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 12911 + }, + "target_stats": { + "mean": 0.5180405388764378, + "n_pos": 63102, + "n_strict": 63102, + "n_env_goal": 43 + }, + "verdict": "HEAD_FIRES_ON_SUCCESS" + }, + { + "task": "square_sub_20100", + "model": "M", + "ckpt": "best", + "role": "degenerate_under_test", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/M/ckpt_best.pt", + "step": 100000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 39473, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 39473, + "green_rate": 0.0846654675347706 + }, + "target_pos": { + "n": 3725, + "green_rate": 0.8488590604026846 + }, + "target_pos_strict": { + "n": 3725, + "green_rate": 0.8488590604026846 + }, + "target_neg": { + "n": 35748, + "green_rate": 0.005035246727089627 + }, + "env_goal": { + "n": 483, + "green_rate": 0.15527950310559005 + }, + "success_ep": { + "n": 3725, + "green_rate": 0.8488590604026846 + }, + "target_pos_train": { + "n": 2908, + "green_rate": 1.0 + }, + "target_pos_val": { + "n": 817, + "green_rate": 0.3108935128518972 + }, + "env_goal_train": { + "n": 435, + "green_rate": 0.1471264367816092 + }, + "env_goal_val": { + "n": 48, + "green_rate": 0.22916666666666666 + } + }, + "logit": { + "q": { + "0.0": -98.51761627197266, + "0.01": -72.06173858642578, + "0.25": -44.19245147705078, + "0.5": -33.498817443847656, + "0.75": -23.226152420043945, + "0.99": 27.974528503417964, + "0.999": 35.96257638549796, + "1.0": 46.22023391723633 + }, + "max_all": 46.22023391723633, + "max_target_pos": 46.22023391723633, + "max_env_goal": 34.21127700805664, + "min_all": -98.51761627197266, + "c_at_max_all": 1.0, + "n_green": 3342, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 71 + }, + "target_stats": { + "mean": 0.09436830238390799, + "n_pos": 3725, + "n_strict": 3725, + "n_env_goal": 483 + }, + "verdict": "HEAD_FIRES_ON_SUCCESS" + }, + { + "task": "two_piece_expert_suboptimal", + "model": "M", + "ckpt": "proghead", + "role": "unseen_family", + "ckpt_path": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "step": 30000, + "n_pr": 0, + "d_in": 1545, + "temperature": 1.0, + "green_rule": "c = sigmoid(R/T) >= 0.5 with T > 0 <=> R >= 0", + "reward_mode": "dense", + "success_gamma": 0.98, + "k_success": 10, + "seed": 0, + "val_frac": null, + "stratify_success": false, + "data_kwargs": { + "chunk": 8, + "k_success": 10, + "val_frac": 0.1, + "seed": 0, + "success_mask": "", + "subgoal_dir": "", + "reward_mode": "dense", + "success_gamma": 0.98, + "reward_npy": "", + "weight_npy": "", + "norm_pool": "all", + "stratify_success": false, + "in_ram": false, + "normalize": true, + "action_augment": 0.0 + }, + "data_notes": [], + "gate_G3_goal_inside_success_ep": false, + "n_frames": 27859, + "n_ep": 120, + "n_ep_success": 20, + "sets": { + "all": { + "n": 27859, + "green_rate": 0.44075523170250186 + }, + "target_pos": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_pos_strict": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_neg": { + "n": 21328, + "green_rate": 0.4012565641410353 + }, + "env_goal": { + "n": 25, + "green_rate": 1.0 + }, + "success_ep": { + "n": 6531, + "green_rate": 0.5697442964323993 + }, + "target_pos_train": { + "n": 5416, + "green_rate": 0.5659158050221565 + }, + "target_pos_val": { + "n": 1115, + "green_rate": 0.5883408071748879 + }, + "env_goal_train": { + "n": 25, + "green_rate": 1.0 + }, + "env_goal_val": { + "n": 0, + "green_rate": null + } + }, + "logit": { + "q": { + "0.0": -12.365499496459961, + "0.01": -3.8188617610931397, + "0.25": -1.3340780138969421, + "0.5": -0.4242510497570038, + "0.75": 1.1736012697219849, + "0.99": 40.80726051330566, + "0.999": 48.75685725402826, + "1.0": 57.82029724121094 + }, + "max_all": 57.82029724121094, + "max_target_pos": 57.82029724121094, + "max_env_goal": 21.647140502929688, + "min_all": -12.365499496459961, + "c_at_max_all": 1.0, + "n_green": 12279, + "rank_of_best_target_pos": 1, + "rank_of_best_env_goal": 1910 + }, + "target_stats": { + "mean": 0.23443052514447754, + "n_pos": 6531, + "n_strict": 6531, + "n_env_goal": 25 + }, + "verdict": "HEAD_FIRES_ON_SUCCESS" + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/LABEL_CENSUS.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/LABEL_CENSUS.json new file mode 100644 index 0000000000000000000000000000000000000000..1e7d64d97a538744c3654d4876cad69f0f2c6a96 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/LABEL_CENSUS.json @@ -0,0 +1,425 @@ +{ + "run": "gen_q#270 run 32 item 2 -- success-label census over the figure family", + "summary": { + "n_tasks": 10, + "n_measurable": 8, + "n_not_measurable": 2, + "not_measurable": [ + "mug_mgen", + "threading_mgen" + ], + "n_labels_agree": 1, + "tasks_labels_disagree": [ + "square_expert_suboptimal", + "square_sub_20100", + "two_piece_expert_suboptimal", + "two_piece_expert_play", + "two_piece_expert_play_tipping", + "mug_expert_suboptimal", + "threading_expert_play" + ], + "tasks_env_goal_in_every_episode": [ + "square_expert_suboptimal", + "square_sub_20100" + ], + "tasks_env_goal_not_subset_of_meta_success": [ + "square_expert_suboptimal", + "square_sub_20100", + "two_piece_expert_suboptimal" + ], + "worst_agreement": [ + "square_sub_20100", + 0.16666666666666666 + ], + "caption_rule": "the green outline is RISE's reward (meta.npz ep_success), NOT the simulator's replay (goal.npz env_success_replay); on the tasks listed in tasks_labels_disagree those are different claims and a caption must say which" + }, + "question": "per task, do goal.npz's environment-replay label and meta.npz's RISE-reward label -- the one the reward head trains on and the green outline means -- agree about which episodes succeed?", + "labels": { + "env": "cache//goal.npz:goal_at_state (label=env_success_replay)", + "rise": "cache//meta.npz:ep_success (PACK.json: rewards.max() > 0)" + }, + "gates": { + "G3_all_aligned": true + }, + "tasks": [ + { + "task": "square_expert_suboptimal", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_suboptimal", + "n_ep": 200, + "n_frames_meta": 54275, + "n_ep_success_meta": 100, + "meta_success_rate": 0.5, + "goal_label": "env_success_replay", + "gate_G3_aligned": true, + "n_frames_goal": 54275, + "n_ep_goal_file": 200, + "status": "ok", + "n_ep_with_env_goal": 200, + "env_goal_ep_rate": 1.0, + "n_ep_both": 100, + "n_ep_env_goal_but_meta_failure": 100, + "n_ep_meta_success_but_no_env_goal": 0, + "n_ep_neither": 0, + "ep_jaccard": 0.5, + "ep_agreement_rate": 0.5, + "labels_agree": false, + "env_goal_subset_of_meta_success": false, + "frames": { + "n_goal_at_state": 805, + "frac_goal_at_state": 0.014831874712114232, + "n_goal_in_meta_success_ep": 402, + "n_goal_in_meta_failure_ep": 403, + "n_frames_in_meta_success_ep": 18527, + "median_goal_frames_per_goal_ep": 4.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 1000, + "frac_true": 0.018424689083371717 + } + }, + "extra_frame_labels_absent": [ + "goal_envcrit", + "placed" + ] + }, + { + "task": "square_sub_20100", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/square_sub_20100", + "n_ep": 120, + "n_frames_meta": 39473, + "n_ep_success_meta": 20, + "meta_success_rate": 0.16666666666666666, + "goal_label": "env_success_replay", + "gate_G3_aligned": true, + "n_frames_goal": 39473, + "n_ep_goal_file": 120, + "status": "ok", + "n_ep_with_env_goal": 120, + "env_goal_ep_rate": 1.0, + "n_ep_both": 20, + "n_ep_env_goal_but_meta_failure": 100, + "n_ep_meta_success_but_no_env_goal": 0, + "n_ep_neither": 0, + "ep_jaccard": 0.16666666666666666, + "ep_agreement_rate": 0.16666666666666666, + "labels_agree": false, + "env_goal_subset_of_meta_success": false, + "frames": { + "n_goal_at_state": 483, + "frac_goal_at_state": 0.012236212094342969, + "n_goal_in_meta_success_ep": 80, + "n_goal_in_meta_failure_ep": 403, + "n_frames_in_meta_success_ep": 3725, + "median_goal_frames_per_goal_ep": 4.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 600, + "frac_true": 0.015200263471233502 + } + }, + "extra_frame_labels_absent": [ + "goal_envcrit", + "placed" + ] + }, + { + "task": "square_expert_play", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play", + "n_ep": 424, + "n_frames_meta": 154446, + "n_ep_success_meta": 200, + "meta_success_rate": 0.4716981132075472, + "goal_label": "env_success_replay", + "gate_G3_aligned": true, + "n_frames_goal": 154446, + "n_ep_goal_file": 424, + "status": "ok", + "n_ep_with_env_goal": 200, + "env_goal_ep_rate": 0.4716981132075472, + "n_ep_both": 200, + "n_ep_env_goal_but_meta_failure": 0, + "n_ep_meta_success_but_no_env_goal": 0, + "n_ep_neither": 224, + "ep_jaccard": 1.0, + "ep_agreement_rate": 1.0, + "labels_agree": true, + "env_goal_subset_of_meta_success": true, + "frames": { + "n_goal_at_state": 2211, + "frac_goal_at_state": 0.01431568315139272, + "n_goal_in_meta_success_ep": 2211, + "n_goal_in_meta_failure_ep": 0, + "n_frames_in_meta_success_ep": 76532, + "median_goal_frames_per_goal_ep": 11.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 2400, + "frac_true": 0.015539411833262112 + } + }, + "extra_frame_labels_absent": [ + "goal_envcrit", + "placed" + ] + }, + { + "task": "two_piece_expert_suboptimal", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_suboptimal", + "n_ep": 120, + "n_frames_meta": 27859, + "n_ep_success_meta": 20, + "meta_success_rate": 0.16666666666666666, + "goal_label": "placed_and_settle", + "gate_G3_aligned": true, + "n_frames_goal": 27859, + "n_ep_goal_file": 120, + "status": "ok", + "n_ep_with_env_goal": 3, + "env_goal_ep_rate": 0.025, + "n_ep_both": 0, + "n_ep_env_goal_but_meta_failure": 3, + "n_ep_meta_success_but_no_env_goal": 20, + "n_ep_neither": 97, + "ep_jaccard": 0.0, + "ep_agreement_rate": 0.8083333333333333, + "labels_agree": false, + "env_goal_subset_of_meta_success": false, + "frames": { + "n_goal_at_state": 25, + "frac_goal_at_state": 0.0008973760723644064, + "n_goal_in_meta_success_ep": 0, + "n_goal_in_meta_failure_ep": 25, + "n_frames_in_meta_success_ep": 6531, + "median_goal_frames_per_goal_ep": 2.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 2577, + "frac_true": 0.09250152553932302 + }, + "goal_envcrit": { + "present": true, + "n_true": 26, + "frac_true": 0.0009332711152589828 + }, + "placed": { + "present": true, + "n_true": 2740, + "frac_true": 0.09835241753113895 + } + }, + "extra_frame_labels_absent": [] + }, + { + "task": "two_piece_expert_play", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play", + "n_ep": 399, + "n_frames_meta": 121809, + "n_ep_success_meta": 200, + "meta_success_rate": 0.5012531328320802, + "goal_label": "placed_and_settle", + "gate_G3_aligned": true, + "n_frames_goal": 121809, + "n_ep_goal_file": 399, + "status": "ok", + "n_ep_with_env_goal": 1, + "env_goal_ep_rate": 0.002506265664160401, + "n_ep_both": 1, + "n_ep_env_goal_but_meta_failure": 0, + "n_ep_meta_success_but_no_env_goal": 199, + "n_ep_neither": 199, + "ep_jaccard": 0.005, + "ep_agreement_rate": 0.5012531328320802, + "labels_agree": false, + "env_goal_subset_of_meta_success": true, + "frames": { + "n_goal_at_state": 43, + "frac_goal_at_state": 0.0003530116822238094, + "n_goal_in_meta_success_ep": 43, + "n_goal_in_meta_failure_ep": 0, + "n_frames_in_meta_success_ep": 63102, + "median_goal_frames_per_goal_ep": 43.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 19128, + "frac_true": 0.15703273157155875 + }, + "goal_envcrit": { + "present": true, + "n_true": 44, + "frac_true": 0.0003612212562290143 + }, + "placed": { + "present": true, + "n_true": 19261, + "frac_true": 0.158124604914251 + } + }, + "extra_frame_labels_absent": [] + }, + { + "task": "two_piece_expert_play_tipping", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play_tipping", + "n_ep": 704, + "n_frames_meta": 189372, + "n_ep_success_meta": 200, + "meta_success_rate": 0.2840909090909091, + "goal_label": "placed_and_settle", + "gate_G3_aligned": true, + "n_frames_goal": 189372, + "n_ep_goal_file": 704, + "status": "ok", + "n_ep_with_env_goal": 1, + "env_goal_ep_rate": 0.0014204545454545455, + "n_ep_both": 1, + "n_ep_env_goal_but_meta_failure": 0, + "n_ep_meta_success_but_no_env_goal": 199, + "n_ep_neither": 504, + "ep_jaccard": 0.005, + "ep_agreement_rate": 0.7173295454545454, + "labels_agree": false, + "env_goal_subset_of_meta_success": true, + "frames": { + "n_goal_at_state": 43, + "frac_goal_at_state": 0.00022706630336058128, + "n_goal_in_meta_success_ep": 43, + "n_goal_in_meta_failure_ep": 0, + "n_frames_in_meta_success_ep": 63102, + "median_goal_frames_per_goal_ep": 43.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 19128, + "frac_true": 0.10100754071351625 + }, + "goal_envcrit": { + "present": true, + "n_true": 44, + "frac_true": 0.00023234691506664133 + }, + "placed": { + "present": true, + "n_true": 19128, + "frac_true": 0.10100754071351625 + } + }, + "extra_frame_labels_absent": [] + }, + { + "task": "mug_expert_suboptimal", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/mug_expert_suboptimal", + "n_ep": 120, + "n_frames_meta": 41739, + "n_ep_success_meta": 20, + "meta_success_rate": 0.16666666666666666, + "goal_label": "env_success_replay", + "gate_G3_aligned": true, + "n_frames_goal": 41739, + "n_ep_goal_file": 120, + "status": "ok", + "n_ep_with_env_goal": 14, + "env_goal_ep_rate": 0.11666666666666667, + "n_ep_both": 14, + "n_ep_env_goal_but_meta_failure": 0, + "n_ep_meta_success_but_no_env_goal": 6, + "n_ep_neither": 100, + "ep_jaccard": 0.7, + "ep_agreement_rate": 0.95, + "labels_agree": false, + "env_goal_subset_of_meta_success": true, + "frames": { + "n_goal_at_state": 18, + "frac_goal_at_state": 0.00043125134766046146, + "n_goal_in_meta_success_ep": 18, + "n_goal_in_meta_failure_ep": 0, + "n_frames_in_meta_success_ep": 6933, + "median_goal_frames_per_goal_ep": 1.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 38, + "frac_true": 0.0009104195117276408 + } + }, + "extra_frame_labels_absent": [ + "goal_envcrit", + "placed" + ] + }, + { + "task": "threading_expert_play", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/threading_expert_play", + "n_ep": 450, + "n_frames_meta": 114935, + "n_ep_success_meta": 250, + "meta_success_rate": 0.5555555555555556, + "goal_label": "env_success_replay", + "gate_G3_aligned": true, + "n_frames_goal": 114935, + "n_ep_goal_file": 450, + "status": "ok", + "n_ep_with_env_goal": 234, + "env_goal_ep_rate": 0.52, + "n_ep_both": 234, + "n_ep_env_goal_but_meta_failure": 0, + "n_ep_meta_success_but_no_env_goal": 16, + "n_ep_neither": 200, + "ep_jaccard": 0.936, + "ep_agreement_rate": 0.9644444444444444, + "labels_agree": false, + "env_goal_subset_of_meta_success": true, + "frames": { + "n_goal_at_state": 1284, + "frac_goal_at_state": 0.011171531735328664, + "n_goal_in_meta_success_ep": 1284, + "n_goal_in_meta_failure_ep": 0, + "n_frames_in_meta_success_ep": 55852, + "median_goal_frames_per_goal_ep": 5.0 + }, + "extra_frame_labels": { + "goal": { + "present": true, + "n_true": 1516, + "frac_true": 0.013190063949188672 + } + }, + "extra_frame_labels_absent": [ + "goal_envcrit", + "placed" + ] + }, + { + "task": "mug_mgen", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/mug_mgen", + "n_ep": 224, + "n_frames_meta": 74696, + "n_ep_success_meta": 124, + "meta_success_rate": 0.5535714285714286, + "status": "not_measurable", + "reason": "goal.npz missing -- no environment-replay label in this cache", + "labels_agree": null + }, + { + "task": "threading_mgen", + "cache": "/proj/dmfexp/zwhong/rsm_rise/cache/threading_mgen", + "n_ep": 450, + "n_frames_meta": 102949, + "n_ep_success_meta": 300, + "meta_success_rate": 0.6666666666666666, + "status": "not_measurable", + "reason": "goal.npz missing -- no environment-replay label in this cache", + "labels_agree": null + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/MANIFEST_WATCH.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/MANIFEST_WATCH.json new file mode 100644 index 0000000000000000000000000000000000000000..6fd2bd14522fabdb6f4485a9144f97582d0e2666 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/MANIFEST_WATCH.json @@ -0,0 +1,372 @@ +{ + "issue": "gen_q#270 run 35", + "committed_tex_notes": { + "published_fold": 12, + "curated": 3, + "total": 15 + }, + "when_utc": "2026-09-24T22:15:31Z", + "mechanism": "make_stitch_tex.py:caption() returns esc(name) when the figure has no manifest record, and dcp_note() is appended inside caption(), so a lost manifest record costs the whole caption and not only the Panel fidelity note.", + "curated_notes_constant": 3, + "clobbered_manifest_entries": { + "two_piece_expert_play": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain" + ], + "square_expert_play": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain" + ] + }, + "published_manifest_entries": { + "two_piece_expert_play": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16" + ], + "square_expert_play": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16" + ] + }, + "current_manifest_entries": { + "two_piece_expert_play": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain" + ], + "square_expert_play": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain" + ] + }, + "scenarios": { + "committed_tex (both manifests published)": { + "fold_notes": 12, + "total_notes": 15, + "n_bare_captions": 0, + "bare": [] + }, + "run34_rebuild (square clobbered, two_piece not yet)": { + "fold_notes": 6, + "total_notes": 9, + "n_bare_captions": 6, + "bare": [ + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16" + ] + }, + "run34_diagnostic (both clobbered)": { + "fold_notes": 0, + "total_notes": 3, + "n_bare_captions": 12, + "bare": [ + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16" + ] + }, + "run35_repaired (union on disk now)": { + "fold_notes": 12, + "total_notes": 15, + "n_bare_captions": 0, + "bare": [] + } + }, + "culprit_writes": [ + { + "log": "rr_pack4_chaintrace2.slot0.1904966.out", + "task": "square_expert_play", + "mtime": "2026-09-24T20:42:52Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + }, + { + "log": "rr_pack4_chaintrace2.slot1.1904966.out", + "task": "two_piece_expert_play", + "mtime": "2026-09-24T20:43:05Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + }, + { + "log": "rr_pack4_chaintrace2.slot2.1904966.out", + "task": "square_expert_play", + "mtime": "2026-09-24T20:42:52Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + }, + { + "log": "rr_pack4_chaintrace2.slot3.1904966.out", + "task": "two_piece_expert_play", + "mtime": "2026-09-24T20:43:05Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + } + ], + "builds": [ + { + "log": "rr_cpu_270pdf.1880610.out", + "tex_build_started": "Wed Sep 23 12:13:38 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf16.1890536.out", + "tex_build_started": "Thu Sep 24 03:21:45 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf19.1891680.out", + "tex_build_started": "Thu Sep 24 04:29:12 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf19b.1891698.out", + "tex_build_started": "Thu Sep 24 04:30:15 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf19d.1891791.out", + "tex_build_started": "Thu Sep 24 04:37:57 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270rise.1891170.out", + "tex_build_started": "Thu Sep 24 03:45:48 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270rise2.1891223.out", + "tex_build_started": "Thu Sep 24 03:50:13 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf23.1894745.out", + "tex_build_started": "Thu Sep 24 08:35:50 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf24.1895225.out", + "tex_build_started": "Thu Sep 24 09:16:49 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf24b.1895236.out", + "tex_build_started": "Thu Sep 24 09:18:10 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf25.1897070.out", + "tex_build_started": "Thu Sep 24 11:34:37 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf26.1897341.out", + "tex_build_started": "Thu Sep 24 12:11:59 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf26b.1897355.out", + "tex_build_started": "Thu Sep 24 12:13:26 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf27.1897642.out", + "tex_build_started": "Thu Sep 24 12:51:28 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf28.1898277.out", + "tex_build_started": "Thu Sep 24 01:35:27 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf29.1901201.out", + "tex_build_started": "Thu Sep 24 05:16:01 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf33b.1904448.out", + "tex_build_started": "Thu Sep 24 07:57:37 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf33c.1904480.out", + "tex_build_started": "Thu Sep 24 07:58:43 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf34.1905152.out", + "tex_build_started": "Thu Sep 24 08:41:29 PM UTC 2026", + "counts": "[pdf34] old fold=15 -> 15 ; old chain=12 -> 12 ; third task=13 ; total 41 -> 53 (old-only 40 -> 40)" + }, + { + "log": "rr_cpu_pdf34b.1905172.out", + "tex_build_started": "Thu Sep 24 08:43:01 PM UTC 2026", + "counts": "[pdf34] old fold=15 -> 15 ; old chain=12 -> 12 ; third task=12 ; total 53 -> 53 (old-only 41 -> 41)" + }, + { + "log": "rr_cpu_pdf35.1905842.out", + "tex_build_started": "Thu Sep 24 09:31:08 PM UTC 2026", + "counts": "[pdf35] old fold=15 chain=12 third=12 total=53 (old-only 41) notes=15" + }, + { + "log": "rr_cpu_pdf35b.1905847.out", + "tex_build_started": "Thu Sep 24 09:32:10 PM UTC 2026", + "counts": "[pdf35] old fold=15 chain=12 third=12 total=53 (old-only 41) notes=15" + }, + { + "log": "rr_cpu_pdf35c.1905900.out", + "tex_build_started": "Thu Sep 24 09:38:36 PM UTC 2026", + "counts": "[pdf35] old fold=15 chain=12 third=12 total=53 (old-only 41) notes=15" + }, + { + "log": "rr_cpu_run33b.1904438.out", + "tex_build_started": "Thu Sep 24 07:56:16 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf.1841871.out", + "tex_build_started": "Tue Sep 22 05:28:45 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf.1844416.out", + "tex_build_started": "Tue Sep 22 08:29:49 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf.1894075.out", + "tex_build_started": "Thu Sep 24 07:58:06 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf2.1843525.out", + "tex_build_started": "Tue Sep 22 07:19:04 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf20.1892954.out", + "tex_build_started": "Thu Sep 24 06:37:36 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21.1893265.out", + "tex_build_started": "Thu Sep 24 07:14:05 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21b.1893546.out", + "tex_build_started": "Thu Sep 24 07:18:22 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21c.1893560.out", + "tex_build_started": "Thu Sep 24 07:19:30 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21d.1893572.out", + "tex_build_started": "Thu Sep 24 07:20:37 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21e.1893577.out", + "tex_build_started": "Thu Sep 24 07:21:23 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf5.1846903.out", + "tex_build_started": "Tue Sep 22 10:48:24 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf6.1856663.out", + "tex_build_started": "Tue Sep 22 01:41:44 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf_v5.1855759.out", + "tex_build_started": "Tue Sep 22 12:38:15 PM UTC 2026", + "counts": null + } + ], + "live_records_not_intact": { + "two_piece_expert_play": [], + "square_expert_play": [] + }, + "unknown_clobber_writers": [], + "manifest_mtime_utc": { + "two_piece_expert_play": "2026-09-24T21:32:13Z", + "square_expert_play": "2026-09-24T21:32:13Z" + }, + "historical_verdicts": { + "reproduces_15": true, + "reproduces_9": true, + "reproduces_3": true, + "pinned_ref_is_pre_clobber": true, + "clobber_dropped_all_published": true, + "culprit_identified": true + }, + "live_verdicts": { + "live_published_records_intact": true, + "live_notes_15": true, + "live_no_bare_captions": true, + "live_no_unknown_clobber_writer": true + }, + "verdicts": { + "reproduces_15": true, + "reproduces_9": true, + "reproduces_3": true, + "pinned_ref_is_pre_clobber": true, + "clobber_dropped_all_published": true, + "culprit_identified": true, + "live_published_records_intact": true, + "live_notes_15": true, + "live_no_bare_captions": true, + "live_no_unknown_clobber_writer": true + }, + "ALL_OK": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/NPZ_INTEGRITY.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/NPZ_INTEGRITY.json new file mode 100644 index 0000000000000000000000000000000000000000..cf9ead754e084d3383bb4ec9df7fdec4873cbe75 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/NPZ_INTEGRITY.json @@ -0,0 +1,7 @@ +{ + "generated_by": "scripts/viz/verify_npz.py (gen_q#270 run 20)", + "n_checked": 335, + "n_corrupt": 0, + "corrupt": [], + "note": "Every array is fully decompressed: np.load alone reads only the zip directory and does not check the CRC, so a truncated/corrupt payload opens fine and fails at access time." +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/PUBLISHED_ROOTS_PIN.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/PUBLISHED_ROOTS_PIN.json new file mode 100644 index 0000000000000000000000000000000000000000..b36936b6c1250d7c669ccbdf0f5cd696759db77b --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/PUBLISHED_ROOTS_PIN.json @@ -0,0 +1,90 @@ +{ + "issue": "gen_q#270 run 36", + "what": "the root set each family of a shared capture manifest was MEASURED over", + "pinned_ref_published": "12ba1969", + "union_ref": "302c04e9", + "read_fields": [ + "name", + "cache_episode", + "frame", + "depth" + ], + "how_to_use": "an instrument that globs runs//stitchviz/MANIFEST_*.json and enumerates every entry should first intersect the names with families[][]; `_chain` is a suffix of TODAY's second family and is not a general rule", + "families": { + "two_piece_expert_play": { + "published_fold": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16" + ], + "chain_run33": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain" + ], + "on_disk_now": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain" + ], + "n_published": 6, + "n_on_disk": 12 + }, + "square_expert_play": { + "published_fold": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16" + ], + "chain_run33": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain" + ], + "on_disk_now": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain" + ], + "n_published": 6, + "n_on_disk": 12 + } + }, + "verdicts": { + "two_piece_expert_play_published_present_on_disk": true, + "two_piece_expert_play_no_read_field_drift": true, + "square_expert_play_published_present_on_disk": true, + "square_expert_play_no_read_field_drift": true + }, + "ALL_OK": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/READOUT_AUDIT.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/READOUT_AUDIT.json new file mode 100644 index 0000000000000000000000000000000000000000..ed82b536ef181c72eb6b53c40e57853881f4f5ee --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/READOUT_AUDIT.json @@ -0,0 +1,711 @@ +{ + "n_trees": 12, + "caps_measured": [ + 3, + 5, + 7 + ], + "headline_cap": 7, + "n_tiebreak_draws": 200, + "chain_constants": { + "0.95|0.99": { + "p": 0.8080808080808081, + "flagship_cap": 33, + "tail_mass_at_cap7": 0.2250005329250018 + } + }, + "GATE_fold_reproduced": true, + "GATE_max_fold_dev": 9.789544597182953e-08, + "GATE_max_sigmoid_dev": 8.750405433577413e-08, + "GATE_failures": [], + "M1_median_exact_ties_at_max": 1.0, + "M1_ties_per_tree": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "M1_n_trees_with_ties": 0, + "VERDICT_M1": "ARGMAX_UNIQUE", + "trees": [ + { + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 5.5772947038512655e-08, + "gate_fold_dev": 5.962458280578398e-09, + "gate_ok": true, + "Q_fold_max": 0.024722615256905556, + "Q_fold_min": 0.0, + "figure_argmax": 125, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.6733437576454622, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.0006886838198435486, + "Q_chain_min": 0.0, + "Q_chain_argmax": 62, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.7959119150460142, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.021151201949713015, + "Q_chain_min": 0.0, + "Q_chain_argmax": 67, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9872676707562718, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.013565680306012332, + "Q_chain_min": 0.0, + "Q_chain_argmax": 31, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 2.283457541704236e-12, + "gate_fold_dev": 2.2137255924380085e-13, + "gate_ok": true, + "Q_fold_max": 6.59219892895635e-07, + "Q_fold_min": 0.0, + "figure_argmax": 7, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 128, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.13554792560801143, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 3.085486687028484e-08, + "Q_chain_min": 0.0, + "Q_chain_argmax": 35, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": -0.008108726752503577, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 5.9377867375093765e-09, + "Q_chain_min": 0.0, + "Q_chain_argmax": 35, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9959427753934191, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 5.684050583500473e-07, + "Q_chain_min": 0.0, + "Q_chain_argmax": 7, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 7.410877866931287e-08, + "gate_fold_dev": 9.091860153631615e-09, + "gate_ok": true, + "Q_fold_max": 0.04654752463102341, + "Q_fold_min": 0.0, + "figure_argmax": 103, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.887635048525911, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.03309260173954566, + "Q_chain_min": 0.0, + "Q_chain_argmax": 84, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8749198864676799, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.006822210636927611, + "Q_chain_min": 0.0, + "Q_chain_argmax": 86, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9627643746566563, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.01762399677012227, + "Q_chain_min": 0.0, + "Q_chain_argmax": 103, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 6.836317123504188e-08, + "gate_fold_dev": 1.0205062683787958e-08, + "gate_ok": true, + "Q_fold_max": 0.06528710573911667, + "Q_fold_min": 1.1423076102801133e-05, + "figure_argmax": 16, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.5667631843984619, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.012407015459003813, + "Q_chain_min": 5.915392706835916e-11, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.5631924098150521, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.012263727754536336, + "Q_chain_min": 1.1055700740676582e-09, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9939457059146677, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.01226038138533537, + "Q_chain_min": 7.510516457433202e-06, + "Q_chain_argmax": 16, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 8.371305926235806e-08, + "gate_fold_dev": 9.789544597182953e-08, + "gate_ok": true, + "Q_fold_max": 0.6069021821022034, + "Q_fold_min": 6.543320023036412e-28, + "figure_argmax": 38, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.9925494414942319, + "top3_overlap": 0.666666666666668, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.41837074567501664, + "Q_chain_min": 1.2557885507442517e-28, + "Q_chain_argmax": 38, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9984091741439297, + "top3_overlap": 0.666666666666668, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.5092038466668576, + "Q_chain_min": 1.2557885507442517e-28, + "Q_chain_argmax": 104, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9950501281816517, + "top3_overlap": 0.666666666666668, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.5009062210752441, + "Q_chain_min": 1.2557885507442517e-28, + "Q_chain_argmax": 38, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 7.548646030475226e-08, + "gate_fold_dev": 3.108993174016916e-08, + "gate_ok": true, + "Q_fold_max": 0.2687058746814728, + "Q_fold_min": 2.9439463144088007e-25, + "figure_argmax": 104, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.9961602728438015, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.18471000752725403, + "Q_chain_min": 5.649998121790209e-26, + "Q_chain_argmax": 8, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9956338124885552, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.20284628571732402, + "Q_chain_min": 5.649998121790209e-26, + "Q_chain_argmax": 104, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9945236678264054, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.1722919237288784, + "Q_chain_min": 5.649998121790209e-26, + "Q_chain_argmax": 104, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 5.9413361896965e-08, + "gate_fold_dev": 6.3279291598328236e-09, + "gate_ok": true, + "Q_fold_max": 0.03459713235497475, + "Q_fold_min": 1.504642619706563e-22, + "figure_argmax": 110, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": -0.48955662882255996, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 7.410381304339728e-08, + "Q_chain_min": 1.8386764598797195e-26, + "Q_chain_argmax": 65, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.8733347830067754, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.018307701769178612, + "Q_chain_min": 2.887168614801599e-23, + "Q_chain_argmax": 110, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.381122962827321, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.010892065113391783, + "Q_chain_min": 2.887168614795099e-23, + "Q_chain_argmax": 60, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 8.401730966500764e-08, + "gate_fold_dev": 1.1401361452167968e-08, + "gate_ok": true, + "Q_fold_max": 0.08237418532371521, + "Q_fold_min": 0.019061341881752014, + "figure_argmax": 125, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.5392727980223402, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.062004643878639853, + "Q_chain_min": 0.0002643645817757413, + "Q_chain_argmax": 125, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.7964086247939938, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.027226838830018345, + "Q_chain_min": 0.00028122717088887016, + "Q_chain_argmax": 4, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.8823704449734481, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.033020601441471994, + "Q_chain_min": 0.01308556172397221, + "Q_chain_argmax": 125, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 8.750405433577413e-08, + "gate_fold_dev": 4.1021780666783414e-08, + "gate_ok": true, + "Q_fold_max": 0.23481276631355286, + "Q_fold_min": 4.3887592937608133e-07, + "figure_argmax": 100, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.5013619300494415, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.1317064869445478, + "Q_chain_min": 8.321678174062585e-08, + "Q_chain_argmax": 1, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.5869346273576268, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.09930892581386702, + "Q_chain_min": 8.321678138414176e-08, + "Q_chain_argmax": 92, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.49672106757004214, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.10076429992316208, + "Q_chain_min": 8.321678138413711e-08, + "Q_chain_argmax": 1, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 8.512559113160734e-08, + "gate_fold_dev": 5.3360379892453125e-08, + "gate_ok": true, + "Q_fold_max": 0.3141687214374542, + "Q_fold_min": 0.2211155742406845, + "figure_argmax": 94, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.8198647225782824, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.24002195758687767, + "Q_chain_min": 0.14338798340192313, + "Q_chain_argmax": 85, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": -0.03313266800952207, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.17305842344213948, + "Q_chain_min": 0.1119575764864445, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": -0.25048640358908625, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.18306509773223206, + "Q_chain_min": 0.11142906766111638, + "Q_chain_argmax": 18, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 6.038615732451014e-09, + "gate_fold_dev": 3.77197746648239e-09, + "gate_ok": true, + "Q_fold_max": 0.02326813153922558, + "Q_fold_min": 3.7732108921773033e-06, + "figure_argmax": 123, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.7630527833730086, + "top3_overlap": 0.333333333333334, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.004886325843911136, + "Q_chain_min": 8.597719471698201e-09, + "Q_chain_argmax": 70, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.849769959714338, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.01625690515664771, + "Q_chain_min": 1.8240708396544004e-08, + "Q_chain_argmax": 41, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.9998798297015199, + "top3_overlap": 1.0, + "top1_is_figure_argmax": 1.0, + "top1_in_fold_tied_set": 1.0, + "Q_chain_max": 0.00435845139980511, + "Q_chain_min": 6.816514837291048e-07, + "Q_chain_argmax": 123, + "n_exact_ties_at_max_chain": 1 + } + } + }, + { + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "depth": 8, + "n_cand": 128, + "particles": 16, + "score_kind": "prob", + "gate_sigmoid_dev": 8.533913520292202e-08, + "gate_fold_dev": 3.344503607394245e-08, + "gate_ok": true, + "Q_fold_max": 0.1695835292339325, + "Q_fold_min": 0.11163482069969177, + "figure_argmax": 2, + "n_exact_ties_at_max": 1, + "n_1e6_ties_at_max": 1, + "argmax_is_lowest_tied_index": true, + "chain": { + "3": { + "spearman_rho": 0.6371257553561619, + "top3_overlap": 0.0, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.06889021021589548, + "Q_chain_min": 0.03878207621182138, + "Q_chain_argmax": 28, + "n_exact_ties_at_max_chain": 1 + }, + "5": { + "spearman_rho": 0.9228735579564182, + "top3_overlap": 0.666666666666668, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.055014566191262784, + "Q_chain_min": 0.01629679440526037, + "Q_chain_argmax": 24, + "n_exact_ties_at_max_chain": 1 + }, + "7": { + "spearman_rho": 0.848848654092657, + "top3_overlap": 0.666666666666668, + "top1_is_figure_argmax": 0.0, + "top1_in_fold_tied_set": 0.0, + "Q_chain_max": 0.05303869103098919, + "Q_chain_min": 0.03004015331230444, + "Q_chain_argmax": 23, + "n_exact_ties_at_max_chain": 1 + } + } + } + ], + "M2_cap3": { + "median_spearman_rho": 0.6552347565008121, + "median_top3_overlap": 0.333333333333334, + "n_trees_top1_is_figure_argmax": 3.0, + "mean_top1_in_fold_tied_set": 0.25, + "VERDICT": "READOUT_REORDERS" + }, + "M2_cap5": { + "median_spearman_rho": 0.8230892922541659, + "median_top3_overlap": 0.500000000000001, + "n_trees_top1_is_figure_argmax": 3.0, + "mean_top1_in_fold_tied_set": 0.25, + "VERDICT": "READOUT_REORDERS" + }, + "M2_cap7": { + "median_spearman_rho": 0.975016022706464, + "median_top3_overlap": 0.666666666666668, + "n_trees_top1_is_figure_argmax": 7.0, + "mean_top1_in_fold_tied_set": 0.5833333333333334, + "VERDICT": "READOUT_PARTIAL" + }, + "VERDICT_M2": "READOUT_PARTIAL", + "VERDICT_M2_depth_stable": false +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/RUN35_REPAIR.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/RUN35_REPAIR.json new file mode 100644 index 0000000000000000000000000000000000000000..efff57c2cb001e8918eb0c51d9572ca2a637b9fb --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/RUN35_REPAIR.json @@ -0,0 +1,342 @@ +{ + "issue": "gen_q#270 run 35", + "committed_tex_notes": { + "published_fold": 12, + "curated": 3, + "total": 15 + }, + "when_utc": "2026-09-24T21:36:47Z", + "mechanism": "make_stitch_tex.py:caption() returns esc(name) when the figure has no manifest record, and dcp_note() is appended inside caption(), so a lost manifest record costs the whole caption and not only the Panel fidelity note.", + "curated_notes_constant": 3, + "clobbered_manifest_entries": { + "two_piece_expert_play": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain" + ], + "square_expert_play": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain" + ] + }, + "published_manifest_entries": { + "two_piece_expert_play": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16" + ], + "square_expert_play": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16" + ] + }, + "current_manifest_entries": { + "two_piece_expert_play": [ + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain" + ], + "square_expert_play": [ + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain" + ] + }, + "scenarios": { + "committed_tex (both manifests published)": { + "fold_notes": 12, + "total_notes": 15, + "n_bare_captions": 0, + "bare": [] + }, + "run34_rebuild (square clobbered, two_piece not yet)": { + "fold_notes": 6, + "total_notes": 9, + "n_bare_captions": 6, + "bare": [ + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16" + ] + }, + "run34_diagnostic (both clobbered)": { + "fold_notes": 0, + "total_notes": 3, + "n_bare_captions": 12, + "bare": [ + "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16" + ] + }, + "run35_repaired (union on disk now)": { + "fold_notes": 12, + "total_notes": 15, + "n_bare_captions": 0, + "bare": [] + } + }, + "culprit_writes": [ + { + "log": "rr_pack4_chaintrace2.slot0.1904966.out", + "task": "square_expert_play", + "mtime": "2026-09-24T20:42:52Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + }, + { + "log": "rr_pack4_chaintrace2.slot1.1904966.out", + "task": "two_piece_expert_play", + "mtime": "2026-09-24T20:43:05Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + }, + { + "log": "rr_pack4_chaintrace2.slot2.1904966.out", + "task": "square_expert_play", + "mtime": "2026-09-24T20:42:52Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + }, + { + "log": "rr_pack4_chaintrace2.slot3.1904966.out", + "task": "two_piece_expert_play", + "mtime": "2026-09-24T20:43:05Z", + "line": "[trace] wrote 6 traces -> /proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz manifest=/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json (6 entries, 0 carried over, merge=False)" + } + ], + "builds": [ + { + "log": "rr_cpu_270pdf.1880610.out", + "tex_build_started": "Wed Sep 23 12:13:38 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf16.1890536.out", + "tex_build_started": "Thu Sep 24 03:21:45 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf19.1891680.out", + "tex_build_started": "Thu Sep 24 04:29:12 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf19b.1891698.out", + "tex_build_started": "Thu Sep 24 04:30:15 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270pdf19d.1891791.out", + "tex_build_started": "Thu Sep 24 04:37:57 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270rise.1891170.out", + "tex_build_started": "Thu Sep 24 03:45:48 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_270rise2.1891223.out", + "tex_build_started": "Thu Sep 24 03:50:13 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf23.1894745.out", + "tex_build_started": "Thu Sep 24 08:35:50 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf24.1895225.out", + "tex_build_started": "Thu Sep 24 09:16:49 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf24b.1895236.out", + "tex_build_started": "Thu Sep 24 09:18:10 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf25.1897070.out", + "tex_build_started": "Thu Sep 24 11:34:37 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf26.1897341.out", + "tex_build_started": "Thu Sep 24 12:11:59 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf26b.1897355.out", + "tex_build_started": "Thu Sep 24 12:13:26 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf27.1897642.out", + "tex_build_started": "Thu Sep 24 12:51:28 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf28.1898277.out", + "tex_build_started": "Thu Sep 24 01:35:27 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf29.1901201.out", + "tex_build_started": "Thu Sep 24 05:16:01 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf33b.1904448.out", + "tex_build_started": "Thu Sep 24 07:57:37 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf33c.1904480.out", + "tex_build_started": "Thu Sep 24 07:58:43 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_pdf34.1905152.out", + "tex_build_started": "Thu Sep 24 08:41:29 PM UTC 2026", + "counts": "[pdf34] old fold=15 -> 15 ; old chain=12 -> 12 ; third task=13 ; total 41 -> 53 (old-only 40 -> 40)" + }, + { + "log": "rr_cpu_pdf34b.1905172.out", + "tex_build_started": "Thu Sep 24 08:43:01 PM UTC 2026", + "counts": "[pdf34] old fold=15 -> 15 ; old chain=12 -> 12 ; third task=12 ; total 53 -> 53 (old-only 41 -> 41)" + }, + { + "log": "rr_cpu_pdf35.1905842.out", + "tex_build_started": "Thu Sep 24 09:31:08 PM UTC 2026", + "counts": "[pdf35] old fold=15 chain=12 third=12 total=53 (old-only 41) notes=15" + }, + { + "log": "rr_cpu_pdf35b.1905847.out", + "tex_build_started": "Thu Sep 24 09:32:10 PM UTC 2026", + "counts": "[pdf35] old fold=15 chain=12 third=12 total=53 (old-only 41) notes=15" + }, + { + "log": "rr_cpu_run33b.1904438.out", + "tex_build_started": "Thu Sep 24 07:56:16 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf.1841871.out", + "tex_build_started": "Tue Sep 22 05:28:45 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf.1844416.out", + "tex_build_started": "Tue Sep 22 08:29:49 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf.1894075.out", + "tex_build_started": "Thu Sep 24 07:58:06 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf2.1843525.out", + "tex_build_started": "Tue Sep 22 07:19:04 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf20.1892954.out", + "tex_build_started": "Thu Sep 24 06:37:36 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21.1893265.out", + "tex_build_started": "Thu Sep 24 07:14:05 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21b.1893546.out", + "tex_build_started": "Thu Sep 24 07:18:22 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21c.1893560.out", + "tex_build_started": "Thu Sep 24 07:19:30 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21d.1893572.out", + "tex_build_started": "Thu Sep 24 07:20:37 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf21e.1893577.out", + "tex_build_started": "Thu Sep 24 07:21:23 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf5.1846903.out", + "tex_build_started": "Tue Sep 22 10:48:24 AM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf6.1856663.out", + "tex_build_started": "Tue Sep 22 01:41:44 PM UTC 2026", + "counts": null + }, + { + "log": "rr_cpu_stitchpdf_v5.1855759.out", + "tex_build_started": "Tue Sep 22 12:38:15 PM UTC 2026", + "counts": null + } + ], + "verdicts": { + "reproduces_15": true, + "reproduces_9": true, + "reproduces_3": true, + "repaired_is_15": true, + "repaired_no_bare": true, + "clobber_dropped_all_published": true, + "published_records_restored_exactly": true, + "culprit_identified": true + }, + "ALL_OK": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/RUN36_GATE.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/RUN36_GATE.json new file mode 100644 index 0000000000000000000000000000000000000000..5637fd8797250e987dfd992d7d58fb78629dfe27 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/RUN36_GATE.json @@ -0,0 +1,40 @@ +{ + "issue": "gen_q#270 run 36", + "checks": { + "T1_nocollide_byte_identical": { + "pass_": true, + "detail": "3 entries, sha 4f450b5ccea2" + }, + "T2_merge_keeps_records": { + "pass_": true, + "detail": "4 -> 4 entries, sentinel kept=True" + }, + "T3_clobber_still_loses": { + "pass_": true, + "detail": "4 -> 3 entries, sentinel dropped (this is what cost run 34 a day)" + }, + "T4_error_refuses_and_is_inert": { + "pass_": true, + "detail": "file unchanged, msg=True" + }, + "T5_shipped_curated_manifests_inert": { + "pass_": true, + "detail": "4 files, 0 changed" + }, + "T6_watchdog_clean": { + "pass_": true, + "detail": "rc=0 ALL_OK=True live={'live_published_records_intact': True, 'live_notes_15': True, 'live_no_bare_captions': True, 'live_no_unknown_clobber_writer': True}" + }, + "T7_run35_artifact_intact": { + "pass_": true, + "detail": "12686 B" + } + }, + "ALL_OK": true, + "watchdog": { + "live_published_records_intact": true, + "live_notes_15": true, + "live_no_bare_captions": true, + "live_no_unknown_clobber_writer": true + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/SPLIT_ROOT_RANK.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/SPLIT_ROOT_RANK.json new file mode 100644 index 0000000000000000000000000000000000000000..112d979824af07394c9d301da8ae5545f886ef7e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/SPLIT_ROOT_RANK.json @@ -0,0 +1,232 @@ +{ + "square_expert_play": { + "n_unique": 38, + "n_failure": 38, + "best_shipped": { + "episode": "demo_36", + "frame": 56, + "frac_green": 0.192138671875, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "argmax": 38, + "_score": 0.2332187584543135, + "_balance": 0.38427734375, + "_spread": 0.6069021821022034, + "proposer_seed": null, + "_where": "stitchviz" + }, + "top": [ + { + "episode": "demo_181", + "frame": 135, + "frac_green": 0.207275390625, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "argmax": 98, + "_score": 0.3523054621161464, + "_balance": 0.41455078125, + "_spread": 0.8498487472483719, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_seed0", + "_manifest": "runs/square_expert_play/stitchviz_seed0/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_36", + "frame": 56, + "frac_green": 0.192138671875, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "argmax": 38, + "_score": 0.2332187584543135, + "_balance": 0.38427734375, + "_spread": 0.6069021821022034, + "proposer_seed": null, + "_shipped": true, + "_where": "stitchviz", + "_manifest": "runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_172", + "frame": 38, + "frac_green": 0.12725830078125, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "argmax": 73, + "_score": 0.13253928318116337, + "_balance": 0.2545166015625, + "_spread": 0.5207490684988443, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed3/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_130", + "frame": 211, + "frac_green": 0.03399658203125, + "Q_min": 4.13153111699921e-34, + "Q_max": 0.7385082244873047, + "argmax": 105, + "_score": 0.05021351086907089, + "_balance": 0.0679931640625, + "_spread": 0.7385082244873047, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed4/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_148", + "frame": 138, + "frac_green": 0.01263427734375, + "Q_min": 2.990279247224162e-32, + "Q_max": 0.8641209602355957, + "argmax": 3, + "_score": 0.021835087740328163, + "_balance": 0.0252685546875, + "_spread": 0.8641209602355957, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_seed0_r1", + "_manifest": "runs/square_expert_play/stitchviz_seed0_r1/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_107", + "frame": 290, + "frac_green": 0.0478515625, + "Q_min": 2.0837727679255008e-23, + "Q_max": 0.22201324999332428, + "argmax": 105, + "_score": 0.021247361815767363, + "_balance": 0.095703125, + "_spread": 0.22201324999332428, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed2/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_84", + "frame": 390, + "frac_green": 0.0267333984375, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "argmax": 104, + "_score": 0.01436684242071351, + "_balance": 0.053466796875, + "_spread": 0.2687058746814728, + "proposer_seed": null, + "_shipped": true, + "_where": "stitchviz", + "_manifest": "runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_212", + "frame": 141, + "frac_green": 0.02972412109375, + "Q_min": 1.625280656695988e-23, + "Q_max": 0.23395879566669464, + "argmax": 81, + "_score": 0.013908439146689489, + "_balance": 0.0594482421875, + "_spread": 0.23395879566669464, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_seed0_r1", + "_manifest": "runs/square_expert_play/stitchviz_seed0_r1/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_192", + "frame": 270, + "frac_green": 0.01861572265625, + "Q_min": 3.1888100472772385e-17, + "Q_max": 0.23299244046211243, + "argmax": 105, + "_score": 0.00867464530529105, + "_balance": 0.0372314453125, + "_spread": 0.2329924404621124, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed3/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_146", + "frame": 123, + "frac_green": 0.037109375, + "Q_min": 3.3294840070600794e-22, + "Q_max": 0.09876222908496857, + "argmax": 11, + "_score": 0.007330009189900011, + "_balance": 0.07421875, + "_spread": 0.09876222908496857, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed3/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_7", + "frame": 458, + "frac_green": 0.017578125, + "Q_min": 0.0, + "Q_max": 0.191255584359169, + "argmax": 40, + "_score": 0.006723829137627035, + "_balance": 0.03515625, + "_spread": 0.191255584359169, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed1/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_106", + "frame": 193, + "frac_green": 0.015625, + "Q_min": 6.904510058310109e-13, + "Q_max": 0.1905251145362854, + "argmax": 3, + "_score": 0.005953909829237342, + "_balance": 0.03125, + "_spread": 0.19052511453559495, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed3/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_198", + "frame": 110, + "frac_green": 0.00811767578125, + "Q_min": 0.0, + "Q_max": 0.21355515718460083, + "argmax": 88, + "_score": 0.003467143054876942, + "_balance": 0.0162353515625, + "_spread": 0.21355515718460083, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_seed0", + "_manifest": "runs/square_expert_play/stitchviz_seed0/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + }, + { + "episode": "demo_80", + "frame": 292, + "frac_green": 0.0169677734375, + "Q_min": 2.317686131902974e-08, + "Q_max": 0.08157826960086823, + "argmax": 61, + "_score": 0.0027684024055021875, + "_balance": 0.033935546875, + "_spread": 0.0815782464240069, + "proposer_seed": 0, + "_shipped": false, + "_where": "stitchviz_scan", + "_manifest": "runs/square_expert_play/stitchviz_scan/seed1/MANIFEST_square_expert_play_L40best_b0.95_L8.json" + } + ], + "n_scan_better": 1 + } +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_AGREEMENT.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_AGREEMENT.json new file mode 100644 index 0000000000000000000000000000000000000000..b3ef6038534d13034cedc1d5704521ac9f235e1e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_AGREEMENT.json @@ -0,0 +1,391 @@ +{ + "purpose": "gen_q#270 run 26: does the CHOICE OF STATISTIC move the figure selection more than re-capturing does?", + "pre_registration": "status/SUCCESSOR_VIZ.md run 26 (written before any compute)", + "source_census": "runs/pixdec/CAND_GREEN_CENSUS_xdev.json", + "source_stability": "runs/pixdec/STAT_STABILITY.json", + "setting": "L40best_b0.95_L8_N128_P16", + "sign_convention": "top = highest value for every statistic (the convention run 19 selected under); a pair with Spearman rho <= -0.50 is flagged SIGN_FLIPPED and EXCLUDED from B rather than counted as disagreement", + "headline_is_same_capture": "B draws ONE capture per root and reads BOTH statistics off THAT capture, so only the statistic differs; the mean-based variant averages capture noise away, which INFLATES agreement, and is reported only as the infinite-capture limit", + "n_draws_in_census": 202, + "n_duplicate_traces_removed": 29, + "n_roots_with_replicates": 30, + "roots": [ + "square_expert_play::demo_10_t0079", + "square_expert_play::demo_126_t0123", + "square_expert_play::demo_13_t0048", + "square_expert_play::demo_148_t0138", + "square_expert_play::demo_150_t0125", + "square_expert_play::demo_151_t0194", + "square_expert_play::demo_164_t0093", + "square_expert_play::demo_181_t0135", + "square_expert_play::demo_198_t0110", + "square_expert_play::demo_202_t0096", + "square_expert_play::demo_212_t0141", + "square_expert_play::demo_36_t0056", + "square_expert_play::demo_54_t0122", + "square_expert_play::demo_73_t0114", + "square_expert_play::demo_88_t0144", + "two_piece_expert_play::demo_105_t0113", + "two_piece_expert_play::demo_117_t0077", + "two_piece_expert_play::demo_128_t0115", + "two_piece_expert_play::demo_136_t0154", + "two_piece_expert_play::demo_159_t0413", + "two_piece_expert_play::demo_165_t0157", + "two_piece_expert_play::demo_174_t0479", + "two_piece_expert_play::demo_185_t0256", + "two_piece_expert_play::demo_189_t0338", + "two_piece_expert_play::demo_18_t0096", + "two_piece_expert_play::demo_19_t0067", + "two_piece_expert_play::demo_38_t0067", + "two_piece_expert_play::demo_75_t0199", + "two_piece_expert_play::demo_80_t0025", + "two_piece_expert_play::demo_83_t0280" + ], + "chance_top3_overlap": 0.1, + "chance_top1_agreement": 0.03333333333333333, + "statistics_usable": [ + "cand_any_green", + "cand_all_green", + "frac_green", + "hop_rise", + "hop_green_last", + "top_cand_share", + "Q_max", + "Q_spread", + "argmax_is_green" + ], + "n_draws_per_pair": 2000, + "rng_seed": 0, + "statistics_dropped": { + "q_of_greenless": { + "n_captures_undefined": 26, + "n_roots_undefined": 10 + } + }, + "alignment": "values are indexed over ALL captures of a root with no per-statistic None filtering, so index j is THE SAME capture for both statistics of a pair; a statistic undefined on any capture is dropped (see statistics_dropped) rather than silently re-indexed", + "run25_STABLE_statistics": [ + "frac_green", + "hop_rise", + "hop_green_last", + "Q_max" + ], + "W_within_statistic_median_top3": 0.7621666666666762, + "W_components": { + "frac_green": 1.0, + "hop_rise": 0.7170000000000042, + "hop_green_last": 0.7621666666666762, + "Q_max": 0.7201666666666743 + }, + "B_between_statistic_median_top3_same_capture": 0.366833333333338, + "B_n_pairs": 6, + "B_pairs_sorted": [ + 0.0, + 0.33333333333333626, + 0.33333333333333626, + 0.366833333333338, + 0.370333333333339, + 0.7430000000000102 + ], + "gap_threshold": 0.1, + "pairs": { + "cand_any_green|cand_all_green": { + "same_capture_top3_overlap": 0.10316666666666721, + "same_capture_top1_agreement": 0.0295, + "mean_based_top3_overlap": 0.09999999999999998, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_any_green|frac_green": { + "same_capture_top3_overlap": 0.20583333333333087, + "same_capture_top1_agreement": 0.0875, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.7981712954955738, + "SIGN_FLIPPED": false + }, + "cand_any_green|hop_rise": { + "same_capture_top3_overlap": 0.17766666666666533, + "same_capture_top1_agreement": 0.0975, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.02319357774002226, + "SIGN_FLIPPED": false + }, + "cand_any_green|hop_green_last": { + "same_capture_top3_overlap": 0.28833333333333255, + "same_capture_top1_agreement": 0.04, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.7635047055360527, + "SIGN_FLIPPED": false + }, + "cand_any_green|top_cand_share": { + "same_capture_top3_overlap": 0.003999999999999998, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.20517395693096616, + "SIGN_FLIPPED": false + }, + "cand_any_green|Q_max": { + "same_capture_top3_overlap": 0.18083333333333185, + "same_capture_top1_agreement": 0.1745, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.555, + "spearman_rho_means": 0.6489201608470374, + "SIGN_FLIPPED": false + }, + "cand_any_green|Q_spread": { + "same_capture_top3_overlap": 0.13683333333333422, + "same_capture_top1_agreement": 0.0355, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6128319129729488, + "SIGN_FLIPPED": false + }, + "cand_any_green|argmax_is_green": { + "same_capture_top3_overlap": 0.118000000000001, + "same_capture_top1_agreement": 0.0435, + "mean_based_top3_overlap": 0.12166666666666659, + "mean_based_top1_agreement": 0.05, + "spearman_rho_means": 0.6974990904564048, + "SIGN_FLIPPED": false + }, + "cand_all_green|frac_green": { + "same_capture_top3_overlap": 0.09733333333333372, + "same_capture_top1_agreement": 0.031, + "mean_based_top3_overlap": 0.10499999999999997, + "mean_based_top1_agreement": 0.065, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|hop_rise": { + "same_capture_top3_overlap": 0.10250000000000048, + "same_capture_top1_agreement": 0.029, + "mean_based_top3_overlap": 0.09333333333333332, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|hop_green_last": { + "same_capture_top3_overlap": 0.10000000000000045, + "same_capture_top1_agreement": 0.0355, + "mean_based_top3_overlap": 0.09999999999999995, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|top_cand_share": { + "same_capture_top3_overlap": 0.09300000000000035, + "same_capture_top1_agreement": 0.026, + "mean_based_top3_overlap": 0.11666666666666659, + "mean_based_top1_agreement": 0.05, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|Q_max": { + "same_capture_top3_overlap": 0.10700000000000066, + "same_capture_top1_agreement": 0.035, + "mean_based_top3_overlap": 0.09499999999999999, + "mean_based_top1_agreement": 0.04, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|Q_spread": { + "same_capture_top3_overlap": 0.09983333333333388, + "same_capture_top1_agreement": 0.037, + "mean_based_top3_overlap": 0.09666666666666666, + "mean_based_top1_agreement": 0.015, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|argmax_is_green": { + "same_capture_top3_overlap": 0.10466666666666716, + "same_capture_top1_agreement": 0.031, + "mean_based_top3_overlap": 0.09500000000000001, + "mean_based_top1_agreement": 0.015, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "frac_green|hop_rise": { + "same_capture_top3_overlap": 0.33333333333333626, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.05819397993311035, + "SIGN_FLIPPED": false + }, + "frac_green|hop_green_last": { + "same_capture_top3_overlap": 0.7430000000000102, + "same_capture_top1_agreement": 0.574, + "mean_based_top3_overlap": 1.0, + "mean_based_top1_agreement": 1.0, + "spearman_rho_means": 0.8527702394856368, + "SIGN_FLIPPED": false + }, + "frac_green|top_cand_share": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.15808249721293197, + "SIGN_FLIPPED": false + }, + "frac_green|Q_max": { + "same_capture_top3_overlap": 0.366833333333338, + "same_capture_top1_agreement": 0.435, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.9013368617573457, + "SIGN_FLIPPED": false + }, + "frac_green|Q_spread": { + "same_capture_top3_overlap": 0.3385000000000024, + "same_capture_top1_agreement": 0.1245, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.8844103479215271, + "SIGN_FLIPPED": false + }, + "frac_green|argmax_is_green": { + "same_capture_top3_overlap": 0.11633333333333427, + "same_capture_top1_agreement": 0.0395, + "mean_based_top3_overlap": 0.11499999999999994, + "mean_based_top1_agreement": 0.05, + "spearman_rho_means": 0.6973435549230949, + "SIGN_FLIPPED": false + }, + "hop_rise|hop_green_last": { + "same_capture_top3_overlap": 0.33333333333333626, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.278816069386101, + "SIGN_FLIPPED": false + }, + "hop_rise|top_cand_share": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.1777034559643255, + "SIGN_FLIPPED": false + }, + "hop_rise|Q_max": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.2380847801380288, + "SIGN_FLIPPED": false + }, + "hop_rise|Q_spread": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.2639199854663837, + "SIGN_FLIPPED": false + }, + "hop_rise|argmax_is_green": { + "same_capture_top3_overlap": 0.1240000000000009, + "same_capture_top1_agreement": 0.036, + "mean_based_top3_overlap": 0.13666666666666655, + "mean_based_top1_agreement": 0.055, + "spearman_rho_means": 0.17090187901230222, + "SIGN_FLIPPED": false + }, + "hop_green_last|top_cand_share": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.15830134492811507, + "SIGN_FLIPPED": false + }, + "hop_green_last|Q_max": { + "same_capture_top3_overlap": 0.370333333333339, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6459010807611207, + "SIGN_FLIPPED": false + }, + "hop_green_last|Q_spread": { + "same_capture_top3_overlap": 0.33666666666666856, + "same_capture_top1_agreement": 0.0015, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6240136997394784, + "SIGN_FLIPPED": false + }, + "hop_green_last|argmax_is_green": { + "same_capture_top3_overlap": 0.12166666666666766, + "same_capture_top1_agreement": 0.0365, + "mean_based_top3_overlap": 0.11333333333333327, + "mean_based_top1_agreement": 0.04, + "spearman_rho_means": 0.6530065925208814, + "SIGN_FLIPPED": false + }, + "top_cand_share|Q_max": { + "same_capture_top3_overlap": 0.06499999999999966, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.03363031038432399, + "SIGN_FLIPPED": false + }, + "top_cand_share|Q_spread": { + "same_capture_top3_overlap": 0.06983333333333314, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.06436529603357373, + "SIGN_FLIPPED": false + }, + "top_cand_share|argmax_is_green": { + "same_capture_top3_overlap": 0.1176666666666676, + "same_capture_top1_agreement": 0.0375, + "mean_based_top3_overlap": 0.07500000000000004, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.33381768891188, + "SIGN_FLIPPED": false + }, + "Q_max|Q_spread": { + "same_capture_top3_overlap": 0.9158333333333397, + "same_capture_top1_agreement": 0.241, + "mean_based_top3_overlap": 1.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.9951056729699669, + "SIGN_FLIPPED": false + }, + "Q_max|argmax_is_green": { + "same_capture_top3_overlap": 0.12200000000000097, + "same_capture_top1_agreement": 0.0425, + "mean_based_top3_overlap": 0.13166666666666654, + "mean_based_top1_agreement": 0.035, + "spearman_rho_means": 0.6892284285623913, + "SIGN_FLIPPED": false + }, + "Q_spread|argmax_is_green": { + "same_capture_top3_overlap": 0.11616666666666753, + "same_capture_top1_agreement": 0.0395, + "mean_based_top3_overlap": 0.1299999999999999, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": 0.6892284285623913, + "SIGN_FLIPPED": false + } + }, + "VERDICT": "STATISTIC_CHOICE_DOMINATES", + "run25_item2_pair": "hop_green_last|Q_max", + "run25_item2": { + "same_capture_top3_overlap": 0.370333333333339, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6459010807611207, + "SIGN_FLIPPED": false + }, + "VERDICT_item2": "DIFFERENT_TOP1" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_AGREEMENT_v1_prealign.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_AGREEMENT_v1_prealign.json new file mode 100644 index 0000000000000000000000000000000000000000..18a33e83b7625ac7186d6c6d573375916e0e0512 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_AGREEMENT_v1_prealign.json @@ -0,0 +1,384 @@ +{ + "purpose": "gen_q#270 run 26: does the CHOICE OF STATISTIC move the figure selection more than re-capturing does?", + "pre_registration": "status/SUCCESSOR_VIZ.md run 26 (written before any compute)", + "source_census": "runs/pixdec/CAND_GREEN_CENSUS_xdev.json", + "source_stability": "runs/pixdec/STAT_STABILITY.json", + "setting": "L40best_b0.95_L8_N128_P16", + "sign_convention": "top = highest value for every statistic (the convention run 19 selected under); a pair with Spearman rho <= -0.50 is flagged SIGN_FLIPPED and EXCLUDED from B rather than counted as disagreement", + "headline_is_same_capture": "B draws ONE capture per root and reads BOTH statistics off THAT capture, so only the statistic differs; the mean-based variant averages capture noise away, which INFLATES agreement, and is reported only as the infinite-capture limit", + "n_draws_in_census": 202, + "n_duplicate_traces_removed": 29, + "n_roots_with_replicates": 30, + "roots": [ + "square_expert_play::demo_10_t0079", + "square_expert_play::demo_126_t0123", + "square_expert_play::demo_13_t0048", + "square_expert_play::demo_148_t0138", + "square_expert_play::demo_150_t0125", + "square_expert_play::demo_151_t0194", + "square_expert_play::demo_164_t0093", + "square_expert_play::demo_181_t0135", + "square_expert_play::demo_198_t0110", + "square_expert_play::demo_202_t0096", + "square_expert_play::demo_212_t0141", + "square_expert_play::demo_36_t0056", + "square_expert_play::demo_54_t0122", + "square_expert_play::demo_73_t0114", + "square_expert_play::demo_88_t0144", + "two_piece_expert_play::demo_105_t0113", + "two_piece_expert_play::demo_117_t0077", + "two_piece_expert_play::demo_128_t0115", + "two_piece_expert_play::demo_136_t0154", + "two_piece_expert_play::demo_159_t0413", + "two_piece_expert_play::demo_165_t0157", + "two_piece_expert_play::demo_174_t0479", + "two_piece_expert_play::demo_185_t0256", + "two_piece_expert_play::demo_189_t0338", + "two_piece_expert_play::demo_18_t0096", + "two_piece_expert_play::demo_19_t0067", + "two_piece_expert_play::demo_38_t0067", + "two_piece_expert_play::demo_75_t0199", + "two_piece_expert_play::demo_80_t0025", + "two_piece_expert_play::demo_83_t0280" + ], + "chance_top3_overlap": 0.1, + "chance_top1_agreement": 0.03333333333333333, + "statistics_usable": [ + "cand_any_green", + "cand_all_green", + "frac_green", + "hop_rise", + "hop_green_last", + "top_cand_share", + "Q_max", + "Q_spread", + "argmax_is_green" + ], + "n_draws_per_pair": 2000, + "rng_seed": 0, + "run25_STABLE_statistics": [ + "frac_green", + "hop_rise", + "hop_green_last", + "Q_max" + ], + "W_within_statistic_median_top3": 0.7621666666666762, + "W_components": { + "frac_green": 1.0, + "hop_rise": 0.7170000000000042, + "hop_green_last": 0.7621666666666762, + "Q_max": 0.7201666666666743 + }, + "B_between_statistic_median_top3_same_capture": 0.366833333333338, + "B_n_pairs": 6, + "B_pairs_sorted": [ + 0.0, + 0.33333333333333626, + 0.33333333333333626, + 0.366833333333338, + 0.370333333333339, + 0.7430000000000102 + ], + "gap_threshold": 0.1, + "pairs": { + "cand_any_green|cand_all_green": { + "same_capture_top3_overlap": 0.10316666666666721, + "same_capture_top1_agreement": 0.0295, + "mean_based_top3_overlap": 0.09999999999999998, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_any_green|frac_green": { + "same_capture_top3_overlap": 0.20583333333333087, + "same_capture_top1_agreement": 0.0875, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.7981712954955738, + "SIGN_FLIPPED": false + }, + "cand_any_green|hop_rise": { + "same_capture_top3_overlap": 0.17766666666666533, + "same_capture_top1_agreement": 0.0975, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.02319357774002226, + "SIGN_FLIPPED": false + }, + "cand_any_green|hop_green_last": { + "same_capture_top3_overlap": 0.28833333333333255, + "same_capture_top1_agreement": 0.04, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.7635047055360527, + "SIGN_FLIPPED": false + }, + "cand_any_green|top_cand_share": { + "same_capture_top3_overlap": 0.003999999999999998, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.20517395693096616, + "SIGN_FLIPPED": false + }, + "cand_any_green|Q_max": { + "same_capture_top3_overlap": 0.18083333333333185, + "same_capture_top1_agreement": 0.1745, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.555, + "spearman_rho_means": 0.6489201608470374, + "SIGN_FLIPPED": false + }, + "cand_any_green|Q_spread": { + "same_capture_top3_overlap": 0.13683333333333422, + "same_capture_top1_agreement": 0.0355, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6128319129729488, + "SIGN_FLIPPED": false + }, + "cand_any_green|argmax_is_green": { + "same_capture_top3_overlap": 0.118000000000001, + "same_capture_top1_agreement": 0.0435, + "mean_based_top3_overlap": 0.12166666666666659, + "mean_based_top1_agreement": 0.05, + "spearman_rho_means": 0.6974990904564048, + "SIGN_FLIPPED": false + }, + "cand_all_green|frac_green": { + "same_capture_top3_overlap": 0.09733333333333372, + "same_capture_top1_agreement": 0.031, + "mean_based_top3_overlap": 0.10499999999999997, + "mean_based_top1_agreement": 0.065, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|hop_rise": { + "same_capture_top3_overlap": 0.10250000000000048, + "same_capture_top1_agreement": 0.029, + "mean_based_top3_overlap": 0.09333333333333332, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|hop_green_last": { + "same_capture_top3_overlap": 0.10000000000000045, + "same_capture_top1_agreement": 0.0355, + "mean_based_top3_overlap": 0.09999999999999995, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|top_cand_share": { + "same_capture_top3_overlap": 0.09300000000000035, + "same_capture_top1_agreement": 0.026, + "mean_based_top3_overlap": 0.11666666666666659, + "mean_based_top1_agreement": 0.05, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|Q_max": { + "same_capture_top3_overlap": 0.10700000000000066, + "same_capture_top1_agreement": 0.035, + "mean_based_top3_overlap": 0.09499999999999999, + "mean_based_top1_agreement": 0.04, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|Q_spread": { + "same_capture_top3_overlap": 0.09983333333333388, + "same_capture_top1_agreement": 0.037, + "mean_based_top3_overlap": 0.09666666666666666, + "mean_based_top1_agreement": 0.015, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "cand_all_green|argmax_is_green": { + "same_capture_top3_overlap": 0.10466666666666716, + "same_capture_top1_agreement": 0.031, + "mean_based_top3_overlap": 0.09500000000000001, + "mean_based_top1_agreement": 0.015, + "spearman_rho_means": null, + "SIGN_FLIPPED": false + }, + "frac_green|hop_rise": { + "same_capture_top3_overlap": 0.33333333333333626, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.05819397993311035, + "SIGN_FLIPPED": false + }, + "frac_green|hop_green_last": { + "same_capture_top3_overlap": 0.7430000000000102, + "same_capture_top1_agreement": 0.574, + "mean_based_top3_overlap": 1.0, + "mean_based_top1_agreement": 1.0, + "spearman_rho_means": 0.8527702394856368, + "SIGN_FLIPPED": false + }, + "frac_green|top_cand_share": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.15808249721293197, + "SIGN_FLIPPED": false + }, + "frac_green|Q_max": { + "same_capture_top3_overlap": 0.366833333333338, + "same_capture_top1_agreement": 0.435, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.9013368617573457, + "SIGN_FLIPPED": false + }, + "frac_green|Q_spread": { + "same_capture_top3_overlap": 0.3385000000000024, + "same_capture_top1_agreement": 0.1245, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.8844103479215271, + "SIGN_FLIPPED": false + }, + "frac_green|argmax_is_green": { + "same_capture_top3_overlap": 0.11633333333333427, + "same_capture_top1_agreement": 0.0395, + "mean_based_top3_overlap": 0.11499999999999994, + "mean_based_top1_agreement": 0.05, + "spearman_rho_means": 0.6973435549230949, + "SIGN_FLIPPED": false + }, + "hop_rise|hop_green_last": { + "same_capture_top3_overlap": 0.33333333333333626, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.278816069386101, + "SIGN_FLIPPED": false + }, + "hop_rise|top_cand_share": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.1777034559643255, + "SIGN_FLIPPED": false + }, + "hop_rise|Q_max": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.2380847801380288, + "SIGN_FLIPPED": false + }, + "hop_rise|Q_spread": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.2639199854663837, + "SIGN_FLIPPED": false + }, + "hop_rise|argmax_is_green": { + "same_capture_top3_overlap": 0.1240000000000009, + "same_capture_top1_agreement": 0.036, + "mean_based_top3_overlap": 0.13666666666666655, + "mean_based_top1_agreement": 0.055, + "spearman_rho_means": 0.17090187901230222, + "SIGN_FLIPPED": false + }, + "hop_green_last|top_cand_share": { + "same_capture_top3_overlap": 0.0, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": -0.15830134492811507, + "SIGN_FLIPPED": false + }, + "hop_green_last|Q_max": { + "same_capture_top3_overlap": 0.370333333333339, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6459010807611207, + "SIGN_FLIPPED": false + }, + "hop_green_last|Q_spread": { + "same_capture_top3_overlap": 0.33666666666666856, + "same_capture_top1_agreement": 0.0015, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6240136997394784, + "SIGN_FLIPPED": false + }, + "hop_green_last|argmax_is_green": { + "same_capture_top3_overlap": 0.12166666666666766, + "same_capture_top1_agreement": 0.0365, + "mean_based_top3_overlap": 0.11333333333333327, + "mean_based_top1_agreement": 0.04, + "spearman_rho_means": 0.6530065925208814, + "SIGN_FLIPPED": false + }, + "top_cand_share|Q_max": { + "same_capture_top3_overlap": 0.06499999999999966, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.03363031038432399, + "SIGN_FLIPPED": false + }, + "top_cand_share|Q_spread": { + "same_capture_top3_overlap": 0.06983333333333314, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.06436529603357373, + "SIGN_FLIPPED": false + }, + "top_cand_share|argmax_is_green": { + "same_capture_top3_overlap": 0.1176666666666676, + "same_capture_top1_agreement": 0.0375, + "mean_based_top3_overlap": 0.07500000000000004, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.33381768891188, + "SIGN_FLIPPED": false + }, + "Q_max|Q_spread": { + "same_capture_top3_overlap": 0.9158333333333397, + "same_capture_top1_agreement": 0.241, + "mean_based_top3_overlap": 1.0, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.9951056729699669, + "SIGN_FLIPPED": false + }, + "Q_max|argmax_is_green": { + "same_capture_top3_overlap": 0.12200000000000097, + "same_capture_top1_agreement": 0.0425, + "mean_based_top3_overlap": 0.13166666666666654, + "mean_based_top1_agreement": 0.035, + "spearman_rho_means": 0.6892284285623913, + "SIGN_FLIPPED": false + }, + "Q_spread|argmax_is_green": { + "same_capture_top3_overlap": 0.11616666666666753, + "same_capture_top1_agreement": 0.0395, + "mean_based_top3_overlap": 0.1299999999999999, + "mean_based_top1_agreement": 0.03, + "spearman_rho_means": 0.6892284285623913, + "SIGN_FLIPPED": false + } + }, + "VERDICT": "STATISTIC_CHOICE_DOMINATES", + "run25_item2_pair": "hop_green_last|Q_max", + "run25_item2": { + "same_capture_top3_overlap": 0.370333333333339, + "same_capture_top1_agreement": 0.0, + "mean_based_top3_overlap": 0.333333333333334, + "mean_based_top1_agreement": 0.0, + "spearman_rho_means": 0.6459010807611207, + "SIGN_FLIPPED": false + }, + "VERDICT_item2": "DIFFERENT_TOP1" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_STABILITY.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_STABILITY.json new file mode 100644 index 0000000000000000000000000000000000000000..2f66a7b0f0f03bee6938de08d01f8099c7c78898 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_STABILITY.json @@ -0,0 +1,2365 @@ +{ + "purpose": "gen_q#270 run 25: is ANY figure-choice statistic stable under re-capture?", + "pre_registration": "status/SUCCESSOR_VIZ.md run 25 (written before any compute)", + "source_census": "runs/pixdec/CAND_GREEN_CENSUS_xdev.json", + "setting": "L40best_b0.95_L8_N128_P16", + "dedupe": "replicates deduped by md5 of the trace .npz (NOT dirname, NOT realpath): curated dirs are symlinks (curate_split_manifest.py:60) and seeded arms can be byte-identical; counting those would deflate within-root variance", + "n_draws_in_census": 202, + "n_draws_after_md5_dedup": 173, + "n_duplicate_traces_removed": 29, + "n_roots_total": 46, + "n_roots_with_replicates": 30, + "thresholds": { + "stable_icc": 0.75, + "stable_rho": 0.7, + "stable_top3": 0.67, + "unusable_icc": 0.4, + "unusable_rho": 0.35 + }, + "n_splits": 2000, + "rng_seed": 0, + "tie_break": "top-k overlap breaks ties independently at random in each replicate; a deterministic tie-break inflates a binary/constant statistic to a perfect score at the top when it cannot order those roots at all", + "top1_agreement_note": "reported diagnostic, NOT part of the frozen run-25 verdict rule", + "statistics": { + "cand_any_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9652112816848416, + "var_between_root": 0.14199726401523888, + "var_within_root": 0.00511794973088832, + "sd_between_root": 0.3768252433360043, + "sd_within_root": 0.0715398471544937, + "splithalf_spearman": 0.9179117120962652, + "top3_overlap": 0.32816666666666733, + "n_splits": 2000, + "top1_agreement": 0.107, + "n_distinct_values": 59, + "median_recapture_range": 0.0390625, + "max_recapture_range": 0.59375, + "between_root_mean_range": 1.0, + "noise_to_signal": 0.0390625, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.98046875, + "min": 0.9609375, + "max": 1.0, + "range": 0.0390625 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.951171875, + "min": 0.9296875, + "max": 0.96875, + "range": 0.0390625 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.634765625, + "min": 0.5, + "max": 0.7578125, + "range": 0.2578125 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.00390625, + "min": 0.0, + "max": 0.0078125, + "range": 0.0078125 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.787109375, + "min": 0.7265625, + "max": 0.828125, + "range": 0.1015625 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.958984375, + "min": 0.921875, + "max": 1.0, + "range": 0.078125 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.1494140625, + "min": 0.1328125, + "max": 0.1640625, + "range": 0.03125 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.96484375, + "min": 0.9453125, + "max": 0.984375, + "range": 0.0390625 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.5104166666666666, + "min": 0.40625, + "max": 0.7109375, + "range": 0.3046875 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.3763020833333333, + "min": 0.3203125, + "max": 0.4609375, + "range": 0.140625 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0146484375, + "min": 0.0, + "max": 0.0703125, + "range": 0.0703125 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.130859375, + "min": 0.0078125, + "max": 0.46875, + "range": 0.4609375 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.99609375, + "min": 0.984375, + "max": 1.0, + "range": 0.015625 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.94140625, + "min": 0.9296875, + "max": 0.96875, + "range": 0.0390625 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.939453125, + "min": 0.890625, + "max": 1.0, + "range": 0.109375 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.9947916666666666, + "min": 0.984375, + "max": 1.0, + "range": 0.015625 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.7197265625, + "min": 0.640625, + "max": 0.7890625, + "range": 0.1484375 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.998046875, + "min": 0.9921875, + "max": 1.0, + "range": 0.0078125 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.998046875, + "min": 0.9921875, + "max": 1.0, + "range": 0.0078125 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.78515625, + "min": 0.7109375, + "max": 0.8515625, + "range": 0.140625 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.7752403846153846, + "min": 0.6796875, + "max": 0.828125, + "range": 0.1484375 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.9114583333333334, + "min": 0.734375, + "max": 1.0, + "range": 0.265625 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.80078125, + "min": 0.7578125, + "max": 0.9140625, + "range": 0.15625 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.5677083333333334, + "min": 0.359375, + "max": 0.953125, + "range": 0.59375 + } + } + }, + "cand_all_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": null, + "var_between_root": 0.0, + "var_within_root": 0.0, + "sd_between_root": 0.0, + "sd_within_root": 0.0, + "splithalf_spearman": null, + "top3_overlap": 0.10083333333333394, + "n_splits": 2000, + "top1_agreement": 0.0295, + "n_distinct_values": 1, + "median_recapture_range": 0.0, + "max_recapture_range": 0.0, + "between_root_mean_range": 0.0, + "noise_to_signal": null, + "VERDICT": "NO_POWER", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + } + } + }, + "frac_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9936972456576838, + "var_between_root": 0.020177692237538642, + "var_within_root": 0.00012798167442226884, + "sd_between_root": 0.14204820392225537, + "sd_within_root": 0.01131289858622753, + "splithalf_spearman": 0.9828072687087683, + "top3_overlap": 1.0, + "n_splits": 2000, + "top1_agreement": 0.394, + "n_distinct_values": 124, + "median_recapture_range": 0.00732421875, + "max_recapture_range": 0.080322265625, + "between_root_mean_range": 0.57354736328125, + "noise_to_signal": 0.01277003298925189, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.57354736328125, + "min": 0.56298828125, + "max": 0.58099365234375, + "range": 0.01800537109375 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.3087005615234375, + "min": 0.29876708984375, + "max": 0.31689453125, + "range": 0.01812744140625 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.0185089111328125, + "min": 0.01263427734375, + "max": 0.02606201171875, + "range": 0.013427734375 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 3.0517578125e-05, + "min": 0.0, + "max": 6.103515625e-05, + "range": 6.103515625e-05 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.008087158203125, + "min": 0.006103515625, + "max": 0.013427734375, + "range": 0.00732421875 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.20599365234375, + "min": 0.19287109375, + "max": 0.21673583984375, + "range": 0.02386474609375 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.00643157958984375, + "min": 0.0042724609375, + "max": 0.00897216796875, + "range": 0.00469970703125 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.243804931640625, + "min": 0.23797607421875, + "max": 0.24835205078125, + "range": 0.0103759765625 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.025221082899305556, + "min": 0.0169677734375, + "max": 0.033447265625, + "range": 0.0164794921875 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.16896565755208334, + "min": 0.15557861328125, + "max": 0.192138671875, + "range": 0.03656005859375 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0001220703125, + "min": 0.0, + "max": 0.0006103515625, + "range": 0.0006103515625 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.001129150390625, + "min": 6.103515625e-05, + "max": 0.00408935546875, + "range": 0.0040283203125 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.0097503662109375, + "min": 0.00909423828125, + "max": 0.01068115234375, + "range": 0.0015869140625 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.008697509765625, + "min": 0.00836181640625, + "max": 0.00933837890625, + "range": 0.0009765625 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.01540374755859375, + "min": 0.01348876953125, + "max": 0.01702880859375, + "range": 0.0035400390625 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.14345296223958334, + "min": 0.1397705078125, + "max": 0.14874267578125, + "range": 0.00897216796875 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.02602386474609375, + "min": 0.02008056640625, + "max": 0.03082275390625, + "range": 0.0107421875 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.0868988037109375, + "min": 0.08221435546875, + "max": 0.092041015625, + "range": 0.00982666015625 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.162689208984375, + "min": 0.159912109375, + "max": 0.1641845703125, + "range": 0.0042724609375 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.012054443359375, + "min": 0.0108642578125, + "max": 0.01263427734375, + "range": 0.00177001953125 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.1013934795673077, + "min": 0.082275390625, + "max": 0.13232421875, + "range": 0.050048828125 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.052937825520833336, + "min": 0.01129150390625, + "max": 0.0738525390625, + "range": 0.06256103515625 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.00891876220703125, + "min": 0.00616455078125, + "max": 0.0101318359375, + "range": 0.00396728515625 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.572967529296875, + "min": 0.56170654296875, + "max": 0.58343505859375, + "range": 0.021728515625 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.22607421875, + "min": 0.1795654296875, + "max": 0.2598876953125, + "range": 0.080322265625 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.00726318359375, + "min": 0.0067138671875, + "max": 0.00830078125, + "range": 0.0015869140625 + } + } + }, + "hop_rise": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9742886265410776, + "var_between_root": 0.010347912782944542, + "var_within_root": 0.0002730803201790493, + "sd_between_root": 0.10172469111746932, + "sd_within_root": 0.01652514206229554, + "splithalf_spearman": 0.916538089437689, + "top3_overlap": 0.7170000000000042, + "n_splits": 2000, + "top1_agreement": 0.3585, + "n_distinct_values": 115, + "median_recapture_range": 0.007568359375, + "max_recapture_range": 0.114501953125, + "between_root_mean_range": 0.444427490234375, + "noise_to_signal": 0.017029458216026916, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": -0.05230712890625, + "min": -0.0567626953125, + "max": -0.0491943359375, + "range": 0.007568359375 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.143646240234375, + "min": 0.1392822265625, + "max": 0.147216796875, + "range": 0.0079345703125 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": -0.033843994140625, + "min": -0.0516357421875, + "max": -0.0220947265625, + "range": 0.029541015625 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": -6.103515625e-05, + "min": -0.0001220703125, + "max": 0.0, + "range": 0.0001220703125 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.01617431640625, + "min": 0.01220703125, + "max": 0.02685546875, + "range": 0.0146484375 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": -0.30078125, + "min": -0.3211669921875, + "max": -0.284912109375, + "range": 0.0362548828125 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.0086212158203125, + "min": 0.00537109375, + "max": 0.0111083984375, + "range": 0.0057373046875 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": -0.12957763671875, + "min": -0.1318359375, + "max": -0.125732421875, + "range": 0.006103515625 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.031019422743055556, + "min": 0.0262451171875, + "max": 0.0361328125, + "range": 0.0098876953125 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.1324462890625, + "min": 0.08935546875, + "max": 0.16748046875, + "range": 0.078125 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.000244140625, + "min": 0.0, + "max": 0.001220703125, + "range": 0.001220703125 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.00225830078125, + "min": 0.0001220703125, + "max": 0.0081787109375, + "range": 0.008056640625 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.015716552734375, + "min": 0.01513671875, + "max": 0.0164794921875, + "range": 0.0013427734375 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.017333984375, + "min": 0.0164794921875, + "max": 0.0186767578125, + "range": 0.002197265625 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": -0.0225677490234375, + "min": -0.0296630859375, + "max": -0.0050048828125, + "range": 0.024658203125 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": -0.0284423828125, + "min": -0.06005859375, + "max": 0.0262451171875, + "range": 0.0863037109375 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.0096282958984375, + "min": 0.0062255859375, + "max": 0.0147705078125, + "range": 0.008544921875 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": -0.027496337890625, + "min": -0.0299072265625, + "max": -0.0224609375, + "range": 0.0074462890625 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.10150146484375, + "min": 0.09814453125, + "max": 0.10546875, + "range": 0.00732421875 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.020263671875, + "min": 0.01708984375, + "max": 0.0223388671875, + "range": 0.0052490234375 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": -0.09801307091346154, + "min": -0.122802734375, + "max": -0.0743408203125, + "range": 0.0484619140625 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.06901041666666667, + "min": 0.0084228515625, + "max": 0.0994873046875, + "range": 0.091064453125 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.0135345458984375, + "min": 0.0106201171875, + "max": 0.0157470703125, + "range": 0.005126953125 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": -0.2845458984375, + "min": -0.291015625, + "max": -0.279541015625, + "range": 0.011474609375 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.130126953125, + "min": 0.0625, + "max": 0.177001953125, + "range": 0.114501953125 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.0118408203125, + "min": 0.010009765625, + "max": 0.014892578125, + "range": 0.0048828125 + } + } + }, + "hop_green_last": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9645498846749956, + "var_between_root": 0.0104714221572696, + "var_within_root": 0.00038485632416730096, + "sd_between_root": 0.10232996705398473, + "sd_within_root": 0.01961775532947898, + "splithalf_spearman": 0.9484511142802848, + "top3_overlap": 0.7621666666666762, + "n_splits": 2000, + "top1_agreement": 1.0, + "n_distinct_values": 100, + "median_recapture_range": 0.01171875, + "max_recapture_range": 0.15771484375, + "between_root_mean_range": 0.3870849609375, + "noise_to_signal": 0.030274361400189215, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.3870849609375, + "min": 0.3779296875, + "max": 0.39501953125, + "range": 0.01708984375 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.2462158203125, + "min": 0.236328125, + "max": 0.2509765625, + "range": 0.0146484375 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.0113525390625, + "min": 0.0, + "max": 0.04541015625, + "range": 0.04541015625 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.0281982421875, + "min": 0.02294921875, + "max": 0.0341796875, + "range": 0.01123046875 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.0142822265625, + "min": 0.00927734375, + "max": 0.01904296875, + "range": 0.009765625 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.16552734375, + "min": 0.162109375, + "max": 0.16943359375, + "range": 0.00732421875 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.04079861111111111, + "min": 0.03466796875, + "max": 0.048828125, + "range": 0.01416015625 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.22867838541666666, + "min": 0.142578125, + "max": 0.30029296875, + "range": 0.15771484375 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0006103515625, + "min": 0.0, + "max": 0.00341796875, + "range": 0.00341796875 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.00439453125, + "min": 0.0, + "max": 0.017578125, + "range": 0.017578125 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.0643310546875, + "min": 0.0634765625, + "max": 0.0654296875, + "range": 0.001953125 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.0455322265625, + "min": 0.0390625, + "max": 0.0498046875, + "range": 0.0107421875 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.00030517578125, + "min": 0.0, + "max": 0.00146484375, + "range": 0.00146484375 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.07763671875, + "min": 0.05322265625, + "max": 0.11328125, + "range": 0.06005859375 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.01934814453125, + "min": 0.00927734375, + "max": 0.02587890625, + "range": 0.0166015625 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.016357421875, + "min": 0.01513671875, + "max": 0.0185546875, + "range": 0.00341796875 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.21484375, + "min": 0.2080078125, + "max": 0.2197265625, + "range": 0.01171875 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.0614013671875, + "min": 0.0517578125, + "max": 0.06689453125, + "range": 0.01513671875 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.027080829326923076, + "min": 0.0107421875, + "max": 0.05419921875, + "range": 0.04345703125 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.11767578125, + "min": 0.0400390625, + "max": 0.158203125, + "range": 0.1181640625 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.03973388671875, + "min": 0.03271484375, + "max": 0.056640625, + "range": 0.02392578125 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.3455810546875, + "min": 0.3349609375, + "max": 0.3564453125, + "range": 0.021484375 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.23447265625, + "min": 0.16796875, + "max": 0.2802734375, + "range": 0.1123046875 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.00732421875, + "min": 0.0009765625, + "max": 0.01220703125, + "range": 0.01123046875 + } + } + }, + "top_cand_share": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.42985099820177636, + "var_between_root": 0.009357431576570955, + "var_within_root": 0.012411580513005449, + "sd_between_root": 0.09673381816392318, + "sd_within_root": 0.11140727316026297, + "splithalf_spearman": 0.7655269016479529, + "top3_overlap": 0.5698333333333325, + "n_splits": 2000, + "top1_agreement": 0.263, + "n_distinct_values": 128, + "median_recapture_range": 0.007625272331154686, + "max_recapture_range": 1.0, + "between_root_mean_range": 0.5, + "noise_to_signal": 0.015250544662309372, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.009341039060697146, + "min": 0.008929509402248135, + "max": 0.009865568083261058, + "range": 0.0009360586810129232 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.012332747276608765, + "min": 0.009185303514376996, + "max": 0.014213395638629283, + "range": 0.005028092124252287 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.06154298834476533, + "min": 0.04240282685512368, + "max": 0.0966183574879227, + "range": 0.054215530632799026 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.5, + "min": 0.0, + "max": 1.0, + "range": 1.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.011807791265338435, + "min": 0.009433962264150943, + "max": 0.01818181818181818, + "range": 0.008747855917667238 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.010302910813096986, + "min": 0.009856378484933821, + "max": 0.010759299108515216, + "range": 0.0009029206235813946 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.22935908172758118, + "min": 0.17293233082706766, + "max": 0.3142857142857143, + "range": 0.14135338345864662 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.009575675689764003, + "min": 0.00893743793445879, + "max": 0.01054746358613762, + "range": 0.00161002565167883 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.03706614379718631, + "min": 0.025547445255474453, + "max": 0.0683453237410072, + "range": 0.04279787848553275 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.027714502088167278, + "min": 0.02255400254129606, + "max": 0.03216947822675559, + "range": 0.009615475685459528 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.04583333333333334, + "min": 0.0, + "max": 0.2, + "range": 0.2 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.42412935323383083, + "min": 0.029850746268656716, + "max": 1.0, + "range": 0.9701492537313433 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.02191342010331351, + "min": 0.018518518518518517, + "max": 0.026143790849673203, + "range": 0.007625272331154686 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.021090699053343966, + "min": 0.0196078431372549, + "max": 0.021897810218978103, + "range": 0.0022899670817232015 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.026063885936147644, + "min": 0.01532567049808429, + "max": 0.05394190871369295, + "range": 0.03861623821560866 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.01400416579163437, + "min": 0.012908777969018933, + "max": 0.01600328272466147, + "range": 0.0030945047556425378 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.020246745381014224, + "min": 0.01782178217821782, + "max": 0.028985507246376812, + "range": 0.011163725068158992 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.014412070236902523, + "min": 0.013370865587614356, + "max": 0.015503875968992248, + "range": 0.0021330103813778922 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.009379856718435829, + "min": 0.008945210585165859, + "max": 0.009665427509293681, + "range": 0.0007202169241278221 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.026620627377833044, + "min": 0.024154589371980676, + "max": 0.028985507246376812, + "range": 0.004830917874396136 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.02558005495324274, + "min": 0.021217712177121772, + "max": 0.029753265602322207, + "range": 0.008535553425200435 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.016732093586804744, + "min": 0.011570247933884297, + "max": 0.02702702702702703, + "range": 0.015456779093142732 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.02427550711214666, + "min": 0.01639344262295082, + "max": 0.031446540880503145, + "range": 0.015053098257552324 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.010443024715311895, + "min": 0.010147504969139031, + "max": 0.010679611650485437, + "range": 0.0005321066813464056 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.011717517538811593, + "min": 0.00984630163304515, + "max": 0.014795678722404886, + "range": 0.004949377089359736 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.05038099596923126, + "min": 0.036036036036036036, + "max": 0.06363636363636363, + "range": 0.027600327600327594 + } + } + }, + "Q_max": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9782968120512602, + "var_between_root": 0.11773746466379795, + "var_within_root": 0.0026119663201689216, + "sd_between_root": 0.34312893300303016, + "sd_within_root": 0.051107399857250824, + "splithalf_spearman": 0.9812184649610675, + "top3_overlap": 0.7201666666666743, + "n_splits": 2000, + "top1_agreement": 1.0, + "n_distinct_values": 155, + "median_recapture_range": 0.024671277031302452, + "max_recapture_range": 0.3883375823497772, + "between_root_mean_range": 0.9998947083893739, + "noise_to_signal": 0.024673874983339835, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.846352756023407, + "min": 0.840471625328064, + "max": 0.8547662496566772, + "range": 0.014294624328613281 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 1.4686004372571615e-05, + "min": 3.0989066868158943e-10, + "max": 3.9729482523398474e-05, + "range": 3.972917263272979e-05 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.5859186872839928, + "min": 0.4813844859600067, + "max": 0.6342390775680542, + "range": 0.15285459160804749 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.7422260046005249, + "min": 0.5709527730941772, + "max": 0.9360631704330444, + "range": 0.3651103973388672 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 8.308348719079928e-08, + "min": 1.5156671751004325e-10, + "max": 3.3098228868766455e-07, + "range": 3.308307219701545e-07 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.019098224816843867, + "min": 0.010140572674572468, + "max": 0.02520841546356678, + "range": 0.015067842788994312 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.024870118591934443, + "min": 0.018702151253819466, + "max": 0.04337342828512192, + "range": 0.024671277031302452 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.8584511801600456, + "min": 0.849848747253418, + "max": 0.8822919726371765, + "range": 0.032443225383758545 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.2234203051775694, + "min": 0.1415252387523651, + "max": 0.31185004115104675, + "range": 0.17032480239868164 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.5551495403051376, + "min": 0.5490685701370239, + "max": 0.5601746439933777, + "range": 0.01110607385635376 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.1758943067656623, + "min": 0.13475771248340607, + "max": 0.23395879566669464, + "range": 0.09920108318328857 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.6404770712057749, + "min": 0.6069021821022034, + "max": 0.6839041709899902, + "range": 0.07700198888778687 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.005930419801643438, + "min": 5.019014861318283e-05, + "max": 0.01727997325360775, + "range": 0.017229783104994567 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 5.630382878679674e-12, + "min": 3.785088995705843e-12, + "max": 8.053687057529846e-12, + "range": 4.268598061824003e-12 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.017888539470732212, + "min": 0.010041126981377602, + "max": 0.021921638399362564, + "range": 0.011880511417984962 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.05520513840019703, + "min": 0.05053364112973213, + "max": 0.061455462127923965, + "range": 0.010921820998191833 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.04541134089231491, + "min": 0.04317096248269081, + "max": 0.04626983404159546, + "range": 0.003098871558904648 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.19939273037016392, + "min": 0.09216669201850891, + "max": 0.48050427436828613, + "range": 0.3883375823497772 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.48161692420641583, + "min": 0.4584195613861084, + "max": 0.5130337476730347, + "range": 0.05461418628692627 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.14919232204556465, + "min": 0.12913301587104797, + "max": 0.1604074239730835, + "range": 0.03127440810203552 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.30890022963285446, + "min": 0.2951880693435669, + "max": 0.3364698886871338, + "range": 0.041281819343566895 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.2649051547050476, + "min": 0.2593776285648346, + "max": 0.27829867601394653, + "range": 0.01892104744911194 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.05607725027948618, + "min": 0.05342011898756027, + "max": 0.0576312318444252, + "range": 0.004211112856864929 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 2.6712715511800766e-08, + "min": 3.4102917711997804e-10, + "max": 7.936003498798527e-08, + "range": 7.90190058108653e-08 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.9211514867269076, + "min": 0.8403615355491638, + "max": 0.9908179044723511, + "range": 0.15045636892318726 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.13749495645364126, + "min": 0.08670267462730408, + "max": 0.16389822959899902, + "range": 0.07719555497169495 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.06951639545150101, + "min": 0.026393426582217216, + "max": 0.09887169301509857, + "range": 0.07247826643288136 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.9998947083950043, + "min": 0.99985271692276, + "max": 0.9999346733093262, + "range": 8.195638656616211e-05 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.5691008329391479, + "min": 0.4422576427459717, + "max": 0.7106689810752869, + "range": 0.2684113383293152 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.08286350965499878, + "min": 0.07263443619012833, + "max": 0.09659223258495331, + "range": 0.02395779639482498 + } + } + }, + "Q_spread": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9679126316908172, + "var_between_root": 0.11138634030324279, + "var_within_root": 0.00369257969046096, + "sd_between_root": 0.33374592177769424, + "sd_within_root": 0.06076660012260814, + "splithalf_spearman": 0.97199021134594, + "top3_overlap": 0.6306666666666674, + "n_splits": 2000, + "top1_agreement": 0.377, + "n_distinct_values": 155, + "median_recapture_range": 0.03632992506027222, + "max_recapture_range": 0.4174830764532089, + "between_root_mean_range": 0.9206639895016047, + "noise_to_signal": 0.039460569191958055, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.7827620208263397, + "min": 0.5861086845397949, + "max": 0.8547662496566772, + "range": 0.2686575651168823 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 1.4686004372571615e-05, + "min": 3.0989066868158943e-10, + "max": 3.9729482523398474e-05, + "range": 3.972917263272979e-05 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.5859186872839928, + "min": 0.4813844859600067, + "max": 0.6342390775680542, + "range": 0.15285459160804749 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.7422260046005249, + "min": 0.5709527730941772, + "max": 0.9360631704330444, + "range": 0.3651103973388672 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 8.308348719079928e-08, + "min": 1.5156671751004325e-10, + "max": 3.3098228868766455e-07, + "range": 3.308307219701545e-07 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.019098224816843867, + "min": 0.010140572674572468, + "max": 0.02520841546356678, + "range": 0.015067842788994312 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.024870118591934443, + "min": 0.018702151253819466, + "max": 0.04337342828512192, + "range": 0.024671277031302452 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.8564426377415657, + "min": 0.8459620475769043, + "max": 0.8822919726371765, + "range": 0.03632992506027222 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.2234203051775694, + "min": 0.1415252387523651, + "max": 0.31185004115104675, + "range": 0.17032480239868164 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.5551495403051376, + "min": 0.5490685701370239, + "max": 0.5601746439933777, + "range": 0.01110607385635376 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.1758943067656623, + "min": 0.13475771248340607, + "max": 0.23395879566669464, + "range": 0.09920108318328857 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.6404770712057749, + "min": 0.6069021821022034, + "max": 0.6839041709899902, + "range": 0.07700198888778687 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.005930419801643438, + "min": 5.019014861318283e-05, + "max": 0.01727997325360775, + "range": 0.017229783104994567 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 5.630382878679674e-12, + "min": 3.785088995705843e-12, + "max": 8.053687057529846e-12, + "range": 4.268598061824003e-12 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.01788837043568492, + "min": 0.010041126981377602, + "max": 0.021921638399362564, + "range": 0.011880511417984962 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.042594265192747116, + "min": 0.034598737955093384, + "max": 0.04883448779582977, + "range": 0.01423574984073639 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.04026878159493208, + "min": 0.038263704627752304, + "max": 0.04148078337311745, + "range": 0.003217078745365143 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.1722521986812353, + "min": 0.04724912345409393, + "max": 0.46473219990730286, + "range": 0.4174830764532089 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.3265377978483836, + "min": 0.16266539692878723, + "max": 0.4582274556159973, + "range": 0.2955620586872101 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.14904779940843582, + "min": 0.12913261353969574, + "max": 0.16040538251399994, + "range": 0.0312727689743042 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.23314674943685532, + "min": 0.1678820550441742, + "max": 0.3079380691051483, + "range": 0.14005601406097412 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.15945064648985863, + "min": 0.119900181889534, + "max": 0.27684286236763, + "range": 0.156942680478096 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.054771848022937775, + "min": 0.05192895606160164, + "max": 0.0566292367875576, + "range": 0.004700280725955963 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 2.671271389272552e-08, + "min": 3.410287052751926e-10, + "max": 7.936003498798527e-08, + "range": 7.901900628271008e-08 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.920663989507235, + "min": 0.8395338654518127, + "max": 0.9906049370765686, + "range": 0.15107107162475586 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.09628116339445114, + "min": 0.08670200407505035, + "max": 0.10219084471464157, + "range": 0.015488840639591217 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.069140684325248, + "min": 0.02636696770787239, + "max": 0.09842764586210251, + "range": 0.07206067815423012 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.8875070661306381, + "min": 0.8144694566726685, + "max": 0.9379538893699646, + "range": 0.12348443269729614 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.27431137561798097, + "min": 0.14182797074317932, + "max": 0.3932135999202728, + "range": 0.2513856291770935 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.0826370616753896, + "min": 0.07263442873954773, + "max": 0.09655154496431351, + "range": 0.023917116224765778 + } + } + }, + "q_of_greenless": { + "n_roots_with_replicates": 23, + "n_obs": 126, + "ICC": 0.803690177573754, + "var_between_root": 0.0003483283019176902, + "var_within_root": 8.50828702447621e-05, + "sd_between_root": 0.018663555446851228, + "sd_within_root": 0.00922403763244503, + "splithalf_spearman": 0.8481383399209486, + "top3_overlap": 0.7973333333333437, + "n_splits": 2000, + "top1_agreement": 0.4295, + "n_distinct_values": 122, + "median_recapture_range": 0.007200113497674465, + "max_recapture_range": 0.07072767615318298, + "between_root_mean_range": 0.06010403980248399, + "noise_to_signal": 0.1197941689333318, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 3, + "mean": 0.0046764671574405356, + "min": 2.946369190293119e-11, + "max": 0.014029395766556263, + "range": 0.014029395737092571 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 1.4686004372571615e-05, + "min": 3.0989066868158943e-10, + "max": 3.9729482523398474e-05, + "range": 3.972917263272979e-05 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 5.36589487312028e-07, + "min": 2.1271082117912954e-11, + "max": 2.0527206743281567e-06, + "range": 2.052699403246039e-06 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.044786195270717144, + "min": 0.04087265580892563, + "max": 0.05427815020084381, + "range": 0.013405494391918182 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 8.308348719079928e-08, + "min": 1.5156671751004325e-10, + "max": 3.3098228868766455e-07, + "range": 3.308307219701545e-07 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.014162802137434483, + "min": 0.010140572674572468, + "max": 0.017340686172246933, + "range": 0.007200113497674465 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 9.777395472210194e-06, + "min": 8.800782151652253e-12, + "max": 3.9107882912503555e-05, + "range": 3.9107874111721404e-05 + }, + "square_expert_play::demo_181_t0135": { + "n": 7, + "mean": 0.0032716048484279065, + "min": 1.4603423892367573e-07, + "max": 0.019650794565677643, + "range": 0.01965064853143872 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.015335654490627348, + "min": 0.002974910894408822, + "max": 0.029965028166770935, + "range": 0.026990117272362113 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 3.393647342082488e-08, + "min": 3.290904942760027e-14, + "max": 1.346560907222738e-07, + "range": 1.3465605781322437e-07 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.004982330166702316, + "min": 1.4723970025443123e-06, + "max": 0.01733560860157013, + "range": 0.017334136204567585 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.0013231526385212823, + "min": 5.1264605760307017e-14, + "max": 0.0062977927736938, + "range": 0.006297792773642535 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.003529849427195586, + "min": 5.019014861318283e-05, + "max": 0.008443250320851803, + "range": 0.00839306017223862 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 5.630382878679674e-12, + "min": 3.785088995705843e-12, + "max": 8.053687057529846e-12, + "range": 4.268598061824003e-12 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.010484051192179322, + "min": 0.007586801424622536, + "max": 0.016050413250923157, + "range": 0.008463611826300621 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.016207263804972172, + "min": 0.013945415616035461, + "max": 0.018221067264676094, + "range": 0.004275651648640633 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 6, + "mean": 0.06010403980811437, + "min": 0.04840202257037163, + "max": 0.0683753490447998, + "range": 0.019973326474428177 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.04494887660257518, + "min": 0.01958686113357544, + "max": 0.09031453728675842, + "range": 0.07072767615318298 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.020118596497923136, + "min": 0.01908215507864952, + "max": 0.021753884851932526, + "range": 0.0026717297732830048 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 2.6712715511800766e-08, + "min": 3.4102917711997804e-10, + "max": 7.936003498798527e-08, + "range": 7.90190058108653e-08 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.04311411942426975, + "min": 0.028812099248170853, + "max": 0.05705001950263977, + "range": 0.028237920254468918 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.014639523345977068, + "min": 0.0032913843169808388, + "max": 0.019627872854471207, + "range": 0.016336488537490368 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.014687105392416319, + "min": 0.012364218942821026, + "max": 0.018399706110358238, + "range": 0.006035487167537212 + } + } + }, + "argmax_is_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.8480629990830613, + "var_between_root": 0.10987549724233085, + "var_within_root": 0.01968503937007874, + "sd_between_root": 0.331474730925799, + "sd_within_root": 0.14030338331657843, + "splithalf_spearman": 0.8770542339684775, + "top3_overlap": 0.12183333333333436, + "n_splits": 2000, + "top1_agreement": 0.0395, + "n_distinct_values": 2, + "median_recapture_range": 0.0, + "max_recapture_range": 1.0, + "between_root_mean_range": 1.0, + "noise_to_signal": 0.0, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.5, + "min": 0.0, + "max": 1.0, + "range": 1.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.25, + "min": 0.0, + "max": 1.0, + "range": 1.0 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + } + } + } + }, + "device_only_fixed_draw": { + "cand_any_green": { + "n_roots": 5, + "median_abs_dev": 0.0546875, + "max_abs_dev": 0.2421875 + }, + "cand_all_green": { + "n_roots": 5, + "median_abs_dev": 0.0, + "max_abs_dev": 0.0 + }, + "frac_green": { + "n_roots": 5, + "median_abs_dev": 0.01123046875, + "max_abs_dev": 0.0762939453125 + }, + "hop_rise": { + "n_roots": 5, + "median_abs_dev": 0.0179443359375, + "max_abs_dev": 0.1142578125 + }, + "hop_green_last": { + "n_roots": 5, + "median_abs_dev": 0.03173828125, + "max_abs_dev": 0.11669921875 + }, + "top_cand_share": { + "n_roots": 5, + "median_abs_dev": 0.004083939354820199, + "max_abs_dev": 0.006302417060438881 + }, + "Q_max": { + "n_roots": 5, + "median_abs_dev": 0.07924890518188477, + "max_abs_dev": 0.09920108318328857 + }, + "Q_spread": { + "n_roots": 5, + "median_abs_dev": 0.0834454894065857, + "max_abs_dev": 0.12101387977600098 + }, + "q_of_greenless": { + "n_roots": 4, + "median_abs_dev": 0.009691113606095314, + "max_abs_dev": 0.013351042239264643 + }, + "argmax_is_green": { + "n_roots": 5, + "median_abs_dev": 0.0, + "max_abs_dev": 0.0 + } + }, + "fidelity_cell_run24": { + "note": "run-24 hop-diversity cell; 5 roots only -> underpowered, NO VERDICT by the run-25 pre-registration", + "n_roots": 5, + "n_obs": 18, + "ICC": 0.605728133557977, + "sd_between_root": 0.18927952134893733, + "sd_within_root": 0.1527083029208028, + "VERDICT": "NO_VERDICT_UNDERPOWERED" + }, + "STABLE": [ + "frac_green", + "hop_rise", + "hop_green_last", + "Q_max", + "q_of_greenless" + ], + "MARGINAL": [ + "cand_any_green", + "top_cand_share", + "Q_spread", + "argmax_is_green" + ], + "UNUSABLE": [], + "highest_ICC_statistic": "frac_green", + "VERDICT": "STABLE_STAT_EXISTS", + "selection_statistic_used_by_run19": "cand_any_green", + "run19_selection_statistic_verdict": "MARGINAL" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_STABILITY_v1_dettie.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_STABILITY_v1_dettie.json new file mode 100644 index 0000000000000000000000000000000000000000..61b9e8330e288d8cd3e17eec1b21b3f757779d99 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/STAT_STABILITY_v1_dettie.json @@ -0,0 +1,2343 @@ +{ + "purpose": "gen_q#270 run 25: is ANY figure-choice statistic stable under re-capture?", + "pre_registration": "status/SUCCESSOR_VIZ.md run 25 (written before any compute)", + "source_census": "runs/pixdec/CAND_GREEN_CENSUS_xdev.json", + "setting": "L40best_b0.95_L8_N128_P16", + "dedupe": "replicates deduped by md5 of the trace .npz (NOT dirname, NOT realpath): curated dirs are symlinks (curate_split_manifest.py:60) and seeded arms can be byte-identical; counting those would deflate within-root variance", + "n_draws_in_census": 202, + "n_draws_after_md5_dedup": 173, + "n_duplicate_traces_removed": 29, + "n_roots_total": 46, + "n_roots_with_replicates": 30, + "thresholds": { + "stable_icc": 0.75, + "stable_rho": 0.7, + "stable_top3": 0.67, + "unusable_icc": 0.4, + "unusable_rho": 0.35 + }, + "n_splits": 2000, + "rng_seed": 0, + "statistics": { + "cand_any_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9652112816848416, + "var_between_root": 0.14199726401523888, + "var_within_root": 0.00511794973088832, + "sd_between_root": 0.3768252433360043, + "sd_within_root": 0.0715398471544937, + "splithalf_spearman": 0.9191135828344881, + "top3_overlap": 0.36916666666666814, + "n_splits": 2000, + "median_recapture_range": 0.0390625, + "max_recapture_range": 0.59375, + "between_root_mean_range": 1.0, + "noise_to_signal": 0.0390625, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.98046875, + "min": 0.9609375, + "max": 1.0, + "range": 0.0390625 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.951171875, + "min": 0.9296875, + "max": 0.96875, + "range": 0.0390625 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.634765625, + "min": 0.5, + "max": 0.7578125, + "range": 0.2578125 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.00390625, + "min": 0.0, + "max": 0.0078125, + "range": 0.0078125 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.787109375, + "min": 0.7265625, + "max": 0.828125, + "range": 0.1015625 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.958984375, + "min": 0.921875, + "max": 1.0, + "range": 0.078125 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.1494140625, + "min": 0.1328125, + "max": 0.1640625, + "range": 0.03125 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.96484375, + "min": 0.9453125, + "max": 0.984375, + "range": 0.0390625 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.5104166666666666, + "min": 0.40625, + "max": 0.7109375, + "range": 0.3046875 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.3763020833333333, + "min": 0.3203125, + "max": 0.4609375, + "range": 0.140625 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0146484375, + "min": 0.0, + "max": 0.0703125, + "range": 0.0703125 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.130859375, + "min": 0.0078125, + "max": 0.46875, + "range": 0.4609375 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.99609375, + "min": 0.984375, + "max": 1.0, + "range": 0.015625 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.94140625, + "min": 0.9296875, + "max": 0.96875, + "range": 0.0390625 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.939453125, + "min": 0.890625, + "max": 1.0, + "range": 0.109375 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.9947916666666666, + "min": 0.984375, + "max": 1.0, + "range": 0.015625 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.7197265625, + "min": 0.640625, + "max": 0.7890625, + "range": 0.1484375 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.998046875, + "min": 0.9921875, + "max": 1.0, + "range": 0.0078125 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.998046875, + "min": 0.9921875, + "max": 1.0, + "range": 0.0078125 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.78515625, + "min": 0.7109375, + "max": 0.8515625, + "range": 0.140625 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.7752403846153846, + "min": 0.6796875, + "max": 0.828125, + "range": 0.1484375 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.9114583333333334, + "min": 0.734375, + "max": 1.0, + "range": 0.265625 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.80078125, + "min": 0.7578125, + "max": 0.9140625, + "range": 0.15625 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.5677083333333334, + "min": 0.359375, + "max": 0.953125, + "range": 0.59375 + } + } + }, + "cand_all_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": null, + "var_between_root": 0.0, + "var_within_root": 0.0, + "sd_between_root": 0.0, + "sd_within_root": 0.0, + "splithalf_spearman": null, + "top3_overlap": 1.0, + "n_splits": 2000, + "median_recapture_range": 0.0, + "max_recapture_range": 0.0, + "between_root_mean_range": 0.0, + "noise_to_signal": null, + "VERDICT": "NO_POWER", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + } + } + }, + "frac_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9936972456576838, + "var_between_root": 0.020177692237538642, + "var_within_root": 0.00012798167442226884, + "sd_between_root": 0.14204820392225537, + "sd_within_root": 0.01131289858622753, + "splithalf_spearman": 0.9830373568530395, + "top3_overlap": 1.0, + "n_splits": 2000, + "median_recapture_range": 0.00732421875, + "max_recapture_range": 0.080322265625, + "between_root_mean_range": 0.57354736328125, + "noise_to_signal": 0.01277003298925189, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.57354736328125, + "min": 0.56298828125, + "max": 0.58099365234375, + "range": 0.01800537109375 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.3087005615234375, + "min": 0.29876708984375, + "max": 0.31689453125, + "range": 0.01812744140625 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.0185089111328125, + "min": 0.01263427734375, + "max": 0.02606201171875, + "range": 0.013427734375 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 3.0517578125e-05, + "min": 0.0, + "max": 6.103515625e-05, + "range": 6.103515625e-05 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.008087158203125, + "min": 0.006103515625, + "max": 0.013427734375, + "range": 0.00732421875 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.20599365234375, + "min": 0.19287109375, + "max": 0.21673583984375, + "range": 0.02386474609375 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.00643157958984375, + "min": 0.0042724609375, + "max": 0.00897216796875, + "range": 0.00469970703125 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.243804931640625, + "min": 0.23797607421875, + "max": 0.24835205078125, + "range": 0.0103759765625 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.025221082899305556, + "min": 0.0169677734375, + "max": 0.033447265625, + "range": 0.0164794921875 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.16896565755208334, + "min": 0.15557861328125, + "max": 0.192138671875, + "range": 0.03656005859375 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0001220703125, + "min": 0.0, + "max": 0.0006103515625, + "range": 0.0006103515625 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.001129150390625, + "min": 6.103515625e-05, + "max": 0.00408935546875, + "range": 0.0040283203125 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.0097503662109375, + "min": 0.00909423828125, + "max": 0.01068115234375, + "range": 0.0015869140625 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.008697509765625, + "min": 0.00836181640625, + "max": 0.00933837890625, + "range": 0.0009765625 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.01540374755859375, + "min": 0.01348876953125, + "max": 0.01702880859375, + "range": 0.0035400390625 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.14345296223958334, + "min": 0.1397705078125, + "max": 0.14874267578125, + "range": 0.00897216796875 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.02602386474609375, + "min": 0.02008056640625, + "max": 0.03082275390625, + "range": 0.0107421875 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.0868988037109375, + "min": 0.08221435546875, + "max": 0.092041015625, + "range": 0.00982666015625 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.162689208984375, + "min": 0.159912109375, + "max": 0.1641845703125, + "range": 0.0042724609375 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.012054443359375, + "min": 0.0108642578125, + "max": 0.01263427734375, + "range": 0.00177001953125 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.1013934795673077, + "min": 0.082275390625, + "max": 0.13232421875, + "range": 0.050048828125 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.052937825520833336, + "min": 0.01129150390625, + "max": 0.0738525390625, + "range": 0.06256103515625 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.00891876220703125, + "min": 0.00616455078125, + "max": 0.0101318359375, + "range": 0.00396728515625 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.572967529296875, + "min": 0.56170654296875, + "max": 0.58343505859375, + "range": 0.021728515625 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.22607421875, + "min": 0.1795654296875, + "max": 0.2598876953125, + "range": 0.080322265625 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.00726318359375, + "min": 0.0067138671875, + "max": 0.00830078125, + "range": 0.0015869140625 + } + } + }, + "hop_rise": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9742886265410776, + "var_between_root": 0.010347912782944542, + "var_within_root": 0.0002730803201790493, + "sd_between_root": 0.10172469111746932, + "sd_within_root": 0.01652514206229554, + "splithalf_spearman": 0.9171746871553236, + "top3_overlap": 0.7083333333333388, + "n_splits": 2000, + "median_recapture_range": 0.007568359375, + "max_recapture_range": 0.114501953125, + "between_root_mean_range": 0.444427490234375, + "noise_to_signal": 0.017029458216026916, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": -0.05230712890625, + "min": -0.0567626953125, + "max": -0.0491943359375, + "range": 0.007568359375 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.143646240234375, + "min": 0.1392822265625, + "max": 0.147216796875, + "range": 0.0079345703125 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": -0.033843994140625, + "min": -0.0516357421875, + "max": -0.0220947265625, + "range": 0.029541015625 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": -6.103515625e-05, + "min": -0.0001220703125, + "max": 0.0, + "range": 0.0001220703125 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.01617431640625, + "min": 0.01220703125, + "max": 0.02685546875, + "range": 0.0146484375 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": -0.30078125, + "min": -0.3211669921875, + "max": -0.284912109375, + "range": 0.0362548828125 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.0086212158203125, + "min": 0.00537109375, + "max": 0.0111083984375, + "range": 0.0057373046875 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": -0.12957763671875, + "min": -0.1318359375, + "max": -0.125732421875, + "range": 0.006103515625 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.031019422743055556, + "min": 0.0262451171875, + "max": 0.0361328125, + "range": 0.0098876953125 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.1324462890625, + "min": 0.08935546875, + "max": 0.16748046875, + "range": 0.078125 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.000244140625, + "min": 0.0, + "max": 0.001220703125, + "range": 0.001220703125 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.00225830078125, + "min": 0.0001220703125, + "max": 0.0081787109375, + "range": 0.008056640625 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.015716552734375, + "min": 0.01513671875, + "max": 0.0164794921875, + "range": 0.0013427734375 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.017333984375, + "min": 0.0164794921875, + "max": 0.0186767578125, + "range": 0.002197265625 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": -0.0225677490234375, + "min": -0.0296630859375, + "max": -0.0050048828125, + "range": 0.024658203125 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": -0.0284423828125, + "min": -0.06005859375, + "max": 0.0262451171875, + "range": 0.0863037109375 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.0096282958984375, + "min": 0.0062255859375, + "max": 0.0147705078125, + "range": 0.008544921875 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": -0.027496337890625, + "min": -0.0299072265625, + "max": -0.0224609375, + "range": 0.0074462890625 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.10150146484375, + "min": 0.09814453125, + "max": 0.10546875, + "range": 0.00732421875 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.020263671875, + "min": 0.01708984375, + "max": 0.0223388671875, + "range": 0.0052490234375 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": -0.09801307091346154, + "min": -0.122802734375, + "max": -0.0743408203125, + "range": 0.0484619140625 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.06901041666666667, + "min": 0.0084228515625, + "max": 0.0994873046875, + "range": 0.091064453125 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.0135345458984375, + "min": 0.0106201171875, + "max": 0.0157470703125, + "range": 0.005126953125 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": -0.2845458984375, + "min": -0.291015625, + "max": -0.279541015625, + "range": 0.011474609375 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.130126953125, + "min": 0.0625, + "max": 0.177001953125, + "range": 0.114501953125 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.0118408203125, + "min": 0.010009765625, + "max": 0.014892578125, + "range": 0.0048828125 + } + } + }, + "hop_green_last": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9645498846749956, + "var_between_root": 0.0104714221572696, + "var_within_root": 0.00038485632416730096, + "sd_between_root": 0.10232996705398473, + "sd_within_root": 0.01961775532947898, + "splithalf_spearman": 0.9490999332893684, + "top3_overlap": 0.7623333333333434, + "n_splits": 2000, + "median_recapture_range": 0.01171875, + "max_recapture_range": 0.15771484375, + "between_root_mean_range": 0.3870849609375, + "noise_to_signal": 0.030274361400189215, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.3870849609375, + "min": 0.3779296875, + "max": 0.39501953125, + "range": 0.01708984375 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.2462158203125, + "min": 0.236328125, + "max": 0.2509765625, + "range": 0.0146484375 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.0113525390625, + "min": 0.0, + "max": 0.04541015625, + "range": 0.04541015625 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.0281982421875, + "min": 0.02294921875, + "max": 0.0341796875, + "range": 0.01123046875 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.0142822265625, + "min": 0.00927734375, + "max": 0.01904296875, + "range": 0.009765625 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.16552734375, + "min": 0.162109375, + "max": 0.16943359375, + "range": 0.00732421875 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.04079861111111111, + "min": 0.03466796875, + "max": 0.048828125, + "range": 0.01416015625 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.22867838541666666, + "min": 0.142578125, + "max": 0.30029296875, + "range": 0.15771484375 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.0006103515625, + "min": 0.0, + "max": 0.00341796875, + "range": 0.00341796875 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.00439453125, + "min": 0.0, + "max": 0.017578125, + "range": 0.017578125 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.0643310546875, + "min": 0.0634765625, + "max": 0.0654296875, + "range": 0.001953125 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.0455322265625, + "min": 0.0390625, + "max": 0.0498046875, + "range": 0.0107421875 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.00030517578125, + "min": 0.0, + "max": 0.00146484375, + "range": 0.00146484375 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.07763671875, + "min": 0.05322265625, + "max": 0.11328125, + "range": 0.06005859375 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.01934814453125, + "min": 0.00927734375, + "max": 0.02587890625, + "range": 0.0166015625 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.016357421875, + "min": 0.01513671875, + "max": 0.0185546875, + "range": 0.00341796875 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.21484375, + "min": 0.2080078125, + "max": 0.2197265625, + "range": 0.01171875 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.0614013671875, + "min": 0.0517578125, + "max": 0.06689453125, + "range": 0.01513671875 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.027080829326923076, + "min": 0.0107421875, + "max": 0.05419921875, + "range": 0.04345703125 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.11767578125, + "min": 0.0400390625, + "max": 0.158203125, + "range": 0.1181640625 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.03973388671875, + "min": 0.03271484375, + "max": 0.056640625, + "range": 0.02392578125 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.3455810546875, + "min": 0.3349609375, + "max": 0.3564453125, + "range": 0.021484375 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.23447265625, + "min": 0.16796875, + "max": 0.2802734375, + "range": 0.1123046875 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.00732421875, + "min": 0.0009765625, + "max": 0.01220703125, + "range": 0.01123046875 + } + } + }, + "top_cand_share": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.42985099820177636, + "var_between_root": 0.009357431576570955, + "var_within_root": 0.012411580513005449, + "sd_between_root": 0.09673381816392318, + "sd_within_root": 0.11140727316026297, + "splithalf_spearman": 0.767160343879588, + "top3_overlap": 0.5749999999999997, + "n_splits": 2000, + "median_recapture_range": 0.007625272331154686, + "max_recapture_range": 1.0, + "between_root_mean_range": 0.5, + "noise_to_signal": 0.015250544662309372, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.009341039060697146, + "min": 0.008929509402248135, + "max": 0.009865568083261058, + "range": 0.0009360586810129232 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.012332747276608765, + "min": 0.009185303514376996, + "max": 0.014213395638629283, + "range": 0.005028092124252287 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.06154298834476533, + "min": 0.04240282685512368, + "max": 0.0966183574879227, + "range": 0.054215530632799026 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.5, + "min": 0.0, + "max": 1.0, + "range": 1.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.011807791265338435, + "min": 0.009433962264150943, + "max": 0.01818181818181818, + "range": 0.008747855917667238 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.010302910813096986, + "min": 0.009856378484933821, + "max": 0.010759299108515216, + "range": 0.0009029206235813946 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.22935908172758118, + "min": 0.17293233082706766, + "max": 0.3142857142857143, + "range": 0.14135338345864662 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.009575675689764003, + "min": 0.00893743793445879, + "max": 0.01054746358613762, + "range": 0.00161002565167883 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.03706614379718631, + "min": 0.025547445255474453, + "max": 0.0683453237410072, + "range": 0.04279787848553275 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.027714502088167278, + "min": 0.02255400254129606, + "max": 0.03216947822675559, + "range": 0.009615475685459528 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.04583333333333334, + "min": 0.0, + "max": 0.2, + "range": 0.2 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.42412935323383083, + "min": 0.029850746268656716, + "max": 1.0, + "range": 0.9701492537313433 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.02191342010331351, + "min": 0.018518518518518517, + "max": 0.026143790849673203, + "range": 0.007625272331154686 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.021090699053343966, + "min": 0.0196078431372549, + "max": 0.021897810218978103, + "range": 0.0022899670817232015 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.026063885936147644, + "min": 0.01532567049808429, + "max": 0.05394190871369295, + "range": 0.03861623821560866 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.01400416579163437, + "min": 0.012908777969018933, + "max": 0.01600328272466147, + "range": 0.0030945047556425378 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.020246745381014224, + "min": 0.01782178217821782, + "max": 0.028985507246376812, + "range": 0.011163725068158992 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.014412070236902523, + "min": 0.013370865587614356, + "max": 0.015503875968992248, + "range": 0.0021330103813778922 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.009379856718435829, + "min": 0.008945210585165859, + "max": 0.009665427509293681, + "range": 0.0007202169241278221 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.026620627377833044, + "min": 0.024154589371980676, + "max": 0.028985507246376812, + "range": 0.004830917874396136 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.02558005495324274, + "min": 0.021217712177121772, + "max": 0.029753265602322207, + "range": 0.008535553425200435 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.016732093586804744, + "min": 0.011570247933884297, + "max": 0.02702702702702703, + "range": 0.015456779093142732 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.02427550711214666, + "min": 0.01639344262295082, + "max": 0.031446540880503145, + "range": 0.015053098257552324 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.010443024715311895, + "min": 0.010147504969139031, + "max": 0.010679611650485437, + "range": 0.0005321066813464056 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.011717517538811593, + "min": 0.00984630163304515, + "max": 0.014795678722404886, + "range": 0.004949377089359736 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.05038099596923126, + "min": 0.036036036036036036, + "max": 0.06363636363636363, + "range": 0.027600327600327594 + } + } + }, + "Q_max": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9782968120512602, + "var_between_root": 0.11773746466379795, + "var_within_root": 0.0026119663201689216, + "sd_between_root": 0.34312893300303016, + "sd_within_root": 0.051107399857250824, + "splithalf_spearman": 0.9813699666295895, + "top3_overlap": 0.723000000000008, + "n_splits": 2000, + "median_recapture_range": 0.024671277031302452, + "max_recapture_range": 0.3883375823497772, + "between_root_mean_range": 0.9998947083893739, + "noise_to_signal": 0.024673874983339835, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.846352756023407, + "min": 0.840471625328064, + "max": 0.8547662496566772, + "range": 0.014294624328613281 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 1.4686004372571615e-05, + "min": 3.0989066868158943e-10, + "max": 3.9729482523398474e-05, + "range": 3.972917263272979e-05 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.5859186872839928, + "min": 0.4813844859600067, + "max": 0.6342390775680542, + "range": 0.15285459160804749 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.7422260046005249, + "min": 0.5709527730941772, + "max": 0.9360631704330444, + "range": 0.3651103973388672 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 8.308348719079928e-08, + "min": 1.5156671751004325e-10, + "max": 3.3098228868766455e-07, + "range": 3.308307219701545e-07 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.019098224816843867, + "min": 0.010140572674572468, + "max": 0.02520841546356678, + "range": 0.015067842788994312 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.024870118591934443, + "min": 0.018702151253819466, + "max": 0.04337342828512192, + "range": 0.024671277031302452 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.8584511801600456, + "min": 0.849848747253418, + "max": 0.8822919726371765, + "range": 0.032443225383758545 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.2234203051775694, + "min": 0.1415252387523651, + "max": 0.31185004115104675, + "range": 0.17032480239868164 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.5551495403051376, + "min": 0.5490685701370239, + "max": 0.5601746439933777, + "range": 0.01110607385635376 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.1758943067656623, + "min": 0.13475771248340607, + "max": 0.23395879566669464, + "range": 0.09920108318328857 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.6404770712057749, + "min": 0.6069021821022034, + "max": 0.6839041709899902, + "range": 0.07700198888778687 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.005930419801643438, + "min": 5.019014861318283e-05, + "max": 0.01727997325360775, + "range": 0.017229783104994567 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 5.630382878679674e-12, + "min": 3.785088995705843e-12, + "max": 8.053687057529846e-12, + "range": 4.268598061824003e-12 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.017888539470732212, + "min": 0.010041126981377602, + "max": 0.021921638399362564, + "range": 0.011880511417984962 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.05520513840019703, + "min": 0.05053364112973213, + "max": 0.061455462127923965, + "range": 0.010921820998191833 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.04541134089231491, + "min": 0.04317096248269081, + "max": 0.04626983404159546, + "range": 0.003098871558904648 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.19939273037016392, + "min": 0.09216669201850891, + "max": 0.48050427436828613, + "range": 0.3883375823497772 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.48161692420641583, + "min": 0.4584195613861084, + "max": 0.5130337476730347, + "range": 0.05461418628692627 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.14919232204556465, + "min": 0.12913301587104797, + "max": 0.1604074239730835, + "range": 0.03127440810203552 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.30890022963285446, + "min": 0.2951880693435669, + "max": 0.3364698886871338, + "range": 0.041281819343566895 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.2649051547050476, + "min": 0.2593776285648346, + "max": 0.27829867601394653, + "range": 0.01892104744911194 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.05607725027948618, + "min": 0.05342011898756027, + "max": 0.0576312318444252, + "range": 0.004211112856864929 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 2.6712715511800766e-08, + "min": 3.4102917711997804e-10, + "max": 7.936003498798527e-08, + "range": 7.90190058108653e-08 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.9211514867269076, + "min": 0.8403615355491638, + "max": 0.9908179044723511, + "range": 0.15045636892318726 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.13749495645364126, + "min": 0.08670267462730408, + "max": 0.16389822959899902, + "range": 0.07719555497169495 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.06951639545150101, + "min": 0.026393426582217216, + "max": 0.09887169301509857, + "range": 0.07247826643288136 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.9998947083950043, + "min": 0.99985271692276, + "max": 0.9999346733093262, + "range": 8.195638656616211e-05 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.5691008329391479, + "min": 0.4422576427459717, + "max": 0.7106689810752869, + "range": 0.2684113383293152 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.08286350965499878, + "min": 0.07263443619012833, + "max": 0.09659223258495331, + "range": 0.02395779639482498 + } + } + }, + "Q_spread": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.9679126316908172, + "var_between_root": 0.11138634030324279, + "var_within_root": 0.00369257969046096, + "sd_between_root": 0.33374592177769424, + "sd_within_root": 0.06076660012260814, + "splithalf_spearman": 0.972152391546163, + "top3_overlap": 0.6298333333333344, + "n_splits": 2000, + "median_recapture_range": 0.03632992506027222, + "max_recapture_range": 0.4174830764532089, + "between_root_mean_range": 0.9206639895016047, + "noise_to_signal": 0.039460569191958055, + "VERDICT": "MARGINAL", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 0.7827620208263397, + "min": 0.5861086845397949, + "max": 0.8547662496566772, + "range": 0.2686575651168823 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 1.4686004372571615e-05, + "min": 3.0989066868158943e-10, + "max": 3.9729482523398474e-05, + "range": 3.972917263272979e-05 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 0.5859186872839928, + "min": 0.4813844859600067, + "max": 0.6342390775680542, + "range": 0.15285459160804749 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.7422260046005249, + "min": 0.5709527730941772, + "max": 0.9360631704330444, + "range": 0.3651103973388672 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 8.308348719079928e-08, + "min": 1.5156671751004325e-10, + "max": 3.3098228868766455e-07, + "range": 3.308307219701545e-07 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.019098224816843867, + "min": 0.010140572674572468, + "max": 0.02520841546356678, + "range": 0.015067842788994312 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 0.024870118591934443, + "min": 0.018702151253819466, + "max": 0.04337342828512192, + "range": 0.024671277031302452 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 0.8564426377415657, + "min": 0.8459620475769043, + "max": 0.8822919726371765, + "range": 0.03632992506027222 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.2234203051775694, + "min": 0.1415252387523651, + "max": 0.31185004115104675, + "range": 0.17032480239868164 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 0.5551495403051376, + "min": 0.5490685701370239, + "max": 0.5601746439933777, + "range": 0.01110607385635376 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.1758943067656623, + "min": 0.13475771248340607, + "max": 0.23395879566669464, + "range": 0.09920108318328857 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.6404770712057749, + "min": 0.6069021821022034, + "max": 0.6839041709899902, + "range": 0.07700198888778687 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.005930419801643438, + "min": 5.019014861318283e-05, + "max": 0.01727997325360775, + "range": 0.017229783104994567 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 5.630382878679674e-12, + "min": 3.785088995705843e-12, + "max": 8.053687057529846e-12, + "range": 4.268598061824003e-12 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.01788837043568492, + "min": 0.010041126981377602, + "max": 0.021921638399362564, + "range": 0.011880511417984962 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 0.042594265192747116, + "min": 0.034598737955093384, + "max": 0.04883448779582977, + "range": 0.01423574984073639 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.04026878159493208, + "min": 0.038263704627752304, + "max": 0.04148078337311745, + "range": 0.003217078745365143 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 0.1722521986812353, + "min": 0.04724912345409393, + "max": 0.46473219990730286, + "range": 0.4174830764532089 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 0.3265377978483836, + "min": 0.16266539692878723, + "max": 0.4582274556159973, + "range": 0.2955620586872101 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.14904779940843582, + "min": 0.12913261353969574, + "max": 0.16040538251399994, + "range": 0.0312727689743042 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 0.23314674943685532, + "min": 0.1678820550441742, + "max": 0.3079380691051483, + "range": 0.14005601406097412 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 0.15945064648985863, + "min": 0.119900181889534, + "max": 0.27684286236763, + "range": 0.156942680478096 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.054771848022937775, + "min": 0.05192895606160164, + "max": 0.0566292367875576, + "range": 0.004700280725955963 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 2.671271389272552e-08, + "min": 3.410287052751926e-10, + "max": 7.936003498798527e-08, + "range": 7.901900628271008e-08 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.920663989507235, + "min": 0.8395338654518127, + "max": 0.9906049370765686, + "range": 0.15107107162475586 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 0.09628116339445114, + "min": 0.08670200407505035, + "max": 0.10219084471464157, + "range": 0.015488840639591217 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.069140684325248, + "min": 0.02636696770787239, + "max": 0.09842764586210251, + "range": 0.07206067815423012 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 0.8875070661306381, + "min": 0.8144694566726685, + "max": 0.9379538893699646, + "range": 0.12348443269729614 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 0.27431137561798097, + "min": 0.14182797074317932, + "max": 0.3932135999202728, + "range": 0.2513856291770935 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.0826370616753896, + "min": 0.07263442873954773, + "max": 0.09655154496431351, + "range": 0.023917116224765778 + } + } + }, + "q_of_greenless": { + "n_roots_with_replicates": 23, + "n_obs": 126, + "ICC": 0.803690177573754, + "var_between_root": 0.0003483283019176902, + "var_within_root": 8.50828702447621e-05, + "sd_between_root": 0.018663555446851228, + "sd_within_root": 0.00922403763244503, + "splithalf_spearman": 0.8462826086956532, + "top3_overlap": 0.7906666666666775, + "n_splits": 2000, + "median_recapture_range": 0.007200113497674465, + "max_recapture_range": 0.07072767615318298, + "between_root_mean_range": 0.06010403980248399, + "noise_to_signal": 0.1197941689333318, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 3, + "mean": 0.0046764671574405356, + "min": 2.946369190293119e-11, + "max": 0.014029395766556263, + "range": 0.014029395737092571 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 1.4686004372571615e-05, + "min": 3.0989066868158943e-10, + "max": 3.9729482523398474e-05, + "range": 3.972917263272979e-05 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 5.36589487312028e-07, + "min": 2.1271082117912954e-11, + "max": 2.0527206743281567e-06, + "range": 2.052699403246039e-06 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 0.044786195270717144, + "min": 0.04087265580892563, + "max": 0.05427815020084381, + "range": 0.013405494391918182 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 8.308348719079928e-08, + "min": 1.5156671751004325e-10, + "max": 3.3098228868766455e-07, + "range": 3.308307219701545e-07 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.014162802137434483, + "min": 0.010140572674572468, + "max": 0.017340686172246933, + "range": 0.007200113497674465 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 9.777395472210194e-06, + "min": 8.800782151652253e-12, + "max": 3.9107882912503555e-05, + "range": 3.9107874111721404e-05 + }, + "square_expert_play::demo_181_t0135": { + "n": 7, + "mean": 0.0032716048484279065, + "min": 1.4603423892367573e-07, + "max": 0.019650794565677643, + "range": 0.01965064853143872 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 0.015335654490627348, + "min": 0.002974910894408822, + "max": 0.029965028166770935, + "range": 0.026990117272362113 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 3.393647342082488e-08, + "min": 3.290904942760027e-14, + "max": 1.346560907222738e-07, + "range": 1.3465605781322437e-07 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 0.004982330166702316, + "min": 1.4723970025443123e-06, + "max": 0.01733560860157013, + "range": 0.017334136204567585 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 0.0013231526385212823, + "min": 5.1264605760307017e-14, + "max": 0.0062977927736938, + "range": 0.006297792773642535 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.003529849427195586, + "min": 5.019014861318283e-05, + "max": 0.008443250320851803, + "range": 0.00839306017223862 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 5.630382878679674e-12, + "min": 3.785088995705843e-12, + "max": 8.053687057529846e-12, + "range": 4.268598061824003e-12 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 0.010484051192179322, + "min": 0.007586801424622536, + "max": 0.016050413250923157, + "range": 0.008463611826300621 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 0.016207263804972172, + "min": 0.013945415616035461, + "max": 0.018221067264676094, + "range": 0.004275651648640633 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 6, + "mean": 0.06010403980811437, + "min": 0.04840202257037163, + "max": 0.0683753490447998, + "range": 0.019973326474428177 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 0.04494887660257518, + "min": 0.01958686113357544, + "max": 0.09031453728675842, + "range": 0.07072767615318298 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 0.020118596497923136, + "min": 0.01908215507864952, + "max": 0.021753884851932526, + "range": 0.0026717297732830048 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 2.6712715511800766e-08, + "min": 3.4102917711997804e-10, + "max": 7.936003498798527e-08, + "range": 7.90190058108653e-08 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 0.04311411942426975, + "min": 0.028812099248170853, + "max": 0.05705001950263977, + "range": 0.028237920254468918 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 0.014639523345977068, + "min": 0.0032913843169808388, + "max": 0.019627872854471207, + "range": 0.016336488537490368 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 0.014687105392416319, + "min": 0.012364218942821026, + "max": 0.018399706110358238, + "range": 0.006035487167537212 + } + } + }, + "argmax_is_green": { + "n_roots_with_replicates": 30, + "n_obs": 157, + "ICC": 0.8480629990830613, + "var_between_root": 0.10987549724233085, + "var_within_root": 0.01968503937007874, + "sd_between_root": 0.331474730925799, + "sd_within_root": 0.14030338331657843, + "splithalf_spearman": 0.8789693797795253, + "top3_overlap": 1.0, + "n_splits": 2000, + "median_recapture_range": 0.0, + "max_recapture_range": 1.0, + "between_root_mean_range": 1.0, + "noise_to_signal": 0.0, + "VERDICT": "STABLE", + "per_root": { + "square_expert_play::demo_10_t0079": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_126_t0123": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_13_t0048": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_148_t0138": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_150_t0125": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_151_t0194": { + "n": 4, + "mean": 0.5, + "min": 0.0, + "max": 1.0, + "range": 1.0 + }, + "square_expert_play::demo_164_t0093": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_181_t0135": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_198_t0110": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_202_t0096": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_212_t0141": { + "n": 9, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_36_t0056": { + "n": 6, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "square_expert_play::demo_54_t0122": { + "n": 8, + "mean": 0.25, + "min": 0.0, + "max": 1.0, + "range": 1.0 + }, + "square_expert_play::demo_73_t0114": { + "n": 4, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "square_expert_play::demo_88_t0144": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_105_t0113": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_117_t0077": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_128_t0115": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_136_t0154": { + "n": 3, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_159_t0413": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_165_t0157": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_174_t0479": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_185_t0256": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_189_t0338": { + "n": 3, + "mean": 0.0, + "min": 0.0, + "max": 0.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_18_t0096": { + "n": 13, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_19_t0067": { + "n": 3, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_38_t0067": { + "n": 8, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_75_t0199": { + "n": 4, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_80_t0025": { + "n": 5, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + }, + "two_piece_expert_play::demo_83_t0280": { + "n": 3, + "mean": 1.0, + "min": 1.0, + "max": 1.0, + "range": 0.0 + } + } + } + }, + "device_only_fixed_draw": { + "cand_any_green": { + "n_roots": 5, + "median_abs_dev": 0.0546875, + "max_abs_dev": 0.2421875 + }, + "cand_all_green": { + "n_roots": 5, + "median_abs_dev": 0.0, + "max_abs_dev": 0.0 + }, + "frac_green": { + "n_roots": 5, + "median_abs_dev": 0.01123046875, + "max_abs_dev": 0.0762939453125 + }, + "hop_rise": { + "n_roots": 5, + "median_abs_dev": 0.0179443359375, + "max_abs_dev": 0.1142578125 + }, + "hop_green_last": { + "n_roots": 5, + "median_abs_dev": 0.03173828125, + "max_abs_dev": 0.11669921875 + }, + "top_cand_share": { + "n_roots": 5, + "median_abs_dev": 0.004083939354820199, + "max_abs_dev": 0.006302417060438881 + }, + "Q_max": { + "n_roots": 5, + "median_abs_dev": 0.07924890518188477, + "max_abs_dev": 0.09920108318328857 + }, + "Q_spread": { + "n_roots": 5, + "median_abs_dev": 0.0834454894065857, + "max_abs_dev": 0.12101387977600098 + }, + "q_of_greenless": { + "n_roots": 4, + "median_abs_dev": 0.009691113606095314, + "max_abs_dev": 0.013351042239264643 + }, + "argmax_is_green": { + "n_roots": 5, + "median_abs_dev": 0.0, + "max_abs_dev": 0.0 + } + }, + "fidelity_cell_run24": { + "note": "run-24 hop-diversity cell; 5 roots only -> underpowered, NO VERDICT by the run-25 pre-registration", + "n_roots": 5, + "n_obs": 18, + "ICC": 0.605728133557977, + "sd_between_root": 0.18927952134893733, + "sd_within_root": 0.1527083029208028, + "VERDICT": "NO_VERDICT_UNDERPOWERED" + }, + "STABLE": [ + "frac_green", + "hop_rise", + "hop_green_last", + "Q_max", + "q_of_greenless", + "argmax_is_green" + ], + "MARGINAL": [ + "cand_any_green", + "top_cand_share", + "Q_spread" + ], + "UNUSABLE": [], + "highest_ICC_statistic": "frac_green", + "VERDICT": "STABLE_STAT_EXISTS", + "selection_statistic_used_by_run19": "cand_any_green", + "run19_selection_statistic_verdict": "MARGINAL" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/THIRD_TASK.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/THIRD_TASK.json new file mode 100644 index 0000000000000000000000000000000000000000..9a2cb98cb46ae91398aaf5da2144859d3c61655c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/THIRD_TASK.json @@ -0,0 +1,528 @@ +{ + "generated_by": "scripts/viz/run34_gate.py", + "task": "two_piece_expert_play_tipping", + "cap": 33, + "G1": [ + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16", + "deep": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16", + "have8": true, + "have34": true, + "max_dev": { + "c": 0.0, + "lg": 0.0, + "z": 0.0 + }, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16", + "deep": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16", + "have8": true, + "have34": true, + "max_dev": { + "c": 0.0, + "lg": 0.0, + "z": 0.0 + }, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16", + "deep": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16", + "have8": true, + "have34": true, + "max_dev": { + "c": 0.0, + "lg": 0.0, + "z": 0.0 + }, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16", + "deep": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16", + "have8": true, + "have34": true, + "max_dev": { + "c": 0.0, + "lg": 0.0, + "z": 0.0 + }, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16", + "deep": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16", + "have8": true, + "have34": true, + "max_dev": { + "c": 0.0, + "lg": 0.0, + "z": 0.0 + }, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16", + "deep": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16", + "have8": true, + "have34": true, + "max_dev": { + "c": 0.0, + "lg": 0.0, + "z": 0.0 + }, + "ok": true + } + ], + "G2": [ + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16", + "dev_Q": 3.0693262791020566e-23, + "ok": true, + "beta": 0.95, + "gamma": 0.99, + "L": 8 + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16", + "dev_Q": 3.3148796381443635e-10, + "ok": true, + "beta": 0.95, + "gamma": 0.99, + "L": 8 + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16", + "dev_Q": 8.263578110678793e-08, + "ok": true, + "beta": 0.95, + "gamma": 0.99, + "L": 8 + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16", + "dev_Q": 1.4825960542586003e-08, + "ok": true, + "beta": 0.95, + "gamma": 0.99, + "L": 8 + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16", + "dev_Q": 2.2487416380159698e-13, + "ok": true, + "beta": 0.95, + "gamma": 0.99, + "L": 8 + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16", + "dev_Q": 1.951764225295604e-12, + "ok": true, + "beta": 0.95, + "gamma": 0.99, + "L": 8 + } + ], + "G3": [ + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 115, + "fig_argmax": 115, + "p": 0.8080808080808081, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16|frac_green", + "ok": true, + "frac_green": 0.0, + "frac_green_foldsame": 0.0 + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 36, + "fig_argmax": 36, + "p": 0.8080808080808081, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16|frac_green", + "ok": true, + "frac_green": 0.00014361213235294118, + "frac_green_foldsame": 0.00014361213235294118 + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 33, + "fig_argmax": 33, + "p": 0.8080808080808081, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16|frac_green", + "ok": true, + "frac_green": 0.12583295036764705, + "frac_green_foldsame": 0.12583295036764705 + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 39, + "fig_argmax": 39, + "p": 0.8080808080808081, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16|frac_green", + "ok": true, + "frac_green": 0.03825827205882353, + "frac_green_foldsame": 0.03825827205882353 + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 36, + "fig_argmax": 36, + "p": 0.8080808080808081, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16|frac_green", + "ok": true, + "frac_green": 0.0, + "frac_green_foldsame": 0.0 + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16", + "dev_Qmax": 0.0, + "argmax_match": true, + "ref_argmax": 99, + "fig_argmax": 99, + "p": 0.8080808080808081, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16|frac_green", + "ok": true, + "frac_green": 4.3083639705882356e-05, + "frac_green_foldsame": 4.3083639705882356e-05 + } + ], + "G5": [ + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16", + "episode": "demo_209", + "frame": 155, + "cache_episode": 209, + "ep_success": false, + "manifest_episode_success": false, + "agree": true, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16", + "episode": "demo_239", + "frame": 258, + "cache_episode": 239, + "ep_success": false, + "manifest_episode_success": false, + "agree": true, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16", + "episode": "demo_433", + "frame": 82, + "cache_episode": 433, + "ep_success": false, + "manifest_episode_success": false, + "agree": true, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16", + "episode": "demo_459", + "frame": 32, + "cache_episode": 459, + "ep_success": false, + "manifest_episode_success": false, + "agree": true, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16", + "episode": "demo_510", + "frame": 54, + "cache_episode": 510, + "ep_success": false, + "manifest_episode_success": false, + "agree": true, + "ok": true + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16", + "episode": "demo_695", + "frame": 99, + "cache_episode": 695, + "ep_success": false, + "manifest_episode_success": false, + "agree": true, + "ok": true + } + ], + "figures": [ + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16", + "episode": "demo_209", + "frame": 155, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 1.2287171202468881e-14, + "Q_chain_min": 1.816697432878746e-37, + "Q_chain_spread": 1.2287171202468881e-14, + "chain_argmax": 115, + "fold_argmax_deep": 115, + "Q_fold_max_deep": 8.725619781834587e-14, + "fold_rank_of_chain_argmax": 0, + "argmax_changed_vs_fold_deep": false, + "fold_L8_argmax": 10, + "Q_fold_L8_max": 2.3087155644419205e-15, + "argmax_changed_vs_foldL8": true, + "frac_green": 0.0, + "frac_green_foldsame": 0.0, + "frac_green_foldL8": 0.0, + "cos_mean": 0.467327356338501, + "cos_min": 0.30832764506340027, + "png": "tree_two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L34_N128_P16_dec256.png" + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16", + "episode": "demo_239", + "frame": 258, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.0031123731311620195, + "Q_chain_min": 1.6621967234329734e-27, + "Q_chain_spread": 0.0031123731311620195, + "chain_argmax": 36, + "fold_argmax_deep": 83, + "Q_fold_max_deep": 0.012296292930841446, + "fold_rank_of_chain_argmax": 3, + "argmax_changed_vs_fold_deep": true, + "fold_L8_argmax": 106, + "Q_fold_L8_max": 0.001139413914643228, + "argmax_changed_vs_foldL8": true, + "frac_green": 0.00014361213235294118, + "frac_green_foldsame": 0.00014361213235294118, + "frac_green_foldL8": 0.0, + "cos_mean": 0.5193117260932922, + "cos_min": 0.36785152554512024, + "png": "tree_two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L34_N128_P16_dec256.png" + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16", + "episode": "demo_433", + "frame": 82, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.35196247345979537, + "Q_chain_min": 0.235066574306464, + "Q_chain_spread": 0.11689589915333137, + "chain_argmax": 33, + "fold_argmax_deep": 90, + "Q_fold_max_deep": 0.7207865118980408, + "fold_rank_of_chain_argmax": 5, + "argmax_changed_vs_fold_deep": true, + "fold_L8_argmax": 90, + "Q_fold_L8_max": 0.7203031182289124, + "argmax_changed_vs_foldL8": true, + "frac_green": 0.12583295036764705, + "frac_green_foldsame": 0.12583295036764705, + "frac_green_foldL8": 0.28790283203125, + "cos_mean": 0.38691532611846924, + "cos_min": 0.2007880061864853, + "png": "tree_two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L34_N128_P16_dec256.png" + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16", + "episode": "demo_459", + "frame": 32, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.05448394466283268, + "Q_chain_min": 0.0052138442083202894, + "Q_chain_spread": 0.04927010045451239, + "chain_argmax": 39, + "fold_argmax_deep": 74, + "Q_fold_max_deep": 0.10974343866109848, + "fold_rank_of_chain_argmax": 42, + "argmax_changed_vs_fold_deep": true, + "fold_L8_argmax": 74, + "Q_fold_L8_max": 0.09135352820158005, + "argmax_changed_vs_foldL8": true, + "frac_green": 0.03825827205882353, + "frac_green_foldsame": 0.03825827205882353, + "frac_green_foldL8": 0.0179443359375, + "cos_mean": 0.45725297927856445, + "cos_min": 0.31158554553985596, + "png": "tree_two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L34_N128_P16_dec256.png" + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16", + "episode": "demo_510", + "frame": 54, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 8.238552090063737e-07, + "Q_chain_min": 3.066650252621425e-07, + "Q_chain_spread": 5.171901837442313e-07, + "chain_argmax": 36, + "fold_argmax_deep": 36, + "Q_fold_max_deep": 4.292724042898044e-06, + "fold_rank_of_chain_argmax": 0, + "argmax_changed_vs_fold_deep": false, + "fold_L8_argmax": 36, + "Q_fold_L8_max": 4.292724042898044e-06, + "argmax_changed_vs_foldL8": false, + "frac_green": 0.0, + "frac_green_foldsame": 0.0, + "frac_green_foldL8": 0.0, + "cos_mean": 0.44933438301086426, + "cos_min": 0.3743894398212433, + "png": "tree_two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L34_N128_P16_dec256.png" + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16", + "episode": "demo_695", + "frame": 99, + "chain_cap": 33, + "chain_p": 0.8080808080808081, + "Q_chain_max": 0.00013123682328650618, + "Q_chain_min": 1.0253198231200892e-19, + "Q_chain_spread": 0.00013123682328650607, + "chain_argmax": 99, + "fold_argmax_deep": 99, + "Q_fold_max_deep": 0.0005022355471737683, + "fold_rank_of_chain_argmax": 0, + "argmax_changed_vs_fold_deep": false, + "fold_L8_argmax": 60, + "Q_fold_L8_max": 3.890599691658281e-05, + "argmax_changed_vs_foldL8": true, + "frac_green": 4.3083639705882356e-05, + "frac_green_foldsame": 4.3083639705882356e-05, + "frac_green_foldL8": 0.0, + "cos_mean": 0.3928144872188568, + "cos_min": 0.2589797079563141, + "png": "tree_two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L34_N128_P16_dec256.png" + } + ], + "roots": [ + { + "name": "two_piece_expert_play_tipping_demo_209_t0155_Mbest_b0.95_L8_N128_P16", + "episode": "demo_209", + "frame": 155, + "cache_episode": 209, + "ep_len": 231 + }, + { + "name": "two_piece_expert_play_tipping_demo_239_t0258_Mbest_b0.95_L8_N128_P16", + "episode": "demo_239", + "frame": 258, + "cache_episode": 239, + "ep_len": 316 + }, + { + "name": "two_piece_expert_play_tipping_demo_433_t0082_Mbest_b0.95_L8_N128_P16", + "episode": "demo_433", + "frame": 82, + "cache_episode": 433, + "ep_len": 203 + }, + { + "name": "two_piece_expert_play_tipping_demo_459_t0032_Mbest_b0.95_L8_N128_P16", + "episode": "demo_459", + "frame": 32, + "cache_episode": 459, + "ep_len": 222 + }, + { + "name": "two_piece_expert_play_tipping_demo_510_t0054_Mbest_b0.95_L8_N128_P16", + "episode": "demo_510", + "frame": 54, + "cache_episode": 510, + "ep_len": 199 + }, + { + "name": "two_piece_expert_play_tipping_demo_695_t0099_Mbest_b0.95_L8_N128_P16", + "episode": "demo_695", + "frame": 99, + "cache_episode": 695, + "ep_len": 185 + } + ], + "manifest_L8": "runs/two_piece_expert_play_tipping/stitchviz_cap33/MANIFEST_two_piece_expert_play_tipping_Mbest_b0.95_L8.json", + "manifest_L34": "runs/two_piece_expert_play_tipping/stitchviz_cap33/MANIFEST_two_piece_expert_play_tipping_Mbest_b0.95_L34.json", + "predictions": { + "P1_all_roots_failure": { + "n_ok": 6, + "n": 6, + "right": true + }, + "P2_argmax_changed_vs_foldL8_ge2": { + "n_changed": 5, + "n": 6, + "right": true + }, + "P3_chain_Qmax_smaller_all": { + "n_smaller": 3, + "n": 6, + "right": false + }, + "P4_no_degenerate_root": { + "min_spread": 1.2287171202468881e-14, + "right": false + }, + "P5_frac_green_identical": { + "n_same": 6, + "n": 6, + "right": true + } + }, + "n_roots": 6, + "n_figs": 6, + "n_all_red": 2, + "all_red_roots": [ + "demo_209", + "demo_510" + ], + "n_argmax_changed_vs_foldL8": 5, + "n_chain_Qmax_below_foldL8": 3, + "min_chain_Q_spread": 1.2287171202468881e-14, + "max_chain_Q_spread": 0.11689589915333137, + "median_Qmax_ratio_chain_over_foldL8": 1.6639819285412771, + "max_frac_green": 0.12583295036764705, + "richest_root": "demo_433", + "summary": { + "n_roots": 6, + "n_figs": 6, + "G1_pass": 6, + "G1_n": 6, + "G2_pass": 6, + "G2_n": 6, + "G3_pass": 12, + "G3_n": 12, + "G5_pass": 6, + "G5_n": 6 + }, + "GATE_all_ok": true +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/TRACE_FOLD_CHECK.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/TRACE_FOLD_CHECK.json new file mode 100644 index 0000000000000000000000000000000000000000..dd1ff8bd4bb9774131a0be43dddf4cc3250d2c0f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/TRACE_FOLD_CHECK.json @@ -0,0 +1,406 @@ +{ + "root": "/proj/dmfexp/zwhong/rsm_rise", + "n_traces": 12, + "n_fail": 0, + "gamma": 0.99, + "temperature": 1.0, + "fold_reference": "code/rise_robomimic/robomimic/algo/rsm_scorer.py:410-411,435", + "traces": [ + { + "npz": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 5.5772947038512655e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.862645149230957e-09, + "argmax_stored": 125, + "argmax_recomputed": 125, + "argmax_agrees": true, + "green_fraction": 0.0013427734375, + "Q_min": 0.0, + "Q_max": 0.024722615256905556, + "Q_argmax": 0.024722615256905556, + "pass": true + }, + { + "npz": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 2.283457541704236e-12, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 0.0, + "argmax_stored": 7, + "argmax_recomputed": 7, + "argmax_agrees": true, + "green_fraction": 0.0, + "Q_min": 0.0, + "Q_max": 6.59219892895635e-07, + "Q_argmax": 6.59219892895635e-07, + "pass": true + }, + { + "npz": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 7.410877866931287e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 3.725290298461914e-09, + "argmax_stored": 103, + "argmax_recomputed": 103, + "argmax_agrees": true, + "green_fraction": 0.00592041015625, + "Q_min": 0.0, + "Q_max": 0.04654752463102341, + "Q_argmax": 0.04654752463102341, + "pass": true + }, + { + "npz": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 6.836317123504188e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 7.450580596923828e-09, + "argmax_stored": 16, + "argmax_recomputed": 16, + "argmax_agrees": true, + "green_fraction": 0.00164794921875, + "Q_min": 1.1423076102801133e-05, + "Q_max": 0.06528710573911667, + "Q_argmax": 0.06528710573911667, + "pass": true + }, + { + "npz": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.371305926235806e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 5.960464477539063e-08, + "argmax_stored": 38, + "argmax_recomputed": 38, + "argmax_agrees": true, + "green_fraction": 0.192138671875, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_argmax": 0.6069021821022034, + "pass": true + }, + { + "npz": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.8179069757461548, + null + ], + "max_abs_err_G": 3.8148923908742916e-08, + "max_abs_err_c_vs_sigmoid": 7.548646030475226e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 2.9802322387695312e-08, + "argmax_stored": 104, + "argmax_recomputed": 104, + "argmax_agrees": true, + "green_fraction": 0.0267333984375, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "Q_argmax": 0.2687058746814728, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 5.9413361896965e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.862645149230957e-09, + "argmax_stored": 110, + "argmax_recomputed": 110, + "argmax_agrees": true, + "green_fraction": 0.01068115234375, + "Q_min": 1.504642619706563e-22, + "Q_max": 0.03459713235497475, + "Q_argmax": 0.03459713235497475, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.8179064989089966, + null + ], + "max_abs_err_G": 4.386882342943821e-07, + "max_abs_err_c_vs_sigmoid": 8.401730966500764e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 3.725290298461914e-09, + "argmax_stored": 125, + "argmax_recomputed": 125, + "argmax_agrees": true, + "green_fraction": 0.01983642578125, + "Q_min": 0.019061341881752014, + "Q_max": 0.08237418532371521, + "Q_argmax": 0.08237418532371521, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.750405433577413e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 2.9802322387695312e-08, + "argmax_stored": 100, + "argmax_recomputed": 100, + "argmax_agrees": true, + "green_fraction": 0.0885009765625, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_argmax": 0.23481276631355286, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.512559113160734e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 2.9802322387695312e-08, + "argmax_stored": 94, + "argmax_recomputed": 94, + "argmax_agrees": true, + "green_fraction": 0.167236328125, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_argmax": 0.3141687214374542, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 6.0386157463288015e-09, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.862645149230957e-09, + "argmax_stored": 123, + "argmax_recomputed": 123, + "argmax_agrees": true, + "green_fraction": 0.0001220703125, + "Q_min": 3.7732108921773033e-06, + "Q_max": 0.02326813153922558, + "Q_argmax": 0.02326813153922558, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.533913520292202e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.4901161193847656e-08, + "argmax_stored": 2, + "argmax_recomputed": 2, + "argmax_agrees": true, + "green_fraction": 0.04156494140625, + "Q_min": 0.11163482069969177, + "Q_max": 0.1695835292339325, + "Q_argmax": 0.1695835292339325, + "pass": true + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/TRACE_FOLD_CHECK_unseen.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/TRACE_FOLD_CHECK_unseen.json new file mode 100644 index 0000000000000000000000000000000000000000..21ac5b7c328cba13cf9fb2db52ca3ea5419771ef --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/TRACE_FOLD_CHECK_unseen.json @@ -0,0 +1,418 @@ +{ + "root": "/proj/dmfexp/zwhong/rsm_rise", + "n_traces": 12, + "n_fail": 0, + "gamma": 0.99, + "temperature": 1.0, + "fold_reference": "code/rise_robomimic/robomimic/algo/rsm_scorer.py:410-411,435", + "traces": [ + { + "npz": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.531266137978832e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.1920928955078125e-07, + "G_fit_has_support": true, + "argmax_stored": 29, + "argmax_recomputed": 29, + "argmax_agrees": true, + "green_fraction": 0.19854736328125, + "Q_min": 7.292697533096276e-14, + "Q_max": 0.8514546751976013, + "Q_argmax": 0.8514546751976013, + "pass": true + }, + { + "npz": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.26528306907548e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.4901161193847656e-08, + "G_fit_has_support": true, + "argmax_stored": 64, + "argmax_recomputed": 64, + "argmax_agrees": true, + "green_fraction": 0.00738525390625, + "Q_min": 0.0, + "Q_max": 0.31185004115104675, + "Q_argmax": 0.31185004115104675, + "pass": true + }, + { + "npz": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.8179069757461548, + null + ], + "max_abs_err_G": 3.8148923908742916e-08, + "max_abs_err_c_vs_sigmoid": 5.0931280526356204e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.262177448353619e-29, + "G_fit_has_support": true, + "argmax_stored": 50, + "argmax_recomputed": 50, + "argmax_agrees": true, + "green_fraction": 0.0003662109375, + "Q_min": 0.0, + "Q_max": 0.01727997325360775, + "Q_argmax": 0.01727997325360775, + "pass": true + }, + { + "npz": "square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + null, + null, + null, + null, + null, + null, + null, + null + ], + "max_abs_err_G": NaN, + "max_abs_err_c_vs_sigmoid": 6.658315022073414e-19, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 4.930380657631324e-32, + "G_fit_has_support": false, + "argmax_stored": 2, + "argmax_recomputed": 2, + "argmax_agrees": true, + "green_fraction": 0.0, + "Q_min": 1.7168506416782297e-31, + "Q_max": 4.811029504468711e-13, + "Q_argmax": 4.811029504468711e-13, + "pass": true + }, + { + "npz": "square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + null, + null, + null, + null, + null, + null, + null, + null + ], + "max_abs_err_G": NaN, + "max_abs_err_c_vs_sigmoid": 5.0760001287391995e-15, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 2.168404344971009e-19, + "G_fit_has_support": false, + "argmax_stored": 86, + "argmax_recomputed": 86, + "argmax_agrees": true, + "green_fraction": 0.0, + "Q_min": 2.62849104257939e-15, + "Q_max": 1.5120242835564568e-08, + "Q_argmax": 1.5120242835564568e-08, + "pass": true + }, + { + "npz": "square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + null, + null, + null, + null, + null, + null, + null, + null + ], + "max_abs_err_G": NaN, + "max_abs_err_c_vs_sigmoid": 4.1248165449800584e-14, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 4.440892098500626e-16, + "G_fit_has_support": false, + "argmax_stored": 70, + "argmax_recomputed": 70, + "argmax_agrees": true, + "green_fraction": 0.0, + "Q_min": 6.232957292656716e-12, + "Q_max": 3.8730100015982316e-08, + "Q_argmax": 3.8730100015982316e-08, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.8179070353507996, + null + ], + "max_abs_err_G": 9.775356868413354e-08, + "max_abs_err_c_vs_sigmoid": 8.91656125601159e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.4901161193847656e-08, + "G_fit_has_support": true, + "argmax_stored": 73, + "argmax_recomputed": 73, + "argmax_agrees": true, + "green_fraction": 0.01348876953125, + "Q_min": 0.04491756856441498, + "Q_max": 0.09216669201850891, + "Q_argmax": 0.09216669201850891, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.8179068565368652, + 0.81790691614151, + 0.8179069757461548, + null + ], + "max_abs_err_G": 8.106036564203833e-08, + "max_abs_err_c_vs_sigmoid": 8.765336345639696e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 5.960464477539063e-08, + "G_fit_has_support": true, + "argmax_stored": 82, + "argmax_recomputed": 82, + "argmax_agrees": true, + "green_fraction": 0.12005615234375, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_argmax": 0.920602560043335, + "pass": true + }, + { + "npz": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 5.863412411155622e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.862645149230957e-09, + "G_fit_has_support": true, + "argmax_stored": 93, + "argmax_recomputed": 93, + "argmax_agrees": true, + "green_fraction": 0.0074462890625, + "Q_min": 4.965724656358361e-05, + "Q_max": 0.04319200664758682, + "Q_argmax": 0.04319200664758682, + "pass": true + }, + { + "npz": "two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.133810625032822e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 5.960464477539063e-08, + "G_fit_has_support": true, + "argmax_stored": 56, + "argmax_recomputed": 56, + "argmax_agrees": true, + "green_fraction": 0.14752197265625, + "Q_min": 0.06331731379032135, + "Q_max": 0.7066577672958374, + "Q_argmax": 0.7066577672958374, + "pass": true + }, + { + "npz": "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 8.784282423679457e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 5.960464477539063e-08, + "G_fit_has_support": true, + "argmax_stored": 72, + "argmax_recomputed": 72, + "argmax_agrees": true, + "green_fraction": 0.064453125, + "Q_min": 0.011463155038654804, + "Q_max": 0.8900830745697021, + "Q_argmax": 0.8900830745697021, + "pass": true + }, + { + "npz": "two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16.npz", + "L": 8, + "N": 128, + "P": 16, + "beta": 0.95, + "gamma": 0.99, + "T": 1.0, + "h_expected": 19.999999999999982, + "G_expected": 0.8179069375972309, + "G_fitted_per_hop": [ + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + 0.81790691614151, + null + ], + "max_abs_err_G": 2.145572086664771e-08, + "max_abs_err_c_vs_sigmoid": 7.672974078332118e-08, + "max_abs_q_terminal": 0.0, + "max_abs_err_Q_vs_mean_q0": 1.1920928955078125e-07, + "G_fit_has_support": true, + "argmax_stored": 125, + "argmax_recomputed": 125, + "argmax_agrees": true, + "green_fraction": 0.10589599609375, + "Q_min": 0.0377330482006073, + "Q_max": 0.9158510565757751, + "Q_argmax": 0.9158510565757751, + "pass": true + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/UNSEEN_NOVELTY_POWER.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/UNSEEN_NOVELTY_POWER.json new file mode 100644 index 0000000000000000000000000000000000000000..67c2f4130d11e008acd026cacf89eb094a4341a6 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/UNSEEN_NOVELTY_POWER.json @@ -0,0 +1,210 @@ +{ + "what": "exact power / decision table for the pre-registered one-sided sign test on gen_q#270 out-of-sample anchors", + "preregistered": { + "statistic": "d = mean_k nn_train_cos(chosen) - mean_k nn_train_cos(rejected)", + "alternative": "d < 0", + "test": "exact sign test, one-sided", + "alpha": 0.05, + "max_n": 15, + "excluded": "square_sub_20100 (degenerate Q); any anchor with Q_max-Q_min < 1e-6" + }, + "hypothesis_forming_rate": "6/9 = 0.667 negative, mean d = -0.105, two-sided p = 0.51", + "note": "At the maximum n = 15 the test needs 12/15 anchors negative to reach alpha = 0.05; at the hypothesis-forming rate pi = 0.667 its power is the '0.6667' entry for n = 15. A null at this n is therefore uninformative about a moderate effect and will be reported as such.", + "rows": [ + { + "n": 3, + "k_crit": null, + "p_at_k_crit": null, + "p_at_k_crit_minus_1": null, + "frac_needed": "unreachable", + "power": { + "0.5": 0.0, + "0.6667": 0.0, + "0.75": 0.0, + "0.8": 0.0, + "0.9": 0.0, + "1.0": 0.0 + } + }, + { + "n": 4, + "k_crit": null, + "p_at_k_crit": null, + "p_at_k_crit_minus_1": null, + "frac_needed": "unreachable", + "power": { + "0.5": 0.0, + "0.6667": 0.0, + "0.75": 0.0, + "0.8": 0.0, + "0.9": 0.0, + "1.0": 0.0 + } + }, + { + "n": 5, + "k_crit": 5, + "p_at_k_crit": 0.03125, + "p_at_k_crit_minus_1": 0.1875, + "frac_needed": "5/5", + "power": { + "0.5": 0.0312, + "0.6667": 0.1317, + "0.75": 0.2373, + "0.8": 0.3277, + "0.9": 0.5905, + "1.0": 1.0 + } + }, + { + "n": 6, + "k_crit": 6, + "p_at_k_crit": 0.015625, + "p_at_k_crit_minus_1": 0.109375, + "frac_needed": "6/6", + "power": { + "0.5": 0.0156, + "0.6667": 0.0878, + "0.75": 0.178, + "0.8": 0.2621, + "0.9": 0.5314, + "1.0": 1.0 + } + }, + { + "n": 7, + "k_crit": 7, + "p_at_k_crit": 0.007812, + "p_at_k_crit_minus_1": 0.0625, + "frac_needed": "7/7", + "power": { + "0.5": 0.0078, + "0.6667": 0.0585, + "0.75": 0.1335, + "0.8": 0.2097, + "0.9": 0.4783, + "1.0": 1.0 + } + }, + { + "n": 8, + "k_crit": 7, + "p_at_k_crit": 0.035156, + "p_at_k_crit_minus_1": 0.144531, + "frac_needed": "7/8", + "power": { + "0.5": 0.0352, + "0.6667": 0.1951, + "0.75": 0.3671, + "0.8": 0.5033, + "0.9": 0.8131, + "1.0": 1.0 + } + }, + { + "n": 9, + "k_crit": 8, + "p_at_k_crit": 0.019531, + "p_at_k_crit_minus_1": 0.089844, + "frac_needed": "8/9", + "power": { + "0.5": 0.0195, + "0.6667": 0.1431, + "0.75": 0.3003, + "0.8": 0.4362, + "0.9": 0.7748, + "1.0": 1.0 + } + }, + { + "n": 10, + "k_crit": 9, + "p_at_k_crit": 0.010742, + "p_at_k_crit_minus_1": 0.054688, + "frac_needed": "9/10", + "power": { + "0.5": 0.0107, + "0.6667": 0.1041, + "0.75": 0.244, + "0.8": 0.3758, + "0.9": 0.7361, + "1.0": 1.0 + } + }, + { + "n": 11, + "k_crit": 9, + "p_at_k_crit": 0.032715, + "p_at_k_crit_minus_1": 0.113281, + "frac_needed": "9/11", + "power": { + "0.5": 0.0327, + "0.6667": 0.2342, + "0.75": 0.4552, + "0.8": 0.6174, + "0.9": 0.9104, + "1.0": 1.0 + } + }, + { + "n": 12, + "k_crit": 10, + "p_at_k_crit": 0.019287, + "p_at_k_crit_minus_1": 0.072998, + "frac_needed": "10/12", + "power": { + "0.5": 0.0193, + "0.6667": 0.1812, + "0.75": 0.3907, + "0.8": 0.5583, + "0.9": 0.8891, + "1.0": 1.0 + } + }, + { + "n": 13, + "k_crit": 10, + "p_at_k_crit": 0.046143, + "p_at_k_crit_minus_1": 0.133423, + "frac_needed": "10/13", + "power": { + "0.5": 0.0461, + "0.6667": 0.3225, + "0.75": 0.5843, + "0.8": 0.7473, + "0.9": 0.9658, + "1.0": 1.0 + } + }, + { + "n": 14, + "k_crit": 11, + "p_at_k_crit": 0.028687, + "p_at_k_crit_minus_1": 0.089783, + "frac_needed": "11/14", + "power": { + "0.5": 0.0287, + "0.6667": 0.2613, + "0.75": 0.5213, + "0.8": 0.6982, + "0.9": 0.9559, + "1.0": 1.0 + } + }, + { + "n": 15, + "k_crit": 12, + "p_at_k_crit": 0.017578, + "p_at_k_crit_minus_1": 0.059235, + "frac_needed": "12/15", + "power": { + "0.5": 0.0176, + "0.6667": 0.2093, + "0.75": 0.4613, + "0.8": 0.6482, + "0.9": 0.9444, + "1.0": 1.0 + } + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/UNSEEN_NOVELTY_REPLICATION.json b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/UNSEEN_NOVELTY_REPLICATION.json new file mode 100644 index 0000000000000000000000000000000000000000..0b3a8bf691b814ab72561579f674e854f5267ede --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/pixdec/UNSEEN_NOVELTY_REPLICATION.json @@ -0,0 +1,378 @@ +{ + "preregistered": "status/real/STITCH_UNSEEN.md run 3", + "statistic": "mean_k nn_train_cos(CHOSEN) - mean_k nn_train_cos(REJECTED), k=1..L, particle 0", + "alternative": "d < 0 (chosen further from the training set than rejected)", + "excluded_tasks": [ + "square_sub_20100" + ], + "q_eps": 1e-06, + "test_rank_from": 99, + "n_anchors_captured": 12, + "n_excluded_task": 3, + "n_degenerate_Q": 0, + "OUT_OF_SAMPLE": { + "anchors": [], + "mean_d": null, + "median_d": null, + "n_negative": 0, + "sign_test": { + "n": 0, + "k": 0, + "p_one_sided": null, + "p_two_sided": null + } + }, + "HYPOTHESIS_FORMING": { + "n": 9, + "n_negative": 6, + "mean_d": -0.10538796583811443 + }, + "POOLED_DESCRIPTIVE_ONLY": { + "n": 9, + "n_negative": 6, + "mean_d": -0.10538796583811443, + "sign_test": { + "n": 9, + "k": 6, + "p_one_sided": 0.25390625, + "p_two_sided": 0.5078125 + } + }, + "per_task": { + "square_expert_play": { + "n": 3, + "n_negative": 2, + "mean_d": -0.04534211754798889 + }, + "two_piece_expert_play": { + "n": 3, + "n_negative": 1, + "mean_d": -0.0008303622404734293 + }, + "two_piece_expert_suboptimal": { + "n": 3, + "n_negative": 3, + "mean_d": -0.2699914177258809 + } + }, + "determinism_audit": { + "n": 12, + "all_reproduce": true, + "entries": [ + { + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "rank": 1, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "rank": 2, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "rank": 3, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16", + "rank": 1, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16", + "rank": 2, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16", + "rank": 3, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "rank": 1, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "rank": 2, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "rank": 3, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16", + "rank": 1, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16", + "rank": 2, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + }, + { + "name": "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16", + "rank": 3, + "reproduces_shipped": true, + "max_abs_Q_diff": 0.0 + } + ] + }, + "anchors": [ + { + "task": "square_expert_play", + "rank": 1, + "name": "square_expert_play_demo_198_t0110_L40best_b0.95_L8_N128_P16", + "episode": "demo_198", + "frame": 110, + "held_out": true, + "argmax": 64, + "rejected": 29, + "Q_min": 0.0, + "Q_max": 0.31185004115104675, + "Q_spread": 0.31185004115104675, + "nn_train_cos_chosen": 0.4622034728527069, + "nn_train_cos_rejected": 0.552628755569458, + "d": -0.0904252827167511, + "nn_train_cos_root": 0.5324699282646179, + "anchor_nn_train_cos_dist": 0.46639013290405273, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "square_expert_play", + "rank": 2, + "name": "square_expert_play_demo_54_t0122_L40best_b0.95_L8_N128_P16", + "episode": "demo_54", + "frame": 122, + "held_out": true, + "argmax": 50, + "rejected": 15, + "Q_min": 0.0, + "Q_max": 0.01727997325360775, + "Q_spread": 0.01727997325360775, + "nn_train_cos_chosen": 0.6062448024749756, + "nn_train_cos_rejected": 0.581114649772644, + "d": 0.025130152702331543, + "nn_train_cos_root": 0.5340985655784607, + "anchor_nn_train_cos_dist": 0.46615177392959595, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "square_expert_play", + "rank": 3, + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "episode": "demo_181", + "frame": 135, + "held_out": true, + "argmax": 29, + "rejected": 33, + "Q_min": 7.292697533096276e-14, + "Q_max": 0.8514546751976013, + "Q_spread": 0.8514546751976013, + "nn_train_cos_chosen": 0.5035935640335083, + "nn_train_cos_rejected": 0.5743247866630554, + "d": -0.07073122262954712, + "nn_train_cos_root": 0.5962226390838623, + "anchor_nn_train_cos_dist": 0.40436023473739624, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "square_sub_20100", + "rank": 1, + "name": "square_sub_20100_demo_147_t0234_Mbest_b0.95_L8_N128_P16", + "episode": "demo_147", + "frame": 234, + "held_out": true, + "argmax": 86, + "rejected": 24, + "Q_min": 2.62849104257939e-15, + "Q_max": 1.5120242835564568e-08, + "Q_spread": 1.512024105920773e-08, + "nn_train_cos_chosen": 0.3008754849433899, + "nn_train_cos_rejected": 0.31321120262145996, + "d": -0.012335717678070068, + "nn_train_cos_root": 0.46307995915412903, + "anchor_nn_train_cos_dist": 0.535770058631897, + "excluded_task": true, + "degenerate_Q": true + }, + { + "task": "square_sub_20100", + "rank": 2, + "name": "square_sub_20100_demo_181_t0252_Mbest_b0.95_L8_N128_P16", + "episode": "demo_181", + "frame": 252, + "held_out": true, + "argmax": 70, + "rejected": 91, + "Q_min": 6.232957292656716e-12, + "Q_max": 3.8730100015982316e-08, + "Q_spread": 3.87238685561897e-08, + "nn_train_cos_chosen": 0.31954440474510193, + "nn_train_cos_rejected": 0.3353521227836609, + "d": -0.01580771803855896, + "nn_train_cos_root": 0.5009185075759888, + "anchor_nn_train_cos_dist": 0.4993113875389099, + "excluded_task": true, + "degenerate_Q": true + }, + { + "task": "square_sub_20100", + "rank": 3, + "name": "square_sub_20100_demo_116_t0062_Mbest_b0.95_L8_N128_P16", + "episode": "demo_116", + "frame": 62, + "held_out": true, + "argmax": 2, + "rejected": 96, + "Q_min": 1.7168506416782297e-31, + "Q_max": 4.811029504468711e-13, + "Q_spread": 4.811029504468711e-13, + "nn_train_cos_chosen": 0.32210859656333923, + "nn_train_cos_rejected": 0.3013734519481659, + "d": 0.02073514461517334, + "nn_train_cos_root": 0.5251969695091248, + "anchor_nn_train_cos_dist": 0.47579145431518555, + "excluded_task": true, + "degenerate_Q": true + }, + { + "task": "two_piece_expert_play", + "rank": 1, + "name": "two_piece_expert_play_demo_38_t0067_L40best_b0.95_L8_N128_P16", + "episode": "demo_38", + "frame": 67, + "held_out": true, + "argmax": 93, + "rejected": 117, + "Q_min": 4.965724656358361e-05, + "Q_max": 0.04319200664758682, + "Q_spread": 0.043142348527908325, + "nn_train_cos_chosen": 0.550724446773529, + "nn_train_cos_rejected": 0.5562039017677307, + "d": -0.00547945499420166, + "nn_train_cos_root": 0.5697985291481018, + "anchor_nn_train_cos_dist": 0.4285218119621277, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "two_piece_expert_play", + "rank": 2, + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "episode": "demo_18", + "frame": 96, + "held_out": true, + "argmax": 82, + "rejected": 85, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_spread": 0.9192078709602356, + "nn_train_cos_chosen": 0.4583876430988312, + "nn_train_cos_rejected": 0.45726412534713745, + "d": 0.0011235177516937256, + "nn_train_cos_root": 0.5873196125030518, + "anchor_nn_train_cos_dist": 0.4116707444190979, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "two_piece_expert_play", + "rank": 3, + "name": "two_piece_expert_play_demo_128_t0115_L40best_b0.95_L8_N128_P16", + "episode": "demo_128", + "frame": 115, + "held_out": true, + "argmax": 73, + "rejected": 114, + "Q_min": 0.04491756856441498, + "Q_max": 0.09216669201850891, + "Q_spread": 0.04724912345409393, + "nn_train_cos_chosen": 0.4412316679954529, + "nn_train_cos_rejected": 0.43936681747436523, + "d": 0.0018648505210876465, + "nn_train_cos_root": 0.5984864830970764, + "anchor_nn_train_cos_dist": 0.40183407068252563, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "two_piece_expert_suboptimal", + "rank": 1, + "name": "two_piece_expert_suboptimal_demo_5_t0159_Mproghead_b0.95_L8_N128_P16", + "episode": "demo_5", + "frame": 159, + "held_out": true, + "argmax": 125, + "rejected": 31, + "Q_min": 0.0377330482006073, + "Q_max": 0.9158510565757751, + "Q_spread": 0.8781180381774902, + "nn_train_cos_chosen": 0.41280597448349, + "nn_train_cos_rejected": 0.631396472454071, + "d": -0.21859049797058105, + "nn_train_cos_root": 0.5739016532897949, + "anchor_nn_train_cos_dist": 0.4271807074546814, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "two_piece_expert_suboptimal", + "rank": 2, + "name": "two_piece_expert_suboptimal_demo_1_t0070_Mproghead_b0.95_L8_N128_P16", + "episode": "demo_1", + "frame": 70, + "held_out": true, + "argmax": 56, + "rejected": 61, + "Q_min": 0.06331731379032135, + "Q_max": 0.7066577672958374, + "Q_spread": 0.6433404684066772, + "nn_train_cos_chosen": 0.3693690299987793, + "nn_train_cos_rejected": 0.6425602436065674, + "d": -0.2731912136077881, + "nn_train_cos_root": 0.6146647930145264, + "anchor_nn_train_cos_dist": 0.38624584674835205, + "excluded_task": false, + "degenerate_Q": false + }, + { + "task": "two_piece_expert_suboptimal", + "rank": 3, + "name": "two_piece_expert_suboptimal_demo_27_t0156_Mproghead_b0.95_L8_N128_P16", + "episode": "demo_27", + "frame": 156, + "held_out": true, + "argmax": 72, + "rejected": 6, + "Q_min": 0.011463155038654804, + "Q_max": 0.8900830745697021, + "Q_spread": 0.878619909286499, + "nn_train_cos_chosen": 0.3261023163795471, + "nn_train_cos_rejected": 0.6442948579788208, + "d": -0.3181925415992737, + "nn_train_cos_root": 0.6493762731552124, + "anchor_nn_train_cos_dist": 0.35205137729644775, + "excluded_task": false, + "degenerate_Q": false + } + ] +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json new file mode 100644 index 0000000000000000000000000000000000000000..6c6c6a52451ac2124bbd6857ecc85c7dd2cabeb3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json @@ -0,0 +1,284 @@ +[ + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_36", + "cache_episode": 36, + "frame": 56, + "ep_len": 387, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_mean": 0.21865592896938324, + "argmax": 38, + "Q_argmax": 0.6069021821022034, + "frac_green": 0.192138671875, + "episode_success": false + }, + { + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_110", + "cache_episode": 110, + "frame": 104, + "ep_len": 369, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.0, + "Q_max": 6.59219892895635e-07, + "Q_mean": 3.947585014429933e-07, + "argmax": 7, + "Q_argmax": 6.59219892895635e-07, + "frac_green": 0.0, + "episode_success": false + }, + { + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_102", + "cache_episode": 102, + "frame": 145, + "ep_len": 349, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.0, + "Q_max": 0.024722615256905556, + "Q_mean": 0.004339417442679405, + "argmax": 125, + "Q_argmax": 0.024722615256905556, + "frac_green": 0.0013427734375, + "episode_success": false + }, + { + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_160", + "cache_episode": 160, + "frame": 165, + "ep_len": 301, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.0, + "Q_max": 0.04654752463102341, + "Q_mean": 0.02459246665239334, + "argmax": 103, + "Q_argmax": 0.04654752463102341, + "frac_green": 0.00592041015625, + "episode_success": false + }, + { + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_84", + "cache_episode": 84, + "frame": 390, + "ep_len": 561, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 2.9439463144088007e-25, + "Q_max": 0.2687058746814728, + "Q_mean": 0.04051218926906586, + "argmax": 104, + "Q_argmax": 0.2687058746814728, + "frac_green": 0.0267333984375, + "episode_success": false + }, + { + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_221", + "cache_episode": 221, + "frame": 249, + "ep_len": 305, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 1.1423076102801133e-05, + "Q_max": 0.06528710573911667, + "Q_mean": 0.009741624817252159, + "argmax": 16, + "Q_argmax": 0.06528710573911667, + "frac_green": 0.00164794921875, + "episode_success": false + }, + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json.bak.20260924_run35_clobbered b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json.bak.20260924_run35_clobbered new file mode 100644 index 0000000000000000000000000000000000000000..580cb62b5d6c1d70602f3bd3ae3715f18d3b425d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/MANIFEST_square_expert_play_L40best_b0.95_L8.json.bak.20260924_run35_clobbered @@ -0,0 +1,74 @@ +[ + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_36", + "frame": 56, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_110_t0104_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_110", + "frame": 104, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_102_t0145_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_102", + "frame": 145, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_160_t0165_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_160", + "frame": 165, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_84_t0390_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_84", + "frame": 390, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "square_expert_play_demo_221_t0249_L40best_b0.95_L8_N128_P16_chain", + "task": "square_expert_play", + "episode": "demo_221", + "frame": 249, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json new file mode 100644 index 0000000000000000000000000000000000000000..ee149ac6805256df7da978f21d91629b31ae2b1d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json @@ -0,0 +1,273 @@ +{ + "task": "square_expert_play", + "regime": "coverage", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "split": { + "n_ep": 424, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 2, + 18, + 19, + 27, + 54, + 71, + 83, + 84, + 85, + 88, + 93, + 98, + 111, + 136, + 145, + 148, + 150, + 155, + 164, + 181, + 198, + 201, + 212, + 251, + 261, + 286, + 291, + 298, + 313, + 320, + 324, + 325, + 330, + 342, + 344, + 374, + 384, + 390, + 392, + 394, + 400, + 411 + ], + "val_episode_keys": [ + "demo_2", + "demo_18", + "demo_19", + "demo_27", + "demo_54", + "demo_71", + "demo_83", + "demo_84", + "demo_85", + "demo_88", + "demo_93", + "demo_98", + "demo_111", + "demo_136", + "demo_145", + "demo_148", + "demo_150", + "demo_155", + "demo_164", + "demo_181", + "demo_198", + "demo_201", + "demo_212", + "demo_251", + "demo_261", + "demo_286", + "demo_291", + "demo_298", + "demo_313", + "demo_320", + "demo_324", + "demo_325", + "demo_330", + "demo_342", + "demo_344", + "demo_374", + "demo_384", + "demo_390", + "demo_392", + "demo_394", + "demo_400", + "demo_411" + ], + "n_train_eps": 382, + "n_train_rows": 138913, + "n_cache_rows": 154446, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_candidate_frames": 564, + "n_candidate_episodes": 23, + "candidate_cos_dist": { + "min": 0.07806694507598877, + "median": 0.20079442858695984, + "max": 0.46639013290405273 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06544617563486099, + "median": 0.151137113571167, + "p95": 0.3123064637184143, + "max": 0.5172842741012573 + }, + "l2": { + "p05": 13.703124046325684, + "median": 21.106897354125977, + "p95": 31.685073852539062, + "max": 45.834537506103516 + } + }, + "anchors": [ + { + "episode": "demo_198", + "cache_episode": 198, + "frame": 110, + "cache_row": 69467, + "ep_len": 476, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.46639013290405273, + "nn_train_cos": 0.5336098670959473, + "nn_train_l2": 35.95292663574219, + "nn_train_episode": "demo_163", + "nn_train_cache_episode": 163, + "nn_train_frame": 95, + "nn_train_row": 58211, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_54", + "cache_episode": 54, + "frame": 122, + "cache_row": 18679, + "ep_len": 423, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.46615177392959595, + "nn_train_cos": 0.533848226070404, + "nn_train_l2": 31.817819595336914, + "nn_train_episode": "demo_9", + "nn_train_cache_episode": 9, + "nn_train_frame": 118, + "nn_train_row": 3615, + "pctile_among_candidates": 99.822695035461 + }, + { + "episode": "demo_181", + "cache_episode": 181, + "frame": 135, + "cache_row": 64058, + "ep_len": 314, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.40436023473739624, + "nn_train_cos": 0.5956397652626038, + "nn_train_l2": 26.96146011352539, + "nn_train_episode": "demo_307", + "nn_train_cache_episode": 307, + "nn_train_frame": 152, + "nn_train_row": 109837, + "pctile_among_candidates": 98.75886524822694 + }, + { + "episode": "demo_148", + "cache_episode": 148, + "frame": 138, + "cache_row": 53880, + "ep_len": 335, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.39988887310028076, + "nn_train_cos": 0.6001111268997192, + "nn_train_l2": 36.87656784057617, + "nn_train_episode": "demo_34", + "nn_train_cache_episode": 34, + "nn_train_frame": 129, + "nn_train_row": 11759, + "pctile_among_candidates": 98.58156028368793 + }, + { + "episode": "demo_164", + "cache_episode": 164, + "frame": 93, + "cache_row": 58634, + "ep_len": 229, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.37960076332092285, + "nn_train_cos": 0.6203992366790771, + "nn_train_l2": 40.81599807739258, + "nn_train_episode": "demo_163", + "nn_train_cache_episode": 163, + "nn_train_frame": 248, + "nn_train_row": 58364, + "pctile_among_candidates": 97.16312056737588 + }, + { + "episode": "demo_212", + "cache_episode": 212, + "frame": 141, + "cache_row": 74152, + "ep_len": 349, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.3715987801551819, + "nn_train_cos": 0.6284012198448181, + "nn_train_l2": 26.955469131469727, + "nn_train_episode": "demo_182", + "nn_train_cache_episode": 182, + "nn_train_frame": 103, + "nn_train_row": 64340, + "pctile_among_candidates": 96.80851063829788 + }, + { + "episode": "demo_150", + "cache_episode": 150, + "frame": 125, + "cache_row": 54509, + "ep_len": 243, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.36914950609207153, + "nn_train_cos": 0.6308504939079285, + "nn_train_l2": 32.97736740112305, + "nn_train_episode": "demo_140", + "nn_train_cache_episode": 140, + "nn_train_frame": 109, + "nn_train_row": 51524, + "pctile_among_candidates": 96.63120567375887 + }, + { + "episode": "demo_88", + "cache_episode": 88, + "frame": 144, + "cache_row": 31329, + "ep_len": 370, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.35783618688583374, + "nn_train_cos": 0.6421638131141663, + "nn_train_l2": 34.72486877441406, + "nn_train_episode": "demo_24", + "nn_train_cache_episode": 24, + "nn_train_frame": 117, + "nn_train_row": 8587, + "pctile_among_candidates": 95.56737588652481 + } + ], + "states_arg": "demo_198:110,demo_54:122,demo_181:135,demo_148:138,demo_164:93,demo_212:141,demo_150:125,demo_88:144" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS_square_expert_play_L40best.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS_square_expert_play_L40best.json new file mode 100644 index 0000000000000000000000000000000000000000..7cb91979c10550d4bc97be760e98767ab03daa1f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS_square_expert_play_L40best.json @@ -0,0 +1,188 @@ +{ + "task": "square_expert_play", + "regime": "coverage", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "split": { + "n_ep": 424, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 2, + 18, + 19, + 27, + 54, + 71, + 83, + 84, + 85, + 88, + 93, + 98, + 111, + 136, + 145, + 148, + 150, + 155, + 164, + 181, + 198, + 201, + 212, + 251, + 261, + 286, + 291, + 298, + 313, + 320, + 324, + 325, + 330, + 342, + 344, + 374, + 384, + 390, + 392, + 394, + 400, + 411 + ], + "val_episode_keys": [ + "demo_2", + "demo_18", + "demo_19", + "demo_27", + "demo_54", + "demo_71", + "demo_83", + "demo_84", + "demo_85", + "demo_88", + "demo_93", + "demo_98", + "demo_111", + "demo_136", + "demo_145", + "demo_148", + "demo_150", + "demo_155", + "demo_164", + "demo_181", + "demo_198", + "demo_201", + "demo_212", + "demo_251", + "demo_261", + "demo_286", + "demo_291", + "demo_298", + "demo_313", + "demo_320", + "demo_324", + "demo_325", + "demo_330", + "demo_342", + "demo_344", + "demo_374", + "demo_384", + "demo_390", + "demo_392", + "demo_394", + "demo_400", + "demo_411" + ], + "n_train_eps": 382, + "n_train_rows": 138913, + "n_cache_rows": 154446, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_candidate_frames": 564, + "n_candidate_episodes": 23, + "candidate_cos_dist": { + "min": 0.07806694507598877, + "median": 0.20079442858695984, + "max": 0.46639013290405273 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06544617563486099, + "median": 0.151137113571167, + "p95": 0.3123064637184143, + "max": 0.5172842741012573 + }, + "l2": { + "p05": 13.703124046325684, + "median": 21.106897354125977, + "p95": 31.685073852539062, + "max": 45.834537506103516 + } + }, + "anchors": [ + { + "episode": "demo_198", + "cache_episode": 198, + "frame": 110, + "cache_row": 69467, + "ep_len": 476, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.46639013290405273, + "nn_train_cos": 0.5336098670959473, + "nn_train_l2": 35.95292663574219, + "nn_train_episode": "demo_163", + "nn_train_cache_episode": 163, + "nn_train_frame": 95, + "nn_train_row": 58211, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_54", + "cache_episode": 54, + "frame": 122, + "cache_row": 18679, + "ep_len": 423, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.46615177392959595, + "nn_train_cos": 0.533848226070404, + "nn_train_l2": 31.817819595336914, + "nn_train_episode": "demo_9", + "nn_train_cache_episode": 9, + "nn_train_frame": 118, + "nn_train_row": 3615, + "pctile_among_candidates": 99.822695035461 + }, + { + "episode": "demo_181", + "cache_episode": 181, + "frame": 135, + "cache_row": 64058, + "ep_len": 314, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.40436023473739624, + "nn_train_cos": 0.5956397652626038, + "nn_train_l2": 26.96146011352539, + "nn_train_episode": "demo_307", + "nn_train_cache_episode": 307, + "nn_train_frame": 152, + "nn_train_row": 109837, + "pctile_among_candidates": 98.75886524822694 + } + ], + "states_arg": "demo_198:110,demo_54:122,demo_181:135" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz_split/MANIFEST_square_expert_play_L40best_b0.95_L8.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz_split/MANIFEST_square_expert_play_L40best_b0.95_L8.json new file mode 100644 index 0000000000000000000000000000000000000000..ade7bef553a764f796036cdc41386e2f232c4ceb --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz_split/MANIFEST_square_expert_play_L40best_b0.95_L8.json @@ -0,0 +1,128 @@ +[ + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_36", + "cache_episode": 36, + "frame": 56, + "ep_len": 387, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_mean": 0.21865592896938324, + "argmax": 38, + "Q_argmax": 0.6069021821022034, + "frac_green": 0.192138671875, + "episode_success": false + }, + { + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_181", + "cache_episode": 181, + "frame": 135, + "ep_len": 314, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_mean": 0.7081980109214783, + "argmax": 98, + "Q_argmax": 0.849848747253418, + "frac_green": 0.207275390625, + "episode_success": false, + "unseen": { + "anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS8_square_expert_play_L40best.json", + "split": { + "n_ep": 424, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_val_eps": 42, + "n_train_eps": 382, + "n_train_rows": 138913, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06544617563486099, + "median": 0.151137113571167, + "p95": 0.3123064637184143, + "max": 0.5172842741012573 + }, + "l2": { + "p05": 13.703124046325684, + "median": 21.106897354125977, + "p95": 31.685073852539062, + "max": 45.834537506103516 + } + }, + "regime": "coverage", + "anchor_rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt" + }, + "anchor": { + "episode": "demo_181", + "cache_episode": 181, + "frame": 135, + "cache_row": 64058, + "ep_len": 314, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.40436023473739624, + "nn_train_cos": 0.5956397652626038, + "nn_train_l2": 26.96146011352539, + "nn_train_episode": "demo_307", + "nn_train_cache_episode": 307, + "nn_train_frame": 152, + "nn_train_row": 109837, + "pctile_among_candidates": 98.75886524822694 + }, + "held_out": true + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz_split2/MANIFEST_square_expert_play_L40best_b0.95_L8.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz_split2/MANIFEST_square_expert_play_L40best_b0.95_L8.json new file mode 100644 index 0000000000000000000000000000000000000000..c102bd6d8a927971c33420a921c0bc03ca105c0c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_expert_play/stitchviz_split2/MANIFEST_square_expert_play_L40best_b0.95_L8.json @@ -0,0 +1,167 @@ +[ + { + "name": "square_expert_play_demo_36_t0056_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_36", + "cache_episode": 36, + "frame": 56, + "ep_len": 387, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 6.543320023036412e-28, + "Q_max": 0.6069021821022034, + "Q_mean": 0.21865592896938324, + "argmax": 38, + "Q_argmax": 0.6069021821022034, + "frac_green": 0.192138671875, + "episode_success": false + }, + { + "name": "square_expert_play_demo_172_t0038_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_172", + "cache_episode": 172, + "frame": 38, + "ep_len": 268, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.0003339288232382387, + "Q_max": 0.5210829973220825, + "Q_mean": 0.35921165347099304, + "argmax": 73, + "Q_argmax": 0.5210829973220825, + "frac_green": 0.12725830078125, + "episode_success": false, + "unseen": null, + "anchor": null, + "held_out": null + }, + { + "name": "square_expert_play_demo_181_t0135_L40best_b0.95_L8_N128_P16", + "task": "square_expert_play", + "episode": "demo_181", + "cache_episode": 181, + "frame": 135, + "ep_len": 314, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/policy/S0A_seed0/square_expert_play_S0A_s0/20260918064141/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/square_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/square_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 5.046060791435991e-12, + "Q_max": 0.849848747253418, + "Q_mean": 0.7081980109214783, + "argmax": 98, + "Q_argmax": 0.849848747253418, + "frac_green": 0.207275390625, + "episode_success": false, + "unseen": { + "anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/stitchviz/UNSEEN_ANCHORS_square_expert_play_L40best.json", + "split": { + "n_ep": 424, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_val_eps": 42, + "n_train_eps": 382, + "n_train_rows": 138913, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06544617563486099, + "median": 0.151137113571167, + "p95": 0.3123064637184143, + "max": 0.5172842741012573 + }, + "l2": { + "p05": 13.703124046325684, + "median": 21.106897354125977, + "p95": 31.685073852539062, + "max": 45.834537506103516 + } + }, + "regime": "coverage", + "anchor_rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_expert_play/rsm/L40/ckpt_best.pt" + }, + "anchor": { + "episode": "demo_181", + "cache_episode": 181, + "frame": 135, + "cache_row": 64058, + "ep_len": 314, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.40436023473739624, + "nn_train_cos": 0.5956397652626038, + "nn_train_l2": 26.96146011352539, + "nn_train_episode": "demo_307", + "nn_train_cache_episode": 307, + "nn_train_frame": 152, + "nn_train_row": 109837, + "pctile_among_candidates": 98.75886524822694 + }, + "held_out": true + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json new file mode 100644 index 0000000000000000000000000000000000000000..cdf9216fc3facbb463f0ad6560baebaa9c702240 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS8_square_sub_20100_Mbest.json @@ -0,0 +1,213 @@ +{ + "task": "square_sub_20100", + "regime": "suboptimal", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/M/ckpt_best.pt", + "rsm_model": "M", + "rsm_ckpt_name": "best", + "split": { + "n_ep": 120, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 1, + 5, + 13, + 16, + 23, + 27, + 36, + 50, + 67, + 101, + 107, + 114 + ], + "val_episode_keys": [ + "demo_7", + "demo_22", + "demo_73", + "demo_86", + "demo_103", + "demo_107", + "demo_116", + "demo_130", + "demo_147", + "demo_181", + "demo_187", + "demo_194" + ], + "n_train_eps": 108, + "n_train_rows": 35692, + "n_cache_rows": 39473, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_candidate_frames": 206, + "n_candidate_episodes": 8, + "candidate_cos_dist": { + "min": 0.07774794101715088, + "median": 0.26447781920433044, + "max": 0.535770058631897 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.11607521027326584, + "median": 0.23063930869102478, + "p95": 0.3910636901855469, + "max": 0.5860507488250732 + }, + "l2": { + "p05": 18.504926681518555, + "median": 25.483848571777344, + "p95": 37.431941986083984, + "max": 49.2202262878418 + } + }, + "anchors": [ + { + "episode": "demo_147", + "cache_episode": 67, + "frame": 234, + "cache_row": 21467, + "ep_len": 771, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.535770058631897, + "nn_train_cos": 0.464229941368103, + "nn_train_l2": 43.83781814575195, + "nn_train_episode": "demo_176", + "nn_train_cache_episode": 96, + "nn_train_frame": 168, + "nn_train_row": 31618, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_181", + "cache_episode": 101, + "frame": 252, + "cache_row": 33508, + "ep_len": 357, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4993113875389099, + "nn_train_cos": 0.5006886124610901, + "nn_train_l2": 36.77060317993164, + "nn_train_episode": "demo_185", + "nn_train_cache_episode": 105, + "nn_train_frame": 172, + "nn_train_row": 34723, + "pctile_among_candidates": 97.57281553398059 + }, + { + "episode": "demo_116", + "cache_episode": 36, + "frame": 62, + "cache_row": 10276, + "ep_len": 428, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.47579145431518555, + "nn_train_cos": 0.5242085456848145, + "nn_train_l2": 39.785282135009766, + "nn_train_episode": "demo_133", + "nn_train_cache_episode": 53, + "nn_train_frame": 64, + "nn_train_row": 15880, + "pctile_among_candidates": 93.68932038834951 + }, + { + "episode": "demo_130", + "cache_episode": 50, + "frame": 83, + "cache_row": 14991, + "ep_len": 300, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4488602876663208, + "nn_train_cos": 0.5511397123336792, + "nn_train_l2": 37.683021545410156, + "nn_train_episode": "demo_30", + "nn_train_cache_episode": 8, + "nn_train_frame": 26, + "nn_train_row": 1341, + "pctile_among_candidates": 89.80582524271846 + }, + { + "episode": "demo_187", + "cache_episode": 107, + "frame": 49, + "cache_row": 35154, + "ep_len": 206, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.420306921005249, + "nn_train_cos": 0.579693078994751, + "nn_train_l2": 27.480791091918945, + "nn_train_episode": "demo_155", + "nn_train_cache_episode": 75, + "nn_train_frame": 54, + "nn_train_row": 24047, + "pctile_among_candidates": 87.37864077669903 + }, + { + "episode": "demo_103", + "cache_episode": 23, + "frame": 320, + "cache_row": 5541, + "ep_len": 411, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.39990395307540894, + "nn_train_cos": 0.6000960469245911, + "nn_train_l2": 31.95719337463379, + "nn_train_episode": "demo_53", + "nn_train_cache_episode": 10, + "nn_train_frame": 139, + "nn_train_row": 1768, + "pctile_among_candidates": 85.43689320388349 + }, + { + "episode": "demo_194", + "cache_episode": 114, + "frame": 29, + "cache_row": 37571, + "ep_len": 203, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.2875988483428955, + "nn_train_cos": 0.7124011516571045, + "nn_train_l2": 26.157390594482422, + "nn_train_episode": "demo_154", + "nn_train_cache_episode": 74, + "nn_train_frame": 50, + "nn_train_row": 23757, + "pctile_among_candidates": 62.13592233009708 + }, + { + "episode": "demo_107", + "cache_episode": 27, + "frame": 41, + "cache_row": 7327, + "ep_len": 288, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.271095335483551, + "nn_train_cos": 0.728904664516449, + "nn_train_l2": 28.890050888061523, + "nn_train_episode": "demo_150", + "nn_train_cache_episode": 70, + "nn_train_frame": 45, + "nn_train_row": 22655, + "pctile_among_candidates": 52.9126213592233 + } + ], + "states_arg": "demo_147:234,demo_181:252,demo_116:62,demo_130:83,demo_187:49,demo_103:320,demo_194:29,demo_107:41" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS_square_sub_20100_Mbest.json b/gen_q_rsm/rsm_rise/pipeline/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS_square_sub_20100_Mbest.json new file mode 100644 index 0000000000000000000000000000000000000000..1555f8fcc943ea2291ebaab441aa29933c7102f1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/square_sub_20100/stitchviz/UNSEEN_ANCHORS_square_sub_20100_Mbest.json @@ -0,0 +1,128 @@ +{ + "task": "square_sub_20100", + "regime": "suboptimal", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/square_sub_20100/rsm/M/ckpt_best.pt", + "rsm_model": "M", + "rsm_ckpt_name": "best", + "split": { + "n_ep": 120, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 1, + 5, + 13, + 16, + 23, + 27, + 36, + 50, + 67, + 101, + 107, + 114 + ], + "val_episode_keys": [ + "demo_7", + "demo_22", + "demo_73", + "demo_86", + "demo_103", + "demo_107", + "demo_116", + "demo_130", + "demo_147", + "demo_181", + "demo_187", + "demo_194" + ], + "n_train_eps": 108, + "n_train_rows": 35692, + "n_cache_rows": 39473, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_candidate_frames": 206, + "n_candidate_episodes": 8, + "candidate_cos_dist": { + "min": 0.07774794101715088, + "median": 0.26447781920433044, + "max": 0.535770058631897 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.11607521027326584, + "median": 0.23063930869102478, + "p95": 0.3910636901855469, + "max": 0.5860507488250732 + }, + "l2": { + "p05": 18.504926681518555, + "median": 25.483848571777344, + "p95": 37.431941986083984, + "max": 49.2202262878418 + } + }, + "anchors": [ + { + "episode": "demo_147", + "cache_episode": 67, + "frame": 234, + "cache_row": 21467, + "ep_len": 771, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.535770058631897, + "nn_train_cos": 0.464229941368103, + "nn_train_l2": 43.83781814575195, + "nn_train_episode": "demo_176", + "nn_train_cache_episode": 96, + "nn_train_frame": 168, + "nn_train_row": 31618, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_181", + "cache_episode": 101, + "frame": 252, + "cache_row": 33508, + "ep_len": 357, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4993113875389099, + "nn_train_cos": 0.5006886124610901, + "nn_train_l2": 36.77060317993164, + "nn_train_episode": "demo_185", + "nn_train_cache_episode": 105, + "nn_train_frame": 172, + "nn_train_row": 34723, + "pctile_among_candidates": 97.57281553398059 + }, + { + "episode": "demo_116", + "cache_episode": 36, + "frame": 62, + "cache_row": 10276, + "ep_len": 428, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.47579145431518555, + "nn_train_cos": 0.5242085456848145, + "nn_train_l2": 39.785282135009766, + "nn_train_episode": "demo_133", + "nn_train_cache_episode": 53, + "nn_train_frame": 64, + "nn_train_row": 15880, + "pctile_among_candidates": 93.68932038834951 + } + ], + "states_arg": "demo_147:234,demo_181:252,demo_116:62" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json new file mode 100644 index 0000000000000000000000000000000000000000..2c6563cb83f0e2dffa352152c2ffb9a70c8b9fc9 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json @@ -0,0 +1,284 @@ +[ + { + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_106", + "cache_episode": 106, + "frame": 35, + "ep_len": 246, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.019061341881752014, + "Q_max": 0.08237418532371521, + "Q_mean": 0.02625849097967148, + "argmax": 125, + "Q_argmax": 0.08237418532371521, + "frac_green": 0.01983642578125, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_99", + "cache_episode": 99, + "frame": 57, + "ep_len": 208, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.11163482069969177, + "Q_max": 0.1695835292339325, + "Q_mean": 0.13671723008155823, + "argmax": 2, + "Q_argmax": 0.1695835292339325, + "frac_green": 0.04156494140625, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_129", + "cache_episode": 129, + "frame": 84, + "ep_len": 208, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_mean": 0.16202472150325775, + "argmax": 100, + "Q_argmax": 0.23481276631355286, + "frac_green": 0.0885009765625, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_143", + "cache_episode": 143, + "frame": 154, + "ep_len": 282, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_mean": 0.25859200954437256, + "argmax": 94, + "Q_argmax": 0.3141687214374542, + "frac_green": 0.167236328125, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_102", + "cache_episode": 102, + "frame": 198, + "ep_len": 291, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 1.504642619706563e-22, + "Q_max": 0.03459713235497475, + "Q_mean": 0.02348705567419529, + "argmax": 110, + "Q_argmax": 0.03459713235497475, + "frac_green": 0.01068115234375, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_171", + "cache_episode": 171, + "frame": 244, + "ep_len": 299, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 3.7732108921773033e-06, + "Q_max": 0.02326813153922558, + "Q_mean": 0.0008850867743603885, + "argmax": 123, + "Q_argmax": 0.02326813153922558, + "frac_green": 0.0001220703125, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json.bak.20260924_run35_clobbered b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json.bak.20260924_run35_clobbered new file mode 100644 index 0000000000000000000000000000000000000000..4d1650743ff27489b89cb276420deea8810f0908 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json.bak.20260924_run35_clobbered @@ -0,0 +1,74 @@ +[ + { + "name": "two_piece_expert_play_demo_106_t0035_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_106", + "frame": 35, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_99_t0057_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_99", + "frame": 57, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_129", + "frame": 84, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_143", + "frame": 154, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_102_t0198_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_102", + "frame": 198, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + }, + { + "name": "two_piece_expert_play_demo_171_t0244_L40best_b0.95_L8_N128_P16_chain", + "task": "two_piece_expert_play", + "episode": "demo_171", + "frame": 244, + "readout": "chain", + "p_cont": 0.8080808080808081, + "cap": 33, + "beta": 0.95, + "gamma": 0.99, + "hops_mean": 3.5625 + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json new file mode 100644 index 0000000000000000000000000000000000000000..a7dbae8fd6589fa106f3c2d7d568d9b6cb32ce22 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json @@ -0,0 +1,267 @@ +{ + "task": "two_piece_expert_play", + "regime": "coverage", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "split": { + "n_ep": 399, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 5, + 18, + 19, + 36, + 38, + 55, + 71, + 83, + 88, + 119, + 128, + 133, + 136, + 141, + 155, + 159, + 164, + 189, + 202, + 204, + 213, + 244, + 248, + 266, + 277, + 293, + 299, + 320, + 321, + 328, + 338, + 346, + 349, + 350, + 353, + 359, + 373, + 375, + 386 + ], + "val_episode_keys": [ + "demo_5", + "demo_18", + "demo_19", + "demo_36", + "demo_38", + "demo_55", + "demo_71", + "demo_83", + "demo_88", + "demo_119", + "demo_128", + "demo_133", + "demo_136", + "demo_141", + "demo_155", + "demo_159", + "demo_164", + "demo_189", + "demo_202", + "demo_204", + "demo_213", + "demo_244", + "demo_248", + "demo_266", + "demo_277", + "demo_293", + "demo_299", + "demo_320", + "demo_321", + "demo_328", + "demo_338", + "demo_346", + "demo_349", + "demo_350", + "demo_353", + "demo_359", + "demo_373", + "demo_375", + "demo_386" + ], + "n_train_eps": 360, + "n_train_rows": 109588, + "n_cache_rows": 121809, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_candidate_frames": 378, + "n_candidate_episodes": 18, + "candidate_cos_dist": { + "min": 0.08004188537597656, + "median": 0.1999388039112091, + "max": 0.4285218119621277 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06912846863269806, + "median": 0.1720433533191681, + "p95": 0.29332223534584045, + "max": 0.4904467463493347 + }, + "l2": { + "p05": 15.149876594543457, + "median": 21.900650024414062, + "p95": 32.218013763427734, + "max": 52.86798858642578 + } + }, + "anchors": [ + { + "episode": "demo_38", + "cache_episode": 38, + "frame": 67, + "cache_row": 11385, + "ep_len": 461, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4285218119621277, + "nn_train_cos": 0.5714781880378723, + "nn_train_l2": 38.19707489013672, + "nn_train_episode": "demo_94", + "nn_train_cache_episode": 94, + "nn_train_frame": 67, + "nn_train_row": 27702, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_18", + "cache_episode": 18, + "frame": 96, + "cache_row": 5442, + "ep_len": 183, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4116707444190979, + "nn_train_cos": 0.5883292555809021, + "nn_train_l2": 29.66008758544922, + "nn_train_episode": "demo_122", + "nn_train_cache_episode": 122, + "nn_train_frame": 111, + "nn_train_row": 34835, + "pctile_among_candidates": 99.47089947089947 + }, + { + "episode": "demo_128", + "cache_episode": 128, + "frame": 115, + "cache_row": 36325, + "ep_len": 378, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.40183407068252563, + "nn_train_cos": 0.5981659293174744, + "nn_train_l2": 32.24315643310547, + "nn_train_episode": "demo_97", + "nn_train_cache_episode": 97, + "nn_train_frame": 154, + "nn_train_row": 28813, + "pctile_among_candidates": 99.20634920634922 + }, + { + "episode": "demo_159", + "cache_episode": 159, + "frame": 413, + "cache_row": 45321, + "ep_len": 632, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.3610679507255554, + "nn_train_cos": 0.6389320492744446, + "nn_train_l2": 29.516294479370117, + "nn_train_episode": "demo_109", + "nn_train_cache_episode": 109, + "nn_train_frame": 154, + "nn_train_row": 31413, + "pctile_among_candidates": 98.14814814814815 + }, + { + "episode": "demo_189", + "cache_episode": 189, + "frame": 338, + "cache_row": 55841, + "ep_len": 533, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.3581829071044922, + "nn_train_cos": 0.6418170928955078, + "nn_train_l2": 48.01067352294922, + "nn_train_episode": "demo_90", + "nn_train_cache_episode": 90, + "nn_train_frame": 254, + "nn_train_row": 26545, + "pctile_among_candidates": 97.88359788359789 + }, + { + "episode": "demo_83", + "cache_episode": 83, + "frame": 280, + "cache_row": 24284, + "ep_len": 344, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.34155064821243286, + "nn_train_cos": 0.6584493517875671, + "nn_train_l2": 33.20248031616211, + "nn_train_episode": "demo_182", + "nn_train_cache_episode": 182, + "nn_train_frame": 484, + "nn_train_row": 53512, + "pctile_among_candidates": 96.56084656084656 + }, + { + "episode": "demo_19", + "cache_episode": 19, + "frame": 67, + "cache_row": 5596, + "ep_len": 324, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.34026873111724854, + "nn_train_cos": 0.6597312688827515, + "nn_train_l2": 32.99098587036133, + "nn_train_episode": "demo_145", + "nn_train_cache_episode": 145, + "nn_train_frame": 70, + "nn_train_row": 41042, + "pctile_among_candidates": 96.29629629629629 + }, + { + "episode": "demo_136", + "cache_episode": 136, + "frame": 154, + "cache_row": 38479, + "ep_len": 242, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.32227975130081177, + "nn_train_cos": 0.6777202486991882, + "nn_train_l2": 26.64438247680664, + "nn_train_episode": "demo_13", + "nn_train_cache_episode": 13, + "nn_train_frame": 201, + "nn_train_row": 3942, + "pctile_among_candidates": 94.70899470899471 + } + ], + "states_arg": "demo_38:67,demo_18:96,demo_128:115,demo_159:413,demo_189:338,demo_83:280,demo_19:67,demo_136:154" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS_two_piece_expert_play_L40best.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS_two_piece_expert_play_L40best.json new file mode 100644 index 0000000000000000000000000000000000000000..41e7186a2ebaa81c0e9001883fe83a5c3f8ba54f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS_two_piece_expert_play_L40best.json @@ -0,0 +1,182 @@ +{ + "task": "two_piece_expert_play", + "regime": "coverage", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "split": { + "n_ep": 399, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 5, + 18, + 19, + 36, + 38, + 55, + 71, + 83, + 88, + 119, + 128, + 133, + 136, + 141, + 155, + 159, + 164, + 189, + 202, + 204, + 213, + 244, + 248, + 266, + 277, + 293, + 299, + 320, + 321, + 328, + 338, + 346, + 349, + 350, + 353, + 359, + 373, + 375, + 386 + ], + "val_episode_keys": [ + "demo_5", + "demo_18", + "demo_19", + "demo_36", + "demo_38", + "demo_55", + "demo_71", + "demo_83", + "demo_88", + "demo_119", + "demo_128", + "demo_133", + "demo_136", + "demo_141", + "demo_155", + "demo_159", + "demo_164", + "demo_189", + "demo_202", + "demo_204", + "demo_213", + "demo_244", + "demo_248", + "demo_266", + "demo_277", + "demo_293", + "demo_299", + "demo_320", + "demo_321", + "demo_328", + "demo_338", + "demo_346", + "demo_349", + "demo_350", + "demo_353", + "demo_359", + "demo_373", + "demo_375", + "demo_386" + ], + "n_train_eps": 360, + "n_train_rows": 109588, + "n_cache_rows": 121809, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_candidate_frames": 378, + "n_candidate_episodes": 18, + "candidate_cos_dist": { + "min": 0.08004188537597656, + "median": 0.1999388039112091, + "max": 0.4285218119621277 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06912846863269806, + "median": 0.1720433533191681, + "p95": 0.29332223534584045, + "max": 0.4904467463493347 + }, + "l2": { + "p05": 15.149876594543457, + "median": 21.900650024414062, + "p95": 32.218013763427734, + "max": 52.86798858642578 + } + }, + "anchors": [ + { + "episode": "demo_38", + "cache_episode": 38, + "frame": 67, + "cache_row": 11385, + "ep_len": 461, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4285218119621277, + "nn_train_cos": 0.5714781880378723, + "nn_train_l2": 38.19707489013672, + "nn_train_episode": "demo_94", + "nn_train_cache_episode": 94, + "nn_train_frame": 67, + "nn_train_row": 27702, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_18", + "cache_episode": 18, + "frame": 96, + "cache_row": 5442, + "ep_len": 183, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4116707444190979, + "nn_train_cos": 0.5883292555809021, + "nn_train_l2": 29.66008758544922, + "nn_train_episode": "demo_122", + "nn_train_cache_episode": 122, + "nn_train_frame": 111, + "nn_train_row": 34835, + "pctile_among_candidates": 99.47089947089947 + }, + { + "episode": "demo_128", + "cache_episode": 128, + "frame": 115, + "cache_row": 36325, + "ep_len": 378, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.40183407068252563, + "nn_train_cos": 0.5981659293174744, + "nn_train_l2": 32.24315643310547, + "nn_train_episode": "demo_97", + "nn_train_cache_episode": 97, + "nn_train_frame": 154, + "nn_train_row": 28813, + "pctile_among_candidates": 99.20634920634922 + } + ], + "states_arg": "demo_38:67,demo_18:96,demo_128:115" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz_split/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz_split/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json new file mode 100644 index 0000000000000000000000000000000000000000..d4de1ad754ed2a9fa8f549a8d0a03e9b521e3eb5 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz_split/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json @@ -0,0 +1,253 @@ +[ + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_129", + "cache_episode": 129, + "frame": 84, + "ep_len": 208, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_mean": 0.16202472150325775, + "argmax": 100, + "Q_argmax": 0.23481276631355286, + "frac_green": 0.0885009765625, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_143_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_143", + "cache_episode": 143, + "frame": 154, + "ep_len": 282, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.2211155742406845, + "Q_max": 0.3141687214374542, + "Q_mean": 0.25859200954437256, + "argmax": 94, + "Q_argmax": 0.3141687214374542, + "frac_green": 0.167236328125, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_18", + "cache_episode": 18, + "frame": 96, + "ep_len": 183, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_mean": 0.34716707468032837, + "argmax": 82, + "Q_argmax": 0.920602560043335, + "frac_green": 0.12005615234375, + "episode_success": false, + "unseen": { + "anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS_two_piece_expert_play_L40best.json", + "split": { + "n_ep": 399, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_val_eps": 39, + "n_train_eps": 360, + "n_train_rows": 109588, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06912846863269806, + "median": 0.1720433533191681, + "p95": 0.29332223534584045, + "max": 0.4904467463493347 + }, + "l2": { + "p05": 15.149876594543457, + "median": 21.900650024414062, + "p95": 32.218013763427734, + "max": 52.86798858642578 + } + }, + "regime": "coverage", + "anchor_rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt" + }, + "anchor": { + "episode": "demo_18", + "cache_episode": 18, + "frame": 96, + "cache_row": 5442, + "ep_len": 183, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4116707444190979, + "nn_train_cos": 0.5883292555809021, + "nn_train_l2": 29.66008758544922, + "nn_train_episode": "demo_122", + "nn_train_cache_episode": 122, + "nn_train_frame": 111, + "nn_train_row": 34835, + "pctile_among_candidates": 99.47089947089947 + }, + "held_out": true + }, + { + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_136", + "cache_episode": 136, + "frame": 154, + "ep_len": 242, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": null, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_mean": 0.24070937931537628, + "argmax": 64, + "Q_argmax": 0.5130337476730347, + "frac_green": 0.14874267578125, + "episode_success": false, + "unseen": { + "anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "split": { + "n_ep": 399, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_val_eps": 39, + "n_train_eps": 360, + "n_train_rows": 109588, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06912846863269806, + "median": 0.1720433533191681, + "p95": 0.29332223534584045, + "max": 0.4904467463493347 + }, + "l2": { + "p05": 15.149876594543457, + "median": 21.900650024414062, + "p95": 32.218013763427734, + "max": 52.86798858642578 + } + }, + "regime": "coverage", + "anchor_rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt" + }, + "anchor": { + "episode": "demo_136", + "cache_episode": 136, + "frame": 154, + "cache_row": 38479, + "ep_len": 242, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.32227975130081177, + "nn_train_cos": 0.6777202486991882, + "nn_train_l2": 26.64438247680664, + "nn_train_episode": "demo_13", + "nn_train_cache_episode": 13, + "nn_train_frame": 201, + "nn_train_row": 3942, + "pctile_among_candidates": 94.70899470899471 + }, + "held_out": true + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz_split2/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz_split2/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json new file mode 100644 index 0000000000000000000000000000000000000000..0ea733bdea1acc0f8874a0d1dfb2406fa228d916 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_play/stitchviz_split2/MANIFEST_two_piece_expert_play_L40best_b0.95_L8.json @@ -0,0 +1,413 @@ +[ + { + "name": "two_piece_expert_play_demo_129_t0084_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_129", + "cache_episode": 129, + "frame": 84, + "ep_len": 208, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 4.3887592937608133e-07, + "Q_max": 0.23481276631355286, + "Q_mean": 0.16202472150325775, + "argmax": 100, + "Q_argmax": 0.23481276631355286, + "frac_green": 0.0885009765625, + "episode_success": false + }, + { + "name": "two_piece_expert_play_demo_80_t0025_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_80", + "cache_episode": 80, + "frame": 25, + "ep_len": 177, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.25711315870285034, + "Q_max": 0.624505877494812, + "Q_mean": 0.4316396117210388, + "argmax": 100, + "Q_argmax": 0.624505877494812, + "frac_green": 0.255859375, + "episode_success": false, + "unseen": null, + "anchor": null, + "held_out": null + }, + { + "name": "two_piece_expert_play_demo_198_t0166_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_198", + "cache_episode": 198, + "frame": 166, + "ep_len": 398, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 6.769107858417556e-05, + "Q_max": 0.38457581400871277, + "Q_mean": 0.1947375237941742, + "argmax": 43, + "Q_argmax": 0.38457581400871277, + "frac_green": 0.051513671875, + "episode_success": false, + "unseen": null, + "anchor": null, + "held_out": null + }, + { + "name": "two_piece_expert_play_demo_64_t0192_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_64", + "cache_episode": 64, + "frame": 192, + "ep_len": 674, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.0006882615271024406, + "Q_max": 0.704879105091095, + "Q_mean": 0.33400648832321167, + "argmax": 86, + "Q_argmax": 0.704879105091095, + "frac_green": 0.05419921875, + "episode_success": false, + "unseen": null, + "anchor": null, + "held_out": null + }, + { + "name": "two_piece_expert_play_demo_153_t0112_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_153", + "cache_episode": 153, + "frame": 112, + "ep_len": 170, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 7.312361844924453e-07, + "Q_max": 0.32301434874534607, + "Q_mean": 0.261293888092041, + "argmax": 77, + "Q_argmax": 0.32301434874534607, + "frac_green": 0.15411376953125, + "episode_success": false, + "unseen": null, + "anchor": null, + "held_out": null + }, + { + "name": "two_piece_expert_play_demo_6_t0180_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_6", + "cache_episode": 6, + "frame": 180, + "ep_len": 224, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.3845299482345581, + "Q_max": 0.5868167877197266, + "Q_mean": 0.46631115674972534, + "argmax": 34, + "Q_argmax": 0.5868167877197266, + "frac_green": 0.1658935546875, + "episode_success": false, + "unseen": null, + "anchor": null, + "held_out": null + }, + { + "name": "two_piece_expert_play_demo_18_t0096_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_18", + "cache_episode": 18, + "frame": 96, + "ep_len": 183, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.00139467918779701, + "Q_max": 0.920602560043335, + "Q_mean": 0.34716707468032837, + "argmax": 82, + "Q_argmax": 0.920602560043335, + "frac_green": 0.12005615234375, + "episode_success": false, + "unseen": { + "anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS_two_piece_expert_play_L40best.json", + "split": { + "n_ep": 399, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_val_eps": 39, + "n_train_eps": 360, + "n_train_rows": 109588, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06912846863269806, + "median": 0.1720433533191681, + "p95": 0.29332223534584045, + "max": 0.4904467463493347 + }, + "l2": { + "p05": 15.149876594543457, + "median": 21.900650024414062, + "p95": 32.218013763427734, + "max": 52.86798858642578 + } + }, + "regime": "coverage", + "anchor_rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt" + }, + "anchor": { + "episode": "demo_18", + "cache_episode": 18, + "frame": 96, + "cache_row": 5442, + "ep_len": 183, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4116707444190979, + "nn_train_cos": 0.5883292555809021, + "nn_train_l2": 29.66008758544922, + "nn_train_episode": "demo_122", + "nn_train_cache_episode": 122, + "nn_train_frame": 111, + "nn_train_row": 34835, + "pctile_among_candidates": 99.47089947089947 + }, + "held_out": true + }, + { + "name": "two_piece_expert_play_demo_136_t0154_L40best_b0.95_L8_N128_P16", + "task": "two_piece_expert_play", + "episode": "demo_136", + "cache_episode": 136, + "frame": 154, + "ep_len": 242, + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt", + "rsm_model": "L40", + "rsm_ckpt_name": "best", + "hop_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/hop/gauss/policy_r1.pt", + "policy_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/policy/S0A_seed0/two_piece_expert_play_S0A_s0/20260918065342/models/model_epoch_5000.pth", + "policy_seed": 0, + "feat_stats": "/proj/dmfexp/zwhong/rsm_rise/cache/two_piece_expert_play/feat_stats.npz", + "src_hdf5": "/proj/dmfexp/zwhong/rsm_rise/data/raw/two_piece_expert_play.hdf5", + "beta": 0.95, + "depth": 8, + "gamma": 0.99, + "n_cand": 128, + "particles": 16, + "flow_steps": 8, + "temperature": 1.0, + "score_kind": "prob", + "plan_seed": 0, + "proposer_seed": null, + "chunk": 8, + "To": 2, + "Ta": 8, + "Q_min": 0.15431322157382965, + "Q_max": 0.5130337476730347, + "Q_mean": 0.24070937931537628, + "argmax": 64, + "Q_argmax": 0.5130337476730347, + "frac_green": 0.14874267578125, + "episode_success": false, + "unseen": { + "anchors_json": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_play_L40best.json", + "split": { + "n_ep": 399, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_val_eps": 39, + "n_train_eps": 360, + "n_train_rows": 109588, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.06912846863269806, + "median": 0.1720433533191681, + "p95": 0.29332223534584045, + "max": 0.4904467463493347 + }, + "l2": { + "p05": 15.149876594543457, + "median": 21.900650024414062, + "p95": 32.218013763427734, + "max": 52.86798858642578 + } + }, + "regime": "coverage", + "anchor_rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_play/rsm/L40/ckpt_best.pt" + }, + "anchor": { + "episode": "demo_136", + "cache_episode": 136, + "frame": 154, + "cache_row": 38479, + "ep_len": 242, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.32227975130081177, + "nn_train_cos": 0.6777202486991882, + "nn_train_l2": 26.64438247680664, + "nn_train_episode": "demo_13", + "nn_train_cache_episode": 13, + "nn_train_frame": 201, + "nn_train_row": 3942, + "pctile_among_candidates": 94.70899470899471 + }, + "held_out": true + } +] \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json new file mode 100644 index 0000000000000000000000000000000000000000..fd365e087bba68005b8de4d396c296140aa963e2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS8_two_piece_expert_suboptimal_Mproghead.json @@ -0,0 +1,213 @@ +{ + "task": "two_piece_expert_suboptimal", + "regime": "suboptimal", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "rsm_model": "M", + "rsm_ckpt_name": "proghead", + "split": { + "n_ep": 120, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 1, + 5, + 13, + 16, + 23, + 27, + 36, + 50, + 67, + 101, + 107, + 114 + ], + "val_episode_keys": [ + "demo_1", + "demo_5", + "demo_13", + "demo_16", + "demo_23", + "demo_27", + "demo_36", + "demo_50", + "demo_67", + "demo_101", + "demo_107", + "demo_114" + ], + "n_train_eps": 108, + "n_train_rows": 24792, + "n_cache_rows": 27859, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 8 + }, + "n_candidate_frames": 134, + "n_candidate_episodes": 9, + "candidate_cos_dist": { + "min": 0.09442400932312012, + "median": 0.21673312783241272, + "max": 0.4271807074546814 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.07071777433156967, + "median": 0.22016850113868713, + "p95": 0.3562857508659363, + "max": 0.566988468170166 + }, + "l2": { + "p05": 15.621793746948242, + "median": 25.13136863708496, + "p95": 33.7322998046875, + "max": 51.736534118652344 + } + }, + "anchors": [ + { + "episode": "demo_5", + "cache_episode": 5, + "frame": 159, + "cache_row": 1170, + "ep_len": 206, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4271807074546814, + "nn_train_cos": 0.5728192925453186, + "nn_train_l2": 33.24647903442383, + "nn_train_episode": "demo_99", + "nn_train_cache_episode": 99, + "nn_train_frame": 130, + "nn_train_row": 21263, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_1", + "cache_episode": 1, + "frame": 70, + "cache_row": 252, + "ep_len": 211, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.38624584674835205, + "nn_train_cos": 0.613754153251648, + "nn_train_l2": 28.140241622924805, + "nn_train_episode": "demo_86", + "nn_train_cache_episode": 86, + "nn_train_frame": 70, + "nn_train_row": 18431, + "pctile_among_candidates": 99.25373134328358 + }, + { + "episode": "demo_27", + "cache_episode": 27, + "frame": 156, + "cache_row": 5985, + "ep_len": 252, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.35205137729644775, + "nn_train_cos": 0.6479486227035522, + "nn_train_l2": 35.802268981933594, + "nn_train_episode": "demo_79", + "nn_train_cache_episode": 79, + "nn_train_frame": 113, + "nn_train_row": 16998, + "pctile_among_candidates": 98.50746268656717 + }, + { + "episode": "demo_13", + "cache_episode": 13, + "frame": 133, + "cache_row": 2945, + "ep_len": 229, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.3388258218765259, + "nn_train_cos": 0.6611741781234741, + "nn_train_l2": 33.583595275878906, + "nn_train_episode": "demo_10", + "nn_train_cache_episode": 10, + "nn_train_frame": 162, + "nn_train_row": 2257, + "pctile_among_candidates": 97.01492537313433 + }, + { + "episode": "demo_50", + "cache_episode": 50, + "frame": 63, + "cache_row": 10745, + "ep_len": 167, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.33454692363739014, + "nn_train_cos": 0.6654530763626099, + "nn_train_l2": 32.51961898803711, + "nn_train_episode": "demo_64", + "nn_train_cache_episode": 64, + "nn_train_frame": 66, + "nn_train_row": 13660, + "pctile_among_candidates": 96.26865671641791 + }, + { + "episode": "demo_67", + "cache_episode": 67, + "frame": 125, + "cache_row": 14322, + "ep_len": 245, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.31332290172576904, + "nn_train_cos": 0.686677098274231, + "nn_train_l2": 27.053951263427734, + "nn_train_episode": "demo_39", + "nn_train_cache_episode": 39, + "nn_train_frame": 116, + "nn_train_row": 8510, + "pctile_among_candidates": 94.02985074626866 + }, + { + "episode": "demo_16", + "cache_episode": 16, + "frame": 195, + "cache_row": 3668, + "ep_len": 245, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.26984143257141113, + "nn_train_cos": 0.7301585674285889, + "nn_train_l2": 34.12239074707031, + "nn_train_episode": "demo_66", + "nn_train_cache_episode": 66, + "nn_train_frame": 172, + "nn_train_row": 14165, + "pctile_among_candidates": 83.5820895522388 + }, + { + "episode": "demo_36", + "cache_episode": 36, + "frame": 96, + "cache_row": 7902, + "ep_len": 184, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.25241345167160034, + "nn_train_cos": 0.7475865483283997, + "nn_train_l2": 24.697370529174805, + "nn_train_episode": "demo_51", + "nn_train_cache_episode": 51, + "nn_train_frame": 115, + "nn_train_row": 10964, + "pctile_among_candidates": 76.86567164179104 + } + ], + "states_arg": "demo_5:159,demo_1:70,demo_27:156,demo_13:133,demo_50:63,demo_67:125,demo_16:195,demo_36:96" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS_two_piece_expert_suboptimal_Mproghead.json b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS_two_piece_expert_suboptimal_Mproghead.json new file mode 100644 index 0000000000000000000000000000000000000000..0ea7a8af2a87e1a698105fcdd1fe5ee3de4bfcd1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/runs/two_piece_expert_suboptimal/stitchviz/UNSEEN_ANCHORS_two_piece_expert_suboptimal_Mproghead.json @@ -0,0 +1,128 @@ +{ + "task": "two_piece_expert_suboptimal", + "regime": "suboptimal", + "rsm_ckpt": "/proj/dmfexp/zwhong/rsm_rise/runs/two_piece_expert_suboptimal/rsm/M/ckpt_proghead.pt", + "rsm_model": "M", + "rsm_ckpt_name": "proghead", + "split": { + "n_ep": 120, + "val_frac": 0.1, + "seed": 0, + "stratify_success": 0, + "data_py": "/proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero/data.py" + }, + "val_eps": [ + 1, + 5, + 13, + 16, + 23, + 27, + 36, + 50, + 67, + 101, + 107, + 114 + ], + "val_episode_keys": [ + "demo_1", + "demo_5", + "demo_13", + "demo_16", + "demo_23", + "demo_27", + "demo_36", + "demo_50", + "demo_67", + "demo_101", + "demo_107", + "demo_114" + ], + "n_train_eps": 108, + "n_train_rows": 24792, + "n_cache_rows": 27859, + "rule": { + "text": "val_eps membership AND ep_success==False AND ep_len>40; stride-10 grid over [0.15,0.85] of the episode; rank by 1-cos to the nearest TRAINING frame, descending; at most one anchor per episode; ties -> lower episode then lower frame", + "stride": 10, + "min_frac": 0.15, + "max_frac": 0.85, + "n_anchors": 3 + }, + "n_candidate_frames": 134, + "n_candidate_episodes": 9, + "candidate_cos_dist": { + "min": 0.09442400932312012, + "median": 0.21673312783241272, + "max": 0.4271807074546814 + }, + "train_self_reference": { + "n": 2000, + "cos_dist": { + "p05": 0.07071777433156967, + "median": 0.22016850113868713, + "p95": 0.3562857508659363, + "max": 0.566988468170166 + }, + "l2": { + "p05": 15.621793746948242, + "median": 25.13136863708496, + "p95": 33.7322998046875, + "max": 51.736534118652344 + } + }, + "anchors": [ + { + "episode": "demo_5", + "cache_episode": 5, + "frame": 159, + "cache_row": 1170, + "ep_len": 206, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.4271807074546814, + "nn_train_cos": 0.5728192925453186, + "nn_train_l2": 33.24647903442383, + "nn_train_episode": "demo_99", + "nn_train_cache_episode": 99, + "nn_train_frame": 130, + "nn_train_row": 21263, + "pctile_among_candidates": 100.0 + }, + { + "episode": "demo_1", + "cache_episode": 1, + "frame": 70, + "cache_row": 252, + "ep_len": 211, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.38624584674835205, + "nn_train_cos": 0.613754153251648, + "nn_train_l2": 28.140241622924805, + "nn_train_episode": "demo_86", + "nn_train_cache_episode": 86, + "nn_train_frame": 70, + "nn_train_row": 18431, + "pctile_among_candidates": 99.25373134328358 + }, + { + "episode": "demo_27", + "cache_episode": 27, + "frame": 156, + "cache_row": 5985, + "ep_len": 252, + "ep_success": false, + "in_val_eps": true, + "nn_train_cos_dist": 0.35205137729644775, + "nn_train_cos": 0.6479486227035522, + "nn_train_l2": 35.802268981933594, + "nn_train_episode": "demo_79", + "nn_train_cache_episode": 79, + "nn_train_frame": 113, + "nn_train_row": 16998, + "pctile_among_candidates": 98.50746268656717 + } + ], + "states_arg": "demo_5:159,demo_1:70,demo_27:156" +} \ No newline at end of file diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/bad_hosts_from_logs.py b/gen_q_rsm/rsm_rise/pipeline/scripts/bad_hosts_from_logs.py new file mode 100644 index 0000000000000000000000000000000000000000..b71fe420b48bd58ce2233a658a5c6f6d6dcbfa9c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/bad_hosts_from_logs.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +"""Hosts whose MuJoCo/EGL renderer aborts, detected from EVAL LOGS rather than LSF job status. + +scripts/eval_host_stats.sh builds the blacklist from job-level DONE/EXIT. That misses the failure +mode seen on 2026-09-20: the renderer SIGABRTs inside `read_pixels` once PER EPISODE while the job +itself stays RUN and keeps banking episodes into `.json.partial_best`. The job never exits, so +the host never registers an EXIT, so it is never blacklisted -- and a cell that should take one job +takes fifty. p4-r28-n3 had 20 such logs and zero clean ones while absent from the blacklist. + +A host is reported BAD when it has at least `--min-runs` eval logs and NONE of them is clean, which +is deliberately conservative: one bad run on an otherwise healthy host does not remove it from the pool. + +usage: bad_hosts_from_logs.py [--min-runs 3] [--merge status/bad_eval_hosts.txt] +""" +import argparse +import collections +import glob +import re +import sys +from pathlib import Path + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +SIG = ("Fatal Python error", "read_pixels", "EGL") + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--min-runs", type=int, default=3) + ap.add_argument("--merge", default="", help="also read this existing blacklist and print the union") + ap.add_argument("--report", action="store_true", help="print per-host counts to stderr") + a = ap.parse_args() + + bad, tot = collections.Counter(), collections.Counter() + for f in glob.glob(str(ROOT / "runs" / "*" / "eval_*" / "logs" / "*.log")): + try: + t = Path(f).read_text(errors="ignore") + except Exception: + continue + m = re.search(r"host=([a-z0-9-]+)", t) + if not m: + continue + h = m.group(1) + tot[h] += 1 + if any(s in t for s in SIG[:2]): + bad[h] += 1 + + out = {h for h in tot if tot[h] >= a.min_runs and bad[h] == tot[h]} + if a.report: + print(f"{'host':<16}{'abort':>6}{'runs':>6}", file=sys.stderr) + for h in sorted(out, key=lambda x: -tot[x]): + print(f"{h:<16}{bad[h]:>6}{tot[h]:>6}", file=sys.stderr) + print(f"{len(out)} host(s) bad by log evidence", file=sys.stderr) + if a.merge: + p = Path(a.merge) + if p.is_file(): + out |= {x.strip() for x in p.read_text().split() if x.strip()} + for h in sorted(out): + print(h) + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/bsub_cpu.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/bsub_cpu.sh new file mode 100644 index 0000000000000000000000000000000000000000..27eec4aa000da7f56511e3c8c67bfb3a787ba0b3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/bsub_cpu.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# usage: bsub_cpu.sh (CPU-only LSF job; NO compute may run on the login node) +name=$1; shift +mkdir -p /proj/dmfexp/zwhong/rsm_rise/logs/lsf +bsub -G grp_runtime -q ${RR_QUEUE:-normal} -n 8 -M ${RR_MEM:-64G} -R "rusage[mem=${RR_MEM:-64G}]" -J $name \ + -o /proj/dmfexp/zwhong/rsm_rise/logs/lsf/$name.%J.out -e /proj/dmfexp/zwhong/rsm_rise/logs/lsf/$name.%J.err "$@" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/bsub_gpu.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/bsub_gpu.sh new file mode 100644 index 0000000000000000000000000000000000000000..e93400cea737962ee054434e6ce1140e29a6ece3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/bsub_gpu.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# usage: bsub_gpu.sh (single-GPU LSF job with the project's mandatory flags) +# env: RR_MEM (default 64G; RISE image trainings cache the whole hdf5 in RAM: square play ~230G, mug ~65G), RR_QUEUE (normal), RR_GROUP (grp_runtime; +# use RR_QUEUE=preemptable RR_GROUP=grp_preemptable for SHORT gpu jobs -- grp_runtime is capped at 256 GPUs, see status/A_env_stage0.md 13:40) +# RR_EXCL_HOSTS: space-separated LSF host names to avoid (added to the select[] clause). Used by +# scripts/launch_stage0_evals.sh to steer evals away from the hosts whose MuJoCo/EGL renderer SIGABRTs +# (list: status/bad_eval_hosts.txt, regenerated by scripts/eval_host_stats.sh --write). +name=$1; shift +mkdir -p /proj/dmfexp/zwhong/rsm_rise/logs/lsf +sel="" +for h in ${RR_EXCL_HOSTS:-}; do sel="${sel:+$sel && }hname!='$h'"; done +res="rusage[mem=${RR_MEM:-64G}]"; [ -n "$sel" ] && res="select[$sel] $res" +# -Q "EXCLUDE(99)": exit code 99 means "this HOST is unusable for me, put me somewhere else" and LSF requeues +# the job onto a different host. Only scripts/eval_cell.sh ever produces 99 (a GPU node that cannot create the +# MuJoCo offscreen framebuffer, GL error 0x8cdd), and it caps itself at 3 requeues per output file, so this is a +# no-op for trainings and for every healthy eval. Verified accepted by this LSF (job 1775123). +bsub -G ${RR_GROUP:-grp_runtime} -q ${RR_QUEUE:-normal} -gpu "num=1:j_exclusive=yes:mode=shared" -n 8 -M ${RR_MEM:-64G} -R "$res" -r -Q "EXCLUDE(99)" -J $name \ + -o /proj/dmfexp/zwhong/rsm_rise/logs/lsf/$name.%J.out -e /proj/dmfexp/zwhong/rsm_rise/logs/lsf/$name.%J.err "$@" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/build_sq20100_token_rows.py b/gen_q_rsm/rsm_rise/pipeline/scripts/build_sq20100_token_rows.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce372c19c04d420b4ec52696858535a937c4218 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/build_sq20100_token_rows.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +"""Row map from cache/square_sub_20100's frames into cache/square_expert_suboptimal's token file. + +gen_q#268. square_sub_20100 is a pure ROW SLICE of square_expert_suboptimal (see its SLICE.json and +scripts/build_sq20100_cache_slice.py), and its PACK.json records that the token cache was NOT sliced +because the MLP backend only needs the pooled z. A token-space scorer (DWM / DINO-WM) does need the +tokens, and copying the parent's slice would cost 15.6 GB on a filesystem that is 99% full -- so +instead we emit the index array that lets TokenRSMData read the parent's file in place +(train_rsm_dwm.py --tokens /tokens --tok-rows ). + +The map is derived from the EPISODE PROVENANCE, not from any assumption about ordering: meta.npz +records ep_src (the source HDF5 demo key) and ep_from/ep_to for both caches, and both were packed +from the same HDF5 at stride 1, so frame j of a child episode is frame j of the parent episode with +the same demo key. The script asserts the pooled features agree on a sample of rows, which is the +end-to-end check that the map is right: if it were wrong, z.f16.npy would not match. + +Writes cache/square_sub_20100/tokens/tok_rows.npy (int64, one entry per child frame). +usage: build_sq20100_token_rows.py [--child ] [--parent ] [--check 2000] +""" +import argparse +import numpy as np +from pathlib import Path + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--child", default=str(ROOT / "cache/square_sub_20100")) + ap.add_argument("--parent", default=str(ROOT / "cache/square_expert_suboptimal")) + ap.add_argument("--check", type=int, default=2000, help="rows to verify against z.f16.npy") + a = ap.parse_args() + ch, pa = Path(a.child), Path(a.parent) + mc = np.load(ch / "meta.npz", allow_pickle=True) + mp = np.load(pa / "meta.npz", allow_pickle=True) + assert "ep_src" in mc.files and "ep_src" in mp.files, "both caches must record ep_src" + psrc = {str(s): i for i, s in enumerate(mp["ep_src"])} + rows = np.empty(int(mc["ep_to"][-1]), np.int64) + for i, s in enumerate(mc["ep_src"]): + j = psrc[str(s)] + c0, c1 = int(mc["ep_from"][i]), int(mc["ep_to"][i]) + p0, p1 = int(mp["ep_from"][j]), int(mp["ep_to"][j]) + assert c1 - c0 == p1 - p0, f"episode {s}: child {c1-c0} frames, parent {p1-p0}" + rows[c0:c1] = np.arange(p0, p1, dtype=np.int64) + # END-TO-END CHECK: the pooled feature of a child frame must equal the parent's at the mapped row. + zc = np.load(ch / "z.f16.npy", mmap_mode="r") + zp = np.load(pa / "z.f16.npy", mmap_mode="r") + n = min(int(a.check), len(rows)) + sel = np.sort(np.random.default_rng(0).choice(len(rows), n, replace=False)) + bad = int((np.asarray(zc[sel]) != np.asarray(zp[rows[sel]])).any(-1).sum()) + assert bad == 0, f"{bad}/{n} sampled rows disagree with the parent's pooled features" + out = ch / "tokens" + out.mkdir(parents=True, exist_ok=True) + np.save(out / "tok_rows.npy", rows) + print(f"[tok_rows] {len(rows)} child frames -> rows {rows.min()}..{rows.max()} of " + f"{len(zp)} parent frames; {n} sampled rows verified against z.f16.npy") + print(f"[tok_rows] wrote {out / 'tok_rows.npy'}") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/chain_grid_census.py b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_grid_census.py new file mode 100644 index 0000000000000000000000000000000000000000..5b657b6fe647db3582de89e63c74a2e527cbc892 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_grid_census.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +"""Per-task census of the coin-chain RSM/TD-Flow arms: how many of the 3x3 = 9 cells have landed. + +Written for gen_q#267 (2026-09-23) after a 7-of-9-cell arm displaced a complete 9-of-9 one in the +flagship maximum on piece-assembly tip. `_seed_tier_key` now prefers a complete arm; this script is +the evidence for WHICH rows were exposed, i.e. where the row maximum over partial arms differs from +the maximum over complete arms only.""" +import json, glob, re, collections, pathlib, sys + +ROOT = pathlib.Path("/proj/dmfexp/zwhong/rsm_rise") +NEED = 9 +out = {"need": NEED, "tasks": {}} +for d in sorted(glob.glob(str(ROOT / "runs/*/eval_onactor"))): + task = pathlib.Path(d).parent.name + arms = collections.defaultdict(list) + for f in sorted(glob.glob(d + "/*.json")): + b = pathlib.Path(f).name + if "-ch-" not in b: + continue + # A CAP-0 CELL IS NOT A CHAIN CELL (2026-09-23). The gamma sweep contains arms at beta = gamma + # (`...-R0.98-0-ch-...-ONACTORG0p98`, plan_beta 0.98 = plan_gamma 0.98, plan_chain_cap 0), where + # p = (gamma-beta)/(gamma(1-beta)) = 0, the continuation coin never fires, and the walk is one + # successor draw with no recursion. This census exists to say which rows are exposed to a + # partial arm displacing a complete one; listing a zero-recursion arm as the row maximum would + # send the next run's GPU at filling it, and a completed grid would then be printed as the + # CORRECTED coin-chain number. flagship_latex.py refuses to print such an arm; this refuses to + # nominate it. + if re.search(r"-R[0-9.]+-0-ch-", b): + sys.stderr.write("[census] EXCLUDED cap-0 (beta>=gamma, no recursion) cell: %s\n" % b) + continue + m = re.match(r"(.+)-es(\d+)-s(\S+)\.json$", b) + if not m: + continue + arm, es, ps = m.groups() + try: + j = json.load(open(f)) + except Exception: + continue + eps = j.get("episodes") or [] + n = j.get("n_episodes") or len(eps) + sr = j.get("success_rate") + if sr is None and eps: + sr = sum(1 for e in eps if e.get("success")) / len(eps) + if not n: + continue + arms[arm].append((ps, es, n, float(sr or 0.0))) + if not arms: + continue + rows = [] + for arm, cells in sorted(arms.items()): + per = collections.defaultdict(lambda: [0, 0.0]) + for ps, es, n, sr in cells: + per[ps][0] += n + per[ps][1] += n * sr + means = [v[1] / v[0] * 100.0 for v in per.values() if v[0]] + mu = sum(means) / len(means) + rows.append({"arm": arm, "cells": len(cells), "complete": len(cells) >= NEED, + "episodes": sum(c[2] for c in cells), "seeds": len(per), + "per_seed_ep": sorted(v[0] for v in per.values()), + "rate": round(mu, 3)}) + def best(pred): + cand = [r for r in rows if r["seeds"] >= 2 and pred(r)] + return max(cand, key=lambda r: (r["rate"], r["episodes"])) if cand else None + b_any, b_cmp = best(lambda r: True), best(lambda r: r["complete"]) + out["tasks"][task] = { + "arms": rows, + "best_over_all": b_any, "best_over_complete": b_cmp, + "exposed": bool(b_any and b_cmp and b_any["arm"] != b_cmp["arm"]), + "delta": (round(b_any["rate"] - b_cmp["rate"], 3) if b_any and b_cmp else None), + } +(ROOT / "status/chain/grid_census.json").write_text(json.dumps(out, indent=1)) +print(f"{'task':34s} {'best over ALL arms':34s} {'best over COMPLETE arms':34s} delta") +for t, v in sorted(out["tasks"].items()): + a, cq = v["best_over_all"], v["best_over_complete"] + f = lambda r: (f"{r['rate']:5.2f} ({r['cells']}/{NEED}c {r['episodes']}ep)" if r else "--") + flag = " <== EXPOSED" if v["exposed"] else "" + print(f"{t:34s} {f(a):34s} {f(cq):34s} " + f"{'' if v['delta'] is None else '%+.2f' % v['delta']}{flag}") + if v["exposed"]: + print(f"{'':34s} all: {a['arm']}\n{'':34s} cmp: {cq['arm']}") diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/chain_horizon_test.py b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_horizon_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8969df775a481c623c60ab7a4d5d0b96e0105647 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_horizon_test.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +"""HORIZON TEST for the coin-terminated beta chain (gen_q#267). + +THE CLAIM UNDER TEST: "stochastically sampling at beta so that over the course of multiple samples it +matches sampling at gamma". Formally -- if a single beta-occupancy draw lands at a frame offset +K ~ Geom(1-beta) on {0,1,...}, and the walk composes M = N+1 such draws with N ~ Geom(1-p) the coin, +then the COMPOSED offset sum_{i=1..M} K_i must be distributed Geom(1-gamma). + +This is the quantity `ocbench_unified_rsm/tools/horizon_error.py` calls the horizon axis, reduced to the +thing the chain alone is responsible for: the composition rule. (horizon_error.py measures how well a +LEARNED occupancy flow predicts the future at a given beta; that is a model-quality question and is +orthogonal. What the read-out defect was about is the COMPOSITION, so that is what is tested here -- +exactly, with no model in the loop.) + +Reported per beta: the analytic check (the PGF identity, to machine precision), a Monte-Carlo KS statistic +against Geom(1-gamma), mean/variance measured vs target, and the same three numbers for the cap-truncated +walk actually used at eval, so the cap's effect on the horizon is visible rather than assumed. + +Also reported: the brief's guessed coin gamma**h (h = 1/(1-beta)) run through the SAME test, so the size +of the error it would have introduced is on the record. +""" +import argparse, json, math, os, sys +import numpy as np + +sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", + "code", "rise_robomimic")) + + +def rec_p(beta, gamma): + return (gamma - beta) / (gamma * (1.0 - beta)) + + +def geom_cdf(k, q): + """CDF of Geom(q) on {0,1,...}: P(X <= k) = 1 - (1-q)^(k+1).""" + return 1.0 - (1.0 - q) ** (k + 1.0) + + +def sample_composed(rng, beta, p, cap, n): + """N ~ truncated Geom(1-p) capped at `cap`; offset = sum of N+1 iid Geom(1-beta).""" + # number of continuations, capped + u = rng.random((n, cap)) if cap > 0 else np.zeros((n, 0)) + cont = u < p + # N = length of the leading run of successes + fail = ~cont + first_fail = np.where(fail.any(1), fail.argmax(1), cap) + N = first_fail.astype(np.int64) + capped = N >= cap + M = N + 1 + # sum of M iid Geom(1-beta) on {0,1,...} == NegBinomial(M, 1-beta) + off = rng.negative_binomial(M, 1.0 - beta) + return off, N, capped + + +def ks_vs_geom(samples, q): + """One-sample KS against Geom(q) on {0,1,...}, done on the discrete support.""" + s = np.sort(samples) + n = s.size + vals, counts = np.unique(s, return_counts=True) + ecdf_hi = np.cumsum(counts) / n + ecdf_lo = ecdf_hi - counts / n + v = vals.astype(np.float64) + # DISCRETE support: the ECDF's LEFT limit must be compared with the target's left limit F(x-) = + # F(x-1), not with F(x). Comparing it with F(x) charges the target's own atom to the statistic, which + # floors KS at max_x P(X = x) = 1 - gamma = 0.01 no matter how perfect the sample -- and that is + # exactly the 0.01000 this test first reported at every beta while the mean and variance matched to + # four digits. The atom is the target's, not an error. + return float(max(np.max(np.abs(ecdf_hi - geom_cdf(v, q))), + np.max(np.abs(ecdf_lo - geom_cdf(v - 1.0, q))))) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--betas", type=str, default="0.90,0.95,0.98") + ap.add_argument("--n", type=int, default=2_000_000) + ap.add_argument("--tail_eps", type=float, default=1e-3) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--out", type=str, default="status/chain/horizon_test.json") + a = ap.parse_args() + + # the implementation under test must be the SHIPPED one, not a copy + from robomimic.algo.rsm_scorer import chain_continuation_p, chain_cap, CHAIN_TAIL_EPS + g = a.gamma + rng = np.random.default_rng(a.seed) + rows = [] + for beta in [float(x) for x in a.betas.split(",")]: + p_ship = chain_continuation_p(beta, g) + p_ref = rec_p(beta, g) + cap = chain_cap(beta, g, a.tail_eps) + assert abs(p_ship - p_ref) < 1e-12, (p_ship, p_ref) + + # ---- analytic: the PGF identity, evaluated at a grid of z ------------------------------- + # H(G(z)) must equal (1-gamma)/(1-gamma z) for every z in (-1, 1) + zs = np.linspace(-0.99, 0.99, 199) + G = (1 - beta) / (1 - beta * zs) + H = G * (1 - p_ref) / (1 - p_ref * G) + target = (1 - g) / (1 - g * zs) + pgf_max_abs_err = float(np.max(np.abs(H - target))) + + # ---- Monte Carlo: uncapped (cap huge) and capped-at-`cap` ------------------------------- + out = {} + for tag, c in (("uncapped", 4000), ("capped", cap)): + off, N, capped = sample_composed(rng, beta, p_ref, c, a.n) + out[tag] = { + "cap": int(c), + "ks": ks_vs_geom(off, 1 - g), + "offset_mean": float(off.mean()), "offset_var": float(off.var()), + "hops_mean": float(N.mean()), "capped_frac": float(capped.mean()), + } + # ---- the brief's guessed coin, same test, for the record -------------------------------- + p_bad = g ** (1.0 / (1.0 - beta)) + off_b, _, _ = sample_composed(rng, beta, p_bad, 4000, a.n) + bad = {"p": p_bad, "ks": ks_vs_geom(off_b, 1 - g), "offset_mean": float(off_b.mean())} + + rows.append({ + "beta": beta, "gamma": g, "p_cont": p_ref, "cap": cap, + "tail_prob_at_cap": p_ref ** cap, "tail_eps": a.tail_eps, + "E_hops_expected": p_ref / (1 - p_ref), + "E_beta_reads_expected": 1.0 / (1 - p_ref), + "L_star_tab_discounts": (1 - beta) / (1 - g), + "offset_mean_target": g / (1 - g), + "offset_var_target": g / (1 - g) ** 2, + "pgf_max_abs_err": pgf_max_abs_err, + "mc": out, "brief_guess_gamma_pow_h": bad, + }) + r = rows[-1] + print(f"beta={beta} p={p_ref:.6f} cap={cap} tail={p_ref**cap:.2e}") + print(f" PGF identity max|H(G(z)) - Geom(1-gamma)| = {pgf_max_abs_err:.3e} (exact => ~1e-16)") + for tag in ("uncapped", "capped"): + o = out[tag] + print(f" {tag:9s} KS={o['ks']:.5f} offset mean={o['offset_mean']:.3f} " + f"(target {g/(1-g):.3f}) var={o['offset_var']:.1f} (target {g/(1-g)**2:.1f}) " + f"hops mean={o['hops_mean']:.3f} (target {p_ref/(1-p_ref):.3f}) " + f"capped={o['capped_frac']:.2e}") + print(f" BRIEF GUESS gamma^h: p={bad['p']:.6f} KS={bad['ks']:.5f} " + f"offset mean={bad['offset_mean']:.3f} vs target {g/(1-g):.3f}") + sys.stdout.flush() + + os.makedirs(os.path.dirname(a.out), exist_ok=True) + with open(a.out, "w") as f: + json.dump({"n_samples": a.n, "seed": a.seed, "gamma": g, "rows": rows}, f, indent=2) + print(f"\nwrote {a.out}") + + # ---- the assertions that make this a TEST and not a printout --------------------------------- + ok = True + for r in rows: + if r["pgf_max_abs_err"] > 1e-12: + print(f"FAIL beta={r['beta']}: PGF identity error {r['pgf_max_abs_err']:.3e}"); ok = False + # KS at n samples: the 99.9% critical value is ~1.95/sqrt(n) + crit = 1.95 / math.sqrt(a.n) + if r["mc"]["uncapped"]["ks"] > crit: + print(f"FAIL beta={r['beta']}: uncapped KS {r['mc']['uncapped']['ks']:.5f} > {crit:.5f}"); ok = False + print("HORIZON TEST: PASS" if ok else "HORIZON TEST: FAIL") + return 0 if ok else 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/chain_verify.py b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_verify.py new file mode 100644 index 0000000000000000000000000000000000000000..58a95c79f4c050cbec08c641603203bc8425d4f6 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_verify.py @@ -0,0 +1,226 @@ +"""VERIFY the coin-terminated beta chain against its exact analytic form, and MEASURE it against the +deterministic truncated fold it replaces (gen_q#267). GPU. + +THREE THINGS ARE ESTABLISHED HERE, and they are not the same thing: + + 1. BIT-IDENTITY OF THE OLD PATH. The chain is additive, so d1 / fold must be byte-for-byte what they + were. Proven by running the fold at the flagship (beta, L) and comparing against the values the + PRE-CHANGE scorer produces from the .bak copy, on the same states with the same seed. + + 2. THE CHAIN IS CORRECT. E[chain] must equal `chain_rb`, the SAME estimator with the coin replaced by + its own law (Rao-Blackwell): read k weighted by w_k = (1-p) p^k for k < cap and p^cap at the cap. + This is an exact identity, so the sampled chain must match it within Monte-Carlo error -- which is the + real "analytic fold" check. It is NOT checked against `fold`: see 3. + + 3. THE SIZE OF THE DEFECT. `fold` computes an ABSORBING hitting probability + q_k = c_k + (1-c_k) gamma^h q_{k+1} -- "did membership fire anywhere inside a gamma^h-geometric + window" -- while the chain computes the discounted-occupancy read E[c at a Geom(1-gamma) offset]. + They are different functionals (for constant c: c/(1-gamma^h(1-c)) vs c, a factor ~1/(1-gamma^h) + apart), so they are NOT expected to agree and the brief's "they must match at a large cap" is false by + construction. What matters for the paper is how far apart they are AND whether they RANK the 128 + candidates the same way -- if the Spearman/top-1 agreement is high the flagship numbers will barely + move, if it is low they will. Both are measured here. + +Also measured: seconds per decision for chain vs fold (the chain prunes dead rows, so it should be +cheaper than a depth-8 fold), and the per-state score SD across particle counts, which is what decides +whether 16 particles is enough for a stochastic read-out. +""" +import argparse, json, os, sys, time + +import numpy as np +import torch +import torch.nn as nn + +ROOT = "/proj/dmfexp/zwhong/rsm_rise" +os.environ.setdefault("RSM_LIBERO_DIR", f"{ROOT}/code/gen_q/rsm_libero") +sys.path.insert(0, f"{ROOT}/code/rise_robomimic") +from robomimic.algo import rsm_scorer as S # noqa: E402 + + +def spearman(a, b): + from scipy.stats import spearmanr + return float(spearmanr(np.asarray(a), np.asarray(b)).correlation) + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--task", default="mug_expert_suboptimal") + ap.add_argument("--ckpt", default="") + ap.add_argument("--hop", default="") + ap.add_argument("--feat-stats", default="") + ap.add_argument("--frames", default="1234,2345,3456,4567") + ap.add_argument("--n-cand", type=int, default=128) + ap.add_argument("--beta", type=float, default=0.95) + ap.add_argument("--gamma", type=float, default=0.99) + ap.add_argument("--fold-depth", type=int, default=1, help="the row's FLAGSHIP fold depth L") + ap.add_argument("--reps", type=int, default=24, help="independent chain draws, for the MC error") + ap.add_argument("--particles", type=int, default=16) + ap.add_argument("--seed", type=int, default=0) + ap.add_argument("--out", default="") + a = ap.parse_args() + a.ckpt = a.ckpt or f"{ROOT}/runs/{a.task}/rsm/M/ckpt_best.pt" + a.hop = a.hop or f"{ROOT}/runs/{a.task}/hop/gauss/policy_r1.pt" + a.feat_stats = a.feat_stats or f"{ROOT}/cache/{a.task}/feat_stats.npz" + a.out = a.out or f"{ROOT}/status/chain/verify_{a.task}_b{a.beta}.json" + dev = "cuda" if torch.cuda.is_available() else "cpu" + print(f"[chain_verify] device={dev} task={a.task} beta={a.beta} gamma={a.gamma}", flush=True) + + p = S.chain_continuation_p(a.beta, a.gamma) + cap = S.chain_cap(a.beta, a.gamma) + print(f"[chain_verify] p={p:.6f} cap={cap} tail={p ** cap:.2e} E[hops]={p / (1 - p):.3f}", flush=True) + + sc = S.RSMScorer(backend="mlp", ckpt=a.ckpt, hop_ckpt=a.hop, feat_stats=a.feat_stats, + mode="fold", depth=max(a.fold_depth, 1), beta=a.beta, gamma=a.gamma, + n_particles=a.particles, flow_steps=8, device=dev, dino=nn.Identity()) + cache = os.path.dirname(a.feat_stats) + z = np.load(os.path.join(cache, "z.f16.npy"), mmap_mode="r") + pr = np.load(os.path.join(cache, "proprio.f32.npy"), mmap_mode="r") + frames = [int(f) for f in a.frames.split(",")] + res = {"task": a.task, "ckpt": a.ckpt, "beta": a.beta, "gamma": a.gamma, "p_cont": p, "cap": cap, + "fold_depth": a.fold_depth, "n_particles": a.particles, "reps": a.reps, + "n_cand": a.n_cand, "frames": frames, "device": dev, "rows": []} + + for fr in frames: + feat = torch.as_tensor(np.concatenate([np.asarray(z[fr], np.float32), + np.asarray(pr[fr], np.float32)]), device=dev)[None] + x = sc.state.normalize(feat) + g = torch.Generator(device=dev).manual_seed(a.seed) + eps = torch.randn(a.n_cand, sc.d_act, device=dev, generator=g) + A = sc.backend.hop_sample(x.expand(a.n_cand, -1), eps) + + # ---- 3a. the fold, at the row's flagship depth ------------------------------------------ + t0 = time.time(); sc.score(x, A, seed=a.seed, mode=("d1" if a.fold_depth == 1 else "fold"), + depth=a.fold_depth) + if dev == "cuda": torch.cuda.synchronize() + t_fold = time.time() - t0 + # THE COST CLAIM HAS TO NAME ITS BASELINE. The chain runs ~1/(1-p) levels (5.2 at beta=0.95), so + # it is necessarily SLOWER than this row's L=1 fold and should be FASTER than the depth-8 fold the + # two Cov rows use. Timing it against L=1 alone would let the paper say "the chain is expensive" + # when what is true is "the chain costs about 5 hops, which is what a gamma=0.99 horizon costs". + t0 = time.time(); sc.score(x, A, seed=a.seed, mode="fold", depth=8) + if dev == "cuda": torch.cuda.synchronize() + t_fold8 = time.time() - t0 + q_fold = sc.last_q.detach().cpu().numpy().copy() + l_fold = sc.last_q_logit.detach().cpu().numpy().copy() + + # ---- 2a. the analytic chain (Rao-Blackwell): the coin replaced by its own law ------------- + t0 = time.time(); sc.score(x, A, seed=a.seed, mode="chain_rb") + if dev == "cuda": torch.cuda.synchronize() + t_rb = time.time() - t0 + q_rb = sc.last_q.detach().cpu().numpy().copy() + # RESET before the sampled reps. chain_rb is a chain mode, so it accumulates hop stats too -- + # and it always reports hops == cap, because it runs the full trajectory by construction. Leaving + # it in made the measured mean 5.445 against an expectation of 4.211 and looked like a real + # accounting bug; removing that ONE decision gives (5.445*25 - 33)/24 = 4.297, i.e. 0.36 sigma. + # The contamination was in this harness, never in the read-out. + sc.chain_hop_acc = None + + # ---- 2b. the sampled chain, `reps` independent draws -------------------------------------- + draws, ldraws, t_ch = [], [], 0.0 + for r in range(a.reps): + sc.backend.chain_seed = 10_000 + r # independent coins per rep + t0 = time.time(); sc.score(x, A, seed=a.seed, mode="chain") + if dev == "cuda": torch.cuda.synchronize() + t_ch += time.time() - t0 + draws.append(sc.last_q.detach().cpu().numpy().copy()) + ldraws.append(sc.last_q_logit.detach().cpu().numpy().copy()) + sc.backend.chain_seed = None + draws = np.stack(draws) # [reps, n_cand] + l_ch = np.stack(ldraws).mean(0) + q_ch = draws.mean(0) + se = draws.std(0, ddof=1) / np.sqrt(a.reps) # MC standard error of the mean of `reps` draws + hops = sc.chain_hop_summary() + sc.chain_hop_acc = None + + # the identity: |E[chain] - chain_rb| must be within MC error + dev_sigma = np.abs(q_ch - q_rb) / np.maximum(se, 1e-12) + row = { + "frame": fr, + "chain_vs_rb": { + "max_abs_diff": float(np.abs(q_ch - q_rb).max()), + "mean_abs_diff": float(np.abs(q_ch - q_rb).mean()), + "max_dev_in_MC_sigmas": float(dev_sigma.max()), + "frac_within_3_sigma": float((dev_sigma <= 3.0).mean()), + "spearman": spearman(q_ch, q_rb), + "mean_MC_se": float(se.mean()), + }, + # 3: the defect, measured -- value gap AND ranking agreement + "chain_vs_fold": { + "fold_mean": float(q_fold.mean()), "chain_mean": float(q_ch.mean()), + "ratio_fold_over_chain": float(q_fold.mean() / max(q_ch.mean(), 1e-12)), + # RANK ON THE LOGIT. The `prob` read-out saturates -- sigma(R(z)) hit exactly one + # distinct value across all 128 candidates on the first run of this test, so Spearman was + # undefined (NaN) and argmax was just index 0. That is a real property of the fold's prob + # read-out at this state, not a bug, and it is reported; but the ranking comparison that + # tells us whether the flagship numbers will move has to be done on the logit, which does + # not saturate. + "spearman_prob": spearman(q_fold, q_ch), + "spearman_logit": spearman(l_fold, l_ch), + "fold_prob_distinct_values": int(np.unique(q_fold).size), + "chain_prob_distinct_values": int(np.unique(q_ch).size), + "fold_logit_distinct_values": int(np.unique(l_fold).size), + "same_argmax_logit": bool(int(np.argmax(l_fold)) == int(np.argmax(l_ch))), + "same_argmax": bool(int(np.argmax(q_fold)) == int(np.argmax(q_ch))), + "top1_of_fold_rank_in_chain": int((q_ch > q_ch[int(np.argmax(q_fold))]).sum()), + "top1_of_chain_rank_in_fold": int((q_fold > q_fold[int(np.argmax(q_ch))]).sum()), + }, + # per-state score SD across particles: does 16 particles order the candidates stably? + "particle_noise": { + "score_sd_across_reps_mean": float(draws.std(0, ddof=1).mean()), + "score_sd_across_reps_max": float(draws.std(0, ddof=1).max()), + "spearman_between_two_single_draws": spearman(draws[0], draws[1]), + "argmax_agreement_across_reps": float( + np.mean([int(np.argmax(d) == np.argmax(q_ch)) for d in draws])), + }, + "timing_s_per_decision": { + "fold_at_row_depth": t_fold, "fold_depth8": t_fold8, + "chain": t_ch / a.reps, "chain_rb": t_rb, + "chain_levels_expected": 1.0 / (1.0 - p), + "chain_cheaper_than_fold_depth8": bool(t_ch / a.reps < t_fold8), + "chain_cheaper_than_fold_at_row_depth": bool(t_ch / a.reps < t_fold)}, + "hop_accounting": hops, + } + res["rows"].append(row) + c = row["chain_vs_rb"]; d = row["chain_vs_fold"] + print(f"[frame {fr}] chain vs RB: maxdiff={c['max_abs_diff']:.2e} " + f"max_dev={c['max_dev_in_MC_sigmas']:.2f}sigma within3sig={c['frac_within_3_sigma']:.3f} | " + f"fold/chain mean ratio={d['ratio_fold_over_chain']:.3f} " + f"spearman(logit)={d['spearman_logit']:.4f} spearman(prob)={d['spearman_prob']:.4f} " + f"distinct fold/chain prob={d['fold_prob_distinct_values']}/{d['chain_prob_distinct_values']} " + f"same_argmax_logit={d['same_argmax_logit']} | " + f"hops mean={hops['hops_mean']:.3f} (E={hops['E_hops_expected']:.3f}, " + f"rel_err={hops['hops_rel_err']:.3f}) capped={hops['capped_frac']:.2e} " + f"cap_binding={hops['cap_binding']} | " + f"t/dec foldL{a.fold_depth}={t_fold * 1e3:.0f}ms fold8={t_fold8 * 1e3:.0f}ms " + f"chain={t_ch / a.reps * 1e3:.0f}ms", flush=True) + + # ---- verdicts ------------------------------------------------------------------------------ + mx = max(r["chain_vs_rb"]["max_dev_in_MC_sigmas"] for r in res["rows"]) + fw = min(r["chain_vs_rb"]["frac_within_3_sigma"] for r in res["rows"]) + he = max(r["hop_accounting"]["hops_rel_err"] for r in res["rows"]) + res["verdict"] = { + # 128 candidates x 4 frames = 512 comparisons, so a few 3-sigma excursions are expected; + # the test is on the FRACTION within 3 sigma (>= 0.99) and on no single gross outlier. + "chain_matches_analytic": bool(fw >= 0.99 and mx < 6.0), + "worst_dev_sigmas": mx, "min_frac_within_3_sigma": fw, + "hop_count_matches_expectation": bool(he < 0.05), "worst_hop_rel_err": he, + "chain_cheaper_than_fold_depth8": bool(all( + r["timing_s_per_decision"]["chain_cheaper_than_fold_depth8"] for r in res["rows"][1:])), + "chain_cheaper_than_fold_at_row_depth": bool(all( + r["timing_s_per_decision"]["chain_cheaper_than_fold_at_row_depth"] for r in res["rows"][1:])), + "ranking_agreement_with_fold_spearman_logit": float( + np.nanmean([r["chain_vs_fold"]["spearman_logit"] for r in res["rows"]])), + "ranking_agreement_with_fold_spearman_prob": float( + np.nanmean([r["chain_vs_fold"]["spearman_prob"] for r in res["rows"]])), + } + os.makedirs(os.path.dirname(a.out), exist_ok=True) + json.dump(res, open(a.out, "w"), indent=2) + print("\n[chain_verify] VERDICT " + json.dumps(res["verdict"], indent=2)) + print(f"[chain_verify] wrote {a.out}") + ok = res["verdict"]["chain_matches_analytic"] and res["verdict"]["hop_count_matches_expectation"] + print("CHAIN VERIFY: PASS" if ok else "CHAIN VERIFY: FAIL") + return 0 if ok else 1 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/chain_verify.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_verify.sh new file mode 100644 index 0000000000000000000000000000000000000000..90105b79de2e5211af8ea100d1fef0707dd52153 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/chain_verify.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -uo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +source $ROOT/scripts/env.sh +export MUJOCO_GL=disable PYTHONUNBUFFERED=1 +export PYTHONPATH=$ROOT/code/gen_q/rsm_libero:$ROOT/code/rise_robomimic:${PYTHONPATH:-} +echo "[chain_verify] host=$(hostname) $(date)"; nvidia-smi -L +cd $ROOT +python scripts/chain_verify.py "$@"; rc=$? +echo "[chain_verify] rc=$rc $(date)"; exit $rc diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/check_iclr_fit.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/check_iclr_fit.sh new file mode 100644 index 0000000000000000000000000000000000000000..882e365167f6f74cca4928b9dbf725b0862cdfd2 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/check_iclr_fit.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash +# Does docs/tex/flagship_table.tex fit ICLR's text block? +# +# ICLR's style sets \textwidth to 5.5in = 397.5pt, which is narrow enough that this table has +# overflowed it once already (464.4pt at \small/4pt colsep -> a 66.9pt Overfull \hbox, which is what +# "it looks like shit in the doc" looked like). The table is regenerated whenever eval cells land, and +# a value gaining a digit or a seed count gaining a character can push it back over, so the fit is +# re-checked rather than assumed. +# +# Compiles against the REAL iclr2027_conference.sty and greps for the overfull warning. Runs as an LSF +# CPU job: no compute on the login node. +# usage: scripts/check_iclr_fit.sh [table.tex] +set -uo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +TBL=${1:-$ROOT/docs/tex/flagship_table.tex} +STY=$ROOT/docs/tex/iclr2027/iclr2027 +# PER-INVOCATION directory (2026-09-21). This used a single fixed $ROOT/docs/tex/_fit with fixed +# flagship_table.tex / fit.out names while only the JOB name was randomised, so two agents checking +# two different tables at the same time compiled each other's file and read each other's log. That +# is not a theoretical race: it produced a "Dimension too large" verdict for a table that has no +# such error, which sent a real investigation down a blind alley. The parent dir is kept so old +# artefacts stay where people expect them. +D=$ROOT/docs/tex/_fit/$$ +[ -d "$STY" ] || { echo "missing ICLR style files in $STY"; exit 2; } +mkdir -p "$D" +cp "$STY"/iclr2027_conference.sty "$STY"/fancyhdr.sty "$STY"/natbib.sty "$D"/ 2>/dev/null +cp "$TBL" "$D"/flagship_table.tex +cat > "$D/fit.tex" <<'TEX' +\documentclass{article} +\usepackage{iclr2027_conference,times} +\usepackage{booktabs} +\providecommand{\TODO}[1]{\textbf{[TODO: #1]}} +\begin{document} +\input{flagship_table.tex} +\end{document} +TEX +# The compiler's own output goes to its own file. Reading the LSF .out instead gave a FALSE FAILURE: +# LSF echoes the job's command line into that log, and the command line contains the string "overfull" +# as part of this very grep pattern, so the check reported an overfull box on a table that had none. +# TABLE-BLOCK SIZE REPORT (2026-09-21). This class aborts with "Dimension too large", pointing at +# the LAST LINE OF A CAPTION, when a table block grows too large -- which reads like a table-WIDTH +# problem and is not one, and cost a real investigation an hour. Bisected on +# docs/tex/flagship_single_actor.tex: the first table block at 5721 B aborts, the same block at +# 5266 B compiles clean, and removing 455 characters from ANY sentence of its caption fixes it, so it +# is total size and not a stray character. That is ONE data point, so the number below is a warning +# line and not a law: the report is printed unconditionally so a failure can be read against it. +python3 - "$TBL" <<'PYCAP' +import re, sys +WARN = 5300 # empirical, from a single bisection -- see the comment above +t = open(sys.argv[1]).read() +spans, i = [], 0 +while True: + j = t.find("\\begin{table}", i) + if j < 0: + break + k = t.find("\\end{table}", j) + k = len(t) if k < 0 else k + len("\\end{table}") + spans.append((j, k)) + i = k +for n, (j, k) in enumerate(spans, 1): + blk = t[j:k] + lab = re.search(r"\\label\{([^}]*)\}", blk) + name = lab.group(1) if lab else f"table {n}" + cap = re.search(r"\\caption\{", blk) + csz = 0 + if cap: + a = cap.end() + depth, b = 1, a + while b < len(blk) and depth: + depth += (blk[b] == "{") - (blk[b] == "}") + b += 1 + csz = b - cap.start() + flag = " <-- over the empirical warning size" if len(blk) > WARN else "" + print(f"[size] {name}: block {len(blk)} B (caption {csz} B){flag}") +PYCAP +J=rr_cpu_iclrfit_$$J=rr_cpu_iclrfit_$$ +OUT=$D/fit.out +rm -f "$OUT" "$D/fit.pdf" +"$ROOT/scripts/bsub_cpu.sh" "$J" bash -c \ + "cd $D && tectonic fit.tex > $OUT 2>&1; echo FIT_CHECK_DONE >> $OUT" >/dev/null 2>&1 +echo "submitted $J in $D; waiting..." +for _ in $(seq 1 60); do + grep -q FIT_CHECK_DONE "$OUT" 2>/dev/null && break + sleep 5 +done +f=$OUT +[ -s "$f" ] || { echo "no output from $J"; exit 1; } +if grep -qi overfull "$f"; then + echo "FAIL -- table exceeds ICLR's 397.5pt text block:" + grep -i overfull "$f" | head -3 + echo "(compiler log kept at $f)" + exit 1 +fi +grep -qi "error" "$f" && { echo "FAIL -- LaTeX error:"; grep -i error "$f" | head -5; exit 1; } +echo "PASS -- fits ICLR \\textwidth (5.5in), no overfull box, compiles clean." +# KEEP THE PASSING PDF (2026-09-21). This used to rm -rf the build dir on PASS, so the only PDFs that ever +# survived were the FAILED ones -- when the owner asked to see the latest flagship PDF, the newest file on +# disk was an overfull build from a previous run. Copy the passing output to a stable path first. +[ -f "$D/fit.pdf" ] && cp "$D/fit.pdf" "$ROOT/docs/tex/flagship_tables_latest.pdf" && echo "PDF kept: $ROOT/docs/tex/flagship_tables_latest.pdf" +rm -rf "$D" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/check_problog_knob.py b/gen_q_rsm/rsm_rise/pipeline/scripts/check_problog_knob.py new file mode 100644 index 0000000000000000000000000000000000000000..473b67ad75b681f151fd912778d07daa3789fe2f --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/check_problog_knob.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +"""gen_q#266: did `training.plan_score=prob_log` actually reach the eval cells? + +WHY THIS EXISTS. On 2026-09-21 a 61-cell temperature sweep was spent on `training.plan_temp` where +`training.plan_temperature` was meant. `plan_temp` is the softmax-rule temperature, read only when +plan_rule=softmax, so under argmax it was inert and every cell duplicated one arm. It was caught only +because two settings produced BIT-IDENTICAL `frac_saturated_mean` and `ties_at_max_mean`. Two settings +with identical health numbers are not a measurement of that knob. + +So before spending a grid, this script checks the FINGERPRINT the cell actually recorded: + + 1. planner.plan_score == "prob_log" (the override resolved) + 2. planner.scorer.score_kind == "prob_log" (the scorer was built with it) + 3. prob_log_ties_at_max_mean ~= 1 (the new array totally orders the 128) + 4. ties_at_max_mean ~= 1 (the RANKING array is prob_log, so its + tie count must be prob_log's -- if this + were still ~60, prob_log was computed + but `prob` still ranked) + 5. prob_ties_at_max_mean still LARGE (the probability array is UNCHANGED, so + `prob` would have tied ~60 of 128 on + these very states. NOTE `ties_at_max` + is the RANKING array's tie count, which + says nothing about prob once another + read-out ranks -- that is why + `prob_ties_at_max` was added.) + 6. frac_saturated_mean still LARGE (the saturation prob_log survives is + still there; if it vanished, the cell + is not in the regime under study) + +It reads only JSON, so it is safe on the login node. + +usage: check_problog_knob.py [ ...] [--dir eval_problog] [--all] + --all prints every cell instead of the first per task. +""" +import glob +import json +import os +import sys + +ROOT = "/proj/dmfexp/zwhong/rsm_rise" +TASKS = ("threading_expert_play", "mug_expert_suboptimal", "two_piece_expert_play") + + +def pl_of(j): + """the planner block, wherever this eval wrote it""" + for k in ("planner", "plan_cfg", "planner_cfg"): + if isinstance(j.get(k), dict): + return j[k] + cfg = j.get("config") or {} + if isinstance(cfg, dict) and isinstance(cfg.get("planner"), dict): + return cfg["planner"] + return {} + + +def health(j): + # Start from the per-episode plan summaries and let planner_time fill any gap: planner_time is a + # cell-level roll-up that predates several of these keys, so preferring it silently hid them. + eps = [e.get("plan") for e in (j.get("episodes") or []) if e.get("plan")] + out = {k: v for k, v in (j.get("planner_time") or {}).items() if v is not None and v == v} + for k in ("ties_at_max_mean", "frac_saturated_mean", "prob_log_ties_at_max_mean", + "prob_ties_at_max_mean", "prob_log_std_mean", "score_std_mean", + "prob_log_distinct_mean", "prob_log_ties_at_max_exact_mean", + "prob_distinct_mean", "prob_ties_at_max_exact_mean"): + v = [e[k] for e in eps if isinstance(e, dict) and e.get(k) is not None and e[k] == e[k]] + if v: + out[k] = sum(v) / len(v) + return out + + +def main(): + argv = sys.argv[1:] + d = "eval_problog" + if "--dir" in argv: + d = argv[argv.index("--dir") + 1] + show_all = "--all" in argv + tasks = [a for a in argv if not a.startswith("--") and a != d] or list(TASKS) + bad = 0 + n = 0 + for t in tasks: + files = sorted(glob.glob(os.path.join(ROOT, "runs", t, d, "*.json"))) + if not files: + print(f"{t}: no finished cell in runs/{t}/{d} yet") + continue + for f in (files if show_all else files[:1]): + n += 1 + try: + j = json.load(open(f)) + except Exception as e: + print(f"{t}: {os.path.basename(f)} unreadable ({e})") + bad += 1 + continue + pl = pl_of(j) + sc = (pl.get("scorer") or {}) if isinstance(pl.get("scorer"), dict) else {} + h = health(j) + ks = pl.get("plan_score") + sk = sc.get("score_kind") + plt_ = h.get("prob_log_ties_at_max_mean") + tm = h.get("ties_at_max_mean") + pt_ = h.get("prob_ties_at_max_mean") + fs = h.get("frac_saturated_mean") + ok = [] + ok.append(("plan_score==prob_log", ks == "prob_log", ks)) + ok.append(("scorer.score_kind==prob_log", sk == "prob_log", sk)) + # The tolerance-FREE numbers are the criteria. `prob_log_ties_at_max_mean` uses a 1e-6 + # ABSOLUTE tolerance, which is meaningless for a quantity that spans 40+ orders of magnitude: + # measured, it reads ~52 on threading while every episode has exactly 1 EXACT tie and 128 + # distinct values. It is printed for continuity with the other read-outs and not asserted on. + pld = h.get("prob_log_distinct_mean") + ple = h.get("prob_log_ties_at_max_exact_mean") + pde = h.get("prob_ties_at_max_exact_mean") + ok.append(("prob_log EXACT ties at max ~1", ple is not None and ple < 1.5, ple)) + ok.append(("prob_log distinct ~128 (total order)", pld is not None and pld > 120.0, pld)) + ok.append(("prob EXACT ties still > 3 (prob would have tied on these states)", + pde is not None and pde > 3.0, pde)) + ok.append(("frac_saturated still > 0.05", fs is not None and fs > 0.05, fs)) + print(f" (1e-6-tolerance ties, not asserted on: prob_log={plt_}, ranking={tm}, prob={pt_})") + print(f"\n{t} {os.path.basename(f)}") + print(f" success={j.get('success_rate', j.get('Success_Rate'))} " + f"episodes={len(j.get('episodes') or [])} " + f"prob_log_spread={h.get('prob_log_std_mean')}") + for name, good, val in ok: + print(f" {'PASS' if good else 'FAIL'} {name}: {val}") + if not all(g for _, g, _ in ok): + bad += 1 + if not n: + print("\nno cells to check yet") + return 2 + print(f"\n{n - bad}/{n} cell(s) carry the prob_log fingerprint") + return 1 if bad else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/collect_chain_hops.py b/gen_q_rsm/rsm_rise/pipeline/scripts/collect_chain_hops.py new file mode 100644 index 0000000000000000000000000000000000000000..cadf97952412401411709fda626f39ab8bbc41f1 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/collect_chain_hops.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 +"""HOP ACCOUNTING (owner 2026-09-22 07:00 UTC) -- aggregate the coin-chain's hop statistics over every +landed chain eval cell and write status/chain/hop_accounting.json for the flagship PDF to print. + +Why a collector and not a read inside flagship_latex.py: each eval JSON is ~128 KB and there are several +hundred of them, so the walk is a CPU job, not a login-node read. + +TWO RECOMPUTATIONS ARE DONE HERE RATHER THAN TRUSTED FROM THE CELL (both are pre-18:30Z scorer bugs, see +status/BETA_CHAIN_DONE run 2): + * `cap_binding` -- the per-cell flag used to fire whenever ANY single decision had one capped particle. + With 16 particles a decision's capped fraction is quantised to 1/16 = 0.0625, which always exceeds the + 1e-2 aggregate threshold, so every healthy cell was flagged truncated. The honest rule is the + aggregate one: pooled capped fraction > 1e-2, or mean hops within 10% of the cap. + * `levels_per_row` -- was divided by decisions x particles, dropping the candidate axis, so it read 128x + high. Cells written by the fixed scorer carry `levels_per_row_legacy_denominator`; cells without that + key are pre-fix and their value is divided by the candidate count. +""" +import json, sys, math +from pathlib import Path + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +NICE = {"square_sub_20100": "Sq-S", "square_expert_play": "Sq-C", + "two_piece_expert_suboptimal": "Pc-S", "two_piece_expert_play": "Pc-C", + "mug_expert_suboptimal": "Mug", "threading_expert_play": "Thr", + "two_piece_expert_play_tipping": "Pc-tip"} +ORDER = ["Sq-S", "Sq-C", "Pc-S", "Pc-C", "Mug", "Thr", "Pc-tip"] +GAMMA = 0.99 +N_CAND = 128 # the flagship candidate count; the axis the legacy denominator dropped + + +def main(): + cells, skipped = [], [] + for task, row in NICE.items(): + for p in sorted((ROOT / "runs" / task).glob("eval_onactor/E1-*-ch*-N128-*.json")): + try: + d = json.loads(p.read_text()) + except Exception as e: + skipped.append([str(p.name), "unreadable: %s" % e]); continue + h = (d.get("planner") or {}).get("scorer", {}).get("chain_hops") + if not h or not h.get("decisions"): + skipped.append([p.name, "no chain_hops"]); continue + if h.get("mode") != "chain": # chain_rb is the analytic path; never published + skipped.append([p.name, "mode=%s" % h.get("mode")]); continue + lpr = h.get("levels_per_row") + legacy = "levels_per_row_legacy_denominator" not in h + if legacy and lpr: + lpr = lpr / N_CAND + cells.append(dict( + row=row, task=task, cell=d.get("cell") or p.stem, file=str(p.relative_to(ROOT)), + sr=d.get("success_rate"), n_ep=d.get("num_episodes"), + beta=h["beta"], cap=h["cap"], p_cont=h["p_cont"], n_particles=h["n_particles"], + decisions=h["decisions"], hops_mean=h["hops_mean"], hops_median=h.get("hops_median"), + hops_p90=h.get("hops_p90"), hops_mean_expired=h.get("hops_mean_expired"), + capped_frac=h["capped_frac"], expired_frac=h.get("expired_frac"), + absorbed_frac=h.get("absorbed_frac", 0.0), + E_hops_expected=h["E_hops_expected"], tail_prob_at_cap=h.get("tail_prob_at_cap"), + levels_per_row=lpr, levels_legacy_fixed=legacy, + cap_binding_recorded=h.get("cap_binding"))) + + # ---- aggregate per row (pooled by decisions) --------------------------------------------------- + rows = [] + for row in ORDER: + cs = [c for c in cells if c["row"] == row] + if not cs: + continue + for beta in sorted({c["beta"] for c in cs}): + g = [c for c in cs if c["beta"] == beta] + D = sum(c["decisions"] for c in g) + w = lambda k: sum(c[k] * c["decisions"] for c in g if c.get(k) is not None) / D + cap = g[0]["cap"] + hm, cf = w("hops_mean"), w("capped_frac") + # THE HONEST CAP ALARM: aggregate only (the per-decision flag is quantised to 1/n_particles). + binds = bool(cf > 1e-2 or hm > 0.9 * cap) + rows.append(dict( + row=row, task=g[0]["task"], beta=beta, cap=cap, p_cont=g[0]["p_cont"], + n_cells=len(g), decisions=D, + E_hops_expected=g[0]["E_hops_expected"], + hops_mean=hm, hops_median=w("hops_median"), hops_p90=w("hops_p90"), + hops_mean_expired=w("hops_mean_expired"), + hops_rel_err=(hm - g[0]["E_hops_expected"]) / g[0]["E_hops_expected"], + capped_frac=cf, expired_frac=w("expired_frac"), absorbed_frac=w("absorbed_frac"), + tail_prob_at_cap=g[0]["tail_prob_at_cap"], + levels_per_row=w("levels_per_row"), + frame_offset_mean_expected=GAMMA / (1.0 - GAMMA), + cap_binding=binds, + n_cells_recorded_binding=sum(1 for c in g if c["cap_binding_recorded"]), + particles=sorted({c["n_particles"] for c in g}))) + + worst = max((abs(r["hops_rel_err"]) for r in rows), default=0.0) + out = dict( + generated_by="scripts/collect_chain_hops.py", gamma=GAMMA, + n_cells=len(cells), n_rows=len({r["row"] for r in rows}), + worst_hops_rel_err=worst, + max_capped_frac=max((r["capped_frac"] for r in rows), default=0.0), + any_cap_binding=any(r["cap_binding"] for r in rows), + n_cells_recorded_binding_wrongly=sum(r["n_cells_recorded_binding"] for r in rows if not r["cap_binding"]), + rows=rows, cells=cells, skipped=skipped[:40], n_skipped=len(skipped)) + # ATOMIC (2026-09-23). flagship_latex.py reads this file while a regeneration is running; a + # partial write there is not an error the reader can see -- json.loads raises, _hop_accounting + # returns ("", "") and tab:chainhops silently disappears from the PDF. Write beside it and rename. + dst = ROOT / "status" / "chain" / "hop_accounting.json" + tmp = dst.with_suffix(".json.tmp") + tmp.write_text(json.dumps(out, indent=1)) + tmp.replace(dst) + print("[hops] %d cells, %d rows -> %s" % (len(cells), len(rows), dst)) + for r in rows: + print(" %-7s b%.2f cap%-3d n=%d D=%-6d hops %.3f / %.3f (%+.1f%%) expired %.3f capped %.2e " + "levels/row %.2f binds=%s" % ( + r["row"], r["beta"], r["cap"], r["n_cells"], r["decisions"], r["hops_mean"], + r["E_hops_expected"], 100 * r["hops_rel_err"], r["hops_mean_expired"], + r["capped_frac"], r["levels_per_row"], r["cap_binding"])) + print("[hops] worst |hops rel err| = %.3f%%, max capped frac = %.2e, any cap binding = %s" + % (100 * worst, out["max_capped_frac"], out["any_cap_binding"])) + print("[hops] cells carrying the stale cap_binding=true flag on non-binding rows: %d" + % out["n_cells_recorded_binding_wrongly"]) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/dinowm_smoke.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/dinowm_smoke.sh new file mode 100644 index 0000000000000000000000000000000000000000..dbb1d1d35905e27c1421e7c82b480b1b8aa41edf --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/dinowm_smoke.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# DINO-WM port smoke test (gen_q#268). GPU LSF job -- never the login node. +# A. the FLOW path is unchanged: pre-patch trainer vs patched trainer at one seed, same loss line +# B. --dynamics latent_mse trains, saves a checkpoint tagged model=dinowm +# C. dinowm_readout scores candidates at d1 and fold, finite, in [0,1], and RANKS them +# D. the two read-outs refuse each other's checkpoints (a velocity field must never be read as a +# next-state predictor, or the table reports a number that is neither method) +set -uo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +CODE=$ROOT/code/gen_q/rsm_libero +SC=$ROOT/runs/_dinowm_smoke; rm -rf "$SC"; mkdir -p "$SC" +PY=$ROOT/venv_rsm/bin/python +TASK=two_piece_expert_suboptimal +# PYTHONPATH, not just cd: python puts the SCRIPT's directory on sys.path, not the cwd, so the +# copy of the pre-patch trainer under runs/_dinowm_smoke/ could not import dwm_model without this +# (the first run of this smoke produced an EMPTY section A1 for exactly that reason). +export OMP_NUM_THREADS=8 PYTHONUNBUFFERED=1 PYTHONPATH=$CODE +cp "$CODE/train_rsm_dwm.py.bak.20260921_dinowm" "$SC/train_rsm_dwm_old.py" +TINY="--depth 2 --heads 4 --dim-head 32 --mlp 256 --dropout 0.0 --chunk 8 \ + --batch 32 --micro 16 --steps 60 --eval-every 30 --save-every 0 --compile 0 --in-ram 0 \ + --warm-cache 0 --eval-rows 64 --eval-frames 64 --eval-minmse-n 2 --wandb-mode disabled \ + --resume 0 --seed 0 --reward-mode dense --reward-loss bce" +cd "$CODE" +echo "===== A1. OLD trainer, flow =====" +$PY "$SC/train_rsm_dwm_old.py" --cache "$ROOT/cache/$TASK" --out "$SC/flow_old" $TINY 2>&1 \ + | tee "$SC/a1.full.txt" | grep -E "^\[dwm\] (60|EVAL)" | tee "$SC/a1.txt" +[ -s "$SC/a1.txt" ] || { echo "A1 PRODUCED NOTHING -- tail of its output:"; tail -15 "$SC/a1.full.txt"; } +echo "===== A2. NEW trainer, flow (must equal A1) =====" +$PY train_rsm_dwm.py --cache "$ROOT/cache/$TASK" --out "$SC/flow_new" --dynamics flow $TINY 2>&1 \ + | grep -E "^\[dwm\] (60|EVAL)" | tee "$SC/a2.txt" +echo "===== B. NEW trainer, latent_mse (DINO-WM) =====" +$PY train_rsm_dwm.py --cache "$ROOT/cache/$TASK" --out "$SC/dinowm" --dynamics latent_mse $TINY 2>&1 \ + | grep -E "^\[dwm\] (DYNAMICS|60|EVAL|--w-actcon)" | tee "$SC/b.txt" +echo "===== C/D. read-out =====" +$PY - "$SC" "$ROOT" <<'PYX' +import sys, glob, torch +sys.path.insert(0, "/proj/dmfexp/zwhong/rsm_rise/code/gen_q/rsm_libero") +SC, ROOT = sys.argv[1], sys.argv[2] +import dwm_readout, dinowm_readout +ck_path = f"{SC}/dinowm/ckpt.pt" +ck = torch.load(ck_path, map_location="cpu", weights_only=False) +print("blob: model=", ck["model"], "dynamics=", ck["config"]["dynamics"], + "hop_frames=", ck.get("hop_frames"), "w_actcon=", ck["config"]["w_actcon"]) +dev = "cuda" if torch.cuda.is_available() else "cpu" +crit = dinowm_readout.load_critic_dwm(ck_path, device=dev) +print("loaded DINOWMCritic: hop_frames", crit.hop_frames, "| d_act", crit.d_act, "| n_pr", crit.n_pr) +B = 8 +torch.manual_seed(0) +tok = torch.randn(B, 514, 384) * 2.0 +pr = torch.randn(B, 9) * 0.1 +a = torch.randn(B, crit.d_act).clamp(-1, 1) +hop = lambda pooled, eps: torch.randn(pooled.shape[0], crit.d_act, device=pooled.device).clamp(-1, 1) +hop.d_act = crit.d_act +for mode, depth in (("d1", 1), ("fold", 2), ("fold", 4)): + q, ql = crit.q(tok, a, beta=0.95, n_particles=16, crn_seed=0, depth=depth, mode=mode, + proprio=pr, hop_policy=hop, gamma=0.99, return_logit=True) + q = q.float().cpu() + print(f" q[{mode},L={depth}] finite={bool(torch.isfinite(q).all())} " + f"in[0,1]={bool((q>=0).all() and (q<=1).all())} spread={float(q.max()-q.min()):.5f} " + f"mean={float(q.mean()):.4f}") +# determinism: the same call twice must agree exactly (no ODE noise on this path) +q1, _ = crit.q(tok, a, beta=0.95, n_particles=16, crn_seed=0, depth=1, mode="d1", proprio=pr, + hop_policy=hop, return_logit=True) +q2, _ = crit.q(tok, a, beta=0.95, n_particles=16, crn_seed=7, depth=1, mode="d1", proprio=pr, + hop_policy=hop, return_logit=True) +print(" deterministic across crn seeds:", bool(torch.equal(q1.float(), q2.float()))) +# D. the read-outs must refuse each other +try: + dwm_readout.load_critic_dwm(ck_path, device="cpu"); print(" D1 FAIL: flow read-out accepted a dinowm blob") +except RuntimeError as e: + print(" D1 ok:", str(e).split(".")[0][:90]) +flows = sorted(glob.glob(f"{ROOT}/runs/*/rsm/DWM/ckpt_best.pt")) +if flows: + try: + dinowm_readout.load_critic_dwm(flows[0], device="cpu"); print(" D2 FAIL: dinowm read-out accepted a flow blob") + except RuntimeError as e: + print(" D2 ok:", str(e).split(".")[0][:90]) +else: + print(" D2 skipped: no flow DWM checkpoint on disk") +print("READOUT CHECKS DONE") +PYX +echo "===== VERDICT =====" +if diff -q "$SC/a1.txt" "$SC/a2.txt" >/dev/null; then echo "FLOW PATH IDENTICAL: PASS" +else echo "FLOW PATH CHANGED: FAIL"; diff "$SC/a1.txt" "$SC/a2.txt" | head -10; fi +echo "===== DINOWM SMOKE DONE =====" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/eval_cell.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/eval_cell.sh new file mode 100644 index 0000000000000000000000000000000000000000..3a753a84f16bba1b4e6a25479dae6c56c3a58817 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/eval_cell.sh @@ -0,0 +1,229 @@ +#!/usr/bin/env bash +# usage: eval_cell.sh [extra hydra overrides...] +# task : label only, stored in the JSON (e.g. square_expert_play) +# ckpt : a model_epoch_*.pth file, OR a run dir (…/_seed, its / dir, or a models/ dir); +# for a dir the highest model_epoch_N.pth under it is used +# envcfg : hydra env config name, e.g. robomimic_square_coverage | robomimic_square | robomimic_mug +# out_json : per-episode results (success/final_success/return/length/first_success_step) + success_rate +# Defaults: 100 rollouts, horizon 400 (RISE's eval default), end_on_success=True, eval_seed=0, no video, +# policy_mode=idql (RISE: 128 samples ranked by the IQL critic). Common overrides: +# exp.num_rollouts=5 exp.rollout_horizon=200 exp.eval_seed=1 exp.policy_mode=bc exp.end_on_success=False +# Must run on a GPU node (EGL rendering + CUDA: the RISE policies are IMAGE-based -- ResNet18 VisualCore on +# agentview_image + robot0_eye_in_hand_image -- so the offscreen renderer is REQUIRED, never disable it). +# The python call is retried up to 3x inside the job (node-flaky SIGABRT); the furthest partial is kept as +# $out.partial_best, and eval.py RESUMES from it: a preempted / crashed cell continues at the next episode index +# with the same init-state sequence (exp.resume_partial=False turns that off). +set -uo pipefail +# The whole script body is a function so bash parses it completely before running anything: +# editing this file while a job is running it is then safe (bash otherwise reads scripts incrementally). +main() { + ROOT=/proj/dmfexp/zwhong/rsm_rise + source $ROOT/scripts/env.sh + # THE RENDERER IS NOT OPTIONAL HERE, SO IT IS NOT INHERITED (rsm_rise #268, 2026-09-21). + # env.sh sets MUJOCO_GL=${MUJOCO_GL:-egl}, which RESPECTS whatever the submitting shell had. LSF + # propagates the submitter's environment into the job, so a submitter that had MUJOCO_GL=disable -- + # which every CPU-side helper must set, or robomimic segfaults on import -- silently handed the + # renderer-disabled value to a GPU eval that REQUIRES rendering. Result: robosuite died at env + # construction with `NameError: name 'GLContext' is not defined` and the cell produced nothing. + # It looked host-correlated for an hour (it is not: 31/31 failures had MUJOCO_GL=disable and 6/6 + # successes had egl, perfectly separated by SUBMITTER, not by host). + # This script knows it needs a renderer, so it decides, and says so when it overrides. + case "${MUJOCO_GL:-}" in + egl|glfw|osmesa) ;; + *) echo "[eval_cell] MUJOCO_GL='${MUJOCO_GL:-unset}' cannot render; forcing egl (an eval REQUIRES" + echo "[eval_cell] an offscreen renderer -- the RISE policies are image-based). If you meant to" + echo "[eval_cell] disable rendering you are running the wrong script." + export MUJOCO_GL=egl PYOPENGL_PLATFORM=egl ;; + esac + task=$1; ckpt=$2; envcfg=$3; out=$4; shift 4 + ckpt_arg=$ckpt + if [ -d "$ckpt" ]; then + ckpt=$(find "$ckpt" -name 'model_epoch_*.pth' | awk -F'model_epoch_' '{split($2,a,"."); print a[1], $0}' | sort -n | tail -1 | cut -d' ' -f2-) + fi + [ -f "$ckpt" ] || { echo "no checkpoint found: $2"; exit 2; } + ckpt=$(readlink -f "$ckpt"); out=$(readlink -m "$out") + # scripts/eval.py wants the run dir that contains models/ ; it picks the highest epoch in it. + # If a specific .pth was requested, expose it alone through a temp dir of symlinks. + mdir=$(dirname "$ckpt"); rundir=$(dirname "$mdir") + tmp=$(mktemp -d $ROOT/cache/evaltmp.XXXXXX); mkdir -p $tmp/models; ln -s "$ckpt" $tmp/models/ + mkdir -p "$(dirname "$out")" + cd $RISE_CODE + echo "[eval_cell] host=$(hostname) job=${LSB_JOBID:-none} task=$task ckpt=$ckpt env=$envcfg out=$out" + # rsm_rise 2026-09-21: the RISE authors evaluated mug-cleanup with the RELAXED "mug in drawer" criterion + # (author communication); every eval from now on uses it, and eval.py records it in the JSON so the + # table loader can tell relaxed cells from the stock-criterion archive. + export RSM_RISE_MUG_SUCCESS=${RSM_RISE_MUG_SUCCESS:-in_drawer} + # rsm_rise #267: threading's _check_success is a single conjunct that 91.6 % of the released expert + # demos satisfy at their final frame, so it is NOT relaxed -- the default stays STOCK. Exported (and + # recorded by eval.py, which also makes it a resume key) so a cell can be told apart from one run under + # RSM_RISE_THREAD_SUCCESS=through_ring, should that variant ever be used deliberately. + export RSM_RISE_THREAD_SUCCESS=${RSM_RISE_THREAD_SUCCESS:-stock} + export PYTHONFAULTHANDLER=1 # SIGABRT/SIGSEGV then print the python stack (the abort is otherwise silent) + echo "[eval_cell] CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-unset} MUJOCO_GL=${MUJOCO_GL:-unset} MUJOCO_EGL_DEVICE_ID=${MUJOCO_EGL_DEVICE_ID:-unset}"; nvidia-smi -L 2>/dev/null + # Retry loop: ~25% of the 2026-09-18 evals die with SIGABRT (exit 134, no python traceback) inside the + # MuJoCo/EGL renderer after 1-3 rollouts. NOT host-correlated -- the same (cell, epoch) reproduces on 4 + # different hosts (status/A_env_stage0.md 17:00 UTC), so it is checkpoint/state dependent. Retrying in-job is + # still worth it (the abort happens ~35 s in, and the resume carries the finished episodes forward). + rc=1 + # Salvage: eval.py rewrites "$out.partial" after EVERY episode, so a crashed attempt still holds all the episodes it + # finished. Keep the attempt that got furthest in "$out.partial_best" instead of deleting it (rsm_rise 15:40 UTC). + keep_best() { + [ -f "$out.partial" ] || return 0 + python - "$out.partial" "$out.partial_best" <<'PYB' +import json, sys, os +src, dst = sys.argv[1:3] +try: n = json.load(open(src)).get('num_episodes', 0) +except Exception: sys.exit(0) +try: m = json.load(open(dst)).get('num_episodes', -1) if os.path.exists(dst) else -1 +except Exception: m = -1 +if n > m: + os.replace(src, dst); print(f"[eval_cell] kept partial with {n} episodes -> {dst}") +PYB + rm -f "$out.partial" + } + # How many finished episodes are currently salvaged (used to detect an attempt that makes no progress). + best_n() { python - "$out.partial_best" <<'PYN' +import json, sys, os +p = sys.argv[1] +try: print(json.load(open(p)).get('num_episodes', 0) if os.path.exists(p) else 0) +except Exception: print(0) +PYN + } + # Retry policy (rsm_rise 20:35 UTC): the SIGABRT is stochastic per simulation step, so a fixed 3 attempts caps a + # crashy cell at ~3 episodes per job and the cell never finishes. Retry until RR_EVAL_ATTEMPTS / RR_EVAL_DEADLINE_S, + # but give up early if 3 consecutive attempts add no episode at all (that is a genuinely dead node/checkpoint). + # rsm_rise 23:20 UTC: budget raised 60 attempts / 5400 s -> 150 / 10800 s. ~5 % of eval jobs land in a + # DEGENERATE mode that aborts after exactly ONE episode per process (see status/A_env_stage0.md 23:10), so a + # 100-rollout TEST eval needs ~100 attempts; with the old 5400 s deadline such a job died at ~45 episodes and + # had to be relaunched 2-3 times. Healthy jobs never retry, so the raise costs them nothing. + # n_start = episodes already salvaged by EARLIER jobs for this same output (shared disk). The exit-99 + # host-requeue below must test progress made by THIS job, not the absolute count -- see 01:15 UTC. + t0=$(date +%s); stall=0; prev_n=$(best_n); n_start=$prev_n + # Per-attempt stderr capture (still streamed live to the job stderr by tee), so the give-up path can + # tell a HOST-level EGL failure apart from a crash: see the exit-99 block after the loop. + errcap=$(mktemp $ROOT/cache/evalerr.XXXXXX) + for attempt in $(seq 1 ${RR_EVAL_ATTEMPTS:-150}); do + if [ $attempt -gt 1 ]; then + echo "[eval_cell] attempt $attempt after rc=$rc (previous attempt crashed)"; keep_best + n_now=$(best_n) + if [ "${n_now:-0}" -gt "${prev_n:-0}" ]; then stall=0; else stall=$((stall+1)); fi + prev_n=$n_now + [ $stall -ge 3 ] && { echo "[eval_cell] giving up: 3 attempts in a row finished 0 new episodes (have $n_now)"; break; } + [ $(( $(date +%s) - t0 )) -ge ${RR_EVAL_DEADLINE_S:-10800} ] && { echo "[eval_cell] giving up: deadline ${RR_EVAL_DEADLINE_S:-10800}s reached (have $n_now episodes)"; break; } + fi + # stdbuf+-u: MuJoCo/robosuite report fatal errors with C-level printf on stdout; with the default block + # buffering that message is LOST when the process aborts, which is why the SIGABRT looked silent. + : > "$errcap" + stdbuf -oL -eL python -u scripts/eval.py -cn eval_robomimic_iql_diffusion +env=$envcfg exp.use_model_manager=False \ + exp.model_path=$tmp exp.eval_ckpt=$ckpt exp.results_json=$out exp.num_rollouts=100 exp.rollout_horizon=400 exp.end_on_success=True \ + exp.eval_seed=0 exp.seed=0 exp.log_video=False env.render=False name=eval_${task} "$@" \ + 2> >(tee -a "$errcap" >&2) + rc=$? + [ $rc -eq 0 ] && break + # rsm_rise #268, 2026-09-21: THIRD host-level GL signature, and the one this test used to miss. + # On a minority of nodes mujoco's EGL context module fails to import, so the name `GLContext` is + # never bound and env construction dies with `NameError: name 'GLContext' is not defined` instead + # of the 0x8cdd FatalError. It is just as host-correlated (14 distinct hosts today, 8 occurrences + # on p1-r20-n1 alone, 35 eval logs in one day) and just as unretryable in-job -- but it did not + # match either existing test, so those cells exited 1 and died instead of being requeued onto a + # working host. A guard that recognises only the failures we have already seen lets every new one + # through as a silent cell death, which is the same shape of bug as the babysitter latch this + # issue started with. Both tests below now match either signature. + # A 0x8cdd framebuffer failure is a property of the HOST's GPU, not of the checkpoint: robosuite dies at env + # construction, so every further attempt in this job dies the same way (~40 s each). Stop retrying at once + # and let the exit-99 block below requeue us onto a different host (rsm_rise 01:15 UTC). + sleep 1 # let the tee process substitution flush this attempt's stderr before we read $errcap + if grep -qE "Offscreen framebuffer is not complete|NameError: name .GLContext. is not defined" "$errcap" 2>/dev/null; then + echo "[eval_cell] attempt $attempt died at env construction with the 0x8cdd offscreen-framebuffer error -- host-level, not retryable in-job; leaving the retry loop" + break + fi + done + rm -rf $tmp + [ $rc -eq 0 ] || keep_best + # Host-level EGL failure (rsm_rise 2026-09-19 00:05 UTC). A minority of GPU nodes cannot create the MuJoCo + # offscreen framebuffer at all: robosuite dies at env construction with + # mujoco.FatalError: Offscreen framebuffer is not complete, error 0x8cdd (= GL_FRAMEBUFFER_UNSUPPORTED) + # All 4 occurrences so far are on the SAME host (p2-r03-n1, 4 of its 13 eval jobs), so unlike the silent + # SIGABRT this one IS host-correlated. Retrying in-job cannot help -- every attempt hits the same GPU -- so + # the 3-stalled-attempts guard fires and the cell dies having produced nothing. Exit 99 instead: bsub_gpu.sh + # passes -Q "EXCLUDE(99)", which makes LSF requeue the job onto a DIFFERENT host. Bounded to 3 requeues per + # output file so a non-host-specific failure cannot loop forever, and only ever taken when THIS JOB added no + # episode (a job that made progress is a normal partial and is resumed by the watcher as usual). + # rsm_rise 2026-09-19 01:15 UTC: the test used to be "salvaged ZERO episodes in total", which silently + # excluded the commonest case -- job 1775175 ran 88 episodes on p1-r29-n2, was requeued by LSF onto the bad + # host p2-r03-n1, could not render a single frame there, and exited 1 (dead) because 88 > 0. The count that + # matters is progress relative to n_start, since .partial_best lives on shared disk and survives the requeue. + if [ $rc -ne 0 ]; then + sleep 1 # let the tee process substitution flush the last attempt's stderr + n_final=$(best_n) + if [ "${n_final:-0}" -le "${n_start:-0}" ] && grep -qE "Offscreen framebuffer is not complete|NameError: name .GLContext. is not defined" "$errcap" 2>/dev/null; then + rq=$(cat "$out.requeues" 2>/dev/null || echo 0) + case "$rq" in ''|*[!0-9]*) rq=0;; esac + if [ "$rq" -lt 3 ]; then + echo $((rq + 1)) > "$out.requeues" + echo "[eval_cell] host $(hostname) cannot create an EGL offscreen framebuffer (0x8cdd) and this job salvaged 0 episodes; exiting 99 so LSF requeues onto another host (requeue $((rq + 1))/3)" + rc=99 + else + echo "[eval_cell] EGL offscreen framebuffer failure again, but $rq requeues already used for $out -- giving up, not requeueing" + fi + # rsm_rise 2026-09-19 05:05 UTC -- SECOND zero-progress mode that the 0x8cdd test above does not catch. + # Jobs 1779677 (squareplay S0A s2 es1) and 1779463 (threading S0A s2 val ep5000) burned 9 and 40 attempts + # and finished ZERO new episodes each: every attempt resumes from .partial_best with the numpy RNG state + # restored, replays the SAME episode, and SIGABRTs (rc=134) inside + # robosuite/utils/binding_utils.py read_pixels <- EGL glReadPixels + # i.e. the crash is reproducible for that (host, episode) pair, so in-job retries cannot clear it and the + # watcher's relaunch can land on the same host again -- an unbounded loop that never produces the gate + # number. Requeue onto a different host instead (same -Q EXCLUDE(99) mechanism, same 3-requeue cap on the + # same counter file, so total requeues per output stay bounded). Deliberately narrow: it requires the + # read_pixels abort signature AND that the in-job stall guard already fired (stall>=3) AND that this job + # added no episode, so an ordinary crash (exit 1, no "Aborted") is still NOT turned into a host requeue -- + # that negative control is case `generic_crash` of scripts/rr_cpu_test_exit99.sh. + # If all 3 requeues abort on 3 DIFFERENT hosts, the failure is episode-level, not host-level; that is the + # diagnostic this branch buys and it is recorded in $out.requeues. + # + # rsm_rise 2026-09-19 06:50 UTC -- the `n_final <= n_start` half of this test had a REAL GAP, and it cost + # four gate evals: 1780354 (piecetip S3H1 s1 es0), 1780237 (subpaper S0B s2 es0), 1780235 + 1780236 + # (piecetip val). All four ran 9-27 attempts, salvaged 3/8/16/17 episodes, then hit the SAME read_pixels + # SIGABRT stall -- and because they HAD made progress inside the job, this branch was skipped and they + # exited 134 with no requeue, i.e. the gate eval simply never completed and only a manual relaunch could + # recover it. The commonest shape of the failure is "salvage some, then wedge on one poisoned episode", + # so requiring zero progress excluded it. + # The condition is therefore split by progress, not gated on it: + # * this job added NO episode -> $out.requeues, cap 3 (unchanged; the 01:15 semantics) + # * this job added episodes -> $out.requeues_prog, cap 6 + # Two counters, so a progress-making requeue can never eat the zero-progress budget or vice versa. Both + # are bounded, and the progress case cannot loop: `.partial_best` lives on shared disk and survives the + # requeue, so every such requeue starts from strictly more episodes than the last and the run terminates + # at num_rollouts. The negative control is untouched: an ordinary crash (exit 1, no read_pixels abort, + # stall < 3) still takes no requeue at all. + elif [ "${stall:-0}" -ge 3 ] && grep -q "in read_pixels" "$errcap" 2>/dev/null; then + if [ "${n_final:-0}" -le "${n_start:-0}" ]; then + cf="$out.requeues"; cap=3; what="salvaged 0 new episodes" + else + cf="$out.requeues_prog"; cap=6; what="salvaged $(( ${n_final:-0} - ${n_start:-0} )) new episodes and then wedged" + fi + rq=$(cat "$cf" 2>/dev/null || echo 0) + case "$rq" in ''|*[!0-9]*) rq=0;; esac + if [ "$rq" -lt "$cap" ]; then + echo $((rq + 1)) > "$cf" + echo "[eval_cell] host $(hostname): $stall consecutive attempts SIGABRTed in read_pixels and this job $what; exiting 99 so LSF requeues onto another host (requeue $((rq + 1))/$cap)" + rc=99 + else + echo "[eval_cell] read_pixels SIGABRT stall again, but $rq requeues already used for $out ($(basename $cf)) -- giving up; $cap different hosts failed, so this looks EPISODE-level, not host-level" + fi + fi + fi + rm -f "$errcap" + if [ $rc -eq 0 ] && [ -f "$out" ]; then + python - "$out" "$task" "$ckpt_arg" "$ckpt" <<'PY' +import json, sys +p, task, ck, ckf = sys.argv[1:5] +d = json.load(open(p)); d['task'] = task; d['checkpoint'] = ck; d['checkpoint_file'] = ckf; json.dump(d, open(p, 'w'), indent=2) +print(f"[eval_cell] {task} success_rate={d['success_rate']} n={d['num_episodes']} mean_len={d['mean_length']}") +PY + fi + echo "[eval_cell] exit=$rc $(date)" + exit $rc +} +main "$@" +exit $? diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/eval_health.py b/gen_q_rsm/rsm_rise/pipeline/scripts/eval_health.py new file mode 100644 index 0000000000000000000000000000000000000000..eb8c3d691043369bdd06e14621ec1d4f8ccedb39 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/eval_health.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +"""Which eval cells actually FAILED, as opposed to printing alarming text. + +Grepping eval logs for "Traceback" massively overcounts failures. robosuite's EGL context raises +`EGLError` from `binding_utils.__del__` at interpreter teardown, long after the rollout finished, so a +perfectly good cell ends its log with a traceback: in one sample 18 of 25 logs contained one and all 18 +had produced a complete JSON. Reporting that as a 72 % failure rate is worse than not checking. + +The only reliable signal is the artefact: a cell succeeded iff its JSON exists and carries episodes. +Everything else is triage detail. + + DONE JSON present with episodes + PARTIAL no JSON but a .partial_best -- the cell is banking episodes, usually the per-episode EGL + SIGABRT (`Fatal Python error: Aborted`), which requeues and resumes rather than losing work + EMPTY neither -- a genuine failure worth looking at + +usage: eval_health.py [--dir eval_flagtopup] [--task T] [--verbose] +""" +from __future__ import annotations + +import argparse +import glob +import json +import os +from collections import Counter +from pathlib import Path + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +NOISE = ("binding_utils.py", "egl_context.py", "EGLError", "__del__") + + +def classify(log): + cell = os.path.basename(log)[:-4] + base = os.path.dirname(os.path.dirname(log)) + js = os.path.join(base, cell + ".json") + if os.path.isfile(js): + try: + d = json.load(open(js)) + if d.get("episodes"): + return "DONE", len(d["episodes"]) + except Exception: + pass + part = js + ".partial_best" + if os.path.isfile(part): + try: + return "PARTIAL", len(json.load(open(part)).get("episodes", [])) + except Exception: + return "PARTIAL", 0 + return "EMPTY", 0 + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--dir", default="eval_flagtopup") + ap.add_argument("--task", default="*") + ap.add_argument("--verbose", action="store_true") + a = ap.parse_args() + logs = sorted(glob.glob(str(ROOT / "runs" / a.task / a.dir / "logs" / "*.log")), + key=os.path.getmtime, reverse=True) + c, eps, noisy, aborts = Counter(), Counter(), 0, 0 + rows = [] + for l in logs: + st, n = classify(l) + c[st] += 1 + eps[st] += n + try: + t = open(l, errors="ignore").read() + except Exception: + t = "" + if "Traceback" in t and any(k in t for k in NOISE): + noisy += 1 + if "Fatal Python error: Aborted" in t: + aborts += 1 + if st != "DONE": + rows.append((st, n, os.path.basename(l)[:-4])) + tot = sum(c.values()) + print(f"{tot} cells in {a.dir}: " + " ".join(f"{k}={c[k]}" for k in ("DONE", "PARTIAL", "EMPTY"))) + print(f" episodes banked: DONE={eps['DONE']} PARTIAL={eps['PARTIAL']}") + print(f" logs with teardown-only tracebacks (NOT failures): {noisy}") + print(f" logs with a per-episode EGL SIGABRT: {aborts}") + if a.verbose and rows: + print("\n not-done cells:") + for st, n, cell in rows[:40]: + print(f" {st:<8}{n:>4} ep {cell}") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/eval_host_stats.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/eval_host_stats.sh new file mode 100644 index 0000000000000000000000000000000000000000..d50e62978651530f05162e376d4f1b30f28e8b57 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/eval_host_stats.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Per-host outcome statistics for the Stage 0 eval jobs (rr_ev_*) and the "bad eval host" +# blacklist derived from them. +# usage: scripts/eval_host_stats.sh [--write] +# Why: the eval SIGABRT (exit 134, no python traceback, inside the MuJoCo/EGL renderer) is +# HOST-correlated -- as of 2026-09-18 17:00 UTC the set of hosts that ever produced an EXIT and +# the set that ever produced a DONE are DISJOINT (16 vs 45 hosts). A host with >=1 EXIT and 0 +# DONE is therefore treated as broken for rendering and excluded from future eval submissions +# (scripts/bsub_gpu.sh honours RR_EXCL_HOSTS). The list is recomputed from the LSF history on +# every call, so a host that starts succeeding again drops out by itself. +ROOT=/proj/dmfexp/zwhong/rsm_rise +out=$ROOT/status/bad_eval_hosts.txt +tmp=$(mktemp) +# stream D 17:25: the rr_e1_* planner-eval cells hit the SAME MuJoCo/EGL SIGABRT, so they are counted too +# (RR_JOB_PAT overrides the pattern). +bjobs -a -w 2>/dev/null | grep -E "${RR_JOB_PAT:-rr_ev_|rr_e1_}" | awk '{print $1, $3}' | while read -r j st; do + case $st in DONE|EXIT) ;; *) continue ;; esac + f=$(ls $ROOT/logs/lsf/*.${j}.out 2>/dev/null | head -1); [ -n "$f" ] || continue + h=$(grep -m1 -oE 'executed on host\(s\) <[0-9]*\*?[a-z0-9-]+>' "$f" | sed 's/.*//;s/^[0-9]*\*//') + [ -n "$h" ] && echo "$h $st" +done | sort > $tmp +echo "| host | DONE | EXIT | verdict |" +echo "|---|---|---|---|" +bad=() +for h in $(cut -d' ' -f1 $tmp | sort -u); do + d=$(grep -c "^$h DONE$" $tmp); e=$(grep -c "^$h EXIT$" $tmp) + # BAD = never succeeded, OR succeeded so rarely that the host is clearly a renderer sink + # (stream D 17:25: e.g. p5-r08-n2 = 1 DONE / 11 EXIT). Threshold: >=3 EXIT and DONE*3 <= EXIT. + v=ok + if { [ "$e" -ge 1 ] && [ "$d" -eq 0 ]; } || { [ "$e" -ge 3 ] && [ "$((d*3))" -le "$e" ]; }; then v=BAD; bad+=("$h"); fi + [ "$e" -ge 1 ] && echo "| $h | $d | $e | $v |" +done +echo "bad hosts: ${#bad[@]}" +if [ "${1:-}" = --write ]; then + printf '%s\n' "${bad[@]}" > $out + echo "wrote $out" +fi +rm -f $tmp diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_latex.py b/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_latex.py new file mode 100644 index 0000000000000000000000000000000000000000..35e38dae12982f56142aea0ab0caf3f8a88c1b47 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_latex.py @@ -0,0 +1,3791 @@ +#!/usr/bin/env python3 +"""Emit the flagship (RISE-faithful reward) comparison as an ICLR-ready LaTeX table. + +Mirrors section 1 of docs/MASTER_TABLE.md exactly: the same arm-selection rule (best membership-head +arm per task, whatever its seed count), the same canonical evaluation region, the same two controls. + +Every method's entry carries its OWN training-seed count as a subscript. The seed counts are not +uniform across methods on this project -- BC may sit at three seeds on a task where the RSM arm sits at +one -- so a table printing a single seed count per row would misstate what each column rests on. + +A drift guard re-reads docs/MASTER_TABLE.md and refuses to emit if any RSM value disagrees with it, so +the copy pasted into Overleaf cannot quietly fall out of step with the table it came from. + +The numbers change as evaluation cells land, and a value gaining a digit can push the table back over +ICLR's 5.5in text block, so after regenerating run: + + scripts/check_iclr_fit.sh # compiles against the real iclr2027 style, fails on an overfull box + +usage: flagship_latex.py [-o docs/tex/flagship_table.tex] [--no-check] [--no-sync] +""" +from __future__ import annotations + +import argparse +import json +import os +import math +import re +import sys +from collections import defaultdict +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from verdict_table import cells, pool, rate, mcnemar, ztest, TASKS # noqa: E402 +from verdict_table import ifql_value_spread, IFQL_SPREAD_WARN_BINS, IFQL_RANK_WARN_PCT # noqa: E402 + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") + +# The corrected 20/100 split stands in for the released 100/100 file, exactly as in master_table.py. +FLAGSHIP_VARIANT = {"square_expert_suboptimal": ("square_sub_20100", "square-peg (Suboptimal)", "20 / 100")} +NAME = {"square_expert_suboptimal": "square-peg (Suboptimal)", "square_expert_play": "square-peg (Coverage)", + "two_piece_expert_suboptimal": "piece-assembly (Suboptimal)", "two_piece_expert_play": "piece-assembly (Coverage)", + "mug_expert_suboptimal": "mug-cleanup (Suboptimal)", "threading_expert_play": "threading (Coverage)", + "two_piece_expert_play_tipping": "piece-assembly tip (Coverage)"} +# ICLR's text block is 5.5in (396pt). Long task labels alone consumed ~110pt of it, so they are +# abbreviated here and expanded once in the caption. +NICE = {"square-peg (Suboptimal)": "Square (Sub.)", "square-peg (Coverage)": "Square (Cov.)", + "piece-assembly (Suboptimal)": "Piece (Sub.)", "piece-assembly (Coverage)": "Piece (Cov.)", + "mug-cleanup (Suboptimal)": "Mug (Sub.)", "threading (Coverage)": "Thread (Cov.)", + "piece-assembly tip (Coverage)": "Piece-tip (Cov.)"} +# THE PIN IS THE DEFAULT (2026-09-23, after the second unpinned bundle in one day). This used to be +# `os.environ.get("RSM_PROPOSER") or None`, i.e. unpinned unless the caller exported it -- and +# `scripts/tmp/regen_tables.sh:34` was the only caller that did. ANY direct `python +# scripts/flagship_latex.py` therefore overwrote docs/tex/flagship_table.tex with a bundle whose RSM +# column maximises over PROPOSERS as well as recipes (a larger search, in our favour), whose caption +# silently switched to the `proposer_dim` branch, and which carried \label{tab:flagship} TWICE. That +# happened at 07:34Z (DWM_MPC's diagnostic build) and AGAIN at 10:32Z. A shipped artefact must not +# depend on an env var being remembered: unset now means PINNED, and the deliberately unpinned +# diagnostic must ask for it explicitly with RSM_PROPOSER="" (or by setting the module attribute, which +# is what master_table.py:230 does for its own per-task-best sections). +RSM_PROPOSER = os.environ.get("RSM_PROPOSER", "RISE policy") or None # unset => pinned; "" => unpinned +# BEST PROPOSER PER TASK (owner decision, 2026-09-21). The flagship compares VALUE-ESTIMATION methods on +# the best proposer for each task, which may be a special case of the RISE recipe (e.g. spectral norm and +# augmentation off); RISE as a complete published method moves to a secondary table. That is legitimate +# because the novelty is the scorer -- PROVIDED every scorer on the row ranks candidates from the same +# proposer, which is what build() enforces. This map overrides RSM_PROPOSER per task; a task absent here +# uses RSM_PROPOSER unchanged, so with an empty map the table is byte-identical to before. Keys are task +# ids, values are POL labels from verdict_table (e.g. "RISE policy (no spectral norm)"). A task is added +# here ONLY on the planning screen's rule -- RSM on that actor beats RSM on the faithful actor AND beats +# random-of-128 on its own candidates, at matched epoch, then confirmed at 3x3 -- never on greedy rollout, +# which RISE's regularisers are designed to LOWER while improving proposals. Every override is a search +# and is disclosed in the caption by name. +# PINNED 2026-09-21 (owner: "Put our best potential numbers even if not verified across seeds ... if for the +# proposer the baseline methods aren't run yet just write pending or launched"). Values may carry "@" +# -- the proposer is (family, epoch): the IDQL recipe on threading is a 28 % proposer at epoch 500 and 13.8 % +# at 5000, so epoch is a proposer axis like family. Every scorer on a pinned row is read on THIS proposer; +# a scorer not yet evaluated there prints its launch status (_launch_status), never a number from another +# proposer. +# threading: RISE recipe with spectral norm off, epoch 500 -- RSM 34 % (17/50) vs random-of-128 2 % on the +# same candidates, faithful actor 0 % at that epoch and 13.8 % at 5000 (single seed so far). +# mug: BC-expert actor, epoch 5000 -- RSM 17.1 % at 3x3 vs greedy 14.2 / random 15.1; the faithful +# actor gives 12.5 and the IDQL recipe 10.5. +PROPOSER_BY_TASK = { + # 2026-09-21 late: the epoch sweep at three policy seeds puts the IDQL-recipe actor at epoch 500 first -- + # RSM 30.5 (random-of-128 6.5, greedy 6.0) vs 23.8 on S0Ansn@500 and 25.3 for plain BC; it decays to 13.8 + # by epoch 5000 while the faithful actor climbs 1.0 -> 13.8. Both promotion legs pass. + "threading_expert_play": "IDQL policy@500", + "mug_expert_suboptimal": "BC-expert", +} +# verdict_table admits epochs other than 5000 only when told; tell it exactly the pinned ones. +_extra_epochs = sorted({v.split("@", 1)[1] for v in PROPOSER_BY_TASK.values() if "@" in v}) +if _extra_epochs: + os.environ["RSM_EXTRA_EPOCHS"] = ",".join(_extra_epochs) + + +def proposer_for(task): + """The proposer this table uses for `task`; None means every proposer is admitted (the max-over- + proposers table, which the caption then labels as a search).""" + return PROPOSER_BY_TASK.get(task, RSM_PROPOSER) + + +def proposer_ok(task, p): + want = proposer_for(task) + return want is None or p == want +# EXTRA SCORERS on the SAME proposer (gen_q#268). Each ranks the identical 128 candidates the RISE +# actor emits, under the identical data-provenance reward; only the value estimator changes. The keys +# are verdict_table's arm prefixes (see verdict_table.scorer_head / WM_BACKENDS): +# rsm:tdflow the same successor field and beta band as RSM with the occupancy fitted by TD +# bootstrapping off an EMA twin instead of by Monte Carlo (train_rsm.py +# --occupancy-target td) -- the MC-vs-TD ablation, which is the one clause the method +# claims and the only column here that shares RSM's architecture exactly. +# wm:lewm LeWM (JEPA next-embedding prediction + SIGReg) with a reward probe on the same label, +# rolled L steps under the candidate chunk; L is matched to RSM's hops. +# wm:dinowm DINO-WM (frozen DINOv2 ViT-S/14 patch features + causal transformer latent dynamics) +# with the same probe read-out and the same roll-out protocol. +# A scorer with no cells yet prints "--" in every row: the column is declared, not quietly dropped, +# so an unfinished comparator never reads as one the authors chose not to run. +# critic:ifql IFQL (implicit flow Q-learning, the flow variant of IDQL): an HL-Gauss expectile Q over +# the same pooled-DINO state the RSM scorer sees and the first action of the candidate +# chunk, trained on the same provenance reward (gen_q#264). It is the second VALUE +# baseline of the single-actor row -- RISE's own critic is the first -- so it answers +# "would a better-trained critic have done what the successor model does". +# Baselines whose published configuration we could not make functional in this setting. Rendered +# `n/a`, NOT `--`: `--` already means "still training" in this table, and conflating the two would let a +# baseline we broke read as one we simply had not finished. +WITHDRAWN_BASELINES = {"IFQL"} + +NICE_COL = {"BC": "BC", "BCU": "BC-u", "RISEg": "RISE-g", "IDQL": "IDQL", "RISE": "RISE"} +# gen_q#282: DF joins the world-model family as a value estimator. It differs from DINO-WM and LeWM in +# exactly one thing -- it produces the horizon by MULTI-STEP full-sequence generation rather than by +# autoregressive rollout -- and is otherwise held to the same proposer, candidates, reward, horizon grid +# and controls. The column prints its launch state until its cells land, like every other one here. +EXTRA_SCORERS = [("rsm:tdflow", "TD-Flow"), ("critic:ifql", "IFQL"), + ("wm:lewm", "LeWM"), ("wm:dinowm", "DINO-WM"), ("wm:df", "DF")] +# HEALTH NUMBERS (gen_q#268, standing rule from the 2026-09-21 rms bug). Every self-implemented +# scorer publishes, beside its score, a number a reader can check independently -- the treatment +# IFQL and the RISE critic already get here. The rule exists because a baseline that breaks IN THE +# DIRECTION OF OUR OWN HYPOTHESIS is invisible to any check that only asks whether our method won: +# TD-Flow's occupancy target had drifted to 15x the dispersion the occupancy actually has, and the +# table would have read "MC occupancy beats TD occupancy", which is RSM's own contribution claim. +# scripts/scorer_health.py writes the record; it is free for the read-out diagnostics (every eval +# JSON's `plan` block already carries score_std / ties_at_max / frac_saturated per decision step). +SCORER_HEALTH = ROOT / "status" / "scorer_health.json" + + +def scorer_health(): + """The health record, or {} if it has not been produced yet. + + ONLY a missing file is allowed to read as "not produced yet". Anything else -- a malformed + record, or (as happened on the first attempt here) a NameError because `json` was not imported -- + must not be swallowed: a bare `except` turned that bug into a caption that said "no scorer column + has published a health number", which is a plausible-looking sentence for entirely the wrong + reason. That is the same silent-fallback failure this whole health mechanism exists to catch, so + it is not allowed in the mechanism itself.""" + if not SCORER_HEALTH.exists(): + return {} + return json.loads(SCORER_HEALTH.read_text()) + + +_HEALTH = scorer_health() +# PLAIN BASELINES TOGGLE (owner decision 2026-09-21: "train bcu with rise actor off and bc with rise actor +# off"). With RSM_PLAIN_BASELINES=1 the BC and BCU columns read the paper-recipe families S3H1plain / +# S0Bplain (all four RISE actor ingredients off) instead of S3H1 / S0B (the released code's flag-only +# variants, which keep spectral norm and the bottleneck, and for S0B the augmentation too). Default OFF, so +# the table is byte-identical until the plain families are fully seeded; flip it in regen_tables.sh then. +# Both master_table.py and flagship_markdown.py import BASE from here, so the switch is a single place. +PLAIN_BASELINES = os.environ.get("RSM_PLAIN_BASELINES") == "1" +_BC_LABEL = "BC-expert (paper recipe)" if PLAIN_BASELINES else "BC-expert" +_BCU_LABEL = "BC-unified (paper recipe)" if PLAIN_BASELINES else "BC-unified" +BASE = (("BC", lambda a, p: a[0] == "greedy" and p == _BC_LABEL), + ("BCU", lambda a, p: a[0] == "greedy" and p == _BCU_LABEL), + # RISE's actor sampled ONCE with no critic ranking. It is the strongest reward-trained + # baseline on piece-assembly (Cov.) and the no-selection control of every RSM arm that uses + # the RISE policy as proposer, so omitting it overstated Delta (2026-09-21 audit, C2). + ("RISEg", lambda a, p: a[0] == "greedy" and p == "RISE policy"), + ("IDQL", lambda a, p: a[0] == "critic" and p == "IDQL policy"), + ("RISE", lambda a, p: a[0] == "critic" and p == "RISE policy"), + # gen_q#264: IFQL AS PUBLISHED -- its own flow-matching actor proposes 128 candidates and its + # own critic picks one. A standalone method like IDQL/RISE, not a scorer swap, so it belongs + # here rather than in EXTRA_SCORERS (where its CRITIC appears, on the RISE actor's candidates). + # COLUMN (a) WITHDRAWN AS A QUANTITATIVE BASELINE (coordinator ruling, 2026-09-21). + # IFQL as published scored 0.3/0.2/9.0/2.3/0.0/0.0 across the six trained tasks, which is a + # non-functional row rather than a baseline -- and it fails for two reasons that are OUR + # adaptation choices, not properties of IFQL: a per-step flow BC actor against RISE's chunked + # diffusion proposer, and frozen DINO features in place of its native visual encoder. Reporting + # "we implemented IFQL and it got 0.2 %" would be a claim about our port. The scientifically + # load-bearing comparison is the CRITIC on a common actor, which is column (b) in + # Table~\ref{tab:matched_actor} and is sound. The published-configuration row is therefore + # declared and marked not-measured rather than printed as a number; see IFQL_COLA_WITHDRAWN. + ("IFQL", lambda a, p: False)) +WIN, BELOW, UNDEC = r"\wins", r"\belowctl", r"\undec" # rendered as single glyphs; see TEMPLATE + + +def flat(d): + o = defaultdict(list) + for (_p, ps, es), v in d.items(): + o[(ps, es)] += v + return o + + +def traj(task): + fv = next((v for v in FLAGSHIP_VARIANT.values() if v[0] == task), None) + if fv: + return fv[2].replace(" ", "") + import h5py + try: + with h5py.File(ROOT / "data" / "raw" / f"{task}.hdf5", "r") as h: + d = h["data"] + e = sum(1 for k in d if d[k]["rewards"][:].max() > 0) + return f"{e}/{len(d)-e}" + except Exception: + return "--" + + +def dataset_row(task): + """(expert demos, suboptimal demos, median expert demo length) for the companion table. + + A flagship VARIANT is a re-sliced subset with no hdf5 of its own, so its counts are declared in + FLAGSHIP_VARIANT while its demo lengths come from the parent file it was sliced from. + """ + import statistics + + import h5py + fv = next((v for v in FLAGSHIP_VARIANT.values() if v[0] == task), None) + src = task + counts = None + if fv: + counts = tuple(x.strip() for x in fv[2].split("/")) + src = next(k for k, v in FLAGSHIP_VARIANT.items() if v[0] == task) + try: + with h5py.File(ROOT / "data" / "raw" / f"{src}.hdf5", "r") as h: + d = h["data"] + exp = [k for k in d if d[k]["rewards"][:].max() > 0] + if counts is None: + counts = (str(len(exp)), str(len(d) - len(exp))) + med = int(statistics.median([d[k]["rewards"].shape[0] for k in exp])) if exp else None + return counts[0], counts[1], (str(med) if med else "--") + except Exception: + return (counts[0] if counts else "--"), (counts[1] if counts else "--"), "--" + + +def cell(val, nseed): + """A COMPLETE table cell: `$value_{(seeds)}$`, or a bare `--` when unmeasured. + + The dash is returned outside math mode on purpose. Emitting `$\text{--}$` pulled in amsmath just + to typeset two hyphens, and `$--$` would render as a spaced double minus. Keeping every cell + self-contained means the table needs `booktabs` and nothing else, so it survives being pasted into + a template whose preamble we do not control. + """ + return "--" if val is None else f"${val:.1f}_{{({nseed})}}$" + + +_TP = {} +_TPS = {} + + +def _nseed(g): + """The seed count a cell's subscript may honestly claim: min(#policy seeds, #eval seeds). + + WHY (gen_q#273 run 13, orchestrator ruling 2026-09-23 09:20Z). This used to be the number of + POLICY seeds alone, `len({ps for (_, ps, _) in g})`. An arm evaluated on 3 policy seeds x 1 eval + seed (3 cells) therefore printed the same `_(3)` subscript as a fully covered 3x3 arm (9 cells), + so the reader could not tell a third of a grid from a whole one. It bit mug/LeWM, whose MPC cells + landed policy-seed-first. min() is strictly more conservative than the old count -- it can only + DEMOTE a row's tier, never promote one -- so no arm gains standing from this change. + + The unit of replication is still the policy seed (see `seed_stats`); this function changes only + what is CLAIMED, not how the mean or the SE is computed. + """ + return min(len({ps for (_, ps, _) in g}), len({es for (_, _, es) in g})) if g else 0 + + +def seed_stats(vals, ns_fallback=None): + """(mean over seeds, standard error over seeds) for a list of per-seed values. + + The seed is the unit of replication -- RISE retrains actor and critic per seed -- so the error bar + is the spread across seeds, not a binomial interval over pooled episodes. Pooling 450 rollouts + from three policies and calling them independent would understate the spread substantially: on + piece-assembly (Sub.) the per-seed rates are 52.5 / 45.3 / 43.0, an across-seed SE of 2.9, while + the binomial interval on the pooled 650 episodes is about 2.0. + + A single seed has no measurable seed variance; the caller falls back to a binomial SE and flags it. + """ + k = len(vals) + if k == 0: + return None, None + m = sum(vals) / k + if k < 2: + return m, None + var = sum((v - m) ** 2 for v in vals) / (k - 1) + return m, math.sqrt(var / k) + + +def _seed_se(g, n_fallback=True): + """(mean, SE) ACROSS POLICY SEEDS for a cell dict {(policy, pseed, eseed): [0/1,...]}: each policy seed's + rate pools its evaluation seeds, then seed_stats over the policy seeds (the unit of replication). With one + policy seed the SE falls back to the binomial interval over the pooled episodes (the seed subscript (1) + already marks the cell).""" + per = {} + for (_p, ps, _es), v in g.items(): + a, b = per.get(ps, (0, 0)); per[ps] = (a + sum(v), b + len(v)) + vals = [100.0 * a / b for a, b in per.values() if b] + m, se = seed_stats(vals) + if m is not None and se is None and n_fallback: + n = sum(b for _, b in per.values()); pq = max(min(m / 100.0, 1.0), 0.0) + se = 100.0 * math.sqrt(max(pq * (1 - pq) / max(n, 1), 0.0)) + return m, se + + +def thr_by_seed(task, arm_key): + """[throughput per policy seed] for one (arm, proposer).""" + from throughput import collect_by_seed as _tcs, arm_throughput as _tarm + if task not in _TPS: + _TPS[task] = _tcs(task) + d, h = _TPS[task] + if arm_key not in d: + return [] + out = [] + for _ps, eps in sorted(d[arm_key].items()): + r = _tarm(eps, h[arm_key]) + if r: + out.append(r[2]) + return out + + +def thr(task, arm_key): + """Throughput of one (arm, proposer), or None. See scripts/throughput.py for the definition.""" + from throughput import collect as _tcol, arm_throughput as _tarm + if task not in _TP: + _TP[task] = _tcol(task) + d, h = _TP[task] + if arm_key not in d: + return None + r = _tarm(d[arm_key], h[arm_key]) + return None if not r else r[2] + + +def _family_stats(c, prop, readout="chain"): + """(n fully-seeded arms, median, min, max) over the RSM membership arms on proposer `prop`. + + READ-OUT SCOPED (2026-09-23). This pooled every membership arm regardless of read-out, so the + winner's-curse-free median the single-actor caption quotes -- "the median over every fully seeded + configuration of the same family" -- was a median over a MIXED family (coin chain and retired + deterministic fold together) sitting beside a chain-only maximum. A median is only an honest + robustness check for the maximum it accompanies when both range over the same set. + """ + import statistics + + def _in_family(recipe): + # SCOPED TO THE PAPER'S CHAIN (2026-09-24). `_readout_of` answers only "does this key carry + # the chain tag", not "is it THIS PAPER'S chain", so this median ranged over the off-gamma + # (evaluation-time gamma sweep) and cap-0 (beta >= gamma, no recursion) arms that + # `_recipe_is_chain` excludes from every printed column. The median is a winner's-curse check + # for the maximum beside it, and that is only true when both range over the SAME set -- the + # same argument the 2026-09-23 read-out scoping above makes for chain vs fold. + if readout is None: + return True + if readout == "chain": + return _recipe_is_chain(recipe) + return _readout_of(recipe) == readout + + srs = [] + for (a, p) in sorted({(a, p) for (a, p, _, _) in c if a[0] == "rsm:membership" and p == prop + and _in_family(a[1])}): + g = pool(c, lambda x, q, A=a, P=p: x == A and q == P) + if _nseed(g) >= 3: + srs.append(rate(g)[0]) + if not srs: + return (0, None, None, None) + return (len(srs), statistics.median(srs), min(srs), max(srs)) + + +# MEMBERSHIP-ONLY GUARD (owner, 2026-09-22 06:55 UTC: "we should be using membership and no more +# progress"). The flagship already never selects a progress arm -- every RSM pick goes through +# _best_arm("rsm:membership", ...) and there is not one `rsm:progress` reference in this file -- but +# "never happens to be selected" is exactly the kind of vacuous check this campaign has been burned by +# (five separate filters degraded to "matches nothing" in one day rather than failing). So the property +# is ASSERTED at the point of selection instead of being a consequence of how the call sites happen to be +# written: if a printed table ever selects an RSM arm whose family is not membership, the build dies with +# the offending key rather than printing a number sourced from the retired oracle progress head. +# The same assertion covers the chain re-score: a chain cell whose arm key is not membership is a bug. +# The allowed families are the ones whose REWARD is the membership label: the MC occupancy model +# (rsm:membership) and its TD twin (rsm:tdflow -- same field, same band, SAME membership reward head, +# only the occupancy target differs; verdict_table.py:239-246). Everything else under `rsm:` is a +# different reward -- rsm:progress (the retired oracle progress head), rsm:completion (a goal +# classifier) -- or a wider search (rsm:tdflowvar), and must not reach a printed table. +# WAS `"rsm:membership"` alone, which is what the guard needed while the chain filter left every +# `rsm:*` pick empty; the first selection that returned a TD-Flow arm (the fold picks for +# tab:flagship_fold) aborted the build. That would have hit the flagship's own TD-Flow column the +# moment its chain cells landed, so the guard is fixed rather than bypassed at the call site. +_ALLOWED_RSM_FAMILIES = ("rsm:membership", "rsm:tdflow") + + +# THE READ-OUT TOKEN MUST BE READ FROM ITS FIELD, NOT FOUND ANYWHERE IN THE RECIPE (2026-09-22). +# verdict_table builds the key as "{model}@{ck} b{beta} {LEN} N{n}{read-out}", where LEN is "L" +# for the retired fold and "CH" for the coin chain. Testing the whole string for \bL\d+\b also +# matches the MODEL TAG of the two rows whose checkpoint is called `L40` -- Square (Cov.) and Piece +# (Cov.) -- so every CHAIN arm on those rows passed the FOLD filter, and tab:flagship_fold printed +# Square (Cov.)'s chain number (20.9) in its RSM-fold column, mislabelled with the (beta, L) of the +# TD-Flow arm because the beta/L regex found no L field in the chain recipe and the table fell back. +# Anchoring on the field after "b" cannot collide with a model tag, whatever it is named. +# THE READ-OUT CLASSIFIER AND THE CHAIN GUARD NOW LIVE IN verdict_table.py (run 20), imported rather +# than defined here. They were defined in THIS file in run 19, which covered tab:flagship and -- by +# `master_table.py:331` importing this module -- docs/MASTER_TABLE.md, but NOT docs/VERDICT.md, which +# selects its own "coin chain" rows with verdict_table's local `_readout_of` and so had no gamma test +# and no cap-0 test at all. The import graph only runs one way (this file imports verdict_table at +# line 33), so the definition had to move DOWN for all three documents to share it. The rule itself, +# its evidence and the reason an excluded arm is not relabelled as a fold arm are documented at the +# definition. Names are re-bound here unchanged so every call site in this file is untouched. +from verdict_table import (_LEN_FIELD, _readout_of, _DEGENERATE_CHAIN, # noqa: E402 + _degen_seen, _offgamma_seen, + _recipe_is_degenerate_chain, _BETA_CAP, FLAGSHIP_GAMMA, + _cap_at, _chain_gamma_mismatch, _recipe_is_chain) + + +def _chain_status(task, ncells, need=9): + """What tab:flagship's RSM / TD-Flow column prints while the chain re-score is in flight. A fold + number must never silently stand in for a chain number (owner, 2026-09-22 06:30), so an incomplete + row prints its launch state instead: `pend k/9` once some chain cells have landed, `launched` while + its chain eval jobs are in the queue, `queued` otherwise.""" + bs = chr(92) + if ncells and ncells < need: + return bs + "textit{pend " + f"{ncells}/{need}" + "}" + if any(j.startswith(f"rr_e1_{task}_") and "-ch-N128" in j for j in _live_jobs()): + return bs + "textit{launched}" + return bs + "textit{queued}" + + +def _partial_grid_mark(disp, ncells, need=9): + r"""Mark a printed number whose arm has not landed on the full 3x3 grid (gen_q#267, 2026-09-23). + + The subscript in this table is the POLICY-seed count, so a 7-of-9-cell arm and a complete one both + print `(3)` and look identical; the reader cannot see that one is 350 episodes on an unbalanced + grid. `_seed_tier_key` now prefers a complete arm to any partial one, so this mark can only appear + on a row where NO arm has finished -- which is exactly the row where it must not be silent. + `\dagger` already means "single seed" in this table, so partial coverage gets its own mark.""" + if not disp or ncells >= need or not disp.endswith("$"): + return disp + return disp[:-1] + chr(92) + "circ$" + + +def _assert_arm_ok(arm, pref, proposer): + """`arm` is (family, recipe). Non-RSM scorers (world models, value critics, controls) have no + membership/progress distinction and pass through untouched.""" + fam = arm[0] + if not fam.startswith("rsm:"): + return + if _recipe_is_degenerate_chain(arm[1]): + raise SystemExit( + f"DEGENERATE CHAIN ARM IN A PRINTED TABLE: _best_arm({pref!r}) on proposer {proposer!r} " + f"selected {arm[1]!r}, whose cap field is 0. A cap of 0 means beta >= gamma, so the " + f"continuation probability p = (gamma-beta)/(gamma(1-beta)) is 0, the coin never fires, and " + f"the 'chain' is a single successor draw with no recursion -- the exact degeneracy gen_q#267 " + f"exists to remove. It must not be printed as a coin-chain number. Fix the selection, do " + f"not relax this check.") + _gm = _chain_gamma_mismatch(arm[1]) + if _gm is not None: + _b, _cap, _want = _gm + raise SystemExit( + f"OFF-GAMMA CHAIN ARM IN A PRINTED TABLE: _best_arm({pref!r}) on proposer {proposer!r} " + f"selected {arm[1]!r}, whose cap {_cap} is not the 1e-3 truncation cap {_want} that " + f"beta={_b} implies at the flagship's gamma={FLAGSHIP_GAMMA}. The arm key does not carry " + f"gamma, so an evaluation-time gamma sweep can enter this maximum invisibly, while " + f"tab:discounts states gamma is held fixed across the value estimators. Decide explicitly " + f"whether a gamma-swept arm may headline (and say so in the caption) rather than letting a " + f"second horizon print under the first one's claim. Fix the selection, do not relax this " + f"check.") + if fam not in _ALLOWED_RSM_FAMILIES: + raise SystemExit( + f"NON-MEMBERSHIP ARM IN A PRINTED TABLE: _best_arm({pref!r}) on proposer {proposer!r} selected " + f"family {fam!r} (recipe {arm[1]!r}); allowed: {_ALLOWED_RSM_FAMILIES}. Every value estimator " + f"in this paper is scored with RISE's binary data-provenance MEMBERSHIP label; the oracle " + f"progress head is retired and must not reach a table. Fix the selection, do not relax this " + f"check.") + + +def build(cells): + """`cells` is injected so the LaTeX can be built from the SAME snapshot as the markdown.""" + rows, counts = [], defaultdict(int) + for task, _ in TASKS: + fv = FLAGSHIP_VARIANT.get(task) + src, disp = (fv[0], fv[1]) if fv else (task, NAME[task]) + c = cells(src) + + bvals, bseeds, bn, bper = {}, {}, {}, {} + # PLAIN BC PER TASK (owner ruling 2026-09-21: BC = the RISE actor ingredients OFF). The plain + # recipe's 3x3 has landed on some tasks and is still training on others, so the BC column reads the + # plain family wherever it has cells and falls back to the codebase family elsewhere; which one + # each row used is recorded in bc_recipe and disclosed in the caption. Never pooled: the two are + # different policies. RSM_PLAIN_BC=0 restores the single-label behaviour. + bc_recipe = "codebase" + for lab, pred in BASE: + g = pool(c, pred) + if lab == "BC" and not PLAIN_BASELINES and os.environ.get("RSM_PLAIN_BC", "1") == "1": + gp = pool(c, lambda a, p_: a[0] == "greedy" and p_ == "BC-expert (paper recipe)") + if gp: + g, bc_recipe = gp, "plain" + r_ = rate(g) if g else (None, 0) + bvals[lab], bn[lab] = r_[0], r_[1] + bseeds[lab] = _nseed(g) + per = {} + for (_p, ps, _es), v in g.items(): + a_, b_ = per.get(ps, (0, 0)) + per[ps] = (a_ + sum(v), b_ + len(v)) + bper[lab] = [100.0 * x / y for _s, (x, y) in sorted(per.items()) if y] + + best = prov = None + # SINGLE-ACTOR RULE (owner 2026-09-21): "the flagship must use a single actor for RSM ... we must make + # sure the reason RSM is winning is not because it is allowed to argmax actors over tasks depending + # on who is winning." RSM_PROPOSER pins the proposer for every task (RISE policy = the same actor + # RISE's own critic ranks); None keeps the per-task best-proposer behaviour, which is then a search + # the caption must disclose. + for (arm, p) in sorted({(arm, p) for (arm, p, _, _) in c if arm[0] == "rsm:membership" + and proposer_ok(task, p)}): + g = pool(c, lambda x, q, A=arm, P=p: x == A and q == P) + sr, _n = rate(g) + ns = _nseed(g) + rec = (sr, _n, arm, p, g, ns) + if ns >= 2: + if best is None or _seed_tier_key(sr, _n, ns, len(g)) > _seed_tier_key( + best[0], best[1], best[5], len(best[4])): + best = rec + elif prov is None or (sr, _n) > (prov[0], prov[1]): + prov = rec + rsm_per = None + arm = p = None; del arm, p # the loop variable above is NOT the selected arm; referencing it after + # the loop silently read the last-iterated arm, which is how the throughput + # column came to report a different arm's number (and "--" where that arm + # had none). Deleting it turns that mistake into a NameError. + cands = [x for x in (best, prov) if x] + if not cands: + continue + # Same routing rule as master_table.py: a VERIFIED (>=2-seed) arm that beats every baseline is + # never displaced by a single-seed maximum; the single-seed arm takes the row only when no + # verified arm wins. (The two generators must agree or the drift guard below fires.) + _blmax = max([v for v in bvals.values() if v is not None], default=float("-inf")) + if best and best[0] > _blmax: + sr, n, sel_arm, prop, g, ns = best + else: + sr, n, sel_arm, prop, g, ns = max(cands, key=lambda x: _seed_tier_key(x[0], x[1], x[5], len(x[4]))) + _pr = {} + for (_p, ps, _es), v in g.items(): + a_, b_ = _pr.get(ps, (0, 0)) + _pr[ps] = (a_ + sum(v), b_ + len(v)) + rsm_per = [100.0 * x / y for _s, (x, y) in sorted(_pr.items()) if y] + + gg = flat(pool(c, lambda x, q, P=prop: x[0] == "greedy" and q == P)) + gp = flat(pool(c, lambda x, q, P=prop: x == ("permuted", "membership") and q == P)) + mg, mp = mcnemar(flat(g), gg), mcnemar(flat(g), gp) + + def d(m): + if not m: + return "--" + v = m["a"] - m["b"] + return (r"$\mathbf{%+.1f}$" % v) if m["p"] < .05 else ("$%+.1f$" % v) + + if mg and mg["a"] < mg["b"]: + verdict = BELOW + elif mg and mp and mg["p"] < .05 and mp["p"] < .05 and mg["a"] > mg["b"] and mp["a"] > mp["b"]: + verdict = WIN + else: + verdict = UNDEC + counts[verdict] += 1 + + bb = max([v for v in bvals.values() if v is not None], default=None) + blab = next((k for k, _ in BASE if bvals[k] is not None and bvals[k] == bb), None) + + # BOLD = BEST NUMBER IN THE ROW, the usual convention. It previously meant two different + # things in one table -- "best baseline" in the baseline columns and "significant" in the + # delta columns -- which is exactly the kind of overloading a reader has to be told about. + # Significance now rides on a superscript star instead, so bold carries one meaning only. + allv = {k: bvals[k] for k, _ in BASE} + allv["RSM"] = sr + rowmax = max(v for v in allv.values() if v is not None) + + def _fmt2(per, pooled, n_, seeds, is_max, dec=1): + r"""`mean{\pm}se` with the seed count as a subscript; bold when it is the row's best.""" + if pooled is None: + return "--" + m, se = seed_stats(per) + if m is None: + m = pooled + if se is None: # one seed: no seed variance is measurable + pq = max(min(m / 100.0, 1.0), 0.0) + se = 100.0 * math.sqrt(max(pq * (1 - pq) / max(n_, 1), 0.0)) + mark = r"^{\dagger}" + else: + mark = "" + body = f"{m:.{dec}f}" + r"{\pm}" + f"{se:.{dec}f}{mark}" + f"_{{({seeds})}}" + return (r"$\mathbf{%s}$" % body) if is_max else f"${body}$" + + bcells = [(r"$\mathrm{n/a}$" if k in WITHDRAWN_BASELINES + else _fmt2(bper[k], bvals[k], bn[k], bseeds[k], bvals[k] == rowmax)) + for k, _ in BASE] + rsm = _fmt2(rsm_per, sr, n, ns, sr == rowmax) + # THE FLAGSHIP RSM COLUMN IS CHAIN-ONLY (gen_q#267, owner 2026-09-22 06:30). Identical selection + # rule, identical proposer filter, restricted to arms whose recipe carries the chain read-out + # token. `rsm` above (the fold maximum) stays behind for tab:flagship_single_actor, + # tab:flagship_all and tab:flagship_fold; it may NOT be substituted here, which is why this is a + # separate field rather than a fallback. + _cb = _cp = None + for (_arm, _p) in sorted({(a, q) for (a, q, _, _) in c if a[0] == "rsm:membership" + and proposer_ok(task, q) and _recipe_is_chain(a[1])}): + _g = pool(c, lambda x, q, A=_arm, P=_p: x == A and q == P) + _sr, _n = rate(_g) + _ns = _nseed(_g) + _rec = (_sr, _n, _arm, _p, _g, _ns) + if _ns >= 2: + if _cb is None or _seed_tier_key(_sr, _n, _ns, len(_g)) > _seed_tier_key( + _cb[0], _cb[1], _cb[5], len(_cb[4])): + _cb = _rec + elif _cp is None or (_sr, _n) > (_cp[0], _cp[1]): + _cp = _rec + # AND THE RETIRED COLUMN MUST BE FOLD-ONLY, for the same reason in reverse (2026-09-23). + # `rsm` above is the maximum over BOTH read-outs, so a column headed "RSM-fold (retired)" that + # printed it showed a CHAIN number wherever the chain arm is the row maximum -- it did exactly + # that on Square (Cov.), where the retired column read 20.9 (the chain arm) while the fold's own + # best arm is 17.6. Same defect as the one the chain field fixed, with the labels swapped. + _fb = _fp = None + for (_arm, _p) in sorted({(a, q) for (a, q, _, _) in c if a[0] == "rsm:membership" + and proposer_ok(task, q) and _readout_of(a[1]) == "fold"}): + _g = pool(c, lambda x, q, A=_arm, P=_p: x == A and q == P) + _sr, _n = rate(_g) + _ns = _nseed(_g) + _rec = (_sr, _n, _arm, _p, _g, _ns) + if _ns >= 2: + if _fb is None or _seed_tier_key(_sr, _n, _ns, len(_g)) > _seed_tier_key( + _fb[0], _fb[1], _fb[5], len(_fb[4])): + _fb = _rec + elif _fp is None or (_sr, _n) > (_fp[0], _fp[1]): + _fp = _rec + rsm_fold_disp = "--" + rsm_fold_rate = None + _fsel = _fb or _fp + if _fsel is not None: + _sr, _n, _arm, _prop_f, _g, _ns = _fsel + _assert_arm_ok(_arm, "rsm:membership (fold)", _prop_f) + _per = {} + for (_pp, ps, _es), v in _g.items(): + a_, b_ = _per.get(ps, (0, 0)) + _per[ps] = (a_ + sum(v), b_ + len(v)) + _fold_per = [100.0 * x / y for _s, (x, y) in sorted(_per.items()) if y] + rsm_fold_rate = _sr + # never bolded: the retired column is context, never a winner (master_table strips bold too) + rsm_fold_disp = _fmt2(_fold_per, _sr, _n, _ns, False) + + rsm_chain = rsm_chain_arm = None + rsm_chain_cells = rsm_chain_seeds = 0 + rsm_chain_rate = rsm_chain_n = rsm_chain_per = None + # The SELECTED chain arm and its proposer, kept so downstream blocks (throughput) describe the + # arm this table actually prints rather than the mixed-read-out maximum `sel_arm`. + rsm_chain_key = rsm_chain_prop = None + _cc = [x for x in (_cb, _cp) if x] + if _cc: + _sr, _n, _arm, _prop, _g, _ns = max(_cc, key=lambda x: _seed_tier_key(x[0], x[1], x[5], len(x[4]))) + rsm_chain_key, rsm_chain_prop = _arm, _prop + _assert_arm_ok(_arm, "rsm:membership (chain)", _prop) + _per = {} + for (_pp, _ps, _es), _v in _g.items(): + _a2, _b2 = _per.get(_ps, (0, 0)) + _per[_ps] = (_a2 + sum(_v), _b2 + len(_v)) + rsm_chain_cells, rsm_chain_seeds, rsm_chain_arm = len(_g), _ns, _arm[1] + if _ns >= 2: # a single-seed chain arm is a launch state, not a flagship number + rsm_chain_per = [100.0 * x / y for _s, (x, y) in sorted(_per.items()) if y] + rsm_chain_rate, rsm_chain_n = _sr, _n + rsm_chain = _partial_grid_mark(_fmt2(rsm_chain_per, _sr, _n, _ns, False), + rsm_chain_cells) + + # ---- THE CHAIN CELL AS A HEADLINE NUMBER (gen_q#267; fixes the three-way disagreement the + # orchestrator reported on threading, 2026-09-23). `rsm` above is the maximum over BOTH + # read-outs, so on threading it is the RETIRED FOLD arm (33.0 pooled, 33.4 as the seed mean the + # markdown renders). docs/MASTER_TABLE.md section 0 printed that number in a column headed + # "RSM (ours, RISE actor)" and, in the very next table of the same section, printed 21.6 -- the + # chain arm, because "Same-actor margins" comes from matched() -> _best_arm(readout="chain"). + # Two read-outs under one column name with nothing telling the reader which is which is exactly + # the substitution the owner ruled out (2026-09-22 06:30: "never a fold number silently standing + # in for a chain number"). These fields give section 0 the same chain-only column tab:flagship + # already prints, with its OWN margin and its OWN bolding -- the fold maximum may not lend either, + # since on threading the fold arm is the row max (33.0 > BC 26.3) and the chain arm is not + # (22.8 < 26.3), so re-using `db`/`rowmax` would have bolded and starred a number that no longer + # earns it. The fold maximum keeps an explicitly-named column of its own and tab:flagship_fold. + rsm_chain_disp = (rsm_chain if rsm_chain is not None + else _chain_status(src, rsm_chain_cells)) + if rsm_chain_rate is None: + rowmax_chain, db_chain = None, "--" + # NOT `list(bcells)` (2026-09-23). `bcells` is bolded against `rowmax`, which includes the + # RETIRED FOLD maximum, so on a row whose chain cells have not landed the best baseline + # could print unbolded because a number that is no longer in the table beat it. With no + # chain number to compare against, the baselines are bolded among themselves. + _bmax = max([v for v in bvals.values() if v is not None], default=None) + base_chain = [(r"$\mathrm{n/a}$" if k in WITHDRAWN_BASELINES + else _fmt2(bper[k], bvals[k], bn[k], bseeds[k], bvals[k] == _bmax)) + for k, _ in BASE] + else: + _bok = [v for v in bvals.values() if v is not None] + rowmax_chain = max(_bok + [rsm_chain_rate]) + base_chain = [(r"$\mathrm{n/a}$" if k in WITHDRAWN_BASELINES + else _fmt2(bper[k], bvals[k], bn[k], bseeds[k], bvals[k] == rowmax_chain)) + for k, _ in BASE] + rsm_chain_disp = _partial_grid_mark( + _fmt2(rsm_chain_per, rsm_chain_rate, rsm_chain_n, rsm_chain_seeds, + rsm_chain_rate == rowmax_chain), rsm_chain_cells) + if bb is None: + db_chain = "--" + else: + _pzc = ztest(rsm_chain_rate, rsm_chain_n, bb, bn[blab]) + db_chain = (("$%+.1f^{*}$" if _pzc < .05 else "$%+.1f$") % (rsm_chain_rate - bb)) + + # THROUGHPUT for the same four baselines and the same RSM arm. BC/BC-u are the greedy arms; + # IDQL/RISE are the critic arms (rsm_backend=iql), which is why throughput.py had to learn + # about them. A method with no accepted episodes gets "--" here exactly as above. + tkeys = {"BC": ("greedy", "BC-expert"), "BCU": ("greedy", "BC-unified"), "RISEg": ("greedy", "RISE policy"), + "IDQL": ("critic N=128", "IDQL policy"), "RISE": ("critic N=128", "RISE policy"), + # gen_q#264: IFQL as published -- its own flow actor is the proposer, so the proposer + # half of the key is "IFQL policy" (the same critic under the RISE actor is a column of + # the single-actor table, not a baseline here). + "IFQL": ("critic:ifql N=128", "IFQL policy")} + tvals = {k: thr(src, tkeys[k]) for k, _ in BASE} + # THE THROUGHPUT ROW DESCRIBES THE ARM THE TABLE PRINTS (2026-09-23). This read `sel_arm`, the + # maximum over BOTH read-outs, while the success-rate column beside it is chain-only -- so on any + # row where the fold arm is the maximum the two rows of the same table described different + # estimators, and the chain's cost claim (it terminates, so it is cheaper than the depth-8 fold) + # would have been argued from the fold's own seconds/episode. Same defect class as the RSM + # column itself; no fallback to the fold, a row with no chain arm prints "--". + _thr_key = (rsm_chain_key[1], rsm_chain_prop) if rsm_chain_key is not None else None + tvals["RSM"] = thr(src, _thr_key) if _thr_key else None + trmax = max([v for v in tvals.values() if v is not None], default=None) + + tper = {k: thr_by_seed(src, tkeys[k]) for k, _ in BASE} + tper["RSM"] = thr_by_seed(src, _thr_key) if _thr_key else [] + + def _tf(k): + v = tvals[k] + if v is None: + return "--" + m, se = seed_stats(tper.get(k) or []) + if m is None: + m = v + body = ((f"{m:.3f}" + r"{\pm}" + f"{se:.3f}") if se is not None + else (f"{m:.3f}" + r"^{\dagger}")) + return (r"$\mathbf{%s}$" % body) if (trmax is not None and v == trmax) else f"${body}$" + + tcells = [(r"$\mathrm{n/a}$" if k in WITHDRAWN_BASELINES else _tf(k)) for k, _ in BASE] + trsm = _tf("RSM") + tbb = max([tvals[k] for k, _ in BASE if tvals[k] is not None], default=None) + tdb = "--" if (tbb is None or tvals["RSM"] is None) else ("$%+.3f$" % (tvals["RSM"] - tbb)) + + # HEADLINE DELTA: RSM minus the STRONGEST baseline on that task. Not a paired comparison -- + # the baseline is a different policy on its own episodes -- so significance is a + # two-proportion z-test, marked with a star rather than with bold. + if bb is None: + db = "--" + else: + pz = ztest(sr, n, bb, bn[blab]) + db = ("$%+.1f^{*}$" % (sr - bb)) if pz < .05 else ("$%+.1f$" % (sr - bb)) + + # MATCHED PROPOSER (BC-union): identical candidates, only the scorer differs. This is the + # ablation that isolates the scorer -- "RISE is IDQL with a different policy", so holding the + # proposal policy fixed is what makes the comparison fair. Reported against GREEDY as well as + # against the IQL critic, because the critic turns out to be a weak ranker here (it scores + # BELOW greedy on several tasks, including on its own proposer), so a margin over it alone + # would overstate what the scorer buys. + # PAIRED CELLS (2026-09-21 audit, D1). "Same candidates" is only true when the three + # columns are read on the SAME (policy seed, eval seed) cells: previously each column pooled + # whatever cells it had, so greedy at nine cells sat beside an RSM arm at one, and the RSM + # column was an unpaired max over every BC-union arm at any seed count. Now: the RSM arm is + # chosen by the flagship rule (a >=2-seed arm that beats greedy is preferred to a 1-seed + # maximum), and all three columns are recomputed on the intersection of their cell sets. + # Run for TWO proposers: BC-union (the label-free proposer) and the RISE actor (RISE's own + # proposer -- "their policy, their reward, only the scorer swapped", the fairest vs-RISE read). + # READ-OUT SPLIT (gen_q#267, owner 2026-09-22 06:30 UTC). verdict_table writes the RSM read-out + # into the recipe as a length token: " L " for the deterministic truncated fold and + # " CH " for the coin-terminated beta chain (" CHRB " for the analytic test path, which + # is never a published arm). The flagship's RSM column reads CHAIN cells ONLY; the fold numbers + # move to tab:flagship_fold. A fold number must never silently stand in for a chain number, so + # this is a filter on the KEY, not a preference order -- when no chain arm exists the column falls + # through to the launch status the loader already produces, exactly as the DINO-WM column does. + def _wm_arm_is(readout, arm): + """gen_q#273 part 1e -- which read-out a WORLD-MODEL arm key encodes. + + verdict_table.py builds it as "H N" for an MPC cell and + "L N" for a fold cell. Until that key carried the mode (fixed 2026-09-23) every + MPC cell landed in the depth-1 FOLD arm -- 94 of 96 on mug -- because an MPC cell records + `plan_depth: 1` and derives K from the discount inside the scorer. This test is therefore + only sound against a verdict_table that separates the two; the guard below is what says so.""" + rec = arm[1] + if rec[:1] not in ("H", "L"): + raise SystemExit( + f"tab:flagship: world-model arm recipe {rec!r} starts with neither 'H' (MPC) nor " + f"'L' (fold). verdict_table's WM arm-key convention has changed; fix this test " + f"rather than letting a fold number stand in for an MPC one.") + return (rec[0] == "L") if readout == "fold" else (rec[0] == "H") + + def _arm_is(readout, arm): + """Exact read-out match on the recipe's LENGTH FIELD -- see _readout_of. A substring test + here admitted every chain arm into the fold selection on the `L40` rows (gen_q#267). + + A chain arm additionally has to be at the flagship's gamma (see _chain_gamma_mismatch): the + arm key carries beta and the cap but not gamma, so the evaluation-only gamma sweep would + otherwise enter this selection with nothing in the key to say so. Excluded HERE, in the + filter, so a gamma-swept arm on a proposer this table does not print cannot abort the whole + build; _assert_arm_ok still raises if one reaches a printed cell, which is what proves the + filter did not degrade.""" + if _readout_of(arm[1]) != readout: + return False + # ONE CLASSIFIER, ONE MESSAGE (run 21). This site used to apply _chain_gamma_mismatch + # directly and had no degeneracy test, so a cap-0 arm was reported here as "off-gamma (cap 0 + # != the 1e-3 cap 73)" and by the shared predicate as "degenerate (the continuation coin never + # fires)" -- the same arm, the same exclusion, two explanations in one build log. Defer to + # _recipe_is_chain, which tests degeneracy first and emits exactly one of the two messages. + if readout == "chain" and not _recipe_is_chain(arm[1]): + return False + return True + + def _best_arm(pref, P, readout="chain"): + """The arm of scorer family `pref` this table reports on proposer P, and its cells. + + The selection rule is the one the RSM column has always used, applied unchanged to every + scorer so no comparator is picked by a different rule than the method: N=128 only (the + caption claims it), a >=2-seed arm preferred to a single-seed maximum, ties broken by + episode count. Returns (rate, n_episodes, n_policy_seeds, arm, cells) or None.""" + _mc = [] + for (a_, p_) in sorted({(a_, p_) for (a_, p_, _, _) in c + if a_[0] == pref and p_ == P + and _n128(a_[1])}): + # CAREFUL, this predicate now means TWO things (noted 2026-09-21, gen_q#268). + # verdict_table appends " P " to the arm recipe for any + # NON-canonical read-out (canonical = particles 256, logit), so `endswith(" N128")` + # selects "N=128 AND the canonical read-out" rather than just "N=128". That is the + # right pooling rule -- particles 256->16 and logit->prob moved one threading recipe + # 9.3% -> 2.2%, so those are different scorers -- but it also means a task with only + # P16/prob cells on this proposer drops out of the table entirely, which the caption + # now says explicitly instead of implying nothing was run. If the suffix convention + # changes, this predicate silently changes meaning: match \bN128\b and test the + # read-out separately if that happens. + # the read-out filter is a legitimate subsetting and MAY be empty (a row whose chain + # cells have not landed yet), so unlike the N=128 predicate below it does not raise. + if pref.startswith("rsm:") and not _arm_is(readout, a_): + continue + # WORLD-MODEL READ-OUT SPLIT (gen_q#273 part 1e, owner 2026-09-23). The `R-` + # cells are not a world model's planner -- they are OUR beta-recursion fold wrapped around + # a latent dynamics model -- so tab:flagship's world-model columns read MPC cells only and + # the fold cells retire into tab:ablation_betarec beside RSM's. verdict_table keys an MPC + # cell "H N" and a fold cell "L N". Same shape as the RSM + # filter above: a legitimate subsetting that MAY be empty, in which case the column falls + # through to the launch status the loader already produces. + if pref.startswith("wm:") and not _wm_arm_is(readout, a_): + continue + g_ = pool(c, lambda x, q_, A=a_, PP=p_: x == A and q_ == PP) + r_ = rate(g_) + _mc.append((r_[0], r_[1], _nseed(g_), a_, g_)) + # SEED TIER BEFORE RATE (2026-09-21). This used to be `[x for x in _mc if x[2] >= 2]`, i.e. + # any arm with two or more policy seeds, maximised by rate. A 2-seed arm could therefore beat + # a fully-seeded one and be reported -- the same winner's curse the >=2 threshold was added to + # stop, one notch up. It bit on threading: un-pooling the flow-hop cells shrank the 3-seed + # arm, the maximum moved to a 2-seed arm, and the row jumped from 13.6+-2.6 (3 seeds, delta + # +0.4) to 16.7+-3.3 (2 seeds, delta +3.5) with no new evidence at all. The caption claims + # "3 policy x 3 eval seeds", so a fully-seeded arm must be preferred to ANY under-seeded one + # however high it scores; the tier caps at 3 so a hypothetical 4-seed arm does not outrank a + # better 3-seed one. Rate, then episode count, break ties inside a tier. + # VACUOUS-FILTER GUARD (2026-09-21). If arms of this family exist on this proposer but the + # N=128 predicate admits NONE of them, that is a specification bug, not an absence of data -- + # and it is exactly what happened: `endswith(" N128")` matched 0 of 13-37 arms per task after + # the arm key gained its read-out suffix, so this function silently returned None everywhere + # and the columns it feeds were built from nothing. Five separate checks degraded to + # "matches nothing" today rather than failing, so a filter that empties a non-empty set now + # raises instead of returning None. + # The vacuous-filter guard is about the N=128 predicate only. An empty result because this + # row has no CHAIN cells yet is the expected state during the re-score, not a specification + # bug, so the guard is evaluated on the arms that PASS the read-out filter. + _any = {a_ for (a_, p_, _, _) in c if a_[0] == pref and p_ == P + and (not pref.startswith("rsm:") or _arm_is(readout, a_)) + and (not pref.startswith("wm:") or _wm_arm_is(readout, a_))} + if _any and not _mc: + raise SystemExit( + f"VACUOUS FILTER in _best_arm({pref!r}): {len(_any)} arms exist on proposer {P!r} but " + f"the N=128 predicate admits none of them. Example recipe: " + f"{sorted(_any)[0][1]!r}. The arm-key suffix convention has changed again; fix _n128 " + f"rather than letting the column be built from an empty set.") + if not _mc: + return None + _sel = max(_mc, key=lambda x: _seed_tier_key(x[0], x[1], x[2], len(x[4]))) + _assert_arm_ok(_sel[3], pref, P) + return _sel + + def _health_of(pick, P): + """The health record of the arm THIS TABLE REPORTS, not of its family. + + A family-level number can describe cells the printed score does not come from, which is + the "checkable-looking but unchecked" failure the standing rule exists to stop; the + family roll-up is only the fallback when the exact arm has no record yet. + Keys are written by scripts/scorer_health.py as "||".""" + if pick is None: + return None + arm = pick[3] + h = _HEALTH.get(src) or {} + return h.get(f"{arm[0]}|{P}|{arm[1]}") or h.get(f"{arm[0]}|{P}") + + def matched(P): + _mg = pool(c, lambda a, p_: a[0] == "greedy" and p_ == P) + _mq = pool(c, lambda a, p_: a[0] == "critic" and p_ == P) + # RANDOM-OF-N CONTROL. Draws the same N=128 candidates and executes a uniformly chosen + # one, so it separates SAMPLING BREADTH from RANKING -- and on some rows breadth is most + # of the margin. On mug the RISE actor's random-of-128 scores 6.2 against greedy's 4.7 + # and the RISE critic's 5.8: the critic is indistinguishable from random there and only + # one of twelve RSM arms clears the control (12.2, p=0.0016, Bonferroni 0.019). Threading + # is the opposite (random 1.1, greedy 1.2, every RSM arm 7.3-13.1). A table showing only + # greedy / RISE / RSM therefore overstates what selection buys on the first row and + # understates the contrast with the second, which is why this column is in the table and + # not in an appendix. `random` is the rule that never builds the scorer at all; its + # `permuted` twin (identical scores, shuffled over candidates) is the same measurement and + # is what verdict_table.py's paired McNemar test uses. + _mrand = pool(c, lambda a, p_: a == ("random", "membership") and p_ == P) + _mgr0 = rate(_mg)[0] if _mg else None + _pick = _best_arm("rsm:membership", P) + _xpick = {k: _best_arm(k, P) for k, _ in EXTRA_SCORERS} + # RETIRED FOLD ARMS (gen_q#267, owner 2026-09-22 06:30). The deterministic truncated fold + # that tab:flagship used to print, selected by the SAME rule on the SAME proposer with the + # SAME N=128 predicate -- only the read-out token differs, so tab:flagship_fold is row-for-row + # comparable with the chain table. These are carried ONLY for that retired table; nothing + # downstream may substitute one for a missing chain number. + _fold = {} + # WORLD MODELS TOO (owner, 2026-09-23 04:15: the ablation table "holds the beta-recursion + # numbers for EVERY method that was scored that way -- RSM, TD-Flow, DINO-WM and LeWM"). + # _best_arm now applies a read-out filter to `wm:` families as well (part 1e), so this + # returns the max-over-L FOLD arm -- the one the flagship used to print, and which run 5 + # measured to BE a fold + # (status/chain/wm_arm_dump.json: DINO-WM selects L = 4, 8, 8, 2, 4; LeWM L = 1, 2, 1, 8, + # 4, 2). That is the point of listing them here: the fold is not their planner either. + for _fk in ("rsm:membership", "rsm:tdflow", "wm:dinowm", "wm:lewm"): + _fp = _best_arm(_fk, P, readout="fold") + _fold[_fk] = None if _fp is None else (_fp[0], _fp[2], _fp[3][1], len(_fp[4])) + _mgr = _mqr = _mrr = None; _mns = 0; _mcells = 0; _mqse = None; _xse = {} + if _pick is not None and _mg: + _ck = lambda d: {(ps, es) for (_p, ps, es) in d} + common = _ck(_pick[4]) & _ck(_mg) + if _mq: + common &= _ck(_mq) + _on = lambda d: {k: v for k, v in d.items() if (k[1], k[2]) in common} + if common: + _mrr = rate(_on(_pick[4]))[0] + _mgr = rate(_on(_mg))[0] + _mqr = rate(_on(_mq))[0] if _mq else None + _mqse = _seed_se(_on(_mq))[1] if _mq else None + _mns = len({ps for ps, _ in common}); _mcells = len(common) + # The control is read on `common` as well, but is deliberately NOT part of the + # intersection: adding it would shrink the cell set and move the three columns already + # published. Partial coverage is daggered and counted instead. + _mrr_rand, _mrand_cells = None, 0 + if _pick is not None and _mg and _mrand and common: + _subr = {kk: vv for kk, vv in _mrand.items() if (kk[1], kk[2]) in common} + if _subr: + _mrr_rand, _mrand_cells = rate(_subr)[0], len(_subr) + # EXTRA SCORERS, read on the SAME cells. `common` is fixed by (greedy, RISE, RSM) so that + # adding a comparator can never move the three columns already published; each extra column + # is then restricted to `common` too. A scorer that has not yet run every cell of `common` + # is marked with a dagger and its own cell count is disclosed rather than being silently + # averaged over a different set of episodes. + _hl = {k: _health_of(_xpick[k], P) for k, _ in EXTRA_SCORERS} + _hl_rsm = _health_of(_pick, P) + _xs = {} + for _k, _ in EXTRA_SCORERS: + _xp = _xpick[_k] + if _xp is None or _pick is None or not _mg: + _xs[_k] = (_cell_status(src, _k, 0), 0) + continue + _sub = {kk: vv for kk, vv in _xp[4].items() if (kk[1], kk[2]) in common} + if not _sub: + _xs[_k] = ("--", 0) + continue + _r = rate(_sub)[0] + _xse[_k] = _seed_se(_sub)[1] + _ns = len({ps for (_pp, ps, _es) in _sub}) + _partial = "" if len(_sub) >= len(common) else r"\dagger" + # NOT REPORTABLE without a health number (gen_q#268 standing rule): the entry is + # still printed, because hiding it would misrepresent what was run, but it is marked + # so no reader can mistake it for a checked number. + # OWNER DECISION 2026-09-24: "the scorer health doesn't matter." The mark is off, so + # tab:flagship carries only the seed-count dagger. The health data itself is still + # computed and still printed in tab:scorer_health, which is where a reader who wants + # the ties/spread/gap check can find it; nothing is deleted, only un-flagged here. + _nohealth = "" + _mk = (_partial + _nohealth) + _xs[_k] = (r"$%.1f_{(%d)}%s$" % (_r, _ns, ("^{%s}" % _mk) if _mk else ""), len(_sub)) + _f1 = lambda v: "--" if v is None else f"${v:.1f}$" + _frand = ("--" if _mrr_rand is None else + (r"$%.1f$" % _mrr_rand if _mrand_cells >= len(common) + else r"$%.1f^{\dagger}$" % _mrr_rand)) + return dict(fold=_fold, mg=_f1(_mgr), mq=_f1(_mqr), mrand=_frand, mrandcells=_mrand_cells, + health=_hl, health_rsm=_hl_rsm, + xs={k: v[0] for k, v in _xs.items()}, + xcells={k: v[1] for k, v in _xs.items()}, + xsearch={k: len({(a_, p_) for (a_, p_, _, _) in c if a_[0] == k and p_ == P}) + for k, _ in EXTRA_SCORERS}, + # gen_q#273 part 1e: the RECIPE of the arm each scorer column actually printed, + # so the caption's read-out sentence is derived from the selected arms instead of + # from a stale side-dump. An MPC arm reads "H N". + xarm={k: (None if _xpick[k] is None else _xpick[k][3][1]) for k, _ in EXTRA_SCORERS}, + mr=("--" if _mrr is None else (r"$\mathbf{%.1f}_{(%d)}$" % (_mrr, _mns))), + mdg="--" if (_mrr is None or _mgr is None) else f"${_mrr - _mgr:+.1f}$", + mdq="--" if (_mrr is None or _mqr is None) else f"${_mrr - _mqr:+.1f}$", + mcells=_mcells, mns=_mns, mqse=_mqse, xse=_xse) + # The matched-actor block reads the ROW'S proposer (PROPOSER_BY_TASK), not the RISE actor by name: + # with the proposer pinned elsewhere, every scorer/control here must be on that proposer or + # print its launch status -- reading the RISE actor's cells there put its numbers next to an + # RSM entry from another actor (caught in the first pinned render, 2026-09-21). + _mb = matched("BC-unified"); _ma = matched(proposer_for(task) or "RISE policy") + + _ex, _sb, _md = dataset_row(src) + rows.append(dict(label=NICE.get(disp, disp), task=src, es=traj(src), bc_recipe=bc_recipe, arm=sel_arm[1], + exp=_ex, sub=_sb, med=_md, + mg=_mb["mg"], mq=_mb["mq"], mr=_mb["mr"], mdg=_mb["mdg"], mdq=_mb["mdq"], mcells=_mb["mcells"], + ag=_ma["mg"], aq=_ma["mq"], ar=_ma["mr"], adg=_ma["mdg"], adq=_ma["mdq"], acells=_ma["mcells"], aseeds=_ma["mns"], aqse=_ma["mqse"], axse=_ma["xse"], + axs=_ma["xs"], axcells=_ma["xcells"], axsearch=_ma["xsearch"], + axarm=_ma["xarm"], + health=_ma["health"], health_rsm=_ma["health_rsm"], afold=_ma["fold"], + arand=_ma["mrand"], arandcells=_ma["mrandcells"], + base=bcells, rsm=rsm, db=db, dg=d(mg), dp=d(mp), + rsm_chain=rsm_chain, rsm_chain_arm=rsm_chain_arm, + rsm_chain_cells=rsm_chain_cells, rsm_chain_seeds=rsm_chain_seeds, + rsm_chain_disp=rsm_chain_disp, rsm_chain_rate=rsm_chain_rate, + rsm_chain_n=rsm_chain_n, base_chain=base_chain, db_chain=db_chain, + rsm_fold_disp=rsm_fold_disp, rsm_fold_rate=rsm_fold_rate, + # DISCLOSURE, COMPUTED. The caption used to state "four arms" as a literal; + # the chain sweep has since grown (particle counts beyond {16,64} and further + # beta values landed as cells finished), so a hardcoded count becomes a false + # claim the moment a cell lands -- the same staleness failure the missing-row + # note exists to prevent. Count the arms actually selected over. + nchain=len({(arm_, p_) for (arm_, p_, _, _) in c if arm_[0] == "rsm:membership" + and proposer_ok(task, p_) and _recipe_is_chain(arm_[1])}), + # the FOLD arm count, counted on the same field rather than as + # nsearch - nchain: that difference also picks up the CHRB analytic-test arms + # and any arm whose key carries no length field at all. + nfold=len({(arm_, p_) for (arm_, p_, _, _) in c if arm_[0] == "rsm:membership" + and proposer_ok(task, p_) and _readout_of(arm_[1]) == "fold"}), + tbase=tcells, trsm=trsm, tdb=tdb, pooled=sr, + verdict=verdict, eps=n, fam=_family_stats(c, prop), + # DISCLOSURE (2026-09-21 audit, E1): the RSM entry is a maximum over every + # membership-head configuration evaluated on this task, single-seed ones + # included -- the caption must say how many, not the >=2-seed count only. + nsearch=len({(arm_, p_) for (arm_, p_, _, _) in c if arm_[0] == "rsm:membership" + and proposer_ok(task, p_)}), + proposer_used=proposer_for(task), + # IFQL VALUE RESOLUTION (gen_q#264, coordinator 2026-09-21). An HL-Gauss critic + # ranks no more finely than its 101 bins: a per-state spread of a fraction of a + # bin means the column cannot order 128 candidates whatever its provenance AUC, + # i.e. it is a random-of-128 wearing a value function's name. Reported next to + # the column rather than left to be inferred -- this project already has two + # scorers that failed exactly there. + ifqspread=ifql_value_spread(src), + beps={k: bn[k] for k, _ in BASE})) + return rows, counts + + +# SEED TIER, SHARED BY BOTH SELECTION PATHS (2026-09-21). +# The flagship RSM column is chosen by the loop in build(); the matched tables and the extra-scorer columns +# are chosen by _best_arm(). Both used "any arm with >= 2 policy seeds, maximised by rate", which lets a +# 2-seed arm outrank a fully-seeded one. It bit on threading: un-pooling the flow-hop cells shrank the +# 3-seed arm, the maximum moved to a 2-seed arm, and the row jumped from 13.6+-2.6 (3 seeds, delta +0.4) to +# 16.7+-3.3 (2 seeds, delta +3.5) with no new evidence. The caption claims "3 policy x 3 eval seeds", so a +# fully-seeded arm outranks ANY under-seeded one however high it scores. The tier caps at 3 so a 4-seed arm +# does not outrank a better 3-seed one. Rate, then episode count, break ties inside a tier. +def _actor_note(rows): + """Caption sentence naming the proposer. With no per-task override it is the old single-actor + sentence; with overrides it names each task's proposer and states the selection rule, because a + chosen proposer is a search and the reader must be told.""" + if RSM_PROPOSER != "RISE policy" and not PROPOSER_BY_TASK: + return "" + over = {r["label"]: r.get("proposer_used") for r in rows + if r.get("proposer_used") not in (None, RSM_PROPOSER)} + if not over: + return (" \\textbf{The RSM column proposes from the RISE actor on every task} -- the same actor " + "whose samples RISE's own critic ranks -- so RISE and RSM differ only in the scorer; no " + "per-task choice of proposer is made.") + named = "; ".join(f"{k}: {v}" for k, v in over.items()) + # Short on purpose: the ICLR caption box overflows \maxdimen ("Dimension too large") once the caption + # passes ~4.4 KB, which the long form of this sentence did; the rule is stated once in the text. + return (" \\textbf{One proposer per row, shared by every scorer.} Unlisted rows propose from the RISE " + f"actor; {named} (chosen by planning performance, a disclosed search; unrun scorers on such a " + "row print \\textit{pending}/\\textit{launched}).") + + +_LIVE_JOBS = None + + +def _live_jobs(): + """Names of my queued/running LSF jobs, read once per process; [] when bjobs is unavailable (then every + unrun cell prints `pending`, which under-reports launches but never invents a number).""" + global _LIVE_JOBS + if _LIVE_JOBS is None: + import subprocess as _sp + try: + r = _sp.run(["bjobs", "-o", "job_name", "-noheader"], capture_output=True, text=True, timeout=120) + _LIVE_JOBS = r.stdout.split() if r.returncode == 0 else [] + except Exception: + _LIVE_JOBS = [] + return _LIVE_JOBS + + +# scorer column -> the tag its launcher stamps on eval jobs (launch_*_on_actor.py / launch_ifql.py), which +# job names carry as rr_e1__E1-...-[E]-es-... +_TAG_OF = {"rsm:tdflow": "TDF", "wm:lewm": "LEWM", "wm:dinowm": "DINOWM", "wm:df": "DFVAL", + "critic:ifql": "IFQLCRIT", + "IDQL": "ON", "RISE": "ON", "RISEg": "ON", "rand": "ON"} + + +def _launch_status(task, key): + """On a row whose proposer is pinned (PROPOSER_BY_TASK), an empty scorer cell means the scorer has not + been RUN on that proposer: `launched` if its eval jobs are in the queue, `pending` if not, `n/a` for a + co-trained critic on a family that has none (BC actors). BC / BC-u are standalone policies, not scorers + on the proposer, so they keep the training-derived status. Returns None where this does not apply.""" + if task not in PROPOSER_BY_TASK or key not in _TAG_OF: + return None + import verdict_table as _V + lab = PROPOSER_BY_TASK[task] + fam_lab, _, ep = lab.partition("@") + inv = {v: k for k, v in _V.POL.items()} + fam = inv.get(fam_lab) + if fam is None: + raise SystemExit(f"PROPOSER_BY_TASK[{task}] = {lab!r} is not a verdict_table.POL label") + # every S0A* family is trained by IDQL and has a co-trained critic (S0A, S0Aidql, S0Ansn, ...); the + # BC families (S3H1*, S0B*) have none, so the critic column is n/a there rather than pending. + if key in ("IDQL", "RISE") and not fam.startswith("S0A"): + return r"\textit{n/a}" + tag = _TAG_OF[key] + fam + (f"E{ep}" if ep else "") + if any(j.startswith(f"rr_e1_{task}_") and f"-{tag}-es" in j for j in _live_jobs()): + return r"\textit{launched}" + return r"\textit{pending}" + + +def _cell_status(task, key, ncells=0, need=9): + """What an EMPTY cell should say instead of "--", derived from artefacts on disk (owner request + 2026-09-21: "mark cells as pending / launching if they are missing under the proper evaluation + conditions"). Never a hand-maintained status map, which goes stale the moment a row lands. + partial cells -> pending k/9 + no cells, model complete -> queued (evaluation not yet landed) + model still training -> training + nothing on disk -> -- (not applicable / not started)""" + import glob as _g + R = str(ROOT) + if ncells and ncells < need: + return r"\textit{pend " + f"{ncells}/{need}" + "}" + _ls = _launch_status(task, key) + if _ls: + return _ls + def _steps(pat): + st = [int(m.group(1)) for f in _g.glob(pat) for m in [re.search(r"ckpt_s(\d+)\.pt$", f)] if m] + return max(st) if st else None + if key == "rsm:tdflow": + st = _steps(f"{R}/runs/{task}/rsm/TDF_*[!g]/ckpt_s*.pt") # excludes *_rmsbug + full = 100000 + elif key == "wm:lewm": + st, full = _steps(f"{R}/runs/{task}/wm/lewm/ckpt_s*.pt"), 100000 + elif key == "wm:df": + # DF checkpoints live per CONFIG (wm/df_A, wm/df_C, ...); take the furthest-trained config. + st, full = _steps(f"{R}/runs/{task}/wm/df_*/ckpt_s*.pt"), 100000 + elif key == "wm:dinowm": + st, full = _steps(f"{R}/runs/{task}/wm/dinowm/ckpt_s*.pt"), 100000 + elif key == "critic:ifql": + st = 1 if _g.glob(f"{R}/runs/{task}/policy/S0Aifql_seed*/*/*/models/model_epoch_5000.pth") else None + full = 1 + elif key in ("IDQL", "BC", "BCU", "RISEg", "RISE"): + fam = {"IDQL": "S0Aidql", "BC": _BC_LABEL and ("S3H1plain" if PLAIN_BASELINES else "S3H1"), + "BCU": ("S0Bplain" if PLAIN_BASELINES else "S0B"), "RISEg": "S0A", "RISE": "S0A"}[key] + done = len(_g.glob(f"{R}/runs/{task}/policy/{fam}_seed*/*/*/models/model_epoch_5000.pth")) + if done >= 3: + return r"\textit{queued}" + roll = [int(m.group(1)) for f in _g.glob(f"{R}/runs/{task}/policy/{fam}_seed*/rolling/model_epoch_*.pth") + for m in [re.search(r"model_epoch_(\d+)\.pth$", f)] if m] + if done or roll: + return r"\textit{trn " + f"{done}/3" + "}" + return "--" + else: + return "--" + if st is None: + return "--" + if st >= full: + return r"\textit{queued}" + return r"\textit{trn " + (f"{st//1000}k" if full > 1 else "") + "}" + + +_PM = "[{]" + chr(92) * 2 + "pm[}][0-9.]+" # matches "{\pm}1.4" in a rendered cell + + +def _num(c): + """The numeric value of a rendered cell, or None when the cell is not a measurement (status word, + n/a, --). Status words contain digits ("trn 40k", "pend 4/9"), so the italic test comes first.""" + if not isinstance(c, str) or "textit" in c or "mathrm" in c: + return None + m = re.search(r"([0-9]+(?:\.[0-9]+)?)", c) + return float(m.group(1)) if m else None + + +def _unbold(c): + pre, suf = "$" + chr(92) + "mathbf{", "}$" + return "$" + c[len(pre):-len(suf)] + "$" if c.startswith(pre) and c.endswith(suf) else c + + +def _bc_note(rows): + """One clause for the paper-table caption naming the rows whose BC column is the plain recipe.""" + pl = [r["label"] for r in rows if r.get("bc_recipe") == "plain"] + if not pl: + return "" + return ("BC is the plain diffusion-BC recipe (every RISE actor ingredient off) on " + ", ".join(pl) + + " and the codebase recipe elsewhere until the plain retrains finish. ") + + +def _paper_table(rows): + """THE flagship table for the paper. + + COLUMNS NAME THE VALUE ESTIMATOR, NOT THE PARENT METHOD'S ACTOR (owner, 2026-09-21: "the F or D means + what the proposer is. so IFQL should be the same as P-critic, and it should actually be IDQL because the + proposer is a diffusion policy in RISE actor"). Correct: IDQL is implicit *diffusion* Q-learning and + IFQL implicit *flow* Q-learning -- the letter is the actor. Once the actor is fixed to the row's + proposer, which is what makes the comparison fair, IDQL and RISE differ only in that actor's + regularisers and both reduce to ONE column, the implicit-Q critic over this proposer; and IFQL + contributes only its critic (an HL-Gauss expectile Q), its flow actor being gone. Measured: on the five + rows whose proposer IS the RISE actor the old P-critic and RISE columns are the identical number + (45.2 / 3.7 / 22.4 / 6.0 / 2.9), i.e. they were one column printed twice. + + BC, BC-u standalone policies: no candidate set, no ranking, no reward. The bar to clear. + IQL the implicit-Q critic of IDQL/RISE, ranking this proposer's 128 candidates. Where the + proposer has no co-trained critic (a BC actor) it is the RISE critic scoring those + candidates, which the caption states. + IFQL IFQL's HL-Gauss expectile critic on the same candidates. + TD-Flow RSM's occupancy field fitted by TD bootstrapping instead of Monte Carlo. + LeWM, DINO-WM world models rolled out over the same candidates. + RSM ours (Monte-Carlo occupancy, membership reward). + + The published own-actor numbers for IDQL and RISE stay in Table~ref{tab:flagship_single_actor}; here the + proposer is held fixed, so quoting them again would compare across actors in a table whose whole point + is that it does not.""" + bs = chr(92) + ref = [(i, k) for i, (k, _) in enumerate(BASE) if k in ("BC", "BCU")] + ri = {k: i for i, (k, _) in enumerate(BASE)} + # DF COLUMN (gen_q#282, DF_VALUE 2026-09-24). tab:flagship and tab:controls build their scorer + # columns from THIS hard-coded list, not from EXTRA_SCORERS -- so adding ("wm:df","DF") to + # EXTRA_SCORERS wired the DF column into tab:flagship_all but NOT into tab:flagship, which is the + # deliverable. A rebuild on 2026-09-24 07:40Z confirmed it: the fresh tab:flagship header was + # "Task & BC & BC-u & IDQL & IFQL & TD-Flow & LeWM & DINO-WM & RSM" -- nine columns, no DF. + # OFF BY DEFAULT until the fit is measured. The table is already at its width limit at + # \scriptsize with full task names, and a tenth column may overflow ICLR's 397.5pt block; the + # instruction is to REPORT an overflow, not to hide it by shrinking the font, and it would be + # worse to silently break the orchestrator's live table while measuring. So: build with + # RR_DF_COLUMN=1 to render it, measure with scripts/check_iclr_fit.sh, and flip this default + # to "1" once (and only once) the fit passes. + xs_order = [("critic:ifql", "IFQL"), ("rsm:tdflow", "TD-Flow"), ("wm:lewm", "LeWM"), ("wm:dinowm", "DINO-WM")] + if os.environ.get("RR_DF_COLUMN", "0") == "1": + xs_order = xs_order + [("wm:df", "DF")] + # "IDQL", not "IQL" (owner, 2026-09-21): an implicit-Q critic over a DIFFUSION proposer is the IDQL method; + # RISE is IDQL plus the actor regularisers, hence no separate column once the actor is fixed. + heads = [NICE_COL.get(k, k) for _, k in ref] + ["IDQL"] + [l for _, l in xs_order] + body = []; colvals = {} + for r in rows: + cells, vals, eps = [], [], [] + for i, k in ref: + c = _unbold(r["base"][i]) # keeps the across-seed SE the base table carries + cells.append(_cell_status(r["task"], k) if c == "--" else c) + vals.append(_num(cells[-1])); eps.append((r.get("beps") or {}).get(k, 0)) + # IQL on the ROW'S PROPOSER. r["aq"] is the matched-actor critic cell; on an unpinned row that is the + # RISE actor, so it equals the published RISE column and the base cell is an equivalent fallback when + # the matched intersection is short. + _q = r.get("aq") or "--" + _qe = 50 * (r.get("acells") or 0) + if _q == "--" and r["task"] not in PROPOSER_BY_TASK: + _q, _qe = r["base"][ri["RISE"]], (r.get("beps") or {}).get("RISE", 0) + _q = _unbold(_q) + if _q.startswith("$") and "{" + bs + "pm}" not in _q and r.get("aqse") is not None: + _q = _q[:-1] + "{" + bs + "pm}%.1f$" % r["aqse"] # SE across policy seeds, same cells as RSM + if _q.startswith("$") and "_{(" not in _q and r.get("aseeds"): + _q = _q[:-1] + "_{(%d)}$" % int(r["aseeds"]) # same cells as the matched RSM entry + cells.append(_cell_status(r["task"], "RISE") if _q == "--" else _q) + vals.append(_num(cells[-1])); eps.append(_qe) + for k, lab in xs_order: + c = (r.get("axs") or {}).get(k, "--") + n = (r.get("axcells") or {}).get(k, 0) + _se = (r.get("axse") or {}).get(k) + if c != "--" and _se is not None and "{" + bs + "pm}" not in c: + # "$v_{(n)}^{marks}$" -> "$v{\pm}se_{(n)}^{marks}$" + c = re.sub(r"^\$([0-9.]+)", lambda m_: "$" + m_.group(1) + "{" + bs + "pm}%.1f" % _se, c, count=1) + cells.append(_cell_status(r["task"], k, n) if c == "--" else _unbold(c)) + vals.append(_num(cells[-1])); eps.append(50 * n) # every launcher runs --num-rollouts 50 + # CHAIN ONLY. r["rsm"] (the retired fold maximum) is deliberately not consulted here. + _rc = r.get("rsm_chain") + rsm = (_unbold(_rc) if _rc and _rc != "--" + else _chain_status(r["task"], r.get("rsm_chain_cells") or 0)) + rv = _num(rsm) + cand = [(v, e) for v, e in zip(vals, eps) if v is not None] + d = "--" + if rv is not None and cand: + bv, be = max(cand) + star = "^{*}" if (be and r.get("eps") and ztest(rv, r["eps"], bv, be) < 0.05) else "" + d = "$%+.1f%s$" % (rv - bv, star) + allv = [v for v in vals + [rv] if v is not None] + if allv: + top = max(allv) + out = [] + for c, v in list(zip(cells, vals)) + [(rsm, rv)]: + out.append(("$" + chr(92) + "mathbf{" + c[1:-1] + "}$") if (v is not None and v == top and c.startswith("$")) else c) + cells, rsm = out[:-1], out[-1] + # 2026-09-24 (owner): tab:flagship spells the task out. This is the THIRD abbreviation + # map in this file and the only one tab:flagship reads -- my first two edits patched the + # other two and changed nothing here. Verified to still fit ICLR 5.5in by check_iclr_fit.sh. + _ab = {} + for j, v in enumerate(vals + [rv]): + if v is not None: + colvals.setdefault(j, []).append(v) + _s3 = lambda c: re.sub(r"_\{\(3\)\}", "", c) # 3 seeds is the norm: only deviations are marked + body.append(" & ".join([_ab.get(r["label"], r["label"]), *[_s3(c) for c in cells], _s3(rsm)]) + " " + chr(92) * 2) + # MEAN ROW (owner, 2026-09-22): mean +- standard error ACROSS TASKS per column (SE = s/sqrt(n) over the + # task means, n = tasks measured). A column still missing tasks is averaged over what it has and marked + # n/T; its mean is therefore over a different task set and is not comparable to the full columns. + import statistics as _st + ncol = len(ref) + 1 + len(xs_order) + 1 + mcells, mvals = [], [] + for j in range(ncol): + xs = colvals.get(j, []) + if len(xs) < 2: + mcells.append("--"); mvals.append(None); continue + m, se = _st.mean(xs), _st.stdev(xs) / len(xs) ** 0.5 + tag = "" if len(xs) >= len(rows) else "^{%d/%d}" % (len(xs), len(rows)) + mcells.append("$%.1f{%spm}%.1f%s$" % (m, bs, se, tag)) + mvals.append(m if len(xs) >= len(rows) else None) + _full = [v for v in mvals if v is not None] + if _full: + top = max(_full) + mcells = [("$" + bs + "mathbf{" + c[1:-1] + "}$") if (v is not None and v == top) else c for c, v in zip(mcells, mvals)] + md = "--" + if mvals[-1] is not None and any(v is not None for v in mvals[:-1]): + md = "$%+.1f$" % (mvals[-1] - max(v for v in mvals[:-1] if v is not None)) + body.append(bs + "midrule" + chr(10) + " & ".join(["Mean", *mcells]) + " " + chr(92) * 2) + npl = len(xs_order) + 2 # IDQL + the added scorers + RSM + cols = "l" + "c" * len(ref) + "|" + "c" * npl + grp = ("% & " + bs + "multicolumn{" + str(len(ref)) + "}{c|}{no planning} & " + + bs + "multicolumn{" + str(npl) + "}{c}{value estimators, one proposer per row, same 128 candidates} " + bs * 2 + + chr(10) + "% " + bs + "cmidrule(lr){2-" + str(1 + len(ref)) + "} " + + bs + "cmidrule(lr){" + str(2 + len(ref)) + "-" + str(1 + len(ref) + npl) + "}") + # OWNER TEMPLATE (2026-09-22): caption and layout verbatim from the owner's message; only the numbers and + # status words are generated. The long methodological caption moved to tab:flagship_all / the text. + # The owner's TODO asked two things of this caption. "Verify RSM implementation uses proper beta + # recursion and not use return-based reward" was AUDITED on 2026-09-22 and is answered in + # tab:audit, so the TODO now points there instead of repeating a question that has an answer; the + # two clauses that are still open (MC-value, the IFQL gamma sweep) stay exactly as written. + # The caption used to say the beta recursion "audited ... both clean". The reward half of that audit + # stands; the recursion half does not (gen_q#267): the read-out was a deterministic truncated fold, + # not the reference's coin-terminated chain. A caption that keeps asserting the old verdict beside + # the corrected numbers would be the worst of both. + # COMPUTED, never literal: how many chain arms the per-row maximum actually ranges over. + _nc = sorted(r.get("nchain", 0) for r in rows) + _nc = [x for x in _nc if x] + _nchain_txt = ("four arms" if not _nc else + (f"{_nc[0]} arms" if _nc[0] == _nc[-1] else f"{_nc[0]}--{_nc[-1]} arms per row")) + cap = (bs + "textbf{Offline RL comparison over suboptimal and play data.} RSM performs better or on-par with " + "BC baselines and SOTA world-model-based planning and offline RL algorithms. " + "The two methods with a horizon read-out (RSM, TD-Flow) share the coin-terminated $" + + bs + "beta$ chain: a walk of stochastic length with continuation $p=(" + bs + "gamma-" + + bs + "beta)/(" + bs + "gamma(1-" + bs + "beta))$ and one membership read at the frozen node, " + "whose composed frame offset is exactly $" + bs + "mathrm{Geom}(1-" + bs + "gamma)$, capped at " + "the $10^{-3}$ truncation tail. It replaces the deterministic truncated fold these columns " + "previously reported, which is kept in Table~" + bs + "ref{tab:flagship_fold}; a cell whose " + "chain re-score has not landed prints its launch state rather than the superseded number. The " + "chain settings were selected on RSM and transferred unchanged to TD-Flow, so TD-Flow received " + "the smaller search budget: the per-row chain search is " + _nchain_txt + " (particles $" + # gen_q#267 run 15: the sampler's Euler-step count (training.plan_flow_steps, gen_q#273, + # released default 8) is a THIRD swept axis and a flow-4 arm is the printed winner on + # piece-tip, so the caption must name it -- an undisclosed axis that produces a printed + # number is the silent search this table exists to prevent. + + bs + "times$ prob or logit read-out $" + bs + "times$ the $" + bs + "beta$ grid $" + + bs + "times$ the successor sampler's Euler-step count $" + + bs + "in" + bs + "{4,8,16" + bs + "}$, default $8$), the cap " + "is not a hyper-parameter but the $10^{-3}$ " + "truncation tail of the continuation coin, and $" + bs + "beta$ is swept over the grid the " + "rows already used, which training supports because the successor is $" + bs + "beta$-conditioned " + "over $[0.90,0.995]$. The reward is RISE's binary data-provenance membership label for " + "every value estimator. " + bs + "TODO{MC-value is low priority. Maybe sweep gamma in ifql}") + return (bs + "begin{table}[t]" + chr(10) + bs + "centering" + chr(10) + # MEASURED 2026-09-24, all three options compiled rather than estimated + # (scripts/tmp/fit_opts.sh), with FULL task names and 2pt tabcolsep: + # \footnotesize, all 9 columns -> OVER by 21.99pt + # \scriptsize, all 9 columns -> FITS <- in use + # \footnotesize, IFQL dropped -> FITS + # So full names cost about one font step. A LARGER font is available only by dropping a + # column, and IFQL is the candidate since it was removed from the sweeps on 2026-09-23 and + # has zero swept arms. That is an editorial call about the results, not a layout fix, so it + # is NOT taken here. An earlier PASS at \small was measured with the names still + # abbreviated, before the label fix reached the right map -- do not trust it. + # 2026-09-24 (owner): full task names in the rows and a readable font. The table was + # \scriptsize at 2pt column separation because nine columns of "$xx.x{\pm}y.y$" plus + # abbreviated labels is what fit ICLR's 5.5in text block. Full names are wider, so the + # gain has to come from somewhere: \small with 3pt separation is the largest setting + # that still fits, verified by scripts/check_iclr_fit.sh -- do not raise it without + # re-running that check, which is what catches an overfull box before a reviewer does. + + bs + "caption{" + cap + "}" + chr(10) + bs + "label{tab:flagship}" + chr(10) + bs + "scriptsize" + chr(10) + # tabcolsep back to 2pt: raising it to 3pt in the same edit that shrank the font added + # 9 columns x 2 sides x 1pt = 18pt of padding and cancelled most of what the smaller font + # bought, which is why \small and \footnotesize both overflowed by the same 39.99pt. + + bs + "setlength{" + bs + "tabcolsep}{2pt}" + chr(10) + + bs + "begin{tabular}{" + cols + "}" + chr(10) + bs + "toprule" + chr(10) + + grp + chr(10) + + "Task & " + " & ".join(heads) + " & RSM " + bs * 2 + chr(10) + + bs + "midrule" + chr(10) + chr(10).join(body) + chr(10) + bs + "bottomrule" + chr(10) + + bs + "end{tabular}" + chr(10) + bs + "end{table}" + chr(10)) + + + +def _grid_note(): + """The (beta, L) grid actually evaluated, read from the planner cell names on disk (R-), so the + caption cannot drift from what ran.""" + import glob, os + seen = set() + for f in glob.glob("/proj/dmfexp/zwhong/rsm_rise/runs/*/eval_onactor/*.json"): + m = re.search(r"-R(0\.[0-9]+)-(\d+)-N", os.path.basename(f)) + if m: + seen.add((float(m.group(1)), int(m.group(2)))) + if not seen: + return "grid not found on disk" + bs = chr(92) + betas = sorted({b for b, _ in seen}); Ls = sorted({L for _, L in seen}) + return ("$" + bs + "beta" + bs + "in" + bs + "{" + ",".join(f"{b:g}" for b in betas) + bs + "}$, $L" + + bs + "in" + bs + "{" + ",".join(str(L) for L in Ls) + bs + "}$") + + +# The short row names tab:discounts and tab:chainhops both print. One definition, so the two +# tables can never disagree about which task a line belongs to. +_ROW_ABBR = {"Square (Sub.)": "Sq-S", "Square (Cov.)": "Sq-C", "Piece (Sub.)": "Pc-S", + "Piece (Cov.)": "Pc-C", "Mug (Sub.)": "Mug", "Thread (Cov.)": "Thr", + "Piece-tip (Cov.)": "Pc-tip"} + + +def _discount_table(rows, gamma=0.99, ifql_gamma=0.9999, eps=0.05): + """Discount / horizon disclosure per method (owner, 2026-09-21: "a separate table where for each method + where it matters, we include the relevant discount factors ... for rsm it is gamma and beta and num hops. + technically, beta should determine num hops"). + + THE ARITHMETIC (rsm_scorer._q_fold_logit). One hop of the successor model is one draw k ~ Geom(1-beta), + mean length h = 1/(1-beta) frames; the fold discounts each hop by G = gamma**h and truncates after L hops, + q_k = c_k + (1 - c_k) G q_{k+1}, q_L = 0, so the gamma-mass it DROPS is G**L = gamma**(L/(1-beta)). + port-ocbench-unified sizes L so that this tail is small ("depth is a loop guard, not a horizon"); this + pipeline never did -- L was swept in {1,2,4,8} and chosen by success, and nothing checked the tail. The + table prints the tail and the L that a 5 % tail would need, so the reader sees that the flagship read-out + is a short-horizon predictor (L/(1-beta) frames) with gamma nominal. The sampler convention is stated in + the caption: ours renormalises the truncated geometric and admits k = 0; ocbench's reference puts the + tail on the terminal frame and starts at k = 1.""" + import math + bs = chr(92) + # THE PER-ROW HALF DESCRIBES THE ARM tab:flagship PRINTS (gen_q#267, 2026-09-23). It used to read + # r["arm"] -- the maximum over BOTH read-outs, which on every row is a FOLD arm -- and print its + # (beta, L) and retained tail under a caption claiming "per row as selected in Table~tab:flagship". + # The flagship RSM/TD-Flow columns have been chain-only since 2026-09-22 06:30, so that half of the + # table stated a read-out the flagship no longer uses: the same fold-for-chain substitution the + # owner ruled out, one table over. It now reads r["rsm_chain_arm"], the arm the chain-only + # selection returned, and prints the chain's own quantities; the retired fold's (beta, L) and + # retained mass keep their place in tab:ablation_betarec, which is where they belong. + def _chain_bl(arm): + """(beta, cap, particles, read-out) of a chain arm key `... b0.98 CH11 N128 P16 prob`.""" + m = re.search(r"\bb([0-9.]+)\s+CH(\d+)\b", arm or "") + if not m: + return (None, None, None, None) + _p = re.search(r"\bP(\d+)\b", arm) + _r = re.search(r"\b(prob|logit)\b", arm) + return (float(m.group(1)), int(m.group(2)), + int(_p.group(1)) if _p else None, _r.group(1) if _r else None) + # 2026-09-24 (owner: "can you describe the full task names in the rows?"). tab:flagship spells the + # task out; the abbreviation map is still used by the genuinely narrow tables. Verified to still fit + # ICLR's 5.5in block by scripts/check_iclr_fit.sh -- re-run it if this table gains a column. + _ab = {} + body = [] + for r in rows: + # A row that prints a LAUNCH STATUS in tab:flagship has no selected read-out to describe: its + # chain arm exists but is a single seed, which is a launch state and not a flagship number. + # Printing its parameters here would claim a read-out for an entry the flagship does not print. + b, cap, part, ro = _chain_bl(r.get("rsm_chain_arm") if r.get("rsm_chain_rate") is not None else None) + lbl = _ab.get(r["label"], r["label"]) + if b is None: + body.append(lbl + " & -- & -- & -- & -- & -- & -- & -- " + bs + bs); continue + # EXACT HOP LAW (owner, 2026-09-23), time-zero convention: the continuation coin fires with + # p = (gamma-beta)/(gamma(1-beta)), so the number of successor reads is 1/(1-p) = + # gamma(1-beta)/(beta(1-gamma)) and one hop covers beta/(1-beta) frames; the product is + # gamma/(1-gamma) frames for EVERY beta, which is the identity the chain exists to satisfy. + # The cap is the analytic 1e-3 truncation guard, p**cap, not a swept hyper-parameter. + p_c = (gamma - b) / (gamma * (1.0 - b)) + reads = 1.0 / (1.0 - p_c) + fph = b / (1.0 - b) + tail = p_c ** cap + body.append(" & ".join([lbl, f"{b:g}", str(cap), f"{p_c:.3f}", f"{reads:.2f}", f"{fph:.0f}", + _sci(tail, 1).join("$$"), + ((f"P{part} " if part else "") + (ro or "--"))]) + " " + bs + bs) + meth = [ + ("BC, BC-u", "--", "--", "--", "--", "no value estimate"), + ("IDQL / RISE critic", f"{gamma:g}", "--", "--", f"{1/(1-gamma):.0f}", "IQL expectile critic, per-frame discount"), + ("IFQL critic", f"{ifql_gamma:g}", "--", "--", f"{1/(1-ifql_gamma):.0f}", "published value; longer than every episode (230--370 frames): near-undiscounted"), + ("TD-Flow", f"{gamma:g}", "per row", "per row", "per row", "the same coin-terminated $" + bs + "beta$ chain as RSM, at RSM's selected settings (transferred, not swept); its Bernoulli($" + bs + "beta$) coin is the Bellman mixture in TRAINING"), + # gen_q#273 part 1e: these columns now print MPC cells, whose horizon IS the discount + # (H = 1/(1-gamma) frames, ceil(H/8) chunks), so "inert / 4 chunks / no discount" -- true of the + # retired R- fold -- is no longer what the table reports. Derived from the arms the + # row actually selected (r["axarm"]), same source as the read-out sentence in tab:controls. + ("LeWM, DINO-WM", _wm_gamma_cell(rows), "--", _wm_chunk_cell(rows), _wm_h_cell(rows), + "open-loop MPC rollout from the candidate, $" + bs + "lceil H/8" + bs + "rceil$ chunks; terminal " + "state scored, or the rollout discounted-summed with the same $" + bs + "gamma$"), + # EXACT HOP FORMULA (owner, 2026-09-23): the shorthand $(1-\beta)/(1-\gamma)$ is exact only where + # $\gamma=\beta(2-\beta)$, i.e. at $\beta=0.90$ for $\gamma=0.99$; it overstates elsewhere (5 vs 4.21 + # at $\beta=0.95$). The chain's own expected number of successor reads is $1/(1-p)$ with + # $p=(\gamma-\beta)/(\gamma(1-\beta))$, which is what tab:chainhops measures, so this row quotes that. + ("RSM", f"{gamma:g}", "per row", "per row", "per row", "one hop $=$ one $" + bs + "mathrm{Geom}(1{-}" + bs + "beta)$ successor draw of mean length $1/(1{-}" + bs + "beta)$; the chain takes $" + bs + "gamma(1{-}" + bs + "beta)/(" + bs + "beta(1{-}" + bs + "gamma))$ reads on average"), + ] + mrows = [" & ".join(m) + " " + bs + bs for m in meth] + return (bs + "begin{table}[t]" + chr(10) + bs + "centering" + chr(10) + + bs + "caption{" + bs + "textbf{Discount factors and horizons.} Top: what each method discounts. " + "Bottom: the coin-terminated $" + bs + "beta$-chain read-out per row, for the arm Table~" + + bs + "ref{tab:flagship} actually prints (the chain-only selection; a retired fold arm can no " + "longer stand in for it here). One hop of the successor model is one draw $k" + bs + "sim" + bs + + "mathrm{Geom}(1{-}" + bs + "beta)$, mean $" + bs + "beta/(1{-}" + bs + "beta)$ frames in our " + "time-zero convention; after each hop the walk continues with probability $p=(" + bs + "gamma{-}" + + bs + "beta)/(" + bs + "gamma(1{-}" + bs + "beta))$, so it takes $1/(1{-}p)=" + bs + "gamma(1{-}" + + bs + "beta)/(" + bs + "beta(1{-}" + bs + "gamma))$ successor reads on average and the composed " + "frame offset has mean $" + bs + "gamma/(1{-}" + bs + "gamma)=" + f"{1/(1-gamma):.0f}" + "$ frames " + "for EVERY $" + bs + "beta$ -- that identity is the point of the read-out, and Table~" + bs + + "ref{tab:chainhops} measures both quantities on the flagship cells. The cap is not a " + "hyper-parameter: it is the smallest depth whose truncation tail $p^{" + bs + "mathrm{cap}}$ is " + "at most $10^{-3}$ (last column), and Table~" + bs + "ref{tab:chainhops} reports the measured " + "capped fraction. The retired deterministic fold's per-row $(" + bs + "beta,L)$ and its retained " + "$" + bs + "gamma$-mass $" + bs + "gamma^{L/(1-" + bs + "beta)}$ are in Table~" + bs + + "ref{tab:ablation_betarec}, where $L$ was swept by success rather than set as a truncation " + "guard; the shorthand $L^{*}=(1{-}" + bs + "beta)/(1{-}" + bs + "gamma)$ used there is exact only " + "where $" + bs + "gamma=" + bs + "beta(2{-}" + bs + "beta)$ -- at $" + bs + "gamma=0.99$ that is $" + + bs + "beta=0.90$ -- and overstates elsewhere (5 against the exact 4.21 at $" + bs + "beta=0.95$). " + "$" + bs + "gamma=0.99$ is the discount of EVERY value-estimator number this paper prints (the " + "robomimic default of the RISE critic), so the cross-method comparison is at one horizon. It was " + "not, however, left unswept: an evaluation-only $" + bs + "gamma$ grid was run on the frozen " + "checkpoints for RSM and TD-Flow and Table~" + bs + "ref{tab:sweeps} counts it. None of those arms reaches a table -- the " + "arm key carries $" + bs + "beta$ and the cap but not $" + bs + "gamma$, so the loader identifies " + "an off-$" + bs + "gamma$ arm by the cap its $" + bs + "beta$ implies at the $10^{-3}$ tail " + "($0.90" + bs + "to73$, $0.95" + bs + "to33$, $0.98" + bs + "to11$), excludes it from the chain " + "pool and aborts the build if one is selected anyway. For the chain, $" + bs + "beta$ is swept over the grid " + "training supports and the cap follows from it; the retired fold additionally swept $L$ " + "(" + _grid_note() + ") and chose it by success, with no consistency check, so on its rows with " + "$L `1.0\\times10^{-7}`: a number read out of the audit JSON still has to typeset.""" + m, e = ("%." + str(d) + "e") % x, None + m, e = m.split("e") + return m + chr(92) + "times10^{" + str(int(e)) + "}" + + +def _gamma_fidelity(): + r"""REQUIRED EXPERIMENT item 1 (owner, 2026-09-22 06:10 UTC): "the key is we need to sample beta until + it approximates sampling from gamma." + + Reads status/rsm_gamma_fidelity.json (scripts/tmp/audit_gamma_fidelity.py, CPU node). Returns + (paragraph, table) or ("", "") when the experiment has not been run, so the bundle still builds. + """ + bs, nl = chr(92), chr(10) + try: + F = json.loads(GAMMAFID_JSON.read_text()) + except Exception: + return "", "" + C = F["checks"] + law = {e["beta"]: e for e in C["exact_hop_count_law"]} + ident = {e["beta"]: e for e in C["identity_sampled_N"]} + inf = {e["beta"]: e for e in C.get("fold_infinite_depth", [])} + grid = C["L_grid"] + rr = {e["beta"]: e for e in C["gammah_reranking"]} if C.get("gammah_reranking") else {} + rk = C.get("gammah_reranking") or [] + betas = sorted(law) + + body = [] + for b in betas: + g = [e for e in grid if e["beta"] == b] + for i, e in enumerate(g): + flag = (bs + "textbf{*}") if e["is_flagship_L"] else "" + body.append(" & ".join([ + ("$%g$" % b) if i == 0 else "", + "$%d$%s" % (e["L"], flag), + "%.0f" % (100 * e["retained"]), + "%.1f" % e["fixed_mean"], "%.3f" % e["fixed_ks"], + "%.1f" % e["fold_mean"], "%.3f" % e["fold_ks_with_defect"], + "%.3f" % e["fold_ks_conditional"]]) + " " + bs + bs) + body.append((bs + "cdashline{2-8}" if False else "") + "") + body = [x for x in body if x] + + tab = (nl + bs + "begin{table}[t]" + nl + bs + "centering" + nl + + bs + "caption{" + bs + "textbf{How many $" + bs + "beta$-hops approximate the $" + bs + + "gamma$ horizon?} A geometric number of $" + bs + "mathrm{Geom}(1{-}" + bs + "beta)$ hops is " + "again geometric in the frame domain, so the chain the fold takes an expectation over " + + bs + "emph{is} the $" + bs + "gamma$ horizon; only its truncation at a fixed $L$ is an " + "approximation. $4" + bs + "times10^{5}$ chains of the deployed sampler " + "(" + bs + "texttt{data.py:11-23}) per cell. " + + bs + "textsc{keep}: the fraction of the $" + bs + "gamma$ mass a depth-$L$ fold retains, " + "$1-" + bs + "gamma^{L/(1-" + bs + "beta)}$ (one minus the tail of Table~" + bs + + "ref{tab:discounts}). " + bs + "textsc{fixed}: exactly $L$ hops. " + bs + "textsc{fold}: the " + "fold's own mixture -- continue after each hop with probability $" + bs + "gamma^{h}$, truncated " + "at $L$; chains still alive at $L$ are dropped and that defect enters $" + bs + "mathrm{KS}$ " + "(the last column conditions on stopping instead). Both are compared against the target $" + + bs + "mathrm{Geom}(1{-}" + bs + "gamma)$, mean $99$ frames. $^{*}$ marks a flagship $L$.}" + nl + + bs + "label{tab:auditgamma}" + nl + bs + "scriptsize" + nl + + bs + "setlength{" + bs + "tabcolsep}{5pt}" + nl + + bs + "begin{tabular}{cc|c|cc|ccc}" + nl + bs + "toprule" + nl + + "& & keep & " + bs + "multicolumn{2}{c|}{fixed $L$} & " + + bs + "multicolumn{3}{c}{fold truncated at $L$} " + bs + bs + nl + + bs + "cmidrule(lr){4-5} " + bs + "cmidrule(lr){6-8}" + nl + + "$" + bs + "beta$ & $L$ & \\% & mean & KS & mean & KS & KS$|$kept " + bs + bs + nl + + bs + "midrule" + nl + nl.join(body) + nl + bs + "bottomrule" + nl + + bs + "end{tabular}" + nl + bs + "end{table}" + nl) + + # the paragraph + txt = [] + for b in betas: + e, it = law[b], ident[b] + txt.append("at $" + bs + "beta=%g$ the exact hop count is $N" % b + bs + "sim" + bs + + "mathrm{Geom}(%.3f)$, i.e.\\ $L^{*}=%.1f$ hops on average" % (e["r_exact_k0"], e["L_star_k0"])) + flagship_keep = sorted({(e["beta"], e["L"], e["retained"]) for e in grid if e["is_flagship_L"]}) + keep_txt = "; ".join("$" + bs + "beta=%g$, $L=%d$: %.0f\\%%" % (b, L, 100 * r) for b, L, r in flagship_keep) + ks_id = max(e["ks_vs_geom_gamma"] for e in ident.values()) + ks_inf = max(e["ks"] for e in inf.values()) if inf else 0.0 + n_same = sum(1 for e in rk if e["argmax_same"]) + # CORRECTED 2026-09-22 (gen_q#267). The paragraph this replaces said "the fold is the expectation + # over exactly that chain -- continuation probability gamma^h per hop -- so the estimator is right and + # the only error is the truncation". Both halves are wrong: the continuation that inverts the + # composition is p = (gamma-beta)/(gamma(1-beta)) (ogbench_genq/rsm.py:113), not gamma^h, and folding + # c_k + (1-c_k) G q_{k+1} is an absorbing hitting probability, a different functional from the + # discounted occupancy read the method claims. It also crashed the build: the whole concatenation was + # %-formatted at the end while `keep_txt` had already inserted a literal "\%", so a "%;" reached the + # formatter ("unsupported format character ';'"). Pieces are formatted individually here. + _ch = _chain_horizon() + par = (bs + "textbf{Does a $" + bs + "beta$-chain reproduce the $" + bs + "gamma$ horizon? Exactly, " + "with the reference's continuation coin -- and the read-out this paper previously reported was " + "not that chain.} " + "A $" + bs + "mathrm{Geom}$-distributed number of $" + bs + "mathrm{Geom}(1{-}" + bs + + "beta)$ hops is $" + bs + "mathrm{Geom}$ in the frame domain, so a chain whose " + + bs + "emph{length} is drawn geometrically reproduces the $" + bs + "gamma$ horizon: " + + ", ".join(txt) + ". Composing $N{+}1$ occupancy draws with $N" + bs + "sim" + bs + + "mathrm{Geom}(1{-}p)$ gives a frame offset that is geometric with ratio " + "$" + bs + "beta/(1-p(1-" + bs + "beta))$, so the offset is $" + bs + "mathrm{Geom}(1{-}" + + bs + "gamma)$ for exactly one continuation probability, " + "$p = (" + bs + "gamma-" + bs + "beta)/(" + bs + "gamma(1-" + bs + "beta))$ " + "(" + bs + "texttt{ogbench" + bs + "_genq/rsm.py:113}); the composition is then an identity, " + "not an approximation" + _ch + ". " + "The read-out this paper reported until now is a different estimator: it folded a " + + bs + "emph{fixed} $L$ hops as $q_k = c_k + (1-c_k)" + bs + "gamma^{h} q_{k+1}$, which is an " + "absorbing hitting probability over a truncated horizon rather than the $" + bs + "gamma$-" + "discounted occupancy, and it retains only $1-" + bs + "gamma^{L/(1-" + bs + "beta)}$ of the " + "mass: " + keep_txt + " (Table~" + bs + "ref{tab:flagship_fold}). On real scored states the two " + "disagree enough to reorder candidates (Spearman $0.861$ on the logit at $" + bs + "beta=0.95$, " + "arg-max differing at $1$ of $4$ frames), which is why every flagship row was re-scored with the " + "chain. Taking $" + bs + "gamma^{h}$ as the coin instead -- the natural guess -- is a second, " + "different error: through the same test it composes to a mean offset of $124.2$ frames against " + "the nominal $99$ at $" + bs + "beta=0.98$, a $25" + bs + "%$ horizon overshoot.") + return par, tab + + +def _chain_horizon(): + """One sentence of measured evidence from status/chain/horizon_test.json (the coin-chain horizon test, + 2e6 sampled walks per beta), or "" if it has not been run. Numbers, not adjectives: a claim that the + composition is exact has to be checkable against a file.""" + bs = chr(92) + try: + H = json.loads((ROOT / "status" / "chain" / "horizon_test.json").read_text()) + except Exception: + return "" + R = H["rows"] + pgf = max(r["pgf_max_abs_err"] for r in R) + ks = max(r["mc"]["capped"]["ks"] for r in R) + mn = [r["mc"]["capped"]["offset_mean"] for r in R] + cf = max(r["mc"]["capped"]["capped_frac"] for r in R) + caps = ", ".join("$%g" % r["beta"] + bs + "to%d$" % r["cap"] for r in R) + return (". Measured on {:,} sampled walks per $".format(H["n_samples"]) + bs + "beta$: the " + "generating-function identity holds to $%.1e$, and the sampled offsets match $" % pgf + + bs + "mathrm{Geom}(1{-}" + bs + "gamma)$ with $" + bs + "mathrm{KS}" + bs + + "le %.5f$ (mean $%.2f$--$%.2f$ frames against $99$), at caps set by the $10^{-3}$ " + "truncation tail (%s) that bind on $%.1e$ of walks" + % (ks, min(mn), max(mn), caps, cf)) + + +def _honest_depth(): + r"""REQUIRED EXPERIMENT item 2: the flagship rows re-scored at honest depth (same proposer, same 128 + candidates, same eval-seed grid; only plan_depth moves). Reads status/rsm_honest_depth.json, which + scripts/tmp/collect_honest_depth.py writes from the cells under runs//eval_honest/.""" + bs, nl = chr(92), chr(10) + try: + H = json.loads(HONEST_JSON.read_text()) + except Exception: + return "", "" + rows = [r for r in H.get("rows", []) if r.get("cells")] + if not rows: + return "", "" + body, moved, partial = [], [], [] + for r in rows: + cs = sorted(r["cells"], key=lambda c: c["L"]) + # A line whose grid is still filling must SAY SO in the table: the honest-depth cells are ~5 h + # each, so a row can be published with fewer cells than its own other line. Data-driven -- the + # dagger appears only while c["n_cells"] is short of the row's own maximum. + full = max(c.get("n_cells") or 0 for c in cs) + first = True + for c in cs: + tag = "" + if c["L"] == r["L_flag"]: + tag = " (flagship)" + deepest = (c["L"] == max(x["L"] for x in cs)) + pv = r.get("deep_vs_flagship_p") + pcell = "" + if deepest and pv is not None: + pcell = ("$<$0.001" if pv < 1e-3 else "$%.3f$" % pv) + if pv < 0.05: + pcell = bs + "textbf{" + pcell + "}" + body.append(" & ".join([ + (r["row"] + ("" if not r.get("proposer") else "")) if first else "", + ("$%g$" % r["beta"]) if first else "", + "$%d$%s" % (c["L"], tag), + "%.0f" % (100 * c["retained"]), + "$%.1f$" % (100 * c["success"]), + "$%d$%s" % (c["n"], (bs + "dag") if (c.get("n_cells") or 0) < full else ""), + ("$%.1f$" % (100 * r["flagship_success"])) if first else "", + pcell]) + " " + bs + bs) + if (c.get("n_cells") or 0) < full: + partial.append((r["row"], c["L"], c["n_cells"], full, c["n"])) + first = False + if r.get("survives") is False: + moved.append(r["row"]) + tab = (nl + bs + "begin{table}[t]" + nl + bs + "centering" + nl + + bs + "caption{" + bs + "textbf{The flagship rows re-scored at honest depth.} Same RSM " + "checkpoint, same proposer, same $128$ candidates per step, same evaluation-seed grid; the " + "only thing that moves is the fold's depth $L$. " + bs + "textsc{keep} is the fraction of the " + "$" + bs + "gamma$ mass that depth retains (Table~" + bs + "ref{tab:auditgamma}); the honest " + # NOT a %-format string: a literal double percent makes TeX comment out the rest of the + # caption line and the build dies with "File ended while scanning use of \@xdblarg". + "depth is the $L$ whose dropped tail is $5" + bs + "%$ ($30$ at $" + bs + "beta{=}0.9$, $15$ " + "at $0.95$). Success is over the episodes listed. The flagship column is MATCHED: it pools only " + "the flagship cells whose (policy seed, evaluation seed) pairs the row's DEEPEST line actually " + "re-scored, so a partial grid cannot flatter either side; $p$ is a two-proportion test of " + "that line against it. All lines use the retired fold read-out, which is the estimator whose truncation " + "this test is about.}" + nl + + bs + "label{tab:audithonest}" + nl + bs + "scriptsize" + nl + + bs + "setlength{" + bs + "tabcolsep}{5pt}" + nl + + bs + "begin{tabular}{lcc|c|cc|cc}" + nl + bs + "toprule" + nl + + "Row & $" + bs + "beta$ & $L$ & keep \\% & success \\% & $n$ & flagship \\% & $p$ " + bs + bs + nl + + bs + "midrule" + nl + nl.join(body) + nl + bs + "bottomrule" + nl + + bs + "end{tabular}" + nl + bs + "end{table}" + nl) + partial_note = "" + if partial: + partial_note = (" " + bs + "dag: a line whose grid is still filling -- " + + "; ".join("%s at $L{=}%d$ pools $%d$ of $%d$ cells ($%d$ episodes)" + % (w, L, nc, fl, n) for (w, L, nc, fl, n) in partial) + ".") + par = (bs + "textbf{The rows at honest depth.} " + (H.get("summary") or "") + partial_note + + " These cells were scored with the retired fold, deliberately: the question they answer is " + "whether the flagship numbers were an artefact of truncating that fold at a small $L$, which " + "can only be asked by moving $L$ and nothing else. They point the same way as the read-out " + "correction above -- the rows that were run at the shallowest depth are the ones that lose " + "the most when the depth is made honest.").strip() + return par, tab + + +def _honest_diag(): + r"""Why the deep fold chooses worse -- the planner's OWN diagnostics, per row and per depth. + + Audit run 4 (2026-09-23) GUESSED in a #267 comment that Pc-S collapses at $L{=}30$ because the deep + fold saturates and the arg-max loses discrimination, then measured the cells' `planner_time` and found + the opposite. The retraction lived only in that comment; this puts the numbers in the paper. Reads + status/rsm_honest_diag.json (scripts/tmp/audit_honest_diag.py, a CPU job) -- decision-count-weighted + pools of each cell's own planner_time, the flagship line from the row's flagship cells and the deeper + lines from runs//audit_honest/. Returns ("", "") when the JSON is absent so the bundle builds. + """ + bs, nl = chr(92), chr(10) + try: + D = json.loads((ROOT / "status" / "rsm_honest_diag.json").read_text()) + except Exception: + return "", "" + try: + H = json.loads(HONEST_JSON.read_text()) + succ = {r["row"]: dict(flag=r.get("flagship_success"), + deep={c["L"]: c["success"] for c in (r.get("cells") or [])}) + for r in H.get("rows", [])} + except Exception: + succ = {} + body, n_tie, n_sat = [], 0, 0 + n_tie_dn = n_sat_dn = n_exact_rows = 0 + for r in D.get("rows", []): + lines = [l for l in (r.get("lines") or []) if (l.get("stats") or {}).get("gap_chosen_minus_mean") is not None] + if len(lines) < 2: + continue + a, b = lines[0], lines[-1] # flagship depth and the deepest measured depth + sa, sb = a["stats"], b["stats"] + arrow = " $" + bs + "to$ " + + def pair(ka, kb, fmt, scale=1.0): + return ("$" + (fmt % (scale * ka)) + "$" + arrow + "$" + (fmt % (scale * kb)) + "$") + + sr = succ.get(r["row"]) or {} + # a is the flagship depth: its success is the MATCHED flagship control, which is what + # tab:audithonest compares against; b is an audited depth, so it comes from cells[]. + s_a, s_b = sr.get("flag"), (sr.get("deep") or {}).get(b["L"]) + scell = (pair(s_a, s_b, "%.1f", 100.0) if (s_a is not None and s_b is not None) else "--") + # `ties_at_max` is a NEAR-tie: within 1e-6 of the max of the ranking array (rsm_planner.py:473), + # about 8 float32 ulps at a probability near 1. On Sq-S that tolerance reports 64.7 tied + # candidates while only 3.7 are bit-identical, so the degeneracy claim must be counted from the + # EXACT count (rsm_planner.py:484) or it is a claim about the tolerance. That column is absent + # from the cells written before gen_q#266 added it, hence the per-line availability check. + ex = None + for l in lines: + v = (l.get("stats") or {}).get("prob_ties_at_max_exact_mean") + if v is not None: + ex = v if ex is None else max(ex, v) + if ex is not None and ex >= 128 / 4.0: + n_tie += 1 + if ex is not None: + n_exact_rows += 1 + if sa["frac_saturated_mean"] is not None and sa["frac_saturated_mean"] > 0.25: + n_sat += 1 + # The degeneracy defence needs ties/saturation to RISE with depth. Count, do not assert: + # Mug's saturation does creep up (46.4 -> 47.3), so "falls on every row" would be false. + # 1% relative tolerance, because Pc-S's tie count goes 1.000000 -> 1.000101 (one decision in + # ten thousand ties at L=30) and calling that a RISE would be a nonsense reading of the data. + tol = 1.01 + if sb["ties_at_max_mean"] <= sa["ties_at_max_mean"] * tol + 1e-9: + n_tie_dn += 1 + if sb["frac_saturated_mean"] <= sa["frac_saturated_mean"] * tol + 1e-9: + n_sat_dn += 1 + body.append(" & ".join([ + r["row"], bs + "texttt{" + str(r.get("plan_score") or "?") + "}", + "$%d$" % a["L"] + arrow + "$%d$" % b["L"], + pair(sa["gap_chosen_minus_mean"], sb["gap_chosen_minus_mean"], "%.2f"), + pair(sa["ties_at_max_mean"], sb["ties_at_max_mean"], "%.1f"), + (pair(sa["prob_ties_at_max_exact_mean"], sb["prob_ties_at_max_exact_mean"], "%.1f") + if (sa["prob_ties_at_max_exact_mean"] is not None + and sb["prob_ties_at_max_exact_mean"] is not None) + else (("--" + arrow + "$%.1f$" % sb["prob_ties_at_max_exact_mean"]) + if sb["prob_ties_at_max_exact_mean"] is not None else "--")), + pair(sa["frac_saturated_mean"], sb["frac_saturated_mean"], "%.1f", 100.0), + scell]) + " " + bs + bs) + if not body: + return "", "" + tab = (nl + bs + "begin{table}[t]" + nl + bs + "centering" + nl + + bs + "caption{" + bs + "textbf{Why the deeper fold does not win: the planner's own " + "diagnostics.} Decision-count-weighted pools of the cells' " + bs + "texttt{planner" + bs + "_time}, " + "at each row's flagship depth and at its deepest audited depth (the same cells as " + "Table~" + bs + "ref{tab:audithonest}). " + bs + "textsc{gap} is the chosen candidate's score " + "minus the mean over the $128$ candidates, " + bs + "textsc{ties}$_{1e{-}6}$ the number of candidates " + "within $10^{-6}$ of the max of the ranking array (about $8$ float32 ulps at a probability " + "near $1$) and " + bs + "textsc{ties}$_{=}$ the BIT-EXACT count on the probability array, " + "which is the one the degeneracy claim is made from -- on Sq-S the tolerance reports $64.7$ " + "tied candidates where only $3.7$ are identical. " + bs + "textsc{ties}$_{=}$ is absent from " + "cells written before it was logged (gen\\_q\\#266). " + bs + "textsc{sat} is the fraction " + "of scored candidates at a saturated value. A degeneracy story would need ties and saturation to RISE with depth; instead ties do not " + # the literal escaped percent MUST stay out of the %-formatted string: "\%)" inside one is + # an invalid format character, and "\%%" inside one comments out the rest of the caption. + + "rise (to within $1$" + bs + "%) on " + + ("$%d$ of the $%d$ rows and saturation falls on $%d$ " % (n_tie_dn, len(body), n_sat_dn)) + + "while success does not improve, so the short fold was not winning by being better " + "separated -- it was ranking differently. Where the exact count exists, Mug, Thr and Pc-C carry " + "$35$--$50$ bit-identical candidates at the maximum of $128$ at BOTH depths, i.e. their " + "arg-max is settled largely by the tie-break; " + bs + "texttt{logit} (Pc-S) ranks without " + "ties at all and still collapses.}" + nl + + bs + "label{tab:auditdiag}" + nl + bs + "scriptsize" + nl + + bs + "setlength{" + bs + "tabcolsep}{4pt}" + nl + + bs + "begin{tabular}{llc|cccc|c}" + nl + bs + "toprule" + nl + + "Row & read-out & $L$ & gap & ties$_{1e{-}6}$ & ties$_{=}$ & sat \\% & success \\% " + + bs + bs + nl + + bs + "midrule" + nl + nl.join(body) + nl + bs + "bottomrule" + nl + + bs + "end{tabular}" + nl + bs + "end{table}" + nl) + par = (bs + "textbf{The deep fold is better separated and still chooses worse.} A natural defence of " + "the short truncation is that the deep fold saturates and its arg-max degenerates. The cells' " + "own diagnostics refuse it (Table~" + bs + "ref{tab:auditdiag}): from the flagship depth to the " + "deepest audited depth the tie count does not rise on " + + ("$%d$ of the $%d$ rows and the saturated fraction falls on $%d$, " % (n_tie_dn, len(body), n_sat_dn)) + + "while success falls or is flat too. On Pc-S the chosen-minus-mean gap TRIPLES " + "($5.1" + bs + "to16.2$) and saturation drops from $13.5$ to $2.2$\\%, and that is the row " + "whose success collapses hardest. The short fold was not a better-conditioned estimator; it was " + "a different, shorter-horizon ranking that happened to suit those tasks. " + "A separate defect is visible in the same table, and it is smaller than the $1e{-}6$ tie " + "column makes it look: counted BIT-EXACTLY, " + + ("$%d$ of the $%d$ rows that log it " % (n_tie, n_exact_rows)) + + "have at least a quarter of the $128$ candidates identical at the maximum (Mug, Thr and " + "Pc-C, $35$--$50$ of $128$), and those are the same " + + ("$%d$ " % n_sat) + "rows that saturate more than a quarter of the scored candidates. On " + "those rows the arg-max is settled largely by the tie-break rather than by the value " + "estimate, which is the read-out defect the coin chain of Table~" + bs + "ref{tab:flagship} " + "replaces. On Sq-S and Pc-tip the same tolerance reports $65$ and $97$ near-ties against " + "$3.7$ and $14.5$ exact ones, so their arg-max is NOT degenerate and the near-tie column " + "should not be read as if it were.").strip() + return par, tab + + +def _hop_accounting(rows=None): + r"""HOP ACCOUNTING (owner, 2026-09-22 07:00 UTC): "we should also be logging the number of 'taken' hops, + which should approximately equal E[hops|beta]". This is the cheapest proof that the deployed chain is + the walk the maths describes -- it is measured inside the flagship evaluations themselves, on hundreds + of thousands of real decisions, not in a standalone sampler test. + + Reads status/chain/hop_accounting.json (scripts/collect_chain_hops.py, a CPU job: the cell JSONs are + ~128 KB each and there are hundreds). That collector RECOMPUTES the cap-binding flag from the pooled + capped fraction, because the per-cell flag written before 18:30Z fired whenever any one decision capped + any one particle -- with 16 particles the smallest nonzero per-decision capped fraction is 1/16, which + always exceeds the 1 % aggregate threshold, so every healthy cell was being flagged truncated. + + Returns ("", "") when no chain cell has landed, so the bundle still builds. + """ + bs, nl = chr(92), chr(10) + try: + H = json.loads((ROOT / "status" / "chain" / "hop_accounting.json").read_text()) + except Exception: + return "", "" + R = H.get("rows") or [] + if not R: + return "", "" + # WHICH LINE IS THE FLAGSHIP'S? (2026-09-23). The collector emits one line per (row, beta) over + # every chain cell on disk, and the sweep has landed several betas per task, so the table alone does + # not say which of them tab:flagship's RSM column is actually built from. Mark it, and -- the part + # that matters -- say so when the selected arm has NO line here, which is exactly what a stale + # hop_accounting.json looks like: the audit that proves the read-out is correct would then be + # evidence about arms the flagship does not print. + _sel, _missing = set(), [] + for _r in (rows or []): + _m = re.search(r"\bb([0-9.]+)\s+CH(\d+)\b", + (_r.get("rsm_chain_arm") or "") if _r.get("rsm_chain_rate") is not None else "") + if not _m: + continue + # Owner 2026-09-24: spell the task out in tab:flagship. _ROW_ABBR is still used by the + # narrow tables that genuinely cannot fit a full name; this row is not one of them. + _lab = _r["label"] + # ...WHICH MEANS THIS MATCH MUST NORMALISE (2026-09-24, run 19). hop_accounting.json is keyed by + # the ABBREVIATION (collect_chain_hops.py:22 NICE -> "Sq-S"), so comparing the spelled-out label + # to it matched nothing on all seven rows the moment tab:flagship's labels grew: every star + # disappeared from tab:chainhops and the build printed "hop accounting has no line" for a + # hop_accounting.json that was in fact complete. The star is what tells the reader the audited + # walk is the walk the flagship column was scored with, so losing it silently would leave the + # audit evidence attached to no printed number. Match on the abbreviation, accept either form. + _key = _ROW_ABBR.get(_lab, _lab) + _b = float(_m.group(1)) + if any(x["row"] in (_key, _lab) and abs(x["beta"] - _b) < 1e-9 for x in R): + _sel.add((_key, _b)) + else: + _missing.append("%s ($\\beta=%g$, cap %s)" % (_lab, _b, _m.group(2))) + if _missing: + print("[flagship_latex] hop accounting has no line for the flagship chain arm on: " + + ", ".join(_missing) + " -- re-run scripts/collect_chain_hops.py", file=sys.stderr) + body = [] + for r in R: + flag = (" " + bs + "textbf{!}") if r["cap_binding"] else "" + _star = (bs + ",$" + bs + "star$") if (r["row"], r["beta"]) in _sel else "" + body.append(" & ".join([ + r["row"] + _star, "$%g$" % r["beta"], "$%d$" % r["cap"], + "$%.2f$" % r["E_hops_expected"], "$%.2f$" % r["hops_mean"], + "$%+.1f$" % (100 * r["hops_rel_err"]), + "$%.2f$" % r["hops_mean_expired"], "$%.1f$" % r["hops_p90"], + "$%.1f$" % (100 * r["expired_frac"]), "$%s$%s" % (_sci(r["capped_frac"]), flag), + "$%d$" % r["n_cells"], "{:,}".format(r["decisions"]).replace(",", "{,}")]) + " " + bs + bs) + # THE RIG ROW (owner's hop accounting, applied to the deployment the planner actually ships to). + # Every row above is SIMULATION. The same identity has to hold on the real robot's own inputs -- + # live DINOv2 from the two cameras, the real successor checkpoint, beta 0.96 / gamma 0.995 rather + # than the sim grid -- or the rig is running a different walk from the one the paper analyses. + # Read from status/chain/real_hop_accounting.json, a snapshot of the rsm_real replay artefact + # (SLURM 37221), so the number in the table is the number the rig produced, not a transcription. + # It is kept OUT of the pooled claims below (`worst`, `max_capped_frac`), which are about the + # flagship cells; it gets its own sentence. + try: + real = json.loads((ROOT / "status" / "chain" / "real_hop_accounting.json").read_text()) + except Exception: + real = None + if real: + body.append(bs + "midrule") + body.append(" & ".join([ + "Real (rig)", "$%g$" % real["beta"], "$%d$" % real["cap"], + "$%.2f$" % real["E_hops_expected"], "$%.2f$" % real["hops_mean"], + "$%+.1f$" % (100 * real["hops_rel_err"]), + "$%.2f$" % real["hops_mean_expired"], "$%.1f$" % real["hops_p90"], + "$%.1f$" % (100 * real["expired_frac"]), + "$%s$%s" % (_sci(real["capped_frac"]), (" " + bs + "textbf{!}") if real["cap_binding"] else ""), + "--", "{:,}".format(real["decisions"]).replace(",", "{,}")]) + " " + bs + bs) + + worst = 100 * H["worst_hops_rel_err"] + par = (bs + "textbf{The deployed chain takes the number of hops the law predicts.} Every chain " + "evaluation logs, per decision, how many hops each particle took and why the walk stopped. " + "Pooled over %s decisions in %d cells, the mean number of taken hops matches " + % ("{:,}".format(sum(r["decisions"] for r in R)).replace(",", "{,}"), H["n_cells"]) + + "$" + bs + "mathrm{E}[N]=p/(1-p)$ to within $%.1f" % worst + bs + "%$ on every row " + "(Table~" + bs + "ref{tab:chainhops}), and the caps set by the $10^{-3}$ truncation tail bind " + "on at most $%s$ of walks, so no reported cell is horizon-truncated. " % _sci(H["max_capped_frac"]) + + "The reference chain has no absorbing event -- the membership head is read once at the frozen " + "node rather than being allowed to stop the walk -- so every walk ends by the continuation coin " + "failing or, with the probability in the last column, by the cap; the expired-only mean is " + "reported beside the overall mean and the two coincide for that reason. The composed frame " + "offset is $" + bs + "mathrm{Geom}(1-" + bs + "gamma)$ by the identity above, verified to " + "$" + bs + "mathrm{KS}" + bs + "le 0.0008$ on $2" + bs + "times 10^{6}$ walks per $" + + bs + "beta$; the per-cell evidence for it is this hop count, which is the walk length the " + "same identity fixes." + + ("" if not real else + ((" The last row is the " + bs + "emph{real} rig rather than simulation: the same planner " + "scored a replay episode through the robot's own perception path (live DINOv2 from the two " + "cameras, the real successor checkpoint, $" + bs + "beta=%g$, $" + bs + "gamma=%g$), and the " + "identity holds there too -- %.3f taken hops against $" + bs + "mathrm{E}[N]=%.3f$ " + "($%+.1f" + bs + "%%$) over %d decisions, with the cap reached on $%s$ of walks. That is the " + "evidence that the deployed planner recurses on the inputs it will see, not only on ours.") + % (real["beta"], real["gamma"], real["hops_mean"], real["E_hops_expected"], + 100 * real["hops_rel_err"], real["decisions"], _sci(real["capped_frac"]))))) + tab = (nl + bs + "begin{table}[t]" + nl + bs + "centering" + nl + + bs + "caption{" + bs + "textbf{Hop accounting of the coin-terminated chain, measured inside " + "the flagship evaluations.} $" + bs + "mathrm{E}[N]=p/(1-p)$ with " + "$p=(" + bs + "gamma-" + bs + "beta)/(" + bs + "gamma(1-" + bs + "beta))$ is what the " + "composition-to-$" + bs + "mathrm{Geom}(1-" + bs + "gamma)$ identity fixes; " + bs + "textsc{taken} is " + "the measured mean over all particles of all decisions of every landed chain cell of that row, " + "and " + bs + "textsc{expired} restricts to walks the coin ended rather than the cap. The cap is " + "computed per $" + bs + "beta$ from $p^{L}" + bs + "le 10^{-3}$ and is not a tuned depth. A row " + "whose pooled capped fraction exceeded $10^{-2}$, or whose mean hop count came within $10" + bs + + "%$ of its cap, would be marked " + bs + "textbf{!} and could not be quoted as a chain number; none " + "is. The final row is the real robot (rsm" + bs + "_real replay through the rig's live DINOv2 path, " + "its own $" + bs + "beta$ and $" + bs + "gamma$); it is reported beside the simulated rows but is " + "not pooled into the figures quoted in the text, which are about the flagship cells. " + + bs + "textbf{One line per $(" + bs + "mathrm{row}," + bs + "beta)$ measured}, not one per task: " + "the chain sweep landed several $" + bs + "beta$ per task and all of them are shown. $" + bs + + "star$ marks the $(" + bs + "mathrm{row}," + bs + "beta)$ whose arm Table~" + bs + + "ref{tab:flagship} selects, so the reader can see that the audited walk is the walk the " + "flagship column was scored with" + + ("." if not _missing else + ("; " + bs + "emph{no line is marked for " + ", ".join(_missing) + ", whose hop " + "accounting has not been collected yet -- those flagship entries are therefore NOT " + "covered by this audit.}")) + + "}" + nl + + bs + "label{tab:chainhops}" + nl + bs + "scriptsize" + nl + + bs + "setlength{" + bs + "tabcolsep}{3.5pt}" + nl + + bs + "begin{tabular}{lcc|ccc|cc|cc|cr}" + nl + bs + "toprule" + nl + + "& & & " + bs + "multicolumn{3}{c|}{hops taken} & " + bs + "multicolumn{2}{c|}{shape} & " + + bs + "multicolumn{2}{c|}{why it stopped} & & " + bs + bs + nl + + bs + "cmidrule(lr){4-6} " + bs + "cmidrule(lr){7-8} " + bs + "cmidrule(lr){9-10}" + nl + + "Row & $" + bs + "beta$ & cap & $" + bs + "mathrm{E}[N]$ & taken & $" + bs + "Delta$" + bs + + "% & expired & p90 & coin " + bs + "% & capped & cells & decisions " + bs + bs + nl + + bs + "midrule" + nl + nl.join(body) + nl + bs + "bottomrule" + nl + + bs + "end{tabular}" + nl + bs + "end{table}" + nl) + return par, tab + + +def _tdflow_chain_verify(): + r"""The owner's fairness sanity check (2026-09-22 06:45Z): the chain-vs-fold comparison must be printed + for TD-Flow as well as for RSM, because the two methods SHARE the read-out. If the retired fold damaged + TD-Flow's ranking more than RSM's -- which it does -- then a RSM-chain vs TD-Flow-fold table would have + measured the read-out rather than the value estimator, and in TD-Flow's disfavour. + + Generated from status/chain/verify_{mug_expert_suboptimal,tdflow_mug}_b0.95.json (the two GPU verify + jobs), so the numbers cannot drift from the files that produced them. Returns "" if either is missing. + """ + bs = chr(92) + out = {} + for key, fn_ in (("RSM", "verify_mug_expert_suboptimal_b0.95.json"), + ("TDF", "verify_tdflow_mug_b0.95.json")): + try: + d = json.loads((ROOT / "status" / "chain" / fn_).read_text()) + except Exception: + return "" + R = d.get("rows") or [] + if not R: + return "" + rb = [r["chain_vs_rb"] for r in R] + cf = [r["chain_vs_fold"] for r in R] + sp = [c["spearman_logit"] for c in cf + if isinstance(c.get("spearman_logit"), float) and c["spearman_logit"] == c["spearman_logit"]] + if not sp: + return "" + out[key] = dict( + beta=d["beta"], cap=d["cap"], npart=d["n_particles"], reps=d["reps"], nframe=len(R), + worst_sigma=max(x["max_dev_in_MC_sigmas"] for x in rb), + frac3=min(x["frac_within_3_sigma"] for x in rb), + ratio_lo=min(c["ratio_fold_over_chain"] for c in cf), + ratio_hi=max(c["ratio_fold_over_chain"] for c in cf), + sp_lo=min(sp), sp_hi=max(sp), + amdiff=sum(0 if c.get("same_argmax_logit") else 1 for c in cf), + ) + r_, t_ = out["RSM"], out["TDF"] + pc = bs + chr(37) # a literal per-cent sign in LaTeX + sig = bs + "sigma$" # closes the math group opened by the number before it + m = "$" + bs + "beta=%g$, cap $%d$, $%d$ particles, $%d$ independent coin draws per state" % ( + t_["beta"], t_["cap"], t_["npart"], t_["reps"]) + parts = [ + bs + "textbf{The same check on TD-Flow, and why both methods had to be re-scored.} ", + "TD-Flow shares RSM's read-out, so the correction is only fair if it is applied to both. ", + "On the same $%d$ states of the same row (" % t_["nframe"], m, "), the chain is a correct sampler ", + "of its own exact form for TD-Flow too: $%.0f" % (100 * t_["frac3"]), pc, + "$ of candidate scores fall within $3" + bs + "sigma$ of the Rao-Blackwellised value ", + "(worst deviation $%.2f" % t_["worst_sigma"], sig, "), against $%.0f" % (100 * r_["frac3"]), pc, + "$ and $%.2f" % r_["worst_sigma"], sig, " for RSM. ", + "But the retired fold distorts TD-Flow considerably more: the fold-over-chain mean ratio is ", + "$%.1f$--$%.1f$ for TD-Flow against $%.2f$--$%.2f$ for RSM, " % ( + t_["ratio_lo"], t_["ratio_hi"], r_["ratio_lo"], r_["ratio_hi"]), + "and the rank correlation between the two read-outs on the logit falls to $%.2f$ at one state " % ( + t_["sp_lo"],), + "(RSM's worst is $%.2f$), with the arg-max differing at $%d$ of $%d$ states. " % ( + r_["sp_lo"], t_["amdiff"], t_["nframe"]), + "A negative rank correlation means the retired read-out ordered TD-Flow's candidates close to ", + "backwards at that state. Comparing RSM under the corrected chain against TD-Flow under the fold ", + "would therefore have measured the read-out, not the value estimator, and would have been biased ", + "against TD-Flow by more than against RSM; both columns of Table~" + bs + "ref{tab:flagship} are ", + "re-scored with the identical chain, and both retired fold columns are kept side by side in ", + "Table~" + bs + "ref{tab:flagship_fold}.", + ] + return "".join(parts) + + +def _chain_vs_fold_verdict(rows): + r"""OWNER, 2026-09-22 06:20Z item 5: "If the corrected numbers CHANGE a flagship conclusion, say so in + the first sentence of the section ... Do not quietly keep the better of the two." + + So this is GENERATED from the two selections the tables themselves print -- r["rsm_chain"] (the coin + chain, tab:flagship) and r["afold"]["rsm:membership"] (the retired fold, tab:flagship_fold) -- rather + than written by hand, and it names the rows where the correction flips who wins the row, in whichever + direction it flips. Returns "" before any chain cell has landed. + """ + bs = chr(92) + if not rows: + return "" + recs = [] + for r in rows: + ch = _num(r.get("rsm_chain") or "--") + fv = (r.get("afold") or {}).get("rsm:membership") + fo = fv[0] if fv else None + if ch is None or fo is None: + continue + # every non-RSM column of tab:flagship, so "who wins the row" is asked of the same numbers the + # table prints rather than of a different selection + comp = [_num(_unbold(x)) for x in r["base"]] + comp += [_num(_unbold(v)) for v in (r.get("axs") or {}).values()] + comp += [_num(_unbold(r.get("aq") or "--"))] + comp = [v for v in comp if v is not None] + recs.append((r["label"], ch, fo, max(comp) if comp else None)) + if not recs: + return "" + moved = sorted((x for x in recs if abs(x[1] - x[2]) >= 3.0), key=lambda x: x[1] - x[2]) + # STRICT ">": on Mug the fold read exactly the best of the other columns (20.0 = 20.0), and a ">=" + # test would have reported that tie as a conclusion the chain reverses. Only a strict crossing + # counts as a flip. + flips = [x for x in recs if x[3] is not None and ((x[2] > x[3]) != (x[1] > x[3]))] + mch = sum(x[1] for x in recs) / len(recs) + mfo = sum(x[2] for x in recs) / len(recs) + parts = [bs + "textbf{The correction changes the numbers, and on some rows it changes the " + "conclusion.} "] + parts.append("Across the %d rows re-scored so far the RSM column moves from a mean of $%.1f$ under " + "the retired fold to $%.1f$ under the coin chain" % (len(recs), mfo, mch)) + if moved: + parts.append(", with per-row shifts of " + + ", ".join("$%+.1f$ on %s" % (x[1] - x[2], x[0]) for x in moved)) + parts.append(". ") + if flips: + # the comparator columns have themselves gained seeds since the fold numbers were taken, so a flip + # is "fold-vs-today's-comparators" against "chain-vs-today's-comparators" -- say so rather than + # letting it read as a pure read-out effect + parts.append("Against the comparator columns as they stand today (they have gained seeds since " + "the fold numbers were taken), the change is decisive on " + + ", ".join(x[0] for x in flips) + ": ") + parts.append("; ".join( + "%s %s the best of the other columns ($%.1f$) with the chain at $%.1f$ where the fold read " + "$%.1f$" % (x[0], "now beats" if x[1] > x[3] else "no longer beats", x[3], x[1], x[2]) + for x in flips)) + parts.append(". ") + else: + parts.append("No row changes which column wins it. ") + # THE SEARCH BUDGETS ARE CONVERGING, so the winner's-curse share of the drop shrinks (2026-09-23). + # Part of the chain-minus-fold gap is that the fold column is a maximum over a LARGER disclosed + # search, and a maximum over more arms is biased up; that argument is only as strong as the ratio of + # the two search sizes, which has been moving all day as chain cells land (the per-row chain search + # grew from 4 arms to {nchain} while this section was being written). COMPUTED from the same row + # records the tables select over, so the claim cannot go stale the way a typed "four arms" did. + _nch = sorted(r.get("nchain", 0) for r in rows) + _nfo = sorted(r.get("nfold", 0) for r in rows) + _nch = [x for x in _nch if x] + _nfo = [x for x in _nfo if x] + if _nch and _nfo: + _rng = lambda v: ("%d" % v[0]) if v[0] == v[-1] else ("%d--%d" % (v[0], v[-1])) + parts.append("Part of the gap is not the read-out at all: the fold column is a maximum over a " + "larger disclosed search, and a maximum over more configurations is biased upward. " + "That share is shrinking as the chain cells land --- the per-row search is now " + + _rng(_nch) + " chain arms against " + _rng(_nfo) + " fold arms, where the chain " + "column began at four --- so the two budgets are converging and the winner's-curse " + "explanation for the drop weakens accordingly; what remains is the different " + "truncated functional. ") + parts.append("Both read-outs are printed -- the chain in Table~" + bs + "ref{tab:flagship}, the fold " + "in Table~" + bs + "ref{tab:flagship_fold} -- so the correction is visible rather than " + "resolved in favour of whichever number is larger.") + return "".join(parts) + + +# --------------------------------------------------------------------------------------------------- +# AUDIT CITATIONS MUST NOT ROT. The audit's evidence column cites file:line in the scorer and the +# planner, and those two files are edited by the chain work: between the 2026-09-22 audit and +# 2026-09-23 09:58 rsm_scorer.py moved every fold line by ~25 (the c_k line went 441 -> 463). A cited +# line number that no longer points at the cited code is a false citation, so resolve the anchors at +# GENERATION time and print `??` loudly if an anchor ever disappears. +_SRC = {"scorer": ROOT / "code/rise_robomimic/robomimic/algo/rsm_scorer.py", + "planner": ROOT / "code/rise_robomimic/robomimic/algo/rsm_planner.py"} + + +def _srcline(which, anchor, occurrence=1): + """1-based line number of the `occurrence`-th line containing `anchor`, or None.""" + try: + seen = 0 + for i, ln in enumerate(_SRC[which].read_text().splitlines(), 1): + if anchor in ln: + seen += 1 + if seen == occurrence: + return i + except Exception: + pass + return None + + +def _cite(which, anchor, occurrence=1): + n = _srcline(which, anchor, occurrence) + f = "rsm\\_scorer.py" if which == "scorer" else "rsm\\_planner.py" + return "\\texttt{%s:%s}" % (f, n if n is not None else "??") + + +def _citeline(which, anchor, occurrence=1): + n = _srcline(which, anchor, occurrence) + return "\\texttt{:%s}" % (n if n is not None else "??") + + +def _audit_section(rows=None): + r"""The 2026-09-22 fairness audit of the RSM value estimate, as a subsection + two tables. + + OWNER'S QUESTION (2026-09-22 06:00 UTC, the \TODO in tab:flagship's caption): "double check that our + flagship rsm is fair i.e. *not* using return based reward and proper beta recursion." + + EVERY NUMBER HERE IS READ FROM status/rsm_audit.json, which scripts/tmp/audit_rsm_value{,2,3}.py + produce on a CPU node. Nothing is typed in: a verdict in the paper is then, by construction, the + verdict the audit script actually reached on the checkpoints and cells that produced + Table~\ref{tab:flagship}, and a re-run of the audit updates the paper rather than contradicting it. + Returns "" when the audit has not been run, so the table bundle still builds. + """ + bs, nl = chr(92), chr(10) + _lead = _chain_vs_fold_verdict(rows) + try: + A = json.loads(AUDIT_JSON.read_text())["checks"] + except Exception: + return "" + try: + S = json.loads(AUDIT_SIMREW_JSON.read_text()) + except Exception: + S = {} + + cp = A["cell_provenance"] + n_cells = sum(c["n_cells"] for c in cp) + n_eps = sum(c["n_episodes"] for c in cp) + cells_agree = all(c["agrees"] for c in cp) + rl = A["reward_label"] + n_rsm_ck = len({r["ckpt"] for r in rl if r["label"].startswith("RSM")}) + n_td_ck = len({r["ckpt"] for r in rl if r["label"].startswith("TDF")}) + all_memb = bool(A["reward_label_all_membership"]) + lc = A.get("label_constant_per_episode", []) + lc_eps = sum(e["n_ep"] for e in lc) + lc_bad = sum(e["episodes_with_varying_label"] for e in lc) + lc_prov = all(e["label_equals_ep_success"] for e in lc) + s_eps = sum(e["n_ep"] for e in S.values()) + s_bad = sum(e["n_episodes_with_varying_reward"] for e in S.values()) + # one hop: the two conventions agree to this KS once the one-frame offset is taken out, away from + # episode ends (>= 100 frames remaining); at 20 frames remaining the truncation dominates. + oh = A["one_hop"] + ks_far = max(e["ks_ours_vs_ref_shifted"] for e in oh if e["remaining"] >= 100) + ks_20 = max(e["ks_ours_vs_ref_shifted"] for e in oh if e["remaining"] == 20) + sup = A["one_hop_support"] + cn = A["composition_negbin"] + ks_nb = max(e["ks"] for e in cn) + cr = A.get("composition_real_episodes", []) + worst = max(cr, key=lambda e: e["rel_shortfall"]) if cr else None + fo = A["fold"] + fold_max = max(e["max_abs_diff_vs_code_Q"] for e in fo) + fold_qL = all(e["code_qL_is_zero"] for e in fo) + fx = (A.get("fold_example") or [None])[0] + hs = A.get("hop_length_convention_sensitivity") or {} + tl = A["tails"] + n_alarm = sum(1 for e in tl if e["alarm_fires"]) + + # ---- the one-sentence verdict the owner asked for, and the two REQUIRED-EXPERIMENT blocks --------- + gam_par, gam_tab = _gamma_fidelity() + hon_par, hon_tab = _honest_depth() + dia_par, dia_tab = _honest_diag() + verdict = "" + try: + Fg = json.loads(GAMMAFID_JSON.read_text())["checks"] + keep = sorted({(e["beta"], e["L"], e["retained"]) for e in Fg["L_grid"] if e["is_flagship_L"]}) + kt = ", ".join("%.0f\\%% at $\\beta{=}%g$, $L{=}%d$" % (100 * r, b, L) for b, L, r in keep) + try: + Hh = json.loads(HONEST_JSON.read_text()) + _c = (Hh.get("verdict_clause") or "").strip() + # the clause follows a full stop, so it opens a sentence + tail_txt = (" " + _c[0].upper() + _c[1:]) if _c else "" + except Exception: + tail_txt = " The re-score at honest depth is in progress." + verdict = (bs + "emph{Verdict}: the reward is the per-frame provenance label and never a return, " + "and that half of the audit stands. The recursion half does not. A chain of $" + + bs + "mathrm{Geom}(1{-}" + bs + "beta)$ hops whose " + + bs + "emph{length} is itself geometric composes to $" + + bs + "mathrm{Geom}(1{-}" + bs + "gamma)$ in the frame domain exactly, but the " + "read-out the flagship reported was not that chain: it folded a FIXED $L$ hops with " + "$q_L{=}0$, which is an absorbing hitting probability over a truncated horizon rather " + "than the $" + bs + "gamma$-discounted occupancy, and it therefore retains only part " + "of the mass (" + kt + "). The corrected read-out is the coin-terminated chain of " + "Table~" + bs + "ref{tab:flagship}; these fold numbers are kept in Table~" + + bs + "ref{tab:flagship_fold}." + tail_txt) + except Exception: + verdict = "" + + def _v(ok, word="PASS"): + return (bs + "textbf{" + word + "}") if ok else (bs + "textbf{FAIL}") + + # ---- the verdict table ------------------------------------------------------------------------- + checks = [ + ("R1", "The per-frame label is the episode's data provenance, not a return", + _v(lc_bad == 0 and lc_prov and s_bad == 0), + "\\texttt{data.py:207-212} writes $r{=}1$ on every frame of an expert episode, $0$ otherwise; " + "the label varies within $0/%d$ cache episodes and equals the provenance flag on all of them; " + "the source \\textsc{hdf5} \\texttt{rewards} vary within $0/%d$ episodes (values $\\{0,1\\}$)" + % (lc_eps, s_eps)), + ("R2", "The reward head regresses the label at the \\emph{current} frame", + _v(True), + "\\texttt{train\\_rsm.py:723-747} feeds the head $z(x_t)$ and takes \\texttt{b[\"r\\_now\"]} as its " + "only target; " + "\\texttt{data.py:361} sets \\texttt{r\\_now\\,=\\,self.r[t]}, the label at the anchor frame. " + "\\texttt{r\\_fut}/\\texttt{succ} enter diagnostics only (\\texttt{train\\_rsm.py:973})"), + ("R3", "No flagship checkpoint uses a discounted or time-to-goal label", + _v(all_memb), + "all %d RSM and %d TD-Flow checkpoints the cells loaded record " + "\\texttt{reward\\_mode=dense}, \\texttt{reward\\_npy=None}, an empty \\texttt{subgoal\\_dir}; " + "the future-derived modes \\texttt{soft} ($\\gamma_s^{\\,k}$ with $k$ the frames to success, " + "\\texttt{data.py:213-218}), \\texttt{terminal} and \\texttt{subgoal} exist but are unused here" + % (n_rsm_ck, n_td_ck)), + ("R4", "TD-Flow sees the identical label (like-for-like)", + _v(all_memb), + "the reward head and its loss are shared; \\texttt{--occupancy-target td} " + "(\\texttt{train\\_rsm.py:102-128,309}) changes only the \\emph{successor} target"), + ("R5", "Nothing from the environment enters the score at evaluation time", + _v(True), + _cite("planner", "def plan_get_action(self") + " passes only the current observation and the " + "128 candidate chunks; \\texttt{RSMScorer.score(state,\\,A)} (" + + _cite("scorer", "def score(self, state, A") + ") takes no reward, " + "success or return argument; $c_k=\\sigma(R(z_k)/T)$ is the head on a \\emph{sampled} future " + "state (" + _cite("scorer", "cs.append(torch.sigmoid(lg / T))") + ")"), + ("B1", "One hop is $k\\sim\\mathrm{Geom}(1{-}\\beta)$ over future frames of the \\emph{same} episode", + _v(bool(sup["stays_in_episode"])), + "\\texttt{data.py:11-23}: the geometric is renormalised to the frames remaining " + "($1-\\beta^{R}$) and clipped to $[0,R{-}1]$, so every target is a real logged frame; measured " + "support $[%d,%d]$ on a $300$-frame remainder" % (sup["min"], sup["max"])), + ("B2", "Our convention vs.\\ \\textsc{port-ocbench-unified}'s", + bs + "textbf{NOTE}", + "ours admits $k{=}0$, the reference starts at $k{=}1$ and puts the tail on the terminal frame, " + "so our mean hop is $\\beta/(1{-}\\beta)=h{-}1$ frames, not $h$. After the one-frame shift the " + "two agree to $\\mathrm{KS}\\le %.4f$ with $\\ge 100$ frames left (%.3f at $20$). Re-ranking the " + "$12$ real scored states with $\\gamma^{h-1}$ moves the arg-max on $%d$ of them " + "(Spearman $\\ge %.3f$): no effect on Table~\\ref{tab:flagship}" + % (ks_far, ks_20, hs.get("argmax_moved", 0), hs.get("min_spearman", 1.0))), + ("B3", "$L$ composed hops are $\\mathrm{NegBin}(L,1{-}\\beta)$ in the frame domain", + _v(ks_nb < 0.01), + "$\\mathrm{KS}\\le %.4f$ on all %d rows' $(\\beta,L)$, mean and variance within $1\\%%$ " + "(Table~\\ref{tab:auditnum}); on \\emph{real} episode lengths the episode end truncates " + "it, worst %s at $\\beta{=}%g$, $L{=}%d$: %.0f vs.\\ %.0f frames (%.0f\\%% short)" + % (ks_nb, len(cn), worst["row"] if worst else "--", worst["beta"] if worst else 0, + worst["L"] if worst else 0, worst["mean_composed_real"] if worst else 0, + worst["mean_negbin"] if worst else 0, 100 * worst["rel_shortfall"] if worst else 0)), + ("B4", "The fold is $q_k=c_k+(1{-}c_k)\\gamma^{h}q_{k+1}$, $q_L=0$, $h=1/(1{-}\\beta)$", + _v(fold_max < 1e-5 and fold_qL), + _cite("scorer", "h = 1.0 / (1.0 - beta)") + " $h=1/(1-\\beta)$, " + + _citeline("scorer", "G = gamma ** h") + " $G=\\gamma^{h}$ (not $\\gamma$), " + + _citeline("scorer", "q = torch.zeros_like(cs[-1])") + " $q_L=0$, " + + _citeline("scorer", "q = c + (1.0 - c) * G * q") + " the backward loop; " + "re-derived by hand in float64 on " + "%d real scored states: $\\max|q^{\\mathrm{hand}}-q^{\\mathrm{code}}|=%s$" % (len(fo), _sci(fold_max))), + ("B5", "The dropped tail is $\\gamma^{L/(1-\\beta)}$ and the alarm fires for tail $>0.5$", + _v(True), + _cite("planner", "if _tail > 0.5:") + " computes exactly the quantity Table~" + "\\ref{tab:discounts} prints and warns above $0.5$; the log carries the warning for each of " + "the %d rows whose tail exceeds $0.5$ and for none of the others" % n_alarm), + ("B6", "The flagship cells ran the $(\\beta,L)$ Table~\\ref{tab:discounts} claims", + _v(cells_agree), + "read back from the %d cell \\textsc{json}s (%s episodes) that make up the RSM column, not from a " + "config: every cell of a row records the same $(\\beta,L,\\gamma)$ and it is that row's, with " + "$\\gamma=0.99$ throughout" + % (n_cells, "{:,}".format(n_eps).replace(",", "{,}"))), + ] + rows_tex = nl.join(" & ".join([k, c, v, e]) + " " + bs + bs for k, c, v, e in checks) + + sec = ( + bs + "subsection*{Audit of the RSM value estimate}" + nl + nl + + ((_lead + nl + nl) if _lead else "") + + bs + "textbf{Correction (this supersedes the audit's earlier conclusion).} The audit below " + "verified that the planner runs the recursion this paper described; it did not ask whether that " + "recursion is the estimator the method claims, and it is not. The published read-out folded a " + + bs + "emph{fixed} number of $" + bs + "beta$-hops with continuation $" + bs + "gamma^{h}$ and " + "$q_L=0$, an absorbing hitting probability over a truncated horizon. The reference implementation " + "(" + bs + "texttt{ogbench" + bs + "_genq/rsm.py:113,532}) instead runs a coin-terminated walk " + "whose length is stochastic, with continuation $p=(" + bs + "gamma-" + bs + "beta)/(" + bs + + "gamma(1-" + bs + "beta))$ and one membership read at the frozen node; only that chain composes " + "to the $" + bs + "gamma$ horizon, and it does so exactly. The fixed depth $L$ was moreover swept " + "by evaluation success rather than set as a truncation guard, and three rows ran at $L=1$, where " + "the estimator collapses to membership at a single sampled successor state. Every flagship row is " + "being re-scored with the corrected read-out; Table~" + bs + "ref{tab:flagship} prints the chain " + "numbers (and the launch status of the cells still running), and the superseded fold numbers are " + "kept in Table~" + bs + "ref{tab:flagship_fold}. The two read-outs reorder candidates (Spearman " + "$0.861$ on the logit at $" + bs + "beta=0.95$), so the flagship numbers can move in either " + "direction." + nl + nl + # A beta = gamma arm is not a chain, and one was two cells from being printed as one. + + bs + "textbf{A $" + bs + "beta=" + bs + "gamma$ arm is not a chain.} Because the continuation " + "probability is $p=(" + bs + "gamma-" + bs + "beta)/(" + bs + "gamma(1-" + bs + "beta))$, setting " + "$" + bs + "beta=" + bs + "gamma$ makes $p=0$: the coin never fires, the walk stops at hop $0$, " + "and the read-out is a single successor draw with no recursion at all -- the same degeneracy, " + "under the chain's name, that the fold's $L=1$ rows had. The $" + bs + "gamma$ sweep contains two " + "such arms on Square (Sub.) ($" + bs + "beta=" + bs + "gamma=0.98$ and $0.90$; $3$ cells in " + "total, both grids incomplete), and the incomplete one led the row's all-arms maximum at $56.0$ " + "over $2$ of $9$ cells against the $54.0$ printed from a complete grid. No table has ever printed " + "such a cell, and none can: the loader now excludes any arm whose cap field is $0$ from the chain " + "pool and aborts the build if one is nevertheless selected, and the grid census refuses to " + "nominate one for completion. The exclusion is preventive rather than corrective -- it changes no " + "reported number." + nl + nl + + verdict + nl + nl + + "Two properties decide whether Table~" + bs + "ref{tab:flagship} is a fair comparison: the RSM's " + "reward must be the dataset's per-frame provenance label rather than anything derived from the " + "future of the trajectory, and its $" + bs + "beta$ recursion must be the one Table~" + bs + + "ref{tab:discounts} describes. Both were audited against the code, against the checkpoints the " + "reported cells loaded, and against the cell records themselves; the audit script is " + + bs + "texttt{scripts/tmp/audit" + bs + "_rsm" + bs + "_value.py} and every number below is its " + "output. " + ("Both hold" if (all_memb and cells_agree and lc_bad == 0 and s_bad == 0 + and fold_max < 1e-5) else "See Table~" + bs + "ref{tab:audit}") + + "; the one discrepancy found is a one-frame definition of the hop length that does not change " + "any reported number (row B2)." + nl + nl + + bs + "textbf{The reward is not return-based.} The label is built once, per frame, from the " + "episode's provenance and never from its future: an expert episode carries $1$ on every frame and " + "a suboptimal one $0$, which is RISE's own reward. It is constant inside every episode of every " + "corpus (rows R1), it is the target at the " + + bs + "emph{anchor} frame rather than at the sampled future (R2), and no discounted return, " + "episode-outcome value or time-to-goal signal is used by any checkpoint in the table (R3). The " + "successor's read-out consumes only that head, evaluated on states the model itself samples; the " + "simulator's success flag reaches the results file and nothing else (R5). TD-Flow, our own " + "occupancy baseline, is trained by the same script with the same head and differs only in the " + "successor target, so the comparison is like-for-like (R4)." + nl + nl + + bs + "textbf{The $" + bs + "beta$ recursion.} One hop draws $k" + bs + "sim" + bs + + "mathrm{Geom}(1{-}" + bs + "beta)$ renormalised to the frames left in the episode, so the target " + "is always a real logged frame of that episode (B1); $L$ such hops compose to $" + bs + + "mathrm{NegBin}(L,1{-}" + bs + "beta)$ to within $" + bs + "mathrm{KS}\\," + ("%.4f" % ks_nb) + "$ (B3); and the fold " + "the planner runs is the claimed recursion, discounting a hop by $" + bs + "gamma^{h}$ and not by $" + + bs + "gamma$, reproduced by hand on real scored states to $10^{-7}$ (B4). The tail it drops is " + "the quantity Table~" + bs + "ref{tab:discounts} prints, and the planner warns whenever it exceeds " + "a half (B5). Read back from the cell records, every reported cell ran the $(" + bs + "beta,L)$ its " + "row claims (B6). What the audit does " + bs + "emph{not} establish is that a short-horizon " + "read-out is the right one: on most rows $L 1}) + return "--" if not gs else (("%g" % gs[0]) if len(gs) == 1 else "%g--%g" % (gs[0], gs[-1])) + + +def _wm_readout_note(rows): + """What the WORLD-MODEL columns actually roll out -- read off the arms the table selected. + + Two corrections live here. tab:controls said "a fixed 4-chunk open-loop rollout" until + 2026-09-23; that was wrong, the depth L was swept in {1,2,4,8} and picked per row by success. + Then (gen_q#273 part 1e) _best_arm gained a read-out filter for `wm:` families, so tab:flagship's + world-model columns stopped printing that fold entirely and print MPC cells only -- which left THIS + sentence describing a read-out the table no longer uses. It is now derived from r["axarm"], the + recipe of the arm each column printed, so it cannot drift from the numbers beside it. An MPC arm + reads "H N"; a fold arm reads "L N". + """ + import json as _json + fam = {} + modes = set() + for r in rows: + for k in ("wm:dinowm", "wm:lewm"): + rec = (r.get("axarm") or {}).get(k) + if not rec or not rec.startswith("H"): + continue + tok = rec.split() + try: + fam.setdefault(k, set()).add(int(tok[0][1:])) + except ValueError: + continue + if len(tok) > 1: + modes.add(tok[1]) + try: + _json.dump({k: sorted(v) for k, v in fam.items()}, + open(f"{ROOT}/status/q273/wm_mpc_arm_dump.json", "w"), indent=1) + except Exception: + pass + # THE SELECTED CHAIN ARM, PER ROW (run 20). `scripts/selected_params.py` writes tab:selected, whose + # caption says the bold entry is "the arm the table reports" -- but it chose that arm with its own + # rule (raw mean success over chain cells, >= 6 cells, no completeness tier, no proposer restriction, + # no gamma guard) while this table chooses with `_seed_tier_key` + `proposer_ok` + the gamma guard. + # Nothing made the two agree, so the settings table could describe a different arm from the printed + # number. Exporting the arm is the only fix that cannot drift: tab:selected now reads it and RAISES + # if it is absent, instead of silently falling back to its own maximum. Purely additive -- one file, + # no effect on any table cell. + try: + _json.dump({(r.get("label") or r.get("task")): { + "task": r.get("task"), + "chain_arm": (r.get("rsm_chain_arm") or None), + "chain_cells": r.get("rsm_chain_cells"), + "chain_seeds": r.get("rsm_chain_seeds"), + "chain_rate": r.get("rsm_chain_rate")} + for r in rows}, + open(f"{ROOT}/status/chain/flagship_chain_arm.json", "w"), indent=1) + except Exception as _e: + sys.stderr.write("[flagship_latex] could not dump flagship_chain_arm.json: %r\n" % (_e,)) + # LEWM_LAND (2026-09-23): the per-family dump above collapses the rows, but the world-model + # columns get a per-ROW search over 10 arms that the RSM column does not, so the selected arm + # has to be readable per row for that asymmetry to be stated. Purely additive: a second file, + # no effect on any table cell. + try: + _json.dump({(r.get("label") or r.get("task")): { + k: ((r.get("axarm") or {}).get(k) or None) + for k in ("wm:dinowm", "wm:lewm")} + for r in rows}, + open(f"{ROOT}/status/q273/wm_mpc_arm_by_row.json", "w"), indent=1) + except Exception: + pass + if not fam: + # No MPC arm has landed on any row yet: say that, rather than describing the retired fold as + # if it were still what the column prints. + return ("The world-model columns read model-predictive-control cells only: the model is rolled " + "open-loop from each candidate for $H = 1/(1-\\gamma)$ frames and scored with the same " + "reward head; no such cell has landed on a printed row yet, so those columns print " + "their launch state.") + def _set(k): + xs = sorted(fam.get(k, [])) + return ",".join(str(x) for x in xs) if xs else "--" + md = ("terminal-state and discounted-sum" if {"mpc", "mpcd"} <= modes else + ("discounted-sum" if "mpcd" in modes else "terminal-state")) + return ("The world models are read as MPC and not through our fold: from each candidate the model is " + "rolled open-loop for $H = 1/(1-\\gamma)$ frames -- $\\lceil H/8 \\rceil$ chunks, the action " + "sequence past the first chunk being the proposer's own continuation -- and scored with the " + "same reward head every other column uses (" + md + " read-out). $H$ was swept through the " + "discount, $\\gamma \\in \\{0.90,0.95,0.98,0.99,0.995\\}$ giving $H \\in " + "\\{10,20,50,100,200\\}$ frames; the selected $H$ is DINO-WM $\\in\\{" + _set("wm:dinowm") + + "\\}$, LeWM $\\in\\{" + _set("wm:lewm") + "\\}$ " + "(\\texttt{status/q273/wm\\_mpc\\_arm\\_dump.json}). The superseded $R\\beta$-$L$ cells, " + "which folded $L \\in \\{1,2,4,8\\}$ open-loop chunks with the per-hop discount " + "$\\gamma^{8}$ and selected $L$ per row by success, are retired into " + "Table~\\ref{tab:ablation_betarec}.") + +# ---------------------------------------------------------------- gen_q#274 (stream NEW_BASELINES) +# Diffusion Forcing and TD-MPC2 in tab:controls and the search-size disclosure. +# +# SELF-LIMITING ON PURPOSE. These rows describe columns that do not exist in tab:flagship until a +# new-baseline cell has actually been measured, so `_new_baseline_cells()` looks for the cell JSONs +# and the rows are emitted only when at least one is on disk. A tab:controls that described a +# Diffusion Forcing column while no DF number existed would be a claim about work not done; a +# tab:controls that stayed silent once the numbers landed would be the silent comparison gen_q#274 +# forbids. The prose source of record for these rows is docs/tex/new_baselines_controls.tex. +# +# ADDITIVE BY CONSTRUCTION: one helper, one insertion point inside _controls_table, no existing row +# or caption touched -- gen_q#273 is editing this generator concurrently. +NB274_DIRS = ("df274", "td274") + + +def _new_baseline_cells(): + """Measured new-baseline cells on disk, {'df': n, 'td': n}. Smokes live in *274smoke/ and are + deliberately NOT counted: a plumbing run must never bring a table row into existence.""" + import glob as _g + out = {} + for d in NB274_DIRS: + n = 0 + for f in _g.glob(str(ROOT / "runs" / "*" / "eval_onactor" / d / "*.json")): + if not f.endswith(".diag.json"): + n += 1 + out[d[:2]] = n + return out + + +def _new_baseline_control_rows(): + bs = chr(92) + have = _new_baseline_cells() + if not any(have.values()): + return [] + rows = [] + rows.append(("Proposer (new baselines)", + "Diffusion Forcing and TD-MPC2 configuration (b) are $" + bs + "emph{planners}$: they propose " + "their own actions and therefore do NOT share the $128$-candidate draw, so their search budget " + "is their own and is disclosed in Table~" + bs + "ref{tab:searchsize}. TD-MPC2 configuration (a) " + "does share it: it ranks the same $128$ chunks from the same actor with common random numbers, " + "and is the only one of the three that is a drop-in value estimator -- which makes it close to " + "DINO-WM with a value head, and it is reported as such")) + rows.append(("Reward (new baselines)", + "unchanged -- RISE's binary data-provenance label. DF's guidance is computed from its own " + "predicted reward channel trained on that label; TD-MPC2's learned reward head is trained on it. " + "No other signal (goal, progress, distance) enters either method")) + rows.append(("Training data (new baselines)", + "the same task cache as DINO-WM: the pooled DINOv2 state ($z$ plus proprioception, normalised by " + "the cache's own \\texttt{feat\\_stats}) and the $7$-d OSC action, same episode split. Neither " + "new baseline saw pixels and neither saw an episode the other columns did not")) + rows.append(("Health (new baselines)", + "every new-baseline score is printed beside a rollout-fidelity number at its OWN row horizon, " + "read against the stay-put predictor on the same pairs. The two fidelities are NOT comparable " + "with each other and are never put in one column: DF predicts observations, so its number is an " + "observation-space RMSE; TD-MPC2's world model is implicit and has no decoder, so its number is " + "the latent analogue. A row whose rollout is no better than standing still carries that flag " + "next to its score")) + return rows + + +def _sweeps_table(): + """tab:sweeps -- what was actually swept per method per task. + + Generated by scripts/sweep_census.py, which COUNTS distinct arms in the evaluation archive rather than + asserting them, because a hand-written sweep description drifts: this table's own caption in + tab:flagship still described the world-model columns as an L-in-{1,2,4,8} chunk fold months after those + arms were retired. Read from disk here so the flagship build never silently ships a stale count; if the + file is missing the table is omitted rather than faked, and the build says so. + """ + import os + f = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "docs", "tex", "_sweeps.tex") + if not os.path.exists(f): + print("[flagship_latex] tab:sweeps SKIPPED: docs/tex/_sweeps.tex absent -- run scripts/sweep_census.py") + return "" + return open(f).read() + chr(10) + + +def _searchsize_table(): + """tab:searchsize -- what each planning column actually spends per decision. + + This table exists because gen_q#274's fairness condition is not satisfiable by a footnote: a + planner row and a $128$-candidate row are different objects, and TD-MPC2 configuration (b) at its + published defaults spends about two orders of magnitude more per episode than the shared-candidate + columns. Printing those side by side without this table is the silent comparison the issue + forbids.""" + bs = chr(92); nl = chr(10) + have = _new_baseline_cells() + if not any(have.values()): + return "" + body = [ + "RSM, TD-Flow & shared actor & $128$ & $128 " + bs + "times M$ particles & the $" + bs + + "beta$ chain; cap from the $10^{-3}$ truncation tail " + bs + bs, + "DINO-WM, LeWM & shared actor & $128$ & $128 " + bs + "times L$ chunks & $L$ selected per row by " + "success " + bs + bs, + "IDQL / RISE, IFQL & shared actor & $128$ & $0$ (critic, no rollout) & " + bs + bs, + "TD-MPC2 (a) & shared actor & $128$ & $128 " + bs + "times 1$ & deterministic latent model: particles " + "do nothing, so this column spends LESS than the RSM column at the same nominal particle count " + bs + bs, + "Diffusion Forcing & " + bs + "emph{planner} & $n_{" + bs + "mathrm{plans}}$ diffused plans & one per plan " + "& guidance scale swept; the swept values are part of this budget and are listed beside the score " + bs + bs, + "TD-MPC2 (b) & " + bs + "emph{planner}, RISE actor as prior & $S$ samples $" + bs + "times$ $I$ iterations " + "& $S " + bs + "times I$ & defaults $S{=}512$, $I{=}6$, $H_p{=}3$, $24$ prior trajectories from the shared " + "actor: $3072$ rollouts per plan, replanned every $" + bs + "min(8,H_p){=}3$ frames " + bs + bs, + ] + return (bs + "begin{table}[t]" + nl + bs + "centering" + nl + + bs + "caption{" + bs + "textbf{Search size per decision, disclosed.} A planning column's score is a " + "joint result of its value estimate AND how much search it is allowed; these are not interchangeable " + "and the table states both. ``Candidates'' is how many distinct action sequences the column evaluates " + "per decision; ``model rollouts'' is how many times a learned dynamics model is rolled. A column that " + "proposes its own actions is marked " + bs + "emph{planner} and is not a $128$-candidate column in any " + "sense. Per $400$-frame episode at the defaults the shared-candidate columns evaluate " + "$50 " + bs + "times 128 = 6" + bs + ",400$ action sequences, Diffusion Forcing diffuses $50$ plans of " + "$n_{" + bs + "mathrm{plans}}$, and TD-MPC2 configuration (b) rolls $134 " + bs + "times 3" + bs + + ",072 " + bs + "approx 4.1" + bs + "times10^{5}$ latent trajectories while re-committing every $3$ " + "frames rather than every $8$.}" + nl + + bs + "label{tab:searchsize}" + nl + bs + "scriptsize" + nl + + bs + "setlength{" + bs + "tabcolsep}{3pt}" + nl + # gen_q#274 2026-09-23: was `llllp{4.4cm}`, 133.14pt overfull -- "\emph{planner}, + # RISE actor as prior" and "$S$ samples $\times$ $I$ iterations" cannot wrap in an `l`. + # Width budget, ICLR 397.5pt: 1.95+2.25+2.25+1.85+4.2 = 12.5cm = 355.8pt, + # + 8*tabcolsep(3pt) = 379.8pt, 17.7pt of slack. + + bs + "begin{tabular}{@{}p{1.95cm}p{2.25cm}p{2.25cm}p{1.85cm}p{4.2cm}@{}}" + nl + bs + "toprule" + nl + + "Column & Proposer & Candidates / decision & Model rollouts / decision & Note " + bs + bs + nl + + bs + "midrule" + nl + nl.join(body) + nl + bs + "bottomrule" + nl + + bs + "end{tabular}" + nl + bs + "end{table}" + nl) + + +def _controls_table(rows): + """What is held identical across the columns of tab:flagship (owner, 2026-09-22: "we should have a list of + things that are controlled across methods. one is the proposal actor, the other is the RISE reward"). + Every line is a statement the pipeline enforces or the loader filters on; the last line names the one + factor that is NOT controlled, because a table of controls that omits it would be read as claiming it.""" + bs = chr(92) + pins = {r["label"]: r.get("proposer_used") for r in rows if r.get("proposer_used") not in (None, RSM_PROPOSER)} + pin_txt = ("the RISE actor on every row except " + + "; ".join(f"{k}: {v}" for k, v in pins.items())) if pins else "the RISE actor on every row" + lines = [ + ("Proposer", "one actor per row, shared by every planning column: " + pin_txt + "; chosen by planning " + "performance and disclosed"), + ("Candidate set", "$128$ action chunks per decision step from that proposer; every value estimator ranks " + "the same draws (common random numbers per evaluation seed), argmax selection"), + ("Reward", "RISE's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on every " + "frame of a suboptimal one), unchanged, for every value estimator; BC/BC-u use none"), + ("Training data", "the row's released expert$+$suboptimal file for every learned component (BC: its " + "expert half; BC-u and all value estimators: the union); no extra data unless the row " + "says regenerated"), + ("Evaluation", "same simulator, same canonical initial-state region, same success criterion (the paper's " + "relaxed mug criterion), horizon $400$, $50$ episodes per cell"), + ("Seeds", "$3$ policy $" + bs + "times$ $3$ evaluation seeds per cell; an evaluation seed varies the " + "action draws and the environment initial conditions"), + ("Scorer budget", "RSM, TD-Flow, LeWM, DINO-WM: $100$k gradient steps on the same cache; IDQL/RISE critic " + "co-trained with the actor; IFQL its published schedule"), + ("Read-out", "RSM and TD-Flow share the coin-terminated $" + bs + "beta$ chain: per particle the walk " + "hops a $" + bs + "mathrm{Bernoulli}(p)$ number of times with $p = (" + bs + "gamma-" + + bs + "beta)/(" + bs + "gamma(1-" + bs + "beta))$ and membership is read once at the frozen " + "node, so the composed frame offset is exactly $" + bs + "mathrm{Geom}(1-" + bs + "gamma)$; " + "the loop cap is set by the $10^{-3}$ truncation tail ($p^{L}" + bs + "le 10^{-3}$), not " + "tuned. " + _wm_readout_note(rows) + " The critics (IDQL/RISE, IFQL) have no horizon " + "read-out at all"), + (bs + "emph{Not controlled}", "the observation each value estimator scores: frozen DINOv2 features of the " + "two camera frames (RSM, IFQL, TD-Flow, DINO-WM), raw $84$ px frames (LeWM), " + "the actor's own image encoder (IDQL/RISE critic)"), + ] + lines += _new_baseline_control_rows() # gen_q#274, empty until a new-baseline cell exists + body = [f"{k} & {v} " + bs + bs for k, v in lines] + return (bs + "begin{table}[t]" + chr(10) + bs + "centering" + chr(10) + + bs + "caption{" + bs + "textbf{What Table~" + bs + "ref{tab:flagship} holds fixed across methods.} " + "Each line is enforced by the evaluation pipeline or filtered on by the table loader; the last line is " + "the one factor that differs between value estimators and is therefore part of what the comparison " + "measures. The read-out is held IDENTICAL across the two methods that have one (RSM and TD-Flow); " + "the reward for every value estimator is RISE's binary data-provenance membership label, and the " + "retired oracle progress head appears in no table in this paper.}" + chr(10) + bs + "label{tab:controls}" + chr(10) + bs + "scriptsize" + chr(10) + + bs + "setlength{" + bs + "tabcolsep}{4pt}" + chr(10) + + bs + "begin{tabular}{@{}p{2.25cm}p{10.7cm}@{}}" + chr(10) + bs + "toprule" + chr(10) + # gen_q#274 2026-09-23: `l` + p{11.2cm} overflowed by 41.01pt once the four + # "(new baselines)" labels landed in column 1. Width budget, ICLR 397.5pt: + # 2.25cm + 10.7cm = 368.6pt, + 2*tabcolsep(4pt) = 376.6pt, 20.9pt of slack. + + "Controlled factor & Setting " + bs + bs + chr(10) + bs + "midrule" + chr(10) + + chr(10).join(body) + chr(10) + bs + "bottomrule" + chr(10) + + bs + "end{tabular}" + chr(10) + bs + "end{table}" + chr(10) + + _searchsize_table() # gen_q#274: empty string until a new-baseline cell exists + + _sweeps_table()) # tab:sweeps -- arms COUNTED from the archive, see scripts/sweep_census.py + + +def _fold_table(rows, gamma=0.99): + """tab:flagship_fold -- the RETIRED deterministic-truncated-fold numbers (gen_q#267). + + These are what the flagship printed before the coin-terminated beta chain existed. They are kept, + in their own table with their own caption, because deleting them would hide a correction: the fold + is a different functional from the discounted-occupancy read the method claims, its depth L was + swept by success rather than set as a truncation guard, and on three rows it ran at L=1 where the + estimator collapses to a single sampled successor state. RSM-fold and TD-Flow-fold sit side by side + because both methods shared the read-out, so both moved.""" + bs = chr(92); nl = chr(10) + body, retained = [], [] + for r in rows: + f = r.get("afold") or {} + cols = [] + b = L = None + for k in ("rsm:membership", "rsm:tdflow", "wm:dinowm", "wm:lewm"): + v = f.get(k) + if v is None: + cols.append("--"); continue + _r, _ns, _rec, _nc = v + m = re.search(r"b([0-9.]+)\s+L(\d+)", _rec) + if m and k == "rsm:membership": + b, L = float(m.group(1)), int(m.group(2)) + cols.append(r"$%.1f_{(%d)}$" % (_r, _ns)) + # THE FALLBACK IS ONLY FOR A MISSING RSM ARM, NEVER FOR AN UNPARSEABLE ONE (2026-09-22). When + # the fold filter was a substring test it selected a CHAIN arm on the `L40` rows; that recipe has + # no "L" field, so `b` stayed None and this fallback quietly stamped the TD-Flow arm's + # (beta, L) = (0.98, 4) onto a rate of 20.9 that came from neither. A present-but-unparseable + # RSM arm is now a build failure. + if b is None and f.get("rsm:membership") is not None: + raise SystemExit( + "tab:flagship_fold: the selected RSM fold arm carries no 'b L' field: " + f"{f['rsm:membership'][2]!r} on row {r['label']!r}. That means the fold selection " + "admitted an arm that is not a fold arm; fix _arm_is/_readout_of, do not relabel it.") + if b is None: # no RSM fold arm on this row at all: fall back to the TD-Flow arm's own (beta, L) + v = f.get("rsm:tdflow") + m = re.search(r"b([0-9.]+)\s+L(\d+)", v[2]) if v else None + if m: + b, L = float(m.group(1)), int(m.group(2)) + if b is None: + bcol, lcol, mcol = "--", "--", "--" + else: + # The fold walks L hops of mean length h = 1/(1-beta) frames, so it can only see the first + # L*h frames; the gamma-discounted occupancy the method claims puts mass 1 - gamma^(L h) + # there. That fraction is the "retained mass" -- the rest of the horizon is dropped by the + # truncation, which is exactly what the coin chain does not do. + _T = L / (1.0 - b) + _mass = 1.0 - gamma ** _T + retained.append(_mass) + bcol, lcol, mcol = "$%.2f$" % b, "$%d$" % L, "$%.2f$" % _mass + body.append(" & ".join([r["label"], bcol, lcol, mcol, *cols]) + " " + bs + bs) + rng = ("" if not retained else + " Retained mass runs from $%.2f$ to $%.2f$ across the rows." % (min(retained), max(retained))) + return (bs + "begin{table}[t]" + nl + bs + "centering" + nl + + bs + "caption{" + bs + "textbf{Ablation: the $" + bs + "beta$-recursion read-out.} " + "The same checkpoints as Table~" + bs + "ref{tab:flagship}, scored with our deterministic " + "truncated fold instead of each method's own read-out. " + "These are the numbers this paper reported before the read-out was corrected. The fold computed " + "$q_k = c_k + (1-c_k)" + bs + "gamma^{h} q_{k+1}$ over a FIXED $L$ hops with $q_L = 0$ " + "($h = 1/(1-" + bs + "beta)$), which is an absorbing hitting probability over a truncated horizon, " + "not the $" + bs + "gamma$-discounted occupancy read the method claims. $L$ was chosen per row " + "BY EVALUATION SUCCESS rather than set as a truncation guard, and on three rows it was $L=1$, where " + "the estimator collapses to $q_0 = c_0$ -- membership at a single sampled successor state, with no " + "chain at all. The retained-mass column is the fraction $1 - " + bs + "gamma^{L h}$ of the " + "$" + bs + "gamma$-horizon that $L$ hops can see; the rest was dropped." + rng + " RSM and TD-Flow " + "shared the read-out, so both are shown: the correction moves both columns, which is why the chain " + "was run for both. THE WORLD MODELS ARE HERE FOR A DIFFERENT REASON: the fold is not their " + "planner at all, and LeWM additionally has no hop head, so it re-rolls one action sequence " + "rather than composing hops. The $(" + bs + "beta, L)$ columns describe the RSM arm; each " + "method selected its own $L$ under the same rule. " + # OWNER 2026-09-23 22:30Z: the LeWM beta-recursion (fold) arms belong in this table as a + # READ-OUT ablation for the world models, and the caption must state the arm-count + # asymmetry so a reader cannot read a fold win as an artefact of a bigger search. + # The counts are structural: fold L in {1,2,4,8} = 4 arms; MPC H in {10,20,50,100,200} + # x {mpc, mpc_disc} = 10. Selected-H census: status/q273/wm_mpc_arm_by_row.json. + "THE TWO READ-OUTS DID NOT GET THE SAME SEARCH, and the asymmetry runs AGAINST the fold " + "shown here: the fold grid is FOUR arms per row ($L " + bs + "in " + bs + "{1,2,4,8" + bs + "}$), while the " + "trajectory (MPC) read-out the world-model columns carry in Table~" + bs + "ref{tab:flagship} is " + "TEN ($H " + bs + "in " + bs + "{10,20,50,100,200" + bs + "}$ frames $" + bs + "times$ terminal-state or discounted-sum " + "read-out). So wherever a world model scores HIGHER in this table than in " + "Table~" + bs + "ref{tab:flagship}, the larger search is on the LOSING side, which strengthens the " + "gap rather than explaining it. Nor is the horizon axis saturated: the selected $H$ is $200$ " + "frames -- the TOP of the grid -- on three of LeWM's five non-Mug/Thread rows and on four of " + "DINO-WM's seven, so the trajectory read-out has NOT been searched to exhaustion; the next " + "grid point is $500$ frames ($" + bs + "gamma = 0.998$) and it would have to be added for BOTH world " + "models or the two columns stop being comparable. Any read-out comparison drawn from this " + "table is per column and per row and does not generalise: the two world models do not agree " + "about which read-out is better, and DINO-WM's trajectory arms are what win it Mug and " + "Thread. This is an ablation of the READ-OUT, not a " + "baseline table: no number in it is a claim about any method as its authors specify it. " + "Subscripts are policy seeds.}" + nl + # LABEL ALIAS (owner, 2026-09-23 04:15): the table is renamed tab:ablation_betarec -- it is an + # ablation of the READ-OUT, not a baseline table -- and the old label is kept as an alias so + # the ~20 \ref{tab:flagship_fold} in this generator and in the prose do not dangle. + + bs + "label{tab:ablation_betarec}" + nl + + bs + "label{tab:flagship_fold}" + nl + bs + "scriptsize" + nl + + bs + "begin{tabular}{lcccrrrr}" + nl + bs + "toprule" + nl + + "Task & $" + bs + "beta$ & $L$ & retained mass & RSM & TD-Flow & DINO-WM & LeWM " + + bs + bs + nl + + bs + "midrule" + nl + nl.join(body) + nl + bs + "bottomrule" + nl + + bs + "end{tabular}" + nl + bs + "end{table}" + nl) + + +def _all_table(rows): + """Every method on ONE proposer per row, split by whether the method plans (owner, 2026-09-21: "any + method that does planning should use same actor proposer"; "bc and bcu do not use the proposal policy + and do not do planning"). + + reference policies BC, BC-u -- standalone actors, no candidate set, no ranking. They are the bar + to clear, not competing scorers, so they sit outside the planning block and + outside Delta; a row where one of them beats RSM is daggered, never hidden. + planning block P-greedy (the row's proposer sampled once = no selection), rand-128 (the same + 128 candidates, chosen uniformly = the binding control), P-critic (the + proposer's own co-trained IQL critic, i.e. RISE's/IDQL's value estimate on this + actor), IFQL, TD-Flow, LeWM, DINO-WM, RSM. Every column here ranks the identical + candidate set from the identical actor, so only the value estimate differs. + + The published-method columns of Table 1 (IDQL on its own actor, RISE as actor+critic) are NOT repeated + here: each plans from its own proposer, which is exactly what this table holds fixed. Delta is the + margin over the strongest PLANNING comparator; the paired significance tests against the two controls + are in Table~ref{tab:matched_actor}, so no star is invented here.""" + bs = chr(92) + ref = [(i, k) for i, (k, _) in enumerate(BASE) if k in ("BC", "BCU")] + pgi = {k: i for i, (k, _) in enumerate(BASE)} + # DF COLUMN (gen_q#282, DF_VALUE 2026-09-24). tab:flagship and tab:controls build their scorer + # columns from THIS hard-coded list, not from EXTRA_SCORERS -- so adding ("wm:df","DF") to + # EXTRA_SCORERS wired the DF column into tab:flagship_all but NOT into tab:flagship, which is the + # deliverable. A rebuild on 2026-09-24 07:40Z confirmed it: the fresh tab:flagship header was + # "Task & BC & BC-u & IDQL & IFQL & TD-Flow & LeWM & DINO-WM & RSM" -- nine columns, no DF. + # OFF BY DEFAULT until the fit is measured. The table is already at its width limit at + # \scriptsize with full task names, and a tenth column may overflow ICLR's 397.5pt block; the + # instruction is to REPORT an overflow, not to hide it by shrinking the font, and it would be + # worse to silently break the orchestrator's live table while measuring. So: build with + # RR_DF_COLUMN=1 to render it, measure with scripts/check_iclr_fit.sh, and flip this default + # to "1" once (and only once) the fit passes. + xs_order = [("critic:ifql", "IFQL"), ("rsm:tdflow", "TD-Flow"), ("wm:lewm", "LeWM"), ("wm:dinowm", "DINO-WM")] + if os.environ.get("RR_DF_COLUMN", "0") == "1": + xs_order = xs_order + [("wm:df", "DF")] + heads = [NICE_COL.get(k, k) for _, k in ref] + ["P-greedy", "rand-128", "P-critic"] + [l for _, l in xs_order] + body = [] + for r in rows: + refc, planc = [], [] + for i, k in ref: + c = _unbold(r["base_chain"][i]) # bold is decided over the WHOLE row below, not inherited + # mean and seed count only in THIS table: the +-SE lives in the single-actor table, and five + # more columns of it put this one past the text block. + refc.append(_cell_status(r["task"], k) if c == "--" else re.sub(_PM, "", c)) + # P-greedy / P-critic are read on the ROW'S PROPOSER: on an unpinned row that is the RISE actor, so + # the flagship's own cells; on a pinned row the matched-actor cells for that proposer, or a status. + pin = r["task"] in PROPOSER_BY_TASK + for key, val in (("RISEg", r.get("ag") if pin else r["base"][pgi["RISEg"]]), + ("rand", r.get("arand")), + ("RISE", r.get("aq") if pin else r["base"][pgi["RISE"]])): + c = val or "--" + n = (r.get("arandcells") or 0) if key == "rand" else 0 + planc.append(_cell_status(r["task"], key, n) if c == "--" else re.sub(_PM, "", c)) + for k, lab in xs_order: + c = (r.get("axs") or {}).get(k, "--") + n = (r.get("axcells") or {}).get(k, 0) + planc.append(_cell_status(r["task"], k, n) if c == "--" else c) + # CHAIN-ONLY (2026-09-23), for the reason spelled out at the single-actor body: every other + # planning column of this table already selects chain cells (`_best_arm` defaults to + # readout="chain"), so a mixed-read-out RSM column was comparing our best-of-two-estimators + # against everyone else's chain number. + # `rsm_chain_disp`, not the unbolded `rsm_chain`: the reference cells above come from + # `base_chain`, which is bolded against the SAME chain row maximum, so taking the unbolded + # variant here left a row with the RSM cell as its maximum showing no bold at all (Sq-S). + # It already carries the launch status when no >=2-seed chain arm exists. + rsm = _unbold(r["rsm_chain_disp"]) + # Delta over the strongest PLANNING comparator only, computed from the rendered numbers so it can + # never disagree with the printed cells. + rv = _num(rsm); pv = [v for v in (_num(c) for c in planc) if v is not None] + d = "--" if rv is None or not pv else f"${'+' if rv - max(pv) >= 0 else '-'}{abs(rv - max(pv)):.1f}$" + rfv = [v for v in (_num(c) for c in refc) if v is not None] + if rv is not None and rfv and max(rfv) > rv: + d += "$^{" + bs + "dagger}$" + # BOLD = THE BEST NUMBER ACTUALLY PRINTED IN THIS ROW (2026-09-23). The baseline and RSM cells + # arrived carrying the bolding of the SINGLE-ACTOR table, whose column set is BC/BC-u/RISE-g/ + # IDQL/RISE/IFQL/RSM -- it does not contain this table's planning comparators. So on Mug the + # RSM cell printed bold at 19.1 in a row whose DINO-WM column reads 21.1 and whose own Delta + # says -2.0: an emphasis mark claiming a win that the same row denies, in a table whose caption + # never said what bold meant. Decided here, over every numeric cell this table prints. + _allc = refc + planc + [rsm] + _allv = [_num(x) for x in _allc] + _top = max([v for v in _allv if v is not None], default=None) + if _top is not None: + _allc = [(("$" + bs + "mathbf{" + x[1:-1] + "}$") if (v == _top and x.startswith("$")) else x) + for x, v in zip(_allc, _allv)] + refc, planc, rsm = _allc[:len(refc)], _allc[len(refc):-1], _allc[-1] + _ab = {"Square (Sub.)": "Sq-S", "Square (Cov.)": "Sq-C", "Piece (Sub.)": "Pc-S", "Piece (Cov.)": "Pc-C", + "Mug (Sub.)": "Mug", "Thread (Cov.)": "Thr", "Piece-tip (Cov.)": "Pc-tip"} + body.append(" & ".join([_ab.get(r["label"], r["label"]), *refc, *planc, rsm, d]) + " " + bs + bs) + npl = len(heads) - len(ref) + 1 # planning comparators + RSM + cols = "l" + "c" * len(ref) + "|" + "c" * (npl + 1) + grp = ("& " + bs + "multicolumn{" + str(len(ref)) + "}{c|}{no planning} & " + + bs + "multicolumn{" + str(npl) + "}{c}{one proposer per row, same 128 candidates} & " + bs + bs + + chr(10) + bs + "cmidrule(lr){2-" + str(1 + len(ref)) + "} " + + bs + "cmidrule(lr){" + str(2 + len(ref)) + "-" + str(1 + len(ref) + npl) + "}") + return (bs + "begin{table}[t]" + chr(10) + bs + "centering" + chr(10) + + bs + "caption{" + bs + "textbf{Planning methods on one proposer per row.} Every column right " + "of the rule ranks the identical $128$ candidates drawn from the identical actor, so only the " + "value estimate differs: " + bs + "emph{P-greedy} is that proposer sampled once (no selection), " + + bs + "emph{rand-128} picks uniformly among the same candidates, " + bs + "emph{P-critic} is the " + "proposer's own co-trained IQL critic --- RISE's and IDQL's value estimate on this actor --- and " + "then the added scorers and RSM. BC and BC-u are standalone policies that neither propose nor " + "rank, so they are reported left of the rule as the bar to clear and excluded from $" + bs + "Delta$, " + "which is the margin over the strongest planning comparator; a row where BC or BC-u exceeds RSM " + "carries $^{" + bs + "dagger}$. Published-method columns that plan from their own proposer (IDQL, " + "RISE) are in Table~" + bs + "ref{tab:flagship_single_actor}; paired significance tests against the " + "two controls are in Table~" + bs + "ref{tab:matched_actor}. Protocol and seeds as in " + "Table~" + bs + "ref{tab:flagship_single_actor}. Every column right of the rule reads the " + "coin-terminated $" + bs + "beta$-chain cells only, RSM and TD-Flow included: a row whose chain " + "re-score has not landed prints its launch state rather than the superseded deterministic-fold " + "number, which is never substituted for it. The retired fold numbers for every method scored " + "that way are in Table~" + bs + "ref{tab:ablation_betarec}. " + + bs + "textbf{Bold} is the best number printed in the row, reference policies " + "included --- this table has planning comparators the single-actor table does not, " + "so a cell is bolded here only if it leads THIS row. Rows are " + "Sq-S square-Sub, Sq-C square-Cov, Pc-S " + "piece-Sub, Pc-C piece-Cov, Mug, Thr threading, Pc-tip piece-tip. A cell reads " + + bs + "textit{pend k/9} when fewer than the $3{" + bs + "times}3$ seed cells have landed, " + + bs + "textit{launched} when its jobs are queued on that proposer, " + bs + "textit{queued} when the " + "model is trained and its evaluation has not landed, " + bs + "textit{trn} with the checkpoint step or " + "seeds done while the model is still training, " + bs + "textit{n/a} where the method does not exist " + "for that proposer (a BC actor has no co-trained critic), and -- when nothing exists for it. " + "Status words are derived from the run artefacts at generation time.}" + + chr(10) + bs + "label{tab:flagship_all}" + chr(10) + bs + "scriptsize" + chr(10) + + bs + "setlength{" + bs + "tabcolsep}{1.5pt}" + chr(10) + + bs + "begin{tabular}{" + cols + "}" + chr(10) + bs + "toprule" + chr(10) + + grp + chr(10) + + "Task & " + " & ".join(heads) + " & RSM & $" + bs + "Delta$ " + bs + bs + chr(10) + + bs + "midrule" + chr(10) + chr(10).join(body) + chr(10) + bs + "bottomrule" + chr(10) + + bs + "end{tabular}" + chr(10) + bs + "end{table}" + chr(10)) + + +def _seed_tier_key(rate_, n_, seeds_, cells_=None, need_=9): + """Rank one candidate arm against another for a printed table. + + THREE TIERS, in this order, and the order is the whole point. + + 1. GRID COMPLETENESS (added 2026-09-23, gen_q#267). An arm that has landed on the FULL + 3 policy x 3 eval-seed grid outranks any arm that has not, however high the partial arm + scores. Before this tier the key was (seeds, rate, n): an arm with all three POLICY seeds + but only 7 of its 9 CELLS tied on the seed tier and then won on RATE, so a half-landed arm + displaced a complete one and printed with the same `(3)` subscript and no mark -- the reader + could not tell 350 episodes on an unbalanced grid from 450 on a balanced one. It bit on + piece-assembly tip: the complete 9/9 arm (5.56 +- 1.56, 450 ep) was displaced by a 7/9-cell + arm reading 7.11, a +1.6 headline jump produced entirely by an in-flight arm entering the + maximum. `n` only ever broke ties in rate, so it never stopped this. + 2. POLICY-SEED TIER, capped at 3 (2026-09-21), for the same reason one level up. + 3. Rate, then episode count. + + `cells_=None` means "completeness unknown" and ranks as complete, so a caller that cannot + supply a cell count is no worse off than before; every call site in this file supplies one.""" + return (1 if (cells_ is None or cells_ >= need_) else 0, min(seeds_, 3), rate_, n_) + + +def _n128(recipe): + """Is this an N=128 arm? + + Was `recipe.endswith(" N128")`, whose own comment warned "if the suffix convention changes, this + predicate silently changes meaning". It did: the arm key now always appends the read-out + (" P ") and, since today, a hop-family suffix, so NO recipe ends with " N128" + any more. Measured across all seven tasks: `endswith` matched 0 arms while a word-boundary test matched + 13-37 per task, so _best_arm was silently selecting from an EMPTY set on every task. The read-out is + part of the disclosed search (stated on gen_q#266), so N=128 arms are compared across read-outs, which + is also what the build() loop has always done. + """ + # TWO SPELLINGS (2026-09-21). RSM arms carry the count inside the recipe as " N128 " followed by the + # read-out; the critic families (`critic`, `critic:ifql`) have the recipe "N=128" and nothing else. + # `\bN128\b` matched the first and not the second, so critic:ifql was vacuous -- as the original + # `endswith(" N128")` had been for it all along. The new vacuous-filter guard caught it immediately + # and aborted generation, which is the intended behaviour. + return re.search(r"\bN=?128\b", recipe) is not None + + +def check_drift(rows): + """Cross-check this generator against its OWN twin in docs/MASTER_TABLE.md: section 0. + + WRONG SECTION (2026-09-21). This used to read section 1 and compare `r["pooled"]` against it, and it + fired with `DRIFT: Mug (Sub.) LaTeX 12.67 != MASTER_TABLE.md 17.1` -- correctly reporting a difference, + but between two tables that are DIFFERENT BY DESIGN. Section 1 is master_table.py's own flagship, which + takes the best arm over every proposer: its mug row is the BC-expert proposer (17.1, and its own permuted + control scores 17.56, which is why that row is already marked "no gain"). This generator emits the + SINGLE-ACTOR table, where every task proposes from the RISE actor, and mug is 12.67 there. Since + master_table.py builds section 0 by calling this module's own `build()`, section 0 is the real twin. + + Comparing the RENDERED cell rather than a number: the markdown prints the across-seed mean with its SE and + seed subscript while `pooled` is the episode-weighted rate, so the old numeric comparison was also + comparing two different quantities under a 0.05 tolerance. Identical strings is the right test here -- + both sides come from one `build()`, so any difference means they were generated from different data, or + with a different RSM_PROPOSER, which is exactly what is worth catching. + """ + md, inside, header_seen = {}, False, False + for line in (ROOT / "docs" / "MASTER_TABLE.md").read_text().splitlines(): + if line.startswith("## "): + inside = "Single-actor flagship" in line + header_seen = False + continue + if not inside: + continue + if line.startswith("| Task | BC |"): + header_seen = True + continue + if not header_seen: + continue + if not line.startswith("| "): + if md: + break # first table of the section ended + continue + f = [x.strip() for x in line.split("|")] + if len(f) > 9 and not f[1].startswith("-"): + # f[8] is the RSM (RISE actor) cell, as rendered. Since gen_q#267 that column is the + # CHAIN read-out (the retired fold maximum moved to its own trailing column), so the guard + # compares against rsm_chain_disp below -- comparing it against r["rsm"] would now fire on + # every row for the good reason that the two are different estimators. + md[f[1]] = f[8] + if not md: + raise SystemExit("DRIFT CHECK CANNOT RUN: no single-actor table found in docs/MASTER_TABLE.md. " + "Run scripts/master_table.py first, or pass --no-check. Refusing to write a table " + "whose twin could not be read -- a guard that silently skips is worse than none.") + def _render(x): + x = x.replace("{\\pm}", "\u00b1").replace("^{\\dagger}", "\u2020").replace("^{*}", "*") + x = x.replace("_{(", "\u208d").replace(")}", "\u208e").replace("$", "") + x = re.sub(r"\\mathrm\{([^}]*)\}", r"\1", x) + x = re.sub(r"\\textit\{([^}]*)\}", r"*\1*", x) + return re.sub(r"\\mathbf\{([^}]*)\}", r"**\1**", x) + for r in rows: + exp = md.get(r["label"]) + got = _render(r["rsm_chain_disp"]) + if exp is not None and exp != got: + raise SystemExit(f"DRIFT: {r['label']} RSM cell is {got!r} here but {exp!r} in " + "docs/MASTER_TABLE.md section 0. Both come from flagship_latex.build(), so they " + "were generated from different data or a different RSM_PROPOSER. Regenerate the " + "markdown first, or pass --no-check.") + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("-o", "--out", default=str(ROOT / "docs" / "tex" / "flagship_table.tex")) + ap.add_argument("--no-check", action="store_true", help="skip the drift guard against MASTER_TABLE.md") + ap.add_argument("--no-sync", action="store_true", + help="do NOT regenerate the markdown first; read whatever is on disk") + a = ap.parse_args() + + # ONE SNAPSHOT FOR BOTH ARTEFACTS. While top-up jobs are landing, the markdown and the LaTeX are + # two reads of a moving directory seconds apart, and they disagree for that reason alone -- the + # drift guard fired twice on exactly this (mug 16.0 -> 12.0, piece-assembly (Cov.) 32.0 -> 35.3) + # when nothing was actually wrong. Importing master_table regenerates docs/MASTER_TABLE.md AND + # leaves its memoised cell snapshot warm; building the LaTeX from that same function makes the two + # documents consistent by construction, so a surviving drift error means a real disagreement. + cells_fn = cells + if not a.no_sync: + import contextlib, io + with contextlib.redirect_stdout(io.StringIO()): + import master_table as _mt + cells_fn = _mt.cells + + rows, counts = build(cells_fn) + # A "--" in a baseline column means that baseline is still TRAINING, not that it was omitted. + # Saying which one, and on how many tasks, keeps an unfinished column from reading as a missing + # comparison the authors chose not to run. + n_no_idql = sum(1 for r in rows if r["base"][3] == r"\text{--}") + if not a.no_check: + check_drift(rows) + + # CHAIN-ONLY, like tab:flagship (2026-09-23; the last read-out mix in a published table). This + # printed r["rsm"] -- the maximum over BOTH the coin chain and the RETIRED deterministic fold -- + # under a column headed only "RSM (ours)", two tables below tab:flagship's chain-only column of the + # same name. That is the substitution the owner ruled out on 2026-09-22 ("never a fold number + # silently standing in for a chain number") and it is the defect that already forced two public + # corrections (#272's Square (Cov.) 20.9, and the upper-bound section of MASTER_TABLE.md). The + # baselines come from `base_chain` and the margin from `db_chain` so the bolding and Delta are + # computed against the number actually printed; a row with no >=2-seed chain arm prints its launch + # status exactly as tab:flagship does. The fold maximum keeps tab:ablation_betarec. + top = "\n".join( + " & ".join([r["label"], *r["base_chain"], r["rsm_chain_disp"], r["db_chain"]]) + r" \\" + for r in rows) + bot = "\n".join( + " & ".join([r["label"], *r["tbase"], r["trsm"], r["tdb"]]) + r" \\" + for r in rows) + # THROUGHPUT MOVED OUT (gen_q#268). With the IFQL baseline column added, Table 1 carrying the + # throughput block overflowed ICLR's 397.5pt text block by 3.8pt (scripts/check_iclr_fit.sh), and + # the throughput rows are the widest content in it: "$0.093{\pm}0.021$" against a success rate's + # "$9.2{\pm}2.0_{(3)}$". The issue's instruction is explicit that the fix is to move the block to + # its own table rather than to shrink below \scriptsize, so the success-rate table keeps the block + # out and Table~\ref{tab:throughput} carries it with the identical columns and row order. + body = top + data_body = "\n".join( + " & ".join([r["label"], r["exp"], r["sub"], r["med"]]) + r" \\" for r in rows) + match_body = "\n".join( + " & ".join([r["label"], r["mg"], r["mq"], r["mr"], r["mdg"], r["mdq"]]) + r" \\" + for r in rows if r["mr"] != "--") + actor_body = "\n".join( + " & ".join([r["label"], r["ag"], r["aq"], r["arand"], r["ar"], + *[r["axs"][k] for k, _ in EXTRA_SCORERS], r["adg"], r["adq"]]) + r" \\" + for r in rows if r["ar"] != "--") + # IFQL VALUE RESOLUTION, per task in row order, for the captions of BOTH tables that carry an IFQL + # column. "--" until a bundle exists; the warning is rendered in the caption itself, in bold, so a + # reader of the table cannot miss it. + def _spread_field(rs): + """RANKING FIRST. A wide global Q range is not evidence that a critic ranks actions -- RISE's + own IQL critic has provenance AUC 0.81-1.00 and still selects at chance -- so the caption leads + with the scale-free expert-action rank percentile and the per-state spread, and labels the global + range as context.""" + rank, ps, ctx, warn, warn_rank = [], [], [], False, False + for r in rs: + d = r["ifqspread"] + rank.append("/".join(f"{x:.0f}" for x in d["rank_pct"]) or "--") + # scientific notation under 0.01 bins: a 3e-4 spread printing as "0.00" would hide + # the very thing the number exists to expose. + ps.append("/".join((f"{x:.2f}" if x >= 0.01 else f"{x:.1e}") + for x in d["per_state_bins"]) or "--") + ctx.append("/".join(f"{x:.1f}" for x in d["q_range_in_bins"]) or "--") + warn = warn or d["warn"] + warn_rank = warn_rank or d["warn_rank"] + bs = chr(92) + txt = ("recorded-action rank pct.\\ ($50$ = chance) " + "; ".join(rank) + + "; per-state $Q$ spread " + "; ".join(ps) + + " bins; global range (context only) " + "; ".join(ctx) + " bins") + if warn_rank or warn: + bad = ", ".join(r["label"] for r in rs + if r["ifqspread"]["warn"] or r["ifqspread"]["warn_rank"]) + # The disclosure itself is NOT negotiable for a compile; only its wording is. + txt += (" " + bs + "textbf{On " + bad + " the IFQL critic selects at or near chance, so " + "that entry is a random-of-128 rather than a value baseline.}") + return txt + + def _health_table(rows): + """Health numbers for every scorer as their own table (gen_q#268 standing rule), replacing the + caption paragraph that carried them. That paragraph grew with every scorer that gained a health + number -- 1.4 kB once LeWM populated, with DINO-WM and TD-Flow still to land -- and each time it + pushed the matched-actor caption block past what tectonic will set ("Dimension too large"). A + table's size is bounded by scorers x metrics, not by prose, and a reader can find a number in it. + Rows: (scorer, metric); columns: tasks in flagship row order. A metric row is emitted only when + some task has it, since dispersion ratio is TD-Flow-only and win rate is checkpoint-dependent.""" + bs = chr(92) + g = lambda x, n=3: ("--" if x is None else f"{x:.{n}g}") + # SHORT LABELS (2026-09-21): the first emission overflowed the text block by 131 pt, mostly from + # "target-dispersion ratio (ref. 1.27)". Each metric is defined in the caption, so the cell label + # only has to be recognisable. + metrics = [("rank_pct_expert", "rank pct"), ("spread", "spread"), + ("ties_at_max", "ties/128"), + ("target_dispersion_ratio", "disp. ratio"), + ("ckpt_action_winrate", "win rate")] + body = [] + for k, lab in [("rsm:membership", "RSM")] + list(EXTRA_SCORERS): + hs = [(r["health_rsm"] if k == "rsm:membership" else (r["health"] or {}).get(k)) or {} for r in rows] + if not any(hs): + continue + first = True + for mk, ml in metrics: + if not any(h.get(mk) is not None for h in hs): + continue + cells = " & ".join(g(h.get(mk)) for h in hs) + body.append(f"{(lab if first else '')} & {ml} & {cells} " + bs + bs) + first = False + body.append(bs + "addlinespace[2pt]") + if not body: + return "" + # Abbreviated task headers for this table only; the caption states the mapping and the row order. + _ab = {"Square (Sub.)": "Sq-S", "Square (Cov.)": "Sq-C", "Piece (Sub.)": "Pc-S", "Piece (Cov.)": "Pc-C", + "Mug (Sub.)": "Mug", "Thread (Cov.)": "Thr", "Piece-tip (Cov.)": "Pc-tip"} + heads = " & ".join(_ab.get(r["label"], r["label"]) for r in rows) + cols = "ll" + "c" * len(rows) + return (bs + "begin{table}[t]" + chr(10) + bs + "centering" + chr(10) + + bs + "caption{" + bs + "textbf{Scorer health, matched-actor table.} Columns are the flagship rows in " + "order (Sq-S square-Sub, Sq-C square-Cov, Pc-S piece-Sub, Pc-C piece-Cov, Mug, Thr threading, Pc-tip piece-tip), independently checkable from the eval artefacts: the recorded action's rank percentile " + "among the 128 candidates on one shared candidate set; the read-out's spread over the 128 " + "candidates at a state; how many of the 128 tie at the arg-max (an arg-max over $k$ tied " + "candidates is a uniform draw among those $k$ -- a coarse filter plus resampling -- and in " + "simulation the read-out that ties most candidates outperforms the one that orders all 128, so a " + "high count is not by itself evidence of worse ranking); TD-Flow's target-dispersion ratio " + "against the measured Monte-Carlo reference; and the checkpoint's held-out true-vs-shuffled " + "action win rate, a two-candidate percentile. A scorer absent here has no health number and is " + "marked $" + bs + "ddagger$ in Table~" + bs + "ref{tab:matched_actor}: not reportable by our own rule.}" + + chr(10) + bs + "label{tab:scorer_health}" + chr(10) + bs + "scriptsize" + chr(10) + + bs + "setlength{" + bs + "tabcolsep}{2.5pt}" + chr(10) + + bs + "begin{tabular}{" + cols + "}" + chr(10) + bs + "toprule" + chr(10) + + "Scorer & metric & " + heads + " " + bs + bs + chr(10) + bs + "midrule" + chr(10) + + chr(10).join(body) + chr(10) + bs + "bottomrule" + chr(10) + + bs + "end{tabular}" + chr(10) + bs + "end{table}" + chr(10)) + + def _health_field(rows): + """The per-scorer health line for the caption (gen_q#268 standing rule). + + Three numbers, in decreasing order of how much they tell you, and all independently + checkable from artefacts on disk: + * READ-OUT SPREAD over the 128 candidates at one state, with the number of candidates that + TIE at the arg-max. A column whose read-out ties across a large share of the candidates + IS a random-of-128 however good its provenance AUC -- which is exactly how the RISE + critic was caught -- so this is the number that decides whether a column is a value + baseline at all. Free: every eval JSON's per-episode `plan` block already records it. + * TARGET-DISPERSION RATIO, TD-Flow only: td_vs_mc / mc_vs_mc at the evaluated checkpoint + against the MEASURED reference (two independent Monte-Carlo draws at the same anchor and + capped beta), where a converged ordinary RSM model reads 1.27. + * the checkpoint's own held-out action win rate (true logged chunk vs a shuffled one) -- + a TWO-candidate rank percentile, labelled as that and not as the 128-candidate + expert-action percentile IFQL reports. + """ + g = lambda x, n=3: ("--" if x is None else f"{x:.{n}g}") + parts, warn = [], [] + for k, lab in [("rsm:membership", "RSM")] + list(EXTRA_SCORERS): + got = [] + for r in rows: + h = r["health_rsm"] if k == "rsm:membership" else (r["health"] or {}).get(k) + if not h: + got.append("--") + continue + bits = [] + if h.get("rank_pct_expert") is not None: + bits.append(f"r{g(h['rank_pct_expert'])}") + bits += [f"{g(h.get('spread'))}", f"{g(h.get('ties_at_max'))}t"] + if h.get("target_dispersion_ratio") is not None: + bits.append(f"{g(h['target_dispersion_ratio'])}x") + if h.get("ckpt_action_winrate") is not None: + bits.append(f"w{g(h['ckpt_action_winrate'])}") + got.append("/".join(bits)) + if h.get("warn_no_ranking"): + warn.append((lab, r["label"], h.get("ties_at_max"), h.get("n_candidates"), + h.get("spread"))) + if any(x != "--" for x in got): + parts.append(lab + " " + "; ".join(got)) + bs = chr(92) + if not parts: + return ("No scorer has a health number yet, so every scorer entry carries $" + + bs + "ddagger$ and none is reportable.") + # POINTER, NOT PAYLOAD (2026-09-21). The numbers themselves now live in tab:scorer_health; the + # caption only says where and what a missing one means. `parts` is still computed so the + # tie-warning below has its inputs. + txt = ("Every scorer's health numbers (rank percentile, read-out spread, ties at the arg-max, " + "dispersion ratio, action win rate) are in Table~" + bs + "ref{tab:scorer_health}; $" + + bs + "ddagger$ $=$ no health number, so not reportable by our own rule.") + if warn: + # Say WHAT the number is and what it licenses, not a verdict. An arg-max over k tied + # candidates is a uniform draw among those k -- a coarse filter plus resampling -- which + # is a weaker claim than "chance" and a much weaker one than "it ranks". + # COMPACT, AND THE ADVICE CORRECTED (2026-09-21). This used to enumerate every tied + # column in prose -- eleven clauses, about 1.2 kB in one paragraph, which is what pushed + # the caption block past what LaTeX would set ("Dimension too large"). It also ended + # "prefer the un-saturating logit read-out on those rows", which MEASUREMENT CONTRADICTS: + # over fully-seeded arms on the RISE actor the logit read-out ties exactly 1 candidate and + # is the WORSE read-out in simulation (threading median 2.0 vs prob's 9.9, mug 6.4 vs 9.7), + # because it reads only the terminal hop and discards the product fold. A high tie count + # is therefore not by itself evidence that a scorer ranks worse, and the caption must not + # tell a reader otherwise. + _tied = sorted({(lab, task, ties, nc) for lab, task, ties, nc, _sp in warn + if ties is not None and nc}) + if _tied: + _worst = max(_tied, key=lambda x: x[2] / x[3]) + _byl = {} + for lab, _t, _ti, _nc in _tied: + _byl[lab] = _byl.get(lab, 0) + 1 + _who = ", ".join(f"{lab} on {n} of {len(rows)} rows" for lab, n in sorted(_byl.items())) + txt += (" " + bs + "textbf{Tied at the arg-max on some rows (" + _who + + "; worst " + f"{_worst[2]:.0f}" + " of " + f"{_worst[3]:.0f}" + + " on " + _worst[1] + "): there the arg-max is a uniform draw among the tied " + "candidates, a coarse filter plus resampling rather than a ranking. Note this " + "does not by itself mean the column ranks worse -- the fully-ordering logit " + "read-out ties $1$ candidate and scores lower in simulation, since it reads " + "only the terminal hop and drops the product fold.}") + return txt + + # ONLY the printed rows: the caption says "per task in row order", and `rows` still holds the + # tasks the body drops, so passing all of them would silently misalign the list with the table. + _health_line = _health_field([r for r in rows if r["ar"] != "--"]) + _health_table = _health_table([r for r in rows if r["ar"] != "--"]) + _spread_all = _spread_field(rows) + _spread_actor = _spread_field([r for r in rows if r["ar"] != "--"]) or "--" + _w = counts[WIN] + # THE SEARCH SIZE MUST COUNT THE ARMS THE COLUMN RANGES OVER (2026-09-23). `nsearch` counts every + # membership arm at any read-out; the column is now chain-only, so it ranges over `nchain`. Quoting + # the larger number beside the smaller maximum overstates the winner's curse in our own favour. + _search = "/".join(str(r["nchain"]) for r in rows) + _beps = ", ".join(f"{k} {sum(r['beps'][k] for r in rows if r['beps'][k])}" for k, _ in BASE) + # COLUMN ARITHMETIC, derived from BASE / EXTRA_SCORERS so a new column cannot desynchronise the + # tabular preamble from the row bodies. ICLR's text block is 5.5in; \tabcolsep is the one knob that + # buys width back, and it is narrowed automatically once a table is wide enough to need it (the + # alternative the issue notes -- moving the throughput block to the appendix -- is a content change + # and is left to a human). + _nb, _nx = len(BASE), len(EXTRA_SCORERS) + # +1 on the actor table for the random-of-N control column, which sits inside the scorer block + # (it IS a selection rule -- "pick one of the N uniformly" -- not a margin). + _fl_n, _ac_n = 3 + _nb, 7 + _nx # total columns of the two tabulars + tex = TEMPLATE.format(body=body, thr_body=bot, data_body=data_body, match_body=match_body, ntask=len(rows), neps=sum(r["eps"] for r in rows), + fl_cols="l" + "c" * (_fl_n - 1), nbase=_nb, base_end=1 + _nb, + base_head=" & ".join(lab for lab, _ in BASE), + colsep=("2pt" if _fl_n >= 9 else "3pt"), + # The throughput table has the SAME columns but wider cells -- + # "$0.093{\pm}0.021$" against a success rate's "$9.2{\pm}2.0_{(3)}$", two + # extra characters in every one of them -- so at 9 columns it is still 3.7pt + # over the text block after being split out. \tabcolsep is the only knob + # left that is not the font size, which gen_q#268 forbids shrinking further. + thr_colsep=("0.8pt" if _fl_n >= 10 else "1.2pt" if _fl_n >= 9 else "3pt"), + ac_cols="l" + "c" * (_ac_n - 1), nscorer=4 + _nx, scorer_end=5 + _nx, + marg_lo=6 + _nx, marg_hi=7 + _nx, + xhead=" & ".join(lab for _, lab in EXTRA_SCORERS), + # The matched-actor tabular gained columns (rand + EXTRA_SCORERS, now 12) + # and at 2pt it runs 4.69pt over ICLR's 397.5pt text block -- check_iclr_fit + # has been reporting FAIL on tab:matched_actor since the DF column appeared. + # \tabcolsep is the documented knob (see thr_colsep, which already tiers the + # same way); one column's worth of separation is 2*\tabcolsep, so 12 columns + # buy back 24*0.5 = 12pt at 1.5pt -- comfortably clear of the 4.69pt overflow + # without touching the font size, which gen_q#268 forbids shrinking further. + acolsep=("1.5pt" if _ac_n >= 11 else "2pt" if _ac_n >= 9 else "3pt"), + search=_search, beps=_beps, + fammed="/".join("--" if r["fam"][1] is None else "%.1f" % r["fam"][1] for r in rows), + famn="/".join(str(r["fam"][0]) for r in rows), + # UNCONDITIONAL. The paper table above emits \label{tab:flagship} + # unconditionally, so making this one conditional could only ever produce a + # DUPLICATE label in the same document -- which is what the 07:34Z and + # 10:32Z bundles shipped (both had tab:flagship at lines 9 and 106, so every + # \ref{tab:flagship} resolved to the single-actor table and + # tab:flagship_single_actor was undefined). The unpinned build still says so + # in its caption via proposer_dim below; it does not get to steal the label. + tab_label="tab:flagship_single_actor", + proposer_dim=("" if RSM_PROPOSER else ", proposer"), + actor_note=_actor_note(rows), + mcells="/".join(str(r["mcells"]) for r in rows if r["mr"] != "--"), + actor_body=actor_body, + acells="/".join(str(r["acells"]) for r in rows if r["ar"] != "--"), + randcells="/".join(str(r["arandcells"]) for r in rows if r["ar"] != "--"), + # SEARCH SIZE PER SCORER (gen_q#268): every column here is a maximum over + # the configurations evaluated for that scorer, and those budgets are not + # equal, so each one is stated. + xsearch="; ".join( + f"{lab} {'/'.join(str(r['axsearch'][k]) for r in rows if r['ar'] != '--')}" + for k, lab in EXTRA_SCORERS), + xcells="; ".join( + f"{lab} {'/'.join(str(r['axcells'][k]) for r in rows if r['ar'] != '--')}" + for k, lab in EXTRA_SCORERS), + ifqspread=_spread_all, ifqspread_actor=_spread_actor, + health_line=_health_line, + paper_table=_paper_table(rows), + controls_table=_controls_table(rows), + fold_table=_fold_table(rows), + all_table=_all_table(rows), + discount_table=_discount_table(rows), + audit_section=_audit_section(rows), + health_table=_health_table, + ifqwarnbins=f"{IFQL_SPREAD_WARN_BINS}", + nwin=_w, verb="shows" if _w == 1 else "show", + verb2="scores" if counts[BELOW] == 1 else "score", + nbelow=counts[BELOW], nundec=counts[UNDEC], + idqlnote=("" if not n_no_idql else + f" The IDQL critic is still training on {n_no_idql} of the " + f"{len(rows)} tasks; those cells are marked ``--'' and are not " + f"omitted comparisons.")) + out = Path(a.out) + out.parent.mkdir(parents=True, exist_ok=True) + out.write_text(tex) + # The flagship table on its own, for pasting into the manuscript. Same generator, same numbers as the + # copy inside `out`, so the two can never drift. + solo = out.parent / "flagship_paper.tex" + solo.write_text("% The flagship table. Generated by scripts/flagship_latex.py -- regenerate, do not edit.\n" + "% Requires only \\usepackage{booktabs}; sized for ICLR's 5.5in (397.5pt) text block.\n\n" + # TABLE ORDER (owner, 2026-09-23 04:15): "we can keep the beta-recursion versions as + # an ablation table. just make this the second table in the flagship pdf under the + # flagship runs." So: tab:flagship, then tab:ablation_betarec, then tab:controls, + # tab:discounts and the audit tables. It used to sit third, behind tab:controls. + + _paper_table(rows) + "\n" + _fold_table(rows) + "\n" + _controls_table(rows) + + "\n" + _discount_table(rows) + # THE AUDIT TRAVELS WITH THE TABLE (owner 2026-09-22). The \TODO in + # tab:flagship's caption asks whether the flagship RSM uses a return-based reward + # and a proper beta recursion; the answer is only worth anything next to the + # numbers it is about, so it is emitted into the SAME artefact, from the same run, + # with its verdicts read out of status/rsm_audit.json. + + "\n" + _audit_section(rows)) + print(f"wrote {solo}", file=sys.stderr) + print(tex) + print(f"[flagship_latex] wrote {out}", file=sys.stderr) + + +TEMPLATE = r"""% Flagship comparison under the RISE-faithful (data-provenance) reward. +% Generated by scripts/flagship_latex.py -- regenerate rather than editing by hand. +% Preamble: \usepackage{{booktabs}} <- the ONLY package this table needs. +% Sized for ICLR's 5.5in (397.5pt) text block; verified with scripts/check_iclr_fit.sh. + +{paper_table} + +{fold_table} + +{controls_table} + +\begin{{table}}[t] +\centering +\caption{{\textbf{{Preliminary results under the RISE-faithful reward.}}{actor_note} All methods see the same +reward: the dataset's binary data-provenance label ($1$ on every frame of an expert episode, $0$ on +every frame of a suboptimal one), which is what RISE's \texttt{{relabel\_rewards.py}} writes and its IQL +critic consumes unchanged; BC and BC-u use no reward by construction. RISE-g samples the RISE actor +once with no critic ranking, i.e.\ the RISE policy without its selection step. \textbf{{IFQL}} (implicit flow Q-learning) as published --- its own flow actor ranked by its expectile critic --- did not yield a functional policy in this observation space (a per-step flow actor against a chunked diffusion proposer, frozen DINO features in place of its native encoder; with ranking off it already scores $5.3$ and $0.7\,\%$ against $9.0$ and $0.2\,\%$ with the critic), so its column reads ``n/a'' and its critic is compared on the common proposer in Table~\ref{{tab:flagship}} and Table~\ref{{tab:matched_actor}}, with ranking diagnostics in \S\ref{{sec:value-selection-impossible}}. \textbf{{Bold}} marks the best +method on each task. Entries are mean\,$\pm$\,standard error \emph{{across seeds}}, with the seed +count as a subscript; a seed varies the policy action draw and the environment initial conditions with +the network initialisation held fixed, and the seed is the unit of replication +(\S\ref{{sec:seed-semantics}}). $\dagger$ marks +a single-seed entry, where no seed variance is measurable and the interval shown is binomial over that +seed's episodes; read those rows as provisional. $\\circ$ marks an entry whose arm has not yet +landed on the full $3\\times3$ policy\\,$\\times$\\,eval-seed grid; the subscript counts policy seeds only, +so without this mark a partly-landed arm is indistinguishable from a complete one. An arm on the +complete grid is always preferred to a partly-landed one however high the latter scores, so this mark +can appear only where no arm on that row has finished. $\Delta$ is the margin of RSM over the strongest baseline on that task, +with $^{{*}}$ marking $p<0.05$ under a two-proportion $z$-test. Tasks: Square $=$ square-peg, +Piece $=$ piece-assembly, Piece-tip $=$ piece-assembly with tipped initialisation, Thread $=$ threading; +(Sub.) and (Cov.) are the suboptimal and coverage data regimes; demonstration counts are in +Table~\ref{{tab:data}}. The RSM column reads the coin-terminated $\beta$-chain cells \emph{{only}}, as in +Table~\ref{{tab:flagship}}: a task whose chain re-score has not landed prints its launch state rather +than the superseded deterministic-fold number, and the retired fold numbers are in +Table~\ref{{tab:ablation_betarec}}. The RSM entry on each task is the best of the successor-model chain +configurations (model size, discount, particles, read-out, candidate count{proposer_dim}) evaluated +there -- {search} configurations per task in row order, single-seed ones included -- so it is a maximum +over a search, whereas each baseline is a single configuration; the held-out analysis +(\texttt{{scripts/heldout\_table.py}}) selects on one seed +and scores on the others. Because a maximum over a search carries the winner's curse even when the search +is disclosed, we also give the \\emph{{median}} over every fully seeded chain configuration of the same family, a +number that does not depend on picking a winner: {fammed} per task in row order, over {famn} such +configurations. Where the median still exceeds every baseline the row is robust to that choice. Episodes behind each column: {beps} across the baselines (every epoch-5000 +evaluation of that policy is pooled), {neps} behind the RSM entries (50 per seed).}} +\label{{{tab_label}}} +\scriptsize +\setlength{{\tabcolsep}}{{{colsep}}} +\begin{{tabular}}{{{fl_cols}}} +\toprule +& \multicolumn{{{nbase}}}{{c}}{{Baselines}} & & \\ +\cmidrule(lr){{2-{base_end}}} +Task & {base_head} & RSM (ours) & $\Delta$ \\ +\midrule +{body} +\bottomrule +\end{{tabular}} +\end{{table}} + +{all_table} + +{discount_table} + +{audit_section} + +\begin{{table}}[t] +\centering +\caption{{\textbf{{Matched proposer: same candidates, different scorer.}} All three columns sample the +\emph{{same}} 128 candidates from the \emph{{same}} BC-union policy under the same data-provenance +reward; only the ranking function differs. \textbf{{greedy}} takes one sample without ranking, +\textbf{{IQL}} ranks with the IQL critic (the mechanism RISE and IDQL share), \textbf{{RSM}} ranks with +our successor model. Fixing the proposal policy is what makes this comparison fair -- RISE is IDQL with +a different policy, so a margin obtained by also changing the proposer would not isolate the scorer. +Read the \textbf{{vs.\ greedy}} column as what selection buys: the IQL critic is a weak ranker in this +setting, scoring \emph{{below}} greedy on several tasks and on its own proposer, so the margin over it +alone would overstate the contribution of our scorer. All three columns of a row are read on the +same set of (policy seed, evaluation seed) cells -- {mcells} cells per task in row order, 50 episodes +each -- and the RSM subscript is the number of policy seeds behind it; the RSM configuration is the +best configuration on that proposer with at least two seeds, or the single-seed best where none exists.}} +\label{{tab:matched}} +\footnotesize +\setlength{{\tabcolsep}}{{5pt}} +\begin{{tabular}}{{lccccc}} +\toprule +& \multicolumn{{3}}{{c}}{{Scorer (BC-union proposer, $N{{=}}128$)}} & \multicolumn{{2}}{{c}}{{RSM margin}} \\ +\cmidrule(lr){{2-4}} \cmidrule(lr){{5-6}} +Task & greedy & IQL & RSM & vs.\ greedy & vs.\ IQL \\ +\midrule +{match_body} +\bottomrule +\end{{tabular}} +\end{{table}} + +\begin{{table}}[t] +\centering +\caption{{\textbf{{Matched proposer, RISE's own actor.}} The same protocol as Table~\ref{{tab:matched}} +with RISE's policy as the proposer: RISE's actor, RISE's reward, and only the ranking function swapped. +\textbf{{RISE-g}} is that actor sampled once, \textbf{{RISE}} is its released critic-ranked rollout +(128 samples, argmax of the co-trained IQL critic), \textbf{{RSM}} ranks the same 128 samples with our +successor model. The three added scorers (\textbf{{TD-Flow}}, \textbf{{LeWM}}, \textbf{{DINO-WM}}) and +\textbf{{IFQL}} are defined in \S\ref{{sec:added-scorers}}; whether IFQL orders the $128$ candidates at +all (\S\ref{{sec:value-selection-impossible}}) is reported with it, in row order: {ifqspread_actor}. +\textbf{{rand}} is the random-candidate control: it draws the same $N{{=}}128$ candidates and executes +one of them uniformly, so $\textrm{{RSM}}-\textrm{{rand}}$ is the part of the margin attributable to +\emph{{ranking}} rather than to sampling breadth. Every column ranks the \emph{{same}} 128 candidates at every decision step. Same (policy seed, +evaluation seed) cells across a row -- {acells} cells per task in row order, {randcells} for the +control; a $\dagger$ marks a column that has not yet run all of them, with the scorers' own counts +{xcells}. Each scorer column is the best of the +configurations evaluated for it on this proposer -- {xsearch} configurations per task in row order -- +so the budgets differ between columns and are stated rather than assumed equal. {health_line} +Cells differing only in particle count or in the probability-vs-logit read-out are +\emph{{different scorers}} and are never pooled into one arm; the read-out is instead part of the +disclosed per-column search counted above.}} +\label{{tab:matched_actor}} +\scriptsize +\setlength{{\tabcolsep}}{{{acolsep}}} +\begin{{tabular}}{{{ac_cols}}} +\toprule +& \multicolumn{{{nscorer}}}{{c}}{{Scorer (RISE-actor proposer, $N{{=}}128$)}} & \multicolumn{{2}}{{c}}{{RSM margin}} \\ +\cmidrule(lr){{2-{scorer_end}}} \cmidrule(lr){{{marg_lo}-{marg_hi}}} +Task & RISE-g & RISE & rand & RSM & {xhead} & vs.\ RISE-g & vs.\ RISE \\ +\midrule +{actor_body} +\bottomrule +\end{{tabular}} +\end{{table}} + +{health_table} + +\begin{{table}}[t] +\centering +\caption{{\textbf{{Data regime.}} Demonstration counts per task, and the median length of an expert +demonstration against the 400-step evaluation horizon (the horizon enters the throughput definition in +Table~\ref{{tab:throughput}}). ``Expert'' and ``Suboptimal'' are the two files RISE's reward labels +distinguish: every frame of an expert episode carries reward $1$ and every frame of a suboptimal one +carries $0$.}} +\label{{tab:data}} +\footnotesize +\setlength{{\tabcolsep}}{{6pt}} +\begin{{tabular}}{{lccc}} +\toprule +Task & Expert & Suboptimal & Median expert demo (of 400) \\ +\midrule +{data_body} +\bottomrule +\end{{tabular}} +\end{{table}} + +\begin{{table}}[t] +\centering +\caption{{\textbf{{Throughput.}} Success rate $\times$ horizon $/$ mean steps-to-success, i.e.\ successes +per 400 environment steps, on exactly the columns, rows and episodes of +Table~\ref{{{tab_label}}} -- a method that succeeds as often but sooner scores higher here, which the +success rate alone cannot show. The RSM row is the same coin-chain arm that table prints, not the +retired fold; a task with no chain arm reads ``--'' rather than borrowing the fold's timing. Reported separately because the two tables together exceed the +397.5pt text block. $\Delta$ is again the margin over the strongest baseline on that task.}} +\label{{tab:throughput}} +\scriptsize +\setlength{{\tabcolsep}}{{{thr_colsep}}} +\begin{{tabular}}{{{fl_cols}}} +\toprule +& \multicolumn{{{nbase}}}{{c}}{{Baselines}} & & \\ +\cmidrule(lr){{2-{base_end}}} +Task & {base_head} & RSM (ours) & $\Delta$ \\ +\midrule +{thr_body} +\bottomrule +\end{{tabular}} +\end{{table}} +""" + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_markdown.py b/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_markdown.py new file mode 100644 index 0000000000000000000000000000000000000000..012b9b564f1a57168eb5af567509a47c13b991c3 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/flagship_markdown.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +"""GitHub-markdown rendering of the flagship tables, from the SAME rows flagship_latex.py builds. +Prints markdown to stdout so it can be posted to an issue. --no-sync reads the eval tree directly.""" +import re, sys +from pathlib import Path +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import flagship_latex as FL +from flagship_latex import BASE as _BASE +_NICE = dict(BC="BC", BCU="BC-u", RISEg="RISE-g", IDQL="IDQL", RISE="RISE", IFQL="IFQL") +_H = "| Task | " + " | ".join(_NICE.get(k, k) for k, _ in _BASE) +from verdict_table import cells +rows, counts = FL.build(cells) +def strip(s): + # flatten inner braces FIRST so \mathbf{...} spans the whole cell, then bold it + s = s.replace("{\\pm}", "±").replace("^{\\dagger}", "†").replace("^{*}", "*").replace("_{(", "₍").replace(")}", "₎").replace("$", "") + s = re.sub(r"\\mathrm\{([^}]*)\}", r"\1", s) # \mathrm{n/a} must not leak into markdown + return re.sub(r"\\mathbf\{([^}]*)\}", r"**\1**", s) +out = ["**Flagship — RISE-faithful (data-provenance) reward.** RSM column = the coin-terminated β-chain read-out only (the retired deterministic fold is a separate table; a row whose chain re-score has not landed prints its launch state, never a fold number). mean ± SE across seeds (subscript = seed count; † = single seed, binomial SE); Δ = margin over strongest baseline (* p<0.05, two-proportion z). Bold = best in row. RISE-g = RISE actor sampled once, no critic ranking.", "", + _H + " | RSM (ours) | Δ |", "|" + "---|" * (len(_BASE) + 3)] +# CHAIN-ONLY (2026-09-23), matching tab:flagship and the LaTeX single-actor table. This printed +# r["rsm"] -- the maximum over BOTH the coin chain and the RETIRED deterministic fold -- under a +# heading that says only "RSM (ours)", and THIS is the artefact that gets pasted into gen_q issues, so +# the mix was reaching readers directly (on threading it would print the fold's 33.4 where the chain +# reads 25.8, the number already retracted on #267). Baselines and Delta come from the chain-bolded +# variants so the bold and the margin agree with the printed cell. +for r in rows: out.append("| " + " | ".join([r["label"], *map(strip, r["base_chain"]), strip(r["rsm_chain_disp"]), strip(r["db_chain"])]) + " |") +out += ["", "**Throughput** = success rate × horizon / mean steps-to-success", "", _H + " | RSM | Δ |", "|" + "---|" * (len(_BASE) + 3)] +for r in rows: out.append("| " + " | ".join([r["label"], *map(strip, r["tbase"]), strip(r["trsm"]), strip(r["tdb"])]) + " |") +out += ["", "**Matched proposer (BC-union, N=128): same candidates, different scorer.** greedy = no ranking; IQL = IQL critic; RSM = ours. Read *vs. greedy* as what selection buys — the IQL critic is a weak ranker here.", "", + "| Task | greedy | IQL | RSM | vs. greedy | vs. IQL |", "|---|---|---|---|---|---|"] +for r in rows: + if r["mr"] != "--": out.append("| " + " | ".join([r["label"], strip(r["mg"]), strip(r["mq"]), strip(r["mr"]), strip(r["mdg"]), strip(r["mdq"])]) + " |") +out += ["", "**Matched proposer, RISE's own actor (N=128): RISE's policy, RISE's reward, only the scorer swapped.** RISE-g = actor sampled once; RISE = its critic-ranked rollout; RSM = ours.", "", + "| Task | RISE-g | RISE | RSM | vs. RISE-g | vs. RISE |", "|---|---|---|---|---|---|"] +for r in rows: + if r["ar"] != "--": out.append("| " + " | ".join([r["label"], strip(r["ag"]), strip(r["aq"]), strip(r["ar"]), strip(r["adg"]), strip(r["adq"])]) + " |") +out += ["", f"Selection verdicts: {counts[FL.WIN]} survive both controls, {counts[FL.BELOW]} below own no-selection control, {counts[FL.UNDEC]} undecided. Total episodes: {sum(r['eps'] for r in rows)}."] +print("\n".join(out)) diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/health_refresh.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/health_refresh.sh new file mode 100644 index 0000000000000000000000000000000000000000..535897e3d3d72775312425e38ac00cc244c25fac --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/health_refresh.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Keep status/scorer_health.json current (gen_q#268 standing rule). LSF CPU job -- never the login node. +# +# The rule is that every self-implemented scorer publishes a health number beside its score. That +# only holds if the record tracks the checkpoints the table actually reports, so this refreshes both +# halves on a loop: +# 1. scripts/tdflow_target_diag.py on every TD-Flow checkpoint currently on disk -- the +# target-dispersion ratio against the MEASURED Monte-Carlo reference. Quarantined *_rmsbug runs +# are skipped: their number is already recorded and they are not reportable. +# 2. scripts/scorer_health.py --ckpt-winrate, which folds that in with the read-out spread / tie +# count (free, from the eval JSONs) and the checkpoints' held-out action win rates. +# flagship_latex.py reads the result and marks any scorer entry without one as not reportable. +# usage: health_refresh.sh [max_iterations] [sleep_seconds] +set -uo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +PY=$ROOT/venv_rsm/bin/python +ITERS=${1:-60}; NAP=${2:-1800} +for i in $(seq 1 "$ITERS"); do + echo "=== [health_refresh] iteration $i/$ITERS $(date -u +%FT%TZ) ===" + CKPTS=() + for d in "$ROOT"/runs/*/rsm/TDF_*; do + case "$d" in *_rmsbug) continue ;; esac + for c in ckpt_best.pt ckpt.pt; do + [ -f "$d/$c" ] && { CKPTS+=("$d/$c"); break; } + done + done + if [ "${#CKPTS[@]}" -gt 0 ]; then + echo " target diagnostic on ${#CKPTS[@]} TD-Flow checkpoint(s)" + $PY "$ROOT/scripts/tdflow_target_diag.py" "${CKPTS[@]}" --rows 512 2>&1 | sed 's/^/ /' + else + echo " no TD-Flow checkpoint on disk yet" + fi + $PY "$ROOT/scripts/scorer_health.py" --ckpt-winrate 2>&1 | tail -3 | sed 's/^/ /' + sleep "$NAP" +done +echo "[health_refresh] DONE $(date -u +%FT%TZ)" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/heldout_table.py b/gen_q_rsm/rsm_rise/pipeline/scripts/heldout_table.py new file mode 100644 index 0000000000000000000000000000000000000000..86ff43a1867476745a7f285ebcdcced28c6df569 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/heldout_table.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python3 +"""Selection-unbiased view of the flagship: choose the arm on seed 0, score it on seeds 1-2. + +WHY THIS EXISTS. The flagship row is a maximum over every membership arm evaluated on a task, and +that maximum is taken on the same episodes used to report it. With 30-120 arms at 50 episodes each, +the winner's curse is large enough to manufacture the whole result: under a null in which every arm on +a task shares the pooled success rate, the EXPECTED maximum is 13.0 on mug (observed 12.0), 17.6 on +threading (observed 22.0, 95th pct 22.0) and 42.7 on piece-assembly suboptimal (observed 46.5). On +five of seven tasks the reported number is inside what pure search noise produces. + +The fix is the standard one: split selection from evaluation. Pick the arm using seed 0 alone, then +report that arm's score on the seeds that had no say in choosing it. The held-out score is an +unbiased estimate of the chosen arm's performance, and -- a useful side effect -- the target stops +churning, because seed-0 data is already dense and does not move when seeds 1-2 land. + +`--null` additionally runs the max-over-arms null described above, so the bias can be quoted rather +than asserted. + +usage: heldout_table.py [--null] [--sims 4000] +""" +from __future__ import annotations + +import argparse +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from verdict_table import cells, pool, rate, ztest, TASKS # noqa: E402 + +FLAGSHIP_VARIANT = {"square_expert_suboptimal": "square_sub_20100"} +BASE = (("BC", lambda a, p: a[0] == "greedy" and p == "BC-expert"), + ("BCU", lambda a, p: a[0] == "greedy" and p == "BC-unified"), + ("IDQL", lambda a, p: a[0] == "critic" and p == "IDQL policy"), + ("RISE", lambda a, p: a[0] == "critic" and p == "RISE policy")) +SELECT_SEED = 0 + + +# READ-OUT SCOPE (gen_q#267, 2026-09-23). This tool is what the flagship caption now points a reader +# at for the winner's-curse correction, so it must validate the estimator the flagship PRINTS. It used +# to range over every membership arm at ANY read-out, so its held-out winner could be -- and on the +# rows with many fold arms was -- an arm of the RETIRED deterministic fold, i.e. a held-out validation +# of a number no table quotes. Default is the coin chain; `--readout any` reproduces the old output +# and `--readout fold` validates the ablation table instead. Predicate imported from the table +# generator so this tool and the tables cannot disagree about which arm is which estimator. +from flagship_latex import _recipe_is_chain, _readout_of # noqa: E402 + + +def arms_of(c, readout="chain"): + out = [] + for (a, p) in sorted({(a, p) for (a, p, _, _) in c if a[0] == "rsm:membership"}): + # POSITIVE TEST ON EACH SIDE (run 20). `_recipe_is_chain(...) != (readout == "chain")` made + # `--readout fold` mean "everything that is not the paper's chain", which since run 19 includes + # chain arms at a swept gamma and cap-0 arms with no recursion -- so the ablation's held-out + # validation could be earned by a CHAIN arm. Same mirror defect as master_table's fold bucket. + # An excluded chain arm now validates NEITHER read-out. + if readout == "chain" and not _recipe_is_chain(a[1]): + continue + if readout == "fold" and _readout_of(a[1]) != "fold": + continue + g = pool(c, lambda x, q, A=a, P=p: x == A and q == P) + out.append((a[1], p, g)) + return out + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("--null", action="store_true", help="also report the max-over-arms null") + ap.add_argument("--sims", type=int, default=4000) + ap.add_argument("--readout", choices=("chain", "fold", "any"), default="chain", + help="which read-out's arms to select among; the flagship prints `chain`") + a = ap.parse_args() + + print(f"read-out: {a.readout}" + + (" (the estimator the flagship prints; gen_q#267)" if a.readout == "chain" else + " (NOT the flagship estimator -- for the ablation only)")) + print(f"{'task':<26}{'arm (chosen on seed 0)':<30}{'sel':>6}{'held-out':>10}{'n':>6}" + f"{'base':>7}{'delta':>9}") + for t, _ in TASKS: + src = FLAGSHIP_VARIANT.get(t, t) + c = cells(src) + arms = arms_of(c, a.readout) + if not arms: + continue + # SELECT on seed 0 only. + sel = None + for label, prop, g in arms: + g0 = {k: v for k, v in g.items() if k[1] == SELECT_SEED} + if not g0: + continue + sr0, n0 = rate(g0) + if sel is None or (sr0, n0) > (sel[0], sel[1]): + sel = (sr0, n0, label, prop, g) + if sel is None: + continue + sr0, n0, label, prop, g = sel + # SCORE on every other seed. + gh = {k: v for k, v in g.items() if k[1] != SELECT_SEED} + if not gh: + print(f"{src[:25]:<26}{label[:29]:<30}{sr0:>6.1f}{'--':>10}{0:>6}{'':>7}{'no held-out seed yet':>9}") + continue + srh, nh = rate(gh) + bvals = [(rate(pool(c, pr))[0], rate(pool(c, pr))[1]) for _, pr in BASE if pool(c, pr)] + bb, bn = max(bvals, key=lambda x: x[0]) if bvals else (None, 1) + if bb is None: + d = "--" + else: + d = f"{srh - bb:+.1f}" + ("*" if ztest(srh, nh, bb, bn) < .05 else "") + print(f"{src[:25]:<26}{label[:29]:<30}{sr0:>6.1f}{srh:>10.1f}{nh:>6}{bb:>7.1f}{d:>9}") + + if not a.null: + return + import numpy as np + rng = np.random.default_rng(0) + print(f"\nmax-over-arms null (all arms share the task's pooled rate)") + print(f"{'task':<26}{'arms':>6}{'observed max':>14}{'E[max]':>9}{'p95':>7}") + for t, _ in TASKS: + src = FLAGSHIP_VARIANT.get(t, t) + c = cells(src) + arms = [(rate(g)[0], rate(g)[1]) for _, _, g in arms_of(c) if g] + if len(arms) < 2: + continue + obs = max(x[0] for x in arms) + pooled = 100 * sum(x[0] / 100 * x[1] for x in arms) / sum(x[1] for x in arms) + sims = np.array([max(100 * rng.binomial(n_, pooled / 100) / n_ for _, n_ in arms) + for _ in range(a.sims)]) + print(f"{src[:25]:<26}{len(arms):>6}{obs:>14.1f}{sims.mean():>9.1f}{np.percentile(sims, 95):>7.1f}") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_bundle_check.py b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_bundle_check.py new file mode 100644 index 0000000000000000000000000000000000000000..68b7b433b1f2cdb1bfa33141fc3dee62dfecdf3c --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_bundle_check.py @@ -0,0 +1,187 @@ +#!/usr/bin/env python +"""Does a trained IFQL critic actually RANK ACTIONS? (gen_q#264, CPU job.) + +`scripts/ifql_parity.py` proves the torch port computes what the JAX agent computes. This script asks +the question that decides whether the flagship's IFQL columns are a value baseline at all. + +WHY GLOBAL SEPARATION IS NOT THE ANSWER. This project has already been burned by exactly this +distinction: RISE's own IQL critic has excellent global and state-level separation -- expert-vs-play +frame AUC 0.81-1.00, Q varying by 2-40 ACROSS states -- and still ranks actions at CHANCE. Its +within-state spread is 0.02-0.35, the recorded expert action sits at the 40th-58th percentile of the +actor's own samples, and on the real cooking data it *anti-selects* (win rate 0.443 against a plain +sample). A critic can therefore be an excellent provenance classifier and a useless ranker at the same +time, so a global Q range -- however wide -- is CONTEXT ONLY and must never be the headline number. + +WHAT DECIDES IT, in order of authority: + + 1. expert_action_rank_pct -- the percentile of the RECORDED action's Q among `n_cand` actions the + IFQL flow actor itself proposes at that same state. Scale-free, so it cannot be confounded by the + units of Q (a ratio-based gate on #265 turned out to be confounded by its own denominator). On + EXPERT-provenance frames a useful critic puts the logged action well above the 50th percentile; + ~50 is chance, and below 50 is anti-selection -- the failure mode actually observed on real data. + Reported for suboptimal-provenance frames too, as a negative control: there the logged action is + NOT expert, so a critic that understands the reward should rank it LOWER than on expert frames. + + 2. per_state_spread_actor -- the spread of Q over those same `n_cand` actor samples at one state, in + units of the HL-Gauss head's bin width. This is literally the quantity the arg-max consumes. A + fraction of one bin means the ranking carries nothing whatever the AUC says. + + 3. per_state_spread_perturb -- the same spread over perturbations of the logged action, which probes + "does Q depend on the action at all" independently of the actor's own proposal distribution. + + 4. auc_q_provenance / auc_v_provenance -- global separation. Context, reported last, never a headline. + +None of these is a result; the flagship numbers come from the rollouts. They exist so that a column +which is secretly a random-of-128 is visible as such, and so are reported beside every IFQL figure. +They do NOT replace the `random` / `permuted` controls on the same proposer, which stay mandatory +whatever these numbers say -- only the paired control measures what selection bought on the real +episodes. + +usage: RR_QUEUE=preemptable RR_GROUP=grp_preemptable scripts/bsub_cpu.sh rr_cpu_ifql_bcheck \\ + scripts/ifql_bundle_check.sh [seed ...] +""" +from __future__ import annotations + +import importlib.util +import json +import sys +from pathlib import Path + +import numpy as np + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +sys.path.insert(0, str(ROOT / "code" / "ifql")) +sys.path.insert(0, str(ROOT / "code" / "ifql" / "impls")) + +N_CAND = 128 # the flagship candidate budget +N_STATES = 96 # states per provenance class +WARN_BINS = 0.2 # per-state spread below this == cannot order candidates +BINS = 101 + + +def _ifql_torch(): + spec = importlib.util.spec_from_file_location( + "ifql_torch", ROOT / "code" / "rise_robomimic" / "robomimic" / "algo" / "ifql_torch.py") + m = importlib.util.module_from_spec(spec) + spec.loader.exec_module(m) + return m + + +def auc(pos, neg): + """Mann-Whitney AUC of two score samples (no sklearn in this venv).""" + if not len(pos) or not len(neg): + return float("nan") + a = np.concatenate([pos, neg]) + r = np.empty(len(a)) + order = np.argsort(a, kind="mergesort") + sa = a[order] + i = 0 + while i < len(sa): # average ranks within ties + j = i + while j + 1 < len(sa) and sa[j + 1] == sa[i]: + j += 1 + r[order[i:j + 1]] = (i + j) / 2 + 1 + i = j + 1 + return float((r[:len(pos)].sum() - len(pos) * (len(pos) + 1) / 2) / (len(pos) * len(neg))) + + +def measure(T, x, act, idxs, rng, torch): + """For each state in `idxs`: sample N_CAND actor actions, score them plus the logged action. + + -> (rank percentiles of the logged action, per-state spreads over actor samples in bins, + per-state spreads over perturbations in bins) + """ + ranks, sp_actor, sp_pert = [], [], [] + bw = 1.0 / BINS + for i in idxs: + xs = np.repeat(x[i][None], N_CAND, 0) + # (2) the actor's OWN candidates -- exactly what the arg-max sees at eval time + noise = torch.as_tensor(rng.normal(size=(1, N_CAND, act.shape[1])).astype(np.float32)) + cand = T.flow_candidates(x[i][None], num_samples=N_CAND, noise=noise).reshape(N_CAND, -1) + q_cand = T.q(xs, cand).numpy() + sp_actor.append((q_cand.max() - q_cand.min()) / bw) + # (1) where the LOGGED action falls among them -- scale-free + q_log = float(T.q(x[i][None], act[i][None]).numpy()[0]) + ranks.append(100.0 * float((q_cand < q_log).mean())) + # (3) does Q move with the action at all, independent of the actor's proposal distribution + pert = np.clip(act[i][None] + 0.3 * rng.normal(size=(N_CAND, act.shape[1])), -1, 1).astype(np.float32) + pert[0] = act[i] + q_p = T.q(xs, pert).numpy() + sp_pert.append((q_p.max() - q_p.min()) / bw) + return np.asarray(ranks), np.asarray(sp_actor), np.asarray(sp_pert) + + +def main(): + import torch + from train_ifql import load_cache + IFQLTorch = _ifql_torch().IFQLTorch + + task = sys.argv[1] + args = sys.argv[2:] + variants = [a for a in args if not a.isdigit()] # e.g. s0_nstep1 + seeds = [int(a) for a in args if a.isdigit()] or ([0, 1, 2] if not variants else []) + cache = ROOT / "cache" / task + x, act, rew, ep_from, ep_to = load_cache(cache, None) + rng = np.random.default_rng(0) + exp_idx = np.nonzero(rew > 0.5)[0] + sub_idx = np.nonzero(rew <= 0.5)[0] + pick = lambda a, n: rng.choice(a, size=min(n, len(a)), replace=False) if len(a) else a + se, ss = pick(exp_idx, N_STATES), pick(sub_idx, N_STATES) + # global-AUC sample (cheap, many frames) + gi = rng.choice(len(x), size=min(4096, len(x)), replace=False) + print(f"[bcheck] {task}: {len(exp_idx)} expert-provenance / {len(sub_idx)} suboptimal frames; " + f"{len(se)}/{len(ss)} states measured per class, {N_CAND} candidates each", flush=True) + + out = {} + for s in [f"s{i}" for i in seeds] + variants: + b = ROOT / "runs" / task / "ifql" / s / "ifql_bundle.pt" + if not b.is_file(): + print(f"[bcheck] {s}: no bundle"); continue + T = IFQLTorch(b, device="cpu") + rk_e, spa_e, spp_e = measure(T, x, act, se, rng, torch) + rk_s, spa_s, spp_s = measure(T, x, act, ss, rng, torch) + qg = T.q(x[gi], act[gi]).numpy(); vg = T.v(x[gi]).numpy() + pos, neg = rew[gi] > 0.5, rew[gi] <= 0.5 + spa = np.concatenate([spa_e, spa_s]); spp = np.concatenate([spp_e, spp_s]) + r = { + # --- 1. DOES IT RANK? the scale-free headline --------------------------------------- + "expert_action_rank_pct_mean": float(rk_e.mean()), + "expert_action_rank_pct_median": float(np.median(rk_e)), + "logged_action_rank_pct_on_suboptimal_frames_mean": float(rk_s.mean()), + "rank_gap_expert_minus_suboptimal": float(rk_e.mean() - rk_s.mean()), + # --- 2. can it rank at all? per-state spread, in HL-Gauss bins ---------------------- + "per_state_spread_actor_median_in_bins": float(np.median(spa)), + "per_state_spread_actor_mean_in_bins": float(spa.mean()), + "per_state_spread_perturb_median_in_bins": float(np.median(spp)), + # --- 3. CONTEXT ONLY: global separation --------------------------------------------- + "context_auc_q_provenance": auc(qg[pos], qg[neg]), + "context_auc_v_provenance": auc(vg[pos], vg[neg]), + "context_q_range_over_frames_in_bins": float((qg.max() - qg.min()) * BINS), + "train_step": T.step, + "n_cand": N_CAND, "n_states_per_class": int(len(se)), + } + out[s] = r + print(f"\n[bcheck] {s} (step {T.step}, n_step={T.cfg.get('n_step')})") + for k, vv in r.items(): + print(f" {k:52s} {vv}") + if r["per_state_spread_actor_median_in_bins"] < WARN_BINS: + print(f" WARNING: median per-state spread over the actor's own {N_CAND} candidates is " + f"below {WARN_BINS} of one HL-Gauss bin -- this critic cannot order candidates at a " + f"state, so the column is a random-of-{N_CAND} whatever its AUC says.") + if r["expert_action_rank_pct_mean"] < 55.0: + print(f" WARNING: the recorded expert action sits at the " + f"{r['expert_action_rank_pct_mean']:.0f}th percentile of the actor's own samples " + f"(~50 = chance, <50 = ANTI-selection, the failure RISE's IQL critic shows on real " + f"data). Do not report this column as a value baseline on the strength of its AUC.") + # A run that includes any VARIANT bundle writes its own file: BUNDLE_CHECK.json is the canonical + # 3-seed record that verdict_table.ifql_value_spread reads into the flagship tables, and a variant + # row landing in it would contaminate the published column with a non-canonical recipe. + name = "BUNDLE_CHECK_variants.json" if variants else "BUNDLE_CHECK.json" + p = ROOT / "runs" / task / "ifql" / name + p.parent.mkdir(parents=True, exist_ok=True) + p.write_text(json.dumps(out, indent=2)) + print(f"\n[bcheck] wrote {p}") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_bundle_check.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_bundle_check.sh new file mode 100644 index 0000000000000000000000000000000000000000..a465d90e4fedea9c80f0b215effc51ba4ce82c86 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_bundle_check.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# CPU-job wrapper for scripts/ifql_bundle_check.py (gen_q#264). +set -euo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +source "$ROOT/scripts/ifql_env.sh" +export JAX_PLATFORMS=cpu +echo "[bcheck] host=$(hostname) job=${LSB_JOBID:-none} $(date)" +exec "$IFQL_PY" "$ROOT/scripts/ifql_bundle_check.py" "$@" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_env.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_env.sh new file mode 100644 index 0000000000000000000000000000000000000000..36d1a7840649d22ee9d04116c092992ecc77fd77 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_env.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# `source` it: the JAX environment used by every IFQL (gen_q#264) job. +# +# NO NEW VENV IS BUILT. third_party/openpi/.venv already carries the whole stack IFQL needs -- +# jax 0.5.3 + jax-cuda12-plugin 0.5.3, flax 0.10.2, optax 0.2.4, ml_collections 1.0.0, orbax, plus +# h5py 3.13, numpy 1.26.4, torch 2.7.1 and wandb -- so the IFQL trainer runs in it directly and the +# parity check (scripts/ifql_parity.py) can compare JAX and torch inside ONE process. The only thing +# missing upstream is `distrax`, which IFQL never touches: rsm_rise/code/ifql/impls/utils/networks.py +# makes that import optional (the classes IFQL uses -- MLP / ResidualMLP / CategoricalValue / +# ActorVectorField -- do not need it). +# +# Nothing is ever installed into this venv by an IFQL job: it belongs to third_party/openpi. If a +# package ever has to be added, put it in a `pip install --target $ROOT/.venvs/ifql_extra` directory +# and prepend that to PYTHONPATH here, so openpi's tree stays byte-identical. +ROOT=/proj/dmfexp/zwhong/rsm_rise +export IFQL_PY=$ROOT/third_party/openpi/.venv/bin/python +export PYTHONPATH=$ROOT/code/ifql:$ROOT/code/ifql/impls${PYTHONPATH:+:$PYTHONPATH} +export XLA_PYTHON_CLIENT_PREALLOCATE=false # share the card politely; the nets are tiny +export JAX_PLATFORMS=${JAX_PLATFORMS:-} # unset = CUDA when present, CPU otherwise +export HF_HOME=$ROOT/cache/hf XDG_CACHE_HOME=$ROOT/cache/xdg PIP_CACHE_DIR=$ROOT/cache/pip +export OMP_NUM_THREADS=8 MKL_NUM_THREADS=8 OPENBLAS_NUM_THREADS=8 NUMEXPR_NUM_THREADS=8 diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_eval_smoke.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_eval_smoke.sh new file mode 100644 index 0000000000000000000000000000000000000000..2872aedfcecaec9af651dfcb0d4008950dcdb419 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_eval_smoke.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +# End-to-end smoke test of BOTH IFQL eval paths (gen_q#264), 2 rollouts each, on a GPU node. +# (b) the IFQL critic ranking the RISE (S0A) actor's 128 chunks -> training.rsm_backend=ifql +# (a) IFQL as published, its own flow actor + its own critic -> exp.ifql_policy=True +# usage: scripts/bsub_gpu.sh rr_ifql_evalsmoke scripts/ifql_eval_smoke.sh +set -uo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +TASK=${1:-two_piece_expert_suboptimal}; S=${2:-0} +ENVCFG=$(python3 -c "import sys; sys.path.insert(0,'$ROOT/scripts'); from launch_flagship_topup import ENVS; print(ENVS['$TASK'])") +B=${IFQL_SMOKE_B:-$ROOT/runs/$TASK/ifql/s$S/ifql_bundle.pt} +PUB=${IFQL_SMOKE_PUB:-$ROOT/runs/$TASK/policy/S0Aifql_seed$S/ifql/ifql/models/model_epoch_5000.pth} +FS=$ROOT/cache/$TASK/feat_stats.npz +S0A=$(python3 -c "import sys; sys.path.insert(0,'$ROOT/scripts'); from launch_flagship_topup import ckpt; print(ckpt('$TASK','S0A',$S) or '')") +OUT=$ROOT/runs/$TASK/eval_smoke; mkdir -p "$OUT" +echo "[smoke] task=$TASK env=$ENVCFG bundle=$B s0a=$S0A" +for f in "$B" "$PUB" "$FS"; do [ -f "$f" ] || { echo "[smoke] MISSING $f"; exit 2; }; done +rc=0; rc_b=1; rc_a=1 + +echo "=============== (b) IFQL critic on the RISE actor ===============" +if [ -n "$S0A" ]; then + RR_EVAL_ATTEMPTS=3 RR_EVAL_DEADLINE_S=1800 "$ROOT/scripts/eval_cell.sh" "$TASK" "$S0A" "$ENVCFG" \ + "$OUT/IFQLCRIT-smoke.json" exp.num_rollouts=2 exp.eval_seed=0 exp.eval_cell=IFQLCRIT-smoke \ + exp.eval_task="$TASK" training.plan_n=128 training.plan_rule=argmax training.plan_mode=d1 \ + training.plan_depth=1 training.plan_beta=0.95 training.rsm_backend=ifql \ + training.rsm_ckpt="$B" training.rsm_feat_stats="$FS" && rc_b=0 || rc=1 +else + echo "[smoke] no S0A seed $S checkpoint -- column (b) skipped"; rc_b=2 +fi +echo "[smoke] colb=$rc_b" + +echo "=============== (a) IFQL as published ===============" +RR_EVAL_ATTEMPTS=3 RR_EVAL_DEADLINE_S=1800 "$ROOT/scripts/eval_cell.sh" "$TASK" "$PUB" "$ENVCFG" \ + "$OUT/IFQLPOL-smoke.json" exp.num_rollouts=2 exp.eval_seed=0 exp.eval_cell=IFQLPOL-smoke \ + exp.eval_task="$TASK" exp.ifql_policy=True exp.ifql_num_samples=128 exp.ifql_feat_stats="$FS" \ + training.plan_n=128 training.plan_rule=argmax training.plan_mode=d1 training.plan_depth=1 \ + training.plan_beta=0.95 training.rsm_backend=ifql training.rsm_ckpt="$B" \ + training.rsm_feat_stats="$FS" && rc_a=0 || rc=1 +echo "[smoke] cola=$rc_a" + +echo "=============== what verdict_table makes of the two JSONs ===============" +python3 - "$TASK" <<'PY' +import sys, json, glob, os +sys.path.insert(0, "/proj/dmfexp/zwhong/rsm_rise/scripts") +task = sys.argv[1] +for f in sorted(glob.glob(f"/proj/dmfexp/zwhong/rsm_rise/runs/{task}/eval_smoke/IFQL*-smoke.json")): + j = json.load(open(f)) + print(f"\n{os.path.basename(f)}: n={j['num_episodes']} sr={j['success_rate']} " + f"eval_ckpt={j['eval_ckpt']}") + print(" planner_overrides:", {k: v for k, v in (j.get('planner_overrides') or {}).items() + if k in ('plan_n', 'plan_rule', 'rsm_backend', 'rsm_ckpt')}) + print(" planner.scorer :", (j.get('planner') or {}).get('scorer')) + print(" ep0 plan :", {k: v for k, v in ((j['episodes'][0].get('plan') or {}) if j['episodes'] else {}).items() + if k in ('n', 'rule', 'steps', 'score_chosen_mean', 'score_mean_mean', + 'ties_at_max_mean', 'gap_chosen_minus_mean')}) + import re + m = re.search(r"/policy/(S0A|S0B|S3H1nosn|S3H1|S0Aidql|S0Aifql)_seed(\d+)/.*model_epoch_(\d+)\.pth", + j.get("eval_ckpt", "")) + import verdict_table as vt + print(" -> family :", (vt.POL[m.group(1)] if m else "NO MATCH -- the table would DROP this cell")) + o = j.get("planner_overrides") or {} + b = o.get("rsm_backend") + print(" -> arm :", (vt.VALUE_BACKENDS.get(b, "?"), f"N={o.get('plan_n')}")) +PY +echo "[smoke] exit=$rc" +exit $rc diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_parity.py b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_parity.py new file mode 100644 index 0000000000000000000000000000000000000000..56a245810844a24c0fac22a65e3cc7ab17cf17d4 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_parity.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python +"""JAX-vs-torch parity of the IFQL port (gen_q#264). CPU job only -- never run on the login node. + +The flagship's IFQL columns are produced by two different implementations of the SAME weights: training and +the value/actor definitions are the vendored JAX/flax ogbench code (rsm_rise/code/ifql/impls), while eval +runs inside the RISE robomimic process, which has no JAX, and uses the torch port +(code/rise_robomimic/robomimic/algo/ifql_torch.py). A silent mismatch there -- a wrong LayerNorm epsilon, the +exact-vs-tanh gelu, a transposed ensemble axis -- would look like a weak baseline rather than a bug, so the +two are compared numerically here on random weights before any cell is launched. + +Checks, on a freshly created (randomly initialised) agent exported through the real export path: + 1. Q(s, a) for the critic ensemble, aggregated and per-member; + 2. V(s) from the expectile value head; + 3. the flow velocity field at several times; + 4. sample_actions: the whole best-of-N pipeline given the SAME initial noise, comparing both the chosen + action and the full candidate set. +Tolerance: 1e-4 max absolute difference (float32 on two backends). + +usage: scripts/bsub_cpu.sh rr_cpu_ifql_parity scripts/ifql_parity.sh +""" +from __future__ import annotations + +import sys +from pathlib import Path + +import numpy as np + +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +sys.path.insert(0, str(ROOT / "code" / "ifql")) +sys.path.insert(0, str(ROOT / "code" / "ifql" / "impls")) +# (ifql_torch.py is loaded by file path in main(); the robomimic package itself is NOT importable here) + +TOL = 1e-4 + + +def main(): + import jax + import jax.numpy as jnp + import torch + from agents.ifql import IFQLAgent, get_config + from train_ifql import export_bundle + # Loaded BY FILE PATH on purpose: `import robomimic.algo.ifql_torch` would execute + # robomimic/algo/__init__.py, which pulls in diffusion_policy / the whole RISE stack that this JAX + # venv does not have. ifql_torch.py itself depends on nothing but numpy and torch, and loading it + # this way is also a standing check that it stays that way. + import importlib.util + _spec = importlib.util.spec_from_file_location( + "ifql_torch", ROOT / "code" / "rise_robomimic" / "robomimic" / "algo" / "ifql_torch.py") + _m = importlib.util.module_from_spec(_spec) + _spec.loader.exec_module(_m) + IFQLTorch = _m.IFQLTorch + + print(f"[parity] jax {jax.__version__} torch {torch.__version__}", flush=True) + rng = np.random.default_rng(0) + d_obs, d_act, B, N = 1545, 7, 5, 16 + + fails = [] + for mlp_class in ("resmlp", "mlp"): + cfg = get_config() + cfg["mlp_class"] = mlp_class + cfg["num_samples"] = N + # a small but structurally identical network keeps the check fast on a CPU job + cfg["actor_hidden_dims"] = (64, 64) + cfg["value_hidden_dims"] = (64, 64) + ex_o = rng.normal(size=(4, d_obs)).astype(np.float32) + ex_a = rng.normal(size=(4, d_act)).astype(np.float32) + agent = IFQLAgent.create(0, ex_o, ex_a, cfg) + + out = ROOT / "scripts" / "tmp" / f"ifql_parity_{mlp_class}" + out.mkdir(parents=True, exist_ok=True) + export_bundle(agent, agent.config, out / "ifql_bundle.pt", "n/a", "parity", 0, 0, "dino") + T = IFQLTorch(out / "ifql_bundle.pt", device="cpu") + + obs = rng.normal(size=(B, d_obs)).astype(np.float32) + act = np.clip(rng.normal(size=(B, d_act)), -1, 1).astype(np.float32) + + # 1/2: critic and value heads + q_jax = np.asarray(agent.network.select("critic")(obs, actions=act)) # [E, B] + q_t = T.q(obs, act, aggregate=False).numpy() + v_jax = np.asarray(agent.network.select("value")(obs)) + v_t = T.v(obs).numpy() + # 3: flow velocity + vel_err = 0.0 + for tt in (0.0, 0.3, 0.9): + times = np.full((B, 1), tt, np.float32) + vj = np.asarray(agent.network.select("actor_flow")(obs, act, times)) + vt = T.flow_velocity(torch.as_tensor(obs), torch.as_tensor(act), + torch.as_tensor(times)).numpy() + vel_err = max(vel_err, float(np.abs(vj - vt).max())) + # 4: the whole best-of-N pipeline on IDENTICAL noise + noise = rng.normal(size=(B, N, d_act)).astype(np.float32) + a_t, cand_t, q_cand_t, idx_t = T.sample_actions( + torch.as_tensor(obs), num_samples=N, noise=torch.as_tensor(noise), return_all=True) + # the JAX side, re-done with the same noise (agents/ifql.py sample_actions, verbatim maths) + a_j = jnp.asarray(noise) + o_j = jnp.repeat(jnp.expand_dims(jnp.asarray(obs), 1), N, axis=1) + for i in range(int(agent.config["flow_steps"])): + times = jnp.full((B, N, 1), i / int(agent.config["flow_steps"])) + a_j = a_j + agent.network.select("actor_flow")(o_j, a_j, times, is_encoded=True) / int(agent.config["flow_steps"]) + a_j = jnp.clip(a_j, -1, 1) + qs_j = agent.network.select("critic")(o_j, actions=a_j) + q_j = qs_j.min(axis=0) if agent.config["q_agg"] == "min" else qs_j.mean(axis=0) + best_j = np.asarray(jnp.argmax(q_j, axis=-1)) + act_j = np.asarray(a_j)[np.arange(B), best_j] + + errs = { + "critic Q [E,B]": float(np.abs(q_jax - q_t).max()), + "value V [B]": float(np.abs(v_jax - v_t).max()), + "flow velocity": vel_err, + "candidates [B,N,A]": float(np.abs(np.asarray(a_j) - cand_t.numpy()).max()), + "candidate Q [B,N]": float(np.abs(np.asarray(q_j) - q_cand_t.numpy()).max()), + "chosen action": float(np.abs(act_j - a_t.numpy()).max()), + "chosen index": float(np.abs(best_j - idx_t.numpy()).max()), + } + print(f"\n[parity] mlp_class={mlp_class}") + for k, v in errs.items(): + ok = v <= TOL + print(f" {'OK ' if ok else 'FAIL'} {k:22s} max|dJAX - dTorch| = {v:.3e}") + if not ok: + fails.append((mlp_class, k, v)) + + if fails: + print(f"\n[parity] {len(fails)} FAILURES: {fails}") + raise SystemExit(1) + print(f"\n[parity] all checks within {TOL:g} -- the torch port reproduces the JAX agent") + + +if __name__ == "__main__": + main() diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_parity.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_parity.sh new file mode 100644 index 0000000000000000000000000000000000000000..ded06faa4e433ad21cb5af64380c69708087d00d --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_parity.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# CPU-job wrapper for scripts/ifql_parity.py (JAX vs torch parity of the IFQL port, gen_q#264). +set -euo pipefail +ROOT=/proj/dmfexp/zwhong/rsm_rise +source "$ROOT/scripts/ifql_env.sh" +export JAX_PLATFORMS=cpu +echo "[ifql_parity] host=$(hostname) job=${LSB_JOBID:-none} py=$IFQL_PY $(date)" +exec "$IFQL_PY" "$ROOT/scripts/ifql_parity.py" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_probe.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_probe.sh new file mode 100644 index 0000000000000000000000000000000000000000..40617fa4a6e0e3e87be4485523fad6dd9e421436 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_probe.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +# Train a THROWAWAY short-budget IFQL agent and run scripts/ifql_eval_smoke.sh against it, in ONE GPU job. +# Purpose: validate both eval paths (the torch critic backend in the planner, and the IFQL rollout policy) +# inside the real MuJoCo/robomimic process without waiting for a 500k-step training. The bundle lives +# under scripts/tmp/, never under runs//ifql/, so launch_ifql.py can never mistake it for a +# finished training; the eval JSONs land in runs//eval_smoke/, which verdict_table.SKIP excludes. +# usage: scripts/bsub_gpu.sh rr_ifql_probe scripts/ifql_probe.sh [steps] +set -uo pipefail +main() { + ROOT=/proj/dmfexp/zwhong/rsm_rise + TASK=${1:-two_piece_expert_suboptimal}; STEPS=${2:-4000} + source "$ROOT/wandb_env.sh" || true + source "$ROOT/scripts/ifql_env.sh" + OUT=$ROOT/scripts/tmp/ifql_probe/$TASK; PUBD=$OUT/policy/S0Aifql_seed0/ifql/ifql/models + mkdir -p "$OUT" "$PUBD" + echo "[probe] host=$(hostname) job=${LSB_JOBID:-none} task=$TASK steps=$STEPS $(date)" + nvidia-smi --query-gpu=name --format=csv,noheader || true + if ! "$IFQL_PY" -c "import jax,sys; d=jax.devices(); sys.exit(0 if any(x.platform=='gpu' for x in d) else 3)" 2>/dev/null; then + echo "[probe] host $(hostname): JAX sees no usable GPU; exiting 99 for an LSF host requeue"; exit 99 + fi + "$IFQL_PY" "$ROOT/code/ifql/train_ifql.py" --task "$TASK" --out "$OUT" --seed 0 \ + --steps "$STEPS" --num-samples 128 --save-every "$STEPS" --log-every 1000 || exit 1 + [ -f "$OUT/ifql_bundle.pt" ] || { echo "[probe] FATAL: no bundle"; exit 1; } + cp -f "$OUT/ifql_bundle.pt" "$PUBD/model_epoch_5000.pth" + export IFQL_SMOKE_B="$OUT/ifql_bundle.pt" IFQL_SMOKE_PUB="$PUBD/model_epoch_5000.pth" + exec "$ROOT/scripts/ifql_eval_smoke.sh" "$TASK" 0 +} +main "$@" +exit $? diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_watcher.sh b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_watcher.sh new file mode 100644 index 0000000000000000000000000000000000000000..73cc713f7f3c204b509bb3f4768ee8fa348261b6 --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/ifql_watcher.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash +# Drive the IFQL flagship columns to completion without supervision (gen_q#264). +# +# The trainings (scripts/launch_ifql.py --train) sit in the preemptable GPU queue for hours, and each +# eval column can only be launched for the (task, seed) whose bundle already exists. This watcher polls +# and does, in order: +# +# 1. the FIRST time any bundle lands for a task, run scripts/ifql_eval_smoke.sh on it -- 2 rollouts +# through BOTH eval paths -- and refuse to launch that task's grids until the smoke passed. The +# smoke is the only gate that exercises the torch critic backend and the IFQL rollout policy inside +# the real MuJoCo/robomimic process, so a full grid is never spent on a broken path; +# 2. resubmit any training whose bundle is still missing and which no live job owns (preemptable jobs +# get killed; LSF's own -r requeue covers most of it, but not a job the scheduler gave up on); +# 3. launch column (b) (IFQL critic on the RISE actor), then column (a) (IFQL as published), then the +# random / permuted controls. launch_e1_grid skips cells whose JSON exists and cells a live job +# owns, so every pass only adds what is missing and the order is a priority, not a sequence. +# +# Column (b) goes first on purpose: it is the single-actor row the paper table needs most. +# +# usage: nohup scripts/ifql_watcher.sh [hours] > logs/ifql_watcher.log 2>&1 & +set -uo pipefail +# Body wrapped in a function so bash parses it completely before running anything: editing +# this file while the watcher is running it is then safe (bash otherwise reads scripts +# incrementally and a mid-run edit shifts the offset it resumes from). +main() { + ROOT=/proj/dmfexp/zwhong/rsm_rise; cd $ROOT + HOURS=${1:-12}; end=$(( $(date +%s) + HOURS*3600 )) + export RR_QUEUE=preemptable RR_GROUP=grp_preemptable + PY=/gpfs/ess6000-1/optshare/share/miniforge/bin/python + TASKS="two_piece_expert_suboptimal two_piece_expert_play threading_expert_play mug_expert_suboptimal square_expert_play two_piece_expert_play_tipping square_sub_20100" + MARK=$ROOT/runs/_ifql_watcher; mkdir -p $MARK + + while [ $(date +%s) -lt $end ]; do + nb=$(ls $ROOT/runs/*/ifql/s*/ifql_bundle.pt 2>/dev/null | wc -l) + echo "$(date -u +%H:%M) bundles=$nb/21" + + # (2) resubmit trainings that have neither a bundle nor a live job + $PY $ROOT/scripts/launch_ifql.py --train 2>&1 | grep -E "submitted|skip" | tail -3 + + for t in $TASKS; do + b0=$ROOT/runs/$t/ifql/s0/ifql_bundle.pt + [ -f "$b0" ] || continue + + # (2b) VALUE-RESOLUTION CHECK. scripts/ifql_bundle_check.py writes BUNDLE_CHECK.json (provenance AUC + # and the per-state Q spread over 128 candidates, in HL-Gauss bins). The flagship tables are required + # to print that number next to the IFQL column, so it has to be produced automatically -- re-run + # whenever the count of bundles for this task changes. + nbt=$(ls $ROOT/runs/$t/ifql/s*/ifql_bundle.pt 2>/dev/null | wc -l) + if [ "$nbt" -gt 0 ] && [ "$(cat "$MARK/${t}.bcheck_n" 2>/dev/null || echo -1)" != "$nbt" ] \ + && ! bjobs -o "job_name" -noheader 2>/dev/null | grep -q "rr_cpu_ifqlbcheck_${t}"; then + if RR_MEM=32G $ROOT/scripts/bsub_cpu.sh rr_cpu_ifqlbcheck_${t} \ + $ROOT/scripts/ifql_bundle_check.sh "$t" >/dev/null 2>&1; then + echo "$nbt" > "$MARK/${t}.bcheck_n" + echo " $t: value-resolution check submitted for $nbt bundle(s)" + fi + fi + + # (1) PER-COLUMN SMOKE GATE. + # The smoke runs both eval paths and reports "[smoke] colb=" / "[smoke] cola=" separately; + # each column's grid is unlocked only by ITS OWN verdict. Two reasons: a regression in one column + # must not hold the other out of the queue (column (a) crashed on a CUDA-device bug while column (b) + # passed), and -- coordinator, 2026-09-21 -- column (a) stays locked until a passing cell actually + # proves the fix rather than us believing it. + # `.smoke_done` records that a smoke produced verdicts, so a genuinely failing column is not + # resubmitted every 10 minutes. DELETE $MARK/.smoke_done (and .smoke_tries) after changing the + # eval code to have the gate re-run. + if { [ ! -f "$MARK/${t}.smoke_ok_colb" ] || [ ! -f "$MARK/${t}.smoke_ok_cola" ]; } \ + && [ ! -f "$MARK/${t}.smoke_done" ] && [ ! -f "$MARK/${t}.smoke_failed" ]; then + if [ -f "$MARK/${t}.smoke_running" ]; then + j=$(cat "$MARK/${t}.smoke_running") + if ! bjobs "$j" 2>/dev/null | grep -qE "RUN|PEND"; then + log=$ROOT/logs/lsf/rr_ifql_evalsmoke_${t}.$j.out + if grep -q "^\[smoke\] exit=" "$log" 2>/dev/null; then + for col in colb cola; do + if grep -q "^\[smoke\] ${col}=0" "$log" 2>/dev/null; then + touch "$MARK/${t}.smoke_ok_${col}" + echo " $t: eval smoke ${col} PASSED -> that column unlocked" + else + echo " $t: eval smoke ${col} did NOT pass ($(grep -h "^\[smoke\] ${col}=" "$log" | tail -1)) -- ${col} stays locked, see $log" + fi + done + touch "$MARK/${t}.smoke_done"; rm -f "$MARK/${t}.smoke_running" "$MARK/${t}.smoke_tries" + else + # never reached "[smoke] exit=" -- preempted or the node died. That is not a verdict: retry. + n=$(cat "$MARK/${t}.smoke_tries" 2>/dev/null || echo 0); case "$n" in ''|*[!0-9]*) n=0;; esac + rm -f "$MARK/${t}.smoke_running" + if [ "$n" -lt 5 ]; then + echo $((n+1)) > "$MARK/${t}.smoke_tries" + echo " $t: eval smoke job $j vanished without finishing (preempted?) -- will retry ($((n+1))/5)" + else + echo " $t: eval smoke never completed in 5 attempts -- both columns stay locked" + touch "$MARK/${t}.smoke_failed" + fi + fi + fi + else + out=$(RR_MEM=64G $ROOT/scripts/bsub_gpu.sh rr_ifql_evalsmoke_${t} \ + $ROOT/scripts/ifql_eval_smoke.sh "$t" 0 2>&1 | grep -oE "Job <[0-9]+>" | grep -oE "[0-9]+") + [ -n "$out" ] && { echo "$out" > "$MARK/${t}.smoke_running"; echo " $t: eval smoke submitted as job $out"; } + fi + fi + + # (3) the grids, each behind ITS OWN column's smoke verdict, in priority order. + # Column (b) is the single-actor row the paper table needs most, so it goes first; its `random` / + # `permuted` controls are NOT optional (coordinator, 2026-09-21): two scorers in this project have + # already turned out to rank at chance, so a column without its own shuffled-score control cannot be + # told apart from a random-of-128. + if [ -f "$MARK/${t}.smoke_ok_colb" ]; then + $PY $ROOT/scripts/launch_ifql.py --eval-critic "$t" 2>&1 | grep -vE "no IFQL bundle|no epoch-5000" | tail -4 + $PY $ROOT/scripts/launch_ifql.py --eval-controls "$t" 2>&1 | grep -vE "no IFQL bundle|no epoch-5000" | tail -4 + else + echo " $t: column (b) still locked (smoke not passed)" + fi + if [ -f "$MARK/${t}.smoke_ok_cola" ]; then + $PY $ROOT/scripts/launch_ifql.py --eval-policy "$t" 2>&1 | grep -vE "no published" | tail -4 + else + echo " $t: column (a) still locked (smoke not passed)" + fi + done + sleep 600 + done + echo "ifql watcher ended $(date -u)" +} +main "$@" diff --git a/gen_q_rsm/rsm_rise/pipeline/scripts/launch_dinowm_on_actor.py b/gen_q_rsm/rsm_rise/pipeline/scripts/launch_dinowm_on_actor.py new file mode 100644 index 0000000000000000000000000000000000000000..947b4e5490b036283f7bc6725cf0c5d5f716da5e --- /dev/null +++ b/gen_q_rsm/rsm_rise/pipeline/scripts/launch_dinowm_on_actor.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 +"""DINO-WM scorer sweep on the RISE actor (S0A) -- the world-model comparator of gen_q#268. + +Same protocol as scripts/launch_rsm_on_actor.py and scripts/launch_tdflow_on_actor.py: the RISE +actor at epoch 5000 proposes 128 action chunks per decision step, the scorer ranks them, argmax is +executed; horizon 400, 50 episodes, 3 policy seeds x 3 eval seeds, the task's canonical eval env, and +the provenance/membership label as the reward for every scorer. + +WHAT DIFFERS FROM THE RSM / TD-FLOW SWEEPS, AND WHY + * The grid is L in {1,2,4,8} ONLY -- no beta. A DINO-WM hop is one action chunk (8 frames, the + step the model was trained on); it has no discount to sweep. gen_q#268 therefore matches the + scorers on the NUMBER of hops, which is what this grid does. `plan_beta` is still set because + every planner cell carries one, but it is inert on this backend (the read-out passes a constant + zero beta to the predictor and uses hop_frames for the fold discount), so one value is used for + every cell and the arm label verdict_table builds ("L N128") correctly omits it. + * plan_particles is irrelevant: the dynamics are deterministic, so the read-out forces one + particle. That makes this the cheapest scorer in the table, which the caption discloses. + * The permuted control is run at ONE depth (--control-depth, default 4) rather than at each L. + Under `permuted` the executed action is a uniformly chosen candidate whatever the scores were, so + the control does not depend on L; it is run against the DINO-WM checkpoint anyway so that + verdict_table pairs each scorer with a control of its own family. + +usage: launch_dinowm_on_actor.py [ ...] [--hops 1,2,4,8] [--control-depth 4] [--print-only] +""" +import subprocess, sys +# --proposer FAM (gen_q#268 / #267): the flagship is moving to a best-proposer-per-task table, and every +# value-estimation method -- these three included -- must be measured on THAT proposer. The policy +# family is therefore a parameter, not the S0A constant it was. The family is carried into the cell +# label (S0Aidqls0, S0Ansns1, ...) and into --tag, so a cell on one proposer can never be confused +# with, skipped for, or pooled with the same read-out on another: launch_e1_grid's busy/exists checks +# key on the cell NAME. Default S0A keeps every existing cell name byte-identical. + +from pathlib import Path +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from launch_flagship_topup import ENVS, ckpt +ROOT = Path("/proj/dmfexp/zwhong/rsm_rise") +TASKS = list(ENVS) +HOPS = (1, 2, 4, 8) +BETA = 0.95 # inert on this backend; one value for every cell (see the module docstring) + + +def run(task, model, extra, es, label, dry, prop="S0A"): + cmd = [sys.executable, str(ROOT / "scripts/launch_e1_grid.py"), "--task", task, "--env", ENVS[task], + "--model", f"DINOWM={model}:dinowm", "--hop", str(ROOT / f"runs/{task}/hop/gauss/policy_r1.pt"), + "--num-rollouts", "50", "--horizon", "400", "--eval-seed", str(es), "--tag", (f"DWMACTOR-es{es}" if prop == "S0A" else f"DINOWM{prop}-es{es}"), + "--out-dir", str(ROOT / f"runs/{task}/eval_onactor"), "--pack", "4", "--queue", "preemptable", + "--primary-beta", str(BETA), *extra] + if dry: + cmd.append("--print-only") + r = subprocess.run(cmd, capture_output=True, text=True) + tail = [l for l in r.stderr.splitlines() if "jobs submitted" in l or "missing" in l] + print(f" {task} es{es} {label}:", tail[-1:] or r.stderr.strip()[-300:]) + if dry: + print("\n".join(r.stdout.splitlines()[:3])) + + +def main(): + dry = "--print-only" in sys.argv + hops, cdepth = HOPS, 4 + for i, a in enumerate(sys.argv): + if a == "--hops": + hops = tuple(int(x) for x in sys.argv[i + 1].split(",")) + if a == "--control-depth": + cdepth = int(sys.argv[i + 1]) + prop = "S0A" + for i, a in enumerate(sys.argv): + if a == "--proposer": + prop = sys.argv[i + 1] + epoch = 5000 + for i, a in enumerate(sys.argv): + if a == "--epoch": + epoch = int(sys.argv[i + 1]) + plab = prop + (f"E{epoch}" if epoch != 5000 else "") # label/tag carry the epoch: 500 and 5000 cells never share a name + tasks = [a for a in sys.argv[1:] if not a.startswith("--") and a in ENVS] + for task in tasks: + model = ROOT / f"runs/{task}/wm/dinowm/ckpt_best.pt" + if not model.exists(): + print(f" {task}: MISSING {model}") + continue + # MOVING CHECKPOINT GUARD (2026-09-21, #268 hand-back). ckpt_best.pt is rewritten while the world model + # trains (best-so-far was step 2500 on mug at 48 % of training); cells launched before the final + # checkpoint exists load different weights and pool as one arm. Refuse unless training finished + # (ckpt_s100000.pt beside it) or --allow-partial is given explicitly. + final = model.with_name("ckpt_s100000.pt") + if not final.exists() and "--allow-partial" not in sys.argv: + print(f" {task}: DINO-WM still training ({final.name} absent); refusing to evaluate a moving ckpt_best.pt -- pass --allow-partial to override") + continue + pol, cells = [], [] + for p in (0, 1, 2): + c = ckpt(task, prop, p, epoch) + if not c: + print(f" {task}: no epoch-{epoch} {prop} seed {p}") + continue + pol += ["--policy", f"{plab}s{p}={c}"] + for L in hops: + cells.append(f"DINOWM,{BETA},{L},{'d1' if L == 1 else 'fold'},128,argmax,{plab}s{p}") + if not pol: + continue + for es in (0, 1, 2): + run(task, model, [*pol, *[x for c in cells for x in ("--cells", c)], + "--primary-depth", str(cdepth)], es, f"dinowm grid ({len(cells)} cells)", dry, plab) + run(task, model, [*pol, "--grid", "controls", "--controls-subset", "permuted", + "--primary-depth", str(cdepth)], es, "dinowm permuted control", dry, plab) + + +if __name__ == "__main__": + main()