ci: compare the browser timings with the base commit (P73) #322
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #322"
general
weight: 0.35
abendrothj
What and why
Closes #185 (P73). The last open item on it was "a regression run for the browser timings" (
docs/BENCHMARKS.md, "Still to come"); the rest of the done-when list is onmain(#226, #228, #232, #233, #297).browser-timingsjob (.github/workflows/bench.yml). On pull requests that touch the timed code (core.ts,envelope.ts, any*.browser.bench.ts,backend/, the frontend's dependencies), it runsnpm run bench:browserin Chromium at the base commit (the merge ref's first parent) and then the head, on one runner. Each side is checked out in place, builds its own wasm module with thewasm-bindgenCLI its ownCargo.lockpins, and installs its own dependencies, so the base build reuses the restored cache. A regression is a warning in the job summary; the job fails only when the comparison cannot run. The summary also gives each commit's Chromium version and wasm module size. Pushes tomainonly build the module, for the cache, and the job does not run on demand, since thebrowserworkflow times all three browsers then. Not a required check.scripts/bench-compare.sh vitest <base.json> <head.json>. The agreed rule (the lower bound of the 95 % interval of the mean change above +10 %) on two Vitest reports. Vitest gives each benchmark's mean and standard error but no interval for the change, so the script computes one: the delta method for the ratio of two independent means, with the larger of the two runs' t critical values. A benchmark with one sample in either run (the wasm cold start) is listed, not judged. Exit codes are the criterion mode's: 1 for a regression, 2 when nothing could be judged or a report is unusable.scripts/bench-targets.shlists the bench targets of every workspace crate, so a criterion bench added outsideplatform-cryptoandquackxide-engine(P85's attestation round trip, say) joins thebenchjob without an edit. Its output is unchanged today.docs/BENCHMARKS.mdgains how to compare browser timings locally, the job, an "Adding a benchmark" section for what P55, P56 and P85 add, and the rule for Vitest results; "Still to come" is gone.docs/TESTING.md,CONTRIBUTING.md,docs/PROJECT_SCOPE.mdandCHANGELOG.mdfollow.@AxolDad: the browser timings' rule is marked "proposed, needs @AxolDad" in
docs/BENCHMARKS.md. If you agree, I'll mark it agreed before you approve, so the approval isn't dismissed.@abendrothj: this differs from what you proposed on #185, a comparison by hand that flags a regression when the head's mean ± rme starts more than 10 % of the base mean above the base's interval. It runs in CI instead, which the done-when allows ("base and head are compared in the same job with a written threshold"), and computes the change's interval, so the browser timings use the same rule as the native benchmarks rather than a second one. Yours is the more conservative: with both rme at 3 %, it flags a change above about 16.5 %, this one above about 15 %. I can switch to yours if you both prefer it.
Not in this PR: since #286 the wasm module is 861 675 bytes, about 228 KiB at brotli -11 (a local build), against the "under 64 KiB brotli-compressed (now 31.8 KiB)" target under "Browser envelope seal". That is P85's target to revisit; this job now shows the module's size at both commits.
How it was tested
scripts/bench-compare.sh selftest(run bycheck.sh) covers the Vitest mode: regressed, improved and within threshold, with the interval checked exactly; a three-sample head whose larger t critical value keeps within threshold a change the base's would have flagged; one-sample, new and removed benchmarks. Each unusable input exits 2: a repeated name, a zero or missing mean, a missing t critical value, no results, truncated JSON, a missing file, nothing judged. Mutating each term of the formula fails the selftest.encryptPayload: +92 % at 4 KiB and +98 % at 4 MiB, both regressed, exit 1. The compare step on its own: a regression gives the warning and exits 0; an unusable report fails it.run:steps, read frombench.ymland run in order in a scratch clone against a merge commit ofmainand this branch, with theuses:steps done by hand: both sides built, timed and compared, and the summary came out; the push path only builds the module. A depth-2 clone of a merge commit can read and check out its first parent. This pull request is the job's first real run.scripts/check.shpasses (locally without gitleaks, so the secret scan was skipped).Checklist
scripts/check.shpasses locallySECURITY_AUDIT_EVENTcovered byaudit_coverage.rs(n/a: CI and docs only)docs/DATA_POLICY.md)CHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made (n/a: the issue needs no ADR)