Repository navigation
Run experiment_runner tests from YAML Experiments - #1704
Conversation
test_legacy_eval_config.py also held two tests for code that YAML graph-spec Runs use: legacy_environment_args_to_cli_args and build_arena_builder_from_legacy_graph. The builder test built its Run through the JSON adapter. Move both tests to test_legacy_graph_environment_cli.py and build the Run from typed configs, so they keep running after the JSON adapter is deleted. The typed Run equals the one the adapter built. Signed-off-by: Clemens Volk <[email protected]>
Four tests wrote legacy JSON jobs to check behavior that does not depend on the JSON format: the graph-spec end-to-end Run, the all-environments smoke test, the GR00T remote end-to-end test, and the in-process check that Run variations reach env_cfg.events. Each one is the only test of its behavior. Write their Experiments as YAML Runs, or as typed ArenaRunCfg objects for the in-process test, so they keep running when the JSON loader is removed. Each YAML Run equals the Run the JSON adapter built. The only exception is the graph-spec Run, where the YAML loader also sets LegacyGraphEnvironmentCfg.enable_cameras. The graph-spec test also gets the camera-less Run from the JSON enable_cameras test, so a Run without cameras in an app with camera support stays covered. The subprocess tests now write to tmp_path and check that every Run completed instead of only checking the exit code. Signed-off-by: Clemens Volk <[email protected]>
[Low impact] This test-only change appears safe to merge. SummaryMoves format-independent Experiment Runner tests from legacy JSON to YAML Experiments or typed Run configs, while preserving graph-spec CLI coverage.
No actionable issues found. Simulation and live GR00T tests were not run during this review. Reviews (1) · Last reviewed commit: "Run experiment_runner tests from YAML Ex..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR moves the four Experiment Runner tests that don't depend on the JSON format to YAML Experiments or typed Findings🔵 Improvement: isaaclab_arena/tests/test_all_environments.py:75: Without 🔵 Improvement: isaaclab_arena/tests/test_experiment_runner.py:660: The block that reads Run statuses now appears in four tests. A 🔵 Improvement: isaaclab_arena/tests/test_legacy_graph_environment_cli.py:23: The CLI-args test only covers the registered-name branch, and no production code reaches that branch anymore. Using a graph YAML path would cover the 🔵 Improvement: isaaclab_arena/tests/test_legacy_graph_environment_cli.py:40: The builder test still builds its input the way the JSON adapter did ( 🔵 Improvement: isaaclab_arena/evaluation/legacy_environment_cli_args.py:10 (not in this diff): The TODO says to delete this module along with the JSON frontend. But Test Coverage and CI CostCI tests had not run on this head yet when I reviewed it, because the image build was still in progress. I didn't run the simulation tests myself. The GR00T Experiment Runner test only runs in the VerdictMinor fixes needed |
Four tests read arena_experiment_result.json and collected each Run's status the same way. Add read_run_statuses next to run_experiment_runner, which loads the file with ArenaExperimentResult.from_experiment_output. Also drop the config_option parameter of run_experiment_runner. --experiment_config and --eval_jobs_config populate the same option, and the file suffix picks JSON or YAML, so every call passes --experiment_config. Signed-off-by: Clemens Volk <[email protected]>
Without --continue_on_error, the first failing Run made the Experiment Runner exit non-zero before it wrote arena_experiment_result.json, so the Run status check never ran and one broken environment hid the ones after it. Pass --continue_on_error. The runner then records failing Runs, still exits 0, and the status check names every environment that failed. Signed-off-by: Clemens Volk <[email protected]>
The two moved tests still used the inputs of the JSON adapter. The CLI-args test passed a registered environment name, which only the JSON adapter sent; build_arena_builder_from_legacy_graph always passes a graph YAML path. The builder test put num_envs in per_run_overrides, where the YAML loader puts only the Run's environment values. Use a graph YAML path and check the whole token list, and build the LegacyGraphEnvironmentCfg the YAML loader builds for a Run with enable_cameras. Pass env_cfg_override when constructing the builder config, and drop the asserts that only read back the test's own inputs from an object already checked by identity. Signed-off-by: Clemens Volk <[email protected]>
Five subprocess tests still wrote JSON jobs, and each behavior they checked has a YAML test: - Two Runs in one process: test_experiment_runner_runs_with_different_env_counts. - Different environments and robots in one process: test_experiment_runner_all_environments. - Different embodiments of one robot: test_experiment_runner_runs_with_different_env_counts. - Variations: test_experiment_runner_replays_recorded_variation_samples. - Camera and camera-less Runs in one process: the graph-spec test, which runs the camera-less Run of test_experiment_runner_enable_cameras. Delete them and write_jobs_config_to_file, so no Experiment Runner test writes a JSON Experiment anymore. Signed-off-by: Clemens Volk <[email protected]>
Without --continue_on_error, a failed Run re-raises and SimulationAppContext exits the process with 1, so run_subprocess raises before a status check runs. The checks in the graph-spec and GR00T tests could only pass. #596 removed a check like this for the same reason. Drop both, and keep the check in the all-environments smoke test, where --continue_on_error makes it the failure report. Reword the run_experiment_runner docstring, which said --continue_on_error is never passed. Signed-off-by: Clemens Volk <[email protected]>
The test also runs the camera-less Run from the deleted test_experiment_runner_enable_cameras. Name both Runs, so the mixed camera and camera-less coverage is visible from the test name. Signed-off-by: Clemens Volk <[email protected]>
The builder test wrapped its inputs in an ArenaRunCfg whose name and rollout_limit nothing read, and computed its expected tokens and Hydra overrides with the same helpers the code under test calls, so a wrong token list could not fail it. Pass local configs and compare against literal values. The arguments test now uses enable_cameras, the key a YAML graph Run carries, instead of num_envs, which such a Run sets under environment_builder. Also drop a comment about language_instruction, which the test never sets. Signed-off-by: Clemens Volk <[email protected]>
The Run set environment_builder to the default values and a rollout limit that build_arena_builder_from_run_cfg never reads, both left over from the JSON job's required fields. Drop them and the comment that repeated the variations line. Signed-off-by: Clemens Volk <[email protected]>
Typed YAML Experiments replaced the JSON jobs format. No JSON Experiment is checked in since #1531, and #1704 ported or deleted the tests that still wrote JSON. Delete legacy_eval_config.py, legacy_experiment_runner.py and the .json branch of load_arena_experiment_from_config_file. A .json path now fails before startup with a message that points to YAML Experiments. Remove the --eval_jobs_config alias and --chunk_size. Chunked dispatch only ever worked for JSON jobs. Long sweeps on OSMO already run each Run in its own process. Delete the tests that covered only the JSON adapter, the JSON camera check, chunking and the JSON override rejection. Signed-off-by: Clemens Volk <[email protected]>
…unner.py (#1705) Make `experiment_runner.py` accept only YAML Experiments. JSON Experiment files, the `--eval_jobs_config` alias and `--chunk_size` are removed. ## Why this change? YAML Experiments replaced the JSON jobs format. Since #1531 no JSON Experiment is checked in, and after #1701 and #1704 no doc or test uses one. The JSON path still kept two modules and a second code path through the loader and the runner. ## What changes? For users: - A `.json` Experiment now fails before Isaac Sim starts, with a message that points to YAML. Rewrite each job as a Run in a YAML Experiment, as in the example below. - `--eval_jobs_config` and `--chunk_size` are gone. Passing either fails as an unrecognized argument. In the code: - Delete `legacy_eval_config.py`, `legacy_experiment_runner.py` and the `.json` branch of `load_arena_experiment_from_config_file`. - Delete `EnvironmentRegistry.get_environment_cfg_type`, which only the JSON adapter used. - Drop the YAML check in OSMO submission. The loader now does it. - Move the graph-spec CLI token helper into `legacy_graph_environment_cli.py`, its only user, and delete `legacy_environment_cli_args.py`. - Delete the tests of the removed code. ### Why `--chunk_size` can go `--chunk_size` (#751) ran each chunk of JSON jobs in a fresh process, to free host memory that leaked on every environment build. - It only ever worked for JSON. YAML Experiments never had it. - It split by job, so all rebuilds of a Run still shared one process. - The leak is mostly gone on the current stack. I ran one Run with many rebuilds in one runner process and measured memory between builds: | Environment | Rebuilds | Growth per rebuild | |---|---|---| | `cube_goal_pose` | 25 | about 1 MiB | | `pick_and_place_maple_table` with cameras | 13 | about 40 MiB | On OSMO each Run runs in its own process anyway. ## Usage example Before: ```json { "jobs": [ { "name": "lift_object_model_1000", "policy_type": "rsl_rl", "num_episodes": 1024, "arena_env_args": {"environment": "lift_object", "num_envs": 64}, "policy_config_dict": {"checkpoint_path": "model_1000.pt"} } ] } ``` After: ```yaml runs: lift_object_model_1000: environment: type: lift_object environment_builder: num_envs: 64 policy: type: rsl_rl checkpoint_path: model_1000.pt rollout_limit: num_episodes: 1024 ``` ## Validation Locally in the Arena container: - A `.json` config, `--eval_jobs_config` and `--chunk_size` each fail before Isaac Sim starts. - The loader, run execution, graph CLI, Hydra, environment config, OSMO workflow, benchmark and RoboLab config tests pass. - All subprocess tests in `test_experiment_runner.py` pass, including the graph-spec Run end to end, and so does the all-environments smoke test. --------- Signed-off-by: Clemens Volk <[email protected]>
Port the Experiment Runner tests that still use legacy JSON to YAML Experiments or typed Run configs, delete the ones YAML tests already cover, and move the graph-spec CLI tests out of
test_legacy_eval_config.py. After this PR, only the JSON loader's own tests still use JSON, and #1705 removes them together with the loader.Why this change?
#1705 removes JSON Experiment loading. Nine tests still use it: they write a JSON jobs file or pass a jobs dict to the JSON adapter.
Four of them check something no YAML test covers, so they are ported:
test_experiment_runner_graph_spec_with_variation: runs a graph-spec environment end to end through the Experiment Runner.test_experiment_runner_all_environments: runs every registered environment for a few steps.test_experiment_runner_with_gr00t_remote_closedloop_policy: runs the Experiment Runner against a remote GR00T policy server.test_eval_config_variation_lands_in_events_cfg: checks that a Run's variations become event terms inenv_cfg.events.The other five are covered by YAML tests and are deleted:
test_experiment_runner_two_jobs_zero_action:test_experiment_runner_runs_with_different_env_counts.test_experiment_runner_multiple_environments:test_experiment_runner_all_environments.test_experiment_runner_different_embodiments:test_experiment_runner_runs_with_different_env_countsandtest_experiment_runner_all_environments.test_experiment_runner_with_variations:test_experiment_runner_replays_recorded_variation_samples.test_experiment_runner_enable_cameras: the ported graph-spec test, which now also runs its camera-less Run.What changes?
tmp_pathand pass--experiment_output_directory, so they no longer write tooutputs/in the working directory.run_experiment_runneralways passes--experiment_config.--continue_on_errorand checks every Run's status with a newread_run_statuseshelper, so it names every broken environment, not only the first. The ported graph-spec and GR00T tests rely on the exit code: without--continue_on_error, a failed Run makes the runner exit non-zero.test_experiment_runner_graph_spec_camera_run_and_camera_less_run.test_eval_config_variation_lands_in_events_cfgbecomestest_run_variation_lands_in_events_cfgand builds anArenaRunCfgdirectly.legacy_environment_args_to_cli_argsandbuild_arena_builder_from_legacy_graphmove totest_legacy_graph_environment_cli.py. YAML graph-spec Runs use both functions. The tests now use the inputs such a Run produces and compare against literal values.Validation
ArenaRunCfgthe JSON adapter built from the old test data. I checked this with a one-off script for all 19 environments, the GR00T Run, the camera-less Run and the typed Runs. The graph-spec Run differs only inLegacyGraphEnvironmentCfg.enable_cameras: the YAML loader sets it from the Run, the JSON adapter left itFalse. The environment's CLI arguments are the same.test_experiment_runner.pypasses, including the graph-spec test with both Runs andtest_run_variation_lands_in_events_cfg.test_experiment_runner_all_environmentscompletes all 19 Runs.test_gr00t_closedloop_e2ejob runs it. I did not run it.