From fd7aafc762a31796a310f47284352e5c927d69fc Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Wed, 11 Nov 2026 13:58:05 -0800 Subject: [PATCH 1/3] chore(quest): claim quest/m0/js-subscribe-drop-hang.md Quest-Claim: fdf829fbda9880f0 From 7909937bc8933c0537d79ce5c59486d84860892d Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:52:34 -0800 Subject: [PATCH 2/3] fix(net): JS subscribe-drop benchmark finishes on lite-07 Lite-07 keeps the Subscribe Stream open past SUBSCRIBE_FINISH, so the bench stops once every group is dropped instead of waiting for the stream's end. Drops are half-open, and the track keeps every group (maxAge null) so all of them are offered. Co-Authored-By: Claude Opus 5.5 --- js/net/bench/subscribe-drop.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/net/bench/subscribe-drop.ts b/js/net/bench/subscribe-drop.ts index 1388d441e8d..794aaca9b12 100644 --- a/js/net/bench/subscribe-drop.ts +++ b/js/net/bench/subscribe-drop.ts @@ -24,7 +24,7 @@ try { const origin = new OriginProducer(); const broadcastRoute = origin.route(Path.from("bench")); const broadcast = broadcastRoute.broadcast; - const track = broadcast.createTrack("video", { timescale: Timescale.MILLI }); + const track = broadcast.createTrack("video", { timescale: Timescale.MILLI, maxAge: null }); for (let sequence = 0n; sequence < BigInt(groups); sequence++) { const group = track.createGroup(sequence); group.writeFrame(textFrame("frame")); @@ -64,15 +64,16 @@ try { server, ); try { + // Lite-07 keeps the Subscribe Stream open past SUBSCRIBE_FINISH, so stop once every + // group is accounted for rather than waiting for its end. let dropped = 0; - for (;;) { + while (dropped < groups) { const response = await decodeSubscribeResponseMaybe( client.reader, Version.DRAFT_07, ); if (!response) break; - if ("drop" in response) - dropped += Number(response.drop.end - response.drop.start + 1n); + if ("drop" in response) dropped += Number(response.drop.end - response.drop.start); } if (dropped !== groups) throw new Error(`dropped ${dropped}, expected ${groups}`); client.writer.close(); From 00c8d4619f5eaf53a64cc09a8ee782778f85ff96 Mon Sep 17 00:00:00 2001 From: Luke Curley <432854+kixelated@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:58:22 -0800 Subject: [PATCH 3/3] quest: finish js-subscribe-drop-hang; follow up on the lone subscriber's drop cost Co-Authored-By: Claude Opus 5.5 --- quest/m0/js-subscribe-drop-hang.md | 25 ----------------------- quest/m0/lite07-compression-bench-hang.md | 4 ---- quest/m4/perf/js-subscribe-drop-single.md | 18 ++++++++++++++++ 3 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 quest/m0/js-subscribe-drop-hang.md create mode 100644 quest/m4/perf/js-subscribe-drop-single.md diff --git a/quest/m0/js-subscribe-drop-hang.md b/quest/m0/js-subscribe-drop-hang.md deleted file mode 100644 index 25827263229..00000000000 --- a/quest/m0/js-subscribe-drop-hang.md +++ /dev/null @@ -1,25 +0,0 @@ -# [S] The JS subscribe-drop benchmark finishes - -## Goal - -`just js bench subscribe-drop` (`js/net/bench/subscribe-drop.ts`) finishes and -prints its rows, and the root cause of its hang is fixed, so -`Nightly (JS benchmarks)` finishes again. - -## Plan - -`Nightly (JS benchmarks)` was cancelled at its 60-minute timeout on every -scheduled run from 2026-11-04 to 11-10; it last passed on 11-02, in about -eight minutes. In -[the 11-10 run](https://github.com/moq-dev/moq/actions/runs/42842827718/job/129922278808) -`subscribe-drop.ts` printed its CSV header -(`publishers,subscribers,groups,drop_us`) and nothing for the job's last 57 -minutes, and the benchmarks after it never ran. The -[11-04 run](https://github.com/moq-dev/moq/actions/runs/41852517544/job/126652296690) -stalled at the same header. Reproduce it locally; if the -hang is in `@moq/net` rather than the benchmark, a test in the merge gate -covers it. - -## Related - -- [session_delivery_compression finishes on lite-07](/quest/m0/lite07-compression-bench-hang.md) - another Nightly benchmark that hangs diff --git a/quest/m0/lite07-compression-bench-hang.md b/quest/m0/lite07-compression-bench-hang.md index 72d618f5f99..89732ec5d88 100644 --- a/quest/m0/lite07-compression-bench-hang.md +++ b/quest/m0/lite07-compression-bench-hang.md @@ -20,7 +20,3 @@ printed `Benchmarking` and nothing for the job's last 34 minutes, so the hang starts with the first lite-07 cell, and every later bench in the job goes unmeasured. Reproduce it locally, bisect against the lite-07 changes if it is a regression, and fix it at the root. - -## Related - -- [JS subscribe-drop finishes](/quest/m0/js-subscribe-drop-hang.md) - another Nightly benchmark that hangs diff --git a/quest/m4/perf/js-subscribe-drop-single.md b/quest/m4/perf/js-subscribe-drop-single.md new file mode 100644 index 00000000000..3a5778a5336 --- /dev/null +++ b/quest/m4/perf/js-subscribe-drop-single.md @@ -0,0 +1,18 @@ +# [S] A lone JS subscriber's drops cost no more than shared ones + +## Goal + +In `just js bench subscribe-drop`, a drop costs no more for 1 publisher and +1 subscriber than for 16 x 16, or the PR that settles this explains why it +must. + +## Plan + +[moq-dev/moq#8520](https://github.com/moq-dev/moq/pull/8520) measured +1190 us per drop at 1 x 1, against 570 us at 16 x 16 and 160-220 us for the +fastest rows. No earlier run gives a baseline. Profile the 1 x 1 row +(`js/net/bench/subscribe-drop.ts`) to see whether the time goes to the drop +path in `js/net/src/lite/publisher.ts`, or to session setup and warmup that +the per-drop division only spreads over fewer drops. Fix a waste the +profile shows; if it is only warmup, make the benchmark warm up before +timing.