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.
- diffneusim/__init__.py +1 -0
- diffneusim/_cache.py +42 -0
- diffneusim/_paths.py +5 -0
- diffneusim/bindings/rew14_ext.cu +115 -0
- diffneusim/bindings/soft14_capi.cpp +443 -0
- diffneusim/bindings/soft14_engine_ext.cu +596 -0
- diffneusim/bindings/soft_capi.cpp +782 -0
- diffneusim/bindings/soft_engine_ext.cu +495 -0
- diffneusim/core/cpu_engine/build.sh +40 -0
- diffneusim/core/cpu_engine/fiber/cuda_runtime.h +445 -0
- diffneusim/core/cpu_engine/x14_cpu.cpp +283 -0
- diffneusim/core/diff/dual.h +126 -0
- diffneusim/core/include/diffneusim/macros.h +35 -0
- diffneusim/core/kin/kinematic_tree.h +273 -0
- diffneusim/core/math/so3.h +182 -0
- diffneusim/core/soft/adj/out_adj.h +102 -0
- diffneusim/core/soft/adj/rnea_adj.h +425 -0
- diffneusim/core/soft/adj/rows_adj.h +439 -0
- diffneusim/core/soft/adj/rows_functor.h +89 -0
- diffneusim/core/soft/adj/rows_lanes.h +443 -0
- diffneusim/core/soft/adj/shell_adj.h +243 -0
- diffneusim/core/soft/adj/tree_adj.h +356 -0
- diffneusim/core/soft/collide.h +183 -0
- diffneusim/core/soft/gpu/adj14.cuh +233 -0
- diffneusim/core/soft/gpu/adj14_mus.cuh +98 -0
- diffneusim/core/soft/gpu/adj_shell.cuh +50 -0
- diffneusim/core/soft/gpu/adj_tab.cuh +49 -0
- diffneusim/core/soft/gpu/body14.cuh +47 -0
- diffneusim/core/soft/gpu/chol_rn.cuh +458 -0
- diffneusim/core/soft/gpu/chol_small.cuh +123 -0
- diffneusim/core/soft/gpu/chol_split.cuh +193 -0
- diffneusim/core/soft/gpu/engine_launch.cuh +263 -0
- diffneusim/core/soft/gpu/fk_rn.cuh +109 -0
- diffneusim/core/soft/gpu/generated/body_019e20820f86_mmfloor.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_62f77a4bb16b_mmfloor.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +28 -0
- diffneusim/core/soft/gpu/generated/body_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +52 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor.cuh +25 -0
- diffneusim/core/soft/gpu/generated/body_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +25 -0
- diffneusim/core/soft/gpu/generated/g1_soft_5db44fd45286.cuh +74 -0
- diffneusim/core/soft/gpu/generated/split_62f77a4bb16b_mmfloor.cuh +18 -0
- diffneusim/core/soft/gpu/generated/split_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +18 -0
- diffneusim/core/soft/gpu/generated/x14_soft_019e20820f86_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_62f77a4bb16b_mmfloor.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_77dbb7213f26_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsd05_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsdef_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_8989b60e4486_mmfloor_rhlsmjd_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a1e8b196b2cd_mmfloor_rampsb3l_n6t12.cuh +129 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor.cuh +123 -0
- diffneusim/core/soft/gpu/generated/x14_soft_a944653edd64_mmfloor_rampsb3l_n6t12.cuh +123 -0
- diffneusim/core/soft/gpu/k_mus.cuh +1038 -0
- diffneusim/core/soft/gpu/k_mus_host.cuh +377 -0
- diffneusim/core/soft/gpu/k_pre.cuh +52 -0
- diffneusim/core/soft/gpu/kernel_p.cuh +490 -0
- diffneusim/core/soft/gpu/kp14.cuh +465 -0
- diffneusim/core/soft/gpu/l2v2.cuh +367 -0
- diffneusim/core/soft/gpu/l2x14.cuh +319 -0
- diffneusim/core/soft/gpu/l3.cuh +1483 -0
- diffneusim/core/soft/gpu/model_view.cuh +48 -0
- diffneusim/core/soft/gpu/mus_case_fits.h +15 -0
- diffneusim/core/soft/gpu/mus_classes.h +182 -0
- diffneusim/core/soft/gpu/mus_row_cf.h +44 -0
- diffneusim/core/soft/gpu/rew14.cuh +177 -0
- diffneusim/core/soft/gpu/rows_ctab.cuh +44 -0
- diffneusim/core/soft/gpu/tree_m.cuh +247 -0
- diffneusim/core/soft/gpu/x14_engine_kernels.cuh +260 -0
- diffneusim/core/soft/gpu/x14_rowcf.h +14 -0
- diffneusim/core/soft/hand.h +124 -0
- diffneusim/core/soft/impedance.h +115 -0
- diffneusim/core/soft/jvp.h +202 -0
- diffneusim/core/soft/kin.h +250 -0
- diffneusim/core/soft/muscle.h +1208 -0
- diffneusim/core/soft/newton.h +371 -0
- diffneusim/core/soft/rows.h +176 -0
- diffneusim/core/soft/step.h +188 -0
- diffneusim/core/soft/tape.h +313 -0
- diffneusim/core/soft/x14/collide14.h +69 -0
- diffneusim/core/soft/x14/jvp14.h +182 -0
- diffneusim/core/soft/x14/law14.h +453 -0
- diffneusim/core/soft/x14adj/collide14_adj.h +134 -0
- diffneusim/core/soft/x14adj/passive14_adj.h +162 -0
- diffneusim/core/soft/x14adj/reward14.h +484 -0
- diffneusim/core/soft/x14adj/rows14_adj.h +400 -0
- diffneusim/core/soft/x14adj/scan14.h +349 -0
- diffneusim/core/soft/x14adj/shell14_adj.h +122 -0
- diffneusim/core/soft/x14adj/sweep14.h +255 -0
- diffneusim/core/soft/x14adj/tree14_adj.h +500 -0
- diffneusim/core/soft/x14adj/x14adj_common.h +96 -0
- diffneusim/data/mirror/H1622v2k_geyer_hfdeq.npz +0 -0
- diffneusim/data/mirror/H1622v2k_hfd.npz +0 -0
- diffneusim/data/mirror/H1622v2k_millard_hfdeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_p2str_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_calf2_pe.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01legs.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_jd01lumbar.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfix.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_lumbfixlegs01.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_hinge.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1a.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n2.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_rom23.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_fusedhand_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_millard.npz +0 -0
- diffneusim/data/mirror/fullbody_contact_spinecoupled_lspine_girdle_osimeq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_compound_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_luispe.npz +0 -0
- diffneusim/data/mirror/myoleg26_3d_kneeexp_g14eq_trunkpose_spin_ank30_hip30_trunk0701.npz +0 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_axfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01legs.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_jd01lumbar.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfix.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_lumbfixlegs01.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n1a.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_n2.json +91 -0
- diffneusim/data/muscle_fit/wang_mass_volume_14t_rom23.json +91 -0
- diffneusim/data/reference/musclemimic/myofullbody_mimic_sites.json +261 -0
- diffneusim/data/reference/pose3/pose3_scone.json +305 -0
- diffneusim/data/reference/pose3/pose3_scone.txt +3 -0
- diffneusim/data/reference/pose3/pose3_scone_gait.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_mirror.npz +0 -0
- diffneusim/data/reference/pose3/pose3_scone_stand.npz +0 -0
- diffneusim/data/reference/x016run/MD5SUMS +241 -0
- diffneusim/data/reference/x016run/x016run_states.txt +240 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p00_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s4_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p25_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p50_s7_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s0_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s1_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s2_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s3_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s5_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s6_r3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_l3.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r0.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r1.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r2.npz +0 -0
- diffneusim/data/reference/x016run/x016run_v3p75_s7_r3.npz +0 -0
- diffneusim/data/state_prior/lumbar_poly_fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc.npz +0 -0
- diffneusim/engine/__init__.py +0 -0
- diffneusim/engine/build_tag.py +52 -0
- diffneusim/engine/case_tables.py +46 -0
- diffneusim/engine/d16_body.py +80 -0
- diffneusim/engine/engine14.py +367 -0
- diffneusim/engine/gen_split.py +159 -0
- diffneusim/engine/hand_format.py +69 -0
- diffneusim/engine/live14.py +149 -0
- diffneusim/engine/phase_b_tree.py +137 -0
- diffneusim/engine/soft14.py +130 -0
- diffneusim/engine/soft_capi.py +373 -0
- diffneusim/engine/soft_engine.py +165 -0
- diffneusim/engine/step14.py +132 -0
- diffneusim/engine/tape_format.py +89 -0
- diffneusim/engine/x14cpu.py +163 -0
- diffneusim/env/__init__.py +0 -0
- diffneusim/env/absent.py +20 -0
- diffneusim/env/cpu14.py +105 -0
- diffneusim/env/e0loop14.py +224 -0
- diffneusim/env/env14.py +568 -0
- diffneusim/env/kin_contact14.py +193 -0
- diffneusim/env/mimic_sites_x14.json +366 -0
- diffneusim/env/old_count.py +78 -0
- diffneusim/env/rew14.py +114 -0
- diffneusim/env/rew14_hook.py +105 -0
- diffneusim/g1/__init__.py +1 -0
- diffneusim/g1/arm_a2.py +165 -0
- diffneusim/g1/arm_a3.py +576 -0
- diffneusim/g1/read_a3.py +79 -0
- diffneusim/g1/rg1_read.py +89 -0
- diffneusim/model/__init__.py +66 -0
- diffneusim/model/case.py +17 -0
- diffneusim/model/dnmodel.py +79 -0
- diffneusim/model/fuse_fixed.py +281 -0
- diffneusim/model/monitor.py +834 -0
- diffneusim/models/BODIES.toml +48 -0
- diffneusim/models/MANIFEST.toml +979 -0
- diffneusim/models/cases/G290/case.bin +0 -0
- diffneusim/models/cases/G290/case.json +1 -0
- diffneusim/models/cases/G356-SRC/case.bin +0 -0
- diffneusim/models/cases/G356-SRC/case.json +1 -0
- diffneusim/models/cases/G416/case.bin +0 -0
- diffneusim/models/cases/G416/case.json +1 -0
- diffneusim/models/cases/M290C-SRC/case.bin +0 -0
- diffneusim/models/cases/M290C-SRC/case.json +1 -0
- diffneusim/models/cases/M290R-SRC/case.bin +0 -0
- diffneusim/models/cases/M290R-SRC/case.json +1 -0
- diffneusim/models/cases/M356C-SRC/case.bin +0 -0
- diffneusim/models/cases/M356C-SRC/case.json +1 -0
- diffneusim/models/cases/M356R-SRC/case.bin +0 -0
- diffneusim/models/cases/M356R-SRC/case.json +1 -0
- diffneusim/models/cases/M416C-SRC/case.bin +0 -0
- diffneusim/models/cases/M416C-SRC/case.json +1 -0
- diffneusim/models/derived/d16_expanded_62f77a4bb16b1e67_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_expanded_a1e8b196b2cd7b3c_mmfloor.xml +673 -0
- diffneusim/models/derived/d16_soft_law_019e20820f8633b9_mmfloor.json +7844 -0
- diffneusim/models/derived/d16_soft_law_62f77a4bb16b1e67_mmfloor.json +16855 -0
- diffneusim/models/derived/d16_soft_law_77dbb7213f26e821_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rampsb3l_n6t12.json +7883 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsd05_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsdef_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_8989b60e44860c5b_mmfloor_rhlsmjd_n6t12.json +7868 -0
- diffneusim/models/derived/d16_soft_law_a1e8b196b2cd7b3c_mmfloor_rampsb3l_n6t12.json +16894 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor.json +12655 -0
- diffneusim/models/derived/d16_soft_law_a944653edd642082_mmfloor_rampsb3l_n6t12.json +12700 -0
- diffneusim/models/derived/unitree_g1_soft_law.json +15580 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +28913 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +29202 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_axfixlegs01.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_armless_ball_lspine_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +46970 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src.dnmodel +38570 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid.dnmodel +38923 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_millard_stickspin_wrapvia_mtp60k25_trunkfix_toepair_n1_src_rigid_qk.txt +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1.dnmodel +1 -0
- diffneusim/models/fullbody_contact_spinecoupled_fusedhand_ball_lspine_girdle_osimeq_stickspin_wrapvia_mtp60k25_trunkfix_calf2_pe_toepair_flsrc_n1_qk.txt +1 -0
- diffneusim/models/fullbody_meshes/1mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2distph.stl +0 -0
- diffneusim/models/fullbody_meshes/2mc.stl +0 -0
- diffneusim/models/fullbody_meshes/2midph.stl +0 -0
- diffneusim/models/fullbody_meshes/2proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/3distph.stl +0 -0
- diffneusim/models/fullbody_meshes/3mc.stl +0 -0
- diffneusim/models/fullbody_meshes/3midph.stl +0 -0
- diffneusim/models/fullbody_meshes/3proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/4distph.stl +0 -0
- diffneusim/models/fullbody_meshes/4mc.stl +0 -0
- diffneusim/models/fullbody_meshes/4midph.stl +0 -0
- diffneusim/models/fullbody_meshes/4proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/5distph.stl +0 -0
- diffneusim/models/fullbody_meshes/5mc.stl +0 -0
- diffneusim/models/fullbody_meshes/5midph.stl +0 -0
- diffneusim/models/fullbody_meshes/5proxph.stl +0 -0
- diffneusim/models/fullbody_meshes/NOTICE +2 -0
- diffneusim/models/fullbody_meshes/capitate.stl +0 -0
- diffneusim/models/fullbody_meshes/clavicle.stl +0 -0
- diffneusim/models/fullbody_meshes/hamate.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_cervical.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_jaw.stl +0 -0
- diffneusim/models/fullbody_meshes/hat_skull.stl +0 -0
- diffneusim/models/fullbody_meshes/humerus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/l_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/l_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/l_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/l_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/l_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/l_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar1.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar2.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar3.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar4.stl +0 -0
- diffneusim/models/fullbody_meshes/lumbar5.stl +0 -0
- diffneusim/models/fullbody_meshes/lunate.stl +0 -0
- diffneusim/models/fullbody_meshes/pisiform.stl +0 -0
- diffneusim/models/fullbody_meshes/r_bofoot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_femur.stl +0 -0
- diffneusim/models/fullbody_meshes/r_fibula.stl +0 -0
- diffneusim/models/fullbody_meshes/r_foot.stl +0 -0
- diffneusim/models/fullbody_meshes/r_patella.stl +0 -0
- diffneusim/models/fullbody_meshes/r_pelvis.stl +0 -0
- diffneusim/models/fullbody_meshes/r_talus.stl +0 -0
- diffneusim/models/fullbody_meshes/r_tibia.stl +0 -0
- diffneusim/models/fullbody_meshes/radius.stl +0 -0
- diffneusim/models/fullbody_meshes/sacrum.stl +0 -0
- diffneusim/models/fullbody_meshes/scaphoid.stl +0 -0
- diffneusim/models/fullbody_meshes/scapula.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic10_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic11_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic12_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic1_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic2_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic3_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic4_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic5_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic6_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic7_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic8_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thoracic9_s.stl +0 -0
- diffneusim/models/fullbody_meshes/thorax.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbdist.stl +0 -0
- diffneusim/models/fullbody_meshes/thumbprox.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezium.stl +0 -0
- diffneusim/models/fullbody_meshes/trapezoid.stl +0 -0
- diffneusim/models/fullbody_meshes/triquetrum.stl +0 -0
- diffneusim/models/fullbody_meshes/ulna.stl +0 -0
- diffneusim/models/source/myo_fullbody/UPSTREAM.md +91 -0
- diffneusim/models/source/myoleg/UPSTREAM.md +52 -0
- diffneusim/models/source/unitree_g1/LICENSE.mjlab +202 -0
- diffneusim/models/source/unitree_g1/UPSTREAM.md +38 -0
- diffneusim/models/source/unitree_g1/assets/head_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/left_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/logo_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/pelvis_contour_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_ankle_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_elbow_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_hip_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_knee_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_rubber_hand.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_shoulder_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_pitch_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_roll_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/right_wrist_yaw_link.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/torso_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_roll_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/assets/waist_yaw_link_rev_1_0.STL +0 -0
- diffneusim/models/source/unitree_g1/dump_mjlab_reference.py +30 -0
- diffneusim/models/source/unitree_g1/g1.xml +308 -0
- diffneusim/models/source/unitree_g1/g1_constants.py +298 -0
- diffneusim/models/source/unitree_g1/mjlab_compiled_reference.json +857 -0
- diffneusim/models/unitree_g1.dnmodel +4393 -0
- diffneusim/models/unitree_g1_selfcol.dnmodel +20824 -0
- diffneusim/rl/__init__.py +2 -0
- diffneusim/rl/dynsyn_layer.py +146 -0
- diffneusim/rl/footstep_plan.py +337 -0
- diffneusim/rl/g1_bm_env.py +572 -0
- diffneusim/rl/g1_bm_eval.py +168 -0
- diffneusim/rl/g1_bm_fused.py +275 -0
- diffneusim/rl/g1_bm_ppo.py +622 -0
- diffneusim/rl/g1_bm_sapo.py +551 -0
- diffneusim/rl/g1_ppo.py +395 -0
- diffneusim/rl/g1_sapo_soft.py +240 -0
- diffneusim/rl/g1_soft_env.py +452 -0
- diffneusim/rl/g1_soft_grad.py +145 -0
- diffneusim/rl/geyer_curves_torch.py +108 -0
- diffneusim/rl/gpu_fullbody_vec_env.py +1241 -0
- diffneusim/rl/imitation.py +2027 -0
- diffneusim/rl/imitation_reward_v2.py +248 -0
- diffneusim/rl/imitation_reward_v3.py +349 -0
- diffneusim/rl/latent_task.py +175 -0
- diffneusim/rl/llc_reward.py +316 -0
- diffneusim/rl/millard_curves_torch.py +154 -0
- diffneusim/rl/mirror_symmetry.py +212 -0
- diffneusim/rl/model_path.py +35 -0
- diffneusim/rl/mvae_recon.py +123 -0
- diffneusim/rl/nets_shac.py +599 -0
- diffneusim/rl/reset_pool.py +154 -0
- diffneusim/rl/sapo_capture.py +873 -0
- diffneusim/rl/sapo_vec.py +1051 -0
- diffneusim/rl/shac_vec.py +346 -0
- diffneusim/rl/state_prior.py +151 -0
- diffneusim/rl/step_library.py +105 -0
- diffneusim/rl/task_walk_env.py +1793 -0
- diffneusim/rl/task_walk_reward.py +3300 -0
- diffneusim/run.py +23 -0
- diffneusim/run_env.py +46 -0
- diffneusim/tasks/__init__.py +147 -0
- diffneusim/tasks/legacy_names.py +63 -0
- diffneusim/tasks/paths.py +79 -0
- diffneusim/tasks/settings.py +202 -0
- diffneusim/third_party/instantmimic_947430ee/LICENSE +202 -0
- diffneusim/third_party/instantmimic_947430ee/NOTICE +19 -0
- diffneusim/third_party/instantmimic_947430ee/README.md +31 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/benchmark_protocol.py +106 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/metrics.py +214 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/envs/unitree_g1/tasks/beyondmimic_tracking/reference.py +513 -0
- diffneusim/third_party/instantmimic_947430ee/instantmimic/motion/quaternion.py +193 -0
- diffneusim/train/__init__.py +0 -0
- diffneusim/train/eval_ckpt.py +239 -0
- diffneusim/train/eval_mimic.py +133 -0
- diffneusim/train/gait_report.py +203 -0
- diffneusim/train/gcot_chain.py +51 -0
- diffneusim/train/levers.py +135 -0
- diffneusim/train/masked_reset.py +314 -0
- diffneusim/train/rl_algorithm_suite.py +917 -0
- diffneusim/train/train14.py +240 -0
- diffneusim/train/train_tw14.py +674 -0
- diffneusim/viz/__init__.py +5 -0
- diffneusim/viz/__main__.py +41 -0
- diffneusim/viz/camera.py +115 -0
- diffneusim/viz/dnrec.py +118 -0
- diffneusim/viz/dnrec_io.py +686 -0
- diffneusim/viz/hud.py +565 -0
- diffneusim/viz/meshes.py +458 -0
- diffneusim/viz/play.py +237 -0
- diffneusim/viz/record.py +74 -0
- diffneusim/viz/render.py +1402 -0
- diffneusim/viz/renderer.py +268 -0
- diffneusim/viz/rl_env_render.py +635 -0
- diffneusim/viz/snapshot.py +54 -0
- diffneusim/viz/strobe.py +124 -0
- diffneusim/viz/to_mp4.py +58 -0
- diffneusim/viz/ui.py +481 -0
- diffneusim/viz/viewer.py +2086 -0
- diffneusim-1.0.0.dist-info/METADATA +226 -0
- diffneusim-1.0.0.dist-info/RECORD +682 -0
- diffneusim-1.0.0.dist-info/WHEEL +5 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSE +201 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-ARMS-hand-wrist-4.3.txt +20 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/BSD-3-Clause-NC-MoBL-ARMS.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/CC-BY-3.0-OpenSim-geometry.txt +25 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Christophy2012-lumbarspine.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lai2017-model-high-flex.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Lee2015-hand_muscle.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Rajagopal2016-full_body.txt +11 -0
- diffneusim-1.0.0.dist-info/licenses/LICENSES/MIT-Uhlrich2022-fbmodpassivecal.txt +10 -0
- diffneusim-1.0.0.dist-info/licenses/NOTICE +274 -0
- diffneusim-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// Host-side upload of a muscle case's tables for k_mus / muscle_adj / muscle_adj_taped (agent F): the case muscle_ref_gate
|
|
3
|
+
// --export-gpu writes (tools/d16/muscle_ref/kmus_gate.py load_case: the 52 arrays in its fixed order; the tables are a[0..42]
|
|
4
|
+
// and the perm a[51]), plus the per-entry records (fix 5 (i)) built here as the model build makes them. Shared by the test
|
|
5
|
+
// binding, the adjoint test binding and the engine binding, so every caller builds the same tables.
|
|
6
|
+
#include <cuda_runtime.h>
|
|
7
|
+
|
|
8
|
+
#include <cstdio>
|
|
9
|
+
#include <cstdlib>
|
|
10
|
+
#include <vector>
|
|
11
|
+
|
|
12
|
+
#include "k_mus.cuh"
|
|
13
|
+
#include "mus_case_fits.h"
|
|
14
|
+
#if defined(D16_BODY_ROW_CF)
|
|
15
|
+
#include "mus_row_cf.h" // the row's closed form: the entry codes (no CUDA dependency)
|
|
16
|
+
#endif
|
|
17
|
+
#if defined(D16_BODY_MUS_SPLIT)
|
|
18
|
+
#include "mus_classes.h" // the muscle split's host derivation (no CUDA dependency)
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
namespace js::soft::gpu {
|
|
22
|
+
|
|
23
|
+
// dims, in kmus_gate.py's order
|
|
24
|
+
enum MusDim { kMusNQ, kMusNV, kMusNM, kMusNSITE, kMusNSLOT, kMusNLEV, kMusNROUND, kMusNNZ, kMusNJE, kMusNSEED, kMusNGENT, kMusNW, kMusKD };
|
|
25
|
+
|
|
26
|
+
// device allocations freed together; up(h, n) copies n elements from the host (h null: uninitialized)
|
|
27
|
+
struct MusPool {
|
|
28
|
+
std::vector<void*> p;
|
|
29
|
+
MusPool() = default;
|
|
30
|
+
MusPool(const MusPool&) = delete;
|
|
31
|
+
MusPool& operator=(const MusPool&) = delete;
|
|
32
|
+
~MusPool() { for (void* x : p) cudaFree(x); }
|
|
33
|
+
template <class X> X* up(const void* h, size_t n) {
|
|
34
|
+
X* d = nullptr;
|
|
35
|
+
if (cudaMalloc(&d, n * sizeof(X) + 64) != cudaSuccess) return nullptr;
|
|
36
|
+
p.push_back(d);
|
|
37
|
+
if (h && n) cudaMemcpy(d, h, n * sizeof(X), cudaMemcpyHostToDevice);
|
|
38
|
+
return d;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// MusBall's host lists (k_mus.cuh): muscle m's joint entries on a ball, in entry order, as (jent_slot[e], vadr[jent_body[e]]).
|
|
43
|
+
// The engine binding and mus_upload_tables both build them here. KMUS_BALL_PLANT 1 (gate builds only) drops each muscle's last
|
|
44
|
+
// ball entry, which the bitwise gate must catch.
|
|
45
|
+
#ifndef KMUS_BALL_PLANT
|
|
46
|
+
#define KMUS_BALL_PLANT 0
|
|
47
|
+
#endif
|
|
48
|
+
inline void mus_ball_list(int nm, const int* jent_off, const int* jent_body, const int* jent_slot, const int* body_jtype,
|
|
49
|
+
const int* vadr, std::vector<int>& off, std::vector<int>& sv) {
|
|
50
|
+
off.assign(static_cast<size_t>(nm) + 1, 0);
|
|
51
|
+
sv.clear();
|
|
52
|
+
for (int m = 0; m < nm; ++m) {
|
|
53
|
+
int last = -1;
|
|
54
|
+
for (int e = jent_off[m]; e < jent_off[m + 1]; ++e)
|
|
55
|
+
if (body_jtype[jent_body[e]] == js::soft::kMJBall) last = e;
|
|
56
|
+
int prev = -1, hits = 0;
|
|
57
|
+
for (int e = jent_off[m]; e < jent_off[m + 1]; ++e) {
|
|
58
|
+
if (body_jtype[jent_body[e]] != js::soft::kMJBall) continue;
|
|
59
|
+
if (KMUS_BALL_PLANT == 1 && e == last) continue;
|
|
60
|
+
if (e <= prev) { std::fprintf(stderr, "mus_ball_list: muscle %d entry %d out of order\n", m, e); std::abort(); }
|
|
61
|
+
prev = e;
|
|
62
|
+
sv.push_back(jent_slot[e]);
|
|
63
|
+
sv.push_back(vadr[jent_body[e]]);
|
|
64
|
+
}
|
|
65
|
+
off[static_cast<size_t>(m) + 1] = static_cast<int>(sv.size() / 2);
|
|
66
|
+
// the review: the list's length equals the old loop's ball hits, counted independently (a duplicated or moved entry would
|
|
67
|
+
// leave the outputs bitwise, since its writes repeat or land on distinct slots, so it must fail here instead)
|
|
68
|
+
for (int e = jent_off[m]; e < jent_off[m + 1]; ++e) hits += body_jtype[jent_body[e]] == js::soft::kMJBall ? 1 : 0;
|
|
69
|
+
const int len = off[static_cast<size_t>(m) + 1] - off[static_cast<size_t>(m)];
|
|
70
|
+
if (len != hits - (KMUS_BALL_PLANT == 1 && hits > 0 ? 1 : 0)) {
|
|
71
|
+
std::fprintf(stderr, "mus_ball_list: muscle %d lists %d ball entries, the tables have %d\n", m, len, hits);
|
|
72
|
+
std::abort();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#ifdef D16_X14_MILLARD
|
|
78
|
+
// The Millard 2013 case's eleven arrays (muscle_ref_gate --export-gpu appends them for a Millard model; kmus_gate.py MILLARD, in this
|
|
79
|
+
// order): law [3] (kLawMillard, K sets, NC curves: 4 per set, then the muscles' own passive curves), mset [nm], pen_h, lce_min,
|
|
80
|
+
// pfl_a, pfl_b [nm], mc_i [NC][2], mc_f [NC][8], mc_knot [nk][3], mc_sinmax [K], pfl_curve [nm]. Checked on the host (the kernels
|
|
81
|
+
// carry no device asserts): the law, every muscle's set and passive curve in range, every curve at least 2 knots inside the knot
|
|
82
|
+
// array. Returns K, NC and the knot count nk.
|
|
83
|
+
inline void mus_millard_check(int nm, const int* law, const int* mset, const int* mc_i, const int* pfl_curve, int& K, int& NC, int& nk) {
|
|
84
|
+
if (law[0] != kLawMillard || law[1] < 1 || law[2] < 4 * law[1]) {
|
|
85
|
+
std::fprintf(stderr, "mus_millard_check: law %d, %d sets, %d curves\n", law[0], law[1], law[2]); std::abort();
|
|
86
|
+
}
|
|
87
|
+
K = law[1]; NC = law[2];
|
|
88
|
+
nk = 0;
|
|
89
|
+
for (int i = 0; i < NC; ++i) {
|
|
90
|
+
if (mc_i[2 * i] < 0 || mc_i[2 * i + 1] < 2) { std::fprintf(stderr, "mus_millard_check: curve %d\n", i); std::abort(); }
|
|
91
|
+
if (mc_i[2 * i] + mc_i[2 * i + 1] > nk) nk = mc_i[2 * i] + mc_i[2 * i + 1];
|
|
92
|
+
}
|
|
93
|
+
for (int m = 0; m < nm; ++m) {
|
|
94
|
+
if (mset[m] < 0 || mset[m] >= K) { std::fprintf(stderr, "mus_millard_check: muscle %d set %d of %d\n", m, mset[m], K); std::abort(); }
|
|
95
|
+
const bool own = pfl_curve[m] >= 4 * K && pfl_curve[m] < NC, set = pfl_curve[m] == 4 * mset[m] + kMCurvePFL;
|
|
96
|
+
if (!own && !set) { std::fprintf(stderr, "mus_millard_check: muscle %d passive curve %d\n", m, pfl_curve[m]); std::abort(); }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
// a: the case's host arrays (T for the float tables, int32 for the integer ones), dm: its dims. NQ / NV are the model's.
|
|
102
|
+
// A Millard build (-DD16_X14_MILLARD) also reads the law's eleven arrays at a[52 ..] (mus_millard_check).
|
|
103
|
+
template <class T, int NQ, int NV>
|
|
104
|
+
void mus_upload_tables(MusPool& P, const int* dm, void* const* a, MuscleTables<T>& t, MusSlots<T>& sl, MusBall& bl) {
|
|
105
|
+
const int nm = dm[kMusNM], nsite = dm[kMusNSITE], ns = dm[kMusNSLOT];
|
|
106
|
+
t.nm = nm; t.nsite = nsite; t.nv = NV; t.nq = NQ; t.nbody = ns;
|
|
107
|
+
const T** vals[15] = {&t.fmax, &t.lopt, &t.lslack, &t.vmax, &t.W, &t.C, &t.N, &t.K, &t.eref, &t.pe_rest, &t.pe_eps, &t.beta,
|
|
108
|
+
&t.tau_act, &t.tau_deact, &t.tausmooth};
|
|
109
|
+
for (int i = 0; i < 15; ++i) *vals[i] = P.up<T>(a[i], nm);
|
|
110
|
+
t.rigid = P.up<int>(a[15], nm); t.site_off = P.up<int>(a[16], nm + 1); t.row_off = P.up<int>(a[17], nm + 1);
|
|
111
|
+
t.row_dof = P.up<int>(a[18], dm[kMusNNZ]); t.jent_off = P.up<int>(a[19], nm + 1); t.jent_body = P.up<int>(a[20], dm[kMusNJE]);
|
|
112
|
+
t.jent_mask = P.up<int>(a[21], dm[kMusNJE]); t.jent_slot = P.up<int>(a[22], dm[kMusNJE]);
|
|
113
|
+
t.site_body = P.up<int>(a[23], nsite); t.site_off3 = P.up<T>(a[24], 3 * nsite); t.site_moving = P.up<int>(a[25], nsite);
|
|
114
|
+
t.site_cdof_q = P.up<int>(a[26], nsite); t.site_slot = P.up<int>(a[27], nsite); t.site_coef = P.up<T>(a[28], 15 * nsite);
|
|
115
|
+
t.body_jtype = P.up<int>(a[29], ns); t.body_jaxis = P.up<T>(a[30], 3 * ns); t.body_cpl_qadr = P.up<int>(a[31], ns);
|
|
116
|
+
t.body_cpl_coef = P.up<T>(a[32], 5 * ns);
|
|
117
|
+
sl.nslot = ns; sl.nlev = dm[kMusNLEV]; sl.nround = dm[kMusNROUND]; sl.nseed = dm[kMusNSEED];
|
|
118
|
+
sl.lev_off = P.up<int>(a[33], dm[kMusNLEV] + 1); sl.parent = P.up<int>(a[34], ns); sl.kjt = P.up<int>(a[35], ns);
|
|
119
|
+
sl.qadr = P.up<int>(a[36], ns); sl.vadr = P.up<int>(a[37], ns); sl.pos = P.up<T>(a[38], 3 * ns); sl.quat = P.up<T>(a[39], 4 * ns);
|
|
120
|
+
sl.cpl_qadr = t.body_cpl_qadr; sl.cpl_coef = t.body_cpl_coef; sl.axis = t.body_jaxis;
|
|
121
|
+
sl.g_off = P.up<int>(a[40], dm[kMusNROUND] * NV + 1); sl.g_ent = P.up<int>(a[41], dm[kMusNGENT]);
|
|
122
|
+
sl.seed = P.up<int>(a[42], 3 * dm[kMusNSEED]);
|
|
123
|
+
sl.perm = P.up<int>(a[51], nm); // the rounds' muscle order (identity unless the case is cost-sorted)
|
|
124
|
+
// the per-entry records: (body, mask, slot, jtype | (cpl_qadr + 1) << 8; c1..c4 of the coupling polynomial, the joint axis)
|
|
125
|
+
const int nje = dm[kMusNJE];
|
|
126
|
+
const int* jb = static_cast<const int*>(a[20]); const int* jm = static_cast<const int*>(a[21]); const int* js = static_cast<const int*>(a[22]);
|
|
127
|
+
const int* bj = static_cast<const int*>(a[29]); const T* bax = static_cast<const T*>(a[30]);
|
|
128
|
+
const int* bcq = static_cast<const int*>(a[31]); const T* bcc = static_cast<const T*>(a[32]);
|
|
129
|
+
#if defined(D16_BODY_ROW_CF) // the records carry the entries' codes (mus_row_cf.h), not their masks
|
|
130
|
+
std::vector<int> rcode;
|
|
131
|
+
mus_row_codes(nm, static_cast<const int*>(a[16]), static_cast<const int*>(a[19]), jm, rcode);
|
|
132
|
+
jm = rcode.data();
|
|
133
|
+
#endif
|
|
134
|
+
std::vector<int> ri(4 * static_cast<size_t>(nje)); std::vector<T> rf(8 * static_cast<size_t>(nje), T(0));
|
|
135
|
+
for (int e = 0; e < nje; ++e) {
|
|
136
|
+
const int b = jb[e];
|
|
137
|
+
ri[4 * e] = b; ri[4 * e + 1] = jm[e]; ri[4 * e + 2] = js[e]; ri[4 * e + 3] = bj[b] | ((bcq[b] + 1) << 8);
|
|
138
|
+
for (int k = 0; k < 4; ++k) rf[8 * e + k] = bcc[5 * b + 1 + k];
|
|
139
|
+
for (int k = 0; k < 3; ++k) rf[8 * e + 4 + k] = bax[3 * b + k];
|
|
140
|
+
}
|
|
141
|
+
sl.erec_i = reinterpret_cast<const int4*>(P.up<int>(ri.data(), ri.size())); sl.erec_f = P.up<T>(rf.data(), rf.size());
|
|
142
|
+
std::vector<int> boff, bsv; // the ball term's lists (MusBall)
|
|
143
|
+
mus_ball_list(nm, static_cast<const int*>(a[19]), jb, js, bj, static_cast<const int*>(a[37]), boff, bsv);
|
|
144
|
+
bl.off = P.up<int>(boff.data(), boff.size()); bl.sv = P.up<int>(bsv.data(), bsv.size());
|
|
145
|
+
#ifdef D16_X14_MILLARD
|
|
146
|
+
{
|
|
147
|
+
int K = 0, NC = 0, nk = 0;
|
|
148
|
+
mus_millard_check(nm, static_cast<const int*>(a[52]), static_cast<const int*>(a[53]), static_cast<const int*>(a[58]),
|
|
149
|
+
static_cast<const int*>(a[62]), K, NC, nk);
|
|
150
|
+
t.law = kLawMillard; t.nmset = K; t.ncurve = NC; t.pfl_curve = P.up<int>(a[62], nm);
|
|
151
|
+
t.mset = P.up<int>(a[53], nm); t.pen_h = P.up<T>(a[54], nm); t.lce_min = P.up<T>(a[55], nm); t.pfl_a = P.up<T>(a[56], nm);
|
|
152
|
+
t.pfl_b = P.up<T>(a[57], nm); t.mc_i = P.up<int>(a[58], 2 * static_cast<size_t>(NC)); t.mc_f = P.up<T>(a[59], 8 * static_cast<size_t>(NC));
|
|
153
|
+
t.mc_knot = P.up<T>(a[60], 3 * static_cast<size_t>(nk)); t.mc_sinmax = P.up<T>(a[61], K);
|
|
154
|
+
}
|
|
155
|
+
#endif
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// one substep k of the 14x reverse (the step 4): muscle_adj_taped on n worlds, the stream s. The caller zeroes u_bar before
|
|
159
|
+
// k = 4 and chains (lce_k_bar, a_k_bar) into substep k - 1's (lce_{k+1}_bar, a_{k+1}_bar).
|
|
160
|
+
template <class T, int NS, int KD, int NSLOT, int NQ, int NV, int KMUS_P(NM)>
|
|
161
|
+
void launch_muscle_adj_taped(const MuscleTables<T>& t, const MusSlots<T>& sl, const MusBall& bl, const AdjTape<T>& tp, T dt, int n,
|
|
162
|
+
const T* tau_bar, const T* lce_next_bar, const T* a_next_bar, T* qmus, T* lce_bar, T* a_bar,
|
|
163
|
+
cudaStream_t s = 0) {
|
|
164
|
+
muscle_adj_taped<T, NS, KD, NSLOT, NQ, NV, KMUS_A(NM)><<<n, 32, 0, s>>>(t, sl, tp, dt, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar,
|
|
165
|
+
bl);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
#if defined(D16_BODY_MUS_SPLIT)
|
|
170
|
+
// ---- The muscle stage by class (2026-11-08; tools/d16_bodies/MUSCLE_SPLIT.md, the review R1-R5) ----
|
|
171
|
+
// A body header that defines D16_BODY_MUS_SPLIT (gen_body.py --mus-split) names two classes, 0 narrow and 1 wide, with each one's muscle count,
|
|
172
|
+
// widths and slot count. Each class runs its own instantiation of the muscle stage on its own tables, derived on the host from the same case
|
|
173
|
+
// arrays as the full tables (mus_classes.h), which stay uploaded: k_mus_equil runs on them (the Q3). R1: the class kernels loop over their
|
|
174
|
+
// class's muscles while every stride, tape word and per-muscle index stays global (NM).
|
|
175
|
+
static_assert(D16_BODY_NV > 64, "the muscle split is a phase B body's (gen_body.py --mus-split)");
|
|
176
|
+
static_assert(D16_BODY_MC0_NM + D16_BODY_MC1_NM == D16_BODY_NM && D16_BODY_MC0_NM > 0 && D16_BODY_MC1_NM > 0, "the two classes cover the body's muscles");
|
|
177
|
+
static_assert(D16_BODY_MC0_NS <= D16_BODY_NS && D16_BODY_MC0_KD <= D16_BODY_MKD && D16_BODY_MC1_NS <= D16_BODY_NS && D16_BODY_MC1_KD <= D16_BODY_MKD &&
|
|
178
|
+
D16_BODY_MC0_NSLOT <= D16_BODY_NSLOT && D16_BODY_MC1_NSLOT <= D16_BODY_NSLOT,
|
|
179
|
+
"each class's widths are within the body's");
|
|
180
|
+
// KMUS_SPLIT_PLANT 1 (gate builds only; the review): the wide class starts from acc = 0 instead of continuing the narrow sum (R3 broken), which
|
|
181
|
+
// split_gate.py's bitwise comparison must catch in tau and q_bar
|
|
182
|
+
#ifndef KMUS_SPLIT_PLANT
|
|
183
|
+
#define KMUS_SPLIT_PLANT 0
|
|
184
|
+
#endif
|
|
185
|
+
constexpr bool kMusWideAccIn = KMUS_SPLIT_PLANT != 1;
|
|
186
|
+
#if defined(D16_BODY_MC_FILL)
|
|
187
|
+
constexpr bool kMusFill = true; // the 12-round partition (mus_classes.h mus_class_vec): the binding's perm'' control takes the same rule
|
|
188
|
+
#else
|
|
189
|
+
constexpr bool kMusFill = false;
|
|
190
|
+
#endif
|
|
191
|
+
template <class T> struct MusClasses {
|
|
192
|
+
MuscleTables<T> t[2];
|
|
193
|
+
MusSlots<T> sl[2];
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// Derive (with R4's checks, mus_classes_host), check against the header and upload both classes' tables. dm / a: the case as
|
|
197
|
+
// mus_upload_tables takes it; t / sl: the full tables uploaded from the same arrays (the classes copy their value arrays, MusBall, seed and
|
|
198
|
+
// erec_f); mc: out.
|
|
199
|
+
template <class T, int NV>
|
|
200
|
+
void mus_class_upload(MusPool& P, const int* dm, void* const* a, const MuscleTables<T>& t, const MusSlots<T>& sl, MusClasses<T>& mc) {
|
|
201
|
+
constexpr int CNS[2] = {D16_BODY_MC0_NS, D16_BODY_MC1_NS}, CKD[2] = {D16_BODY_MC0_KD, D16_BODY_MC1_KD};
|
|
202
|
+
constexpr int CNM[2] = {D16_BODY_MC0_NM, D16_BODY_MC1_NM}, CNSLOT[2] = {D16_BODY_MC0_NSLOT, D16_BODY_MC1_NSLOT};
|
|
203
|
+
if (dm[kMusNV] != NV || dm[kMusNM] != D16_BODY_NM || dm[kMusNSLOT] != D16_BODY_NSLOT) mus_class_fail("the case is not this body's", -1, dm[kMusNM]);
|
|
204
|
+
MusClassHost<T> h[2];
|
|
205
|
+
#if defined(D16_BODY_MC_FILL)
|
|
206
|
+
mus_classes_host<T>(dm, a, CNS, CKD, true, h); // the 12-round partition (gen_body --mus-fill)
|
|
207
|
+
#else
|
|
208
|
+
mus_classes_host<T>(dm, a, CNS, CKD, false, h);
|
|
209
|
+
#endif
|
|
210
|
+
for (int c = 0; c < 2; ++c) {
|
|
211
|
+
if (h[c].nm != CNM[c]) mus_class_fail("the class's muscle count is not the header's", c, h[c].nm);
|
|
212
|
+
if (h[c].nslot != CNSLOT[c]) mus_class_fail("the class's slot count is not the header's", c, h[c].nslot);
|
|
213
|
+
const MusClassHost<T>& o = h[c];
|
|
214
|
+
MuscleTables<T>& ct = mc.t[c];
|
|
215
|
+
ct = t;
|
|
216
|
+
ct.nbody = o.nslot;
|
|
217
|
+
ct.site_body = P.up<int>(o.site_body.data(), o.site_body.size()); ct.jent_body = P.up<int>(o.jent_body.data(), o.jent_body.size());
|
|
218
|
+
ct.body_jtype = P.up<int>(o.jtype.data(), o.jtype.size()); ct.body_jaxis = P.up<T>(o.axis.data(), o.axis.size());
|
|
219
|
+
ct.body_cpl_qadr = P.up<int>(o.cpl_qadr.data(), o.cpl_qadr.size()); ct.body_cpl_coef = P.up<T>(o.cpl_coef.data(), o.cpl_coef.size());
|
|
220
|
+
MusSlots<T>& cs = mc.sl[c];
|
|
221
|
+
cs = sl; // nseed, seed (q indices) and erec_f (per-entry values) stay the full tables'
|
|
222
|
+
cs.nslot = o.nslot; cs.nlev = o.nlev; cs.nround = o.nround;
|
|
223
|
+
cs.lev_off = P.up<int>(o.lev_off.data(), o.lev_off.size()); cs.parent = P.up<int>(o.parent.data(), o.parent.size());
|
|
224
|
+
cs.kjt = P.up<int>(o.kjt.data(), o.kjt.size()); cs.qadr = P.up<int>(o.qadr.data(), o.qadr.size()); cs.vadr = P.up<int>(o.vadr.data(), o.vadr.size());
|
|
225
|
+
cs.pos = P.up<T>(o.pos.data(), o.pos.size()); cs.quat = P.up<T>(o.quat.data(), o.quat.size());
|
|
226
|
+
cs.cpl_qadr = ct.body_cpl_qadr; cs.cpl_coef = ct.body_cpl_coef; cs.axis = ct.body_jaxis;
|
|
227
|
+
cs.g_off = P.up<int>(o.g_off.data(), o.g_off.size()); cs.g_ent = P.up<int>(o.g_ent.data(), o.g_ent.size());
|
|
228
|
+
cs.perm = P.up<int>(o.perm.data(), o.perm.size());
|
|
229
|
+
cs.erec_i = reinterpret_cast<const int4*>(P.up<int>(o.erec_i.data(), o.erec_i.size()));
|
|
230
|
+
for (const void* p : {static_cast<const void*>(ct.site_body), static_cast<const void*>(ct.body_cpl_coef), static_cast<const void*>(cs.g_ent),
|
|
231
|
+
static_cast<const void*>(cs.perm), static_cast<const void*>(cs.erec_i)})
|
|
232
|
+
if (p == nullptr) mus_class_fail("a device allocation failed", c, -1);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
#if defined(D16_BODY_MUS_W2)
|
|
237
|
+
constexpr bool kMusW2 = true; // the narrow class at two warps per world (PREREG_MW2.md; k_mus.cuh's _w2 kernels, 64 threads)
|
|
238
|
+
#else
|
|
239
|
+
constexpr bool kMusW2 = false;
|
|
240
|
+
#endif
|
|
241
|
+
// One class's forward launch: c 0 the narrow class (at two warps when w2), 1 the wide class (continuing tau, R3). Tp: NoMusTape (k_mus) or a
|
|
242
|
+
// tape policy (k_mus_taped).
|
|
243
|
+
template <class T, int NQ, int NV, int NM, class Tp>
|
|
244
|
+
void mus_fwd_one(int c, bool w2, const MusClasses<T>& C, unsigned n, cudaStream_t s, const T* q, const T* lce, const T* a, const T* u, T dt, int niter,
|
|
245
|
+
T* tau, T* lce_o, T* a_o, T* F_o, Tp tp) {
|
|
246
|
+
constexpr bool kTaped = !std::is_same_v<Tp, NoMusTape>;
|
|
247
|
+
if (c == 0) {
|
|
248
|
+
#if defined(D16_BODY_MUS_W2)
|
|
249
|
+
if (w2) {
|
|
250
|
+
if constexpr (kTaped)
|
|
251
|
+
k_mus_taped_w2<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, Tp, D16_BODY_MC0_NM><<<n, 64, 0, s>>>(
|
|
252
|
+
C.t[0], C.sl[0], q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
253
|
+
else
|
|
254
|
+
k_mus_w2<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, D16_BODY_MC0_NM><<<n, 64, 0, s>>>(
|
|
255
|
+
C.t[0], C.sl[0], q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o);
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
#endif
|
|
259
|
+
if (w2) { std::fprintf(stderr, "mus_fwd_one: two warps requested in a build without D16_BODY_MUS_W2\n"); std::abort(); }
|
|
260
|
+
if constexpr (kTaped)
|
|
261
|
+
k_mus_taped<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, Tp, D16_BODY_MC0_NM, false><<<n, 32, 0, s>>>(
|
|
262
|
+
C.t[0], C.sl[0], q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
263
|
+
else
|
|
264
|
+
k_mus<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, D16_BODY_MC0_NM, false><<<n, 32, 0, s>>>(
|
|
265
|
+
C.t[0], C.sl[0], q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
if constexpr (kTaped)
|
|
269
|
+
k_mus_taped<T, D16_BODY_MC1_NS, D16_BODY_MC1_KD, D16_BODY_MC1_NSLOT, NQ, NV, NM, Tp, D16_BODY_MC1_NM, kMusWideAccIn><<<n, 32, 0, s>>>(
|
|
270
|
+
C.t[1], C.sl[1], q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
271
|
+
else
|
|
272
|
+
k_mus<T, D16_BODY_MC1_NS, D16_BODY_MC1_KD, D16_BODY_MC1_NSLOT, NQ, NV, NM, D16_BODY_MC1_NM, kMusWideAccIn><<<n, 32, 0, s>>>(
|
|
273
|
+
C.t[1], C.sl[1], q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o);
|
|
274
|
+
}
|
|
275
|
+
// The forward's two launches, narrow from acc = 0 (at two warps in a D16_BODY_MUS_W2 build) and then wide continuing tau (R3), on stream s.
|
|
276
|
+
// R5: step_t and the gate binding call this, so no caller can launch one class alone.
|
|
277
|
+
template <class T, int NQ, int NV, int NM, class Tp>
|
|
278
|
+
void mus_fwd_cls(const MusClasses<T>& c, unsigned n, cudaStream_t s, const T* q, const T* lce, const T* a, const T* u, T dt, int niter, T* tau,
|
|
279
|
+
T* lce_o, T* a_o, T* F_o, Tp tp) {
|
|
280
|
+
mus_fwd_one<T, NQ, NV, NM>(0, kMusW2, c, n, s, q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
281
|
+
mus_fwd_one<T, NQ, NV, NM>(1, false, c, n, s, q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
282
|
+
}
|
|
283
|
+
// The test builds' selection (bindings/muscle_gpu_test.cu's variants 2-6 as sel = variant - 2): 0 both classes (mus_fwd_cls), 1 the narrow class
|
|
284
|
+
// alone, 2 the wide class alone (its sum from a zeroed tau), 3 both with the narrow class at one warp, 4 the narrow class alone at one warp. One
|
|
285
|
+
// class alone does not compute the stage; it times or profiles it. Sel 3 is the two-warp build's per-muscle bitwise and summation-order control.
|
|
286
|
+
template <class T, int NQ, int NV, int NM, class Tp>
|
|
287
|
+
void mus_fwd_cls_sel(int sel, const MusClasses<T>& c, unsigned n, cudaStream_t s, const T* q, const T* lce, const T* a, const T* u, T dt, int niter,
|
|
288
|
+
T* tau, T* lce_o, T* a_o, T* F_o, Tp tp) {
|
|
289
|
+
if (sel == 2) {
|
|
290
|
+
cudaMemsetAsync(tau, 0, sizeof(T) * static_cast<size_t>(n) * NV, s);
|
|
291
|
+
mus_fwd_one<T, NQ, NV, NM>(1, false, c, n, s, q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
mus_fwd_one<T, NQ, NV, NM>(0, kMusW2 && sel < 3, c, n, s, q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
295
|
+
if (sel == 0 || sel == 3) mus_fwd_one<T, NQ, NV, NM>(1, false, c, n, s, q, lce, a, u, dt, niter, tau, lce_o, a_o, F_o, tp);
|
|
296
|
+
}
|
|
297
|
+
// One class's adjoint launch (muscle_adj_taped, one substep): c 0 narrow (two warps when w2) writing qmus, 1 wide continuing it (R3). MusBall is
|
|
298
|
+
// global (indexed by the global muscle, holding row slots and dofs), so both classes take the full tables' (the Q1).
|
|
299
|
+
template <class T, int NQ, int NV, int NM>
|
|
300
|
+
void muscle_adj_taped_one(int c, bool w2, const MusClasses<T>& C, const MusBall& bl, const AdjTape<T>& tp, T dt, int n, const T* tau_bar,
|
|
301
|
+
const T* lce_next_bar, const T* a_next_bar, T* qmus, T* lce_bar, T* a_bar, cudaStream_t s) {
|
|
302
|
+
if (c == 0) {
|
|
303
|
+
#if defined(D16_BODY_MUS_W2)
|
|
304
|
+
if (w2) {
|
|
305
|
+
muscle_adj_taped_w2<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, D16_BODY_MC0_NM><<<n, 64, 0, s>>>(
|
|
306
|
+
C.t[0], C.sl[0], tp, dt, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, bl);
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
#endif
|
|
310
|
+
if (w2) { std::fprintf(stderr, "muscle_adj_taped_one: two warps requested in a build without D16_BODY_MUS_W2\n"); std::abort(); }
|
|
311
|
+
launch_muscle_adj_taped<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, D16_BODY_MC0_NM, false>(
|
|
312
|
+
C.t[0], C.sl[0], bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
launch_muscle_adj_taped<T, D16_BODY_MC1_NS, D16_BODY_MC1_KD, D16_BODY_MC1_NSLOT, NQ, NV, NM, D16_BODY_MC1_NM, kMusWideAccIn>(
|
|
316
|
+
C.t[1], C.sl[1], bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
317
|
+
}
|
|
318
|
+
// The adjoint's two launches (adj14_control_step_mus's), narrow writing qmus and then wide continuing it (R3)
|
|
319
|
+
template <class T, int NQ, int NV, int NM>
|
|
320
|
+
void launch_muscle_adj_taped_cls(const MusClasses<T>& c, const MusBall& bl, const AdjTape<T>& tp, T dt, int n, const T* tau_bar,
|
|
321
|
+
const T* lce_next_bar, const T* a_next_bar, T* qmus, T* lce_bar, T* a_bar, cudaStream_t s = 0) {
|
|
322
|
+
muscle_adj_taped_one<T, NQ, NV, NM>(0, kMusW2, c, bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
323
|
+
muscle_adj_taped_one<T, NQ, NV, NM>(1, false, c, bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
324
|
+
}
|
|
325
|
+
// the taped adjoint's selection (as mus_fwd_cls_sel's sel)
|
|
326
|
+
template <class T, int NQ, int NV, int NM>
|
|
327
|
+
void launch_muscle_adj_taped_cls_sel(int sel, const MusClasses<T>& c, const MusBall& bl, const AdjTape<T>& tp, T dt, int n, const T* tau_bar,
|
|
328
|
+
const T* lce_next_bar, const T* a_next_bar, T* qmus, T* lce_bar, T* a_bar, cudaStream_t s = 0) {
|
|
329
|
+
if (sel == 2) {
|
|
330
|
+
cudaMemsetAsync(qmus, 0, sizeof(T) * static_cast<size_t>(n) * NV, s);
|
|
331
|
+
muscle_adj_taped_one<T, NQ, NV, NM>(1, false, c, bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
muscle_adj_taped_one<T, NQ, NV, NM>(0, kMusW2 && sel < 3, c, bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
335
|
+
if (sel == 0 || sel == 3) muscle_adj_taped_one<T, NQ, NV, NM>(1, false, c, bl, tp, dt, n, tau_bar, lce_next_bar, a_next_bar, qmus, lce_bar, a_bar, s);
|
|
336
|
+
}
|
|
337
|
+
// One class's contiguous adjoint launch (muscle_adj: the gate binding's reference path)
|
|
338
|
+
template <class T, int NQ, int NV, int NM>
|
|
339
|
+
void muscle_adj_one(int c, bool w2, const MusClasses<T>& C, int n, const T* q, const T* lce, const T* a, const T* u, const T* lnew, T dt, const T* tb,
|
|
340
|
+
const T* lb, const T* ab, T* qb, T* lpb, T* apb, T* ub, const MusBall& bl, cudaStream_t s) {
|
|
341
|
+
if (c == 0) {
|
|
342
|
+
#if defined(D16_BODY_MUS_W2)
|
|
343
|
+
if (w2) {
|
|
344
|
+
muscle_adj_w2<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, D16_BODY_MC0_NM><<<n, 64, 0, s>>>(
|
|
345
|
+
C.t[0], C.sl[0], q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
#endif
|
|
349
|
+
if (w2) { std::fprintf(stderr, "muscle_adj_one: two warps requested in a build without D16_BODY_MUS_W2\n"); std::abort(); }
|
|
350
|
+
muscle_adj<T, D16_BODY_MC0_NS, D16_BODY_MC0_KD, D16_BODY_MC0_NSLOT, NQ, NV, NM, D16_BODY_MC0_NM, false><<<n, 32, 0, s>>>(
|
|
351
|
+
C.t[0], C.sl[0], q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
muscle_adj<T, D16_BODY_MC1_NS, D16_BODY_MC1_KD, D16_BODY_MC1_NSLOT, NQ, NV, NM, D16_BODY_MC1_NM, kMusWideAccIn><<<n, 32, 0, s>>>(
|
|
355
|
+
C.t[1], C.sl[1], q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl);
|
|
356
|
+
}
|
|
357
|
+
template <class T, int NQ, int NV, int NM>
|
|
358
|
+
void launch_muscle_adj_cls(const MusClasses<T>& c, int n, const T* q, const T* lce, const T* a, const T* u, const T* lnew, T dt, const T* tb,
|
|
359
|
+
const T* lb, const T* ab, T* qb, T* lpb, T* apb, T* ub, const MusBall& bl, cudaStream_t s = 0) {
|
|
360
|
+
muscle_adj_one<T, NQ, NV, NM>(0, kMusW2, c, n, q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl, s);
|
|
361
|
+
muscle_adj_one<T, NQ, NV, NM>(1, false, c, n, q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl, s);
|
|
362
|
+
}
|
|
363
|
+
// the contiguous adjoint's selection (as mus_fwd_cls_sel's sel; the wide class alone continues a zeroed q_bar)
|
|
364
|
+
template <class T, int NQ, int NV, int NM>
|
|
365
|
+
void launch_muscle_adj_cls_sel(int sel, const MusClasses<T>& c, int n, const T* q, const T* lce, const T* a, const T* u, const T* lnew, T dt,
|
|
366
|
+
const T* tb, const T* lb, const T* ab, T* qb, T* lpb, T* apb, T* ub, const MusBall& bl, cudaStream_t s = 0) {
|
|
367
|
+
if (sel == 2) {
|
|
368
|
+
cudaMemsetAsync(qb, 0, sizeof(T) * static_cast<size_t>(n) * NV, s);
|
|
369
|
+
muscle_adj_one<T, NQ, NV, NM>(1, false, c, n, q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl, s);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
muscle_adj_one<T, NQ, NV, NM>(0, kMusW2 && sel < 3, c, n, q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl, s);
|
|
373
|
+
if (sel == 0 || sel == 3) muscle_adj_one<T, NQ, NV, NM>(1, false, c, n, q, lce, a, u, lnew, dt, tb, lb, ab, qb, lpb, apb, ub, bl, s);
|
|
374
|
+
}
|
|
375
|
+
#endif
|
|
376
|
+
|
|
377
|
+
} // namespace js::soft::gpu
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// D16 k_pre (2026-11-02): the first kernel of a substep in NablaEngine's split (k_pre -> hand -> k_post).
|
|
3
|
+
// One world per 32-thread block:
|
|
4
|
+
// 1. p_world (core/soft/gpu/kernel_p.cuh): the smooth dynamics. It writes the hand's smooth block (M unfactored,
|
|
5
|
+
// qfrc_smooth, qacc_smooth, the clamp mask) and leaves the poses, dof axes and qvel in shared memory (SharedP's live
|
|
6
|
+
// block);
|
|
7
|
+
// 2. L2 v2 (core/soft/gpu/l2v2.cuh): collision and rows from that live block into the hand's counts, contact and row
|
|
8
|
+
// blocks, and the world's nefc into a dense array (k_post's row-count dispatch);
|
|
9
|
+
// 3. (when given) the tape's POSE block: the bodies' frames at the substep's input q, from the live block (tape.h).
|
|
10
|
+
// Shared memory: L2's geometry (L2Geo) and its contact table (L2Keep) lie over p_world's scratch, which is dead when p_world
|
|
11
|
+
// returns; the live block stays below them.
|
|
12
|
+
// The model header (tools/d16/l1_gen.py) and D16_MODEL_NS must come before this file, as for kernel_p.cuh.
|
|
13
|
+
#include <cstddef>
|
|
14
|
+
|
|
15
|
+
#include "kernel_p.cuh"
|
|
16
|
+
#include "l2v2.cuh"
|
|
17
|
+
|
|
18
|
+
namespace js::soft::gpu {
|
|
19
|
+
|
|
20
|
+
template <class T, int NG, int NP, int NC> struct KPreShared {
|
|
21
|
+
// the live block's end, rounded to 16 bytes: everything above it in SharedP is p_world's scratch
|
|
22
|
+
static constexpr size_t kLive = (offsetof(d16::kp::SharedP<T>, qpos) + 15) / 16 * 16;
|
|
23
|
+
struct Over {
|
|
24
|
+
unsigned char live[kLive];
|
|
25
|
+
L2Geo<T, NG, NP, NC> g;
|
|
26
|
+
L2Keep<NC> k;
|
|
27
|
+
};
|
|
28
|
+
union {
|
|
29
|
+
d16::kp::SharedP<T> p;
|
|
30
|
+
Over o;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// One world's k_pre. V: the model's values (p_world's table); m2: L2's model tables; h: the hand's layout (h.nc == NC,
|
|
35
|
+
// h.nr == NR); rec: this world's hand record; pose: this world's tape POSE block (xpos [NB][3] then xquat [NB][4]) or null.
|
|
36
|
+
// E: the external-force policy (kernel_p.cuh's NoTauExt, the default and the G1's, or TauExt<T> with this world's tau_ext).
|
|
37
|
+
template <class T, int NG, int NP, int NC, int NR, class E = d16::kp::NoTauExt>
|
|
38
|
+
__device__ void k_pre_world(KPreShared<T, NG, NP, NC>& sh, const T* __restrict__ V, const L2Tab<T>& m2, const HandLayout& h,
|
|
39
|
+
const T* __restrict__ qpos, const T* __restrict__ qvel, const T* __restrict__ ctrl, T fric, T* rec,
|
|
40
|
+
int* nefc_out, T* pose, int lane, long long* tmr_p, long long* tmr_l2, const E& ext = E{}) {
|
|
41
|
+
using namespace d16::kp;
|
|
42
|
+
p_world<T, E>(sh.p, V, qpos, qvel, ctrl, lane, rec, tmr_p, ext);
|
|
43
|
+
__syncwarp();
|
|
44
|
+
if (pose) { // the frames L2 is about to use, for the tape (coalesced: the live block's poses are contiguous)
|
|
45
|
+
for (int k = lane; k < 3 * NB; k += 32) pose[k] = (&sh.p.xpos[0][0])[k];
|
|
46
|
+
for (int k = lane; k < 4 * NB; k += 32) pose[3 * NB + k] = (&sh.p.xquat[0][0])[k];
|
|
47
|
+
}
|
|
48
|
+
const L2In<T> in{&sh.p.xpos[0][0], &sh.p.xquat[0][0], &sh.p.dofax[0][0], qpos, sh.p.qvel};
|
|
49
|
+
l2v2_world<T, NG, NP, NC, NR>(m2, sh.o.g, sh.o.k, in, fric, h, rec, nefc_out, lane, tmr_l2);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
} // namespace js::soft::gpu
|