Repository navigation
Conversation
Split NewtonManager's class-level state into construction requests (kept across hard resets), a per-model runtime (discarded on hard reset), and an immutable world schema. Move solver-specific behavior into NewtonSolverBinding and reduce each solver manager to a binding selection. Compile the whole step, including the decimation loop, Newton actuators, consumer stages, solver substeps, and sensors, into one program over explicit buffers. Graph-safe runs are captured; other operations run eagerly in place, so actuators that cannot be captured no longer force the environment to own decimation. Replace the register_*_callback hooks with runtime-scoped add_stage/remove_stage, make the actuator adapter follow world-varying DOF layouts, and map reset masks through articulation_world.
Make NewtonRuntime plain data and move its behavior into free functions that take the runtime explicitly (create_runtime, bind_solver, invalidate_fk, reconcile, add_stage, compile_program, step, and the sensor and actuator helpers). NewtonManager only supplies the active simulation's runtime, so several runtimes bound to different Newton backends can be driven side by side. Add NewtonSchema.from_model, recompile the program whenever the requested step count changes instead of invalidating it from set_decimation, and skip the device scope when a fully captured program replays.
Newton Manager Redesign — Current DesignStatus: draft PR #8218 ( History:
1. Principles
Renames from develop and earlier PR revisions:
2. Layoutdevelop's 3. Data and lifetimesRenderers, ray casters, and visualizers get the backend with 4. Functional core (
|
| Function | Analogue | What it does |
|---|---|---|
NewtonManager.finalize_backend() |
mj_compile |
prepare_builder (sites, solver normalization), finalize, NewtonBackend. |
get_newton_builder(sim), get_newton_backend(sim) |
— | The physics manager's builder/backend under Newton physics; the shared render-only ones otherwise. |
create_newton_backend(cfg) |
— | Registry factory of the render-only backend. |
NewtonBackend(model, physics_cfg, dt=...) |
mj_makeData |
Allocates state, control, masks, staged forces, and the solver adapter. Needs no SimulationContext. |
init_solver(b, relaxed_capture=) |
develop initialize_solver |
adapter.create_solver, output state, contacts and pipeline, eval_fk, and b.capture. |
invalidate_fk(b, env_mask | env_ids, articulation_ids) |
develop | Flags FK and world resets on the device. |
invalidate_body_state(b, ..., row_worlds) |
develop | Flags world resets only. |
invalidate_worlds(b, worlds) |
mj_resetData per world |
Flags whole worlds from a per-world device mask; the reset commit of an outer runner. |
forward(b, force=False) |
mj_forward |
Masked reset_solver + eval_fk for flagged worlds, then clears the masks. |
mark_model_changed(b, change, env_mask) |
— | Queues a ModelFlags change for the worlds of a wp.array mask. |
notify_model_changes(b) |
notify_model_changed |
Applies queued flags; a conditional graph gated on a device flag when the adapter captures_model_changes (MJWarp), else an eager host notify (no sync). Warns once for ignored flags. |
register_step_callback(b, list, fn, graphable=, name=) |
mjcb_* |
Appends to one of b.callbacks' lists and invalidates the graph. The manager wraps it in named methods. |
invalidate_step_graph(b) |
— | Rebuilds the graph before the next step when a callback's recorded work changes (e.g. an asset's first external wrench). |
activate_actuators(b) |
— | Builds the flat-DOF NewtonActuatorAdapter. |
add_contact_sensor, add_imu_sensor |
newton.sensors |
Sensors updated at the end of each step. |
build_step_graph(b, steps) |
Newton examples' simulate() |
Unrolls steps physics steps into bound ops. |
prepare(b) |
— | Builds the graph if the structure or b.steps_per_call changed. Host only. |
step(b) |
mj_step |
Notifies model changes, runs forward, launches the graph (eager on the first launch after a build, then captured). |
record_step(b) |
— | Records a forced masked forward and the prepared graph into the caller's Warp or Torch capture. No warm-up step. |
capture_graph(device, fn, relaxed=), run_query, refit_bvh |
wp.ScopedCapture |
Capture without executing; query graphs; shared BVH refit. |
4.1 Step callbacks
Each callback point has one name and one cadence:
| Manager method | Runs | Example |
|---|---|---|
register_pre_step_callback(fn) |
once per step(), before the physics steps |
action terms that hold their command (joint position targets) |
register_control_callback(fn) |
before every physics step, after collision | in-step OSC, asset command writers, per-step action terms |
register_post_actuator_callback(fn) |
after the actuators of the last physics step | articulation actuator telemetry |
register_state_force_callback(fn) |
every substep, fn(state) before the solver |
viewer picking forces |
register_post_step_callback(fn) |
after every physics step, before sensors | articulation user-order republish |
unregister_step_callback(cb) |
— | each register method returns the StepCallback handle |
All take graphable=True and name="". graphable=False callbacks become eager islands between captured segments.
4.2 The step graph
pre_step callbacks actions held for the environment step
for each physics step:
adapter.prepare_step(state_0) VBD BVH rebuild (when prepares_step)
collide(state_0) when backend.collision_pipeline is set
control callbacks per-step actions, controllers, asset command writers
stage forces double-buffered solvers or state-force callbacks only
Newton actuators history ping-pong bound at build time
post_actuator callbacks last physics step only
for each substep:
apply staged forces, state_force callbacks(state_in)
adapter.step_solver(state_in, state_out) in/out alternate at build time
optional mid-step collide
state_0.assign(state_in) if needed; restore staged forces
post_step callbacks
sensors (IMU, contact)
copy actuator history back on odd counts
clear forces
- Segments. Consecutive graphable ops form one captured segment; TorchScript/LSTM actuators and
graphable=Falsecallbacks run eagerly between them. - Warm-up. The first launch after any rebuild runs eagerly, then the graph is captured. This replaces develop's
Windows warm-up fix, the pre-capture visualizer hook, and the OSC pre-warm. - Captured terms must write in place. A captured callback reads the buffer addresses it saw at capture time. An
action term that rebindsself._processed_actionsmakes later replays read a stale tensor; the joint, binary and
limit actions now write without=/in-place ops, andtest_bound_joint_actions_follow_each_new_actionguards it
(mutation-checked).
4.3 Who runs the decimation loop
ManagerBasedEnv calls manager.bind_control(action_manager, scene) when the physics manager supports it. Each
action term goes to pre_step (apply_every_physics_step = False) or control, and every asset in
scene.assets (articulations, rigid objects and collections, deformables, cables, surface grippers, in write order)
registers write_data_to_sim as a control callback. The binding is re-applied after every hard reset. Physics
then runs the whole decimation loop in one graph, and the env skips its host loop.
set_decimation(decimation, apply_every_physics_step=...) still exists for direct envs and non-capturable setups. handles_decimation() is evaluated only when an input changes
and stored in backend.steps_per_call.
5. Solver adapters
NewtonSolver instances, built by create_solver_adapter(solver_cfg) from solver_cfg.class_type (None gives the
base adapter). The adapter holds self.cfg; it never holds runtime state.
Capability class attributes (constants, not state): solver_class, builder_attribute_solvers, single_state,
supports_deterministic, supports_contact_sensors, prepares_step, supports_heterogeneous_worlds (Featherstone,
XPBD, VBD, Kamino), ignored_model_changes, captures_model_changes (MJWarp only: its notify_model_changed is
graph safe; MPM couplers allocate and Kamino reads the device, so they are notified on the host).
| Group | Instance methods |
|---|---|
| Construction | create_solver(model, deterministic_mode), validate_cfg(b) |
| Builder | register_builder_attributes(builder), registers_builder_attributes_from(solver_cls), prepare_solver_builder(builder), get_usd_import_schema_resolvers() |
| Contacts | uses_collision_pipeline(b), create_contacts(b), prepare_contacts(b) |
| Capabilities | supports_body_forces(b), supports_graph_capture(b) |
| Stepping | initialize_output_state, prepare_step, step_solver, reset_solver, eval_fk |
| Diagnostics | check_status, log_debug |
| Adapter | Overrides |
|---|---|
| Featherstone | solver_class; ignored_model_changes |
| XPBD | solver_class |
| VBD | solver_class, builder coloring, prepare_step, supports_body_forces |
| MJWarp | single state; internal contacts; CPU reset guard; determinism validation; tendons via create_mjwarp_tendon_control(articulation, model) |
| Kamino | create_solver resolves use_fk_solver=None into self.cfg; FK-solver reset; output state; contact cap |
| MPM | single state; no pipeline; config built from the cfg; status check; reset_mpm_solver_state |
| Coupler (contrib) | one entry adapter per entry type for builder hooks; entries build their solvers through create_solver_adapter(entry.solver_cfg).create_solver(model_view) |
| MJWarp + VBD (contrib) | rigid and soft sub-adapters around CoupledMJWarpVBDSolver(SolverBase) |
State a solver needs between steps belongs on the Newton solver object.
6. Initialization
Before this pass, initialization had two public steps, start_simulation and initialize_solver, plus these patches:
- a pre-capture visualizer hook in
SimulationContext; - the OSC controller pre-warm;
- sensors re-registering sites on
STOP, which injected duplicate sites into the retained builder on every hard
reset; - deterministic mode mutating
MJWarpSolverCfg.disable_sensors; NewtonBackendpatched after construction (particle_ranges,num_envs, gravity);- MPM authoring its USD config twice (now never: the config is built directly);
- scene-data geometry written through a private field.
Construction is one phase: NewtonManager(builder, cfg, dt=, device=) is complete, and attaching it to a context
(PhysicsManager.initialize, now concrete) only records the context. A context adopts a configured manager's cfg
as sim.cfg.physics; an unconfigured manager takes the context's. The clone context is a class attribute and the
timestep comes from the attached context.
Initialization is one function:
NewtonManager.reset(soft=False):
close the previous backend STOP, drop views, backend.close()
MODEL_INIT consumers author the manager's builder (e.g. joint target modes)
backend = finalize_backend() sites -> solver builder prep -> finalize -> NewtonBackend(model, cfg, dt)
(no registry round-trip; num_envs, gravity, soft contact set at construction)
scene-data geometry from the clone record
PHYSICS_READY consumers bind views, callbacks, sensors, actuators; they may author the model
init_solver(backend) the solver sees the authored model; contacts; FK; capture function
resolve steps_per_call
first step(): build StepGraph -> run it eagerly -> capture
- Attribute requests.
request_extended_state_attributeandrequest_extended_contact_attributeapply straight
to the shared builder. - Site requests. These persist until
close(). A hard reset reuses the sites already in the builder: across two
hard resets the builder stays at 354 shapes and 3 sites.
7. MDP2 compatibility
MDP2 compiles the whole MDP into one graph that an outer runner owns. Its physics-facing requirements, and what the
Newton layer provides for each:
| MDP2 requirement | Newton layer | Status |
|---|---|---|
Immutable physics schema, separate from mutable state; create_state checks it matches |
NewtonBackend.model (Newton's Model, like mjModel) plus dt, num_substeps, steps_per_call; state lives in state_0, control, solver data. A hard reset builds a new backend, so backend identity tells a runner to recompile. |
ready |
Physics advanced once per control period, decimation owned by physics (NewtonPhysics(scene, decimation=4)) |
backend.steps_per_call physics steps per step/record_step, unrolled in one StepGraph |
ready |
| Outer runner owns capture; prepare allocates and warms up, step allocates nothing | prepare(b) builds the graph without advancing physics; record_step(b) records into the caller's capture. No solver (MJWarp, Featherstone, XPBD, VBD, Kamino) needs a warm-up step: recording right after prepare replays bit-identically to eager stepping. |
ready, tested |
| Warp-owned and Torch-owned capture | Warp capture directly; Torch capture with Warp joining on the same stream via wp.capture_begin(stream, external=True) |
ready, tested |
| Reset selected worlds by device mask; unselected worlds keep their state; empty mask does nothing | invalidate_worlds(b, worlds) + forward(b, force=True), both masked kernels recorded into the graph; the mask contents are read at replay time |
ready, tested (mutation-checked) |
| Refresh dependent physical data after resets before observations | the recorded forward (masked reset_solver + eval_fk) |
ready |
| Actions written before physics; controllers per physics step | MDP2 writes backend.control before record_step; per-step controllers use control callbacks |
ready |
| Sensors refreshed inside the graph | contact and IMU sensors update at the end of the step graph | ready |
| Heterogeneous worlds in one shared physics owner, or independent owners when unsupported | manager.supports_heterogeneous_worlds; several backends record into one graph (section 8) |
ready, tested; MJWarp needs one backend per world layout |
| Stable buffer addresses for the graph lifetime; recapture when structure changes | buffers are allocated with the backend; record_step returns the StepGraph, and a new graph (new callbacks or step count) means record again |
ready |
| No host syncs or allocations in step and reset | sections 9 and 14 | ready on Newton; PhysX masked writes still call nonzero |
from isaaclab_newton.physics import newton_backend as nb
nb.prepare(backend) # MDP2 "prepare": no physics step consumed
with wp.ScopedCapture(device) as capture: # MDP2's runner owns the graph
write_actions(actions, backend.control) # 1. actions -> controls
nb.record_step(backend) # physics for one control period
rewards_terminations(...) # 2.-4.
write_reset_state(reset_mask, backend.state_0) # 5. reset ending worlds ...
nb.invalidate_worlds(backend, reset_mask) # ... commit them
nb.forward(backend, force=True) # ... and refresh body state
observations(...) # 6.
wp.capture_launch(capture.graph)Open items for MDP2 on the physics side:
- Bindings for heterogeneous layouts. Newton's
ArticulationViewassumes one layout over all worlds. MDP2's
flat per-world segments need per-world joint/body offsets of each entity; Newton'sModelhas the per-world data
(articulation_world,joint_q_start, ...), but no view over a world subset yet (upstream). - Lazy Isaac Lab data. Timestamp-guarded
ArticulationDataproperties cannot be read inside a replay. MDP2
reads bound Tier-1 buffers instead; the current manager-based env still needs them (see section 14). - One shared simulator for heterogeneous MJWarp worlds waits on heterogeneous
SolverMuJoCoupstream.
test_captured_environment_step_matches_eager (isaaclab_tasks/test/contrib/test_newton_step_tasks.py) runs this
pattern end to end with the current managers.
8. Two Newton backends, and what "two managers" needs
Works now: two backends through the functional core
from isaaclab_newton.physics import FeatherstoneSolverCfg, MJWarpSolverCfg, NewtonBackend, NewtonCfg
from isaaclab_newton.physics import newton_backend as nb
rigid = NewtonBackend(model_a, NewtonCfg(solver_cfg=MJWarpSolverCfg(), num_substeps=2), dt=0.01)
other = NewtonBackend(model_b, NewtonCfg(solver_cfg=FeatherstoneSolverCfg(), num_substeps=4), dt=0.01)
for backend, steps in ((rigid, 3), (other, 2)):
nb.init_solver(backend)
backend.steps_per_call = steps
nb.prepare(backend) # builds the step graph; no warm-up step needed
with wp.ScopedCapture() as capture: # both physics steps in ONE CUDA graph
nb.record_step(rigid)
nb.record_step(other)
wp.capture_launch(capture.graph)source/isaaclab_newton/test/physics/test_two_backends.py covers this:
- each backend moves only its own model;
- eager and captured stepping each match a backend stepped alone;
- one caller-owned graph holding both matches eager stepping, with Warp or Torch owning the capture;
- a recorded world-masked reset commit follows the mask of each replay;
- solvers declaring heterogeneous-world support step worlds with different chains (eager equals captured), and
MJWarp refuses them.
Two managers in one process
NewtonManager has no class-level state, so two managers coexist: each owns its builder, backend, sites, clone
record, and views, and test_two_backends.py builds two managers side by side. What still assumes one manager per
SimulationContext:
| # | Change | Size |
|---|---|---|
| 1 | SimulationContext holds one physics_manager. Two physics scenes in one context need a list of managers and a routing rule (an asset cfg field such as physics_scene) for cloning. |
medium |
| 2 | Assets and sensors now resolve the context once (self._sim, self._physics_manager, 04228e466), and Newton consumers read it from there. The one remaining global lookup per asset or sensor is in its base constructor; passing the context in (or in the PHYSICS_READY payload) removes it. Renderers and visualizers still look it up; this is core-wide, not Newton-specific. |
medium, mechanical |
| 3 | The scene data provider and renderers merge or select per-manager transforms. | medium |
Different robots inside one backend remain blocked upstream: ArticulationView over world subsets and heterogeneous
SolverMuJoCo.
9. Hot path and host syncs
NewtonManager.step():- one
backend.device.is_capturingquery (nowp.get_device(str)lookup); notify_model_changes, which exits early when nothing changed;- the
forwardhost flag check; prepare, a compare againstbackend.steps_per_call;- graph replay, skipping
ScopedDevicewhen the step is fully captured. - No per-step
handles_decimation(),uses_collision_pipeline(), orsupports_graph_capture()calls.
- one
- No per-step allocation or
.numpy().staged_forcesandworld_idsare allocated with the backend. - Reset path: kernels only (
invalidate_fk,invalidate_body_state, Newton actuatorreset_dofson the
caller's Warp mask). Masks arewp.arrayend to end; MDP terms read the env's stable mask through a cached
ProxyArray.torchview, so there is no per-step conversion. Fixed-base root writes queueJOINT_PROPERTIESthroughadd_model_change; during an
outer capture the solver is notified immediately so the replay applies it. - Remaining host reads, all off the default GPU path:
- the MuJoCo-CPU empty-mask check;
- the MPM status check after a replay;
- the single-world MPM reset promotion;
view_row_worlds, at bind time only;- debug logging.
Runtime work in graphs (principle 7)
env.step itself is now laid out as operations and captured (EnvStepCapture, shared by ManagerBasedRLEnv and
DirectRLEnv): actions, the physics step's own operations (PhysicsManager.step_ops), the scene update,
terminations, rewards, the masked reset, commands, interval events, and observations. Consecutive graphable operations
replay as one graph; the rest are eager islands. Mechanics:
- Warm-up, then capture-and-replay. The first launch after a (re)build runs eagerly and watches Torch's sync-debug
warnings: operations that synchronize (index-based terms,nonzero) become islands automatically. The next launch
records the graphs and replays them, so returned buffers always hold executed work. - Opt-outs. Term functions and classes set
supports_graph_capture = Falsewhen they branch on host state that
changes between steps (modify_reward_weight,modify_env_param,DifficultyScheduler, ...). Entities whose
masked reset cannot be recorded (TorchScript LSTM drive state) reset eagerly. - Rebound buffers. A term that replaces a buffer every step (
self.x = f(self.x)) leaves recorded readers on the
old tensor; each replay ends with a recorded copy of the new value into it, so captured stepping equals eager
stepping. An eager island that rebinds every step disables capture and names the buffer. - Host bookkeeping after each replay: counters, simulation time, asset data timestamps
(notify_update_replayed), sensor dirty flags. - Rebuilds when the physics operations change (new callbacks, first wrench use), on
set_term_cfgor
invalidate_step_graph(); more than 3 rebuilds in 50 steps steps eagerly for good. - Blockers (eager stepping): rendering or video, recorder terms, cameras, non-capturable sensors, PhysX.
What still runs on the host per step:
| Work | Why |
|---|---|
| Model-change notification | host-gated queue; a no-op when nothing changed |
| TorchScript LSTM actuators (ANYmal-D) | Newton's torch-checkpoint drive is not graphable (a torch.export model is) |
| Host-scheduled curricula, torch-only action terms (OSC, tendons), manager reset of host loggers | declared non-graphable |
| Direct-workflow episode reset | the default _reset_idx takes indices (nonzero syncs) |
Coverage (core Newton tasks, survey): every manager-based task captures except the camera tasks; every direct task
captures (in-hand reorientation after 4d640ecbb). Validation: captured steps are bit-identical to eager stepping on
Cartpole, Reach-Franka and flat ANYmal-D (deterministic mode, resets inside the rollout), including out-of-graph lazy
data reads and episode logs; direct Cartpole too. Contact-rich in-hand tasks match only without physics graphs: the
MuJoCo Warp graph-vs-eager numeric difference (the known first-graph issue) grows through contact.
10. Validation and performance
Tests:
| Area | Result |
|---|---|
| Physics unit tests (abstraction, VBD, MPM contract, visualization state) | 137 passed |
| Two backends | 4 passed |
| Assets, env events, controllers | 133 passed |
| Contrib couplers and custom coupling | 86 passed |
| Cloner | 20 passed |
| Sensors | 62 passed |
newton_step tasks (in-step OSC matches the host controller; captured Cartpole matches eager) |
2 passed |
| Visualizer | 69 passed; 1 pyglet headless failure unrelated to the manager |
Review pass (2026-10-09): abstraction 120, two backends 4, VBD 8, MPM reset 4, assets (articulation 37, rigid 19, cable 6, joint coords 11, MPM 3, Newton actuators 37), sensors 63, controllers 13, coupler 66 + runtime 4, custom coupling 10, cloner 36, newton_step tasks 2 |
all passed |
Not runnable here (Kit/Isaac Sim missing): test_newton_solver_reset.py, test_deformable_object.py,
test_manual_coupling.py.
Benchmarks: see the table in section 12.
11. Follow-ups
Done: one-phase construction, no registry round-trip, module names, deprecated getters, context resolved once per
asset/sensor, wrench work after first use, Warp-first masks, and the captured environment step (manager-based and
direct).
Open, by value:
- Mask-native direct resets. Direct environments still reset by index (
nonzerosyncs every step), which keeps
their captured step split around a synchronizing island (Cartpole-Direct 1.28 → 1.15 ms only). A mask-taking
_reset_maskhook, as manager-based envs have, would close this. - Graphable LSTM actuators. Newton's TorchScript LSTM drive is not graphable; a
torch.export(pt2) model is.
Converting ANYmal-D's actuator network removes its islands. - Sticky
transforms_may_change_on_graph_replay(kept on purpose): replays by third-party graphs bypass Python;
retiring it needs a replay-notification contract. Now that the environment owns its replays, the flag could be
cleared byEnvStepCapturefor envs that never hand their state to outside graphs. - Host-stateful contrib tasks opt out of capture (UR10 particle push, Franka-Pour, G1 trocar); rewriting their
per-step caches and stage machines on the device would let them capture. - Non-capturable
notify_model_changedfor MPM couplers and Kamino (upstream). - Port DiffIK, RMPFlow, and Pink to
controlcallbacks; removeuse_newton_actuators. - Upstream: world-subset
ArticulationView, heterogeneousSolverMuJoCo, the first-graph numeric drift; re-check
_drain_stale_cuda_erroron Warp 1.17.
VisualMaterialWriter stays on Warp: with a warm kernel cache its first apply takes 1.3 ms at 4096 × 50 shapes against
6 ms in NumPy (44 ms against 1.8 ms at 16384 × 100); NumPy only wins below ~100 environments.
12. Benchmarks
Current (4d640ecbb, presets=newton_mjwarp, 4096 envs, 500 steps after 50 warm-up, warm kernel cache, sequential),
ms per environment step:
| Task | develop 8a7a974f1 |
551fd1d04 |
44752289a |
9abd88700 |
captured step 4d640ecbb |
|---|---|---|---|---|---|
| Isaac-Cartpole | 1.43 | 1.33 | 1.26 | 1.27 | 0.60 |
| Isaac-Reach-Franka | 4.01 | 3.44 | 3.63 | 3.59 | 3.62 |
| Isaac-Velocity-Rough-AnymalD | 24.25 | 22.83 | 22.65 | 22.61 | 22.52 |
| Isaac-Cartpole-Direct | 1.15 (1.28 with capture_step=False) |
||||
| Isaac-Ant-Direct | 1.75 (2.01 with capture_step=False) |
Capturing the whole environment step halves Cartpole (1.27 → 0.60 ms), which was bound by the Python launch cost of
its MDP terms. Reach-Franka and Rough ANYmal-D are GPU bound, so their step time does not change. Direct environments
gain less because their index-based reset synchronizes every step. Recording wrench work only after first use took
Reach-Franka from 3.63 to 3.59 ms. The rest of the gap to
551fd1d04 is the actuator compute and command submission running before every physics step inside the graph, as
develop runs it; Warp-first masks changed nothing measurable. A first run after editing kernels
measures Warp compilation (ANYmal-D sim start 2.3 s cold vs 0.77 s warm), so benchmark with a warm cache.
Earlier tables:
Whole PR (551fd1d04: redesign + mask resets + MDP2 contract) against develop 8a7a974f1, same setup as below,
ms per environment step:
| Task | develop | this PR | Throughput | Startup (scene + sim start) |
|---|---|---|---|---|
| Isaac-Cartpole | 1.43 ± 0.43 | 1.33 ± 0.04 | +7.5% | 4.57 s → 4.30 s |
| Isaac-Reach-Franka | 4.01 ± 0.75 | 3.44 ± 0.15 | +16.6% | 6.19 s → 5.86 s |
| Isaac-Velocity-Rough-AnymalD | 24.25 ± 6.58 | 22.83 ± 1.01 | +6.2% | 14.73 s → 13.38 s |
Review pass (dd8fb3f3f, presets=newton_mjwarp, 4096 envs, 500 steps, one run each): Reach-Franka 3.94 ms/iter
(was 3.95), startup env 4.78 s / first step 1.09 s; Rough ANYmal-D 23.31 ms/iter (was 23.97), startup env 12.91 s /
first step 0.45 s.
Setup:
isaaclab benchmark runtimewithphysics=newton_mjwarp, 4096 envs, 500 steps after 50 warm-up steps.- RTX PRO 6000 Blackwell; runs are sequential, interleaved develop/branch, one run each.
- develop is
2df15f961, run from a clean worktree; the branch is at90dc7253f.
| Task | develop (steps/s) | branch (steps/s) | Δ | Note |
|---|---|---|---|---|
| Isaac-Cartpole | 2,858,440 | 2,813,152 | −1.6% | Noise: std is about 50% of the mean at this size; both capture one graph per env step |
| Isaac-Reach-Franka | 953,805 | 1,036,911 | +8.7% | Idempotent joint actions, so physics runs the decimation loop |
| Isaac-Velocity-Rough-AnymalD | 154,714 | 170,906 | +10.5% | LSTM actuators run as eager islands inside a physics-run loop |
| Isaac-Reach-Franka-OSC (torch OSC) | 468,769 ¹ | 257,734 | correct now | The torque is recomputed every physics step on the host |
| IsaacContrib-NewtonStep-Reach-Franka-NewtonOSC | — | 434,676 | +69% vs the correct host path | The same control law as a captured control callback |
¹ develop's number reflects the held-torque bug: it computes the OSC torque once per env step and holds it across
the decimation loop.
13. Where the time goes (2026-10-09 profile, 4096 envs, MJWarp, warm kernel cache)
Graph capture removes host launch cost. It does not make kernels faster. On develop the physics step was already a
CUDA graph, so the redesign only gains where decimation is folded into one launch.
Runtime
| Task | env.step | physics GPU | rest | sync-free env.step |
|---|---|---|---|---|
| Cartpole | 0.69 ms | 0.42 ms | torch MDP, 2 host syncs | 0.49 ms (−29%) |
| Reach-Franka | 3.53 ms | 2.76 ms (8 MJWarp solves) | torch MDP, 2 host syncs | 2.89 ms (−18%) |
| Rough ANYmal-D | 17.5 ms | 17.2 ms | — | GPU bound |
- Host syncs. Every
ManagerBasedRLEnv.stepblocks on the GPU twice, so Python manager time never overlaps
physics. The two syncs arelen(reset_buf.nonzero())inmanager_based_rl_env.pyand
len((time_left <= 0).nonzero())incommand_manager.py. Removing them needs mask-based resets and resampling,
which is the MDP2 and Warp-frontend direction (done in section 14). Whole-step capture of Cartpole already reaches the physics floor
(0.454 ms). - ANYmal-D collision. 55% of GPU time (8.7 ms per env step) is Newton's
narrow_phase_find_mesh_triangle_overlapsagainst the 1.2M-face rough-terrain mesh. With the terrain as a
heightfield, the step takes 13.5 ms (−23%). That conversion changes the stair and box geometry, so it is the task
author's choice (SubTerrainBaseCfg.convert_to_heightfield). - Newton upstream.
SolverMuJoCo._update_newton_staterunseval_fkafter every MJWarp step (21 µs, ~7% of
Franka physics). It is not redundant: MJWarp'sxpos/xquatdescribe the pre-integration state. An opt-in skip on
intermediate substeps is drafted as an upstream issue, as is caching the terrain-mesh canonicalization in
ModelBuilder.finalize(~1.6 s → ~0.3 s estimated). - Step graph overhead. Isaac Lab kernels inside the physics graph are under 1% of GPU time. The rest is
MJWarp's ~1000 small kernels per env step.
Startup (ANYmal-D, 11.6 s to build the env)
- Fixed:
gc.collect()after each capture cost 0.25 s × 7 captures. The first step went from 3.1 s to 0.75 s
(develop: 1.3 s), and env construction is 1.2 s faster. ModelBuilder.finalizetakes 3.45 s, mostly mesh canonicalization and watertight checks on the terrain mesh,
repeated 3×.SolverMuJoCo.__init__takes 3.5 s: ~1 s importingmujoco_warp, 0.8 sput_data, 0.66 sadd_geoms, plus
collision masks.- Terrain generation takes 1.3 s, replication 1.0 s, and the LSTM actuator
torch.exportload ~1–3 s. - All of these are upstream (Newton, MJWarp, torch) or task content. The manager's own init is under 0.3 s.
14. Sync-free environment step (merged from envs/mask-resets)
ManagerBasedRLEnv.step used to compact reset_buf and the command timers into indices with nonzero(), which
blocked the host twice per step. Resets now run every step on a boolean mask:
ManagerBasedEnv._reset_mask(env_mask)implements the reset;_reset_idx(env_ids)wraps it. Subclasses that
override_reset_idxkeep receiving indices.- Managers,
InteractiveScene, assets, actuators, sensors, and the built-in and task event, command, curriculum,
action, observation, reward and modifier terms takeenv_mask, compute for all envs, and leave unselected envs
unchanged. - Mask types (Warp first). The env owns one stable Warp mask (
_step_reset_mask) and copies the termination
flags into it each step. Managers and MDP terms receive it as aProxyArray: Torch terms readenv_mask.torch(a
cached zero-copy view) and passenv_mask.warpto assets and sensors. The scene, assets, actuators, sensors and the
Newton backend takewp.array(dtype=wp.bool)only. Masks derived per step (interval events, throttled reset
events, expired commands, task selections) live in preallocated buffers, so no mask is allocated or converted per
step.env.reset_bufstays a Torch tensor for RL libraries. - Callables are dispatched by signature:
env_maskgets the mask;env_idsgets indices through
isaaclab.utils.env_selection_kwargs(one sync, skipped when nothing is selected).ManagerBase._reset_term
holds the shared logic. - Episode logs stay tensors and keep their last value on steps without a reset.
| Task (4096 envs, MJWarp) | develop | mask resets |
|---|---|---|
| Cartpole | 1.43 ms | 1.45 ms (host bound on the reset terms' Python launch cost) |
| Reach-Franka | 4.01 ms | 3.50 ms (+14.7% FPS) |
| Rough ANYmal-D | 24.25 ms | 22.77 ms (+6.5%) |
Next step, now possible because nothing after physics syncs: capture terminations, rewards, resets, commands, and
observations into one CUDA graph with the physics recording. A prototype took Cartpole from 1.47 to 0.60 ms per
step; ANYmal-D needs the lazy ArticulationData properties refreshed inside the graph first. Known caveats: PhysX
masked writers still call nonzero per write; Newton reset-mode randomization notifies the solver every step;
DifficultyScheduler reads its difficulty on the host every step; this overlaps upstream drafts #6646 and #8234.
Add a COMMAND phase before Newton actuators and give the Newton operational-space action a graph-native path that computes task-space state, runs the Warp controller, and writes efforts inside the captured program before every physics step. Let the environment fold the decimation loop only when no action term must run between physics steps: terms declare apply_every_physics_step, set_decimation takes a fold request, and articulations on Isaac Lab actuator models require host physics steps. Re-apply forces authored before a step to every substep, add a prepare hook, map view rows to worlds in invalidate_body_state, bind the scene data backend to an explicit runtime, and add IsaacContrib-StepProgram tasks for controllers, actuators, and sensors.
Let an MDP capture a whole environment step, physics included, as one graph: NewtonManager.step() called during a caller's capture records the prepared step program into that graph (runtime.record_step), always with the masked reconcile, and refuses unprepared programs or operations that cannot be recorded. Add CapturedCartpole, Isaac-Cartpole's MDP as Warp stages around the folded Newton program, a test that its captured step matches eager stepping through partial resets, and a benchmark against the torch and Warp frontends. Fix the Warp observation manager treating history_order as a term.
# Description On Newton, the external wrenches of `Articulation`, `RigidObject` and `RigidObjectCollection` acted only on the first solver substep. The assets write `state_0.body_f` once per step, and `NewtonManager._run_solver_substeps` clears the input state's forces after every substep. A constant wrench therefore delivered 1/`num_substeps` of its impulse, and 1/(decimation x `num_substeps`) when Newton runs the decimation loop, which is the default for supported explicit actuators. `NewtonManager` now copies `state_0.body_f` at the start of each step and writes it into the input state of every solver substep, before the state-force callbacks (viewer picking) add their forces. The copy is allocated in `initialize_solver`, so graph capture allocates nothing. The forces are still cleared after each substep, so a write applies to exactly one `step()` call. Only `body_f` is staged; Isaac Lab writes no particle forces. Draft #8218 re-applies authored forces in its manager rewrite as well; this PR fixes the current manager, so the fix can also be backported. Fixes #8268 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Tests `test_staged_body_force_acts_on_every_solver_substep` in `source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py` writes a `body_f` that cancels gravity on a 1 kg free body and checks that its velocity stays zero over one step: MJWarp (single state) with 2 substeps, and Kamino (double-buffered) with 3 substeps and a folded decimation of 2. On develop `qd_z` is -0.0245 and -0.0818 m/s. ``` pytest source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py -k test_staged_body_force_acts_on_every_solver_substep # before: 2 failed after: 2 passed ``` The rest of the file and the external-force tests of the rigid object, rigid object collection and articulation pass. The repro in the issue prints 0.100 m/s for 1, 2 and 4 substeps. Cost: one `body_f` copy per step and one per substep; 4096 envs x 8 bodies, 2 substeps: 0.882 -> 0.886 ms per step (measured without a wrench, so both trees integrate the same motion). ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Co-authored-by: Mustafa H <[email protected]>
# Description On Newton, the external wrenches of `Articulation`, `RigidObject` and `RigidObjectCollection` acted only on the first solver substep. The assets write `state_0.body_f` once per step, and `NewtonManager._run_solver_substeps` clears the input state's forces after every substep. A constant wrench therefore delivered 1/`num_substeps` of its impulse, and 1/(decimation x `num_substeps`) when Newton runs the decimation loop, which is the default for supported explicit actuators. `NewtonManager` now copies `state_0.body_f` at the start of each step and writes it into the input state of every solver substep, before the state-force callbacks (viewer picking) add their forces. The copy is allocated in `initialize_solver`, so graph capture allocates nothing. The forces are still cleared after each substep, so a write applies to exactly one `step()` call. Only `body_f` is staged; Isaac Lab writes no particle forces. Draft #8218 re-applies authored forces in its manager rewrite as well; this PR fixes the current manager, so the fix can also be backported. Fixes #8268 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Tests `test_staged_body_force_acts_on_every_solver_substep` in `source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py` writes a `body_f` that cancels gravity on a 1 kg free body and checks that its velocity stays zero over one step: MJWarp (single state) with 2 substeps, and Kamino (double-buffered) with 3 substeps and a folded decimation of 2. On develop `qd_z` is -0.0245 and -0.0818 m/s. ``` pytest source/isaaclab_newton/test/physics/test_newton_manager_abstraction.py -k test_staged_body_force_acts_on_every_solver_substep # before: 2 failed after: 2 passed ``` The rest of the file and the external-force tests of the rigid object, rigid object collection and articulation pass. The repro in the issue prints 0.100 m/s for 1, 2 and 4 substeps. Cost: one `body_f` copy per step and one per substep; 4096 envs x 8 bodies, 2 substeps: 0.882 -> 0.886 ms per step (measured without a wrench, so both trees integrate the same motion). ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Co-authored-by: Mustafa H <[email protected]> (cherry picked from commit adeb1f2)
…edesign # Conflicts: # source/isaaclab/test/assets/test_articulation_iface.py # source/isaaclab/test/assets/test_articulation_ordering_iface.py # source/isaaclab/test/assets/test_rigid_object_collection_iface.py # source/isaaclab/test/assets/test_rigid_object_iface.py # source/isaaclab_newton/isaaclab_newton/assets/articulation/articulation.py # source/isaaclab_newton/isaaclab_newton/cloner/replicate.py # source/isaaclab_newton/isaaclab_newton/physics/newton_manager.py # source/isaaclab_newton/isaaclab_newton/sensors/frame_transformer/frame_transformer.py # source/isaaclab_newton/isaaclab_newton/sim/views/newton_site_frame_view.py # source/isaaclab_newton/test/assets/test_articulation.py # source/isaaclab_newton/test/assets/test_articulation_ordering_kernels.py # source/isaaclab_newton/test/assets/test_newton_actuators_newton.py # source/isaaclab_newton/test/assets/test_rigid_object.py # source/isaaclab_newton/test/assets/test_rigid_object_collection.py
Move everything bound to a finalized model (solver, contacts, sensors, actuators, step callbacks, reset masks, and the compiled step) onto the existing NewtonBackend instead of a NewtonRuntime that wrapped it, and drop NewtonSchema. The functions in newton_backend take the backend explicitly, so several backends can be built and stepped side by side. Return solver-specific behavior to the Newton*Manager subclasses as stateless classmethod hooks over an explicit backend, replacing the NewtonSolverBinding layer. Build the whole simulation in one reset pass, apply sites and solver normalization in the registry's backend factory, and capture on the first step after a structural change, which removes the pre-capture visualizer and controller warm-up hooks. Rename stages to step callbacks with MuJoCo- and develop-style phases (CONTROL, POST_ACTUATOR, STATE_FORCE, POST_STEP), the step program to a step graph, reconcile to forward, and the decimation fold request to apply_every_physics_step.
Move the physics, asset, sensor, cloner, coupler, and task tests from the runtime, step program, and solver bindings to NewtonBackend, the newton_backend functions, and the manager hooks. Add a test that steps an MJWarp and a Featherstone backend side by side and records both into one CUDA graph, and a test that invalidate_fk maps view rows to worlds. Apply soft-contact settings before allocating state, resolve lazy manager class types once per backend, and accept lazy entry managers in the coupler's nested-solver check. Update the solver extension guide and API reference.
Site requests were consumed by injection, so IMU, PVA, and frame transformer sensors re-registered them on STOP, and every hard reset injected duplicate sites into the retained builder. Keep requests until close and inject only unresolved sites, which removes the re-registration from the sensors.
ManagerBasedRLEnv.step compacted reset_buf and the command resampling timers into indices with nonzero() on every step, which blocked the host on the device twice per step. Resets now run every step on a boolean mask: managers, the scene, assets, actuators and the built-in event, command, curriculum, action, observation, reward and modifier terms take env_mask and leave unselected environments unchanged. Terms that still take env_ids keep working through env_selection_kwargs, which hands them indices and skips the call when none are selected. Episode logs stay on the device and keep their last value on steps without a reset.
# Conflicts: # source/isaaclab_newton/isaaclab_newton/assets/articulation/actuator_control.py # source/isaaclab_newton/isaaclab_newton/envs/mdp/events.py
Newton Manager Redesign: OverviewSource: draft PR #8218, which is being split into WhyOn develop, the Newton manager is a 2,100-line class whose state lives in class variables. It owns the solver
ArchitectureData vs. behavior.
One step = one graph.
Environment layer.
API by exampleGet the manager and its data: one owner per context, no globals. from isaaclab.sim import SimulationCfg, SimulationContext
from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg, get_newton_backend
sim = SimulationContext(SimulationCfg(dt=1 / 200, physics=NewtonCfg(solver_cfg=MJWarpSolverCfg())))
manager = sim.physics_manager # NewtonManager instance (was: NewtonManager class + classmethods)
backend = get_newton_backend(sim) # == manager.backend after reset()
backend.model, backend.state_0, backend.control, backend.solverIndependent managers: no shared state between instances. left = NewtonManager(builder_a, NewtonCfg(solver_cfg=MJWarpSolverCfg()), dt=0.01, device="cuda:0")
right = NewtonManager(builder_b, NewtonCfg(solver_cfg=XPBDSolverCfg()), dt=0.01, device="cuda:0")
left.reset(); right.reset()
left.step() # right's model, callbacks and time are untouchedRun code inside the step: register on def bind(_):
manager.register_control_callback(osc.compute_torques, name="osc") # every physics step, before actuators
manager.register_post_step_callback(log_contacts, graphable=False) # eager island, still in order
sim.physics_manager.register_callback(bind, PhysicsEvent.PHYSICS_READY)Add a solver: an adapter instance holding only its cfg. Each hook takes the backend explicitly. @configclass
class MySolverCfg(NewtonSolverCfg):
class_type: type[NewtonSolver] | str = "my_pkg.my_solver:MySolverAdapter"
iterations: int = 16
class MySolverAdapter(NewtonSolver):
single_state = True # capabilities are class attributes
def create_solver(self, model, deterministic_mode=wp.DeterministicMode.NOT_GUARANTEED):
return SolverMySolver(model, iterations=self.cfg.iterations)Functional core / MDP2: record two backends into one caller-owned graph. from isaaclab_newton.physics import newton_backend as nb
for b in (rigid, cloth): # NewtonBackend(model, NewtonCfg(solver_cfg=...), dt=0.01)
nb.init_solver(b); b.steps_per_call = 2; nb.prepare(b) # allocate, no warm-up step
graph = nb.capture_graph("cuda:0", lambda: (nb.record_step(rigid), nb.record_step(cloth)))
graph.launch()
# World-masked reset commit; recorded once, follows the mask contents on every replay.
nb.invalidate_worlds(backend, reset_worlds) # wp.array(dtype=bool), shape (world_count,)
nb.forward(backend, force=True)Sync-free resets: terms take a mask and leave unselected environments unchanged. def reset_joints_by_offset(env, env_mask: ProxyArray, position_range, velocity_range, asset_cfg=...):
asset = env.scene[asset_cfg.name]
joint_pos = asset.data.default_joint_pos.torch.clone() + noise(...)
asset.write_joint_position_to_sim_mask(position=joint_pos, joint_mask=..., env_mask=env_mask.warp)
Captured environment step: on by default. env_cfg.capture_step = True # ManagerBasedRLEnvCfg / DirectRLEnvCfg
class MyCurriculum(ManagerTermBase):
supports_graph_capture = False # branches on host state between steps -> runs eagerly in placeMigration (main items)
Results (4096 envs, MJWarp, ms per env step)
|
# Description First PR of the Newton manager redesign series, split out of the draft #8218 (reference implementation and measurements). Overview of the whole redesign, with API examples: #8218 (comment). This PR changes one contract: **physics managers are instances**. On develop, `PhysicsManager` and its subclasses keep all simulation state in class variables and expose classmethods, so a process can hold only one simulation, and every consumer reaches the backend through a global (`NewtonManager.get_model()`, `PhysxManager.get_physics_sim_view()`, ...). Here: - `SimulationContext` constructs the manager selected by `cfg.physics.class_type` and owns it as `sim.backend_manager` (renamed from `sim.physics_manager`, which stays as a deprecated alias). Its runtime methods (`reset`, `step`, `forward`, `register_callback`, getters, ...) are instance methods, and its state (`_sim`, `_cfg`, `_device`, `_sim_time`, callbacks, `views`) is per instance. - Assets and sensors resolve the context and its manager once (`self._sim`, `self._backend_manager`); their data classes receive the manager at construction. MDP terms use `env.sim.backend_manager`. - `PhysicsManager.backend_name` (`"physx"`, `"ovphysx"`, `"newton"`) replaces class-name checks in the factories. - `views` is keyed by prim path per manager, instead of `(manager class, path)` in one process-wide dict. - PhysX, OVPhysX and Newton managers (and the Newton solver managers, couplers, and task-local managers) are converted mechanically. Class-level factory hooks used before a manager exists stay classmethods (`_prepare_stage_creation`, `fix_articulation_root`, `setup_deformable_body`, Newton `create_builder` and solver construction). Newton solver construction now receives the determinism mode as an argument instead of reading class state. No behavior changes otherwise; the Newton manager's internals are restructured in [2/N]. ## Series | PR | Scope | |---|---| | **[1/N] #8711 (this)** | Physics managers become instances | | [2/N] #8712 | Newton backend as data, stateless solver adapters, named step callbacks, one step graph | | [3/N] | Environment control inside the Newton step (actions, actuators, decimation loop in one graph) | | [4/N] | Mask-based resets: assets, scene, sensors, actuators | | [5/N] | Mask-based resets: managers, MDP and task terms (sync-free `env.step`) | | [6/N] | MDP2 physics contract: outer capture (`prepare`/`record_step`), world-masked commits, heterogeneous worlds | | [7/N] | Captured environment step | The split order and scope will change while the design is reviewed. ## Type of change - Breaking change, with deprecation paths for the common entry points. Migration below and in the changelog fragments. ## Migration Deprecated (still works, warns with `DeprecationWarning`): | Before | Now | |---|---| | `PhysxManager.get_physics_sim_view()`, `NewtonManager.get_model()`, `Manager.register_callback(fn, event)`, ... (class-level runtime calls and state) | `sim.backend_manager.get_physics_sim_view()`, `sim.backend_manager.get_model()`, ... (assets and sensors: `self._backend_manager`). Class-level access forwards to the active simulation's manager. | | `sim.physics_manager` | `sim.backend_manager` | | `RigidObjectData(view, device)` (PhysX, OVPhysX, Newton data classes) | `RigidObjectData(view, device, backend_manager=manager)` | | `profile_physics_steps(ManagerClass)` / lazy class reference | `profile_physics_steps(sim.backend_manager)` | | `PhysicsManager.safe_callback_invoke(..., physics_manager=m)` | `PhysicsManager.safe_callback_invoke(..., backend_manager=m)` | | `ParticleSurfaceRenderer(visualizers, surface, ...)` | `ParticleSurfaceRenderer(visualizers, surface, ..., backend_manager=sim.backend_manager)` | Breaking (no shim): | Before | Now | |---|---| | `sim.physics_manager is NewtonManager`, `sim.physics_manager.__name__` | `isinstance(sim.backend_manager, NewtonManager)`, `sim.backend_manager.backend_name` | | `Manager.views[(Manager, path)]` | `manager.views[path]` | | `InteractiveScene.physics_backend == "newtonmjwarpmanager"` (lowercased class name) | `scene.physics_backend == "newton"` (backend key) | | Manager subclasses overriding runtime hooks as classmethods (`_build_solver`, `_solver_specific_clear`, ...) | override them as instance methods | | Newton `_create_solver(model, solver_cfg)`, `_filter_solver_kwargs(solver_cls, solver_cfg)` reading the determinism mode from class state | `_create_solver(model, solver_cfg, deterministic_mode)`, `_filter_solver_kwargs(solver_cls, solver_cfg, deterministic_mode)` | ## Testing Each test file in its own process, without Isaac Sim (Kit): - All Newton physics, asset, sensor, env, cloner, controller and renderer tests; the asset contract suites on all three backends (articulation 487 passed, rigid object 231 passed); core sim, benchmark and backend-utility tests; all OVPhysX tests (30 files); contrib coupling and custom-coupling tests; the Newton contrib task tests (Franka pour, UR10 particle push); visualizer adapter tests. - New tests for the deprecation paths: class-level forwarding (methods and `views`), the `sim.physics_manager` alias, data-class fallback, profiler class input, and the OVPhysX exit hook being dropped on close. - Remaining failures also fail on develop `0ab97e9c8` (Kit launcher tests, `test_api.py` without `rl_games`/`sb3`, `test_rendering_franka_soft_kitless.py`, `test_xr_camera_feed_presets.py`) or need extras not installed here (`rerun`). - Not runnable here (need Isaac Sim): the PhysX asset, sensor and env tests, and Kit-dependent sim tests. The PhysX consumer changes are the same mechanical substitution and are lint-checked. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments
# Description Part of the Newton manager redesign (overview with API examples: #8218 (comment)). [1/N] #8711 (merged) made physics managers instances owned by the simulation as `sim.backend_manager`. The former [2/N] #8712 is split into five stacked PRs: | PR | Stage | |---|---| | [2a/N] **#8733 (this PR)** | Move Newton simulation data onto NewtonBackend | | [2b/N] #8734 | Describe Newton solvers with solver specifications | | [2c/N] #8735 | Move Newton manager logic into backend functions | | [2d/N] #8736 | Capture Newton model changes and Torch work in the step | | [2e/N] #8737 | Run each Newton step as one step graph | This PR is the bottom of the stack and targets `main` directly. ## What this PR does Newton's `Model` stays the immutable description (like `mjModel`). **`NewtonBackend`** becomes the mutable data bound to one finalized model (like `mjData`): state, control, solver, collision pipeline, contacts, sensors, Newton actuators and reset masks. The manager reads and writes `backend.*` instead of private fields, and a hard reset closes the backend and finalizes a new one. - The simulation registry still owns the builder and backend: consumers call `sim.get_or_create_backend(NewtonBuilderCfg(...))` / `sim.get_or_create_backend(NewtonBackendCfg(...))` as before. `NewtonBackendCfg.class_type` is `NewtonBackend`, constructed through `instantiate`. - Replication outputs (`NewtonCloneRecord`, site index map, world transforms, source builders) are read through manager accessors instead of private fields; site and extended-attribute requests persist on the builder across hard resets, so sensors no longer re-register them. - `add_contact_sensor` / `add_imu_sensor` return the Newton sensor. - `NewtonBuilderCfg` and `NewtonBackendCfg` move into their own `newton_builder_cfg.py` / `newton_backend_cfg.py`. - The per-solver manager subclasses and their hooks are unchanged apart from operating on the backend. ## Type of change - Breaking change. No deprecation shims: removed APIs are listed below with their replacements. ## Migration | Before | Now | |---|---| | `manager.get_model()`, `get_state_0()`, `get_state_1()`, `get_control()`, `get_contacts()` | `manager.backend.model`, `.state_0`, `.state_1`, `.control`, `.contacts` | | `manager._solver`, `_contacts`, `_collision_pipeline`, `_adapter`, `_world_reset_mask`, `_fk_reset_mask`, `kinematics_dirty` | `backend.solver`, `.contacts`, `.collision_pipeline`, `.actuators`, `.world_mask`, `.fk_mask`, `.kinematics_dirty` | | `get_num_envs()`, `get_dt()`, `get_solver_dt()` | `backend.model.world_count`, `backend.dt`, `backend.solver_dt` | | `cl_register_site(...)` | `register_site(...)` | | `add_frame_transform_sensor(...)` | construct `newton.sensors.SensorFrameTransform` on `backend.model` | | `add_contact_sensor` / `add_imu_sensor` returning a key or index | both return the Newton sensor | | private replication fields (`_cl_site_index_map`, `_world_xforms`, `_cl_protos`, ...) | `get_site_index_map()`, `get_world_xforms()`, `get_clone_source_builders()`, `get_clone_record()` | | `from isaaclab_newton.physics.newton_manager_cfg import NewtonBuilderCfg, NewtonBackendCfg` | `from isaaclab_newton.physics import NewtonBuilderCfg, NewtonBackendCfg` | | sensors re-registering sites / `body_qdd` on `STOP` | not needed; requests persist on the builder | ## Testing Every test file in its own process without Isaac Sim (Kit), compared with `main`: no file has more failures or fewer passes, apart from two tests removed with the deprecated accessors. Remaining failures also fail on `main` or need missing extras (Kit launcher tests, rl_games/sb3, `rerun`). Not run: Kit-only tests and the GB300, Rizon coffee and teapot examples. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments --------- Co-authored-by: Maximilian Krause <[email protected]>
# Description Part 2b of the Newton manager redesign ([overview](#8218 (comment))). Builds on [2a/N] #8733 (merged), which moved Newton's simulation data onto `NewtonBackend`. ## Summary There is now **one `NewtonManager` and one generic solver path for every Newton solver**. The six per-solver manager subclasses (`NewtonMJWarpManager`, `NewtonVBDManager`, ...) are gone. What differs per solver lives in a small, stateless **Isaac Lab solver** class (`MJWarpSolver`, `XPBDSolver`, ...) that the solver configuration selects through `class_type`. Newton's solver is never wrapped: `backend.solver` is Newton's solver. **Why:** most of what Isaac Lab does with a solver is the same for all of them: build it from its config, step it, reset masked worlds, run forward kinematics, collide with Newton's `CollisionPipeline`. The manager's own job (lifecycle, builder, hard reset, callbacks) doesn't depend on the solver at all. So: - `NewtonSolver` holds that generic path as class methods taking the config and Newton's solver; a subclass overrides only where its solver differs; - XPBD and Featherstone are three-line classes; - the solver classes hold no state, so Newton's solver is the only solver object; - a coupler builds each entry through that entry's own config. `CouplerCfg.outer_contact_entry` limits the outer collision pipeline to one entry's shape pairs. ## Before and after ```python # Choosing a solver: unchanged sim_cfg = SimulationCfg(physics=NewtonCfg(solver_cfg=MJWarpSolverCfg())) sim.backend_manager # always a NewtonManager sim.backend_manager.backend.solver # Newton's SolverMuJoCo: unchanged # A simple solver, before: a manager subclass. Now: a solver class and its config. class XPBDSolver(NewtonSolver): solver_class = SolverXPBD deterministic = True @configclass class XPBDSolverCfg(NewtonSolverCfg): class_type: type | str = "{DIR}.xpbd_solver:XPBDSolver" iterations: int = 2 # The manager calls them with the config and Newton's solver. solver_cls = solver_cfg.class_type backend.solver = solver_cls.build(solver_cfg, model, mode) solver_cls.reset(solver_cfg, backend.solver, backend.state_0, backend.world_mask) # A custom solver, before: subclass a manager and override its hooks. Now: subclass the solver. class MyMPMSolver(MPMSolver): @classmethod def build(cls, cfg, model, mode, env_template=None): return MyMPM(model, mpm_solver_config(cfg)) ``` ## What differs between solvers | Solver | Overrides | |---|---| | XPBD, Featherstone | nothing (Featherstone warns that it ignores inertia changes) | | VBD | builder coloring, BVH rebuild before and joint IK after each step | | MJWarp | MuJoCo contacts, warm-start reset, sensors off under determinism, tendon control | | Kamino | loop-closure FK through its reset, optional internal collision detector | | MPM | in-place stepping, collider projection, no per-world reset, grid capture check | | Couplers | build each entry's solver through the entry's own config | ## Breaking changes There are no deprecation shims. Each removal is listed in the changelog with its replacement. | Removed | Use instead | |---|---| | `NewtonMJWarpManager`, `NewtonXPBDManager`, `NewtonVBDManager`, `NewtonFeatherstoneManager`, `NewtonKaminoManager`, `NewtonMPMManager` | `NewtonManager`; the solver config's `class_type` selects `MJWarpSolver`, `XPBDSolver`, ... | | `NewtonSolverCfg.class_type` selecting a manager | it selects the `NewtonSolver`; a custom manager goes on `NewtonCfg.class_type` | | Overriding `_build_solver`, `_step_solver`, ... | Override `build`, `step`, `reset`, ... on a `NewtonSolver` subclass | | `NewtonManager.create_builder` | `isaaclab_newton.physics.create_builder` | | `NewtonManager.create_fixed_tendon_control(articulation)` | `NewtonSolver.fixed_tendon_control(cfg, articulation, model)` | | `NewtonMPMManager.reset_solver_state` | `reset_mpm_solver_state(backend, ...)` | | Contrib `NewtonCouplerManager`, `NewtonCoupledMJWarpVBDManager` | `CouplerSolver`, `CoupledMJWarpVBDSolver`; override `CouplerSolver.build_coupled` for a custom coupled solver | | Modules `mjwarp_manager`, `xpbd_manager`, ..., `*_manager_cfg` | `*_solver` / `*_solver_cfg`; import from `isaaclab_newton.physics` | ## Behavior changes - VBD's per-step preparation runs in both stepping paths, and VBD registers its Newton custom builder attributes. - When determinism is requested, MJWarp is built with its sensor stage disabled instead of raising, and the config is no longer modified. Tasks whose sensors need attributes only that stage fills (IMU/PVA `body_qdd`, joint wrench `body_parent_f`) still raise. - MJWarp with `use_mujoco_cpu=True` steps eagerly instead of capturing a CUDA graph. - `NewtonCfg.collision_cfg` is rejected for any solver that does not use Newton's collision pipeline: MJWarp with MuJoCo contacts (as before), Kamino with its own collision detector, and MPM. - `NewtonCfg.class_type=None` raises; omit it to use `NewtonManager`. - Couplers forward `NewtonCfg.debug_mode` diagnostics to their entries' solvers. - A coupler without proxies steps its entries independently; a coupled MPM entry that doesn't step in place raises. - Coupler `{ENV_REGEX_NS}` selectors expand against the environment template the manager passes in, not a global. ## Testing Targeted tests pass on the branch merged with current `main`: manager abstraction (106), coupler (66), coupler runtime, custom coupling, contrib coupling environments without Isaac Sim, VBD core, MPM reset contract and spawners, MJWarp tendon control, cloner, visualization state, the Newton visualizer tests, and the articulation contract (`-k newton`). The GB300, Rizon coffee, teapot and coupled MJWarp/VBD solvers resolve. Tests that need Isaac Sim (`test_manual_coupling`, `test_newton_solver_reset`, `test_newton_fabric_body_sync`, MPM rendering) were not run locally. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments
# Description Part 2c of the Newton manager redesign ([overview](#8218 (comment))). Builds on [2a/N] #8733 and [2b/N] #8734 (both merged). ## Summary `NewtonManager`'s step, reset and contact logic moves onto `NewtonBackend`. A backend now holds everything one model's step needs and the methods that run it, so backends with different solvers can be built and stepped side by side without a manager or simulation context: ```python backend = NewtonBackend(NewtonBackendCfg(physics_cfg=cfg, device="cuda:0"), builder, dt=0.01) backend.init_solver() # solver, contacts, initial FK backend.invalidate_fk(env_mask, articulation_ids=ids) backend.step() # forward + step; captured as a CUDA graph after the first call backend.refit_bvh(timestamp) # shared BVHs, refit once per state ``` **Why:** - **Hard resets are correct by construction.** Step callbacks, solver-init callbacks, pending model changes, the outer-capture flag and the captured graph live on the backend, so they are discarded with the model instead of being cleared by hand in the manager. - **Several simulations per process.** No backend method reads manager or module state (`test_two_backends.py`: MJWarp and Featherstone stepped side by side, eager and captured, with reset masks isolated per backend). - **Groundwork for 2d/2e:** the step becomes one captured graph whose capture the caller can own. The manager keeps what outlives a model (builder, sites, clone record, decimation) and scene-data timestamps. Solver behavior goes through `solver_cfg.class_type` as in 2b. Behavior is unchanged, including the solver-init callback and initial-FK order. `NewtonQueries.run_query` combined a shared BVH refit with each consumer's query capture. It is split: the shared part is `backend.refit_bvh(timestamp)`, and the renderer and ray caster capture their own query, as the frame transformer already did. The Newton viewer now registers its picking forces with each new backend on a hard reset, since state-force callbacks belong to the backend. ## Breaking changes | Removed | Use instead | |---|---| | `NewtonQueries.run_query` | `backend.refit_bvh(timestamp)`, then capture the query with `newton_backend.capture_graph` | | `NewtonQueries.capture_graph`, `._refit_bvh` | `newton_backend.capture_graph`, `backend.refit_bvh` | | `NewtonManager.transforms_may_change_on_graph_replay` | `NewtonBackend.transforms_may_change_on_graph_replay` | | Manager privates (`_simulate_full`, `_graph`, `_post_step_callbacks`, ...) | `backend.step()`, `backend.graph`, `backend.post_step_callbacks`, ... | ## Performance `isaaclab benchmark runtime`, 4096 envs, `physics=newton_mjwarp`, 1000 steps, warm kernel cache, run sequentially: | Task | main | this PR | |---|---|---| | Cartpole | 2.65 M steps/s | 2.69 M steps/s | | Reach-Franka | 1.058 M steps/s | 1.054 M steps/s | | Flat ANYmal-D | 254.6 k steps/s | 254.6 k steps/s | ## Testing Targeted tests pass, run file by file: manager abstraction (106), two backends (3), Newton visualizer adapter, VBD core, MJWarp tendon control, MPM reset masks and object, coupler, coupler runtime, custom coupling, visualization state, articulation (incl. contract `-k newton`), joint coordinates, Newton actuators, BAM actuator, contact sensor, frame transformer, ray caster, IMU, cloner. Tests that need Isaac Sim (renderers, deformable object, `test_newton_solver_reset`) were not run locally. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments
# Description `NoiseModelWithAdditiveBiasCfg.bias_noise_cfg` is documented as "sampled at every reset of the noise model", and the direct-env how-to says the bias is "resampled at the next reset". `NoiseModelWithAdditiveBias.reset` instead applies the bias noise to the previous bias: ```python self._bias[env_ids] = self._bias_noise_cfg.func(self._bias[env_ids], self._bias_noise_cfg) ``` With the default `operation="add"`, every reset adds a new sample to the old bias, so the bias random-walks across episodes. With 4096 envs, `sample_bias_per_component=False`, `GaussianNoiseCfg(std=0.1)` as the bias noise and `torch.manual_seed(0)`, after N calls to `reset()`: | resets | bias std (`"add"`, `develop`) | bias std (`"abs"`) | |---|---|---| | 1 | 0.099 | 0.099 | | 10 | 0.317 | 0.101 | | 100 | 0.988 | 0.101 | A `UniformNoiseCfg(n_min=-0.1, n_max=0.1)` bias spans about -1.3 to 1.5 after 50 resets. `ObservationManager.reset` and the direct envs call this reset on every episode reset, so the observation bias of long training runs keeps growing. `"abs"` happens to work because it ignores the input. This samples the bias from zeros instead of from the previous bias. `"add"` now gives a fresh sample on each reset, the same as `"abs"`. The noise functions draw the same random numbers either way, so `"abs"` (used by all in-repo configs) and `"scale"` give bit-identical results to `develop`. The changelog fragment notes the behavior change for configs that use `"add"`, and the `bias_noise_cfg` docstring now says how each operation applies to the bias (`"scale"` already yielded no bias on `develop`, since the initial bias is zero). All in-repo configs have used `"abs"` since the bias model was added, and I did not add an option to keep the accumulating behavior; happy to add one if you prefer. #8218 (draft) also edits this `reset` to add an `env_mask` path, but both of its branches still pass the previous bias, so the two changes would need a small merge there. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the [test-audit criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md) to any test changes - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package (do **not** edit `CHANGELOG.rst` or bump package versions — CI handles that) - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there ## Testing - Added `test_additive_bias_is_resampled_on_reset` to `test/utils/test_noise.py`: with a constant `"add"` bias of 0.5, the output must stay 0.5 after repeated full resets, and after changing the bias to 0.25 a partial reset of env 1 must resample only that env. On `develop` it fails at the first check with 1.0 (the explicit reset and the lazy per-component reset on the first call each add 0.5); it passes with the fix. - Compared the fixed `reset` with the `develop` one under a fixed seed for Gaussian, uniform and constant bias noise, each operation, and both `sample_bias_per_component` settings, over 50 full and partial resets: `"abs"` and `"scale"` outputs are identical, and `"add"` now stays at the configured spread. - `test_noise.py` and `test_observation_manager.py` pass locally on CPU (the `cuda:0` rows of the existing noise tests were run with the device swapped to CPU, since my machine has no CUDA). I could not run the direct-env unit tests in my environment. - Ruff v0.14.10 (the pre-commit pin) `check` and `format` and codespell are clean on the changed files. I ran them directly because the full `uv run isaaclab --format` environment isn't available on my Windows machine. ## Release backport - [ ] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` --------- Signed-off-by: Patrick-SCH03 <[email protected]> Co-authored-by: Antoine RICHARD <[email protected]>
# Description
`reset_joints_within_limits_range` samples values only for the joints
listed in `position_range` / `velocity_range` and writes them into those
columns, but then clamps the **whole** `(num_envs, num_joints)` tensor
with the soft limits of the listed joints only:
```python
joint_pos[:, self._pos_joint_ids] = math_utils.sample_uniform(...)
joint_pos_limits = self._asset.data.soft_joint_pos_limits.torch[0, self._pos_joint_ids] # (num_selected, 2)
joint_pos = joint_pos.clamp(joint_pos_limits[:, 0], joint_pos_limits[:, 1]) # (num_envs, num_joints)
```
The velocity branch does the same. Depending on which joints are listed,
this:
- **one joint listed:** clamps every other joint to that joint's limits,
so joints without a range do not keep their default state as the
docstring says ("If the dictionary does not contain a key, the joint
position or joint velocity is set to the default value for that
joint.");
- **a subset of more than one joint:** raises `RuntimeError: The size of
tensor a (4) must match the size of tensor b (2) at non-singleton
dimension 1`;
- **all joints, but keys not in joint order** (e.g. `{"j2|j3": ...,
"j0|j1": ...}`): applies each joint's limits to a different joint;
- **an empty `position_range` or `velocity_range` (`{}`):** raises
`IndexError: tensors used as indices must be long, int, byte or bool
tensors` in `__init__`, because the ids are built with
`torch.tensor([])`, which is a float tensor.
This clamps the samples with the limits of the sampled joints before
writing them into those columns, and builds the id tensors with
`dtype=torch.int32`. Listing every joint in joint order gives the same
result as before.
No task config in the repository uses this term today, so only users of
the public API are affected (the subset case currently fails with the
`RuntimeError` above). I did not find an existing issue for this. Draft
#8218 also edits this `__call__` (moving it to `env_mask`) but keeps the
whole-tensor clamp, so the two will need a small rebase whichever lands
first.
## Type of change
- Bug fix (non-breaking change which fixes an issue)
## Release backport
- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`
## Checklist
- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/develop/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
## Testing
- Added a test in `test/envs/mdp/test_events.py` with an inline sim-free
articulation double and four joints with distinct soft limits. Two
cases: two joints listed out of joint order with a range wider than
every soft limit in `position_range` and an empty `velocity_range`, then
swapped. The listed joints must reach exactly their own soft limits, and
every other joint position and velocity must keep its default. Both
cases fail on `develop` and pass with the fix.
- Mutation check: reverting either clamp line to clamp the whole tensor,
taking the position or velocity limits in sorted instead of key order,
dropping either `dtype=torch.int32`, or not writing the position or
velocity samples each turns one case red.
- `test_root_state_events.py` and `test_terminations.py` still pass
(CPU, 6 passed together with the new test).
- Ruff v0.14.10 (the pre-commit pin) `check` and `format` and codespell
are clean on the changed files, and I checked the changelog fragment
name and format against the rules in `tools/changelog/cli.py`. I ran
these directly because the full `uv run isaaclab --format` environment
isn't available on my Windows machine.
---------
Signed-off-by: Patrick-SCH03 <[email protected]>
Co-authored-by: Antoine RICHARD <[email protected]>
# Description Part 2c-ii of the Newton manager redesign ([overview](#8218 (comment))). Follows [2c/N] #8735 (merged). The test overhaul is [2c-iii/N] #8884. ## Reset and FK flags are mask-only `NewtonBackend.invalidate_fk(env_mask, articulation_ids, *, articulation_mask, consume_mask)` and `invalidate_body_state(env_mask, *, consume_mask)` select worlds and articulations with boolean masks only. The flag kernels run one thread per world and take no index selectors, so their launch shape is fixed and any write made through a `_mask` writer can be recorded into a CUDA graph. Resets still call the `_index` writers until mask-based environment resets land. The FK flag kernel is specialized per view with `wp.static` on its articulation count and on whether an articulation mask is given, so it handles no optional arrays at run time. The id-indexed kernels and their dtype dispatch are removed. - **Breaking:** `NewtonManager.invalidate_fk` and `invalidate_body_state` (and the backend methods) no longer take `env_ids`. Pass a boolean `env_mask`, and `articulation_mask` to select view-local articulations. ## Index writes convert ids at the asset boundary Asset `*_index` writes (articulation root and joint state, rigid object root state, rigid object collection body state, cable segments) flag their ids into a per-asset scratch mask with one small kernel and pass that mask on. The backend clears each entry as it reads it (`consume_mask=True`), so the mask starts empty for the next write without a memset. Writes over all environments pass the asset's all-true mask. Collections also flag `body_ids` into a scratch object mask, zeroed after the call when a subset of objects was written. The assets share one `mask_from_ids` helper. ## Asset state writes - Rigid object collection writes use separate index and mask kernels. The mask kernels take only masks and full data, so the index path can later be removed without touching them. - Asset writers flag the backend once per write. The data classes' `_reset_pose` / `_reset_velocity` invalidate only derived caches. - Obtaining write destinations no longer refreshes derived state. ## Deprecated joint-state index writer `Articulation.write_joint_state_to_sim_index` (Newton, PhysX, OVPhysX) emits a `DeprecationWarning`. Use `write_joint_state_to_sim_mask`, or `write_joint_position_to_sim_index` and `write_joint_velocity_to_sim_index`. The lift, locomotion, Franka pour, Rizon coffee and UR10 particle-push resets move to the position and velocity writers. ## Performance RTX PRO 6000 Blackwell, Warp 1.17.0, `main` at `c498443e0`. Environment throughput from `isaaclab benchmark runtime --task <task> --num_envs 4096 --num_steps 1000 --warmup_steps 100 --visualizer none physics=newton_mjwarp`, two alternating sequential rounds after a warm-up run (steps/s): | Task | `main` | this PR | change | |---|---|---|---| | Cartpole (reset-heavy) | 2.67M | 2.63M | −1.4% | | Flat ANYmal-D | 254.3k | 254.7k | +0.2% | Per-call cost of articulation writes, 4096 envs, CUDA, three alternating rounds (host-bound; µs): | Write | `main` | this PR | |---|---|---| | `write_joint_state_to_sim_index` | 61.6 | 57.9 | | `write_joint_position_to_sim_index` | 59.1 | 55.0 | | `write_root_link_pose_to_sim_index` | 71.3 | 78.8 | | `write_root_link_pose_to_sim_mask` | 52.5 | 52.8 | | `write_joint_state_to_sim_mask` | 42.6 | 33.6 | The ids→mask launch adds about 5.5 µs to each `_index` write; root pose index writes are about 7.5 µs slower than on `main`, and reset-heavy Cartpole, which makes four `_index` writes per reset, is 1.4% slower. Mask-based environment resets (a later stage) move resets onto the `_mask` writers. ## Testing Targeted tests pass, run file by file: Newton manager abstraction, two backends, visualization state, articulation and rigid object contracts (all backends), articulation, rigid object and collections, cable, joint coordinates, Newton actuators, MDP events, lift environment config and Warp event capture safety. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments
# Description Part 2c-iii of the Newton manager redesign ([overview](#8218 (comment))). Follows [2c-ii/N] #8870 (merged). Test-only. ## 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: 43.7 s → 32.3 s, 119 → 88 tests (plus 5 cases moved), 1.7k → 1.3k lines. The manager file also covers 2c-ii's mask-only reset flags: environment and articulation masks, a consumed mask cleared as it is read, a caller mask left unchanged, and selections accumulating in one backend only. ## Testing `test_newton_manager.py`, `test_newton_solvers.py`, `test_vbd_core.py` and `assets/test_articulation.py` pass, run file by file. New unit tests fail under one-line mutations of the code they guard. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] My changes generate no new warnings - [x] I have added changelog fragments
# Description Part 2d of the Newton manager redesign ([overview](#8218 (comment))). Follows [2c-iii/N] #8884 (merged) and folds in [2e/N] #8737. Builds on @maxkra15's captured-runtime work and its regression coverage. Newton's step folds the decimation loop even when some actuators cannot be captured, and the step, BVH refits, sensor queries and derived asset data work inside a CUDA graph recorded by a caller, such as a whole environment step. Capture follows the Warp, Newton and MuJoCo Warp examples: Warp owns the capture (`wp.ScopedCapture` / `wp.capture_launch`), Torch actuators that are not graphable stay eager, and Warp's blocking stream orders work with Torch's default stream. ## Changes - **Step around the Newton actuators.** Each physics step runs `_before_actuators()` (solver `pre_step`, collision, pre-actuator callbacks), the Newton actuators, then `_after_actuators()` (post-actuator callbacks, solver substeps); `_finish_step()` runs post-step callbacks and sensors once. With capture-safe actuators the whole decimation loop replays from one graph, as before. Actuators that cannot be captured (Torch networks) now run eagerly between captured `_before_actuators` and `_after_actuators` graphs instead of disabling the folded loop, so `handles_decimation()` holds whenever Newton actuators run in the step. Registering a callback or reallocating contacts captures again. - **Record into an enclosing capture.** `NewtonBackend.step`, `refit_bvh`, the Newton Warp renderer and the ray caster record their work into a caller's capture instead of starting or replaying their own graph. Recorded BVH refits run on every replay, because replays cannot consult host timestamps. Solver status checks run only outside capture. - **Live derived data.** `NewtonBackend.live` is true during a step and while a graph is recorded. Derived asset properties (link velocities, COM poses, heading, projected gravity, body-frame velocities, state concatenations) recompute on read in that interval, so step callbacks see the current substep and replays refresh them. Outside it the timestamp caches apply as before. This replaces the `capture_unsafe` guards that raised during capture. - **Model changes before state reads.** Queued model-property edits reach the solver at the next `forward()`, scene-data state read or step, through `NewtonBackend.notify_model_changes`. Fixed-root pose writes queue their edit instead of notifying the solver on every write. - **View rows map to worlds.** `invalidate_fk` maps articulation-view rows to worlds through `model.articulation_world`, so views over a subset or reordering of worlds reset the right worlds, and global articulations get FK without resetting the global world. ## Performance RTX PRO 6000 Blackwell, Warp 1.17.0, `main` at `e44437edc`. `isaaclab benchmark runtime --task <task> --num_envs 4096 --num_steps 1000 --warmup_steps 100 --visualizer none physics=newton_mjwarp`, two alternating sequential rounds after a warm-up run (steps/s): | Task | `main` | this PR | change | |---|---|---|---| | Cartpole | 2.65M | 2.61M | −1.5% | | Flat ANYmal-D | 254.1k | 260.8k | +2.6% | | Flat Go2 (Newton actuators in the step) | 769.0k | 768.3k | 0% | This PR enables, rather than delivers, the larger gain: capturing the whole environment step, recorded by the caller, in a later stage. ## Testing Targeted tests pass, run file by file: Newton manager, solvers, VBD, MJWarp tendon control, MPM reset masks, coupler and custom coupling, visualization state, articulation and rigid object contracts, articulation, rigid object, cable, joint coordinates, Newton actuators, BAM actuator, MPM object, contact sensor, frame transformer, ray caster, IMU, cloner and the visualizer adapter. New coverage includes the decimation order with capture-safe and eager actuators, an outer capture of two backends side by side, FK over reordered view rows with a global articulation, and a derived heading refreshed inside a replayed step. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments
# Description Part 2d-ii of the Newton manager redesign ([overview](#8218 (comment))). Follows [2d/N] #8736 (merged). `NewtonSolver` was a class that was never instantiated: every call passed the solver configuration and Newton's solver back in, e.g. `cfg.class_type.pre_step(cfg, solver, state)`. It is now a driver built once from its configuration and model, so the backend calls `backend.solver_ops.pre_step(state)`. ## Changes - **`NewtonSolver(cfg, model, mode, env_template)`** stores `cfg` and builds Newton's solver into `native` through the overridable `build(model, mode, env_template)`. Per-solver methods (`init_state`, `pre_step`, `step`, `post_step`, `reset`, `eval_fk`, `check_step`, contact and capture queries) are instance methods, and each driver narrows `cfg` to its configuration type. - **Configuration-level hooks stay classmethods** (`solver_classes`, `prepare_builder`, `applied_deterministic_mode`, `shares_materials`, `coupling_error`, `fixed_tendon_control`): they need no built solver. - **`NewtonBackend.solver_ops`** holds the driver; `NewtonBackend.solver` stays Newton's solver. - **Couplers hold their entries' drivers.** `CouplerSolver` keeps one driver per entry and `CoupledMJWarpVBDSolver` keeps its rigid and soft drivers, instead of re-deriving them from configurations and `solver.solver(name)`. - MJWarp, Kamino, MPM, VBD, the coffee-task MPM solver, the teapot example's coupler and the Newton visualizer follow the new API. ## Breaking Custom solvers override `build(self, model, mode, env_template)` and instance methods such as `pre_step(self, state)`, reading `self.cfg` and `self.native`. Code that called `cfg.class_type.<method>(cfg, solver, ...)` calls `backend.solver_ops.<method>(...)`. ## Validation Targeted tests, one file at a time: `test_newton_manager.py` (50), `test_newton_solvers.py` (36), `test_vbd_core.py` (8), `test_mpm_reset_mask_contract.py` (4), `test_mjwarp_tendon_control.py` (10), `test_coupler.py` (66), `custom_coupling/test_manager.py` (9), `test_articulation.py` (42), `test_rigid_object.py` (22), asset contract tests (296 + 146), all passing. ## Type of change - Breaking change (existing functionality will not work without user modification) ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `./isaaclab.sh --format` - [x] I have added changelog fragments under each touched package's `changelog.d/`
# Description Part 3 of the Newton manager redesign ([overview](#8218 (comment))). Follows [2d-ii/N] #8946 (merged). The environment's control now runs inside the Newton step. When every action term and every asset that writes to the simulation can be recorded, the Newton step handles them: each physics step of the captured decimation loop applies the actions and writes the assets before the Newton actuators, as the environment's own loop does. One `env.step` then makes one physics call instead of `decimation` calls. ## Changes - **`handle_actions`.** `PhysicsManager.handle_actions(actions, scene)` returns `False` by default. `NewtonManager.handle_actions` registers `ActionManager.apply_action` and `scene.write_data_to_sim` as pre-actuator callbacks and sets `NewtonBackend.handles_actions`. The backend then stages the body forces after the pre-actuator callbacks, so wrenches written by the assets hold for that physics step's substeps, and a reordered or ball-jointed articulation republishes its state at the start of its write. Post-step callbacks still run once per step. Hard resets register them again on the new backend. When something cannot be recorded, nothing is handled and the environment keeps its loop. `ManagerBasedEnv` also keeps its loop when `render_interval` is not a multiple of the decimation, a recorder term records after every physics step (`RecorderManager.records_physics_steps`), or a sensor that refreshes on update (contact history or eager sensor updates) has a period that is not a whole number of environment steps. - **Capture flags.** - `ActionTerm.is_graphable` (default `False`) marks terms whose `apply_actions` launches only Warp work on fixed buffers: joint position, velocity and effort, joint-to-limits (with EMA) and binary joint actions. These terms now write their processed actions in place, so a held `processed_actions` reference sees later commands. A subclass that overrides `process_actions` or `apply_actions` must set it again. `ActionManager.is_graphable` is whether all terms set it. - `AssetBase.is_graphable` (default `False`) is `True` for Newton rigid objects and collections, and for Newton articulations whose actuators run no Torch model and that have no fixed-tendon control. `ActuatorCollection.is_graphable` and `InteractiveScene.is_graphable` report the same. - **Wrench work in a captured step.** `WrenchComposer.pending` replaces `active` in the Newton asset writers. While a graph records, a composer that was ever written always merges, composes into the body frame and clears its buffers, so replays apply wrenches written after the capture. The `on_first_use` constructor argument captures the step again at the first write. ## Performance RTX PRO 6000 Blackwell, Warp 1.17.0. `isaaclab benchmark runtime --task <task> --num_envs 4096 --num_steps 1000 --warmup_steps 100 --visualizer none physics=newton_mjwarp`, two alternating sequential rounds after a warm-up run (steps/s): | Task | `main` | [2d/N] | this PR | vs [2d/N] | |---|---|---|---|---| | Cartpole | 2.632M | 2.634M | 2.808M | +6.6% | | Flat ANYmal-D | 254.0k | 261.1k | 261.9k | +0.3% | | Reach-Franka | 1.049M | 1.051M | 1.078M | +2.6% | ## Testing - New: a backend that handles actions matches the environment loop with a state-dependent action over a captured decimation loop, including after a hard reset. Dropping the re-staging of body forces turns it red. - New: recorded wrench work applies wrenches written after the capture, and recordable joint action terms process into the same buffer. - Handled and env-loop Cartpole and Reach-Franka rollouts on MJWarp match exactly. Flat ANYmal-D (Newton actuators, external wrench applied mid-rollout) matches the unfolded environment loop exactly. - Targeted tests pass, run file by file: Newton manager, solvers, VBD, MJWarp tendon control, MPM reset masks, coupler, visualization state, articulation and rigid object contracts, articulation, rigid object, cable, joint coordinates, Newton actuators, BAM actuator, MPM object, sensors, cloner, visualizer adapter, wrench composer, actions, experimental capture safety and Warp action parity, interactive scene. - Kit-only tests did not run locally. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments --------- Co-authored-by: Antoine RICHARD <[email protected]>
# Description Part 4 of the Newton manager redesign ([overview](#8218 (comment))). Builds on [2c-ii/N] #8870 (merged), which made the backend reset flags mask-only. The env/MDP layer is [5/N] #8927. Everything below the managers resets from a boolean device mask. A masked reset changes only the selected environments and does not synchronize the device, so [5/N] can reset on the reset mask every step. ## Assets and scene - `AssetBase.reset(env_ids=None, env_mask=None)` matches the sensor signature on `main`. Every asset honors `env_mask` (a `wp.bool` array of shape `(num_envs,)`), and it takes precedence over `env_ids`. - `InteractiveScene.reset(env_ids=None, env_mask=None)` passes both to every asset and sensor. - Fixed: on `main`, a reset with only `env_mask` reset the actuator state of every environment (Newton, PhysX, OV articulations), and the external wrenches of every environment (Newton and PhysX rigid objects and collections). - **Breaking:** `SurfaceGripper.reset` takes `env_ids` and `env_mask` instead of `indices`. - **Breaking:** `InteractiveSceneWarp` is removed. The base scene now resets every entity from the mask, and the override passed indices to the sensors. ## Actuators - `ActuatorBase.reset(env_ids=None, env_mask=None)`; `ActuatorCollection.reset` forwards the mask to every group and to the backend-native actuators. - `DelayedPDActuator` draws a delay for every environment and keeps the selected ones; the actuator nets clear the masked history. - `NewtonActuatorAdapter.reset(env_mask=...)` builds the per-DOF masks of stateful actuators into preallocated arrays and skips stateless ones. - Contrib `Thruster` and `Multirotor` resample and reset the masked environments. ## Buffers and processors - `DelayBuffer.reset` takes a boolean mask and redraws sampled lags with `torch.where`. - `TensorProcessor.reset`, `DigitalFilter`, `Integrator`, `NoiseModel` and `NoiseModelWithAdditiveBias` take `env_mask`. - Ray-caster drift resampling selects environments with the resolved reset mask instead of `nonzero()`. **Breaking:** custom subclasses of `AssetBase`, `ActuatorBase`, `TensorProcessor` and `NoiseModel` must accept `env_mask` and leave unselected environments unchanged. ## Testing Targeted tests pass, run file by file: actuator collection and Newton adapter (masked reset; the collection test runs under `torch.cuda.set_sync_debug_mode("error")`), delay buffer, tensor processors, noise, Newton articulation, rigid object, cable, Newton actuators, Newton ray caster, articulation and rigid object contracts (`-k newton`), and the experimental frontend. Kit-only tests not run locally: interactive scene, ray caster sensor, sensor base, thruster, PhysX/OV assets. ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added changelog fragments
Description
Rewrite Newton simulation around independent manager instances, an explicit backend, and solver adapter instances. The captured simulation step includes ordinary controllers, action terms, actuators, forces, solver substeps and native sensors across decimation. Downstream applications can extend the manager, inject their own instance into Isaac Lab, or use the functional API directly.
Extending Newton solvers
Architecture
SimulationCfg.physics = NewtonCfg(...)selects Newton;NewtonCfgcontains manager/solver selection and physics settings, whileNewtonBackendcontains the finalized model and live runtime buffers. The manager owns its builder and finalizes and closes its backend itself;get_newton_builder(sim)/get_newton_backend(sim)return them, and the registry descriptors (NewtonBuilderCfg,NewtonBackendCfg) only describe the render-only model used under other physics.NewtonManagerowns construction and integration;NewtonBackendowns one model's runtime state, solver, contacts, sensors, actuators, reset masks and compiled schedule. Two standalone managers can coexist without sharing callbacks, views or simulation state. Common physics interfaces and backend consumers retain their owning instance.NewtonCfg.class_typeselects the integration manager;solver_cfg.class_typeselects aNewtonSolveradapter, an instance that holds its solver configuration and no runtime state (no classmethods or class state). Subclass the manager, overridefinalize_backend()when needed, or passSimulationContext(cfg, physics_manager=my_manager). A manager is configured completely at construction (PhysicsManager.initializeonly attaches the context), and a context adopts a configured manager'sNewtonCfg.SimulationContextitself remains a singleton.init_solver,forward,invalidate_worlds,mark_model_changed,register_step_callback(backend, backend.callbacks.control, fn),prepare,stepandrecord_stepoperate on a supplied backend. Multiple backends can be recorded into one caller-owned graph.MODEL_INIT→ finalize →PHYSICS_READY→ solver construction. Consumers author properties before solver creation. Hard reset rebuilds the backend and rebinds consumers; soft reset retains it.Captured execution and performance
StepGraphorders collision,CONTROL, Newton actuators,POST_ACTUATOR, substep forces/solver work andPOST_STEP/native sensor updates. Native sensors refresh every physics step; actuator telemetry is published on the final physics step. Double-buffered solvers finish each physics step in a stablestate_0.prepare()allocates schedule scratch without stepping.record_step()supports outer capture and rejects unsupported schedules before executing work.capture_graph()coordinates Torch/Warp streams and owns temporary allocation lifetimes; replay usesgraph.launch().captures_model_changes, MuJoCo Warp), CUDA conditional execution skips empty masks, and other solvers are notified on the host without a sync. Property-changing resets in an outer capture usecapture_graph()to retain conditional scratch.env_maskselection through the manager-based environment, scene, assets, actuators, sensors and MDP terms, Warp first: the environment owns one stable Warp mask, MDP terms receive it as aProxyArray(cached.torchview for Torch terms), and the scene, assets, actuators, sensors and Newton backend takewp.arrayonly. Derived masks live in preallocated buffers. Legacyenv_idscallbacks use a compatibility bridge. Episode logs remain on device.capture_step, on by default, manager-based and direct workflows): the step is laid out as operations around the physics step's own (PhysicsManager.step_ops()); graphable runs replay from CUDA graphs and the rest stay eager islands — terms that opt out withsupports_graph_capture = False, operations found to synchronize the device on the first run, non-capturable entity resets (TorchScript LSTM state) and non-graphable Newton actuators. Buffers that terms replace every step are carried into the recorded readers after each replay, host bookkeeping advances as eager stepping would, and term-configuration changes re-record the step. Rendering, recorders, cameras and PhysX step eagerly. Cartpole at 4096 envs: 1.27 → 0.60 ms per step.An indicative shared-GPU probe of 128-environment OSC with standard Torch actuators measured startup 4.49 → 3.51 s and median step 9.53 → 8.93 ms against the previous PR head (
551fd1d). First-step time was 1.76 → 1.81 s. These noisy measurements are not a controlled performance guarantee.API migration
This is a breaking change with package changelog fragments and migration documentation.
sim.physics_manager.NewtonMJWarpManager→MJWarpSolverAdapter. Runtime solver behavior is exposed throughbackend.solver_adapter.register_pre_step_callback,register_control_callback,register_post_actuator_callback,register_state_force_callbackorregister_post_step_callback(each returns a callback forunregister_step_callback); useregister_site()andactivate_actuators().manager.backend(get_model(),get_state_0(), ... are deprecated); use the functional query/capture helpers instead ofNewtonQueries.get_newton_builder(sim)/get_newton_backend(sim)instead ofsim.get_or_create_backend(NewtonBuilderCfg/NewtonBackendCfg(...)).*_manager/*_manager_cfgmodules (or import them from the package).env_maskas aProxyArray(useenv_mask.torchorenv_mask.warp); asset, sensor and scene resets take awp.arraymask.env.stepreturns buffers that the next step overwrites when the step is captured; copy them to keep them, or setcapture_step = False. Terms that branch on host state changing between steps (step counters, lazily built buffers) setsupports_graph_capture = False.supports_graph_captureonly when replay does not depend on changing Python state, dynamic shapes or host synchronization. Delayed/neural implementations with Python history remain eager.Validation
Focused local suites passed, including:
env.stepmakes zero host syncs on Cartpole, Reach-Franka and Rough ANYmal-D. 4096-env MJWarp step: Cartpole 1.27 ms, Reach-Franka 3.59 ms, Rough ANYmal-D 22.61 ms (develop 1.43 / 4.01 / 24.25).8d3086e86..5a1d15154): net change against develop cut from +4,862 to +2,278 lines (tests +1,373 → +880). It drops alias modules, demo tasks, the capture benchmark script, duplicated Markdown docs and overlapping tests. Remaining growth is the captured environment step (EnvStepCapture,StepGraph) and the mask-reset ports. Non-Kit sweep (264 files, each in its own process) matches the previous round apart from the consolidated tests; onetest_two_backends.pycase failed once in the sweep and passed 11 reruns.A later repeat of the injection suite could not initialize CUDA because other workloads exhausted GPU memory; the earlier successful run is reported above. Full PhysX/OVPhysX and optional Kit/rendering runtime validation was unavailable locally. No new GitHub CI run is claimed.
Remaining constraints
Full outer capture requires every scheduled operation and the selected solver to support capture. Derived-state reads recompute during capture, while finite-difference accelerations retain scene-publication cadence. Legacy PhysX mask writers and callbacks requiring index lists can still synchronize. Existing heterogeneous MJWarp restrictions and the strict first-capture MuJoCo-Warp numerical-drift xfail remain.
Type of change
Release backport
developChecklist
uv run isaaclab --formatCONTRIBUTORS.md