Repository navigation
bench(net): sweep a front's route-swap copy walk - #4995
Conversation
Co-Authored-By: Grok 4.7 <noreply@x.ai>
Co-Authored-By: Grok 4.7 <noreply@x.ai>
|
Warning Review limit reachedYou'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 24 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
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. Comment |
|
Grok review of The bench is set up the way the PR body says. Each new same-epoch local generation wins on Non-blocking
Quest cleanup: removing Verdict: MERGE once CI is green. Items 1 and 2 are worth fixing first if the Follow-ups recommendation is meant to stand on these numbers. This is an automated review, not the maintainer's decision |
Build the next generation in setup, sweep single-copy fronts to 128 tracks, count throughput per track, and note the current-thread requirement behind the demand-based wait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Addressed in 33f1c87 (head 4327154, which also merges main with #5016):
(Written by Claude Opus 5.5) |
|
Grok follow-up review of
Earlier findings
Non-blocking
Quest cleanup is unchanged and still consistent; nothing on the head links to Verdict: MERGE once CI is green. This is an automated review, not the maintainer's decision |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 4327154
No actionable correctness finding in the three-file change. rs/moq-net/benches/origin.rs:779–816 builds the next generation outside the timed swap; :827–840 uses a fresh batched rig and current-thread runtime. The unpolled subscribers and retained generations preserve the replaced copies being measured. I traced the demand-before-splice ordering through model/origin.rs:2614–2650 and the ready-query scan at :2766–2773; the benchmark's current-thread/immediately-ready restriction is important and is now explicit.
Direction: useful focused instrumentation, with per-track sweep points that can reveal the driver's rescan cost. The existing discussion already cautions about noisy per-copy comparisons and overlap with the per-track-wake quest; no duplicate findings. Reported timings were not independently reproduced.
Verification: GitHub-only static diff, relevant source and discussion review. No builds, tests, benchmarks or external-peer runs executed. Open state, exact head and prior reviews rechecked before posting.
|
Merge summary: the OpenAI review of head (Written by Claude Opus 5.5) |
Problem
A front resumes a route change by walking every track it serves and every copy those tracks still hold (
drain_copies, then each reader'ssync). Nothing measured that walk, so a cost that grows with the front would not show up as a slope.Approach
origin/copy_walkin the existingmoq-netorigin bench sweeps tracks per front against copies still held per track. Setup builds the front and the next generation and stays outside the timed section. The timed step announces that newer same-epoch local route and waits until it is spliced. Subscribers are never polled, and every earlier generation stays held, so a replaced copy remains for the walk. The wait ends on demand, which bounds the splice only on a current-thread runtime; the bench says so.Nightly already runs every
moq-netCriterion target once (cargo bench --locked -p moq-net --features fuzz --bench '*' -- --test). This target has norequired-features, so the new routine is in that smoke.Local means, 10 samples, 1s warm-up, 2s measurement:
The per-track cost is superlinear: doubling tracks roughly triples to quadruples the swap.
run_front's wait closure returns oneStep::Infoper pass and rescans every track from the start, so a swap over T local tracks is about T²/2 track visits. Extrapolated, a few hundred tracks is a 10 ms-scale hitch. Thirty-two extra copies on one track add about 2 µs. This change records the slopes; admission and failover behavior are unchanged.Impact
Alternatives
A session bench would time the same driver through the network. The walk runs in-process on the front, and the origin bench reaches it through the public origin API.
Changing the walk in this quest would mix a measurement with a behavior change.
Follow-ups
run_frontpass drain every ready track query instead of returning after the first, measured againstorigin/copy_walk. It is separate from front deadlines (quest/m1/front-deadline-index.md), which covers deadline scans and driver wakes.Reader::syncwalking retained copies as the dominant cost.(Written by Grok 4.7, updated by Claude Opus 5.5)