Repository navigation
Conversation
Confidence Score: 4/5
[Medium impact] Viewport recording changes outcomes for policy and experiment runs that enable it. The PR appears safe to merge with non-blocking improvements for reused output directories and camera cleanup. FindingsSummaryThe PR flushes viewport recordings after successful rollouts and fails when no matching MP4 exists.
Reviews (1) · Last reviewed commit: "Fail a run whose viewport recording wrot..." · Reviewed by Greptile |
| clip_pattern = f"{video_cfg.viewport_name_prefix}_*.mp4" | ||
| assert any(Path(video_cfg.video_base_dir).glob(clip_pattern)), ( |
There was a problem hiding this comment.
Old clips hide recording failures
write_viewport_video() accepts an old clip as proof that this rollout wrote one. build_and_run() accepts a caller-chosen output directory and reuses the same prefixes. If an API caller retries into that directory, this check can pass even when the new recorder writes nothing. Require an empty destination or check that this recording created or replaced the clip.
| if policy.is_remote: | ||
| policy.shutdown_remote(kill_server=args_cli.remote_kill_on_exit) | ||
|
|
||
| write_viewport_video(env, video_cfg) |
There was a problem hiding this comment.
Failed check skips camera cleanup
If the viewport check fails here, policy_runner skips env.close(). With both recording flags enabled, a step-limited rollout can still have camera encoders open. CameraObsVideoRecorder.close() must close those encoders and delete incomplete episode videos, but SimulationAppContext exits immediately on this exception without cleanup. Put environment cleanup in a finally block while keeping the viewport check on the success path.
Isaac Lab's VideoRecorder only logs a frame it could not capture, for example when the visualizer's render_rgb_array() returns None, or a clip it could not write. The rollout then finished without a viewport video. write_viewport_video() runs after the rollout. It writes the clip the recorder still holds, which an episode-driven rollout can stop short of, and asserts that a viewport clip exists. The policy runner and each Experiment Runner rebuild call it on the success path, so a rollout error is still the error reported. Signed-off-by: Xinjie Yao <[email protected]>
0be67ff to
7d7c44c
Compare
|
The PR changed while this review was running. Please run |
Fail a run when
--record_viewport_videowrites no viewport MP4. After the rollout, the newwrite_viewport_video()writes the clip the recorder still holds and asserts that it exists.Why this change?
#1808 records the viewport with Isaac Lab's
VideoRecorder, and fails before the rollout when no active visualizer can capture frames. The recorder can still end up writing no clip. When a visualizer'srender_rgb_array()returnsNone, the recorder catches the error, logs it, and stops capturing. It also only logs a clip that fails to write. In both cases the run finishes and exits 0 without a viewport video. This was raised in the review of #1808.What changes?
write_viewport_video(env, video_cfg)closes the environment's video recorders, which writes the clip still being recorded. It then asserts that a<viewport_name_prefix>_*.mp4exists in the video directory. An episode-driven rollout usually stops before its video length, so without this its clip is written only when the environment closes.env.close(), so a rollout error is still the error reported, and the Experiment Runner still writes placement diagnostics when the check fails.--record_viewport_video. The review GUI's sim preview is unchanged: it already checks for its MP4 after closing the environment.A run whose rollout succeeded but whose video is missing now fails. Its episode results are already on disk.
Validation
render_rgb_array()returnsNone, and another checks that a rollout shorter than its video length still gets its clip written. I did not reproduce a frame-capture failure in Isaac Sim.🤖 Generated with Claude Code