From 95b693672b018f5f09813f73f25a04075e28bc1f Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 11:09:40 -0700 Subject: [PATCH 1/3] quest: plan follow-ups from the 2026-10-28 merges Shared-PID TS stats (#6689), the lite-01..06 close drain and the lite track end at session death (#6969). Co-Authored-By: Claude Opus 5.5 --- quest/m1/README.md | 2 ++ quest/m1/lite-legacy-close-drain.md | 26 ++++++++++++++++ quest/m1/lite-track-end.md | 34 +++++++++++++++++++++ quest/m1/ts-reliability/README.md | 1 + quest/m1/ts-reliability/shared-pid-stats.md | 32 +++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 quest/m1/lite-legacy-close-drain.md create mode 100644 quest/m1/lite-track-end.md create mode 100644 quest/m1/ts-reliability/shared-pid-stats.md diff --git a/quest/m1/README.md b/quest/m1/README.md index b1f871bd4e5..0b8a60fc79b 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -171,6 +171,8 @@ removed). - [Relay demand gaps](/quest/m1/relay-demand-gaps.md) - pre-07 backlog, IETF warm-relay newcomer, and double upstream pulls are fixed or ruled out - [Segment cuts hold bounded state](/quest/m1/segmenter-cuts.md) - the HLS segmenter keeps one pending cut, so `styp` input without sync samples cannot grow it - [Next Object on a cold Rust copy](/quest/m1/next-object-cold-copy.md) - a join after an upstream group report starts at the first frame received, never skipping +- [Lite track end at session death](/quest/m1/lite-track-end.md) - Rust and JS abort an ended lite track whose tail never settled, and agree on what declares the end +- [Legacy lite close drain](/quest/m1/lite-legacy-close-drain.md) - a lite-01..06 graceful close never cuts a final group the subscriber has not read - [Container consumers buffer by backpressure](/quest/m1/container-backpressure.md) - Rust and JS container consumers decode ahead only a byte budget, so a hostile publisher cannot grow them - [An HLS viewer starts capture](/quest/m1/hls-record-demand.md) - a record-track subscriber counts as demand for its rendition's media - [One moq-ffi build definition](/quest/m1/ffi-build-flags.md) - every binding takes moq-ffi's default features from one place diff --git a/quest/m1/lite-legacy-close-drain.md b/quest/m1/lite-legacy-close-drain.md new file mode 100644 index 00000000000..722d351b6c2 --- /dev/null +++ b/quest/m1/lite-legacy-close-drain.md @@ -0,0 +1,26 @@ +# [S] A lite-01..06 graceful close delivers the final group + +## Goal + +A publisher's graceful close on lite-01..06 never cuts a final group the +subscriber has not read yet, over WebTransport and QMux, in Rust and JS. + +## Plan + +Found while landing [moq-dev/moq#6969](https://github.com/moq-dev/moq/pull/6969): +the JS publisher's drain waits only for the transport's FIN +acknowledgement. The mock resolves that once the bytes are queued at the +peer, and its close discards unread chunks; WebTransport likewise errors a +session's receive streams on close, dropping their unread bytes. lite-07's +subscriber FIN avoids this. + +Decided 2026-10-28 (maintainer): m1, since lite-01..06 are published and a +graceful close losing data breaks what "graceful" promises. + +Reproduce first, over real WebTransport and QMux, for the JS publisher and +the Rust publisher. Then make the drain wait until the subscriber has read +the final group, using a signal lite-01..06 already carries (such as the +subscriber closing its side of the stream). If those versions carry no such +signal, stop and report the options rather than add a wait on a timer. + +Public API: none expected. Wire: none; published versions keep their wire. diff --git a/quest/m1/lite-track-end.md b/quest/m1/lite-track-end.md new file mode 100644 index 00000000000..b0521e48a3f --- /dev/null +++ b/quest/m1/lite-track-end.md @@ -0,0 +1,34 @@ +# [S] An ended lite track with an unsettled tail aborts at session death + +## Goal + +When a session dies after a lite publisher ended a track but before its tail +settled, Rust and JS both abort the track, and both end it cleanly once the +tail settled. Both agree on what declares the end. + +## Plan + +Found while landing [moq-dev/moq#6969](https://github.com/moq-dev/moq/pull/6969). +Rust lite marks a track ended on the subscribe stream's FIN, on every +version, and its cleanup then calls `finish()` without checking the tail: +`SubscriptionCleanup::abort` and `close`, and `ServeMode::Tail`'s +`ServeEnd::Finished`, in `rs/moq-net/src/lite/subscriber.rs`. JS declares +the end on SUBSCRIBE_END (and, after #6969, the FIN on lite-01..04), and +`track.Producer#close` downgrades an abort to a clean end only once the +declared end settled. Rust's IETF subscriber already aborts. + +Decided 2026-10-28 (maintainer): + +- Rust aborts like JS, since `finish()` on an unsettled tail reports + incomplete content as complete. Its cleanup always calls `abort` and relies + on `track::Producer::abort`'s existing downgrade when the declared end + settled. +- Align the end signal in both languages: SUBSCRIBE_END on lite-05+, the + stream FIN on lite-01..04. On lite-07 a bounded range also FINs, which must + not end the track. + +Cover it with a test in each language for the settled and unsettled cases, +and an interop case that kills the session with groups unsettled. + +Public API: none. Wire: none; behavior only. A Rust consumer of an +unsettled track sees the session error instead of a clean finish. diff --git a/quest/m1/ts-reliability/README.md b/quest/m1/ts-reliability/README.md index 044fcfa9373..55982365de9 100644 --- a/quest/m1/ts-reliability/README.md +++ b/quest/m1/ts-reliability/README.md @@ -102,6 +102,7 @@ catalog linger (#5305). - [TS workflow passes](/quest/m1/ts-reliability/validation-green.md) - the scheduled TS lanes pass on main again, with no lane loosened - [Export SI order](/quest/m1/ts-reliability/export-si-order.md) - a TS export sends SI and media after its PMT and a PCR interval, so a hop keeps first emissions - [A stitched switch returns to --delay](/quest/m1/ts-reliability/stitch-catch-up.md) - `--stitch` drops the old program's tail once the replacement acquires, so latency settles back to `--delay` +- [Shared PID stats](/quest/m1/ts-reliability/shared-pid-stats.md) - `ts::stats` counts a shared PID once in the shared parser, so its timing counts survive program changes ## Related diff --git a/quest/m1/ts-reliability/shared-pid-stats.md b/quest/m1/ts-reliability/shared-pid-stats.md new file mode 100644 index 00000000000..c9675bbfaf2 --- /dev/null +++ b/quest/m1/ts-reliability/shared-pid-stats.md @@ -0,0 +1,32 @@ +# [M] TS stats count a shared PID once + +## Goal + +`ts::stats` counts each PID once, in the parser every program shares, so a +PID two programs carry has one continuous set of TR 101 290 counters across +program starts and retirements. The multiplex totals read those counters +directly instead of rebuilding them from per-program copies. + +## Plan + +Found while landing [moq-dev/moq#6689](https://github.com/moq-dev/moq/pull/6689): + +- Each program keeps its own counters for the PIDs it reads, and the + multiplex totals merge them, then subtract what a retiring program still + shares with a running one. Most of that PR's review churn came from this + merge-and-subtract logic. +- A program that starts after another on a shared PID retired counts that + PID's timing checks only from its own start. Where both run at once, the + larger count stands. + +Decided 2026-10-28 (maintainer): one quest, since counting in the shared +parser both closes the timing gap and deletes the merge-and-subtract logic. +Keep #6689's outcomes: a retired program's final picture still counts, a +missing PMT still refuses after 0.5 s of program clock, and an unfinished +section on a PMT PID gets its bad CRC counted once. Extend the `ts_programs` +bench if the shared counters change its cost. + +Rust: `rs/moq-mux` `container/ts/stats.rs`, `programs.rs`, `unclaimed.rs`. + +Public API: none expected; if `ts::stats`' per-program view changes shape, +say how to migrate. Wire: none. From 43a0bd714ef318cf45e8d4ed64f02f6ccd0252d5 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 11:10:15 -0700 Subject: [PATCH 2/3] quest: gate send-depth on a pinned nightly Co-Authored-By: Claude Opus 5.5 --- quest/m0/ci/README.md | 1 + quest/m0/ci/send-depth-gate.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 quest/m0/ci/send-depth-gate.md diff --git a/quest/m0/ci/README.md b/quest/m0/ci/README.md index 700b5b7d160..7bf0925d022 100644 --- a/quest/m0/ci/README.md +++ b/quest/m0/ci/README.md @@ -138,3 +138,4 @@ The historical samples locate candidates; they are not controlled benchmarks. - [Padding runs](/quest/m0/ci/quic-padding.md) - moq-quic parses a PADDING run as one frame, keeping the padding stats' meaning - [tracing-test filter](/quest/m0/ci/tracing-filter.md) - moq-tokio's tests stop forcing every crate to format at TRACE - [Stats oversize](/quest/m0/ci/stats-oversize.md) - moq-stats refuses an oversized plain snapshot before parsing it back +- [Gate send-depth](/quest/m0/ci/send-depth-gate.md) - the merge gate runs send-depth on a pinned nightly when moq-net changes, after #6890 fixes main diff --git a/quest/m0/ci/send-depth-gate.md b/quest/m0/ci/send-depth-gate.md new file mode 100644 index 00000000000..c0e83a9a755 --- /dev/null +++ b/quest/m0/ci/send-depth-gate.md @@ -0,0 +1,34 @@ +# [S] The merge gate runs send-depth + +## Goal + +A PR whose change deepens moq-net's native `Send` proofs past the default +recursion limit fails the merge gate, instead of turning Nightly red after it +lands. The check runs on a pinned nightly from the dev shell, so a toolchain +release alone never fails it. + +## Plan + +`just rs send-depth` runs only in Nightly, on whatever nightly +`dtolnay/rust-toolchain` installs. The gate never built it, so a deeper IETF +future failed Nightly every night from 2026-10-25 until +[moq-dev/moq#6890](https://github.com/moq-dev/moq/pull/6890). Land this after +that fix, since the check is red on `main` until then. + +Decided 2026-10-28 (maintainer): gate it, because it is cheap. Measured on +2026-10-28: about 14 s cold and 9 s warm on a 24-core host, against a +21-minute median for the gate runs that select moq-net (26% of 144 runs +since 2026-10-25). + +- Pin a dated nightly in the flake (rust-overlay already provides one) and + have `sh/rs/send-depth.sh` use it instead of rustup's latest; Nightly's + send-depth job uses the same pin. Bump the pin on purpose, like stable. +- Run it from `sh/rs/select.sh` beside `net-features`: + `if wants moq-net; then just rs send-depth; fi`, so it runs only when + moq-net or a workspace dependency of it changes. + +Public API: none. Wire: none. + +## Related + +- [Measure the parallel frontend](/quest/m0/ci/nightly-levers.md) - also builds on a pinned nightly From 2b4f4ee26a00c7b34e8fbd232705bde130b2d82c Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 29 Oct 2026 08:24:36 -0700 Subject: [PATCH 3/3] quest: lite-track-end also covers the ServeMode::Tail session close Co-Authored-By: Claude Opus 5.5 --- quest/m1/lite-track-end.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quest/m1/lite-track-end.md b/quest/m1/lite-track-end.md index b0521e48a3f..0eb797d8513 100644 --- a/quest/m1/lite-track-end.md +++ b/quest/m1/lite-track-end.md @@ -22,13 +22,16 @@ Decided 2026-10-28 (maintainer): - Rust aborts like JS, since `finish()` on an unsettled tail reports incomplete content as complete. Its cleanup always calls `abort` and relies on `track::Producer::abort`'s existing downgrade when the declared end - settled. + settled. So does `ServeMode::Tail` when the session closes before the tail + settles: that branch returns `ServeEnd::Finished` today, which + `TrackServeRun` turns into `serving.finish()`, so it must abort instead. - Align the end signal in both languages: SUBSCRIBE_END on lite-05+, the stream FIN on lite-01..04. On lite-07 a bounded range also FINs, which must not end the track. Cover it with a test in each language for the settled and unsettled cases, -and an interop case that kills the session with groups unsettled. +including Rust's `ServeMode::Tail` session close, and an interop case that +kills the session with groups unsettled. Public API: none. Wire: none; behavior only. A Rust consumer of an unsettled track sees the session error instead of a clean finish.