From 8cc415f6c810f5dcdc9eebe7ce4ead62fe6f1f68 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 00:02:28 -0700 Subject: [PATCH 1/3] chore(quest): claim quest/m1/poll-first/sansio-compare.md Quest-Claim: e83267a1d8a6986a From 6d49d7161f267438f2a19b5655d8116c5f01de75 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 02:45:23 -0700 Subject: [PATCH 2/3] quest(m1): sans-IO compared, record the spike's findings The lite subscriber's upstream SUBSCRIBE was converted to a sans-IO core on spike/sansio-upstream and compared with kio poll. Delete the quest and record what it found in the poll-first epic's Plan. Co-Authored-By: Claude Opus 5.5 --- quest/m1/poll-first/README.md | 10 ++++++++- quest/m1/poll-first/sansio-compare.md | 30 --------------------------- quest/m1/quic-api/waits.md | 1 - 3 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 quest/m1/poll-first/sansio-compare.md diff --git a/quest/m1/poll-first/README.md b/quest/m1/poll-first/README.md index dc9e748f369..5f7fc4a2ebd 100644 --- a/quest/m1/poll-first/README.md +++ b/quest/m1/poll-first/README.md @@ -43,6 +43,15 @@ and their alternatives: coloring only because its evented backend parks whole stacks. kio's `&Waiter` parameter is the stackless half of that idea. Sans-IO is the other: the protocol never does I/O and each runtime drives it. +- **Sans-IO compared** in [moq-dev/moq#7058](https://github.com/moq-dev/moq/pull/7058), + on the lite subscriber's upstream SUBSCRIBE (prototype on + [`spike/sansio-upstream`](https://github.com/moq-dev/moq/tree/spike/sansio-upstream)). + moq-net already takes I/O through its transport traits and runs on any executor, + so sans-IO only buys a core without waiters. That core translated through rust2-ts + with 4 refusals, but the serve loop driving it still had 919, so translating a + session still waits on the model. Rules became plain `#[test]`s, while + interleaving bugs stay in driver tests. Compile cost and the benches were flat. + The cost is an effect enum per model touch (+206 lines on this path). - **Gate the wrappers regardless** of the build measurement, because poll-first is the style moq wants. kixelated/rust2's [semantic API hash quest](https://github.com/kixelated/rust2/blob/main/quest/m3/api-cutoff.md) @@ -53,5 +62,4 @@ and their alternatives: - [Generated async wrappers behind a feature](/quest/m1/poll-first/async-feature.md) - each library's `async fn` wrappers are generated from its `poll_*` signatures and compile only with its `async` feature - [A kio macro for poll bodies](/quest/m1/poll-first/poll-macro.md) - spike a proc macro that writes a `poll_*` state machine from straight-line code with wait points -- [Sans-IO compared](/quest/m1/poll-first/sansio-compare.md) - one moq-net protocol path as a sans-IO core, compared with kio poll - [Libraries spawn nothing](/quest/m1/poll-first/no-spawn.md) - web-async goes, and moq-ffi, moq-stats, moq-wasm and moq-relay's cluster and auth run as polled `kio::Tasks` children instead of spawned tasks diff --git a/quest/m1/poll-first/sansio-compare.md b/quest/m1/poll-first/sansio-compare.md deleted file mode 100644 index 00406ce75f3..00000000000 --- a/quest/m1/poll-first/sansio-compare.md +++ /dev/null @@ -1,30 +0,0 @@ -# [M] Sans-IO compared - -## Goal - -A report that converts one moq-net protocol path, such as a lite subscription's -control flow, to a sans-IO core (synchronous `handle_*` and `poll_transmit` / -`poll_timeout`-style calls with no `Waiter`, as quinn-proto and rustls do), driven -by a thin kio layer. It compares this with the kio `poll_*` version on: - -- implementation effort; -- testability (deterministic replay without moq-clock); -- rust2's TypeScript translation and FFI export of the result; -- compile time; -- runtime cost. - -It recommends whether moq-net's protocol core should move toward sans-IO. - -## Plan - -Decided with the maintainer on 2026-10-25: compare it in the design, and adopt it -only if it clearly wins. moq-uring already runs on a sans-IO QUIC stack, so -reuse its driving pattern. Zig's `std.Io` (I/O passed as an explicit parameter) -is the model the maintainer asked about. In Rust without stackful coroutines, -sans-IO is the closest equivalent that removes coloring from the protocol core. - -Public API: none; the prototype stays on a branch unless adopted. - -## Related - -- [moq-quic owns its waits](/quest/m1/quic-api/waits.md) - a sans-IO core that holds kio waiter lists but does no I/O, a middle point between the two styles compared here diff --git a/quest/m1/quic-api/waits.md b/quest/m1/quic-api/waits.md index 7253c4470b2..9557b7add4d 100644 --- a/quest/m1/quic-api/waits.md +++ b/quest/m1/quic-api/waits.md @@ -79,4 +79,3 @@ moq-quic's README fork list and describe migration in the PR's Impact section. W - [Poll forms](/quest/m1/quic-api/poll.md) - the drivers' public poll forms forward to these - [poll_acked](/quest/m2/quic-ack-hook.md) - its offset wait lives here - [QUIC lock contention](/quest/m2/perf/quic-lock-contention.md) - profiles the lock these waits are registered under -- [Sans-IO compared](/quest/m1/poll-first/sansio-compare.md) - a core that owns kio waits but no I/O is a third data point From 37040a80ea7b22ac90c0f5f6d162e6fa9bbe8c7e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Wed, 28 Oct 2026 08:26:05 -0700 Subject: [PATCH 3/3] quest(m1): record the sans-IO decision Co-Authored-By: Claude Opus 5.5 --- quest/m1/poll-first/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quest/m1/poll-first/README.md b/quest/m1/poll-first/README.md index 5f7fc4a2ebd..ae334dfc046 100644 --- a/quest/m1/poll-first/README.md +++ b/quest/m1/poll-first/README.md @@ -44,14 +44,16 @@ and their alternatives: parameter is the stackless half of that idea. Sans-IO is the other: the protocol never does I/O and each runtime drives it. - **Sans-IO compared** in [moq-dev/moq#7058](https://github.com/moq-dev/moq/pull/7058), - on the lite subscriber's upstream SUBSCRIBE (prototype on - [`spike/sansio-upstream`](https://github.com/moq-dev/moq/tree/spike/sansio-upstream)). + on the lite subscriber's upstream SUBSCRIBE (an unmerged prototype, since deleted). moq-net already takes I/O through its transport traits and runs on any executor, so sans-IO only buys a core without waiters. That core translated through rust2-ts with 4 refusals, but the serve loop driving it still had 919, so translating a session still waits on the model. Rules became plain `#[test]`s, while interleaving bugs stay in driver tests. Compile cost and the benches were flat. The cost is an effect enum per model touch (+206 lines on this path). + **Decided (maintainer, 2026-10-28):** moq-net's protocol core stays kio poll and + does not move toward sans-IO. Pull pure wire rules into plain functions where + that turns scripted async tests into plain ones, as ordinary refactors. - **Gate the wrappers regardless** of the build measurement, because poll-first is the style moq wants. kixelated/rust2's [semantic API hash quest](https://github.com/kixelated/rust2/blob/main/quest/m3/api-cutoff.md)