Skip to content

[RL] Unify and cleanup isaaclab_rl for 3.0 release - #7923

Merged
StafaH merged 4 commits into
isaac-sim:developfrom
StafaH:cleanup/isaaclab-rl-pass
Sep 20, 2026
Merged

StafaH merged 4 commits into
isaac-sim:developfrom
StafaH:cleanup/isaaclab-rl-pass

Conversation

@StafaH

@StafaH StafaH commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Complete cleanup pass over isaaclab_rl following the recent additions and test cleanup. The goal is one consistent code and comment style across the package, no leftover artifacts from the script-based entrypoints, and imports at the top of each module unless there is a documented reason to defer them.

Entrypoints

  • Every train, play, and export backend now exposes the same run(argv) function with _parse_args and _resolve_checkpoint helpers and module-level imports. The play backends were module-level scripts executed through runpy, each duplicating the parser and the playback loop; the runpy path in dispatch.py is gone.
  • Remaining inline imports are documented necessities: optional extras (torchrl, wandb, isaaclab_experimental, isaaclab_visualizers), modules that must load after the simulation launches (concrete environment classes, the LEAPP runtime), and RLinf modules that read environment variables at import time.
  • common.py gains add_common_play_args, run_playback, resolve_published_checkpoint, resolve_seed, and normalize_task_name. The video-recording logic is split into small helpers with the same behavior. apply_env_overrides now also applies --disable_fabric and --export_io_descriptors.
  • The LEAPP exporters share run_export, prepare_export_env, leapp_capture, and resolve_export_save_path in export_common; the duplicated get_checkpoint_path is replaced by a re-export from isaaclab_tasks. The unused simulation_app parameter and the main_cli/run_export_with_hydra layers are removed. Import sorting is now ruff-enforced in these modules too.
  • New cli_args_skrl.py; cli_args_rlinf.py gains configure_rlinf_environment and resolve_rlinf_checkpoint (public rename).

Wrappers and utilities

  • New isaaclab_rl.utils.env_types.check_env_type replaces five copies of the environment-type check in the wrappers.
  • isaaclab_rl.rsl_rl: check_rsl_rl_version, create_rsl_rl_runner. isaaclab_rl.skrl: check_skrl_version, import_skrl_runner. isaaclab_rl.rl_games: RlGamesVecEnvWrapper.from_agent_cfg, register_rl_games_env.
  • Intra-package imports use the relative form (up to three dots); imports of other packages stay absolute. entrypoints/multigpu.py keeps absolute imports because it runs as a per-rank script.

Removed leftovers

  • Dead helpers dispatch_library_entrypoint, import_local_module, wrap_training_capture, configure_io_descriptors; the no-op --disable_fabric flags in the play parsers (now functional); the rsl-rl < 4.0 export path in playback; duplicated version constants; the _isaac_sim/python.sh restart path in PBT.

Behavior changes

  • RSL-RL play and export enforce rsl-rl-lib >= 5.0.1 like training already did.
  • IO descriptors are enabled only when the flag is passed; previously every direct-env training printed a warning and the flag default overwrote a config-set value.
  • Zero and random agents honor --deterministic. Playback closes the environment after Ctrl+C.

Tests tied to removed internals were updated; the export_rsl_rl import test now checks the real invariant (no LEAPP import before launch) instead of forbidding all framework imports.

Type of change

  • Breaking change (existing functionality will not work without user modification)

Downstream code that imported the play modules as scripts should call their run(argv) function instead; pre_launch_video_config now takes (env_cfg, args_cli).

Release backport

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

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

🤖 Generated with Claude Code

Restructure every train, play, and export backend around the same run(argv)
function with module-level imports, share the playback loop, checkpoint
resolution helpers, and LEAPP session handling, and replace the duplicated
wrapper environment-type checks with one helper. Remove dead helpers left over
from the script-based entrypoints and switch intra-package imports to the
relative form.
@StafaH
StafaH requested a review from a team September 20, 2026 14:49
@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: 5/5

The PR appears safe to merge; no concrete correctness, security, or repository-rule violation remains.

Summary

This PR consolidates the reinforcement-learning entrypoints and adapters around shared train, play, export, checkpoint, playback, video, and environment-validation helpers.

  • Replaces script-style playback dispatch with uniform backend run(argv) calls.
  • Centralizes playback loops, checkpoint selection, seed handling, video configuration, and LEAPP export lifecycle management.
  • Adds shared RL-Games, RSL-RL, skrl, and environment-type utilities while retaining backend-specific adapter contracts.
  • Makes playback fabric control and training IO-descriptor flags effective and updates RSL-RL version enforcement.
  • Updates tests, documentation, changelog material, and the dependency lockfile for the unified structure.

Reviews (1) · Last reviewed commit: "Unify isaaclab_rl entrypoints and wrappe..."

… prefixes

Rewrite one-line conditionals and nested calls introduced by the cleanup as
plain statements, and rename is_missing and create_zero_action_policy so that
names imported from other modules carry no private prefix.
@StafaH StafaH changed the title Unify isaaclab_rl entrypoints and wrappers into a single code style [RL] Unify and cleanup isaaclab_rl for 3.0 release Sep 20, 2026

@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 unified run(argv) backend structure and shared playback/export helpers are coherent, but three concrete regressions need correction: the sensor-capture documentation includes the wrong source lines, SB3 export can leak a process-global Torch setting when environment creation fails, and versioned -Play task IDs no longer normalize compatibly for checkpoint and manifest lookup.

  • Design and architecture: Consolidating dispatch, playback, checkpoint handling, and LEAPP export lifecycle into shared helpers reduces duplication. However, centralizing task-name handling in normalize_task_name changed the compatibility behavior for IDs such as Foo-Play-v0; it should strip -Play before an optional version suffix.
  • API: The new shared wrapper and runner APIs are exposed consistently, and documented breaking entrypoint changes include migration guidance. The checkpoint/manifest compatibility surface still needs correction because versioned -Play task IDs previously normalized to their training IDs but now remain unchanged.
  • Implementation: Fix the stale literalinclude range in capture_sensor_frames.rst, place SB3 gym.make inside the try/finally that restores Torch distribution validation while guarding environment cleanup, and update normalize_task_name to handle -Play-v<N> task IDs.

Minor fixes needed. Posted 3 actionable findings inline.

Automated review; human maintainers own approval decisions.

@StafaH
StafaH requested a review from frlai as a code owner September 20, 2026 16:45
@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 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 4b1234b 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 a1dd560.

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

Complete cleanup pass over `isaaclab_rl` following the recent additions
and test cleanup. The goal is one consistent code and comment style
across the package, no leftover artifacts from the script-based
entrypoints, and imports at the top of each module unless there is a
documented reason to defer them.

**Entrypoints**

- Every train, play, and export backend now exposes the same `run(argv)`
function with `_parse_args` and `_resolve_checkpoint` helpers and
module-level imports. The play backends were module-level scripts
executed through `runpy`, each duplicating the parser and the playback
loop; the `runpy` path in `dispatch.py` is gone.
- Remaining inline imports are documented necessities: optional extras
(`torchrl`, `wandb`, `isaaclab_experimental`, `isaaclab_visualizers`),
modules that must load after the simulation launches (concrete
environment classes, the LEAPP runtime), and RLinf modules that read
environment variables at import time.
- `common.py` gains `add_common_play_args`, `run_playback`,
`resolve_published_checkpoint`, `resolve_seed`, and
`normalize_task_name`. The video-recording logic is split into small
helpers with the same behavior. `apply_env_overrides` now also applies
`--disable_fabric` and `--export_io_descriptors`.
- The LEAPP exporters share `run_export`, `prepare_export_env`,
`leapp_capture`, and `resolve_export_save_path` in `export_common`; the
duplicated `get_checkpoint_path` is replaced by a re-export from
`isaaclab_tasks`. The unused `simulation_app` parameter and the
`main_cli`/`run_export_with_hydra` layers are removed. Import sorting is
now ruff-enforced in these modules too.
- New `cli_args_skrl.py`; `cli_args_rlinf.py` gains
`configure_rlinf_environment` and `resolve_rlinf_checkpoint` (public
rename).

**Wrappers and utilities**

- New `isaaclab_rl.utils.env_types.check_env_type` replaces five copies
of the environment-type check in the wrappers.
- `isaaclab_rl.rsl_rl`: `check_rsl_rl_version`, `create_rsl_rl_runner`.
`isaaclab_rl.skrl`: `check_skrl_version`, `import_skrl_runner`.
`isaaclab_rl.rl_games`: `RlGamesVecEnvWrapper.from_agent_cfg`,
`register_rl_games_env`.
- Intra-package imports use the relative form (up to three dots);
imports of other packages stay absolute. `entrypoints/multigpu.py` keeps
absolute imports because it runs as a per-rank script.

**Removed leftovers**

- Dead helpers `dispatch_library_entrypoint`, `import_local_module`,
`wrap_training_capture`, `configure_io_descriptors`; the no-op
`--disable_fabric` flags in the play parsers (now functional); the
`rsl-rl < 4.0` export path in playback; duplicated version constants;
the `_isaac_sim/python.sh` restart path in PBT.

**Behavior changes**

- RSL-RL play and export enforce `rsl-rl-lib >= 5.0.1` like training
already did.
- IO descriptors are enabled only when the flag is passed; previously
every direct-env training printed a warning and the flag default
overwrote a config-set value.
- Zero and random agents honor `--deterministic`. Playback closes the
environment after Ctrl+C.

Tests tied to removed internals were updated; the `export_rsl_rl` import
test now checks the real invariant (no LEAPP import before launch)
instead of forbidding all framework imports.

## Type of change

- Breaking change (existing functionality will not work without user
modification)

Downstream code that imported the play modules as scripts should call
their `run(argv)` function instead; `pre_launch_video_config` now takes
`(env_cfg, args_cli)`.

## Release backport

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

## 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

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

(cherry picked from commit 4b1234b)
@StafaH
StafaH deleted the cleanup/isaaclab-rl-pass branch September 20, 2026 18:41
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 <[email protected]>
Co-authored-by: ooctipus <[email protected]>
ooctipus added a commit that referenced this pull request Sep 24, 2026
…ng docs (#7957)

Backports the three changes from the September 20–23 `develop` audit
that are missing from `release/3.0.0`, alongside the existing
cloning-guide backport:

- #7722 (`4cf439dfeb`): reject a second `SimulationContext` construction
instead of silently discarding its configuration. Includes the original
fixture cleanup and regression coverage.
- #7893 (`22fcd71bc4`): validate DelayBuffer lag values before mutating
its live configuration.
- #7947 (`6e9ef17f59`): make `v3.0.0-EA` the default documentation
version in deployment and local multi-version builds.
- #7129 (`354168560f`): clarify that `replicate_physics=False` skips the
active physics context while other declared replication contexts still
run.

**Compatibility:** repeated `SimulationContext(...)` calls now raise.
Retrieve the live context with `SimulationContext.instance()`, or call
`clear_instance()` before constructing a replacement. The original major
changelog fragment includes this migration.

The runtime and test files match current `develop`. The docs-default
backport adapts the release branch's existing redirect template,
validates the target page, and preserves explicit overrides. The
cloning-guide backport preserves the current release APIs; its obsolete
sections were already removed.

## Release audit

Checked all **35 PRs** merged into `develop` from **2026-09-20 16:43:18
UTC** through `cff81e8473` (September 23), against release head
`5d3e0b695e`. **32 are already covered; the remaining three are included
here.** Git history, patch equivalence, GitHub's merged PR list, and
remaining file differences were checked. Branch-specific
version/changelog compilation and existing release-only changes are
preserved.

<details>
<summary>Already covered PRs</summary>

26 have an equivalent patch in release: #7919, #7922, #7923, #7924,
#7925, #6758, #7928, #7902, #7927, #7891, #7931, #7691, #7861, #7929,
#7916, #7939, #4609, #7942, #7940, #7948, #7937, #7955, #7960, #7961,
#7970, #7958.

Six were squash-merged or adapted: #7530 and #7899 in #7926; #7637 in
#7933; #7860 in #7936; #7954 and #7950 in #7964. Their implementation
differences were checked against the current release tree.

</details>

## Validation

- **276 tests passed**: SimulationContext (51, including CPU/CUDA),
headless context construction (15), nine schema/fragment suites (165),
four manager suites (38), and DelayBuffer (7).
- Both backported regressions reproduce with the original release
implementations.
- Docs redirect recipe: local/deployment EA defaults, explicit override,
and missing-target rejection passed with a stubbed Sphinx builder.
- All 22 changed files match the intended backport scope; `uv run
isaaclab -f` and `git diff --check` passed.
- Fresh Sphinx validation (`-b dummy -W --keep-going`): passed without
warnings, excluding static assets as the HTML builder does. Full HTML
documentation CI is running.

Local runtime validation used PyTorch 2.12.0, CUDA 13.0, Isaac Sim
6.0.1.0, and an RTX 5090. Existing runtime/deprecation warnings
occurred; the CI jobs validate the pinned environments.

The previous [docs CI
failure](https://github.com/isaac-sim/IsaacLab/actions/runs/35795116307/job/106972539281)
was an external connection reset fetching the Omniverse intersphinx
inventory, producing one warning under `-W`. That URL returned HTTP 200
when rechecked. This update starts a fresh docs build.

---------

Co-authored-by: hujc <[email protected]>
Co-authored-by: Zihan Xu <[email protected]>
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