Repository navigation
quest(m1): plan the group order follow-ups #5400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1f41d02
2fbe812
d6106bb
0f24823
750f1db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # [S] moq-transport FETCH and fill streams in the session queue | ||
|
|
||
| ## Goal | ||
|
|
||
| Under congestion, a moq-transport FETCH or fill stream competes with the | ||
| session's group streams through the same priority queue: a fill as the group | ||
| it fills, a standalone FETCH by its subscriber priority. Today the Rust | ||
| moq-transport publisher gives these streams the raw subscriber priority as | ||
| their send order, mixing an absolute priority with the queue's relative ranks | ||
| (send order `255 - rank`), so how they compare with group streams is | ||
| arbitrary. | ||
|
|
||
| ## Plan | ||
|
|
||
| Where it stands after #5385 (`rs/moq-net/src/ietf/publisher.rs`): | ||
|
|
||
| - Group streams take a `Rank` from the session `PriorityQueue` through | ||
| `TrackServe::rank(sequence)`, keyed by the subscription's request id and | ||
| ordered by its `Order`. | ||
| - `run_fill` calls `stream.set_priority(priority)` with the raw subscriber | ||
| priority, and so does the FETCH stream in `run_fetch_stream`. | ||
|
|
||
| The work: | ||
|
|
||
| - A draft-20 fill joins its subscription's ranking as the group it fills, | ||
| the way JS already ranks it (`js/net/src/ietf/publisher.ts`, `#runFill`). | ||
| A joining FETCH, used before draft-20, ranks the same way within the | ||
| subscription it joins. | ||
| - A standalone FETCH gets its own queue entry, keyed by its own request id. | ||
| `Priority::cmp` compares that id before order or group, so the FETCH ranks | ||
| against group streams by subscriber priority alone, with the id breaking | ||
| ties. Its group and GROUP_ORDER do not affect the rank. It follows | ||
| priority changes the way a group stream's `Rank` does. | ||
| - JS parity (decided 2026-10-13 in #5400). JS already ranks its fill through | ||
| the subscription's `Priority`. It serves no standalone FETCH: `runFetch` | ||
| (`js/net/src/ietf/publisher.ts`) refuses every one. So JS has nothing to | ||
| change now, and any FETCH serving it gains later ranks through the same | ||
| `Priority`. | ||
| - Keep each stream ranked until it settles, not just until its FIN is | ||
| written (the #5385 review fix for JS group streams). | ||
| - Tests, on mock time, in Rust: a fill and a FETCH stream ranked against open | ||
| group streams of the same and a different priority, asserting | ||
| the recorded send orders the way `group_stream_preserves_model_priority` | ||
| does. | ||
|
|
||
| This is unblocked and lands before [moq-transport ranges](/quest/m1/subscribe-ranges/ietf.md), | ||
| which makes a FETCH span several groups on one stream that keeps this one | ||
| entry. | ||
|
|
||
| Out of scope: lite FETCH. lite-07 removes it, and published lite versions | ||
| answer FETCH through the range model that [Model ranges](/quest/m1/subscribe-ranges/model.md) | ||
| builds. | ||
|
|
||
| ## Related | ||
|
|
||
| - [Scope and sign track priority](/quest/m1/track-priority-scope.md) - changes what the queue compares across subscriptions | ||
| - [FETCH max-delay](/quest/m1/fetch-max-delay.md) - the same FETCH serving path |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # [S] moq-transport upstream updates | ||
|
|
||
| ## Goal | ||
|
|
||
| A relay's moq-transport upstream subscription follows its downstream | ||
| subscribers: when their aggregate subscriber priority changes, the relay sends | ||
| SUBSCRIBE_UPDATE (drafts 14 and 15) or REQUEST_UPDATE (draft-16 on) with the | ||
| new priority, as lite-07 already does. Today the IETF subscriber reads the | ||
| aggregate once, at SUBSCRIBE (`rs/moq-net/src/ietf/subscriber.rs`, | ||
| `js/net/src/ietf/subscriber.ts`), and never updates the request. | ||
|
|
||
| Group order is not part of this. The upstream order stays whatever SUBSCRIBE | ||
| asked for (decided 2026-10-13 in #5400: updates carry priority only, with no | ||
| re-subscribe and no forced Descending upstream). | ||
|
|
||
| ## Plan | ||
|
|
||
| Researched 2026-10-13 against the published drafts 14 to 22: no moq-transport | ||
| draft lets a subscriber change a subscription's group order. | ||
|
|
||
| - Every draft says the group order of an existing subscription cannot be | ||
| changed (§7.1 in 14 to 20, §5.1.1 in 21 and 22). | ||
| - Draft-14's SUBSCRIBE_UPDATE has no Group Order field. From draft-15 on, | ||
| GROUP_ORDER's list of allowed messages leaves out the update message, and | ||
| draft-22 spells out per request type what a REQUEST_UPDATE may carry. | ||
| - Sending it anyway is ignored on 14 and 15, ambiguous on 16, and a | ||
| PROTOCOL_VIOLATION from draft-17 on. Draft-20 to 22 allow GROUP_ORDER inside | ||
| FILL_PARAMETERS, but that orders a new fill, not the subscription. | ||
| - The only way to change the order is to UNSUBSCRIBE and SUBSCRIBE again with | ||
| a fill or FETCH for the gap. That is not planned: it costs a round trip and | ||
| a gap to change a transmission preference on one leg, and the relay already | ||
| serves each downstream subscriber in its own order. | ||
|
|
||
| What an update can carry, and this quest sends: | ||
|
|
||
| - Subscriber priority, on every draft: a fixed field on draft-14, the | ||
| SUBSCRIBER_PRIORITY parameter after. | ||
| - Draft-14's SUBSCRIBE_UPDATE also requires Start Location and End Group, so a | ||
| priority update repeats the subscription's current bounds rather than | ||
| zeroes, which a conforming peer would read as narrowing to group 0. | ||
| - From draft-15 on, a priority update omits the subscription filter. Today | ||
| `SubscribeUpdate::encode_msg` (`rs/moq-net/src/ietf/subscribe.rs`) always | ||
| writes `Filter::NextObject`, which would reset the filter. | ||
| - Forward stays 1. Pausing is not part of this. | ||
| - The subscription filter is updatable from draft-15 on. Narrowing upstream | ||
| ranges belongs to [moq-transport ranges](/quest/m1/subscribe-ranges/ietf.md), | ||
| which can reuse this update path. | ||
|
|
||
| Implementation: the IETF subscriber watches the aggregate the way | ||
| `lite/subscriber.rs` does (`buffer_update`), sending one update per change | ||
| and coalescing changes while one is in flight. The publisher side already | ||
| applies a priority update to open group streams | ||
| (`subscription_update_reprioritizes_open_group_streams`). The JS publisher on | ||
| drafts 14 to 16 still reads and discards updates, which | ||
| [the legacy updates quest](/quest/m1/ietf-legacy-updates.md) fixes first. | ||
| Test on mock time, | ||
| in Rust and JS, directly and through a relay: a second downstream subscriber | ||
| at a higher priority raises the upstream priority, and leaving lowers it again. | ||
|
|
||
| ## Required | ||
|
|
||
| - [Apply draft 14-16 request updates](/quest/m1/ietf-legacy-updates.md) - the JS publisher applies the priority this sends | ||
|
|
||
| ## Related | ||
|
|
||
| - [Scope and sign track priority](/quest/m1/track-priority-scope.md) - may stop forwarding downstream priority upstream on relay-to-relay links, which changes what this sends | ||
| - [moq-transport FETCH and fill streams in the session queue](/quest/m1/subscribe-ranges/ietf-fetch-queue.md) - the same publisher queue the updated priority lands in | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,17 +18,18 @@ that 127 is the middle of a `u8`. The wire stays a byte. | |
|
|
||
| Where the model stands today, all in `rs/moq-net`: | ||
|
|
||
| - One `PriorityQueue` per moq-lite session (`lite/publisher.rs`), a strict | ||
| global sort over every in-flight group on the connection: a subscription at | ||
| - One `PriorityQueue` per session, shared by the moq-lite and moq-transport | ||
| publishers, a strict global sort over every in-flight group on the | ||
| connection: a subscription at | ||
| priority 200 pre-empts one at 100 indefinitely, and only the top 255 groups | ||
| get a distinct rank. | ||
| - `Priority` already ranks a group by its track priority, then its subscription | ||
| id, then newest group first within that subscription (`lite/priority.rs`). JS | ||
| id, then group within that subscription in its order (`priority.rs`). JS | ||
| packs track priority and the group's position within its own subscription | ||
| into one send order (`js/net/src/lite/priority.ts`), so two tracks at equal | ||
| into one send order (`js/net/src/priority.ts`), so two tracks at equal | ||
| priority interleave rather than one draining first. | ||
| - Group order within a track is fixed newest first today; a subscription-chosen | ||
| order arrives with [Subscribe ranges](/quest/m1/subscribe-ranges/README.md). | ||
| - Group order within a track follows each subscription's `order` (#5385), | ||
| newest first by default. | ||
|
Comment on lines
+31
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This updated current-state description correctly says that #5385 already makes group order follow each subscription, but the same plan later still says to rank newest-first until subscribe ranges adds a direction and still points to the removed AGENTS.md reference: AGENTS.md:L27-L28 Useful? React with 👍 / 👎.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in d6106bb: the later bullet now ranks by (Written by Claude Opus 5.5) |
||
| - A relay forwards the max of its downstream subscriber priorities upstream | ||
| (`model/subscription.rs`, `lite/subscriber.rs`), never the publisher's track | ||
| priority, so one viewer asking for 255 raises that track above every other | ||
|
|
@@ -65,10 +66,10 @@ Direction to settle in the draft first, then the code: | |
| bypasses tenant isolation; settle their carrier beside the subscription one, | ||
| or narrow the goal to subscription delivery. | ||
| - Rank by track priority, then subscription, then the subscription's own group | ||
| order (newest first until subscribe ranges adds a direction). | ||
| order (`Subscription::order`, newest first by default). | ||
| - Decide whether the publisher's `track::Info::priority` breaks a tie | ||
| between equal subscriber priorities in `Priority::cmp` | ||
| (`rs/moq-net/src/lite/priority.rs`). The | ||
| (`rs/moq-net/src/priority.rs`). The | ||
| [ladder controller](/quest/m3/ladder/controller.md), now in m3, wants that | ||
| tiebreak; this quest owns the answer and the code change, so the controller | ||
| only consumes it (2026-10-06 audit). Either way, make the docs agree: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Draft 14 also requires every SUBSCRIBE_UPDATE to carry
Start LocationandEnd Group(SubscribeUpdate::encode_msginrs/moq-net/src/ietf/subscribe.rs), so treating range updates as a draft-15-on concern leaves the priority-only implementation without safe values for those mandatory fields. Placeholder zeroes can narrow a conforming peer to group 0 when aggregate priority changes. Specify how the existing bounds are repeated or otherwise preserved before this quest is implemented.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d6106bb: a draft-14 priority update repeats the subscription's current bounds. From draft-15 on it also omits the filter, because the encoder currently always writes
Filter::NextObject.(Written by Claude Opus 5.5)