Skip to content

Load typed experiments alongside external environments - #1379

Closed
bdou0716 wants to merge 2 commits into
isaac-sim:mainfrom
bdou0716:bdouillard/fix/typed-loader-external-envs-public
Closed

bdou0716 wants to merge 2 commits into
isaac-sim:mainfrom
bdou0716:bdouillard/fix/typed-loader-external-envs-public

Conversation

@bdou0716

@bdou0716 bdou0716 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Load experiments backed by configuration classes beside unrelated external environments.

Fixes blocked experiment loading.

Why this change?

  • Arena loads experiment files that configure simulated robot evaluations.
  • An unrelated external environment can lack a configuration class.
  • Importing it then blocks otherwise valid experiments.

What changes?

  • Discover only configured environments so unrelated registrations cannot block valid experiments.

Illustration

Configured environments enter discovery; unconfigured ones are skipped

  • Schematic: discovery skips environments without configuration classes.

System view

before
  all environments ──► configuration lookup ──► unrelated error

after
  registry ──► configured environments ──► selected experiment
           └► unconfigured environments (skipped)

Files

Kind Files Added Removed Share
Code 2 13 6 31%
Tests 1 38 0 62%
Docs 1 4 0 7%
Total 4 55 6 100%
IsaacLab-Arena/
├── docs/pages/concepts/concept_arena_experiments.rst  isolated experiment discovery
└── isaaclab_arena/
    ├── assets/registries.py                           configured environment discovery
    ├── evaluation/arena_experiment_config_loader.py   typed experiment loading
    └── tests/test_arena_experiment_config_loader.py   external registration regression checks

Review-bot findings

  • Use the supported registry lookup.
  • Preserve alternate names when the obsolete lookup map is removed.

Commit review order

I can split these commits into smaller pull requests.

Order Commit Title
1 91ee64d0 Load typed experiments beside external environments
2 a0994244 Document isolated typed experiment discovery

Usage example

Before:

Import unconfigured environment -> load valid experiment -> error

After:

Import unconfigured environment -> load valid experiment -> loaded

Compatibility

  • Existing selectors and alternate construction routes remain available.
  • Explicitly selecting an unconfigured environment still fails.

Validation

Results

  • Focused checks ran at 91ee64d082.
  • The follow-up changes documentation only.
  • An earlier full suite passed with all five changes combined.
  • It retained six live-service skips and one expected conversion failure.
  • The five combined pass the full suite at the revisions before the documentation follow-ups: 2,090 of 2,091 executions, 6 live-service skips, 1 expected failure.
Check Result
External registration Valid experiments load after unrelated imports
Alias after lookup cleanup Configured alternate names still resolve
Unconfigured selection Explicit requests still raise errors
Existing workflows Overrides and legacy loading passed
Reports Existing reports passed

Not covered

  • Upstream automation has no result for this head.

@bdou0716
bdou0716 marked this pull request as ready for review October 6, 2026 17:40
Comment on lines +289 to +296
def get_environment_cfg_types(self) -> dict[str, type["ArenaEnvironmentCfg"]]:
"""Return selectors for factories that registered typed configurations."""
ensure_assets_registered()
return {
name: self._cfg_types_by_factory_type[factory_type]
for name, factory_type in self._components.items()
if factory_type in self._cfg_types_by_factory_type
}

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.

🔵 Build this from the map that outlives the migration

The old TODO planned to delete _cfg_types_by_factory_type together with the legacy JSON adapter. This PR drops that from the TODO because the new method now reads that map from the typed YAML path, which is meant to stay. Could it read _factory_types_by_cfg_type instead? That map is kept after the migration, and register_environment already keys every typed factory by factory_type.name. The legacy-only map could then still be removed as planned, and the TODO could go back to its original wording.

Suggested change
def get_environment_cfg_types(self) -> dict[str, type["ArenaEnvironmentCfg"]]:
"""Return selectors for factories that registered typed configurations."""
ensure_assets_registered()
return {
name: self._cfg_types_by_factory_type[factory_type]
for name, factory_type in self._components.items()
if factory_type in self._cfg_types_by_factory_type
}
def get_environment_cfg_types(self) -> dict[str, type["ArenaEnvironmentCfg"]]:
"""Return selectors for factories that registered typed configurations."""
ensure_assets_registered()
return {factory_type.name: cfg_type for cfg_type, factory_type in self._factory_types_by_cfg_type.items()}

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

The typed YAML loader now builds its environment list only from factories that registered a typed config. External environments that come in through --external_environment_class_path use the plain register() path and have no config, so they no longer break loading of unrelated experiments. Selecting one of them by name still fails. The fix is small, sits in the right layer, and the new test covers both the case that used to fail and the case that should still fail.

Findings

🔵 Improvement: isaaclab_arena/assets/registries.py:289 — get_environment_cfg_types reads _cfg_types_by_factory_type, which the TODO planned to delete with the legacy JSON adapter. Building the dict from _factory_types_by_cfg_type (kept after the migration) would leave that cleanup plan intact. See the inline suggestion.

Verdict

Ship it

@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Typed experiments can now load when an unrelated external environment has no configuration class.

  • Built-in experiments load even when external environments lack typed configs.

Reviews (2) · Last reviewed commit: "Load typed experiments beside external e..." · Reviewed by Greptile

@bdou0716
bdou0716 marked this pull request as draft November 3, 2026 13:06
@bdou0716
bdou0716 force-pushed the bdouillard/fix/typed-loader-external-envs-public branch from 7a6492e to 91ee64d Compare November 3, 2026 13:07
@bdou0716 bdou0716 changed the title Load typed experiments alongside unconfigured external environments Load typed experiments alongside external environments Nov 3, 2026
@bdou0716
bdou0716 marked this pull request as ready for review November 3, 2026 13:07
@arena-review-bot

Copy link
Copy Markdown
Contributor

The review stopped before it finished. Please run /review to retry.

alexmillane added a commit that referenced this pull request Nov 3, 2026
load_arena_experiment_from_config_file checks that every registered
environment has a config. In CI, test_external_environment runs earlier
in the same process and leaves ExternalFrankaTableEnvironment registered
without one, so every PerfLab config test failed (issue #1580).

Load the PerfLab Experiments with load_arena_experiment_from_yaml and an
explicit environment config mapping instead, as test_experiment_hydra
does. Switch back once #1379 fixes the loader.

Signed-off-by: alex <[email protected]>
@bdou0716

bdou0716 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

/review

@arena-review-bot

Copy link
Copy Markdown
Contributor

The review stopped before it finished. Please run /review to retry.

Requested in this comment.

@alexmillane

Copy link
Copy Markdown
Collaborator

/review

@arena-review-bot

Copy link
Copy Markdown
Contributor

The review stopped before it finished. Please run /review to retry.

Requested in this comment.

@alexmillane

Copy link
Copy Markdown
Collaborator

@bdou0716 Thank you for adding this!!!

This issue has now shown up in CI and is blocking some work so in the interests of time I have copied the MR over to #1594 and am doing a bit of cleanup there.

Will merge from there.

alexmillane added a commit that referenced this pull request Nov 4, 2026
Load typed Experiments when an unrelated environment without a config is
registered. Copy of #1379 by @bdou0716, merged with `main`.

Fixes #1580.

## Why this change?

- `_registered_environment_cfg_types()` asserts that every registered
environment has a config.
- External environments registered through
`--external_environment_class_path` or the Isaac Lab callback have none,
so loading any typed Experiment in the same process fails with "must
register a config".
- This is causing bugs in our tests: for some test orderings:
`test_external_environment.py` leaves `franka_table` registered, and
later loader tests fail.

## What changes?

- Add `EnvironmentRegistry.get_environment_cfg_types()`, which returns
only the environments that registered a config.
- `_registered_environment_cfg_types()` uses it. Selecting an
environment without a config still fails, with "unknown environment
type".

## Validation

- Adds
`test_typed_experiment_ignores_unconfigured_external_environment`.

---------

Signed-off-by: Bertrand Douillard <[email protected]>
Signed-off-by: alex <[email protected]>
Co-authored-by: Bertrand Douillard <[email protected]>
alexmillane added a commit that referenced this pull request Nov 4, 2026
load_arena_experiment_from_config_file checks that every registered
environment has a config. In CI, test_external_environment runs earlier
in the same process and leaves ExternalFrankaTableEnvironment registered
without one, so every PerfLab config test failed (issue #1580).

Load the PerfLab Experiments with load_arena_experiment_from_yaml and an
explicit environment config mapping instead, as test_experiment_hydra
does. Switch back once #1379 fixes the loader.

Signed-off-by: alex <[email protected]>
@bdou0716

bdou0716 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged upstream via #1594, closing.

@bdou0716 bdou0716 closed this Nov 5, 2026
alexmillane added a commit that referenced this pull request Nov 5, 2026
load_arena_experiment_from_config_file checks that every registered
environment has a config. In CI, test_external_environment runs earlier
in the same process and leaves ExternalFrankaTableEnvironment registered
without one, so every PerfLab config test failed (issue #1580).

Load the PerfLab Experiments with load_arena_experiment_from_yaml and an
explicit environment config mapping instead, as test_experiment_hydra
does. Switch back once #1379 fixes the loader.

Signed-off-by: alex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] Ignore unconfigured external environments during typed discovery

2 participants