diff --git a/quest/m0/README.md b/quest/m0/README.md index fa0d6b06f9b..07a90340a36 100644 --- a/quest/m0/README.md +++ b/quest/m0/README.md @@ -86,3 +86,4 @@ have fixes on `main`: macOS tests (#5335), drill-sensitivity (#5338), loom - [web-transport releases the qmux fixes](/quest/m0/qmux-credit-upstream.md) - waiting on moq-dev/web-transport#412 and #413 to merge and ship, which qmux credit bumps to - [qmux credit](/quest/m0/qmux-credit.md) - qmux returns connection credit for dropped and stopped streams and delivers its close frame, on both lines - [Broadcast epochs](/quest/m0/broadcast-epoch/README.md) - every first-party publisher that can restart mints a fresh route epoch, the newest wins a path, and only routes with the same epoch resume a subscription +- [Parked drain](/quest/m0/parked-drain.md) - draining parked groups after a cap rise, as a same-epoch relay handover causes, is near-linear in the backlog, not quadratic diff --git a/quest/m0/parked-drain.md b/quest/m0/parked-drain.md new file mode 100644 index 00000000000..8ce8682a52b --- /dev/null +++ b/quest/m0/parked-drain.md @@ -0,0 +1,45 @@ +# [S] Draining parked groups is near-linear in the backlog + +## Goal + +Once a subscriber's raised cap releases its parked groups, each delivery +costs at most O(log P), so draining P parked groups is O(P log P), not +quadratic. The `origin/resume_overlap` benchmark's per-group drain time no +longer grows linearly with the parked count. + +## Plan + +Found on [#5446](https://github.com/moq-dev/moq/pull/5446): 1024 parked groups +drain at about a tenth of the rate of 64, on `main` as well. +`track::Subscriber::poll_recv_group` (`rs/moq-net/src/model/track.rs`) runs +`parked.retain(..)` over every parked group on every poll, re-registering an +abort waiter on each, so a drain is quadratic. + +Decided 2026-10-13 (maintainer): m0. Groups park in production during a +same-epoch relay handover: `Copy::wire` (`rs/moq-net/src/model/resume.rs`) +caps the replaced copy's range, the lite publisher treats that end group as +a serving cap, and the new route's unbounded demand then drains the parked +set quadratically. Live players setting no cap of their own doesn't help. + +Recommended: validate lazily. Wake the subscriber from the track (one +registration) when a cached group aborts, rather than registering on every +parked group per poll, and on that wake remove exactly the parked entries +that aborted, cap raised or not. Aborted entries are not a low-end prefix: +eviction rotates recently read groups to the back and expiry follows last +access. A sequence can name both a live group and a fetched head, so confirm +the parked consumer itself aborted before dropping it, and keep any abort +bookkeeping bounded by what the cache retains, not by lifetime churn. Each removal is paid for by its insertion, and +the `BTreeMap`'s O(log P) removal is accepted rather than swapping the +structure. Keep the existing guarantees: a raised `start_at` drops overtaken +entries, eviction bounds the parked set to what the cache retains, a +finished track with only aborted parked groups ends, and an abort between +check and registration still wakes the reader. A track-wide wake fans out to +every capped subscriber, so extend the benchmark to sweep parked count +against capped subscribers per track: the parked axis flattens, and a +per-abort cost that grows with subscribers shows up as a slope. + +Public API: none. Wire: none. + +## Required + +- [Resume duplicates](/quest/m0/broadcast-epoch/resume-duplicates.md) - reshapes `track::Subscriber`'s delivery record in the same code diff --git a/quest/m1/ffi-panic-supervision.md b/quest/m1/ffi-panic-supervision.md index aa062ba1e80..e858965d903 100644 --- a/quest/m1/ffi-panic-supervision.md +++ b/quest/m1/ffi-panic-supervision.md @@ -22,7 +22,9 @@ each task's `JoinHandle` the way #5447 did for moq-c sessions, reusing the `Cancel` its dropped channel produces today. Add a regression per binding that injects a panic into one background task and asserts the host sees `MOQ_ERROR_PANIC` (moq-c) or the binding's panic error (moq-ffi), -while another object keeps working. Also add the regression #5447 left out: +while another object keeps working. A binding's origin task needs its own owner for +the driver, so its panic can be reported; wrapping the helper that aborts the +process (`moq_tokio::origin::spawn`) is not enough. Also add the regression #5447 left out: a moq-tokio accept loop that panics ends its listener. Public API: none expected, beyond the panic error reaching more callbacks.