Repository navigation
[release/0.4.0] Validate replay before the first rebuild (#1792) - #1836
Conversation
Validate variation values in every replay file against the Run's configured choices and ranges before the first rebuild. Move categorical choices into samplers and configure them through `sampler_cfg.choices`, so replay sample validations can happen in the sampler instead of in hdr/asset variation. ## Why this change? With a valid replay file for rebuild 0 and an out-of-choice asset in rebuild 1, the Run previously completed the first rollout and wrote its episode results and dataset before failing. This wasted evaluation time and left an output directory that could not be reused without clearing it. Fixes https://nvbugspro.nvidia.com/bug/7140990. ## What changes? - Validate variation values in all replay files before creating a simulation environment. Preflight and environment construction share `ArenaEnvBuilder.get_variations_with_overrides()`, using the builder's configured Hydra overrides. Errors identify the offending file and rebuild. Placement poses are still checked separately during each rebuild. - Add side-effect-free `SamplerBase.validate_samples()`, shared by preflight checks and replay sampling. Enforce categorical membership, continuous sample shapes, inclusive uniform bounds in every dimension, and boolean values for Bernoulli samples. Keep variation-key and record-consistency checks. - Share choice ownership and membership validation through `CategoricalSampler`, the base of `ChoiceSampler` and `SequentialSampler`. Preserve choice order and repetitions, and report rejected values alongside the allowed choices. `VariationBase` delegates recorded-value validation directly to its sampler. - Keep asset-name and rigid-object-type checks in the asset-selection variation. Keep HDR registration checks and expansion of an empty pool to all registered HDRs in the HDR variation. - Replace variation-level `registry_names` and `hdr_names` with `sampler_cfg.choices`. Update maintained YAML examples, CLI overrides, Python callers, and the migration guide. Preserve the recording format and sampler bindings when applying config overrides. **Breaking changes:** existing YAML and CLI overrides must use the new choice paths shown below. Python callers pass `AssetSelectionSamplerCfg(choices=[...])` or `ChoiceSamplerCfg(choices=[...])` as the variation's `sampler_cfg`. Direct categorical sampler callers supply choices at construction, then call `sample()` without a choices argument. Empty HDR choices still select from all registered HDRs; enabled asset selection requires a non-empty pool. Uniform replay previously accepted values outside `low`/`high`; those values are now rejected. Match the experiment bounds to the intended replay data. Custom samplers used for variation replay must implement `validate_samples()` without drawing samples, invoking replay callbacks, or notifying listeners. ## Usage example Before: ```yaml variations: pick_up_object.asset_selection.enabled: true pick_up_object.asset_selection.registry_names: [cracker_box, sugar_box] light.hdr_image.enabled: true light.hdr_image.hdr_names: [home_office_robolab, billiard_hall_robolab] ``` After: ```yaml variations: pick_up_object.asset_selection.enabled: true pick_up_object.asset_selection.sampler_cfg.choices: [cracker_box, sugar_box] light.hdr_image.enabled: true light.hdr_image.sampler_cfg.choices: [home_office_robolab, billiard_hall_robolab] ``` ## Validation Ran the Experiment Runner locally with two replay files, the zero-action policy, and trajectory recording enabled. A second file selecting `banana_ycb_robolab` outside the configured choices exited with code 1 before any rollout and left the output directory empty. Corrected that file to select `orange_01_fruits_veggies_robolab` and reran into the same output directory. Both rebuilds completed with the expected asset selections, one episode record, and one HDF5 trajectory each. Also ran the Experiment Runner with a valid first file and a second file recording mass `3.0` against bounds `[0.1, 2.0]`. It rejected rebuild 1 before any rollout and left the output directory empty. --------- (cherry picked from commit ecb2f74) Signed-off-by: Qian Lin <[email protected]>
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThis PR checks every replay file against the Run's configured variations before starting a multi-file replay.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Start Run] --> B{Multiple distinct replay files?}
B -->|Yes| C[Create builder and apply overrides]
C --> D[Check every replay file]
D -->|Invalid| E[Stop before first rebuild]
D -->|Valid| F[Start rebuild loop]
B -->|No| F
F --> G[Load and check this rebuild's replay]
G --> H[Bind recorded samples]
H --> I[Build environment and run episodes]
Reviews (1) · Last reviewed commit: "Validate replay files before the first r..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis backports #1792 to When I reviewed, CI had not run the tests on this head: the native uv test job was skipped and the image build was still in progress. So I haven't seen a test result for the release-only test change. VerdictShip it |
Backport #1792 (
ecb2f74a89d3ac74a2990abd09baca48a7fcb9d7) torelease/0.4.0. Validate all replay files against the Run's configured sampler choices and ranges before the first rebuild, so a bad later file cannot leave completed rollouts and datasets behind.Fixes https://nvbugspro.nvidia.com/bug/7140990.
What changes?
Breaking changes: replace variation-level
registry_namesandhdr_nameswithsampler_cfg.choicesin YAML, CLI overrides, and Python configs. Direct categorical sampler callers provide choices at construction. Uniform replay now rejects values outside the configured bounds; custom replay samplers must implementvalidate_samples().Release adaptations
test_concept_experiment_configs.pyandgr1_put_sauce_bottles_in_fridge_gr00t_experiment.yaml, which were introduced by Run concept page examples as Experiments #1463 and Evaluate the GR00T workflow pages with Experiments #1702 and do not exist on release.Nonefor the release's metrics aggregation. Main removed that aggregation in Replace the HDF5 metrics with per-episode values in the episode results #1456; production replay logic is unchanged from Validate replay files before the first rebuild #1792.Validation scope
The original end-to-end checks are documented in #1792: an invalid second replay file was rejected before any rollout, and correcting it allowed a retry into the same output directory. Those full Experiment Runner checks were not repeated for this backport.