build(crypto): add benchmarks and the HPK1 baseline (P73, part 1) #226
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.63) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.63 · 307 lines diff across 3 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.343
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.063
Real PR Conversation Timeline
1 comments
"Review active on #226"
general
weight: 0.35
abendrothj
What and why
Part of #185 (P73). #187 can't merge until the
HPK1(X25519) cost is recorded (ADR 0001, ADR 0007 "Consequences"). This adds a criterion harness inplatform-cryptothat timesHPK1key generation and envelope seal and open at 32 B, 4 KiB and 4 MiB, a unit test that pins the 52-byte envelope overhead, and abenchworkflow that runs on pull requests touchingbackend/orrust-toolchain.tomland only reports; pull requests restore the build cache that pushes tomainsave, and save none of their own.cargo testruns each benchmark once, soscripts/check.shfails on a broken one.docs/BENCHMARKS.mdhas the method, how #187 compares against it, and the baseline from this PR's CI run.The benchmarks refuse to run on any suite but
HPK1, so thehpk1IDs stay the baseline after #187 changes the default suite.@AxolDad: #185 says the targets and the regression threshold are agreed with you.
docs/BENCHMARKS.mdproposes no absolute targets until the hybrid numbers exist, and a base-vs-head check in one job that flags a significant change over 10 %. Shared runners vary more than that between runs, so it never compares against recorded numbers.Still to come in later PRs, so #185 stays open: engine query latency, the
encryptPayloadVitest bench, #171's bundle and load figures, and the regression check.How it was tested
hpk1_envelope_overhead_is_52_bytesfails at 51 and passes at 52.cargo bench -p platform-crypto --bench hpke --locked -- --testruns all seven. With a wronginfoon open it now panics (open: OpenFailed); before, it reported success.--save-baseline/--baseline-lenient/--baselinebehave as the doc says (strict fails on a missing baseline).cargo test --workspacedoesn't run the benches;cargo deny checkpasses; all new crates are MIT or Apache-2.0.Checklist
scripts/check.shpasses locallySECURITY_AUDIT_EVENTcovered byaudit_coverage.rs: n/adocs/DATA_POLICY.md)CHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made: n/a