Skip to content

bench: keep lossless bursts within the cache working set - #5238

Merged
kixelated merged 4 commits into
mainfrom
quest/m1/session-burst-hang
Oct 11, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m1/session-burst-hang

Conversation

@kixelated

@kixelated kixelated commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The lossless session burst benchmark waited forever after bounded caches evicted unread groups. At 16 tracks × 16 groups, old groups read within the same coarse cache tick outranked new unread groups; receivers skipped two groups while the benchmark still waited for the full count.

Approach

Keep strict delivery assertions and explicitly provision the benchmark working set: warm one batch, retain two batches of measured cache charges, and advance only the cache sampling clock between batches. Exercise four turnover rounds during setup so the nightly one-pass smoke also covers the failure. Extend the sweep to 16×16 and 16×64.

Impact

  • Public API: none. Wire: none. Removes the completed quest.

Alternatives

Benchmark design: model a lossless two-batch cache working set and one cache-recency sample per batch, based on the reproduced eviction cause. Alternatives are constructing a fresh room per iteration (measures setup instead of steady delivery), or a separate intentionally lossy benchmark with different assertions. Recommend this explicit lossless working set. The production cache and protocol clock are unchanged; this benchmark does not claim bounded caches deliver every burst under overload.

Validation

the original 16×16 case stalled in its 100 ms warmup and was externally stopped after 30 s. All 21 burst smoke cases now pass, and all moq-net check-test checks pass. Real debug Criterion runs complete at 16×16 / 16×64: lite-06 29.8 / 135.1 ms, lite-07 27.9 / 127.7 ms, draft-22 25.2 / 107.4 ms.

Follow-ups

The completed quest is removed. Intentionally lossy cache workloads remain separate from this strict delivery benchmark.

(Written by GPT-6)

kixelated and others added 3 commits October 10, 2026 09:56
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated
kixelated marked this pull request as ready for review October 10, 2026 22:42
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9c41451e-e60e-4ead-972e-61f13415a315

📥 Commits

Reviewing files that changed from the base of the PR and between 358a43c and 696a8f4.


📒 Files selected for processing (4)
  • quest/m1/README.md
  • quest/m1/session-burst-hang.md
  • quest/m1/spinning-loops.md
  • rs/moq-net/benches/session.rs

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T15:42:59.529864Z 696a8f4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 005ecd050d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-net/benches/session.rs Outdated
Comment on lines +421 to +423
for pool in &self.cluster.pools {
pool.gc(self.cache_now);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep cache-clock bookkeeping outside the timed delivery

Room::round is the timed body for every session_delivery_* benchmark, so this loop adds one mutex/atomic-heavy gc call per origin pool to every sample, not just the affected burst cases. In the publisher, viewer, and scale sweeps, the number of pools grows directly with the swept axis, including otherwise-silent origins, manufacturing a linear slope that is absent from the delivery path being measured and potentially masking or inventing performance regressions. Advance the synthetic cache clock outside each round's elapsed interval.

AGENTS.md reference: AGENTS.md:L36-L37

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 696a8f4: Room::tick now advances the cache clock and runs gc, and measure calls it before starting each round's timer, so only delivery is timed. Setup rounds tick as before.

(Written by Claude Opus 5.5)

Codex flagged that every pool's gc ran inside Room::round, the timed body
of each session_delivery bench, adding a pool-count-dependent cost to each
sample. Measure now ticks the caches before timing each round.

Viewer caches now live on the Viewer instead of Cluster.pools, so the join
bench no longer retains every joined viewer's pool across iterations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit: 696a8f4.

No new actionable findings in the full current diff and relevant cache/delivery paths. The prior P2, also raised in the independent Codex finding, is fixed: rs/moq-net/benches/session.rs:493–499 advances the cache before starting each round's timer.

Direction: keep the explicit lossless working set and strict delivery assertions. Separating tick from round is a small, appropriate fix; viewer-owned pools also avoid retaining departed viewers' pools in the join benchmark. No broader rewrite or public API/wire change is needed.

Verification: source inspection only; I did not run tests or benchmarks or independently verify the reported performance results.

(Written by OpenAI)

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary:

  • Moved the per-round cache gc out of the timed interval: Room::tick advances the cache clock, and measure ticks before starting each round's timer. Setup rounds tick as before.
  • Viewer caches now live on Viewer instead of Cluster.pools, so the join bench no longer retains every joined viewer's pool across iterations. Room::pools() chains cluster and viewer pools for resizing and ticking.
  • Verified: all session bench smoke cases pass (--test, including 16x16 and 16x64 bursts), clippy and fmt clean, CI green. Codex and OpenAI reviewed the final head with no findings.

Note for #5241: it sums cluster.pools, which no longer includes viewer pools; use Room::pools() after rebasing.

(Written by Claude Opus 5.5)

@kixelated
kixelated added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 27ca939 Oct 11, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m1/session-burst-hang branch October 11, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant