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,243 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// D16 adjoint megakernel, the CUDA shell's per-world body (d5, 2026-11-02; tools/d16_adj_shell/PREREG.md): the VJP of one control
|
|
3
|
+
// step from its packed tape records (core/soft/tape.h), B's Chain.vjp (tools/d16_adj/vjp_chain.py) steps 1-4 per substep in
|
|
4
|
+
// reverse, with B's row / PD reverse as the Rows functor (stub until it lands) and adj_tree for the RNE / pose terms; the output
|
|
5
|
+
// pull-back (out_adj.h) once per control step. Host-emulable phases (ADJ_LANES), deterministic, no allocation, every buffer the
|
|
6
|
+
// caller's (CUDA-graph capturable); failures OR-ed into *flag.
|
|
7
|
+
#include <cstdint>
|
|
8
|
+
|
|
9
|
+
#include "../tape.h"
|
|
10
|
+
#if defined(__CUDACC__)
|
|
11
|
+
#include "../gpu/chol_rn.cuh"
|
|
12
|
+
#endif
|
|
13
|
+
#include "out_adj.h"
|
|
14
|
+
#include "tree_adj.h"
|
|
15
|
+
|
|
16
|
+
namespace js::soft::adj {
|
|
17
|
+
|
|
18
|
+
constexpr uint32_t kShellBadRecord = 1u << 0; // a record carries kTapeOverflow (its content is not valid)
|
|
19
|
+
constexpr int kNV = 35; // the G1's nv (the solves' and vectors' size)
|
|
20
|
+
|
|
21
|
+
// shell scratch words (S): the adj_tree / output scratch, the poses buffer, then the vectors
|
|
22
|
+
constexpr int kShVec = 14; // qb vb ub aadvb y asb lam work z acc2 rinv | staged: v q a* (36 words each)
|
|
23
|
+
// + the pose cotangents (2 x 3 kNB). The record's POSE block is read in place: adj_tree reads it only in its two parallel phases
|
|
24
|
+
// (the pre-pass and the off-chain inertia), never on the level chain, so staging it would cost residency for nothing (the
|
|
25
|
+
// 8.3 KB staged build ran at 10 blocks / SM and was 5% slower, 143150ef).
|
|
26
|
+
constexpr int kShellWords = kSlotT * kNB + kShVec * 36 + 2 * 3 * kNB;
|
|
27
|
+
static_assert(kSlotT * kNB >= kNV * (kNV + 1) / 2, "a staged factor must fit in adj_tree's scratch");
|
|
28
|
+
|
|
29
|
+
// The rows functor's interface: ADDS its q_bar, v_bar, u_bar and the pose cotangents (xpos_bar, xrot_bar nb x 3) of substep s.
|
|
30
|
+
// The kernel binds it per world: rows.bind(w, the world's records, the shell scratch, the world's flag word) returns the functor
|
|
31
|
+
// adj_control_step calls (B's RowsBFactory binds the records, foot friction, scratch and flag). Scratch lifetime: B's RowsB
|
|
32
|
+
// uses the first kRowsScratch (1,088) words of the shell scratch, adj_tree's slot area. In a substep that area holds the
|
|
33
|
+
// staged L_Q, then L_H (steps 3-4, dead once each solve returns), RowsB's data (step 5, dead when it returns), then adj_tree's
|
|
34
|
+
// slots; the staged q / v / a*, y, lambda, a* - a_adv and the pose cotangents live in the vector region after it.
|
|
35
|
+
struct RowsStub {
|
|
36
|
+
template <class S> DN_HOST_DEVICE void operator()(int, const S*, const S*, const S*, const S*, S*, S*, S*, S*, S*) const {}
|
|
37
|
+
template <class S> DN_HOST_DEVICE RowsStub bind(int, const S*, S*, uint32_t*) const { return *this; }
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// G-S2's functor: B's rows reverse outputs injected per substep (data: nsub x kInjWords, [q_bar 35 | v_bar 35 | u_bar 29 |
|
|
41
|
+
// xpos_bar 96 | xrot_bar 96]), ADDED as B's device function will add them. A test functor; never in a production build.
|
|
42
|
+
constexpr int kInjWords = 35 + 35 + 29 + 96 + 96;
|
|
43
|
+
template <class S> struct RowsInj {
|
|
44
|
+
const S* data;
|
|
45
|
+
DN_HOST_DEVICE RowsInj bind(int, const S*, S*, uint32_t*) const { return *this; }
|
|
46
|
+
DN_HOST_DEVICE void operator()(int s, const S*, const S*, const S*, const S*, S* qb, S* vb, S* ub, S* xpb, S* xrb) const {
|
|
47
|
+
const S* d = data + static_cast<size_t>(s) * kInjWords;
|
|
48
|
+
ADJ_LANES(lane) {
|
|
49
|
+
for (int i = lane; i < 35; i += 32) { qb[i] = qb[i] + d[i]; vb[i] = vb[i] + d[35 + i]; }
|
|
50
|
+
for (int i = lane; i < 29; i += 32) ub[i] = ub[i] + d[70 + i];
|
|
51
|
+
for (int i = lane; i < 96; i += 32) { xpb[i] = xpb[i] + d[99 + i]; xrb[i] = xrb[i] + d[195 + i]; }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// x = (L L')^-1 b on the packed lower TRI(i, j) = L[i (i + 1) / 2 + j], one phase per column (each lane derives the pivot
|
|
57
|
+
// quotient itself, so no phase reads a word written in the same phase). A placeholder for the latency-optimized solve.
|
|
58
|
+
template <class S, class T>
|
|
59
|
+
DN_HOST_DEVICE inline void tri_solve(const T* L, const S* b, S* work, S* z, S* x) {
|
|
60
|
+
ADJ_LANES(lane) {
|
|
61
|
+
for (int i = lane; i < kNV; i += 32) work[i] = b[i];
|
|
62
|
+
}
|
|
63
|
+
for (int j = 0; j < kNV; ++j) { // forward: L z = b
|
|
64
|
+
ADJ_LANES(lane) {
|
|
65
|
+
const S zj = work[j] / S(L[j * (j + 1) / 2 + j]);
|
|
66
|
+
for (int i = lane; i < kNV; i += 32) {
|
|
67
|
+
if (i > j) work[i] = work[i] - S(L[i * (i + 1) / 2 + j]) * zj;
|
|
68
|
+
else if (i == j) z[j] = zj;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (int j = kNV - 1; j >= 0; --j) { // backward: L' x = z
|
|
73
|
+
ADJ_LANES(lane) {
|
|
74
|
+
const S xj = z[j] / S(L[j * (j + 1) / 2 + j]);
|
|
75
|
+
for (int i = lane; i < kNV; i += 32) {
|
|
76
|
+
if (i < j) z[i] = z[i] - S(L[j * (j + 1) / 2 + i]) * xj;
|
|
77
|
+
else if (i == j) x[j] = xj;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// x = (L L')^-1 b with the factor staged in shared memory: on the device the solve (chol_rn.cuh, d6ee775c: reciprocal
|
|
84
|
+
// pivots, both halves column by column; the review's choice for the adjoint's L_H and, until the tree-sparse header lands, L_Q);
|
|
85
|
+
// on the host the placeholder column solve (the host gate's arithmetic). rinv: kNV words of scratch.
|
|
86
|
+
template <class S>
|
|
87
|
+
DN_HOST_DEVICE inline void staged_solve(const S* Ls, const S* b, S* work, S* z, S* x, S* rinv) {
|
|
88
|
+
#if defined(__CUDA_ARCH__)
|
|
89
|
+
(void)work; (void)z;
|
|
90
|
+
const int lane = static_cast<int>(threadIdx.x & 31u);
|
|
91
|
+
for (int i = lane; i < kNV; i += 32) x[i] = b[i];
|
|
92
|
+
js::soft::gpu::chol::set_rinv<S, kNV>(Ls, rinv, lane);
|
|
93
|
+
// both halves column by column (engine C, 2026-11-02, tools/d16_adj/COLSOLVE.md): one shuffle and one row load per column,
|
|
94
|
+
// in place of the 8-row blocks with their diagonal block on every lane (the v3j in k_post: -5.0%)
|
|
95
|
+
// Tag 1: the adjoint's own instantiation, so k_post's solves are compiled for k_post alone (binding v10b)
|
|
96
|
+
js::soft::gpu::chol::solve_fwd<S, kNV, 1>(Ls, rinv, x, lane);
|
|
97
|
+
js::soft::gpu::chol::solve_bwd<S, kNV, 1>(Ls, rinv, x, lane);
|
|
98
|
+
#else
|
|
99
|
+
(void)rinv;
|
|
100
|
+
tri_solve(Ls, b, work, z, x);
|
|
101
|
+
#endif
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// copies a packed factor (ntri words) into shared memory, lane strided
|
|
105
|
+
template <class S> DN_HOST_DEVICE inline void stage_tri(const S* src, int ntri, S* dst) {
|
|
106
|
+
ADJ_LANES(lane) {
|
|
107
|
+
for (int k = lane; k < ntri; k += 32) dst[k] = src[k];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// One control step's VJP for one world.
|
|
112
|
+
// rec: the nsub records of the control step, record s at rec + s * L.words (T = the record's word, the same as S here)
|
|
113
|
+
// kd_dof: kd on each actuated dof (0 elsewhere); h: the timestep
|
|
114
|
+
// q_out, v_out: (q_{t+1}, v_{t+1}); wq (tangent 35), wv: their cotangents; out_*: the output frames' cotangents (nb x 3 each,
|
|
115
|
+
// nullptr for none); q_bar, v_bar, u_bar: written (not added); dbg: nsub x 3 x kNV (y, a*_bar, lambda) or nullptr
|
|
116
|
+
// ADJ_SECT (engine B's L5 section timers, a profiling build only; compiled out by default): lane 0 stamps clock64 into
|
|
117
|
+
// g_adj_sect[(world x nsub_max + substep) x kSectStamps + k] at the substep's section boundaries (k 0-5 here, 6-11 inside RowsB).
|
|
118
|
+
constexpr int kSectStamps = 16, kSectNsubMax = 4;
|
|
119
|
+
#if defined(ADJ_SECT) && defined(__CUDACC__)
|
|
120
|
+
__device__ long long* g_adj_sect; // declared in both nvcc passes (the host sets it with cudaMemcpyToSymbol)
|
|
121
|
+
#endif
|
|
122
|
+
#if defined(ADJ_SECT) && defined(__CUDA_ARCH__)
|
|
123
|
+
#define ADJ_STAMP(s, k) do { if ((threadIdx.x & 31u) == 0 && g_adj_sect) \
|
|
124
|
+
g_adj_sect[(static_cast<size_t>(blockIdx.x) * kSectNsubMax + (s)) * kSectStamps + (k)] = clock64(); } while (0)
|
|
125
|
+
#else
|
|
126
|
+
#define ADJ_STAMP(s, k) do {} while (0)
|
|
127
|
+
#endif
|
|
128
|
+
|
|
129
|
+
template <class S, class Tab, class Rows>
|
|
130
|
+
DN_HOST_DEVICE void adj_control_step(const Tab& B, const S* rec, const TapeLayout& L, int nsub, S h, const S* kd_dof,
|
|
131
|
+
const S* q_out, const S* v_out, const S* wq, const S* wv, const S* out_xpos_bar,
|
|
132
|
+
const S* out_xrot_bar, const S* out_vb_bar, const S* out_wb_bar, const Rows& rows,
|
|
133
|
+
S* q_bar, S* v_bar, S* u_bar, uint32_t* flag, S* scratch, S* dbg = nullptr) {
|
|
134
|
+
S* tree_scr = scratch;
|
|
135
|
+
S* vec = scratch + kSlotT * kNB;
|
|
136
|
+
S *qb = vec, *vb = vec + 36, *ub = vec + 72, *aadvb = vec + 108, *y = vec + 144, *asb = vec + 180, *lam = vec + 216,
|
|
137
|
+
*work = vec + 252, *z = vec + 288, *acc2 = vec + 324, *sp0 = vec + 360, *sv = vec + 396, *sq = vec + 432, *sast = vec + 468;
|
|
138
|
+
S* xpb = vec + kShVec * 36;
|
|
139
|
+
S* xrb = xpb + 3 * kNB;
|
|
140
|
+
// the review's rule (12:0x): no dependent global load on the chain. Every per-world vector the level sweeps read is staged in
|
|
141
|
+
// shared memory once, coalesced: the record's q, v, a* and POSE block per substep, (q_{t+1}, v_{t+1}) for the output pull-back
|
|
142
|
+
ADJ_LANES(lane) {
|
|
143
|
+
for (int i = lane; i < kNV; i += 32) { qb[i] = wq[i]; vb[i] = wv[i]; }
|
|
144
|
+
for (int i = lane; i < 36; i += 32) ub[i] = S(0);
|
|
145
|
+
}
|
|
146
|
+
// 0. the output frames' pull-back at (q_{t+1}, v_{t+1})
|
|
147
|
+
if (out_xpos_bar || out_xrot_bar || out_vb_bar || out_wb_bar) {
|
|
148
|
+
ADJ_LANES(lane) {
|
|
149
|
+
for (int i = lane; i < 36; i += 32) sq[i] = q_out[i];
|
|
150
|
+
for (int i = lane; i < kNV; i += 32) sv[i] = v_out[i];
|
|
151
|
+
}
|
|
152
|
+
adj_out_pullback<S, 0>(B, sq, sv, out_xpos_bar, out_xrot_bar, out_vb_bar, out_wb_bar, qb, vb, tree_scr);
|
|
153
|
+
}
|
|
154
|
+
for (int s = nsub - 1; s >= 0; --s) {
|
|
155
|
+
const S* r = rec + static_cast<size_t>(s) * L.words;
|
|
156
|
+
const uint32_t fl = tape_get_u(r, L.flags);
|
|
157
|
+
// a record with kTapeOverflow is not valid (l3.cuh tape_overflow writes only hdr and flags) and the forward HELD the state over
|
|
158
|
+
// that substep (l3.cuh solve: q1 = q, v1 = v), so its VJP is the identity: q_bar and v_bar pass through, u_bar gets nothing. fl is
|
|
159
|
+
// the same word on every lane, so the skip is warp-uniform (outside any ADJ_LANES block: every lane continues together)
|
|
160
|
+
if (fl & kTapeOverflow) {
|
|
161
|
+
ADJ_LANES(lane) {
|
|
162
|
+
if (lane == 0) *flag = *flag | kShellBadRecord;
|
|
163
|
+
}
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const S* aadv = r + L.qadv;
|
|
167
|
+
const bool posed = L.npose == kNB;
|
|
168
|
+
ADJ_LANES(lane) {
|
|
169
|
+
for (int i = lane; i < 36; i += 32) sq[i] = r[L.qpos + i];
|
|
170
|
+
for (int i = lane; i < kNV; i += 32) { sv[i] = r[L.qvel + i]; sast[i] = r[L.qacc + i]; }
|
|
171
|
+
}
|
|
172
|
+
const S *q = sq, *v = sv, *astar = sast;
|
|
173
|
+
ADJ_STAMP(s, 0);
|
|
174
|
+
// 1. positions (the free root: dofs 0-2 translation, 3-5 rotation; a hinge dof d at qpos d + 1) and 2. velocities
|
|
175
|
+
ADJ_LANES(lane) {
|
|
176
|
+
if (lane == 3) { // the root rotation: q' = q (x) Exp(phi), phi = h w', w' = v + h a_adv (body frame)
|
|
177
|
+
S phi[3], t2 = S(0);
|
|
178
|
+
for (int k = 0; k < 3; ++k) { phi[k] = h * (v[3 + k] + h * aadv[3 + k]); t2 = t2 + phi[k] * phi[k]; }
|
|
179
|
+
using so3::js_sqrt; using so3::js_sin; using so3::js_cos;
|
|
180
|
+
const S th = js_sqrt(t2);
|
|
181
|
+
S c1, c2, d1, d2; // Exp = I + c1 K + c2 K^2 ; Jr = I - d1 K + d2 K^2 (K = [phi]x)
|
|
182
|
+
if (th < S(1e-8)) { c1 = S(1); c2 = S(0.5); d1 = S(0.5); d2 = S(1) / S(6); }
|
|
183
|
+
else {
|
|
184
|
+
const S sn = js_sin(th), cs = js_cos(th);
|
|
185
|
+
c1 = sn / th; c2 = (S(1) - cs) / t2; d1 = (S(1) - cs) / t2; d2 = (th - sn) / (t2 * th);
|
|
186
|
+
}
|
|
187
|
+
const S g[3] = {qb[3], qb[4], qb[5]};
|
|
188
|
+
S Kg[3], KKg[3];
|
|
189
|
+
cross3(phi, g, Kg); cross3(phi, Kg, KKg);
|
|
190
|
+
// Exp(phi) g -> q_bar rotation; h Jr(phi)' g = h (I + d1 K + d2 K^2) g (K' = -K) -> v_bar rotation
|
|
191
|
+
for (int k = 0; k < 3; ++k) {
|
|
192
|
+
qb[3 + k] = g[k] + c1 * Kg[k] + c2 * KKg[k];
|
|
193
|
+
vb[3 + k] = vb[3 + k] + h * (g[k] + d1 * Kg[k] + d2 * KKg[k]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
for (int i = lane; i < kNV; i += 32) {
|
|
197
|
+
if (i < 3 || i >= 6) vb[i] = vb[i] + h * qb[i]; // translation and hinges: q' = q + h v'
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
ADJ_LANES(lane) {
|
|
201
|
+
for (int i = lane; i < kNV; i += 32) aadvb[i] = h * vb[i]; // v' = v + h a_adv (v_bar passes through)
|
|
202
|
+
}
|
|
203
|
+
// 3. y = Q^-1 a_adv_bar (L_Q); a*_bar = M y = a_adv_bar - h kd (.) y on the unclamped actuated dofs. Each factor is staged in
|
|
204
|
+
// shared memory once (coalesced) in adj_tree's scratch, free until step 5: the solve's phases then read shared, not the record
|
|
205
|
+
ADJ_STAMP(s, 1);
|
|
206
|
+
stage_tri(r + L.LQ, L.ntri, tree_scr);
|
|
207
|
+
staged_solve(tree_scr, aadvb, work, z, y, sp0);
|
|
208
|
+
ADJ_LANES(lane) {
|
|
209
|
+
for (int i = lane; i < kNV; i += 32) {
|
|
210
|
+
const bool clamped = (tape_get_u(r, L.clamp + (i >> 5)) >> (i & 31)) & 1u;
|
|
211
|
+
asb[i] = clamped ? aadvb[i] : aadvb[i] - h * kd_dof[i] * y[i];
|
|
212
|
+
acc2[i] = astar[i] - aadv[i];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// 4. lambda = H^-1 a*_bar (L_H)
|
|
216
|
+
ADJ_STAMP(s, 2);
|
|
217
|
+
stage_tri(r + L.LH, L.ntri, tree_scr);
|
|
218
|
+
staged_solve(tree_scr, asb, work, z, lam, sp0);
|
|
219
|
+
if (dbg) {
|
|
220
|
+
ADJ_LANES(lane) {
|
|
221
|
+
for (int i = lane; i < kNV; i += 32) {
|
|
222
|
+
dbg[(s * 3 + 0) * kNV + i] = y[i]; dbg[(s * 3 + 1) * kNV + i] = asb[i]; dbg[(s * 3 + 2) * kNV + i] = lam[i];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// 5. theta: B's rows / PD reverse (adds, with the pose cotangents), then the RNE / pose sweep
|
|
227
|
+
ADJ_LANES(lane) {
|
|
228
|
+
for (int i = lane; i < 3 * kNB; i += 32) { xpb[i] = S(0); xrb[i] = S(0); }
|
|
229
|
+
}
|
|
230
|
+
ADJ_STAMP(s, 3);
|
|
231
|
+
rows(s, q, v, lam, astar, qb, vb, ub, xpb, xrb);
|
|
232
|
+
ADJ_STAMP(s, 4);
|
|
233
|
+
const S* pose = posed ? r + L.pose : nullptr;
|
|
234
|
+
adj_tree<S>(B, q, v, astar, acc2, lam, S(-1), y, S(1), xpb, xrb, qb, vb, tree_scr, nullptr, pose);
|
|
235
|
+
ADJ_STAMP(s, 5);
|
|
236
|
+
}
|
|
237
|
+
ADJ_LANES(lane) {
|
|
238
|
+
for (int i = lane; i < kNV; i += 32) { q_bar[i] = qb[i]; v_bar[i] = vb[i]; }
|
|
239
|
+
for (int i = lane; i < 29; i += 32) u_bar[i] = ub[i];
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
} // namespace js::soft::adj
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
// D16 adjoint, the contact-free reverse half FUSED into one tree sweep per substep (d5, 2026-11-02; prediction and gate in
|
|
3
|
+
// tools/d16_adj_rnea/PREREG.md, "Section split ... and the fused version's prediction"). adj_tree adds, in one root-to-leaf and
|
|
4
|
+
// one leaf-to-root sweep, the sum of what B's three calls per substep add:
|
|
5
|
+
// coef1 d/d(q, v) [seed1' RNEA(q, v, acc1)] with gravity (channel 1: B's (q, v, a*, gravity, lambda, -1))
|
|
6
|
+
// coef2 d/d q [seed2' RNEA(q, 0, acc2)] without gravity (channel 2: B's (q, null, a* - a_adv, y, +1))
|
|
7
|
+
// the pull-back of xpos_bar / xrot_bar through fk (B's pose cotangents of the substep)
|
|
8
|
+
// NablaEngine's organization (adjoint.py A3 / A4 / A7): the poses once, both channels as two interleaved chains on the levels,
|
|
9
|
+
// each body's own terms off the chain in one phase with all lanes active, then one reverse sweep with a 33-word message.
|
|
10
|
+
// The math of each term is rnea_adj.h's (gated there against kin.h in Dual); this file only reorganizes it.
|
|
11
|
+
#include "rnea_adj.h"
|
|
12
|
+
|
|
13
|
+
namespace js::soft::adj {
|
|
14
|
+
|
|
15
|
+
constexpr int kSlotT = 36; // forward publish: xq 4, xp 3, w, al, ao, wt, vot (ch 1), al2, ao2, wt2, vot2 (ch 2); 2 pad words
|
|
16
|
+
constexpr int kMsgT = 36; // reverse message: xpb, tau, ch 1 (wb, alb, aob, wtb, vtb), ch 2 (alb2, aob2, wtb2, vtb2); 3 pad
|
|
17
|
+
constexpr int kMaxKids = 4; // children per body held in registers (the G1: at most 3)
|
|
18
|
+
|
|
19
|
+
// The pose input's layout, in one place (the review: fixes ONE layout in tape.h): SoA as kernel P's hand, xpos [kNB][3] at word 0,
|
|
20
|
+
// then xquat [kNB][4]; the world's row holds the identity.
|
|
21
|
+
constexpr int kPoseXpos = 0, kPoseXquat = 3 * kNB, kPoseWords = 7 * kNB;
|
|
22
|
+
template <class S> DN_HOST_DEVICE inline const S* pose_xpos(const S* pose, int b) { return pose + kPoseXpos + 3 * b; }
|
|
23
|
+
template <class S> DN_HOST_DEVICE inline const S* pose_xquat(const S* pose, int b) { return pose + kPoseXquat + 4 * b; }
|
|
24
|
+
template <class S> DN_HOST_DEVICE inline S* pose_xpos(S* pose, int b) { return pose + kPoseXpos + 3 * b; }
|
|
25
|
+
template <class S> DN_HOST_DEVICE inline S* pose_xquat(S* pose, int b) { return pose + kPoseXquat + 4 * b; }
|
|
26
|
+
|
|
27
|
+
// 36-word row operations: float4 on the device for float (rows are 144-byte aligned), word by word elsewhere. Pure data movement
|
|
28
|
+
// and the same additions in the same order, so the results are bitwise those of the word-by-word loop.
|
|
29
|
+
template <class S> DN_HOST_DEVICE inline void add_row36(S* acc, const S* m) {
|
|
30
|
+
#if defined(__CUDA_ARCH__)
|
|
31
|
+
if constexpr (std::is_same<S, float>::value) {
|
|
32
|
+
const float4* m4 = reinterpret_cast<const float4*>(m);
|
|
33
|
+
#pragma unroll
|
|
34
|
+
for (int i = 0; i < 9; ++i) {
|
|
35
|
+
const float4 x = m4[i];
|
|
36
|
+
acc[4 * i] = acc[4 * i] + x.x; acc[4 * i + 1] = acc[4 * i + 1] + x.y; acc[4 * i + 2] = acc[4 * i + 2] + x.z;
|
|
37
|
+
acc[4 * i + 3] = acc[4 * i + 3] + x.w;
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
#endif
|
|
42
|
+
for (int k = 0; k < 36; ++k) acc[k] = acc[k] + m[k];
|
|
43
|
+
}
|
|
44
|
+
template <class S> DN_HOST_DEVICE inline void store_row36(S* dst, const S* src) {
|
|
45
|
+
#if defined(__CUDA_ARCH__)
|
|
46
|
+
if constexpr (std::is_same<S, float>::value) {
|
|
47
|
+
float4* d4 = reinterpret_cast<float4*>(dst);
|
|
48
|
+
#pragma unroll
|
|
49
|
+
for (int i = 0; i < 9; ++i) d4[i] = make_float4(src[4 * i], src[4 * i + 1], src[4 * i + 2], src[4 * i + 3]);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
#endif
|
|
53
|
+
for (int k = 0; k < 36; ++k) dst[k] = src[k];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
// R, r = X_b - X_p as the forward forms it (R_p pos), and the hinge axis a = R axis, from the poses (xq, xp) of the body and
|
|
58
|
+
// (pq) of its parent: what body_kin derives besides the pose itself, so a given pose gives bitwise body_kin's values.
|
|
59
|
+
template <class S, class Tab>
|
|
60
|
+
DN_HOST_DEVICE inline void body_pose_derived(const Tab& B, int b, const S* xq, const S* pq, S* R, S* r, S* a) {
|
|
61
|
+
const int jt = B.jnt(b);
|
|
62
|
+
if (jt == kJntFree) {
|
|
63
|
+
r[0] = r[1] = r[2] = S(0);
|
|
64
|
+
} else {
|
|
65
|
+
#if defined(__CUDA_ARCH__)
|
|
66
|
+
if constexpr (std::is_same<S, float>::value) {
|
|
67
|
+
d16::qrot_rn(pq, B.pos(b), r);
|
|
68
|
+
} else
|
|
69
|
+
#endif
|
|
70
|
+
{
|
|
71
|
+
S Rp[9];
|
|
72
|
+
quat_to_mat(pq, Rp);
|
|
73
|
+
mat_vec(Rp, B.pos(b), r);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
quat_to_mat(xq, R);
|
|
77
|
+
if (jt == kJntHinge) mat_vec(R, B.axis(b), a);
|
|
78
|
+
else a[0] = a[1] = a[2] = S(0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// pose: kernel P's poses in the layout of pose_xpos / pose_xquat (kPoseWords words), or nullptr to recompute them via body_kin.
|
|
82
|
+
template <class S, class Tab>
|
|
83
|
+
DN_HOST_DEVICE void adj_tree(const Tab& B, const S* q, const S* v, const S* acc1, const S* acc2, const S* seed1, S coef1,
|
|
84
|
+
const S* seed2, S coef2, const S* xpos_bar, const S* xrot_bar, S* q_bar, S* v_bar, S* scratch,
|
|
85
|
+
long long* prof = nullptr, const S* pose = nullptr) {
|
|
86
|
+
(void)prof;
|
|
87
|
+
S (*slot)[kSlotT] = reinterpret_cast<S (*)[kSlotT]>(scratch);
|
|
88
|
+
const int nb = B.nb();
|
|
89
|
+
LANEA(S, R, 9); LANEA(S, r, 3); LANEA(S, a, 3);
|
|
90
|
+
LANEA(S, own, kMsgT); // the body's own cotangent terms (off the chain), the reverse sweep's starting values
|
|
91
|
+
LANE1(int, dep); LANE1(int, par); LANE1(int, jtl); LANE1(int, nk); LANEA(int, kid, kMaxKids);
|
|
92
|
+
ADJ_LANES(lane) { // each lane's structure, read once (not per level)
|
|
93
|
+
LV(dep) = lane < nb ? B.depth(lane) : -1;
|
|
94
|
+
LV(par) = lane < nb ? B.parent(lane) : 0;
|
|
95
|
+
LV(jtl) = lane < nb ? B.jnt(lane) : -1;
|
|
96
|
+
LV(nk) = lane < nb ? B.nchild(lane) : 0;
|
|
97
|
+
#if !defined(__CUDA_ARCH__) // the device's table is checked at compile time (adj_tab.cuh), so no device assert and no stack
|
|
98
|
+
assert(LV(nk) <= kMaxKids && "adj_tree holds at most kMaxKids children per body in registers");
|
|
99
|
+
#endif
|
|
100
|
+
#pragma unroll
|
|
101
|
+
for (int i = 0; i < kMaxKids; ++i) LV(kid)[i] = i < LV(nk) ? B.child(lane, i) : 0;
|
|
102
|
+
}
|
|
103
|
+
if (pose) { // the poses are given: R, r and a for every body at once, off the levels' chain
|
|
104
|
+
ADJ_LANES(lane) {
|
|
105
|
+
if (LV(dep) >= 1) body_pose_derived(B, lane, pose_xquat(pose, lane), pose_xquat(pose, LV(par)), LV(R), LV(r), LV(a));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
ADJ_LANES(lane) {
|
|
109
|
+
if (lane == 0) { // the world: at rest; channel 1 has the base acceleration -gravity, channel 2 none
|
|
110
|
+
S* s = slot[0];
|
|
111
|
+
s[0] = S(1);
|
|
112
|
+
for (int k = 1; k < kSlotT; ++k) s[k] = S(0);
|
|
113
|
+
for (int k = 0; k < 3; ++k) s[13 + k] = S(0) - B.gravity(k);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// ---- A3: root-to-leaf, the poses and both channels' velocity / acceleration chains
|
|
117
|
+
for (int d = 1; d <= B.maxdepth(); ++d) {
|
|
118
|
+
ADJ_LANES(lane) {
|
|
119
|
+
ADJ_LEAD(LV(dep) == d);
|
|
120
|
+
if (LV(dep) == d) {
|
|
121
|
+
ADJ_TS(2 + 10 * (d - 1));
|
|
122
|
+
const int b = lane, jt = LV(jtl);
|
|
123
|
+
const S* ps = slot[LV(par)];
|
|
124
|
+
S* s = slot[b];
|
|
125
|
+
S xq[4], xp[3];
|
|
126
|
+
// the posed path needs no pose on the chain: R, r, a came from the pre-pass and the off-chain phase reads the pose itself
|
|
127
|
+
if (pose) { for (int k = 0; k < 4; ++k) xq[k] = S(0); for (int k = 0; k < 3; ++k) xp[k] = S(0); }
|
|
128
|
+
else body_kin(B, b, q, ps, ps + 4, xq, xp, LV(R), LV(r), LV(a));
|
|
129
|
+
ADJ_TS(3 + 10 * (d - 1));
|
|
130
|
+
const S *wp = ps + 7, *alp = ps + 10, *aop = ps + 13, *wtp = ps + 16, *votp = ps + 19;
|
|
131
|
+
const S *al2p = ps + 22, *ao2p = ps + 25, *wt2p = ps + 28, *vot2p = ps + 31;
|
|
132
|
+
S w[3], al[3], ao[3], wt[3], vot[3], al2[3], ao2[3], wt2[3], vot2[3], t[3];
|
|
133
|
+
if (jt == kJntFree) {
|
|
134
|
+
const int dd = B.dadr(b);
|
|
135
|
+
S wbody[3] = {v[dd + 3], v[dd + 4], v[dd + 5]}, a1b[3] = {acc1[dd + 3], acc1[dd + 4], acc1[dd + 5]},
|
|
136
|
+
a2b[3] = {acc2[dd + 3], acc2[dd + 4], acc2[dd + 5]}, s1b[3] = {seed1[dd + 3], seed1[dd + 4], seed1[dd + 5]},
|
|
137
|
+
s2b[3] = {seed2[dd + 3], seed2[dd + 4], seed2[dd + 5]};
|
|
138
|
+
mat_vec(LV(R), wbody, w);
|
|
139
|
+
mat_vec(LV(R), a1b, t); for (int k = 0; k < 3; ++k) al[k] = alp[k] + t[k];
|
|
140
|
+
mat_vec(LV(R), a2b, t); for (int k = 0; k < 3; ++k) al2[k] = al2p[k] + t[k];
|
|
141
|
+
mat_vec(LV(R), s1b, t); for (int k = 0; k < 3; ++k) wt[k] = wtp[k] + t[k];
|
|
142
|
+
mat_vec(LV(R), s2b, t); for (int k = 0; k < 3; ++k) wt2[k] = wt2p[k] + t[k];
|
|
143
|
+
for (int k = 0; k < 3; ++k) {
|
|
144
|
+
ao[k] = aop[k] + acc1[dd + k]; ao2[k] = ao2p[k] + acc2[dd + k];
|
|
145
|
+
vot[k] = votp[k] + seed1[dd + k]; vot2[k] = vot2p[k] + seed2[dd + k];
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
S t1[3], t2[3], t3[3];
|
|
149
|
+
cross3(wp, LV(r), t1); cross3(alp, LV(r), t2); cross3(wp, t1, t3);
|
|
150
|
+
for (int k = 0; k < 3; ++k) ao[k] = aop[k] + t2[k] + t3[k];
|
|
151
|
+
cross3(al2p, LV(r), t2);
|
|
152
|
+
for (int k = 0; k < 3; ++k) ao2[k] = ao2p[k] + t2[k];
|
|
153
|
+
cross3(wtp, LV(r), t1); for (int k = 0; k < 3; ++k) vot[k] = votp[k] + t1[k];
|
|
154
|
+
cross3(wt2p, LV(r), t1); for (int k = 0; k < 3; ++k) vot2[k] = vot2p[k] + t1[k];
|
|
155
|
+
if (jt == kJntHinge) {
|
|
156
|
+
const int dd = B.dadr(b);
|
|
157
|
+
const S vb = v[dd];
|
|
158
|
+
S sq[3], c[3];
|
|
159
|
+
for (int k = 0; k < 3; ++k) sq[k] = LV(a)[k] * vb;
|
|
160
|
+
cross3(wp, sq, c);
|
|
161
|
+
for (int k = 0; k < 3; ++k) {
|
|
162
|
+
w[k] = wp[k] + sq[k];
|
|
163
|
+
al[k] = alp[k] + c[k] + LV(a)[k] * acc1[dd];
|
|
164
|
+
wt[k] = wtp[k] + LV(a)[k] * seed1[dd];
|
|
165
|
+
al2[k] = al2p[k] + LV(a)[k] * acc2[dd];
|
|
166
|
+
wt2[k] = wt2p[k] + LV(a)[k] * seed2[dd];
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
for (int k = 0; k < 3; ++k) { w[k] = wp[k]; al[k] = alp[k]; wt[k] = wtp[k]; al2[k] = al2p[k]; wt2[k] = wt2p[k]; }
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
ADJ_TS(4 + 10 * (d - 1));
|
|
173
|
+
S pub[kSlotT];
|
|
174
|
+
for (int k = 0; k < 4; ++k) pub[k] = xq[k];
|
|
175
|
+
for (int k = 0; k < 3; ++k) {
|
|
176
|
+
pub[4 + k] = xp[k]; pub[7 + k] = w[k]; pub[10 + k] = al[k]; pub[13 + k] = ao[k]; pub[16 + k] = wt[k]; pub[19 + k] = vot[k];
|
|
177
|
+
pub[22 + k] = al2[k]; pub[25 + k] = ao2[k]; pub[28 + k] = wt2[k]; pub[31 + k] = vot2[k];
|
|
178
|
+
}
|
|
179
|
+
pub[34] = pub[35] = S(0);
|
|
180
|
+
store_row36(s, pub);
|
|
181
|
+
ADJ_TS(5 + 10 * (d - 1));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// ---- A4: each body's own terms, all lanes at once (off the levels' chain)
|
|
186
|
+
ADJ_LANES(lane) {
|
|
187
|
+
ADJ_LEAD(lane == 1);
|
|
188
|
+
ADJ_TS(kProf - 3);
|
|
189
|
+
if (lane >= 1 && lane < nb) {
|
|
190
|
+
const int b = lane;
|
|
191
|
+
const S* s = slot[b];
|
|
192
|
+
const S *w = s + 7, *al = s + 10, *ao = s + 13, *wt = s + 16, *vot = s + 19, *al2 = s + 22, *ao2 = s + 25, *wt2 = s + 28,
|
|
193
|
+
*vot2 = s + 31;
|
|
194
|
+
S* o = LV(own);
|
|
195
|
+
for (int k = 0; k < kMsgT; ++k) o[k] = S(0);
|
|
196
|
+
if (xpos_bar) for (int k = 0; k < 3; ++k) { o[k] = xpos_bar[3 * b + k]; o[3 + k] = xrot_bar[3 * b + k]; }
|
|
197
|
+
const S m = B.mass(b);
|
|
198
|
+
S rc[3], I[9], xq2[4], X[9];
|
|
199
|
+
mat_vec(LV(R), B.ipos(b), rc);
|
|
200
|
+
quat_mul(pose ? pose_xquat(pose, b) : s, B.iquat(b), xq2);
|
|
201
|
+
quat_to_mat(xq2, X);
|
|
202
|
+
world_inertia(X, B.inertia(b), I);
|
|
203
|
+
S *tau = o + 3, *wb = o + 6, *alb = o + 9, *aob = o + 12, *wtb = o + 15, *vtb = o + 18, *alb2 = o + 21, *aob2 = o + 24,
|
|
204
|
+
*wtb2 = o + 27, *vtb2 = o + 30;
|
|
205
|
+
S rcb[3] = {S(0), S(0), S(0)}, Ib[9], t[3], u[3], ub[3];
|
|
206
|
+
// channel 1: f = m (ao + al x rc + w x (w x rc)), n = I al + w x I w, vc~ = vo~ + w~ x rc; s1 = coef1 (f . vc~ + n . w~)
|
|
207
|
+
{
|
|
208
|
+
S u1[3], u2[3], u3[3], Iw[3], Ial[3], wIw[3], f[3], n[3], vct[3];
|
|
209
|
+
cross3(al, rc, u1); cross3(w, rc, u2); cross3(w, u2, u3);
|
|
210
|
+
for (int k = 0; k < 3; ++k) f[k] = m * (ao[k] + u1[k] + u3[k]);
|
|
211
|
+
mat_vec(I, w, Iw); mat_vec(I, al, Ial); cross3(w, Iw, wIw);
|
|
212
|
+
for (int k = 0; k < 3; ++k) n[k] = Ial[k] + wIw[k];
|
|
213
|
+
cross3(wt, rc, u1);
|
|
214
|
+
for (int k = 0; k < 3; ++k) vct[k] = vot[k] + u1[k];
|
|
215
|
+
S fb[3], nbar[3], vcb[3], acb[3], nxw[3];
|
|
216
|
+
for (int k = 0; k < 3; ++k) { fb[k] = coef1 * vct[k]; nbar[k] = coef1 * wt[k]; vcb[k] = coef1 * f[k];
|
|
217
|
+
wtb[k] = wtb[k] + coef1 * n[k]; acb[k] = m * fb[k]; }
|
|
218
|
+
mat_vec(I, nbar, t); add3(alb, t);
|
|
219
|
+
cross3(nbar, w, nxw);
|
|
220
|
+
cross3(Iw, nbar, t); add3(wb, t);
|
|
221
|
+
mat_vec(I, nxw, t); add3(wb, t);
|
|
222
|
+
for (int i = 0; i < 3; ++i)
|
|
223
|
+
for (int j = 0; j < 3; ++j) Ib[3 * i + j] = nbar[i] * al[j] + nxw[i] * w[j];
|
|
224
|
+
add3(aob, acb);
|
|
225
|
+
cross3(rc, acb, t); add3(alb, t);
|
|
226
|
+
cross3(acb, al, t); add3(rcb, t);
|
|
227
|
+
cross3(w, rc, u); cross3(acb, w, ub);
|
|
228
|
+
cross3(u, acb, t); add3(wb, t);
|
|
229
|
+
cross3(rc, ub, t); add3(wb, t);
|
|
230
|
+
cross3(ub, w, t); add3(rcb, t);
|
|
231
|
+
add3(vtb, vcb);
|
|
232
|
+
cross3(rc, vcb, t); add3(wtb, t);
|
|
233
|
+
cross3(vcb, wt, t); add3(rcb, t);
|
|
234
|
+
}
|
|
235
|
+
// channel 2 (w = 0): f2 = m (ao2 + al2 x rc), n2 = I al2, vc2~ = vo2~ + w2~ x rc; s2 = coef2 (f2 . vc2~ + n2 . w2~)
|
|
236
|
+
{
|
|
237
|
+
S u1[3], f2[3], n2[3], vct2[3];
|
|
238
|
+
cross3(al2, rc, u1);
|
|
239
|
+
for (int k = 0; k < 3; ++k) f2[k] = m * (ao2[k] + u1[k]);
|
|
240
|
+
mat_vec(I, al2, n2);
|
|
241
|
+
cross3(wt2, rc, u1);
|
|
242
|
+
for (int k = 0; k < 3; ++k) vct2[k] = vot2[k] + u1[k];
|
|
243
|
+
S fb[3], nbar[3], vcb[3], acb[3];
|
|
244
|
+
for (int k = 0; k < 3; ++k) { fb[k] = coef2 * vct2[k]; nbar[k] = coef2 * wt2[k]; vcb[k] = coef2 * f2[k];
|
|
245
|
+
wtb2[k] = wtb2[k] + coef2 * n2[k]; acb[k] = m * fb[k]; }
|
|
246
|
+
mat_vec(I, nbar, t); add3(alb2, t);
|
|
247
|
+
for (int i = 0; i < 3; ++i)
|
|
248
|
+
for (int j = 0; j < 3; ++j) Ib[3 * i + j] = Ib[3 * i + j] + nbar[i] * al2[j];
|
|
249
|
+
add3(aob2, acb);
|
|
250
|
+
cross3(rc, acb, t); add3(alb2, t);
|
|
251
|
+
cross3(acb, al2, t); add3(rcb, t);
|
|
252
|
+
add3(vtb2, vcb);
|
|
253
|
+
cross3(rc, vcb, t); add3(wtb2, t);
|
|
254
|
+
cross3(vcb, wt2, t); add3(rcb, t);
|
|
255
|
+
}
|
|
256
|
+
// rotations of the body-attached rc and I (both channels): tau += rc x rc_bar + vee(Ib I - I Ib)
|
|
257
|
+
cross3(rc, rcb, t); add3(tau, t);
|
|
258
|
+
S G[9];
|
|
259
|
+
for (int i = 0; i < 3; ++i)
|
|
260
|
+
for (int j = 0; j < 3; ++j) {
|
|
261
|
+
S s1 = S(0), s2 = S(0);
|
|
262
|
+
for (int k = 0; k < 3; ++k) { s1 = s1 + Ib[3 * i + k] * I[3 * k + j]; s2 = s2 + I[3 * i + k] * Ib[3 * k + j]; }
|
|
263
|
+
G[3 * i + j] = s1 - s2;
|
|
264
|
+
}
|
|
265
|
+
t[0] = G[7] - G[5]; t[1] = G[2] - G[6]; t[2] = G[3] - G[1];
|
|
266
|
+
add3(tau, t);
|
|
267
|
+
}
|
|
268
|
+
ADJ_TS(kProf - 2);
|
|
269
|
+
}
|
|
270
|
+
// ---- A7: leaf-to-root, both channels and the pose pull-back in one message
|
|
271
|
+
for (int d = B.maxdepth(); d >= 1; --d) {
|
|
272
|
+
ADJ_LANES(lane) {
|
|
273
|
+
ADJ_LEAD(LV(dep) == d);
|
|
274
|
+
if (LV(dep) == d) {
|
|
275
|
+
ADJ_TS(7 + 10 * (d - 1));
|
|
276
|
+
const int b = lane, jt = LV(jtl);
|
|
277
|
+
S acc[kMsgT];
|
|
278
|
+
for (int k = 0; k < kMsgT; ++k) acc[k] = LV(own)[k];
|
|
279
|
+
#pragma unroll
|
|
280
|
+
for (int ci = 0; ci < kMaxKids; ++ci) // the children, in increasing index (unrolled: kid[] stays in registers)
|
|
281
|
+
if (ci < LV(nk)) add_row36(acc, slot[LV(kid)[ci]]);
|
|
282
|
+
ADJ_TS(8 + 10 * (d - 1));
|
|
283
|
+
S *xpb = acc, *tau = acc + 3, *wb = acc + 6, *alb = acc + 9, *aob = acc + 12, *wtb = acc + 15, *vtb = acc + 18,
|
|
284
|
+
*alb2 = acc + 21, *aob2 = acc + 24, *wtb2 = acc + 27, *vtb2 = acc + 30;
|
|
285
|
+
const S* s = slot[b];
|
|
286
|
+
S t[3];
|
|
287
|
+
if (jt == kJntFree) {
|
|
288
|
+
const int dd = B.dadr(b);
|
|
289
|
+
const S *w = s + 7, *al = s + 10, *wt = s + 16, *al2 = s + 22, *wt2 = s + 28; // the root's parent is the world (at rest)
|
|
290
|
+
cross3(w, wb, t); add3(tau, t);
|
|
291
|
+
cross3(al, alb, t); add3(tau, t);
|
|
292
|
+
cross3(wt, wtb, t); add3(tau, t);
|
|
293
|
+
cross3(al2, alb2, t); add3(tau, t);
|
|
294
|
+
cross3(wt2, wtb2, t); add3(tau, t);
|
|
295
|
+
mat_tvec(LV(R), wb, t);
|
|
296
|
+
for (int k = 0; k < 3; ++k) v_bar[dd + 3 + k] = v_bar[dd + 3 + k] + t[k];
|
|
297
|
+
mat_tvec(LV(R), tau, t);
|
|
298
|
+
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]; }
|
|
299
|
+
} else {
|
|
300
|
+
const S* ps = slot[LV(par)]; // the parent's forward values (it overwrites its slot only in the next phase)
|
|
301
|
+
const S *wp = ps + 7, *alp = ps + 10, *wtp = ps + 16, *al2p = ps + 22, *wt2p = ps + 28;
|
|
302
|
+
S out[kMsgT];
|
|
303
|
+
for (int k = 0; k < kMsgT; ++k) out[k] = S(0);
|
|
304
|
+
S rb[3] = {xpb[0], xpb[1], xpb[2]}, u[3], ub[3];
|
|
305
|
+
S *ow = out + 6, *oal = out + 9, *oao = out + 12, *owt = out + 15, *ovt = out + 18, *oal2 = out + 21, *oao2 = out + 24,
|
|
306
|
+
*owt2 = out + 27, *ovt2 = out + 30;
|
|
307
|
+
// channel 1: ao = ao_p + al_p x r + w_p x (w_p x r); vo~ = vo~_p + w~_p x r
|
|
308
|
+
add3(oao, aob);
|
|
309
|
+
cross3(LV(r), aob, t); add3(oal, t);
|
|
310
|
+
cross3(aob, alp, t); add3(rb, t);
|
|
311
|
+
cross3(wp, LV(r), u); cross3(aob, wp, ub);
|
|
312
|
+
cross3(u, aob, t); add3(ow, t);
|
|
313
|
+
cross3(LV(r), ub, t); add3(ow, t);
|
|
314
|
+
cross3(ub, wp, t); add3(rb, t);
|
|
315
|
+
add3(ovt, vtb);
|
|
316
|
+
cross3(LV(r), vtb, t); add3(owt, t);
|
|
317
|
+
cross3(vtb, wtp, t); add3(rb, t);
|
|
318
|
+
// channel 2: ao2 = ao2_p + al2_p x r; vo2~ = vo2~_p + w2~_p x r
|
|
319
|
+
add3(oao2, aob2);
|
|
320
|
+
cross3(LV(r), aob2, t); add3(oal2, t);
|
|
321
|
+
cross3(aob2, al2p, t); add3(rb, t);
|
|
322
|
+
add3(ovt2, vtb2);
|
|
323
|
+
cross3(LV(r), vtb2, t); add3(owt2, t);
|
|
324
|
+
cross3(vtb2, wt2p, t); add3(rb, t);
|
|
325
|
+
add3(ow, wb); add3(oal, alb); add3(owt, wtb); add3(oal2, alb2); add3(owt2, wtb2);
|
|
326
|
+
if (jt == kJntHinge) {
|
|
327
|
+
const int dd = B.dadr(b);
|
|
328
|
+
const S vb = v[dd];
|
|
329
|
+
S ab3[3], sq[3], sqb[3];
|
|
330
|
+
for (int k = 0; k < 3; ++k) {
|
|
331
|
+
sq[k] = LV(a)[k] * vb;
|
|
332
|
+
ab3[k] = vb * wb[k] + acc1[dd] * alb[k] + seed1[dd] * wtb[k] + acc2[dd] * alb2[k] + seed2[dd] * wtb2[k];
|
|
333
|
+
}
|
|
334
|
+
cross3(sq, alb, t); add3(ow, t);
|
|
335
|
+
cross3(alb, wp, sqb);
|
|
336
|
+
for (int k = 0; k < 3; ++k) ab3[k] = ab3[k] + vb * sqb[k];
|
|
337
|
+
v_bar[dd] = v_bar[dd] + dot3(LV(a), wb) + dot3(LV(a), sqb);
|
|
338
|
+
cross3(LV(a), ab3, t); add3(tau, t);
|
|
339
|
+
q_bar[dd] = q_bar[dd] + dot3(LV(a), tau);
|
|
340
|
+
}
|
|
341
|
+
for (int k = 0; k < 3; ++k) out[k] = xpb[k];
|
|
342
|
+
cross3(LV(r), rb, t);
|
|
343
|
+
for (int k = 0; k < 3; ++k) out[3 + k] = tau[k] + t[k];
|
|
344
|
+
store_row36(slot[b], out); // read by the parent in the next phase
|
|
345
|
+
}
|
|
346
|
+
ADJ_TS(10 + 10 * (d - 1));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
ADJ_LANES(lane) {
|
|
351
|
+
ADJ_LEAD(lane == 0);
|
|
352
|
+
ADJ_TS(kProf - 1);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
} // namespace js::soft::adj
|