Repository navigation
fix(moq-hls): list a live segment once its last group passes the next line - #8874
Conversation
Quest-Claim: 9e2cd3ee780200d7
… line A group off the grid waited for the next group's start before it was placed, so a segment listed only when the group after its successor started, about one extra GOP late. The export now reads the newest group's frames as they arrive, and places the pending group as soon as one of them passes the next line. Numbering, EXTINF and Grid::starts are unchanged. Also gates Client::is_simulated on the features that use it, which broke `-p moq-hls` test builds under deny-warnings. Finishes quest/m3/hls-listing-lag.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unded memory A group carried whole in one CMAF fragment passes the next line in its first frame, so place it from the first frame's samples too, and from each later frame's samples through the same Reach the track's end reads. Reach now folds all but its newest 64 stamps into the shortest spacing, so a group read as it arrives costs bounded memory however long it runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment across edges Accepted by the maintainer on 2026-11-15, in exchange for listing every off-grid segment up to a group sooner. 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. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed all four commits. They make a live moq-hls segment list once its last group's frames pass the next grid line, without waiting for the group after it to start.
Grid::reachearly placement: a pending off-grid group goes intoslot + 1once one of its samples is strictly past the next line. That is the segment its successor's pts would give it when groups don't overlap, so numbering,EXTINFandGrid::startsstay the same.- Frames read as they arrive in
Step::Next: while the grid has a pending group, the watcher drains that group's frames and passes the newest sample toreach. It reads through the same consumer thatStep::Endlater finishes, and stops once the group is placed, ends or fails.Follow::firstalso checks the first frame's samples, so a CMAF group carried whole in one fragment is placed right away. - Bounded
Reach: stamps beyond the newestKEEP = 64fold into a running shortest spacing thatfinishincludes, so reading a long group keeps memory bounded. Placement also stays consistent because fmp4 decode times its samples from the frame's transport timestamp, which the group'sptsalso uses. - Accepted overlap trade-off documented: when a keyframe overlaps the previous group's frames across a line, one segment can differ between edges. That affects only that broadcast, and
grid.rsanddoc/bin/hls.mdsay so, with #8883 tracking the follow-up. Client::is_simulatedfeature gate: removes a dead-code warning when building withoutsim/websocket.
claude-opus-5-5 | 𝕏
|
quest land watch: the merge queue removed this pull request at 7320c09 because A person's removal ends the pick: the watcher leaves this pull request alone until a maintainer enqueues it again. (written by quest land watch) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 7320c098c5891f1880a92df952f1f82188ab8697.
No new actionable code defects found in this static pass. Checked the strict boundary comparison in Grid::reach, first-frame CMAF sample handling, the incremental reader's handoff to Step::End, and folded shortest-spacing accounting in Reach::finish. Reviewed the boundary and early-listing regression tests. The documented cross-edge segment mismatch for overlapping groups is an explicitly accepted trade-off, not a new finding.
Verification limits: GitHub-only static review of the diff and relevant source/tests. I did not build, run tests, execute the model checker, or reproduce the reported integration results. This is a COMMENT review, not an approval or a CI/merge-readiness assertion.
|
quest land watch: the merge queue removed this pull request at 7320c09 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.
… [0.26ms]
moq-doc check: (pass) audio jitter corpus > skipped > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > skipped > reports every target as a change
moq-doc check: (pass) audio jitter corpus > idle > matches the checked-in file [0.03ms]
moq-doc check: (pass) audio jitter corpus > idle > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > idle > arrives in a monotonic order [0.12ms]
moq-doc check: (pass) audio jitter corpus > idle > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > idle > reports every target as a change
moq-doc check: (pass) audio jitter corpus > silence > matches the checked-in file [0.04ms]
moq-doc check: (pass) audio jitter corpus > silence > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > silence > arrives in a monotonic order [0.19ms]
moq-doc check: (pass) audio jitter corpus > silence > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > silence > reports every target as a change
moq-doc check: (pass) audio jitter corpus > tunein > matches the checked-in file [0.04ms]
moq-doc check: (pass) audio jitter corpus > tunein > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > tunein > arrives in a monotonic order [0.20ms]
moq-doc check: (pass) audio jitter corpus > tunein > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > tunein > reports every target as a change
moq-doc check: (pass) audio jitter corpus > spike > matches the checked-in file [0.05ms]
moq-doc check: (pass) audio jitter corpus > spike > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > spike > arrives in a monotonic order [0.23ms]
moq-doc check: (pass) audio jitter corpus > spike > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > spike > reports every target as a change
moq-doc check: (pass) audio jitter corpus > outage > matches the checked-in file [0.07ms]
moq-doc check: (pass) audio jitter corpus > outage > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > outage > arrives in a monotonic order [0.34ms]
moq-doc check: (pass) audio jitter corpus > outage > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > outage > reports every target as a change
moq-doc check: (pass) audio jitter corpus > batches > matches the checked-in file [0.05ms]
moq-doc check: (pass) audio jitter corpus > batches > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > batches > arrives in a monotonic order [0.22ms]
moq-doc check: (pass) audio jitter corpus > batches > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > batches > reports every target as a change
moq-doc check: (pass) audio jitter corpus > straggler > matches the checked-in file [0.04ms]
moq-doc check: (pass) audio jitter corpus > straggler > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > straggler > arrives in a monotonic order [0.44ms]
moq-doc check: (pass) audio jitter corpus > straggler > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > straggler > reports every target as a change
moq-doc check: (pass) audio jitter corpus > fixed > matches the checked-in file [0.01ms]
moq-doc check: (pass) audio jitter corpus > fixed > is a trace of equal-length clocks
moq-doc check: (pass) audio jitter corpus > fixed > arrives in a monotonic order [0.06ms]
moq-doc check: (pass) audio jitter corpus > fixed > names a target for the first frame
moq-doc check: (pass) audio jitter corpus > fixed > reports every target as a change
moq-doc check:
moq-doc check: ::endgroup::
moq-doc check:
moq-doc check: ::group::concept/audio-jitter/stretch/corpus.test.ts:
moq-doc check: (pass) audio stretch corpus > the decisions match the checked-in file [0.08ms]
moq-doc check: (pass) audio stretch corpus > the cases match the checked-in file [0.04ms]
moq-doc check: (pass) audio stretch corpus > hold > matches the checked-in case [0.02ms]
moq-doc check: (pass) audio stretch corpus > hold > decides every hop it plays [0.01ms]
moq-doc check: (pass) audio stretch corpus > hold > moves the output by exactly the shifts it took [0.03ms]
moq-doc check: (pass) audio stretch corpus > speed-up-voiced > matches the checked-in case [0.05ms]
moq-doc check: (pass) audio stretch corpus > speed-up-voiced > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > speed-up-voiced > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > slow-down-voiced > matches the checked-in case [0.05ms]
moq-doc check: (pass) audio stretch corpus > slow-down-voiced > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > slow-down-voiced > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > bridge > matches the checked-in case [0.04ms]
moq-doc check: (pass) audio stretch corpus > bridge > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > bridge > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > turns-around > matches the checked-in case [0.06ms]
moq-doc check: (pass) audio stretch corpus > turns-around > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > turns-around > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > narrow-range > matches the checked-in case [0.03ms]
moq-doc check: (pass) audio stretch corpus > narrow-range > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > narrow-range > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > music > matches the checked-in case [0.09ms]
moq-doc check: (pass) audio stretch corpus > music > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > music > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > noise > matches the checked-in case [0.05ms]
moq-doc check: (pass) audio stretch corpus > noise > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > noise > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > silence > matches the checked-in case [0.04ms]
moq-doc check: (pass) audio stretch corpus > silence > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > silence > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > stereo-linked > matches the checked-in case [0.06ms]
moq-doc check: (pass) audio stretch corpus > stereo-linked > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > stereo-linked > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > stereo-opposite > matches the checked-in case [0.06ms]
moq-doc check: (pass) audio stretch corpus > stereo-opposite > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > stereo-opposite > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > bridge-44100 > matches the checked-in case [0.05ms]
moq-doc check: (pass) audio stretch corpus > bridge-44100 > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > bridge-44100 > moves the output by exactly the shifts it took [0.03ms]
moq-doc check: (pass) audio stretch corpus > bridge-48000 > matches the checked-in case [0.05ms]
moq-doc check: (pass) audio stretch corpus > bridge-48000 > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > bridge-48000 > moves the output by exactly the shifts it took
moq-doc check: (pass) audio stretch corpus > speed-up-16000 > matches the checked-in case [0.07ms]
moq-doc check: (pass) audio stretch corpus > speed-up-16000 > decides every hop it plays
moq-doc check: (pass) audio stretch corpus > speed-up-16000 > moves the output by exactly the shifts it took
moq-doc check:
moq-doc check: ::endgroup::
moq-doc check:
moq-doc check: 199 pass
moq-doc check: 0 fail
moq-doc check: 26712 expect() calls
moq-doc check: Ran 199 tests across 5 files. [2.75s]
##[endgroup]
##[error]ci: check rs failed
error: recipe `ci` failed on line 120 with exit code 101
##[error]Process completed with exit code 101.
##[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: 60f728bfb7de38adf338fc8f88bce642310cd9b6
CHECK_FAIL_FAST: 1
NEXTEST_TEST_THREADS: 24
MBX_CACHE_LINKS: 1
MBX_REMOTE_URL:
##[endgroup]
With the provided path, there will be 3 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 173550
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 376afbc1f466ee71eb4e35a0cae87412284ba3dd27d23f6fcb6442208ec80d31
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 14214279093
Artifact cargo-timings has been successfully uploaded! Final size is 173550 bytes. Artifact ID is 14214279093
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/43846369520/artifacts/14214279093
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@88acf2bb50552c7c508cbac13e5f8c576b95b1de;id=__3540c598-dfc3-4b97-9494-8399b5c7cef3.mbx]
##[end-action id=__3540c598-dfc3-4b97-9494-8399b5c7cef3.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/d95ede34-e164-40d0-ae9e-b8903ad88f2b' 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 0 objects and 0 action results (613.4 KiB logical); 49.9 GiB logical remain
dropped 1 session event streams
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: armed auto-merge on this pull request at c6e0e21, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix ( (written by quest land watch) |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since 7320c09, main was merged in and the moq-tokio change was dropped. The moq-hls changes are the same as in the last review.
- Dropped the
is_simulatedfeature gate: the#[cfg(any(feature = "sim", feature = "websocket"))]onClient::is_simulatedis gone becausemainnow calls the method unconditionally inrs/moq-tokio/src/client.rs. The gate would now be wrong, so removing it is correct, and the PR no longer changesmoq-tokio.
The PR description still says the PR gates Client::is_simulated on the sim/websocket features. That paragraph is out of date and can be removed.
claude-opus-5-5 | 𝕏

A live moq-hls media playlist now lists a segment as soon as the export can know it is complete, one group sooner than before when GOPs fall off the grid lines.
A group belongs to the first grid line it contains, so a group starting off a line used to wait for its end, the next group's pts, before it was placed. A segment completes only when a later one is placed, so segment N listed when group N+2 started. The export now also reads the newest group's frames as they arrive (
Step::Next), andGrid::reachplaces the pending group in the next slot once one of its samples passes the next line, counting the first frame's samples too, so a CMAF group carried whole in one fragment places at once.Reachfolds all but its newest 64 distinct stamps into a running shortest spacing, so reading a long group as it arrives costs bounded memory. Numbering,EXTINF, andGrid::startsare unchanged, so every edge and recorder still agrees on segment URLs.The saving equals the GOP's phase against the grid, between 0 and one interval (about 1 s on average for a random phase).
Also gates
Client::is_simulated(moq-tokio) on thesim/websocketfeatures that call it. Without them it is dead code, which brokecargo test -p moq-hlsunder deny-warnings.Public API:
Gridis crate-private, so there is no public API change. Wire: none.Validation
every_extinf_fits_the_targetnow replays every random stream through a second grid that gets three randomreachcalls per group. It asserts the listed segments are identical, which covers a short group that ends before the line.a_segment_completes_once_a_later_one_startsgains a case: frames short of or exactly on the next line list nothing, and the first frame past it places the group and completes the open segment.a_segment_lists_once_the_next_group_passes_its_line, on a paused clock: segment 1 lists once a frame of group 2 passes line 4 s, before group 3 starts. It fails with the new loop disabled ("never listed"). A CMAF case, where each group is one fragment, lists segment 1 from group 2's only frame, and fails with the first-frame placement disabled.a_whole_fragment_in_one_frame_reaches_its_last_samplereads 250 reordered, duplicated samples, checking the bound after each and that the newest sample and end match an unfolded read.moq-relayrunning an x264 test pattern with keyframes at 1.5 s + 2n, throughmoq export hls. I polled the media playlist every 50 ms and compared each segment's end byEXT-X-PROGRAM-DATE-TIMEwith when it first appeared:just checkpasses.Decisions
grid.rsanddoc/bin/hls.md. quest: plan groups whose frames present before the next group starts #8883 plansquest/m3/groups-never-overlap.md, which stops groups from overlapping and deletes those notes.Models
Size: M
Implementer: Claude Code, claude-opus-5-5
(Written by Claude Opus 5.5)
🤖 Generated with Claude Code
Review
mechanical fix by codex, gpt-6.1-sol, medium effort:
Merged base and removed the stale is_simulated cfg gate without changing its implementation; passed nix develop --command just ci base and nix develop --command just test interop --all.(head c6e0e21)Rewritten by
quest reviewafter each round.Head: 7320c09
Base: origin/main at 6ac78b6
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:
01a1e150-cc2c-74e1-a87a-6965caf962e4, round 1Score: 9/10,
Ready to land with the accepted overlap mismatch documented; no additional defects were identified, and builds and tests were not run as instructed.Rounds: 3; first round 3 (high 1, medium 2); findings 3 (high 1, medium 2): fixed 2, refuted 1, open 0
Findings: none
The last round's findings, at b32ca20:
rs/moq-hls/src/export/grid.rs:311:Preserve segment identity for supported overlapping groups;The 2026-11-15 maintainer decision documented at rs/moq-hls/src/export/grid.rs:15–19 explicitly accepts the overlap mismatch, so it remains an accepted trade-off rather than a blocking defect.