Skip to content

Promote benchmarks to library API - #6564

Merged
AntoineRichard merged 44 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/benchmark-library-api
Jul 28, 2026
Merged

AntoineRichard merged 44 commits into
isaac-sim:developfrom
AntoineRichard:antoiner/benchmark-library-api

Conversation

@AntoineRichard

@AntoineRichard AntoineRichard commented Jul 16, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Promotes the benchmark framework from isaaclab.test.benchmark to the public isaaclab.benchmark package. Runtime, startup, training, play, and RL backend workflows become library entrypoints with typed in-process dispatch.

The transitional import and script shims were removed from this PR to keep the move reviewable and leave one implementation for each workflow. This is an intentional breaking change: callers must replace isaaclab.test.benchmark imports with isaaclab.benchmark and use isaaclab benchmark instead of the former runtime, startup, training, and play scripts.

Highlights

  • Adds typed runtime, startup, training, and play request objects and run_benchmark convenience APIs.
  • Returns workflow-specific result types such as BenchmarkResult[RuntimeBundle].
  • Adds in-process isaaclab benchmark CLI dispatch.
  • Moves the supported benchmark workflows and RL backend adapters into the package.
  • Removes the duplicate isaaclab.test.benchmark namespace and standalone workflow forwarding scripts.
  • Restores process-global Torch, SKRL, and RL Games state and closes environments safely across repeated calls.
  • Rejects schema finalization without an attached typed bundle instead of reporting a nonexistent output.
  • Carries forward Improve benchmark sampling and synchronized timing diagnostics #6474 validation: positive workloads, non-negative warm-up counts, one default train/play warm-up step, and --measure_sync_step.
  • Adds public API documentation, migration guidance, tests, and changelog fragments.

Dependencies

Breaking migration

  • from isaaclab.test.benchmark ... becomes from isaaclab.benchmark ....
  • scripts/benchmarks/{runtime,startup,training,play}.py becomes isaaclab benchmark {runtime,startup,training,play}.
  • Per-library train/play scripts become the unified training/play commands with --rl_library.
  • Independent camera, loading, Hydra, and other standalone benchmarks remain unchanged.

Type of change

  • New feature
  • Breaking API migration
  • Documentation update

Validation

  • Focused benchmark API, CLI, parser, adapter, and early-stop suite: 265 passed, 4 simulator smoke cases deselected.
  • Focused public API and CLI entrypoint suite: 26 passed.
  • ./isaaclab.sh -f: all applicable hooks pass. The conflict-marker hook was skipped because current develop contains literal ======= headings in three third-party license files.
  • tools/changelog/cli.py check develop: passed.
  • Runtime/startup smoke tests now invoke uv run isaaclab benchmark; the local clean-uv bootstrap exceeded the validation window while downloading the CUDA environment, so CI remains the end-to-end CLI confirmation.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks
  • I have made corresponding documentation changes
  • My changes generate no new warnings
  • I have added tests for the public API and canonical CLI paths
  • I have added the required changelog fragments
  • I have documented the intentional breaking migration
  • My name already exists in CONTRIBUTORS.md

AntoineRichard and others added 18 commits July 13, 2026 09:48
Exclude configurable warmup frames from runtime metrics and compute throughput from total measured work over total wall time. Use longer defaults so the quick benchmark is less sensitive to startup and short sampling windows.
Add an opt-in runtime benchmark probe around the environment's SimulationContext step calls. Report host time inside and outside that boundary while preserving the original method after measurement.
Measure environment and synchronized simulation stepping across runtime, training, and play benchmarks. Store the resulting Isaac Lab overhead in benchmark schema 1.1 while leaving regular training and play entry points uninstrumented.
Require an explicit benchmark flag before wrapping environment and simulation steps. Disabled benchmarks now avoid method replacement and device synchronization while schema 1.1 continues to represent measured runs.
Delegate synchronization and elapsed-time measurement to the existing Isaac Lab Timer. Keep the interception layer focused on recording per-step samples so environment, simulation, and derived overhead metrics include standard deviation and peak values.
Record the env.step boundary in every benchmark workflow without adding explicit synchronization. Keep the nested synchronized simulation probe optional, and expose environment-step FPS in schema 1.2 so runtime, play, and training results can be compared on the same scope.
Name the opt-in instrumentation after the Isaac Lab overhead it reports instead of the implementation detail used to derive it.
Synchronize before environment and simulation timing begins so policy and action-generation work queued earlier is not attributed to Isaac Lab overhead.
Recalculate throughput standard deviation around the aggregate effective mean so benchmark MeanStd values use one consistent center.
Validate workload counts before launch and require positive environment timing samples so empty synchronized runs fail with actionable errors instead of division by zero.
Run the training and play smoke matrix without synchronized overhead measurement, retain one focused synchronized replay, and verify pending work before env.step is excluded from its metric.
Keep the first runtime step outside throughput regardless of overhead instrumentation and floor derived overhead at zero when nested wall timers cross due to measurement noise.
Rename the disputed overhead metric as a serialized synchronized step breakdown and expose explicit measurement modes. Mark every instrumented timing and rate as diagnostic, validate the additive partition, and document why outside-simulation time is not removable overhead.
Follow-up polish from review of the runtime/synchronized-timing changes;
no behavior change.

- Drop the redundant ``dest=``/``default=False`` on runtime.py's
  ``--measure_synchronized_step_breakdown`` (argparse derives both) so the
  flag matches the eight RL adapter scripts.
- Remove the single-use ``timer_context`` alias and enter the step-timing
  recorder alongside ``BenchmarkMonitor`` on one line, matching the
  adapters' context-manager pattern.
- Reorder the ``build_runtime`` Args block to signature order
  (``aggregate_throughput`` before ``frames_per_environment_step``).
- Clarify ``MeanStd.mean``/``std``: for effective-throughput fields these
  are the aggregate rate and the dispersion about the effective mean, not
  the arithmetic sample mean and standard deviation.
Bring PR isaac-sim#6553 on top of the benchmark timing work from PR isaac-sim#6474 so the benchmark library can dispatch the new RL entrypoints directly.
Move the supported benchmark workflows into isaaclab.benchmark and expose typed in-process dispatch for runtime, startup, training, and play benchmarks. Keep deprecated script and test namespace shims so existing callers can migrate without an immediate break.
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team infrastructure labels Jul 16, 2026
Replace per-file Python shims with lazy module proxies so legacy imports remain compatible while Git can recognize the benchmark implementation moves. Retain type forwarding stubs and document removal in Isaac Lab 3.1.
Add a warmup_steps parameter to EnvironmentStepTimingRecorder that drops
the first N ``env.step()`` calls (CUDA graph capture, lazy kernel
compilation) from the recorded environment-step timing. In serialized
mode the skipped steps' simulation call-count and time are rolled back so
the recorded aggregate stays consistent.

Expose it as an opt-in ``--warmup_steps`` flag (default 0, validated
non-negative, recorded in metadata) on the eight RL train/play benchmark
adapters. ``runtime.py`` is unchanged: its ``--warmup_frames`` already
excludes the startup step before the recorder is installed.

Add recorder unit tests for the host-return and serialized exclusion
paths and a parse-level test rejecting a negative ``--warmup_steps``.
Make runtime and startup help bypass the required task check so the unified benchmark CLI can render its full options. Cover the forwarded-argv path that exposed the parser ordering bug.
Target the public benchmark backend modules after the standalone scripts became compatibility wrappers. This keeps parser validation attached to the implementation that owns it.
@AntoineRichard AntoineRichard mentioned this pull request Jul 17, 2026
7 tasks done
@AntoineRichard

AntoineRichard commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Integrated the latest #6474 tip and exposed its RL warm-up control through the typed Python API. BenchmarkTrainingRequest and BenchmarkPlayRequest now accept warmup_steps, and dispatch translates it to --warmup_steps. Existing training CLI coverage was extended and a focused play-request test was added. Validation: 18 API tests passed; 12 focused warm-up/timing tests passed; full ./isaaclab.sh -f passed.

@AntoineRichard

Copy link
Copy Markdown
Collaborator Author

Advanced-guide end-to-end validation found that typed requests were passed to each workflow explicitly, but nested AppLauncher parsing still read the caller process's sys.argv. Commit ae91002357d scopes sys.argv to the typed request during dispatch and restores it afterward.

Validation:

  • regression test fails before the fix and checks both explicit and nested parser arguments
  • all 18 API tests pass
  • real PhysX typed runtime workflow reaches environment creation and stepping and writes schema + summary outputs
  • full pre-commit passes

Use concise timing diagnostics, exclude the first environment step by default, and validate frame counts directly through argparse so invalid workloads fail consistently.
Mark the isaaclab_rl parser plumbing as covered by the benchmark changelog entry in isaaclab.
Define the deliberate compatibility break and validation scope used to simplify review of the benchmark library promotion.
…up' into antoiner/benchmark-library-api

# Conflicts:
#	scripts/benchmarks/rl_games/benchmark_rl_games_play.py
#	scripts/benchmarks/rl_games/benchmark_rl_games_train.py
#	scripts/benchmarks/rsl_rl/benchmark_rsl_rl_play.py
#	scripts/benchmarks/rsl_rl/benchmark_rsl_rl_train.py
#	scripts/benchmarks/runtime.py
#	scripts/benchmarks/sb3/benchmark_sb3_play.py
#	scripts/benchmarks/sb3/benchmark_sb3_train.py
#	scripts/benchmarks/skrl/benchmark_skrl_play.py
#	scripts/benchmarks/skrl/benchmark_skrl_train.py
Make the promoted benchmark package and unified CLI the only supported entry points. This removes duplicate forwarding code and keeps future benchmark changes confined to one implementation.
Resolve the benchmark package relocation against the finalized timing API.

Keep the public entrypoints while adopting exact warmup frame semantics.
Keep adapters nested by backend while making each play and training
module unambiguous in traces, imports, and code review.
@AntoineRichard

Copy link
Copy Markdown
Collaborator Author

Addressed the two review points:

  • The compatibility play, training, runtime, startup, and backend-specific scripts under scripts/benchmarks were removed. The isaaclab benchmark CLI now dispatches directly into isaaclab.benchmark. The remaining files in scripts/benchmarks are independent benchmark workloads rather than forwarding entrypoints.
  • The backend adapters remain grouped by backend and now use explicit filenames consistently, for example entrypoints/backends/rsl_rl/benchmark_play_rsl_rl.py and benchmark_train_rsl_rl.py. Dispatch paths and tests were updated for all four backends in 2114b11.

Align typed play requests with backend parser arguments and make generated output names collision resistant. Repair smoke imports, documentation, and breaking changelog metadata.
Keep the four supported workflow scripts as thin package entrypoints. Use them in smoke tests so core CI does not depend on uv.
Reuse the RL entrypoint common state guards across benchmark backends. Make Torch settings explicit at each call site and remove the standalone state module.
Share state restoration through the RL entrypoint utilities and make each backend's Torch settings explicit. Update the rollback regression test to exercise the common helpers.
@AntoineRichard
AntoineRichard merged commit 8a2df0c into isaac-sim:develop Jul 28, 2026
88 of 91 checks passed
AntoineRichard added a commit that referenced this pull request Jul 30, 2026
## Summary

Consolidates the remaining open benchmarking work onto `develop`, which
now
contains #6564 and #6631. This pull request is the canonical source for
review,
CI, and merge; the superseded individual pull requests are closed to
keep
discussion and validation centralized here.

## Superseded pull requests

- #6565 — Fix articulation data micro-benchmarks
- #6566 — Add OVPhysX asset micro-benchmarks
- #6567 — Add OVPhysX sensor micro-benchmarks
- #6568 — Add Newton sensor micro-benchmarks
- #6587 — Document micro-benchmark workflows
- #6595 — Rewrite benchmark user guide
- #6624 — Success series in benchmark schema
- #6627 — Rewrite advanced benchmark framework guide
- #6629 — Unify benchmark documentation journey
- #6764 — Standardize benchmark warm-up steps

## Already landed dependencies

- #6564 — Benchmark library API
- #6631 — Restore RL entrypoint backend state

## Integration notes

- The success-rate learning curve advances the benchmark bundle schema
from
  1.2 to 1.3.
- Runtime and play use `num_steps` and `warmup_steps` consistently.
- Shared asset and sensor suites preserve backend-specific setup while
  centralizing common workload, timing, and reporting behavior.
- The top-level micro-benchmark factory exposes exact physics selectors
and
  runs retained benchmark scripts in child processes.
- The benchmark user, framework, and micro-benchmark guides form one
  documentation path with generated API coverage for public symbols.
- Historical plan/spec commits were excluded from the consolidated
history.

## Verification

- `./isaaclab.sh -f`
- `python3 tools/changelog/cli.py check develop`
- `./isaaclab.sh -d`
- Focused benchmark and RL entrypoint tests: 315 passed, 9 skipped

---------

Co-authored-by: Kelly Guo <kellyg@nvidia.com>
fatimaanes added a commit to NVIDIA-Omniverse/IsaacLab that referenced this pull request Aug 4, 2026
isaac-sim#6564 promoted the benchmark framework out of the internal namespace into
isaaclab.benchmark and removed the old one. perf_runtime.py still imported the
retired path, so every bench container died at module import before the app
launched: all nine buckets reported HARD_FAILURE(phase=import) while the bench
jobs themselves stayed green.

Every symbol the driver uses is available unchanged at the new path --
BaseIsaacLabBenchmark, BenchmarkMonitor, the builders/capture/stepping
submodules and schema.StartupTime -- so this is a namespace move, not an API
migration. Six docstring references carried the retired path too.

perf_runtime.py is the only gate module that imports Isaac Lab, and it runs
only inside the CI container, so nothing in this suite or in a local check
could see the breakage. test_framework_imports.py resolves each framework
import statically against source/ in the current checkout, which fails on the
machine that rebases instead of on the GPU runner an hour later.
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
# Description

Promotes the benchmark framework from `isaaclab.test.benchmark` to the
public `isaaclab.benchmark` package. Runtime, startup, training, play,
and RL backend workflows become library entrypoints with typed
in-process dispatch.

The transitional import and script shims were removed from this PR to
keep the move reviewable and leave one implementation for each workflow.
This is an intentional breaking change: callers must replace
`isaaclab.test.benchmark` imports with `isaaclab.benchmark` and use
`isaaclab benchmark` instead of the former runtime, startup, training,
and play scripts.

## Highlights

- Adds typed runtime, startup, training, and play request objects and
`run_benchmark` convenience APIs.
- Returns workflow-specific result types such as
`BenchmarkResult[RuntimeBundle]`.
- Adds in-process `isaaclab benchmark` CLI dispatch.
- Moves the supported benchmark workflows and RL backend adapters into
the package.
- Removes the duplicate `isaaclab.test.benchmark` namespace and
standalone workflow forwarding scripts.
- Restores process-global Torch, SKRL, and RL Games state and closes
environments safely across repeated calls.
- Rejects schema finalization without an attached typed bundle instead
of reporting a nonexistent output.
- Carries forward isaac-sim#6474 validation: positive workloads, non-negative
warm-up counts, one default train/play warm-up step, and
`--measure_sync_step`.
- Adds public API documentation, migration guidance, tests, and
changelog fragments.

## Dependencies

- Direct dependency: isaac-sim#6474.
- Satisfied prerequisite: isaac-sim#6553, already merged, provides reusable RL
train/play entrypoints.

## Breaking migration

- `from isaaclab.test.benchmark ...` becomes `from isaaclab.benchmark
...`.
- `scripts/benchmarks/{runtime,startup,training,play}.py` becomes
`isaaclab benchmark {runtime,startup,training,play}`.
- Per-library train/play scripts become the unified training/play
commands with `--rl_library`.
- Independent camera, loading, Hydra, and other standalone benchmarks
remain unchanged.

## Type of change

- New feature
- Breaking API migration
- Documentation update

## Validation

- Focused benchmark API, CLI, parser, adapter, and early-stop suite: 265
passed, 4 simulator smoke cases deselected.
- Focused public API and CLI entrypoint suite: 26 passed.
- `./isaaclab.sh -f`: all applicable hooks pass. The conflict-marker
hook was skipped because current `develop` contains literal `=======`
headings in three third-party license files.
- `tools/changelog/cli.py check develop`: passed.
- Runtime/startup smoke tests now invoke `uv run isaaclab benchmark`;
the local clean-`uv` bootstrap exceeded the validation window while
downloading the CUDA environment, so CI remains the end-to-end CLI
confirmation.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks
- [x] I have made corresponding documentation changes
- [x] My changes generate no new warnings
- [x] I have added tests for the public API and canonical CLI paths
- [x] I have added the required changelog fragments
- [x] I have documented the intentional breaking migration
- [x] My name already exists in `CONTRIBUTORS.md`

---------

Co-authored-by: Mustafa Haiderbhai <mhaiderbhai@nvidia.com>
matthewtrepte pushed a commit to matthewtrepte/IsaacLab that referenced this pull request Aug 4, 2026
## Summary

Consolidates the remaining open benchmarking work onto `develop`, which
now
contains isaac-sim#6564 and isaac-sim#6631. This pull request is the canonical source for
review,
CI, and merge; the superseded individual pull requests are closed to
keep
discussion and validation centralized here.

## Superseded pull requests

- isaac-sim#6565 — Fix articulation data micro-benchmarks
- isaac-sim#6566 — Add OVPhysX asset micro-benchmarks
- isaac-sim#6567 — Add OVPhysX sensor micro-benchmarks
- isaac-sim#6568 — Add Newton sensor micro-benchmarks
- isaac-sim#6587 — Document micro-benchmark workflows
- isaac-sim#6595 — Rewrite benchmark user guide
- isaac-sim#6624 — Success series in benchmark schema
- isaac-sim#6627 — Rewrite advanced benchmark framework guide
- isaac-sim#6629 — Unify benchmark documentation journey
- isaac-sim#6764 — Standardize benchmark warm-up steps

## Already landed dependencies

- isaac-sim#6564 — Benchmark library API
- isaac-sim#6631 — Restore RL entrypoint backend state

## Integration notes

- The success-rate learning curve advances the benchmark bundle schema
from
  1.2 to 1.3.
- Runtime and play use `num_steps` and `warmup_steps` consistently.
- Shared asset and sensor suites preserve backend-specific setup while
  centralizing common workload, timing, and reporting behavior.
- The top-level micro-benchmark factory exposes exact physics selectors
and
  runs retained benchmark scripts in child processes.
- The benchmark user, framework, and micro-benchmark guides form one
  documentation path with generated API coverage for public symbols.
- Historical plan/spec commits were excluded from the consolidated
history.

## Verification

- `./isaaclab.sh -f`
- `python3 tools/changelog/cli.py check develop`
- `./isaaclab.sh -d`
- Focused benchmark and RL entrypoint tests: 315 passed, 9 skipped

---------

Co-authored-by: Kelly Guo <kellyg@nvidia.com>
ooctipus added a commit that referenced this pull request Sep 9, 2026
#7611)

# Description

The symptoms addressed by #7045 and the now-merged #7532 are real, but
the selection mechanism grew into a parallel configuration system: task
registrations described preset-to-agent relationships, the preset CLI
rediscovered those relationships and rewrote `args.agent`, every backend
had to opt into that mutation, and the documentation browser copied the
same mapping again.

Because #7532 has since merged, this branch also fully removes its live
sentinel, second parse, mutation guard, benchmark wiring, and associated
compatibility tests. Historical compiled changelog entries remain as
release history.

This PR makes the existing preset resolver the only owner of
environment-coupled selection:

```text
presets=resnet18
        |
        v
resolve_task_config(task, <library>_cfg_entry_point)
        |
        +-- environment PresetCfg root -> ResNet18 observations
        |
        `-- agent PresetCfg root       -> feature-policy configuration
```

The Gym registry now selects a library or a genuinely independent
training recipe. A library's canonical entry point owns any agent
variants coupled to environment presets, so the same `presets=`
broadcast selects both roots in one resolution pass.

The final diff is **687 additions / 787 deletions: net -100 lines**.

## Before and after

### 1. Environment-coupled agent variants

#### Before: repeat the pairing, then teach the CLI to translate it

The camera task registered separate raw and feature agent keys, then
repeated their relationship to environment presets in another
dictionary:

```python
_RAW_CAMERA_PRESETS = ("albedo", "depth", "rgb", ...)

gym.register(
    ...,
    kwargs={
        "env_cfg_entry_point": "...:CartpoleCameraEnvCfg",
        "rsl_rl_cfg_entry_point": "...:CartpoleCameraPPORunnerCfg",
        "rsl_rl_feature_cfg_entry_point": "...:CartpoleCameraFeaturePPORunnerCfg",
        "agent_preset_compatibility": {
            "rsl_rl_cfg_entry_point": _RAW_CAMERA_PRESETS,
            "rsl_rl_feature_cfg_entry_point": ("resnet18", "theia_tiny"),
            # The same pairings were repeated for RL Games.
        },
    },
)
```

The showcase tasks amplified this into one registry key per
observation/action-space combination—24 noncanonical SKRL keys across
the two tasks—plus another compatibility map:

```python
"skrl_cfg_entry_point": "...:skrl_box_box_ppo_cfg.yaml",
"skrl_box_box_cfg_entry_point": "...:skrl_box_box_ppo_cfg.yaml",
"skrl_box_discrete_cfg_entry_point": "...:skrl_box_discrete_ppo_cfg.yaml",
"skrl_box_multidiscrete_cfg_entry_point": "...:skrl_box_multidiscrete_ppo_cfg.yaml",
# ... one key for every remaining space combination ...
"agent_preset_compatibility": {
    "skrl_cfg_entry_point": ("box_box",),
    "skrl_box_discrete_cfg_entry_point": ("box_discrete",),
    # ... repeat every pairing again ...
},
```

#### After: the canonical agent entry point is a preset root

The agent package owns the variants directly:

```python
@configclass
class CartpoleCameraPPORunnerPresetsCfg(PresetCfg):
    default = CartpoleCameraPPORunnerCfg()
    resnet18 = CartpoleCameraFeaturePPORunnerCfg()
    theia_tiny = CartpoleCameraFeaturePPORunnerCfg()

gym.register(
    ...,
    kwargs={
        "env_cfg_entry_point": "...:CartpoleCameraEnvCfg",
        "rsl_rl_cfg_entry_point": "...:CartpoleCameraPPORunnerPresetsCfg",
    },
)
```

RL Games uses the same canonical-root shape with `preset(default=...,
resnet18=..., theia_tiny=...)`. The showcase YAML family is likewise
exposed behind its sole canonical key:

```python
def skrl_cfg():
    configs = {
        path.stem.removeprefix("skrl_").removesuffix("_ppo_cfg"): load_yaml(path)
        for path in Path(__file__).parent.glob("skrl_*_ppo_cfg.yaml")
    }
    return preset(default=configs.pop("box_box"), **configs)

# Gym registration
"skrl_cfg_entry_point": f"{agents.__name__}:skrl_cfg"
```

The configurations remain, but the 26 preset-specific agent keys, three
compatibility maps, and duplicate preset-name lists do not.

### 2. Preset CLI ownership

#### Before: parse, rediscover task metadata, and mutate another
subsystem's argument

```python
def setup_preset_cli(parser, argv=None, *, agent_library=None):
    ...
    args, remaining = parser.parse_known_args(args_to_parse)
    if agent_library and task_name:
        _auto_select_agent(args, task_name, agent_library, args_to_parse)
    return args, remaining

# Every caller had to opt into the second selector.
args, remaining = setup_preset_cli(parser, agent_library="rsl_rl")
```

`_auto_select_agent` scanned raw `presets=` tokens, intersected them
with the compatibility maps, selected a different registry key, and
rewrote `args.agent`. #7532 later added a sentinel and a second argparse
pass just to decide whether that mutation was allowed to override a
parser default.

#### After: parse preset syntax and return it unchanged

```python
def setup_preset_cli(parser, argv=None):
    ...
    return parser.parse_known_args(args_to_parse)

args, remaining = setup_preset_cli(parser)
```

The preset CLI is again bounded to preset help and parsing. Agent
configuration selection happens once, inside config resolution.

### 3. Humanoid AMP and SKRL algorithm identity

#### Before: infer both the config and algorithm from CLI/key spelling

```python
# Humanoid AMP registered no canonical SKRL key.
"skrl_amp_cfg_entry_point": "...:skrl_walk_amp_cfg.yaml"

# SKRL defaulted to PPO and reconstructed meaning from registry-key text.
parser.add_argument("--algorithm", default="PPO", ...)
agent_cfg_entry_point = (
    "skrl_cfg_entry_point"
    if args_cli.algorithm.lower() == "ppo"
    else f"skrl_{args_cli.algorithm.lower()}_cfg_entry_point"
)
algorithm = agent_cfg_entry_point.split("_cfg")[0].split("skrl_")[-1].lower()
```

A plain Humanoid AMP command therefore looked for the missing
`skrl_cfg_entry_point`. #7045 compensated with a second CLI rule: if the
canonical key was absent and exactly one other key existed, mutate
`args.agent` to that key. The same key-parsing pattern also mislabeled
showcase keys such as `skrl_box_discrete_cfg_entry_point` as algorithms.

#### After: the task owns its default; the resolved config owns its
algorithm

```python
# Humanoid AMP registration
"default_agent": "skrl",
"skrl_cfg_entry_point": "...:skrl_walk_amp_cfg.yaml",
"skrl_amp_cfg_entry_point": "...:skrl_walk_amp_cfg.yaml",  # explicit --algorithm AMP

agent_cfg_entry_point = resolve_skrl_agent_cfg_entry_point(args_cli.agent, args_cli.algorithm)
env_cfg, agent_cfg = resolve_task_config(args_cli.task, agent_cfg_entry_point)
algorithm = resolve_skrl_algorithm(agent_cfg, args_cli.algorithm)  # reads agent.class
```

Omitting `--algorithm` now means “use the task's canonical SKRL config,”
not “assume PPO.” An explicit `--algorithm` still selects an independent
algorithm recipe and is checked against the resolved `agent.class`.
Train, play, benchmarks, and LEAPP all use the same rule.

### 4. Downstream consumers

| Surface | Before | After |
| --- | --- | --- |
| CLI help | `_AgentDescriptionBuilder` and `_enumerate_agents` loaded
Gym metadata and rendered compatibility pairings. | Preset help
describes selectable presets; agent selection is not duplicated in the
preset CLI. |
| Environment browser | Every generated row carried
`agentPresetCompatibility`; JavaScript searched it and injected
`--agent` into commands. | The row field and JavaScript rewrite are
gone; generated commands pass `presets=` directly. |
| Environment catalog | Treated arbitrary agent-key suffixes as
algorithms, displaying recipe names such as `FEATURE` or `BOX_DISCRETE`.
| Recognizes only explicit algorithm aliases, ignores preset/recipe
suffixes, and deduplicates canonical aliases of the same config. |
| Ray Cartpole vision jobs | Set both
`--agent=rl_games_feature_cfg_entry_point` and
`presets=resnet18/theia_tiny`. | Set only the preset. |
| Missing-config diagnostics | Split every `*_cfg_entry_point` suffix
into guessed library and algorithm labels. | Lists the exact registered
configuration keys. |
| LEAPP export | The shared parser accepted `agent_library` so the
preset CLI could mutate `args.agent`; SKRL then reconstructed the
algorithm from that key. | Uses the plain preset parser and derives SKRL
identity from the resolved `agent.class`. |
| Generated project defaults | Emitted the canonical
`<library>_cfg_entry_point` only for PPO, so non-PPO and all multi-agent
projects depended on CLI fallback. | Filters selected algorithms per
workflow and marks PPO, MAPPO, or the sole selected non-PPO recipe
canonical; the documented command resolves directly. |
| Regression tests | Preserved compatibility dictionaries and asserted
an intermediate rewritten `args.agent` value. | Assert the resolved
environment and agent configs, exact canonical registrations/minimal
variants, and absence of the rejected maps/helpers. |

### 5. Commands

Before, users either had to provide both coupled selectors explicitly or
rely on the preset CLI to synthesize the `--agent` half:

```bash
# Before: two names for one camera-feature choice
uv run isaaclab train --rl_library rsl_rl \
    --task Isaac-Cartpole-Camera \
    --agent rsl_rl_feature_cfg_entry_point presets=resnet18

# After: one preset is composed into both roots
uv run isaaclab train --rl_library rsl_rl \
    --task Isaac-Cartpole-Camera presets=resnet18
```

The same simplification applies to RL Games and the showcase space
matrix:

```bash
# Before
uv run isaaclab train --rl_library skrl \
    --task IsaacContrib-Cartpole-Showcase-Direct \
    --agent skrl_box_discrete_cfg_entry_point presets=box_discrete

# After
uv run isaaclab train --rl_library skrl \
    --task IsaacContrib-Cartpole-Showcase-Direct presets=box_discrete
```

Humanoid AMP no longer depends on an algorithm flag or the sole-entry
fallback:

```bash
# Before, without relying on CLI auto-selection
uv run isaaclab train --rl_library skrl \
    --task IsaacContrib-Humanoid-AMP-Walk-Direct --algorithm AMP

# After: the canonical task config is AMP
uv run isaaclab train --rl_library skrl \
    --task IsaacContrib-Humanoid-AMP-Walk-Direct
```

`--algorithm AMP` remains valid when an explicit algorithm selection is
desired. Generated multi-agent projects likewise use MAPPO as their
canonical SKRL config, so their documented command needs no fallback:

```bash
uv run isaaclab train --rl_library skrl --task <GENERATED-MARL-TASK>
```

## Exact lineage of the removed mechanism

The structure removed or superseded here accumulated across several PRs:

| Change | Mechanism introduced | Disposition in this PR |
| --- | --- | --- |
| #2713 | Made missing-config errors split every agent entry-point key
into inferred library and algorithm labels. | Errors now report the
exact registered keys instead of inventing semantics for their suffixes.
|
| #5605 | Added the 24 space-specific showcase SKRL keys and the
RL-Games camera feature key while consolidating preset-driven Cartpole
tasks. | Keeps those configurations under canonical agent preset roots
and removes their preset-specific registry keys. |
| #5879 | Made the generated environment catalog infer algorithm labels
from arbitrary entry-point suffixes and, for RL-Games vision, from the
config path. | Catalog generation recognizes only the known algorithm
aliases and ignores preset/recipe suffixes. |
| #5904 | Added Ray camera-feature jobs that specified both
`--agent=rl_games_feature_cfg_entry_point` and
`presets=resnet18/theia_tiny`. | Ray selects each feature pipeline with
the preset alone. |
| #5930 | Added the separate `rsl_rl_feature_cfg_entry_point` for
pretrained camera features. | The canonical RSL-RL root owns its raw and
feature-policy variants. |
| #6553 and #6564 | Made SKRL train/play and benchmark entry points
default `--algorithm` to PPO, select a registry key from that default,
and reconstruct algorithm identity from explicit key suffixes. | An
omitted algorithm resolves the task's canonical config first; the
resolved `agent.class` is authoritative everywhere. |
| #6677 | Added three `agent_preset_compatibility` maps, duplicate
`_SPACE_PRESETS` / `_RAW_CAMERA_PRESETS` lists, `setup_preset_cli(...,
agent_library=...)`, `_AgentDescriptionBuilder`, `_enumerate_agents`,
and `agent_library=` plumbing in all eight unified RL train/play entry
points. It also added help, docs, and tests around those pairings. |
Deletes the maps, duplicate lists, agent-aware preset CLI API/helpers,
call-site plumbing, and preservation tests. |
| #6779 | Extended `agent_library` into the shared LEAPP export parser
and added another SKRL helper that inferred the algorithm from the agent
key. | Removes that parser parameter/helper and resolves algorithm
identity from the loaded config. |
| #7045 | Promoted the compatibility metadata from help text into
runtime control with `_auto_select_agent`, raw `presets=` scanning,
declared-domain filtering, preset-to-key matching, post-parse
`args.agent` mutation, and a sole-noncanonical-agent fallback for
Humanoid AMP. It also wired the two SKRL benchmark entry points. |
Deletes both selection rules and their benchmark wiring. Presets compose
the environment and agent roots directly; AMP is registered canonically.
|
| #7160 | Copied `agent_preset_compatibility` into the generated
environment-browser row schema and used it in JavaScript to inject a
preset-specific `--agent` into generated commands. | Removes the
compatibility column and browser-side command rewrite. |
| #7532 (merged) | Added `_AGENT_UNSET`, a second argparse pass in
`_agent_passed_explicitly`, a looser mutation guard, six
RSL-RL/RL-Games/SB3 benchmark train/play wirings, and tests for
rewritten `args.agent` values and explicit-flag spellings. | Fully
reverts its live implementation: there is no agent-key mutation to
guard, no backend-specific preset-CLI wiring to propagate, and no
preservation test for that removed behavior. |

This is therefore more than an alternative fix for two symptoms: it
removes the parallel preset-to-agent selection system end to end.

## Intentional compatibility removal

No warning-only or no-op compatibility shim is retained for:

- `agent_preset_compatibility`
- preset-specific agent keys such as `rsl_rl_feature_cfg_entry_point`
and the showcase space-specific SKRL keys
- `setup_preset_cli(..., agent_library=...)`

The separately named `pretrained_checkpoint_preset_compatibility`
metadata from #7630 is intentionally retained: it declares which
preset-specific checkpoint artifacts exist and never selects an agent
entry point.

Keeping those aliases would preserve the duplicate ownership this
refactor removes. Commands using a preset-specific key should remove
`--agent=<preset-specific-key>` and use the canonical library selection
plus `presets=<name>`, as shown above.

Older SKRL runs may have encoded a configuration-key suffix such as
`box_discrete` as the algorithm in a run directory or manifest. The
corrected identity is the resolved `agent.class` (`PPO` in that
example), so automatic `latest` / `best` discovery cannot safely match
those historical runs. Pass their checkpoint path explicitly.

## Type of change

- Bug fix
- Architecture refactor
- Intentional removal of recently introduced compatibility APIs
- Documentation update

## Validation

The four-case composition regression was also run against an untouched
`develop` worktree. All four cases failed there because the environment
preset changed while the canonical agent stayed at its default; all four
pass on this branch.

- Preset composition, CLI, RL entrypoint, generator, and benchmark
adapter/API tests: **148 passed**
- Pretrained-checkpoint metadata tests: **12 passed**
- Environment documentation tests: **35 passed**
- LEAPP selector/checkpoint tests: **11 passed, 1 skipped**
- Environment browser generation: up to date for **137** training
environments
- JavaScript syntax, pre-commit hooks for all PR files, changelog
validation against current `upstream/develop`, centralized structure
audit, and `git diff --check`: passed

No GPU simulation or full training job was run; the regression is
exercised at configuration composition and entrypoint boundaries before
environment construction.

The generated environment-browser refresh also incorporates the current
physics selectors for the two DrLegs rows.

## Release backport

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

## Screenshots

Not applicable.

## Checklist

- [x] I have read and understood the contribution guidelines
- [x] I have run the pre-commit checks with `uv run --frozen isaaclab
-f`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove the fix is effective
- [x] I have added changelog fragments for every touched package
- [x] My name already exists in `CONTRIBUTORS.md`
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.

3 participants