Skip to content

[Tasks] Final isaaclab_tasks cleanup pass for 3.0 - #7919

Merged
StafaH merged 3 commits into
isaac-sim:developfrom
StafaH:tasks/final-cleanup-pass
Sep 20, 2026
Merged

StafaH merged 3 commits into
isaac-sim:developfrom
StafaH:tasks/final-cleanup-pass

Conversation

@StafaH

@StafaH StafaH commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Description

The per-task cleanups for 3.0 landed in separate PRs by different contributors and drifted in style. This is one consolidating pass over isaaclab_tasks (core in full, contrib where needed) with the goal of a single consistent convention, shared MDP terms, and no per-step waste in the terms.

Consistency (core)

  • Module docstrings everywhere; one section-banner scheme (Scene definition / MDP settings / Environment configuration); one mdp import form; relative from . import agents; uniform gym registration key order (and the missing default_agent entries for Isaac-Shadow-Handover, Isaac-Lift-Cable-Franka, Isaac-Lift-Cable-Franka-Camera).
  • .pyi stubs use sorted __all__, relative imports, and the from isaaclab.envs.mdp import * fallback last.
  • ManagerTermBase subclasses take (cfg, env) like the base class; the locomotion terms now also call super().__init__.
  • Removed stale isort:skip and "Pre-defined configs" banners, historical/changelog-style comments, commented-out code, and (w, x, y, z) quaternion docstrings (Isaac Lab uses (x, y, z, w)).
  • Replaced deprecated viewer writes with sim.default_visualizer_cfg (handover, Franka soft-body).

Shared MDP terms moved to isaaclab.envs.mdp (task packages still resolve them through their stub fallback, so mdp.<term> in configs is unchanged)

  • survival_success_rate (was triplicated in cartpole, locomotion, dr_legs), terminated_penalty, joint_pos_target_l2.
  • DifficultyScheduler and initial_final_interpolate_fn from lift, with a success_term_name parameter.
  • Fourbar's joint_pos_cos / joint_pos_sin moved from rewards.py to observations.py.

De-duplication

  • New cartpole_common.py, ant_common.py, humanoid_common.py hold the physics/camera presets, gears, targets and terrain previously copy-pasted between the direct and manager workflows. Removed the no-op AntObservationsCfg / HumanoidObservationsCfg presets and the dead vision_camera.show_collage debug helper.
  • _FrankaSoftSceneCfg / _FrankaSoftCameraSceneCfg become the public FrankaSoftBaseSceneCfg / FrankaSoftBaseCameraSceneCfg since the cloth and cable configs subclass them.

Performance

  • Cached the reorient cube-corner offsets (rebuilt on device every step), scalar comparisons in the deformable/cable bounds terminations, expand instead of repeat / repeat_interleave in the lift, handover and reorient hot paths, cached marker constants in ReorientCommand, gear ratios resolved once as a (num_joints,) vector.

Fixes found along the way

  • LiftEnvCfg lacked @configclass.
  • The lift ADR curriculum interpolated the point-cloud noise upper bound to -0.01 (now 0.01).
  • Stale docs literalinclude ranges for the joint-wrench sensor page and the moved cartpole presets.

Contrib (targeted)

  • dr_legs duplicate survival_success_rate removed and constructor order fixed; wp.to_torch replaced by .torch in drone_arl; quaternion-order docstrings fixed in deploy/keyboard; hoisted an inline math_utils import in assemble_trocar; module docstrings for 15 files.

Tests

  • Deleted the dead test/benchmarking/ scaffolding, the permanently skipped determinism test and the empty XFAIL_TASKS branch; converted the lone unittest.TestCase file to pytest; removed single-element parametrizes, redundant prints, a repo-layout-only test and a never-asserting lazy-export test; fixed wxyz identity quaternions in the lift cfg test.

Audit findings deliberately not changed here because they alter task behavior and need an owner call: contrib/multitask_manipulation/mdp/utils.py converts an xyzw offset quaternion to="wxyz" before combine_frame_transforms; contrib/drone_arl/mdp/events.py writes [1, 0, 0, 0] as an identity quaternion (a 180° x-rotation in xyzw); contrib/stack/mdp/observations.py::object_grasped can raise UnboundLocalError when gripper_joint_names is absent; the Humanoid manager terrain lacks the friction_combine_mode="average" the direct cfg sets.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Verification: all 48 registered task configs load kitless without forbidden imports; 251 task unit tests pass; the experimental capture-safety tests pass; a kitless Newton smoke run of the touched Cartpole, Ant, Humanoid, Fourbar, Allegro/Shadow reorient, handover, cabinet, reach, lift and AnymalD tasks passes.

🤖 Generated with Claude Code

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Apply one consistent convention across the core task packages (module
docstrings, section banners, mdp and agents import forms, gym
registration layout, sorted relative .pyi stubs, ManagerTermBase
constructor order) and move the terms duplicated across tasks
(survival_success_rate, terminated_penalty, joint_pos_target_l2,
DifficultyScheduler, initial_final_interpolate_fn) into isaaclab.envs.mdp.

Share the direct/manager physics, camera and asset presets of the
cartpole, Ant and Humanoid tasks through common modules, cache per-step
constants in the reorient and lift terms, fix the LiftEnvCfg configclass
decorator and the lift ADR noise sign, correct (w, x, y, z) quaternion
docstrings, and drop dead test scaffolding and no-op tests.
@StafaH
StafaH requested a review from a team September 20, 2026 07:26
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team labels Sep 20, 2026
@greptile-apps

greptile-apps Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR should not merge until the task MDP packages retain the wildcard-export compatibility of the terms moved into isaaclab.envs.mdp.

Findings

  1. P1 Wildcard exports lose moved terms

Summary

This PR consolidates task-package conventions, moves duplicated MDP terms into the shared environment package, extracts common task presets, and removes repeated allocations from several hot paths.

  • Shared rewards and ADR curriculum terms now resolve through task MDP fallback packages.
  • Cartpole, Ant, Humanoid, lift, handover, and reorientation configurations share presets and optimized tensor operations.
  • Documentation and tests are updated alongside removal of obsolete scaffolding.
  • The task stubs do not retain the moved terms in __all__, breaking their previous wildcard-import contract.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    Config["Task configs: mdp.term"] --> TaskMDP["Task MDP lazy_export"]
    TaskMDP --> Local["Task-local terms"]
    TaskMDP -->|"fallback __getattr__"| Shared["isaaclab.envs.mdp"]
    Shared --> Terms["Shared rewards and curricula"]
    Star["from task.mdp import *"] --> All["Task __all__"]
    All --> Local
    All -. "moved names omitted" .-> Shared
Loading

Reviews (1) · Last reviewed commit: "Unify isaaclab_tasks coding style and sh..."

"joint_pos_target_l2",
"survival_success_rate",
]
__all__ = ["CameraImageStack"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Wildcard exports lose moved terms

The moved terms remain available through direct mdp.<name> access, but removing them from the task stubs’ __all__ breaks wildcard imports. For example, from isaaclab_tasks.core.cartpole.mdp import * previously exported joint_pos_target_l2 and survival_success_rate; it now exports only CameraImageStack, because lazy_export() does not add fallback-package names to __all__. The corresponding locomotion, lift, and DR-legs stubs have the same issue, so callers using those public wildcard exports receive missing names.

from isaaclab.sensors import CameraCfg
from isaaclab.utils import configclass

from isaaclab_tasks.utils import PresetCfg

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am seeing mixed absolute import and relative import

# SPDX-License-Identifier: BSD-3-Clause

__all__ = [
"CameraImageStack",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

here changed from abs to relative

@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

The cleanup consolidates shared MDP terms and task presets, but introduces an avoidable cross-task dependency in the Humanoid direct scene that should be corrected before merge.

  • Design and architecture: Finding 0 is valid: humanoid_direct_env_cfg.py imports TERRAIN_CFG from the Ant-specific ant_common.py, making Humanoid behavior depend on an unrelated task package and causing future Ant terrain changes to propagate into Humanoid. Move the terrain configuration to an appropriately shared locomotion module or restore Humanoid-owned terrain configuration.
  • API: The reviewed MDP-term moves preserve task-level mdp.<term> resolution through the stub fallback, and no separate public API break is established by the accepted finding.
  • Implementation: The main implementation concern is the changed producer path for HumanoidDirectSceneCfg.terrain: it now references Ant-owned configuration rather than a Humanoid- or locomotion-owned definition. The allocation-reduction and term-relocation paths reviewed do not otherwise support a candidate finding.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

from isaaclab.utils import configclass

from isaaclab_tasks.utils import PresetCfg
from isaaclab_tasks.core.locomotion.ant.ant_common import TERRAIN_CFG

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.

🔵 Suggestion · Design Architecture — Humanoid scene imports terrain from ant package

HumanoidDirectSceneCfg now takes TERRAIN_CFG from locomotion.ant.ant_common, so tuning the Ant ground plane silently changes the direct Humanoid task. This also splits ownership: humanoid_common.py was added in this change for exactly such shared constants, and humanoid_manager_env_cfg.py still declares its own terrain inline. Place the shared terrain in a locomotion-level module (or humanoid_common.py) used by both Humanoid workflows.

@@ -173,3 +131,22 @@ def __call__(
return torch.sum(
torch.abs(env.action_manager.action * asset.data.joint_vel.torch * self.gear_ratio_scaled), dim=-1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just notice this power consumption definiton looks quite problematic it assume action is torque

@StafaH

StafaH commented Sep 20, 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 Sep 20, 2026
- Use relative imports within task subpackages (max three dots) and absolute
  imports across packages
- Own the Humanoid terrain in humanoid_common instead of importing it from Ant
- Re-export the moved shared MDP terms from the task stubs so wildcard imports
  keep working
- Drop the leading underscore from helpers imported across files
- Clarify the power_consumption docstring and other readability nits
- Fix the keyboard SuccessMonitor import and the capture-safety test lookups
@StafaH
StafaH force-pushed the tasks/final-cleanup-pass branch from 2d6a148 to 5be8716 Compare September 20, 2026 16:35
@StafaH

StafaH commented Sep 20, 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 Sep 20, 2026
@StafaH
StafaH merged commit 0c5dcbc into isaac-sim:develop Sep 20, 2026
53 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as ef1514c.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 20, 2026
# Description

The per-task cleanups for 3.0 landed in separate PRs by different
contributors and drifted in style. This is one consolidating pass over
`isaaclab_tasks` (core in full, contrib where needed) with the goal of a
single consistent convention, shared MDP terms, and no per-step waste in
the terms.

**Consistency (core)**
- Module docstrings everywhere; one section-banner scheme (`Scene
definition` / `MDP settings` / `Environment configuration`); one `mdp`
import form; relative `from . import agents`; uniform gym registration
key order (and the missing `default_agent` entries for
`Isaac-Shadow-Handover`, `Isaac-Lift-Cable-Franka`,
`Isaac-Lift-Cable-Franka-Camera`).
- `.pyi` stubs use sorted `__all__`, relative imports, and the `from
isaaclab.envs.mdp import *` fallback last.
- `ManagerTermBase` subclasses take `(cfg, env)` like the base class;
the locomotion terms now also call `super().__init__`.
- Removed stale `isort:skip` and "Pre-defined configs" banners,
historical/changelog-style comments, commented-out code, and `(w, x, y,
z)` quaternion docstrings (Isaac Lab uses `(x, y, z, w)`).
- Replaced deprecated `viewer` writes with `sim.default_visualizer_cfg`
(handover, Franka soft-body).

**Shared MDP terms moved to `isaaclab.envs.mdp`** (task packages still
resolve them through their stub fallback, so `mdp.<term>` in configs is
unchanged)
- `survival_success_rate` (was triplicated in cartpole, locomotion,
dr_legs), `terminated_penalty`, `joint_pos_target_l2`.
- `DifficultyScheduler` and `initial_final_interpolate_fn` from lift,
with a `success_term_name` parameter.
- Fourbar's `joint_pos_cos` / `joint_pos_sin` moved from `rewards.py` to
`observations.py`.

**De-duplication**
- New `cartpole_common.py`, `ant_common.py`, `humanoid_common.py` hold
the physics/camera presets, gears, targets and terrain previously
copy-pasted between the direct and manager workflows. Removed the no-op
`AntObservationsCfg` / `HumanoidObservationsCfg` presets and the dead
`vision_camera.show_collage` debug helper.
- `_FrankaSoftSceneCfg` / `_FrankaSoftCameraSceneCfg` become the public
`FrankaSoftBaseSceneCfg` / `FrankaSoftBaseCameraSceneCfg` since the
cloth and cable configs subclass them.

**Performance**
- Cached the reorient cube-corner offsets (rebuilt on device every
step), scalar comparisons in the deformable/cable bounds terminations,
`expand` instead of `repeat` / `repeat_interleave` in the lift, handover
and reorient hot paths, cached marker constants in `ReorientCommand`,
gear ratios resolved once as a `(num_joints,)` vector.

**Fixes found along the way**
- `LiftEnvCfg` lacked `@configclass`.
- The lift ADR curriculum interpolated the point-cloud noise upper bound
to `-0.01` (now `0.01`).
- Stale docs `literalinclude` ranges for the joint-wrench sensor page
and the moved cartpole presets.

**Contrib (targeted)**
- dr_legs duplicate `survival_success_rate` removed and constructor
order fixed; `wp.to_torch` replaced by `.torch` in drone_arl;
quaternion-order docstrings fixed in deploy/keyboard; hoisted an inline
`math_utils` import in assemble_trocar; module docstrings for 15 files.

**Tests**
- Deleted the dead `test/benchmarking/` scaffolding, the permanently
skipped determinism test and the empty `XFAIL_TASKS` branch; converted
the lone `unittest.TestCase` file to pytest; removed single-element
parametrizes, redundant prints, a repo-layout-only test and a
never-asserting lazy-export test; fixed wxyz identity quaternions in the
lift cfg test.

Audit findings deliberately **not** changed here because they alter task
behavior and need an owner call:
`contrib/multitask_manipulation/mdp/utils.py` converts an xyzw offset
quaternion `to="wxyz"` before `combine_frame_transforms`;
`contrib/drone_arl/mdp/events.py` writes `[1, 0, 0, 0]` as an identity
quaternion (a 180° x-rotation in xyzw);
`contrib/stack/mdp/observations.py::object_grasped` can raise
`UnboundLocalError` when `gripper_joint_names` is absent; the Humanoid
manager terrain lacks the `friction_combine_mode="average"` the direct
cfg sets.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)

## 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
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

Verification: all 48 registered task configs load kitless without
forbidden imports; 251 task unit tests pass; the experimental
capture-safety tests pass; a kitless Newton smoke run of the touched
Cartpole, Ant, Humanoid, Fourbar, Allegro/Shadow reorient, handover,
cabinet, reach, lift and AnymalD tasks passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

(cherry picked from commit 0c5dcbc)
@StafaH
StafaH deleted the tasks/final-cleanup-pass branch September 21, 2026 02:23
ooctipus added a commit that referenced this pull request Sep 21, 2026
…7530, #7899) (#7926)

## Description

Backports the two changes merged into `develop` since September 19 that
are still missing from `release/3.0.0`:

| Source PR | Change | Source commit |
| --- | --- | --- |
| #7530 | Validate camera outputs against renderer capabilities before
simulator startup | `31d1c53510490c76841e9c35a329574b357d9900` |
| #7899 | Share native resources by construction cfg and centralize
ownership and teardown | `c90c3a1097a0a669a823b880b1c8d0654d7fd267` |

Includes the original regression tests, API documentation, and changelog
fragments. #7530 applied without changes. #7899 required two conflict
resolutions to retain the release branch's OVRTX mapping API,
documentation, and tests. Of its 62 files, 59 match the merged source
exactly; the other three retain those existing release additions.
Release versions, lockfile entries, compiled changelogs, and
documentation routing are preserved.

## Audit

Checked all **33 PRs** merged from September 19, 2026 00:00
America/Los_Angeles through `develop` commit `c90c3a1097` (September 20,
21:29 Pacific), against release base `75e9c8ce12`. **31 are already
backported; the remaining two are included here.** Git first-parent
history and GitHub's merged PR list agree. Automatic changelog/version
compilation remains branch-specific.

<details>
<summary>31 PRs already recorded in release</summary>

| Source PRs | Existing release commit |
| --- | --- |
| #7777, #7608, #7895, #7872, #7831, #7834, #7838, #7840, #7903, #7674 |
[`ff22c52891`](ff22c52)
|
| #7886 |
[`41bfaee5f0`](41bfaee)
|
| #7042 |
[`970d21ef48`](970d21e)
|
| #7905 |
[`f0563d1f9e`](f0563d1)
|
| #7604 |
[`dca7cfe984`](dca7cfe)
|
| #7610, #7603 |
[`5dd2220243`](5dd2220)
|
| #7839 |
[`b8b93bb96e`](b8b93bb)
|
| #6851 |
[`baa025ad90`](baa025a)
|
| #7250 |
[`f86b33e6b1`](f86b33e)
|
| #7910 |
[`24f7b4842b`](24f7b48)
|
| #7810 |
[`9738e096c8`](9738e09)
|
| #7832 |
[`be270ed88b`](be270ed)
|
| #4679 |
[`80157aa22d`](80157aa)
|
| #7914 |
[`01b59b5a22`](01b59b5)
|
| #7502 |
[`db7db61f60`](db7db61)
|
| #7918 |
[`bca9dba8bb`](bca9dba)
|
| #7919 |
[`ef1514c97c`](ef1514c)
|
| #7922 |
[`7d6979a19e`](7d6979a)
|
| #7923 |
[`a1dd560b98`](a1dd560)
|
| #7924 |
[`892e51dc1d`](892e51d)
|
| #7925 |
[`75e9c8ce12`](75e9c8c)
|

</details>

## Validation

**745 tests passed** on the combined backport:

- Core registry, configclass, replication, camera contracts, and task
presets: 158 passed.
- Newton manager/model/reset and coupling suites: 299 passed.
- OVPhysX/OVRTX lifecycle, scene data, bindings, and material contracts:
141 passed on CPU.
- Clone-plan algebra: 83 passed.
- All 8 OV CUDA cases skipped in the CPU run: 8 passed on GPU.
- OVPhysX ray-caster regression: 1 passed.
- Kit simulation-context and PhysX scene-data tests: 54 passed.
- Newton solver reset integration: 1 passed.

The registry-identity and borrowed-config-field regressions both fail
with the pre-backport implementations and pass with this change.
Backport file-scope validation, source-file comparison, `git diff
--check`, and `uv run isaaclab -f` passed.

Local validation used PyTorch 2.12.0/CUDA 13.0, Isaac Sim 6.0.1.0,
Newton 1.6.0rc1, and an RTX 5090. Existing deprecation/runtime warnings
occurred. Full Docker CI is requested separately against the pinned
environment; local checks do not claim a startup or runtime speedup.

## Checklist

- [x] Read the contribution guidelines and ran formatting/changelog
checks.
- [x] Included source tests, documentation, and changelog fragments.
- [x] Verified regression behavior and preserved release-specific
changes.
- [x] Recorded source commit hashes and audited the requested merge
window.

---------

Co-authored-by: Antoine RICHARD <antoiner@nvidia.com>
Co-authored-by: ooctipus <zhengyuz@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants