Skip to content

[Warp] Part 3a/9: Resolve Warp selections on SceneEntityCfg and hold the env origins in a Warp array - #8856

Open
hujc7 wants to merge 13 commits into
isaac-sim:mainfrom
hujc7:jichuanh/warp-stable-foundations
Open

hujc7 wants to merge 13 commits into
isaac-sim:mainfrom
hujc7:jichuanh/warp-stable-foundations

Conversation

@hujc7

@hujc7 hujc7 commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Warp terms select joints and bodies through the stable SceneEntityCfg, which now carries their int32 Warp ids, and read the environment origins from a Warp array that env_origins views, so Warp code needs no conversion while torch code keeps main's types. The experimental SceneEntityCfg subclass and the frontend's config promotion are removed.

Description

Update (2026-11-17): re-cut on main without Part 2b's commits (2b, 3a and 4a now each branch from main). env_origins is no longer a ProxyArray: it stays main's torch.Tensor, now a view of the wp.vec3f array that holds the origins (env_origins_wp), so existing torch code pays nothing extra per operation. Typing joint_ids/body_ids or env_origins as a ProxyArray was tried and dropped: torch takes a Python dispatch for every non-native index or operand, MEASURED per op on an L40 host: x[:, slice(None)] 2.42 us vs 9.97 us with a ProxyArray-typed selection, pos - env_origins 6.12 us vs 11.08 us. A finalized SceneEntityCfg now serializes: to_dict stores the Warp ids as lists and a pickled configuration leaves them out until resolve_warp_ids runs again.

Update (2026-11-15): a4c37aa9471 adds a reordered joint subset ([8, 0, 5, 2], what preserve_order=True resolves) to the Warp-vs-torch joint observation parity tests; the reordered cases fail when the Warp ids are sorted.

Update (2026-11-10): SceneEntityCfg.resolve() is main's; the Warp managers fill the Warp ids through the new resolve_warp_ids(scene), so torch terms do no Warp work.

  1. SceneEntityCfg Warp selections (isaaclab): resolve_warp_ids(scene) fills joint_ids_wp and body_ids_wp, int32 Warp arrays in the order of joint_ids and body_ids (a slice expands over the entity's joints or bodies, the sensors of a contact sensor; a negative index wraps; repeats are kept). joint_ids, body_ids and resolve() are main's. Copies share the Warp ids (copy(), copy.copy, copy.deepcopy, replace); to_dict writes them as lists, validate accepts them, and a pickled configuration drops them.
  2. Warp env origins (isaaclab): InteractiveScene and TerrainImporter hold the origins in a wp.vec3f Warp array, env_origins_wp; env_origins is its zero-copy torch.Tensor view, as on main by type. TerrainImporter.env_origins is a property whose setter writes into the same array, so an earlier view of either stays current; InteractiveScene writes each new clone plan's positions into its array.
  3. Experimental (isaaclab_experimental, isaaclab_tasks_experimental): the SceneEntityCfg subclass with joint_mask and from_stable, and the frontend's promotion to it, are removed. The Warp joint penalties, joint_pos_out_of_manual_limit and the Cartpole joint_pos_target_l2 loop over joint_ids_wp, so a joint selected twice counts twice, as in the torch terms. The Warp environments read scene.env_origins_wp.

Breaking changes

  1. isaaclab_experimental.managers.SceneEntityCfg now resolves to isaaclab.managers.SceneEntityCfg; joint_mask and from_stable are removed.

Evidence

MEASURED on a 4-GPU L40 host (isaac-lab:latest-main, kitless Newton MJWarp, Kit for the scene, terrain and camera tests), one pytest process per file, at 384b7318540 and, for the two test files 97665adb2e5 changes, at 97665adb2e5: test_scene_entity_cfg.py 7, test_interactive_scene.py 8, test_terrain_importer.py 6, test_camera_image_obs_manager.py 1, the manager tests (event 20, manager base 8, observation 46, recorder 8 + 1, reward 7, termination 2), experimental test_frontend.py 25, test_frontend_cfg_conversion.py 8 (1 skipped), test_manager_call_switch.py 29, test_warp_graph_cache.py 6, and the Warp parity and capture tests (actions 4, events 5, observations 11, rewards 20, terminations 10, capture safety 11) passed. pre-commit passes over the PR's commits.

Type of change

  • 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
  • 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 documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Oct 27, 2026
@hujc7 hujc7 changed the title [Warp] Part 9/12: Select Warp joints and bodies through the stable SceneEntityCfg and move the capture utilities into isaaclab [Warp] Part 5/11: Select Warp joints and bodies through the stable SceneEntityCfg and move the capture utilities into isaaclab Nov 2, 2026
@hujc7 hujc7 changed the title [Warp] Part 5/11: Select Warp joints and bodies through the stable SceneEntityCfg and move the capture utilities into isaaclab [Warp] Part 3a/8: Resolve Warp selections on SceneEntityCfg and return env origins as a ProxyArray Nov 10, 2026
@hujc7

hujc7 commented Nov 10, 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 Nov 10, 2026
@hujc7
hujc7 marked this pull request as ready for review November 10, 2026 08:01
@hujc7
hujc7 requested a review from a team November 10, 2026 08:01
@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] The PR appears safe to merge; no new actionable issues remain.

Summary

Moves Warp joint and body selections into the stable SceneEntityCfg and exposes environment origins through ProxyArray.

  • Warp terms use selected joint and body IDs from the stable scene config.
  • Scene and terrain origins now offer matching Warp and Torch views.
  • Masked actuator resets clear selected state through Warp kernels.
  • Ray casters resample masked environment drift with per-environment Warp random states.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[SceneEntityCfg] --> B[resolve]
    B --> C[resolve_warp_ids]
    C --> D[Warp terms]
    E[Scene or terrain origins] --> F[ProxyArray]
    F --> G[.torch]
    F --> H[.warp]
Loading

Reviews (2) · Last reviewed commit: "Resolve Warp selections on the stable Sc..." · Reviewed by Greptile

env_ids: Env indices to reset. If ``None``, resets all envs.
env_mask: Env mask. Shape is (num_envs,). Defaults to None.
"""
if env_ids is None and env_mask is not None:

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.

P1 Unselected thrusters reset too

Calling Multirotor.reset(env_mask=mask) resets every thruster. Its parent, Articulation.reset, replaces the omitted env_ids with slice(None) before forwarding both arguments through _ThrusterCollection. This condition then ignores the mask because env_ids is no longer None.

Continuing environments have their motor parameters sampled again and their current thrust reset. Treat slice(None) like None when a mask is supplied, as resolve_ids does.

Suggested change
if env_ids is None and env_mask is not None:
if env_mask is not None and (env_ids is None or (isinstance(env_ids, slice) and env_ids == slice(None))):

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in edc7ec3 (#6646): _ThrusterCollection.reset turns the slice(None) the articulation forwards into None, so a mask-only reset resamples only the masked thrusters. The multirotor unit test covers it.

@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 Nov 14, 2026
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
@hujc7

hujc7 commented Nov 16, 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 Nov 16, 2026
@hujc7

hujc7 commented Nov 16, 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 Nov 16, 2026
@hujc7

hujc7 commented Nov 16, 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 Nov 16, 2026
hujc7 added 13 commits November 16, 2026 22:06
The import came from Part 2b's scene test, which no longer changes this file.
… selection

A selection resolved with preserve_order=True keeps the configured joint
order; the Warp gather must produce the same columns as the torch term.
Camera._as_device_tensor already converts a ProxyArray through its array
interface, with the same values and the same one-time deprecation warning,
and no caller passes the scene's env origins to a camera pose setter. Remove
the branch and its test.
The header still announced four steps and repeated the noise step that the
list now names as its third item.
Only the line that takes the Warp view of the env origins had to change.
Fold the copy-sharing test into the subclass deep-copy test: copy, clone and
replace share one configclass path that test_configclass covers, so one clone
line proves the field metadata and the deep-copy assertions prove
__deepcopy__. Drop the finalize tail of the Warp id resolution test, which
repeats test_finalize_moves_resolved_selections_to_device.
…figuration

The joint-subset observation parity cases built their selection with a mock
that wrote the Warp ids straight from the list, so a resolve_warp_ids that
sorted the ids would not fail them. They now resolve a SceneEntityCfg by
joint name with preserve_order=True, then resolve_warp_ids, on the mock
articulation; the mock scene gains the keys() and device that resolution
reads.
Its only use, building a joint mask, went with the mask.
@hujc7
hujc7 force-pushed the jichuanh/warp-stable-foundations branch from a4c37aa to 97665ad Compare November 17, 2026 19:03
@hujc7 hujc7 changed the title [Warp] Part 3a/8: Resolve Warp selections on SceneEntityCfg and return env origins as a ProxyArray [Warp] Part 3a/9: Resolve Warp selections on SceneEntityCfg and hold the env origins in a Warp array Nov 17, 2026
@hujc7

hujc7 commented Nov 17, 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 Nov 17, 2026

This branch has not been deployed

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant