Skip to content

Fix external callback order in rsrl script - #7473

Merged
kellyguo11 merged 2 commits into
isaac-sim:developfrom
peterd-NV:peterd/fix_external_callback_order
Sep 3, 2026
Merged

kellyguo11 merged 2 commits into
isaac-sim:developfrom
peterd-NV:peterd/fix_external_callback_order

Conversation

@peterd-NV

Copy link
Copy Markdown
Collaborator

Fixes # (issue)

The unified RSL-RL trainer resolved task agent metadata before invoking --external_callback.
Externally registered tasks therefore failed because they were not yet present in the Gym registry.

This change invokes the external callback before preset and agent discovery while preserving the
existing Hydra argument handling. It also adds regression coverage for externally registered tasks.

Type of change

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

Release backport

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

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • 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

@peterd-NV
peterd-NV requested a review from a team September 1, 2026 15:47
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Sep 1, 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 change correctly moves external task registration ahead of RSL-RL preset and agent discovery and adds focused regression coverage, but it also causes the external callback to run for help requests before the main parser can exit.

  • Design and architecture: The targeted pre-parser resolves the registration/metadata ordering cycle. However, because it ignores help handling and invokes the callback immediately, --help now imports and executes user-supplied callback code, introducing side effects or callback failures on an informational CLI path that previously exited first.
  • API: The declared --external_callback CLI option, parsed namespace, and callback return-value flow into Hydra argument handling remain unchanged. The behavioral compatibility issue is that invocations combining the callback option with --help or -h no longer short-circuit before callback execution.
  • Implementation: The callback runs once before setup_preset_cli, enabling externally registered Gym task metadata to be discovered as intended, and the regression test covers that ordering. The early invocation should be bypassed when help is requested so help output retains its prior side-effect-free behavior.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes RSL-RL startup for externally registered tasks by invoking the registration callback before preset and agent metadata discovery.

  • Adds an early, minimal parse of --external_callback.
  • Preserves the existing preset, camera, and Hydra argument handling after registration.
  • Adds regression coverage demonstrating that an externally registered task is discoverable.
  • Adds the required changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The callback is parsed with the same string semantics as the canonical argument and now runs before the first operation that requires externally registered Gym metadata, while existing Hydra argument handling remains in place.

Important Files Changed

Filename Overview
source/isaaclab_rl/isaaclab_rl/entrypoints/backends/train_rsl_rl.py Moves external task registration ahead of preset discovery while retaining the original downstream argument-processing sequence.
source/isaaclab_rl/test/test_entrypoints.py Adds focused regression coverage proving that callback registration occurs before RSL-RL agent metadata lookup.
source/isaaclab_rl/changelog.d/fix-external-callback-order.rst Accurately records the externally registered task discovery fix.

Sequence Diagram

sequenceDiagram
    participant CLI as RSL-RL CLI
    participant Callback as External callback
    participant Gym as Gym registry
    participant Preset as Preset/agent discovery
    CLI->>CLI: Parse external_callback
    CLI->>Callback: Invoke registration callback
    Callback->>Gym: Register external task
    CLI->>Preset: Parse presets and discover agent metadata
    Preset->>Gym: Read registered task metadata
    Gym-->>Preset: Return RSL-RL configuration entry point
Loading

Reviews (1): Last reviewed commit: "fix external callback order in rsrl scri..." | Re-trigger Greptile

@peterd-NV peterd-NV changed the title fix external callback order in rsrl script Fix external callback order in rsrl script Sep 1, 2026

@AntoineRichard AntoineRichard left a comment

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.

Hi @peterd-NV this looks good! Thanks for fixing this. Any chances this is required for the other frameworks like sb3, rl_games, or skrl?

@peterd-NV

Copy link
Copy Markdown
Collaborator Author

Hi @AntoineRichard , I did a scan and only saw external callbacks enabled for the rsrl train script so this currently doesn't affect the other frameworks. But would be good to keep in mind the ordering if external callbacks are ever added to those in the future.

@kellyguo11

Copy link
Copy Markdown
Contributor

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 2, 2026
@kellyguo11
kellyguo11 merged commit cca25c2 into isaac-sim:develop Sep 3, 2026
74 of 77 checks passed
kellyguo11 added a commit that referenced this pull request Sep 4, 2026
# Description

Backports the following merged `develop` PRs to `release/3.0.0`:

- #7220 — prune unused Docker volumes on package-test runners
- #7169 — cache the resolved OVRTX Warp device
- #6889 — move the OVPhysX collider cache out of the Python interpreter
directory
- #7345 — document the registered XR camera PiP tasks
- #7050 — update and reorganize the LEAPP documentation
- #7473 — register external RSL-RL tasks before agent discovery
- #7467 — update the China storage profile to Isaac Sim 6.1
- #7385 — accept legal float scale values when seeding Fabric frame
views from USD
- #7517 — use lazy exports in `isaaclab_rl`

The duplicate #7517 in the original request is included once.

Seven source commits replayed cleanly. Two required release-specific
reconciliation:

- #7169 retains the release branch's mapped OVRTX write path, which was
removed separately on `develop`, while resolving and caching one Warp
device for render-product IDs, mappings, and CUDA streams.
- #7050 preserves the #7494 export-backend clarification that is already
present on the release branch while applying the broader LEAPP
documentation overhaul.

No new dependencies are added.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- Performance improvement
- Documentation update
- CI/infrastructure update

## Release backport

- [ ] <!-- backport-active-release --> This PR already targets the
active release branch; do not backport it again.

## Validation

- `uv run --no-project --with pytest python -m pytest -q
.github/actions/run-package-tests/test_cleanup_docker_storage.py` — 10
passed
- Nine isolated `isaaclab_rl` namespace/lazy-import regression cases
passed
- Resolved-device OVRTX mapping behavior check passed with Warp 1.16.0
- `uv run --no-project python -m compileall -q` on all changed Python
modules and tests
- `uv run --no-project python tools/changelog/cli.py check` against the
exact `upstream/release/3.0.0` base
- `pre-commit==4.6.2 run --all-files` passed all available hooks
- `git diff --check upstream/release/3.0.0..HEAD`

The full project test environment and documentation build cannot resolve
on this macOS/arm64 host because the release lockfile supports Linux and
Windows only. The Git LFS hook was also unavailable because `git-lfs` is
not installed; none of the changed paths are LFS-tracked. Linux CI
remains authoritative for simulator, OVRTX, Fabric, and full
documentation validation.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the available formatting and static checks
- [x] I have included the corresponding documentation changes
- [x] Each touched source package includes its original changelog
fragment
- [x] Every backported commit records its source commit with `cherry
picked from commit`
- [x] The original contributors are preserved as commit authors

---------

Signed-off-by: Zeng Qingcheng <[email protected]>
Co-authored-by: myurasov-nv <[email protected]>
Co-authored-by: Peter Verswyvelen <[email protected]>
Co-authored-by: pv-nvidia <[email protected]>
Co-authored-by: hujc <[email protected]>
Co-authored-by: hougantc-nvda <[email protected]>
Co-authored-by: Frank Lai NV <[email protected]>
Co-authored-by: peterd-NV <[email protected]>
Co-authored-by: Sheikh Dawood <[email protected]>
Co-authored-by: Zeng Qingcheng <[email protected]>
Co-authored-by: Antoine RICHARD <[email protected]>
Co-authored-by: Mustafa H <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants