Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
ecf3b48
Add TorchArray design spec
AntoineRichard Apr 16, 2026
0aa313b
Add validation test commands to TorchArray spec
AntoineRichard Apr 16, 2026
710d431
Add TorchArray implementation plan
AntoineRichard Apr 16, 2026
fe86064
Add TorchArray class with explicit .torch/.warp accessors
AntoineRichard Apr 16, 2026
43f030c
Add missing operator tests for TorchArray
AntoineRichard Apr 16, 2026
d5f97ec
Update BaseArticulationData return types to TorchArray
AntoineRichard Apr 16, 2026
c11ee51
Update PhysX ArticulationData to return TorchArray
AntoineRichard Apr 16, 2026
cbaf769
Update Newton ArticulationData to return TorchArray
AntoineRichard Apr 16, 2026
e8f5056
Fix trailing whitespace in torch_array.py
AntoineRichard Apr 16, 2026
45125fc
Add changelog entries and bump versions for TorchArray
AntoineRichard Apr 16, 2026
d777e43
Add .warp/.torch to data property accesses in PhysX Articulation
AntoineRichard Apr 16, 2026
6871add
Add .warp/.torch to data property accesses in Newton Articulation
AntoineRichard Apr 16, 2026
9bedcfa
Update PhysX articulation tests for TorchArray
AntoineRichard Apr 16, 2026
fdbd411
Fix TorchArray consumers in terminations and wrench composer
AntoineRichard Apr 16, 2026
2e11478
Update Newton articulation tests for TorchArray
AntoineRichard Apr 16, 2026
e5439e4
Update MDP framework for TorchArray
AntoineRichard Apr 16, 2026
2144ebd
Update MDP framework and cartpole task for TorchArray
AntoineRichard Apr 16, 2026
ae28c6d
Update direct cartpole env for TorchArray
AntoineRichard Apr 16, 2026
6694970
Update manager-based task envs for TorchArray
AntoineRichard Apr 16, 2026
82ca1b2
Update direct task envs for TorchArray
AntoineRichard Apr 16, 2026
4b754b4
Extend TorchArray to PVA and IMU sensors
AntoineRichard Apr 16, 2026
f08c1e5
Extend TorchArray to DeformableObject
AntoineRichard Apr 16, 2026
23b56c2
Extend TorchArray to FrameTransformer across all layers
AntoineRichard Apr 16, 2026
f3a2930
Extend TorchArray to RigidObjectCollection across all layers
AntoineRichard Apr 16, 2026
3eea75c
Extend TorchArray to RigidObject across all layers
AntoineRichard Apr 16, 2026
2623ac5
Extend TorchArray to ContactSensor across all layers
AntoineRichard Apr 16, 2026
2d0b6ac
Fix missed getattr wp.to_torch pattern in rigid object tests
AntoineRichard Apr 16, 2026
5f63aaf
Revert GRAVITY_VEC_W.torch to wp.to_torch in rigid object tests
AntoineRichard Apr 16, 2026
2fdb623
Revert GRAVITY_VEC_W.torch in rigid object collection tests
AntoineRichard Apr 16, 2026
7c3cc52
Fix TorchArray passed to write methods in frame transformer tests
AntoineRichard Apr 16, 2026
0184ddd
Fix remaining TorchArray in Newton frame transformer tests
AntoineRichard Apr 16, 2026
656f8b7
Fix remaining wp.to_torch on data properties in source files
AntoineRichard Apr 16, 2026
7f210cd
Fix remaining wp.to_torch on data properties in test files
AntoineRichard Apr 16, 2026
41fa511
Pin TorchArray instances in Newton ArticulationData
AntoineRichard Apr 16, 2026
1e6593b
Pin TorchArray instances in Newton RigidObject/Collection data
AntoineRichard Apr 16, 2026
57fb86e
Pin TorchArray instances in Newton sensor data classes
AntoineRichard Apr 16, 2026
6ded9ea
Revert FrameTransformer TorchArray pinning to dynamic creation
AntoineRichard Apr 16, 2026
a645b3e
Fix Newton TorchArray pinning for sim rebind and non-contiguous slices
AntoineRichard Apr 16, 2026
82a196b
Fix bot review comments: sliced buffer invalidation + __getitem__
AntoineRichard Apr 17, 2026
f0f4c82
Add rebind logic to Newton RigidObject/Collection data classes
AntoineRichard Apr 17, 2026
15d8fe2
Fix review findings: collection PHYSICS_READY callback + missing inva…
AntoineRichard Apr 17, 2026
74afcbd
Add PhysX _create_simulation_bindings design spec
AntoineRichard Apr 17, 2026
099ce97
Add PhysX simulation bindings implementation plan
AntoineRichard Apr 17, 2026
1539747
Add array interface to TorchArray for direct warp kernel interop
AntoineRichard Apr 20, 2026
a53fb61
Pin TorchArrays on PhysX data properties to avoid per-access allocation
AntoineRichard Apr 17, 2026
d6132a0
Remove .warp from PhysX kernel launch arguments
AntoineRichard Apr 20, 2026
654f71f
Merge origin/develop into antoiner/feat/physx-sim-bindings
AntoineRichard Apr 21, 2026
fd8c734
Address review feedback and migrate OVPhysX to TorchArray
AntoineRichard Apr 21, 2026
5eb59f6
Fix wp.to_torch on TorchArray-returning compute_first_contact
AntoineRichard Apr 21, 2026
62d2356
Fix critical review issues from TorchArray migration
AntoineRichard Apr 21, 2026
97ddeda
Pin contact sensor TorchArray, add type validation, update mocks
AntoineRichard Apr 21, 2026
ca10f04
Document PhysX pointer stability, fix lint and changelog
AntoineRichard Apr 21, 2026
9b4bd1a
Add TorchArray docs, migration guide, and update asset mocks
AntoineRichard Apr 21, 2026
f0a706d
Remove superpowers planning docs from tracked files
AntoineRichard Apr 21, 2026
709e286
Fix migration docs: 2.x returned torch.Tensor, not wp.array
AntoineRichard Apr 21, 2026
9d8d94f
Document TorchArray auto-interop with warp kernels and torch functions
AntoineRichard Apr 21, 2026
bef68c1
Migrate WrenchComposer to return TorchArray
AntoineRichard Apr 21, 2026
a6c9889
Fix wrench composer unit tests for TorchArray returns
AntoineRichard Apr 21, 2026
a620501
Extract _pin_torch_arrays in Newton data classes
AntoineRichard Apr 21, 2026
a58bf08
Extract _pin_torch_arrays in PhysX data classes
AntoineRichard Apr 21, 2026
3304099
Deduplicate lazy None init and restore type annotations in _pin_torch…
AntoineRichard Apr 21, 2026
b4bc8fe
Add isinstance validation to rebind() and test init TypeError
AntoineRichard Apr 21, 2026
850cf31
Merge origin/develop
AntoineRichard Apr 21, 2026
bcdc899
Add tasks changelog, migration guidance, fix return type annotation
AntoineRichard Apr 21, 2026
4a15fcd
Merge origin/develop, resolve contact sensor test conflict
AntoineRichard Apr 21, 2026
c1b6190
Guard _pin_torch_arrays in _create_simulation_bindings for first init
AntoineRichard Apr 21, 2026
823173d
Apply formatting and stage remaining .torch migration files
AntoineRichard Apr 21, 2026
a7307c2
Fix doc build: add :no-index: to how-to autoclass, remove orphan plan
AntoineRichard Apr 21, 2026
ce728b2
Update tests and ovphysx to use TorchArray interface
AntoineRichard Apr 21, 2026
a7f80aa
Wrap ovphysx GRAVITY_VEC_W and FORWARD_VEC_B in TorchArray
AntoineRichard Apr 22, 2026
a7e8460
Merge branch 'develop' into antoiner/feat/physx-sim-bindings
AntoineRichard Apr 24, 2026
f5ba5e7
Wrap RayCasterData properties in TorchArray
AntoineRichard Apr 24, 2026
779bb14
Release isaaclab 4.6.14 for RayCaster TorchArray migration
AntoineRichard Apr 24, 2026
1cad098
Wrap FrameView pose getters in TorchArray
AntoineRichard Apr 24, 2026
e077490
Release for FrameView TorchArray migration
AntoineRichard Apr 24, 2026
4d6e1fd
Migrate scripts/ to TorchArray API and add regression scanner
AntoineRichard Apr 24, 2026
73444f5
Merge remote-tracking branch 'origin/develop' into antoiner/feat/phys…
AntoineRichard Apr 24, 2026
8a6f00f
Rename TorchArray to ProxyArray
AntoineRichard Apr 24, 2026
5b40e55
Make ProxyArray immutable and drop rebind
AntoineRichard Apr 24, 2026
7bd86a4
Release isaaclab 4.6.16 for ProxyArray rename and immutability
AntoineRichard Apr 24, 2026
a45f698
Finish TorchArray to ProxyArray rename in embedded identifiers
AntoineRichard Apr 24, 2026
c514742
Pass .warp when feeding PhysX tendon setters
AntoineRichard Apr 24, 2026
c0d2f80
Shim wp.to_torch to handle ProxyArray with a deprecation warning
AntoineRichard Apr 24, 2026
726a62c
Merge remote-tracking branch 'origin/develop' into antoiner/feat/phys…
AntoineRichard Apr 27, 2026
b51594f
Use explicit ProxyArray .warp accessor in experimental Warp MDPs
AntoineRichard Apr 27, 2026
bb068c9
Make ProxyArray .shape access explicit on the warp path
AntoineRichard Apr 27, 2026
7f31f32
Make parity_helpers mocks ProxyArray-native via proxy_array helper
AntoineRichard Apr 27, 2026
9e0da29
Replace wp.to_torch on ProxyArray data props with .torch accessor
AntoineRichard Apr 27, 2026
a0c3af0
Use explicit ProxyArray .warp accessor in tasks_experimental warp MDPs
AntoineRichard Apr 27, 2026
a00a0a3
Use explicit ProxyArray .warp accessor in Newton data class launches
AntoineRichard Apr 27, 2026
036efb2
Add opt-in runtime detector for wp.quatf .torch reads
AntoineRichard Apr 27, 2026
fc62354
Fix a bunch of forgotten .torch/.warp
AntoineRichard Apr 27, 2026
a2f5c8b
Merge branch 'develop' into antoiner/feat/physx-sim-bindings
AntoineRichard Apr 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/source/how-to/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ Isaac Lab.
draw_markers


Working with Simulation Data
----------------------------

This guide explains how to read and write simulation state using the :class:`~isaaclab.utils.warp.ProxyArray`
dual-access wrapper that all data classes return.

.. toctree::
:maxdepth: 1

proxy_array


Interfacing with Environments
-----------------------------

Expand Down
134 changes: 134 additions & 0 deletions docs/source/how-to/proxy_array.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.. _how-to-torch-array:

Working with ProxyArray
=======================

.. currentmodule:: isaaclab.utils.warp

Isaac Lab data classes return :class:`ProxyArray` — a lightweight, warp-first wrapper that
provides zero-copy access to simulation data as either a :class:`warp.array` or a
:class:`torch.Tensor`.

.. note::

``ProxyArray`` is inspired by the ``ProxyArray`` class from
`mujocolab/mjlab <https://github.com/mujocolab/mjlab>`_ (BSD-3-Clause).
The design adapts the same dual-accessor pattern to Isaac Lab's warp-based data pipeline.


Quick Start
~~~~~~~~~~~

Every property on asset and sensor data classes (e.g., ``robot.data.joint_pos``,
``sensor.data.net_forces_w``) returns a ``ProxyArray``:

.. code-block:: python

robot = env.scene["robot"]

# Explicit torch access (preferred)
joint_positions = robot.data.joint_pos.torch # torch.Tensor, cached zero-copy view
gravity_proj = robot.data.projected_gravity_b.torch # torch.Tensor

# Explicit warp access (for kernel interop)
wp_array = robot.data.joint_pos.warp # warp.array, the original buffer

# Pass directly to warp kernels — no unwrapping needed
wp.launch(my_kernel, inputs=[robot.data.joint_pos], ...) # works via __cuda_array_interface__


The ``.torch`` and ``.warp`` Accessors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- ``.torch`` returns a cached, zero-copy :class:`torch.Tensor` view of the underlying warp array
(via :func:`warp.to_torch`). The tensor is created on first access and reused on subsequent
calls. Since it is a zero-copy view, writes to the tensor are visible through the warp array
and vice versa.

- ``.warp`` returns the original :class:`warp.array`. Use this when you need to pass data to
warp kernels explicitly or access warp-specific attributes (``ptr``, ``strides``, etc.).


Deprecation Bridge
~~~~~~~~~~~~~~~~~~

To ease migration, ``ProxyArray`` includes a deprecation bridge that allows existing code to
treat it as a ``torch.Tensor`` temporarily:

.. code-block:: python

# These still work but emit a one-time DeprecationWarning:
result = torch.sum(robot.data.joint_pos) # via __torch_function__
value = robot.data.joint_pos[0, 3] # via __getitem__
result = robot.data.joint_pos + 1.0 # via __add__
legacy = wp.to_torch(robot.data.joint_pos) # temporary shim

# Preferred (no warning):
result = torch.sum(robot.data.joint_pos.torch)
value = robot.data.joint_pos.torch[0, 3]
result = robot.data.joint_pos.torch + 1.0
tensor = robot.data.joint_pos.torch

The ``wp.to_torch()`` compatibility path is a temporary shim for code that was migrated
before ``ProxyArray`` exposed explicit accessors. It returns the same zero-copy tensor as
``.torch`` and emits a one-time ``DeprecationWarning``. The shim and the other deprecation
bridges will be removed in a future release. Migrate to explicit ``.torch`` access now.


Migrating from Isaac Lab 2.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In Isaac Lab 2.x, data properties returned ``torch.Tensor`` directly. In 3.0, they return
``ProxyArray``. Append ``.torch`` to get the tensor:

.. code-block:: python

# BEFORE (Isaac Lab 2.x) — properties returned torch.Tensor directly
joint_pos = robot.data.joint_pos
first_contact = sensor.compute_first_contact(dt)

# AFTER (Isaac Lab 3.0) — properties return ProxyArray
joint_pos = robot.data.joint_pos.torch
first_contact = sensor.compute_first_contact(dt).torch

.. note::

Passing a ``ProxyArray`` to ``wp.to_torch()`` is temporarily supported by a compatibility
shim and returns the same cached zero-copy tensor as ``.torch``. This path emits a
one-time ``DeprecationWarning`` and will be removed in a future release. Use ``.torch``
in new code.


Backend Differences
~~~~~~~~~~~~~~~~~~~

While the ``ProxyArray`` interface is identical across backends, the underlying data refresh
model differs:

**PhysX (pull-to-refresh):**
Properties pull fresh data from the PhysX tensor API on first access per simulation step,
then cache the result. The underlying GPU buffers are stable and pre-allocated — the
``ProxyArray`` wrapper is created once and reused safely across steps.

**Newton (auto-refresh with wrapper replacement):**
The simulation automatically refreshes GPU buffers each step. On full simulation resets,
buffers may be re-created. The Newton backend creates new ``ProxyArray`` wrappers for the
new warp arrays, invalidating any previously cached torch tensors.

In both cases, ``.torch`` always returns a view of the current simulation state for the
current step.

.. warning::

Do not cache ``.torch`` results across simulation resets. After a reset (especially on
Newton), previously obtained tensors may point to stale or freed GPU memory. Always
re-access the property after a reset.


API Reference
~~~~~~~~~~~~~

.. autoclass:: ProxyArray
:members:
:undoc-members:
:no-index:
Loading
Loading