Skip to content

quest: a route arrival re-ranks only what it changes - #9525

Merged
kixelated merged 1 commit into
mainfrom
quest-plan/claim-arrival-rank
Nov 24, 2026
Merged

kixelated merged 1 commit into
mainfrom
quest-plan/claim-arrival-rank

Conversation

@kixelated

@kixelated kixelated commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Adds quest/m3/claim-arrival-rank.md: a route arriving at a path re-ranks only what it changes, so a burst of N claims at one path is linear per reader instead of quadratic.

Summary

moq-dev/moq#9371 found that in js/net each lite-07 claim arrival re-picks every instance at its path (82 to 84 ms at 1024 instances with one reader on main, 2.7 to 2.9 s with 32), and added js/net/bench/routed-claims.ts. Checked for the same shape elsewhere:

  • JS BroadcastCache re-runs a full mostSpecific for every consumed path under the prefix on each announce and withdraw.
  • Rust's origin has it too: sync_route re-sorts every entry at the prefix on each change, then each cursor rescans it. origin/announce_duplicate here: one arrival costs 3.1 µs at 1 route and 1 cursor, 4.7 µs at 30 and 1, 143 µs at 60 and 60, 286 µs at 240 and 60, 1.12 ms at 240 and 240. So the quest covers both languages, benchmarked over routes and readers.

Placed in m3 as decided; nothing found makes it block a release (cost only, at hundreds of routes on one path). Sized L: three selectors in two languages whose arrival-order tie-breaks must come out identical, checked against today's full pick as an oracle. It requires quest/m1/lite07-routing/origin-route-rank.md, since #9371 is still open and changes the ranking this makes incremental; quest check --fix drops that link once it lands. Fronts' re-selection below the prefix stays with quest/m3/route-wakes.md.

Overlap checked: the quest tree, and every open PR's changed files (quest pr list). PRs touching the same source files (moq-dev/moq#9437, #9477, #9491, #9505, #9508) do other work.

Impact

Quest tree only. No public API or wire change.

Validation

quest check: 505 documents ok. The Rust numbers above are from cargo bench -p moq-net --features fuzz --bench origin -- origin/announce_duplicate on main (e56d723); the JS numbers are #9371's.

Follow-ups

None.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, high effort

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high)

Review

Rewritten by quest review after each round.

  • Head: 4161fef

  • Base: origin/main at 8e2ae08

  • Risk: low, The change only adds one quest plan document (quest/m3/claim-arrival-rank.md) and no code, config, API, wire, or release file; if it is wrong, the worst outcome is a misleading plan for future work, and a revert removes it completely.

  • Classified: low by Claude Code, claude-haiku-5-5, low effort, session 0ef79f73-4cc4-4206-b5bf-bfdaebd6b088

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

  • Session: 01a20bbc-3a5a-7910-a43b-812580174118, round 1

  • Score: 10/10, The change is ready to land as a plan, with no actionable defects found.

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

  • Findings: none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 24, 2026 04:07
@coderabbitai

coderabbitai Bot commented Nov 24, 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 6 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

  • 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: 02b94aaa-dc85-4dc2-8e63-224d822e3140
Commits

Reviewing files that changed from the base of the PR and between 8e2ae08 and 4161fef.

Files selected for processing: 1

  • quest/m3/claim-arrival-rank.md
  • 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

@kixelated
kixelated enabled auto-merge November 24, 2026 04:08

@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 — a plan-only quest that makes route arrival ranking incremental in both js/net and moq-net, with the current full pick kept as a test oracle.

Reviewed changes

Reviewed the single added document, quest/m3/claim-arrival-rank.md, and confirmed its linked quests exist.

  • Goal and done criteria: linear per-reader cost for a burst of claims, measured by routed-claims.ts and origin/announce_duplicate.
  • Plan: covers the three selectors (Routed, BroadcastCache, sync_route), keeps the arrival-order tie-breaks identical, and leaves fronts' re-selection to route-wakes.
  • Links: Required and Related all resolve.

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

@kixelated
kixelated added this pull request to the merge queue Nov 24, 2026
Merged via the queue into main with commit 555c0e3 Nov 24, 2026
7 checks passed
@kixelated
kixelated deleted the quest-plan/claim-arrival-rank branch November 24, 2026 04:52
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