Repository navigation
feat(net)!: an ordered track's next_group yields groups - #9130
Conversation
Quest-Claim: 7296141a8dd667c9
…elds gaps too Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 1 minute. 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.
Approach: sound. Moving the gap skip into Ordered::poll_next_group removes a Gap => continue arm that a dozen callers each repeated, and poll_next_item keeps gap ranges for the one reader that needs them. The names now match js/net's nextGroup / nextItem.
Reviewed changes
This review covers the whole PR: the Ordered API split and the callers and tests moved onto it.
Orderedsplit — the oldpoll_next_groupis nowpoll_next_item(unchanged), and the newpoll_next_grouploops over it, passing gaps. Each gap moves the cursor forward, so the loop is bounded and costs the same as the caller loops it replaces.Item::groupremoved — no callers remain. Its doc comments now point atpoll_next_item.- Production callers — libmoq, moq-ffi (its private
poll_groupis inlined), moq-json snapshot and window, moq-hls rendition export, moq-mux's MSF catalog and TS SI export, moq-archive's producer track, and moq-net's origin bench all callpoll_next_groupdirectly. They behave the same as before. - Tests — tests that check gaps now call
next_item/poll_next_item, and the rest drop the.group().unwrap()unwrapping. A new test,next_group_passes_the_gaps_next_item_reports, checks both readers on one track with leading, middle, and trailing gaps. - Quest docs — the finished
ordered-gapsquest is deleted, andunused-api/netnow points atnext_item.
claude-opus-5-5 | 𝕏
|
Merge pick (maintainer away, granted the coordinator merges it confidently recommends): ✅ /quest-merge, accepting the decisions listed in the PR body. (Written by Claude Opus 5.5 with high) |
|
quest land watch: the merge queue removed this pull request at dfb38f8 because it conflicts with 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. (written by quest land watch) |
|
codex, gpt-6.1-sol, medium effort land fixer note:
(written by codex, gpt-6.1-sol, medium effort) |
|
codex, gpt-6.1-sol, medium effort land fixer: Auto-merging rs/moq-transcode/src/lib.rs Auto-merging rs/moq-transcode/src/rung.rs CONFLICT (content): Merge conflict in rs/moq-transcode/src/rung.rs Automatic merge failed; fix conflicts and then commit the result. (written by codex, gpt-6.1-sol, medium effort) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found. The merge of main resolves its conflict correctly.
Reviewed changes
Since the last review, the only new commit merges origin/main. I checked the conflict resolution and the new main code that calls the changed API.
drop_gapconflict inmoq-transcode/src/rung.rs: the resolution keeps main's comparison (group.start >= sequence, returningSome(group.start)). It reads through the gap-freenext_groupinstead of matchingtrack::Item::Group, so it behaves the same as main.- Main's new live-rung test in
moq-transcode/src/lib.rs: the test used to loop overnext_group().group()to skip gaps. It now takesnext_group()directly, which also skips gaps, so the test checks the same thing. - No stale callers: nothing in
rs/still calls.group()on an ordered read or matchestrack::Itemon anext_groupresult. TheItem::*arms inrung.rsandfeed.rsuse transcode's own local enum.
claude-opus-5-5 | 𝕏

Finishes quest/m2/outcome-enums/ordered-gaps.md.
Problem
track::Ordered::next_groupreturnedtrack::Item, and every production caller (libmoq, moq-ffi, moq-json snapshot and window, moq-hls, moq-mux TS export and MSF catalog, moq-archive, moq-stats, moq-net benches) wrote the sameItem::Gap => continuearm. Tests that wrote.and_then(Item::group)treated a gap as the end of the track.Approach
Ordered::next_group/poll_next_groupreturngroup::Consumerand pass over gaps.Ordered::next_item/poll_next_item, still returningItemfor a reader that needs each gap's range in order.Item::groupis gone: nothing needs it once callers read groups directly.next_group; tests that check gaps callnext_item. moq-ffi's privatepoll_grouphelper is inlined away.next_group_passes_the_gaps_next_item_reportschecks both readers on one track with leading, middle, and trailing gaps.next_item. It still reads in arrival order on main, so that quest makes the switch.Already on main: the JS side (moq-dev/moq#9068) has
Ordered.nextGroupandnextItem. The Rust names now match it. Nothing on main had started the Rust change.Impact
track::Ordered::next_group/poll_next_groupnow returnResult<Option<group::Consumer>>and pass over gaps. Migration: drop theItem::Group(group)/Item::Gap { .. } => continuematch and use the group directly. A reader that needs gaps callsnext_item/poll_next_item, which returnItemexactly asnext_groupdid before.track::Item::groupremoved. Migration: callnext_groupinstead ofnext_item().and_then(Item::group). Note that a gap no longer reads asNone.Alternatives
Decided in the quest's plan (maintainer, 2026-11-18): two methods, rejecting
Itemas the only return and a gap counter.Decisions
Taken while the maintainer was away. A later review can undo each one:
poll_next_item(range, end, and abort semantics).poll_next_grouppoints to it instead of repeating it..group().expect(..)moved tonext_group. Each still asserts the group's start, so a skipped gap would fail on the key. Tests that read gaps on purpose moved tonext_item.Gapitself.moq-transcode'sdrop_gapconflict keeps main's logic (sequence,Some(group.start)) and reads it through the gap-freenext_group. Main's new live-rung test inmoq-transcode/src/lib.rslooped overnext_group().group()to skip gaps; it now takesnext_group()directly. moq-dev/moq#9196 still callsnext_groupfor gap-aware reads; whichever of the two lands second renames those calls tonext_item.Validation
cargo check --workspace --all-targets --all-featuresandjust checkpass.just checkandjust cipass locally (clippy and tests for every changed crate and its dependents, plus bindings).just test interop --all: all checks pass, including thedrop moq-lite-0{5,6,7-wip}cases, where the Rust ordered reader skips a cut group to a clean end over a real relay, andhls grid, which uses the reworkedtest/interop/clients/rust/hls.rs.next_itemgivesgap 0..2, group 2, gap 3..4, group 4, gap 5..7andnext_groupgives[2, 4], both ending at the same point.Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, high effort
Implementer: Claude Code, claude-opus-5-5, high effort (iterate: merge main)
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with high)
Review
Rewritten by
quest reviewafter each round.Head: 6d2705b
Base: origin/main at 4d9190a
Risk: high,
Changing Ordered::next_group and poll_next_group to return groups instead of Item and removing Item::group breaks the public Rust API for downstream consumers, requiring caller migrations or a revert.Classified: high by Codex, gpt-6.1-sol, low effort, session
01a1f721-e9b0-75d2-99ae-7eff5afc17f1Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f721-f96f-7b93-b9b2-29b0053f6135, round 1Score: 9/10,
The group-only wrapper preserves gap-skipping behavior and gap-aware readers retain next_item, with no actionable regressions found in source review; builds and tests were not run as instructed.Rounds: 2; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none