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,193 @@
1
+ """Each foot's contact in the D16 engine's own law, from the pose alone (feat/d16-taskwalk step 3; C, 2026-11-09).
2
+
3
+ The D16 engine collides the floor (plane z = 0) with each floor pair's geom and keeps a contact iff its distance is below the pair's margin
4
+ (l2x14.cuh's COLLIDE stage: collide.h's colliders, MuJoCo's). A foot is DOWN when any of its floor-pair geoms (the law JSON's pairs with the
5
+ floor whose geom sits on calcn_<side> or toes_<side>) is within its pair's margin of the plane: exactly the engine's active contact set on that
6
+ foot, computed from the body poses with the colliders' own distances:
7
+ sphere p_z - r
8
+ capsule p_z - |a_z| h - r (a the capsule's axis, h its half-length; MuJoCo's two end contacts, the lower)
9
+ ellipsoid p_z - sqrt(sum_k (R[2,k] s_k)^2) (the support point along -z, exact)
10
+ The body poses are the env's own FK (DnModelMonitor.body_poses_subset on the old chart's q): calcn_* / toes_* frames equal MuJoCo's on the law's
11
+ expanded XML to 1e-8 (gate_kin_contact14.py K0). Flat ground only (the floor geom at the origin, unrotated: asserted).
12
+ This replaces the old engine's contact force for the mirror's strike latch (DN_MIRROR_SYM: fz > 1 N on the old foot spheres); the latch
13
+ reads it through env._mirror_down. gap() grounds a reset pose on these geoms (env14's E0_ENV14_GROUND14). Torch, any device, no engine call."""
14
+ import json
15
+
16
+ import torch
17
+
18
+ GEOM_PLANE, GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID = 0, 2, 3, 4
19
+
20
+
21
+ def foot_geoms(law, sides=("r", "l")):
22
+ """{side: [dict(body=name, type, size, pos, quat, margin)]}: the floor pairs' geoms on calcn_<side> / toes_<side>, from the law JSON"""
23
+ G, B = law["geoms"], law["bodies"]
24
+ fl = G[0]
25
+ assert fl["name"] == "floor" and fl["type"] == GEOM_PLANE and fl["pos"] == [0.0, 0.0, 0.0] and fl["quat"] == [1.0, 0.0, 0.0, 0.0], fl
26
+ out = {s: [] for s in sides}
27
+ for p in law["pairs"]:
28
+ if 0 not in (p["g1"], p["g2"]):
29
+ continue
30
+ assert p["gap"] == 0.0, p
31
+ g = G[p["g2"] if p["g1"] == 0 else p["g1"]]
32
+ bn = B[g["body"]]["name"]
33
+ for s in sides:
34
+ if bn in (f"calcn_{s}", f"toes_{s}"):
35
+ assert g["type"] in (GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID), g
36
+ out[s].append(dict(name=g["name"], body=bn, type=int(g["type"]), size=[float(x) for x in g["size"]],
37
+ pos=[float(x) for x in g["pos"]], quat=[float(x) for x in g["quat"]], margin=float(p["margin"])))
38
+ for s in sides:
39
+ assert out[s], f"no floor pair on the {s} foot"
40
+ return out
41
+
42
+
43
+ def _qmul(a, b): # (4, ...) quaternions, w first
44
+ aw, ax, ay, az = a
45
+ bw, bx, by, bz = b
46
+ return torch.stack([aw * bw - ax * bx - ay * by - az * bz, aw * bx + ax * bw + ay * bz - az * by,
47
+ aw * by - ax * bz + ay * bw + az * bx, aw * bz + ax * by - ay * bx + az * bw])
48
+
49
+
50
+ def _rot_row2(q): # the third row of R(q), (3, ...): world z of the body's x, y, z axes
51
+ w, x, y, z = q
52
+ return torch.stack([2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y)])
53
+
54
+
55
+ def _rotate_z(q, v): # the world z of R(q) v, v (3,) constant
56
+ r = _rot_row2(q)
57
+ return r[0] * v[0] + r[1] * v[1] + r[2] * v[2]
58
+
59
+
60
+ def other_geoms(law, feet=("calcn_r", "toes_r", "calcn_l", "toes_l")):
61
+ """{"o": [...]}: the floor pairs' geoms on every body but the feet (the N1-290 law: Full Body, femur_*, tibia_*, lumbar1 with the welded
62
+ arms), in foot_geoms' form; TASKWALK_FALL_NONFOOT's contact set (11-13, the review)"""
63
+ G, B = law["geoms"], law["bodies"]
64
+ fl = G[0]
65
+ assert fl["name"] == "floor" and fl["type"] == GEOM_PLANE and fl["pos"] == [0.0, 0.0, 0.0] and fl["quat"] == [1.0, 0.0, 0.0, 0.0], fl
66
+ out = {"o": []}
67
+ for p in law["pairs"]:
68
+ if 0 not in (p["g1"], p["g2"]):
69
+ continue
70
+ assert p["gap"] == 0.0, p
71
+ g = G[p["g2"] if p["g1"] == 0 else p["g1"]]
72
+ bn = B[g["body"]]["name"]
73
+ if bn not in feet:
74
+ assert g["type"] in (GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID), g
75
+ # jname: the law body's joint, so the geom finds ITS link of a same-named dnmodel chain (tibia_r is 5 links there, the first a
76
+ # 0.001 kg phantom; a name lookup lands on it: 11-13, the MuJoCo check of this set)
77
+ out["o"].append(dict(name=g["name"], body=bn, jname=B[g["body"]]["joint_name"], type=int(g["type"]),
78
+ size=[float(x) for x in g["size"]], pos=[float(x) for x in g["pos"]], quat=[float(x) for x in g["quat"]],
79
+ margin=float(p["margin"])))
80
+ assert out["o"], "no non-foot floor pair in the law"
81
+ return out
82
+
83
+
84
+ class FootTouch14:
85
+ """touch(q) -> (down_r, down_l) (n,) bool; lowest(q) -> {side: (G, n) each geom's distance minus its margin}. With geoms=other_geoms
86
+ (TASKWALK_FALL_NONFOOT) the same colliders over the non-foot floor pairs: any_down(q) -> (n,) bool"""
87
+
88
+ def __init__(self, law_path, monitor, device, dtype=torch.float32, geoms=None):
89
+ law = json.load(open(law_path))
90
+ self.geoms = foot_geoms(law) if geoms is None else geoms(law)
91
+ jn = [b["name"] for b in monitor.jm["bodies"]]
92
+ self.mon = monitor
93
+ jb = monitor.jm["bodies"]
94
+ def link(g): # the foot geoms (unique names): the name; other_geoms: the link with the law body's name AND joint (asserted unique)
95
+ if "jname" not in g:
96
+ return jn.index(g["body"])
97
+ c = [i for i, x in enumerate(jb) if x["name"] == g["body"] and x.get("joint_name") == g["jname"]]
98
+ assert len(c) == 1, ("no unique dnmodel link for the law body", g["body"], g["jname"], c)
99
+ return c[0]
100
+ self.bodies = sorted({link(g) for s in self.geoms for g in self.geoms[s]})
101
+ self.dev, self.dt = device, dtype
102
+ self.tab = {}
103
+ for s, gs in self.geoms.items():
104
+ self.tab[s] = [(link(g), g["type"], torch.tensor(g["size"], dtype=dtype, device=device),
105
+ torch.tensor(g["pos"], dtype=dtype, device=device), torch.tensor(g["quat"], dtype=dtype, device=device)[:, None],
106
+ g["margin"]) for g in gs]
107
+ self.n_calls = 0
108
+ # TW1 K1 (11-10; the census: the per-geom loop below was ~764 kernel launches per control step, every step, in the mirror latch):
109
+ # every geom of both sides in one stacked computation. The arithmetic per element is the loop's, in the same order (the same
110
+ # products and sums, the constants as (G, 1) columns of the same float32 values instead of 0-d tensors), so lowest() equals
111
+ # lowest_reference() bitwise (test_kin_batched.py, tw1_traj.py). One margin for every row (asserted), subtracted as the same
112
+ # Python float.
113
+ rows = [(s, *r) for s in self.tab for r in self.tab[s]]
114
+ self.side_rows = {s: (sum(len(self.tab[x]) for x in list(self.tab)[:i]), len(self.tab[s])) for i, s in enumerate(self.tab)}
115
+ margins = {r[6] for r in rows}
116
+ assert len(margins) == 1, margins
117
+ self.margin = margins.pop()
118
+ self.row_body = [r[1] for r in rows]
119
+ col = lambda k, i: torch.stack([r[k][i] if len(r[k]) > i else r[k][0] for r in rows])[:, None] # noqa: E731 (G, 1)
120
+ self.gp = [col(4, i) for i in range(3)] # the geom's position in its body, per axis
121
+ self.gq = [torch.stack([r[5][i, 0] for r in rows])[:, None] for i in range(4)] # the geom's frame in its body (w, x, y, z)
122
+ self.size = [col(3, i) for i in range(3)]
123
+ types = [r[2] for r in rows]
124
+ self.groups = {t: torch.tensor([i for i, x in enumerate(types) if x == t], device=device)
125
+ for t in (GEOM_SPHERE, GEOM_CAPSULE, GEOM_ELLIPSOID) if t in types}
126
+ order = [i for t in self.groups for i in self.groups[t].tolist()]
127
+ self.unperm = torch.tensor(sorted(range(len(order)), key=lambda j: order[j]), device=device) # cat order -> row order
128
+
129
+ def lowest(self, q, poses=None):
130
+ """{side: (G, n)}: each foot geom's distance to the plane minus its pair's margin (< 0: the engine keeps the contact). poses = (pos,
131
+ quat) dicts covering the foot bodies (TW1 K2: the reward's own FK of the same q, detached) skips this call's FK"""
132
+ pos, quat = poses if poses is not None else self.mon.body_poses_subset(q, self.bodies, False)[:2]
133
+ Q = [torch.stack([quat[b][k] for b in self.row_body]).to(self.dt) for k in range(4)] # (G, n) each: w, x, y, z
134
+ w, x, y, z = Q
135
+ r0, r1, r2 = 2 * (x * z - w * y), 2 * (y * z + w * x), 1 - 2 * (x * x + y * y) # _rot_row2(qb)
136
+ pz = torch.stack([pos[b][2] for b in self.row_body]).to(self.dt) + (r0 * self.gp[0] + r1 * self.gp[1] + r2 * self.gp[2])
137
+ parts = []
138
+ if GEOM_SPHERE in self.groups:
139
+ i = self.groups[GEOM_SPHERE]
140
+ parts.append(pz[i] - self.size[0][i])
141
+ if GEOM_CAPSULE in self.groups or GEOM_ELLIPSOID in self.groups:
142
+ bw, bx, by, bz = self.gq # _qmul(qb, gq)
143
+ mw = w * bw - x * bx - y * by - z * bz
144
+ mx = w * bx + x * bw + y * bz - z * by
145
+ my = w * by - x * bz + y * bw + z * bx
146
+ mz = w * bz + x * by - y * bx + z * bw
147
+ g0, g1, g2 = 2 * (mx * mz - mw * my), 2 * (my * mz + mw * mx), 1 - 2 * (mx * mx + my * my) # _rot_row2 of the product
148
+ if GEOM_CAPSULE in self.groups:
149
+ i = self.groups[GEOM_CAPSULE]
150
+ parts.append(pz[i] - g2[i].abs() * self.size[1][i] - self.size[0][i])
151
+ if GEOM_ELLIPSOID in self.groups:
152
+ i = self.groups[GEOM_ELLIPSOID]
153
+ parts.append(pz[i] - torch.sqrt((g0[i] * self.size[0][i]) ** 2 + (g1[i] * self.size[1][i]) ** 2
154
+ + (g2[i] * self.size[2][i]) ** 2))
155
+ d = torch.cat(parts)[self.unperm] - self.margin
156
+ return {s: d[a:a + n] for s, (a, n) in self.side_rows.items()}
157
+
158
+ def lowest_reference(self, q):
159
+ """lowest()'s per-geom form (the original loop, kept as the reference lowest() is checked against bitwise)"""
160
+ pos, quat, _ = self.mon.body_poses_subset(q, self.bodies, False)
161
+ out = {}
162
+ for s, rows in self.tab.items():
163
+ d = []
164
+ for b, t, size, gp, gq, margin in rows:
165
+ qb = quat[b].to(self.dt)
166
+ pz = pos[b][2].to(self.dt) + _rotate_z(qb, gp) # the geom's centre, world z
167
+ if t == GEOM_SPHERE:
168
+ dist = pz - size[0]
169
+ else:
170
+ r2 = _rot_row2(_qmul(qb, gq.expand_as(qb))) # the geom frame's third row: R[2, 0..2]
171
+ if t == GEOM_CAPSULE: # the axis is the geom's z: its world z component R[2, 2]
172
+ dist = pz - r2[2].abs() * size[1] - size[0]
173
+ else:
174
+ dist = pz - torch.sqrt((r2[0] * size[0]) ** 2 + (r2[1] * size[1]) ** 2 + (r2[2] * size[2]) ** 2)
175
+ d.append(dist - margin)
176
+ out[s] = torch.stack(d)
177
+ return out
178
+
179
+ def gap(self, q):
180
+ """(n,): the lowest foot geom's distance to the plane (the margin added back): 0 = the lowest geom touches"""
181
+ lo = self.lowest(q)
182
+ m = {s: torch.tensor([r[5] for r in self.tab[s]], dtype=self.dt, device=self.dev)[:, None] for s in self.tab}
183
+ return torch.minimum((lo["r"] + m["r"]).min(0).values, (lo["l"] + m["l"]).min(0).values)
184
+
185
+ def touch(self, q, poses=None):
186
+ self.n_calls += 1
187
+ lo = self.lowest(q, poses)
188
+ return (lo["r"] < 0).any(0), (lo["l"] < 0).any(0)
189
+
190
+ def any_down(self, q, poses=None):
191
+ """(n,) bool: any of this set's geoms within its pair's margin (other_geoms: a non-foot body on the floor)"""
192
+ assert set(self.tab) == {"o"}, "any_down is the other_geoms set's"
193
+ return (self.lowest(q, poses)["o"] < 0).any(0)
@@ -0,0 +1,366 @@
1
+ {
2
+ "model": "fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.dnmodel",
3
+ "law": "e0_14x_soft_law_f1c2243ae6be449e_mmfloor.json",
4
+ "n_states": 256,
5
+ "sites": [
6
+ {
7
+ "site": "pelvis_mimic",
8
+ "body_old": "pelvis",
9
+ "b14": 1,
10
+ "b14_name": "Full Body",
11
+ "pos": [
12
+ 0.0,
13
+ 0.0,
14
+ 0.0
15
+ ],
16
+ "quat": [
17
+ 0.7071067811865476,
18
+ 0.7071067811865476,
19
+ -1.214306433183765e-17,
20
+ 6.938893903907228e-18
21
+ ],
22
+ "spread": 3.3306690738754696e-16,
23
+ "max_err_P": 0.0,
24
+ "max_err_Q": 2.220446049250313e-16
25
+ },
26
+ {
27
+ "site": "upper_body_mimic",
28
+ "body_old": "lumbar1",
29
+ "b14": 19,
30
+ "b14_name": "lumbar1",
31
+ "pos": [
32
+ -1.0074504309411302e-17,
33
+ 3.5738810517731515e-18,
34
+ 9.655458800411759e-17
35
+ ],
36
+ "quat": [
37
+ 1.0,
38
+ 2.200930410145574e-16,
39
+ 1.1275702593849246e-17,
40
+ 5.0306980803327406e-17
41
+ ],
42
+ "spread": 8.881784197001252e-16,
43
+ "max_err_P": 4.440892098500626e-16,
44
+ "max_err_Q": 7.771561172376096e-16
45
+ },
46
+ {
47
+ "site": "head_mimic",
48
+ "body_old": "head",
49
+ "b14": 19,
50
+ "b14_name": "lumbar1",
51
+ "pos": [
52
+ -0.0025000000000000334,
53
+ 0.40100000000000036,
54
+ 4.440892098500626e-16
55
+ ],
56
+ "quat": [
57
+ 1.0,
58
+ 2.200930410145574e-16,
59
+ 1.1275702593849246e-17,
60
+ 5.0306980803327406e-17
61
+ ],
62
+ "spread": 1.1891529427821013e-15,
63
+ "max_err_P": 1.3322676295501878e-15,
64
+ "max_err_Q": 7.771561172376096e-16
65
+ },
66
+ {
67
+ "site": "left_shoulder_mimic",
68
+ "body_old": "humerus_l",
69
+ "b14": 51,
70
+ "b14_name": "humerus_l",
71
+ "pos": [
72
+ 1.5009864778058442e-16,
73
+ 1.1403607091067931e-16,
74
+ 3.3979269872328656e-16
75
+ ],
76
+ "quat": [
77
+ 1.0000000000000007,
78
+ 3.8510861166685117e-16,
79
+ 1.249000902703301e-16,
80
+ -1.249000902703301e-16
81
+ ],
82
+ "spread": 1.5543122344752192e-15,
83
+ "max_err_P": 1.1102230246251565e-15,
84
+ "max_err_Q": 1.5543122344752192e-15
85
+ },
86
+ {
87
+ "site": "left_elbow_mimic",
88
+ "body_old": "ulna_l",
89
+ "b14": 52,
90
+ "b14_name": "ulna_l",
91
+ "pos": [
92
+ 3.0666461355875576e-16,
93
+ 3.850161386560089e-16,
94
+ 6.510315389320607e-17
95
+ ],
96
+ "quat": [
97
+ 1.0000000000000004,
98
+ 5.030698080332741e-16,
99
+ -5.898059818321144e-17,
100
+ -2.1337098754514727e-16
101
+ ],
102
+ "spread": 1.3912482277333993e-15,
103
+ "max_err_P": 1.5543122344752192e-15,
104
+ "max_err_Q": 1.5543122344752192e-15
105
+ },
106
+ {
107
+ "site": "left_hand_mimic",
108
+ "body_old": "lunate_l",
109
+ "b14": 55,
110
+ "b14_name": "lunate_l",
111
+ "pos": [
112
+ 6.700460844903972e-17,
113
+ 4.478358008932125e-16,
114
+ -3.3974728936514323e-16
115
+ ],
116
+ "quat": [
117
+ 1.0000000000000004,
118
+ 4.0939474033052647e-16,
119
+ -2.7755575615628914e-17,
120
+ -3.7470027081099033e-16
121
+ ],
122
+ "spread": 1.6350888179376964e-15,
123
+ "max_err_P": 1.887379141862766e-15,
124
+ "max_err_Q": 1.4432899320127035e-15
125
+ },
126
+ {
127
+ "site": "right_shoulder_mimic",
128
+ "body_old": "humerus_r",
129
+ "b14": 33,
130
+ "b14_name": "humerus_r",
131
+ "pos": [
132
+ -1.1829060525433411e-16,
133
+ -5.177010932010586e-17,
134
+ 3.070191415632783e-16
135
+ ],
136
+ "quat": [
137
+ 0.9999999999999998,
138
+ -2.0816681711721685e-17,
139
+ 1.3877787807814457e-17,
140
+ 1.249000902703301e-16
141
+ ],
142
+ "spread": 1.3322676295501878e-15,
143
+ "max_err_P": 1.1102230246251565e-15,
144
+ "max_err_Q": 9.992007221626409e-16
145
+ },
146
+ {
147
+ "site": "right_elbow_mimic",
148
+ "body_old": "ulna_r",
149
+ "b14": 34,
150
+ "b14_name": "ulna_r",
151
+ "pos": [
152
+ -3.602009003146464e-17,
153
+ -4.8774802034939207e-17,
154
+ 3.4580787764503097e-16
155
+ ],
156
+ "quat": [
157
+ 1.0,
158
+ 3.2959746043559335e-17,
159
+ -2.7755575615628914e-17,
160
+ 8.326672684688674e-17
161
+ ],
162
+ "spread": 1.3431114712333363e-15,
163
+ "max_err_P": 1.3322676295501878e-15,
164
+ "max_err_Q": 8.881784197001252e-16
165
+ },
166
+ {
167
+ "site": "right_hand_mimic",
168
+ "body_old": "lunate_r",
169
+ "b14": 37,
170
+ "b14_name": "lunate_r",
171
+ "pos": [
172
+ 7.334548164207165e-17,
173
+ -2.5957625256639473e-16,
174
+ 3.36006333370681e-16
175
+ ],
176
+ "quat": [
177
+ 1.0,
178
+ -4.163336342344337e-17,
179
+ 8.326672684688674e-17,
180
+ 1.6653345369377348e-16
181
+ ],
182
+ "spread": 1.3196973535350964e-15,
183
+ "max_err_P": 1.3322676295501878e-15,
184
+ "max_err_Q": 9.992007221626409e-16
185
+ },
186
+ {
187
+ "site": "left_hip_mimic",
188
+ "body_old": "femur_l",
189
+ "b14": 61,
190
+ "b14_name": "femur_l",
191
+ "pos": [
192
+ -7.46157333973857e-18,
193
+ 2.2488889989907985e-18,
194
+ -4.0897486127076716e-17
195
+ ],
196
+ "quat": [
197
+ 0.9999999999999999,
198
+ -8.673617379884035e-19,
199
+ 6.938893903907228e-18,
200
+ -6.938893903907228e-18
201
+ ],
202
+ "spread": 5.551115123125783e-16,
203
+ "max_err_P": 4.440892098500626e-16,
204
+ "max_err_Q": 3.3306690738754696e-16
205
+ },
206
+ {
207
+ "site": "left_knee_mimic",
208
+ "body_old": "tibia_l",
209
+ "b14": 62,
210
+ "b14_name": "tibia_l",
211
+ "pos": [
212
+ 1.7949924073108143e-16,
213
+ -6.691643951779404e-17,
214
+ -9.0423339926422e-17
215
+ ],
216
+ "quat": [
217
+ 0.9975666948000462,
218
+ -0.005119189982353875,
219
+ -0.06941652991575117,
220
+ -0.003978529136687975
221
+ ],
222
+ "spread": 7.771561172376096e-16,
223
+ "max_err_P": 5.551115123125783e-16,
224
+ "max_err_Q": 6.661338147750939e-16
225
+ },
226
+ {
227
+ "site": "left_ankle_mimic",
228
+ "body_old": "talus_l",
229
+ "b14": 63,
230
+ "b14_name": "talus_l",
231
+ "pos": [
232
+ 5.0011213156424874e-17,
233
+ -3.128898778590592e-16,
234
+ -2.9592155288886903e-16
235
+ ],
236
+ "quat": [
237
+ 0.9999999999999999,
238
+ 7.112366251504909e-17,
239
+ 0.0,
240
+ 8.326672684688674e-17
241
+ ],
242
+ "spread": 1.0274165517734856e-15,
243
+ "max_err_P": 9.575673587391975e-16,
244
+ "max_err_Q": 5.551115123125783e-16
245
+ },
246
+ {
247
+ "site": "left_toes_mimic",
248
+ "body_old": "toes_l",
249
+ "b14": 65,
250
+ "b14_name": "toes_l",
251
+ "pos": [
252
+ 4.137547792515669e-17,
253
+ -3.7702010210257793e-16,
254
+ -2.533623781848e-16
255
+ ],
256
+ "quat": [
257
+ 0.9999999999999998,
258
+ 7.134050294954619e-17,
259
+ -1.3877787807814457e-17,
260
+ 1.249000902703301e-16
261
+ ],
262
+ "spread": 1.1789569707612258e-15,
263
+ "max_err_P": 1.1102230246251565e-15,
264
+ "max_err_Q": 6.661338147750939e-16
265
+ },
266
+ {
267
+ "site": "right_hip_mimic",
268
+ "body_old": "femur_r",
269
+ "b14": 56,
270
+ "b14_name": "femur_r",
271
+ "pos": [
272
+ -2.5854007489137302e-17,
273
+ -1.0734069569494286e-16,
274
+ 1.8113254345763995e-17
275
+ ],
276
+ "quat": [
277
+ 1.0,
278
+ 2.229119666630197e-16,
279
+ -1.3877787807814457e-17,
280
+ -2.0816681711721685e-17
281
+ ],
282
+ "spread": 5.577135975265435e-16,
283
+ "max_err_P": 4.440892098500626e-16,
284
+ "max_err_Q": 6.661338147750939e-16
285
+ },
286
+ {
287
+ "site": "right_knee_mimic",
288
+ "body_old": "tibia_r",
289
+ "b14": 57,
290
+ "b14_name": "tibia_r",
291
+ "pos": [
292
+ -3.766793150269113e-17,
293
+ -2.266355288104523e-16,
294
+ -1.851202244581025e-16
295
+ ],
296
+ "quat": [
297
+ 0.9975666948000463,
298
+ 0.005119189982354258,
299
+ 0.06941652991575119,
300
+ -0.003978529136688065
301
+ ],
302
+ "spread": 1.0753893398233159e-15,
303
+ "max_err_P": 8.881784197001252e-16,
304
+ "max_err_Q": 5.551115123125783e-16
305
+ },
306
+ {
307
+ "site": "right_ankle_mimic",
308
+ "body_old": "talus_r",
309
+ "b14": 58,
310
+ "b14_name": "talus_r",
311
+ "pos": [
312
+ -7.983856961282811e-17,
313
+ -2.3366770561190903e-16,
314
+ -3.5480777755062727e-16
315
+ ],
316
+ "quat": [
317
+ 1.0,
318
+ 2.229119666630197e-16,
319
+ 2.7755575615628914e-17,
320
+ 6.938893903907228e-18
321
+ ],
322
+ "spread": 1.2643572149880734e-15,
323
+ "max_err_P": 1.3322676295501878e-15,
324
+ "max_err_Q": 6.661338147750939e-16
325
+ },
326
+ {
327
+ "site": "right_toes_mimic",
328
+ "body_old": "toes_r",
329
+ "b14": 60,
330
+ "b14_name": "toes_r",
331
+ "pos": [
332
+ -2.3489538564931953e-17,
333
+ -1.880723228394087e-16,
334
+ -4.171948647174534e-16
335
+ ],
336
+ "quat": [
337
+ 1.0,
338
+ 1.682681771697503e-16,
339
+ 1.3877787807814457e-17,
340
+ -6.938893903907228e-18
341
+ ],
342
+ "spread": 1.3050975545358006e-15,
343
+ "max_err_P": 1.3322676295501878e-15,
344
+ "max_err_Q": 6.661338147750939e-16
345
+ }
346
+ ],
347
+ "root": {
348
+ "body_old": "Full Body",
349
+ "b14": 1,
350
+ "b14_name": "Full Body",
351
+ "pos": [
352
+ 0.0,
353
+ 0.0,
354
+ 0.0
355
+ ],
356
+ "quat": [
357
+ 1.0,
358
+ 0.0,
359
+ -4.363913744254155e-18,
360
+ 0.0
361
+ ],
362
+ "spread": 2.220446049250313e-16
363
+ },
364
+ "monitor_constants": "float64",
365
+ "worst_site_err": 1.887379141862766e-15
366
+ }
@@ -0,0 +1,78 @@
1
+ """env14's count of the calls that still reach the OLD engine once env14 is installed (ENGINE_UNIFY_PLAN.md item 3.0.1; the review, 11-09).
2
+
3
+ Before this, count["old_sim"] was set to 0 and never incremented, so t4_collect.py's `old_sim == 0` checked nothing. E0_ENGINE14=1 replaces
4
+ only env.sim.step. These routes into the old engine remain, each counted here by a wrapper that makes the same call with the same arguments
5
+ and adds an integer:
6
+ old_act env._activation: the old sim's activate, bound at the env's construction (gpu_fullbody_vec_env.py:134), before env14 installs;
7
+ rew14_hook replaces it with an identity under E0_REW14_SKIP_ENV_ACT=1, and then it is never called
8
+ old_contact contact_force through env14's Sim.__getattr__ (gpu_fullbody_vec_env.py:759, 882, 1333; rew14_hook's cfnorm) and the env
9
+ module's gpu_bridge.contact_force_gpu (:1013, :1048)
10
+ old_equil the old mtu_gpu.equilibrate_fibers through env._myoleg_gpu (:699); with E0_ENV14_EQUIL14 the proxy replaces it with env14's
11
+ own, which is not counted
12
+ old_other any other callable reached through Sim.__getattr__, env._myoleg_gpu or the env module's gpu_bridge (name kept in .names)
13
+ old_sim their sum: every call into the old engine after the install
14
+ Not counted, by design: the parser and the model dims (`_dnmodel_json`, `dims`, `muscle_l_opts`, `_load_lopt`: no engine work), attribute reads
15
+ (`sim.path`: kept in .reads), and the construction itself (the env is built and its first reset equilibrated on the old engine before env14
16
+ exists: count["old_construct"] = 1 records that, always).
17
+ Torch-free, so its test (test_old_count.py) runs anywhere."""
18
+ import collections
19
+
20
+ PARSE = frozenset({"_dnmodel_json", "dims", "muscle_l_opts", "_load_lopt"})
21
+ KEYS = ("old_act", "old_contact", "old_equil", "old_other", "old_sim")
22
+
23
+
24
+ class OldCount:
25
+ def __init__(self, count):
26
+ self.count = count
27
+ for k in KEYS:
28
+ count[k] = 0
29
+ count["old_construct"] = 1
30
+ self.names = collections.Counter() # every counted call, by route and name
31
+ self.reads = collections.Counter() # non-callable attributes read through a forward
32
+
33
+ def _hit(self, key, name):
34
+ self.count[key] += 1
35
+ self.count["old_sim"] += 1
36
+ self.names[name] += 1
37
+
38
+ def wrap(self, key, name, fn):
39
+ def counted(*a, **kw):
40
+ self._hit(key, name)
41
+ return fn(*a, **kw)
42
+ return counted
43
+
44
+ def forward(self, route, obj, name):
45
+ """getattr(obj, name) as a forward does it, with a callable wrapped so that a call counts"""
46
+ v = getattr(obj, name)
47
+ if not callable(v):
48
+ self.reads[f"{route}.{name}"] += 1
49
+ return v
50
+ if name in PARSE:
51
+ return v
52
+ key = "old_contact" if name.startswith("contact_force") else "old_equil" if name == "equilibrate_fibers" else "old_other"
53
+ return self.wrap(key, f"{route}.{name}", v)
54
+
55
+ def proxy(self, route, obj):
56
+ """a stand-in for a module or object whose every callable attribute counts (attributes set on the proxy itself are not counted)"""
57
+ oc = self
58
+
59
+ class Proxy:
60
+ def __getattr__(self, name):
61
+ return oc.forward(route, obj, name)
62
+ return Proxy()
63
+
64
+
65
+ def install(env, e14):
66
+ """wrap the env's routes into the old engine; called by Env14.__init__ after it keeps env.sim as old_sim. Returns the OldCount."""
67
+ oc = OldCount(e14.count)
68
+ env._activation = oc.wrap("old_act", "env._activation", env._activation)
69
+ env._myoleg_gpu = oc.proxy("mtu_gpu", env._myoleg_gpu)
70
+ import sys
71
+ mod = sys.modules.get(type(env).__module__)
72
+ if mod is not None and hasattr(mod, "_bridge"):
73
+ # the env module's gpu_bridge handle (a module global): the original is kept once, so a second install re-points the proxy
74
+ # to its own count instead of nesting proxies
75
+ orig = getattr(mod, "_bridge_unproxied", None) or mod._bridge
76
+ mod._bridge_unproxied = orig
77
+ mod._bridge = oc.proxy("gpu_bridge", orig)
78
+ return oc