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,400 @@
1
+ #pragma once
2
+ // D16 14x adjoint, the constraint rows (engine C, 2026-11-03; tools/d16_x14adj/PLAN.md "rows14"): the cotangent of
3
+ // F_rows(q, v) = sum over the QUADRATIC rows r of D_r (J_r lam) (J_r a - aref_r)
4
+ // for held lam, a, the contact list (pair, slot) and the zones (the solve's decisions, from the tape).
5
+ // The rows are recomputed from the tree's poses (tree14's DOWN), exactly as the L2 forms them (core/soft/gpu/l2x14.cuh):
6
+ // - limits in limit order, lower then upper, with the TRUE slope J = +-c on the master (the hand's unit form only encodes the
7
+ // solve);
8
+ // - then the contacts in contact order, each by collide14 at its (pair, slot), make_frame, condim 1 (one row) or 3 (four pyramid
9
+ // rows d = F0 +- mu Fk).
10
+ // Law: impedance -> R (pyramid: c R0, c = 2 mu^2 / impratio) -> D = 1 / R, aref = -B vel - K imp (dist - margin).
11
+ // A contact row's J x = d . (P_x(b2) - P_x(b1)), P_x(b) = vo_x + w_x x (p - x_b): the point velocity of body b under the twist of
12
+ // x taken as joint velocities (x = lam: tree14's (lw, lo); x = a: (wa, voa); x = v: (w, vo)), the signed support lists of L2.
13
+ // Reverse:
14
+ // per row the scalar cotangents; per contact the three channels' point cotangents, deposited into tree14's accumulators of its
15
+ // two bodies (the twist words and the pose wrench about O: the contact point and the body origin as points, the geoms' pose
16
+ // cotangents through the collider's reverse: B's collide_reverse for plane / capsule pairs, passive's sibling
17
+ // collide14_adj.h for the plane-ellipsoid); limits straight into q_bar / v_bar of their master dof.
18
+ // ADDS into the cotangents: the caller's convention is F_rows itself (the shell negates through lam).
19
+ #include "x14adj_common.h"
20
+ #include "tree14_adj.h"
21
+ #include "collide14_adj.h"
22
+ #include "../collide.h"
23
+ #include "../impedance.h"
24
+ #include "../x14/collide14.h"
25
+ #include "../adj/rows_adj.h" // B's impedance_dpos, make_frame_reverse, collide_reverse (sphere / capsule / plane)
26
+
27
+ namespace d16::x14adj {
28
+
29
+ #if defined(D16_NV_GT64) // a body with more limits than the 14x (tools/d16_bodies/PHASE_B.md section 6.2): every limit has a slot, so `nl < kMaxLim14` drops none
30
+ constexpr int kMaxCon14 = 64, kMaxLim14 = MD::NLIM, kConBatch14 = 8;
31
+ static_assert(kMaxLim14 >= MD::NLIM, "one limit row slot per limit (one side at most: gen14 asserts range > 2 margin)");
32
+ #else
33
+ constexpr int kMaxCon14 = 64, kMaxLim14 = 64, kConBatch14 = 8; // contacts reversed 8 at a time (lane = contact)
34
+ #endif
35
+
36
+ template <class T> struct Rows14 {
37
+ #if defined(D16_X14_ADJ5) // (11-08; up/PREREG_X14ADJ5.md) the 14x's k_adj14 at 5 per SM: the row indices in 16 bits; every read widens to int
38
+ int ncon, nlim;
39
+ short crow0[kMaxCon14];
40
+ short lim_l[kMaxLim14], lim_side[kMaxLim14];
41
+ #else
42
+ int ncon, nlim, crow0[kMaxCon14];
43
+ int lim_l[kMaxLim14], lim_side[kMaxLim14];
44
+ #endif
45
+ T lq[kMaxLim14], lv[kMaxLim14]; // the limit rows' q / v cotangents (on their master dof)
46
+ int cb[kConBatch14][2]; // the batch's contacts' bodies (b2, b1; 0: the world)
47
+ T dep[kConBatch14][2][kMsg]; // their deposits into tree14's accumulators (the same word layout)
48
+ int flags; // 1: a contact did not reproduce at its (pair, slot)
49
+ };
50
+
51
+ template <class T> DN_HOST_DEVICE inline bool zone_on(const unsigned* zone, int r) { return (zone[r >> 5] >> (r & 31)) & 1u; }
52
+
53
+ // the geom's world pose from its body's (L2's GEOM phase)
54
+ template <class T> DN_HOST_DEVICE inline void r14_geom_pose(const Tree14<T>& s, const T* V, int g, js::soft::GeomPose<T>& G) {
55
+ const int b = X14T(GBody)[g];
56
+ const T* gv = V + MD::O_GEOM + 15 * g;
57
+ T R[9];
58
+ qmat(s.xquat[b], R);
59
+ const T gpos[3] = {gv[3], gv[4], gv[5]};
60
+ T t[3];
61
+ mv(R, gpos, t);
62
+ G.p = js::soft::V3<T>{s.xpos[b][0] + t[0], s.xpos[b][1] + t[1], s.xpos[b][2] + t[2]};
63
+ for (int i = 0; i < 3; ++i)
64
+ for (int j = 0; j < 3; ++j) G.R[3 * i + j] = R[3 * i] * gv[6 + j] + R[3 * i + 1] * gv[9 + j] + R[3 * i + 2] * gv[12 + j];
65
+ }
66
+
67
+ // one limit row (row r of the hand's order) of limit l, side -1 (lower) / +1 (upper): its q / v cotangents of D s e
68
+ template <class T> DN_HOST_DEVICE inline void r14_limit(const Tree14<T>& s, const T* V, int l, int side, T* qb, T* vb) {
69
+ using namespace js::soft;
70
+ const T* lv = V + MD::O_LIM + 12 * l;
71
+ const int dof = X14T(LimDof)[l];
72
+ const T c = lv[0], q = c * s.q[X14T(LimQadr)[l]], margin = lv[3], diagA = lv[4];
73
+ const T dist = side < 0 ? q - lv[1] : lv[2] - q;
74
+ const KBT<T> kb{lv[5], lv[6]};
75
+ const T imp5[5] = {lv[7], lv[8], lv[9], lv[10], lv[11]};
76
+ const T Jd = side < 0 ? c : -c;
77
+ const T Jq = X14ADJ_PLANT == 31 ? (side < 0 ? T(1) : T(-1)) : Jd; // (planted: the hand's unit slope in the q path)
78
+ const T imp = impedance<T, T>(imp5, dist, margin);
79
+ const T R = regularizer<T, T>(imp, diagA), D = T(1) / R;
80
+ const T vel = Jd * s.v[dof];
81
+ const T aref = reference_accel<T, T>(kb, imp, vel, dist, margin);
82
+ const T sl = Jd * s.lam[dof], t = Jd * s.a[dof], e = t - aref;
83
+ // F = D sl e: Dbar = sl e, arefbar = -D sl
84
+ const T Db = sl * e, arb = -D * sl;
85
+ const T velb = -kb.B * arb;
86
+ T impb = -kb.K * (dist - margin) * arb, distb = -kb.K * imp * arb;
87
+ const T Rb = -D * D * Db;
88
+ JS_DEVICE_ASSERT((T(1) - imp) * diagA / imp > T(kMinVal) && "r14_limit: the regularizer at mjMINVAL");
89
+ impb = impb + Rb * (-diagA / (imp * imp));
90
+ distb = distb + impb * adj::impedance_dpos<T, T>(imp5, dist, margin);
91
+ *qb = distb * Jq;
92
+ *vb = velb * Jd;
93
+ }
94
+
95
+ // one contact (index ci, its rows from row0): the deposits into its two bodies' accumulators
96
+ template <class T>
97
+ DN_HOST_DEVICE inline bool r14_contact(const Tree14<T>& s, const T* V, int pr, int slot, int row0, const unsigned* zone,
98
+ int* bodies, T (*dep)[kMsg]) {
99
+ using namespace js::soft;
100
+ using V3T = V3<T>;
101
+ const int g1 = X14T(PG1)[pr], g2 = X14T(PG2)[pr], t1 = X14T(GType)[g1], t2 = X14T(GType)[g2];
102
+ const int b1 = X14T(GBody)[g1], b2 = X14T(GBody)[g2];
103
+ bodies[0] = b2; bodies[1] = b1;
104
+ for (int sd = 0; sd < 2; ++sd)
105
+ for (int k = 0; k < kMsg; ++k) dep[sd][k] = T(0);
106
+ GeomPose<T> G1, G2;
107
+ r14_geom_pose(s, V, g1, G1);
108
+ r14_geom_pose(s, V, g2, G2);
109
+ const T* pv = V + MD::O_PAIR + 10 * pr;
110
+ const T mu0 = pv[0], mu = mu0 < T(1e-5) ? T(1e-5) : mu0, margin = pv[1], gap = pv[2];
111
+ const T sz1[3] = {V[MD::O_GEOM + 15 * g1], V[MD::O_GEOM + 15 * g1 + 1], V[MD::O_GEOM + 15 * g1 + 2]};
112
+ const T sz2[3] = {V[MD::O_GEOM + 15 * g2], V[MD::O_GEOM + 15 * g2 + 1], V[MD::O_GEOM + 15 * g2 + 2]};
113
+ PreContact<T> all[4];
114
+ const int n = js::soft::x14::collide14<T, T>(all, margin + gap, t1, G1, sz1, t2, G2, sz2);
115
+ int k0 = -1;
116
+ for (int k = 0; k < n; ++k) // the forward's decision is held: the contact by its slot (its dist < margin test was the forward's)
117
+ if (all[k].slot == slot) k0 = k;
118
+ if (k0 < 0) return false; // the collider no longer produces the slot (flagged by the caller)
119
+ const PreContact<T>& pc = all[k0];
120
+ V3T F3[3];
121
+ make_frame(pc.normal, pc.tangent, F3);
122
+ const T dist = pc.dist;
123
+ const T pp[3] = {pc.pos.x, pc.pos.y, pc.pos.z};
124
+ // the three channels' point velocities of both bodies: x = 0 lam (lw, lo), 1 a (wa, voa), 2 v (w, vo)
125
+ T P[3][2][3];
126
+ for (int sd = 0; sd < 2; ++sd) {
127
+ const int b = bodies[sd];
128
+ for (int x = 0; x < 3; ++x) {
129
+ if (b == 0) { for (int i = 0; i < 3; ++i) P[x][sd][i] = T(0); continue; }
130
+ const T* wx = x == 0 ? s.lw[b] : (x == 1 ? s.wa[b] : s.w[b]);
131
+ const T* vx = x == 0 ? s.lo[b] : (x == 1 ? s.voa[b] : s.vo[b]);
132
+ const T d[3] = {pp[0] - s.xpos[b][0], pp[1] - s.xpos[b][1], pp[2] - s.xpos[b][2]};
133
+ T wd[3];
134
+ crs(wx, d, wd);
135
+ for (int i = 0; i < 3; ++i) P[x][sd][i] = vx[i] + wd[i];
136
+ }
137
+ }
138
+ T dP[3][3];
139
+ for (int x = 0; x < 3; ++x)
140
+ for (int i = 0; i < 3; ++i) dP[x][i] = P[x][0][i] - P[x][1][i];
141
+ const int condim = X14T(PCondim)[pr], nr = condim == 1 ? 1 : 4;
142
+ const T Fm[3][3] = {{F3[0].x, F3[0].y, F3[0].z}, {F3[1].x, F3[1].y, F3[1].z}, {F3[2].x, F3[2].y, F3[2].z}};
143
+ T dr[4][3];
144
+ for (int j = 0; j < nr; ++j) {
145
+ if (condim == 1) { for (int i = 0; i < 3; ++i) dr[j][i] = Fm[0][i]; continue; }
146
+ const int kk = 1 + j / 2;
147
+ const T sg = j % 2 == 0 ? mu : -mu;
148
+ for (int i = 0; i < 3; ++i) dr[j][i] = Fm[0][i] + sg * Fm[kk][i];
149
+ }
150
+ // the law (L2's): imp, R, D, aref per row
151
+ const KBT<T> kb{pv[3], pv[4]};
152
+ const T imp5[5] = {pv[5], pv[6], pv[7], pv[8], pv[9]};
153
+ const T tran = V[MD::O_BIW + 2 * b1] + V[MD::O_BIW + 2 * b2];
154
+ const T imp = impedance<T, T>(imp5, dist, margin);
155
+ T D, cR, dA;
156
+ if (condim == 1) { dA = tran; cR = T(1); D = T(1) / regularizer<T, T>(imp, dA); }
157
+ else {
158
+ dA = tran + mu * mu * tran;
159
+ const T R0 = regularizer<T, T>(imp, dA);
160
+ const T Rpy = pyramid_regularizer<T, T>(R0, mu, T(MD::IMPRATIO));
161
+ cR = Rpy / R0; // 2 mu^2 / impratio
162
+ D = T(1) / Rpy;
163
+ }
164
+ JS_DEVICE_ASSERT((T(1) - imp) * dA / imp > T(kMinVal) && "r14_contact: the regularizer at mjMINVAL");
165
+ // the rows' scalar cotangents
166
+ T co[4][3]; // per row: sbar (lam), tbar (a), velbar (v)
167
+ T Db = T(0), impb = T(0), distb = T(0);
168
+ for (int j = 0; j < nr; ++j) {
169
+ co[j][0] = co[j][1] = co[j][2] = T(0);
170
+ if (!zone_on<T>(zone, row0 + j)) continue;
171
+ const T sl = dot3(dr[j], dP[0]), t = dot3(dr[j], dP[1]), vel = dot3(dr[j], dP[2]);
172
+ const T aref = reference_accel<T, T>(kb, imp, vel, dist, margin);
173
+ const T e = t - aref;
174
+ Db = Db + sl * e;
175
+ co[j][0] = D * e; co[j][1] = D * sl;
176
+ const T arb = -D * sl;
177
+ co[j][2] = -kb.B * arb;
178
+ impb = impb - kb.K * (dist - margin) * arb;
179
+ distb = distb - kb.K * imp * arb;
180
+ }
181
+ const T Rb = -D * D * Db;
182
+ impb = impb + Rb * cR * (-dA / (imp * imp));
183
+ distb = distb + impb * (X14ADJ_PLANT == 33 ? T(0) : adj::impedance_dpos<T, T>(imp5, dist, margin)); // (33: planted)
184
+ // the channels' direction-weighted cotangent vectors W[x] = sum_j co_j[x] d_j, and the frame's cotangent
185
+ T Wv[3][3];
186
+ V3T fbar[3] = {V3T{T(0), T(0), T(0)}, V3T{T(0), T(0), T(0)}, V3T{T(0), T(0), T(0)}};
187
+ for (int x = 0; x < 3; ++x) for (int i = 0; i < 3; ++i) Wv[x][i] = T(0);
188
+ for (int j = 0; j < nr; ++j) {
189
+ for (int x = 0; x < 3; ++x)
190
+ for (int i = 0; i < 3; ++i) Wv[x][i] = Wv[x][i] + co[j][x] * dr[j][i];
191
+ // d_j . dP_x per channel: frame0 gets sum_x co_j[x] dP_x; the pyramid's tangent k gets +-mu of it
192
+ T g3[3] = {T(0), T(0), T(0)};
193
+ for (int x = 0; x < 3; ++x) for (int i = 0; i < 3; ++i) g3[i] = g3[i] + co[j][x] * dP[x][i];
194
+ fbar[0] = V3T{fbar[0].x + g3[0], fbar[0].y + g3[1], fbar[0].z + g3[2]};
195
+ if (condim != 1) {
196
+ const int kk = 1 + j / 2;
197
+ const T sg = j % 2 == 0 ? mu : -mu;
198
+ fbar[kk] = V3T{fbar[kk].x + sg * g3[0], fbar[kk].y + sg * g3[1], fbar[kk].z + sg * g3[2]};
199
+ }
200
+ }
201
+ // the bodies' twist words and the points' cotangents (the contact point p, the body origins)
202
+ T pbar[3] = {T(0), T(0), T(0)};
203
+ for (int sd = 0; sd < 2; ++sd) {
204
+ const int b = bodies[sd];
205
+ if (b == 0) continue;
206
+ const T sgn = sd == 0 ? T(1) : T(-1);
207
+ const T d[3] = {pp[0] - s.xpos[b][0], pp[1] - s.xpos[b][1], pp[2] - s.xpos[b][2]};
208
+ T* o = dep[sd];
209
+ const int wo[3] = {kMLW, kMWA, kMW}, vo[3] = {kMLO, kMVOA, kMVO};
210
+ T xbb[3] = {T(0), T(0), T(0)};
211
+ for (int x = 0; x < 3; ++x) {
212
+ const T Wx[3] = {sgn * Wv[x][0], sgn * Wv[x][1], sgn * Wv[x][2]};
213
+ const T* wx = x == 0 ? s.lw[b] : (x == 1 ? s.wa[b] : s.w[b]);
214
+ add3(o + vo[x], Wx); // vobar += W
215
+ add_crs(o + wo[x], d, Wx); // wbar += (p - x_b) x W
216
+ T t3[3];
217
+ crs(Wx, wx, t3); // d/dp [W . (w x (p - x_b))] = W x w
218
+ add3(pbar, t3);
219
+ for (int i = 0; i < 3; ++i) xbb[i] = xbb[i] - t3[i];
220
+ }
221
+ // the body origin as a point: force xbb at x_b, torque about O (x_b - O) x xbb
222
+ add3(o + kMF, xbb);
223
+ const T xo[3] = {s.xpos[b][0] - s.xpos[1][0], s.xpos[b][1] - s.xpos[1][1], s.xpos[b][2] - s.xpos[1][2]};
224
+ add_crs(o + kMT, xo, xbb);
225
+ }
226
+ // the contact's outputs -> the geoms' poses -> the bodies' wrenches about O
227
+ V3T nb, tb;
228
+ bool tused;
229
+ if (X14ADJ_PLANT == 32) for (int k = 0; k < 3; ++k) fbar[k] = V3T{T(0), T(0), T(0)}; // (planted: no frame cotangent)
230
+ adj::make_frame_reverse<T>(pc.normal, pc.tangent, fbar, nb, tb, tused);
231
+ if (!tused) tb = V3T{T(0), T(0), T(0)}; // (B's rule: the hint's cotangent only when the frame used it)
232
+ const V3T posb{pbar[0], pbar[1], pbar[2]};
233
+ T xgb[2][3] = {{T(0), T(0), T(0)}, {T(0), T(0), T(0)}}, rgb[2][3] = {{T(0), T(0), T(0)}, {T(0), T(0), T(0)}}; // g2, g1
234
+ if (t1 == 0 && t2 == 4) { // plane-ellipsoid: the frame is the plane's (no pose dependence: nb, tb unused)
235
+ T Rg[9];
236
+ for (int k = 0; k < 9; ++k) Rg[k] = G2.R[k];
237
+ collide14_plane_ellipsoid_vjp<T>(V, pr, Rg, distb, pbar, xgb[0], rgb[0]);
238
+ } else {
239
+ struct G14 { int type; T size[3]; } ga{t1, {sz1[0], sz1[1], sz1[2]}}, gb{t2, {sz2[0], sz2[1], sz2[2]}};
240
+ adj::GeomBar<T> ba{V3T{T(0), T(0), T(0)}, V3T{T(0), T(0), T(0)}}, bb{V3T{T(0), T(0), T(0)}, V3T{T(0), T(0), T(0)}};
241
+ adj::collide_reverse<T>(b1 == 0, ga, G1, gb, G2, slot, distb, posb, nb, tb, ba, bb);
242
+ const V3T z1 = zaxis(G1.R), z2 = zaxis(G2.R);
243
+ xgb[0][0] = bb.p.x; xgb[0][1] = bb.p.y; xgb[0][2] = bb.p.z;
244
+ xgb[1][0] = ba.p.x; xgb[1][1] = ba.p.y; xgb[1][2] = ba.p.z;
245
+ const V3T r2 = js::so3::cross(z2, bb.z), r1 = js::so3::cross(z1, ba.z); // z_bar . (dphi x z) = dphi . (z x z_bar)
246
+ rgb[0][0] = r2.x; rgb[0][1] = r2.y; rgb[0][2] = r2.z;
247
+ rgb[1][0] = r1.x; rgb[1][1] = r1.y; rgb[1][2] = r1.z;
248
+ }
249
+ const GeomPose<T>* GP[2] = {&G2, &G1};
250
+ for (int sd = 0; sd < 2; ++sd) {
251
+ if (bodies[sd] == 0) continue;
252
+ T* o = dep[sd];
253
+ add3(o + kMF, xgb[sd]);
254
+ const T xo[3] = {GP[sd]->p.x - s.xpos[1][0], GP[sd]->p.y - s.xpos[1][1], GP[sd]->p.z - s.xpos[1][2]};
255
+ add_crs(o + kMT, xo, xgb[sd]);
256
+ add3(o + kMT, rgb[sd]);
257
+ }
258
+ return true;
259
+ }
260
+
261
+ // the rows' VALUE F_rows from the tree's state (the same recomputation as the reverse; the self-check differentiates it in Dual)
262
+ template <class T>
263
+ DN_HOST_DEVICE inline T rows14_value(const Tree14<T>& s, const T* V, int ncon, const int* con_pair, const int* con_slot,
264
+ const unsigned* zone, int* ok) {
265
+ using namespace js::soft;
266
+ T F = T(0);
267
+ int r = 0;
268
+ for (int l = 0; l < MD::NLIM; ++l) {
269
+ const T* lv = V + MD::O_LIM + 12 * l;
270
+ const int dof = X14T(LimDof)[l];
271
+ const T c = lv[0], q = c * s.q[X14T(LimQadr)[l]], margin = lv[3], diagA = lv[4];
272
+ for (int side = -1; side <= 1; side += 2) {
273
+ const T dist = side < 0 ? q - lv[1] : lv[2] - q;
274
+ if (!(dist < margin)) continue;
275
+ if (zone_on<T>(zone, r)) {
276
+ const KBT<T> kb{lv[5], lv[6]};
277
+ const T imp5[5] = {lv[7], lv[8], lv[9], lv[10], lv[11]};
278
+ const T Jd = side < 0 ? c : -c;
279
+ const T imp = impedance<T, T>(imp5, dist, margin), D = T(1) / regularizer<T, T>(imp, diagA);
280
+ const T aref = reference_accel<T, T>(kb, imp, Jd * s.v[dof], dist, margin);
281
+ F = F + D * (Jd * s.lam[dof]) * (Jd * s.a[dof] - aref);
282
+ }
283
+ ++r;
284
+ }
285
+ }
286
+ for (int c = 0; c < ncon; ++c) {
287
+ const int pr = con_pair[c], slot = con_slot[c];
288
+ const int g1 = X14T(PG1)[pr], g2 = X14T(PG2)[pr], t1 = X14T(GType)[g1], t2 = X14T(GType)[g2];
289
+ const int bod[2] = {X14T(GBody)[g2], X14T(GBody)[g1]};
290
+ GeomPose<T> G1, G2;
291
+ r14_geom_pose(s, V, g1, G1);
292
+ r14_geom_pose(s, V, g2, G2);
293
+ const T* pv = V + MD::O_PAIR + 10 * pr;
294
+ const T mu0 = pv[0], mu = mu0 < T(1e-5) ? T(1e-5) : mu0, margin = pv[1], gap = pv[2];
295
+ const T sz1[3] = {V[MD::O_GEOM + 15 * g1], V[MD::O_GEOM + 15 * g1 + 1], V[MD::O_GEOM + 15 * g1 + 2]};
296
+ const T sz2[3] = {V[MD::O_GEOM + 15 * g2], V[MD::O_GEOM + 15 * g2 + 1], V[MD::O_GEOM + 15 * g2 + 2]};
297
+ PreContact<T> all[4];
298
+ const int n = js::soft::x14::collide14<T, T>(all, margin + gap, t1, G1, sz1, t2, G2, sz2);
299
+ int k0 = -1;
300
+ for (int k = 0; k < n; ++k)
301
+ if (all[k].slot == slot) k0 = k;
302
+ if (k0 < 0) { *ok = 0; return F; }
303
+ V3<T> F3[3];
304
+ make_frame(all[k0].normal, all[k0].tangent, F3);
305
+ const T pp[3] = {all[k0].pos.x, all[k0].pos.y, all[k0].pos.z}, dist = all[k0].dist;
306
+ T dP[3][3];
307
+ for (int x = 0; x < 3; ++x) {
308
+ T P2[2][3];
309
+ for (int sd = 0; sd < 2; ++sd) {
310
+ const int b = bod[sd];
311
+ if (b == 0) { for (int i = 0; i < 3; ++i) P2[sd][i] = T(0); continue; }
312
+ const T* wx = x == 0 ? s.lw[b] : (x == 1 ? s.wa[b] : s.w[b]);
313
+ const T* vx = x == 0 ? s.lo[b] : (x == 1 ? s.voa[b] : s.vo[b]);
314
+ const T d[3] = {pp[0] - s.xpos[b][0], pp[1] - s.xpos[b][1], pp[2] - s.xpos[b][2]};
315
+ T wd[3];
316
+ crs(wx, d, wd);
317
+ for (int i = 0; i < 3; ++i) P2[sd][i] = vx[i] + wd[i];
318
+ }
319
+ for (int i = 0; i < 3; ++i) dP[x][i] = P2[0][i] - P2[1][i];
320
+ }
321
+ const int condim = X14T(PCondim)[pr], nr = condim == 1 ? 1 : 4;
322
+ const KBT<T> kb{pv[3], pv[4]};
323
+ const T imp5[5] = {pv[5], pv[6], pv[7], pv[8], pv[9]};
324
+ const T tran = V[MD::O_BIW + 2 * bod[1]] + V[MD::O_BIW + 2 * bod[0]];
325
+ const T imp = impedance<T, T>(imp5, dist, margin);
326
+ T D;
327
+ if (condim == 1) D = T(1) / regularizer<T, T>(imp, tran);
328
+ else D = T(1) / pyramid_regularizer<T, T>(regularizer<T, T>(imp, tran + mu * mu * tran), mu, T(MD::IMPRATIO));
329
+ for (int j = 0; j < nr; ++j, ++r) {
330
+ if (!zone_on<T>(zone, r)) continue;
331
+ T d[3];
332
+ for (int i = 0; i < 3; ++i) {
333
+ const T f0 = i == 0 ? F3[0].x : (i == 1 ? F3[0].y : F3[0].z);
334
+ if (condim == 1) { d[i] = f0; continue; }
335
+ const int kk = 1 + j / 2;
336
+ const T fk = i == 0 ? F3[kk].x : (i == 1 ? F3[kk].y : F3[kk].z);
337
+ d[i] = f0 + (j % 2 == 0 ? mu : -mu) * fk;
338
+ }
339
+ const T sl = dot3(d, dP[0]), t = dot3(d, dP[1]), vel = dot3(d, dP[2]);
340
+ F = F + D * sl * (t - reference_accel<T, T>(kb, imp, vel, dist, margin));
341
+ }
342
+ }
343
+ return F;
344
+ }
345
+
346
+ // the rows' reverse for one world: limits into qbar / vbar (by master dof, row order), contacts into s.acc (by body, contact
347
+ // order). con_pair / con_slot [ncon]: the tape's contacts; zone: the tape's zone words. Call between tree14's LOCAL and UP.
348
+ template <class T>
349
+ DN_HOST_DEVICE inline void rows14_vjp(Tree14<T>& s, Rows14<T>& w, const T* V, int ncon, const D16_IDX_T* con_pair,
350
+ const D16_IDX_T* con_slot, int nlim_tape, const unsigned* zone, T* qbar, T* vbar, int lane,
351
+ const unsigned* limmask = nullptr) {
352
+ (void)lane;
353
+ // the limit rows in L2's order (lane 0: a short serial scan; <= 60 limits). limmask (the record's, the k_pre14): the forward's
354
+ // decision held, limit l active iff its bit, on its nearer side (one side at most: range > 2 margin, gen14); null: L2's test
355
+ if (lane == 0) {
356
+ int nl = 0;
357
+ for (int l = 0; l < MD::NLIM; ++l) {
358
+ const T* lv = V + MD::O_LIM + 12 * l;
359
+ const T c = lv[0], q = c * s.q[X14T(LimQadr)[l]], margin = lv[3];
360
+ if (limmask) {
361
+ if (((limmask[l >> 5] >> (l & 31)) & 1u) && nl < kMaxLim14) { w.lim_l[nl] = l; w.lim_side[nl++] = q - lv[1] < lv[2] - q ? -1 : 1; }
362
+ continue;
363
+ }
364
+ if (q - lv[1] < margin && nl < kMaxLim14) { w.lim_l[nl] = l; w.lim_side[nl++] = -1; }
365
+ if (lv[2] - q < margin && nl < kMaxLim14) { w.lim_l[nl] = l; w.lim_side[nl++] = 1; }
366
+ }
367
+ w.nlim = nl;
368
+ w.ncon = ncon;
369
+ int r = nl;
370
+ for (int c = 0; c < ncon; ++c) { w.crow0[c] = r; r += X14T(PCondim)[con_pair[c]] == 1 ? 1 : 4; }
371
+ w.flags = nl == nlim_tape ? 0 : 2; // 2: the limit rows differ from the tape's count
372
+ }
373
+ X14_SYNC();
374
+ X14_FOR(i, w.nlim) {
375
+ w.lq[i] = T(0); w.lv[i] = T(0);
376
+ if (zone_on<T>(zone, i)) r14_limit(s, V, w.lim_l[i], w.lim_side[i], &w.lq[i], &w.lv[i]);
377
+ }
378
+ X14_SYNC();
379
+ X14_FOR(d, NV) { // the limit rows by master dof, in row order
380
+ T sq = T(0), sv = T(0);
381
+ for (int i = 0; i < w.nlim; ++i)
382
+ if (X14T(LimDof)[w.lim_l[i]] == d) { sq = sq + w.lq[i]; sv = sv + w.lv[i]; }
383
+ qbar[d] = qbar[d] + sq;
384
+ vbar[d] = vbar[d] + sv;
385
+ }
386
+ for (int c0 = 0; c0 < ncon; c0 += kConBatch14) { // the contacts by batch; each batch's deposits added in contact order
387
+ const int nb = ncon - c0 < kConBatch14 ? ncon - c0 : kConBatch14;
388
+ X14_FOR(i, nb) {
389
+ if (!r14_contact(s, V, con_pair[c0 + i], con_slot[c0 + i], w.crow0[c0 + i], zone, w.cb[i], w.dep[i])) w.flags |= 1;
390
+ }
391
+ X14_SYNC();
392
+ X14_FOR(k, kMsg)
393
+ for (int i = 0; i < nb; ++i)
394
+ for (int sd = 0; sd < 2; ++sd)
395
+ if (w.cb[i][sd] != 0) s.acc[w.cb[i][sd]][k] = s.acc[w.cb[i][sd]][k] + w.dep[i][sd][k];
396
+ X14_SYNC();
397
+ }
398
+ }
399
+
400
+ } // namespace d16::x14adj