Skip to content

Simplify Arena Experiment result collection - #1082

Open
cvolkcvolk wants to merge 1 commit into
mainfrom
cvolk/refactor/simplify-experiment-result
Open

Simplify Arena Experiment result collection#1082
cvolkcvolk wants to merge 1 commit into
mainfrom
cvolk/refactor/simplify-experiment-result

Conversation

@cvolkcvolk

Copy link
Copy Markdown
Collaborator

Summary

Simplify Arena Experiment result collection

Detailed description

  • Follow up on Write one combined JSON result for each Arena Experiment #1070 by keeping ArenaExperimentResult focused on combining declared Run outputs while preserving the completed-Run directory check.
  • Rename the configuration conversion to describe its exact output: environment fields and policy_variant.
  • Document when that conversion can be removed. The generated JSON format does not change.

Verified with the full pre-commit suite and 54 focused result, local runner, and OSMO tests.

Keep result collection focused on combining declared Run outputs. Use an explicit name for the environment and policy variant conversion, and document when that conversion can be removed.

Signed-off-by: Clemens Volk <cvolk@nvidia.com>
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR simplifies Arena Experiment result collection while retaining completed-Run directory validation and renames the configuration conversion helper to describe its output precisely.

  • Collects declared environment metadata directly and discovers rebuilds uniformly.
  • Renames the environment and policy-variant conversion across local and OSMO execution paths.
  • Updates focused tests and documents when the compatibility conversion can be removed.

Confidence Score: 4/5

The PR appears safe to merge, with a non-blocking opportunity to retain validation of the serialized Run-status contract.

Current production callers obtain statuses from the completed/failed enum, while the simplified collector now permits schema-invalid statuses from direct callers and may cause those Runs to disappear from report classification.

Files Needing Attention: isaaclab_arena/evaluation/arena_experiment_result.py

Important Files Changed

Filename Overview
isaaclab_arena/evaluation/arena_experiment_result.py Simplifies Run result collection and renames metadata conversion, but removes runtime validation of the declared status domain.
isaaclab_arena/evaluation/experiment_runner.py Updates the local result-writing path to use the renamed conversion helper without changing generated metadata.
osmo/tasks/experiment_runner_task.py Updates OSMO metadata generation to use the renamed helper while preserving the JSON shape.
isaaclab_arena/tests/test_arena_experiment_result.py Renames conversion tests consistently; existing coverage confirms missing failed-Run directories still produce empty rebuild lists.

Reviews (1): Last reviewed commit: "Simplify Arena Experiment result collect..." | Re-trigger Greptile

Comment on lines +132 to +135
status = run_metadata["status"]
assert (
status != "completed" or run_output_directory.is_dir()
), f"completed Run {run_name!r} is missing its output directory: {run_output_directory}"

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.

P2 Validate the Run status domain

ArenaExperimentRunData restricts status to completed or failed, but _collect_run now serializes any supplied value. An invalid status therefore produces schema-invalid output and prevents downstream reports from classifying the Run as either completed or failed.

Suggested change
status = run_metadata["status"]
assert (
status != "completed" or run_output_directory.is_dir()
), f"completed Run {run_name!r} is missing its output directory: {run_output_directory}"
status = run_metadata["status"]
assert status in ("completed", "failed"), f"status for Run {run_name!r} must be 'completed' or 'failed'"
assert (
status != "completed" or run_output_directory.is_dir()
), f"completed Run {run_name!r} is missing its output directory: {run_output_directory}"

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

Clean, well-scoped follow-up to #1070. It trims _collect_run down to two asserts plus an unconditional _collect_rebuilds, passes the environment field straight through instead of rebuilding it, and renames build_arena_run_result_metadatarun_environment_and_policy_variant_from_config with TODOs marking when the conversion can be retired. I verified the simplifications are behavior-preserving and the tests cover them.

Findings

No blocking issues. A few things I checked that hold up:

  • Dropping the if run_output_directory.is_dir() else [] guard is safe — find_episode_results_files globs via Path.rglob, which yields nothing (no error) on a missing path, so a failed Run without a directory still collects []. Exercised by test_failed_runs_may_have_empty_or_missing_output_directories.
  • Removing assert status in ("completed", "failed") is fine — every producer feeds RunStatus.value, and RunStatus only has those two members, so the check was redundant. Passing run_metadata["environment"] through instead of reconstructing {name, definition} is likewise contract-enforced by the ArenaExperimentRunData TypedDict and the single producer.
  • The hasattr(env_spec_path) / getattr(policy_variant) branches in the renamed function are pre-existing and now documented with removal TODOs — out of scope here.

Test Coverage

Good. The renamed conversion tests still assert the exact output for both the graph-YAML and registered-config paths, and the collection tests cover completed-requires-directory, failed-with-missing/empty-directory, unsafe run names, and malformed JSONL. No new code paths go untested.

Verdict

Ship it

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.

1 participant