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,425 @@
1
+ #pragma once
2
+ // D16 adjoint, the contact-free reverse half (d5, 2026-11-02; B's tools/d16_adj/INTERFACE.md "Revision of the slot",
3
+ // preregistered in tools/d16_adj_rnea/PREREG.md):
4
+ // adj_rnea adds coef * d/d(q tangent, v) of s = seed' RNEA(q, v, acc) (RNEA = M(q) acc + qfrc_bias(q, v))
5
+ // adj_fk_pullback adds the pull-back of world body-origin cotangents and world rotation-vector cotangents through fk
6
+ // in core/soft/kin.h's world-frame formulation and MuJoCo's coordinates. The q tangent is: root world translation, root
7
+ // body-frame rotation (quat <- quat (x) exp(d / 2)), hinges in dof order; v is qvel (v_world, w_body, hinges).
8
+ //
9
+ // seed' RNEA = sum_b f_b . vc~_b + n_b . w~_b: kin.h's Newton-Euler forces f_b = m a_com, n_b = I al + w x I w against body
10
+ // b's COM and angular velocity under the virtual joint velocity `seed` (the virtual power). The reverse runs level-parallel
11
+ // over the tree with lane = body. Rotation cotangents are world rotation-vector cotangents tau (the moment about the body
12
+ // origin): a hinge's q_bar = a . tau, the root's (xpos_bar, R' tau). Children hand their parent one message each (21 words);
13
+ // a parent sums its children in increasing body index, so the sums are deterministic with no atomics or float shuffles.
14
+ //
15
+ // Every phase is an ADJ_LANES block: on the device lane = threadIdx.x & 31 followed by __syncwarp(); on the host a loop over
16
+ // the 32 lanes. No phase reads what another lane writes in the same phase, so the host loop is exact and the same template
17
+ // is gated on the CPU (tools/d16_adj_rnea/gate.py). Per-lane values that live across phases are LANEA / LANE1 variables: one
18
+ // register set per thread on the device, one array slot per lane on the host.
19
+ #include <type_traits>
20
+
21
+ #include "../kin.h"
22
+ #if defined(__CUDACC__)
23
+ #include "../gpu/fk_rn.cuh"
24
+ #endif
25
+
26
+ namespace js::soft::adj {
27
+
28
+ constexpr int kNB = 32; // bodies, one per lane (the G1 law: 32 with the world and the terrain)
29
+ constexpr int kMsg = 21; // child -> parent message: xpos_bar 3, tau 3, w_bar, al_bar, ao_bar, wt_bar, vot_bar 3 each
30
+ constexpr int kPub = 22; // parent -> child values: xquat 4, xpos 3, w, al, ao, wt, vot 3 each
31
+ constexpr int kSlot = 22; // scratch words per body (max of the two; the reverse reuses the forward's slots)
32
+
33
+ // ADJ_PROF (section timers, tools/d16_adj_rnea/g3.cu's profiling build only): the first active lane of a phase writes clock64
34
+ // stamps into prof[]; per call 2 + 10 per level: forward (phase start, pose, velocities, COM / inertia, published), reverse
35
+ // (phase start, children summed, own terms, recursion / message), and the end.
36
+ constexpr int kProf = 128;
37
+ #if defined(ADJ_PROF) && defined(__CUDA_ARCH__)
38
+ #define ADJ_LEAD(cond) const int adj_lead_ = __ffs(__ballot_sync(0xffffffffu, (cond))) - 1
39
+ #define ADJ_TS(idx) do { if (prof && lane == adj_lead_) prof[(idx)] = clock64(); } while (0)
40
+ #else
41
+ #define ADJ_LEAD(cond) do {} while (0)
42
+ #define ADJ_TS(idx) do {} while (0)
43
+ #endif
44
+
45
+ #if defined(__CUDA_ARCH__)
46
+ #define ADJ_LANES(lane) for (int lane = static_cast<int>(threadIdx.x & 31u), adj_once_ = 1; adj_once_; adj_once_ = 0, __syncwarp())
47
+ #define LANEA(T, name, n) T name[n]
48
+ #define LANE1(T, name) T name
49
+ #define LV(name) name
50
+ #else
51
+ #define ADJ_LANES(lane) for (int lane = 0; lane < 32; ++lane)
52
+ #define LANEA(T, name, n) T name[32][n]
53
+ #define LANE1(T, name) T name[32]
54
+ #define LV(name) name[lane]
55
+ #endif
56
+
57
+ // The model as the functions read it, through an accessor (Tab): nb(), maxdepth(), parent / jnt / qadr / dadr / depth (b),
58
+ // nchild(b), child(b, i) in increasing index, pos / quat / ipos / iquat / inertia / axis (b) -> const S*, mass(b), gravity(k).
59
+ // The device uses the generated tables (core/soft/gpu/adj_tab.cuh); the host gate uses BodyTable through HostTab. Bodies in
60
+ // topological order (parent < body), body 0 the world, depth(0) = 0.
61
+ template <class S> struct BodyTable {
62
+ int nb = 0, maxdepth = 0;
63
+ int parent[kNB], jnt[kNB], qadr[kNB], dadr[kNB], depth[kNB], nchild[kNB], child[kNB][kNB];
64
+ S pos[kNB][3], quat[kNB][4], ipos[kNB][3], iquat[kNB][4], mass[kNB], inertia[kNB][3], axis[kNB][3];
65
+ S gravity[3];
66
+ };
67
+ template <class S> struct HostTab {
68
+ const BodyTable<S>* t;
69
+ DN_HOST_DEVICE int nb() const { return t->nb; }
70
+ DN_HOST_DEVICE int maxdepth() const { return t->maxdepth; }
71
+ DN_HOST_DEVICE int parent(int b) const { return t->parent[b]; }
72
+ DN_HOST_DEVICE int jnt(int b) const { return t->jnt[b]; }
73
+ DN_HOST_DEVICE int qadr(int b) const { return t->qadr[b]; }
74
+ DN_HOST_DEVICE int dadr(int b) const { return t->dadr[b]; }
75
+ DN_HOST_DEVICE int depth(int b) const { return t->depth[b]; }
76
+ DN_HOST_DEVICE int nchild(int b) const { return t->nchild[b]; }
77
+ DN_HOST_DEVICE int child(int b, int i) const { return t->child[b][i]; }
78
+ DN_HOST_DEVICE const S* pos(int b) const { return t->pos[b]; }
79
+ DN_HOST_DEVICE const S* quat(int b) const { return t->quat[b]; }
80
+ DN_HOST_DEVICE const S* ipos(int b) const { return t->ipos[b]; }
81
+ DN_HOST_DEVICE const S* iquat(int b) const { return t->iquat[b]; }
82
+ DN_HOST_DEVICE const S* inertia(int b) const { return t->inertia[b]; }
83
+ DN_HOST_DEVICE const S* axis(int b) const { return t->axis[b]; }
84
+ DN_HOST_DEVICE S mass(int b) const { return t->mass[b]; }
85
+ DN_HOST_DEVICE S gravity(int k) const { return t->gravity[k]; }
86
+ };
87
+
88
+ template <class S> DN_HOST_DEVICE inline void add3(S* a, const S* b) { a[0] = a[0] + b[0]; a[1] = a[1] + b[1]; a[2] = a[2] + b[2]; }
89
+ template <class S> DN_HOST_DEVICE inline S dot3(const S* a, const S* b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; }
90
+ template <class S> DN_HOST_DEVICE inline void mat_tvec(const S* R, const S* v, S* r) { // r = R' v
91
+ for (int i = 0; i < 3; ++i) r[i] = R[i] * v[0] + R[3 + i] * v[1] + R[6 + i] * v[2];
92
+ }
93
+ // I = X diag(d) X' (X row-major), the world inertia as kin.h forms it
94
+ template <class S> DN_HOST_DEVICE inline void world_inertia(const S* X, const S* d, S* I) {
95
+ for (int i = 0; i < 3; ++i)
96
+ for (int j = 0; j < 3; ++j) {
97
+ S s = S(0);
98
+ for (int k = 0; k < 3; ++k) s = s + X[3 * i + k] * d[k] * X[3 * j + k];
99
+ I[3 * i + j] = s;
100
+ }
101
+ }
102
+
103
+ // The per-body kinematic forward from the parent's published (xquat, xpos): xquat, xpos, R, r = R_p pos (non-root), a.
104
+ template <class S, class Tab>
105
+ DN_HOST_DEVICE inline void body_kin(const Tab& B, int b, const S* q, const S* pq, const S* pp, S* xq, S* xp,
106
+ S* R, S* r, S* a) {
107
+ const int jt = B.jnt(b);
108
+ #if defined(__CUDA_ARCH__)
109
+ if constexpr (std::is_same<S, float>::value) { // kernel P's own per-body FK (core/soft/gpu/fk_rn.cuh)
110
+ if (jt == kJntFree) {
111
+ d16::fk_free_rn(q + B.qadr(b), xp, xq);
112
+ r[0] = r[1] = r[2] = 0.f;
113
+ } else {
114
+ const bool hinge = jt == kJntHinge;
115
+ d16::fk_child_rn(pp, pq, B.pos(b), B.quat(b), hinge, hinge ? q[B.qadr(b)] : 0.f, B.axis(b), xp, xq);
116
+ d16::qrot_rn(pq, B.pos(b), r);
117
+ }
118
+ quat_to_mat(xq, R);
119
+ if (jt == kJntHinge) mat_vec(R, B.axis(b), a);
120
+ else a[0] = a[1] = a[2] = 0.f;
121
+ return;
122
+ }
123
+ #endif
124
+ if (jt == kJntFree) {
125
+ for (int k = 0; k < 3; ++k) { xp[k] = q[B.qadr(b) + k]; r[k] = S(0); }
126
+ for (int k = 0; k < 4; ++k) xq[k] = q[B.qadr(b) + 3 + k];
127
+ quat_normalize(xq);
128
+ } else {
129
+ S Rp[9];
130
+ quat_to_mat(pq, Rp);
131
+ mat_vec(Rp, B.pos(b), r);
132
+ for (int k = 0; k < 3; ++k) xp[k] = pp[k] + r[k];
133
+ quat_mul(pq, B.quat(b), xq);
134
+ if (jt == kJntHinge) {
135
+ using so3::js_sin; using so3::js_cos;
136
+ const S half = q[B.qadr(b)] * S(0.5);
137
+ const S sh = js_sin(half);
138
+ const S ql[4] = {js_cos(half), B.axis(b)[0] * sh, B.axis(b)[1] * sh, B.axis(b)[2] * sh};
139
+ S t[4];
140
+ quat_mul(xq, ql, t);
141
+ for (int k = 0; k < 4; ++k) xq[k] = t[k];
142
+ }
143
+ quat_normalize(xq);
144
+ }
145
+ quat_to_mat(xq, R);
146
+ if (jt == kJntHinge) mat_vec(R, B.axis(b), a);
147
+ else a[0] = a[1] = a[2] = S(0);
148
+ }
149
+
150
+ // adds coef * d/d(q tangent, v) of seed' RNEA(q, v, acc); v == nullptr: v = 0 and no v_bar. scratch: kSlot * kNB S words.
151
+ // PC (the gate's positive controls only, 0 in every real build): 1 drops the gyroscopic term's reverse, 2 maps the root's
152
+ // rotation cotangent as tau instead of R' tau.
153
+ template <class S, int PC = 0, class Tab>
154
+ DN_HOST_DEVICE void adj_rnea(const Tab& B, const S* q, const S* v, const S* acc, bool gravity, const S* seed,
155
+ S coef, S* q_bar, S* v_bar, S* scratch, long long* prof = nullptr) {
156
+ (void)prof;
157
+ S (*slot)[kSlot] = reinterpret_cast<S (*)[kSlot]>(scratch);
158
+ const int nb = B.nb();
159
+ // per-lane values kept from the forward for the reverse
160
+ LANEA(S, R, 9); LANEA(S, r, 3); LANEA(S, rc, 3); LANEA(S, a, 3); LANEA(S, I, 9);
161
+ LANEA(S, w, 3); LANEA(S, al, 3); LANEA(S, wt, 3); LANEA(S, vct, 3); LANEA(S, f, 3); LANEA(S, n, 3);
162
+ LANEA(S, wp, 3); LANEA(S, alp, 3); LANEA(S, wtp, 3);
163
+ LANE1(S, vb); LANE1(S, sb); LANE1(S, ab); LANE1(S, m);
164
+ ADJ_LANES(lane) {
165
+ if (lane == 0) { // the world: at rest, base acceleration -gravity
166
+ S* s = slot[0];
167
+ s[0] = S(1); s[1] = s[2] = s[3] = S(0);
168
+ for (int k = 4; k < kPub; ++k) s[k] = S(0);
169
+ if (gravity) for (int k = 0; k < 3; ++k) s[13 + k] = S(0) - B.gravity(k); // ao at words 13-15
170
+ }
171
+ }
172
+ for (int d = 1; d <= B.maxdepth(); ++d) {
173
+ ADJ_LANES(lane) {
174
+ ADJ_LEAD(lane < nb && B.depth(lane) == d);
175
+ if (lane < nb && B.depth(lane) == d) {
176
+ ADJ_TS(2 + 10 * (d - 1));
177
+ const int b = lane, p = B.parent(b), jt = B.jnt(b);
178
+ const S* ps = slot[p];
179
+ S xq[4], xp[3];
180
+ body_kin(B, b, q, ps, ps + 4, xq, xp, LV(R), LV(r), LV(a));
181
+ ADJ_TS(3 + 10 * (d - 1));
182
+ for (int k = 0; k < 3; ++k) { LV(wp)[k] = ps[7 + k]; LV(alp)[k] = ps[10 + k]; LV(wtp)[k] = ps[16 + k]; }
183
+ const S* aop = ps + 13;
184
+ const S* votp = ps + 19;
185
+ S ao[3], vot[3];
186
+ LV(vb) = S(0); LV(sb) = S(0); LV(ab) = S(0);
187
+ if (jt == kJntFree) {
188
+ const int dd = B.dadr(b);
189
+ S wbody[3] = {v ? v[dd + 3] : S(0), v ? v[dd + 4] : S(0), v ? v[dd + 5] : S(0)};
190
+ S abody[3] = {acc[dd + 3], acc[dd + 4], acc[dd + 5]}, sbody[3] = {seed[dd + 3], seed[dd + 4], seed[dd + 5]};
191
+ S t[3];
192
+ mat_vec(LV(R), wbody, LV(w));
193
+ mat_vec(LV(R), abody, t);
194
+ for (int k = 0; k < 3; ++k) LV(al)[k] = LV(alp)[k] + t[k];
195
+ for (int k = 0; k < 3; ++k) ao[k] = aop[k] + acc[dd + k];
196
+ mat_vec(LV(R), sbody, t);
197
+ for (int k = 0; k < 3; ++k) { LV(wt)[k] = LV(wtp)[k] + t[k]; vot[k] = votp[k] + seed[dd + k]; }
198
+ } else {
199
+ S t1[3], t2[3], t3[3];
200
+ cross3(LV(wp), LV(r), t1);
201
+ cross3(LV(alp), LV(r), t2);
202
+ cross3(LV(wp), t1, t3);
203
+ for (int k = 0; k < 3; ++k) ao[k] = aop[k] + t2[k] + t3[k];
204
+ cross3(LV(wtp), LV(r), t1);
205
+ for (int k = 0; k < 3; ++k) vot[k] = votp[k] + t1[k];
206
+ if (jt == kJntHinge) {
207
+ const int dd = B.dadr(b);
208
+ LV(vb) = v ? v[dd] : S(0); LV(ab) = acc[dd]; LV(sb) = seed[dd];
209
+ S sq[3], c[3];
210
+ for (int k = 0; k < 3; ++k) sq[k] = LV(a)[k] * LV(vb);
211
+ cross3(LV(wp), sq, c);
212
+ for (int k = 0; k < 3; ++k) {
213
+ LV(w)[k] = LV(wp)[k] + sq[k];
214
+ LV(al)[k] = LV(alp)[k] + c[k] + LV(a)[k] * LV(ab);
215
+ LV(wt)[k] = LV(wtp)[k] + LV(a)[k] * LV(sb);
216
+ }
217
+ } else {
218
+ for (int k = 0; k < 3; ++k) { LV(w)[k] = LV(wp)[k]; LV(al)[k] = LV(alp)[k]; LV(wt)[k] = LV(wtp)[k]; }
219
+ }
220
+ }
221
+ ADJ_TS(4 + 10 * (d - 1));
222
+ // COM: rc = R ipos, a_c = ao + al x rc + w x (w x rc), f = m a_c, n = I al + w x I w, vc~ = vo~ + w~ x rc
223
+ LV(m) = B.mass(b);
224
+ mat_vec(LV(R), B.ipos(b), LV(rc));
225
+ S xq2[4], X[9];
226
+ quat_mul(xq, B.iquat(b), xq2);
227
+ quat_to_mat(xq2, X);
228
+ world_inertia(X, B.inertia(b), LV(I));
229
+ S u1[3], u2[3], u3[3], Iw[3], Ial[3], wIw[3];
230
+ cross3(LV(al), LV(rc), u1);
231
+ cross3(LV(w), LV(rc), u2);
232
+ cross3(LV(w), u2, u3);
233
+ for (int k = 0; k < 3; ++k) LV(f)[k] = LV(m) * (ao[k] + u1[k] + u3[k]);
234
+ mat_vec(LV(I), LV(w), Iw);
235
+ mat_vec(LV(I), LV(al), Ial);
236
+ cross3(LV(w), Iw, wIw);
237
+ for (int k = 0; k < 3; ++k) LV(n)[k] = Ial[k] + wIw[k];
238
+ cross3(LV(wt), LV(rc), u1);
239
+ for (int k = 0; k < 3; ++k) LV(vct)[k] = vot[k] + u1[k];
240
+ ADJ_TS(5 + 10 * (d - 1));
241
+ // publish for the children
242
+ S* s = slot[b];
243
+ for (int k = 0; k < 4; ++k) s[k] = xq[k];
244
+ for (int k = 0; k < 3; ++k) {
245
+ s[4 + k] = xp[k]; s[7 + k] = LV(w)[k]; s[10 + k] = LV(al)[k]; s[13 + k] = ao[k]; s[16 + k] = LV(wt)[k];
246
+ s[19 + k] = vot[k];
247
+ }
248
+ ADJ_TS(6 + 10 * (d - 1));
249
+ }
250
+ }
251
+ }
252
+ // reverse, deepest level first: sum the children's messages, add this body's own terms, send the message to the parent
253
+ for (int d = B.maxdepth(); d >= 1; --d) {
254
+ ADJ_LANES(lane) {
255
+ ADJ_LEAD(lane < nb && B.depth(lane) == d);
256
+ if (lane < nb && B.depth(lane) == d) {
257
+ ADJ_TS(7 + 10 * (d - 1));
258
+ const int b = lane, jt = B.jnt(b);
259
+ S xpb[3] = {S(0), S(0), S(0)}, tau[3] = {S(0), S(0), S(0)}, wb[3] = {S(0), S(0), S(0)}, alb[3] = {S(0), S(0), S(0)},
260
+ aob[3] = {S(0), S(0), S(0)}, wtb[3] = {S(0), S(0), S(0)}, vtb[3] = {S(0), S(0), S(0)};
261
+ for (int ci = 0; ci < B.nchild(b); ++ci) { // the children, in increasing index (deterministic order)
262
+ const S* mc = slot[B.child(b, ci)];
263
+ add3(xpb, mc); add3(tau, mc + 3); add3(wb, mc + 6); add3(alb, mc + 9); add3(aob, mc + 12); add3(wtb, mc + 15);
264
+ add3(vtb, mc + 18);
265
+ }
266
+ ADJ_TS(8 + 10 * (d - 1));
267
+ // own terms: s_b = coef (f . vc~ + n . w~)
268
+ {
269
+ S fb[3], nbar[3], vcb[3], acb[3], rcb[3] = {S(0), S(0), S(0)}, Ib[9], t[3], t2[3];
270
+ for (int k = 0; k < 3; ++k) { fb[k] = coef * LV(vct)[k]; nbar[k] = coef * LV(wt)[k]; vcb[k] = coef * LV(f)[k];
271
+ wtb[k] = wtb[k] + coef * LV(n)[k]; acb[k] = LV(m) * fb[k]; }
272
+ // n = I al + w x (I w)
273
+ S Iw[3], nxw[3];
274
+ mat_vec(LV(I), nbar, t);
275
+ add3(alb, t);
276
+ mat_vec(LV(I), LV(w), Iw);
277
+ cross3(nbar, LV(w), nxw);
278
+ if (PC != 1) {
279
+ cross3(Iw, nbar, t);
280
+ add3(wb, t);
281
+ mat_vec(LV(I), nxw, t);
282
+ add3(wb, t);
283
+ }
284
+ for (int i = 0; i < 3; ++i)
285
+ for (int j = 0; j < 3; ++j) Ib[3 * i + j] = nbar[i] * LV(al)[j] + nxw[i] * LV(w)[j];
286
+ // a_c = ao + al x rc + w x (w x rc)
287
+ add3(aob, acb);
288
+ cross3(LV(rc), acb, t); add3(alb, t);
289
+ cross3(acb, LV(al), t); add3(rcb, t);
290
+ S u[3], ub[3];
291
+ cross3(LV(w), LV(rc), u);
292
+ cross3(acb, LV(w), ub);
293
+ cross3(u, acb, t); add3(wb, t);
294
+ cross3(LV(rc), ub, t); add3(wb, t);
295
+ cross3(ub, LV(w), t); add3(rcb, t);
296
+ // vc~ = vo~ + w~ x rc
297
+ add3(vtb, vcb);
298
+ cross3(LV(rc), vcb, t); add3(wtb, t);
299
+ cross3(vcb, LV(wt), t); add3(rcb, t);
300
+ // rotations of the body-attached rc and I: tau += rc x rc_bar + vee(Ib I - I Ib)
301
+ cross3(LV(rc), rcb, t); add3(tau, t);
302
+ S G[9];
303
+ for (int i = 0; i < 3; ++i)
304
+ for (int j = 0; j < 3; ++j) {
305
+ S s1 = S(0), s2 = S(0);
306
+ for (int k = 0; k < 3; ++k) { s1 = s1 + Ib[3 * i + k] * LV(I)[3 * k + j]; s2 = s2 + LV(I)[3 * i + k] * Ib[3 * k + j]; }
307
+ G[3 * i + j] = s1 - s2;
308
+ }
309
+ t2[0] = G[7] - G[5]; t2[1] = G[2] - G[6]; t2[2] = G[3] - G[1];
310
+ add3(tau, t2);
311
+ }
312
+ ADJ_TS(9 + 10 * (d - 1));
313
+ S out[kMsg];
314
+ for (int k = 0; k < kMsg; ++k) out[k] = S(0);
315
+ if (jt == kJntFree) {
316
+ const int dd = B.dadr(b);
317
+ S t[3];
318
+ // w = R w_body, al = al_p + R acc_ang, w~ = w~_p + R seed_ang; ao, vo~ carry no q / v dependence of their own
319
+ cross3(LV(w), wb, t); add3(tau, t);
320
+ S alown[3] = {LV(al)[0] - LV(alp)[0], LV(al)[1] - LV(alp)[1], LV(al)[2] - LV(alp)[2]};
321
+ cross3(alown, alb, t); add3(tau, t);
322
+ S wtown[3] = {LV(wt)[0] - LV(wtp)[0], LV(wt)[1] - LV(wtp)[1], LV(wt)[2] - LV(wtp)[2]};
323
+ cross3(wtown, wtb, t); add3(tau, t);
324
+ if (v_bar) { mat_tvec(LV(R), wb, t); for (int k = 0; k < 3; ++k) v_bar[dd + 3 + k] = v_bar[dd + 3 + k] + t[k]; }
325
+ if (PC == 2) for (int k = 0; k < 3; ++k) t[k] = tau[k];
326
+ else mat_tvec(LV(R), tau, t);
327
+ for (int k = 0; k < 3; ++k) { q_bar[dd + k] = q_bar[dd + k] + xpb[k]; q_bar[dd + 3 + k] = q_bar[dd + 3 + k] + t[k]; }
328
+ // the root's parent is the world: its message is not needed
329
+ } else {
330
+ S t[3], rb[3] = {xpb[0], xpb[1], xpb[2]};
331
+ S* ow = out + 6; S* oal = out + 9; S* oao = out + 12; S* owt = out + 15; S* ovt = out + 18;
332
+ // ao = ao_p + al_p x r + w_p x (w_p x r)
333
+ add3(oao, aob);
334
+ cross3(LV(r), aob, t); add3(oal, t);
335
+ cross3(aob, LV(alp), t); add3(rb, t);
336
+ S u[3], ub[3];
337
+ cross3(LV(wp), LV(r), u);
338
+ cross3(aob, LV(wp), ub);
339
+ cross3(u, aob, t); add3(ow, t);
340
+ cross3(LV(r), ub, t); add3(ow, t);
341
+ cross3(ub, LV(wp), t); add3(rb, t);
342
+ // vo~ = vo~_p + w~_p x r
343
+ add3(ovt, vtb);
344
+ cross3(LV(r), vtb, t); add3(owt, t);
345
+ cross3(vtb, LV(wtp), t); add3(rb, t);
346
+ if (jt == kJntHinge) {
347
+ const int dd = B.dadr(b);
348
+ S ab3[3] = {S(0), S(0), S(0)}, sq[3], sqb[3];
349
+ // w = w_p + a v, al = al_p + w_p x (a v) + a acc, w~ = w~_p + a seed
350
+ add3(ow, wb); add3(oal, alb); add3(owt, wtb);
351
+ for (int k = 0; k < 3; ++k) { ab3[k] = LV(vb) * wb[k] + LV(ab) * alb[k] + LV(sb) * wtb[k]; sq[k] = LV(a)[k] * LV(vb); }
352
+ cross3(sq, alb, t); add3(ow, t);
353
+ cross3(alb, LV(wp), sqb);
354
+ for (int k = 0; k < 3; ++k) ab3[k] = ab3[k] + LV(vb) * sqb[k];
355
+ if (v_bar) v_bar[dd] = v_bar[dd] + dot3(LV(a), wb) + dot3(LV(a), sqb);
356
+ cross3(LV(a), ab3, t); add3(tau, t); // a = R axis
357
+ q_bar[dd] = q_bar[dd] + dot3(LV(a), tau);
358
+ } else {
359
+ add3(ow, wb); add3(oal, alb); add3(owt, wtb);
360
+ }
361
+ // xpos = xpos_p + r, r = R_p pos: the parent's position and rotation
362
+ for (int k = 0; k < 3; ++k) out[k] = xpb[k];
363
+ cross3(LV(r), rb, t);
364
+ for (int k = 0; k < 3; ++k) out[3 + k] = tau[k] + t[k];
365
+ }
366
+ if (jt != kJntFree) for (int k = 0; k < kMsg; ++k) slot[b][k] = out[k]; // read by the parent in the next phase
367
+ ADJ_TS(10 + 10 * (d - 1));
368
+ }
369
+ }
370
+ }
371
+ ADJ_LANES(lane) {
372
+ ADJ_LEAD(lane == 0);
373
+ ADJ_TS(kProf - 1);
374
+ }
375
+ }
376
+
377
+ // adds the pull-back of xpos_bar[b] (world, body origin) and xrot_bar[b] (world rotation-vector cotangent, dR_b = [dtheta]x R_b),
378
+ // nb x 3 each, through fk to the q tangent. scratch: kSlot * kNB S words.
379
+ template <class S, class Tab>
380
+ DN_HOST_DEVICE void adj_fk_pullback(const Tab& B, const S* q, const S* xpos_bar, const S* xrot_bar, S* q_bar,
381
+ S* scratch, long long* prof = nullptr) {
382
+ (void)prof;
383
+ S (*slot)[kSlot] = reinterpret_cast<S (*)[kSlot]>(scratch);
384
+ const int nb = B.nb();
385
+ LANEA(S, R, 9); LANEA(S, r, 3); LANEA(S, a, 3);
386
+ ADJ_LANES(lane) {
387
+ if (lane == 0) { S* s = slot[0]; s[0] = S(1); for (int k = 1; k < 7; ++k) s[k] = S(0); }
388
+ }
389
+ for (int d = 1; d <= B.maxdepth(); ++d) {
390
+ ADJ_LANES(lane) {
391
+ if (lane < nb && B.depth(lane) == d) {
392
+ const int b = lane;
393
+ const S* ps = slot[B.parent(b)];
394
+ S xq[4], xp[3];
395
+ body_kin(B, b, q, ps, ps + 4, xq, xp, LV(R), LV(r), LV(a));
396
+ for (int k = 0; k < 4; ++k) slot[b][k] = xq[k];
397
+ for (int k = 0; k < 3; ++k) slot[b][4 + k] = xp[k];
398
+ }
399
+ }
400
+ }
401
+ for (int d = B.maxdepth(); d >= 1; --d) {
402
+ ADJ_LANES(lane) {
403
+ if (lane < nb && B.depth(lane) == d) {
404
+ const int b = lane, jt = B.jnt(b);
405
+ S xpb[3], tau[3], t[3];
406
+ for (int k = 0; k < 3; ++k) { xpb[k] = xpos_bar[3 * b + k]; tau[k] = xrot_bar[3 * b + k]; }
407
+ for (int ci = 0; ci < B.nchild(b); ++ci) { // the children, in increasing index
408
+ const S* mc = slot[B.child(b, ci)];
409
+ add3(xpb, mc); add3(tau, mc + 3);
410
+ }
411
+ if (jt == kJntFree) {
412
+ const int dd = B.dadr(b);
413
+ mat_tvec(LV(R), tau, t);
414
+ for (int k = 0; k < 3; ++k) { q_bar[dd + k] = q_bar[dd + k] + xpb[k]; q_bar[dd + 3 + k] = q_bar[dd + 3 + k] + t[k]; }
415
+ } else {
416
+ if (jt == kJntHinge) q_bar[B.dadr(b)] = q_bar[B.dadr(b)] + dot3(LV(a), tau);
417
+ cross3(LV(r), xpb, t);
418
+ for (int k = 0; k < 3; ++k) { slot[b][k] = xpb[k]; slot[b][3 + k] = tau[k] + t[k]; }
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+
425
+ } // namespace js::soft::adj