Repository navigation
fix(moq-net): the relay's drop poll stops locking the track for a revision it rarely needs - #8979
Conversation
Quest-Claim: 5361f58f45b58427
…received run needs a check The fan-out harnesses also build against the start-addressed group API again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntion Records the attribution and the fix's measurements in release-perf.md, finishes the relay CPU quest, and plans the track-lock passes and the chat startup loss. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: bd496465ab3366233ea2c1a48d6799a08b54777c.
I’d land the lock fix. When there are no queued received stale runs, there’s nothing for the revision to invalidate. Once a run is queued, the next poll still reads the revision before forwarding it. No code blocker found.
I wouldn’t call the release comparison cleared yet. The reported medians still show +13.9% chat and +17.5% fanout CPU per delivered frame versus release (respectively +10.4% and +7.8% pinned). Some chat rounds mixed startup losses and backlog into the measured window, and the measured variant kept the spare chunk this PR drops. Before accepting the residual for the cut, pair the exact candidate with release on the same host, report startup group loss separately, and compare steady-state windows at the same delivery rate. That does not require landing the larger lock rework first.
Static review only; I did not rerun benchmarks or tests.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the drop-poll fix in resume::Reader::poll_drop, the two bench/fanout harness updates, and the perf record plus quest bookkeeping.
- Drop poll skips the track lock when nothing was received:
poll_dropnow readsstale_revision()only whenreceivedis non-empty. While it is empty,received_checkedkeeps its last value, so the first poll after a run is received may recheckreceivedone extra time. That recheck costs O(received), and the result stays correct.stale_revisionis a monotonic counter (track.rs,stale_revision += 1), a run joinsreceivedonly afterstale_heldreported it held, andsyncstill resetsreceived_checkedtoNonewhen the generation changes. A matching revision therefore still proves the run is held. - Bench harness builds again:
bench/fanout/{model,session}now callappend_group(start),Timestamp::from_millis,group::Producer::close(), andorigin::Config::new(NonZeroU64). All four match the currentmoq-netsignatures. - Perf record:
.github/release-perf.mdadds the Relay CPU attribution and the fix's numbers. It also says therelease-to-fix runs included the spare-chunk transport change that was not taken (about 0.4% of achatframe). - Quests: deletes
quest/m2/relay-cpu.mdand adds the m3 follow-upsrelay-track-lock.mdandchat-startup-loss.md.
claude-opus-5-5 | 𝕏
|
No actionable comments were generated in the recent review. WalkthroughThe changes update Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the last review at bd49646, the branch merged origin/main and updated the fan-out bench harnesses to match main's group API.
- Timestamp-started groups in the bench harnesses:
bench/fanout/{model,session}now calltrack.append_group(at)andwrite_frame(at, …)withat = Timestamp::from_millis(start), thengroup.finish(). These calls matchtrack::Producer::append_group(&self, start: Timestamp),Timestamp::from_millis(u64) -> Result, andgroup::Producer::finish(self)on the current head. Both harnesses create their track withTimescale::MILLI, so the rescale inappend_groupcan't fail. - README revision floor:
bench/README.mdnow says themodelharness builds against revisions since #8961, and the example command compares againstorigin/main. - Quest index: the merge removed the
relay-cpulink fromquest/m2/README.md, since this PR deletes that quest file.
claude-opus-5-5 | 𝕏
…butes fanout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed the automated review on (Written by Claude Opus 5.5) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 499791330c07cb93cb9eccf3f50cea4e19f0ae45.
The new same-host pairing addresses the measurement request: it compares the fix without the spare chunk and separates startup loss. At the offered delivery rate, the three chat pairs still cost +8.7%, +22.1%, and +25.3% CPU/frame; fanout's five-pair median is +18.8%. Video improves by 15.2% at the median. Chat’s startup loss is reduced but not gone (0.3–1.1% of groups versus none on release).
I’d land the lock fix. Treat the remaining CPU cost and the startup delivery loss as separate release decisions, not as cleared benchmarks. In particular, don’t dismiss the startup loss on the strength of the steady-state runs. I reviewed the recorded results; I did not rerun them.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the last review at d762859, the branch only updated docs.
- Fanout attribution in the perf record:
.github/release-perf.mdnow splits the owner table and futex numbers bychatandfanout, and says the contention is work under the track lock as well as waiting for it. - Exact-head release pairing: the release-to-fix medians come from 5 rounds, and the text notes which
chatrounds ran below the offered rate and the startup group loss. - Follow-up quest goal:
quest/m3/relay-track-lock.mdnow coversfanoutas well aschat, with matching numbers in its decision text.
No code changed, so the earlier poll_drop review still holds.
claude-sonnet-5-5 | 𝕏
|
Maintainer decision (2026-11-16, /quest-run): merge. Keep both follow-ups. For quest/m3/relay-track-lock.md: ✅ the cut does not wait on it, and it follows the cut in m3 (rejected: moving it to m2). Keep quest/m3/chat-startup-loss.md. (Written by Opus 5.5) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
quest land watch: ended this pull request's pick, taking it out of the queue, since its head 4997913 is held by decision by kixelated: Maintainer decision (2026-11-16, /quest-run): merge. Keep both follow-ups. For quest/m3/relay-track-lock.md: ✅ the cut d (#8979 (comment)). Push a fix, or answer each by a thread reply or a comment linking its review or decision, then land it again. (written by quest land watch) |
|
Answered the maintainer decision in 0b40501: (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the last review at 4997913, the branch updated one quest file and merged origin/main. The merge changed nothing else in this PR's files.
- Release decision recorded:
quest/m3/relay-track-lock.mdnow records the maintainer's 2026-11-17 decision that the release cut does not wait on this work, which follows the cut in m3. The "Waiting" section that asked for that decision is removed.
No code changed, so the earlier approval of the poll_drop fix still holds.
claude-opus-5-5 | 𝕏

Finishes quest/m2/relay-cpu.md.
Problem
The relay memory pairing (moq-dev/moq#8943) measured
main's relay at +43% CPU per delivered frame inchatand +35% infanoutagainstrelease, the opposite of the 2026-11-05 pairing. The cut waits on a named cause.Approach
Attributed with
just bench-profile instructions chat 8 tokio-workers origin/releaseby owner (transport, session, origin). Transport is 29k instructions per frame cheaper thanrelease, session 8k cheaper, origin (moq_net::model) 62k dearer. The net growth is lock contention: futex syscalls rose from 2.4k to 19.7k instructions per frame, nearly all on the track's sharedTrackStatelock. Every subscriber wakes on each group at once, and the publisher's track side (TrackRun::poll_track) takes that lock several times per pass to forward drops and judge misses, three passes per group. Contention grows with workers, so the host matters (8 pinned CPUs on 2026-11-05, 32 here).resume::Reader::poll_dropread the serving copy's stale revision through the track lock on every poll, even with no received stale run to check (moq-dev/moq#8867). It now reads it only when a received run is held.bench/fanout/{model,session}build again against the timestamp-started group API (moq-dev/moq#8638, moq-dev/moq#8961) and the privateHop; the README says which revisions the model harness builds against..github/release-perf.mdgains a Relay CPU section with the attribution for both workloads, the fix's numbers, and the remaining cost recorded as the price of drop forwarding and fills. The quest file is deleted.Impact
Alternatives
chatframe, but holds 8 KiB on every idle connection (16 MiB acrosschat's 2,001). Measured and dropped.Decisions
Validation
All on
fedora(32 CPUs, shared, one-minute load 24 to 66); per-round numbers are inrelease-perf.md.just bench-profile instructions chat 8 tokio-workers "<release> <main>", 4 alternating rounds: futex instructions per framerelease2.3k,main8.5k, the fix 4.7k; total 161.2k / 164.8k / 164.0k.just bench-relay <main> quic, 5 rounds: the fix lowerschatrelay CPU per frame by a median 11.5% (four of five pairs lower);fanoutandvideowithin noise.just bench-relay <release> quicagainst this exact head, 5 rounds (addressing the automated review onbd49646):chat+8.7% (-5.3 to +25.3; +8.7 to +25.3 in the three pairs at the offered rate),fanout+18.8% (-6.8 to +38.2),video-15.2%. The fix lost 0.3% to 1.1% ofchat's groups during startup,releasenone.just bench-profile instructions fanout 8 tokio-workers "<release> <main>", 3 rounds:release170.7k,main219.7k, the fix 218.7k instructions per frame; the growth is origin (+73k) and its lock (futex 12.6k to 33.8k), which the fix does not reach.just bench-fanout <main>with callgrind: single-threaded counts unchanged (session113.7k to 113.6k per group at 512), which shows the fix's effect is contention, not work; the call counts give the passes per group.cargo nextest run -p moq-net --all-features(4,051 passed),just check,just ci.Caused by
Follow-ups
chat(+8.7%) andfanout(+18.8%) gap. Kept; decided 2026-11-17 (maintainer, comment): the cut does not wait on it, it follows the cut in m3 (rejected: moving it to m2). Recorded in its Plan by 0b40501.main's relay loses whilechat's viewers join. Kept (maintainer, 2026-11-17). No open decisions.Models
Size: M
Implementer: Claude Code, claude-opus-5-5, unknown effort
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)
Review
Rewritten by
quest reviewafter each round.Head: 9edfed2
Base: origin/main at 93af504
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1e761-9e07-7490-a016-a8b1b513c3bf, round 4Score: 9/10,
The incremental change records the release decision, and the merge introduces no actionable findings in the branch’s own changes; builds and tests were not run, as instructed.Rounds: 4; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none