Skip to content

Run typed YAML experiments from eval_runner.py - #876

Merged
cvolkcvolk merged 6 commits into
mainfrom
cvolk/refactor/eval-runner-yaml-integration
Jul 12, 2026
Merged

cvolkcvolk merged 6 commits into
mainfrom
cvolk/refactor/eval-runner-yaml-integration

Conversation

@cvolkcvolk

@cvolkcvolk cvolkcvolk commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Connect typed YAML Experiments to eval_runner while preserving legacy JSON evaluation.

Detailed description

  • Build on Add typed YAML experiment composition #873 by accepting typed YAML arena experiments through the --experiment_config option and forwarding Hydra overrides.
  • Compose typed Runs only after AppLauncher starts, avoiding pre-start runtime registry and pxr imports without changing registry boundaries.
  • Preserve legacy JSON behavior and the --eval_jobs_config alias until legacy json files are ported.

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This PR wires typed YAML Experiments into eval_runner behind a neutral --experiment_config flag (keeping the --eval_jobs_config alias), moves config loading until after SimulationApp starts so registry/pxr discovery stays safe, and preserves legacy JSON behavior (camera auto-detection, JSON-only chunking, per-Run device). The layering is sound — the loader sits in evaluation/, sim-dependent imports are deferred, and the getting-started YAML is renamed to Hydra-path-compatible Run names with a new validation guard. Nice, well-tested refactor; only one minor cleanup.

Findings

🔵 Improvement: eval_runner.py:144 — _validate_experiment_config_path duplicates the exact is_file + suffix validation (same assert messages) already performed inside load_arena_experiment_from_config_file. Suggest exposing one shared validator from arena_experiment_config_loader and calling it from both so the definition of a valid config path has a single home.

Notes (verified clean, not blocking)

  • getattr(run_cfg.environment, "enable_cameras", False) is justified — enable_cameras lives on concrete env cfgs, not the base ArenaEnvironmentCfg, so it is genuinely heterogeneous.
  • YAML camera runs correctly fail loud post-startup when --enable_cameras is missing, rather than silently running without cameras.
  • Copyright years on the two new files are correct (2026, single year).

Test Coverage

Strong. New tests cover override+device application, post-startup load ordering, the camera-flag assertion, preserved legacy JSON camera detection, YAML-chunking rejection, JSON-rejects-overrides, unknown file type, and Hydra-compatible Run-name validation, plus an end-to-end with_subprocess YAML run through the neutral CLI. Markers are appropriate (subprocess test marked; monkeypatched loader tests are Phase 1 and need no sim).

Verdict

Ship it (address the small duplication nit at your convenience).

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the eval runner to accept typed YAML experiments (alongside the existing legacy JSON path) via a unified --experiment_config flag, forwarding repeatable --experiment_override Hydra overrides and deferring YAML composition until after SimulationApp starts to avoid pre-startup registry and pxr imports.

  • New loader (arena_experiment_config_loader.py): dispatches to the legacy JSON adapter or the Hydra YAML composer based on file extension, applies the process-wide device to every run, and enforces that Hydra overrides are only used with YAML.
  • Camera handling split: legacy JSON experiments retain automatic pre-startup camera detection; typed YAML experiments require the user to pass --enable_cameras explicitly, validated post-startup via _assert_camera_support_enabled.
  • Run name constraints: a new _assert_run_name_is_hydra_compatible check enforces that run names begin with a letter or underscore (rejecting the previous 01_baseline style), enabling those names to appear as keys in Hydra override dotted paths; the existing getting_started_experiment.yaml run names are updated accordingly.

Confidence Score: 4/5

The YAML experiment path is well-structured and the legacy JSON behavior is preserved; the main uncertainty is whether the hyphen character in run names will parse correctly in the installed Hydra version's override grammar.

The core logic — dispatching JSON vs YAML, deferring composition until after SimulationApp starts, enforcing overrides only for YAML, and restricting chunking to JSON — is all correct and well-tested. The one open question is _assert_run_name_is_hydra_compatible allowing hyphens: historical Hydra versions define ID as [a-zA-Z0-9_] only, so a run named e.g. my-run would trigger a LexerNoViableAltException when a user tries an override like runs.my-run.foo=bar. Whether this bites depends on the installed Hydra version, so it is worth confirming before users start adopting the new naming freedom.

isaaclab_arena/hydra/arena_experiment.py — the hyphen allowance in _assert_run_name_is_hydra_compatible

Important Files Changed

Filename Overview
isaaclab_arena/evaluation/arena_experiment_config_loader.py New loader that dispatches between legacy JSON and typed YAML experiments; clean separation of concerns and correct post-startup registry access pattern.
isaaclab_arena/evaluation/eval_runner.py Main orchestration refactored to support YAML experiments; pre-startup camera auto-detection preserved for JSON, camera assertion added post-startup for YAML, chunking correctly restricted to JSON.
isaaclab_arena/evaluation/eval_runner_cli.py Adds --experiment_config as the canonical flag (keeping --eval_jobs_config alias) and introduces --experiment_override with correct action=append semantics.
isaaclab_arena/hydra/arena_experiment.py Adds run-name Hydra compatibility check; regex allows hyphens which may not be supported in the installed Hydra version's override key grammar.
isaaclab_arena/tests/test_arena_experiment_config_loader.py New unit tests covering YAML loading, startup ordering, camera flag requirements, JSON chunking rejection, override rejection for JSON, and unknown file type rejection.
isaaclab_arena/tests/test_eval_runner.py Extends existing eval-runner integration tests with a typed YAML end-to-end subprocess test; the config_option parameter cleanly covers both legacy and new CLI flags.
isaaclab_arena/tests/test_experiment_hydra.py Updates expected run names after the numeric-prefix drop and adds a test that numeric-prefixed names (e.g., 01_baseline) are now rejected.
isaaclab_arena_environments/experiment_configs/getting_started_experiment.yaml Renames all four runs from numeric-prefixed (e.g., 01_baseline) to plain identifiers (baseline) to satisfy the new Hydra-compatible name constraint.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[eval_runner main] --> B[_parse_eval_runner_args]
    B --> C[_validate_experiment_config_path]
    C --> D{suffix .json?}
    D -- yes --> E[_load_legacy_json_experiment_config
pre-startup JSON read]
    D -- no --> F[legacy_experiment_config = None]
    E --> G{any job
requires cameras?}
    G -- yes --> H[args_cli.enable_cameras = True]
    G -- no --> I[continue]
    F --> I
    H --> I
    I --> J{--list_variations?}
    J -- yes --> K[SimulationAppContext]
    K --> L[load_arena_experiment_from_config_file
post-startup YAML compose or JSON adapt]
    L --> M[_assert_camera_support_enabled]
    M --> N[list_variations]
    J -- no --> O{--chunk_size set?}
    O -- yes, JSON --> P{jobs > chunk_size?}
    P -- yes --> Q[_run_legacy_json_in_chunks
subprocess per chunk]
    P -- no --> R[SimulationAppContext]
    O -- yes, YAML --> S[AssertionError:
chunking not supported]
    O -- no --> R
    R --> L2[load_arena_experiment_from_config_file]
    L2 --> M2[_assert_camera_support_enabled]
    M2 --> T[execute_experiment]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[eval_runner main] --> B[_parse_eval_runner_args]
    B --> C[_validate_experiment_config_path]
    C --> D{suffix .json?}
    D -- yes --> E[_load_legacy_json_experiment_config
pre-startup JSON read]
    D -- no --> F[legacy_experiment_config = None]
    E --> G{any job
requires cameras?}
    G -- yes --> H[args_cli.enable_cameras = True]
    G -- no --> I[continue]
    F --> I
    H --> I
    I --> J{--list_variations?}
    J -- yes --> K[SimulationAppContext]
    K --> L[load_arena_experiment_from_config_file
post-startup YAML compose or JSON adapt]
    L --> M[_assert_camera_support_enabled]
    M --> N[list_variations]
    J -- no --> O{--chunk_size set?}
    O -- yes, JSON --> P{jobs > chunk_size?}
    P -- yes --> Q[_run_legacy_json_in_chunks
subprocess per chunk]
    P -- no --> R[SimulationAppContext]
    O -- yes, YAML --> S[AssertionError:
chunking not supported]
    O -- no --> R
    R --> L2[load_arena_experiment_from_config_file]
    L2 --> M2[_assert_camera_support_enabled]
    M2 --> T[execute_experiment]
Loading

Reviews (1): Last reviewed commit: "Run typed YAML Experiments from eval run..." | Re-trigger Greptile

@cvolkcvolk
cvolkcvolk force-pushed the cvolk/refactor/eval-runner-yaml-integration branch from 330e232 to 24a47c9 Compare July 9, 2026 08:44
@cvolkcvolk cvolkcvolk changed the title Run typed YAML Experiments from eval runner Run typed YAML Experiments from eval_runner.py Jul 9, 2026
@cvolkcvolk cvolkcvolk changed the title Run typed YAML Experiments from eval_runner.py Run typed YAML experiments from eval_runner.py Jul 9, 2026
@cvolkcvolk
cvolkcvolk force-pushed the cvolk/refactor/eval-runner-yaml-integration branch from 24a47c9 to a094353 Compare July 9, 2026 09:08
@cvolkcvolk
cvolkcvolk force-pushed the cvolk/refactor/hydra-experiment-composition branch from a0b06b0 to 419a2cc Compare July 9, 2026 16:56
@cvolkcvolk
cvolkcvolk force-pushed the cvolk/refactor/eval-runner-yaml-integration branch 2 times, most recently from adb0d67 to 6255af5 Compare July 9, 2026 21:54
@cvolkcvolk
cvolkcvolk changed the base branch from cvolk/refactor/hydra-experiment-composition to main July 9, 2026 21:55

@alexmillane alexmillane 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.

LGTM!!!

Load typed YAML only after AppLauncher starts so runtime registry discovery remains safe. Preserve legacy JSON behavior and expose explicit Hydra overrides for typed Runs.

Signed-off-by: Clemens Volk <[email protected]>
Keep import-safe dependencies at module scope while leaving registry discovery after AppLauncher. Make the YAML process-device update explicit and avoid repeating it for legacy JSON.

Signed-off-by: Clemens Volk <[email protected]>
Keep path and suffix validation in the config loader so eval_runner and independent callers share one rule. Record the follow-up for moving device ownership to process-level execution configuration.

Signed-off-by: Clemens Volk <[email protected]>
Use native Hydra tokens and verify typed Run overrides end to end.

Isolate legacy JSON dispatch and record the camera follow-up.

Signed-off-by: Clemens Volk <[email protected]>
@cvolkcvolk
cvolkcvolk force-pushed the cvolk/refactor/eval-runner-yaml-integration branch from b0f0a82 to 40306c4 Compare July 10, 2026 15:02
@cvolkcvolk
cvolkcvolk enabled auto-merge (squash) July 10, 2026 15:02
@cvolkcvolk
cvolkcvolk merged commit fa2b97a into main Jul 12, 2026
6 checks passed
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.

2 participants