Skip to content

[Video] Add video recording to the zero and random agents - #7955

Merged
StafaH merged 3 commits into
isaac-sim:developfrom
StafaH:mh/zero-random-agent-video
Sep 23, 2026
Merged

StafaH merged 3 commits into
isaac-sim:developfrom
StafaH:mh/zero-random-agent-video

Conversation

@StafaH

@StafaH StafaH commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • 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.
  • The new regression cases fail on the pre-fix code and pass with the fix.
  • 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.
  • pre-commit hooks pass on the changed files

Release backport

  • Backport this pull request to the active release branch after it merges into develop

🤖 Generated with Claude Code

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.
@StafaH
StafaH requested a review from a team September 22, 2026 21:20
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Sep 22, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

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.

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, and enable_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_interval flags are opt-in, use consistent snake_case naming, and preserve non-video behavior. The user-visible addition is covered by an isaaclab_rl changelog fragment. Under video mode, --max_steps acts 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.

@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR should not merge until playback preserves complete output for every configured video recorder.

Findings

  1. P1 Later Recorders Stop Early ▶
  2. P2 Invalid Length Skips Recording ▶

Summary

This PR adds video-recording options to the checkpoint-free zero and random agents, configures camera and recorder infrastructure, stores clips beneath policy-specific log directories, and bounds playback to the recording step budget.

  • Adds --video, --video_length, and --video_interval.
  • Reuses the shared pre-launch and recorder configuration helpers.
  • Stops agent playback after the first configured clip or the smaller --max_steps budget.
  • Adds a changelog fragment for the new capability.

Reviews (1) · Last reviewed commit: "Add video recording to the zero and rand..."

if args_cli.video:
recorders = env_cfg.video_recorders or []
if recorders:
video_steps = recorders[0].video_length + recorders[0].step_offset

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.

P1 Later recorders stop early

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +262 to +265
"--video_length",
type=int,
default=None,
help="Length of each recorded video clip in env steps. Overrides the value in VideoRecorderCfg.",

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 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@StafaH

StafaH commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 22, 2026
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]>
@StafaH
StafaH requested a review from hujc7 as a code owner September 22, 2026 22:44
@StafaH StafaH changed the title Add video recording to the zero and random agents [Video] Add video recording to the zero and random agents Sep 22, 2026

@matthewtrepte matthewtrepte left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@StafaH

StafaH commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 23, 2026
@StafaH
StafaH merged commit c1fb8f3 into isaac-sim:develop Sep 23, 2026
53 checks passed
@isaaclab-bot

isaaclab-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as d7cf4f1.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 23, 2026
## 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)
ooctipus added a commit that referenced this pull request Sep 24, 2026
…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]>
@StafaH
StafaH deleted the mh/zero-random-agent-video branch October 10, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants