Skip to content

[MDP2] Add MDP2 variants of 13 experimental tasks - #9159

Merged
kellyguo11 merged 29 commits into
isaac-sim:mainfrom
hujc7:jichuanh/mdp2-pr1-cartpole-reach
Nov 25, 2026
Merged

kellyguo11 merged 29 commits into
isaac-sim:mainfrom
hujc7:jichuanh/mdp2-pr1-cartpole-reach

Conversation

@hujc7

@hujc7 hujc7 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds MDP2 variants of 13 experimental tasks: the tasks that main runs with the Warp managers, and Cartpole Direct. All MDP2 tasks now live in isaaclab_tasks_experimental.mdp2, and the Warp-manager versions move under deprecated packages, which --frontend warp still runs. Trained at each task's default budget over three seeds, they match the stable Torch tasks' returns and success within the seed-to-seed spread; on one host, MDP2 trains 25–88% faster.
  • Changes isaaclab_experimental and isaaclab_tasks_experimental, moves the MDP2 tasks out of isaaclab_tasks, and updates the Warp-environment imports in isaaclab_rl: mdp2.time_out, DirectAction clip and named scale, COM-velocity and joint-wrench bindings, and a captured step that runs around actuator networks Newton cannot capture. In docs, it adds the 13 tasks to the environment browser, names isaaclab_tasks_experimental.mdp2 on the MDP2 page, notes that MDP2 replaces --frontend warp, and moves the Warp API pages under deprecated.

Description

  1. Framework changes (isaaclab_experimental):

    # Area Now
    F1 mdp2.time_out MDP field set where the time limit is evaluated, beside mdp2.terminated
    F2 DirectAction clip, and scale / clip by element-name pattern
    F3 Scene bindings body_com_vel_w; joint-wrench sensor force and torque
    F4 Capture Physics and scene reset run between the graphs when Newton's actuators cannot be captured (networks loaded from Torch checkpoints); the rest of the step stays captured
    F5 Terms Heading command that steers when it resamples; biped and locomotion terms; pose-tracking terms
    F6 Shared term state World configs that fill the shared state of a use differently (feet_slide foot matching, locomotion gear weights) fail the build instead of overwriting each other
    F7 Deprecated Warp stack Warp envs, frontend, managers, terms and utilities move to isaaclab_experimental.deprecated, their tasks to isaaclab_tasks_experimental.deprecated.core; the frontend mirrors stable modules there and warns (FutureWarning) that MDP2 replaces it
  2. Tasks (isaaclab_tasks_experimental.mdp2, ids <manager id>-MDP2):

    1. Cartpole Direct, on main's MDP2 Cartpole terms.
    2. UR10 and Franka Reach, with the reset-driven reward curriculum, which skips a reward the task disables.
    3. Flat velocity: A1, Cassie, G1, H1, ANYmal-B/C/D, Go1, derived from main's Go2 MDP2 task.
    4. Ant and Humanoid.
    5. Moved unchanged from isaaclab_tasks.mdp2: Cartpole, Go2 flat velocity and WalkStand, and Kuka Allegro lift.

    Each robot has its own module. Robots share a declared task where the stable tasks share their configs, and derive
    theirs from it with replace: REACH_TASK as the manager Reach base config, LOCOMOTION_TASK as the direct Ant and
    Humanoid environment class, and FLAT_VELOCITY_TASK as the manager velocity base config. A shared task leaves the
    robots' own uses None. Robot constants come from the stable modules (ant_common, humanoid_common, and the
    physics presets).

  3. MDP1 vs MDP2. MDP1 is the stable Torch task on main (5c40dd797ba), built by --frontend torch (gym.make of
    the registered id, e.g. Isaac-Reach-UR10): ManagerBasedRLEnv, or the direct CartpoleEnv for Cartpole Direct;
    not the Warp managers. MDP2 is the -MDP2 task on this PR. Both arms run physics=newton_mjwarp. Δ is
    (MDP2 − MDP1) / MDP1.

    1. Training results: RSL-RL PPO at each task's default max_iterations and num_envs, mean of seeds 42, 43 and 44;
      evaluation over 64 envs with seed 31415. Both arms of a pair ran on the same GPU. The MDP2 arms ran at earlier
      revisions of this PR; the later commits change neither these tasks' configs nor their CPU step traces.
# Task Iterations Envs Return MDP1 Return MDP2 Δ Metric MDP1 MDP2 Δ
1 Cartpole Direct 150 4096 4.94 4.95 +0.2% survival rate 1.00 1.00 -0.1%
2 UR10 Reach 1000 4096 0.27 0.27 +0.1% success rate 1.00 1.00 +0.0%
3 Franka Reach 1000 4096 0.13 0.13 -0.4% success rate 1.00 1.00 +0.0%
4 Unitree A1 flat 300 4096 28.85 33.67 +16.7% survival rate 0.76 0.92 +20.5%
5 Cassie flat 1000 4096 57.08 58.83 +3.1% survival rate 0.98 0.99 +0.5%
6 G1 flat 1500 4096 36.30 36.13 -0.5% survival rate 1.00 0.99 -0.5%
7 H1 flat 500 4096 36.79 37.06 +0.7% survival rate 0.99 1.00 +0.5%
8 ANYmal-B flat 300 4096 25.13 25.17 +0.2% survival rate 0.99 0.99 -0.3%
9 ANYmal-C flat 300 4096 23.37 23.99 +2.7% survival rate 0.95 0.97 +2.2%
10 ANYmal-D flat 300 4096 24.62 24.65 +0.1% survival rate 0.98 0.98 +0.0%
11 Unitree Go1 flat 300 4096 38.06 38.69 +1.7% survival rate 0.98 0.99 +0.5%
12 Ant 1000 4096 77.44 76.82 -0.8% survival rate 0.99 0.97 -2.1%
13 Humanoid 1000 4096 142.32 138.88 -2.4% survival rate 0.91 0.89 -1.6%
Per-seed values
Task Seed Return MDP1 Return MDP2 Δ Metric MDP1 Metric MDP2
Cartpole Direct 42 4.95 4.96 +0.1% 1.00 1.00
Cartpole Direct 43 4.94 4.95 +0.2% 1.00 1.00
Cartpole Direct 44 4.93 4.95 +0.4% 1.00 1.00
UR10 Reach 42 0.27 0.27 +0.1% 1.00 1.00
UR10 Reach 43 0.27 0.27 +0.1% 1.00 1.00
UR10 Reach 44 0.27 0.27 +0.2% 1.00 1.00
Franka Reach 42 0.12 0.13 +5.9% 1.00 1.00
Franka Reach 43 0.12 0.12 -1.2% 1.00 1.00
Franka Reach 44 0.13 0.12 -5.6% 1.00 1.00
Unitree A1 flat 42 36.69 38.81 +5.8% 0.94 0.98
Unitree A1 flat 43 20.47 33.18 +62.1% 0.61 0.88
Unitree A1 flat 44 29.41 29.02 -1.3% 0.74 0.90
Cassie flat 42 57.74 59.22 +2.6% 0.98 0.99
Cassie flat 43 56.75 57.59 +1.5% 0.99 0.98
Cassie flat 44 56.76 59.68 +5.2% 0.98 0.98
G1 flat 42 36.38 36.45 +0.2% 1.00 0.99
G1 flat 43 36.21 35.78 -1.2% 1.00 1.00
G1 flat 44 36.31 36.15 -0.4% 1.00 0.99
H1 flat 42 37.00 37.18 +0.5% 1.00 1.00
H1 flat 43 36.92 36.98 +0.1% 1.00 1.00
H1 flat 44 36.45 37.04 +1.6% 0.98 1.00
ANYmal-B flat 42 24.95 25.06 +0.4% 0.98 0.98
ANYmal-B flat 43 25.36 25.34 -0.1% 1.00 1.00
ANYmal-B flat 44 25.07 25.10 +0.1% 1.00 0.99
ANYmal-C flat 42 23.99 24.19 +0.8% 0.98 0.98
ANYmal-C flat 43 22.45 23.90 +6.4% 0.91 0.98
ANYmal-C flat 44 23.67 23.90 +1.0% 0.95 0.95
ANYmal-D flat 42 24.60 24.84 +1.0% 0.98 0.98
ANYmal-D flat 43 24.54 24.58 +0.2% 0.99 0.96
ANYmal-D flat 44 24.72 24.52 -0.8% 0.96 0.98
Unitree Go1 flat 42 38.35 39.03 +1.8% 0.98 0.98
Unitree Go1 flat 43 37.15 39.22 +5.6% 0.98 0.98
Unitree Go1 flat 44 38.68 37.81 -2.2% 0.98 0.99
Ant 42 78.47 79.84 +1.8% 1.00 1.00
Ant 43 77.48 74.43 -3.9% 0.99 0.97
Ant 44 76.39 76.20 -0.2% 0.99 0.95
Humanoid 42 147.76 130.05 -12.0% 0.88 0.88
Humanoid 43 130.45 156.54 +20.0% 0.92 0.90
Humanoid 44 148.73 130.06 -12.6% 0.92 0.91
  1. Training throughput (steps/s, median over a full default-budget run, seed 44). All tasks on one host (8× L40), one
    task per GPU with dedicated CPU cores, both arms of a task on the same GPU.
# Task Envs MDP1 steps/s MDP2 steps/s Δ
1 Cartpole Direct 4096 531k 754k +42.1%
2 UR10 Reach 4096 367k 501k +36.3%
3 Franka Reach 4096 295k 442k +49.5%
4 Unitree A1 flat 4096 294k 450k +53.1%
5 Cassie flat 4096 278k 412k +48.2%
6 G1 flat 4096 164k 205k +24.8%
7 H1 flat 4096 249k 338k +35.7%
8 ANYmal-B flat 4096 183k 238k +30.2%
9 ANYmal-C flat 4096 170k 219k +28.9%
10 ANYmal-D flat 4096 185k 233k +26.3%
11 Unitree Go1 flat 4096 268k 386k +43.7%
12 Ant 4096 500k 939k +87.9%
13 Humanoid 4096 358k 535k +49.7%
  1. Validation:
    • CPU, Newton/MJWarp: all 13 tasks build, reset and step; test_mdp2.py and the Newton articulation tests pass;
      pre-commit run --from-ref upstream/main --to-ref HEAD and tools/update_environments_rst.py --check pass.
    • GPU (RTX PRO 6000, the same change on 2d74247b4c0): the MDP2 env, term and contact tests pass (63 passed), and so does the experimental smoke test (13
      tasks), which also checks the graphs per captured step: A1 1, ANYmal-D 2, Go1 2.
    • GPU (RTX PRO 6000, 5059904dabf): the experimental env tests pass (13 tasks and the Reach curriculum test), and
      so do the contact-term tests and test_mdp2.py (35 passed). The curriculum test fails when the kernel drops its
      step threshold.
    • Module layout (9336af17a7a): the 13 tasks' resolved env configs, compared field by field in order, are identical
      before and after the per-robot modules and shared tasks; the env, contact-term and test_mdp2.py tests pass on
      GPU (49 passed), and the regenerated environment browser leaves every MDP2 row unchanged.
    • Review round (e94cae2c67f, GPU RTX PRO 6000): each reviewer-reported case is a test that fails without its fix.
      World configs that select different feet for feet_slide, or give a gear-weighted reward different gear ratios,
      fail the build and leave no simulation behind; with the same feet, every world matches MDP1 on both backends.
      Franka Reach with action_rate disabled builds and applies the joint_vel curriculum. After the task and Warp
      moves: the experimental MDP2 tests pass (24), and so do the experimental, isaaclab_rl entrypoint and stable
      tests that import the Warp code (304 passed, 1 skipped); --frontend warp trains Cartpole and Cartpole Direct
      for two iterations; the regenerated environment browser is unchanged.
    • verify_capture: UR10 Reach, ANYmal-D and Ant pass. Humanoid and Go1 also differ between two uncaptured runs
      (contact physics is not bitwise reproducible), so the check cannot separate capture from that noise there.
  2. For reviewers: follow-ups, not in this PR: a public capturability query on the physics manager; DirectAction
    growing into an action term; an ordered SubsetSelector for feet_slide; a declarative Reach curriculum; per-action
    last_action views.

Suggested reviewers: StafaH (MDP2 runtime), AntoineRichard (isaaclab_experimental).

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshots

Not applicable.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks (pre-commit run --from-ref upstream/main --to-ref HEAD)
  • I have made corresponding changes to the documentation (the task package in mdp2.rst, the environment browser, the --frontend warp note and the deprecated API pages)
  • 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

@hujc7

hujc7 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Nov 23, 2026
@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 23, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 24, 2026
@hujc7 hujc7 changed the title [MDP2] Part 1/4: Run Cartpole Direct and the UR10 and Franka Reach tasks on MDP2 [MDP2] Move 16 experimental tasks onto the MDP2 runtime Nov 24, 2026
hujc7 added 11 commits November 23, 2026 23:08
Terms that must tell a time-out from a termination, such as a success reward that pays only before the time
limit, would otherwise repeat the builder's time limit in control steps as a task param, which diverges from it
when the decimation, the physics step or the episode length changes. Expose whether a time-out was reached this
step as the MDP field mdp2.time_out, parallel to mdp2.terminated and like MDP1's time_outs: the time limit and
time-out terminations set it, also in worlds that a termination ended in the same step. Quantities run before
terminations, so they see only the time limit.
The Ant and Humanoid tasks scale their joint efforts per joint by gear ratio and clip them at the gear
magnitude, since unbounded joint efforts drive the solver to NaN. DirectAction takes clip, and takes scales and
clip ranges as dictionaries of name patterns over the selected elements: unmatched elements keep a unit scale
and no bounds. Both backends apply them in the fused action kernel, and world configs keep their own named
scales.
Add the scene fields that the biped and Ant/Humanoid terms read: the body COM velocity of articulations, for
the foot slide reward, and the force and torque of joint wrench sensors, for the foot wrench observation. Each
is a live view of the asset's or the sensor's data, like the fields bound already.
Newton runs LSTM and MLP actuator networks from Torch checkpoints on the host and cannot record them into a
graph. Newton already reports whether its actuators can be captured, and the environment already runs
non-capturable work between graphs, so classify the physics and scene-reset work by the backend's actuators:
the rest of the step stays captured, and networks that Newton can capture are captured with it. The scene data
accepts LSTM and MLP networks that Newton runs; Isaac Lab's Torch networks stay refused.
MDP1's command manager updates the commands right after a reset, so the first observation of an episode
already carries the yaw rate steered towards the new heading. heading_velocity_command steers only at its
next update, and observes the drawn yaw rate first. heading_velocity_command_steered_on_resample also steers
at its resample, so that the flat velocity tasks observe what MDP1 observes, without changing the existing
command. The test checks that both backends agree and that the steered variant gives at its resample what
the plain command gives at its first update.
Port the MDP1 terms that the flat velocity bipeds and the Ant and Humanoid tasks use: the biped air-time,
air-time variance and foot slide rewards, velocity tracking in the yaw frame and around the world vertical
axis, and the incoming joint wrench of the feet as an observation. Each has a Torch and a Warp
implementation. The MDP1 parity tests compare them with their MDP1 functions on the same Newton states; the
term fixture steps the physics once so that its joint wrench sensor reports wrenches, and the contact test
tilts the robots so that their feet land unevenly and every reward is nonzero.
Port the MDP1 terms that the Reach tasks use: the position and orientation errors of a body from a pose
command in the root frame, and the pose command success termination on those errors. The Reach success reward
pays only before the time limit, so is_terminated_before_time_out reads mdp2.terminated and mdp2.time_out
instead of a time limit in control steps passed as a task param. The MDP1 parity tests compare the errors and
the success with MDP1's functions and pose command on the same Newton states, and the library term test
covers a termination before and at the time limit.
…task

The task importer finds registrations in the new isaaclab_tasks_experimental.mdp2 package. Cartpole Direct
reuses the MDP2 Cartpole task on main and lays out the policy observation in the Direct workflow's cart, pole
order. The MDP2 smoke test selects the tasks registered from isaaclab_tasks.mdp2, so add the same
reset-and-step test for the new package, and state in the MDP2 docs which tasks live in which package.
Declare the joint-position Reach tasks as TaskCfg literals: the UR10 and Franka tasks share the observations,
rewards and terminations, and each has a Newton physics preset and the manager task's scene class with its arm
asset. The end effector's pose errors are quantities that the tracking rewards and the success termination
read, and the success reward pays only for a success before the time limit. The Reach environment applies the
manager tasks' reset-driven reward curriculum at the first reset after its step threshold.
Add flat-ground velocity tracking for the Unitree A1, Cassie, Unitree G1 and H1, ANYmal-B, -C and -D and Unitree
Go1. The shared task derives from main's Unitree Go2 MDP2 task with replace, changing only the base body, the
action rate weight, the heading command that steers when it resamples, and the Go2-specific base height
penalty. The A1 takes the shared task and scene with its own MJWarp solver settings. The other robots replace
the shared task's terms where their manager tasks differ, and take the manager tasks' flat terrain scene with
their robot asset and their MJWarp solver settings. The bipeds use the biped air-time and foot slide rewards;
the ANYmal and Go1 tasks keep their learned actuator checkpoints, which Newton runs. The smoke test checks how
many graphs a captured step replays: one for PD actuators (A1), and two for actuator networks from Torch
checkpoints (ANYmal-D, Go1), around the physics and the scene reset that Newton cannot capture.
Port the Ant and Humanoid manager tasks. Their task-specific terms (heading and up projections, progress, the
move-to-target and upright bonuses, power consumption, the joint limit penalty, the termination penalty and
the survival quantity) live with the tasks. The two TaskCfg literals share their quantities and reset events,
each has a Newton physics preset and the manager task's scene class, and their joint efforts are scaled by gear
and clipped at the gear magnitude. Both observe the incoming joint wrench of their feet, and the logged
survival reads mdp2.time_out rather than a time limit in control steps.
@hujc7
hujc7 force-pushed the jichuanh/mdp2-pr1-cartpole-reach branch from 45f9b20 to ee24815 Compare November 24, 2026 07:13
@hujc7 hujc7 changed the title [MDP2] Move 16 experimental tasks onto the MDP2 runtime [MDP2] Move 13 experimental tasks onto the MDP2 runtime Nov 24, 2026
@hujc7
hujc7 marked this pull request as ready for review November 24, 2026 07:46
@hujc7
hujc7 requested a review from a team November 24, 2026 07:46
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no new actionable findings.

Summary

Adds 13 experimental MDP2 task variants while keeping the existing tasks.

  • MDP2 actions can scale and clip values by matching element names.
  • MDP2 reports time limits separately from other terminations.
  • MDP2 adds the robot signals and task terms used by locomotion and Reach.
  • MDP2 keeps eligible step work captured when Newton actuator networks cannot be captured.
  • UR10 and Franka arms can train to reach commanded poses on MDP2.
  • Eight quadrupeds can train on flat-ground velocity tasks with MDP2.
  • Cassie, G1, and H1 can train on flat-ground velocity tasks with MDP2.
  • Ant and Humanoid can train with MDP2 locomotion tasks.
  • Cartpole Direct can run as an MDP2 task.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'upstream/m..." · Reviewed by Greptile

Comment on lines +40 to +43
for _ in range(3):
actions = 2.0 * torch.rand(env.action_space.shape, device=env.unwrapped.device) - 1.0
obs, reward, terminated, truncated, _ = env.step(actions)
assert all(torch.isfinite(value).all() for value in [*obs.values(), reward])

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 Reach curriculum goes untested

This smoke test runs only three steps, but the new Reach curriculum waits until after 4,500 steps and a reset. It never checks either reward-weight change, so a broken counter or reset condition could silently change training while this test passes.

Add a focused test with a small threshold. Check that both weights stay unchanged until a reset after the threshold, then change for every world, including during captured steps.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Added test_reach_curriculum_sets_reward_weights_at_first_reset_after_threshold: Franka Reach with a two-step threshold and four-step episodes. It checks that both weights stay unchanged until the first reset after the threshold, then change in every world, from a captured step. (9b9bdf7)

@isaaclab-review-bot isaaclab-review-bot Bot 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.

Isaac Lab Review Bot

Needs attention: Design and architecture (2), Scope and over-engineering (3), Implementation (6), Style consistency (9), Test quality (2). Other reviewed categories look good.

  • PR description: Replace “move” with “add variants,” include documentation scope, qualify seed-spread equivalence, and supplement supplied L40/Newton/4096-environment throughput measurements with exact candidate revisions, reproducible commands, software environment, warmup treatment, and metric calculation.
  • Design and architecture: Environment capture scheduling reads Newton actuator internals, coupling lifecycle decisions to backend storage; expose capturability through the physics manager.
  • Scope and over-engineering: Minimal implementation: extend MDP2 builder/backends, scene bindings, and shared Warp math; remove uniform-clip expansion, unused compute inputs, and duplicate survival conversion. Keep all eight added initializers, seven task-config modules, velocity_flat.py, locomotion/mdp.py, and reach_env.py for its reset lifecycle. Suggested PR breakdown: runtime capabilities/actions/fields with owner tests; Cartpole/Reach with policy/curriculum validation; velocity variants with contact/network validation; Ant/Humanoid with locomotion parity.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Replicated foot mappings share non-world-indexed state, so the last initializer overwrites earlier configurations; store alignment separately per configuration.
  • Style consistency: New locomotion terms omit public contract documentation, leaving units, frames, and reset behavior unclear; add concise docstrings and concrete hook annotations.
  • Test quality: The fixed-action oracle repeats production transformations, weakening independent proof; replace it with numerical expectations while retaining distinct physical, backend-parity, timeout, and registration coverage.

Significant concerns. Posted 22 inline findings.

Automated review; human maintainers own approval decisions.

torch=_feet_slide_torch,
warp=_feet_slide,
init=_align_foot_contacts,
state={"aligned_sensor_ids": State(("body_ids",), persistent=True)},

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.

🔴 Critical · Implementation — Separate replicated foot alignments

Replicated tasks with different foot mappings share this non-world-indexed state by use name. The last initializer overwrites earlier mappings, so those worlds read the wrong contacts. Store alignment per configuration.

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.

No registered task replicates feet_slide: only the single-task biped configs use it, and the one replicated task, Go2 WalkStand, does not. An ordered SubsetSelector for feet_slide, which removes this alignment state, is listed as a follow-up.

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.

I tried two replicated configs with the same reward name, one selecting the left foot and one the right. The second config overwrote the first config’s sensor mapping, so the first world got zero reward on both Torch and Warp when it should’ve had a nonzero value. Could we keep the mapping per compiled op, or reject mixed mappings until the ordered selector lands?

observations={
"policy": {
f"{joint}_{name}": replace(term, inputs={**term.inputs, "joint_ids": subset})
for name, term in TASK.observations["policy"].items()

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.

🔴 Critical · Implementation — Restore Cartpole Direct observation order

The name-first comprehension emits cart position, pole position, cart velocity, pole velocity rather than cart position, cart velocity, pole position, pole velocity. Iterate joints before observation terms.

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.

The order already matches the Direct environment (cartpole_direct_env.py: cart and pole positions, then cart and pole velocities), since the outer loop runs over the terms and the inner one over the joints. Reworded the docstring to state the order. (2a1683d)

self._curriculum_step = ProxyArray(wp.zeros(1, dtype=wp.int32, device=self.device))
self._curriculum_applied = wp.zeros(1, dtype=wp.bool, device=self.device)
reward_indices = {op.use: op.index for op in self.mdp.ops[mdp2.Phase.REWARDS]}
self._action_rate_index = reward_indices["rewards.action_rate"]

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.

🔴 Critical · Implementation — Handle disabled curriculum rewards

TaskCfg permits disabling rewards, but disabling either curriculum target raises KeyError after simulation construction. Validate required rewards before construction or make the curriculum tolerate their absence.

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.

Both Reach configs keep action_rate and joint_vel, so no registered task reaches this. A declarative Reach curriculum is listed as a follow-up.

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.

I set action_rate=None on Franka Reach and got a KeyError after the sim had already started. The simulation singleton was still registered after the failure, so it also gets in the way of retrying. Can the curriculum skip disabled rewards, or validate them before starting the sim?

self._substeps = cfg.decimation if sim.backend_manager.handles_decimation() else 1
# Newton actuators that it cannot capture, such as networks loaded from Torch checkpoints, run on the host:
# the physics, which steps them, and the scene reset, which resets them, then run between the graphs.
actuators = sim.backend_manager.backend.actuators

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.

🟡 Warning · Design Architecture — Query capture capability through physics

The environment inspects Newton's actuator container to schedule physics and resets. This couples environment lifecycle to backend internals; expose and consume capturability at the physics-manager boundary.

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.

This PR stays within the MDP2 packages, and InteractiveScene.is_graphable covers only Isaac Lab's Torch actuators and fixed tendons, not Newton's own drives. A public capturability query on the physics manager is listed as a follow-up.

``default_joint_vel``, ``joint_pos_target``, ``joint_effort_target`` and ``applied_effort`` [N·m or N],
``soft_joint_vel_limits``, and ``soft_joint_pos_limits`` (``wp.vec2f``), per world and joint. The ``scene``
entity provides ``env_origins`` [m] and ``gravity_w`` (``wp.vec3f``, with magnitude) [m/s^2] per world.
Articulations provide ``body_com_vel_w`` (a world-frame ``wp.spatial_vectorf`` per world and body, linear then

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.

🟡 Warning · Style Consistency — Specify COM velocity units

body_com_vel_w states frame and component order but omits linear [m/s] and angular [rad/s] units. Add them to the field contract.

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.

Added the units. (9479320)

return float(time_out[world])


survival = Term(torch=lambda time_out: time_out.float(), warp=_survival)

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.

🟡 Warning · Scope Complexity — Reuse the boolean reward term

survival duplicates mdp.is_terminated's boolean-to-float operation. Bind that term's terminated input to mdp2.time_out and delete this implementation pair.

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.

survival is the logged success_rate quantity, bound to mdp2.time_out. is_terminated is documented as bound to mdp2.terminated and excluding time-outs, so reusing it here would read as the opposite.

if applied[0] or step[0] <= after_steps:
return
resetting = bool(False)
for world in range(reset_mask.shape[0]):

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.

🟡 Warning · Implementation — Batch the curriculum reset update

One Warp thread scans the reset mask and writes every world's weights serially. Use a batched reset check and per-world writes while preserving the first-reset gate.

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.

The kernel returns at once except between the threshold and the first reset after it, so the serial loop runs for only a few steps per run.

"actions": mdp2.Observation(mdp.last_action, inputs={"actions": mdp2.last_action}),
}
}
"""Observations of both arms: the joint state, the commanded pose, and the last action."""

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.

🟡 Warning · Style Consistency — Remove repeated configuration inventories

The OBSERVATIONS, REWARDS, and TERMINATIONS prose repeats adjacent keys without explaining a constraint. Remove these inventories or replace them with non-obvious intent.

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.

The REWARDS docstring states a constraint (the joint velocity penalty differs per robot), and the three inventories are documented alike.

},
weight=-0.1,
),
# Fixes the tilted gait.

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.

🟡 Warning · Style Consistency — Explain the gait constraint

“Fixes the tilted gait” claims an outcome without explaining the penalty. Say that unequal swing and stance durations are penalized to discourage an asymmetric gait.

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.

This is the stable H1 config's comment (core/velocity/config/h1/flat_env_cfg.py), kept as is.

self.task = tasks[0] if isinstance(self.task, mdp2.TaskCfg) else tasks


def flat_velocity_sim(**solver: Any) -> sim_utils.SimulationCfg:

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.

🟡 Warning · Style Consistency — Restore prescribed module ordering

Public functions follow public classes, and FLAT_TERRAIN_SCENE follows both. Put constants before functions and public functions before classes.

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.

The contribution guide does not prescribe a module order, so this stays.

@hujc7 hujc7 changed the title [MDP2] Move 13 experimental tasks onto the MDP2 runtime [MDP2] Add MDP2 variants of 13 experimental tasks Nov 24, 2026
@hujc7

hujc7 commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review


MDP2 lives in ``isaaclab_experimental.mdp2``, and its tasks in ``isaaclab_tasks.mdp2``. It is an experimental
feature: expect its API to change.
MDP2 lives in ``isaaclab_experimental.mdp2``, and its tasks in ``isaaclab_tasks.mdp2`` and

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.

let's move the ones in isaaclab_tasks.mdp2 into isaaclab_tasks_experimental.mdp2 as well, so we consolidate everything together

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.

can we remove the previous tasks under isaaclab_tasks_experimental? or at least move them into a deprecated folder or something so that it's not confusing?

The curriculum looked up both reward columns by name after the simulation started, so a task that disabled
action_rate or joint_vel raised KeyError and left the simulation instance behind. A disabled reward now has no
column to set, and the curriculum test runs with action_rate disabled too.
feet_slide and the gear-weighted locomotion rewards fill a state without a world dimension in their init hooks.
World configs that define such a use differently share that state, so the last config overwrote the others and
their worlds read another config's feet or gears. The state now starts as NaN and a second init that fills it
with different values raises ValueError at build. Tests cover mixed and matching feet against MDP1 on both
backends, and mixed gear ratios, which also leave no simulation behind.
All MDP2 tasks now live in isaaclab_tasks_experimental.mdp2. The Cartpole package registers both
Isaac-Cartpole-MDP2 and Isaac-Cartpole-Direct-MDP2, with the Direct config in cartpole_direct_env_cfg.py as in
isaaclab_tasks.core.cartpole. The Go2 and Kuka Allegro lift packages move unchanged; task IDs stay the same. The
experimental environment test collects the moved tasks by entry point, so the stable copy of it goes.
MDP2 replaces --frontend warp, so the Warp manager-based and direct environments, the frontend, the managers, the
terms, and the utilities move to isaaclab_experimental.deprecated, and their tasks to
isaaclab_tasks_experimental.deprecated.core. The frontend mirrors stable modules into these packages, so
--frontend warp runs the same tasks as before. Imports in isaaclab_rl, tools, the tests and the API pages follow,
with redirects from the old API pages, and the Warp environments page says that MDP2 replaces the frontend.
Building an environment through the Warp frontend now emits a FutureWarning that points to the MDP2 tasks and
their docs, and the --frontend help says that MDP2 replaces 'warp'. The frontend build test checks the warning.
@hujc7

hujc7 commented Nov 25, 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 25, 2026
@kellyguo11
kellyguo11 enabled auto-merge (squash) November 25, 2026 03:17
@kellyguo11
kellyguo11 merged commit 96a8a4a into isaac-sim:main Nov 25, 2026
66 of 96 checks passed
kellyguo11 pushed a commit that referenced this pull request Nov 25, 2026
…tasks by default (#9219)

## Summary

`isaaclab train --task Isaac-Cartpole-MDP2` without `--rl_library` picks
the task's registered RL library again, and the
Reach curriculum test now fails if the curriculum writes to the wrong
reward weight. Follow-up to #9159 (MDP2 variants
of 13 experimental tasks).

# Description

| # | Area | Now |
|---|---|---|
| 1 | `isaaclab_rl` default library | `_resolve_default_library` also
imports `isaaclab_tasks_experimental` when it is installed, where #9159
placed the `-MDP2` tasks. |
| 2 | Reach curriculum test | Compares the whole reward-weight tensor
and adds a case with `joint_vel` disabled. An unguarded write through
index -1 then puts that weight into the last active reward column
(`action_magnitude`). |

Validation (desk, RTX PRO 6000 Blackwell, `physics=newton_mjwarp`):

- Dispatch tests in `test_entrypoints.py`: 2 passed; with `dispatch.py`
at `main`, the new test fails.
- Reach curriculum test: 3 passed; with the kernel's `>= 0` guards
removed, `[joint_vel]` fails.
- `isaaclab train --task Isaac-Cartpole-MDP2 physics=newton_mjwarp
--num_envs 64 --max_iterations 2`, no `--rl_library`: selects `rsl_rl`,
trains, exits 0.

Suggested reviewers: `ooctipus`, `kellyguo11` (reviewed #9159).

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Screenshots

Not applicable.

## Checklist

- [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`
- [x] No documentation change is needed (a bug fix and a test change)
- [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 added a commit to StafaH/IsaacLab that referenced this pull request Nov 25, 2026
Main gained the MDP2 variants of 13 experimental tasks (isaac-sim#9159) and the shared delayed-actuator mixin (isaac-sim#8992).

- Delayed actuators: the device-stream delay draw moves into _DelayedActuator, so DelayedPDActuator and
  DelayedImplicitActuator both draw delays on the device.
- Physics capture: the physics and the scene reset leave the graphs where Newton runs an actuator it cannot
  capture, such as TorchScript networks; MDP2 accepts Newton's own actuators again.
- Actions: per-element scale and clip of DirectAction resolve on top of the slot-based action columns, and
  only direct actions get scale and clip arrays.
- Tasks added on main use Quantity(record=True).
@hujc7 hujc7 mentioned this pull request Nov 25, 2026
8 tasks done
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 infrastructure isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants