Repository navigation
Validate replay files before the first rebuild - #1792
Conversation
[Medium impact] The PR appears safe to merge. SummaryValidates every replay file against the Run's enabled variations before the first environment build.
No actionable issues found. This review used source inspection; tests were not run. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Run configuration] --> B[Create preflight builder]
B --> C[Apply variation overrides]
C --> D[Load and validate every replay file]
D -->|Invalid| E[Stop before rollout outputs]
D -->|Valid| F[Build each environment]
F --> G[Bind replay samples and run episodes]
Reviews (1) · Last reviewed commit: "Move variation choice fields into sample..." · Reviewed by Greptile |
🤖 Isaac Lab-Arena Review BotSummaryThis PR checks every replay file against the Run's variation settings before the first rebuild. A bad file for a later rebuild now fails before any rollout runs or output is written. To make that one generic check, categorical choices move into the sampler configs ( Findings🟡 Warning: docs/pages/references/migration_guide_v0_4.rst:527: 🔵 Improvement: isaaclab_arena/variations/choice_sampler.py:58: 🔵 Improvement: isaaclab_arena/evaluation/run_execution.py:318: the up-front check repeats the builder's steps of applying overrides and then validating. If 🔵 Improvement: docs/pages/concepts/experiment_record_replay.rst:40: placement poses are still checked separately for each rebuild. The sentence saying all replay files are validated before the first rebuild promises more than the code does. VerdictMinor fixes needed |
Report the JSONL filename and all affected line numbers when a recorded variation is missing from some episode records. Fixes https://nvbugspro.nvidia.com/bug/7140973 ## Why this change? A missing `variations` field currently reports only that a build-time variation is absent from some records. Finding the bad rows in a large or merged recording requires inspecting every file. This change targets `main` and is independent of the replay preflight and sampler changes in #1792. ## What changes? Check partial presence for both build-time and run-time variations in the loader, and remove the redundant presence check from replay validation. Use "Build-time variation" for known build-time keys and "Recorded variation" for other keys, whose phase the loader cannot determine. When validation fails, scan the source lines to report every missing row for the offending variation, accounting for blank lines. Use strict row matching so a changed row count fails instead of silently truncating the diagnostic. Keep the JSONL parser and its returned records unchanged. Variations omitted from every record can still be sampled live, except that geometry-changing build-time variations require recorded values when replaying recorded placements. Update the placement-test fixture to include its variation in both records, and remove duplicate tests. For example: ```text Build-time variation 'light.color' is missing from some episode records: outputs/rebuild1.jsonl, lines 2, 37 ``` --------- Signed-off-by: Qian Lin <[email protected]>
9ed3ab1 to
609de6b
Compare
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
Signed-off-by: Qian Lin <[email protected]>
bab607a to
32d96ef
Compare
Backport #1792 (`ecb2f74a89d3ac74a2990abd09baca48a7fcb9d7`) to `release/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? - Share side-effect-free sample validation between preflight checks and replay sampling. Errors identify the variation, replay file, and rebuild. - Move categorical choices into samplers, retaining asset and HDR registry validation in their variations. Update the release examples and migration guide. **Breaking changes:** replace variation-level `registry_names` and `hdr_names` with `sampler_cfg.choices` in 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 implement `validate_samples()`. ## Release adaptations - Keep the release's variations-guide structure and update its existing command examples. Main's guide was reorganized in #1463 and #1737, neither of which is on release. - Omit edits to `test_concept_experiment_configs.py` and `gr1_put_sauce_bottles_in_fridge_gr00t_experiment.yaml`, which were introduced by #1463 and #1702 and do not exist on release. - Set the new rollout test mock's return value to `None` for the release's metrics aggregation. Main removed that aggregation in #1456; production replay logic is unchanged from #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. Signed-off-by: Qian Lin <[email protected]>
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?
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.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.CategoricalSampler, the base ofChoiceSamplerandSequentialSampler. Preserve choice order and repetitions, and report rejected values alongside the allowed choices.VariationBasedelegates recorded-value validation directly to its sampler.registry_namesandhdr_nameswithsampler_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=[...])orChoiceSamplerCfg(choices=[...])as the variation'ssampler_cfg. Direct categorical sampler callers supply choices at construction, then callsample()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 implementvalidate_samples()without drawing samples, invoking replay callbacks, or notifying listeners.Usage example
Before:
After:
Validation
Ran the Experiment Runner locally with two replay files, the zero-action policy, and trajectory recording enabled. A second file selecting
banana_ycb_robolaboutside 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_robolaband 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.0against bounds[0.1, 2.0]. It rejected rebuild 1 before any rollout and left the output directory empty.