Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a62b26d
quest: claim quest/m1/quic/fork/switch
kixelated Oct 16, 2026
590d323
feat(moq-tokio): import quinn's async layer and web-transport-moq ver…
kixelated Oct 16, 2026
e8195bd
feat(quic)!: run moq-tokio and moq-uring on moq-quic
kixelated Oct 16, 2026
866b13d
fix(moq-tokio): log a CONNECT stream cut off by the close at debug
kixelated Oct 16, 2026
88a6fae
docs: point fork and advisory guidance at moq-quic
kixelated Oct 16, 2026
2d50267
docs: format the upgrade note
kixelated Oct 16, 2026
c2993ca
quest: finish quest/m1/quic/fork/switch
kixelated Oct 16, 2026
fcd8ea4
Merge origin/main into quest/m1/quic/fork/switch
kixelated Oct 16, 2026
c193155
quest: claim quest/m1/quic/reliable-reset
kixelated Oct 16, 2026
a13889e
feat(quic): implement RESET_STREAM_AT
kixelated Oct 16, 2026
29cc077
feat(quic): keep the WebTransport header across a stream reset
kixelated Oct 16, 2026
f26d51b
quest: drop the fork blocker from reliable-reset
kixelated Oct 16, 2026
b78cacc
docs(moq-quic): list RESET_STREAM_AT as a carried change
kixelated Oct 16, 2026
e111abf
test(moq-tokio): gate the timed helper with its only caller
kixelated Oct 16, 2026
5b7bff2
Merge origin/main into quest/m1/quic/fork/switch
kixelated Oct 16, 2026
43193f9
Merge remote-tracking branch 'origin/main' into quest-switch-alias
kixelated Oct 16, 2026
1d476d5
style(quic): format the reliable reset changes
kixelated Oct 16, 2026
188b08c
fix(tokio): mark quic::web and quic::driver error enums non_exhaustive
kixelated Oct 16, 2026
5d21b4f
fix(tokio): count in-flight accepts in wait_all_draining
kixelated Oct 16, 2026
21cac2b
fix(tokio): wake draining waiters when accept empties the queue
kixelated Oct 16, 2026
c1f4cfd
fix(tokio): surface non-WouldBlock receive errors, cap moq_quic logs
kixelated Oct 16, 2026
a9d2ed4
Merge remote-tracking branch 'origin/quest/m1/quic/fork/switch' into …
kixelated Oct 16, 2026
a58f2e1
feat(quic)!: reset from a send-stream checkpoint
kixelated Oct 16, 2026
91b50a5
quest: split the MoQ half of reliable reset into group-reset
kixelated Oct 16, 2026
947d62a
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
93e1f48
feat(quic)!: hold a plain reset until the checkpoint is acked
kixelated Oct 16, 2026
920f037
style(quic): rustfmt
kixelated Oct 16, 2026
644058f
fix(quic): STOP_SENDING drops the prefix of a RESET_STREAM_AT too
kixelated Oct 16, 2026
d88372a
fix(uring): write the WebTransport header before handing out a stream
kixelated Oct 16, 2026
650ed77
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
76d461a
test(uring): let the client close after it sees the reset
kixelated Oct 16, 2026
a15dd7f
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
192180a
fix(quic): retire a reset only on an ACK of its current Reliable Size
kixelated Oct 16, 2026
3471f5d
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
714febd
fix(quic): count a reset acked only at its current Reliable Size
kixelated Oct 16, 2026
14731f6
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
074ca6f
fix(quic): a checkpoint from rejected 0-RTT stays closed
kixelated Oct 16, 2026
026ba74
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
20967bd
Merge branch 'main' of github.com:moq-dev/moq into quest/m1/quic/reli…
kixelated Oct 16, 2026
d953fa1
fix(quic): a checkpoint panics on another connection
kixelated Oct 16, 2026
c620fac
test(quic): use two pairs for the cross-connection checkpoint test
kixelated Oct 16, 2026
45cf6eb
Merge remote-tracking branch 'origin/main' into quest/m1/quic/reliabl…
kixelated Oct 16, 2026
56aa1b0
Merge branch 'main' of github.com:moq-dev/moq into quest/m1/quic/reli…
kixelated Oct 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions quest/m1/quic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ cache limits remain separate; bitrate pacing composes with this memory cap.
## Required

- [Bound message assembly](/quest/m1/quic/receive-memory.md) - complete headers and frames return credit, and receiver priority cancellation restores progress
- [Reliable stream reset](/quest/m1/quic/reliable-reset.md) - `RESET_STREAM_AT`,
so a reset WebTransport stream still delivers its header
- [A reset group keeps its header](/quest/m1/quic/group-reset.md) - a lite
publisher resets a group with `RESET_STREAM_AT`, so its subscriber drops the
tail grace
- [Hierarchical stream scheduling](/quest/m1/quic/scheduler.md) - strict
subscription priority, fair buckets, and newest-first group order replace
the lossy scalar; retransmits follow the same order
Expand Down
64 changes: 64 additions & 0 deletions quest/m1/quic/group-reset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# [M] A reset group keeps its header

## Goal

A moq-lite publisher on a native QUIC or WebTransport stack resets a group
stream with `RESET_STREAM_AT`, still delivering the group header, so the
subscriber can always tell which group the reset belongs to. A subscriber
that knows its publisher does this stops waiting out the tail grace for
groups whose reset lost the header (`rs/moq-net/src/tail.rs`,
`js/net/src/tail.ts`). Subscribers whose publisher cannot do it, such as a
browser, keep the grace.

## Plan

Split from the transport half, which landed in `moq-quic`,
`moq_tokio::quic::web`, and moq-uring's WebTransport adapter (#5690). There,
`SendStream::checkpoint()` marks the data written so far and
`Checkpoint::reset(code)` sends `RESET_STREAM_AT` with that offset as the
Reliable Size. A peer without the extension instead gets a plain
`RESET_STREAM` once it has acknowledged the data before the checkpoint, a round
trip later. The WebTransport adapters already keep their own stream header
this way.

That fallback is weaker than it looks. An ACK only means the peer's QUIC stack
holds the bytes, not that its application read them, and RFC 9000 lets a
receiver discard unread data on `RESET_STREAM`. The WebTransport header
survives because receiving stacks parse it on arrival. A MoQ group header is
read by the application, so check whether Chrome hands it to JS when a plain
`RESET_STREAM` follows the ACK, and treat a peer without `reset_stream_at` as
unable to keep the header unless it does.

- Give moq-net's `transport::poll::SendStream` a reset that keeps a
checkpoint, using `Checkpoint` rather than a byte count, so a size past the
written data cannot be asked for. Implement it in the moq-tokio and
moq-uring adapters. Backends that cannot do it (browser, qmux, iroh) report
that rather than silently sending a plain reset.
- The lite publisher checkpoints right after writing a group header and
resets the group from that checkpoint.
- QUIC negotiation alone cannot drop the grace. A peer's stack can advertise
`reset_stream_at` while its application never sends one, as a browser
publisher whose WebTransport API has no reliable reset. Dropping the grace
on negotiation would hang the tail. So the publisher declares it with a
MoQ-level signal, per session, since each relay hop re-serves groups on its
own streams. Open: the signal's shape (a SETUP parameter or a version
feature), and how it composes with SUBSCRIBE_DROP, which already names a
group reset before its header on lite-05 and later. Any wire change updates
`drafts/draft-lcurley-moq-lite.md`.
- Remove the grace for subscriptions on sessions that declare it, in Rust and
`@moq/net`. Datagram holes still wait out the grace.

Test a group reset before any payload with and without the signal, both
directions between Rust and `@moq/net`, and through a relay hop. Cover it in
the Chrome wasm harness and the native interop matrix, which the transport
half did not reach.

## Related

- [SUBSCRIBE_DROP accounts for every group](/quest/m1/subscribe-drop.md) - a
DROP covers a reset whose header was lost; a reset that keeps its header acts
as a one-group drop
- [Per-stream ACK progress](/quest/m2/quic-ack-progress.md) - adds
`Checkpoint::acked()` to the same handle
- [qmux on the QUIC stream state machine](/quest/m2/quic-qmux.md) - qmux reuses
`moq-quic`'s reset state
74 changes: 0 additions & 74 deletions quest/m1/quic/reliable-reset.md

This file was deleted.

2 changes: 1 addition & 1 deletion quest/m1/subscribe-drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Decided:
- lite-07 restores SUBSCRIBE_DROP and removes `Stream Count`. With every
sequence accounted for, the count is redundant; one mechanism instead of two.
A reset whose header may be lost is covered by a DROP.
- A reliable reset ([Reliable stream reset](/quest/m1/quic/reliable-reset.md))
- A reliable reset ([A reset group keeps its header](/quest/m1/quic/group-reset.md))
that keeps the stream header acts as a one-group drop, an optimization over
sending the DROP.
- Publishers send SUBSCRIBE_DROP on lite-05 and lite-06 too: for every group
Expand Down
4 changes: 4 additions & 0 deletions quest/m2/quic-ack-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ stream teardown: the accessor must not return a prefix that includes bytes the
peer will never acknowledge, and a waiter for an offset beyond the final
size must resolve with the reset instead of hanging.

Decided 2026-10-16 (maintainer, #5690): the waiter is `Checkpoint::acked()`
on the send-stream checkpoint that `RESET_STREAM_AT` already uses, so an
acknowledged offset is named the same way a reliable reset's is.

The `web-transport-moq` half of [the ACK hook](/quest/m2/quic-ack-hook.md)
is in-tree too and can land in the same PR.

Expand Down
6 changes: 2 additions & 4 deletions quest/m2/quic-qmux.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ receive-offset accessor, frame-iterator access, and limited datagram helper
visibility. Review each exposure as a reusable internal boundary rather than
making the whole QUIC connection public.

`RESET_STREAM_AT` is a QUIC extension, not a qmux-specific frame. Once the
reliable-reset quest lands, make qmux drive that shared send and receive state
`RESET_STREAM_AT` is a QUIC extension, not a qmux-specific frame, and
`moq-quic` now implements it (#5690). Make qmux drive that shared send and receive state
instead of retaining the prototype's local parsing and transitions. Because
qmux runs over a reliable ordered transport, serialization acknowledges the
committed prefix immediately, but the receiver must still delay the reset
Expand Down Expand Up @@ -78,8 +78,6 @@ the fork plan the same day kept it there.

## Required

- [Reliable stream reset](/quest/m1/quic/reliable-reset.md) - qmux reuses the
extension's stream state rather than implementing reset locally
- [Hierarchical stream scheduling](/quest/m1/quic/scheduler.md) - qmux must
expose the same scheduling contract as native QUIC

Expand Down
1 change: 1 addition & 0 deletions rs/moq-quic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Changes on top of the upstream commit, besides the renames:
- `TransportConfig::handshake_idle_timeout` (default 10s, as msquic's `HandshakeIdleTimeoutMs`) governs the idle timer until the handshake completes, and the negotiated idle timeout takes over once established. A 2s idle timeout otherwise expires 3x the initial PTO in, just before the second Initial probe, leaving a client two flights. A server also drops an Initial left waiting for `accept` past it, and a deadline too far out to represent never fires instead of panicking. Also [moq-dev/noq#34](https://github.com/moq-dev/noq/pull/34), whose third change (the handshake idle timeout picks noq's idle-based PTO interval cap) has nothing to apply to here, since quinn's PTO backoff has no such cap.
quinn's `handshake_timeout` test in its async layer expects the handshake to end at the idle timeout, so the driver's copy sets both timeouts.
- **Instants on [moq-clock](../moq-clock)**: the crate's `Instant` is `moq_clock::Instant`, so one clock steps every timer, tokio's paused clock and the simulator included. qlog stamps events relative to `QlogConfig::start_time` on that clock rather than the streamer's own `std::time::Instant`.
- **`RESET_STREAM_AT`** ([draft-ietf-quic-reliable-stream-reset](https://datatracker.ietf.org/doc/draft-ietf-quic-reliable-stream-reset/)): the `reset_stream_at` transport parameter is always advertised, `Checkpoint::reset` (from `SendStream::checkpoint`) keeps the data written before the checkpoint reliable, holding a plain `RESET_STREAM` until that data is acknowledged when the peer lacks the extension, and a received reset surfaces only once the reliable prefix has been read. Stopping a stream after it was reset no longer credits its unread data twice.
- **Draining endpoint event**: `EndpointEvent::is_draining` fires once per connection when it stops being active, before the drained event, so the driver's `Endpoint::wait_all_draining` can end a shutdown without sitting out every closing period.

Recheck the BBR3 changes when cherry-picking quinn#2481 updates, or if it merges.
Expand Down
12 changes: 12 additions & 0 deletions rs/moq-quic/src/config/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub struct TransportConfig {
pub(crate) allow_spin: bool,
pub(crate) datagram_receive_buffer_size: Option<usize>,
pub(crate) datagram_send_buffer_size: usize,
/// Advertise and accept RESET_STREAM_AT; only tests turn it off
pub(crate) reset_stream_at: bool,
#[cfg(test)]
pub(crate) deterministic_packet_numbers: bool,

Expand Down Expand Up @@ -332,6 +334,13 @@ impl TransportConfig {
self
}

/// Whether to advertise support for receiving RESET_STREAM_AT
#[cfg(test)]
pub(crate) fn reset_stream_at(&mut self, enabled: bool) -> &mut Self {
self.reset_stream_at = enabled;
self
}

/// Whether to force every packet number to be used
///
/// By default, packet numbers are occasionally skipped to ensure peers aren't ACKing packets
Expand Down Expand Up @@ -419,6 +428,7 @@ impl Default for TransportConfig {
allow_spin: true,
datagram_receive_buffer_size: Some(STREAM_RWND as usize),
datagram_send_buffer_size: 1024 * 1024,
reset_stream_at: true,
#[cfg(test)]
deterministic_packet_numbers: false,

Expand Down Expand Up @@ -457,6 +467,7 @@ impl fmt::Debug for TransportConfig {
allow_spin,
datagram_receive_buffer_size,
datagram_send_buffer_size,
reset_stream_at,
#[cfg(test)]
deterministic_packet_numbers: _,
congestion_controller_factory: _,
Expand Down Expand Up @@ -494,6 +505,7 @@ impl fmt::Debug for TransportConfig {
.field("allow_spin", allow_spin)
.field("datagram_receive_buffer_size", datagram_receive_buffer_size)
.field("datagram_send_buffer_size", datagram_send_buffer_size)
.field("reset_stream_at", reset_stream_at)
// congestion_controller_factory not debug
.field("enable_segmentation_offload", enable_segmentation_offload);
if cfg!(feature = "qlog") {
Expand Down
72 changes: 72 additions & 0 deletions rs/moq-quic/src/connection/assembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,40 @@ impl Assembler {
self.bytes_read
}

/// Number of bytes before `end` the application has yet to read, received or not
pub(super) fn unread_before(&self, end: u64) -> u64 {
let State::Unordered { recvd } = &self.state else {
return end.saturating_sub(self.bytes_read);
};
// Unordered reads leave holes, so count what was received and not yet handed out
let clip = |range: std::ops::Range<u64>| range.end.min(end).saturating_sub(range.start);
let received: u64 = recvd.iter().map(clip).sum();
let buffered: u64 = self
.data
.iter()
.map(|buffer| clip(buffer.offset..buffer.end()))
.sum();
end - received + buffered
}

/// Discard buffered data at or past `end`
pub(super) fn truncate(&mut self, end: u64) {
let (mut buffered, mut allocated) = (self.buffered, self.allocated);
self.data.retain_mut(|buffer| {
if buffer.offset >= end {
buffered -= buffer.bytes.len();
allocated -= buffer.allocation_size;
return false;
}
let excess = buffer.end().saturating_sub(end) as usize;
buffer.bytes.truncate(buffer.bytes.len() - excess);
buffered -= excess;
true
});
self.buffered = buffered;
self.allocated = allocated;
}

/// Discard all buffered data
pub(super) fn clear(&mut self) {
self.data.clear();
Expand Down Expand Up @@ -937,6 +971,44 @@ mod test {
assert_eq!(&got[..], b"abcdefghij");
}

#[test]
fn truncate_ordered() {
let mut x = Assembler::new();
x.insert(0, Bytes::from_static(b"abc"), 3).unwrap();
x.insert(2, Bytes::from_static(b"cdefg"), 5).unwrap();
x.insert(6, Bytes::from_static(b"gh"), 2).unwrap();
assert_eq!(next(&mut x, 2), Some(Bytes::from_static(b"ab")));
assert_eq!(x.unread_before(5), 3);
x.truncate(5);
assert_sorted(&x);
assert_eq!(x.buffered, 4);
assert_eq!(next(&mut x, usize::MAX), Some(Bytes::from_static(b"cde")));
assert_eq!(next(&mut x, usize::MAX), None);
assert_eq!(x.unread_before(5), 0);
assert_eq!(x.unread_before(9), 4);
}

#[test]
fn truncate_unordered() {
let mut x = Assembler::new();
x.ensure_ordering(false).unwrap();
x.insert(4, Bytes::from_static(b"efgh"), 4).unwrap();
x.insert(0, Bytes::from_static(b"a"), 1).unwrap();
assert_eq!(
next_unordered(&mut x),
Chunk::new(0, Bytes::from_static(b"a"))
);
// 1..4 was never received, and 4..6 is buffered
assert_eq!(x.unread_before(6), 5);
x.truncate(6);
assert_eq!(
next_unordered(&mut x),
Chunk::new(4, Bytes::from_static(b"ef"))
);
assert_eq!(x.unread_before(6), 3);
assert_eq!(x.read(usize::MAX, false), None);
}

fn next_unordered(x: &mut Assembler) -> Chunk {
x.read(usize::MAX, false).unwrap()
}
Expand Down
Loading
Loading