Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions quest/m0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ publishers mint epochs. Backport patches cut from `release` don't carry

Liveness: a serve loop with work always ready never yields, which starved
an FFI publisher's QUIC driver and fails hosted Interop's go lanes (found
2026-10-08 landing #4225). The [serve budget](/quest/m0/serve-budget.md)
bounds every kio task's loop. The Go and Python interop cells it fails
2026-10-08 landing #4225). The publish serve loops now yield through a
`kio::coop::Budget`. The Go and Python interop cells it fails
moved here from m1 the same day, because the stall masks interop on every
wire PR and hides as slow passes; the harness now fails a cell whose
connection idles out.
Expand All @@ -61,9 +61,8 @@ remain and no release waits on them.

## Required

- [Serve budget](/quest/m0/serve-budget.md) - a kio task that always has work ready yields after a budget, so a fast publisher can't starve its own QUIC driver
- [Draft-22 media on 0.17](/quest/m0/release-22/README.md) - a 0.17.x with the LOCATION_FILTER and FIRST_OBJECT fixes and moq-noq 1.3.4, before Seattle
- [FFI publisher stall](/quest/m0/ffi-publisher-stall.md) - every Go, Python, and C++ publisher cell passes reliably once the serve budget lands, and a cell fails when a connection idles out
- [FFI publisher stall](/quest/m0/ffi-publisher-stall.md) - every Go, Python, and C++ publisher cell passes reliably with the serve budgets, and a cell fails when a connection idles out
- [FFI cancelled reads](/quest/m0/ffi-cancel-read.md) - cancelling a moq-ffi read in any binding leaves its data for the next read, so the C++ probe stops flaking
- [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
Expand Down
12 changes: 5 additions & 7 deletions quest/m0/ffi-publisher-stall.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ cell.

The cause is known: a serve loop with work always ready never yields and
starves moq-ffi's single runtime thread until the relay times the publisher
out (found 2026-10-08 landing #4225). [Serve budget](/quest/m0/serve-budget.md)
fixes it, so this quest starts once it lands and no bisect is needed.
out (found 2026-10-08 landing #4225). The publish serve loops now yield
through a `kio::coop::Budget` (#5088), which is meant to fix it: interop run
37889112106 passed every Go and Python publisher cell on an earlier design of
that PR. Confirm on `main` and nightly before closing.

Decided 2026-10-08:

- In m0, moved from m1 and widened from the browser cells: the stall masks
interop on every wire PR and may disconnect real FFI publishers.
- Re-check every Go, Python, and C++ publisher cell once the serve budget lands.
- Re-check every Go, Python, and C++ publisher cell now that the budget landed.
The #4225 root-cause comment saw a 64-iteration yield still time the
publisher out, so if a cell still stalls, find the rest of the cause.
Never raise a timeout or add a retry.
Expand Down Expand Up @@ -52,10 +54,6 @@ Harness facts (2026-10-08):

Public API: none expected. Wire: none.

## Required

- [Serve budget](/quest/m0/serve-budget.md) - fixes the stall's cause; this quest verifies the cells and hardens the harness

## Related

- [FFI runtime](/quest/m1/ffi-runtime.md) - FFI apps run on more than one thread, which also hides the stall
Expand Down
98 changes: 0 additions & 98 deletions quest/m0/serve-budget.md

This file was deleted.

2 changes: 2 additions & 0 deletions quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ were done or not worth their cost.
- [FFI runtime](/quest/m1/ffi-runtime.md) - moq-ffi drives moq on a multi-thread runtime instead of one thread
- [Audio group duration](/quest/m1/audio-group-duration.md) - audio groups span at least 20 ms by default, so small frames don't mint a group each
- [Pipelined requests](/quest/m1/pipeline-requests/README.md) - SUBSCRIBE and the first FETCH go out with the track-info request at every hop, so first data arrives a round trip sooner per hop
- [A spinning loop fails a sim test](/quest/m1/spinning-loops.md) - a sim test names any loop that holds a task poll too long, and each one yields through a budget
- [A busy js/net serve yields](/quest/m1/js-serve-yield.md) - js/net's serve loop leaves the browser its event loop under a fast publisher, if it does not already
- [Kotlin wrapper POMs](/quest/m1/kt-ffi-pom.md) - Maven builds of `dev.moq:moq` resolve a published moq-ffi instead of the missing `0.0.0-dev`
- [Installable moq-gst](/quest/m1/gst-brew-path.md) - `brew install moq-gst` installs the plugin from the tarball's `lib/gstreamer-1.0/`, and the Nix package carries `x264enc`, `avenc_aac`, and `avdec_h264`
- [Same-epoch importers](/quest/m1/hop-aligned-import.md) - importers sharing one `--epoch` and fed one stream publish identical groups and timestamps, so failover between a redundant pair survives
Expand Down
1 change: 0 additions & 1 deletion quest/m1/audio-group-duration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ Public API: a changed default in moq-audio and `@moq/publish`. Wire: none.

## Related

- [Serve budget](/quest/m0/serve-budget.md) - bounds the serve loop whatever the group rate
- [FFI codec namespaces](/quest/m1/ffi-shape/codec.md) - owns the FFI encoder's frame duration default, a separate knob
5 changes: 2 additions & 3 deletions quest/m1/ffi-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ added this quest):
#1071) with no stated reason.
- Use `new_multi_thread().enable_all()` with tokio's default worker count.
No configuration knob until an embedder needs one. Rejected: a small fixed
pool, and keeping `current_thread` behind the
[serve budget](/quest/m0/serve-budget.md) alone.
pool, and keeping `current_thread` behind the serve budgets
(`kio::coop::Budget`) alone.
- Keep the "foreign caller's thread never drives our futures" property: work
still runs via `Task::run` and `detached`. Check the exported async fns that
await in place (`subscribe_catalog`, `subscribe_track`, `fetch_group`,
Expand Down Expand Up @@ -51,6 +51,5 @@ Public API: callbacks may fire concurrently on any runtime thread

## Related

- [Serve budget](/quest/m0/serve-budget.md) - the root fix for a task hogging its thread
- [Kotlin/JVM exit](/quest/m2/kt-jvm-exit.md) - runtime-thread shutdown
- [Generated C bindings](/quest/m1/c/README.md) - inherits the moq-ffi runtime, so hand-written moq-c needs no change
20 changes: 20 additions & 0 deletions quest/m1/js-serve-yield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [S] A busy js/net serve leaves the browser its event loop

## Goal

Find whether a js/net serve loop whose awaits keep resolving immediately (a
fast publisher with a backlog) runs only microtasks and starves the browser's
event loop: rendering, input, and WebTransport reads. Fix it at the cause if it
does, and keep a browser bench that shows it.

## Plan

Found 2026-10-09 while reworking #5088, which bounds the Rust serve loops with
`kio::coop::Budget`. Microtask starvation is the JS analog of a Rust task that
never returns `Pending`. Measure first: a browser bench publishing 2.5 ms
groups with a sibling timer, checking that the timer keeps firing. Node and Bun
only stand in for the browser.

## Related

- [A spinning loop fails a sim test](/quest/m1/spinning-loops.md) - the Rust side's guard
4 changes: 0 additions & 4 deletions quest/m1/perf/uring-quiescence.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,3 @@ meaning with a budget of 1 and gains a sibling proving the budget bound.
- [Hard fork](/quest/m1/quic/fork/README.md) - the noq driver this edits moves onto `moq-quic` (decided in the 2026-10-05 audit)
- [One enter per turn](/quest/m1/perf/uring-one-enter.md) - the metrics and
the submit placement this sweep is measured with

## Related

- [Serve budget](/quest/m0/serve-budget.md) - a per-task budget bounds one task's loop; this quest's pass count bounds passes per turn, and the sweep runs with both in place
8 changes: 2 additions & 6 deletions quest/m1/session-burst-hang.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Goal

`rs/moq-net/benches/session.rs`'s `burst` sweep runs to completion at 16
subscriptions and 16 or more groups per round, with or without the kio
budget, and the sweep covers those shapes again.
subscriptions and 16 or more groups per round, with or without the serve
budgets, and the sweep covers those shapes again.

## Plan

Expand All @@ -15,7 +15,3 @@ budget too, so the sweep was limited to shapes that complete. Decided 2026-10-08
treat it as a possible session stall, not a bench setup limit. Find whether
it is cache size, stream credit, or a real stall, fix it at the cause, and
add a regression test if the cause is in the session rather than the bench.

## Required

- [A busy task yields within a budget](/quest/m0/serve-budget.md) - adds the `burst` axis
38 changes: 38 additions & 0 deletions quest/m1/spinning-loops.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# [M] A spinning loop fails a sim test

## Goal

A moq-net sim test fails, naming the loop, when one task poll makes more than a
fixed number of kio `Ready` polls, and every loop it flags yields through a
`kio::coop::Budget`. Today a loop with no budget that keeps finding work ready
holds its thread with nothing to flag it, the way `RequestServe::poll_serve`
starved a go publisher's runtime (#5088).

## Plan

Decided 2026-10-09 while reworking #5088:

- #5088 gives only the publish serve loops a `Budget`: lite `RequestServe` and
`GroupServe`, and ietf `TrackServe`, `GroupServe`, `read_fetch`, and
`write_fetch_group`. A search found about 31 more loops that can keep
finding work in one poll (receive, accept, announce, and request loops in
`lite/subscriber.rs`, `ietf/subscriber.rs`, `ietf/session.rs`, and
`model/origin.rs`). This guard decides which of them actually spin.
- Also unbudgeted: ietf `run_fetch_stream`'s write loop over the frames
`read_fetch` collected, which sends a whole cached group in one poll over
always-ready writes. Add an end-to-end FETCH test that checks a sibling
still gets its turns (found by the OpenAI review of #5088).
- The count is test-only, so kio's hot path stays untouched: a feature or
`cfg` that only the sim runtime enables, reset on each task poll.
- A loop takes a `Budget` only where its `Pending` goes straight up to the
task. Three known sites need care: lite `FetchServeRun` reads a
`FrameIngest` yield as "still short" and may `abort_unused`;
`Announced::poll_serve` must re-queue the route through `route_waiter` and
yield in the outer loop too; and ietf `poll_datagrams` still spins on a
datagram backlog after `TrackServe` yields, and its drain arm would skip
datagrams after a yield unless it returns `Poll`.

## Related

- [Session burst hang](/quest/m1/session-burst-hang.md) - the same bench shapes that hang
- [FFI runtime](/quest/m1/ffi-runtime.md) - FFI apps run on more than one thread
12 changes: 4 additions & 8 deletions quest/m1/track-tail-interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ run 37139033242 (2026-10-03) failed `tail rust -> rust`, `rust ->
js-native-node`, and `rust -> js-native-bun`. Merge `main` (after #4741 and
#4813) into #4225, rerun, and record here whatever defect still fails.

Found 2026-10-08: #4225's `go -> *` lanes fail on the
[serve budget](/quest/m0/serve-budget.md) stall, where the go publisher's
serve loop starves its own QUIC driver until the relay times it out. Rerun
the lanes once that lands.
Found 2026-10-08: #4225's `go -> *` lanes fail on a stall where the go
publisher's serve loop starves its own QUIC driver until the relay times it
out. The serve budgets (`kio::coop::Budget`) are meant to fix it; rerun the
lanes.

Decided in the 2026-09-30 audit: the lite-07 drop case moved into
[SUBSCRIBE_DROP](/quest/m1/subscribe-drop.md)'s tests, so the basic Rust and
Expand All @@ -41,10 +41,6 @@ JS tail interop lands now instead of waiting on that [L] quest.
QUIC on localhost rarely reorders, so this is a smoke check that the end is
delivered and clean. The ordering race itself stays in the unit tests.

## Required

- [Serve budget](/quest/m0/serve-budget.md) - is meant to fix the stall that fails #4225's go lanes; rerun them once it lands

## Related

- [SUBSCRIBE_DROP](/quest/m1/subscribe-drop.md) - owns the lite-07 drop case on top of this harness
Expand Down
2 changes: 2 additions & 0 deletions rs/kio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The channel auto-closes when all producers are dropped.
poll-native FIFO queue (bounded or unbounded) built in the same style. `Park` holds a
waiter for as long as a poll stays pending, bridging a `std::task::Context` to kio's
waiter-based polls when implementing `Future` or `poll_*` on top of kio channels.
`coop::Budget` bounds the passes a loop makes per poll, so one that always finds
work ready still yields to the rest of its runtime.

It's used internally by [moq-net](https://github.com/moq-dev/moq/tree/main/rs/moq-net) and friends, but is generic enough to be useful on its own.

Expand Down
Loading
Loading