Add DART 7 body deactivation#2939
Conversation
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ation-sleeping # Conflicts: # dart/simulation/compute/detail/deformable_avbd_replay_state.hpp
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2939 +/- ##
==========================================
+ Coverage 84.81% 85.08% +0.26%
==========================================
Files 692 702 +10
Lines 87571 92823 +5252
==========================================
+ Hits 74272 78975 +4703
- Misses 13299 13848 +549
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…ation-sleeping # Conflicts: # dart/simulation/compute/world_step_stage.cpp # dart/simulation/io/binary_io.hpp # dart/simulation/world.cpp # python/tests/integration/test_demos_cycle.py # tests/unit/simulation/world/test_serialization.cpp
Resolve conflicts from main's snapshot/profiling refactor (#2996) and the contact-query/guard changes landing alongside it: - world.cpp: adopt SnapshotVector/ComponentSnapshot replay storage and keep the new DeactivationState snapshot; order m_deactivationOptions correctly in the constructor init list; thread replayAllocator through the deactivation replay capture and restore calls to match the new helper signatures. - multibody_dynamics.cpp / world_step_stage.cpp / world.hpp: adapt the deactivation contact filter to main's std::span<const Contact> queryContacts API while preserving main's new hasAnyCollisionShapes early-out and mayUseAvbdContactDetails query. - registry.py / README.md / test_demos_cycle.py / test_py_demo_panels.py: keep main's reorganized demo catalog and re-apply the deactivation_sleeping scene entries, import, panel, and tests. - test_world.py: keep both sides' forbidden camelCase binding names. - api-boundary-inventory.md: regenerated.
… tests Bring the DART 7 deactivation port to full parity with #2920 and broaden test coverage of the new sleeping paths: - world.cpp: a contact island may sleep only once every contact's penetration has converged below 1e-3 (including penetration against static geometry), so quiet bodies are never frozen mid-interpenetration. Matches the DART 6 resting-scene gate. - test_deactivation.cpp: add coverage for the penetration gate (PenetratingContactDefersSleepUntilConverged), gravity-loaded resting-contact sleeping (RestingRigidBodyOnGroundSleepsUnderGravity), and semi-implicit multibody sleeping/waking (RestingMultibodySleepsAndFreezes, LinkForceWakesSleepingMultibody, ContactWithActiveBodyWakesSleepingMultibody), covering the previously-untested multibody deactivation paths.
Pick up the C++23 bump (#3005), AVBD spring/collision-pair work (#3004), allocator-backed Dantzig scratch change (#3011), and Python 3.14 minimum (#3010). Conflicts: - api-boundary-inventory.md: accept main's deletion; #3005 made the inventory an untracked, gitignored on-demand report (`report-api-boundary-inventory`) and dropped the `check-api-boundary-inventory` gate. world_step_stage.cpp, test_demos_cycle.py, test_py_demo_panels.py, and CHANGELOG.md auto-merged cleanly.
Pick up the PLAN-091 stage-contract refactor (#3003) and the string-component-ID serialization change. Conflicts: - world_options.hpp / world.hpp / world.cpp: keep both the deactivation options (DeactivationOptions / m_deactivationOptions) and main's new strictSolverResolution member; order m_deactivationOptions before m_strictSolverResolution to match the constructor init list. - binary_io.hpp: main took format version 20 (AvbdJointStiffness component) and 21 (stable string component IDs); renumber the deactivation-options payload to version 22 and bump kBinaryFormatVersion to 22. - world.cpp: gate the deactivation-options read on formatVersion >= 22. - comps/dynamics.hpp: give DeactivationState an explicit "comps.DeactivationState" stable ID for the new string-ID component identity scheme.
clang-format wraps the two-argument DART_SIMULATION_PROPERTY_COMPONENT call that gained the stable string ID in the main merge.
… allocation-free RigidIpcContactStage::prepare pre-warmed only the assembly scratch, so the projected-Newton solve's motion-dependent CCD and line-search scratch (and the FreeListAllocator pool blocks backing them) were materialized lazily on the first World::step. That grew the World base allocator after the bake boundary and tripped World.BakedDynamicRigidIpcStepsDoNotGrowWorldBaseAllocator (a pre-existing failure on main, surfaced here by merging main into this branch). Run a one-shot warm-up solve in prepare(), driven by the real dynamics terms so the bodies approach contact and the full assembly/line-search/friction scratch is reserved at bake. The warm-up writes only to discarded scratch and result -- it never advances a body or mutates the World -- so it is side-effect free. Validated: the allocator guard tests, test_rigid_ipc_barrier (55), test_rigid_ipc_paper_experiments (45), test_boxed_lcp_contact (122), test_deactivation (10), and full test_world (372) all pass.
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
DeactivationOptions,World.deactivation_options,World.deactivation_enabled, and body sleep-state/group accessors in C++ and dartpy.deactivation_sleepingPython GUI demo inpy-demoswith sleep-state diagnostics and headless capture coverage.Motivation / Problem
Before / After
DeactivationOptions.enabledis set.pixi run py-demos -- --scene deactivation_sleepingshows sleep/wake diagnostics.Changes / Key Changes
DeactivationOptionstoWorldOptionsand World setters/getters, with deactivation disabled by default.Testing
pixi run buildpixi run lintcmake --build build/default/cpp/Release --target test_deactivationctest --test-dir build/default/cpp/Release -R '^test_deactivation$' --output-on-failurePYTHONPATH=build/default/cpp/Release/python pixi run pytest python/tests/unit/simulation/test_world.py -qcmake --build build/default/cpp/Release --target test_worldbuild/default/cpp/Release/bin/test_world --gtest_filter=World.ReservedRegistryStorageReusesComponentCapacity:World.BakedRigidBodyContactStepsDoNotAllocateGlobalHeap:World.BakedArticulatedContactStepsDoNotAllocateGlobalHeapPYTHONPATH=build/default/cpp/Release/python:python pixi run pytest python/tests/unit/test_py_demo_panels.py::test_deactivation_sleeping_scene_exposes_sleep_state_panel python/tests/unit/test_py_demo_panels.py::test_high_value_world_scenes_expose_custom_panels -qPYTHONPATH=build/default/cpp/Release/python:python pixi run pytest python/tests/integration/test_demos_cycle.py::test_world_scenes_use_solver_focused_categories python/tests/integration/test_demos_cycle.py::test_deactivation_sleeping_demo_sleeps_then_wakes_contact_target -qPYTHONPATH=build/default/cpp/Release/python:python pixi run py-demos -- --listLIBGL_ALWAYS_SOFTWARE=1 MESA_LOADER_DRIVER_OVERRIDE=llvmpipe PYTHONPATH=build/default/cpp/Release-docking/python:python pixi run py-demo-capture -- --scene deactivation_sleeping --show-ui --frames 150 --width 1280 --height 720main:pixi run lintcmake --build build/default/cpp/Debug --target test_world test_serialization test_deactivation -j2build/default/cpp/Debug/bin/test_serialization --gtest_filter=Serialization.RejectsInvalidWorldSolverOptionTail:Serialization.LegacyWorldMetadataDoesNotConsumeTrailingBytesAsGravity:Serialization.SimulationModeReloadReservesRegistryStorageBeforeStepbuild/default/cpp/Debug/bin/test_world --gtest_filter=World.EnterSimulationModeReservesRegistryStorageForKinematicIpcSteps:World.EnterSimulationModeReservesRegistryStorageForMultibodySteps:World.SetMultibodyOptionsReservesVariationalStateAfterBake:World.SolverMethodSwitchesAfterBakeSharePreparationPath:World.EnterSimulationModeReservesRegistryStorageForDeformableSteps:World.BakedKinematicIpcStepsDoNotAllocateGlobalHeap:World.BakedRigidBodyContactStepsDoNotAllocateGlobalHeap:World.BakedArticulatedContactStepsDoNotAllocateGlobalHeap:World.BakedMultibodyAndDeformableStepsDoNotAllocateGlobalHeap:World.SetRigidBodySolverPreparesIpcScratchAfterSimulationBake:World.StepWithCustomStageReusesPreparedSolverStagesbuild/default/cpp/Debug/bin/test_deactivationcmake --build build/default/cpp/Release --target test_world test_serialization test_deactivation -j2build/default/cpp/Release/bin/test_serialization --gtest_filter=Serialization.RejectsInvalidWorldSolverOptionTail:Serialization.LegacyWorldMetadataDoesNotConsumeTrailingBytesAsGravity:Serialization.SimulationModeReloadReservesRegistryStorageBeforeStepbuild/default/cpp/Release/bin/test_world --gtest_filter=World.EnterSimulationModeReservesRegistryStorageForKinematicIpcSteps:World.EnterSimulationModeReservesRegistryStorageForMultibodySteps:World.SetMultibodyOptionsReservesVariationalStateAfterBake:World.SolverMethodSwitchesAfterBakeSharePreparationPath:World.EnterSimulationModeReservesRegistryStorageForDeformableSteps:World.BakedKinematicIpcStepsDoNotAllocateGlobalHeap:World.BakedRigidBodyContactStepsDoNotAllocateGlobalHeap:World.BakedArticulatedContactStepsDoNotAllocateGlobalHeap:World.BakedMultibodyAndDeformableStepsDoNotAllocateGlobalHeap:World.SetRigidBodySolverPreparesIpcScratchAfterSimulationBake:World.StepWithCustomStageReusesPreparedSolverStagesbuild/default/cpp/Release/bin/test_deactivationVisual capture note: the capture helper produced a nonblank screenshot and 149 PNG frames locally. The CLI path here cannot upload GitHub user-attachment images; a maintainer can upload the local artifact through the PR editor if inline visual evidence is required.
Breaking Changes
Related Issues / PRs (backports)
mainAPIs and py-demos.Checklist
main, DART 6.17.1 forrelease-6.17)