feat(bb.js): paired A/B Chonk bench mode in browser-test-app#23472
Draft
AztecBot wants to merge 2 commits into
Draft
feat(bb.js): paired A/B Chonk bench mode in browser-test-app#23472AztecBot wants to merge 2 commits into
AztecBot wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a paired A/B benchmarking mode to the existing bb.js
browser-test-appso PR-vs-base Chonk prove comparisons on real BrowserStack hardware produce statistically defensible numbers, reusing the harness we already trust instead of a separate minimal rig.What it does
window.runChonkAb(options)(auto-runs on a base64url?bench=param) runs a Chonk prove repeatedly, interleaving twobb.wasmvariants on the same device in one session (alternating order per pair to remove first-mover bias), then reports the paired median Δ with a bootstrap 95% CI. Variant selection is at runtime via bb.js's existingwasmPathoption — both binaries are hosted side by side, no rebuild and no second bundle:memMaxPagesmaps toBarretenberg.new({ memory: { maximum } })(set 16384 = 1 GiB on iOS Safari, which rejects the default 4 GiB SAB).Why
Between-session variance on real devices (different physical unit, thermal state, co-tenant) dwarfs single-digit prover deltas. Pairing both variants back-to-back on one device, N≥10 times, and reporting a CI is what distinguishes a real 3–6% delta from noise — or honestly reports that it cannot be distinguished. See
BENCH.md.Files
src/index.ts—wasmPath/memorypassthrough onproveChonk; newinstallChonkAbGlobal()(interleave loop, bootstrap-CI stats,/progress+/resultPOST,window.__benchResult).scripts/serve-bench.mjs— node server hostingdest/,/wasm/<variant>/,/inputs/<flow>/ivc-inputs.msgpack,/progress+/resultsinks, with COOP/COEP for SAB. bb.js fetches CRS from the public CDN, so no CRS proxy.package.json—serve-benchscript.BENCH.md— usage, the reporting rule (no signed delta when the CI crosses zero), and the iOS two-session workaround.Verification status — DRAFT, not yet validated
yarn buildof the app + a paired-A/B smoke run on at least one desktop and one mobile BS target, confirming verified proofs and a populatedpairedblock. I can run that as the next step.Methodology background: https://gist.github.com/AztecBot/0483ec5b0293ff9e31621ad035854eb0 · protocol: https://gist.github.com/AztecBot/a8d3e5c14475c8fb5af520706e408222
This consolidates browser benching onto bb.js and supersedes the unmerged
codex/browserstack-wasm-benchminimal harness (andbarretenberg-claude#3799).Created by claudebox · group:
slackbot