Skip to content

[Warp] Part 2a/8: Reset only the masked environments - #6646

Closed
hujc7 wants to merge 114 commits into
isaac-sim:mainfrom
hujc7:jichuanh/warp-scene-mask-native
Closed

hujc7 wants to merge 114 commits into
isaac-sim:mainfrom
hujc7:jichuanh/warp-scene-mask-native

Conversation

@hujc7

@hujc7 hujc7 commented Jul 21, 2026 •

Copy link
Copy Markdown
Collaborator

Review Map

PR Status Depends on Exact changes
#8821 Part 1a/8: shared id and mask helpers, mask writers without host sync — —
#8824 Part 1b/8: PhysX tendon mask setters through the masks 1a —
📌 #6646 Part 2a/8: reset only the masked environments 1a link
#8997 Part 2b/8: actuator networks reset by mask 2a link
#8856 Part 3a/8: env origins as a ProxyArray, SceneEntityCfg Warp selections 2a link
#8228 Part 3b/8: ray caster camera frames as a ProxyArray, Rough velocity tasks (re-cut not pushed yet) 3a —
#8998 Part 4a/8: recording utilities, lazy buffers correct under recording 2b, 3a link
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) 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) 8a —
#8861 [DO-NOT-MERGE] all parts combined for review ALL —
---
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 A2 stroke-width:3px
Loading

Summary

Masked resets on Newton, OvPhysX and PhysX reset only the selected environments' actuator, wrench, sensor and deformable state (main resets every environment's), and no longer synchronize with the host, so the Warp frontend can record them in CUDA graphs.
InteractiveScene.reset takes the mask too, so the Warp environments use the stable scene.

Description

Update (2026-10-26): InteractiveScene.reset(env_mask=...) forwards the mask to every asset and sensor; InteractiveSceneWarp is removed. #8821 now owns the mask writers this PR used to change.

Update (2026-11-02): every asset, sensor and actuator reset now takes env_mask, so the scene and ActuatorCollection pass env_ids= and env_mask= by name instead of adding env_mask only when one is given. Surface grippers, DelayBuffer, contrib thrusters and Multirotor accept the mask; SurfaceGripper.reset(indices=...) is deprecated in favor of env_ids, the name every other reset uses. Actuator models take the same Warp env_mask as the native actuators; the models that index torch convert it once.

Update (2026-11-09): ActuatorCollection.reset passes env_ids and env_mask to each actuator as given, and each actuator uses the form it takes, without a conversion in the collection.

Update (2026-11-10): ActuatorCollection.reset passes env_mask to an actuator model only when a mask is given, so a custom model with main's reset(self, env_ids) keeps working. A mask-only Multirotor.reset resets only the masked thrusters again (the 11-09 change had made the thruster collection reset all of them). Creating a ray caster no longer draws from torch's random generator; its drift state is seeded on the first reset that samples drift. Tendon limit units read [m or rad, depending on the spanned joints' type].

Update (2026-11-13): carries the replay-refresh fix of #8821 (9ae2df0fd94, cherry-picked from e6e178c746b): NewtonManager.add_model_change records the solver refresh of a model-property write that is recorded into a graph, so every replay reaches the solver. The branch still conflicts with main (#8926).

1. Fixes on main

  1. Articulation.reset(env_mask=...) (Newton, OvPhysX, PhysX) reset the actuator state of every environment.
  2. Newton and PhysX RigidObject / RigidObjectCollection resets ignored env_mask and cleared every environment's external wrenches.
  3. InteractiveSceneWarp.reset(env_mask) reset deformables, surface grippers and sensors in every environment and skipped cable objects.
  4. A contrib Multirotor reset with only env_mask reset every environment's thrusters.

2. Capture readiness

Actuator models, DelayBuffer and backend-native actuators reset from the mask without converting it to indices; masked ray-caster drift is resampled in a Warp kernel.

3. Breaking changes

  1. isaaclab_experimental.envs.InteractiveSceneWarp is removed; use isaaclab.scene.InteractiveScene.
  2. InteractiveScene.reset passes env_mask to the reset of every asset and sensor, also when it is None; custom assets and sensors must accept it, as AssetBase.reset and SensorBase.reset do.

Deprecated: the indices argument of SurfaceGripper.reset; pass env_ids.

Not breaking: ActuatorBase.reset takes an optional env_mask (a boolean wp.array); the collection passes it only when a mask is given, so models with main's reset(self, env_ids) are unaffected.

4. Evidence (MEASURED, desk RTX PRO 6000)

  • At ddb48256383 (8gpu L40, Newton MJWarp and Kit, isaac-lab:latest-main): actuator collection 23 (a one-argument custom actuator resets through the collection), multirotor 7, thruster 7, Newton ray caster 10, ray caster sensor 4, camera 10, multi-mesh camera 7, integration 10, PhysX ray-caster graph 5, OvPhysX ray caster 2, Newton-native actuators on Newton 39 and on PhysX 15, articulation Newton 44, PhysX 17, OvPhysX 48 tests pass.

  • At 93daa9b9bf6: Newton native-actuator (40), articulation (39) and Warp frontend (29) tests pass; InteractiveScene.reset mask forwarding is a stub-scene unit test (test_interactive_scene.py); Warp Cartpole, Flat-Go2, Cartpole-Direct and torch Cartpole run with the stable scene (4096 envs, 150 steps with resets).

  • At 0afc2e95099 (desk GPU0, isaac-lab:latest-main image): scene 9, multirotor 7, thruster 7, surface gripper 4, PhysX rigid object 10 (+2 xfail), actuator collection 30, delay buffer 13 and Newton articulation 41 tests pass. The scene test checks every entity group, cable objects included, receives env_ids and env_mask; the gripper test checks a masked reset, and the deprecated indices alias, open the same grippers as an index reset.

  • At 48b14a74e79 (desk GPU0): actuator and delay buffer 102 and Newton articulation 41 tests pass. At 1d770e66bf7: scene and visual material 10 tests pass (isaac-lab:latest-main of 2026-11-02). A masked ActuatorCollection.reset (4096 envs, 12 joints, eager) takes 36.6 µs with a DelayedPDActuator group (36.5 µs at aecf205c52d) and 0.4 µs with an IdealPDActuator group (2.8 µs).

  • New tests fail on main: actuator and wrench isolation, the OvPhysX reset, the PhysX wrench reset, and masked resets under capture (cudaErrorStreamCaptureImplicit).

5. Follow-ups

  • OvPhysX RigidObjectCollection mask writers still convert on the host: the OvPhysX wheel's writes wait on the legacy stream (Warp CUDA error 906).

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • 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.

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation: the Warp guides already describe mask-based resets
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • 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)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Jul 21, 2026
@hujc7
hujc7 force-pushed the jichuanh/warp-scene-mask-native branch from c589567 to 0086860 Compare July 21, 2026 19:15
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 21, 2026
@hujc7
hujc7 force-pushed the jichuanh/warp-scene-mask-native branch 2 times, most recently from 58c7ed4 to 6d49e32 Compare July 22, 2026 17:49
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.
@hujc7
hujc7 force-pushed the jichuanh/warp-scene-mask-native branch from 6d49e32 to 12a3b4a Compare October 1, 2026 02:08
@hujc7 hujc7 changed the title [WARP] Cleanup Part 3: Make scene reset mask-native and capture-ready [Warp] Part 1/5: Reset only the masked environments and fix manager-based Warp environment construction Oct 1, 2026
@hujc7

hujc7 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 1, 2026
@hujc7

hujc7 commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@hujc7

hujc7 commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@maxkra15

maxkra15 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Normalize env_mask to the collection device before forwarding it. On a CUDA collection with DelayedPDActuator, reset(env_mask=wp.array([True, False, False], dtype=wp.bool, device="cpu")) raises a Torch device mismatch in DelayBuffer.set_time_lag. Native actuators likewise receive that CPU mask in the CUDA per-DOF kernel. Other scene reset owners already resolve host masks. Keep the same-device mask path allocation-free and add this case to the existing reset test.

@maxkra15 maxkra15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normalize env_mask to the actuator device before dispatch. A CPU Warp mask currently fails on CUDA DelayedPDActuator resets and reaches the native CUDA kernel unchanged. Keep the same-device path allocation-free. Add the host-mask case to the existing reset regression.

env_ids: Environment indices to reset. Defaults to all environments.
env_mask: Environment mask. Shape is (num_instances,). Defaults to None.
"""
group_env_ids = self._control._normalize_index_sequence(env_ids)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Normalize env_mask to the collection device before forwarding it. On a CUDA collection with DelayedPDActuator, reset(env_mask=wp.array([True, False, False], dtype=wp.bool, device="cpu")) raises a Torch device mismatch in DelayBuffer.set_time_lag. Native actuators likewise receive that CPU mask in the CUDA per-DOF kernel. Other scene reset owners already resolve host masks. Keep the same-device mask path allocation-free and add this case to the existing reset test.

@hujc7

hujc7 commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@hujc7

hujc7 commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

…-mask-native

# Conflicts:
#	source/isaaclab_newton/test/assets/test_articulation.py
@hujc7

hujc7 commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

…l_ids to its first user

resolve_1d_mask now rejects a boolean mask longer than all_mask with or without a scratch_mask, so the Newton fixed-tendon writer, which launches over the mask length, can no longer write past its rows; shorter masks stay allowed without a scratch mask. resolve_ids drops the all_ids=slice(None) form, which nothing in this part calls. The PhysX selection helpers and resolve_1d_mask describe the behaviour they have.
… as main does

ActuatorCollection.reset passes env_mask to an actuator model only when a mask is given, so a custom model with main's reset(env_ids) works again. _ThrusterCollection.reset turns the slice(None) the articulation forwards into None, so Multirotor.reset(env_mask=m) resamples only the masked thrusters. The ray caster seeds its masked-reset random states on the first reset that samples drift instead of at creation, so a ray caster without drift draws nothing from torch's global generator. The fixed-tendon limit docs give the unit of the spanned joints.
@hujc7

hujc7 commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

add_model_change only queued the change on the host, so a write recorded
into a graph capture refreshed the solver once: the first step after the
capture flushed the queue and later replays left the solver on the old
values. Inside a capture it now records the refresh of that change, and
changes queued before the capture stay queued for the next step.

(cherry picked from commit e6e178c)
@hujc7

hujc7 commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Achieved by #8926.

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.

3 participants