Repository navigation
[Video] Add video recording to the zero and random agents - #7955
Conversation
Wire the checkpoint-free zero and random agents through the video recording infrastructure shared with the train and play entrypoints, adding --video, --video_length, and --video_interval CLI flags.
There was a problem hiding this comment.
Isaac Lab Review Bot
The change consistently adds opt-in video recording to the zero and random checkpoint-free agents using the existing shared recording infrastructure, with a matching changelog fragment. The reviewed step clamp intentionally limits video runs to the first requested clip while allowing a smaller --max_steps budget, matching the stated PR behavior rather than demonstrating a defect.
- Design and architecture: The entrypoint reuses
pre_launch_video_config,apply_video_recording, andenable_cameras_for_video, and follows the established normalized log-directory layout instead of creating a separate recording path. Termination based on the first configured recorder is consistent with the stated single-clip playback scope, though it would need revisiting if multi-recorder or multi-clip playback becomes a requirement. - API: The new
--video,--video_length, and--video_intervalflags are opt-in, use consistent snake_case naming, and preserve non-video behavior. The user-visible addition is covered by anisaaclab_rlchangelog fragment. Under video mode,--max_stepsacts as an upper bound capped by completion of the requested clip, as explicitly described by the PR. - Implementation: The configuration and construction sequence is coherent: video configuration is prepared before launch, recording is applied before
gym.make, and camera enablement occurs during argument processing. The loop retains visualizer-close termination and unchanged unbounded behavior when video is disabled, while video runs stop after the configured recorder length and offset or an earlier explicit step limit.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
|
| if args_cli.video: | ||
| recorders = env_cfg.video_recorders or [] | ||
| if recorders: | ||
| video_steps = recorders[0].video_length + recorders[0].step_offset |
There was a problem hiding this comment.
If an environment config declares multiple video recorders with different video_length or step_offset values, this run limit considers only recorders[0]. The environment can therefore stop before later recorders complete their first clip, producing truncated or missing video output.
There was a problem hiding this comment.
Fixed in 4e6fdf0. The same first-recorder-only bug was in the shared play helper, so video_playback_steps in common.py now waits for the recorder whose first clip ends last, including its step_offset. All play backends and the zero/random agents use it.
| "--video_length", | ||
| type=int, | ||
| default=None, | ||
| help="Length of each recorded video clip in env steps. Overrides the value in VideoRecorderCfg.", |
There was a problem hiding this comment.
Invalid length skips recording
--video_length accepts zero and negative integers. With the default zero step offset, a non-positive value becomes the run limit and exits before the environment takes any steps, so the command can succeed without producing the requested clip. Restrict this option to positive integers or report a clear CLI error.
There was a problem hiding this comment.
Fixed in 4e6fdf0, at the config level rather than only the CLI flag. VideoRecorderCfg.validate_config now rejects a non-positive video_length/frame_stride and a negative video_interval/step_offset, which covers env configs as well as CLI overrides. The zero/random agents apply recorder settings before pre-launch validation, so --video_length 0 fails before the simulator starts.
|
run-ci |
Reject non-positive video_length/frame_stride and negative video_interval/step_offset in VideoRecorderCfg.validate_config so every env and entrypoint fails fast instead of silently skipping recording. Bound --video playback by the recorder whose first clip ends last, including its step_offset, in the helper shared by the play backends and the zero and random agents. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Merge overlapping video recorder, entrypoint, and end-to-end tests into parametrized tests that check observable output, cutting 58 test functions to 35 and the end-to-end suite from six simulation runs to three without dropping covered behavior. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
run-ci |
|
Backported to |
## Summary - Add `--video`, `--video_length`, and `--video_interval` to the checkpoint-free zero and random agents (`isaaclab_rl.entrypoints.simple_agents`) and `video` to `SimpleAgentRequest`, reusing the recording helpers shared with the train/play entrypoints. Clips go to `logs/<zero|random>_agent/<task>/videos/play/`. - Fix `--video` playback stopping before every recorder finished its first clip. The shared `video_playback_steps` helper (used by every play backend and the zero/random agents) now waits for the recorder whose first clip ends last, and no longer ignores `step_offset` when `--video_length` is passed. - Add `VideoRecorderCfg.validate_config`, which rejects a non-positive `video_length`/`frame_stride` and a negative `video_interval`/`step_offset` during environment config validation. Before, these values silently wrote one-frame clips, divided by zero, or recorded nothing. The zero/random agents apply recorder settings before their pre-launch validation, so a bad `--video_length` fails before the simulator starts. ## Test plan - [x] Consolidated the video recording tests (58 → 35 test functions) into parametrized tests that check observable output: which env steps land in each written clip, recorder config validation, the step budget across recorders, and zero/random agent runs. The end-to-end suite now runs three simulations instead of six (25.4 s → 18.0 s locally) and still covers the same behavior. - [x] The new regression cases fail on the pre-fix code and pass with the fix. - [x] `test_video_recorder.py`, `test_apply_video_recording.py`, `test_entrypoints.py`, `test_entrypoints_common.py`: 136 passed. End-to-end `test_video_recording.py` (`--extra video`): 3 passed. - [x] pre-commit hooks pass on the changed files ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit c1fb8f3)
…ng docs (#7957) Backports the three changes from the September 20–23 `develop` audit that are missing from `release/3.0.0`, alongside the existing cloning-guide backport: - #7722 (`4cf439dfeb`): reject a second `SimulationContext` construction instead of silently discarding its configuration. Includes the original fixture cleanup and regression coverage. - #7893 (`22fcd71bc4`): validate DelayBuffer lag values before mutating its live configuration. - #7947 (`6e9ef17f59`): make `v3.0.0-EA` the default documentation version in deployment and local multi-version builds. - #7129 (`354168560f`): clarify that `replicate_physics=False` skips the active physics context while other declared replication contexts still run. **Compatibility:** repeated `SimulationContext(...)` calls now raise. Retrieve the live context with `SimulationContext.instance()`, or call `clear_instance()` before constructing a replacement. The original major changelog fragment includes this migration. The runtime and test files match current `develop`. The docs-default backport adapts the release branch's existing redirect template, validates the target page, and preserves explicit overrides. The cloning-guide backport preserves the current release APIs; its obsolete sections were already removed. ## Release audit Checked all **35 PRs** merged into `develop` from **2026-09-20 16:43:18 UTC** through `cff81e8473` (September 23), against release head `5d3e0b695e`. **32 are already covered; the remaining three are included here.** Git history, patch equivalence, GitHub's merged PR list, and remaining file differences were checked. Branch-specific version/changelog compilation and existing release-only changes are preserved. <details> <summary>Already covered PRs</summary> 26 have an equivalent patch in release: #7919, #7922, #7923, #7924, #7925, #6758, #7928, #7902, #7927, #7891, #7931, #7691, #7861, #7929, #7916, #7939, #4609, #7942, #7940, #7948, #7937, #7955, #7960, #7961, #7970, #7958. Six were squash-merged or adapted: #7530 and #7899 in #7926; #7637 in #7933; #7860 in #7936; #7954 and #7950 in #7964. Their implementation differences were checked against the current release tree. </details> ## Validation - **276 tests passed**: SimulationContext (51, including CPU/CUDA), headless context construction (15), nine schema/fragment suites (165), four manager suites (38), and DelayBuffer (7). - Both backported regressions reproduce with the original release implementations. - Docs redirect recipe: local/deployment EA defaults, explicit override, and missing-target rejection passed with a stubbed Sphinx builder. - All 22 changed files match the intended backport scope; `uv run isaaclab -f` and `git diff --check` passed. - Fresh Sphinx validation (`-b dummy -W --keep-going`): passed without warnings, excluding static assets as the HTML builder does. Full HTML documentation CI is running. Local runtime validation used PyTorch 2.12.0, CUDA 13.0, Isaac Sim 6.0.1.0, and an RTX 5090. Existing runtime/deprecation warnings occurred; the CI jobs validate the pinned environments. The previous [docs CI failure](https://github.com/isaac-sim/IsaacLab/actions/runs/35795116307/job/106972539281) was an external connection reset fetching the Omniverse intersphinx inventory, producing one warning under `-W`. That URL returned HTTP 200 when rechecked. This update starts a fresh docs build. --------- Co-authored-by: hujc <[email protected]> Co-authored-by: Zihan Xu <[email protected]>
Summary
--video,--video_length, and--video_intervalto the checkpoint-free zero and random agents (isaaclab_rl.entrypoints.simple_agents) andvideotoSimpleAgentRequest, reusing the recording helpers shared with the train/play entrypoints. Clips go tologs/<zero|random>_agent/<task>/videos/play/.--videoplayback stopping before every recorder finished its first clip. The sharedvideo_playback_stepshelper (used by every play backend and the zero/random agents) now waits for the recorder whose first clip ends last, and no longer ignoresstep_offsetwhen--video_lengthis passed.VideoRecorderCfg.validate_config, which rejects a non-positivevideo_length/frame_strideand a negativevideo_interval/step_offsetduring environment config validation. Before, these values silently wrote one-frame clips, divided by zero, or recorded nothing. The zero/random agents apply recorder settings before their pre-launch validation, so a bad--video_lengthfails before the simulator starts.Test plan
test_video_recorder.py,test_apply_video_recording.py,test_entrypoints.py,test_entrypoints_common.py: 136 passed. End-to-endtest_video_recording.py(--extra video): 3 passed.Release backport
develop🤖 Generated with Claude Code