Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quest/m2/cluster-routing/routes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ benchmarks.
- [Route layer acceptance](/quest/m2/cluster-routing/routes/acceptance.md) - forwarding fixtures ported and the model deleted, incident fixtures, end-to-end checks, and benchmarks
- [Firefox tabs prove their route key](/quest/m2/cluster-routing/routes/browser-proof.md) - a current Firefox tab opens a lite-07 session with a route-key proof the relay verifies, once neqo's exporter follows the draft
- [Playwright bundles Chromium's spec exporter](/quest/m2/cluster-routing/routes/playwright-pin.md) - the toolchain's Playwright bundles Chromium 158+, so the route key lane proves the Chromium tab
- [Showing an identity's claims costs the claims that changed](/quest/m2/cluster-routing/routes/show-cost.md) - lite-07 session setup and teardown grow linearly with broadcasts, not quadratically per identity

## Related

Expand Down
32 changes: 32 additions & 0 deletions quest/m2/cluster-routing/routes/show-cost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# [M] Showing an identity's claims costs the claims that changed

## Goal

A lite-07 session's setup and teardown cost grows linearly with the
broadcasts it carries, as lite-06's does. One identity holding many claims no
longer makes `show` in `rs/moq-net/src/route/mod.rs` quadratic. The session
bench (`rs/moq-net/benches/session`) and the route bench
(`rs/moq-net/benches/routes.rs`) show it, swept over both axes as the
repository's fan-out rule requires.

## Plan

Planned 2026-11-09 (maintainer, /quest-complete follow-up of
[moq-dev/moq#8352](https://github.com/moq-dev/moq/pull/8352)). βœ… m2, in this
epic (rejected: m4, dropping it).

#8352's session bench measured lite-07 setup at 4096 broadcasts at 4.9 s of
CPU, against 0.5 s for lite-06, and teardown the same. It traced this to
showing one identity's claims: every change re-derives what the identity
shows from all of its claims. That ran on main after
[moq-dev/moq#8293](https://github.com/moq-dev/moq/pull/8293) (routes presented
incrementally), but before
[moq-dev/moq#8374](https://github.com/moq-dev/moq/pull/8374) (a relay folds
received route batches by the claims they change).

Re-measure on current main first. If #8374 already made it linear, record the
numbers in the PR and delete this quest. Otherwise keep what `show` derives up
to date per changed claim instead of recomputing it, and add a route-bench
case swept over claims per identity and claims changed.
Comment on lines +27 to +30

@pullfrog pullfrog Bot Nov 9, 2026 •

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.

Suggested change
Re-measure on current main first. If #8374 already made it linear, record the
numbers in the PR and delete this quest. Otherwise keep what `show` derives up
to date per changed claim instead of recomputing it, and add a route-bench
case swept over claims per identity and claims changed.
Re-measure on current main first. If #8374 already made it linear, record the
numbers in the PR and delete this quest. Otherwise locate the hot path with the
existing route-bench sweeps (and a profile if they stay flat) before changing
`show`, then add a case only if none of the current sweeps covers it.

The fallback here describes work that already exists: Router::show takes the Dirty { all, claims } short-circuit and recomputes only dirty.claims unless the identity's context changed, and the existing route bench already sweeps both relevant shapes (watched/unwatched over claims Γ— streams, received over claims Γ— changes). Because #8374 merged before this commit, its published received numbers (10,000 claims Γ— 1: 4.77 ms β†’ 1.58 Β΅s) suggest the re-measure may be the whole task. If the cost survives, the plan should name how to find the real hot path (Node::home and the view merge are the other candidates) rather than prescribe code that already ships.

Technical details
# `show` is already incremental; `routes` already has both sweeps

## Affected sites
- `rs/moq-net/src/route/mod.rs:348` β€” `Dirty { all, claims }`, the state that makes `show` per claim.
- `rs/moq-net/src/route/mod.rs:1450` β€” `update` sets `dirty.all` only when the identity's `Ctx` changed.
- `rs/moq-net/src/route/mod.rs:1779` β€” `show` computes `shown_now` only over `dirty.claims` unless `all` is set.
- `rs/moq-net/benches/routes.rs:3` β€” `watched`/`unwatched` already sweep one origin claim change over claims Γ— streams.
- `rs/moq-net/benches/routes.rs:9` β€” `received` already sweeps claims Γ— changes, added by #8374.
- `rs/moq-net/benches/session/mod.rs:1976` β€” the `broadcasts` shape (16/256/4096) the plan cites.

## Required outcome
- If the re-measure is still superlinear, identify the actual hot path before prescribing a fix, and update the fallback so it does not repeat behavior that already ships.
- If the re-measure is linear, the plan's own instruction says to delete the quest; recording the measurement here and doing that avoids adding a cut-blocking m2 child for work #8374 may have finished.

## Open questions for the human
- Is #8374's `routes/received` result enough to close this without a fresh session-bench run, or does the session bench exercise a path the route bench does not?


Public API: none expected. Wire: none.