Repository navigation
Allocate GRiD topology helpers in fixed-base dynamics - #21
Conversation
Reserve aligned helper storage in the dynamics and gradient scratch arenas, including contact and exact-Hessian compositions. Keep zero-helper models unchanged and propagate the existing scalar type through scratch-size calculations. Compare a three-joint signed/mixed-axis robot against Pinocchio for the device step and discrete A/B linearization. Its helper-index/sign path exercises the missing buffer in ordinary Release builds.
|
Thank you for finding this and for the Pinocchio check. The fix is merged on our development line with one addition: the exact-Hessian path now carves the helper block at the end of the numeric arena with a static_assert that the sum fits the sizer, instead of subtracting from the arena end. The vendored arms have a zero helper count, so their modules and goldens are unchanged, and your mixed-axis test runs in the slow tier and the signed receipt (512 tests). Timing of the release: we are batching this with a set of GRiD changes (the sizing rule, 5n+1 helpers for branching plus n for any non +Z axis with n = max(nq, NJ), goes into GRiD's integration docs, and GRiD will emit the rounded T-element count next to the COUNT constants so adapters stop computing it by hand) and will ship everything together in one release, soon but not immediately. The PR will show as merged when that line is pushed. |
|
Thank you for finding this and for the Pinocchio check. The fix is merged on our development line with one addition: the exact-Hessian path now carves the helper block at the end of the numeric arena with a static_assert that the sum fits the sizer, instead of subtracting from the arena end. The vendored arms have a zero helper count, so their modules and goldens are unchanged, and your mixed-axis test runs in the slow tier and the signed receipt. On the GRiD side the rule is now in grid-rbd 0.5.4 (released): the count is 5n+1 helpers for branching plus n for any non +Z axis with n = max(nq, NJ), stated in the integration docs, and the header emits |
|
Merged and released in 0.1.4 with the exact-Hessian helper carve under a static_assert; |
Mixed-axis serial arms can require GRiD helper storage, but the fixed-base
adapter passed null pointers. A three-joint +Z/-Z/+X arm produces a CUDA launch
failure.
Reserve aligned scratch for the helpers and thread it through dynamics, derivatives,
contact and exact-Hessian compositions. Zero-helper scratch sizes stay unchanged.
Validation: four registration host checks pass. The new three-joint test checks
the device step and SQP linearization against Pinocchio; it fails on the baseline
and passes with the fix.
I also use this on working MPC on a robot model of TIAGo Pro.
No performance impact:
Timing:
aeacf16→639320b, GTX1070/sm61, i7-7700K, CUDA12.9, GRiD0.5.1,Release/fast-math. Three separate repeats per source, each using:
Mean repeat-median native solve-wall time: B1 0.414 → 0.400 ms;
B16 4.899 → 4.877 ms. Two matched-clock B16 pairs give 4.893 → 4.884 ms
(−0.18%); B1 clocks vary.
developed with codex everything reviewed by me
@cherti