Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part 2c-ii of the Newton manager redesign (overview).
Stacked on [2c/N] #8735, so this PR also shows 2c's commits until it merges. Review only the last five commits (from
273181509).Reset flags select worlds by mask only
NewtonBackend.invalidate_fk(env_mask, articulation_ids)andinvalidate_body_state(env_mask)take masks only, andthe id-indexed reset kernels and their dtype dispatch are removed. A mask is a fixed-size device array, so every reset
path can be recorded into a CUDA graph and replayed for any selection. Asset
_indexwrites still passenv_ids;NewtonManagerturns them into a mask at its boundary (NewtonBackend.mask_from_ids). The scratch mask stays allfalse between calls: the flagging kernel clears each entry it consumes, so the conversion needs no per-call memset.
Measured cost per call, 4096 worlds (host / CUDA-graph replay):
The mask path is unchanged; ids now cost one extra scatter launch. At the environment level (4096 envs, MJWarp,
sequential runs, warm cache) flat ANYmal-D is unchanged (254.6k vs 254.9k steps/s). Reset-heavy Cartpole resets
through asset
_indexwrites; joint writes that reset both pose and velocity now flag the selection for FK onceinstead of twice, which brings its cost to about 1.5% (2.61M vs 2.65M steps/s). The rest goes away when environments
reset through masks (the mask-reset stage), so ids never reach physics. The benefit here is the fixed-size,
capture-friendly contract that stage and the captured env step build on.
Tests
The 1.5k-line
test_newton_manager_abstraction.pymixed solver configs, builder preparation, the manager lifecycleand the step. It is split by owner, and duplicated or restating tests are removed:
physics/test_newton_solvers.pyphysics/test_newton_manager.pyNewtonCfg, the manager lifecycle, and the backend: step order, capture, collision decimation, model changes, contacts, reset masks, independent backends, BVH refitnotification,
collision_cfgrejection, MPM projection and history, VBD BVH rebuild.sensor attributes, four graph-capture cases that covered two paths), and a second schema-precedence test now merged
into the real replication-path test.
test_two_backends.pyfolds into the manager file; two asset tests move toassets/test_articulation.py.Per-file
pytesttime on a warm Warp cache: 41.7 s → 30.8 s, 118 → 89 tests (plus 2 moved), 1.7k → 1.3k lines.Testing
Targeted tests pass, run file by file: the two new files, VBD core, MJWarp tendon control, MPM reset masks and object,
coupler, coupler runtime, custom coupling, visualization state, articulation (incl. contract
-k newton), rigid object,cable, joint coordinates, Newton actuators, BAM actuator, contact sensor, frame transformer, ray caster, IMU, cloner,
Newton visualizer adapter. The old test files pass against the mask commit before the overhaul. New unit tests fail
under one-line mutations of the code they guard.
Checklist
pre-commitchecks with./isaaclab.sh --format