Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9c397c1
quest(m2): claim quic-ack-progress
kixelated Oct 17, 2026
7ec8d9d
feat(quic): report when a checkpoint's data is acknowledged
kixelated Oct 17, 2026
112d157
Merge branch 'main' of github.com:moq-dev/moq into quest/m2/quic-ack-…
kixelated Oct 17, 2026
6981441
Merge branch 'main' of github.com:moq-dev/moq into quest/m2/quic-ack-…
kixelated Oct 17, 2026
ede4d62
docs(quic): migration notes and a checkpoint benchmark
kixelated Oct 17, 2026
4a1d706
fix(quic): checkpoint instants on reordered ACKs and empty resets
kixelated Oct 17, 2026
a867b46
fix(quic): fail checkpoints taken on a stopped or reset stream
kixelated Oct 17, 2026
3da6169
fix(quic): prune dropped checkpoints when taking another
kixelated Oct 17, 2026
98e6cae
fix(quic): subtract the ACK delay only for the largest packet
kixelated Oct 17, 2026
6fc2259
fix(quic): cap the ACK delay after confirming ACK_FREQUENCY
kixelated Oct 17, 2026
64a299b
Merge branch 'main' of github.com:moq-dev/moq into quest/m2/quic-ack-…
kixelated Oct 17, 2026
589321f
Merge remote-tracking branch 'origin/main' into HEAD
kixelated Oct 18, 2026
02826de
fix(quic): resolve a checkpoint at the latest ACK instant below it
kixelated Oct 18, 2026
b54745d
fix(quic): sweep checkpoints replaced before they drop
kixelated Oct 18, 2026
663cea6
fix(quic): time only the bytes an ACK newly covers
kixelated Oct 18, 2026
3a27124
test(quic): a redundant ACK leaves a checkpoint's instant alone
kixelated Oct 18, 2026
00a43a5
docs(quic): list ACK checkpoints as a carried change
kixelated Oct 18, 2026
77cb57d
refactor(quic): make a checkpoint plain data, registering a waiter on…
kixelated Oct 18, 2026
0653c1e
Merge remote-tracking branch 'origin/main' into quest/m2/quic-ack-pro…
kixelated Oct 18, 2026
e2a4a02
refactor(quic)!: replace Checkpoint with byte offsets on SendStream
kixelated Oct 18, 2026
be05f32
Merge remote-tracking branch 'origin/main' into quest/m2/quic-ack-pro…
kixelated Oct 18, 2026
bfc9223
fix(quic): report a waiting offset that a reset or STOP_SENDING fails
kixelated Oct 18, 2026
f58a1c5
fix(quic): wake every acked waiter on a reset or STOP_SENDING
kixelated Oct 18, 2026
c588775
docs(quic): say what SendStream::offset reports after a reset
kixelated Oct 18, 2026
2794e60
docs(quic): format the ACK progress notes
kixelated Oct 18, 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
15 changes: 7 additions & 8 deletions quest/m1/quic/group-reset.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ browser, keep the grace.

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
`SendStream::reset_at(offset, 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.
Expand All @@ -29,9 +28,11 @@ 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
- Give moq-net's `transport::poll::SendStream` a reset that keeps the first
`offset` bytes, matching `moq-quic`'s `reset_at(offset, code)`. Decided
2026-10-17 on #5817: a byte offset rather than a `Checkpoint` handle; an
offset past the written data panics instead of being unrepresentable.
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
Expand All @@ -58,7 +59,5 @@ half did not reach.
- [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
2 changes: 0 additions & 2 deletions quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ ranked just below deterministic TS legs, which it requires.
- [Drop web-transport-trait](/quest/m2/drop-web-transport-trait.md) - every backend implements moq-net's `transport::poll` traits, and the generic `web_transport_trait` adapters are deleted
- [Measure ECN on the backbone](/quest/m2/quic-ecn-measure.md) - a written
verdict on marking versus dropping, and whether Linode and OVH keep marks
- [Per-stream ACK progress](/quest/m2/quic-ack-progress.md) - `moq-quic` reports
how far a send stream has been acknowledged and when
- [poll_acked on moq-net's send stream](/quest/m2/quic-ack-hook.md) - the
backend-neutral hook on moq-net's own transport trait that awaits an
acknowledged stream offset, implemented by the moq-tokio and moq-uring adapters
Expand Down
22 changes: 14 additions & 8 deletions quest/m2/quic-ack-hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ wakeups a latency sample needs.
Add one method to `SendStream`, in the trait's poll style:

```rust
fn poll_acked(&mut self, cx: &mut Context, offset: u64) -> Poll<Result<Option<Acked>, Self::Error>>;
fn poll_acked(&mut self, cx: &mut Context, offset: u64) -> Poll<Result<Option<()>, Self::Error>>;
```

It is ready with `Some` once every byte below `offset` has been acknowledged.
`Acked` carries the ACK-delay-corrected receive instant from `moq-quic`. It resolves
It carries no instant: the caller records one when woken, which includes the
peer's delayed-ACK timer (up to `max_ack_delay`) as well as the return trip.
Decided 2026-10-17 on #5817, which dropped `moq-quic`'s ACK-delay-corrected
instant until a consumer shows it matters. It resolves
with an error once the stream is reset by either side or the session closes,
so a waiter never hangs on bytes the peer will never acknowledge. The default
implementation is ready with `Ok(None)` immediately: `None` means the backend
Expand All @@ -36,7 +39,15 @@ unsupported has to live in the return type rather than the error, and a
consumer must treat `None` as unknown, never as delivered.

Implement it in the moq-tokio and moq-uring adapters over `moq-quic`'s
accessor. Leave the browser transport on the default; the browser's `WebTransportSendStream.getStats()` is
`SendStream::acked(offset)`, which returns whether every byte before the
offset is acknowledged and fails once it never will be. A `false` asks
`moq-quic` to report `StreamEvent::Acked { id, offset }` when the stream's
acknowledged prefix reaches it, so the adapter wakes waiters at or below that
offset; moq-uring's `sweep_stream` currently ignores the event. `acked` fails
once the stream is freed, after `StreamEvent::Finished`, which means
everything was acknowledged, so the adapter answers from that. The trait
method takes a byte offset, like `moq-quic` (decided 2026-10-17 on #5817);
the starvation quest's writer counts the bytes it writes. Leave the browser transport on the default; the browser's `WebTransportSendStream.getStats()` is
unimplemented in shipping Chrome and its `bytesAcknowledged` is at risk in the
W3C draft. qmux over a reliable transport may treat serialization as
acknowledgment only if the qmux quest decides that is honest; until then it
Expand All @@ -51,11 +62,6 @@ STOP_SENDING by the receiver, and session close.
Decided in the 2026-09-30 audit: moved to m2 with its only consumer,
[frame-granularity starvation](/quest/m2/starvation-frames.md).

## Required

- [Per-stream ACK progress](/quest/m2/quic-ack-progress.md) - the
`moq-quic` accessor the adapter reads

## Related

- [Starvation at frame granularity](/quest/m2/starvation-frames.md) - the
Expand Down
51 changes: 0 additions & 51 deletions quest/m2/quic-ack-progress.md

This file was deleted.

13 changes: 7 additions & 6 deletions quest/m2/starvation-frames.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ span from the newest acknowledged frame to the newest written one, which is
the exact media the viewer lost.

Add a second byte-weighted cumulative histogram of delivery delay:
`acked.received - written_at` per frame, where `received` is the
ACK-delay-corrected instant the hook returns. Its low edge approaches the
path RTT and its spread is the jitter. Document that the value still includes
the return one-way delay and that a backend without the hook leaves the
`acked_at - written_at` per frame, where `acked_at` is when the serve task is
woken by `poll_acked`. Its low edge approaches the path RTT and its spread is
the jitter. Document that the value still includes the return one-way delay
and the peer's delayed-ACK timer, since the hook reports no corrected instant
(decided 2026-10-17 on #5817), and that a backend without the hook leaves the
histogram absent, never zero.

Backends that return unsupported from `poll_acked` keep the group-granularity
Expand All @@ -52,8 +53,8 @@ is Required.
Tests: the frontier tracking frame ends under a peer that acknowledges in
bursts, with interval samples landing one bucket lower than group-granularity
tracking of the same run; a reset mid-group attributing only the
unacknowledged span to `dropped_duration`; delivery delay under an injected ACK delay staying inside one bucket of the
true RTT; and fallback to group-granularity frontier tracking when the hook is
unacknowledged span to `dropped_duration`; delivery delay staying inside one bucket of the true RTT plus the peer's
`max_ack_delay`; and fallback to group-granularity frontier tracking when the hook is
unsupported.

## Required
Expand Down
10 changes: 10 additions & 0 deletions rs/moq-quic/MIGRATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ How to update your code for each breaking change, newest first.

Each entry is a change from `quinn-proto`.

### `StreamEvent::Acked` (#5817)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the Checkpoint-to-offset migration

This migration entry covers only the new StreamEvent::Acked, but the same commit removes the public Checkpoint type and SendStream::checkpoint from both moq-quic and moq-tokio and replaces their reset flow with byte offsets and reset_at; existing consumers therefore stop compiling without any documented replacement, and moq-tokio's MIGRATE.md is not updated at all. Add before/after guidance to every affected package's migration file.

AGENTS.md reference: AGENTS.md:L60-L62

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declining: Checkpoint and SendStream::checkpoint came in with #5690, which no release contains yet (it is not on release), so no released consumer breaks. moq-quic's MIGRATE.md lists changes from quinn-proto, which has neither, and moq-tokio's lists changes since its last release. The StreamEvent::Acked entry is the one break that applies.

(Written by Opus 5.5)


`StreamEvent` gained `Acked { id, offset }`, reported when the answer changes for the lowest offset a `SendStream::acked` call is waiting for: the stream's acknowledged prefix reached it, or `STOP_SENDING` or a reset made it fail.
An exhaustive `match` needs an arm for it.

```rust
// After
StreamEvent::Acked { id, offset } => wake_ack_waiters(id, offset),
```

### Streams and datagrams take `SendOptions` (#5770, #5872)

`Streams::open` and `Datagrams::send` take a `SendOptions { group, priority }`,
Expand Down
3 changes: 2 additions & 1 deletion rs/moq-quic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Changes on top of the upstream commit, besides the renames:
- **Send groups** (`streams/schedule.rs`, `Connection::send_groups`): streams outside every group go first, in quinn's order; groups are served strictly by priority, with equal priorities sharing bytes by deficit round robin. A stream's priority is an `i64` ordering it only within its group, and `Streams::open` takes a `SendOptions { group, priority }` to start it there, like W3C WebTransport's send options. The schedule also has scheduling domains that share bytes the same way, crate-private until a consumer needs them. This replaces quinn's single pending-stream heap, so a cherry-pick touching `PendingStreamsQueue` has to be redone against the schedule. moq-tokio's `quic::driver` and moq-uring's driver wrap a group in a shared `SendGroup` handle that closes on drop.
- **Scheduled datagrams** (`Datagrams::send`): a datagram is queued by its `SendOptions`, in a send group (or ungrouped) at an `i64` priority, and scheduled with the group's streams, winning a tie with a stream of equal priority and spending the group's byte credit, instead of quinn's datagram-first FIFO in `populate_packet`. Sending never blocks: `datagram_send_buffer_size` is shared, and an overflow evicts the oldest datagram of the lowest-priority group in the domain holding the most datagram bytes. `SendDatagramError::Blocked` and `Event::DatagramsUnblocked` are gone, and a cherry-pick touching the `// DATAGRAM` loop has to be redone against `StreamsState::write_frames`.
- **Sharded connection IDs** (`RandomConnectionIdGenerator::set_shard`): every CID names shard `index` of a `count`-endpoint group in its first byte, modulo `count`, and sets a marker in its fourth byte, so a `SO_REUSEPORT` steering filter delivers a packet to the endpoint that issued its CID. `validate` refuses a CID without this shard's prefix and marker, so a misrouted packet is dropped instead of answered with a stateless reset. Not offered upstream; it serves moq-sock's per-core sharding.
- **`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.
- **`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, `SendStream::reset_at` keeps the data written before an offset 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.
- **ACK progress** (`SendStream::offset`, `SendStream::acked`, `StreamEvent::Acked`): `acked` reports whether the peer acknowledged every byte before an offset, by comparing against the stream's contiguous acknowledged prefix. A `false` stores the lowest polled offset on the stream, and the ACK that advances the prefix past it, or a reset or `STOP_SENDING` that makes it fail, reports `StreamEvent::Acked` with the prefix, so a cherry-pick touching `StreamsState::received_ack_of`, `received_stop_sending`, or the reset path has to keep that report. Not offered upstream: quinn has no API for when sent data was acknowledged.
- **Fuzzing** runs through the hidden `fuzz` module behind a `fuzz` feature, with one-line shims in [`fuzz/`](fuzz/README.md): upstream's `packet`, `params`, `streamid`, and `streams` targets, plus `frame` and a connection op sequence. Upstream's `cfg(fuzzing)` `fuzzing` module and `arbitrary` feature are gone, so its fuzz patches port by hand.
- **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.
- **Late stream limits**: peer transport parameters that raise a stream limit after an open was refused emit `StreamEvent::Available`, as `MAX_STREAMS` does. A server accepted before the rest of a multi-packet ClientHello (a post-quantum key share is enough) otherwise leaves a 0.5-RTT `open_uni` parked until the idle timeout. Not offered upstream yet.
Expand Down
2 changes: 1 addition & 1 deletion rs/moq-quic/fuzz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ symbol stripping. Prefix direct calls with
- A stream ID keeps the initiator, direction, and index it was built from.
- ACK ranges walk downward without overlapping.
- `connection` handshakes a client and server over TLS, then applies opens, accepts,
writes, finishes, resets (plain and from a checkpoint), stops, reads that hold or
writes, finishes, resets (plain and at an offset), acknowledgment queries, stops, reads that hold or
release credit, runtime limit and window changes, datagrams, key updates, and time
jumps, while dropping, duplicating, reordering, corrupting, and injecting datagrams.
Every stream read is in order, never past what was written, byte-for-byte what was
Expand Down
5 changes: 2 additions & 3 deletions rs/moq-quic/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ pub use stats::{ConnectionStats, CreditStats, FrameStats, PathStats, UdpStats};
mod streams;
pub(crate) use streams::StreamsState;
pub use streams::{
Checkpoint, Chunks, ClosedStream, Credit, FinishError, ReadError, ReadableError, RecvStream,
SendGroup, SendGroups, SendOptions, SendStream, ShouldTransmit, StreamEvent, Streams,
WriteError, Written,
Chunks, ClosedStream, Credit, FinishError, ReadError, ReadableError, RecvStream, SendGroup,
SendGroups, SendOptions, SendStream, ShouldTransmit, StreamEvent, Streams, WriteError, Written,
};

mod timer;
Expand Down
5 changes: 5 additions & 0 deletions rs/moq-quic/src/connection/send_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ impl SendBuffer {
self.offset
}

/// The end of the contiguous acknowledged prefix
pub(super) fn acked(&self) -> u64 {
self.offset - self.unacked_len as u64
}

/// Whether all sent data has been acknowledged
pub(super) fn is_fully_acked(&self) -> bool {
self.unacked_len == 0
Expand Down
Loading
Loading