Continue video clip indices after existing files - #7391
Conversation
Greptile SummaryThe PR prevents sequential recorder processes from overwriting existing clips by initializing the clip counter after the largest matching filename.
Confidence Score: 4/5The PR appears safe to merge, with a non-blocking scalability issue when a reused directory contains an unusually large sparse clip index and retention pruning is enabled. Existing filenames can now initialize the counter to an arbitrarily large value, while retention cleanup still enumerates every lower integer rather than only existing files. Files Needing Attention: source/isaaclab/isaaclab/envs/utils/video_recorder.py Important Files Changed
Reviews (1): Last reviewed commit: "Continue video clip indices after existi..." | Re-trigger Greptile |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change seeds VideoRecorder clip numbering from the highest existing matching <prefix>_<index>.mp4 file, preventing successive processes from restarting at zero. Focused tests cover sparse matching files, ignored non-matching files, and an empty output directory; release metadata is included.
- Design and architecture: Index discovery remains within the recorder’s existing filesystem boundary and reuses
_effective_output_dir()and the established filename convention._close_clip()continues incrementing the seeded index through the existing path without broader architectural changes. - API: No public API is added or removed. The private initial index behavior changes intentionally, while
VideoRecorderCfg, defaults, and the output filename format remain unchanged. The user-visible fix is documented in the package changelog fragment. - Implementation: The constructor assigns
self.cfgbefore scanning, the anchored and escaped regex limits matches to the configured prefix and numeric MP4 filenames, and missing or empty directories preserve the prior zero start. A non-blocking tradeoff is that construction now lists an existing output directory, so permission or filesystem errors can surface during initialization rather than later as logged write failures.
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.
621ec7e to
81c0b31
Compare
|
Could you target develop? We'll backport them to release 3.0 |
|
Retargeted to develop, thanks! |
Previously, VideoRecorder started every process at clip index zero. Recording into an existing output directory could overwrite clip_0000.mp4 and any later clips from a previous play or replay run. Initialize the recorder index from the highest existing file matching the configured prefix. Fresh or empty directories still start at zero.
81c0b31 to
c0c29c7
Compare
|
@kellyguo11 @matthewtrepte could I get a review? |
|
run-ci |
|
run-ci |
|
run-ci |
|
Backported to |
# Description `VideoRecorder` starts its clip index at zero on every new process, so a run that records into a directory that already holds clips overwrites `clip_0000.mp4` onward. This scans the output directory for existing `<prefix>_<N>.mp4` files and continues the clip index after the highest one, so successive runs into the same directory no longer clobber earlier recordings. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the `pre-commit` checks with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have added a changelog fragment under `source/<pkg>/changelog.d/` for every touched package - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there (cherry picked from commit 5615143)
Description
VideoRecorderstarts its clip index at zero on every new process, so a run that records into a directory that already holds clips overwritesclip_0000.mp4onward. This scans the output directory for existing<prefix>_<N>.mp4files and continues the clip index after the highest one, so successive runs into the same directory no longer clobber earlier recordings.Type of change
Release backport
developChecklist
pre-commitchecks with./isaaclab.sh --formatsource/<pkg>/changelog.d/for every touched packageCONTRIBUTORS.mdor my name already exists there