moq-lite-05: move immutable track props to a Track Stream (TRACK_INFO)#1609
Open
kixelated wants to merge 1 commit into
Open
moq-lite-05: move immutable track props to a Track Stream (TRACK_INFO)#1609kixelated wants to merge 1 commit into
kixelated wants to merge 1 commit into
Conversation
Replace the per-response publisher metadata in SUBSCRIBE_OK with a dedicated, on-demand Track Stream, per moq-dev/drafts#25. Scoped to the WIP Lite05 version; Lite01-04 keep SUBSCRIBE_OK unchanged. - New Track Stream (0x6): a TRACK request (broadcast path + track name) answered with a single TRACK_INFO carrying the immutable publisher properties (Priority, Ordered, Cache, Timescale, Compression), then a FIN (or reset on error / missing track). - Removed the static props (compression/timescale/cache) from SUBSCRIBE_OK; on Lite05 a subscription is accepted implicitly (rejection is a reset) and the publisher sends nothing on the subscribe stream. - Subscriber flights TRACK and SUBSCRIBE in parallel, so the first group still arrives in one round trip. A pending TrackEntry is inserted before SUBSCRIBE, so group streams that race ahead of TRACK_INFO park on a resolved channel (buffered by QUIC flow control) instead of being dropped. The resolved (producer, compression, timescale) is reused for every group's decode instead of being re-derived per response, and is fetched once for the upstream subscription's lifetime (linger). Publisher resolves TRACK_INFO by subscribing to read the track's .info and dropping the subscription; a parallel SUBSCRIBE coalesces onto the same upstream producer. Priority/Ordered are sent as 0/false for now since the model Track carries no publisher priority/order field yet. Not included (no functional gap in the Rust impl, which never resolves a group range or emits drops): SUBSCRIBE_START/SUBSCRIBE_END and the SUBSCRIBE_DROP renumber. Cross-package sync to js/net and doc/concept is also deferred. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements moq-dev/drafts#25 in
rs/moq-net: move a track's immutable publisher properties out ofSUBSCRIBE_OKand onto a dedicated, on-demand Track Stream. Scoped to the WIPLite05version;Lite01-Lite04keepSUBSCRIBE_OKunchanged, so this is backward-compatible.Why
Priority,Ordered,Cache,Timescale, andCompressionare fixed for a track's lifetime, yet were echoed on everySUBSCRIBE_OK. Fetching them once over their own stream and caching them removes that per-response repetition (and would let group-by-groupFETCHes reuse a single lookup). Keeping them immutable also avoids a relay fan-out problem: a publisher-side change would otherwise have to propagate out to every downstream subscriber.What changed (
rs/moq-net)0x6) (lite/stream.rs,lite/track.rs): aTRACKrequest (broadcast path + track name) answered with a singleTRACK_INFO(Priority,Ordered,Cache,Timescale,Compression), then FIN, or a reset on error / missing track. With roundtrip tests.SUBSCRIBE_OKslimmed (lite/subscribe.rs): the static props are gone. On Lite05 a subscription is accepted implicitly (rejection is a stream reset) and the publisher sends nothing on the subscribe stream.lite/publisher.rs):recv_track/run_track_inforesolve the track's.info(via a short-lived subscribe) and replyTRACK_INFO.run_subscribeno longer sendsSUBSCRIBE_OKon Lite05 but still computes the same compression/timescale for serving.lite/subscriber.rs): flightsTRACKandSUBSCRIBEin parallel, so the first group still arrives in one round trip. A pendingTrackEntryis inserted beforeSUBSCRIBE, so group streams that race ahead ofTRACK_INFOpark on aresolvedchannel (buffered by QUIC flow control) instead of being dropped. The resolved(producer, compression, timescale)is reused for every group's decode and fetched once per upstream-subscription lifetime (linger), rather than re-derived per response.Design notes / open questions
TRACK_INFOby subscribing-and-dropping. In the model, immutable props are only delivered onaccept, so there's no cheap "peek info" path. At an origin this reuses the live producer instantly; at a relay it coalesces with the parallelSUBSCRIBE(linger covers the gap). A dedicatedTrackConsumer::info()would makeTRACKcheaper.Priority/Orderedare sent as0/false. The modelTrackhas no publisher priority/order field yet (the oldSUBSCRIBE_OKechoed the subscriber's priority and hardcodedordered=false), so nothing real is lost. Making them meaningful means adding twoTrackfields (+ catalog/serde + js sync).SUBSCRIBE_START/SUBSCRIBE_ENDand theSUBSCRIBE_DROPrenumber. The Rust impl never resolves a group range or emits drops, so there's no functional gap, only a wire-spec one.Cross-package sync (deferred)
Per the sync table,
rs/moq-netwire changes also needjs/netanddoc/concept. Left out here while we gauge the approach; happy to follow up in this PR.Test plan
cargo test -p moq-net(350 passing) including newTRACK/TRACK_INFOroundtrip testscargo clippy -p moq-net --all-targetscleancargo fmt(pinned nix toolchain)cargo check -p moq-relay -p hang -p moq-cli(downstream still builds)(Written by Claude)