Skip to content

[Newton] Redesign Newton Manager [2c-ii/N] - #8870

Draft
StafaH wants to merge 11 commits into
isaac-sim:mainfrom
StafaH:newton/redesign-2cii-tests-masks
Draft

StafaH wants to merge 11 commits into
isaac-sim:mainfrom
StafaH:newton/redesign-2cii-tests-masks

Conversation

@StafaH

@StafaH StafaH commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

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) and invalidate_body_state(env_mask) take masks only, and
the 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 _index writes still pass env_ids;
NewtonManager turns them into a mask at its boundary (NewtonBackend.mask_from_ids). The scratch mask stays all
false 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):

before after
mask 9.0 / 2.1 µs 9.0 / 2.0 µs
ids 9.7 / 2.1 µs 17.2 / 4.1 µs

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 _index writes; joint writes that reset both pose and velocity now flag the selection for FK once
instead 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.py mixed solver configs, builder preparation, the manager lifecycle
and the step. It is split by owner, and duplicated or restating tests are removed:

File Covers
physics/test_newton_solvers.py solver configs and the Isaac Lab solvers: MJWarp, Kamino, MPM, VBD, builder schema, USD joint-property precedence (no simulation)
physics/test_newton_manager.py NewtonCfg, the manager lifecycle, and the backend: step order, capture, collision decimation, model changes, contacts, reset masks, independent backends, BVH refit
  • Simulation round-trips that only exercised one hook are now direct unit tests: collision decimation, model-change
    notification, collision_cfg rejection, MPM projection and history, VBD BVH rebuild.
  • Removed: restated capability flags, duplicate parametrizations (e.g. both deterministic modes on MuJoCo CPU, both
    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.py folds into the manager file; two asset tests move to assets/test_articulation.py.
  • The Newton warp-cache warm job lists the new file name.

Per-file pytest time 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

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added changelog fragments

@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team infrastructure labels Oct 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant