Skip to content

[Warp] Part 6/11: Capture Warp stages per term without warm-up and step like the stable environments - #6607

Draft
hujc7 wants to merge 113 commits into
isaac-sim:mainfrom
hujc7:jichuanh/warp-frontend-cleanup
Draft

hujc7 wants to merge 113 commits into
isaac-sim:mainfrom
hujc7:jichuanh/warp-frontend-cleanup

Conversation

@hujc7

@hujc7 hujc7 commented Jul 19, 2026 •

Copy link
Copy Markdown
Collaborator

Review Map

PR Status Depends on Exact changes
#8821 Part 1/11: shared id and mask helpers, mask writers without host sync — —
#8824 Part 2/11: PhysX tendon mask setters through the masks #8821 link
#6646 Part 3/11: mask-correct partial resets #8821 link
#8783 Part 4/11: shared Warp RNG state #6646 link
#8856 Part 5/11: ProxyArray core: stable SceneEntityCfg Warp selections (re-cut not pushed yet) #8821 —
📌 #6607 Part 6/11: per-term capture, capture utilities (rebuild not pushed yet) #8783, #8856 link
Part 7/11: Warp environments step like the stable ones (split from #6607, not opened) — #6607 —
#8228 Part 8/11: Warp commands, Rough tasks, live term changes Part 7 link
Part 9/11: term links, Warp terms into the stable managers (local) — #8228 —
#6582 Part 10/11: Shadow Warp twin, Allegro twin fixes #6607 link
#7012 Part 11/11: --video on the Warp frontend — —
---
config:
  look: neo
  flowchart:
    curve: basis
---
flowchart TD
  P1("<b>#8821</b> · Part 1<br/>id/mask helpers")
  P2("<b>#8824</b> · Part 2<br/>PhysX tendon masks")
  P3("<b>#6646</b> · Part 3<br/>masked resets")
  P4("<b>#8783</b> · Part 4<br/>WarpRng")
  P5("<b>#8856</b> · Part 5<br/>ProxyArray core")
  P6("📌 <b>#6607</b> · Part 6<br/>per-term capture")
  P7("Part 7<br/>stable alignment, not opened")
  P8("<b>#8228</b> · Part 8<br/>commands, Rough")
  P9("Part 9<br/>into stable, local")
  P10("<b>#6582</b> · Part 10<br/>Shadow twin")
  P11("<b>#7012</b> · Part 11<br/>--video, independent")
  P1 --> P2
  P1 --> P3
  P3 --> P4
  P1 --> P5
  P4 --> P6
  P5 --> P6
  P6 --> P7
  P7 --> P8
  P8 --> P9
  P6 --> P10
  style P6 stroke-width:3px
Loading

Summary

Warp environments step like the stable ones (physics-owned decimation, extras["final_obs"], per-step extras["log"] copies) and record their stages from the first call without a warm-up, bitwise equal to eager.
Capture is decided per term, so one term that cannot be recorded no longer forces its whole stage eager: Go2 Flat 7.53 → 6.96 ms per step.

Description

1. Changes

  1. Capture: CapturedStage, @captured and eager() replace WarpGraphCache. A stage records on its first call and records again after a simulation reset, stop or rebind (main: CUDA error 700 after a rebind).
  2. Per-term capture: a @WarpCapturable(False) term runs eagerly at its place inside the recording; WarpCapturable(lambda params: ...) decides per configured instance.
  3. Stepping like stable: managers run in the stable order; manager-based environments reset by mask; DirectRLEnvWarp decides resets on the GPU (no host sync per step).
  4. Stateful event terms are classes with buffers allocated at creation. Fixes main's COM offsets accumulating per call and zero-range wrench events clearing permanent wrenches.
  5. Stable parity fixes: physics owns decimation (main stepped the scene 4x per Go2 step), extras["final_obs"] is stored, extras["log"] returns copies (main returned views, so rsl_rl logged the last reset's value).
  6. Breaking (experimental): ManagerCallSwitch, WarpGraphCache and the step_warp_* hooks are removed; ActionManager.process_action takes a torch tensor; SceneEntityCfg.joint_mask is joint_mask_wp.

2. Evidence (MEASURED)

  • Eager and captured runs are bitwise equal, including a simulation rebind mid-run; on Cartpole and Go2 Flat every manager stage records one graph.
  • Step time, 8gpu L40, 4096 envs, vs [Warp] Part 2a/8: Reset only the masked environments #6646: Go2 Flat 7.53 → 6.96 ms; Cartpole, Cartpole-Direct and Ant within ±2%.
  • Go2 Flat against the stable environment, 200 steps: contact history, air times and physics state bitwise equal, feet_air_time within 3e-8.

3. Follow-ups

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (existing functionality will not work without user modification)

Release backport

  • Backport this pull request to the active release branch after it merges into main

Screenshots

Not applicable.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jul 19, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 20, 2026
@hujc7 hujc7 changed the title Make the Warp frontend mask-first [WARP] Cleanup Part 2: Make the Warp frontend mask-first Jul 21, 2026
@hujc7
hujc7 force-pushed the jichuanh/warp-frontend-cleanup branch from c971364 to f68d03f Compare July 23, 2026 23:19
kellyguo11 added a commit that referenced this pull request Jul 24, 2026
…asks (#5504)

## Review Map

- A stacked PR’s page shows the cumulative diff of its dependency chain;
the "Exact changes" link pins that PR’s own commit range.
- SHA links can go stale after a branch update; the copy on #5504 is
refreshed first.

| PR | Status | Depends on | Exact changes |
|---|---|---|---|
| 📌 #5504 Part 1: frontend bridge (stable ids on the warp runtime) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/5504?label=)
| — | — |
| #6607 Part 2: mask-first frontend (draft) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6607?label=)
| #5504 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6607/changes/00ae695ac63e67ca678b91a837d3737529d2ec91..f68d03f40854b31a36063c5068f2933d32ea5db9)
|
| #6646 Part 3: scene reset mask-native + capture-ready (draft, base
rewritten — pending rebase onto #6607) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6646?label=)
| #6607 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6646/changes/4360622bde446c52c3fc85924639f9d1119d6e95..6d49e32f11e15894a4a0e49161a356ec79679ac6)
|
| #6580 Part 4: OVPhysX backend (draft) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6580?label=)
| #5504 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6580/changes/fc37fa65ad95d1ac6e3f32e721329ef715899d37..716cef20979ca6c578a6e595812291c7b1a282fc)
|
| #6611 Part 5: persistent-launch speedups (draft, absorbs #6551) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6611?label=)
| #6646 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6611/changes/6d49e32f11e15894a4a0e49161a356ec79679ac6..6e3da794215da03745a9bc8d35790e22262b099a)
|

## 1. Summary

- `--frontend {torch,warp}` on the shared RL CLI (train **and play**)
runs **stable** task ids on the warp runtime — no duplicated configs, no
parallel warp task registrations at all (end state pinned by test). The
`rlinf` integration constructs environments inside the external
framework and is not frontend-routable (known limitation).
- **1.24–1.70× faster end-to-end** than torch on the same tasks,
identical Newton physics (§3.1).
- Manager-based: `WarpFrontend` adapts the stable cfg in place; MDP
twins resolve by name on the mirrored experimental package tree —
deterministic, registration-free, missing twins reported in one
aggregated failure.
- Direct: the stable registration declares its warp class via
`warp_entry_point`; only the env class swaps, the cfg is shared.
- Stable observation-noise cfgs (constant/uniform/gaussian) swap to
warp-native twins during adaptation; cfgs without a twin (class-based
noise models, customized funcs, tensor-valued params) are a hard error
instead of silently dropping noise. The warp observation manager rejects
non-warp noise cfgs and plumbs the shared per-env RNG state.
- Plus: warp adapters for the material/mass randomization startup
events; `isaaclab_tasks_experimental` mirrors the stable `core/<task>`
layout; `Metrics/success_rate` restored under warp.

## 2. Migration map

| Retired | Replacement |
|---|---|
| `Isaac-{Cartpole,Humanoid,Ant}-Warp-v0`, `Isaac-Reach-Franka-Warp-v0`
(+`-Play`) | stable id + `--frontend warp presets=newton_mjwarp` |
| `Isaac-Velocity-Flat-<Robot>-Warp-v0` (+`-Play`), all robots | stable
id + `--frontend warp presets=newton_mjwarp` |
| `Isaac-{Cartpole,Ant,Humanoid}-Direct-Warp-v0`,
`Isaac-Reorient-Cube-Allegro-Direct-Warp-v0` | stable id + `--frontend
warp presets=newton_mjwarp` (via `warp_entry_point`) |

## 3. Test plan

- [x] Merged current `develop`; `./isaaclab.sh -f` clean on all files.
- [x] Re-merged develop (task-id catalog update #6606, entrypoints
refactor); environments catalog regenerated; conversion sweep + warp
smokes (`Isaac-Velocity-Flat-UnitreeGo2`, `Isaac-Cartpole-Direct`)
re-run green; pre-commit clean on all files.
- [x] 142 focused tests: frontend units, cfg-conversion sweep over every
covered stable id, no-warp-registrations end-state pin, shared-CLI
tests.
- [x] 5-iteration RSL-RL trainings exit clean (`Training time:` present,
no traceback): `Isaac-Cartpole` (torch); `Isaac-Cartpole`,
`Isaac-Humanoid`, `Isaac-Cartpole-Direct`, `Isaac-Ant-Direct`,
`Isaac-Velocity-Flat-AnymalD`, `Isaac-Velocity-Flat-H1` (warp;
randomization events active); `Isaac-Reorient-Cube-Allegro-Direct`
(warp). `Metrics/success_rate` reported under warp.

### 3.1 Frontend A/B benchmark

Same stable task id and cfg on both sides, `presets=newton_mjwarp` on
**both** (identical Newton physics — only `--frontend` differs); rsl_rl,
4096 envs, 300 iterations, headless, one L40 per run, single run per
cell. Metric: rsl_rl `Training time:` — learn-loop wall-clock (env
stepping + PPO update; warp includes its one-time CUDA-graph capture).
PPO-update cost is common to both, so the env-pipeline gain exceeds the
end-to-end ratio.

| Task | torch | warp | end-to-end | final reward (torch / warp) |
|---|---|---|---|---|
| `Isaac-Cartpole` | 58.2 s | 39.7 s | 1.46× | 4.95 / 4.95 |
| `Isaac-Humanoid` | 162.0 s | 110.5 s | 1.47× | 149.1 / 179.8 |
| `Isaac-Ant` | 109.8 s | 64.5 s | 1.70× | 82.1 / 77.1 |
| `Isaac-Velocity-Flat-AnymalD` | 162.4 s | 130.7 s | 1.24× | 20.3 /
21.4 |

## 4. Out of scope / follow-ups

- No video-recorder plumbing on warp envs; rough terrain blocked on Warp
`TerrainImporter` APIs; no twins for IK/OSC actions, `height_scan`, or
Digit/Spot-specific terms.
- OVPhysX support for the warp frontend prepared as a follow-up PR
(physics gate widening + backend data-parity test).
- Candidate refactor: fold the ~300 lines of converged plumbing shared
by `DirectRLEnvWarp` and stable `DirectRLEnv` into a common base.

---------

Co-authored-by: Kelly Guo <kellyguo123@hotmail.com>
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
…asks (isaac-sim#5504)

## Review Map

- A stacked PR’s page shows the cumulative diff of its dependency chain;
the "Exact changes" link pins that PR’s own commit range.
- SHA links can go stale after a branch update; the copy on isaac-sim#5504 is
refreshed first.

| PR | Status | Depends on | Exact changes |
|---|---|---|---|
| 📌 isaac-sim#5504 Part 1: frontend bridge (stable ids on the warp runtime) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/5504?label=)
| — | — |
| isaac-sim#6607 Part 2: mask-first frontend (draft) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6607?label=)
| isaac-sim#5504 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6607/changes/00ae695ac63e67ca678b91a837d3737529d2ec91..f68d03f40854b31a36063c5068f2933d32ea5db9)
|
| isaac-sim#6646 Part 3: scene reset mask-native + capture-ready (draft, base
rewritten — pending rebase onto isaac-sim#6607) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6646?label=)
| isaac-sim#6607 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6646/changes/4360622bde446c52c3fc85924639f9d1119d6e95..6d49e32f11e15894a4a0e49161a356ec79679ac6)
|
| isaac-sim#6580 Part 4: OVPhysX backend (draft) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6580?label=)
| isaac-sim#5504 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6580/changes/fc37fa65ad95d1ac6e3f32e721329ef715899d37..716cef20979ca6c578a6e595812291c7b1a282fc)
|
| isaac-sim#6611 Part 5: persistent-launch speedups (draft, absorbs isaac-sim#6551) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6611?label=)
| isaac-sim#6646 |
[link](https://github.com/isaac-sim/IsaacLab/pull/6611/changes/6d49e32f11e15894a4a0e49161a356ec79679ac6..6e3da794215da03745a9bc8d35790e22262b099a)
|

## 1. Summary

- `--frontend {torch,warp}` on the shared RL CLI (train **and play**)
runs **stable** task ids on the warp runtime — no duplicated configs, no
parallel warp task registrations at all (end state pinned by test). The
`rlinf` integration constructs environments inside the external
framework and is not frontend-routable (known limitation).
- **1.24–1.70× faster end-to-end** than torch on the same tasks,
identical Newton physics (§3.1).
- Manager-based: `WarpFrontend` adapts the stable cfg in place; MDP
twins resolve by name on the mirrored experimental package tree —
deterministic, registration-free, missing twins reported in one
aggregated failure.
- Direct: the stable registration declares its warp class via
`warp_entry_point`; only the env class swaps, the cfg is shared.
- Stable observation-noise cfgs (constant/uniform/gaussian) swap to
warp-native twins during adaptation; cfgs without a twin (class-based
noise models, customized funcs, tensor-valued params) are a hard error
instead of silently dropping noise. The warp observation manager rejects
non-warp noise cfgs and plumbs the shared per-env RNG state.
- Plus: warp adapters for the material/mass randomization startup
events; `isaaclab_tasks_experimental` mirrors the stable `core/<task>`
layout; `Metrics/success_rate` restored under warp.

## 2. Migration map

| Retired | Replacement |
|---|---|
| `Isaac-{Cartpole,Humanoid,Ant}-Warp-v0`, `Isaac-Reach-Franka-Warp-v0`
(+`-Play`) | stable id + `--frontend warp presets=newton_mjwarp` |
| `Isaac-Velocity-Flat-<Robot>-Warp-v0` (+`-Play`), all robots | stable
id + `--frontend warp presets=newton_mjwarp` |
| `Isaac-{Cartpole,Ant,Humanoid}-Direct-Warp-v0`,
`Isaac-Reorient-Cube-Allegro-Direct-Warp-v0` | stable id + `--frontend
warp presets=newton_mjwarp` (via `warp_entry_point`) |

## 3. Test plan

- [x] Merged current `develop`; `./isaaclab.sh -f` clean on all files.
- [x] Re-merged develop (task-id catalog update isaac-sim#6606, entrypoints
refactor); environments catalog regenerated; conversion sweep + warp
smokes (`Isaac-Velocity-Flat-UnitreeGo2`, `Isaac-Cartpole-Direct`)
re-run green; pre-commit clean on all files.
- [x] 142 focused tests: frontend units, cfg-conversion sweep over every
covered stable id, no-warp-registrations end-state pin, shared-CLI
tests.
- [x] 5-iteration RSL-RL trainings exit clean (`Training time:` present,
no traceback): `Isaac-Cartpole` (torch); `Isaac-Cartpole`,
`Isaac-Humanoid`, `Isaac-Cartpole-Direct`, `Isaac-Ant-Direct`,
`Isaac-Velocity-Flat-AnymalD`, `Isaac-Velocity-Flat-H1` (warp;
randomization events active); `Isaac-Reorient-Cube-Allegro-Direct`
(warp). `Metrics/success_rate` reported under warp.

### 3.1 Frontend A/B benchmark

Same stable task id and cfg on both sides, `presets=newton_mjwarp` on
**both** (identical Newton physics — only `--frontend` differs); rsl_rl,
4096 envs, 300 iterations, headless, one L40 per run, single run per
cell. Metric: rsl_rl `Training time:` — learn-loop wall-clock (env
stepping + PPO update; warp includes its one-time CUDA-graph capture).
PPO-update cost is common to both, so the env-pipeline gain exceeds the
end-to-end ratio.

| Task | torch | warp | end-to-end | final reward (torch / warp) |
|---|---|---|---|---|
| `Isaac-Cartpole` | 58.2 s | 39.7 s | 1.46× | 4.95 / 4.95 |
| `Isaac-Humanoid` | 162.0 s | 110.5 s | 1.47× | 149.1 / 179.8 |
| `Isaac-Ant` | 109.8 s | 64.5 s | 1.70× | 82.1 / 77.1 |
| `Isaac-Velocity-Flat-AnymalD` | 162.4 s | 130.7 s | 1.24× | 20.3 /
21.4 |

## 4. Out of scope / follow-ups

- No video-recorder plumbing on warp envs; rough terrain blocked on Warp
`TerrainImporter` APIs; no twins for IK/OSC actions, `height_scan`, or
Digit/Spot-specific terms.
- OVPhysX support for the warp frontend prepared as a follow-up PR
(physics gate widening + backend data-parity test).
- Candidate refactor: fold the ~300 lines of converged plumbing shared
by `DirectRLEnvWarp` and stable `DirectRLEnv` into a common base.

---------

Co-authored-by: Kelly Guo <kellyguo123@hotmail.com>
A mask-only Articulation.reset called ActuatorCollection.reset(None), which
cleared delay buffers, network history, and Newton-native actuator state for
every environment. Newton rigid objects and collections dropped the mask
before resetting their wrench composers, clearing every environment's
persistent wrench.

ActuatorCollection.reset now takes env_mask. Isaac Lab actuator models still
reset by index, so the collection converts the mask to indices once for all
groups, and skips the conversion when no group carries reset state. Native
actuator state resets from the mask through a new
ActuatorControl.reset_native_actuators_mask hook; Newton and OVPhysX pass the
mask to the Newton actuator adapter, and the base default converts to indices
so backends that only implement the index hook stay correct.
InteractiveSceneWarp.reset passed env_ids=None to deformable objects, surface
grippers, and sensors on a masked reset, so every environment's sensor state
was cleared on each partial reset, and it never reset cable objects.

Forward the mask to every entity family in the stable scene's order. Surface
grippers use their reset_mask method. Cable objects take env_mask like the
other scene assets, so the scene does not convert the mask for a reset that
holds no state.
RigidObjectCollection.write_body_*_to_sim_mask converted masks to indices
with torch.nonzero before delegating to the index writers, so the mask
writers synchronized the host and could not be captured in a CUDA graph,
although their docstrings name them as the graph-capable path. They now
launch masked kernels over the full environment-body grid, and body_ids
selections resolve to a mask through a preallocated scratch buffer.

BaseRayCaster.reset compacted a mask with nonzero before resampling drift.
A masked reset now resamples every environment and keeps the new values
where the mask is set; index and slice selections are unchanged.
isaac-sim#8079 added ObservationGroupCfg.history_order and taught the stable
observation manager to skip it as a group setting. The Warp manager's skip
list was not updated, so it parsed the field as a term and raised a
TypeError for every observation group, and no manager-based Warp
environment could be constructed.

Skip history_order like the other group settings. The Warp manager raises
NotImplementedError for any term with history, and history_order only
takes effect with history, so a time-ordered group cannot be silently
reordered wrong.
The fixed-tendon set_*_mask methods and
write_fixed_tendon_properties_to_sim_mask converted masks to indices with
torch.nonzero and delegated to the index writers, so they synchronized the
host and could not be captured in a CUDA graph.

Write the masked cells in-kernel instead: scalar and full data go into the
staging buffers through masked kernels, and the property writer copies the
masked cells of each staging buffer into its simulation binding. The mask
compaction helpers have no remaining callers and are removed.
A masked Articulation.reset on the Newton-native actuator path allocated a
per-DOF mask for every actuator on each call, and a masked ray-caster
reset sampled drift with torch ops and uploaded its ranges, so neither
could run inside a CUDA graph captured on Warp's stream.

NewtonActuatorAdapter preallocates its per-DOF reset masks. BaseRayCaster
resamples masked drift in a Warp kernel from per-environment random states
seeded from torch's global generator at initialization, with the ranges
passed as launch arguments; index and slice resets keep the torch path.
The Newton fixed-tendon position-target setters raised a host-side dirty
flag, and write_data_to_sim scattered the buffered targets into MuJoCo's
controls only while it was set. A setter recorded in a CUDA graph raised
the flag once, at capture time, so later replays updated the target buffer
on the device but never reached the solver.

Write the buffered targets on every step whenever the articulation has
tendon actuators, and drop the flag from the Newton setters. The write
costs about 60 us per call on Shadow Hand; gating it on a device-side flag
would need Newton's control-array mapping re-implemented in a kernel.
Replace ManagerCallSwitch with an environment-owned WarpGraphCache that
follows the Newton core capture model: a stage is recorded through
NewtonQueries.capture_graph with no eager warm-up, so the first
execution is the launch of the new graph; recording starts at the first
step; graphs are keyed by the pointers and scalar values of the stage
arguments; and every graph is dropped when the physics backend rebinds
its buffers or stops, so the next step records against the new buffers.

Managers with a non-capturable term keep their stages eager through
register_capturability. ISAACLAB_WARP_CAPTURE=0 runs every stage
eagerly and ISAACLAB_SYNC_DEBUG=1 traps hidden host synchronizations in
eager stages. The direct environment uses the same cache in place of
capture_or_replay.
The manager-based Warp environments now reset through one mask-first
pipeline: every reset selection is copied into an environment-owned mask
that the recorded reset stages read, the scene and the Warp managers
reset from that mask, and the episode-length buffer is cleared by a
masked kernel. The mask is compacted to environment indices once per
reset, and only when a stable command, curriculum or recorder manager has
active terms. ManagerBasedEnvWarp.reset accepts env_mask.

Each step makes one host check to decide whether any environment
terminated: the index compaction when a manager needs indices, otherwise
reset_buf.any(). DirectRLEnvWarp moves its reset out of the end-of-step
graph into its own stage behind the same predicate.

A static gate pins the sanctioned host synchronizations of the mask-first
path, which also removes the device read from CircularBuffer.max_length.
The Episode_Termination metric keeps averaging over every environment,
as the stable manager does.
push_by_setting_velocity, apply_external_force_torque,
reset_root_state_uniform and randomize_rigid_body_com kept scratch
arrays and parsed ranges as attributes of the module-level function. The
first call allocated them, which inside a recorded stage becomes
graph-owned memory; the parsed ranges froze the first configuration; and
the state was shared by every environment in the process.

They are now ManagerTermBase classes that allocate in __init__ and read
their ranges on every call. randomize_rigid_body_com offsets the center of
mass it finds on its first call instead of accumulating, and
apply_external_force_torque with zero ranges leaves the permanent wrench
composer untouched.

The material and mass adapters reject modes other than startup and are
marked non-capturable. Startup terms no longer keep the event stages
eager, since they never run inside one, and set_term_cfg re-resolves the
term and drops the recorded event stages.
A manager with one non-capturable term used to run every stage eagerly.
Managers now describe each stage as ordered steps, one per term plus
their own setup and finalize kernels, and WarpGraphCache.call_steps
records each run of consecutive capturable steps into one graph while
the terms marked @WarpCapturable(False) run eagerly in place.

Reward and termination terms write their own output columns and the
finalize kernel combines the columns in a fixed order, so these stages
evaluate the capturable terms first and need at most one eager group.
Observation noise and events draw from the shared per-environment random
state, and action terms are applied in order, so those stages keep the
configured term order and split into contiguous runs.

Observation terms with history run as eager steps instead of raising
inside capture. Replacing a reward term rebuilds its steps and drops the
recorded reward stages.
A term can be capture-safe for one configuration and not another: a
reward that reads a ray-caster refreshes the sensor on the host and
launches its query graph, which cannot run inside a recorded stage,
while the same reward without a sensor can.

WarpCapturable accepts a predicate over the term's parameters, and its
guard raises only for the parameters the predicate rejects. The Warp
managers resolve capturability with each term's parameters, and a class
term may set _warp_capturable in __init__ to decide per instance. The
sync gate's opt-out inventory also lists predicate annotations.
Stable environments tell the physics backend their decimation and, when the
backend runs the whole decimation loop, apply actions, step the simulation and
update the scene once per environment step. The Warp environments still looped
once per physics step, so contact sensors sampled four times as often on Go2
and the contact history, air times and the rewards and terminations reading
them differed from the stable environment with the same configuration.

Mirror the stable loop in the manager-based and direct Warp environments. The
per-physics-step loop remains for backends that do not run the decimation loop.
The stable environments honor compute_final_obs: a step that resets
environments stores the observations from before the reset in
extras["final_obs"] and declares Same-Step autoreset in the metadata. The
Warp environments ignored the flag, so torchrl, which sets it, bootstrapped
time-outs from the post-reset observation.

Compute the observations before the reset stage and keep a copy, because the
reset overwrites the persistent observation buffers. Declare Same-Step
autoreset in both Warp environment classes.
Warp managers and tasks log persistent buffers that later steps overwrite.
Loggers such as the rsl_rl logger keep extras["log"] of every step and average
it at the end of an iteration, so every entry showed the latest value. The
stable environments log fresh tensors.

The manager-based environment copies the tensor values when it builds the
reset log. The direct environment keeps the log the task writes and returns a
copy of it from every step, so task code that is recorded into a CUDA graph
keeps refreshing its own buffers.
ManagerBasedEnvWarp built its reset log from the same persistent manager
buffers as the RL environment, so a logged value changed with the next reset.
Copy the tensor values like the RL environment does.
hujc7 added 20 commits October 28, 2026 16:09
Main moved resolve_1d_mask into isaaclab.utils.warp.memory (isaac-sim#8843).
resolve_ids and write_2d_with_mask move next to it, and
write_2d_with_mask launches the memory module's masked copy and fill
kernels instead of its own. resolve_1d_mask keeps the optional scratch
mask; masks given without one are returned as given. The SensorBase,
sensor test stub and experimental re-export changes are now main's.
…ne-mask-native

The Newton actuator adapter imports resolve_1d_mask from isaaclab.utils.warp.memory, where main moved it, without the dropped device argument.
…chuanh/warp-rng-shared

The core Warp kernels keep the RNG state initializer; the masked writers moved to isaaclab.utils.warp.memory. The Warp reorient twin imports quat_error_magnitude from the shared Warp math next to WarpRng.
…warp-frontend-cleanup

The manager-based Warp environment imports resolve_1d_mask from isaaclab.utils.warp.memory, where main moved it.
Ids resolve on the device of all_ids and keep their dtype; callers that need
contiguous int32 ids pass them through memory.resolve_1d_indices, as main's
indexed writers do. write_2d_with_mask launches on the device of its output.
The deformable mask tests check the backend writes.
# Conflicts:
#	source/isaaclab/test/assets/contract/test_articulation_contract.py
…p-rng-shared

# Conflicts:
#	source/isaaclab/isaaclab/utils/warp/kernels.py
@hujc7 hujc7 changed the title [Warp] Part 5/12: Capture Warp stages per term without warm-up and step like the stable environments [Warp] Part 6/11: Capture Warp stages per term without warm-up and step like the stable environments Nov 2, 2026
@AntoineRichard

Copy link
Copy Markdown
Collaborator

Hi @hujc7 👋 This draft PR has been open for more than two months. Is it still being worked on, or should it be closed (it can always be reopened later)? If it is still active, feel free to ignore this and thanks for keeping it going!

hujc7 added a commit that referenced this pull request Nov 13, 2026
…rs (#8821)

## Review Map

- A number is one feature and its letters are that feature's PRs, in
merge order; an arrow points from a PR to the PRs that build on it.
- A stacked PR's page shows the cumulative diff of its dependency chain;
the "Exact changes" link opens that PR's Files changed page on its own
changes (parent head to PR head). #6646's head merges `main` for one
conflict, so its link also shows `main`'s #8928.
- #8783 and #6607 are no longer part of the series.

| PR | Status | Depends on | Exact changes |
|---|---|---|---|
| 📌 #8821 Part 1a/8: shared id and mask helpers, mask writers without
host sync |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8821?label=)
| — | — |
| #8824 Part 1b/8: PhysX tendon mask setters through the masks |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8824?label=)
| 1a |
[link](https://github.com/isaac-sim/IsaacLab/pull/8824/changes/84470f4c0c5dfe1905dd1b5d822f6faf50832d4d..2fbbcc5a98a91f34c129f1ce65b227201ec50f60)
|
| #6646 Part 2a/8: reset only the masked environments |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6646?label=)
| 1a |
[link](https://github.com/isaac-sim/IsaacLab/pull/6646/changes/84470f4c0c5dfe1905dd1b5d822f6faf50832d4d..41ed0c0775175ad2f76db6bb9c31202d80e1519b)
|
| #8997 Part 2b/8: actuator networks reset by mask |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8997?label=)
| 2a |
[link](https://github.com/isaac-sim/IsaacLab/pull/8997/changes/41ed0c0775175ad2f76db6bb9c31202d80e1519b..cb14223b1d957f7fd8ac232ea50605618ce53de3)
|
| #8856 Part 3a/8: env origins as a ProxyArray, `SceneEntityCfg` Warp
selections |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8856?label=)
| 2a |
[link](https://github.com/isaac-sim/IsaacLab/pull/8856/changes/41ed0c0775175ad2f76db6bb9c31202d80e1519b..f8944ad680d2bb4b09b13d2adb4b740eafe7b363)
|
| #8228 Part 3b/8: ray caster camera frames as a ProxyArray, Rough
velocity tasks (re-cut not pushed yet) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8228?label=)
| 3a | — |
| #8998 Part 4a/8: recording utilities, lazy buffers correct under
recording |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8998?label=)
| 2b, 3a |
[link](https://github.com/isaac-sim/IsaacLab/pull/8998/changes/9d74ad2de08a152312833dbe3ad9260b02f683b0..0e2a77d842051fb3946feb988f2e14d010aac3fb)
|
| Parts 4b-4h/8: the Warp frontend on the stable managers (not opened) |
— | 4a | — |
| Part 5/8: OVPhysX on the Warp frontend (not opened) | — | 4h | — |
| Part 6/8: Warp noise model with an additive bias (not opened) | — | 4h
| — |
| #7012 Part 7/8: `--video` on the Warp frontend (re-cut not pushed yet)
|
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/7012?label=)
| 4h | — |
| Part 8a/8: Direct Warp environment step (not opened) | — | 5, 7 | — |
| #6582 Part 8b/8: Shadow Hand Warp twin, Allegro twin fix (re-cut not
pushed yet) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6582?label=)
| 8a | — |
| #8861 [DO-NOT-MERGE] all parts combined for review |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8861?label=)
| ALL | — |

```mermaid
---
config:
  look: neo
  flowchart:
    curve: basis
---
flowchart TD
  A1("📌 <b>#8821</b> · 1a<br/>id/mask helpers")
  B1("<b>#8824</b> · 1b<br/>PhysX tendon masks")
  A2("<b>#6646</b> · 2a<br/>masked resets")
  B2("<b>#8997</b> · 2b<br/>actuator net reset")
  A3("<b>#8856</b> · 3a<br/>env origins, Warp selections")
  B3("<b>#8228</b> · 3b<br/>Rough velocity")
  A4("<b>#8998</b> · 4a<br/>recording utilities")
  P4("4b-4h<br/>Warp frontend on the stable managers")
  P5("5<br/>OVPhysX")
  P6("6<br/>noise model")
  P7("<b>#7012</b> · 7<br/>--video")
  A8("8a<br/>Direct env step")
  B8("<b>#6582</b> · 8b<br/>Shadow twin")
  A1 --> B1
  A1 --> A2
  A2 --> B2
  A2 --> A3
  A3 --> B3
  B2 --> A4
  A3 --> A4
  A4 --> P4
  P4 --> P5
  P4 --> P6
  P4 --> P7
  P5 --> A8
  P7 --> A8
  A8 --> B8
  style A1 stroke-width:3px
```

## Summary

Id and mask selections in the Newton, OVPhysX and PhysX assets, the
camera and the wrench composer resolve through main's `resolve_1d_mask`
and a new `resolve_ids`, both in `isaaclab.utils.warp.memory`, instead
of hand-written copies (−907 / +410 source lines). Newton mask writers
that converted masks to ids now write through the mask: the fixed-tendon
setters are 2.7-5.4x faster.

# Description

**Update (2026-11-12):** a Newton model-property write recorded into a
graph capture now refreshes the solver on every replay, not only the
first (`NewtonManager.add_model_change` records the refresh inside a
capture); merged main `616f517707d`.

**Update (2026-11-10):** a mask longer than its destination raises
instead of being written past the end (the Newton fixed-tendon writer
launches over the mask), and the PhysX and rigid-object selection
docstrings say ids come first, as `resolve_ids` does. The
`all_ids=slice(None)` form of `resolve_ids` leaves this PR for the part
that first uses it.

## 1. Changes

1. **Helpers** (`isaaclab/utils/warp/memory.py`, next to main's
`resolve_1d_mask`): new `resolve_ids` (ids or a boolean mask → ids on
the device of the caller's all-ids array; callers that need contiguous
int32 ids pass the result through main's `resolve_1d_indices`, as main's
indexed writers do). `resolve_1d_mask` takes `scratch_mask` as optional
again: a mask passed without one is used as given when it is not longer
than the destination, so a shorter mask writes only the rows it covers,
as main's Newton mask writers do; a longer mask raises with or without a
scratch mask. New `write_2d_with_mask` writes a scalar or a 2-D array
into a buffer where an env mask and an item mask are both true,
launching main's masked copy and fill kernels over the mask lengths on
the output's device (torch vector data with strided components goes
through scalar views, without a copy); the Newton articulation and
collection mask writers use it.
2. **All assets, `Camera` and `WrenchComposer` use them**, so every
selection accepts the same inputs: integer sequences, negative-step
slices, ids on another device. A `ProxyArray` raises `TypeError`.
3. **Newton writes without a host sync:** the fixed-tendon mask setters
write through the masks; joint-coordinate writes reuse a scratch mask.
The `RigidObjectCollection` mask writers (main's, since #8870) launch
over the mask lengths like the other Newton mask writers, so a mask
shorter than the asset dimension writes only the rows it covers.
4. **Fixes:** the deformable `write_nodal_*_to_sim_mask` writers raised
whenever `env_mask` was given (OVPhysX, PhysX); the Newton fixed-tendon
mask setters accepted data of the wrong shape; a Newton model-property
write recorded into a graph capture (such as the fixed-tendon mask
writer, now capturable) left the solver on the first replay's values,
because `NewtonManager.add_model_change` only queued the refresh on the
host.

## 2. Performance (MEASURED)

8gpu L40, Newton contract mocks, 4096 envs, host µs per call including
the GPU wait, main `299af193136` against this PR
at `b75b5a81585` (same source as the head but for main's #8971), 3
alternated runs per arm.

| Write | main | this PR | |
|---|---|---|---|
| Fixed-tendon stiffness mask, half envs, 2 tendons | 455 | 84 | 5.4x |
| Fixed-tendon position limit mask, all | 216 | 80 | 2.7x |
| Fixed-tendon position limit mask, half envs, 2 tendons | 393 | 84 |
4.7x |
| `write_fixed_tendon_properties_to_sim_mask`, all | 373 | 124 | 3.0x |
| `write_fixed_tendon_properties_to_sim_mask`, half envs, 2 tendons |
573 | 127 | 4.5x |
| Joint position index write, half envs | 290 | 249 | 1.17x |
| Joint state index write, half envs | 321 | 281 | 1.14x |
| Joint position mask write; collection pose and velocity mask writes |
| | within ±1% |

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

## Screenshots

Not applicable.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [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/HEAD/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
hujc7 added a commit that referenced this pull request Nov 15, 2026
…ks (#8824)

## Review Map

- A number is one feature and its letters are that feature's PRs, in
merge order; an arrow points from a PR to the PRs that build on it.
- A stacked PR's page shows the cumulative diff of its dependency chain;
the "Exact changes" link opens that PR's Files changed page on its own
changes (parent head to PR head).
- #8783 and #6607 are no longer part of the series.

| PR | Status | Depends on | Exact changes |
|---|---|---|---|
| #8821 Part 1a/8: shared id and mask helpers, mask writers without host
sync |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8821?label=)
| — | — |
| 📌 #8824 Part 1b/8: PhysX tendon mask setters through the masks |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8824?label=)
| 1a | — |
| #8997 Part 2b/8: actuator networks reset by mask |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8997?label=)
| 1a | — |
| #8856 Part 3a/8: env origins as a ProxyArray, `SceneEntityCfg` Warp
selections |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8856?label=)
| 2b |
[link](https://github.com/isaac-sim/IsaacLab/pull/8856/changes/1a3ef00daac107596034140a6a36633fec2a5f65..401b0191f04f6480c1ed03deffdd966f9f469009)
|
| #8228 Part 3b/8: ray caster camera frames as a ProxyArray, Rough
velocity tasks (re-cut not pushed yet) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8228?label=)
| 3a | — |
| #8998 Part 4a/8: recording utilities, lazy buffers correct under
recording |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8998?label=)
| 3a |
[link](https://github.com/isaac-sim/IsaacLab/pull/8998/changes/9d74ad2de08a152312833dbe3ad9260b02f683b0..0e2a77d842051fb3946feb988f2e14d010aac3fb)
|
| Parts 4b-4h/8: the Warp frontend on the stable managers (not opened) |
— | 4a | — |
| Part 5/8: OVPhysX on the Warp frontend (not opened) | — | 4h | — |
| Part 6/8: Warp noise model with an additive bias (not opened) | — | 4h
| — |
| #7012 Part 7/8: `--video` on the Warp frontend (re-cut not pushed yet)
|
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/7012?label=)
| 4h | — |
| Part 8a/8: Direct Warp environment step (not opened) | — | 5, 7 | — |
| #6582 Part 8b/8: Shadow Hand Warp twin, Allegro twin fix (re-cut not
pushed yet) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6582?label=)
| 8a | — |
| #8861 [DO-NOT-MERGE] all parts combined for review |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8861?label=)
| ALL | — |

```mermaid
---
config:
  look: neo
  flowchart:
    curve: basis
---
flowchart TD
  A1("<b>#8821</b> · 1a<br/>id/mask helpers")
  B1("📌 <b>#8824</b> · 1b<br/>PhysX tendon masks")
  B2("<b>#8997</b> · 2b<br/>actuator net reset")
  A3("<b>#8856</b> · 3a<br/>env origins, Warp selections")
  B3("<b>#8228</b> · 3b<br/>Rough velocity")
  A4("<b>#8998</b> · 4a<br/>recording utilities")
  P4("4b-4h<br/>Warp frontend on the stable managers")
  P5("5<br/>OVPhysX")
  P6("6<br/>noise model")
  P7("<b>#7012</b> · 7<br/>--video")
  A8("8a<br/>Direct env step")
  B8("<b>#6582</b> · 8b<br/>Shadow twin")
  A1 --> B1
  A1 --> B2
  B2 --> A3
  A3 --> B3
  A3 --> A4
  A4 --> P4
  P4 --> P5
  P4 --> P6
  P4 --> P7
  P5 --> A8
  P7 --> A8
  A8 --> B8
  style B1 stroke-width:3px
```

## Summary

The 11 PhysX tendon `set_*_mask` setters no longer turn their masks into
ids with a GPU→host wait: they fill the tendon buffers through the
masks, 83-91 → 18.5 µs per call (5x) with half the environments
selected.

# Description

The setters only fill Isaac Lab's tendon buffers; the push to PhysX
stays index based in `write_*_tendon_properties_to_sim_*`. Each setter
now resolves its masks, checks the shape and launches a masked kernel,
as the Newton setters do.

- MEASURED (desk RTX PRO 6000, PhysX, 4096 envs, half selected): 5x for
stiffness, damping, limit stiffness, rest length and offset; 4.5x for
position limit and target; unchanged with all environments selected.
- No task calls these setters per step, so task FPS does not change.

## Type of change

- New feature (non-breaking change which adds functionality)

## Screenshots

Not applicable.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [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/HEAD/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

This branch has not been deployed

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

Labels

asset New asset feature or request documentation Improvements or additions to documentation infrastructure isaac-lab Related to Isaac Lab team isaac-mimic Related to Isaac Mimic team isaac-sim Related to Isaac Sim team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants