Skip to content

bench(pattern): sweep the worst known peer grant shapes over AUTH_OK size - #7536

Merged
moq-bot[bot] merged 9 commits into
mainfrom
quest/m2/peer-grant-bound
Nov 3, 2026
Merged

moq-bot[bot] merged 9 commits into
mainfrom
quest/m2/peer-grant-bound

Conversation

@kixelated

@kixelated kixelated commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Quest: Bound peer grant processing by design

Summary

This PR lands the benchmark that will prove the peer grant bound, its baseline measurements, and the quest rewritten to the design the maintainer picked (below). The type change itself waits on a /quest-plan that names the received-grant type and decides whether Grant splits, so the quest stays open.

  • rs/moq-pattern/benches/matching.rs: pattern-algebra gains collect-{mask,chain} and covers-{mask,chain}, each swept over 4096, 16384, and 65535 encoded bytes (a whole moq-lite AUTH_OK), with byte throughput so super-linear cost shows as falling throughput. collect is the decode-time reduction; covers is the regrant comparison against a previous grant built so the index reaches the covering member last.
    • mask: equal-weight */y masks ending in y, beside literal y/…/y/xNNNN queries that fail only at the last segment (the Orthogonal Vectors shape).
    • chain: correlated partials a^i*z^(n-i) from the Codex thread.
  • js/pattern/bench/algebra.ts: the same shapes against @moq/pattern. It runs in Chromium through bench/browser/micro.ts --bench pattern (also in the browser smoke lane) and under bun in the nightly JS leg (just js pattern-bench).
  • quest/m2/peer-grant-bound.md: Plan rewritten to the decided design, with the measurements, where each AUTH_OK pays the cost, and the naming and split questions left for the plan. The Goal puts the regrant's route re-match out of scope, linking regrant-route-recheck.
  • Doc comments on Patterns (Rust and JS) and on both union helpers no longer promise that a peer's grant costs about its own size; the mask and chain cases refute it.

Measurements

The 4096 / 16384 / 65535 byte columns are the message size.

Rust, deterministic: user-space instructions for one iteration, from perf stat -e cpu_atom/instructions/u pinned to one core type. Each number is the bench binary's --test run selecting the case minus a run selecting nothing. Repeated base runs agree within 1.5k instructions.

case 4096 16384 65535 growth
collect-mask 5.64M 55.3M 595M bytes^1.7
covers-mask 3.90M 47.5M 555M bytes^1.8
collect-chain 1.94M 11.6M 73.8M bytes^1.3
covers-chain 2.15M 11.6M 74.0M bytes^1.3

For reference, the benign collect-literal/4096 (about 37 KB) costs 12.3M (about 330 instructions/byte). collect-mask/65535 costs about 9,100 instructions/byte, 27 times as much.

Rust, Criterion wall time on a host at load ~20 of 24 cores:

case 4096 16384 65535
collect-mask 0.26 ms 3.58 ms 39.6 ms
covers-mask 0.21 ms 3.25 ms 36.7 ms
collect-chain 0.17 ms 1.35 ms 9.35 ms
covers-chain 0.17 ms 1.34 ms 9.52 ms

JS, Chromium 156 via micro.ts --bench pattern current=. aa=., median of 3 rounds after a warmup. The A/A spread is within about 10%.

case 4096 16384 65535
collect-mask 1.85 ms 22.5 ms 252 ms
covers-mask 1.37 ms 19.7 ms 225 ms
collect-chain 0.60 ms 3.31 ms 24.1 ms
covers-chain 0.35 ms 2.56 ms 20.0 ms

One AUTH_OK pays this more than once:

  • Rust reduces on decode (Patterns::decode) and again in Grant::union (Attached::recompute). Then every moq-lite announce stream's regrant calls Permit::covers, the same index walk, so the cost is K × 37 ms for K announce streams.
  • JS reduces on decode (decodePatterns) and again in union. That blocks the main thread for about 500 ms per mask-shaped AUTH_OK in Chromium.

Decisions

Answered by the maintainer on 2026-11-01, and recorded in the quest's Plan.

1. How to bound peer grant processing

Containment between wildcard patterns reduces to Orthogonal Vectors, so no index can make reduction or covers near-linear on every shape. A bound must change what is computed for a peer's grant.

  1. ✅ Keep received grants unreduced, in their own type. AUTH_OK decodes into a sorted, deduplicated pattern list in O(n log n). The union of received grants is a merge, and equality and Permit::covers become syntactic. Patterns keeps its reduced, set-equality promise for the grants this side issues and verifies, including moq-auth's granted.covers(requested). A /quest-plan settles the received type's name and whether Grant splits before it is implemented, so this PR does not change the type.
  2. Weaken Patterns everywhere to sorted and deduplicated.
  3. Joint prefix/suffix index for partial segments (leaves mask at bytes^1.7).
  4. Refuse an AUTH_OK whose reduction exceeds a work budget.

2. Scope: the regrant's route re-match

  1. Fold a bound for it into this quest.
  2. ✅ Leave it to a follow-up quest. It already exists on main as A regrant re-checks only the routes it can change, and the quest now links it and puts it out of scope in its Goal.

Impact

  • Public API: none.
  • Wire: none.
  • Benchmarks: new Criterion cases in moq-pattern's matching target, which CodSpeed and the nightly already build. There is also a new JS bench in the nightly JS leg and the browser smoke lane.

Choices made without asking

  • The shapes, the sizes (4096, 16384, 65535), and sample_size(10) for the shape cases, so each iteration reducing a whole message keeps the sweep short.
  • Message sizes use QUIC varint widths, which are never smaller than lite's, so each grant fits one AUTH_OK on either encoding.
  • The JS bench joins the nightly JS leg and the browser smoke lane, matching how drift and ledger run.

Checks

On head e959f2c4d631f528f9cc6c5e62fd317e244f4368, after merging main (e5ec95ce15): just check origin/main passed (9908 Rust tests, every module), as did cargo test -p moq-pattern --all-targets and quest check --base origin/main with the repo-pinned quest (moq-dev/quest@5e66075). The branch also merges cleanly into the newer origin/main (9ac02f9a27).

The merge resolved conflicts with main's new buffered browser bench in bench/README.md, bench/browser/micro.ts, bench/browser/run.sh, and sh/gh/nightly.test.py, keeping both the buffered and pattern registrations. Main's smoke-lane coverage test globbed js/*/bench/<name>.ts, which can't find pattern's js/pattern/bench/algebra.ts. It now reads each smoke name's entry from micro.ts's benchmarks table, the same table the harness resolves.

cargo test -p moq-net --all-targets fails in track_range_widening/1r/64 on main itself, so the failure isn't from this PR (this PR's Rust changes are doc comments plus moq-pattern's bench). The failure reproduces on origin/main (e5ec95ce15) and on this PR's previous base, 7ed14bb25. A bisect over rs/moq-net names moq-dev/moq@64cba13 (moq-dev/moq#7545, "end bounded reads"). After the bench narrows its reader back to the already-delivered 0..1, poll_recv_group now returns Ready(Ok(None)) (the bounded read ends) rather than Pending, so the bench's assertion is stale. No open PR fixes it. CI's cargo test skips bench targets, which is why it went unnoticed.

An earlier merge resolved conflicts with main's bandwidth, replay, resume-history, and audio-support benches in bench/README.md, bench/browser/micro.ts, bench/browser/run.sh, sh/gh/nightly.sh, and js/pattern/package.json. Each file keeps both sides.

This PR is unaffected by moq-auth drops the unused peer grant API. That quest deletes moq_auth::PeerGrant, the P2P key-bound grant. This PR measures moq-pattern's Patterns algebra on the grant a remote session sends in moq-lite's AUTH_OK, which stays.

Review

Codex (gpt-6.1-sol, medium effort) via quest review --base origin/main, round 1 on head e959f2c4d631f528f9cc6c5e62fd317e244f4368 (base 9ac02f9a27): no findings. The online reviewers posted no findings on earlier heads: Pullfrog on ee183d9f42 and 9db02fcf5e, and the OpenAI automated review. CodeRabbit was rate limited.

Follow-ups

  • /quest-plan for the received-grant type (the parent session runs it). Open questions, with a recommendation:
    • Split. (a) Split Grant into the issued Grant (reduced Patterns, taken by Request::accept, Issued::update, and Handle::authorize) and a received grant (unreduced list, returned by Handle::grant() and Credential::grant, and held in Permit::granted), in both Rust and @moq/net. (b) Keep one Grant whose fields become the unreduced type, and have the issue side reduce its input. (c) Make Grant generic over its pattern type. Recommended: (a), because each side's type then states its own promise, and the issue side keeps set equality without a conversion at every call.
    • Name and home. For the list: moq_pattern::PatternList / @moq/pattern PatternList (recommended: a pattern-algebra type beside Patterns, shared by Rust and JS, that knows nothing about auth), or a moq-net-private list type. For the received grant, if it splits: PeerGrant (recommended), Received, or Granted.
  • Fix main's stale track_range_widening assertion (see Checks), outside this PR's scope; the parent session plans it.
  • A regrant re-checks only the routes it can change already exists for the route re-match; no new quest is needed.

🤖 Generated with Claude Code

(Written by Claude Opus 5.5)

kixelated and others added 2 commits November 1, 2026 01:28
…size

Adds the mask (Orthogonal Vectors) and correlated partial-chain shapes to the
Rust pattern-algebra benchmark and a matching @moq/pattern sweep that runs in
Chromium through bench/browser/micro.ts, nightly, and the browser smoke lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Bound peer grant processing by design bench(pattern): sweep the worst known peer grant shapes over AUTH_OK size Nov 1, 2026
kixelated and others added 2 commits November 1, 2026 14:03
The maintainer picked keeping received grants unreduced in their own type,
and left the regrant's route re-match to regrant-route-recheck. The type's
name and whether Grant splits wait on a /quest-plan.

Also correct the Patterns and union docs, which promised near-linear cost
that the new mask and chain benches refute.

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

coderabbitai Bot commented Nov 1, 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 21 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: f5cbfd3e-9c5f-4078-9794-84f4dae0499a
Commits

Reviewing files that changed from the base of the PR and between e5ec95c and e959f2c.

Files selected for processing: 15
  • bench/README.md
  • bench/browser/micro.ts
  • bench/browser/run.sh
  • js/justfile
  • js/net/src/auth_session.ts
  • js/pattern/bench/algebra.ts
  • js/pattern/bench/tsconfig.json
  • js/pattern/package.json
  • js/pattern/src/index.ts
  • quest/m2/peer-grant-bound.md
  • rs/moq-net/src/auth.rs
  • rs/moq-pattern/benches/matching.rs
  • rs/moq-pattern/src/patterns.rs
  • sh/gh/nightly.sh
  • sh/gh/nightly.test.py
  • 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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@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: bc17d07

No actionable bugs found in the benchmark additions and wiring. The mask/chain fixtures exercise late containment failures and check that reduction preserves their incomparable members; the browser harness resolves each variant's implementation, and the nightly CSV reader accepts the new dimensions and timing column.

Overall direction: a useful independently landable baseline, not a fix for peer-grant processing. Reusing the existing Criterion/browser/nightly paths keeps the added machinery proportionate. Keeping received grants separate from reduced issued grants targets the underlying cost more directly than another index optimization; the actual type/API change remains explicitly deferred. This PR changes no runtime API or wire behavior.

Verification limits: static GitHub source review only. I did not run tests, benchmarks, or reproduce the reported timings. No prior published reviews were present.

(Written by OpenAI)

@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.

Reviewed changes

A benchmark-and-docs PR: it adds a benchmark that characterizes the worst known peer-grant shapes, wires it into the existing Rust/Criterion, browser, and nightly paths, corrects the doc comments that promised near-linear cost, and rewrites the quest to the design the maintainer picked. No public API, wire, or runtime behavior changes.

  • Rust pattern-algebra cases — {collect,covers}-{mask,chain} swept over 4096/16384/65535 encoded bytes with byte throughput, so a super-linear cost shows as falling throughput. MAX_MESSAGE = u16::MAX correctly matches lite's MAX_MESSAGE_SIZE (rs/moq-net/src/lite/message.rs:8).
  • JS mirror (js/pattern/bench/algebra.ts) — the same shapes against @moq/pattern, emitting 12 rows; runs under bun (just js pattern-bench) and in Chromium via bench/browser/micro.ts --bench pattern.
  • Wiring — browser entry/plugin, run.sh loop, js/justfile, nightly JS leg, and README all updated consistently.
  • Doc corrections — Patterns (Rust and JS) and both Grant::union helpers now name the Orthogonal-Vectors refutation instead of promising near-linear cost.
  • Quest — recorded design and the deferred received-grant type work; links resolve.

I verified locally: cargo test -p moq-pattern --benches --no-run compiles and a debug bench point exercises all setup asserts (fill ratio, incomparable members, previous.covers(reduced)) successfully; bun js/pattern/bench/algebra.ts runs and passes its asserts; tsc --noEmit is clean for bench/browser/tsconfig.json and js/pattern/bench/tsconfig.json; python3 sh/gh/nightly.test.py passes all 14 tests, including test_every_js_bench_runs_nightly. I also confirmed group.sample_size(10) is set after the pre-existing pattern-algebra cases, so those keep 100 samples.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

kixelated and others added 2 commits November 2, 2026 22:29
…ound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's smoke-lane coverage check assumed every micro.ts fixture lives in js/net/bench; the pattern fixture runs js/pattern/bench/algebra.ts, as micro.ts resolves it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026

@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: 9db02fc

No new actionable issues found. Accounting for main's browser benchmark changes, the smoke loop, micro resolver and nightly coverage test agree on the pattern entry. The reported design remains a benchmark and plan rather than a runtime change.

Static GitHub review only; I did not run tests or benchmarks.

@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.

Reviewed changes

Since the prior review, the branch merged origin/main and added one commit that maps the pattern smoke fixture in the nightly coverage test.

  • Merged origin/main — resolved conflicts in bench/README.md, bench/browser/micro.ts, bench/browser/run.sh, sh/gh/nightly.sh, and js/pattern/package.json, keeping both sides. micro.ts adopts main's table-driven ROWS (pattern: 12) and resolves pattern to js/pattern/bench/algebra.ts while the other smoke fixtures resolve to js/net/bench/<name>.ts.
  • Nightly coverage mapping — sh/gh/nightly.test.py now maps the pattern smoke fixture to js/pattern/bench/algebra.ts and the rest to js/net/bench/<name>.ts, matching how bench/browser/micro.ts resolves each entry, so the coverage guard finds the fixture that lives outside js/net/bench. python3 sh/gh/nightly.test.py passes (14 tests).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 3, 2026
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at 9db02fc because it conflicts with main (merge_conflict).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

(written by quest land watch)

@moq-bot
moq-bot Bot enabled auto-merge November 3, 2026 07:48
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

codex / Codex land fixer note:

Merged base and resolved the benchmark registry conflict by registering pattern with its algebra.ts entry and 12 rows in the new registry. Preserved the algebra loading hook. Validation passed with local Nix store dependencies exposed through PKG_CONFIG_PATH, LIBCLANG_PATH, BINDGEN_EXTRA_CLANG_ARGS, PYTHONPATH, and BROWSER_BIN; the local libav build supplied browser bundling dependencies. No tracked environment or protected files were edited.

(written by codex / Codex)

@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

quest land watch: armed auto-merge on this pull request at ee183d9, so it joins the back of the merge queue once its required checks pass, with the land fixer's fix (codex / Codex): Merged base; retained pattern entry in the new benchmark registry and algebra loader. Passed: bun install --frozen-lockfile --ignore-scripts; bun run --cwd js/pattern check/build/test and js/net check/build/test (each script separately); bun run --cwd bench/browser check/test; bun bench/browser/build.ts /tmp/quest-land-7536-browser current=.; bun bench/browser/micro.ts --bench pattern --rounds 1 --out /tmp/quest-land-7536-pattern.json current=. aa=.; cargo test --locked -p moq-pattern -p moq-net.

(written by quest land watch)

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 3, 2026

@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.

Reviewed changes

Since the prior pullfrog review, one commit merged the base and preserved the pattern benchmark registration in the browser harness.

  • Browser registry adopted — bench/browser/micro.ts now uses the base's benchmarks: Record<string, { entry, rows }> map and resolves each entry through selected.entry, replacing the branch's numeric ROWS table and per-benchmark ternary. The resolution resolve(benchmark === "frames" ? root : resolve(import.meta.dir, "../.."), selected.entry) is correct for pattern.
  • Pattern registration preserved — the merge keeps pattern: { entry: "js/pattern/bench/algebra.ts", rows: 12 } and algebra inside the bundle onLoad filter, so the pattern fixture still bundles and gets globalThis.measure = run.
  • Verified — bun js/pattern/bench/algebra.ts emits exactly 12 data rows (plus header), matching rows: 12; python3 sh/gh/nightly.test.py passes all 14 tests, and that guard maps pattern from run.sh's list itself rather than parsing micro.ts, so the registry shape change cannot break it.

No prior pullfrog inline threads were open, so none needed retiring.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 3, 2026
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at ee183d9 because it conflicts with main (merge_conflict).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

(written by quest land watch)

@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

codex / Codex land fixer note:

The failure log shows overlapping benchmark registration changes. Lines 3–13:

Auto-merging bench/README.md
CONFLICT (content): Merge conflict in bench/README.md
Auto-merging bench/browser/micro.ts
CONFLICT (content): Merge conflict in bench/browser/micro.ts
Auto-merging bench/browser/run.sh
CONFLICT (content): Merge conflict in bench/browser/run.sh
Auto-merging js/justfile
Auto-merging sh/gh/nightly.sh
Auto-merging sh/gh/nightly.test.py
CONFLICT (content): Merge conflict in sh/gh/nightly.test.py
Automatic merge failed; fix conflicts and then commit the result.

A trial mechanical merge preserved base's buffered benchmark and this PR's pattern benchmark, listed eight browser fixtures, combined the loader alternatives and smoke loop, and retained base's fixture discovery with the pattern-to-algebra mapping.

Validation of that trial passed: bun run --cwd js/pattern check, build, and test (33 tests); the corresponding js/net commands (2740 tests); bench/browser check and test (10 tests); python3 sh/gh/nightly.test.py (14 tests); python3 sh/gh/test-inventory.test.py (16 tests, with installed PyYAML on PYTHONPATH); shell syntax checks; Biome; and cargo fmt --all -- --check. Chromium runs of bun bench/browser/micro.ts --bench pattern --rounds 1 and the corresponding buffered run passed with current and aa variants.

However, cargo test -p moq-pattern -p moq-net --all-targets, with installed PipeWire, libclang, and libc header paths configured, exited 101:

Testing track_range_widening/1r/64
thread 'main' panicked at rs/moq-net/benches/track.rs:1730:21:
assertion failed: reader.poll_recv_group(&waiter).is_pending()
error: test failed, to rerun pass `-p moq-net --bench track`

The Rust unit tests had passed, but the full requested validation did not. Resolving this assertion needs investigation beyond the allowed mechanical fixes. The trial merge was aborted and pr-7536 remains at its supplied pinned head.

(written by codex / Codex)

@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

codex / Codex land fixer: After mechanically merging base, cargo test -p moq-pattern -p moq-net --all-targets failed in track_range_widening/1r/64: "assertion failed: reader.poll_recv_group(&waiter).is_pending()" (rs/moq-net/b. Recommendation: Merge base preserving both buffered and pattern benchmark registrations and their smoke inventory mappings; investigate the track_range_widening assertion and rerun the Rust checks before landing.

Auto-merging bench/README.md
CONFLICT (content): Merge conflict in bench/README.md
Auto-merging bench/browser/micro.ts
CONFLICT (content): Merge conflict in bench/browser/micro.ts
Auto-merging bench/browser/run.sh
CONFLICT (content): Merge conflict in bench/browser/run.sh
Auto-merging js/justfile
Auto-merging sh/gh/nightly.sh
Auto-merging sh/gh/nightly.test.py
CONFLICT (content): Merge conflict in sh/gh/nightly.test.py
Automatic merge failed; fix conflicts and then commit the result.

(written by codex / Codex)

kixelated and others added 2 commits November 3, 2026 09:07
…ound

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 head e959f2c against base e5ec95c.

P2 — Bound aggregate work on a small regrant (quest/m2/peer-grant-bound.md:33–36). The goal bounds each AUTH_OK by its own bytes, but replacing reduction with a merge alone does not achieve that while every reply rebuilds the union of all live credential grants (rs/moq-net/src/auth.rs:371–377,1030–1034; JS has the same recomputation). A peer can repeatedly send a tiny regrant while other credentials retain large grants, forcing work proportional to the accumulated grants each time. Extend the plan with an incremental, removal-aware aggregate or explicitly change the bound to include existing state, and benchmark many live grants with a small replacement; the current single-grant size sweep cannot expose this case.

The merge retains both the existing buffered and pattern benchmark wiring. Verification: static GitHub review of the plan, auth update paths and benchmark integration; I did not run tests or benchmarks.

@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.

Reviewed changes

Since the prior pullfrog review at ee183d9f4, the branch merged origin/main and added one style commit. The benchmark's own fixtures and doc corrections are unchanged; the delta is harness wiring.

  • Merged origin/main (e5ec95ce1) — brings main's buffered browser bench and its registration in bench/browser/micro.ts, bench/browser/run.sh, bench/README.md, and sh/gh/nightly.test.py.
  • Browser harness adopts main's shape — micro.ts gains buffered and the generalized dir = benchmark === "buffered" ? "js/hang/bench" : "js/net/bench", keeping pattern: { entry: "js/pattern/bench/algebra.ts", rows: 12 } and algebra in the onLoad filter. For pattern, dir stays js/net/bench, but the fixture imports @moq/pattern rather than ../src/, so the onResolve branch never runs for it and the entry still bundles through selected.entry.
  • Conflict resolution in the nightly coverage test — sh/gh/nightly.test.py derives smoke coverage by parsing micro.ts's registry (^\t"?([\w-]+)"?: \{ entry: "([^"]+)") instead of the branch's hardcoded outside map, so pattern resolves to js/pattern/bench/algebra.ts from the same table the harness uses.
  • Style wrap (e959f2c4d) — the bundle onLoad filter object is expanded to multiple lines; no behavior change.

Verified locally: python3 sh/gh/nightly.test.py passes all 16 tests, and bun js/pattern/bench/algebra.ts still emits its data rows. The js/justfile pattern-bench recipe and sh/gh/nightly.sh's nightly JS-leg registration survived the merge.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 3, 2026
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at e959f2c because its merge_group build failed (failed_checks).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

Queue / Queue (job) failure at step Check:

…/moq-gst)
 Documenting moq-ffi v0.4.12 (/var/cache/github-runner-work/moq/moq/rs/moq-ffi)
 Documenting moq-relay v0.17.2 (/var/cache/github-runner-work/moq/moq/rs/moq-relay)
 Documenting moq-rtsp v0.1.0 (/var/cache/github-runner-work/moq/moq/rs/moq-rtsp)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 39s
   Generated /var/cache/github-runner-work/moq/moq/target/doc/hang/index.html and 27 other files
mbx[cache]: object cache: 129 hits, 254 misses, 28 bypassed; 0 B downloaded, 0 B uploaded, 544.2 MiB stored locally
mbx[cache]: 1m 41s session; 3m 28s estimated compiler time avoided (summed across compilations)
mbx[cache]: bypass reasons: 28 rustdoc
mbx[cache]: Cargo artifact reuse and CI cache archive transfers are not included above
mbx[savings]: 876988 compilations old. not one compiled twice.
cargo shear
##[warning]25 unlinked files in `kio`
macros/tests/ui/branch_wait.rs
macros/tests/ui/break_outside_loop.rs
macros/tests/ui/duplicate_wait.rs
macros/tests/ui/every_poll_late.rs
macros/tests/ui/generic.rs
macros/tests/ui/hidden_borrow.rs
macros/tests/ui/hidden_turbofish.rs
macros/tests/ui/hidden_yield.rs
macros/tests/ui/missing_try.rs
macros/tests/ui/not_send.rs
macros/tests/ui/poll_moves.rs
macros/tests/ui/poll_type.rs
macros/tests/ui/segment_type.rs
macros/tests/ui/self_borrow.rs
macros/tests/ui/untyped.rs
macros/tests/ui/wrapper_moved_argument.rs
macros/tests/ui/wrapper_name.rs
macros/tests/ui/wrapper_no_receiver.rs
macros/tests/ui/wrapper_output.rs
macros/tests/ui/wrapper_owned_receiver.rs
macros/tests/ui/wrapper_pattern.rs
macros/tests/ui/wrapper_qualifiers.rs
macros/tests/ui/wrapper_unnameable.rs
macros/tests/ui/wrapper_waiter.rs
macros/tests/ui/wrong_annotation.rs (delete these files)
##[warning]redundant ignore `kio` (remove from ignored list)
##[warning]25 unlinked files in `kio-macros`
tests/ui/branch_wait.rs
tests/ui/break_outside_loop.rs
tests/ui/duplicate_wait.rs
tests/ui/every_poll_late.rs
tests/ui/generic.rs
tests/ui/hidden_borrow.rs
tests/ui/hidden_turbofish.rs
tests/ui/hidden_yield.rs
tests/ui/missing_try.rs
tests/ui/not_send.rs
tests/ui/poll_moves.rs
tests/ui/poll_type.rs
tests/ui/segment_type.rs
tests/ui/self_borrow.rs
tests/ui/untyped.rs
tests/ui/wrapper_moved_argument.rs
tests/ui/wrapper_name.rs
tests/ui/wrapper_no_receiver.rs
tests/ui/wrapper_output.rs
tests/ui/wrapper_owned_receiver.rs
tests/ui/wrapper_pattern.rs
tests/ui/wrapper_qualifiers.rs
tests/ui/wrapper_unnameable.rs
tests/ui/wrapper_waiter.rs
tests/ui/wrong_annotation.rs (delete these files)
##[warning]1 unlinked file in `moq-audio`
src/decode/conformance.rs (delete this file)
# The workspace-hack's table order is `cargo hakari`'s, which `cargo sort` disagrees with.
cargo sort --check --no-format . $(cargo metadata --locked --no-deps --format-version 1 | jq -r '.packages[] | select(.name != "workspace-hack") | .manifest_path | rtrimstr("/Cargo.toml")')
Checking ....
Checking bridge...
Checking moq-mux...
Checking hang...
Checking kio...
Checking macros...
Checking test-env...
Checking bench-harness...
Checking moq-json...
Checking moq-net...
Checking moq-pattern...
Checking moq-tokio...
Checking moq-congestion...
Checking moq-ice...
Checking moq-quic...
Checking moq-sock...
Checking qmux...
Checking moq-shaper...
Checking moq-loc...
Checking moq-msf...
Checking moq-video...
Checking moq-nvenc...
Checking moq-v4l...
Checking libmoq...
Checking moq-archive...
Checking moq-audio...
Checking moq-auth...
Checking moq-bench...
Checking moq-uring...
Checking moq-boy...
Checking moq-c...
Checking moq-cli...
Checking moq-hls...
Checking moq-relay...
Checking moq-stats...
Checking moq-rtc...
Checking moq-rtmp...
Checking moq-rtsp...
Checking moq-srt...
Checking moq-transcode...
Checking moq-e2ee...
Checking moq-ffi...
Checking moq-gst...
Checking moq-native...
Checking moq-net-tests...
Checking moq-room...
Checking moq-sign...
Checking uniffi-bindgen...
Checking fuzz...
Checking fuzz...
Checking fuzz...
Checking fuzz...
cargo hakari generate --diff
python3 sh/rs/hakari.py
##[endgroup]
##[group]test rs
sh/rs/select.sh test "$LIST"
rs: selecting bridge hang moq-archive moq-audio moq-auth moq-bench moq-boy moq-c moq-cli moq-e2ee moq-ffi moq-gst moq-hls moq-json moq-loc moq-mux moq-net moq-net-tests moq-pattern moq-relay moq-room moq-rtc moq-rtmp moq-rtsp moq-sign moq-srt moq-stats moq-tokio moq-transcode moq-uring moq-video qmux 
CARGO_BUILD_WARNINGS=deny RUSTC_WORKSPACE_WRAPPER='/nix/store/4klbl675argl2irhl89zrh2n14wilzx9-rust-minimal-1.98.1/bin/clippy-driver' bash sh/rs/nextest.sh cargo nextest run --locked --tests "$@"
   Compiling moq-pattern v0.1.2 (/var/cache/github-runner-work/moq/moq/rs/moq-pattern)
   Compiling clang-sys v1.9.1
   Compiling moq-quic v0.1.0 (/var/cache/github-runner-work/moq/moq/rs/moq-quic)
   Compiling moq-net v0.3.10 (/var/cache/github-runner-work/moq/moq/rs/moq-net)
   Compiling moq-auth v0.2.1 (/var/cache/github-runner-work/moq/moq/rs/moq-auth)
   Compiling bindgen v0.72.1
   Compiling bindgen v0.70.1
mbx[warning]: prediction was not restored: cached action is missing blob 47aaf27b2f1758f8a3dd252ff5be8dcc58e4b52b02c97c50b39df696e0967d85
   Compiling libspa-sys v0.10.1
   Compiling pipewire-sys v0.10.1
   Compiling moq-vaapi v0.1.0
   Compiling libspa v0.10.1
mbx[warning]: result was not stored: rustc search path kind is not cacheable yet: native
   Compiling pipewire v0.10.1
   Compiling workspace-hack v0.1.0 (/var/cache/github-runner-work/moq/moq/rs/workspace-hack)
   Compiling moq-json v0.5.8 (/var/cache/github-runner-work/moq/moq/rs/moq-json)
   Compiling qmux v0.7.0 (/var/cache/github-runner-work/moq/moq/rs/qmux)
   Compiling moq-loc v0.2.19 (/var/cache/github-runner-work/moq/moq/rs/moq-loc)
   Compiling moq-uring v0.0.12 (/var/cache/github-runner-work/moq/moq/rs/moq-uring)
   Compiling moq-archive v0.0.11 (/var/cache/github-runner-work/moq/moq/rs/moq-archive)
   Compiling moq-tokio v0.19.23 (/var/cache/github-runner-work/moq/moq/rs/moq-tokio)
   Compiling hang v0.21.11 (/var/cache/github-runner-work/moq/moq/rs/hang)
   Compiling moq-stats v0.2.12 (/var/cache/github-runner-work/moq/moq/rs/moq-stats)
   Compiling moq-e2ee v0.0.11 (/var/cache/github-runner-work/moq/moq/rs/moq-e2ee)
   Compiling moq-mux v0.10.11 (/var/cache/github-runner-work/moq/moq/rs/moq-mux)
   Compiling moq-net-tests v0.0.0 (/var/cache/github-runner-work/moq/moq/rs/moq-net-tests)
   Compiling moq-sign v0.0.1 (/var/cache/github-runner-work/moq/moq/rs/moq-sign)
   Compiling moq-relay v0.17.2 (/var/cache/github-runner-work/moq/moq/rs/moq-relay)
   Compiling moq-video v0.1.10 (/var/cache/github-runner-work/moq/moq/rs/moq-video)
   Compiling moq-audio v0.1.10 (/var/cache/github-runner-work/moq/moq/rs/moq-audio)
   Compiling moq-hls v0.5.11 (/var/cache/github-runner-work/moq/moq/rs/moq-hls)
   Compiling moq-srt v0.3.11 (/var/cache/github-runner-work/moq/moq/rs/moq-srt)
   Compiling moq-rtmp v0.3.11 (/var/cache/github-runner-work/moq/moq/rs/moq-rtmp)
   Compiling moq-rtc v0.3.12 (/var/cache/github-runner-work/moq/moq/rs/moq-rtc)
   Compiling moq-rtsp v0.1.0 (/var/cache/github-runner-work/moq/moq/rs/moq-rtsp)
   Compiling moq-gst v0.4.12 (/var/cache/github-runner-work/moq/moq/rs/moq-gst)
   Compiling moq-carla-bridge v0.1.0 (/var/cache/github-runner-work/moq/moq/demo/carla/bridge)
   Compiling moq-cli v0.14.2 (/var/cache/github-runner-work/moq/moq/rs/moq-cli)
   Compiling moq-ffi v0.4.12 (/var/cache/github-runner-work/moq/moq/rs/moq-ffi)
   Compiling moq-transcode v0.1.10 (/var/cache/github-runner-work/moq/moq/rs/moq-transcode)
   Compiling moq-c v0.7.0 (/var/cache/github-runner-work/moq/moq/rs/moq-c)
   Compiling moq-bench v0.0.1 (/var/cache/github-runner-work/moq/moq/rs/moq-bench)
   Compiling moq-room v0.2.11 (/var/cache/github-runner-work/moq/moq/rs/moq-room)
##[endgroup]
error: recipe `test` was terminated on line 303 by signal 15
ci: seconds per module
   117  check rs
   142  test rs (cancelled)
     6  check biome
   227  check js
    25  test js (failed)
    42  check bench
     1  check drill
     4  check quest
     0  check python
    27  check shell
     0  check large_files
     0  check text
     0  check toml
     1  check nix
     0  check justfile
   259  wall time
error: recipe `ci` failed on line 107 with exit code 1
##[error]ci: test js failed
##[error]Process completed with exit code 1.
##[group]Run actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
with:
  name: cargo-timings
  path: target/cargo-timings/cargo-timing-*.html
  if-no-files-found: ignore
  retention-days: 14
  compression-level: 6
  overwrite: false
  include-hidden-files: false
  archive: true
env:
  BASE: 96d432264d14c79912d15002540ef5c0d03f9957
  CHECK_FAIL_FAST: 1
  NEXTEST_TEST_THREADS: 24
  MBX_CACHE_LINKS: 1
  MBX_REMOTE_URL: 
##[endgroup]
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: cargo-timings.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 94528
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 985c37ee834a265c6e421f7ab134a6052279c51024aa92298b7028a8b3e1ca01
Finalizing artifact upload
Artifact cargo-timings successfully finalized. Artifact ID 13263377147
Artifact cargo-timings has been successfully uploaded! Final size is 94528 bytes. Artifact ID is 13263377147
Artifact download URL: https://github.com/moq-dev/moq/actions/runs/41700523666/artifacts/13263377147
Post job cleanup.
##[start-action display=Run jdx/mr-boxington-action@47ce49b32025d93a7a2f4570815afaa2b7092240;id=__3b85208e-62a2-459c-b323-0d8167e307da.mbx]
##[end-action id=__3b85208e-62a2-459c-b323-0d8167e307da.mbx;outcome=skipped;conclusion=skipped;duration_ms=0]
Post job cleanup.
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git version
git version 2.55.0
Temporarily overriding HOME='/var/cache/github-runner-work/_temp/b7b36dbe-8fcb-4a60-b6fa-9e4c590a2881' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --global --add safe.directory /var/cache/github-runner-work/moq/moq
Removing SSH command configuration
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp core\.sshCommand
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git config --local --name-only --get-regexp ^includeIf\.gitdir:
[command]/nix/store/lg46w7hrjx7kylsh6645c9l975i8h43b-git-2.55.0/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
A job completed hook has been configured by the self-hosted runner administrator
##[group]Run '/nix/store/gx2v6q84b0w43bafm0whkdx93qyxbpps-ci-cache-gc.sh/bin/ci-cache-gc.sh'
shell: /nix/store/1mv3qz005gkbalxfghk4y3s8ayv4d2dl-bash-interactive-5.3p15/bin/bash --noprofile --norc -e -o pipefail {0}
##[endgroup]
evicted 389 objects and 14 action results (1.2 GiB logical); 50.0 GiB logical remain
dropped 4 session event streams
evicted 0 objects and 0 action results (0 B logical); 50.0 GiB logical remain
Cleaning up orphan processes

(written by quest land watch)

@moq-bot
moq-bot Bot added this pull request to the merge queue Nov 3, 2026
@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

codex / Codex land fixer note:

The queue failed because the worklet library-build test exceeded its 5000 ms timeout (failure log lines 1322–1324). This PR changes neither that test nor its worklet build implementation. The same five-file shared test command passed locally: 38 tests, including the worklet test in 1.46 seconds. All 2814 affected JS tests, Rust package tests and doctests, the Rust benchmark smoke run, the new JS benchmark, and nightly harness tests passed. No source changes were needed; the PR branch remains at its pinned head. The timeout appears flaky and can be followed up separately.

(written by codex / Codex)

@moq-bot

moq-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

quest land watch: re-enqueued this pull request at e959f2c, at the back of the merge queue, unchanged, since the land fixer judged the failure flaky: bun test js/common/worklet.test.ts: library builds load worklets from a lazy blob or a hosted base, leaving no child process.

(written by quest land watch)

Merged via the queue into main with commit 371dad1 Nov 3, 2026
9 of 10 checks passed
@moq-bot
moq-bot Bot deleted the quest/m2/peer-grant-bound branch November 3, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant