Improve DART 6 deformable-body performance and soft contact#3382
Improve DART 6 deformable-body performance and soft contact#3382jslee02 wants to merge 133 commits into
Conversation
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
dart/dart/collision/dart/DARTCollisionDetector.hpp
Lines 128 to 129 in 05d9de6
When a downstream application or plugin is built against the previous DART 6.20 headers but loaded with this library, these new private members change sizeof(DARTCollisionDetector) and the derived-class layout for an exported installed class. The same commit uses side registries/static assertions elsewhere to preserve release-branch ABI, so the thread-count/thread-pool state should follow that pattern instead of adding storage to the public header.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 416266f60e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c41f273d27
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Record the two independent role-separated reviews (correctness APPROVE; semantic-equivalence EQUIVALENT-AND-CORRECT) on head 351d4a0 for the ConstraintSolver registry-removal and preparation-state fix, standing in for the weekly-limited Codex code review. Note the spurious non-required AppVeyor status and the optional non-blocking hardening follow-ups. Record the 2026-07-23 maintainer directive elevating the task to full two-paper parity (correctness and performance, no compromise) plus zero rigid-body overhead, retracting the 2026-07-11 deferral list, via ABI-safe additive work on release-6.20 in a ~3-PR structure, with a research-and-propose milestone plan as the next step.
Accepted 2026-07-23 plan for full Kim/Pollard + Jain/Liu parity (correctness and performance, no compromise) plus zero rigid-body overhead, as ABI-safe additive work on release-6.20 in a ~3-PR structure. Grounds the ABI-safe FEM extension design (no FEM exists in DART today; integrate via a custom FemBodyNode's existing virtuals / ConstraintBase / subclassed ConstraintSolver rather than SoftBodyNode's ABI-breaking Skeleton-registry pattern) and the Jain/Liu controller/model reuse (existing SIMBICON controller + soft-feet Atlas asset). First build step is M2.0: prototype and pick the FEM integration seam while proving pure-rigid determinism and zero overhead. Point PLAN-622 at the plan.
The ABI-safe per-step FEM integration hook is a custom constraint::ConstraintBase whose update() ConstraintSolver::updateConstraints() calls unconditionally every solve() (ConstraintSolver.cpp:1077, before the isActive() LCP gate), staying out of the LCP with isActive()==false. A throwaway prototype (single explicit-Euler particle one-way spring-coupled to a free rigid body) proved the hook runs 200/200, integrates deterministically, and leaves the rigid trajectory bit-identical (zero perturbation) while touching no production code -- confirming additive-on-release-6.20 is feasible. Two-way FEM->rigid coupling must use LCP participation or caller-driven force before step() because mid-solve addExtForce is cleared at World.cpp:1378. Records the seam, the coupling routes, zero-rigid- overhead/determinism, and ABI-safety; updates RESUME next steps to PR-2 M2.1 and PR-3a soft-foot.
Record the maintainer's 2026-07-23 sign-off of the competitive-implementation envelope (in-tree backends + normalized paper metrics; external engines out of scope) as the performance-acceptance bar. Add the PR-3a kickoff spec for the Jain/Liu biped-push-recovery row: reuse the GUI-free atlas_simbicon controller with the soft-feet Atlas asset, 3-part model/scene/test pattern, CMake wiring, and rigid-vs-soft push-recovery/contact-count acceptance gates.
Summary
contact coverage for DART 6.
benchmark, and demo coverage.
layouts and default behavior.
This is a representative DART 6 release slice, not a claim of complete paper
parity, successful multicore scaling, or a native-default deformable backend.
Motivation / Problem
DART 6
SoftBodyNodehad a useful point-mass soft-body model, but lackedseveral release-quality pieces:
a vertex;
gates;
native-default follow-ups.
The implementation must preserve DART 6 API/ABI compatibility. New behavior
therefore remains opt-in and implementation state stays out of public class
layouts.
Before / After
adaptive_soft_contactandsoft_wormare integrated intodart-demos; no new standalone GUI executables remain.Changes / Key Changes
Adaptive soft-contact activation (WP-DB.05, opt-in)
SoftBodyNodecontrols for contact seeding, ringexpansion, linger, and rest tolerances.
Soft face-interior contacts (WP-DB.08, opt-in)
soft vertices.
Equation and stability coverage (WP-DB.02/.04)
external-force checks.
public mass-matrix columns.
mode and adds an immediate-query regression.
final-state gates.
Performance and memory work (WP-DB.06/.07)
empty-solve, allocation, and native-fallback improvements that passed
correctness gates.
PointMassstorage as deferred redesign work.affinity, raw-row, and completion-marker requirements.
process-group wall-time guarantee.
Native collision direction (WP-DB.08)
direct-native fallback support.
downstream gates, and reproducible paired evidence.
docs/design/dart6_deformable_body.md.Flagship demos (WP-DB.09)
adaptive_soft_contactandsoft_worminto the consolidateddart-demosSoft Bodies catalog; the separate executables are removed.the common ImGui host.
model tests preserving the adaptive comparison and worm-locomotion gates.
Performance evidence and limitation
The recorded pre-merge matrix at
.benchmark_results/wp-db-final-6cfa4fa-parent-c743a45-base-72ebe16/compares branch
3340e1d3df2with base72ebe164e8c.adaptive_deformable/1is +8.4% in the noisy block-ordered run.FAILbecause directnativeexceeds the2% tie tolerance on several rows.
only; they do not override the evaluator or cover the full failed gate.
A reviewed paired runner now exists, but every exact-head attempt was stopped
in preflight because the shared host failed its load/thermal/workload gates.
The latest clean-source attempt at
af7ae4ccedderecorded 156/156 loadfailures, 151 thermal failures, 110 sibling-workload failures, zero clean polls,
and no timing rows or
COMPLETE.json.Accordingly, no final native/DART winner claim is made. Closeout still requires
either a conformant paired artifact or explicit maintainer acceptance of the
documented limitation.
Scope decisions and follow-ups
Maintainer-approved deferrals cover the paper-scale volumetric-FEM characters,
SIMBICON/controller rows, and hand-manipulation scenes. They do not cover the
four-link flexible-rigid-foot versus deformable-foot comparison.
Still open:
mainfix corresponding to release commit10c6b6055e4; andTesting
Current exact head:
351d4a04fb3fc070e5c1713dba23a32738e49c8c.It includes
origin/release-6.20@6a1d377f61631f03880a88bd21f2e7e803696c1athrough merge commit
416266f60e484e2a6359fcdc8fecdaa718f3a3ff,same-count soft-face cache repair
e973a75fb96, Gazebo hot-path correctionc41f273d271, preparation-state review fix891f43fd590, and the evidencerefresh at the current head. The base merge also carries #3395's Windows CI
/GL//LTCGcorrection.Windows and Codecov follow-up
At pre-follow-up head
b172b2ee1db, 21 checks passed, one failed, and onewas skipped. Windows Release completed 150/151 tests; the only failure was
SoftDynamicsTest.restingSoftContactForceAndCenterOfPressureAreSmoothinlegacy FCL's
default adaptivelane, where maximum per-step CoP motion was0.12115883267368355 magainst the former0.11 mbound.Test-only commit
50a254e7e56calibrates the legacy-FCL bound to0.13 m,just above one
0.125 mscene mesh interval. The native bound remains0.02 m; percentile-force, support-loss, spike, and finite-state guards areunchanged, and the per-step CoP assertion remains in place. This changes no
runtime behavior, API, ABI, or default simulation semantics. Windows Release
passed the calibrated suite on
05d9de6e3fbbefore the ABI follow-up.Codecov passed both GitHub checks on
b172b2ee1db: patch coverage was94.34783%with 143 uncovered changed lines, while project coverage was75.17%versus73.90%(reported as+1.26percentage points). The redpatch marker in the bot comment is informational under
codecov.yml; it isnot a required threshold.
Detector ABI follow-up
Fresh Codex review of
05d9de6e3fbidentified private collision-threadfields in the installed, derivable
DARTCollisionDetectorclass. Those fieldsoriginated in prior release commit
3e13581f67d, but they are absent fromreleased tag
v6.19.4and enlarged the x86-64 class from 32 to 48 bytes.Commit
9a6796596bcrestores the released header layout and implicit-destructorsurface. DART-specific thread-pool/count and soft-contact state now lives in a
forwarding manager behind the base class's existing collision-object-manager
pointer. The pool address remains stable, resize is serialized, published
options are atomic, clone state remains independent, and compile-time
size/alignment guards prevent renewed exported-layout growth.
ABI follow-up validation:
test_DARTCollisionDetector— PASS (22/22)test_Collision— PASS (52/52)test_NonFiniteContact— PASS (4/4)v6.19.4-header/new-library ABI canary — PASS (20/20 processes;legacy/current detector sizes both 32 bytes)
pixi run lint,git diff --check, andpixi run check-ai-commands— PASSThe ABI compatibility repair has a DART 6.20 changelog entry linked to #3382.
Same-count soft-topology cache follow-up
Fresh review of merge head
416266f60e4found that changing aSoftBodyNodeface ordering without changing point/face counts left theDART fallback object's cached face identities, first-face map, and BVH
topology stale. Commit
e973a75fb96compares the cached and current faceindices after the existing O(1) topology guards and reuses the existing
cache/BVH rebuild path when they differ.
The controlled regression failed before the fix (
triID2remained stale at0instead of moving to2) and passed afterward. It also exercises avertex contact to guard the first-face map.
Exact-head local validation:
pixi run lint— PASStest_DARTCollisionDetector— PASS (23/23)INTEGRATION_StepAllocation,test_Collision, andtest_NonFiniteContact— PASSpixi run test— PASS (154/154)git diff --checkand post-repair Ninja no-work check — CLEANThe fix is implementation-only, allocation-free, and does not change public
API, ABI, or default contact-enable behavior. The unchanged-cache path adds
an early-exit O(F) integer comparison alongside the existing O(P) point
geometry scan.
Gazebo zero-overhead follow-up
The PR previously put a process-wide
ConstraintSolverClearStateRegistrylookup, mutex, and hash-table access on every
ConstraintSolver::solve()call. Commit
c41f273d271removes that unconditional cost. Previous-stepcleanup is derived from
mActiveConstraintsandmCollisionResult, whichthe solver already retains, while newly inserted skeletons are sanitized
outside the stepping hot path. The common contact cleanup remains
branch-free per skeleton.
The audited downstream path is the real plugin boundary:
GzOdeCollisionDetectorby default, and gz-sim 9reaches DART through that gz-physics plugin;
default rigid-world route;
and
libdarthas no clear-state-registry symbol, so the removedregistry no longer adds unconditional synchronization to a one-thread
Gazebo step.
A production-equivalent plugin-boundary A/B used GCC 15.2, Release
-O3,profiling off, SIMD off, CPU 24, 1,000 warmup steps, and 20 interleaved
base/head pairs. Timing covered only gz-physics
World::Step:The corresponding medians improved 24.773% and 0.816%. This timing does not
claim mathematical instruction-for-instruction identity; the structural
audit establishes removal of the unintended unconditional work, and the
plugin-boundary A/B establishes no measured downstream regression.
Exact local validation:
test_ConstraintSolver— PASS (57/57)DART_DISABLE_COMPILER_CACHE=ON pixi run test— PASS (154/154)pixi run lint, pre-commit Tier-0 gate, andgit diff --check— PASSFresh review of
c41f273d271found thatprepareForSimulation()coulderase the retained active-set signal after a manual-only solve, preventing
the next
solve()from clearing the prior constraint impulse. Commit891f43fd590preserves the active set and its classification flags acrossthe preparation-only passes. The regression failed before the fix and
passed afterward. Because
solve()and the production gz steady-state pathare unchanged, the plugin-boundary A/B above remains an exact comparison of
the affected hot-path code.
No new changelog entry is needed: #3382 already documents the user-visible
deformable feature and ABI repair, while this follow-up removes an internal
implementation cost without adding an API or user-visible behavior.
Local validation on the merged calibration candidate
pixi run lint— PASSpixi run check-ai-commands— PASS (23 shared capabilities)DART_DISABLE_COMPILER_CACHE=ON pixi run build— PASS (292/292)DART_DISABLE_COMPILER_CACHE=ON pixi run test— PASS (154/154)test_SoftDynamics— PASS (25/25)pixi run -e gazebo test-gz— PASS (gz-physics 199/199 functional and4/4 performance checks; gz-sim source-built-DART integration 1/1)
git diff --check— PASSimplementation, and CLEAN x2 for the current task/evidence refresh
Latest-base and exact-head validation
origin/release-6.20@6a1d377f616through416266f60e4—CLEAN, no manual conflict resolution
of both parent deltas; the only overlaps (
ci_windows.ymlandCHANGELOG.md) preserve both payloads with no conflict markersDART_BUILD_GUI_OSG=OFF, andDART_BUILD_DARTPY=OFF— PASS (154/154)e973a75fb96, normal Release, compiler cache disabled andlaunchers empty — lint PASS and full CTest PASS (154/154)
891f43fd590, compiler cache disabled — full CTestPASS (154/154), focused solver PASS (57/57), allocation gate PASS (14/14),
gz-physics PASS (199/199 + 4/4), and gz-sim PASS (1/1)
351d4a04fb3differs from the validatedimplementation only in task documentation
git diff --check, lint, and both staged pre-commit safety gates — CLEANVisual verification
No new visual capture is claimed for the
0.11 mto0.13 mtestcalibration: it changes a numeric assertion, not simulation or rendering
behavior, and an image cannot prove a per-step CoP limit. Historical
dart-demosvisual commands and verdicts are recorded in the task evidence,but their temporary
/tmpcaptures are not durable current artifacts.GUI-free model gates remain the numerical scene oracle.
Manual demo commands:
Published head
351d4a04fb3supersedes the prior hosted matrix; only itschecks and review are authoritative now. Its validated implementation parent
is
891f43fd590; the final commit changes task evidence only. Hostedgz-physics/gz-sim passed on
c41f273d271, whose fresh Codex review found thepreparation-state issue addressed by
891f43fd590. Hosted CI for earlierhead
e973a75fb96was terminal: 18 GitHub Actions checks passed, one expectedAPI-documentation deploy was skipped, and both Read the Docs contexts passed.
Merging remains unauthorized.
Previous exact head
416266f60e4was fully terminal, including both Codecovstatuses. Its updated Codecov comment reported 94.42919% patch coverage with
142 changed lines missing and 75.17% project coverage versus 73.87% on the base
(+1.29 percentage points); patch coverage remains informational under
codecov.yml.The prior
e973a75fb9Codex review completed clean at issue comment5041775831. The thread-aware audit was 16/16 resolved before publishingc41f273d271; its new preparation-state thread is addressed by891f43fd590without an inline reply. The current head requires its owntop-level review, and live review status is authoritative.
Breaking Changes
Related Issues / PRs (backports)
release-6.20.release-6.20through Skip MSVC whole-program optimization in Windows CI test build #3395 at6a1d377f616; this includes the 6.19.4 closeout, required no-OSG/exact-candidate compatibility gate, and Windows CI whole-program-optimization correction.mainfollow-up.Checklist
DART 6.20.0)CHANGELOG.mdupdated