Repository navigation
Add typed Arena experiment runner - #867
Conversation
🤖 Isaac Lab-Arena Review BotSummaryThis PR replaces the mutable Findings🟡 experiment_execution.py:50 — The rebuild loop is 🔵 arena_experiment.py:79 — Test CoverageGood. The new pure-Python logic is well covered without a sim: VerdictShip it (after confirming the |
Greptile SummaryThis PR introduces
Confidence Score: 3/5Two behavioral changes in the legacy adapter path need attention before this merges: per-rebuild failure recovery is gone and certain existing JSON configs will be rejected outright. The old eval loop placed its try/except inside the per-rebuild for loop so that continue_on_error=True could skip a failing rebuild and aggregate metrics from the successful ones. build_and_run_experiment uses only try/finally in that loop, so any rebuild exception now propagates immediately, discarding all partial metrics and preventing remaining rebuilds from running. Separately, the top-level assert set(config) == {"jobs"} in experiment_cfgs_from_legacy_eval_config will raise for any existing JSON config that carries extra metadata fields, contradicting the stated goal of keeping current JSON files working. experiment_execution.py (rebuild failure handling) and legacy_eval_config.py (config key assertion) need the most attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["eval_runner.main()"] --> B["experiment_cfgs_from_legacy_eval_config()"]
B --> C{"environment is\ngraph YAML?"}
C -- yes --> D["LegacyGraphEnvironmentCfg\n(arena_env_args: list[str])"]
C -- no --> E["EnvironmentRegistry\n.get_environment_cfg_type()\n→ concrete ArenaEnvironmentCfg"]
D --> F["ArenaExperimentCfg"]
E --> F
B --> G["PolicyRegistry\n.get_policy_cfg_type()\n→ concrete PolicyCfg"]
G --> F
F --> H["build_and_run_experiment()"]
H --> I["_split_episodes_across_rebuilds()"]
I --> J["for each rebuild"]
J --> K{"LegacyGraphEnvironmentCfg?"}
K -- yes --> L["build_arena_builder_from_legacy_graph()\n(argparse path)"]
K -- no --> M["EnvironmentRegistry\n.get_factory_type_for_cfg()\n→ factory.build(cfg)"]
L --> N["arena_builder.make_registered()"]
M --> N
N --> O["_build_policy_from_cfg()\nPolicyRegistry.get_policy_type_for_cfg()"]
O --> P["rollout_policy()"]
P --> Q["close_experiment_resources()"]
Q --> R["aggregate_metrics()\n→ ArenaExperimentResult(COMPLETED)"]
%%{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["experiment_cfgs_from_legacy_eval_config()"]
B --> C{"environment is\ngraph YAML?"}
C -- yes --> D["LegacyGraphEnvironmentCfg\n(arena_env_args: list[str])"]
C -- no --> E["EnvironmentRegistry\n.get_environment_cfg_type()\n→ concrete ArenaEnvironmentCfg"]
D --> F["ArenaExperimentCfg"]
E --> F
B --> G["PolicyRegistry\n.get_policy_cfg_type()\n→ concrete PolicyCfg"]
G --> F
F --> H["build_and_run_experiment()"]
H --> I["_split_episodes_across_rebuilds()"]
I --> J["for each rebuild"]
J --> K{"LegacyGraphEnvironmentCfg?"}
K -- yes --> L["build_arena_builder_from_legacy_graph()\n(argparse path)"]
K -- no --> M["EnvironmentRegistry\n.get_factory_type_for_cfg()\n→ factory.build(cfg)"]
L --> N["arena_builder.make_registered()"]
M --> N
N --> O["_build_policy_from_cfg()\nPolicyRegistry.get_policy_type_for_cfg()"]
O --> P["rollout_policy()"]
P --> Q["close_experiment_resources()"]
Q --> R["aggregate_metrics()\n→ ArenaExperimentResult(COMPLETED)"]
Reviews (1): Last reviewed commit: "Simplify legacy config conversion signat..." | Re-trigger Greptile |
alexmillane
left a comment
There was a problem hiding this comment.
LGTM.
Only comment is on what we call the experiments. Let's discuss that.
Separate portable experiment declarations from execution results and sequential dispatch. Remove the mutable Job and JobManager model while preserving the current JSON and environment-graph CLI paths behind explicit compatibility adapters. Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Return one resolved plan per legacy JSON job instead of parallel config and builder collections. Keep failure reporting in eval_runner and limit experiment results to data currently consumed. Signed-off-by: Clemens Volk <[email protected]>
Register environment config-to-factory mappings so typed execution no longer carries temporary builder callbacks. Keep graph configs on the legacy argparse branch and require explicit or policy-provided rollout limits. Signed-off-by: Clemens Volk <[email protected]>
Name config and legacy builders explicitly, document which registry direction remains part of typed execution, and explain the one import that must wait for SimulationApp. Signed-off-by: Clemens Volk <[email protected]>
Pass only preserved CLI arguments and the values they require into the legacy builder adapter. Keep the typed experiment and builder configs outside the argparse compatibility function. Signed-off-by: Clemens Volk <[email protected]>
Keep the JSON job adapter focused on producing typed experiment configs while limiting argparse compatibility to graph-YAML environment construction. Reject unknown registered-environment fields instead of silently falling back to the legacy parser. Signed-off-by: Clemens Volk <[email protected]>
Separate shared legacy CLI argument formatting from the graph-only compatibility path, and name the JSON conversion module after the evaluation configuration it consumes. Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
f76a805 to
e4f1f18
Compare
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
Signed-off-by: Clemens Volk <[email protected]>
## Summary Use typed Runs for experiment orchestration. Replace the CLI-oriented `Job` and `JobManager` layer with the typed Run configuration and result model introduced in #867. ## Detailed description - Treat each JSON document as an ordered Experiment of Runs and execute them directly through build_and_run. - Preserve the legacy JSON schema, CLI, chunking, camera preflight, reporting, and continue-on-error behavior. --------- Signed-off-by: Clemens Volk <[email protected]>
## Summary Keep local planning files `CONTEXT.md` and `CONTEXT-MAP.md` out of Git ## Detailed description - `CONTEXT.md` was created while planning #867 and was merged unintentionally. - Removes the file and ignores `/CONTEXT.md` and `/CONTEXT-MAP.md` at the repository root so they are not committed by mistake --------- Signed-off-by: Clemens Volk <[email protected]>
Summary
Run evaluations from typed experiment configs. Add
ArenaExperimentCfgandRolloutCfgso an experiment describes its environment, policy, and rollout without making execution depend on an argparse namespace.Detailed description
experiment_cfgs_from_legacy_eval_config().build_and_run_experiment()can run anArenaExperimentCfgdirectly, without a temporary callback wrapper.Part of a broader move away from passing
argparse.Namespaceobjects through Arena’s runtime. Environments, policies, builders, and evaluations will consume source-independent typed configs, allowing CLI, YAML/Hydra, and Python callers to share the same execution path.Depends on #863