diffneusim 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (682) hide show
  1. diffneusim/__init__.py +1 -0
  2. diffneusim/_cache.py +42 -0
  3. diffneusim/_paths.py +5 -0
  4. diffneusim/bindings/rew14_ext.cu +115 -0
  5. diffneusim/bindings/soft14_capi.cpp +443 -0
  6. diffneusim/bindings/soft14_engine_ext.cu +596 -0
  7. diffneusim/bindings/soft_capi.cpp +782 -0
  8. diffneusim/bindings/soft_engine_ext.cu +495 -0
  9. diffneusim/core/cpu_engine/build.sh +40 -0
  10. diffneusim/core/cpu_engine/fiber/cuda_runtime.h +445 -0
  11. diffneusim/core/cpu_engine/x14_cpu.cpp +283 -0
  12. diffneusim/core/diff/dual.h +126 -0
  13. diffneusim/core/include/diffneusim/macros.h +35 -0
  14. diffneusim/core/kin/kinematic_tree.h +273 -0
  15. diffneusim/core/math/so3.h +182 -0
  16. diffneusim/core/soft/adj/out_adj.h +102 -0
  17. diffneusim/core/soft/adj/rnea_adj.h +425 -0
  18. diffneusim/core/soft/adj/rows_adj.h +439 -0
  19. diffneusim/core/soft/adj/rows_functor.h +89 -0
  20. diffneusim/core/soft/adj/rows_lanes.h +443 -0
  21. diffneusim/core/soft/adj/shell_adj.h +243 -0
  22. diffneusim/core/soft/adj/tree_adj.h +356 -0
  23. diffneusim/core/soft/collide.h +183 -0
  24. diffneusim/core/soft/gpu/adj14.cuh +233 -0
  25. diffneusim/core/soft/gpu/adj14_mus.cuh +98 -0
  26. diffneusim/core/soft/gpu/adj_shell.cuh +50 -0
  27. diffneusim/core/soft/gpu/adj_tab.cuh +49 -0
  28. diffneusim/core/soft/gpu/body14.cuh +47 -0
  29. diffneusim/core/soft/gpu/chol_rn.cuh +458 -0
  30. diffneusim/core/soft/gpu/chol_small.cuh +123 -0
  31. diffneusim/core/soft/gpu/chol_split.cuh +193 -0
  32. diffneusim/core/soft/gpu/engine_launch.cuh +263 -0
  33. diffneusim/core/soft/gpu/fk_rn.cuh +109 -0
  34. diffneusim/core/soft/gpu/generated/body_019e20820f86_mmfloor.cuh +28 -0
  35. diffneusim/core/soft/gpu/generated/body_62f77a4bb16b_mmfloor.cuh +52 -0
  36. diffneusim/core/soft/gpu/generated/body_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +28 -0
  37. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +28 -0
  38. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +28 -0
  39. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +28 -0
  40. diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +28 -0
  41. diffneusim/core/soft/gpu/generated/body_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +52 -0
  42. diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor.cuh +25 -0
  43. diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +25 -0
  44. diffneusim/core/soft/gpu/generated/g1_soft_5db44fd45286.cuh +74 -0
  45. diffneusim/core/soft/gpu/generated/split_62f77a4bb16b_mmfloor.cuh +18 -0
  46. diffneusim/core/soft/gpu/generated/split_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +18 -0
  47. diffneusim/core/soft/gpu/generated/x14_soft_019e20820f86_mmfloor.cuh +123 -0
  48. diffneusim/core/soft/gpu/generated/x14_soft_62f77a4bb16b_mmfloor.cuh +129 -0
  49. diffneusim/core/soft/gpu/generated/x14_soft_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +123 -0
  50. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +123 -0
  51. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +123 -0
  52. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +123 -0
  53. diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +123 -0
  54. diffneusim/core/soft/gpu/generated/x14_soft_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +129 -0
  55. diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor.cuh +123 -0
  56. diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +123 -0
  57. diffneusim/core/soft/gpu/k_mus.cuh +1038 -0
  58. diffneusim/core/soft/gpu/k_mus_host.cuh +377 -0
  59. diffneusim/core/soft/gpu/k_pre.cuh +52 -0
  60. diffneusim/core/soft/gpu/kernel_p.cuh +490 -0
  61. diffneusim/core/soft/gpu/kp14.cuh +465 -0
  62. diffneusim/core/soft/gpu/l2v2.cuh +367 -0
  63. diffneusim/core/soft/gpu/l2x14.cuh +319 -0
  64. diffneusim/core/soft/gpu/l3.cuh +1483 -0
  65. diffneusim/core/soft/gpu/model_view.cuh +48 -0
  66. diffneusim/core/soft/gpu/mus_case_fits.h +15 -0
  67. diffneusim/core/soft/gpu/mus_classes.h +182 -0
  68. diffneusim/core/soft/gpu/mus_row_cf.h +44 -0
  69. diffneusim/core/soft/gpu/rew14.cuh +177 -0
  70. diffneusim/core/soft/gpu/rows_ctab.cuh +44 -0
  71. diffneusim/core/soft/gpu/tree_m.cuh +247 -0
  72. diffneusim/core/soft/gpu/x14_engine_kernels.cuh +260 -0
  73. diffneusim/core/soft/gpu/x14_rowcf.h +14 -0
  74. diffneusim/core/soft/hand.h +124 -0
  75. diffneusim/core/soft/impedance.h +115 -0
  76. diffneusim/core/soft/jvp.h +202 -0
  77. diffneusim/core/soft/kin.h +250 -0
  78. diffneusim/core/soft/muscle.h +1208 -0
  79. diffneusim/core/soft/newton.h +371 -0
  80. diffneusim/core/soft/rows.h +176 -0
  81. diffneusim/core/soft/step.h +188 -0
  82. diffneusim/core/soft/tape.h +313 -0
  83. diffneusim/core/soft/x14/collide14.h +69 -0
  84. diffneusim/core/soft/x14/jvp14.h +182 -0
  85. diffneusim/core/soft/x14/law14.h +453 -0
  86. diffneusim/core/soft/x14adj/collide14_adj.h +134 -0
  87. diffneusim/core/soft/x14adj/passive14_adj.h +162 -0
  88. diffneusim/core/soft/x14adj/reward14.h +484 -0
  89. diffneusim/core/soft/x14adj/rows14_adj.h +400 -0
  90. diffneusim/core/soft/x14adj/scan14.h +349 -0
  91. diffneusim/core/soft/x14adj/shell14_adj.h +122 -0
  92. diffneusim/core/soft/x14adj/sweep14.h +255 -0
  93. diffneusim/core/soft/x14adj/tree14_adj.h +500 -0
  94. diffneusim/core/soft/x14adj/x14adj_common.h +96 -0
  95. diffneusim/data/mirror/H1622v2k_geyer_hfdeq.npz +0 -0
  96. diffneusim/data/mirror/H1622v2k_hfd.npz +0 -0
  97. diffneusim/data/mirror/H1622v2k_millard_hfdeq.npz +0 -0
  98. diffneusim/data/mirror/fullbody_contact.npz +0 -0
  99. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard.npz +0 -0
  100. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str.npz +0 -0
  101. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str_rigid.npz +0 -0
  102. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.npz +0 -0
  103. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.npz +0 -0
  104. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq.npz +0 -0
  105. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin.npz +0 -0
  106. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_calf2_pe.npz +0 -0
  107. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
  108. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfix.npz +0 -0
  109. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.npz +0 -0
  110. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01.npz +0 -0
  111. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01legs.npz +0 -0
  112. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01lumbar.npz +0 -0
  113. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfix.npz +0 -0
  114. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfixlegs01.npz +0 -0
  115. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
  116. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
  117. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
  118. diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
  119. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair.npz +0 -0
  120. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
  121. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_hinge.npz +0 -0
  122. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
  123. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
  124. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
  125. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
  126. diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_lspine_girdle_osimeq.npz +0 -0
  127. diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_millard.npz +0 -0
  128. diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_osimeq.npz +0 -0
  129. diffneusim/data/mirror/myoleg26_3d_compound_g14eq.npz +0 -0
  130. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq.npz +0 -0
  131. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose.npz +0 -0
  132. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin.npz +0 -0
  133. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30.npz +0 -0
  134. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.npz +0 -0
  135. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_luispe.npz +0 -0
  136. diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_trunk0701.npz +0 -0
  137. diffneusim/data/muscle_fit/wang_mass_volume_14t.json +91 -0
  138. diffneusim/data/muscle_fit/wang_mass_volume_14t_axfix.json +91 -0
  139. diffneusim/data/muscle_fit/wang_mass_volume_14t_axfixlegs01.json +91 -0
  140. diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01.json +91 -0
  141. diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01legs.json +91 -0
  142. diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01lumbar.json +91 -0
  143. diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfix.json +91 -0
  144. diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfixlegs01.json +91 -0
  145. diffneusim/data/muscle_fit/wang_mass_volume_14t_n1.json +91 -0
  146. diffneusim/data/muscle_fit/wang_mass_volume_14t_n1a.json +91 -0
  147. diffneusim/data/muscle_fit/wang_mass_volume_14t_n2.json +91 -0
  148. diffneusim/data/muscle_fit/wang_mass_volume_14t_rom23.json +91 -0
  149. diffneusim/data/reference/musclemimic/myofullbody_mimic_sites.json +261 -0
  150. diffneusim/data/reference/pose3/pose3_scone.json +305 -0
  151. diffneusim/data/reference/pose3/pose3_scone.txt +3 -0
  152. diffneusim/data/reference/pose3/pose3_scone_gait.npz +0 -0
  153. diffneusim/data/reference/pose3/pose3_scone_mirror.npz +0 -0
  154. diffneusim/data/reference/pose3/pose3_scone_stand.npz +0 -0
  155. diffneusim/data/reference/x016run/MD5SUMS +241 -0
  156. diffneusim/data/reference/x016run/x016run_states.txt +240 -0
  157. diffneusim/data/reference/x016run/x016run_v3p00_s0_l0.npz +0 -0
  158. diffneusim/data/reference/x016run/x016run_v3p00_s0_l1.npz +0 -0
  159. diffneusim/data/reference/x016run/x016run_v3p00_s0_l2.npz +0 -0
  160. diffneusim/data/reference/x016run/x016run_v3p00_s0_l3.npz +0 -0
  161. diffneusim/data/reference/x016run/x016run_v3p00_s0_r0.npz +0 -0
  162. diffneusim/data/reference/x016run/x016run_v3p00_s0_r1.npz +0 -0
  163. diffneusim/data/reference/x016run/x016run_v3p00_s0_r2.npz +0 -0
  164. diffneusim/data/reference/x016run/x016run_v3p00_s0_r3.npz +0 -0
  165. diffneusim/data/reference/x016run/x016run_v3p00_s1_l0.npz +0 -0
  166. diffneusim/data/reference/x016run/x016run_v3p00_s1_l1.npz +0 -0
  167. diffneusim/data/reference/x016run/x016run_v3p00_s1_l2.npz +0 -0
  168. diffneusim/data/reference/x016run/x016run_v3p00_s1_l3.npz +0 -0
  169. diffneusim/data/reference/x016run/x016run_v3p00_s1_r0.npz +0 -0
  170. diffneusim/data/reference/x016run/x016run_v3p00_s1_r1.npz +0 -0
  171. diffneusim/data/reference/x016run/x016run_v3p00_s1_r2.npz +0 -0
  172. diffneusim/data/reference/x016run/x016run_v3p00_s1_r3.npz +0 -0
  173. diffneusim/data/reference/x016run/x016run_v3p00_s2_l0.npz +0 -0
  174. diffneusim/data/reference/x016run/x016run_v3p00_s2_l1.npz +0 -0
  175. diffneusim/data/reference/x016run/x016run_v3p00_s2_l2.npz +0 -0
  176. diffneusim/data/reference/x016run/x016run_v3p00_s2_l3.npz +0 -0
  177. diffneusim/data/reference/x016run/x016run_v3p00_s2_r0.npz +0 -0
  178. diffneusim/data/reference/x016run/x016run_v3p00_s2_r1.npz +0 -0
  179. diffneusim/data/reference/x016run/x016run_v3p00_s2_r2.npz +0 -0
  180. diffneusim/data/reference/x016run/x016run_v3p00_s2_r3.npz +0 -0
  181. diffneusim/data/reference/x016run/x016run_v3p00_s3_l0.npz +0 -0
  182. diffneusim/data/reference/x016run/x016run_v3p00_s3_l1.npz +0 -0
  183. diffneusim/data/reference/x016run/x016run_v3p00_s3_l2.npz +0 -0
  184. diffneusim/data/reference/x016run/x016run_v3p00_s3_l3.npz +0 -0
  185. diffneusim/data/reference/x016run/x016run_v3p00_s3_r0.npz +0 -0
  186. diffneusim/data/reference/x016run/x016run_v3p00_s3_r1.npz +0 -0
  187. diffneusim/data/reference/x016run/x016run_v3p00_s3_r2.npz +0 -0
  188. diffneusim/data/reference/x016run/x016run_v3p00_s3_r3.npz +0 -0
  189. diffneusim/data/reference/x016run/x016run_v3p00_s4_l0.npz +0 -0
  190. diffneusim/data/reference/x016run/x016run_v3p00_s4_l1.npz +0 -0
  191. diffneusim/data/reference/x016run/x016run_v3p00_s4_l2.npz +0 -0
  192. diffneusim/data/reference/x016run/x016run_v3p00_s4_l3.npz +0 -0
  193. diffneusim/data/reference/x016run/x016run_v3p00_s4_r0.npz +0 -0
  194. diffneusim/data/reference/x016run/x016run_v3p00_s4_r1.npz +0 -0
  195. diffneusim/data/reference/x016run/x016run_v3p00_s4_r2.npz +0 -0
  196. diffneusim/data/reference/x016run/x016run_v3p00_s4_r3.npz +0 -0
  197. diffneusim/data/reference/x016run/x016run_v3p00_s5_l0.npz +0 -0
  198. diffneusim/data/reference/x016run/x016run_v3p00_s5_l1.npz +0 -0
  199. diffneusim/data/reference/x016run/x016run_v3p00_s5_l2.npz +0 -0
  200. diffneusim/data/reference/x016run/x016run_v3p00_s5_l3.npz +0 -0
  201. diffneusim/data/reference/x016run/x016run_v3p00_s5_r0.npz +0 -0
  202. diffneusim/data/reference/x016run/x016run_v3p00_s5_r1.npz +0 -0
  203. diffneusim/data/reference/x016run/x016run_v3p00_s5_r2.npz +0 -0
  204. diffneusim/data/reference/x016run/x016run_v3p00_s5_r3.npz +0 -0
  205. diffneusim/data/reference/x016run/x016run_v3p00_s6_l0.npz +0 -0
  206. diffneusim/data/reference/x016run/x016run_v3p00_s6_l1.npz +0 -0
  207. diffneusim/data/reference/x016run/x016run_v3p00_s6_l2.npz +0 -0
  208. diffneusim/data/reference/x016run/x016run_v3p00_s6_l3.npz +0 -0
  209. diffneusim/data/reference/x016run/x016run_v3p00_s6_r0.npz +0 -0
  210. diffneusim/data/reference/x016run/x016run_v3p00_s6_r1.npz +0 -0
  211. diffneusim/data/reference/x016run/x016run_v3p00_s6_r2.npz +0 -0
  212. diffneusim/data/reference/x016run/x016run_v3p00_s6_r3.npz +0 -0
  213. diffneusim/data/reference/x016run/x016run_v3p00_s7_l0.npz +0 -0
  214. diffneusim/data/reference/x016run/x016run_v3p00_s7_l1.npz +0 -0
  215. diffneusim/data/reference/x016run/x016run_v3p00_s7_l2.npz +0 -0
  216. diffneusim/data/reference/x016run/x016run_v3p00_s7_l3.npz +0 -0
  217. diffneusim/data/reference/x016run/x016run_v3p00_s7_r0.npz +0 -0
  218. diffneusim/data/reference/x016run/x016run_v3p00_s7_r1.npz +0 -0
  219. diffneusim/data/reference/x016run/x016run_v3p00_s7_r2.npz +0 -0
  220. diffneusim/data/reference/x016run/x016run_v3p00_s7_r3.npz +0 -0
  221. diffneusim/data/reference/x016run/x016run_v3p25_s0_l0.npz +0 -0
  222. diffneusim/data/reference/x016run/x016run_v3p25_s0_l1.npz +0 -0
  223. diffneusim/data/reference/x016run/x016run_v3p25_s0_l2.npz +0 -0
  224. diffneusim/data/reference/x016run/x016run_v3p25_s0_l3.npz +0 -0
  225. diffneusim/data/reference/x016run/x016run_v3p25_s0_r0.npz +0 -0
  226. diffneusim/data/reference/x016run/x016run_v3p25_s0_r1.npz +0 -0
  227. diffneusim/data/reference/x016run/x016run_v3p25_s0_r2.npz +0 -0
  228. diffneusim/data/reference/x016run/x016run_v3p25_s0_r3.npz +0 -0
  229. diffneusim/data/reference/x016run/x016run_v3p25_s1_l0.npz +0 -0
  230. diffneusim/data/reference/x016run/x016run_v3p25_s1_l1.npz +0 -0
  231. diffneusim/data/reference/x016run/x016run_v3p25_s1_l2.npz +0 -0
  232. diffneusim/data/reference/x016run/x016run_v3p25_s1_l3.npz +0 -0
  233. diffneusim/data/reference/x016run/x016run_v3p25_s1_r0.npz +0 -0
  234. diffneusim/data/reference/x016run/x016run_v3p25_s1_r1.npz +0 -0
  235. diffneusim/data/reference/x016run/x016run_v3p25_s1_r2.npz +0 -0
  236. diffneusim/data/reference/x016run/x016run_v3p25_s1_r3.npz +0 -0
  237. diffneusim/data/reference/x016run/x016run_v3p25_s2_l0.npz +0 -0
  238. diffneusim/data/reference/x016run/x016run_v3p25_s2_l1.npz +0 -0
  239. diffneusim/data/reference/x016run/x016run_v3p25_s2_l2.npz +0 -0
  240. diffneusim/data/reference/x016run/x016run_v3p25_s2_l3.npz +0 -0
  241. diffneusim/data/reference/x016run/x016run_v3p25_s2_r0.npz +0 -0
  242. diffneusim/data/reference/x016run/x016run_v3p25_s2_r1.npz +0 -0
  243. diffneusim/data/reference/x016run/x016run_v3p25_s2_r2.npz +0 -0
  244. diffneusim/data/reference/x016run/x016run_v3p25_s2_r3.npz +0 -0
  245. diffneusim/data/reference/x016run/x016run_v3p25_s3_l0.npz +0 -0
  246. diffneusim/data/reference/x016run/x016run_v3p25_s3_l1.npz +0 -0
  247. diffneusim/data/reference/x016run/x016run_v3p25_s3_l2.npz +0 -0
  248. diffneusim/data/reference/x016run/x016run_v3p25_s3_l3.npz +0 -0
  249. diffneusim/data/reference/x016run/x016run_v3p25_s3_r0.npz +0 -0
  250. diffneusim/data/reference/x016run/x016run_v3p25_s3_r1.npz +0 -0
  251. diffneusim/data/reference/x016run/x016run_v3p25_s3_r2.npz +0 -0
  252. diffneusim/data/reference/x016run/x016run_v3p25_s3_r3.npz +0 -0
  253. diffneusim/data/reference/x016run/x016run_v3p25_s4_l0.npz +0 -0
  254. diffneusim/data/reference/x016run/x016run_v3p25_s4_l1.npz +0 -0
  255. diffneusim/data/reference/x016run/x016run_v3p25_s4_l2.npz +0 -0
  256. diffneusim/data/reference/x016run/x016run_v3p25_s4_l3.npz +0 -0
  257. diffneusim/data/reference/x016run/x016run_v3p25_s4_r0.npz +0 -0
  258. diffneusim/data/reference/x016run/x016run_v3p25_s4_r1.npz +0 -0
  259. diffneusim/data/reference/x016run/x016run_v3p25_s4_r2.npz +0 -0
  260. diffneusim/data/reference/x016run/x016run_v3p25_s4_r3.npz +0 -0
  261. diffneusim/data/reference/x016run/x016run_v3p25_s5_l0.npz +0 -0
  262. diffneusim/data/reference/x016run/x016run_v3p25_s5_l1.npz +0 -0
  263. diffneusim/data/reference/x016run/x016run_v3p25_s5_l2.npz +0 -0
  264. diffneusim/data/reference/x016run/x016run_v3p25_s5_l3.npz +0 -0
  265. diffneusim/data/reference/x016run/x016run_v3p25_s5_r0.npz +0 -0
  266. diffneusim/data/reference/x016run/x016run_v3p25_s5_r1.npz +0 -0
  267. diffneusim/data/reference/x016run/x016run_v3p25_s5_r2.npz +0 -0
  268. diffneusim/data/reference/x016run/x016run_v3p25_s5_r3.npz +0 -0
  269. diffneusim/data/reference/x016run/x016run_v3p25_s6_l0.npz +0 -0
  270. diffneusim/data/reference/x016run/x016run_v3p25_s6_l1.npz +0 -0
  271. diffneusim/data/reference/x016run/x016run_v3p25_s6_l2.npz +0 -0
  272. diffneusim/data/reference/x016run/x016run_v3p25_s6_l3.npz +0 -0
  273. diffneusim/data/reference/x016run/x016run_v3p25_s6_r0.npz +0 -0
  274. diffneusim/data/reference/x016run/x016run_v3p25_s6_r1.npz +0 -0
  275. diffneusim/data/reference/x016run/x016run_v3p25_s6_r2.npz +0 -0
  276. diffneusim/data/reference/x016run/x016run_v3p25_s6_r3.npz +0 -0
  277. diffneusim/data/reference/x016run/x016run_v3p25_s7_l0.npz +0 -0
  278. diffneusim/data/reference/x016run/x016run_v3p25_s7_l1.npz +0 -0
  279. diffneusim/data/reference/x016run/x016run_v3p25_s7_l2.npz +0 -0
  280. diffneusim/data/reference/x016run/x016run_v3p25_s7_l3.npz +0 -0
  281. diffneusim/data/reference/x016run/x016run_v3p25_s7_r0.npz +0 -0
  282. diffneusim/data/reference/x016run/x016run_v3p25_s7_r1.npz +0 -0
  283. diffneusim/data/reference/x016run/x016run_v3p25_s7_r2.npz +0 -0
  284. diffneusim/data/reference/x016run/x016run_v3p25_s7_r3.npz +0 -0
  285. diffneusim/data/reference/x016run/x016run_v3p50_s0_l0.npz +0 -0
  286. diffneusim/data/reference/x016run/x016run_v3p50_s0_l1.npz +0 -0
  287. diffneusim/data/reference/x016run/x016run_v3p50_s0_l2.npz +0 -0
  288. diffneusim/data/reference/x016run/x016run_v3p50_s0_l3.npz +0 -0
  289. diffneusim/data/reference/x016run/x016run_v3p50_s0_r0.npz +0 -0
  290. diffneusim/data/reference/x016run/x016run_v3p50_s0_r1.npz +0 -0
  291. diffneusim/data/reference/x016run/x016run_v3p50_s0_r2.npz +0 -0
  292. diffneusim/data/reference/x016run/x016run_v3p50_s0_r3.npz +0 -0
  293. diffneusim/data/reference/x016run/x016run_v3p50_s1_l0.npz +0 -0
  294. diffneusim/data/reference/x016run/x016run_v3p50_s1_l1.npz +0 -0
  295. diffneusim/data/reference/x016run/x016run_v3p50_s1_l2.npz +0 -0
  296. diffneusim/data/reference/x016run/x016run_v3p50_s1_l3.npz +0 -0
  297. diffneusim/data/reference/x016run/x016run_v3p50_s1_r0.npz +0 -0
  298. diffneusim/data/reference/x016run/x016run_v3p50_s1_r1.npz +0 -0
  299. diffneusim/data/reference/x016run/x016run_v3p50_s1_r2.npz +0 -0
  300. diffneusim/data/reference/x016run/x016run_v3p50_s1_r3.npz +0 -0
  301. diffneusim/data/reference/x016run/x016run_v3p50_s2_l0.npz +0 -0
  302. diffneusim/data/reference/x016run/x016run_v3p50_s2_l1.npz +0 -0
  303. diffneusim/data/reference/x016run/x016run_v3p50_s2_l2.npz +0 -0
  304. diffneusim/data/reference/x016run/x016run_v3p50_s2_l3.npz +0 -0
  305. diffneusim/data/reference/x016run/x016run_v3p50_s2_r0.npz +0 -0
  306. diffneusim/data/reference/x016run/x016run_v3p50_s2_r1.npz +0 -0
  307. diffneusim/data/reference/x016run/x016run_v3p50_s2_r2.npz +0 -0
  308. diffneusim/data/reference/x016run/x016run_v3p50_s2_r3.npz +0 -0
  309. diffneusim/data/reference/x016run/x016run_v3p50_s3_l0.npz +0 -0
  310. diffneusim/data/reference/x016run/x016run_v3p50_s3_l1.npz +0 -0
  311. diffneusim/data/reference/x016run/x016run_v3p50_s3_l2.npz +0 -0
  312. diffneusim/data/reference/x016run/x016run_v3p50_s3_l3.npz +0 -0
  313. diffneusim/data/reference/x016run/x016run_v3p50_s3_r0.npz +0 -0
  314. diffneusim/data/reference/x016run/x016run_v3p50_s3_r1.npz +0 -0
  315. diffneusim/data/reference/x016run/x016run_v3p50_s3_r2.npz +0 -0
  316. diffneusim/data/reference/x016run/x016run_v3p50_s3_r3.npz +0 -0
  317. diffneusim/data/reference/x016run/x016run_v3p50_s5_l0.npz +0 -0
  318. diffneusim/data/reference/x016run/x016run_v3p50_s5_l1.npz +0 -0
  319. diffneusim/data/reference/x016run/x016run_v3p50_s5_l2.npz +0 -0
  320. diffneusim/data/reference/x016run/x016run_v3p50_s5_l3.npz +0 -0
  321. diffneusim/data/reference/x016run/x016run_v3p50_s5_r0.npz +0 -0
  322. diffneusim/data/reference/x016run/x016run_v3p50_s5_r1.npz +0 -0
  323. diffneusim/data/reference/x016run/x016run_v3p50_s5_r2.npz +0 -0
  324. diffneusim/data/reference/x016run/x016run_v3p50_s5_r3.npz +0 -0
  325. diffneusim/data/reference/x016run/x016run_v3p50_s6_l0.npz +0 -0
  326. diffneusim/data/reference/x016run/x016run_v3p50_s6_l1.npz +0 -0
  327. diffneusim/data/reference/x016run/x016run_v3p50_s6_l2.npz +0 -0
  328. diffneusim/data/reference/x016run/x016run_v3p50_s6_l3.npz +0 -0
  329. diffneusim/data/reference/x016run/x016run_v3p50_s6_r0.npz +0 -0
  330. diffneusim/data/reference/x016run/x016run_v3p50_s6_r1.npz +0 -0
  331. diffneusim/data/reference/x016run/x016run_v3p50_s6_r2.npz +0 -0
  332. diffneusim/data/reference/x016run/x016run_v3p50_s6_r3.npz +0 -0
  333. diffneusim/data/reference/x016run/x016run_v3p50_s7_l0.npz +0 -0
  334. diffneusim/data/reference/x016run/x016run_v3p50_s7_l1.npz +0 -0
  335. diffneusim/data/reference/x016run/x016run_v3p50_s7_l2.npz +0 -0
  336. diffneusim/data/reference/x016run/x016run_v3p50_s7_l3.npz +0 -0
  337. diffneusim/data/reference/x016run/x016run_v3p50_s7_r0.npz +0 -0
  338. diffneusim/data/reference/x016run/x016run_v3p50_s7_r1.npz +0 -0
  339. diffneusim/data/reference/x016run/x016run_v3p50_s7_r2.npz +0 -0
  340. diffneusim/data/reference/x016run/x016run_v3p50_s7_r3.npz +0 -0
  341. diffneusim/data/reference/x016run/x016run_v3p75_s0_l0.npz +0 -0
  342. diffneusim/data/reference/x016run/x016run_v3p75_s0_l1.npz +0 -0
  343. diffneusim/data/reference/x016run/x016run_v3p75_s0_l2.npz +0 -0
  344. diffneusim/data/reference/x016run/x016run_v3p75_s0_l3.npz +0 -0
  345. diffneusim/data/reference/x016run/x016run_v3p75_s0_r0.npz +0 -0
  346. diffneusim/data/reference/x016run/x016run_v3p75_s0_r1.npz +0 -0
  347. diffneusim/data/reference/x016run/x016run_v3p75_s0_r2.npz +0 -0
  348. diffneusim/data/reference/x016run/x016run_v3p75_s0_r3.npz +0 -0
  349. diffneusim/data/reference/x016run/x016run_v3p75_s1_l0.npz +0 -0
  350. diffneusim/data/reference/x016run/x016run_v3p75_s1_l1.npz +0 -0
  351. diffneusim/data/reference/x016run/x016run_v3p75_s1_l2.npz +0 -0
  352. diffneusim/data/reference/x016run/x016run_v3p75_s1_l3.npz +0 -0
  353. diffneusim/data/reference/x016run/x016run_v3p75_s1_r0.npz +0 -0
  354. diffneusim/data/reference/x016run/x016run_v3p75_s1_r1.npz +0 -0
  355. diffneusim/data/reference/x016run/x016run_v3p75_s1_r2.npz +0 -0
  356. diffneusim/data/reference/x016run/x016run_v3p75_s1_r3.npz +0 -0
  357. diffneusim/data/reference/x016run/x016run_v3p75_s2_l0.npz +0 -0
  358. diffneusim/data/reference/x016run/x016run_v3p75_s2_l1.npz +0 -0
  359. diffneusim/data/reference/x016run/x016run_v3p75_s2_l2.npz +0 -0
  360. diffneusim/data/reference/x016run/x016run_v3p75_s2_l3.npz +0 -0
  361. diffneusim/data/reference/x016run/x016run_v3p75_s2_r0.npz +0 -0
  362. diffneusim/data/reference/x016run/x016run_v3p75_s2_r1.npz +0 -0
  363. diffneusim/data/reference/x016run/x016run_v3p75_s2_r2.npz +0 -0
  364. diffneusim/data/reference/x016run/x016run_v3p75_s2_r3.npz +0 -0
  365. diffneusim/data/reference/x016run/x016run_v3p75_s3_l0.npz +0 -0
  366. diffneusim/data/reference/x016run/x016run_v3p75_s3_l1.npz +0 -0
  367. diffneusim/data/reference/x016run/x016run_v3p75_s3_l2.npz +0 -0
  368. diffneusim/data/reference/x016run/x016run_v3p75_s3_l3.npz +0 -0
  369. diffneusim/data/reference/x016run/x016run_v3p75_s3_r0.npz +0 -0
  370. diffneusim/data/reference/x016run/x016run_v3p75_s3_r1.npz +0 -0
  371. diffneusim/data/reference/x016run/x016run_v3p75_s3_r2.npz +0 -0
  372. diffneusim/data/reference/x016run/x016run_v3p75_s3_r3.npz +0 -0
  373. diffneusim/data/reference/x016run/x016run_v3p75_s5_l0.npz +0 -0
  374. diffneusim/data/reference/x016run/x016run_v3p75_s5_l1.npz +0 -0
  375. diffneusim/data/reference/x016run/x016run_v3p75_s5_l2.npz +0 -0
  376. diffneusim/data/reference/x016run/x016run_v3p75_s5_l3.npz +0 -0
  377. diffneusim/data/reference/x016run/x016run_v3p75_s5_r0.npz +0 -0
  378. diffneusim/data/reference/x016run/x016run_v3p75_s5_r1.npz +0 -0
  379. diffneusim/data/reference/x016run/x016run_v3p75_s5_r2.npz +0 -0
  380. diffneusim/data/reference/x016run/x016run_v3p75_s5_r3.npz +0 -0
  381. diffneusim/data/reference/x016run/x016run_v3p75_s6_l0.npz +0 -0
  382. diffneusim/data/reference/x016run/x016run_v3p75_s6_l1.npz +0 -0
  383. diffneusim/data/reference/x016run/x016run_v3p75_s6_l2.npz +0 -0
  384. diffneusim/data/reference/x016run/x016run_v3p75_s6_l3.npz +0 -0
  385. diffneusim/data/reference/x016run/x016run_v3p75_s6_r0.npz +0 -0
  386. diffneusim/data/reference/x016run/x016run_v3p75_s6_r1.npz +0 -0
  387. diffneusim/data/reference/x016run/x016run_v3p75_s6_r2.npz +0 -0
  388. diffneusim/data/reference/x016run/x016run_v3p75_s6_r3.npz +0 -0
  389. diffneusim/data/reference/x016run/x016run_v3p75_s7_l0.npz +0 -0
  390. diffneusim/data/reference/x016run/x016run_v3p75_s7_l1.npz +0 -0
  391. diffneusim/data/reference/x016run/x016run_v3p75_s7_l2.npz +0 -0
  392. diffneusim/data/reference/x016run/x016run_v3p75_s7_l3.npz +0 -0
  393. diffneusim/data/reference/x016run/x016run_v3p75_s7_r0.npz +0 -0
  394. diffneusim/data/reference/x016run/x016run_v3p75_s7_r1.npz +0 -0
  395. diffneusim/data/reference/x016run/x016run_v3p75_s7_r2.npz +0 -0
  396. diffneusim/data/reference/x016run/x016run_v3p75_s7_r3.npz +0 -0
  397. diffneusim/data/state_prior/lumbar_poly_fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
  398. diffneusim/engine/__init__.py +0 -0
  399. diffneusim/engine/build_tag.py +52 -0
  400. diffneusim/engine/case_tables.py +46 -0
  401. diffneusim/engine/d16_body.py +80 -0
  402. diffneusim/engine/engine14.py +367 -0
  403. diffneusim/engine/gen_split.py +159 -0
  404. diffneusim/engine/hand_format.py +69 -0
  405. diffneusim/engine/live14.py +149 -0
  406. diffneusim/engine/phase_b_tree.py +137 -0
  407. diffneusim/engine/soft14.py +130 -0
  408. diffneusim/engine/soft_capi.py +373 -0
  409. diffneusim/engine/soft_engine.py +165 -0
  410. diffneusim/engine/step14.py +132 -0
  411. diffneusim/engine/tape_format.py +89 -0
  412. diffneusim/engine/x14cpu.py +163 -0
  413. diffneusim/env/__init__.py +0 -0
  414. diffneusim/env/absent.py +20 -0
  415. diffneusim/env/cpu14.py +105 -0
  416. diffneusim/env/e0loop14.py +224 -0
  417. diffneusim/env/env14.py +568 -0
  418. diffneusim/env/kin_contact14.py +193 -0
  419. diffneusim/env/mimic_sites_x14.json +366 -0
  420. diffneusim/env/old_count.py +78 -0
  421. diffneusim/env/rew14.py +114 -0
  422. diffneusim/env/rew14_hook.py +105 -0
  423. diffneusim/g1/__init__.py +1 -0
  424. diffneusim/g1/arm_a2.py +165 -0
  425. diffneusim/g1/arm_a3.py +576 -0
  426. diffneusim/g1/read_a3.py +79 -0
  427. diffneusim/g1/rg1_read.py +89 -0
  428. diffneusim/model/__init__.py +66 -0
  429. diffneusim/model/case.py +17 -0
  430. diffneusim/model/dnmodel.py +79 -0
  431. diffneusim/model/fuse_fixed.py +281 -0
  432. diffneusim/model/monitor.py +834 -0
  433. diffneusim/models/BODIES.toml +48 -0
  434. diffneusim/models/MANIFEST.toml +979 -0
  435. diffneusim/models/cases/G290/case.bin +0 -0
  436. diffneusim/models/cases/G290/case.json +1 -0
  437. diffneusim/models/cases/G356-SRC/case.bin +0 -0
  438. diffneusim/models/cases/G356-SRC/case.json +1 -0
  439. diffneusim/models/cases/G416/case.bin +0 -0
  440. diffneusim/models/cases/G416/case.json +1 -0
  441. diffneusim/models/cases/M290C-SRC/case.bin +0 -0
  442. diffneusim/models/cases/M290C-SRC/case.json +1 -0
  443. diffneusim/models/cases/M290R-SRC/case.bin +0 -0
  444. diffneusim/models/cases/M290R-SRC/case.json +1 -0
  445. diffneusim/models/cases/M356C-SRC/case.bin +0 -0
  446. diffneusim/models/cases/M356C-SRC/case.json +1 -0
  447. diffneusim/models/cases/M356R-SRC/case.bin +0 -0
  448. diffneusim/models/cases/M356R-SRC/case.json +1 -0
  449. diffneusim/models/cases/M416C-SRC/case.bin +0 -0
  450. diffneusim/models/cases/M416C-SRC/case.json +1 -0
  451. diffneusim/models/derived/d16_expanded_62f77a4bb16b1e67_mmfloor.xml +673 -0
  452. diffneusim/models/derived/d16_expanded_a1e8b196b2cd7b3c_mmfloor.xml +673 -0
  453. diffneusim/models/derived/d16_soft_law_019e20820f8633b9_mmfloor.json +7844 -0
  454. diffneusim/models/derived/d16_soft_law_62f77a4bb16b1e67_mmfloor.json +16855 -0
  455. diffneusim/models/derived/d16_soft_law_77dbb7213f26e821_mmfloor_rampsb3l_n6t12.json +7883 -0
  456. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rampsb3l_n6t12.json +7883 -0
  457. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsd05_n6t12.json +7868 -0
  458. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsdef_n6t12.json +7868 -0
  459. diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsmjd_n6t12.json +7868 -0
  460. diffneusim/models/derived/d16_soft_law_a1e8b196b2cd7b3c_mmfloor_rampsb3l_n6t12.json +16894 -0
  461. diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor.json +12655 -0
  462. diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor_rampsb3l_n6t12.json +12700 -0
  463. diffneusim/models/derived/unitree_g1_soft_law.json +15580 -0
  464. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +28913 -0
  465. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
  466. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +29202 -0
  467. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
  468. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.dnmodel +1 -0
  469. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
  470. diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
  471. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +46970 -0
  472. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
  473. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
  474. diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
  475. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +38570 -0
  476. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
  477. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +38923 -0
  478. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
  479. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
  480. diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
  481. diffneusim/models/fullbody_meshes/1mc.stl +0 -0
  482. diffneusim/models/fullbody_meshes/2distph.stl +0 -0
  483. diffneusim/models/fullbody_meshes/2mc.stl +0 -0
  484. diffneusim/models/fullbody_meshes/2midph.stl +0 -0
  485. diffneusim/models/fullbody_meshes/2proxph.stl +0 -0
  486. diffneusim/models/fullbody_meshes/3distph.stl +0 -0
  487. diffneusim/models/fullbody_meshes/3mc.stl +0 -0
  488. diffneusim/models/fullbody_meshes/3midph.stl +0 -0
  489. diffneusim/models/fullbody_meshes/3proxph.stl +0 -0
  490. diffneusim/models/fullbody_meshes/4distph.stl +0 -0
  491. diffneusim/models/fullbody_meshes/4mc.stl +0 -0
  492. diffneusim/models/fullbody_meshes/4midph.stl +0 -0
  493. diffneusim/models/fullbody_meshes/4proxph.stl +0 -0
  494. diffneusim/models/fullbody_meshes/5distph.stl +0 -0
  495. diffneusim/models/fullbody_meshes/5mc.stl +0 -0
  496. diffneusim/models/fullbody_meshes/5midph.stl +0 -0
  497. diffneusim/models/fullbody_meshes/5proxph.stl +0 -0
  498. diffneusim/models/fullbody_meshes/NOTICE +2 -0
  499. diffneusim/models/fullbody_meshes/capitate.stl +0 -0
  500. diffneusim/models/fullbody_meshes/clavicle.stl +0 -0
  501. diffneusim/models/fullbody_meshes/hamate.stl +0 -0
  502. diffneusim/models/fullbody_meshes/hat_cervical.stl +0 -0
  503. diffneusim/models/fullbody_meshes/hat_jaw.stl +0 -0
  504. diffneusim/models/fullbody_meshes/hat_skull.stl +0 -0
  505. diffneusim/models/fullbody_meshes/humerus.stl +0 -0
  506. diffneusim/models/fullbody_meshes/l_bofoot.stl +0 -0
  507. diffneusim/models/fullbody_meshes/l_femur.stl +0 -0
  508. diffneusim/models/fullbody_meshes/l_fibula.stl +0 -0
  509. diffneusim/models/fullbody_meshes/l_foot.stl +0 -0
  510. diffneusim/models/fullbody_meshes/l_patella.stl +0 -0
  511. diffneusim/models/fullbody_meshes/l_pelvis.stl +0 -0
  512. diffneusim/models/fullbody_meshes/l_talus.stl +0 -0
  513. diffneusim/models/fullbody_meshes/l_tibia.stl +0 -0
  514. diffneusim/models/fullbody_meshes/lumbar1.stl +0 -0
  515. diffneusim/models/fullbody_meshes/lumbar2.stl +0 -0
  516. diffneusim/models/fullbody_meshes/lumbar3.stl +0 -0
  517. diffneusim/models/fullbody_meshes/lumbar4.stl +0 -0
  518. diffneusim/models/fullbody_meshes/lumbar5.stl +0 -0
  519. diffneusim/models/fullbody_meshes/lunate.stl +0 -0
  520. diffneusim/models/fullbody_meshes/pisiform.stl +0 -0
  521. diffneusim/models/fullbody_meshes/r_bofoot.stl +0 -0
  522. diffneusim/models/fullbody_meshes/r_femur.stl +0 -0
  523. diffneusim/models/fullbody_meshes/r_fibula.stl +0 -0
  524. diffneusim/models/fullbody_meshes/r_foot.stl +0 -0
  525. diffneusim/models/fullbody_meshes/r_patella.stl +0 -0
  526. diffneusim/models/fullbody_meshes/r_pelvis.stl +0 -0
  527. diffneusim/models/fullbody_meshes/r_talus.stl +0 -0
  528. diffneusim/models/fullbody_meshes/r_tibia.stl +0 -0
  529. diffneusim/models/fullbody_meshes/radius.stl +0 -0
  530. diffneusim/models/fullbody_meshes/sacrum.stl +0 -0
  531. diffneusim/models/fullbody_meshes/scaphoid.stl +0 -0
  532. diffneusim/models/fullbody_meshes/scapula.stl +0 -0
  533. diffneusim/models/fullbody_meshes/thoracic10_s.stl +0 -0
  534. diffneusim/models/fullbody_meshes/thoracic11_s.stl +0 -0
  535. diffneusim/models/fullbody_meshes/thoracic12_s.stl +0 -0
  536. diffneusim/models/fullbody_meshes/thoracic1_s.stl +0 -0
  537. diffneusim/models/fullbody_meshes/thoracic2_s.stl +0 -0
  538. diffneusim/models/fullbody_meshes/thoracic3_s.stl +0 -0
  539. diffneusim/models/fullbody_meshes/thoracic4_s.stl +0 -0
  540. diffneusim/models/fullbody_meshes/thoracic5_s.stl +0 -0
  541. diffneusim/models/fullbody_meshes/thoracic6_s.stl +0 -0
  542. diffneusim/models/fullbody_meshes/thoracic7_s.stl +0 -0
  543. diffneusim/models/fullbody_meshes/thoracic8_s.stl +0 -0
  544. diffneusim/models/fullbody_meshes/thoracic9_s.stl +0 -0
  545. diffneusim/models/fullbody_meshes/thorax.stl +0 -0
  546. diffneusim/models/fullbody_meshes/thumbdist.stl +0 -0
  547. diffneusim/models/fullbody_meshes/thumbprox.stl +0 -0
  548. diffneusim/models/fullbody_meshes/trapezium.stl +0 -0
  549. diffneusim/models/fullbody_meshes/trapezoid.stl +0 -0
  550. diffneusim/models/fullbody_meshes/triquetrum.stl +0 -0
  551. diffneusim/models/fullbody_meshes/ulna.stl +0 -0
  552. diffneusim/models/source/myo_fullbody/UPSTREAM.md +91 -0
  553. diffneusim/models/source/myoleg/UPSTREAM.md +52 -0
  554. diffneusim/models/source/unitree_g1/LICENSE.mjlab +202 -0
  555. diffneusim/models/source/unitree_g1/UPSTREAM.md +38 -0
  556. diffneusim/models/source/unitree_g1/assets/head_link.STL +0 -0
  557. diffneusim/models/source/unitree_g1/assets/left_ankle_pitch_link.STL +0 -0
  558. diffneusim/models/source/unitree_g1/assets/left_ankle_roll_link.STL +0 -0
  559. diffneusim/models/source/unitree_g1/assets/left_elbow_link.STL +0 -0
  560. diffneusim/models/source/unitree_g1/assets/left_hip_pitch_link.STL +0 -0
  561. diffneusim/models/source/unitree_g1/assets/left_hip_roll_link.STL +0 -0
  562. diffneusim/models/source/unitree_g1/assets/left_hip_yaw_link.STL +0 -0
  563. diffneusim/models/source/unitree_g1/assets/left_knee_link.STL +0 -0
  564. diffneusim/models/source/unitree_g1/assets/left_rubber_hand.STL +0 -0
  565. diffneusim/models/source/unitree_g1/assets/left_shoulder_pitch_link.STL +0 -0
  566. diffneusim/models/source/unitree_g1/assets/left_shoulder_roll_link.STL +0 -0
  567. diffneusim/models/source/unitree_g1/assets/left_shoulder_yaw_link.STL +0 -0
  568. diffneusim/models/source/unitree_g1/assets/left_wrist_pitch_link.STL +0 -0
  569. diffneusim/models/source/unitree_g1/assets/left_wrist_roll_link.STL +0 -0
  570. diffneusim/models/source/unitree_g1/assets/left_wrist_yaw_link.STL +0 -0
  571. diffneusim/models/source/unitree_g1/assets/logo_link.STL +0 -0
  572. diffneusim/models/source/unitree_g1/assets/pelvis.STL +0 -0
  573. diffneusim/models/source/unitree_g1/assets/pelvis_contour_link.STL +0 -0
  574. diffneusim/models/source/unitree_g1/assets/right_ankle_pitch_link.STL +0 -0
  575. diffneusim/models/source/unitree_g1/assets/right_ankle_roll_link.STL +0 -0
  576. diffneusim/models/source/unitree_g1/assets/right_elbow_link.STL +0 -0
  577. diffneusim/models/source/unitree_g1/assets/right_hip_pitch_link.STL +0 -0
  578. diffneusim/models/source/unitree_g1/assets/right_hip_roll_link.STL +0 -0
  579. diffneusim/models/source/unitree_g1/assets/right_hip_yaw_link.STL +0 -0
  580. diffneusim/models/source/unitree_g1/assets/right_knee_link.STL +0 -0
  581. diffneusim/models/source/unitree_g1/assets/right_rubber_hand.STL +0 -0
  582. diffneusim/models/source/unitree_g1/assets/right_shoulder_pitch_link.STL +0 -0
  583. diffneusim/models/source/unitree_g1/assets/right_shoulder_roll_link.STL +0 -0
  584. diffneusim/models/source/unitree_g1/assets/right_shoulder_yaw_link.STL +0 -0
  585. diffneusim/models/source/unitree_g1/assets/right_wrist_pitch_link.STL +0 -0
  586. diffneusim/models/source/unitree_g1/assets/right_wrist_roll_link.STL +0 -0
  587. diffneusim/models/source/unitree_g1/assets/right_wrist_yaw_link.STL +0 -0
  588. diffneusim/models/source/unitree_g1/assets/torso_link_rev_1_0.STL +0 -0
  589. diffneusim/models/source/unitree_g1/assets/waist_roll_link_rev_1_0.STL +0 -0
  590. diffneusim/models/source/unitree_g1/assets/waist_yaw_link_rev_1_0.STL +0 -0
  591. diffneusim/models/source/unitree_g1/dump_mjlab_reference.py +30 -0
  592. diffneusim/models/source/unitree_g1/g1.xml +308 -0
  593. diffneusim/models/source/unitree_g1/g1_constants.py +298 -0
  594. diffneusim/models/source/unitree_g1/mjlab_compiled_reference.json +857 -0
  595. diffneusim/models/unitree_g1.dnmodel +4393 -0
  596. diffneusim/models/unitree_g1_selfcol.dnmodel +20824 -0
  597. diffneusim/rl/__init__.py +2 -0
  598. diffneusim/rl/dynsyn_layer.py +146 -0
  599. diffneusim/rl/footstep_plan.py +337 -0
  600. diffneusim/rl/g1_bm_env.py +572 -0
  601. diffneusim/rl/g1_bm_eval.py +168 -0
  602. diffneusim/rl/g1_bm_fused.py +275 -0
  603. diffneusim/rl/g1_bm_ppo.py +622 -0
  604. diffneusim/rl/g1_bm_sapo.py +551 -0
  605. diffneusim/rl/g1_ppo.py +395 -0
  606. diffneusim/rl/g1_sapo_soft.py +240 -0
  607. diffneusim/rl/g1_soft_env.py +452 -0
  608. diffneusim/rl/g1_soft_grad.py +145 -0
  609. diffneusim/rl/geyer_curves_torch.py +108 -0
  610. diffneusim/rl/gpu_fullbody_vec_env.py +1241 -0
  611. diffneusim/rl/imitation.py +2027 -0
  612. diffneusim/rl/imitation_reward_v2.py +248 -0
  613. diffneusim/rl/imitation_reward_v3.py +349 -0
  614. diffneusim/rl/latent_task.py +175 -0
  615. diffneusim/rl/llc_reward.py +316 -0
  616. diffneusim/rl/millard_curves_torch.py +154 -0
  617. diffneusim/rl/mirror_symmetry.py +212 -0
  618. diffneusim/rl/model_path.py +35 -0
  619. diffneusim/rl/mvae_recon.py +123 -0
  620. diffneusim/rl/nets_shac.py +599 -0
  621. diffneusim/rl/reset_pool.py +154 -0
  622. diffneusim/rl/sapo_capture.py +873 -0
  623. diffneusim/rl/sapo_vec.py +1051 -0
  624. diffneusim/rl/shac_vec.py +346 -0
  625. diffneusim/rl/state_prior.py +151 -0
  626. diffneusim/rl/step_library.py +105 -0
  627. diffneusim/rl/task_walk_env.py +1793 -0
  628. diffneusim/rl/task_walk_reward.py +3300 -0
  629. diffneusim/run.py +23 -0
  630. diffneusim/run_env.py +46 -0
  631. diffneusim/tasks/__init__.py +147 -0
  632. diffneusim/tasks/legacy_names.py +63 -0
  633. diffneusim/tasks/paths.py +79 -0
  634. diffneusim/tasks/settings.py +202 -0
  635. diffneusim/third_party/instantmimic_947430ee/LICENSE +202 -0
  636. diffneusim/third_party/instantmimic_947430ee/NOTICE +19 -0
  637. diffneusim/third_party/instantmimic_947430ee/README.md +31 -0
  638. diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/benchmark_protocol.py +106 -0
  639. diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/metrics.py +214 -0
  640. diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/reference.py +513 -0
  641. diffneusim/third_party/instantmimic_947430ee/instantmimic/motion/quaternion.py +193 -0
  642. diffneusim/train/__init__.py +0 -0
  643. diffneusim/train/eval_ckpt.py +239 -0
  644. diffneusim/train/eval_mimic.py +133 -0
  645. diffneusim/train/gait_report.py +203 -0
  646. diffneusim/train/gcot_chain.py +51 -0
  647. diffneusim/train/levers.py +135 -0
  648. diffneusim/train/masked_reset.py +314 -0
  649. diffneusim/train/rl_algorithm_suite.py +917 -0
  650. diffneusim/train/train14.py +240 -0
  651. diffneusim/train/train_tw14.py +674 -0
  652. diffneusim/viz/__init__.py +5 -0
  653. diffneusim/viz/__main__.py +41 -0
  654. diffneusim/viz/camera.py +115 -0
  655. diffneusim/viz/dnrec.py +118 -0
  656. diffneusim/viz/dnrec_io.py +686 -0
  657. diffneusim/viz/hud.py +565 -0
  658. diffneusim/viz/meshes.py +458 -0
  659. diffneusim/viz/play.py +237 -0
  660. diffneusim/viz/record.py +74 -0
  661. diffneusim/viz/render.py +1402 -0
  662. diffneusim/viz/renderer.py +268 -0
  663. diffneusim/viz/rl_env_render.py +635 -0
  664. diffneusim/viz/snapshot.py +54 -0
  665. diffneusim/viz/strobe.py +124 -0
  666. diffneusim/viz/to_mp4.py +58 -0
  667. diffneusim/viz/ui.py +481 -0
  668. diffneusim/viz/viewer.py +2086 -0
  669. diffneusim-1.0.0.dist-info/METADATA +226 -0
  670. diffneusim-1.0.0.dist-info/RECORD +682 -0
  671. diffneusim-1.0.0.dist-info/WHEEL +5 -0
  672. diffneusim-1.0.0.dist-info/licenses/LICENSE +201 -0
  673. diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-ARMS-hand-wrist-4.3.txt +20 -0
  674. diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-MoBL-ARMS.txt +25 -0
  675. diffneusim-1.0.0.dist-info/licenses/LICENSES/CC-BY-3.0-OpenSim-geometry.txt +25 -0
  676. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Christophy2012-lumbarspine.txt +10 -0
  677. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lai2017-model-high-flex.txt +10 -0
  678. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lee2015-hand_muscle.txt +11 -0
  679. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Rajagopal2016-full_body.txt +11 -0
  680. diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Uhlrich2022-fbmodpassivecal.txt +10 -0
  681. diffneusim-1.0.0.dist-info/licenses/NOTICE +274 -0
  682. diffneusim-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,239 @@
1
+ """Eval a saved SUITE_SAVE_CKPTS checkpoint and print its gait_report.
2
+
3
+ Rebuilds the env + algo exactly like rl_algorithm_suite, loads the checkpoint's actor + obs_rms,
4
+ runs the deterministic eval rollout (eval_and_record -> a self-contained per-start `.dnrec` record;
5
+ muscle/full-body envs write ONLY .dnrec, no .npz), and prints the foot-filtered gait_report verdict
6
+ (gait_report reads the .dnrec directly). This lets a WALK be detected/timed from any epoch checkpoint
7
+ (the steps-to-walk moat metric, GH #36) without re-running training or waiting for the full run.
8
+
9
+ The env config (control-hz / substeps / imitation ref) is read from the SAME DN_* env vars the
10
+ training run used, so the eval env must be launched with the identical environment. Example:
11
+ DN_IMITATION=1 DN_REF=... DN_CONTROL_HZ=100 DN_SUBSTEPS=5 MTU_ADJ_F32=1 \
12
+ PYTHONPATH=python .venv-gpu/bin/python tools/eval_ckpt.py --env fullbody --algo rpo \
13
+ --ckpt <run>/ckpt/fullbody_rpo_ep0200.pt --out <run>/eval_ep0200.dnrec
14
+ """
15
+ import argparse
16
+ import dataclasses
17
+ import pathlib
18
+ import sys
19
+
20
+ import numpy as np
21
+ import torch
22
+
23
+ from diffneusim._paths import ROOT as ROOT # (3a) the repo root
24
+ # (3a) was: sys.path.insert(0, str(ROOT / "tools"))
25
+ # (3a) was: sys.path.insert(0, str(ROOT / "tools" / "diagnostics"))
26
+
27
+ from diffneusim.train import rl_algorithm_suite as S # noqa: E402
28
+
29
+
30
+ def _stamp_heading_task(env, rec, footsteps=None):
31
+ """A steering eval's record carries its task (dnrec_io.set_task): the env's own heading command (mode, waypoints, radius,
32
+ per-waypoint speeds, schedule) and TASKWALK_TASK_LABEL as the label, so the renderer can draw the live map. No-op without
33
+ TASKWALK_HEADING."""
34
+ if not getattr(env, "_tw_heading_on", False) or not str(rec).endswith(".dnrec"):
35
+ return
36
+ mode = env._tw_hd_mode
37
+ if mode == "random" and footsteps is None: # the random commands are not rebuilt from the record: a map needs the plan
38
+ return
39
+ import math
40
+ if str(ROOT / "tools" / "viz") not in sys.path:
41
+ pass # (3a) was: sys.path.insert(0, str(ROOT / "tools" / "viz"))
42
+ from diffneusim.viz.dnrec_io import set_task
43
+ task = {"mode": mode,
44
+ "v_fixed": float(env.TW_V_FIXED) if env.TW_V_FIXED is not None else None}
45
+ if mode == "target":
46
+ tg = env._tw_hd_targets.detach().cpu().numpy()
47
+ task.update(targets=[[float(tg[0, k]), float(tg[1, k])] for k in range(tg.shape[1])], radius=float(env._tw_hd_target_r))
48
+ if env._tw_hd_speeds is not None:
49
+ task["speeds"] = [float(v) for v in env._tw_hd_speeds.detach().cpu().tolist()]
50
+ elif mode == "schedule":
51
+ ts, ang = env._tw_hd_sched
52
+ task["schedule"] = [[float(t), math.degrees(float(a))] for t, a in zip(ts.tolist(), ang.tolist())]
53
+ if footsteps is not None: # TASKWALK_FOOTSTEPS: the plan per frame, WORLD (p0x, p0y, p1x, p1y, heading, prov, left)
54
+ task["footsteps"] = [[round(v, 4) for v in row] for row in footsteps]
55
+ label = ""
56
+ task["label"] = (f"{len(task['targets'])} waypoints" if mode == "target" else
57
+ "DeepLoco's random footstep plan" if mode == "random" else
58
+ "heading schedule " + ", ".join(f"{d:+.0f} deg at {t:g} s" for t, d in task["schedule"]))
59
+ set_task(rec, task)
60
+
61
+
62
+ def _stamp_latent_task(env, rec):
63
+ """A latent task-phase eval on a command schedule (DN_LATENT_TASK_SCHEDULE) stamps it as the record's task, schedule mode
64
+ with the per-segment speed, so the renderer draws the live map and the readout. No-op otherwise: the random redraw is not
65
+ rebuilt from the record."""
66
+ lt = getattr(env, "latent_task", None)
67
+ if lt is None or lt.schedule is None or not str(rec).endswith(".dnrec"):
68
+ return
69
+ import math
70
+ if str(ROOT / "tools" / "viz") not in sys.path:
71
+ pass # (3a) was: sys.path.insert(0, str(ROOT / "tools" / "viz"))
72
+ from diffneusim.viz.dnrec_io import set_task
73
+ ts, dh, vs = lt.schedule
74
+ sched = [[float(t), math.degrees(float(d)), float(v)] for t, d, v in zip(ts.tolist(), dh.tolist(), vs.tolist())]
75
+ set_task(rec, {"mode": "schedule", "schedule": sched, "v_fixed": None,
76
+ "label": "heading / speed schedule " + ", ".join(f"{d:+.0f} deg {v:g} m/s at {t:g} s" for t, d, v in sched)})
77
+
78
+
79
+ def main():
80
+ from diffneusim.tasks.paths import announce
81
+ announce("eval_ckpt")
82
+ ap = argparse.ArgumentParser()
83
+ ap.add_argument("--env", required=True)
84
+ ap.add_argument("--algo", required=True, choices=("shac", "ppo", "rpo", "sapo"))
85
+ ap.add_argument("--ckpt", required=True)
86
+ ap.add_argument("--out", dest="out", required=True,
87
+ help="output .dnrec base path (per-start files get a _start{i} suffix)")
88
+ ap.add_argument("--seed", type=int, default=1)
89
+ ap.add_argument("--batch", action="store_true",
90
+ help="evaluate all --n-starts at once in one n_env=N env (eval_and_record_batch): ~N x faster, "
91
+ "but the starts differ from the sequential eval's -- compare batched with batched")
92
+ ap.add_argument("--n-starts", type=int, default=5,
93
+ help="number of DIFFERENT start poses (RSI reference phases) to eval; a single start "
94
+ "is one anecdote and hides the trend. Policy is deterministic (unless --stochastic); only the START varies.")
95
+ ap.add_argument("--stop-after-survivors", type=int, default=0, metavar="N",
96
+ help="stop once N starts reach the full episode (0 = off, run all --n-starts). A "
97
+ "FALLING start costs almost nothing -- it dies in ~50 of 1000 steps -- so the "
98
+ "whole cost of an eval is its SURVIVORS, and N=1 is ~6x faster at 6/8 survival. "
99
+ "Use it for a CURVE-SHAPE sweep, never for a scored cell: the survival fraction "
100
+ "it reports is a stopping rule, not a measurement, and score.py GATES on "
101
+ "survival >= 4/8. What it is safe for is the cycle statistics -- one 1000-step "
102
+ "rollout yields ~19 strides over the two legs, and this line's own seed study "
103
+ "found the stance knee spreads 0.3-2.5 deg across replicates while SURVIVAL "
104
+ "spreads 9/32 on an identical config. The stable quantity survives n=1; the "
105
+ "unstable one is exactly what this flag throws away.")
106
+ ap.add_argument("--stochastic", action="store_true",
107
+ help="record the TRAINING policy (sampled actions) instead of the deterministic mean. SAPO "
108
+ "optimises the sampled policy, and its mean controller can walk a different gait; "
109
+ "compare stochastic with stochastic, never with a deterministic sweep row.")
110
+ ap.add_argument("--latent-mode", choices=("tracking", "generation"), default=None,
111
+ help="latent skill model checkpoints only (DN_LATENT=1, as in training): 'tracking' runs the "
112
+ "decoder on z = the posterior mean given the next reference frame, 'generation' on z sampled "
113
+ "from the state prior p(z | s) at every step, with no reference read. Required for such a "
114
+ "checkpoint, refused for any other.")
115
+ ap.add_argument("--kl-trace", action="store_true",
116
+ help="with --latent-mode tracking (sequential starts only): per control step, the KL of the posterior "
117
+ "mean against the prior mean, |mu_q|^2 / (2 sigma^2), written to <record>_kl.txt and summarised "
118
+ "per start (mean, first 1 s, last 5 s): how far the prior's z sits from the one the reference asks for.")
119
+ ap.add_argument("--dnmodel", default=None,
120
+ help="dnmodel for gait_report FK; default = the env's ACTUAL trained model (env.model), "
121
+ "so the foot-FK matches the nq/nv of the rollout. The old hardcoded nq115 "
122
+ "fullbody_contact.dnmodel default silently mis-measured (or crashed on) the nq60 "
123
+ "fused-hand rollout, and myoleg26 too.")
124
+ a = ap.parse_args()
125
+
126
+ assert torch.cuda.is_available()
127
+ if a.stochastic:
128
+ # a fallen env's state can go non-finite before its done is read, and Normal()'s argument check would
129
+ # then raise on the whole batch (as in taskwalk_term_rollout.py); that env is out of every record
130
+ torch.distributions.Distribution.set_default_validate_args(False)
131
+ cfg = S.DEFAULT_CONFIGS[a.env]
132
+ # Multi-start eval: DETERMINISTIC policy, STOCHASTIC start (RSI reference phase + pose noise). make_env
133
+ # builds cfg.n_env envs when stochastic_init=True, so pin n_env=1 and re-reset once per start (each
134
+ # env.reset() draws a fresh RSI phase from the env RNG) -> N independent rollouts, eval_and_record
135
+ # unchanged. n_starts=1 with stochastic_init reproduces a single random-start rollout (NOT the old
136
+ # phase-0 deterministic start -- that hid the trend, which is exactly what we are fixing).
137
+ cfg = dataclasses.replace(cfg, n_env=a.n_starts if a.batch else 1)
138
+ env = S.make_env(a.env, cfg, a.seed + 12345, stochastic_init=True)
139
+ algo = S.make_algo(a.algo, env, cfg, a.seed)
140
+ ck = torch.load(a.ckpt, map_location="cuda")
141
+ assert ("latent_task" in ck) == bool(getattr(algo, "ltask", False)), (
142
+ "a latent task-phase checkpoint needs DN_LATENT_TASK=1 (and its DN_LATENT_TASK_CKPT) in the eval "
143
+ "environment, as in training, and that environment evaluates only such a checkpoint")
144
+ algo.actor.load_state_dict(ck["actor"])
145
+ _r = ck["obs_rms"]; algo.obs_rms.mean, algo.obs_rms.var, algo.obs_rms.count = _r["mean"], _r["var"], _r["count"]
146
+ if getattr(algo, "ltask", False):
147
+ # commands: random per DN_LATENT_TASK_CMD_PERIOD, or DN_LATENT_TASK_SCHEDULE; the battery with heading
148
+ # and speed errors is tools/latent_task_eval.py
149
+ assert a.latent_mode is None, "--latent-mode is a latent-model (P2) option; the task phase is driven by commands"
150
+ algo.load_latent_task_state(ck)
151
+ print(f"[eval] latent task phase (frozen model from {algo.ltask_cfg['source']})", flush=True)
152
+ elif getattr(algo, "latent", None) is not None:
153
+ assert a.latent_mode is not None, "a latent skill model checkpoint needs --latent-mode tracking|generation"
154
+ algo.load_latent_state(ck)
155
+ algo.latent_eval_mode = a.latent_mode
156
+ print(f"[eval] latent skill model, {a.latent_mode} mode (z dim {algo.latent_cfg['dim']})", flush=True)
157
+ assert not a.kl_trace or (a.latent_mode == "tracking" and not a.batch), \
158
+ "--kl-trace needs --latent-mode tracking and sequential starts"
159
+ else:
160
+ assert a.latent_mode is None and "latent" not in ck, (
161
+ "--latent-mode / a latent checkpoint need DN_LATENT=1 in the eval environment, as in training")
162
+ print(f"loaded {a.ckpt} epoch={ck.get('epoch')} step_count={ck.get('step_count')}", flush=True)
163
+
164
+ out = pathlib.Path(a.out)
165
+ if out.suffix not in (".dnrec", ".npz"):
166
+ out = out.with_suffix(".dnrec")
167
+ per_start = []
168
+ n_surv = 0
169
+ if a.batch:
170
+ assert not a.stop_after_survivors, "--stop-after-survivors is a sequential-eval option"
171
+ outs = [out.with_name(f"{out.stem}_start{i}.dnrec") for i in range(a.n_starts)]
172
+ for i, m in enumerate(S.eval_and_record_batch(a.env, env, algo, outs, deterministic=not a.stochastic)):
173
+ per_start.append((i, m, m["rollout_dnrec"]))
174
+ _stamp_heading_task(env, m["rollout_dnrec"], m.get("footsteps"))
175
+ _stamp_latent_task(env, m["rollout_dnrec"])
176
+ print(f" start {i}: steps={m['eval_steps']:4d} fwd={m['eval_fwd']:+.3f} "
177
+ f"ret={m['eval_return']:8.3f} height_mean={m['eval_height_mean']:.3f} -> "
178
+ f"{pathlib.Path(m['rollout_dnrec']).name} [batched]", flush=True)
179
+ for i in (range(0) if a.batch else range(a.n_starts)):
180
+ out_i = out.with_name(f"{out.stem}_start{i}.dnrec") # canonical self-contained record (no npz)
181
+ # COMMANDED HEIGHT, when it is in use. The env redraws it at each reset and records it nowhere else,
182
+ # so without this line an eval row from a height-commanded cell cannot be interpreted at all -- the
183
+ # per-start posture is a response to a target that was invisible. Read BEFORE the rollout because a
184
+ # rollout that dies auto-resets and redraws it.
185
+ _tw = getattr(env, "taskwalk", None)
186
+ _ht = getattr(_tw, "h_tgt", None) if _tw is not None else None
187
+ _h0 = float(_ht[0]) if _ht is not None else None
188
+ if a.kl_trace:
189
+ algo.latent_kl_trace = []
190
+ m = S.eval_and_record(a.env, env, algo, out_i, deterministic=not a.stochastic)
191
+ if a.kl_trace:
192
+ kl = torch.stack(algo.latent_kl_trace)[:, 0].cpu().numpy() # n_env 1 in the sequential eval
193
+ algo.latent_kl_trace = None
194
+ np.savetxt(out_i.with_name(f"{out_i.stem}_kl.txt"), kl, fmt="%.4f")
195
+ k1 = int(round(env.control_hz)) # control steps per second
196
+ print(f" start {i}: KL(posterior mean || prior mean) per step: mean {kl.mean():.2f} first 1 s "
197
+ f"{kl[:k1].mean():.2f} last 5 s {kl[-5 * k1:].mean():.2f} ({len(kl)} steps)", flush=True)
198
+ if _h0 is not None:
199
+ m["h_tgt"] = _h0
200
+ rec = m["rollout_dnrec"]
201
+ _stamp_heading_task(env, rec, m.get("footsteps"))
202
+ _stamp_latent_task(env, rec)
203
+ per_start.append((i, m, rec))
204
+ if _h0 is not None:
205
+ print(f" start {i}: COMMANDED HEIGHT h_tgt={_h0:.4f}", flush=True)
206
+ if "start_clip" in m:
207
+ print(f" start {i}: CLIP {m['start_clip']} phase0={m['start_phase']:.4f}", flush=True)
208
+ print(f" start {i}: steps={m['eval_steps']:4d} fwd={m['eval_fwd']:+.3f} "
209
+ f"ret={m['eval_return']:8.3f} height_mean={m['eval_height_mean']:.3f} -> {pathlib.Path(rec).name}",
210
+ flush=True)
211
+ if m["eval_steps"] >= cfg.episode_length:
212
+ n_surv += 1
213
+ if a.stop_after_survivors and n_surv >= a.stop_after_survivors:
214
+ print(f" EARLY STOP: {n_surv} survivor(s) after {i + 1} of {a.n_starts} starts "
215
+ f"(--stop-after-survivors {a.stop_after_survivors}). The SURVIVAL FRACTION from this "
216
+ f"run is not comparable to a full-N run; the cycle statistics are.", flush=True)
217
+ break
218
+
219
+ steps = np.array([m["eval_steps"] for _, m, _ in per_start], dtype=float)
220
+ fwd = np.array([m["eval_fwd"] for _, m, _ in per_start], dtype=float)
221
+ print(f"=== TREND over {len(per_start)} of {a.n_starts} starts ===", flush=True)
222
+ print(f" eval_steps: mean={steps.mean():.1f} std={steps.std():.1f} min={steps.min():.0f} "
223
+ f"max={steps.max():.0f} all={steps.astype(int).tolist()}", flush=True)
224
+ print(f" eval_fwd(m): mean={fwd.mean():+.3f} std={fwd.std():.3f} min={fwd.min():+.3f} "
225
+ f"max={fwd.max():+.3f} all={[round(float(x),3) for x in fwd]}", flush=True)
226
+
227
+ from diffneusim.train import gait_report as G
228
+ # Default the gait_report dnmodel to the env's ACTUAL model so foot-FK matches the rollout's nq/nv
229
+ # (env.model respects FULLBODY_DNMODEL / the muscle-env model). Explicit --dnmodel still overrides.
230
+ dnmodel_path = a.dnmodel or getattr(env, "model", None) or str(ROOT / "models" / "fullbody_contact.dnmodel")
231
+ print(f"gait_report dnmodel: {dnmodel_path}", flush=True)
232
+ jm = G.load_dnmodel(dnmodel_path)
233
+ for i, _, rec in per_start:
234
+ print(f"--- gait_report start {i} ---", flush=True)
235
+ G.report(jm, str(rec)) # load_record reads the .dnrec directly
236
+
237
+
238
+ if __name__ == "__main__":
239
+ main()
@@ -0,0 +1,133 @@
1
+ """E0 evaluation in MuscleMimic's protocol: every clip of a list played ONCE from its FIRST frame, deterministic policy.
2
+
3
+ This is how muscle-supermimic scores its held-out KIT clips (ms-eval) and SuperMimic's App. F.1 protocol: one env per
4
+ clip, the clip's frame 0 as the start (no RSI draw, no reset noise), the policy's mean action, until the clip ends or
5
+ MuscleMimic's deviation termination fires (DN_IM_MIMIC's mimic_failed: mean site deviation > 1 m, root position
6
+ > 1 m, root orientation > 1 rad). A physical end of the episode before the clip's end (fall gate, divergence) also
7
+ counts as a failure. Reported per clip and overall:
8
+ * normalized return = sum of MimicReward over the clip / ((clip length - 1) * max step reward); a clip that fails
9
+ keeps what it earned before, so failures score low (muscle-supermimic's norm_return);
10
+ * the frame-weighted version (sum over clips / sum of their maxima) and the number of failed clips;
11
+ * MuscleMimic's own tracking errors over the frames each clip survived: the mean site deviation (cm, the
12
+ termination's measure) and the mean absolute joint angle error (deg, every hinge coordinate).
13
+
14
+ The env is built from the same DN_* / FULLBODY_* variables as training, with DN_REF set to the evaluated list.
15
+ Example (neu):
16
+ DN_IM_MIMIC=1 DN_REF=<test list .txt> ... .venv-gpu/bin/python tools/eval_mimic.py --algo sapo \
17
+ --ckpt <run>/ckpt/fullbody_sapo_ep1000.pt --out <run>/eval_mimic_ep1000.json
18
+ """
19
+ import argparse
20
+ import dataclasses
21
+ import json
22
+ import os
23
+ import pathlib
24
+ import time
25
+
26
+ import torch
27
+
28
+ # (3a) was: sys.path.insert(0, str(ROOT / "tools"))
29
+ # (3a) was: sys.path.insert(0, str(ROOT / "tools" / "diagnostics"))
30
+
31
+ from diffneusim.train import rl_algorithm_suite as S # noqa: E402
32
+
33
+
34
+ def first_frames(task):
35
+ """An rsi() that starts env i on clip i at its first frame, exactly on the reference (no noise, no RNG draw).
36
+
37
+ The env autoresets an env whose episode ended; that env is no longer scored (main() stops counting it at its end),
38
+ so a SUBSET reset just gets clip 0's first frame."""
39
+ def rsi(n, rng, stochastic):
40
+ cid = (torch.arange(n, device=task.device) if n == task.n_clips
41
+ else torch.zeros(n, dtype=torch.long, device=task.device))
42
+ phi = torch.zeros(n, device=task.device)
43
+ prev, task.clip_id = task.clip_id, cid
44
+ try:
45
+ q0, qd0 = task.ref_at(phi)
46
+ finally:
47
+ task.clip_id = prev
48
+ return q0, qd0, phi, cid
49
+ return rsi
50
+
51
+
52
+ def main():
53
+ from diffneusim.tasks.paths import announce
54
+ announce("eval_mimic")
55
+ ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
56
+ ap.add_argument("--algo", required=True, choices=("shac", "sapo", "rpo"))
57
+ ap.add_argument("--ckpt", required=True)
58
+ ap.add_argument("--out", required=True, help="JSON with the per-clip and overall numbers")
59
+ ap.add_argument("--seed", type=int, default=1)
60
+ a = ap.parse_args()
61
+ assert torch.cuda.is_available()
62
+ assert os.environ.get("DN_IM_MIMIC") == "1", "eval_mimic scores MuscleMimic's MDP: set DN_IM_MIMIC=1"
63
+ os.environ["DN_EPISODE"] = os.environ.get("DN_EPISODE", "30000") # MuscleMimic's horizon; clips end first
64
+ os.environ["DN_RSI_NO_NOISE"] = "1"
65
+ paths = [ln.strip() for ln in pathlib.Path(os.environ["DN_REF"]).read_text().splitlines()
66
+ if ln.strip() and not ln.startswith("#")]
67
+ n = len(paths)
68
+ cfg = dataclasses.replace(S.DEFAULT_CONFIGS["fullbody"], n_env=n, episode_length=int(os.environ["DN_EPISODE"]))
69
+ # make_env builds ONE env when stochastic_init is False; build cfg.n_env (one per clip), then switch the start-state
70
+ # noise off before the reset below (first_frames draws nothing either)
71
+ env = S.make_env("fullbody", cfg, a.seed + 12345, stochastic_init=True)
72
+ env.stochastic_init = False
73
+ task = env.imitation_task
74
+ assert task.IM_MIMIC and task.n_clips == n, (task.IM_MIMIC, task.n_clips, n)
75
+ algo = S.make_algo(a.algo, env, cfg, a.seed)
76
+ ck = torch.load(a.ckpt, map_location="cuda")
77
+ algo.actor.load_state_dict(ck["actor"])
78
+ _r = ck["obs_rms"]
79
+ algo.obs_rms.mean, algo.obs_rms.var, algo.obs_rms.count = _r["mean"], _r["var"], _r["count"]
80
+ print(f"[eval_mimic] {a.ckpt} epoch={ck.get('epoch')} on {n} clips", flush=True)
81
+
82
+ task.rsi = first_frames(task)
83
+ obs = env.reset()
84
+ env.eval_mode = True # the env's own desync ET stays off; mimic_failed() is read below
85
+ dev = env.device
86
+ T = task.clip_T.to(dev)
87
+ alive = torch.ones(n, dtype=torch.bool, device=dev)
88
+ failed = torch.zeros(n, dtype=torch.bool, device=dev)
89
+ ret = torch.zeros(n, device=dev)
90
+ steps = torch.zeros(n, dtype=torch.long, device=dev)
91
+ site_dev = torch.zeros(n, device=dev)
92
+ joint_err = torch.zeros(n, device=dev)
93
+ hinge = task._mm_q_scalar[task._mm_q_scalar >= 7] # every scalar coordinate except the free root's position
94
+ t0 = time.time()
95
+ with torch.no_grad():
96
+ for _ in range(int(T.max())):
97
+ if not bool(alive.any()):
98
+ break
99
+ action = torch.tanh(S.policy_action(env, algo, obs, True))
100
+ obs, rew, done, extra = env.step(action)
101
+ fail_now = task.mimic_failed() & alive
102
+ q_ref, _ = task.ref_at(env.phase)
103
+ ok = alive & ~fail_now
104
+ ret = ret + torch.where(ok, rew, torch.zeros_like(rew))
105
+ site_dev = site_dev + torch.where(ok, task._mm_last[0], torch.zeros_like(rew))
106
+ joint_err = joint_err + torch.where(ok, (env.q[hinge] - q_ref[hinge]).abs().mean(0), torch.zeros_like(rew))
107
+ steps = steps + ok.long()
108
+ clip_done = extra["term_clip_end"]
109
+ phys_end = done & ~clip_done & ~fail_now # fall gate / divergence before the clip's end
110
+ failed = failed | fail_now | (phys_end & alive)
111
+ alive = alive & ~fail_now & ~done
112
+ norm = ret / ((T - 1).float() * task.mm_max_step_reward)
113
+ per = {}
114
+ for i, p in enumerate(paths):
115
+ k = max(int(steps[i]), 1)
116
+ per[pathlib.Path(p).stem] = dict(norm_return=round(float(norm[i]), 4), failed=bool(failed[i]), steps=int(steps[i]),
117
+ frames=int(T[i]), site_dev_cm=round(100.0 * float(site_dev[i]) / k, 2),
118
+ joint_err_deg=round(float(torch.rad2deg(joint_err[i])) / k, 2))
119
+ s = steps.clamp(min=1).float()
120
+ res = dict(ckpt=a.ckpt, epoch=ck.get("epoch"), step_count=ck.get("step_count"), n_clips=n,
121
+ norm_return=float(norm.mean()),
122
+ norm_return_framew=float(ret.sum() / ((T - 1).sum().float() * task.mm_max_step_reward)),
123
+ n_failed=int(failed.sum()), failed=[pathlib.Path(paths[i]).stem for i in failed.nonzero().flatten().tolist()],
124
+ site_dev_cm=float((100.0 * site_dev / s).mean()), joint_err_deg=float(torch.rad2deg(joint_err / s).mean()),
125
+ seconds=time.time() - t0, per_clip=per)
126
+ pathlib.Path(a.out).write_text(json.dumps(res, indent=1))
127
+ print(f"[eval_mimic] norm return {res['norm_return']:.4f} (frame-weighted {res['norm_return_framew']:.4f}), "
128
+ f"failed {res['n_failed']}/{n}, site dev {res['site_dev_cm']:.2f} cm, joint err {res['joint_err_deg']:.2f} deg, "
129
+ f"{res['seconds']:.0f} s", flush=True)
130
+
131
+
132
+ if __name__ == "__main__":
133
+ main()
@@ -0,0 +1,203 @@
1
+ """Comprehensive gait report from a trained-policy eval .npz — judges REAL walking vs a
2
+ reward-hack (double-support topple / hop / shuffle / passive lunge). Never trust return alone.
3
+
4
+ Foot-filtered contact-cycle: some dnmodels split one foot across calcn/toes contact bodies and
5
+ also include non-foot spheres (pelvis/torso), so known foot body sets are aggregated first.
6
+ Reports codex-locked gates: survival, per-foot lift clearance (does a foot ever swing?), root-height
7
+ fall (topple), single/double support, L/R alternation, cadence, duty, muscle-activation RMS/mean
8
+ (passive-lunge check).
9
+
10
+ Run: python tools/diagnostics/gait_report.py <model.dnmodel> <eval.npz> [<eval.npz> ...]
11
+ """
12
+ import json
13
+ import os
14
+ import pathlib
15
+ import re
16
+ import sys
17
+
18
+ import numpy as np
19
+
20
+ # (3a) was: sys.path.insert(0, str(ROOT / "tools" / "viz"))
21
+ from diffneusim.viz.dnrec_io import fk_poses, load_record, quat_rotate # noqa: E402
22
+
23
+ STANCE_EPS = 0.02 # foot bottom within 2 cm of ground z=0 = stance
24
+ LIFT_EPS = 0.03 # foot bottom above 3 cm = airborne/swing
25
+
26
+
27
+ def load_dnmodel(p):
28
+ return json.loads(re.sub(r"^\s*//.*$", "", pathlib.Path(p).read_text(), flags=re.MULTILINE))
29
+
30
+
31
+ def _foot_groups(geoms):
32
+ bodies = {int(g["body"]) for g in geoms}
33
+ if {4, 5, 9, 10}.issubset(bodies):
34
+ return [("R", (4, 5)), ("L", (9, 10))]
35
+ if {137, 138, 151, 152}.issubset(bodies):
36
+ return [("R", (137, 138)), ("L", (151, 152))]
37
+ return [(b, (b,)) for b in sorted(bodies)]
38
+
39
+
40
+ def _free_base_axes(jm):
41
+ """(fwd, height, lat) indices into the free-base translation q[0:3], from the root body's rest quat.
42
+
43
+ A free joint's translation lives in the root's joint frame, so which slot is world up is the root `quat`'s
44
+ business. It used to be keyed off a foot-body signature -- full body (0, 2, 1), everything else (0, 1, 2) --
45
+ which was already wrong for the z-up H-series and became wrong for myoLeg26 when its root went z-up
46
+ (tools/reframe_zup.py, 2026-09-23). Returns the slot whose world image is most nearly +z / +x.
47
+ """
48
+ root = next(b for b in jm["bodies"] if b.get("joint") == "free")
49
+ w, x, y, z = (float(v) for v in root.get("quat", [1.0, 0.0, 0.0, 0.0]))
50
+ R = np.array([[1 - 2 * (y * y + z * z), 2 * (x * y - w * z), 2 * (x * z + w * y)],
51
+ [2 * (x * y + w * z), 1 - 2 * (x * x + z * z), 2 * (y * z - w * x)],
52
+ [2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y)]])
53
+ up, fwd = int(np.argmax(R[2])), int(np.argmax(R[0]))
54
+ assert R[2, up] > 0.9 and R[0, fwd] > 0.9 and up != fwd, R
55
+ return fwd, up, ({0, 1, 2} - {up, fwd}).pop()
56
+
57
+
58
+ def foot_bottom_z_and_y(jm, q):
59
+ """per logical foot: bottom z(t) (min over spheres of world center z - radius) + mean world-y."""
60
+ geoms = jm["contact"]["geoms"]
61
+ groups = _foot_groups(geoms)
62
+ labels = [label for label, _bodies in groups]
63
+ by_label = {
64
+ label: [g for g in geoms if int(g["body"]) in bodies]
65
+ for label, bodies in groups
66
+ }
67
+ T = len(q)
68
+ z = {label: np.zeros(T) for label in labels}
69
+ y = {label: 0.0 for label in labels}
70
+ vec = os.environ.get("DN_DNREC_VEC", "0")
71
+ assert vec in ("0", "1"), f"DN_DNREC_VEC={vec!r} must be exactly '0' or '1'"
72
+ if vec == "1":
73
+ # every frame at once (rl_env_render.fk_poses_rows / _qrot_rows: fk_poses / quat_rotate over rows, bitwise; the gate is
74
+ # tools/launch/mtu_vec_gate.py); the spheres in the same order, the minimum and the frame-0 y sum as the loop below
75
+ # (3a) was: sys.path.insert(0, str(ROOT / "tools"))
76
+ from diffneusim.viz.rl_env_render import _qrot_rows, fk_poses_rows
77
+ P = fk_poses_rows(jm, np.asarray(q).astype(np.float64))
78
+ for label in labels:
79
+ zmin = np.full(T, 1e9)
80
+ ysum = 0.0
81
+ for g in by_label[label]:
82
+ b = int(g["body"])
83
+ c = np.asarray(g["center"], float); r = float(g["radius"])
84
+ wp = P[:, b, :3] + _qrot_rows(P[:, b, 3:7], c)
85
+ zmin = np.minimum(zmin, wp[:, 2] - r)
86
+ ysum += wp[0, 1]
87
+ y[label] = ysum / len(by_label[label])
88
+ z[label][:] = zmin
89
+ return labels, z, y
90
+ for t in range(T):
91
+ P = fk_poses(jm, q[t].astype(np.float64))
92
+ for label in labels:
93
+ zmin = 1e9
94
+ ysum = 0.0
95
+ for g in by_label[label]:
96
+ b = int(g["body"])
97
+ c = np.asarray(g["center"], float); r = float(g["radius"])
98
+ wp = P[b, :3] + quat_rotate(P[b, 3:7], c)
99
+ zmin = min(zmin, wp[2] - r)
100
+ ysum += wp[1]
101
+ if t == 0:
102
+ y[label] = ysum / len(by_label[label])
103
+ z[label][t] = zmin
104
+ return labels, z, y
105
+
106
+
107
+ def report(jm, npz_path):
108
+ d = load_record(npz_path) # reads a v2 .dnrec OR a legacy .npz (dnrec-format.md P2)
109
+ q = d["q"]; T = len(q)
110
+ dt = float(d["dt"]) if "dt" in d else 1.0 / 60.0
111
+ FWD, UP, LAT = _free_base_axes(jm) # model-aware free-base translation indices
112
+ bodies, fz, y0 = foot_bottom_z_and_y(jm, q)
113
+ # Fallback foot-filter: if the model did not match a known foot grouping, keep the two lowest
114
+ # contact bodies and drop body-proxy contacts such as pelvis/torso.
115
+ feet = bodies if len(bodies) == 2 else sorted(bodies, key=lambda b: float(fz[b].mean()))[:2]
116
+ feet.sort(key=lambda b: y0[b]) # order by lateral y -> [right(-), left(+)]
117
+ fA, fB = feet
118
+ A = fz[fA] < STANCE_EPS; B = fz[fB] < STANCE_EPS # per-foot stance
119
+ single = float(np.mean(A ^ B)); double = float(np.mean(A & B)); flight = float(np.mean(~A & ~B))
120
+ tdA = int(np.sum((~A[:-1]) & A[1:])); tdB = int(np.sum((~B[:-1]) & B[1:])) # touchdowns
121
+ dur = max(T * dt, 1e-9)
122
+ cadence = (tdA + tdB) / dur / 2.0 # per-foot steps/s
123
+ duty = float((A.mean() + B.mean()) / 2.0)
124
+ # alternation: cross-correlation of the two feet stance at HALF-GAIT-CYCLE lag; +1 = perfect
125
+ # alternation. BUGFIX: the lag must be in FRAMES. The old code used 0.5*dur/n_steps (= seconds) as
126
+ # a frame index (missing /dt), collapsing to lag=1 (~zero lag) where a properly alternating walk is
127
+ # ANTI-correlated (~-0.6) and always failed the >0.5 gate. Reported only (the alternation GATE is now
128
+ # the robust multi-cycle touchdown + single/double-support battery below; cross-corr is gameable by a
129
+ # near-constant "shuffle").
130
+ Ac, Bc = A.astype(float) - A.mean(), B.astype(float) - B.mean()
131
+ denom = np.sqrt(np.sum(Ac ** 2) * np.sum(Bc ** 2)) + 1e-9
132
+ cyc_frames = (dur / max((tdA + tdB) / 2.0, 1)) / dt # per-foot gait-cycle, in frames
133
+ lag = max(1, int(round(0.5 * cyc_frames))) # half-cycle: the feet are anti-phase
134
+ altern = float(np.sum(Ac[:-lag] * Bc[lag:]) / denom) if T > lag else 0.0
135
+ clear = {b: float(fz[b].max()) for b in feet}
136
+ air = {b: float(np.mean(fz[b] > LIFT_EPS)) for b in feet}
137
+ lifts = any(air[b] > 0.02 for b in feet)
138
+ h = q[:, UP]
139
+ root = dict(h0=float(h[0]), hend=float(h[-1]), hmin=float(h.min()), hosc=float(h.std()))
140
+ root_dist = float(q[-1, FWD] - q[0, FWD])
141
+ stride = root_dist / max((tdA + tdB) / 2.0, 1)
142
+ act = None
143
+ if "activation" in d:
144
+ a = np.asarray(d["activation"], float)
145
+ if a.ndim == 2 and a.shape[0] != T and a.shape[1] == T:
146
+ a = a.T
147
+ act = dict(mean=float(a.mean()), rms=float(np.sqrt((a ** 2).mean())),
148
+ p95=float(np.percentile(a, 95)), frac_gt01=float(np.mean(a > 0.1)))
149
+ # top muscles by mean activation, named (dnmodel muscles carry anatomical "name" after
150
+ # inject_fullbody_names / export_myoleg*); reveals WHICH muscles the policy leans on.
151
+ muscles = jm.get("muscles", [])
152
+ if len(muscles) == a.shape[1]:
153
+ mean_a = a.mean(0)
154
+ top = np.argsort(-mean_a)[:8]
155
+ act["top"] = [(muscles[i].get("name", f"m{i}"), float(mean_a[i])) for i in top]
156
+ # Forward progress + straightness: the earlier battery had NO translation gate (skeptic), so an
157
+ # in-place march or a lateral sway passed every gate. root_dist and the horizontal path are already
158
+ # available; gate mean forward speed in a walking band and net/path straightness -> rejects marching,
159
+ # swaying, and circling.
160
+ fwd_speed = root_dist / dur # mean world-x speed [m/s]
161
+ xy = np.stack([q[:, FWD], q[:, LAT]], axis=1) # forward + lateral; horizontal (ground-plane) path
162
+ path_len = float(np.sum(np.linalg.norm(np.diff(xy, axis=0), axis=1)))
163
+ straightness = float(np.linalg.norm(xy[-1] - xy[0]) / max(path_len, 1e-6))
164
+ dutyA = float(A.mean()); dutyB = float(B.mean()) # PER-foot duty (averaging hid an asymmetric limp)
165
+ # Walk gates (Phase J hardening; skeptic-reviewed). NOTE: stance is a KINEMATIC contact proxy
166
+ # (foot-bottom-z < STANCE_EPS); a force-based (GRF>0) stance for the in-sim trained eval is a TODO
167
+ # (eval_ckpt must dump per-foot contact force). Alternation is enforced by the ROBUST battery
168
+ # (forward progress + straightness + multi-cycle touchdowns + per-foot single/double/duty + L/R
169
+ # symmetry), NOT the gameable cross-correlation. Every gate is grounded in human gait biomechanics
170
+ # AND rejects a specific reward-hack (METHODS.md §3; verified vs synth hop/shuffle/stand/run/limp/march).
171
+ gates = {
172
+ "survives": T >= int(0.98 * 300),
173
+ "forward_speed0.5-2.0": 0.5 <= fwd_speed <= 2.0, # real translation (rejects march-in-place)
174
+ "straight_path>0.8": straightness > 0.8, # net/path (rejects sway / circling)
175
+ "both_feet_step>=3": (tdA >= 3) and (tdB >= 3), # multi-cycle, BOTH feet (rejects hop-on-one-foot/topple)
176
+ "single_supp>0.5": single > 0.5, # human walking ~0.6-0.8 single-support
177
+ "double_supp0.1-0.3": 0.1 <= double <= 0.3, # ~0.2 textbook (0 = run, high = shuffle/stand)
178
+ "flight<0.05": flight < 0.05, # a walk has ~no flight phase
179
+ "duty_per_foot0.5-0.75": (0.5 <= dutyA <= 0.75) and (0.5 <= dutyB <= 0.75), # per-limb duty factor (walk>0.5)
180
+ "symmetric": (abs(dutyA - dutyB) < 0.12) and (abs(tdA - tdB) <= 1), # rejects asymmetric limp
181
+ "cadence0.7-1.2": 0.7 <= cadence <= 1.2, # per-foot steps/s = 84-144 spm (human walking)
182
+ "foot_lifts": lifts,
183
+ }
184
+ walk = all(gates.values())
185
+ print(f"\n=== {pathlib.Path(npz_path).name} (T={T}, {dur:.2f}s, feet={feet}) ===")
186
+ print(f" cycle: cadence={cadence:.2f}Hz stride={stride:.2f}m duty={dutyA:.2f}/{dutyB:.2f} "
187
+ f"1supp={single:.2f} 2supp={double:.2f} flight={flight:.2f} ALTERN={altern:+.2f}")
188
+ print(f" lift: " + " ".join(f"foot{b}: clear={clear[b]*100:+.1f}cm air={air[b]*100:.0f}%" for b in feet))
189
+ print(f" root: h0={root['h0']:.3f} hend={root['hend']:.3f} dist={root_dist:.2f}m "
190
+ f"fwd={fwd_speed:.2f}m/s straight={straightness:.2f} osc={root['hosc']:.3f}")
191
+ if act:
192
+ print(f" act: mean={act['mean']:.3f} rms={act['rms']:.3f} p95={act['p95']:.3f} frac>0.1={act['frac_gt01']:.2f}")
193
+ if act.get("top"):
194
+ print(f" top-act: " + " ".join(f"{nm}={v:.2f}" for nm, v in act["top"]))
195
+ print(f" GATES: " + " ".join(f"{k}={'Y' if v else 'n'}" for k, v in gates.items()))
196
+ print(f" VERDICT: {'*** WALK ***' if walk else 'NOT-A-WALK'} ({sum(gates.values())}/{len(gates)})")
197
+ return dict(walk=walk, gates=gates, cadence=cadence, altern=altern, single=single, act=act, T=T)
198
+
199
+
200
+ if __name__ == "__main__":
201
+ jm = load_dnmodel(sys.argv[1])
202
+ for npz in sys.argv[2:]:
203
+ report(jm, npz)
@@ -0,0 +1,51 @@
1
+ """The GCOT warm-start chain's parent check (2026-11-22; a design direction: train the speed sweep as warm-start chains outward
2
+ from cold roots, each speed from the FINAL checkpoint of the nearest finished speed). train_tw14.py calls it when D16_TW_CHAIN=GCOT; without
3
+ that switch its old rule stands (no warm start in a parent's ancestry).
4
+
5
+ A chain link may start from a parent checkpoint only if the parent's run (its run_config.json env_vars):
6
+ - had no kickstart and no imitation;
7
+ - was a COLD root (no SUITE_INIT_CKPT) or itself a GCOT chain link (D16_TW_CHAIN=GCOT), whose own parent this same check accepted when it
8
+ trained, so the whole chain reaches a cold root by induction (the pattern of the S290 exception in train_tw14.py);
9
+ - trained with the same seed and world count (run_config 'seed', config n_env) as the child's --seed / --n-env, and
10
+ - trained with the SAME change set as the child, except the speed schedule (TASKWALK_V_*, TASKWALK_LOG_VTGT_EVERY), the warm-start and
11
+ checkpoint bookkeeping (SUITE_*, TW14_EMA_RESTART / DRY_EPOCHS / PARSE_ONLY, D16_TW_CHAIN) and host paths (trees, case, extension caches).
12
+ Missing and empty values are the same (an unset knob is recorded as absent)."""
13
+
14
+ PREFIXES = ("TASKWALK_", "DN_", "SAPO_", "LEARN_", "FULLBODY_", "E0_ENV14_", "E0_ENGINE14", "X14_", "D16_BODY", "D16_TW_RESET",
15
+ "DN_FK_COMPILE", "TW14_")
16
+ # SUITE_* are bookkeeping only (the init checkpoint, the save cadence, the dnrec skip, the wall-clock checkpoint); of train_tw14's own TW14_*
17
+ # knobs, FREEZE_ALPHA / FREEZE_OBS_RMS / LR_SCHED change training and stay compared, DRY_EPOCHS / PARSE_ONLY / EMA_RESTART are exempt
18
+ EXEMPT_PREFIXES = ("TASKWALK_V_", "SUITE_")
19
+ EXEMPT_KEYS = {"TASKWALK_LOG_VTGT_EVERY", "D16_TW_CHAIN", "D16_TREE", "D16_CASE", "E0_TREE14", "E0_MUSCLE_CASE", "TORCH_EXTENSIONS_DIR",
20
+ "TW14_EMA_RESTART", "TW14_DRY_EPOCHS", "TW14_PARSE_ONLY"}
21
+
22
+
23
+ def compared(k):
24
+ return k.startswith(PREFIXES) and not k.startswith(EXEMPT_PREFIXES) and k not in EXEMPT_KEYS
25
+
26
+
27
+ def argv_value(argv, flag):
28
+ """the value after FLAG in an argv list (the suite's --seed / --n-env), None when absent"""
29
+ return argv[argv.index(flag) + 1] if flag in argv else None
30
+
31
+
32
+ def parent_ok(parent_rc, env, argv):
33
+ """(ok, reason) for a parent's whole run_config.json (dict) against the child's environment and argv: the env rules above, plus the
34
+ same seed (run_config 'seed' against the child's --seed) and the same world count (config n_env against --n-env), which the suite
35
+ takes from its argv, not from the environment."""
36
+ parent_env = parent_rc["env_vars"]
37
+ for flag, have in (("--seed", parent_rc.get("seed")), ("--n-env", parent_rc.get("config", {}).get("n_env"))):
38
+ want = argv_value(argv, flag)
39
+ if want is None or have is None or int(want) != int(have):
40
+ return False, f"{flag}: parent run {have!r}, child {want!r} (a chain keeps one seed and one world count)"
41
+ if parent_env.get("SAPO_KICKSTART_CKPT"):
42
+ return False, f"the parent's run had SAPO_KICKSTART_CKPT={parent_env['SAPO_KICKSTART_CKPT']!r}"
43
+ if parent_env.get("DN_IMITATION", "0") not in ("", "0"):
44
+ return False, f"the parent's run had DN_IMITATION={parent_env['DN_IMITATION']!r}"
45
+ if parent_env.get("SUITE_INIT_CKPT") and parent_env.get("D16_TW_CHAIN") != "GCOT":
46
+ return False, "the parent was warm-started outside the GCOT chain (SUITE_INIT_CKPT set without D16_TW_CHAIN=GCOT)"
47
+ diff = sorted(k for k in set(parent_env) | set(env) if compared(k) and (parent_env.get(k) or "") != (env.get(k) or ""))
48
+ if diff:
49
+ return False, "the parent's change set differs from the child's beyond the speed schedule: " + ", ".join(
50
+ f"{k}: parent {parent_env.get(k)!r} child {env.get(k)!r}" for k in diff[:8])
51
+ return True, ("cold root" if not parent_env.get("SUITE_INIT_CKPT") else f"chain link (its parent {parent_env['SUITE_INIT_CKPT']})")