Skip to content

fix(net): a moq-transport reader from the oldest group asks for the backlog - #9405

Merged
kixelated merged 7 commits into
mainfrom
quest/m1/ietf-oldest-backlog
Nov 22, 2026
Merged

kixelated merged 7 commits into
mainfrom
quest/m1/ietf-oldest-backlog

Conversation

@kixelated

@kixelated kixelated commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Claims and finishes quest/m1/ietf-oldest-backlog.md.

Changes

A moq-transport subscriber reading from track::Start::Oldest used to ask for a live join, so it got only the live group, never the backlog the publisher holds. Two things were wrong, in both Rust and JS:

  1. The wire request. The SUBSCRIBE's start came from Subscription::start() (Rust) or wireSpan (JS), which treat an Oldest range as "no start", and "no start" means a live join. A new wire_start / wireStart sends group 0 for any Oldest range whose Delay::max reaches back. That is the filterless SUBSCRIBE moq-dev/moq#7883 settled on for a group-0 start, so the copy's fills then fetch the groups below Largest with one range FETCH. wire_bounds (the REQUEST_UPDATE span) uses the same rule, which replaces its joins special case.
  2. The copy's fill floor. Fixing the wire alone was not enough. The quest's plan assumed the existing group-0 path would fetch the backlog, but it didn't. The receiving copy declared its feed start at SUBSCRIBE_OK's Largest, and the miss judge (Misses::judge in Rust, #fillFloor in JS) only fills below a declared start for readers that name a group there. An Oldest reader names none, so it was never offered the history. A Time(0) reader names group 0, which is why its path worked. An IETF live join now declares its start (SUBSCRIBE_OK's Largest) as publisher-resolved (start_resolved in Rust; a new resolved flag on JS startTrack), the existing rule lite-06+ uses: every group below it stays fillable, and each reader's budget decides what it asks. This also covers a patient Oldest reader that joins a JS copy after its SUBSCRIBE, which JS never re-asks upstream because its REQUEST_UPDATE carries no range.

Docs: doc/concept/standard.md says when an oldest reader asks from group 0.

Impact

  • No public API change. No wire format change.
  • Wire behavior: a moq-net (Rust or JS) subscriber over moq-transport whose ranges include Oldest, with a non-zero or unbounded Delay::max, now sends a filterless SUBSCRIBE. Once the copy is current it sends one range FETCH below Largest, instead of a live join (Next Object plus a draft-18 joining FETCH or a draft-20+ fill). A third-party publisher that answers the range delivers its backlog. Our own publisher still refuses a multi-group FETCH, as feat(ffi)!: expose socket endpoints and preserve IETF starts #7883 decided, so against moq-net the reader gets the whole latest group and the history below it is reported dropped.
  • The default subscription (one Oldest range, Delay::max zero) still joins live, unchanged.

Decisions

Taken without the maintainer, who was away; a review can undo each:

  • An Oldest range asks from group 0 only when its budget reaches back (Delay::max not zero). Why: the default subscription is an Oldest range with a zero budget, which keeps only the latest group. Sending every default reader a filterless SUBSCRIBE plus a range FETCH would ask for history the reader then discards, and would make a spec-following publisher replay its whole retention. The quest's plan said "any non-empty Oldest range"; that version broke 11 IETF subscriber tests that expect a default reader to join live. Not chosen: every Oldest range (the plan as written).
  • A zero-budget Oldest range next to a time range now keeps a placed live join rather than widening to group 0. This changes one feat(net)!: a live join is a range's Live start, asked upstream per join #9316 assertion in a_live_join_keeps_its_bounds_for_a_range_it_already_delivers. A zero-budget Oldest range delivers only the latest group, which the join already covers; with a budget that reaches back it still widens to group 0, and the test now pins both.
  • The backlog arrives through the existing group-0 path (filterless SUBSCRIBE plus one range FETCH), not an explicit absolute {0, 0} SUBSCRIBE. This follows feat(ffi)!: expose socket endpoints and preserve IETF starts #7883's settled decision. As a result, our own publisher can't serve an Oldest reader its backlog over moq-transport, since it refuses multi-group FETCH; only third-party publishers that answer range FETCH do. Not chosen: reopening feat(ffi)!: expose socket endpoints and preserve IETF starts #7883 (an absolute start from 0 on drafts 18 and 22, which our publisher replays, but which draft 20 cannot spell).
  • Every IETF live join's start counts as publisher-resolved, not only a group-0 join's (from review round 1). A zero-budget reader still asks nothing below it, because its budget marks those groups stale; the full Rust and JS suites confirm no default reader starts fetching. Not chosen: re-subscribing a JS copy when a later reader widens it, since JS has no range updates.
  • No end-to-end test against moq-net's own publisher. By the decision above, that path ends in a refused FETCH. Instead, the Rust and JS unit tests pin the wire request against a scripted peer and check an Oldest reader asks exactly what a Time(0) reader does. An end-to-end run against our publisher (below) confirmed the FETCH goes out.

Validation

  • Reproduced first: a new Rust integration test (an Oldest reader behind a moq-transport-22 hop, publisher holding groups 0 to 5000 ms) read 5000 first. With the wire fix only, a probe in ServeEnd::Fill showed a Time(0) reader asking fill 0..4501 while an Oldest reader asked nothing. With both halves, the Oldest reader asked the same 0..4501 fill, which our publisher then refused as designed. I dropped that test because, against our own publisher, it can only show the refusal.
  • Rust an_oldest_reader_fetches_the_groups_below_largest (draft 22, scripted peer): Time(0) and Oldest both send a filterless SUBSCRIBE and then the identical range FETCH Absolute {0,0}..=group 8 below Largest 9. Rust an_oldest_range_asks_from_group_zero pins wire_start/wire_bounds for Oldest alone, beside a live join, bounded, and with a zero budget.
  • JS: the existing a start of group 0 joins live with no filter and fetches the groups below Largest now also runs from the oldest group, on drafts 18, 20 and 22. Mutation check: reverting either half (wireStart's Oldest rule, or the resolved flag) fails exactly the three oldest-group cases. New a reader from the oldest group joining a live copy fetches the groups below Largest covers a patient reader joining after the live join; it fails on all three drafts with resolved limited to group-0 joins.
  • cargo test -p moq-net --features async: all pass (3605 lib, 639 integration). bun test src/ietf/: 667 pass. just check: pass. Its first run after the round-1 fix timed out two unrelated stitch_tests under nextest. They passed alone, 20 of 20 in a nextest stress loop, and in a clean just check rerun; their harness doesn't reach the changed SubscribeOnce path. just test interop --all: all checks passed.

Caused by

  • No single PR: the IETF adapter has read an oldest range as "no start", and so as a live join, since it took its start from Subscription::start(). moq-dev/moq#8402 and moq-dev/moq#9316 moved that code without changing it. Found on moq-dev/moq#9265 (found by reviewer).

Follow-ups

None. quest/m1/live-max-age.md may redefine a None start on lite-07; this PR keeps Oldest meaning the oldest group the publisher holds, bounded by the reader's budget, as the quest asked.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm A)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, S)

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 8790a76

  • Base: origin/main at 040a566

  • Risk: medium, It is a bug fix in shipped Rust and JS moq-transport subscriber code that keeps the API and wire format: an Oldest-range reader with a non-zero delay budget now sends a filterless SUBSCRIBE from group 0 and fetches the backlog, so a moq-transport peer may deliver more history than before, and a revert fully undoes it, which keeps it out of high.

  • Classified: medium by Claude Code, claude-haiku-5-5, low effort, session 54e0f2f3-4112-47af-bbc6-2bde456c0e65

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a203ba-9df5-7602-8547-2b0404924d26, round 2

  • Score: 10/10, The incremental changes fix budget widening, the existing plan and tests support the group-0 behavior, and code inspection found no new issues.

  • Rounds: 2; first round 2 (medium 2); findings 2 (medium 2): fixed 1, refuted 1, open 0

  • Findings: none

  • The last round's findings, at 3c84221:

    • Refuted: medium, rs/moq-net/src/ietf/subscriber.rs:14503: Preserve current-group head recovery for Oldest readers; The base's quest/m1/ietf-oldest-backlog.md explicitly selects the existing unfiltered group-0 path, and rs/moq-net/src/ietf/subscriber.rs:18288 and js/net/src/ietf/join.test.ts:286 pin skipping cut Largest groups; the external #7883 decision could not be fetched.
    • Fixed: medium, js/net/src/ietf/subscriber.ts:1694: Enable backlog fills when an existing JavaScript reader widens its budget; js/net/src/ietf/subscriber.ts:1698 now marks every live start with Largest as resolved, allowing #fillFloor to admit older groups after budget widening, with a new regression test covering a later Oldest reader across drafts 18, 20 and 22.

Since the reviewed head 8790a76, the only change is a8d7496, which applies Pullfrog's suggested patch from this thread unchanged: a reviewer's suggested patch applied as-is needs no new local round.

kixelated and others added 5 commits November 22, 2026 05:57
…acklog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oup 0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h the quest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title A moq-transport reader from the oldest group gets the backlog fix(net): a moq-transport reader from the oldest group asks for the backlog Nov 22, 2026
… oldest reader fills

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 22, 2026 16:48
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0b2b8968-1602-4dd6-b10a-f71f51b2f49f
Commits

Reviewing files that changed from the base of the PR and between 3d1bb40 and a8d7496.

Files selected for processing: 7

  • doc/concept/standard.md
  • js/net/src/ietf/subscriber.test.ts
  • js/net/src/ietf/subscriber.ts
  • js/net/src/internal.ts
  • js/net/src/track.ts
  • quest/m1/ietf-oldest-backlog.md
  • rs/moq-net/src/ietf/subscriber.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one small cleanup inline.

Approach: sound. It fixes both causes in Rust and JS together. First, the wire start now asks from group 0 for an Oldest range whose budget reaches back. Second, the fill floor now marks a live join's start as publisher-resolved. It reuses the settled #7883 path (a filterless SUBSCRIBE plus one range FETCH) and adds no new wire shape.

Reviewed changes — I read the full diff at 8790a76 (6 commits, 7 files):

  • wire_start / wireStart: an Oldest range asks from group 0 when Delay::max is not zero. Rust treats Some(ZERO) as the default, and JS treats an omitted max as 0 and null as unbounded, so the two sides agree.
  • wire_bounds: the REQUEST_UPDATE span now goes through wire_start, which drops the joins special case. With a zero budget, an Oldest range next to a time range now keeps the placed live join.
  • Resolved live start: every IETF live join that has a Largest declares FeedStart::Resolved (Rust start_resolved; JS startTrack({ resolved }), read in #fillFloor). The groups below stay fillable for any reader whose budget reaches them.
  • Tests: Rust an_oldest_range_asks_from_group_zero and an_oldest_reader_fetches_the_groups_below_largest are new. JS adds an Oldest variant of the group-0 join test and a test for an Oldest reader joining a live copy late, on drafts 18, 20 and 22.
  • Docs/quest: doc/concept/standard.md now says when an Oldest reader asks from group 0. The finished quest file is deleted.

In Rust, a patient Oldest reader that joins an existing live copy goes through the update path instead of the resolved flag. wire_bounds returns (Some(0), None), so the copy sends a SUBSCRIBE_UPDATE with no filter and calls start_at(Some(0)), which replaces the resolved start. The gaps below Largest then fold after the miss grace and get filled. A Time range below the join already takes this path, so this PR adds no new risk there.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread rs/moq-net/src/ietf/subscriber.rs Resolved
Co-Authored-By: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — the delta since the prior Pullfrog review at 8790a76:

  • Spelled out the Largest-less live join: (true, None) => track.start_at(0) replaces the dead largest.map_or(0, …), applying the earlier suggestion unchanged. Behavior is identical.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 8c713ec Nov 22, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m1/ietf-oldest-backlog branch November 22, 2026 18:56
kixelated added a commit that referenced this pull request Nov 23, 2026
Ports main's mid-group ends (#9402), answered joins past the end (#9311), the ietf
Oldest start (#9405), and the kept-out reask (#9435) onto per-range Live max ages.
Main's tests that leaned on a subscription-wide delay take a Live range now; two
that relied on a history range expiring let the replaced route fail instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant