Repository navigation
bench(pattern): sweep the worst known peer grant shapes over AUTH_OK size - #7536
Conversation
Quest-Claim: 1e1976c1ccdcc87c
…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>
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>
|
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 21 minutes. View limit details
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. CodeRabbit Verify
|
kixelated
left a comment
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
✅ 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-algebracases —{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::MAXcorrectly matches lite'sMAX_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 viabench/browser/micro.ts --bench pattern. - Wiring — browser entry/plugin,
run.shloop,js/justfile, nightly JS leg, and README all updated consistently. - Doc corrections —
Patterns(Rust and JS) and bothGrant::unionhelpers 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.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
…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
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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 inbench/README.md,bench/browser/micro.ts,bench/browser/run.sh,sh/gh/nightly.sh, andjs/pattern/package.json, keeping both sides.micro.tsadopts main's table-drivenROWS(pattern: 12) and resolvespatterntojs/pattern/bench/algebra.tswhile the other smoke fixtures resolve tojs/net/bench/<name>.ts. - Nightly coverage mapping —
sh/gh/nightly.test.pynow maps thepatternsmoke fixture tojs/pattern/bench/algebra.tsand the rest tojs/net/bench/<name>.ts, matching howbench/browser/micro.tsresolves each entry, so the coverage guard finds the fixture that lives outsidejs/net/bench.python3 sh/gh/nightly.test.pypasses (14 tests).
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
quest land watch: the merge queue removed this pull request at 9db02fc because it conflicts with 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) |
|
codex / Codex land fixer note:
(written by codex / Codex) |
|
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 ( (written by quest land watch) |
There was a problem hiding this comment.
✅ 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.tsnow uses the base'sbenchmarks: Record<string, { entry, rows }>map and resolves each entry throughselected.entry, replacing the branch's numericROWStable and per-benchmark ternary. The resolutionresolve(benchmark === "frames" ? root : resolve(import.meta.dir, "../.."), selected.entry)is correct forpattern. - Pattern registration preserved — the merge keeps
pattern: { entry: "js/pattern/bench/algebra.ts", rows: 12 }andalgebrainside the bundleonLoadfilter, so the pattern fixture still bundles and getsglobalThis.measure = run. - Verified —
bun js/pattern/bench/algebra.tsemits exactly 12 data rows (plus header), matchingrows: 12;python3 sh/gh/nightly.test.pypasses all 14 tests, and that guard mapspatternfromrun.sh's list itself rather than parsingmicro.ts, so the registry shape change cannot break it.
No prior pullfrog inline threads were open, so none needed retiring.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
quest land watch: the merge queue removed this pull request at ee183d9 because it conflicts with 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) |
|
codex / Codex land fixer note:
(written by codex / Codex) |
|
codex / Codex land fixer: 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) |
…ound Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
✅ 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'sbufferedbrowser bench and its registration inbench/browser/micro.ts,bench/browser/run.sh,bench/README.md, andsh/gh/nightly.test.py. - Browser harness adopts main's shape —
micro.tsgainsbufferedand the generalizeddir = benchmark === "buffered" ? "js/hang/bench" : "js/net/bench", keepingpattern: { entry: "js/pattern/bench/algebra.ts", rows: 12 }andalgebrain theonLoadfilter. Forpattern,dirstaysjs/net/bench, but the fixture imports@moq/patternrather than../src/, so theonResolvebranch never runs for it and the entry still bundles throughselected.entry. - Conflict resolution in the nightly coverage test —
sh/gh/nightly.test.pyderives smoke coverage by parsingmicro.ts's registry (^\t"?([\w-]+)"?: \{ entry: "([^"]+)") instead of the branch's hardcodedoutsidemap, sopatternresolves tojs/pattern/bench/algebra.tsfrom the same table the harness uses. - Style wrap (
e959f2c4d) — the bundleonLoadfilter 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.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
quest land watch: the merge queue removed this pull request at e959f2c because its 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.
…/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) |
|
codex / Codex land fixer note:
(written by codex / Codex) |
|
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: (written by quest land watch) |

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-planthat names the received-grant type and decides whetherGrantsplits, so the quest stays open.rs/moq-pattern/benches/matching.rs:pattern-algebragainscollect-{mask,chain}andcovers-{mask,chain}, each swept over 4096, 16384, and 65535 encoded bytes (a whole moq-liteAUTH_OK), with byte throughput so super-linear cost shows as falling throughput.collectis the decode-time reduction;coversis the regrant comparison against a previous grant built so the index reaches the covering member last.mask: equal-weight*/ymasks ending iny, beside literaly/…/y/xNNNNqueries that fail only at the last segment (the Orthogonal Vectors shape).chain: correlated partialsa^i*z^(n-i)from the Codex thread.js/pattern/bench/algebra.ts: the same shapes against@moq/pattern. It runs in Chromium throughbench/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 eachAUTH_OKpays 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.Patterns(Rust and JS) and on bothunionhelpers no longer promise that a peer's grant costs about its own size; themaskandchaincases 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/upinned to one core type. Each number is the bench binary's--testrun selecting the case minus a run selecting nothing. Repeated base runs agree within 1.5k instructions.For reference, the benign
collect-literal/4096(about 37 KB) costs 12.3M (about 330 instructions/byte).collect-mask/65535costs about 9,100 instructions/byte, 27 times as much.Rust, Criterion wall time on a host at load ~20 of 24 cores:
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%.One
AUTH_OKpays this more than once:Patterns::decode) and again inGrant::union(Attached::recompute). Then every moq-lite announce stream'sregrantcallsPermit::covers, the same index walk, so the cost is K × 37 ms for K announce streams.decodePatterns) and again inunion. That blocks the main thread for about 500 ms per mask-shapedAUTH_OKin 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
coversnear-linear on every shape. A bound must change what is computed for a peer's grant.AUTH_OKdecodes into a sorted, deduplicated pattern list in O(n log n). The union of received grants is a merge, and equality andPermit::coversbecome syntactic.Patternskeeps its reduced, set-equality promise for the grants this side issues and verifies, including moq-auth'sgranted.covers(requested). A/quest-plansettles the received type's name and whetherGrantsplits before it is implemented, so this PR does not change the type.Patternseverywhere to sorted and deduplicated.maskat bytes^1.7).AUTH_OKwhose reduction exceeds a work budget.2. Scope: the regrant's route re-match
Impact
moq-pattern'smatchingtarget, 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
sample_size(10)for the shape cases, so each iteration reducing a whole message keeps the sweep short.AUTH_OKon either encoding.driftandledgerrun.Checks
On head
e959f2c4d631f528f9cc6c5e62fd317e244f4368, after merging main (e5ec95ce15):just check origin/mainpassed (9908 Rust tests, every module), as didcargo test -p moq-pattern --all-targetsandquest check --base origin/mainwith the repo-pinnedquest(moq-dev/quest@5e66075). The branch also merges cleanly into the newerorigin/main(9ac02f9a27).The merge resolved conflicts with main's new
bufferedbrowser bench inbench/README.md,bench/browser/micro.ts,bench/browser/run.sh, andsh/gh/nightly.test.py, keeping both thebufferedandpatternregistrations. Main's smoke-lane coverage test globbedjs/*/bench/<name>.ts, which can't findpattern'sjs/pattern/bench/algebra.ts. It now reads each smoke name's entry frommicro.ts'sbenchmarkstable, the same table the harness resolves.cargo test -p moq-net --all-targetsfails intrack_range_widening/1r/64on main itself, so the failure isn't from this PR (this PR's Rust changes are doc comments plusmoq-pattern's bench). The failure reproduces onorigin/main(e5ec95ce15) and on this PR's previous base,7ed14bb25. A bisect overrs/moq-netnames moq-dev/moq@64cba13 (moq-dev/moq#7545, "end bounded reads"). After the bench narrows its reader back to the already-delivered0..1,poll_recv_groupnow returnsReady(Ok(None))(the bounded read ends) rather thanPending, so the bench's assertion is stale. No open PR fixes it. CI'scargo testskips bench targets, which is why it went unnoticed.An earlier merge resolved conflicts with main's
bandwidth,replay,resume-history, andaudio-supportbenches inbench/README.md,bench/browser/micro.ts,bench/browser/run.sh,sh/gh/nightly.sh, andjs/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 measuresmoq-pattern'sPatternsalgebra on the grant a remote session sends in moq-lite'sAUTH_OK, which stays.Review
Codex (
gpt-6.1-sol, medium effort) viaquest review --base origin/main, round 1 on heade959f2c4d631f528f9cc6c5e62fd317e244f4368(base9ac02f9a27): no findings. The online reviewers posted no findings on earlier heads: Pullfrog onee183d9f42and9db02fcf5e, and the OpenAI automated review. CodeRabbit was rate limited.Follow-ups
/quest-planfor the received-grant type (the parent session runs it). Open questions, with a recommendation:Grantinto the issuedGrant(reducedPatterns, taken byRequest::accept,Issued::update, andHandle::authorize) and a received grant (unreduced list, returned byHandle::grant()andCredential::grant, and held inPermit::granted), in both Rust and@moq/net. (b) Keep oneGrantwhose fields become the unreduced type, and have the issue side reduce its input. (c) MakeGrantgeneric 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.moq_pattern::PatternList/@moq/patternPatternList(recommended: a pattern-algebra type besidePatterns, 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, orGranted.track_range_wideningassertion (see Checks), outside this PR's scope; the parent session plans it.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)