Repository navigation
fix(moq-mux,play): native video stops waiting on a hole its clock passed - #8909
Conversation
Quest-Claim: 7ebdc3d24e7cc42b
A missing video group whose successor starts at or before the media the playout clock presents now is worthless: the successor's pictures are due and replace it. The container consumer takes that clock with set_playhead and skips the hole then, and its timer and the clock's moves wake it. moq play passes its shared clock to the video reader, mirroring @moq/hang's playhead. Native audio keeps its estimate wait: given the clock, the audio-quality rows measured worse on bursty and congestion arrivals. 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 38 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. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the Rust port of the browser's playhead hole rule into the container consumer, and how moq play's video reader is wired to it.
container::Consumer::set_playhead— In the missing-group branch, a hole now also ends once the shared clock's due time for the first group past it is now or earlier. The hole timer wakes atmin(wait expiry, due). While a hole is pending, the reader registers onsync::Consumer::poll_changed, so a re-anchor or delay change wakes it. This runs only afterStartup::Started, the same as JS, where#passedapplies only whenstarting === undefined.moq playvideo —Video::rungives the consumerpresentation.consume(). Video presents through the samepresentation.due, so the skip and the display share one schedule. Native audio keeps its estimate wait, as measured in the PR body.- Tests — Three
moq-muxtests cover: the clock reaching the group, the clock jumping past it, and a newest-first backlog. One player-level test covers video catching up after a late group. I ran the threemoq-muxtests locally and they pass. - Quest docs — Retires
rust-playhead-holes.md, adds the follow-upbrowser-audio-hole-skip.md, and records the native audio measurements indelay-hole-wait.md.
claude-opus-5-5 | 𝕏
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 78df7a9a272efe0486da7f80bdde649e90454216.
P2: A due video group can get stuck behind a hole if the deadline crosses during the poll. The hole branch checks now at line 862, then does more reader work before arming the timer. If the new playhead deadline crosses in between, the host timer returns Ready immediately rather than registering a wake. Line 911 discards that result. On a live but idle track with one buffered successor and a stable schedule, the read can then return Pending and nothing wakes it at either the playhead deadline or the later fallback expiry. This is especially relevant when a late burst leaves very little time until the chosen deadline.
Re-enter the hole loop when the timer poll returns Ready, as the branch already does when the schedule changes during registration. A deterministic test that crosses the deadline between the initial time check and the timer poll would cover the missed-wake case; the existing tests cover a timer that actually goes pending first.
The video-only scope makes sense, and leaving native audio on its estimate wait fits the reported burst results. I reviewed the code statically and did not run tests. COMMENT only, not approval.
|
quest land watch: the merge queue removed this pull request at 78df7a9 because its The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.
…_video_config_replaces_its_own_rendition
PASS [ 0.034s] ( 719/5998) moq-c test::raw_loc_video_uses_the_declared_catalog_container
PASS [ 0.047s] ( 720/5998) moq-c test::publish_media_labels_config_without_naming_track
PASS [ 0.039s] ( 721/5998) moq-c test::raw_track_publish_consume
PASS [ 0.085s] ( 722/5998) moq-c test::parity::session_tokens_and_grants
PASS [ 0.035s] ( 723/5998) moq-c test::raw_track_skips_are_final
PASS [ 0.029s] ( 724/5998) moq-c test::raw_track_sparse_groups_and_known_end
PASS [ 1.088s] ( 725/5998) moq-audio decode::consumer::tests::a_declared_end_survives_a_lost_group
PASS [ 0.024s] ( 726/5998) moq-c test::server_listen_refuses_bad_config
PASS [ 0.026s] ( 727/5998) moq-c test::server_keylog_requires_sslkeylogfile
PASS [ 0.029s] ( 728/5998) moq-c test::route_broadcast_survives_id_reuse
PASS [ 0.086s] ( 729/5998) moq-c test::parity::video_encoder_without_a_broadcast
PASS [ 0.020s] ( 730/5998) moq-c test::session_connect_invalid_url
PASS [ 0.032s] ( 731/5998) moq-c test::raw_track_time_anchor
PASS [ 0.031s] ( 732/5998) moq-c test::route_options_carry_cost_and_instance
PASS [ 0.037s] ( 733/5998) moq-c test::raw_track_subscription_options_and_update
PASS [ 0.033s] ( 734/5998) moq-c test::raw_track_update_refuses_a_scaled_time_anchor
PASS [ 0.023s] ( 735/5998) moq-c test::status_callback_refuses_null
PASS [ 0.025s] ( 736/5998) moq-c test::session_snapshot_error_preserves_destination
PASS [ 0.023s] ( 737/5998) moq-c test::subscription_defaults_are_moq_net_defaults
PASS [ 0.046s] ( 738/5998) moq-c test::session_connect_and_close
PASS [ 0.026s] ( 739/5998) moq-c test::tokens_reach_the_dial
PASS [ 0.032s] ( 740/5998) moq-c test::timestamp_writes_refuse_out_of_range_and_mismatch
PASS [ 0.027s] ( 741/5998) moq-c test::track_demand_reports_current_state_before_close
PASS [ 0.050s] ( 742/5998) moq-c test::server_rejects_a_session
PASS [ 0.028s] ( 743/5998) moq-c test::track_demand_reports_an_abort
PASS [ 0.028s] ( 744/5998) moq-c test::track_info_max_age
PASS [ 0.034s] ( 745/5998) moq-c test::track_demand_reports_the_wanted_group
PASS [ 0.033s] ( 746/5998) moq-c test::track_dynamic_serves_a_fetch_miss
PASS [ 0.034s] ( 747/5998) moq-c test::track_request_accepted_after_the_broadcast_closes_is_refused
PASS [ 0.034s] ( 748/5998) moq-c test::track_request_dynamic_survives_accept
PASS [ 0.039s] ( 749/5998) moq-c test::track_demand_follows_subscribers
PASS [ 0.030s] ( 750/5998) moq-c test::unpublishable_catalog_containers_are_rejected
PASS [ 0.034s] ( 751/5998) moq-c test::unknown_format
PASS [ 0.056s] ( 752/5998) moq-c test::timestamps_round_trip_exactly
PASS [ 0.028s] ( 753/5998) moq-c test::video_raw_decode_output_rejected
PASS [ 0.043s] ( 754/5998) moq-c test::track_request_media_carries_hints
PASS [ 0.032s] ( 755/5998) moq-c test::versions_lists_the_offered_set
PASS [ 1.174s] ( 756/5998) moq-audio decode::backend::libopus::tests::family_one_decodes_in_canonical_order
PASS [ 0.026s] ( 757/5998) moq-c test::zero_with_a_flag_set_is_a_real_value
PASS [ 0.027s] ( 758/5998) moq-c test::viewers_split_the_receive_estimate
FAIL [ 0.096s] ( 759/5998) moq-c test::server_accepts_a_session
stdout ───
running 1 test
test test::server_accepts_a_session ... FAILED
failures:
failures:
test::server_accepts_a_session
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 208 filtered out; finished in 0.07s
stderr ───
thread 'test::server_accepts_a_session' (2720358) panicked at rs/moq-c/src/test.rs:8389:5:
assertion `left == right` failed
left: -21
right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Cancelling due to test failure: 23 tests still running
PASS [ 0.033s] ( 760/5998) moq-c test::video_raw_publish_rejects_invalid_config
PASS [ 0.055s] ( 761/5998) moq-c test::video_publish_consume
PASS [ 0.036s] ( 762/5998) moq-c video::follow_tests::a_lowered_ceiling_beats_a_due_raise
PASS [ 0.028s] ( 763/5998) moq-c video::follow_tests::a_moved_lower_retries_the_dropped_target
PASS [ 0.029s] ( 764/5998) moq-c video::follow_tests::a_quiet_grant_retries_a_failed_raise
PASS [ 0.058s] ( 765/5998) moq-c test::video_raw_publish_rejects_frame_size_mismatch
PASS [ 0.047s] ( 766/5998) moq-c video::tests::a_failed_drain_aborts_the_track
PASS [ 0.064s] ( 767/5998) moq-c test::zeroed_audio_hint_measures
PASS [ 0.049s] ( 768/5998) moq-c video::tests::a_successful_drain_ends_the_track_cleanly
PASS [ 0.049s] ( 769/5998) moq-c video::tests::finish_ends_the_track_after_a_rate_follower_panic
PASS [ 0.063s] ( 770/5998) moq-c video::tests::a_failed_disable_leaves_the_catalog_and_encoder_agreeing
PASS [ 0.098s] ( 771/5998) moq-c test::video_raw_decode
PASS [ 1.063s] ( 772/5998) moq-audio encode::capture::tests::an_hls_viewer_starts_an_on_demand_capture
PASS [ 0.113s] ( 773/5998) moq-c test::video_raw_publish_from_many_threads
PASS [ 0.108s] ( 774/5998) moq-c video::tests::a_resume_onto_a_new_level_reserves_on_the_new_track
PASS [ 1.026s] ( 775/5998) moq-audio encode::producer::tests::batch_size_does_not_change_the_published_track
PASS [ 0.184s] ( 776/5998) moq-c test::video_raw_publish_consume
PASS [ 0.192s] ( 777/5998) moq-c test::video_raw_decode_rgba
PASS [ 0.195s] ( 778/5998) moq-c test::video_raw_decode_resize
PASS [ 0.710s] ( 779/5998) moq-c test::a_route_credential_rides_and_renews_the_moq_transport_announce
PASS [ 1.068s] ( 780/5998) moq-c test::a_credential_rides_every_reconnect
PASS [ 3.557s] ( 781/5998) moq-audio decode::consumer::tests::the_decode_path_conforms_to_the_corpus
PASS [ 4.524s] ( 782/5998) moq-audio ring::tests::stretch_plays_onto_the_clock_through_drift_and_target_changes
────────────
Summary [ 5.348s] 782/5998 tests run: 781 passed, 1 failed, 66 skipped
FAIL [ 0.096s] ( 759/5998) moq-c test::server_accepts_a_session
stdout ───
running 1 test
test test::server_accepts_a_session ... FAILED
failures:
failures:
test::server_accepts_a_session
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 208 filtered out; finished in 0.07s
stderr ───
thread 'test::server_accepts_a_session' (2720358) panicked at rs/moq-c/src/test.rs:8389:5:
assertion `left == right` failed
left: -21
right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: 5216/5998 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
mbx[cache]: object cache: 2 hits, 62 misses, 20 bypassed; 0 B downloaded, 0 B uploaded, 2.5 GiB stored locally
mbx[cache]: 2m 21s session; 172.8ms estimated compiler time avoided (summed across compilations)
mbx[cache]: bypass reasons: 20 unsupported-crate-type
mbx[cache]: Cargo artifact reuse and CI cache archive transfers are not included above
mbx[savings]: 1.9 TiB logical of old build output has been shown the door.
error: recipe `test` failed on line 364 with exit code 100
error: recipe `test-changed` failed on line 104 with exit code 100
##[endgroup]
ci: wall and CPU seconds per module
75 103 check rs
141 590 test rs (failed)
24 35 check biome
23 10 check markdown
17 23 check gh
50 33 check carla_bridge
0 0 check drill
2 3 check quest
17 16 check shell
0 0 check large_files
0 0 check text
1 1 check coverage_tables
1 0 check toml
3 2 check nix
0 0 check justfile
216 823 whole run
error: recipe `ci` failed on line 120 with exit code 100
##[error]ci: test rs failed
##[error]Process completed with exit code 100.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
name: cargo-timings
path: target/cargo-timings/cargo-timing-*.html
if-no-files-found: ignore
retention-days: 14
compression-level: 6
overwrite: false
include-hidden-files: false
archive: true
env:
BASE: 0c7b462d9dfead1eabc91de3f4c2285542a92d78
CHECK_FAIL_FAST: 1
NEXTEST_TEST_THREADS: 24
MBX_CACHE_LINKS: 1
MBX_REMOTE_URL:
##[endgroup]
With the provided path, there will be 5 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 257395
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 7cae68e423c082d05bc59def827f59a55fe79b8015cdaa662e5e9e80178fab79
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 14275146174
Artifact cargo-timings has been successfully uploaded! Final size is 257395 bytes. Artifact ID is 14275146174
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/43961073501/artifacts/14275146174
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__09e8750f-701d-4bb4-b30d-d20f0da7675f.mbx]
##[end-action id=__09e8750f-701d-4bb4-b30d-d20f0da7675f.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git version
git version 2.56.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/6f8af08f-3480-4a8a-b5ec-e64066294ae6' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/i2m3w4ly2w6grrmk1j59rb7zp09bssia-git-2.56.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/qrn6ds64bzvwbm5nwf245ifz2c6jb9xw-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/lfm00fnq66xfgbn099vqckabyl5jllz6-bash-interactive-5.3p20/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 526 objects and 135 action results (2.7 GiB logical); 50.0 GiB logical remain
dropped 9 session event streams
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
Cleaning up orphan processes
(written by quest land watch) |
|
codex, gpt-6.1-sol, medium effort land fixer note:
(written by codex, gpt-6.1-sol, medium effort) |
|
quest land watch: re-enqueued this pull request at 78df7a9, at the back of the merge queue, unchanged, since the land fixer judged the failure flaky: (written by quest land watch) |

Finishes quest/m2/audio-playout/rust-playhead-holes.md.
Problem
moq-dev/moq#8799 gave
@moq/hang's consumer the player's clock: a missing group ends once the clock reaches the group past it. The Rust container consumer had no such rule, somoq playwaited out the hole wait even when the media past the hole was already due.Natively the gap is smaller than in the browser. Both native waits are about one playout delay: audio waits its jitter estimate, and video's
agedrule fires once the newest content runs one delay past the hole. So the clock only gains when the group past the hole arrives late. Then video freezes on its last picture for up to one more delay, and the late group's pictures are never shown.Approach
moq_mux::container::Consumer::set_playhead(sync::Consumer). In the missing-group branch,passedholds once the clock's due time for the first stamped group past the hole is now or earlier. The hole timer wakes at whichever comes first, the wait or that due time. The reader also registers onsync::Consumer::poll_changed, so a clock that jumps (a re-anchor or a new delay) wakes it.moq play's video reader passes its shared clock (rs/moq-cli/src/play/video.rs).Decisions
Taken on my recommendation while the user was away:
Video only. Audio keeps its estimate wait. This narrows the quest's Plan, which also routed the clock through
moq_audio::decode::Consumer. I built that first, then measured it withjust test audio-quality --runtimes native --codecs opus --duration 40 --seed 7(video is off in these rows, so only audio changed):burstyunderruns/mincongestionunderruns/mincongestionA/V lag p95mildA burst lands late all at once. The group past a hole is already due when the missing group lands a moment later in the same burst, so skipping at the clock throws it away. Audio still plays late audio under the stretch threshold, so a hole that will fill is worth waiting for. Allowing the stretch fixed
bursty. It still lost oncongestion: the earlier skips turn into gaps, which reset audio's hold on the clock. Video has neither problem, because the next due picture replaces a late one.The rule for video is exactly the browser's (clock reaches the group past the hole), with no allowance.
No
moq-ffichange: the bindings expose no playout clock (moq_mux::syncis not bound), and no binding player API changed.Validation
moq-muxunit tests, mocked clock:gap, 13, 14as soon as the clock passes group 13. Without the rule it waits for group 5, which lands last, and plays everything late.passedcheck, the timer's due time, and thepoll_changedregistration.Video::runwith the real container consumer, shared clock, andmoq play's video budgets of one delay as both min and max): group 5 is lost, and audio holds the clock while video from group 6 on is 300 ms late. Picture 600 shows at 0.9 s, when it lands. Without the call, the screen stays frozen on 400 until 1.0 s and 600 never shows.just test native-playpasses (the shipped binary; audio only).just checkpasses.just test -p moq-mux -p moq-audio -p moq-cli --features moq-cli/play --no-fail-fast: 2753 passed, 1 failed. The failure isa_wide_delay_observes_the_whole_tune_in_burst, which needs a software H264 encoder this local build lacks (NoEncoder). It is environmental and unrelated.moq play's headless mode is audio only).Impact
moq-mux: newcontainer::Consumer::set_playhead(sync::Consumer). Additive.moq play: video skips a hole once the shared clock reaches the group past it.Alternatives
lateallowance parameter onset_playhead: dropped with the audio use, its only consumer.Caused by
No single PR. The native waits predate the browser's playhead rule.
Follow-ups
burstyandcongestionrows with and without it, and if they regressed, gives audio the native estimate wait. No open decisions.Models
Size: M
Implementer: Claude, claude-opus-5-5, high effort (arm B)
(Written by Claude Opus 5.5 with high)
Review
Rewritten by
quest reviewafter each round.Head: 78df7a9
Base: origin/main at 6488ce6
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1e458-9b7d-7f00-b607-774c81ee73a9, round 1Score: 9/10,
The clock-aware skip and wakeup handling fit the existing design and include focused regression coverage, though builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none