Repository navigation
feat(net)!: a live join is a range's Live start, asked upstream per join - #9316
Conversation
Quest-Claim: fdffed9a36272526
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moq-net moved a live join's lag from Delay::min into Range::start
(Start::Live). moq-mux gains container::Delay { min, max } as the media
playout delay; Delay::subscription and Playout::subscription turn each
Start::Oldest range into Start::Live(min) when min is stated. moq-audio
and moq-video re-export it as decode::Delay. Exporters take it.
moq-ffi and libmoq keep MoqDelay/moq_delay and MoqRange/moq_range,
mapping delay.min onto each range with no start at the conversion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors the Rust moq-net change into js/net and its users.
- Track.Range takes `start?: Start`, where `Start = bigint | { live: Duration }`; the lag rounds
up to whole milliseconds. Track.Delay keeps only `max`.
- lite-07 carries a live start as Anchor type 3 (milliseconds, start only); SUBSCRIBE and
SUBSCRIBE_UPDATE drop Subscriber Min Age.
- A received lite-07 copy places a live join only from its upstream's answer to that (lag, end),
recorded after the reader began waiting and under a budget at least as wide. Readers asking the
same join share one pending range; the session forwards each as its own Live range.
- @moq/hang adds its own playout `Container.Delay { min, max }` and `Container.subscribed()`,
which turns each range from the oldest group into a live join `min` back. watch, json and
publish build their subscriptions through it or directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A replaced range resolves again, so rewriting a live join's lag from set_delay re-placed a start the reader had already subscribed. The old Delay::min update never moved a resolved range either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…only A lite-07 copy places a reader's Live(min) range only from its upstream's answer recorded since the range was added; IETF and lite-06 copies measure joins locally. A range an update adds below where delivery started lowers the start it reports from, so a deeper live join is not clamped to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heir range was added Mirrors the Rust follow-up: - joinsLive is back to an open range with no time start, so a default subscribe asks for a refresh again; the refresh tests subscribe plainly as before. - A copy places a live join only from its upstream's answer when its session marks it (`hooks.answersJoins`, lite-07 ranges). Another wire copy (lite-06, IETF) measures the join from the groups it holds as before, minus where the feed starts. - The join tick lives in the demand (`Subscriptions.joinTick`, bumped by `answered`). Prefs record it per live join range when the range is added, and the window takes each range's `since` from there; the front's preview takes the current tick. - The range table counts an empty warm delivery as answered alone only if the read ended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t added the range The join tick is counted process-wide, and a front stamps each copy it asks with the tick its reader added the range at, so a copy subscribed after its upstream answered still places the join that asked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tart Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y started Another added range, such as a fill, still starts no earlier than delivery. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lite-07 draft adds the Live start anchor (0x3) carrying Min Age, drops Subscriber Min Age from SUBSCRIBE and SUBSCRIBE_UPDATE, and states how a relay copy places each join from its upstream's answer. The quest is complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… added the range Mirrors cb8b20a. The join tick is counted process-wide (`joinTick` and `answered` in demand.ts), so a front's reader and the copies it reads compare ticks. A front stamps each copy it asks with the tick its reader added each live range at (`Prefs.stamp`, through `hooks.stampSubscriber`), on a new copy and on each update, so a copy subscribed after its upstream answered still places the join from that answer instead of asking again. A stamp places again only joins still waiting; one already placed stays where it started. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…stop asking once ended - A reader asking one join with several ranges counts it once in the demand, so retiring the ranges leaves nothing asked (Rust and JS). - A front notes its reader's tick on a ready copy before the copy's window places the edit, so an answer recorded since still places it. - A JS copy whose end is declared places a live join from its groups, as Rust. - js/watch keeps the ranges it first subscribed and updates only the max delay, so an adaptive min never places the join again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sks-upstream # Conflicts: # rs/moq-cli/src/play/media.rs
|
Maintainer decision (2026-11-21):
(Written by Claude Opus 5.5) |
|
Answers the maintainer decision: this PR lands as is. The Max Age follow-up is planned as its own quest. (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
Important
A lite-07 relay copy can leave a reader's live join waiting with no ask in flight. Separately, a binding update that changes delay.min now places the join again. Details are inline.
Approach: Sound. Making a live join its own Start::Live range lets a relay copy ask upstream for each join exactly, and it deletes the feed_start inference that kept losing information. It implements the maintainer's recorded decision, and lite-07 stays -wip and off by default (rs/moq-net/src/version.rs:271), so changing the wire is fine.
Reviewed changes
I reviewed the full diff at 1143197. Separate passes covered relay join placement, Rust/JS parity, and downstream media-delay users.
- Wire (lite-07-wip): a new Live anchor
0x3carries the lag in milliseconds, rounded up. It is a start only and is refused as an end.Subscriber Min Ageis removed. Older wires send a Live start as no start. - Model:
Range::startis nowStart { Oldest, Time, Live }, andDelaykeeps onlymax. The demand keeps each Live range by its value. Fit/collapse merges Live ranges intoLive(max). - Relay copy: a reader's join is placed only from
join_answers[(min, end)], using an answer whose tick is newer than the reader'ssinceand whose budget is at least as wide.join_probesasks for joins that no live range answers. A front stamps its copies with the reader's tick. - Publisher: an added live join reports its own start, even below where delivery started, and lowers the delivery start.
- Downstream:
moq_mux::container::Delay { min, max }andDelay::subscriptionturnOldestranges intoLive(min). moq-ffi and libmoq keepMoqDelay.min. js/hang, js/watch, js/publish and js/json mirror this.
claude-opus-5-5 | 𝕏
|
quest land watch: ended this pull request's pick, disarming its auto-merge, since its head 1143197 is held by finding by pullfrog[bot]: (written by quest land watch) |
|
quest land watch: the merge queue removed this pull request at 0820109 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) |
|
quest land watch: Another session holds this pull request, so the watcher stops acting on it and leaves it to that session: the hold ends the pick, and a maintainer enqueues it again once that session is done. (written by quest land watch) |
…sks-upstream # Conflicts: # rs/moq-net/src/lite/subscriber.rs
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This review covers 47af657, a merge of main since the prior review at 0820109. It doesn't change how the PR behaves.
- Resolved the
lite/subscriber.rsconflict:mainmovedSUBSCRIBE_STARTEDhandling intoServeLoop::record_started, which records a burst of STARTED messages and then runsreport_starts/declareonce. The resolution keeps that structure and dropsactive.mins.insert(id, active.min_delay), because this PR removedmin_delay. Batching only movesanswer_jointo after the burst. That is still later than each reader'ssincetick, so join placement doesn't change. - Merged the rest of
mainwithout conflicts: theietf/publisher.rschange (#9374) doesn't touchlive_join.cargo check -p moq-net --all-features --testspasses at47af657.
claude-opus-5-5 | 𝕏
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A TS export subscribed each live track with `Live { min: delay }`, so the
relay sent up to two groups of history that the export's newest-group reader
then skipped. Since #9316 forwards that join upstream exactly, on a congested
path the backlog delayed the newest keyframe by a group, and the scheduled
`TS congested path` step started a group late, its audio one frame past the
3 s join. A live-start `ExportSource` now joins with a zero min; a replay
still reaches back the whole delay, and the max still bounds every group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

A lite-07 live join is now its own range start,
Live(min_age), so a relay copy asks upstream for each reader's join exactly and takes that range's answer, with no inference.Maintainer decision (comment), recorded here because this PR completes and deletes the quest: Decided 2026-11-21 (maintainer, /quest-complete): a new lite-07
StartvariantLive(min_age)joins at the Group holding the live edge minusmin_age. It replacesStartNone plus the subscription-levelSubscriber Min Age, which SUBSCRIBE and SUBSCRIBE_UPDATE no longer carry. AStartof None now only reaches back as far asSubscriber Max Ageallows. This is lite-07-wip only: lite-05/06 and moq-transport keep their encodings, and moq-net maps to them. Multiple Ranges per subscription stay. Rejected: a per-range Min Age field beside Start, keeping the subscription Min Age with an edge probe, and keeping the inference.Changes
0x3, a start only, carrying Min Age in milliseconds rounded up.Subscriber Min Ageis removed from SUBSCRIBE and SUBSCRIBE_UPDATE.doc/concept/moq-lite.md.track::StartisOldest | Time(u64) | Live(Duration), andtrack::Delaykeeps onlymax.Live(min)..endrange and places that reader's join only from an answer to the same(min, end).JoinStart, itsPastbound andfeed_start(js/net#joinFed) are removed.moq_mux::container::Delay { min, max }.Delay::subscriptionturnsOldestranges intoLive(min)when a min is stated.MoqDelay.minand map it the same way, so the binding API is unchanged.Impact
Breaking public API (Rust
moq-net,moq-mux, JS@moq/net,@moq/hang) and the lite-07-wip wire.Migration:
moq-nettrack::Range::startis atrack::Start, no longer anOption<u64>:NonebecomesStart::Oldest, andSome(t)becomesStart::Time(t).Range::from(Start::Live(lag)). Previously it was a range with no start plusDelay::min.Delay::min/with_minare gone. Put the lag on the range instead.moq-mux,moq-audio,moq-video)moq_mux::container::Delay(re-exported asdecode::Delay), which keepsminandmax.Delay::subscription(sub)applies it to a subscription.@moq/netstart(Track.Start) is a time (bigint),{ live: Duration }for a live join, or absent for the oldest group.Delay.minis gone. A JSON-encoded start uses{live: number}.@moq/hangContainer.Delaycarries the media min and max.Container.subscribedbuilds the subscription.MoqDelay.minstill joins that far behind the live edge.Decisions
These are my calls; a review can undo any of them:
MoqDelay.minconvenience. It maps ontoOldestranges asLive(min)rather than exposing a per-range start type. This keeps the binding API stable until a binding user needs several lags.wire_boundstreats any non-empty range other thanOldestas asking a join.Container.DelayandContainer.subscribedfor the media min, mirroring moq-mux.Consumer::set_delaykeep the ranges first subscribed. A changed min would otherwise place the live join again and skip buffered media.Validation
cargo nextest run --workspace --all-features: 13195 passed, after merging main.cargo nextest run -p moq-net --all-features4220 passed, js/net 3594 passed,just checkpassed.#settled(), lazily, only in the fallback), not by the outcome latch: js/net 3595 passed,just checkpassed.just checkrun timed out 4 moq-hlsexport::testsat 60s. They passed alone in 0.25s, and a fulljust checkrerun passed, so I couldn't reproduce it.just test interop --all: all checks passed.Follow-ups
Models
Size: L
Implementer: Claude Code, claude-opus-5-5, high effort
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, M)
(Written by Claude Opus 5.5 with high)
🤖 Generated with Claude Code
Review
Rewritten by
quest reviewafter each round.Head: 47af657
Base: origin/main at ca42dc4
Risk: high,
The change rewrites shipped moq-net and js/net internals and changes the public API surface (js/net/api/index.api.md and js/hang/api/container.api.md are updated, and the lite version modules rs/moq-net/src/lite/version.rs and js/net/src/lite/version.ts are deleted), so a published Rust or JS consumer or a deployed peer speaking the lite wire protocol could break, and reverting it would mean redoing a large multi-package change.Classified: high by Claude Code, claude-haiku-5-5, low effort, session
17dffd25-13a3-449d-8054-5869cf9fd56aReviewer: Codex, gpt-6.1-sol, high effort
Session:
01a200d3-c0bd-71b1-84aa-c712ace76bc2, round 9Score: 10/10,
Source review found no new issues in the merge resolutions for batched join answers and probe accounting; builds and tests were not run.Rounds: 14; first round 2 (medium 2); findings 8 (high 2, medium 6): fixed 8, refuted 0, open 0
Findings: none