Repository navigation
[Warp] Part 2a/8: Reset only the masked environments #6646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
ce4db9c
Reset only masked environments in Newton and OVPhysX assets
hujc7 116e021
Forward the reset mask to every Warp scene entity
hujc7 88b1ba2
Write collection masks and reset ray-caster drift without host sync
hujc7 16ee932
Read history_order as a group setting in the Warp observation manager
hujc7 7949cb9
Write fixed tendon masks on Newton articulations without host sync
hujc7 12bd5a9
Make masked native-actuator and ray-caster resets capturable
hujc7 eb458ca
Write Newton tendon targets every step so captured commands apply
hujc7 12a3b4a
Merge remote-tracking branch 'upstream/develop' into jichuanh/warp-sc…
hujc7 29b25ec
Merge remote-tracking branch 'upstream/develop' into jichuanh/warp-sc…
hujc7 2bb8e9e
Resolve adapter reset ids through preallocated masks
hujc7 edc61c8
Reset Isaac Lab actuator models from the environment mask
hujc7 e89284a
Reset surface grippers by index in the Warp scene
hujc7 8b2a161
Drop float from the fixed-tendon position limit type
hujc7 4fb4e01
Rename the fixed-tendon mask helper and move it beside its setters
hujc7 3c5e2de
Reuse the shared masked-copy kernel for tendon and link-pose writes
hujc7 ea94e20
Rename the collection body-mask resolver to _resolve_body_mask
hujc7 3f26cfa
Pass masks explicitly to actuator models, native actuators and delay …
hujc7 75de1d9
Forward env_mask through PhysX asset resets
hujc7 6ac6061
Share one per-environment Warp RNG state through WarpRng
hujc7 7966bba
Merge remote-tracking branch 'upstream/develop' into jichuanh/warp-sc…
hujc7 69c13a6
Point the Warp migration guide at WarpRng.state
hujc7 f846372
Allocate the scratch body mask in the Newton collection test helper
hujc7 11e36c4
Reset Multirotor thrusters and test actuator stubs from the environme…
hujc7 9328d98
Defer annotations in the seed module so the docs import it with Warp …
hujc7 e86c3c4
Merge remote-tracking branch 'upstream/develop' into jichuanh/warp-sc…
hujc7 e35945b
Merge remote-tracking branch 'upstream/develop' into jichuanh/warp-sc…
hujc7 e9535c6
Merge remote-tracking branch 'upstream/main' into jichuanh/warp-scene…
hujc7 f6d31ca
Drop the history_order changelog entry that main already ships
hujc7 dbb3b12
Merge remote-tracking branch 'upstream/main' into jichuanh/warp-scene…
hujc7 2030fe3
Move the shared WarpRng state out of this pull request
hujc7 5676dd1
Add resolve_ids next to resolve_1d_mask as the shared id and mask hel…
hujc7 97e5662
Resolve sensor, camera and wrench composer selections through the sha…
hujc7 92590d0
Fix the deformable mask writers that raised on any env mask
hujc7 f044c92
Resolve Newton selections through the shared helpers and write its ma…
hujc7 7b48c38
Resolve OVPhysX selections through the shared helpers
hujc7 3d3661f
Resolve PhysX selections through the shared helpers
hujc7 b455d35
Merge jichuanh/id-mask (#8821) into jichuanh/warp-scene-mask-native
hujc7 a9f7c50
Merge remote-tracking branch 'upstream/main' into jichuanh/warp-scene…
hujc7 6c31123
Write Newton tendon targets behind the host flag again
hujc7 44021e5
Reset only the masked environments from the stable scene
hujc7 43bb968
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 93daa9b
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 e390289
Trim duplicate id-resolution and mask-writer tests
hujc7 2048c62
Trim redundant setup from the masked-reset tests
hujc7 0402115
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 38721ea
Resample masked ray-caster drift from the device mask
hujc7 0e9e57d
Pass the reset mask to actuator models only when one is given
hujc7 59f9cf5
Accept env_mask in the multirotor reset
hujc7 d8d4911
Match the base reset selector type in the actuator overrides
hujc7 13ec11c
Accept every id form main accepted in resolve_1d_mask
hujc7 784b0a2
Refresh the solver on every replay of the Newton tendon mask writer
hujc7 6a4f173
Tidy the mask writers, their docs and the selection tests
hujc7 bc9a8bb
Reject Newton masks whose length differs from the asset dimension
hujc7 981e3a4
Accept strided torch limits in the Newton tendon position limit mask …
hujc7 cff8f86
Run the tendon replay test before the module's shared scene opens
hujc7 bbb5104
Revert "Reject Newton masks whose length differs from the asset dimen…
hujc7 029ee47
Resolve the Newton collection writer masks inline again
hujc7 551e508
Launch the rewritten Newton mask writers over the mask lengths
hujc7 86ce1c9
Write the rewritten Newton mask writers through a core masked write
hujc7 0b464e2
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 fe3bb54
Pass env_ids and env_mask to every scene entity and actuator model
hujc7 72586c9
Accept env_mask in the surface gripper reset
hujc7 a1e220b
Accept Warp masks in the delay buffer
hujc7 f730333
Convert the reset mask inside the thruster reset
hujc7 06a2888
Reset multirotor thrust targets through the shared mask resolver
hujc7 b37d231
Merge upstream main 6ef40d19a6f into jichuanh/id-mask
hujc7 e1c666f
Merge jichuanh/id-mask (upstream main 6ef40d19a6f) into jichuanh/warp…
hujc7 69c6765
Merge the main merge of jichuanh/warp-scene-mask-native into the held…
hujc7 dc2aba6
Align resolve_ids and write_2d_with_mask with the shared memory helpers
hujc7 1bbc0f4
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native-…
hujc7 464fac0
Merge branch 'jichuanh/warp-scene-mask-native-push' into jichuanh/war…
hujc7 92a413e
Write strided vector components through scalar views instead of copyi…
hujc7 2efdac5
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native-…
hujc7 631738a
Merge branch 'jichuanh/warp-scene-mask-native-push' into jichuanh/war…
hujc7 efee1b9
Update camera poses on reset through the resolved mask
hujc7 6ea8b42
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native-…
hujc7 984e898
Merge branch 'jichuanh/warp-scene-mask-native-push' into jichuanh/war…
hujc7 b7d5295
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 e0e6e22
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native-…
hujc7 420865d
Merge branch 'jichuanh/warp-scene-mask-native-push' into jichuanh/war…
hujc7 d73ad63
Reset by ids and by mask through explicit keyword arguments in the tests
hujc7 613ad50
Name the surface gripper reset selection env_ids and pass env_ids by …
hujc7 c5299e5
Pass the short test mask as an explicit env_mask keyword
hujc7 b8ef662
Reset multirotor thrust targets in the selection form given
hujc7 255270c
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 ead998b
Reset multirotor thrust targets by mask with the minimum change to th…
hujc7 3635089
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 0afc2e9
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 aecf205
Mark the contrib and PhysX reset mask APIs as minor bumps
hujc7 d8c3e75
Pass one Warp reset mask to every actuator group
hujc7 48b14a7
Convert the delayed actuator reset mask once for all delay buffers
hujc7 1d770e6
Take the reset mask in the abstract asset reset
hujc7 96a7fa7
Build the delayed actuator test mask as a Warp array
hujc7 ddcd317
Merge remote-tracking branch 'upstream/main' into jichuanh/id-mask
hujc7 3d02559
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 12270ab
Describe the Newton collection and FK changes after the main merge
hujc7 810e551
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 22b9aed
Merge main 299af193136 into jichuanh/id-mask
hujc7 c94a9f3
Restore main's FK launch size
hujc7 6afa0a2
Pass every selection form on and let each consumer pick its own
hujc7 47b5499
Describe resolve_ids' slice(None) all_ids in the changelog
hujc7 b75b5a8
Register tendon property writes as a model change as main does
hujc7 1f64a84
Merge jichuanh/id-mask into jichuanh/warp-scene-mask-native
hujc7 80e6e9c
Pass the reset selection to the actuators as given
hujc7 2a65a30
Merge main 2742c2d5e6b into jichuanh/id-mask
hujc7 a401aae
Merge jichuanh/id-mask into jichuanh/warp-scene-mask-native
hujc7 84470f4
Drop the invalidate_fk changelog line: its launch size is main's again
hujc7 1cbe859
Merge jichuanh/id-mask into jichuanh/warp-scene-mask-native
hujc7 41ed0c0
Merge remote-tracking branch 'upstream/main' into jichuanh/warp-scene…
hujc7 11d840a
Reject masks longer than the destination and leave the slice(None) al…
hujc7 fbef54c
Merge branch 'jichuanh/id-mask' into jichuanh/warp-scene-mask-native
hujc7 edc7ec3
Reset index-only actuators, masked thrusters and unseeded ray casters…
hujc7 ddb4825
Say which selection the thruster collection reset uses when given both
hujc7 9ae2df0
Refresh the solver on every replay of a captured model-property write
hujc7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| * Added :func:`~isaaclab.utils.warp.memory.resolve_ids`, which resolves an index selection given as ids or as a | ||
| boolean mask to ids on a device, as :func:`~isaaclab.utils.warp.memory.resolve_1d_mask` does to a mask. | ||
| * Added :func:`~isaaclab.utils.warp.memory.write_2d_with_mask`, which writes 2-D data or one scalar into a Warp array | ||
| where a row mask and a column mask are both true, launching over the mask lengths. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| * Changed the env selection helpers of :class:`~isaaclab.utils.wrench_composer.WrenchComposer` and | ||
| :class:`~isaaclab.sensors.Camera` to resolve ``env_ids`` and ``env_mask`` through | ||
| :func:`~isaaclab.utils.warp.memory.resolve_ids` and :func:`~isaaclab.utils.warp.memory.resolve_1d_mask`. | ||
| Any integer sequence and slices with a negative step are accepted, ids on another device are moved to the owner's | ||
| device, and a :class:`~isaaclab.utils.warp.ProxyArray` is rejected with a :class:`TypeError`. The | ||
| :class:`~isaaclab.sensors.Camera` now rejects floating-point ``env_ids`` with a :class:`TypeError` and | ||
| multi-dimensional ``env_ids`` with a :class:`ValueError` instead of casting and flattening them. | ||
| * Changed :class:`~isaaclab.utils.wrench_composer.WrenchComposer` to resolve ``body_ids`` through | ||
| :func:`~isaaclab.utils.warp.memory.resolve_ids` as well, so slices other than ``slice(None)`` are accepted. | ||
| * Changed :func:`~isaaclab.utils.warp.memory.resolve_1d_mask` to make ``scratch_mask`` optional for callers that never | ||
| pass ids. Their masks are returned as given. Ids without a ``scratch_mask`` raise a :class:`ValueError`, and so | ||
| does a mask longer than ``all_mask``. | ||
| * Changed :func:`~isaaclab.utils.warp.memory.resolve_ids` to use given ids over a mask: the mask is converted to ids | ||
| only when no ids (or ``slice(None)``) are given. When both ``env_ids`` and ``env_mask`` are given, PhysX assets now | ||
| use the ids, which their views take without a host synchronization; mask-native consumers still use the mask. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| * Fixed the ``write_nodal_*_to_sim_mask`` methods of :class:`~isaaclab.assets.BaseDeformableObject`, which the | ||
| OVPhysX deformable object inherits, raising a :class:`RuntimeError` whenever ``env_mask`` was given. | ||
| * Fixed :meth:`~isaaclab.sensors.Camera.reset` with an ``env_mask`` on another device than the camera: the camera | ||
| poses are now updated through the mask resolved on the camera's device, like the timestamps and buffers. |
Empty file.
10 changes: 10 additions & 0 deletions
10
source/isaaclab/changelog.d/jichuanh-warp-scene-mask-native.added.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| * Added ``env_mask`` to :meth:`~isaaclab.actuators.ActuatorCollection.reset` and | ||
| :meth:`~isaaclab.actuators.ActuatorControl.reset_native_actuators`. Isaac Lab actuator models and backend-native | ||
| actuator state reset only the masked environments from the mask itself, without converting it to indices. | ||
| * Added ``batch_mask``, a boolean torch tensor or Warp array, to | ||
| :meth:`~isaaclab.utils.buffers.DelayBuffer.set_time_lag` and :meth:`~isaaclab.utils.buffers.DelayBuffer.reset`, | ||
| which select batches on the device without synchronizing the host. Tensor lags set through a mask are full-sized | ||
| and are not range-checked. | ||
| * Added ``env_mask`` to :meth:`~isaaclab.assets.BaseCableObject.reset`, matching the other scene assets. | ||
| * Added ``env_mask`` to :meth:`~isaaclab.scene.InteractiveScene.reset`, which forwards the mask to every asset and | ||
| sensor so only the masked environments are reset, without synchronizing the host. |
23 changes: 23 additions & 0 deletions
23
source/isaaclab/changelog.d/jichuanh-warp-scene-mask-native.changed.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| * Changed masked :meth:`~isaaclab.sensors.ray_caster.BaseRayCaster.reset` to resample drift in a Warp kernel from | ||
| per-environment random states, so it neither synchronizes the host nor allocates and can be captured in a CUDA | ||
| graph. The states are seeded from torch's global generator by the first reset that samples drift, which therefore | ||
| must not run during a capture; a ray caster without drift draws nothing from it, as before. When both ``env_ids`` and ``env_mask`` are given, the mask selects | ||
| the resampled environments, matching :meth:`~isaaclab.sensors.SensorBase.reset`. | ||
| * Changed :meth:`~isaaclab.actuators.newton.NewtonActuatorAdapter.reset` to reuse preallocated per-DOF masks, so | ||
| masked resets of Newton-native actuator state do not allocate and can be captured in a CUDA graph. | ||
| * Changed :meth:`~isaaclab.actuators.ActuatorBase.reset` to take an ``env_mask`` argument, the boolean ``wp.array`` | ||
| of the environments to reset that masked resets pass instead of indices. | ||
| :meth:`~isaaclab.actuators.ActuatorCollection.reset` passes it only when a mask is given, so custom actuator models | ||
| with the index-only ``reset(env_ids)`` keep working for index resets. To support masked resets they accept | ||
| ``env_mask`` and reset from it without synchronizing the host, for example through | ||
| :func:`~isaaclab.utils.array.index_fill_` or :func:`torch.where` on its :func:`warp.to_torch` view. | ||
| * **Breaking:** Changed :meth:`~isaaclab.scene.InteractiveScene.reset` to pass ``env_mask`` to the ``reset`` of every | ||
| asset and sensor, also when it is None. Custom assets and sensors must accept ``env_mask``, as | ||
| :meth:`~isaaclab.assets.AssetBase.reset` and :meth:`~isaaclab.sensors.SensorBase.reset` do. | ||
| * Changed :class:`~isaaclab.actuators.DelayedPDActuator` to raise :class:`ValueError` at construction unless | ||
| ``0 <= min_delay <= max_delay``, instead of at a reset, because masked resets apply the sampled delays without | ||
| checking them on the host. | ||
| * Changed the ``limit`` annotation of | ||
| :meth:`~isaaclab.assets.BaseArticulation.set_fixed_tendon_position_limit_index` and | ||
| :meth:`~isaaclab.assets.BaseArticulation.set_fixed_tendon_position_limit_mask` to exclude ``float``, matching the | ||
| backends, which raise :class:`ValueError` for a float because it cannot hold both bounds. |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.