Skip to content

fix(bench): the routes bench counts what the lite-07 route node queues - #9090

Open
kixelated wants to merge 1 commit into
mainfrom
fix/routes-bench-counts
Open

kixelated wants to merge 1 commit into
mainfrom
fix/routes-bench-counts

Conversation

@kixelated

@kixelated kixelated commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Nightly's moq-net/routes bench panics before measuring: routes/refollow asserts the node queues one output per claim (left: 4, right: 1 on main), and routes/received asserts one forwarded batch per change (left: 200, right: 101). Both counts describe a router the lite-07 route node never was: the node sends each Ask edit as its own wire message, withdraws a dropped prefix's claims before serving them again, and sends one Announce per claim changed (Router::export in route/relay.rs).

Approach

The two assertions count what the node actually queues:

  • refollow: 2 + 2 * claims, the remove and add edits, and each claim withdrawn and served again.
  • received: 2 * changes, each changed claim served into the origin and forwarded.

The refollow doc line also says "stops asking for a prefix" rather than "closes its stream", which the node no longer does.

Impact

  • None: bench-only.

Alternatives

  • Batching a flush's per-claim Announces into one message per peer would make the old changes + 1 true, but the lite-07 publisher encodes each claim as its own AnnounceBroadcast regardless, so it saves nothing on the wire.

Validation

  • cargo bench -p moq-net --features fuzz --bench routes -- --test reproduced the panic on 4f3ba3317f; with a non-panicking check every other routes case already matched, only received/*_100d and refollow/* differed.
  • After the fix, a full (non---test) run of every routes case with short warm-up/measurement passes, so the counts also hold across repeated iterations on the kept fixture.
  • Printed the queued outputs for refollow/16p_1c and received/100c_100d to confirm the new counts are the messages described above, not something spurious.
  • just check passes.

Caused by

  • moq-dev/moq#8987 - rewrote RouteFollower/RouteRelay onto the lite-07 route node but kept the old router's output counts in the bench assertions (found by check: Nightly).

Follow-ups

  • Same Nightly job: moq-net/publisher wake/8192 setup is O(drops x ranges) since moq-dev/moq#8638, which pushes the job past its timeout; tracked separately.

Models

Size: S
Implementer: Claude Code, claude-opus-5-5, unknown effort

(Written by Claude Opus 5.5)

Review

Rewritten by quest review after each round.

  • Head: 073e654

  • Base: origin/main at 4f3ba33

  • Risk: medium, the base has no RISK.md to name what is always high or customer-facing, so every change is medium

  • Classified: medium by default

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1efc4-9c01-77b0-9594-276196a143de, round 1

  • Score: 10/10, The updated assertions match the route fixtures, and source inspection identified no defects; builds and tests were not run.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

…the node queues

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 18, 2026 17:48

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Approach: sound — the bench assertions are updated to count what the lite-07 route node actually queues, rather than changing the node to match the old counts.

Reviewed changes — the single-file diff to rs/moq-net/benches/routes.rs.

  • routes/refollow — the assertion now expects 2 + 2 * claims (two Ask edits, plus each claim withdrawn and served again), and the doc line says "stops asking for a prefix".
  • routes/received — the assertion now expects 2 * changes (each changed claim served into the origin and forwarded).

I did not run the bench. The PR description reports a reproduced panic on main and a passing full run after the fix.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@coderabbitai

coderabbitai Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The refollow benchmark description now states that the node stops and resumes its request for a prefix. The bench_received expected work count changes to 2 * changes. The bench_refollow expected work count changes to 2 + 2 * claims. Comments in both benchmarks describe the work represented by these counts.

Merge Risk: Minimal · up to 073e6

This updates benchmark expectations to match the current route node's output counts. It has no production impact and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the routes bench now counts the outputs that the lite-07 route node queues. It is specific and matches the raw summary, which changes the expected counts in bench_rece…
Description check Passed The description states the problem (the Nightly routes bench panics on outdated assertion counts), the approach (new counts 2 + 2 * claims and 2 * changes), the doc wording change, validation steps, a…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the routes bench now counts the outputs that the lite-07 route node queues. It is specific and matches the raw summary, which changes the expected counts in bench_received and bench_refollow. It uses a conventional fix(bench) prefix and stays under typical length limits.

Full details: Description check

Explanation

The description states the problem (the Nightly routes bench panics on outdated assertion counts), the approach (new counts 2 + 2 * claims and 2 * changes), the doc wording change, validation steps, and the originating PR. These match the raw summary, which covers the same assertion and doc changes in rs/moq-net/benches/routes.rs. It is related to the changeset in substance.

Finishing Touches

Simplify code

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe21723d-dc8d-4ac7-be14-08369ac9a41e
Commits

Reviewing files that changed from the base of the PR and between 4f3ba33 and 073e654.

Files selected for processing: 1

  • rs/moq-net/benches/routes.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

This branch has not been deployed

No deployments
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