jiajun0613 commited on
Commit
3255bae
·
verified ·
1 Parent(s): ed00389

Remove superseded paths after replacement content verification

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. UPLOAD.md +0 -18
  2. act/jev_long000_supplement_v2/README.md +0 -9
  3. act/jev_long000_supplement_v2/checksums.sha256 +0 -79
  4. act/jev_long000_supplement_v2/clips.csv +0 -32
  5. act/jev_long000_supplement_v2/evidence/jev_006.json.gz +0 -3
  6. act/jev_long000_supplement_v2/evidence/jev_007.json.gz +0 -3
  7. act/jev_long000_supplement_v2/evidence/jev_012.json.gz +0 -3
  8. act/jev_long000_supplement_v2/evidence/jev_039.json.gz +0 -3
  9. act/jev_long000_supplement_v2/evidence/jev_041.json.gz +0 -3
  10. act/jev_long000_supplement_v2/evidence/jev_046.json.gz +0 -3
  11. act/jev_long000_supplement_v2/evidence/jev_047.json.gz +0 -3
  12. act/jev_long000_supplement_v2/evidence/jev_v2_006.json.gz +0 -3
  13. act/jev_long000_supplement_v2/evidence/jev_v2_007.json.gz +0 -3
  14. act/jev_long000_supplement_v2/evidence/jev_v2_012.json.gz +0 -3
  15. act/jev_long000_supplement_v2/evidence/jev_v2_014.json.gz +0 -3
  16. act/jev_long000_supplement_v2/evidence/jev_v2_039.json.gz +0 -3
  17. act/jev_long000_supplement_v2/evidence/jev_v2_040.json.gz +0 -3
  18. act/jev_long000_supplement_v2/evidence/jev_v2_041.json.gz +0 -3
  19. act/jev_long000_supplement_v2/evidence/jev_v2_046.json.gz +0 -3
  20. act/jev_long000_supplement_v2/evidence/jev_v2_047.json.gz +0 -3
  21. act/jev_long000_supplement_v2/evidence/jev_v2_049.json.gz +0 -3
  22. act/jev_long000_supplement_v2/evidence/rules_000.json.gz +0 -3
  23. act/jev_long000_supplement_v2/evidence/rules_007.json.gz +0 -3
  24. act/jev_long000_supplement_v2/evidence/rules_041.json.gz +0 -3
  25. act/jev_long000_supplement_v2/evidence/rules_046.json.gz +0 -3
  26. act/jev_long000_supplement_v2/gpu_jev.json +0 -9
  27. act/jev_long000_supplement_v2/gpu_jev_v2.json +0 -9
  28. act/jev_long000_supplement_v2/gpu_rules.json +0 -9
  29. act/jev_long000_supplement_v2/hdf5/jev.hdf5 +0 -3
  30. act/jev_long000_supplement_v2/hdf5/jev_v2.hdf5 +0 -3
  31. act/jev_long000_supplement_v2/hdf5/rules.hdf5 +0 -3
  32. act/jev_long000_supplement_v2/logs/render_418473.err +0 -18
  33. act/jev_long000_supplement_v2/logs/render_418473.out +0 -21
  34. act/jev_long000_supplement_v2/manifest.json +0 -22
  35. act/jev_long000_supplement_v2/source_records/LIVING_ROOM_SCENE2_put_both_the_alphabet_soup_and_the_tomato_sauce_in_the_basket.bddl +0 -134
  36. act/jev_long000_supplement_v2/source_records/LIVING_ROOM_SCENE2_put_both_the_alphabet_soup_and_the_tomato_sauce_in_the_basket.pruned_init +0 -0
  37. act/jev_long000_supplement_v2/source_records/builder_code/__init__.py +0 -1
  38. act/jev_long000_supplement_v2/source_records/builder_code/build_labels.py +0 -172
  39. act/jev_long000_supplement_v2/source_records/builder_code/common.py +0 -58
  40. act/jev_long000_supplement_v2/source_records/builder_code/dataset.py +0 -78
  41. act/jev_long000_supplement_v2/source_records/builder_code/extract_expert.py +0 -53
  42. act/jev_long000_supplement_v2/source_records/builder_code/finalize.py +0 -266
  43. act/jev_long000_supplement_v2/source_records/builder_code/labels.py +0 -75
  44. act/jev_long000_supplement_v2/source_records/builder_code/preview.py +0 -34
  45. act/jev_long000_supplement_v2/source_records/builder_code/render_supplement.py +0 -186
  46. act/jev_long000_supplement_v2/source_records/builder_code/review_model.py +0 -52
  47. act/jev_long000_supplement_v2/source_records/builder_code/smoke_loader.py +0 -37
  48. act/jev_long000_supplement_v2/source_records/builder_code/validate.py +0 -175
  49. act/jev_long000_supplement_v2/source_records/jev_006.json +0 -0
  50. act/jev_long000_supplement_v2/source_records/jev_007.json +0 -0
UPLOAD.md DELETED
@@ -1,18 +0,0 @@
1
- # Restore the complete snapshot
2
-
3
- Run from the downloaded dataset root:
4
-
5
- ```bash
6
- sha256sum -c checksums.sha256
7
- find archives/steervit_libero_v3 -name '*.tar' -print0 | while IFS= read -r -d '' f; do
8
- tar -xf "$f" -C .
9
- done
10
- ```
11
-
12
- The checksum list covers bundle files, v3 metadata and all task archives.
13
- Original expert HDF5 SHA hashes are generated by the uploader, and recorded in
14
- upload_completed.json only after all remote file sizes and content hashes match.
15
- To verify those HDF5 files locally, compare against that receipt's sha256 values.
16
- Treat a missing upload_completed.json as an incomplete/unverified upload.
17
- See the GitHub Docs/HANDOFF.md, ENVIRONMENT.md and dataset.md for environment,
18
- assets, path mapping and setup. No old trained weights are included.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/README.md DELETED
@@ -1,9 +0,0 @@
1
- # Long000 测试补充 HDF5 v2
2
-
3
- 保留前轮11条来源、15窗口,并加入最近JEV测试的10条来源、16窗口。合计21条来源、31窗口,1872个保存的双相机观测(含历史),1259个候选观测。其中405个候选观测来自本轮新增窗口。
4
-
5
- hdf5/rules.hdf5、jev.hdf5、jev_v2.hdf5分别存纯规则、旧JEV和最新JEV固定动作回放。来源作业416731/417429,渲染作业418473;同一张独立干净GPU顺序运行。没有加载策略/JEV,没有新闭环,没有造抓取演示。
6
- 每组data/episode_NNN含原始336双RGB、proprio[8]、previous_action[7]、source_observation_step、candidate_target、query_stage_index;sim_state和goal_success仅供离线审查。原动作和来源哈希在source_records;完整物理证据在evidence。
7
- 保存窗口补足前20步:视觉最远前19步,额外1步用于计算该时刻的单步机器人变化。历史跨阶段重置,HDF5不连续行不能直接当相邻时刻。
8
-
9
- 训练标签在outputs/annotations/jev_long000_v3,各行均有因果历史索引、类别、IGNORE掩码和sample_weight。原始LIBERO无需修改。
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/checksums.sha256 DELETED
@@ -1,79 +0,0 @@
1
- fcfd3221a39a231457d54a7c11420d18f1b317722d55511e27d6232cc04db150 README.md
2
- bfdc84c3aa338ef677bb1f183f19e42e93c94ab3fd7e0d40c39633b60a21428e clips.csv
3
- 00e93b73e4863b6d10ea82a024cb8c87282cf63da9ca8929a55d8089e643850d evidence/jev_006.json.gz
4
- a71c78d08fe84e9fb68e72f78395129fc0baf5cb30af5a0fe79bd38b5f6da13f evidence/jev_007.json.gz
5
- c59c675af0b8a0fa5c4f1ae765084c06b1e0e55c31d4d861c465fbeeefd58bfe evidence/jev_012.json.gz
6
- c83b6d9b0dbfdfdc6e6b55918dce179a811ccd73aeae3b11aee713954bab9fb9 evidence/jev_039.json.gz
7
- 801dafd8f9d407da195de90b7ed5ff2ea509e38db36f0ab4b1ee38a25f6ccdbc evidence/jev_041.json.gz
8
- 508e995f8588799ceb2d5f91c6bb17b96bcb216d89d8aeb0301301a84238f856 evidence/jev_046.json.gz
9
- 00c78c866c041a41a2832392955b6134bf780a065b3789ee70729c0d9427b331 evidence/jev_047.json.gz
10
- 7af634c5b12b71b7cd318d98dd63638f5bb62cafb138783d4c9a3c9bc650d6b4 evidence/jev_v2_006.json.gz
11
- f9579465c5ed4539d4b0ee04bdd414a24cba524a8fc3abcb5d0a90f5ff8fc381 evidence/jev_v2_007.json.gz
12
- ef431583834993d090b852b2c40a58d2190fb6cfd59946a6ed196b726602c876 evidence/jev_v2_012.json.gz
13
- f8ab1b5a2861bc22fd5e9b2746dc94e3190862e4ab5a5d4b9aa46a251fccc08b evidence/jev_v2_014.json.gz
14
- 12af81ec7d5b8f6394a80e03ec80d26ce138dd768a24a1a1f4d457e7e2edbafd evidence/jev_v2_039.json.gz
15
- 027fa417a288dfefd2515e27e2008b96e781dd406927ddecb3f8489bc961b5e1 evidence/jev_v2_040.json.gz
16
- 7b9b2c45e9b760138450ca50c417a0eac9dd50cae059c66d76dc60365e2bec30 evidence/jev_v2_041.json.gz
17
- 7d1032488500bfe6a94c76dc5a5fde10af305b16e7ec41929b29703a150033df evidence/jev_v2_046.json.gz
18
- 7e417f5618a341e90d6bdee11ed6b367a0666de0e1cfcc3f95b4f4b1574b23aa evidence/jev_v2_047.json.gz
19
- bc77ee9b0e3f659f9b9e1f8f6c24e8c102ca77cddb18077d79c6c78546d4cff9 evidence/jev_v2_049.json.gz
20
- 4f791e0b32e102ee08bfa4d7ec1c16fca72beda1b543df2af215e970c5402b2c evidence/rules_000.json.gz
21
- 169f86ff94cf5ebc085ee80c9cc954c0865597242325f44f451a2a38c2fd5128 evidence/rules_007.json.gz
22
- 95acd1bd1e45e7c9988f9ed0fafb45fa33b0fe72cad878e47e2c7967d0010379 evidence/rules_041.json.gz
23
- f61dc0bcedb7233aae5d0629fda61a0ec5ebebbfaacf4a2358fe27f130cce236 evidence/rules_046.json.gz
24
- 5f402bca743c5611d1f6b83e1ea2326778e64823524dfe356be1791d1d6a502c gpu_jev.json
25
- 5f402bca743c5611d1f6b83e1ea2326778e64823524dfe356be1791d1d6a502c gpu_jev_v2.json
26
- 5f402bca743c5611d1f6b83e1ea2326778e64823524dfe356be1791d1d6a502c gpu_rules.json
27
- 38a2d451a50b16c13cfd33ac14a5ac5ebb08e95d342b20bb63369b5f98f8b2eb hdf5/jev.hdf5
28
- ce76b050f6d764633fc01062b46622c71eb3f4260e24ad27badecc0875fda04f hdf5/jev_v2.hdf5
29
- 0da709d9b6b8994119cb085131b48362426b904ba10bbf730f28fbca73dc0dfa hdf5/rules.hdf5
30
- 95f994bafb91529eef0dd07a9a63dcd36d08f00a4fd638f1b10e5195d81f9437 logs/render_418473.err
31
- d09507b48dd44d39709f0e49a32e1b3cd08a9f8010054a5785429d6e161e65fd logs/render_418473.out
32
- e8f97ad86220d1f3aaea5ddc521b01c716e2b3dd94fe0d1b076e4eb599c1da3e manifest.json
33
- 2e661058917f683a25bce480015197f0a2c1911bcbc2b9dd9d947199069c9618 source_records/LIVING_ROOM_SCENE2_put_both_the_alphabet_soup_and_the_tomato_sauce_in_the_basket.bddl
34
- 1899fe54c51e24a41d5f9e32254730d6777f4894ab68e0e873f1fa7ae2062030 source_records/LIVING_ROOM_SCENE2_put_both_the_alphabet_soup_and_the_tomato_sauce_in_the_basket.pruned_init
35
- c0c24d2738432a3dff10df961ab660fda1c051c07552f6f4e782a0c745a6295b source_records/builder_code/__init__.py
36
- f8f36689cbb5b50b0dc9e8e5541290aadc609bb5451706a936a30fc5183f2a8d source_records/builder_code/build_labels.py
37
- 9d4557aee5fefe7441fde360e3cb7caa8099dc2e7bea310f29247f0ee82c8a2a source_records/builder_code/common.py
38
- 7337881947be76c159ad4b4f5f338d3d6788ef9f42608084b13d432eb6f6b8aa source_records/builder_code/dataset.py
39
- 380db5cd2fd9653070a8a219a461cd3467415bd550d041074856e7aadd6afdaa source_records/builder_code/extract_expert.py
40
- 88f1f9dcf59d81e99f9d249cd478efb34c952ad12d32b34d11d971525ef7c768 source_records/builder_code/finalize.py
41
- 95fe3a2d0fb6d06766f328e229cbb822392b6c66d73f960f0f52cb0b34457999 source_records/builder_code/labels.py
42
- a5a47b293f2c3975b229e2e45fe90e94f1ce480c751aacfb9dc741cdaac390ac source_records/builder_code/preview.py
43
- 96768b45204f2432f3a6450a0d4f080c3232c49f13dac099e65ce1451a6049ed source_records/builder_code/render_supplement.py
44
- 2c0d0d6951d9631880b08658b2164020f42bc72fe2f030b415913daa6e8cad10 source_records/builder_code/review_model.py
45
- 6d452122b2a11dbe0d02b9b7e5b20cce83955492e3a0fd15209ba2be04cf870c source_records/builder_code/smoke_loader.py
46
- 8920be9cd6783c0b43f62c4cd996ad964bbe74b6b5a264f72871a832a279ad9a source_records/builder_code/validate.py
47
- d446b767492ae115580a7d5c7c5c04232e323cce0eaba21dea3fc3b3cc435445 source_records/jev_006.json
48
- dca8d79e6223c4da638d7aacb2a4e78d0b2d9ba7a326102591b7596f90d4e8fa source_records/jev_007.json
49
- db3ba6f8f7e678ce3bdc30aae952c3aac02484eb1da8fcb0c8172ade5b43a163 source_records/jev_012.json
50
- 33b398f876ba8d62d1d37ad1d0351b2a9dea1e46ba53e7664ee20d83954833ad source_records/jev_039.json
51
- eb859c8072099a3610a8ca06baa67151b24f5e7728934beb4f1675f4d6791259 source_records/jev_041.json
52
- a06ff34c9d4f9bbdda570d23654a69ab10ec8b13f37b33e777df1adac82d83c7 source_records/jev_046.json
53
- f85e69788f80720e06c42a23e6896c9d0e9b101f5b636a5211de2e79aab338e1 source_records/jev_047.json
54
- 84b42c9b4db7b0481364a6a961da332142ad5a78dd44319a30d83389630465c1 source_records/jev_manifest.json
55
- e780d5b4e4defb74b5f2ae66e842e719bf782f806b38667507aebc69c7e819ea source_records/jev_selection.json
56
- d57a34bb7a840079b4415ba95501cdef43e5925350aff2438530c1778dd12e27 source_records/jev_v2_006.json
57
- 3835886f220bf81b171fac8b5d9d28c3819e6c4d8a22545f8d59f48d68837c45 source_records/jev_v2_007.json
58
- 1d10b42d6c793e71f1a0c467259a0b909263629c14ac1546d24e2c7a76bfecd2 source_records/jev_v2_012.json
59
- a8b81530b62c5bde4e1df47113b11c1114d4f1ba844679fda7d3916647f15c7c source_records/jev_v2_014.json
60
- 717a6799ee7a36968e58cad44386c7073147a6a1b520d83ecb755f0c30ee3193 source_records/jev_v2_039.json
61
- dc4da3bc90f6ea8154481e47fe441fccec350280ea60c190ebb68b2fccf3b46d source_records/jev_v2_040.json
62
- fe376c8592cae634a2d946982f594da642d7261eabb64858a53ce1c16c64d548 source_records/jev_v2_041.json
63
- 714fb201665215bcee414cc30d4e0f0b728350a7a002c56d7288398f6c324acc source_records/jev_v2_046.json
64
- 7f8124ca9199ba946cfc4833f946b5c8c9b38f542d5c0001ec8a9c548f012d00 source_records/jev_v2_047.json
65
- 6ef0bc1e3dc38bc637a5062e991992c46422d9aa61f7226d3bd49e059de08d0c source_records/jev_v2_049.json
66
- 7b2c6b6e505905e070c58258e5fc8a8b438ab1693c7573d8471462e2bd0102d0 source_records/jev_v2_manifest.json
67
- 8f721cb13b10ea73ab873cb7e0a407c1b3d041e3d7aad488b805361f028cc95c source_records/jev_v2_selection.json
68
- 53cf439a8947be4c3c4ae083ab45a0282d1ea63f3bb5c61da3cad853b6e054e1 source_records/render.sbatch
69
- 263684ad5bb9046e8a867675b446deeb70291932b5dd26308f721efd96235661 source_records/rules_000.json
70
- 0c4e738fa4fdaa4e71fda4fffaddd45b880b23dcf36b9258b75c5e8c2193c0f8 source_records/rules_007.json
71
- 76e5600985d9ff33a9596321e9713458b29c37304fed48f5dfdf98b54ab8d09a source_records/rules_041.json
72
- c5c7c74dd6b3f5cedee53cca6cca6b0912624aca2348419c2bec0c1c0f352984 source_records/rules_046.json
73
- 7049fbaf120464ccf3005c98ae731b80f7a119502c4cfe2a46bf4dc830fc53c6 source_records/rules_manifest.json
74
- f9a7947316cac7812351d0de7cfa3f56d6a7310e24c51e384d2c4918605ff96f source_records/rules_selection.json
75
- 3c055f4b9d8d4210190f902d807f09790d09228cc1ea77924aadf52375e1aba6 source_records/task.json
76
- 209d2497eeb2588de3d6353f234998fc617fd8df86eebde03207cf4d58d5249f verification.json
77
- 36ed000e9bbcf1415ff333301636e2f72766250d94eebe452154847d246452b1 verification_jev.json
78
- fae35154d42db08ccd293ca66d65dd8ed775646748d74a03c8ee2cc4247d315d verification_jev_v2.json
79
- 8837d0b6b57780a1c19e4f49433b0f128d30e767bbea17490ba052cdd71fbc9b verification_rules.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/clips.csv DELETED
@@ -1,32 +0,0 @@
1
- source,episode,clip_id,start_inclusive,end_exclusive,history_start,purpose,hdf5_file,hdf5_group,annotation
2
- rules,41,clip_01,76,303,56,汤罐真实掉落、回pick及重新抓稳,hdf5/rules.hdf5,data/episode_041,episodes/rollouts/rules_041.json
3
- rules,41,clip_02,343,364,323,重抓汤罐后放好并进入抓番茄酱,hdf5/rules.hdf5,data/episode_041,episodes/rollouts/rules_041.json
4
- rules,41,clip_03,474,521,454,番茄酱掉落并回pick,预算内未完成重抓,hdf5/rules.hdf5,data/episode_041,episodes/rollouts/rules_041.json
5
- rules,46,clip_04,256,513,236,番茄酱真实掉落、回pick及重新抓稳,hdf5/rules.hdf5,data/episode_046,episodes/rollouts/rules_046.json
6
- rules,0,clip_11,244,260,224,256步回退,259步已成功且中间无重新接触,hdf5/rules.hdf5,data/episode_000,episodes/rollouts/rules_000.json
7
- rules,7,clip_12,205,230,185,成功策略的正常番茄酱抓稳交接,hdf5/rules.hdf5,data/episode_007,episodes/rollouts/rules_007.json
8
- rules,7,clip_13,246,263,226,成功策略的正常番茄酱最终放置,hdf5/rules.hdf5,data/episode_007,episodes/rollouts/rules_007.json
9
- jev,7,clip_05,213,244,193,抓起后脱手、落桌,旧JEV仍停place,hdf5/jev.hdf5,data/episode_007,episodes/rollouts/jev_007.json
10
- jev,12,clip_06,214,264,194,不稳交接、搬运滑落、篮沿接触后落桌,hdf5/jev.hdf5,data/episode_012,episodes/rollouts/jev_012.json
11
- jev,39,clip_07,244,276,224,空抓高概率误切place,hdf5/jev.hdf5,data/episode_039,episodes/rollouts/jev_039.json
12
- jev,47,clip_08,228,258,208,未稳交接后脱手,hdf5/jev.hdf5,data/episode_047,episodes/rollouts/jev_047.json
13
- jev,41,clip_09,71,104,51,第一place中汤罐脱手,旧JEV无回退,hdf5/jev.hdf5,data/episode_041,episodes/rollouts/jev_041.json
14
- jev,6,clip_10,288,314,268,篮沿/释放临界状态,313步成功,hdf5/jev.hdf5,data/episode_006,episodes/rollouts/jev_006.json
15
- jev,46,clip_14,218,243,198,原JEV成功案例的正常抓取交接,hdf5/jev.hdf5,data/episode_046,episodes/rollouts/jev_046.json
16
- jev,46,clip_15,323,340,303,原JEV成功案例的最终放置,hdf5/jev.hdf5,data/episode_046,episodes/rollouts/jev_046.json
17
- jev_v2,7,v2_007_203,203,228,183,unstable_handoff,hdf5/jev_v2.hdf5,data/episode_007,episodes/rollouts/jev_v2_007.json
18
- jev_v2,40,v2_040_211,211,237,191,unstable_handoff,hdf5/jev_v2.hdf5,data/episode_040,episodes/rollouts/jev_v2_040.json
19
- jev_v2,46,v2_046_249,249,275,229,opening_handoff,hdf5/jev_v2.hdf5,data/episode_046,episodes/rollouts/jev_v2_046.json
20
- jev_v2,39,v2_039_58,58,82,38,wrong_target_handoff,hdf5/jev_v2.hdf5,data/episode_039,episodes/rollouts/jev_v2_039.json
21
- jev_v2,39,v2_039_414,414,444,394,empty_handoff,hdf5/jev_v2.hdf5,data/episode_039,episodes/rollouts/jev_v2_039.json
22
- jev_v2,41,v2_041_49,49,75,29,wrong_target_handoff,hdf5/jev_v2.hdf5,data/episode_041,episodes/rollouts/jev_v2_041.json
23
- jev_v2,41,v2_041_238,238,260,218,wrong_target_handoff,hdf5/jev_v2.hdf5,data/episode_041,episodes/rollouts/jev_v2_041.json
24
- jev_v2,41,v2_041_278,278,302,258,wrong_target_handoff,hdf5/jev_v2.hdf5,data/episode_041,episodes/rollouts/jev_v2_041.json
25
- jev_v2,41,v2_041_365,365,389,345,wrong_target_handoff,hdf5/jev_v2.hdf5,data/episode_041,episodes/rollouts/jev_v2_041.json
26
- jev_v2,14,v2_014_403,403,432,383,opening_handoff,hdf5/jev_v2.hdf5,data/episode_014,episodes/rollouts/jev_v2_014.json
27
- jev_v2,14,v2_014_451,451,477,431,stable_regrasp_control,hdf5/jev_v2.hdf5,data/episode_014,episodes/rollouts/jev_v2_014.json
28
- jev_v2,49,v2_049_370,370,394,350,late_handoff_control,hdf5/jev_v2.hdf5,data/episode_049,episodes/rollouts/jev_v2_049.json
29
- jev_v2,6,v2_006_204,204,230,184,empty_handoff,hdf5/jev_v2.hdf5,data/episode_006,episodes/rollouts/jev_v2_006.json
30
- jev_v2,6,v2_006_259,259,282,239,regrasp_control,hdf5/jev_v2.hdf5,data/episode_006,episodes/rollouts/jev_v2_006.json
31
- jev_v2,12,v2_012_194,194,219,174,stable_handoff_control,hdf5/jev_v2.hdf5,data/episode_012,episodes/rollouts/jev_v2_012.json
32
- jev_v2,47,v2_047_279,279,304,259,stable_handoff_control,hdf5/jev_v2.hdf5,data/episode_047,episodes/rollouts/jev_v2_047.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_006.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:00e93b73e4863b6d10ea82a024cb8c87282cf63da9ca8929a55d8089e643850d
3
- size 30587
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_007.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:a71c78d08fe84e9fb68e72f78395129fc0baf5cb30af5a0fe79bd38b5f6da13f
3
- size 42497
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_012.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c59c675af0b8a0fa5c4f1ae765084c06b1e0e55c31d4d861c465fbeeefd58bfe
3
- size 41608
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_039.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c83b6d9b0dbfdfdc6e6b55918dce179a811ccd73aeae3b11aee713954bab9fb9
3
- size 43940
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_041.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:801dafd8f9d407da195de90b7ed5ff2ea509e38db36f0ab4b1ee38a25f6ccdbc
3
- size 34384
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_046.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:508e995f8588799ceb2d5f91c6bb17b96bcb216d89d8aeb0301301a84238f856
3
- size 37402
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_047.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:00c78c866c041a41a2832392955b6134bf780a065b3789ee70729c0d9427b331
3
- size 42010
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_006.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7af634c5b12b71b7cd318d98dd63638f5bb62cafb138783d4c9a3c9bc650d6b4
3
- size 29337
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_007.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f9579465c5ed4539d4b0ee04bdd414a24cba524a8fc3abcb5d0a90f5ff8fc381
3
- size 53440
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_012.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ef431583834993d090b852b2c40a58d2190fb6cfd59946a6ed196b726602c876
3
- size 22733
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_014.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f8ab1b5a2861bc22fd5e9b2746dc94e3190862e4ab5a5d4b9aa46a251fccc08b
3
- size 43232
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_039.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:12af81ec7d5b8f6394a80e03ec80d26ce138dd768a24a1a1f4d457e7e2edbafd
3
- size 42908
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_040.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:027fa417a288dfefd2515e27e2008b96e781dd406927ddecb3f8489bc961b5e1
3
- size 45061
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_041.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7b9b2c45e9b760138450ca50c417a0eac9dd50cae059c66d76dc60365e2bec30
3
- size 40676
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_046.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7d1032488500bfe6a94c76dc5a5fde10af305b16e7ec41929b29703a150033df
3
- size 43255
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_047.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:7e417f5618a341e90d6bdee11ed6b367a0666de0e1cfcc3f95b4f4b1574b23aa
3
- size 33571
 
 
 
 
act/jev_long000_supplement_v2/evidence/jev_v2_049.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:bc77ee9b0e3f659f9b9e1f8f6c24e8c102ca77cddb18077d79c6c78546d4cff9
3
- size 44879
 
 
 
 
act/jev_long000_supplement_v2/evidence/rules_000.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:4f791e0b32e102ee08bfa4d7ec1c16fca72beda1b543df2af215e970c5402b2c
3
- size 24605
 
 
 
 
act/jev_long000_supplement_v2/evidence/rules_007.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:169f86ff94cf5ebc085ee80c9cc954c0865597242325f44f451a2a38c2fd5128
3
- size 28832
 
 
 
 
act/jev_long000_supplement_v2/evidence/rules_041.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:95acd1bd1e45e7c9988f9ed0fafb45fa33b0fe72cad878e47e2c7967d0010379
3
- size 48865
 
 
 
 
act/jev_long000_supplement_v2/evidence/rules_046.json.gz DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f61dc0bcedb7233aae5d0629fda61a0ec5ebebbfaacf4a2358fe27f130cce236
3
- size 54928
 
 
 
 
act/jev_long000_supplement_v2/gpu_jev.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "host": "dgx-082",
3
- "slurm_job": "418473",
4
- "cuda_visible": "0",
5
- "index": "0",
6
- "uuid": "GPU-13d7d564-7e6a-ceb0-c5ed-eb83fa5ee9bd",
7
- "memory_before_MiB": 0,
8
- "utilization_before": 0
9
- }
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/gpu_jev_v2.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "host": "dgx-082",
3
- "slurm_job": "418473",
4
- "cuda_visible": "0",
5
- "index": "0",
6
- "uuid": "GPU-13d7d564-7e6a-ceb0-c5ed-eb83fa5ee9bd",
7
- "memory_before_MiB": 0,
8
- "utilization_before": 0
9
- }
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/gpu_rules.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "host": "dgx-082",
3
- "slurm_job": "418473",
4
- "cuda_visible": "0",
5
- "index": "0",
6
- "uuid": "GPU-13d7d564-7e6a-ceb0-c5ed-eb83fa5ee9bd",
7
- "memory_before_MiB": 0,
8
- "utilization_before": 0
9
- }
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/hdf5/jev.hdf5 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:38a2d451a50b16c13cfd33ac14a5ac5ebb08e95d342b20bb63369b5f98f8b2eb
3
- size 163165286
 
 
 
 
act/jev_long000_supplement_v2/hdf5/jev_v2.hdf5 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ce76b050f6d764633fc01062b46622c71eb3f4260e24ad27badecc0875fda04f
3
- size 288851052
 
 
 
 
act/jev_long000_supplement_v2/hdf5/rules.hdf5 DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0da709d9b6b8994119cb085131b48362426b904ba10bbf730f28fbca73dc0dfa
3
- size 300257642
 
 
 
 
act/jev_long000_supplement_v2/logs/render_418473.err DELETED
@@ -1,18 +0,0 @@
1
- [robosuite WARNING] No private macro file found! (macros.py:53)
2
- [robosuite WARNING] It is recommended to use a private macro file (macros.py:54)
3
- [robosuite WARNING] To setup, run: python /home/hansirui_3rd/qianpusun/envs/miniconda3/envs/libero-steeract/lib/python3.10/site-packages/robosuite/scripts/setup_macros.py (macros.py:55)
4
- Gym has been unmaintained since 2022 and does not support NumPy 2.0 amongst other critical functionality.
5
- Please upgrade to Gymnasium, the maintained drop-in replacement of Gym, or contact the authors of your software and request that they upgrade.
6
- See the migration guide at https://gymnasium.farama.org/introduction/migration_guide/ for additional information.
7
- [robosuite WARNING] No private macro file found! (macros.py:53)
8
- [robosuite WARNING] It is recommended to use a private macro file (macros.py:54)
9
- [robosuite WARNING] To setup, run: python /home/hansirui_3rd/qianpusun/envs/miniconda3/envs/libero-steeract/lib/python3.10/site-packages/robosuite/scripts/setup_macros.py (macros.py:55)
10
- Gym has been unmaintained since 2022 and does not support NumPy 2.0 amongst other critical functionality.
11
- Please upgrade to Gymnasium, the maintained drop-in replacement of Gym, or contact the authors of your software and request that they upgrade.
12
- See the migration guide at https://gymnasium.farama.org/introduction/migration_guide/ for additional information.
13
- [robosuite WARNING] No private macro file found! (macros.py:53)
14
- [robosuite WARNING] It is recommended to use a private macro file (macros.py:54)
15
- [robosuite WARNING] To setup, run: python /home/hansirui_3rd/qianpusun/envs/miniconda3/envs/libero-steeract/lib/python3.10/site-packages/robosuite/scripts/setup_macros.py (macros.py:55)
16
- Gym has been unmaintained since 2022 and does not support NumPy 2.0 amongst other critical functionality.
17
- Please upgrade to Gymnasium, the maintained drop-in replacement of Gym, or contact the authors of your software and request that they upgrade.
18
- See the migration guide at https://gymnasium.farama.org/introduction/migration_guide/ for additional information.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/logs/render_418473.out DELETED
@@ -1,21 +0,0 @@
1
- {"group": "sim_state", "episode": 0, "saved": 36, "exact": true, "elapsed_seconds": 10.35}
2
- {"group": "sim_state", "episode": 7, "saved": 78, "exact": true, "elapsed_seconds": 21.84}
3
- {"group": "sim_state", "episode": 41, "saved": 355, "exact": true, "elapsed_seconds": 44.23}
4
- {"group": "sim_state", "episode": 46, "saved": 277, "exact": true, "elapsed_seconds": 68.65}
5
- {"group": "jev_completion", "episode": 6, "saved": 46, "exact": true, "elapsed_seconds": 15.25}
6
- {"group": "jev_completion", "episode": 7, "saved": 51, "exact": true, "elapsed_seconds": 39.85}
7
- {"group": "jev_completion", "episode": 12, "saved": 70, "exact": true, "elapsed_seconds": 64.14}
8
- {"group": "jev_completion", "episode": 39, "saved": 52, "exact": true, "elapsed_seconds": 88.3}
9
- {"group": "jev_completion", "episode": 41, "saved": 53, "exact": true, "elapsed_seconds": 110.95}
10
- {"group": "jev_completion", "episode": 46, "saved": 82, "exact": true, "elapsed_seconds": 129.42}
11
- {"group": "jev_completion", "episode": 47, "saved": 50, "exact": true, "elapsed_seconds": 154.18}
12
- {"group": "jev_completion", "episode": 6, "saved": 89, "exact": true, "elapsed_seconds": 16.23}
13
- {"group": "jev_completion", "episode": 7, "saved": 45, "exact": true, "elapsed_seconds": 41.05}
14
- {"group": "jev_completion", "episode": 12, "saved": 45, "exact": true, "elapsed_seconds": 53.98}
15
- {"group": "jev_completion", "episode": 14, "saved": 94, "exact": true, "elapsed_seconds": 78.0}
16
- {"group": "jev_completion", "episode": 39, "saved": 94, "exact": true, "elapsed_seconds": 102.0}
17
- {"group": "jev_completion", "episode": 40, "saved": 46, "exact": true, "elapsed_seconds": 125.53}
18
- {"group": "jev_completion", "episode": 41, "saved": 174, "exact": true, "elapsed_seconds": 146.09}
19
- {"group": "jev_completion", "episode": 46, "saved": 46, "exact": true, "elapsed_seconds": 165.67}
20
- {"group": "jev_completion", "episode": 47, "saved": 45, "exact": true, "elapsed_seconds": 179.91}
21
- {"group": "jev_completion", "episode": 49, "saved": 44, "exact": true, "elapsed_seconds": 199.21}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/manifest.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "dataset_id": "jev_long000_supplement_v2",
3
- "format_version": 2,
4
- "complete": true,
5
- "task_key": "libero_10:000",
6
- "source_jobs": [
7
- 416731,
8
- 417429
9
- ],
10
- "render_jobs": [
11
- "418473"
12
- ],
13
- "source_episodes": 21,
14
- "clips": 31,
15
- "candidate_observations": 1259,
16
- "observations_including_history": 1872,
17
- "resolution": 336,
18
- "raw_orientation": "robosuite_unrotated",
19
- "training_annotations": "/home/hansirui_3rd/qianpusun/projects/third_party/SteerACT/outputs/annotations/jev_long000_v3",
20
- "verification_sha256": "209d2497eeb2588de3d6353f234998fc617fd8df86eebde03207cf4d58d5249f",
21
- "history": "dense stored prefix up to 20 steps: 19-step visual span + one previous robot observation"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/LIVING_ROOM_SCENE2_put_both_the_alphabet_soup_and_the_tomato_sauce_in_the_basket.bddl DELETED
@@ -1,134 +0,0 @@
1
- (define (problem LIBERO_Living_Room_Tabletop_Manipulation)
2
- (:domain robosuite)
3
- (:language put both the alphabet soup and the tomato sauce in the basket)
4
- (:regions
5
- (basket_init_region
6
- (:target living_room_table)
7
- (:ranges (
8
- (-0.01 0.25 0.01 0.27)
9
- )
10
- )
11
- (:yaw_rotation (
12
- (0.0 0.0)
13
- )
14
- )
15
- )
16
- (milk_init_region
17
- (:target living_room_table)
18
- (:ranges (
19
- (0.025 -0.125 0.07500000000000001 -0.07500000000000001)
20
- )
21
- )
22
- (:yaw_rotation (
23
- (0.0 0.0)
24
- )
25
- )
26
- )
27
- (cream_cheese_init_region
28
- (:target living_room_table)
29
- (:ranges (
30
- (0.07500000000000001 -0.225 0.125 -0.17500000000000002)
31
- )
32
- )
33
- (:yaw_rotation (
34
- (0.0 0.0)
35
- )
36
- )
37
- )
38
- (orange_juice_init_region
39
- (:target living_room_table)
40
- (:ranges (
41
- (-0.025 -0.275 0.025 -0.225)
42
- )
43
- )
44
- (:yaw_rotation (
45
- (0.0 0.0)
46
- )
47
- )
48
- )
49
- (tomato_sauce_init_region
50
- (:target living_room_table)
51
- (:ranges (
52
- (-0.125 0.025 -0.07500000000000001 0.07500000000000001)
53
- )
54
- )
55
- (:yaw_rotation (
56
- (0.0 0.0)
57
- )
58
- )
59
- )
60
- (alphabet_soup_init_region
61
- (:target living_room_table)
62
- (:ranges (
63
- (-0.125 -0.175 -0.07500000000000001 -0.125)
64
- )
65
- )
66
- (:yaw_rotation (
67
- (0.0 0.0)
68
- )
69
- )
70
- )
71
- (butter_init_region
72
- (:target living_room_table)
73
- (:ranges (
74
- (0.025 0.025 0.07500000000000001 0.07500000000000001)
75
- )
76
- )
77
- (:yaw_rotation (
78
- (0.0 0.0)
79
- )
80
- )
81
- )
82
- (ketchup_init_region
83
- (:target living_room_table)
84
- (:ranges (
85
- (-0.275 -0.175 -0.225 -0.125)
86
- )
87
- )
88
- (:yaw_rotation (
89
- (0.0 0.0)
90
- )
91
- )
92
- )
93
- (contain_region
94
- (:target basket_1)
95
- )
96
- )
97
-
98
- (:fixtures
99
- living_room_table - living_room_table
100
- )
101
-
102
- (:objects
103
- alphabet_soup_1 - alphabet_soup
104
- cream_cheese_1 - cream_cheese
105
- tomato_sauce_1 - tomato_sauce
106
- ketchup_1 - ketchup
107
- orange_juice_1 - orange_juice
108
- milk_1 - milk
109
- butter_1 - butter
110
- basket_1 - basket
111
- )
112
-
113
- (:obj_of_interest
114
- alphabet_soup_1
115
- tomato_sauce_1
116
- basket_1
117
- )
118
-
119
- (:init
120
- (On alphabet_soup_1 living_room_table_alphabet_soup_init_region)
121
- (On cream_cheese_1 living_room_table_cream_cheese_init_region)
122
- (On tomato_sauce_1 living_room_table_tomato_sauce_init_region)
123
- (On ketchup_1 living_room_table_ketchup_init_region)
124
- (On milk_1 living_room_table_milk_init_region)
125
- (On orange_juice_1 living_room_table_orange_juice_init_region)
126
- (On butter_1 living_room_table_butter_init_region)
127
- (On basket_1 living_room_table_basket_init_region)
128
- )
129
-
130
- (:goal
131
- (And (In alphabet_soup_1 basket_1_contain_region) (In tomato_sauce_1 basket_1_contain_region))
132
- )
133
-
134
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/LIVING_ROOM_SCENE2_put_both_the_alphabet_soup_and_the_tomato_sauce_in_the_basket.pruned_init DELETED
Binary file (58.9 kB)
 
act/jev_long000_supplement_v2/source_records/builder_code/__init__.py DELETED
@@ -1 +0,0 @@
1
- """Versioned Long000 JEV data preparation; separate from v1 model training."""
 
 
act/jev_long000_supplement_v2/source_records/builder_code/build_labels.py DELETED
@@ -1,172 +0,0 @@
1
- """Build all-50 expert + recorded-rollout JEV v2 JSON; do not train a model."""
2
- import argparse
3
- from collections import Counter, defaultdict
4
- import csv
5
- from pathlib import Path
6
- import shutil
7
-
8
- from common import PROJECT, EVAL, OLD, AUDIT, FINAL_SUPPLEMENT, FINAL_LABELS, CAMERAS, read, write, sha
9
- from labels import classify, IGNORE, RECOVER, NAMES, RECIPE
10
-
11
- def summarize(rows):
12
- out=defaultdict(Counter)
13
- for r in rows:
14
- out[r['head']][r['label_name']]+=1
15
- return {k:dict(v) for k,v in out.items()}
16
-
17
- def history_indices(t,context_start,lookup,version=2):
18
- start=max(context_start,t-7)
19
- times=list(range(start,t+1))
20
- if version==3:
21
- from tools.libero_completion.inputs import history_steps
22
- times=history_steps(t,context_start)
23
- assert all(v in lookup for v in times),(t,context_start,times)
24
- padding=8-len(times)
25
- return [-1]*padding+[lookup[v] for v in times], [False]*padding+[True]*len(times),times
26
-
27
- def make_row(t,si,context_start,states,lookup,task,source_kind,source_id,role,version=2):
28
- # Physical decisions see the same causal context available to the classifier.
29
- indices,mask,times=history_indices(t,context_start,lookup,version)
30
- # Teacher confirmations stay dense physical steps, regardless of input subsampling.
31
- h=[states[v] for v in range(max(context_start,t-7),t+1)]
32
- label,reason=classify(task['stages'][si],h,source_kind=source_kind,source_id=source_id,
33
- old_prompt=role=='previous_stage_prompt')
34
- return dict(sample_weight=1.,sample_id=f's{si}_t{t:06}',observation_step=t,rgb_index=lookup[t],
35
- prompt_stage_index=si,head='pick' if si%2==0 else 'place',
36
- label=label,label_name=NAMES[label],loss_mask=label!=IGNORE,
37
- label_source='causal_physics_v2',label_reason=reason,role=role,
38
- history_rgb_indices=indices,history_valid_mask=mask,history_observation_steps=times,
39
- query_context_start=context_start,recovery_stage_id=f's{si-1}' if label==RECOVER else None,
40
- label_status='audited_physics_weak_supervision')
41
-
42
- def main():
43
- ap=argparse.ArgumentParser();ap.add_argument('--build-root',type=Path,required=True)
44
- ap.add_argument('--version',type=int,choices=[2,3],default=2)
45
- args=ap.parse_args();version=args.version
46
- final_supplement=PROJECT/'data/jev_long000_supplement_v2' if version==3 else FINAL_SUPPLEMENT
47
- root=args.build_root;out=root/'annotations';out.mkdir(exist_ok=False)
48
- expert_evidence=root/'expert_evidence';supplement=root/'supplement'
49
- task=read(EVAL/'sim_state/evaluation/manifest.json')['plans'][0]['task']
50
- original=read(OLD/'episodes/libero_10/000/demo_0.json')
51
- prompts=[]
52
- for i,p in enumerate(original['stage_prompts']):
53
- prompts.append(dict(index=i,template_id=f's{i}',head='pick' if i%2==0 else 'place',
54
- stage_type=p['stage_type'],action_text=p['action_text'],focus=p['focus'],
55
- object_ids=task['stages'][i]['object_ids'],is_terminal=i==3,
56
- next_stage_id=f's{i+1}' if i<3 else None,recovery_stage_id=f's{i-1}' if i%2 else None))
57
- write(out/'label_recipe.json',RECIPE)
58
- write(out/'stage_prompts.json',dict(task_key='libero_10:000',stages=prompts,
59
- routing='pick COMPLETE -> same-object place; nonterminal place COMPLETE -> next pick; '
60
- 'place RECOVER -> same-object pick; terminal COMPLETE never ends episode; official simulator goal ends episode'))
61
- records=[];all_rows=[];source_checks={}
62
- def save_episode(ep,rel):
63
- write(out/rel,ep)
64
- records.append(dict(episode_id=ep['episode_id'],source_kind=ep['source_kind'],annotation=rel,
65
- annotation_sha256=sha(out/rel),source_hdf5=ep['source_hdf5'],hdf5_episode_group=ep['hdf5_episode_group'],
66
- split='train',candidate_rows=len(ep['samples']),train_rows=sum(r['loss_mask'] for r in ep['samples']),
67
- label_counts=summarize(ep['samples'])))
68
- for r in ep['samples']:
69
- all_rows.append(dict(episode_id=ep['episode_id'],source_kind=ep['source_kind'],**r))
70
- for i in range(50):
71
- src=OLD/f'episodes/libero_10/000/demo_{i}.json';old=read(src)
72
- evidence=expert_evidence/f'expert_{i:03}.json.gz';states=read(evidence)['states'];n=len(states)
73
- lookup={t:t-1 for t in range(1,n)};rows=[]
74
- for prev in old['samples']:
75
- t,si=prev['state_index'],prev['prompt_stage_index']
76
- p=old['stage_prompts'][si];role='active_stage_prompt' if t<p['reference_end'] else 'previous_stage_prompt'
77
- row=make_row(t,si,max(1,p['reference_start']),states,lookup,task,'expert',f'expert_{i:03}',role,version)
78
- row['previous_binary_label']=prev['label'];rows.append(row)
79
- source_checks[str(src)]=sha(src)
80
- ep=dict(format_version=version,dataset_kind='phase_conditioned_temporal_decision',episode_id=f'expert_{i:03}',
81
- source_kind='expert',split='train',source_hdf5=old['source_hdf5'],hdf5_episode_group=old['hdf5_episode_group'],
82
- source_annotation=str(src),source_annotation_sha256=sha(src),source_evidence=f'audit/expert/expert_{i:03}.json.gz',
83
- observation_convention='state t -> RGB[t-1]; 1<=t<num_steps; duplicate terminal RGB excluded',
84
- task_key='libero_10:000',num_source_states=n,cameras=CAMERAS,stage_prompts=prompts,
85
- physical_source_sha256=sha(evidence),samples=rows)
86
- save_episode(ep,f'episodes/expert/demo_{i:03}.json')
87
- if version==3:
88
- selections=[read(root/f'{name}_selection.json') for name in ('rules','jev','jev_v2')]
89
- grouped=[]
90
- for name,selection in zip(('rules','jev','jev_v2'),selections):
91
- by_episode=defaultdict(list)
92
- for c in selection['clips']:by_episode[int(c['episode'])].append(c)
93
- for i,windows in sorted(by_episode.items()):
94
- grouped.append((name,'sim_state' if name=='rules' else 'jev_completion',i,windows,selection['source_job']))
95
- else:
96
- clips=list(csv.DictReader((AUDIT/'training_data_review/long000_dataset_spec/proposed_clips.csv').open()))
97
- by_episode=defaultdict(list)
98
- for c in clips:by_episode[c['group'],int(c['episode'])].append(c)
99
- grouped=[('rules' if g=='sim_state' else 'jev',g,i,ws,416731) for (g,i),ws in sorted(by_episode.items())]
100
- for prefix,group,i,windows,source_job in grouped:
101
- eid=f'{prefix}_{i:03}'
102
- evidence=supplement/'evidence'/f'{eid}.json.gz';ev=read(evidence);states=ev['states'];stages=ev['query_stage_indices']
103
- context=[];begin=0
104
- for t,si in enumerate(stages):
105
- if t and si!=stages[t-1]:begin=t
106
- context.append(begin)
107
- selected=set();targets=set();window_by_step={}
108
- for c in windows:
109
- selected.update(range(int(c['history_start']),int(c['end_exclusive'])))
110
- for t in range(int(c['start_inclusive']),int(c['end_exclusive'])):
111
- targets.add(t);window_by_step[t]=c['clip_id']
112
- lookup={t:j for j,t in enumerate(sorted(selected))};rows=[]
113
- for t in sorted(targets):
114
- row=make_row(t,stages[t],context[t],states,lookup,task,'rollout',eid,'recorded_predecision_stage',version)
115
- row['clip_id']=window_by_step[t]
116
- row['sample_weight']=2. if prefix=='jev_v2' else 1.
117
- rows.append(row)
118
- ep=dict(format_version=version,dataset_kind='phase_conditioned_temporal_decision',episode_id=eid,
119
- source_kind='rollout',source_group=group,initial_state_group=f'init_{i:03}',source_job=source_job,split='train',
120
- source_hdf5=str(final_supplement/'hdf5'/f'{prefix}.hdf5'),hdf5_episode_group=f'data/episode_{i:03}',
121
- source_record=str(final_supplement/'source_records'/f'{eid}.json'),source_record_sha256=ev['source_sha256'],
122
- source_evidence=str(final_supplement/'evidence'/f'{eid}.json.gz'),physical_source_sha256=sha(evidence),
123
- observation_convention='RGB row -> source_observation_step; observation t follows t actions',
124
- task_key='libero_10:000',cameras=CAMERAS,stage_prompts=prompts,samples=rows,
125
- selection_windows=[dict(clip_id=c['clip_id'],start=int(c['start_inclusive']),end=int(c['end_exclusive']),
126
- history_start=int(c['history_start']),purpose=c['purpose']) for c in windows])
127
- save_episode(ep,f'episodes/rollouts/{eid}.json')
128
- (out/'splits').mkdir()
129
- write(out/'splits/train.json',[r['annotation'] for r in records])
130
- write(out/'source_checksums.json',source_checks)
131
- for split in ('validation','calibration','test'):write(out/f'splits/{split}.json',[])
132
- write(out/'manifest.json',dict(format_version=version,dataset_id=f'jev_long000_v{version}',task_keys=['libero_10:000'],
133
- complete=False,phase='awaiting_independent_validation',history_frames=8,
134
- classes={'pick':{'0':'CONTINUE','1':'COMPLETE'},'place':{'0':'CONTINUE','1':'COMPLETE','2':'RECOVER'}},
135
- ignore_index=IGNORE,labels_are='causal physics weak supervision with explicit uncertainty masks',
136
- model_input='raw main/wrist RGB history + action_text + focus; phase selects pick/place head',
137
- excluded_model_inputs=['sim_state','proprio','actions','physical evidence','step','stage index','source','recovery target'],
138
- image_preprocessing=dict(orientation='rotate180_at_encoder_only',resolution=336,raw_dtype='uint8'),
139
- original_expert_episodes=50,supplement_source_episodes=11,supplement_clips=15,
140
- supplement_candidate_observations=854,supplement_saved_observations=959,
141
- episode_index=records,label_counts=summarize(all_rows),
142
- counts_by_source={k:summarize([r for r in all_rows if r['source_kind']==k]) for k in ['expert','rollout']},
143
- split_policy='all 50 original demos and all reviewed supplemental rows train; IGNORE never enters loss; '
144
- 'no offline validation/calibration/test claimed; old supplemental split proposal superseded',
145
- evaluation='closed-loop original 50 are development/regression after using their clips; not independent test',
146
- model_training_started=False,legacy_binary_loader_compatible=False,
147
- legacy_entrypoint='tools.libero_completion.run is v1 binary/single-frame/holdout-only; do not pass this manifest to it',
148
- recipe_sha256=sha(out/'label_recipe.json'),stage_prompts_sha256=sha(out/'stage_prompts.json'),
149
- original_hdf5_sha256=read(expert_evidence/'verification.json')['source_hdf5_sha256']))
150
- if version==3:
151
- from tools.libero_completion.inputs import ROBOT_CONTRACT
152
- import h5py
153
- m=read(out/'manifest.json')
154
- m.update(robot_contract=ROBOT_CONTRACT,history_offsets=ROBOT_CONTRACT['history_offsets'],
155
- model_input='8 mixed-history raw dual RGB + causal robot state + action/focus text; phase selects head',
156
- excluded_model_inputs=['sim_state','object states','contacts','predicates','goal_success','future actions',
157
- 'absolute episode step','stage index','source','recovery target'],
158
- legacy_entrypoint='tools.libero_completion.run --config configs/jev_long000_v3_data.json',
159
- supplement_source_episodes=len(grouped),supplement_clips=sum(len(g[3]) for g in grouped),
160
- supplement_candidate_observations=sum(len(r['samples']) for r in []))
161
- m['supplement_candidate_observations']=sum(r['candidate_rows'] for r in records if r['source_kind']=='rollout')
162
- m['supplement_saved_observations']=0
163
- for name in ('rules','jev','jev_v2'):
164
- with h5py.File(supplement/'hdf5'/f'{name}.hdf5','r') as f:
165
- m['supplement_saved_observations']+=sum(len(g['source_observation_step']) for g in f['data'].values())
166
- m['sample_weighting']='Original/previous supplement 1; 405 new audited window rows 2, including positive controls; IGNORE excluded.'
167
- write(out/'manifest.json',m)
168
- # Evidence is an audit sidecar, never a tensor input.
169
- shutil.copytree(expert_evidence,out/'audit/expert',ignore=shutil.ignore_patterns('runtime'))
170
- print(dict(episodes=len(records),counts=summarize(all_rows)),flush=True)
171
-
172
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/common.py DELETED
@@ -1,58 +0,0 @@
1
- """Shared paths and serialization for the versioned Long000 JEV dataset."""
2
- import gzip
3
- import hashlib
4
- import json
5
- from pathlib import Path
6
-
7
- PROJECT = Path('/home/hansirui_3rd/qianpusun/projects/third_party/SteerACT')
8
- EVAL = PROJECT/'outputs/evaluations/jev_rules_mixed_threads_20261010'
9
- OLD = PROJECT/'outputs/annotations/libero_completion_classification_v1'
10
- AUDIT = PROJECT/'outputs/diagnostics/jev_failure_audit_20261011'
11
- FINAL_SUPPLEMENT = PROJECT/'data/jev_long000_supplement_v1'
12
- FINAL_LABELS = PROJECT/'outputs/annotations/jev_long000_v2'
13
- OBJECTS = ['alphabet_soup_1', 'tomato_sauce_1']
14
- CAMERAS = {'main': 'obs/agentview_rgb', 'wrist': 'obs/eye_in_hand_rgb'}
15
-
16
- def read(path):
17
- path = Path(path)
18
- opener = gzip.open if path.suffix == '.gz' else open
19
- with opener(path, 'rt') as f:
20
- return json.load(f)
21
-
22
- def serial(value):
23
- if hasattr(value, 'tolist'):
24
- return value.tolist()
25
- if isinstance(value, Path):
26
- return str(value)
27
- raise TypeError(type(value))
28
-
29
- def write(path, value):
30
- path = Path(path)
31
- path.parent.mkdir(parents=True, exist_ok=True)
32
- tmp = path.with_name(path.name+'.tmp')
33
- opener = gzip.open if path.suffix == '.gz' else open
34
- with opener(tmp, 'wt') as f:
35
- json.dump(value, f, ensure_ascii=False, indent=None if path.suffix == '.gz' else 2,
36
- default=serial, allow_nan=False)
37
- f.write('\n')
38
- tmp.replace(path)
39
-
40
- def sha(path):
41
- h = hashlib.sha256()
42
- with open(path, 'rb') as f:
43
- for block in iter(lambda: f.read(8*1024*1024), b''):
44
- h.update(block)
45
- return h.hexdigest()
46
-
47
- def trace_stages(ep):
48
- """Pre-decision stage, including the last observation after the last action."""
49
- traces = {r['observation_step']: r for r in ep['manager_trace']}
50
- stages = []
51
- for t in range(ep['num_steps']+1):
52
- if t in traces:
53
- sid = traces[t]['scored_stage_id']
54
- else:
55
- assert t == ep['num_steps'], (t, ep['num_steps'])
56
- sid = ep['stage_ids'][-1]
57
- stages.append(int(sid[1:]))
58
- return stages
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/dataset.py DELETED
@@ -1,78 +0,0 @@
1
- """Raw v2 samples for the future pick-binary/place-three-way temporal trainer.
2
-
3
- This adapter does not silently change the v1 binary trainer. RGB is unrotated,
4
- uint8, [8, 2, 336, 336, 3]; apply FrozenEncoder.preprocess once to valid frames.
5
- """
6
- from collections import OrderedDict
7
- from pathlib import Path
8
- import json
9
- import numpy as np
10
- import h5py
11
- import torch
12
- from torch.utils.data import Dataset
13
-
14
- class DecisionDataset(Dataset):
15
- def __init__(self, root, *, include_ignored=False, supplement_root=None):
16
- self.root=Path(root)
17
- manifest=json.loads((self.root/'manifest.json').read_text())
18
- if manifest['dataset_id'] not in ('jev_long000_v2','jev_long000_v3') or manifest['history_frames']!=8:
19
- raise ValueError('Expected temporal, phase-conditioned JEV Long000 v2')
20
- self.manifest=manifest
21
- self.supplement_root=Path(supplement_root) if supplement_root else None
22
- self.episodes=[];self.indices=[];self.files=OrderedDict()
23
- for rel in json.loads((self.root/'splits/train.json').read_text()):
24
- ep=json.loads((self.root/rel).read_text());i=len(self.episodes);self.episodes.append(ep)
25
- self.indices.extend((i,j) for j,r in enumerate(ep['samples']) if include_ignored or r['loss_mask'])
26
-
27
- def __len__(self):return len(self.indices)
28
-
29
- def source_path(self,ep):
30
- p=Path(ep['source_hdf5'])
31
- if ep['source_kind']=='rollout' and self.supplement_root:
32
- p=self.supplement_root/'hdf5'/p.name
33
- return p
34
-
35
- def __getitem__(self,index):
36
- i,j=self.indices[index];ep=self.episodes[i];row=ep['samples'][j]
37
- path=str(self.source_path(ep))
38
- if path not in self.files:
39
- self.files[path]=h5py.File(path,'r')
40
- if len(self.files)>4:self.files.popitem(last=False)[1].close()
41
- self.files.move_to_end(path);g=self.files[path][ep['hdf5_episode_group']]
42
- mask=np.asarray(row['history_valid_mask'],bool)
43
- ids=np.asarray(row['history_rgb_indices'],np.int64)[mask]
44
- rgb=np.zeros((8,2,336,336,3),np.uint8)
45
- for camera,key in enumerate(['main','wrist']):
46
- # Frame chunks are much faster than HDF5 point selections over RGB.
47
- rgb[mask,camera]=np.stack([g[ep['cameras'][key]][int(v)] for v in ids])
48
- p=ep['stage_prompts'][row['prompt_stage_index']]
49
- extra={}
50
- if ep['format_version']==3:
51
- from tools.libero_completion.inputs import robot_history
52
- extra['robot_state']=robot_history(ep,row,g)
53
- return dict(model_inputs=dict(**extra,rgb_history=rgb,history_mask=mask,action_text=p['action_text'],focus=p['focus']),
54
- target=dict(head=row['head'],label=row['label'],loss_mask=row['loss_mask']),
55
- metadata=dict(episode_id=ep['episode_id'],sample_id=row['sample_id'],source_kind=ep['source_kind'],
56
- recovery_stage_id=row['recovery_stage_id']))
57
-
58
- def close(self):
59
- for f in self.files.values():f.close()
60
- self.files.clear()
61
-
62
- def __getstate__(self):return {**self.__dict__,'files':OrderedDict()}
63
-
64
-
65
- def collate_decisions(samples):
66
- """Preserve text and audit metadata while batching only intended tensors."""
67
- extra={}
68
- if 'robot_state' in samples[0]['model_inputs']:
69
- extra['robot_state']=torch.from_numpy(np.stack([s['model_inputs']['robot_state'] for s in samples]))
70
- return dict(model_inputs=dict(**extra,
71
- rgb_history=torch.from_numpy(np.stack([s['model_inputs']['rgb_history'] for s in samples])),
72
- history_mask=torch.from_numpy(np.stack([s['model_inputs']['history_mask'] for s in samples])),
73
- action_text=[s['model_inputs']['action_text'] for s in samples],
74
- focus=[s['model_inputs']['focus'] for s in samples]),
75
- target=dict(head_id=torch.tensor([0 if s['target']['head']=='pick' else 1 for s in samples]),
76
- label=torch.tensor([s['target']['label'] for s in samples],dtype=torch.long),
77
- loss_mask=torch.tensor([s['target']['loss_mask'] for s in samples],dtype=torch.bool)),
78
- metadata=[s['metadata'] for s in samples])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/extract_expert.py DELETED
@@ -1,53 +0,0 @@
1
- """Restore expert XML/states on CPU to audit causal labels; never alter HDF5."""
2
- import argparse
3
- import sys
4
- import time
5
- from pathlib import Path
6
- from common import PROJECT, EVAL, OLD, AUDIT, read, write, sha
7
-
8
- def main():
9
- ap=argparse.ArgumentParser(); ap.add_argument('--output',type=Path,required=True); args=ap.parse_args()
10
- import h5py
11
- import numpy as np
12
- import torch
13
- torch.set_num_threads(1)
14
- sys.path.insert(0,str(PROJECT/'steeract_policy/src'))
15
- from steeract.evaluation.backend import configure, make_env, localize_xml
16
- from steeract.stages.state_reader import StateReader
17
- cfg=read(EVAL/'sim_state/evaluation/manifest.json')['config']
18
- task=read(EVAL/'sim_state/evaluation/manifest.json')['plans'][0]['task']
19
- package=configure(cfg,'standard',args.output/'runtime',render=False)
20
- env=make_env(task['bddl'],seed=7,render=False)
21
- checks=[]; start=time.perf_counter()
22
- with h5py.File(task['source_hdf5'],'r') as h5:
23
- try:
24
- for i in range(50):
25
- old=read(OLD/f'episodes/libero_10/000/demo_{i}.json')
26
- group=h5[f'data/demo_{i}']; states=group['states'][()]; actions=group['actions'][()]
27
- env.reset_from_xml_string(localize_xml(group.attrs['model_file'],package,task['entities']))
28
- reader=StateReader(env,task)
29
- original=np.load(AUDIT/'training_data_review/physics'/f"{old['episode_id']}.npz")
30
- rows=[]
31
- for t, state in enumerate(states):
32
- env.sim.set_state_from_flattened(state); env.sim.forward()
33
- row=reader.read(t,actions[t-1] if t else [0.]*6+[-1.])
34
- for oi,obj in enumerate(['alphabet_soup_1','tomato_sauce_1']):
35
- assert row['touch'][obj]==original['touch'][t,oi].tolist()
36
- assert row['supported'][obj]==bool(original['supported'][t,oi])
37
- assert row['palm'][obj]==bool(original['palm'][t,oi])
38
- assert np.allclose(row['positions'][obj],original['positions'][t,oi],atol=1e-10,rtol=0)
39
- assert np.isclose(row['width'],abs(original['gripper'][t,0]-original['gripper'][t,1]),atol=1e-10)
40
- rows.append(row)
41
- write(args.output/f'expert_{i:03}.json.gz',dict(episode=i,task=task,source_hdf5=task['source_hdf5'],
42
- annotation_sha256=sha(OLD/f'episodes/libero_10/000/demo_{i}.json'),
43
- method='restore recorded XML/state; mj_forward; no dynamics or model inference',states=rows))
44
- checks.append(dict(episode=i,states=len(rows),matches_prior_contact_audit=True,
45
- observed_final_goal_success=rows[-1]['goal_success'],
46
- first_goal_success=next((t for t,r in enumerate(rows) if r['goal_success']),None)))
47
- if i%10==9: print('expert states audited',i+1,'elapsed',round(time.perf_counter()-start,1),flush=True)
48
- finally:
49
- env.close()
50
- write(args.output/'verification.json',dict(passed=True,episodes=checks,source_hdf5_sha256=sha(task['source_hdf5']),
51
- elapsed_seconds=time.perf_counter()-start,model_inference=False))
52
-
53
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/finalize.py DELETED
@@ -1,266 +0,0 @@
1
- """Write dataset documentation and reproducibility manifests after validation."""
2
- import argparse
3
- import csv
4
- from pathlib import Path
5
- import shutil
6
- from common import PROJECT,EVAL,AUDIT,FINAL_SUPPLEMENT,FINAL_LABELS,read,write,sha
7
-
8
- def main():
9
- ap=argparse.ArgumentParser();ap.add_argument('--build-root',type=Path,required=True);a=ap.parse_args()
10
- root=a.build_root;sup=root/'supplement';ann=root/'annotations'
11
- m=read(ann/'manifest.json');v=read(ann/'verification.json')
12
- if m['format_version']==3:return finalize_state(root)
13
- assert m['complete'] and v['passed']
14
- assert read(ann/'audit/loader_smoke.json')['passed']
15
- groups={g:read(sup/f'verification_{g}.json') for g in ['rules','jev']}
16
- gpus=[read(sup/f'gpu_{g}.json') for g in ['rules','jev']]
17
- assert all(g['passed'] for g in groups.values()) and gpus[0]['uuid']!=gpus[1]['uuid']
18
- assert sum(g['saved_observations'] for g in groups.values())==959
19
- old=AUDIT/'training_data_review/long000_dataset_spec/proposed_clips.csv'
20
- rows=list(csv.DictReader(old.open()))
21
- for r in rows:
22
- for key in ['proposed_split','proposed_labels','label_status','clean_rgb_status','source_replay','source_replay_sha256']:
23
- r.pop(key)
24
- prefix='rules' if r['group']=='sim_state' else 'jev'
25
- r['hdf5_file']=f'hdf5/{prefix}.hdf5';r['hdf5_group']=f"data/episode_{int(r['episode']):03}"
26
- r['annotation']=f"episodes/rollouts/{prefix}_{int(r['episode']):03}.json"
27
- with (sup/'clips.csv').open('w',newline='') as f:
28
- writer=csv.DictWriter(f,fieldnames=list(rows[0]));writer.writeheader();writer.writerows(rows)
29
- source=read(EVAL/'sim_state/evaluation/manifest.json')
30
- initial=Path(source['plans'][0]['initial_states']);bddl=Path(source['plans'][0]['task']['bddl'])
31
- shutil.copy2(initial,sup/'source_records'/initial.name)
32
- shutil.copy2(bddl,sup/'source_records'/bddl.name)
33
- write(sup/'source_records/task.json',source['plans'][0]['task'])
34
- shutil.copy2(root/'model_review.json',ann/'audit/model_review.json')
35
- (sup/'logs').mkdir(exist_ok=True)
36
- for p in (root/'logs').glob('*417152*'):shutil.copy2(p,sup/'logs'/p.name)
37
- shutil.copy2(root/'render.sbatch',sup/'source_records/render.sbatch')
38
- shutil.copytree(root/'code',sup/'source_records/builder_code',dirs_exist_ok=True,
39
- ignore=shutil.ignore_patterns('__pycache__','*.pyc'))
40
- write(sup/'verification.json',dict(passed=True,source_job=416731,render_job=417152,render_node='dgx-103',
41
- gpu_preflights=gpus,group_checks=groups,recorded_actions_unchanged=True,model_inference=False,
42
- policy_loaded=False,jev_loaded=False,synthetic_disturbance=False,total_saved_observations=959,
43
- total_candidate_observations=854,source_episodes=11,clips=15))
44
- artifact_files={str(p.relative_to(sup)):dict(sha256=sha(p),bytes=p.stat().st_size)
45
- for folder in ['hdf5','source_records','evidence','logs'] for p in sorted((sup/folder).rglob('*')) if p.is_file()}
46
- artifact_files['clips.csv']=dict(sha256=sha(sup/'clips.csv'),bytes=(sup/'clips.csv').stat().st_size)
47
- write(sup/'manifest.json',dict(dataset_id='jev_long000_supplement_v1',format_version=1,complete=True,
48
- task_key='libero_10:000',source_job=416731,render_job=417152,render_node='dgx-103',
49
- original_selection=str(old),original_selection_sha256=sha(old),source_episodes=11,
50
- clips=15,candidate_observations=854,observations_including_history=959,
51
- resolution=336,cameras=['agentview_rgb','eye_in_hand_rgb'],raw_orientation='robosuite_unrotated',
52
- observation_convention='Each saved row is observation t after t recorded actions; map with source_observation_step.',
53
- training_annotations=str(FINAL_LABELS),files=artifact_files,verification_sha256=sha(sup/'verification.json'),
54
- label_storage='Versioned JSON outside HDF5. Original records are provenance, not labels.',
55
- sparse_storage='Rows are union of selected clip intervals plus up to 7 context frames. Never bridge source-step gaps.',
56
- reproduce='render_supplement.py --group sim_state/jev_completion --output NEW_DIR on allocated clean GPUs; '
57
- 'OpenBLAS4, torch/OMP/MKL1; use source_records manifests, initial states and original actions.'))
58
- (sup/'README.md').write_text('''# Long000 JEV 测试补充数据 v1
59
-
60
- 已生成并校验。来源为作业416731已经完成的真实测试;此次渲染作业417152,dgx-103两张独立空闲GPU。没有加载policy/JEV,没有改变动作或制造扰动。
61
-
62
- ## 文件与数量
63
-
64
- - `hdf5/rules.hdf5`:规则000/007/041/046,4条来源轨迹、7片段,659个保存观测、610个候选标注时刻。
65
- - `hdf5/jev.hdf5`:JEV006/007/012/039/041/046/047,7条来源轨迹、8片段,300个保存观测、244个候选标注时刻。
66
- - 合计959个双相机观测(含最多7帧额外历史),其中854个候选标注时刻。片段可以跨阶段,不是额外15条完整演示。
67
- - `clips.csv`:原观测区间 `[start_inclusive,end_exclusive)` 和历史起点。
68
- - `source_records/`:11条旧运行记录、两组原manifest、初态文件、BDDL、任务定义与作业脚本。原记录中的概率和切换不是新标签。
69
- - `evidence/`:动作重放得到的完整物理证据,仅供离线审查。
70
- - `verification.json` / `manifest.json`:零机器人状态误差、奖励/最终成败/旧接触证据一致性及文件哈希。
71
-
72
- ## HDF5结构
73
-
74
- 每条轨迹为 `data/episode_NNN`,下含:
75
-
76
- | 字段 | 含义 |
77
- |---|---|
78
- | `obs/agentview_rgb`、`obs/eye_in_hand_rgb` | `[N,336,336,3]` uint8原始双RGB,LZF无损压缩,无文字边框 |
79
- | `source_observation_step` | 这一行对应原轨迹执行t个动作后的观测t |
80
- | `candidate_target` | 是否属于候选标注时刻;false只用于历史上下文 |
81
- | `query_stage_index` | 决策前查询阶段;不是决策后执行动作阶段 |
82
- | `proprio`、`previous_action`、`sim_state`、`goal_success` | 同时刻核查信息,不作为JEV模型输入 |
83
-
84
- group属性保留原XML、seed、初态编号、来源哈希、原成败和步数。每条轨迹只保存窗口并集,同一帧不重复存储;不同窗口可能不连续,历史必须按原step检查连续性。最后真实动作后观测可以保存,不沿用原演示的重复终帧处理。
85
-
86
- 图像保持robosuite原始方向,编码器预处理时仅旋转180度一次;`source_observation_step`直接说明对齐,不使用原LIBERO的隐含t−1规则。训练不得直接按这个稀疏HDF5的相邻行推断时间连续。
87
-
88
- ## 标签
89
-
90
- 新标签统一在项目 `outputs/annotations/jev_long000_v2/`,包含原50条演示与本补充集。补充集854条候选中771条有效、83条IGNORE。RECOVER有64条观测样本,并非64次独立失手;规则000与JEV006均无RECOVER正例。
91
-
92
- 标签是经过案例检查的物理弱监督;临界帧通过IGNORE屏蔽,不能声称全部是人工逐帧gold。没有新训练、没有新闭环结果。
93
- ''')
94
- (ann/'README.md').write_text('''# Long000 JEV v2 训练标签与索引
95
-
96
- 数据已生成并通过检查;模型尚未训练。原LIBERO HDF5和第一轮JEV数据保持原样。
97
-
98
- ## 组成与划分
99
-
100
- - 原50条演示全部进入train,继续引用原 `libero_hdf5_336`;重新生成JEV标签。
101
- - 补充11条来源轨迹的15个窗口,引用 `data/jev_long000_supplement_v1/hdf5/{rules,jev}.hdf5`。
102
- - 本轮经审核可用的补充样本一起训练;之前的补充train/val/cal候选划分不再使用。三个留出清单为空,不能沿用v1的留出选模或温度校准流程。
103
- - 共26504条候选“观测+查询文本”行,24584条计损失、1920条IGNORE。观测数不等于分类样本数:原演示同一画面可查询两个不同阶段。
104
-
105
- | 来源/头 | CONTINUE | COMPLETE | RECOVER | IGNORE |
106
- |---|---:|---:|---:|---:|
107
- | 原演示pick | 7042 | 5918 | 不适用 | 1690 |
108
- | 原演示place | 6833 | 4020 | 0 | 147 |
109
- | 补充pick | 540 | 31 | 不适用 | 9 |
110
- | 补充place | 132 | 4 | 64 | 74 |
111
-
112
- ## 标签规则
113
-
114
- pick头为0继续、1当前抓稳可交接;place头为0继续、1完成、2恢复同物体pick。`-100=IGNORE`配`loss_mask=false`,不是第四个输出。
115
-
116
- - pick正例要求当前无外部支撑,过去3步闭合,并有稳定双指/闭合宽度或持续携带证据。明确空抓、开夹或仍在支撑上为继续,证据不充分的临界帧IGNORE。正常放好松手后配旧pick文本的行排除。
117
- - 100个专家pick切点中71个保留COMPLETE、29个IGNORE,没有统一后移动作切点;后29个在1–2步后获得足够因果证据。8帧历史不等于8帧连续抓稳。
118
- - place完成要求连续3步目标关系、支撑、低位移,并有释放或目标支撑证据;末阶段已有真实官方成功观测可标COMPLETE。没有伪造原HDF5缺失的终态图。
119
- - 恢复要求连续5步脱手、有支撑、目标外且无目标支撑;原演示不生成恢复正例。规则000、JEV006的疑似落稳窗口排除恢复正例,含糊状态IGNORE。
120
- - 最后一个place仍有三类标签;其COMPLETE不触发任务结束,仿真器负责结束。
121
-
122
- 具体参数与判定原因在 `label_recipe.json` 和逐帧 `label_reason`。这是可审计的物理弱监督,未声称所有画面均经人工审核。
123
-
124
- ## 格式和历史
125
-
126
- `manifest.json`是总入口,`splits/train.json`列出61份episode JSON。每份JSON定义图像来源、4个stage_prompts和samples;每行给出当前帧、查询阶段、label、loss_mask及8个历史索引/有效掩码。
127
-
128
- 原演示 state t对应RGB[t−1],仅1≤t<num_steps;补充数据使用显式source_observation_step映射。历史只到当前帧,不跨轨迹、保存区间缺口或查询阶段切换。不足8帧左侧以−1索引/false掩码填充;不得把−1读作最后一帧。旧阶段反事实查询使用该查询自身的上下文起点,并以同一focus编码整个有效历史。
129
-
130
- 运行记录的切换时刻取决策前 `manager_trace.scored_stage_id`。第84步place恢复与第85步pick继续不同,不能用决策后的动作阶���替代。
131
-
132
- ## 读取和训练兼容性
133
-
134
- 项目 `tools/libero_jev/long000_dataset/dataset.py` 提供 `DecisionDataset` 与 `collate_decisions`。默认只加载loss_mask=true的行,返回:
135
-
136
- - `model_inputs`:uint8 RGB历史 `[8,2,336,336,3]`、历史掩码、action_text、focus;图像尚未旋转/归一化。
137
- - `target`:pick/place头标识、类别、loss掩码。head用于选输出头,不是额外视觉进度特征。
138
- - `metadata`:来源和回退目标,仅用于审计/路由。
139
-
140
- ```python
141
- from torch.utils.data import DataLoader
142
- from tools.libero_jev.long000_dataset.dataset import DecisionDataset, collate_decisions
143
- ds = DecisionDataset('outputs/annotations/jev_long000_v2')
144
- loader = DataLoader(ds, batch_size=4, collate_fn=collate_decisions)
145
- batch = next(iter(loader))
146
- ```
147
-
148
- v1 `tools.libero_completion.run` 仍是单帧二分类与40/2/3/5流程,不能直接给它这份数据。后续训练须增加轻量因果聚合、pick二分类/place三分类双头、分别BCE/CE和新checkpoint契约;骨干ViT v1、policy v2固定。本次没有实现模型头或改变线上manager,也未提取新版冻结特征缓存。
149
-
150
- 保存所有有效行;后续训练可按来源/阶段/事件调整采样,不能把大量相邻帧当独立恢复事件。原50闭环案例已用于补数据,其再测只能称开发回归,不能宣称独立测试成功率。
151
-
152
- ## 核验和预览
153
-
154
- `verification.json`检查全部行的对齐、历史因果性、掩码、合法类别、原文件哈希及15个具体错误/恢复案例,实际读取全部来源/头/标签组合。`audit/model_review.json`保存当前模型、训练和缓存复核;`audit/expert/`保存50条原演示的物理标签依据;补充物理证据在补充数据目录。`previews/key_cases.jpg`给出关键案例的当前帧双相机预览。
155
- ''')
156
- config=dict(dataset=str(FINAL_LABELS),dataset_kind='phase_conditioned_temporal_decision',format_version=2,
157
- history_frames=8,heads={'pick':2,'place':3},ignore_index=-100,
158
- stage_prompts=str(FINAL_LABELS/'stage_prompts.json'),split='train',
159
- backbone_checkpoint=str(PROJECT/'checkpoints/steervit/v1/best.pth'),
160
- policy_checkpoint=str(PROJECT/'checkpoints/policy/run2_spatial/resume.pth'),
161
- backbone_frozen=True,policy_frozen=True,legacy_completion_v1_compatible=False,
162
- dataset_manifest_sha256=sha(ann/'manifest.json'),feature_extraction_complete=False,
163
- model_training_started=False,terminal_place_complete_ends_episode=False)
164
- write(root/'jev_long000_v2_data.json',config)
165
- # Core dataset fingerprints do not depend on cache/log/README files.
166
- for directory in [sup,ann]:
167
- paths=[p for p in sorted(directory.rglob('*')) if p.is_file() and p.name!='checksums.sha256' and 'runtime' not in p.parts]
168
- (directory/'checksums.sha256').write_text(''.join(f'{sha(p)} {p.relative_to(directory)}\n' for p in paths))
169
- print('Dataset documentation/manifests finalized',flush=True)
170
-
171
- def finalize_state(root):
172
- """Finalize the mixed-history/state revision without changing prior datasets."""
173
- sup=root/'supplement';ann=root/'annotations';m=read(ann/'manifest.json')
174
- assert m['complete'] and read(ann/'verification.json')['passed']
175
- names=('rules','jev','jev_v2')
176
- checks={name:read(sup/f'verification_{name}.json') for name in names}
177
- assert all(v['passed'] for v in checks.values())
178
- m['supplement_hdf5_sha256']={}
179
- for name in names:
180
- digest=sha(sup/'hdf5'/f'{name}.hdf5')
181
- assert digest==checks[name]['hdf5_sha256']
182
- m['supplement_hdf5_sha256'][str(PROJECT/f'data/jev_long000_supplement_v2/hdf5/{name}.hdf5')]=digest
183
- write(ann/'manifest.json',m)
184
- count=m['supplement_saved_observations']
185
- assert sum(v['saved_observations'] for v in checks.values())==count
186
- selections=[];clips=[]
187
- for name in names:
188
- selection=read(root/f'{name}_selection.json');selections.append(selection)
189
- shutil.copy2(root/f'{name}_selection.json',sup/'source_records'/f'{name}_selection.json')
190
- for c in selection['clips']:
191
- clips.append(dict(source=name,episode=int(c['episode']),clip_id=c['clip_id'],
192
- start_inclusive=int(c['start_inclusive']),end_exclusive=int(c['end_exclusive']),
193
- history_start=int(c['history_start']),purpose=c['purpose'],
194
- hdf5_file=f'hdf5/{name}.hdf5',hdf5_group=f"data/episode_{int(c['episode']):03}",
195
- annotation=f"episodes/rollouts/{name}_{int(c['episode']):03}.json"))
196
- with (sup/'clips.csv').open('w',newline='') as f:
197
- writer=csv.DictWriter(f,fieldnames=list(clips[0]));writer.writeheader();writer.writerows(clips)
198
- source=read(sup/'source_records/rules_manifest.json');plan=source['plans'][0]
199
- for asset in (plan['initial_states'],plan['task']['bddl']):
200
- shutil.copy2(asset,sup/'source_records'/Path(asset).name)
201
- write(sup/'source_records/task.json',plan['task'])
202
- shutil.copy2(root/'render.sbatch',sup/'source_records/render.sbatch')
203
- shutil.copytree(PROJECT/'tools/libero_jev/long000_dataset',sup/'source_records/builder_code',
204
- ignore=shutil.ignore_patterns('__pycache__','*.pyc'),dirs_exist_ok=True)
205
- (sup/'logs').mkdir(exist_ok=True)
206
- for f in (root/'logs').glob('render_*.???'):shutil.copy2(f,sup/'logs'/f.name)
207
- gpu=[read(sup/f'gpu_{name}.json') for name in names]
208
- write(sup/'verification.json',dict(passed=True,group_checks=checks,gpu_preflights=gpu,
209
- recorded_actions_unchanged=True,model_inference=False,synthetic_disturbance=False,
210
- total_saved_observations=count,total_candidate_observations=m['supplement_candidate_observations'],
211
- source_episodes=m['supplement_source_episodes'],clips=m['supplement_clips']))
212
- final_ann=PROJECT/'outputs/annotations/jev_long000_v3'
213
- write(sup/'manifest.json',dict(dataset_id='jev_long000_supplement_v2',format_version=2,complete=True,
214
- task_key='libero_10:000',source_jobs=[416731,417429],render_jobs=sorted({x['slurm_job'] for x in gpu}),
215
- source_episodes=m['supplement_source_episodes'],clips=m['supplement_clips'],
216
- candidate_observations=m['supplement_candidate_observations'],observations_including_history=count,
217
- resolution=336,raw_orientation='robosuite_unrotated',training_annotations=str(final_ann),
218
- verification_sha256=sha(sup/'verification.json'),
219
- history='dense stored prefix up to 20 steps: 19-step visual span + one previous robot observation'))
220
- lines=['| 来源/头 | CONTINUE | COMPLETE | RECOVER | IGNORE |','|---|---:|---:|---:|---:|']
221
- for source,heads in m['counts_by_source'].items():
222
- for head,counts in heads.items():
223
- lines.append('| '+source+'/'+head+' | '+' | '.join(str(counts.get(k,0)) for k in ('CONTINUE','COMPLETE','RECOVER','IGNORE'))+' |')
224
- (ann/'README.md').write_text(f'''# Long000 JEV 训练数据 v3(SteerACT v4 设计的一部分)
225
-
226
- 原50条演示全部训练,另含21条历史测试来源的31个窗口。原HDF5、旧标签和模型权重未修改。
227
- 共{sum(r['candidate_rows'] for r in m['episode_index'])}个候选“观测+查询文本”,{sum(r['train_rows'] for r in m['episode_index'])}个有效样本;IGNORE不参与损失。
228
-
229
- {chr(10).join(lines)}
230
-
231
- 本轮新增作业417429的16个窗口、405个候选观测,包含错误目标接触、空抓、开夹交接和稳定抓取对照。并非新增405条演示,也没有合成扰动。
232
- 原50演示和上一轮补充样本标签逐行保留;新窗口仍用相同物理弱监督。pick二分类,place三分类;末place COMPLETE不结束任务。
233
-
234
- 模型视觉索引固定为当前步加[-19,-15,-11,-7,-3,-2,-1,0],每步仍评分。短历史左侧mask,阶段变化清空,不等待20帧。抓稳3步、失手5步的标签确认仍使用连续物理观测。
235
- 机器人特征16维,具体顺序与固定尺度见manifest.robot_contract及tools/libero_completion/inputs.py:双指位置和单步变化、上一条已执行夹爪命令、相对当前末端位姿、末端单步位移、上一状态有效位和相对帧龄。相邻稀疏帧不能冒充单步速度。
236
- 原演示RGB[r]/robot_obs[r]对应state r+1和已经执行的action[r];补充数据proprio/previous_action与RGB同一行,并通过source_observation_step显式映射。未来动作、物体状态、接触、成功谓词不进入模型。
237
-
238
- 新16窗口有效样本损失权重2(包含正例对照),其余1;不复制样本,不改变IGNORE。place RECOVER原类别权重8保留。
239
- 训练入口仍为tools.libero_completion.run,配置configs/jev_long000_v3_data.json。冻结ViT v1/policy v2;JEV v2第30轮初始化兼容层,新状态分支零初始化。预设30epoch;本次尚未正式训练。
240
- 所有来源进入train,无离线留出或校准;原50闭环是开发回归集。训练集拟合不等于闭环成功率。
241
- ''')
242
- (sup/'README.md').write_text(f'''# Long000 测试补充 HDF5 v2
243
-
244
- 保留前轮11条来源、15窗口,并加入最近JEV测试的10条来源、16窗口。合计21条来源、31窗口,{count}个保存的双相机观测(含历史),1259个候选观测。其中405个候选观测来自本轮新增窗口。
245
-
246
- hdf5/rules.hdf5、jev.hdf5、jev_v2.hdf5分别存纯规则、旧JEV和最新JEV固定动作回放。来源作业416731/417429,渲染作业418473;同一张独立干净GPU顺序运行。没有加载策略/JEV,没有新闭环,没有造抓取演示。
247
- 每组data/episode_NNN含原始336双RGB、proprio[8]、previous_action[7]、source_observation_step、candidate_target、query_stage_index;sim_state和goal_success仅供离线审查。原动作和来源哈希在source_records;完整物理证据在evidence。
248
- 保存窗口补足前20步:视觉最远前19步,额外1步用于计算该时刻的单步机器人变化。历史跨阶段重置,HDF5不连续行不能直接当相邻时刻。
249
-
250
- 训练标签在outputs/annotations/jev_long000_v3,各行均有因果历史索引、类别、IGNORE掩码和sample_weight。原始LIBERO无需修改。
251
- ''')
252
- cfg=read(PROJECT/'configs/jev_long000_v2_data.json')
253
- from tools.libero_completion.inputs import ROBOT_CONTRACT
254
- cfg.update(format_version=3,dataset=str(final_ann),stage_prompts=str(final_ann/'stage_prompts.json'),
255
- dataset_manifest_sha256=sha(ann/'manifest.json'),robot_contract=ROBOT_CONTRACT,
256
- init_checkpoint=str(PROJECT/'checkpoints/completion/steervit_long000_v2_20261012/last.pth'))
257
- cfg['init_checkpoint_sha256']=sha(cfg['init_checkpoint'])
258
- write(root/'jev_long000_v3_data.json',cfg)
259
- for folder in (sup,ann):
260
- paths=[f for f in sorted(folder.rglob('*')) if f.is_file() and f.name!='checksums.sha256'
261
- and 'runtime' not in f.parts and '__pycache__' not in f.parts]
262
- (folder/'checksums.sha256').write_text(''.join(f'{sha(f)} {f.relative_to(folder)}\n' for f in paths))
263
- print('v3 dataset finalized; formal training not started',flush=True)
264
-
265
-
266
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/labels.py DELETED
@@ -1,75 +0,0 @@
1
- """Causal physical-evidence labels, kept separate from RGB and model inputs.
2
-
3
- Labels are auditable weak supervision, not a claim of manual frame-level gold.
4
- Uncertain grip/release/settling frames are masked rather than forced into a class.
5
- """
6
- import numpy as np
7
-
8
- CONTINUE, COMPLETE, RECOVER, IGNORE = 0, 1, 2, -100
9
- NAMES = {CONTINUE:'CONTINUE', COMPLETE:'COMPLETE', RECOVER:'RECOVER', IGNORE:'IGNORE'}
10
- RECIPE = dict(version='long000_causal_physics_v2', history_frames=8, pick_confirm_steps=3,
11
- loss_confirm_steps=5, place_confirm_steps=3, closure_tolerance_m=.001,
12
- transport_m=.004, motion_cosine=.65, relative_drift_m=.025, rest_step_m=.004,
13
- pick_requires_current_no_external_support=True,
14
- expert_release_old_pick='IGNORE', ambiguous='IGNORE',
15
- expert_RECOVER_positive=False, terminal_COMPLETE_ends_episode=False,
16
- excluded_recovery_controls=['rules_000','jev_006'])
17
-
18
- def hand(s,o):
19
- return any(s['touch'][o]) or s['palm'][o]
20
-
21
- def ready(history, o):
22
- if len(history)<3:return False
23
- h=history[-3:];s=h[-1]
24
- if s['supported'][o] or not all(x['closing_command'] for x in h):return False
25
- stationary=(all(all(x['touch'][o]) for x in h)
26
- and np.ptp([x['width'] for x in h])<=RECIPE['closure_tolerance_m'])
27
- h6=history[-min(6,len(history)):]
28
- p=np.asarray([x['positions'][o] for x in h6]);ee=np.asarray([x['eef'] for x in h6])
29
- a,b=p[-1]-p[0],ee[-1]-ee[0];an,bn=np.linalg.norm(a),np.linalg.norm(b)
30
- cosine=float(a@b/max(an*bn,1e-12));drift=np.max(np.linalg.norm((p-ee)-(p-ee)[0],axis=1))
31
- motion=bool(an>=.004 and bn>=.0028 and cosine>=.65 and (drift<.025 or drift<.8*an+.008))
32
- carried=(motion and all(hand(x,o) and not x['supported'][o] for x in h)
33
- and any(any(x['touch'][o]) for x in h))
34
- return bool(stationary or carried)
35
-
36
- def classify(stage, history, *, source_kind, source_id, old_prompt=False):
37
- s=history[-1];o=stage['object_ids'][0];phase=stage['type']
38
- if phase=='grasp':
39
- if old_prompt and (not s['closing_command'] or not hand(s,o)):
40
- return IGNORE,'old_pick_after_release_excluded'
41
- if ready(history,o):return COMPLETE,'current_unsupported_stable_grip_or_carriage'
42
- if not hand(s,o):return CONTINUE,'not_grasped'
43
- if not s['closing_command']:return CONTINUE,'grip_not_closed'
44
- if s['supported'][o]:return CONTINUE,'grip_not_yet_lifted_off_support'
45
- return IGNORE,'grasp_readiness_ambiguous'
46
- assert phase=='place'
47
- predicate=' '.join(stage['predicate']);sid=stage['template_id']
48
- # A recorded official success is a valid terminal placement observation.
49
- # It never fabricates a missing post-action terminal image in expert HDF5.
50
- if sid=='s3' and s['goal_success']:
51
- return COMPLETE,'observed_official_goal_terminal_place'
52
- if len(history)>=3:
53
- h=history[-3:]
54
- relation=all(x['predicates'][predicate] for x in h)
55
- supported=all(x['supported'][o] for x in h)
56
- still=np.max(np.linalg.norm(np.diff([x['positions'][o] for x in h],axis=0),axis=1))<.004
57
- released=all(not x['closing_command'] or not hand(x,o) for x in h)
58
- target_supported=all(x['target_support'][sid] for x in h)
59
- if relation and supported and still and (released or target_supported):
60
- return COMPLETE,'stable_target_placement'
61
- loss=False
62
- if len(history)>=5:
63
- h=history[-5:]
64
- loss=all(not hand(x,o) and x['supported'][o] and not x['predicates'][predicate]
65
- and not x['target_support'][sid] for x in h)
66
- if loss:
67
- if source_kind=='expert':return IGNORE,'expert_off_target_release_requires_review'
68
- if source_id in RECIPE['excluded_recovery_controls']:
69
- return IGNORE,'ambiguous_settling_control_exclude_recovery'
70
- return RECOVER,'sustained_5step_supported_loss_outside_target'
71
- if hand(s,o) and not s['predicates'][predicate]:return CONTINUE,'ongoing_transport_or_placement'
72
- # Release into the destination is normal, even before full stable completion.
73
- if s['predicates'][predicate] or s['target_support'][sid]:
74
- return CONTINUE,'destination_settling_before_stable_completion'
75
- return IGNORE,'airborne_or_off_target_release_not_yet_resolved'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/preview.py DELETED
@@ -1,34 +0,0 @@
1
- """Render a compact contact sheet from the exact HDF5 rows used by labels."""
2
- import argparse
3
- from pathlib import Path
4
- import h5py
5
- import numpy as np
6
- from PIL import Image,ImageDraw
7
- from common import read
8
-
9
- def main():
10
- ap=argparse.ArgumentParser();ap.add_argument('--build-root',type=Path,required=True);a=ap.parse_args()
11
- ann=a.build_root/'annotations';sup=a.build_root/'supplement'
12
- cases=[('expert_001',79,0),('expert_001',170,0),('rules_041',84,1),('rules_041',294,0),
13
- ('rules_041',355,1),('rules_046',264,3),('rules_046',504,2),('jev_039',258,2),
14
- ('jev_047',240,2),('jev_007',221,2),('jev_007',234,3),('jev_006',300,3),
15
- ('rules_000',256,3),('jev_046',339,3)]
16
- epmap={read(ann/x['annotation'])['episode_id']:read(ann/x['annotation']) for x in read(ann/'manifest.json')['episode_index']}
17
- tiles=[]
18
- for eid,t,si in cases:
19
- ep=epmap[eid];r=next((r for r in ep['samples'] if r['observation_step']==t and r['prompt_stage_index']==si),None)
20
- if r is None:continue
21
- p=Path(ep['source_hdf5']);p=sup/'hdf5'/p.name if ep['source_kind']=='rollout' else p
22
- tile=Image.new('RGB',(448,260),'white');d=ImageDraw.Draw(tile)
23
- with h5py.File(p,'r') as f:
24
- g=f[ep['hdf5_episode_group']]
25
- for i,c in enumerate(['main','wrist']):
26
- rgb=g[ep['cameras'][c]][r['rgb_index']][::-1,::-1]
27
- tile.paste(Image.fromarray(rgb).resize((224,224)),(i*224,36))
28
- d.text((4,3),f'{eid} obs={t} s{si} {r["head"]} -> {r["label_name"]}',fill='black')
29
- d.text((4,18),r['label_reason'][:68],fill='black');tiles.append(tile)
30
- canvas=Image.new('RGB',(896,260*((len(tiles)+1)//2)),(220,220,220))
31
- for i,tile in enumerate(tiles):canvas.paste(tile,((i%2)*448,(i//2)*260))
32
- (ann/'previews').mkdir(exist_ok=True);canvas.save(ann/'previews/key_cases.jpg',quality=94)
33
-
34
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/render_supplement.py DELETED
@@ -1,186 +0,0 @@
1
- """Replay unchanged recorded actions; export raw dual RGB and audit evidence.
2
-
3
- No policy or JEV weights/inference. Run on an allocated, unused EGL GPU.
4
- """
5
- import argparse
6
- import csv
7
- import json
8
- import os
9
- from pathlib import Path
10
- import random
11
- import shutil
12
- import subprocess
13
- import sys
14
- import time
15
-
16
- from common import PROJECT, EVAL, AUDIT, CAMERAS, read, write, sha, trace_stages
17
-
18
- def main():
19
- ap = argparse.ArgumentParser(description=__doc__)
20
- ap.add_argument('--group', choices=['sim_state', 'jev_completion'], required=True)
21
- ap.add_argument('--output', type=Path, required=True)
22
- ap.add_argument('--spec', type=Path, help='Reviewed versioned replay selection JSON')
23
- ap.add_argument('--name', help='Distinct source name, e.g. jev_v2')
24
- args = ap.parse_args()
25
- out = args.output
26
- for subdirectory in ('hdf5', 'source_records', 'evidence'):
27
- (out/subdirectory).mkdir(parents=True, exist_ok=True)
28
- name = args.name or ('rules' if args.group == 'sim_state' else 'jev')
29
- selection = read(args.spec) if args.spec else None
30
- eval_root = Path(selection['evaluation']) if selection else EVAL/args.group/'evaluation'
31
- destination = out/'hdf5'/f'{name}.hdf5'
32
- if destination.exists():
33
- raise FileExistsError(destination)
34
- visible = os.environ.get('CUDA_VISIBLE_DEVICES', '').split(',')[0]
35
- if not visible.isdigit():
36
- raise RuntimeError('Require a Slurm allocated numeric CUDA_VISIBLE_DEVICES')
37
- raw = subprocess.check_output(['nvidia-smi', '-i', visible,
38
- '--query-gpu=index,uuid,memory.used,utilization.gpu', '--format=csv,noheader,nounits'], text=True).strip()
39
- gpu_index, gpu_uuid, memory, utilization = [v.strip() for v in raw.split(',')]
40
- if int(memory) > 32 or int(utilization) != 0:
41
- raise RuntimeError(f'Allocated GPU is not clean: {raw}')
42
- write(out/f'gpu_{name}.json', dict(host=os.uname().nodename, slurm_job=os.environ.get('SLURM_JOB_ID'),
43
- cuda_visible=visible, index=gpu_index, uuid=gpu_uuid, memory_before_MiB=int(memory), utilization_before=int(utilization)))
44
- import h5py
45
- import numpy as np
46
- import torch
47
- torch.set_num_threads(1)
48
- assert torch.get_num_threads() == 1
49
- import ctypes
50
- library = next((Path(np.__file__).parent.parent/'numpy.libs').glob('*openblas*'))
51
- get_threads = ctypes.CDLL(str(library)).openblas_get_num_threads64_
52
- get_threads.restype = ctypes.c_int
53
- pools = dict(numpy_openblas=get_threads(), torch=torch.get_num_threads(),
54
- omp_env=os.environ['OMP_NUM_THREADS'], mkl_env=os.environ['MKL_NUM_THREADS'])
55
- assert pools['numpy_openblas'] == 4, pools
56
- sys.path.insert(0, str(PROJECT/'steeract_policy/src'))
57
- from steeract.evaluation.backend import configure, make_env
58
- from steeract.data.transforms import proprio_from_obs
59
- from steeract.stages.state_reader import StateReader
60
- from steeract.stages.manager import StageManager
61
-
62
- spec = AUDIT/'training_data_review/long000_dataset_spec/proposed_clips.csv'
63
- clips = selection['clips'] if selection else [r for r in csv.DictReader(spec.open()) if r['group'] == args.group]
64
- by_episode = {}
65
- for c in clips:
66
- by_episode.setdefault(int(c['episode']), []).append(c)
67
- manifest_path = eval_root/'manifest.json'
68
- manifest = read(manifest_path)
69
- plans = {p['episode_idx']: p for p in manifest['plans']}
70
- cfg = manifest['config']
71
- package = configure(cfg, 'standard', out/'runtime'/name, render=True, egl_device=int(visible))
72
- shutil.copy2(manifest_path, out/'source_records'/f'{name}_manifest.json')
73
- def seed(n):
74
- random.seed(n); np.random.seed(n); torch.manual_seed(n)
75
- seed(7)
76
- env = make_env(plans[0]['task']['bddl'], seed=7, render=True)
77
- started = time.perf_counter()
78
- checks = []
79
- tmp = destination.with_suffix('.hdf5.tmp')
80
- try:
81
- with h5py.File(tmp, 'x') as h5:
82
- h5.attrs.update(format='jev_recorded_rollout_rgb_v1', resolution=336,
83
- orientation='raw_robosuite', task_key='libero_10:000',
84
- observation_convention='observation t follows t actions; images and physical state share row',
85
- group=args.group, source_job=selection['source_job'] if selection else 416731, history_frames=8,
86
- history_span_steps=20 if selection else 8)
87
- for i, windows in sorted(by_episode.items()):
88
- source = eval_root/'episodes'/f'task_000_episode_{i:03}.json'
89
- ep = read(source); plan = plans[i]
90
- selected, targets = set(), set()
91
- for c in windows:
92
- selected.update(range(int(c['history_start']), int(c['end_exclusive'])))
93
- targets.update(range(int(c['start_inclusive']), int(c['end_exclusive'])))
94
- selected = sorted(selected)
95
- row_for_step = {t: j for j, t in enumerate(selected)}
96
- query_stages = trace_stages(ep)
97
- seed(7+i); env.seed(7+i); env.reset()
98
- initial = torch.load(plan['initial_states'], map_location='cpu', weights_only=False)[plan['initial_state_idx']]
99
- obs = env.set_init_state(initial)
100
- dummy = [0.]*6+[-1.]
101
- for _ in range(cfg['evaluation']['settle_steps']):
102
- obs, *_ = env.step(dummy)
103
- reader = StateReader(env, plan['task'])
104
- manager = StageManager(plan['task'], cfg['manager']) if args.group == 'sim_state' else None
105
- group = h5.create_group(f'data/episode_{i:03}')
106
- group.attrs.update(source_episode=str(source.resolve()), source_sha256=sha(source),
107
- episode_idx=i, initial_state_index=plan['initial_state_idx'], seed=7+i,
108
- recorded_success=ep['success'], num_actions=ep['num_steps'],
109
- model_file=env.sim.model.get_xml(), num_saved_observations=len(selected))
110
- group.create_dataset('source_observation_step', data=np.asarray(selected, np.int32))
111
- group.create_dataset('candidate_target', data=np.asarray([t in targets for t in selected], bool))
112
- group.create_dataset('query_stage_index', data=np.asarray([query_stages[t] for t in selected], np.int8))
113
- image_sets = {k: group.create_dataset(v, shape=(len(selected),336,336,3), dtype='u1',
114
- chunks=(1,336,336,3), compression='lzf') for k,v in CAMERAS.items()}
115
- for key, shape in [('proprio',(8,)), ('previous_action',(7,)),
116
- ('sim_state', (len(env.sim.get_state().flatten()),))]:
117
- group.create_dataset(key, shape=(len(selected),*shape), dtype='f8')
118
- group.create_dataset('goal_success', shape=(len(selected),), dtype='?')
119
- evidence = []
120
- def capture(t, last_action):
121
- state = reader.read(t, last_action)
122
- if manager is not None:
123
- state['rule_decision'] = manager.update(state)
124
- evidence.append(state)
125
- if t not in row_for_step:
126
- return
127
- j = row_for_step[t]
128
- for camera, key in [('main','agentview_image'),('wrist','robot0_eye_in_hand_image')]:
129
- rgb = obs[key]
130
- assert rgb.shape == (336,336,3) and rgb.dtype == np.uint8
131
- assert rgb.std() > 5, (i,t,camera,'blank render')
132
- image_sets[camera][j] = rgb
133
- group['proprio'][j] = proprio_from_obs(obs)
134
- group['previous_action'][j] = last_action
135
- group['sim_state'][j] = env.sim.get_state().flatten()
136
- group['goal_success'][j] = state['goal_success']
137
- capture(0, dummy)
138
- max_error = 0.
139
- for t, action in enumerate(ep['actions']):
140
- actual = proprio_from_obs(obs).tolist()
141
- expected = ep['proprio_states'][t]
142
- max_error = max(max_error, float(np.max(np.abs(np.asarray(actual)-expected))))
143
- assert actual == expected, (args.group,i,t,max_error,'robot replay differs')
144
- obs, reward, done, _ = env.step(action)
145
- assert float(reward) == ep['rewards'][t], (i,t,'reward differs')
146
- capture(t+1, action)
147
- assert evidence[-1]['goal_success'] == ep['success']
148
- if manager is not None:
149
- assert manager.events == ep['stage_events'], (i,'rule events differ')
150
- previous = AUDIT/'replays'/f'{args.group}_{i:03}.json.gz'
151
- if i == 0:
152
- previous = AUDIT/'training_data_review/long000_dataset_spec/replay000/replays'/f'{args.group}_{i:03}.json.gz'
153
- if selection:
154
- previous = Path(windows[0]['source_replay'])
155
- assert sha(previous) == windows[0]['source_replay_sha256']
156
- old = read(previous)
157
- expected_source = old.get('source_episode_sha256', old.get('source_sha256'))
158
- if expected_source is not None:
159
- assert expected_source == sha(source), 'Replay evidence belongs to another episode'
160
- assert len(evidence) == len(old['states'])
161
- for a, b in zip(evidence, old['states']):
162
- for key in ('touch','palm','supported','target_support','predicates','goal_success','closing_command','width'):
163
- assert a[key] == b[key], (i,a['step'],key,'physics evidence differs')
164
- for obj in a['positions']:
165
- assert np.array_equal(a['positions'][obj],b['positions'][obj]), (i,a['step'],obj)
166
- shutil.copy2(source, out/'source_records'/f'{name}_{i:03}.json')
167
- write(out/'evidence'/f'{name}_{i:03}.json.gz', dict(source_sha256=sha(source),
168
- source_group=args.group, episode=i, task=plan['task'], query_stage_indices=query_stages,
169
- exact_replay=True, states=evidence))
170
- checks.append(dict(episode=i, saved_observations=len(selected), candidate_targets=len(targets),
171
- exact_proprio=True, max_proprio_error=max_error, exact_rewards=True,
172
- final_success=ep['success'], matches_prior_physics_audit=True,
173
- initial_states_sha256=sha(plan['initial_states']), bddl_sha256=sha(plan['task']['bddl'])))
174
- h5.flush()
175
- print(json.dumps(dict(group=args.group, episode=i, saved=len(selected), exact=True,
176
- elapsed_seconds=round(time.perf_counter()-started,2))), flush=True)
177
- finally:
178
- env.close()
179
- tmp.replace(destination)
180
- write(out/f'verification_{name}.json', dict(passed=True, episodes=checks,
181
- hdf5_sha256=sha(destination), saved_observations=sum(c['saved_observations'] for c in checks),
182
- model_inference=False, synthetic_disturbance=False, threadpools=pools,
183
- elapsed_seconds=time.perf_counter()-started))
184
-
185
- if __name__ == '__main__':
186
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/review_model.py DELETED
@@ -1,52 +0,0 @@
1
- """CPU-only identity and interface audit of the existing JEV and demo caches."""
2
- import argparse
3
- from pathlib import Path
4
- import sys
5
- from common import PROJECT, OLD, read,write,sha
6
-
7
- def main():
8
- ap=argparse.ArgumentParser();ap.add_argument('--output',type=Path,required=True);args=ap.parse_args()
9
- import numpy as np
10
- import torch
11
- torch.set_num_threads(1)
12
- sys.path.insert(0,str(PROJECT))
13
- from tools.libero_completion.model import CompletionHead
14
- run=PROJECT/'checkpoints/completion/steervit_pilot_v1'
15
- checkpoint=torch.load(run/'best.pth',map_location='cpu',weights_only=False)
16
- head=CompletionHead(**checkpoint['model_kwargs']);head.load_state_dict(checkpoint['state_dict'],strict=True)
17
- manifest=read(run/'run_manifest.json');episodes=[]
18
- for item in manifest['episodes']:
19
- annotation=OLD/item['annotation'];e=read(annotation);assert sha(annotation)==item['annotation_sha256']
20
- cached=read(run/'features'/f"{e['episode_id']}.json")
21
- assert cached['labels']==[r['label'] for r in e['samples']]
22
- assert cached['annotation_sha256']==sha(annotation)
23
- arr=np.load(run/'features'/cached['file'],mmap_mode='r')
24
- assert arr.shape[1:]==(2,37,768)
25
- episodes.append(dict(episode=e['episode_id'],old_split=cached['split'],old_samples=len(cached['labels']),
26
- cache_shape=list(arr.shape)))
27
- sources={str(p.relative_to(PROJECT)):sha(p) for folder in ['tools/libero_completion','tools/libero_jev']
28
- for p in (PROJECT/folder).glob('*.py')}
29
- files=['steeract_policy/src/steeract/evaluation/managers.py','steeract_policy/src/steeract/evaluation/rollout.py',
30
- 'steeract_policy/src/steeract/stages/completion_manager.py','steeract_policy/src/steeract/stages/state_reader.py',
31
- 'steeract_policy/src/steeract/stages/rules.py','steeract_policy/configs/jev_pilot_stages.json']
32
- sources.update({p:sha(PROJECT/p) for p in files})
33
- bindings=read(PROJECT/'steeract_policy/configs/jev_pilot_stages.json')
34
- assert sha(run/'best.pth')==bindings['completion_checkpoint_sha256']
35
- assert sha(PROJECT/'checkpoints/policy/run2_spatial/resume.pth')==bindings['policy_checkpoint_sha256']
36
- assert sha(PROJECT/'checkpoints/steervit/v1/best.pth')==manifest['backbone_checkpoint_sha256']
37
- write(args.output,dict(passed=True,cuda_initialized=torch.cuda.is_initialized(),model_inference=False,
38
- model_kind=checkpoint['model_kind'],model_kwargs=checkpoint['model_kwargs'],
39
- trainable_parameters=sum(p.numel() for p in head.parameters()),best_epoch=checkpoint['epoch'],
40
- original_training_config=manifest['config'],episodes=episodes,source_code_sha256=sources,
41
- matching_baseline_weights=dict(steervit='v1/best.pth',policy='run2_spatial/resume.pth, step20000 EMA',
42
- jev='completion/steervit_pilot_v1/best.pth'),
43
- v1_contract='single-frame RGB + action/focus; single logit BCE; 40 train/2 validation/3 calibration/5 test',
44
- v2_data_contract='8-frame causal RGB history; pick 2 classes/place 3; 50 expert plus reviewed rollout train rows',
45
- required_future_training_changes=['temporal aggregator with valid-history mask','pick binary head + place three-way head',
46
- 'pick BCE + place cross entropy; ignore mask','new feature cache identity includes label version/focus',
47
- 'remove mandatory old holdout model selection/calibration','new checkpoint and predictor/manager contract',
48
- 'terminal place keeps recovery scoring; only simulator ends task'],
49
- scope='Only data builder/reader/validation implemented in this task; no model training or runtime change.'))
50
- print('CPU model/cache identity audit passed; CUDA initialized:',torch.cuda.is_initialized(),flush=True)
51
-
52
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/smoke_loader.py DELETED
@@ -1,37 +0,0 @@
1
- """Exercise mixed-head, masked temporal batches through a two-worker loader."""
2
- import argparse
3
- from pathlib import Path
4
- import torch
5
- from torch.utils.data import DataLoader,Subset
6
- from common import write
7
- from dataset import DecisionDataset,collate_decisions
8
-
9
- def main():
10
- ap=argparse.ArgumentParser();ap.add_argument('--annotations',type=Path,required=True)
11
- ap.add_argument('--supplement',type=Path);ap.add_argument('--output',type=Path,required=True);a=ap.parse_args()
12
- torch.set_num_threads(1)
13
- ds=DecisionDataset(a.annotations,include_ignored=True,supplement_root=a.supplement)
14
- seen=set();indices=[]
15
- for index,(i,j) in enumerate(ds.indices):
16
- ep=ds.episodes[i];r=ep['samples'][j];key=(ep['source_kind'],r['head'],r['label'])
17
- if key not in seen:seen.add(key);indices.append(index)
18
- loader=DataLoader(Subset(ds,indices),batch_size=4,num_workers=2,
19
- multiprocessing_context='spawn',collate_fn=collate_decisions)
20
- rows=0;batch_count=0
21
- for b in loader:
22
- x,y=b['model_inputs'],b['target'];n=len(y['label'])
23
- assert x['rgb_history'].shape==(n,8,2,336,336,3)
24
- assert x['rgb_history'].dtype==torch.uint8 and x['history_mask'].dtype==torch.bool
25
- assert torch.equal(y['loss_mask'],y['label']!=-100)
26
- valid=y['loss_mask'];heads=y['head_id'];labels=y['label']
27
- assert torch.all((labels[valid & (heads==0)]>=0)&(labels[valid & (heads==0)]<2))
28
- assert torch.all((labels[valid & (heads==1)]>=0)&(labels[valid & (heads==1)]<3))
29
- assert torch.all(x['history_mask'][:,-1]) and len(b['metadata'])==n
30
- rows+=n;batch_count+=1
31
- ds.close()
32
- report=dict(passed=True,samples=rows,batches=batch_count,num_workers=2,
33
- covered_source_head_label_combinations=[list(k) for k in sorted(seen)],
34
- cuda_initialized=torch.cuda.is_initialized(),training=False)
35
- write(a.output,report);print(report,flush=True)
36
-
37
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/builder_code/validate.py DELETED
@@ -1,175 +0,0 @@
1
- """Independent data/causality/known-failure checks plus real HDF5 loader smoke."""
2
- import argparse
3
- from collections import Counter, defaultdict
4
- from pathlib import Path
5
- import numpy as np
6
- import h5py
7
- from common import read,write,sha,OLD,PROJECT,FINAL_SUPPLEMENT
8
- from dataset import DecisionDataset
9
-
10
- def main():
11
- import faulthandler
12
- faulthandler.dump_traceback_later(90,repeat=True)
13
- ap=argparse.ArgumentParser();ap.add_argument('--annotations',type=Path,required=True)
14
- ap.add_argument('--supplement',type=Path,required=True);args=ap.parse_args()
15
- root=args.annotations;sup=args.supplement;m=read(root/'manifest.json');version=m['format_version']
16
- counts=defaultdict(Counter);sources=Counter();seen=set();examples={};cut_stats=Counter();terminal=Counter()
17
- all_known={};checks=[];cached_source={};rgb_stats=[]
18
- files={};robot_alignment=[];preserved_labels=0
19
- for rec in m['episode_index']:
20
- ep=read(root/rec['annotation']);sid=ep['episode_id'];sources[ep['source_kind']]+=1
21
- assert sha(root/rec['annotation'])==rec['annotation_sha256']
22
- if version==3 and not sid.startswith('jev_v2_'):
23
- original=read(PROJECT/'outputs/annotations/jev_long000_v2'/rec['annotation'])
24
- previous={r['sample_id']:r for r in original['samples']}
25
- assert len(previous)==len(ep['samples'])
26
- for row in ep['samples']:
27
- assert all(row[k]==previous[row['sample_id']][k] for k in ('label','loss_mask','label_reason','observation_step','prompt_stage_index'))
28
- preserved_labels+=1
29
- p=Path(ep['source_hdf5'])
30
- if ep['source_kind']=='rollout':p=sup/'hdf5'/p.name
31
- if str(p) not in files:files[str(p)]=h5py.File(p,'r')
32
- g=files[str(p)][ep['hdf5_episode_group']]
33
- for c in ep['cameras'].values():assert g[c].shape[1:]==(336,336,3) and g[c].dtype==np.uint8
34
- if ep['source_kind']=='expert':
35
- times=np.arange(1,ep['num_source_states']);ev=read(root/ep['source_evidence'])
36
- assert sha(root/ep['source_evidence'])==ep['physical_source_sha256']
37
- else:
38
- times=g['source_observation_step'][()];ev=read(sup/'evidence'/f'{sid}.json.gz')
39
- assert sha(sup/'evidence'/f'{sid}.json.gz')==ep['physical_source_sha256']
40
- assert len(times)==len(set(times)) and np.all(np.diff(times)>0)
41
- target_steps=set(times[g['candidate_target'][()]])
42
- assert target_steps=={r['observation_step'] for r in ep['samples']}
43
- assert np.isfinite(g['sim_state'][()]).all() and np.isfinite(g['proprio'][()]).all()
44
- for camera in ep['cameras'].values():
45
- for first in range(0,len(times),8):
46
- arr=g[camera][first:first+8]
47
- assert np.all(arr[:,::8,::8].reshape(len(arr),-1).std(axis=1)>5)
48
- rgb_stats.append(dict(episode=sid,observations=len(times),candidate=len(target_steps)))
49
- states=ev['states'];task=ev['task'];local_counts=defaultdict(Counter)
50
- if version==3:
51
- from tools.libero_completion.inputs import robot_history, observation_lookup, history_steps, read_robot_observation, load_robot_source
52
- robot_source=load_robot_source(ep,g)
53
- lookup=observation_lookup(ep,robot_source)
54
- # Independently cross-check robot input alignment against replay evidence.
55
- maximum_width_error=0.;maximum_position_error=0.
56
- for t,index in lookup.items():
57
- p,command=read_robot_observation(ep,robot_source,index)
58
- assert p.shape==(8,) and np.isfinite(p).all() and np.isfinite(command)
59
- maximum_width_error=max(maximum_width_error,abs(abs(float(p[6])-float(p[7]))-states[t]['width']))
60
- maximum_position_error=max(maximum_position_error,float(np.max(np.abs(p[:3]-states[t]['eef']))))
61
- assert bool(command>0)==states[t]['closing_command'],(sid,t,'previous command shifted')
62
- if ep['source_kind']=='expert':
63
- assert maximum_width_error<1e-7,(sid,maximum_width_error)
64
- else:
65
- # Sensor samples are slightly behind final mj_forward state within a control tick.
66
- # Require exact original online sensor/command values, not oracle qpos substitution.
67
- record=read(sup/'source_records'/f'{sid}.json')
68
- for t,index in lookup.items():
69
- p,command=read_robot_observation(ep,robot_source,index)
70
- if t<len(record['proprio_states']):
71
- assert np.array_equal(p,np.asarray(record['proprio_states'][t],np.float32)),(sid,t,'online sensor differs')
72
- if t:assert command==float(record['actions'][t-1][-1]),(sid,t,'executed command differs')
73
- assert maximum_width_error<.002,(sid,maximum_width_error)
74
- # StateReader uses freshly forwarded physics; robot sensor position can differ slightly.
75
- assert maximum_position_error<.002,(sid,maximum_position_error)
76
- robot_alignment.append(dict(episode=sid,max_width_error=maximum_width_error,
77
- max_eef_sensor_physics_error=maximum_position_error,previous_command_matches=True,rollout_sensor_matches_record_exactly=ep['source_kind']=='rollout'))
78
- for r in ep['samples']:
79
- key=(sid,r['sample_id']);assert key not in seen;seen.add(key)
80
- t,si=r['observation_step'],r['prompt_stage_index'];stage=task['stages'][si];o=stage['object_ids'][0]
81
- mask=r['history_valid_mask'];ids=r['history_rgb_indices'];valid=[v for v,b in zip(ids,mask) if b]
82
- assert len(mask)==len(ids)==8 and mask[-1]
83
- assert mask==[False]*(8-len(valid))+[True]*len(valid)
84
- assert all(v==-1 for v,b in zip(ids,mask) if not b)
85
- assert all(0<=v<len(times) for v in valid)
86
- ht=times[valid].tolist()
87
- assert ht==r['history_observation_steps']==(history_steps(t,r['query_context_start']) if version==3 else list(range(max(r['query_context_start'],t-7),t+1)))
88
- if version==3:
89
- state_features=robot_history(ep,r,robot_source,lookup)
90
- assert state_features.shape==(8,16) and np.isfinite(state_features).all()
91
- assert not state_features[np.logical_not(mask)].any()
92
- assert ht[-1]==t and valid[-1]==r['rgb_index'] and max(ht)<=t
93
- assert r['head']==('pick' if si%2==0 else 'place')
94
- assert r['label'] in ({-100,0,1} if si%2==0 else {-100,0,1,2})
95
- assert r['loss_mask']==(r['label']!=-100)
96
- h=[states[v] for v in range(max(r['query_context_start'],t-7),t+1)];s=h[-1]
97
- touched=lambda x:any(x['touch'][o]) or x['palm'][o]
98
- if r['head']=='pick' and r['label']==1:
99
- assert len(h)>=3 and not s['supported'][o] and touched(s)
100
- assert all(x['closing_command'] for x in h[-3:])
101
- if r['label']==2:
102
- assert ep['source_kind']=='rollout' and sid not in ('rules_000','jev_006')
103
- assert si in (1,3) and r['recovery_stage_id']==f's{si-1}' and len(h)>=5
104
- predicate=' '.join(stage['predicate'])
105
- assert all(not touched(x) and x['supported'][o] and not x['predicates'][predicate]
106
- and not x['target_support'][f's{si}'] for x in h[-5:])
107
- else:assert r['recovery_stage_id'] is None
108
- if r['head']=='place' and r['label']==1:
109
- assert s['predicates'][' '.join(stage['predicate'])]
110
- if si==3:terminal[ep['source_kind']]+=1
111
- if r['role']=='previous_stage_prompt' and si%2==0 and (not touched(s) or not s['closing_command']):
112
- assert r['label']==-100
113
- if ep['source_kind']=='rollout':
114
- assert si==ev['query_stage_indices'][t]
115
- assert all(ev['query_stage_indices'][v]==si for v in ht), (sid,t,'history crossed phase')
116
- counts[r['head']][r['label_name']]+=1;local_counts[r['head']][r['label_name']]+=1
117
- examples.setdefault((ep['source_kind'],r['head'],r['label']),key)
118
- all_known[(sid,t,si)]=r['label']
119
- assert {k:dict(v) for k,v in local_counts.items()}==rec['label_counts']
120
- checks.append(dict(episode=sid,rows=len(ep['samples']),passed=True))
121
- if len(checks)%10==0 or len(checks)==61:
122
- print('Validated annotations and physics:',len(checks),flush=True)
123
- assert dict(sources)=={'expert':50,'rollout':m['supplement_source_episodes']},sources
124
- assert {k:dict(v) for k,v in counts.items()}==m['label_counts']
125
- assert sum(v['candidate'] for v in rgb_stats)==m['supplement_candidate_observations']
126
- assert sum(v['observations'] for v in rgb_stats)==m['supplement_saved_observations']
127
- # Concrete regressions from audited examples, independent of builder control flow.
128
- expected={('expert_001',170,0):-100,('expert_001',171,0):-100,('expert_001',172,0):-100,
129
- ('rules_041',84,1):2,('rules_041',85,0):0,('rules_041',294,0):1,('rules_041',355,1):1,
130
- ('rules_041',482,3):2,('rules_046',264,3):2,('rules_046',504,2):1,
131
- ('jev_039',256,2):0,('jev_039',257,2):0,('jev_039',258,2):0,
132
- ('jev_047',240,2):0,('jev_007',221,2):1}
133
- if version==3:
134
- expected.update({('jev_v2_040',223,2):0,('jev_v2_046',261,2):0,('jev_v2_007',215,2):0,
135
- ('jev_v2_039',426,0):0,('jev_v2_041',61,0):0,('jev_v2_014',415,0):0,
136
- ('jev_v2_014',469,0):1,('jev_v2_012',206,2):1,('jev_v2_047',291,2):1})
137
- for key,value in expected.items():assert all_known[key]==value,(key,all_known.get(key),value)
138
- for i in range(50):
139
- old=read(OLD/f'episodes/libero_10/000/demo_{i}.json')
140
- for si in (0,2):cut_stats[str(all_known[f'expert_{i:03}',old['stage_prompts'][si]['reference_end'],si])]+=1
141
- assert not cut_stats['0'],cut_stats
142
- source_hashes=read(root/'source_checksums.json')
143
- assert all(sha(p)==h for p,h in source_hashes.items())
144
- original_path=next(r['source_hdf5'] for r in m['episode_index'] if r['source_kind']=='expert')
145
- assert sha(original_path)==m['original_hdf5_sha256']
146
- print('Original HDF5 and annotation hashes unchanged',flush=True)
147
- assert sha(root/'label_recipe.json')==m['recipe_sha256']
148
- assert sha(root/'stage_prompts.json')==m['stage_prompts_sha256']
149
- dataset=DecisionDataset(root,include_ignored=True,supplement_root=sup)
150
- wanted=set(examples.values());selected=[]
151
- for index,(i,j) in enumerate(dataset.indices):
152
- ep=dataset.episodes[i];r=ep['samples'][j]
153
- if (ep['episode_id'],r['sample_id']) not in wanted:continue
154
- sample=dataset[index];inp=sample['model_inputs'];rgb=inp['rgb_history'];mask=inp['history_mask']
155
- assert set(inp)==({'rgb_history','history_mask','action_text','focus','robot_state'} if version==3 else {'rgb_history','history_mask','action_text','focus'})
156
- assert rgb.shape==(8,2,336,336,3) and rgb.dtype==np.uint8 and not rgb[~mask].any()
157
- assert np.all(rgb[mask][:,:,::8,::8].reshape(mask.sum(),-1).std(axis=1)>5)
158
- selected.append(dict(episode=ep['episode_id'],sample=r['sample_id'],head=r['head'],label=r['label']))
159
- print('Loaded RGB example',selected[-1],flush=True)
160
- dataset.close()
161
- for f in files.values():f.close()
162
- assert len(selected)==len(examples)
163
- report=dict(passed=True,episodes=checks,label_counts=m['label_counts'],saved_rgb=rgb_stats,
164
- candidate_rows=len(seen),train_rows=sum(r['train_rows'] for r in m['episode_index']),
165
- known_case_assertions=len(expected),loader_examples=selected,expert_pick_cut_labels=dict(cut_stats),
166
- terminal_place_complete_rows=dict(terminal),original_hdf5_unchanged=True,original_annotations_unchanged=True,
167
- robot_alignment=robot_alignment, preserved_prior_sample_labels=preserved_labels, history_causal=True,history_phase_reset_checked=True,rollout_index_mapping_checked=True,
168
- note='Validation verifies structure, causal evidence and audited cases; labels are not all human-reviewed gold.')
169
- write(root/'verification.json',report)
170
- m.update(complete=True,phase='dataset_ready_no_training',verification_sha256=sha(root/'verification.json'))
171
- write(root/'manifest.json',m)
172
- faulthandler.cancel_dump_traceback_later()
173
- print({k:v for k,v in report.items() if k not in ('episodes','saved_rgb','loader_examples')},flush=True)
174
-
175
- if __name__=='__main__':main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
act/jev_long000_supplement_v2/source_records/jev_006.json DELETED
The diff for this file is too large to render. See raw diff
 
act/jev_long000_supplement_v2/source_records/jev_007.json DELETED
The diff for this file is too large to render. See raw diff