Repository navigation
Conversation
Frando
force-pushed
the
Frando/send-groups
branch
from
November 14, 2026 08:19
007be94 to
59369d6
Compare
moq-transport-iroh returned no send groups, so moq-net ranked every group stream of a session in one queue, where the older of two equal-priority subscriptions goes first. Under a held bandwidth cap a rendition switch never landed: the replacement's first group waited behind the incumbent's backlog, which never drained. `Transport::send_group` now returns a `SendGroup`. iroh schedules a stream by an i32 priority, so the group priority and each stream's dense rank by order within its group are packed into it (group * 16 + 15 - tier), with ungrouped streams at 2^29 and up, above every group. The heads of equal-priority groups share one priority, and noq sends streams of one priority round robin while send fairness is on, its default, so they share the bytes. A group's older streams wait for its head, and a higher group outranks every tier of a lower one. A stream joining, leaving or moving reranks its group, which reaches the other streams through a shared handle. Unlike moq-quic's deficit round robin, fairness is per stream and only within a tier: a group whose head is idle does not hand its share to its backlog. With send fairness turned off the older group goes first again; RFC 9218's incremental flag, which n0-computer/noq#859 adds, would remove that dependency. `a_switch_lands_while_the_link_stays_capped` is no longer ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frando
force-pushed
the
Frando/send-groups
branch
from
November 16, 2026 11:12
59369d6 to
cf14b6d
Compare
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.
Stacked on #94 and mergeable after it. It no longer depends on noq: it builds against stock noq 1.4, and
cargo tree -i noq-protoshows 1.4.0. Still a draft.Problem
moq-transport-irohreturned no send groups, so moq-net ranked every group stream of a session in one queue, where the older of two equal-priority subscriptions goes first. On a capped link a pinned rendition switch never landed: the replacement's first group, its keyframe, waited behind the incumbent's backlog, which never drained.a_switch_lands_while_the_link_stays_cappedwas ignored for this reason.Approach
Transport::send_groupnow returns aSendGroup. moq-net opens one per subscription, and expects a higher group to preempt lower ones, equal groups to share the bytes, streams inside a group to go in their own order, and ungrouped (control) streams to go first. moq-quic does this with deficit round robin. noq has one level, ani32priority per stream, so the two levels are packed into it:p2^29 + pg, tiert16 * g + (15 - t)The tier is the stream's dense rank by order within its group, capped at 15. The heads of equal-priority groups therefore share one priority, and noq sends streams of one priority round robin while send fairness is on, which is its default. So equal groups split the bytes, a group's older streams wait for its head, and a higher group outranks every tier of a lower one. Joining, leaving or reordering a stream reranks its group through a shared handle to each member's noq stream.
This differs from moq-quic in one way: fairness is per stream and only within a tier, so a group whose head is idle does not pass its share to its backlog. For live media that drops the backlog first, which the newest-first order wants anyway. Datagrams ignore their group, since noq queues them apart from streams.
The sharing relies on send fairness. An endpoint that sets
send_fairness(false)in itsQuicTransportConfigwould get streams of one priority in write order, and the older group would go first again. RFC 9218's per-stream incremental flag removes that dependency. It is in n0-computer/noq#859, and #97 sets it on top of this PR.Evidence
a_switch_lands_while_the_link_stays_capped, un-ignored, on stock noq 1.4: 7 of 7 runs pass (6 on their own plus one in the full suite, 6 to 11 s each). Before this change, withsend_groupreturningNone, 0 of 6 tries passed, and each timed out after 60 s still onhigh.moq-transport-irohcover the priority mapping and reranking (groups_rank_their_streams_in_tiers), plus a data test whose flow-control windows exceed the payload. Inequal_priority_groups_progress_together, two equal-priority groups whose streams have orders 1000 and 0 interleave on stock noq: it passed 6 of 6 runs. The control testungrouped_streams_drain_in_ordersends the same streams ungrouped and confirms that they drain one after the other.cargo make check-all(clippy-D warningsand the configured fmt check included),cargo fmt --check,cargo nextest run --workspace --all-features(656 passed), doctests, the full patchbay suite with--run-ignored all(8 of 8, under the measure lock) andscripts/check-links.pyall pass.Follow-ups
send_fairness(false). It patches noq to feat: add per-stream incremental scheduling noq#859 and should be merged once that is released.Rebased onto #94 at
aa6de124(the moq bump toe8075629a, which addsOffsetto the send-stream trait, and the layout and endpoint moves). After the rebase:cargo make check-alland the 21 tests of moq-transport-iroh pass, anda_switch_lands_while_the_link_stays_cappedpasses 3 of 3 runs (7 to 10 s each).🤖 Generated with Claude Code