Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d6571ee
Bring the MDP2 features of the Arena prototype to MDP2
StafaH Nov 20, 2026
97e1622
Read where MDP2 ops run and start from the op
StafaH Nov 20, 2026
284d501
Add tunable MDP2 values that change per world while graphs replay
StafaH Nov 20, 2026
d8b4bbf
Switch MDP2 uses on and off per world with when
StafaH Nov 20, 2026
d5b5a66
Count repeated completions of MDP2 tasks
StafaH Nov 20, 2026
7e50cf4
Give MDP2 actions name slots and a live mask
StafaH Nov 20, 2026
201b0d8
Let the tasks of an MDP2 sequence take actions
StafaH Nov 20, 2026
e7e3674
Apply MDP2 actions once per control step or before every physics step
StafaH Nov 20, 2026
01ba17d
Fix a role split across lines in the MDP2 changelog fragment
StafaH Nov 20, 2026
017be53
Name the action and observation columns of an MDP2 task in its spec
StafaH Nov 20, 2026
22039bc
Resolve term state, tunables, and progress by name inside MDP2 subtasks
StafaH Nov 20, 2026
732e9d1
Let MDP2 splits nest and divide the same worlds
StafaH Nov 20, 2026
cb95c95
Add mdp2.choice, which draws a subtask per episode and world
StafaH Nov 20, 2026
e025fec
Give MDP2 subtasks that run together columns of their own, and add re…
StafaH Nov 20, 2026
98b4f36
Add MDP2 start events, and let reset events read the ended progress
StafaH Nov 20, 2026
850e36b
Record MDP2 quantities per episode with one flag, and keep done with …
StafaH Nov 20, 2026
5f4435c
Replace the task of a running MDP2 environment with update_task
StafaH Nov 20, 2026
f1bcf02
Add MDP2 variations that draw, record, and replay scene values
StafaH Nov 20, 2026
edea9e5
Flag actuators that CUDA graphs can replay
StafaH Nov 20, 2026
5b21b22
Capture MDP2 steps through the physics backend, and account for replays
StafaH Nov 20, 2026
6e2a3cd
Verify MDP2 captures bitwise without reproducible physics
StafaH Nov 20, 2026
c71c307
Add the resting_on term for contact-based success in MDP2
StafaH Nov 20, 2026
7be76dd
Run uses that the tasks of an MDP2 sequence define alike as one
StafaH Nov 20, 2026
99208cd
Run MDP2 uses of all the tasks of a sequence in its scope, and log pr…
StafaH Nov 20, 2026
761a0d8
Compute the MDP2 episode logs inside the captured step
StafaH Nov 20, 2026
c767884
Average MDP2 progress logs with one mean where every world runs every…
StafaH Nov 20, 2026
31f6ac1
Check that the illegal-contact termination fires in the MDP2 contact …
StafaH Nov 20, 2026
8dae7a2
Render only the cameras that MDP2 terms read
StafaH Nov 20, 2026
52a3b4b
Test the new MDP2 features in a captured Cartpole step, and fix two e…
StafaH Nov 20, 2026
4802915
Document MDP2 runtime values, switches, choices, variations, and the …
StafaH Nov 20, 2026
bf4a67e
Keep MDP2 episode logs in one generated kernel per step
StafaH Nov 20, 2026
67b1fb6
Mark the network actuators as not capturable
StafaH Nov 20, 2026
9cfdb3e
Tune MDP2 values without undoing other writes, and carry tuned values…
StafaH Nov 20, 2026
4279f31
Keep MDP2 episode statistics a row per column, so writes and sums are…
StafaH Nov 20, 2026
d2bd603
Update the measured costs of MDP2 runtime values and stages
StafaH Nov 20, 2026
bc218ca
Keep earlier inertia changes when randomizing masses
StafaH Nov 22, 2026
a0c4fd3
Address review comments on MDP2 Part 2
StafaH Nov 24, 2026
220266e
List the one-task builder among the MDP2 breaking changes
StafaH Nov 24, 2026
e4dc7e2
Merge main into MDP2 Part 2
hujc7 Nov 25, 2026
6311633
Describe the MDP2 actuator support and changelogs after merging main
hujc7 Nov 25, 2026
277d4d3
Test delayed-implicit replay, per-step bookkeeping of MDP2 tasks, and…
hujc7 Nov 25, 2026
e214512
Compute the MDP2 physics capture flag with the step work
hujc7 Nov 25, 2026
e2c5b67
Merge main into MDP2 Part 2
hujc7 Nov 25, 2026
5806801
Raise on physics other than Newton in MDP2 environments
hujc7 Nov 26, 2026
adc02e5
Require mask in Python hooks of MDP2 action terms
hujc7 Nov 26, 2026
d2591d9
Compute quantities that MDP2 actions read again after resets
hujc7 Nov 26, 2026
ad9a06e
Check the episode budget of MDP2 environments without an RL config
hujc7 Nov 26, 2026
1d3054d
Log MDP2 task progress over the episodes that ran each task
hujc7 Nov 26, 2026
a7daf59
Keep the Torch delay draw of delayed actuators and mark them not capt…
hujc7 Nov 26, 2026
7962cb3
Describe MDP2 progress logs and delayed actuator support accurately
hujc7 Nov 26, 2026
cd2f0f4
Merge main into MDP2 Part 2
hujc7 Nov 26, 2026
8dea79c
Trim the MDP2 action-hook check, capture flag, and progress tests
StafaH Nov 26, 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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Observations
.. automodule:: isaaclab_experimental.mdp2.mdp.observations
:members:

Actions
-------

.. automodule:: isaaclab_experimental.mdp2.mdp.actions
:members:

Commands
--------

Expand Down Expand Up @@ -38,3 +44,9 @@ Curriculums

.. automodule:: isaaclab_experimental.mdp2.mdp.curriculums
:members:

Variations
----------

.. automodule:: isaaclab_experimental.mdp2.mdp.variations
:members:
40 changes: 40 additions & 0 deletions docs/source/api/lab_experimental/isaaclab_experimental.mdp2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ Terms and task configuration
SubsetSelector
TaskCfg
DirectAction
Action
ActionRate
Observation
ObservationGroup
Reward
Termination
TimeLimit
Expand All @@ -31,7 +34,18 @@ Terms and task configuration
EventMode
Quantity
UniformNoise
Tunable
tunable
term_state
compose
sequence
split
choice
rename
Milestone
TaskMode
progress
progress_field

Building and running
--------------------
Expand All @@ -41,15 +55,20 @@ Building and running

MDPBuilder
MDP
Columns
Spec
MDPState
Transition
Backend
CapturedMDP
startup
process_actions
apply_actions
evaluate
reset
observe
tune
migrate

Scene data
----------
Expand All @@ -73,7 +92,11 @@ Scene data
.. autoclass:: SubsetSelector
.. autoclass:: TaskCfg
.. autoclass:: DirectAction
.. autoclass:: Action
.. autoclass:: ActionRate
:members:
.. autoclass:: Observation
.. autoclass:: ObservationGroup
.. autoclass:: Reward
.. autoclass:: Termination
.. autoclass:: TimeLimit
Expand All @@ -83,11 +106,25 @@ Scene data
:members:
.. autoclass:: Quantity
.. autoclass:: UniformNoise
.. autoclass:: Tunable
.. autofunction:: tunable
.. autofunction:: term_state
.. autofunction:: compose
.. autofunction:: sequence
.. autofunction:: split
.. autofunction:: choice
.. autofunction:: rename
.. autoclass:: Milestone
.. autoclass:: TaskMode
:members:
.. autodata:: progress
.. autofunction:: progress_field
.. autoclass:: MDPBuilder
:members:
.. autoclass:: MDP
:members:
.. autoclass:: Columns
.. autoclass:: Spec
.. autoclass:: MDPState
:members:
.. autoclass:: Transition
Expand All @@ -96,10 +133,13 @@ Scene data
.. autoclass:: CapturedMDP
:members:
.. autofunction:: startup
.. autofunction:: process_actions
.. autofunction:: apply_actions
.. autofunction:: evaluate
.. autofunction:: reset
.. autofunction:: observe
.. autofunction:: tune
.. autofunction:: migrate
.. autoclass:: SceneData
:members:
.. autoclass:: SceneSchema
Expand Down
203 changes: 193 additions & 10 deletions docs/source/experimental-features/mdp2.rst

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions source/isaaclab/changelog.d/mdp2-part2.added.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* Added :attr:`~isaaclab.actuators.ActuatorBase.capturable`, which says whether a CUDA graph can replay an actuator's
compute and masked reset with Torch work inside it: the implicit, ideal PD, and DC motor actuators. The delayed
actuators, whose masked resets draw from Torch's generator, and the network actuators are not capturable.
* Added :meth:`~isaaclab.physics.PhysicsManager.supports_step_capture` and
:meth:`~isaaclab.physics.PhysicsManager.capture`, with which environments that replay their steps as CUDA graphs
record them as the physics backend records its own step, and :meth:`~isaaclab.sim.SimulationContext.after_replay`,
which does the host work of the physics steps that a replayed graph ran, such as counting them.
Empty file.
9 changes: 9 additions & 0 deletions source/isaaclab/isaaclab/actuators/actuator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ class ActuatorBase(ABC):
If a class inherits from :class:`ImplicitActuator`, then this flag should be set to :obj:`True`.
"""

capturable: ClassVar[bool] = False
"""Whether :meth:`compute` and :meth:`reset` with an ``env_mask`` can be recorded into a CUDA graph and replayed.

They must then not synchronize with the host, nor draw from Torch's random generators, which cannot record their
draws when Torch joins the capture on the capturing stream. Environments that replay their steps as
graphs with Torch work inside them, such as MDP2's, accept only such actuators. Unlike
:attr:`~isaaclab.actuators.ActuatorCollection.is_graphable`, Torch models qualify.
"""

computed_effort: torch.Tensor
"""The computed effort [N or N·m, depending on joint type] for the actuator group.

Expand Down
6 changes: 5 additions & 1 deletion source/isaaclab/isaaclab/actuators/actuator_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import annotations

from collections.abc import Sequence
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, ClassVar

import torch
import warp as wp
Expand Down Expand Up @@ -44,6 +44,8 @@ class ActuatorNetLSTM(DCMotor):
cfg: ActuatorNetLSTMCfg
"""The configuration of the actuator model."""

capturable: ClassVar[bool] = False # Not checked in replayed graphs, so not inherited from DCMotor

def __init__(self, cfg: ActuatorNetLSTMCfg, *args, **kwargs):
if cfg.network_file is None:
raise ValueError("network_file must be provided for the Isaac Lab neural actuator model.")
Expand Down Expand Up @@ -124,6 +126,8 @@ class ActuatorNetMLP(DCMotor):
cfg: ActuatorNetMLPCfg
"""The configuration of the actuator model."""

capturable: ClassVar[bool] = False # The histories are assigned anew at every step, which a graph cannot follow

def __init__(self, cfg: ActuatorNetMLPCfg, *args, **kwargs):
if cfg.network_file is None:
raise ValueError("network_file must be provided for the Isaac Lab neural actuator model.")
Expand Down
5 changes: 5 additions & 0 deletions source/isaaclab/isaaclab/actuators/actuator_pd.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
class _DelayedActuator:
"""Shared command history and reset lifecycle for delayed actuator models."""

capturable: ClassVar[bool] = False # Masked resets draw delays from Torch's generator, which graphs cannot record

def __init__(self, cfg: DelayedImplicitActuatorCfg | DelayedPDActuatorCfg, *args, **kwargs) -> None:
self._max_delay = 0 if cfg.max_delay is None else cfg.max_delay
if not 0 <= cfg.min_delay <= self._max_delay:
Expand Down Expand Up @@ -98,6 +100,7 @@ class ImplicitActuator(ActuatorBase):
"""The configuration for the actuator model."""

is_implicit_model: ClassVar[bool] = True
capturable: ClassVar[bool] = True

def __init__(
self,
Expand Down Expand Up @@ -319,6 +322,8 @@ class IdealPDActuator(ActuatorBase):
cfg: IdealPDActuatorCfg
"""The configuration for the actuator model."""

capturable: ClassVar[bool] = True
Comment thread
StafaH marked this conversation as resolved.
Resolved

actuator_effort_limit: torch.Tensor
"""Actuator-model effort clipping limit [N or N·m, depending on joint type].

Expand Down
32 changes: 32 additions & 0 deletions source/isaaclab/isaaclab/physics/physics_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,38 @@ def handles_decimation(self) -> bool:
"""
return False

def after_replay(self, num_steps: int) -> None:
"""Do the host work of :meth:`step` for steps whose device work a CUDA graph replayed, such as advancing the
simulation time. The default does nothing.

Args:
num_steps: Calls of :meth:`step` that the graph recorded.
"""

def supports_step_capture(self) -> bool:
"""Whether :meth:`step` can be recorded into a CUDA graph by :meth:`capture`, as part of a step of an
environment that replays the graph. The default is ``False``: such environments step the physics eagerly."""
return False

def capture(self, fn: Callable[[], None]) -> Any:
"""Record ``fn`` into a Warp graph, without running it, for :func:`warp.capture_launch` to replay.

``fn`` may call :meth:`step` if :meth:`supports_step_capture` is ``True``. The backend chooses how to capture,
such as on a stream of its own while a renderer shares the device; the default records on Warp's current
stream of the device.

Args:
fn: Work to record. Perform lazy initialization before capture.

Returns:
The captured graph.
"""
import warp as wp

with wp.ScopedCapture(device=self._device) as capture:
fn()
return capture.graph

def handle_actions(self, actions: ActionManager, scene: InteractiveScene) -> bool:
"""Run the environment's actions and asset writes inside :meth:`step`, before every physics step.

Expand Down
26 changes: 22 additions & 4 deletions source/isaaclab/isaaclab/sim/simulation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,14 @@ def step(self, render: bool = True) -> None:
"""
# Block while the GUI timeline is paused so the entire training loop freezes.
# See: https://github.com/isaac-sim/IsaacLab/issues/4279
self._wait_while_paused()
self._physics_step_count += 1
self.backend_manager.step()
if render and self.is_rendering:
self.render()

def _wait_while_paused(self) -> None:
"""Block while the timeline or a visualizer is paused, keeping the visualizers responsive."""
self.backend_manager.wait_for_playing()
visualizers_to_remove = []
for viz in self._visualizers:
Expand All @@ -596,10 +604,20 @@ def step(self, render: bool = True) -> None:
logger.error("Error stepping visualizer '%s': %s", type(viz).__name__, exc)
visualizers_to_remove.append(viz)
self._remove_visualizers(visualizers_to_remove)
self._physics_step_count += 1
self.backend_manager.step()
if render and self.is_rendering:
self.render()

def after_replay(self, num_steps: int) -> None:
"""Do the host work of :meth:`step` for steps whose device work a CUDA graph replayed.

A replayed graph runs the physics steps it recorded, but not their host work: this blocks while the timeline
or a visualizer is paused, counts the steps, and lets the physics backend account for them, such as its
simulation time.

Args:
num_steps: Calls of :meth:`step` that the graph recorded.
"""
self._wait_while_paused()
self._physics_step_count += num_steps
self.backend_manager.after_replay(num_steps)

def render(self, mode: int | None = None, skip_app_pumping: bool = False) -> None:
"""Update visualizers and render the scene.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Fixed :data:`~isaaclab_experimental.mdp2.mdp.randomize_rigid_body_mass` scaling the inertias from before the
startup events: an inertia offset from :data:`~isaaclab_experimental.mdp2.mdp.randomize_rigid_body_inertia` that
ran before it was lost. It now scales the inertias at its first call, as MDP1 does.
76 changes: 76 additions & 0 deletions source/isaaclab_experimental/changelog.d/mdp2-part2.added.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
* Added cameras to :class:`~isaaclab_experimental.envs.MDP2Env`: their data types are scene fields that terms read,
such as ``camera.rgb``, and the environment renders them once per control step at
:attr:`~isaaclab_experimental.envs.Step.RENDER`, inside the step's CUDA graph.
:attr:`~isaaclab_experimental.envs.ResetStep.RENDER` renders them again after resets.
* Added :class:`~isaaclab_experimental.mdp2.ObservationGroup`, whose ``concatenate=False`` keeps a buffer per term,
with the term's own shape and element type, such as ``uint8`` images, observed as a dict of tensors, and
:data:`~isaaclab_experimental.mdp2.mdp.image_rgb`.
* Added :class:`~isaaclab_experimental.mdp2.Action`, action terms whose hooks turn their columns of the action into
writes, and :data:`~isaaclab_experimental.mdp2.mdp.binary_joint_position`, a binary gripper command with a
threshold. A Python hook takes ``mask``, the worlds where the action applies.
* Added :func:`~isaaclab_experimental.mdp2.compose`, which merges partial task configs, such as those of a scene, an
embodiment, and a task, in order.
* Added tasks of tasks to MDP2: a :class:`~isaaclab_experimental.mdp2.TaskCfg` may say when it is ``done`` (with
``hold``, ``score``, and ``final``) and hold named subtasks, which run together
(:func:`~isaaclab_experimental.mdp2.compose`, with ``require``), one after another
(:func:`~isaaclab_experimental.mdp2.sequence`), or in their own worlds (:func:`~isaaclab_experimental.mdp2.split`).
:class:`~isaaclab_experimental.mdp2.Milestone` is a task with only a completion. The uses of a task of a sequence run
while it does, and restart when it starts. A subtask reads its own fields by name, as a task that runs alone does:
its commands, quantities, term state, tunable values, and progress. Terms read the progress of every task, such as
``mdp2.progress.grasp.done``, and :class:`~isaaclab_experimental.envs.MDP2RLEnv` logs it as ``Progress/<task>`` and
records the step at which each task was done.
* Added :meth:`~isaaclab_experimental.mdp2.MDP.spec`, which names the columns of the action and of the observation
buffers, with the names of their elements, such as joint names, and
:meth:`~isaaclab_experimental.mdp2.MDP.action_mask` and :meth:`~isaaclab_experimental.mdp2.MDP.observation_mask`,
which give the columns each world takes and writes.
* Added :data:`~isaaclab_experimental.mdp2.mdp.joint_pos_normalized`, :data:`~isaaclab_experimental.mdp2.mdp.is_true`,
and :data:`~isaaclab_experimental.mdp2.mdp.one_hot`.
* Added an episode budget to :class:`~isaaclab_experimental.envs.MDP2RLEnv` for evaluation, ``episode_budget``: worlds
stop starting episodes once the budget is spent, and every episode is recorded on the device, with the quantities
marked ``Quantity(record=True)``, in :meth:`~isaaclab_experimental.envs.MDP2RLEnv.episode_records`.
* Added OptiX cameras to :class:`~isaaclab_experimental.envs.MDP2Env`: cameras with
:class:`~isaaclab_newton.renderers.NewtonOptixRendererCfg` render between the CUDA graphs of a step, since OptiX
refits its acceleration structures on the host.
* Added runtime values to MDP2: a param or reward weight declared :class:`~isaaclab_experimental.mdp2.Tunable` holds
one value per world, which :func:`~isaaclab_experimental.mdp2.tune` and
:meth:`~isaaclab_experimental.envs.MDP2Env.tune` change at each world's next reset or from the next step, while
captured steps keep replaying, leaving the other values as they are. Terms read a param as a field,
:func:`~isaaclab_experimental.mdp2.tunable`, and each world counts the tunings that took effect, recorded as
``revision``.
* Added ``when`` to MDP2 term uses: a reward, termination, observation, command, or interval event runs only in the
worlds where a field, such as a mode command, was positive at the start of the step, and restarts its state, timer,
command, and history where it turns on. ``when=mdp2.Tunable(True)`` is a switch per world that
:func:`~isaaclab_experimental.mdp2.tune` turns on and off.
* Added ``repeat`` to MDP2 tasks: a task that repeats counts its completions as ``mdp2.progress.<task>.count``, such as
the drops of an object, and restarts with its subtasks and uses once its completion no longer holds.
:class:`~isaaclab_experimental.envs.MDP2RLEnv` records the count of every episode.
* Added actions to the tasks of an MDP2 sequence: each task writes its actions while it runs, and actions of the same
name share their columns of the action, so that one policy drives every task.
* Added :class:`~isaaclab_experimental.mdp2.ActionRate` to MDP2 actions: an action at ``ActionRate.CONTROL`` applies
once per control step, before the physics steps, such as an embedded whole-body controller or inverse kinematics,
and one at ``ActionRate.PHYSICS``, the default, before every physics step.
:func:`~isaaclab_experimental.mdp2.process_actions` runs the former.
* Added nested splits to MDP2: a :func:`~isaaclab_experimental.mdp2.split` may be a step of a sequence, and several
subtasks that split divide the same worlds, such as robots and terrains, each world running the subtask of its
share of each.
* Added :func:`~isaaclab_experimental.mdp2.choice`, which draws one subtask per episode and world at the reset, by
weights, for multi-task learning: only the drawn subtask's uses run, and ``Progress/<task>`` logs its success over
the worlds that drew it.
* Added :func:`~isaaclab_experimental.mdp2.rename`, which binds a part of a task to other scene entities, so that a
part can run twice, such as two arms. Uses of subtasks that run together get columns of their own, named with the
subtask's name, as in ``left.joint_pos``; uses of subtasks that take turns share the columns of their name.
* Added start events to MDP2, ``EventMode.START``: an event writes the scene when its task starts, at the reset or,
for a task of a sequence or a choice, or one that repeats, during the episode, where the scene commits it.
* Added :meth:`~isaaclab_experimental.envs.MDP2Env.update_task`, which replaces the task of a running environment on
the same scene, such as with a reward added, and :func:`~isaaclab_experimental.mdp2.migrate`, which carries over the
state, random streams, and tunable values of the uses that both tasks have; other reward weights and params are the
new task's.
* Added variations to the MDP2 library, :func:`~isaaclab_experimental.mdp2.mdp.variation`: a reset event that draws a
value per world, such as how far a drawer is open, writes it to a scene field, and records it per episode, drawn
:class:`~isaaclab_experimental.mdp2.mdp.Uniform` (in a tunable range), from a
:class:`~isaaclab_experimental.mdp2.mdp.Choice`, or replayed in the order of the resets with
:class:`~isaaclab_experimental.mdp2.mdp.Replay`, independent of the number of worlds.
* Added :data:`~isaaclab_experimental.mdp2.mdp.resting_on`, one where an object rests on another by its contact force
in a cone and its speed, like Arena's ``object_on_destination``, for a milestone with ``hold``.
* Added sharing of uses across the tasks of an MDP2 sequence or choice: uses that the tasks define alike run as one,
while any of these tasks runs, so that their state and observation histories carry on from one task to the next.
Loading
Loading