Skip to content

Write each Run's graph environment definition to its output directory - #1776

Merged
alexmillane merged 10 commits into
mainfrom
alexmillane/feature/save-run-environment-definition
Dec 1, 2026
Merged

alexmillane merged 10 commits into
mainfrom
alexmillane/feature/save-run-environment-definition

Conversation

@alexmillane

@alexmillane alexmillane commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Write each Run's graph YAML environment to arena_run_environment_definition.yaml in the output directory.

Why this change?

  • This captures the environment as it was run.

What changes?

  • execute_experiment writes the definition with the other outputs of each completed Run.
  • external_yaml includes are merged in.
  • Per-Run overrides are applied and written out.

Usage example

A Run in the Experiment definition

runs:
  maple_table_dex_cube:
    environment:
      type: isaaclab_arena/tests/test_data/pick_and_place_maple_table_env_graph.yaml
      object: dex_cube

The Run's output directory then holds arena_run_environment_definition.yaml, excerpted here:

env_name: pick_and_place_maple_table_default
tags: []
embodiment:
  id: droid_abs_joint_pos
  registry_name: droid_abs_joint_pos
  params: {}
objects:
- id: rubiks_cube_hot3d_robolab
  registry_name: dex_cube
  params: {}
# ...

@alexmillane
alexmillane force-pushed the alexmillane/feature/save-run-environment-definition branch 2 times, most recently from 9e6e562 to 0854cec Compare November 27, 2026 15:26
@alexmillane
alexmillane added this pull request to stack #1777 November 27, 2026 15:28

@alexmillane alexmillane left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self review

@alexmillane
alexmillane marked this pull request as ready for review November 27, 2026 16:39
@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · The PR appears safe to merge, with a non-blocking concern about source edits changing the saved graph.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches the output folders for completed graph-based evaluation Runs.

The PR appears safe to merge, with a non-blocking concern about source edits changing the saved graph.

Findings

  1. P2 Saved graph can differ ▶

Summary

Adds arena_run_environment_definition.yaml for completed graph-YAML Runs.

  • Completed graph Runs save the environment definition they used.

Reviews (1) · Last reviewed commit: "Move write_run_environment_definition in..." · Reviewed by Greptile

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

This PR writes each completed graph-YAML Run's spec to arena_run_environment_definition.yaml, with external_yaml includes merged and per-Run overrides applied. To do that, it splits spec loading out of arena_env_from_graph_spec and build_arena_builder_from_legacy_graph. The change is small and well contained. The main concern is the headline case in the usage example: per-Run overrides don't seem to get through the real argument parser in an experiment run, and the new test uses its own parser, which hides this. The author's earlier notes on this PR (explain the isinstance check, cut the docstring to one line) are addressed at this head.

Findings

🟡 Warning: isaaclab_arena/evaluation/legacy_graph_environment_cli.py:88: The real parser only adds a YAML's cli_override_specs flags when --env_spec is in sys.argv, and it isn't under experiment_runner.py. A Run with object: dex_cube therefore exits in parse_args before its environment is built. This bug was already there before the PR, but the new test's stand-in parser hides it.
🔵 Improvement: isaaclab_arena/evaluation/run_environment_definition.py:27: Use the existing ArenaEnvGraphSpec.write_yaml instead of writing the YAML dump again.
🔵 Improvement: isaaclab_arena/evaluation/legacy_graph_environment_cli.py:79: Rename load_graph_spec_from_graph to load_graph_spec_from_legacy_graph, and make parse_graph_environment_cli_args private.
🔵 Improvement: isaaclab_arena/evaluation/run_execution.py:106: Question: should the definition be written just before build_and_run? Then it would be read right before the build instead of after a long rollout, and failed Runs would keep it too.

Test Coverage and CI Cost

The new test in test_run_execution.py runs in Phase 1 and is cheap because build_and_run is patched out. Its get_parser stand-in, though, registers the override flags that the real parser skips. So the test passes even though the same Run would fail under experiment_runner.py. The new assertions in test_experiment_runner_graph_spec_camera_run_and_camera_less_run reuse an existing subprocess test and add no CI cost. Limitation: I confirmed the parser behavior by reading the code and with a small standard-library argparse reproduction, not by running the experiment runner.

Verdict

Minor fixes needed

@cvolkcvolk cvolkcvolk 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

Base automatically changed from alexmillane/feature/environment-tags to main November 30, 2026 19:35
Save the Run's graph YAML, with its external_yaml includes merged, as
arena_run_environment_definition.yaml in the Run output directory. The
result keeps the scene and task that ran after the source YAML is renamed
or edited.

Signed-off-by: Alex Millane <[email protected]>
Write the graph spec the environment is built from, with its CLI
overrides applied, instead of the YAML as authored. Write it inside the
Run's failure handling, since loading the spec can now fail.

Signed-off-by: Alex Millane <[email protected]>
Write the definition after a Run completes, next to its timings, instead
of before the Run starts. Drop "legacy" from load_graph_spec_from_graph.

Signed-off-by: Alex Millane <[email protected]>
Keep run_execution.py focused on executing Runs, as with write_run_timings.
Shorten the docstring to one line and explain why Python environments
write no definition.

Signed-off-by: Alex Millane <[email protected]>
Rename run_environment_definition.py to run_outputs.py and move
write_run_outputs into it, so run_execution.py only executes Runs.

Signed-off-by: Alex Millane <[email protected]>
The environments CLI parser adds a graph YAML's override flags only when
--env_spec is in sys.argv, which the Experiment Runner's command line
doesn't have, so a Run such as object: dex_cube exited in parse_args.
Build the parser from the Run's YAML instead, and test with the real
parser. Write the definition with ArenaEnvGraphSpec.write_yaml.

Signed-off-by: Alex Millane <[email protected]>
@alexmillane
alexmillane force-pushed the alexmillane/feature/save-run-environment-definition branch from 5e3e044 to 05b5739 Compare November 30, 2026 19:35
@alexmillane
alexmillane enabled stacked auto-merge (squash) November 30, 2026 20:16
@alexmillane
alexmillane disabled stacked auto-merge November 30, 2026 20:22
@alexmillane
alexmillane merged commit 4757d51 into main Dec 1, 2026
10 checks passed
@alexmillane
alexmillane deleted the alexmillane/feature/save-run-environment-definition branch December 1, 2026 11:29
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