Repository navigation
test(mux): encode the recovery clips once per FFmpeg build - #7074
Conversation
Quest-Claim: 5a4144e5f30cbd16
Nextest runs each test in its own process, so the per-process OnceLock re-encoded every recovery_test clip and re-decoded its reference in every case. Cache both beside the test binary, keyed by the FFmpeg binary, arguments and input, behind a per-entry file lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 080f2f5
No actionable bugs found. The test-only cache is a reasonable, dependency-free way to share encodes and reference decodes across nextest processes: per-entry locking serializes producers, partial-file rename avoids publishing interrupted writes, and argument/input changes invalidate entries. Crucially, exported-output grading still runs fresh FFmpeg decodes and retains the existing assertions. Keeping splice transformations outside the cache preserves their coverage without duplicating fixture recipes.
Verification: static inspection of the changed helper, clip construction, reference parsing/comparison and grader paths. I did not run tests or reproduce the reported CPU savings. FFmpeg identity is intentionally path/mtime-based, not a complete fingerprint of dynamically linked libraries.
|
Merge summary: no changes needed. CI passed on Suggested follow-up from the PR body: moq-dev/moq#6987 touches the same (Written by Claude Opus 5.5) |
Problem
quest/m0/ci/recovery-clips.md, found by moq-dev/moq#6987's profile: nextest runs each test in its own process, so theOnceLockinProfile::clipnever shared anything. Everyrecovery_testcase re-encoded its FFmpeg clip and re-decoded it for the reference pictures.Change
Test-only, in
rs/moq-mux/src/container/ts/recovery_test.rs:ffmpeg(args, input)helper replaces the two hand-rolledCommandblocks (the encode anddecode). It fails on a non-zero status or any logged error, as both did.cached(args, input)runs it once per FFmpeg build. The entry is keyed by a hash of the FFmpeg binary's resolved path and mtime, the arguments, and the input bytes. It lives inrecovery-ffmpeg/beside the test binary (target/debug/recovery-ffmpeg/).std::fs::File::lock). The first process that needs an entry makes it and the others wait for it..partialfile and renamed into place, so a killed process leaves no torn entry.cached. Every other decode, the ones that grade the export, still runs FFmpeg each time.splicestays in-process. The Resized and Spliced profiles share their first encode with Closed.Every case runs as before. No assertion changed.
Result
CPU for moq-mux
container::ts::recovery_test: 19 tests, the per-test-processwait4user+system time from the moq-dev/moq#6914 wrapper (SHA-256d16e86fb...). Same machine, means of 2 to 3 runs each.Per-test CPU seconds
hevc_keeps_radl_after_a_holehevc_trims_only_orphaned_rasla_skip_across_a_resolution_change_takes_the_new_parametersa_declared_discontinuity_survives_loss_either_sidea_lost_discontinuity_marker_still_breaks_the_clocka_skipped_group_resumes_at_the_nexta_skip_across_the_wrap_keeps_the_clocka_cut_group_keeps_what_it_deliveredskewed_audio_survives_a_video_skipa_clean_path_loses_nothinga_stalled_track_leaves_the_others_runninga_stall_drops_what_it_made_latea_congested_path_sheds_what_it_made_latea_path_stall_drops_what_it_made_lateopen_gop_trims_only_the_orphansa_join_starts_on_a_whole_groupa_late_catalog_starts_on_a_whole_groupthe_graders_fail_what_they_shouldthe_bottleneck_admits_only_what_fitsChoices made without asking
cargo testwould lose the clips.cargo test.target/is cleaned. The current set is 2.4 MB.std::hash::DefaultHasher, which a Rust release may change. That only costs a re-encode.ffmpeg -version.Conflicts
moq-dev/moq#6987 edits the same
Encode::runanddecode: x265pools=none, a murmur3framehash, and one TS concatenation. Whichever lands second needs a small hand merge. Its argument changes need nothing else: they change the cache keys, so they invalidate the cache themselves.Impact
Validation
just checkpassed: 4,136 Rust tests, 60 skipped.quest check --base origin/mainpassed.just rs ts-recoverypassed: the nightly two-minute arm runs through the same cache.Reference::newtemporarily back on the uncacheddecode.target/debug/recovery-ffmpeg/first. The command wasjust rs test -p moq-mux --lib -E 'test(/^container::ts::recovery_test::/)'under the wrapper, with zero retries.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code