Support graph-spec YAML environments in typed YAML experiment configs#943
Support graph-spec YAML environments in typed YAML experiment configs#943alexmillane wants to merge 4 commits into
Conversation
The typed YAML experiment frontend previously resolved environment.type only against registered environment names; graph-spec YAML environments (e.g. the robolab tasks) were reachable only through the legacy JSON format or the CLI. An environment.type ending in .yaml/.yml now routes through the same LegacyGraphEnvironmentCfg compatibility path the JSON frontend uses, and the camera pre-launch guard recognizes such runs. Signed-off-by: Alex Millane <amillane@nvidia.com>
🤖 Isaac Lab-Arena Review BotSummaryThis PR lets typed YAML experiment configs select graph-spec YAML environments ( FindingsNo blocking issues found. A few things I verified and liked:
Test CoverageWell covered. The new unit tests assert the exact VerdictShip it |
Greptile SummaryThis PR extends the typed YAML experiment frontend so that an
Confidence Score: 4/5Safe to merge; the changes are a well-scoped compatibility shim with good test coverage, touching only the experiment loading and camera-guard paths. The implementation is clean and consistent with existing patterns. The only issue found is a minor dict construction order in _graph_environment_cfg_from_yaml_values where "environment" is placed first in the literal, meaning a hypothetically colliding key in the spread dicts could silently overwrite the graph-spec YAML path. Tests cover the factory contract, token ordering, camera detection, and the no-factory assertion. isaaclab_arena/evaluation/arena_experiment_config_loader.py — the _graph_environment_cfg_from_yaml_values dict literal ordering Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Loader as arena_experiment_config_loader
participant HydraLoader as typed_experiment_loader
participant CliArgs as legacy_environment_cli_args
participant Runner as experiment_runner
User->>Loader: load_arena_experiment_from_config_file(path, device)
Loader->>HydraLoader: load_arena_experiment_from_yaml(path, env_cfg_types, policy_resolver, graph_env_factory)
loop for each Run
HydraLoader->>HydraLoader: _graph_spec_yaml_selector(environment_values)
alt type ends with .yaml/.yml
HydraLoader->>Loader: graph_environment_cfg_factory(graph_spec_yaml, env_values, builder_values)
Loader->>CliArgs: "legacy_environment_args_to_cli_args({environment, ...builder_values, ...env_values})"
CliArgs-->>Loader: [--num_envs, 2, --enable_cameras, --env_graph_spec_yaml, path, ...]
Loader-->>HydraLoader: "LegacyGraphEnvironmentCfg(arena_env_args=[...])"
else registered selector name
HydraLoader->>HydraLoader: _compose_typed_config_from_yaml_selector(...)
end
HydraLoader->>HydraLoader: Compose ArenaRunCfg via Hydra (remaining_values incl. environment_builder)
end
HydraLoader-->>Loader: "ArenaExperimentCfg(runs={...})"
Loader->>Loader: Apply device to each run.environment_builder
User->>Runner: main() / _assert_camera_support_enabled(experiment_cfg, enable_cameras)
loop for each Run
Runner->>Runner: _run_environment_requires_cameras(run_cfg)
alt isinstance LegacyGraphEnvironmentCfg
Runner->>Runner: --enable_cameras in arena_env_args
else typed environment
Runner->>Runner: getattr(environment, enable_cameras, False)
end
end
Reviews (1): Last reviewed commit: "Support graph-spec YAML environments in ..." | Re-trigger Greptile |
| arena_env_args: dict[str, Any] = { | ||
| "environment": env_graph_spec_yaml, | ||
| **environment_builder_values, | ||
| **environment_values, | ||
| } |
There was a problem hiding this comment.
The
"environment" key is set first in the literal, so a key named "environment" in either environment_builder_values or environment_values (e.g. a YAML field literally called environment nested inside the environment: section) would silently overwrite env_graph_spec_yaml. Placing it last guarantees it always wins.
| arena_env_args: dict[str, Any] = { | |
| "environment": env_graph_spec_yaml, | |
| **environment_builder_values, | |
| **environment_values, | |
| } | |
| arena_env_args: dict[str, Any] = { | |
| **environment_builder_values, | |
| **environment_values, | |
| "environment": env_graph_spec_yaml, | |
| } |
language_instruction is not a flag on the graph-environment parser (it is injected from the typed builder config after parsing, as is device), so rendering it as a token made argparse swallow the value as the example-environment positional. Signed-off-by: Alex Millane <amillane@nvidia.com>
Literal annotations are rejected by OmegaConf structured configs, which blocked the GR00T remote policy from typed YAML Experiments; the policy constructor already validates the value at runtime. Signed-off-by: Alex Millane <amillane@nvidia.com>
osmo/submit_arena_experiment.py embeds the effective Experiment by re-serializing it, which failed for graph-YAML environments because the serializer only resolves registry-registered configs. The compatibility config now records its graph-spec path and source environment values, and the serializer emits them as the environment section. Graph runs also now execute with the Run's typed environment_builder config instead of one re-derived from CLI tokens, so post-load Hydra overrides (e.g. environment_builder.num_envs on an OSMO submission) take effect; tokens carry only environment values. Signed-off-by: Alex Millane <amillane@nvidia.com>
Summary
Support graph-YAML environments in typed YAML experiment configs
Detailed description
environment.typeonly against registered environment names, so graph-spec YAML environments (e.g.isaaclab_arena_environments/robolab/tasks/*.yaml) were reachable only through the legacy JSON format or the CLI.environment.typeending in.yaml/.ymlnow builds the same temporaryLegacyGraphEnvironmentCfgcompatibility config the JSON frontend produces, via agraph_environment_cfg_factoryinjected from the evaluation layer next to the othertyped-config-migrationshims.environment_builderconfig (not one re-derived from CLI tokens), so post-load Hydra overrides such asexperiment_cfg.runs.X.environment_builder.num_envs=4on an OSMO submission take effect; the pre-launch camera guard also recognizes graph runs.osmo/submit_arena_experiment.pynow works with graph-run experiments: the compatibility config records its graph-spec path and source values, andserialize_arena_experiment_to_yamlemits them, so the embedded per-Run handoff round-trips through the runner loader. The GR00T remote policy config'sLiteralannotation was also relaxed so it composes in typed YAML experiments.experiment_runner.pyon a robolab graph run with anum_envsoverride applied;osmo.submit_arena_experiment --policy_server pi0 osmo.dry_run=truerenders a 4-run robolab workflow with embedded graph experiments.