docs(benchmarks): reproducible gateway, PII, and evidence benchmarks (#119)#164
Merged
Conversation
…rks (#119) Add BenchmarkGatewayPipelineOverhead (ServeHTTP with local mock upstream), scripts/run-benchmarks.sh, and make benchmarks to emit a markdown table with hardware metadata. Document methodology in docs/reference/benchmarks.md and link from README, LIMITATIONS, and the request-lifecycle doc. Closes #119
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issue.
Reviewed by Cursor Bugbot for commit fa7270f. Configure here.
| if w.Code != http.StatusOK { | ||
| b.Fatalf("status %d: %s", w.Code, w.Body.String()) | ||
| } | ||
| } |
There was a problem hiding this comment.
Gateway bench cost query drift
Medium Severity
BenchmarkGatewayPipelineOverhead times repeated ServeHTTP calls against one SQLite evidence store that grows every iteration. Each request runs callerCostTotals, which scans accumulating rows via CostByAgent, so measured ns/op rises during the run and overstates steady per-request overhead versus a fixed-size store.
Reviewed by Cursor Bugbot for commit fa7270f. Configure here.
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.


Summary
Closes the last P1 in credibility epic #108 — reproducible benchmarks for the README "< 15 ms excluding upstream" claim.
BenchmarkGatewayPipelineOverhead— fullServeHTTPpath with OPA policy, PII scan, local mock upstream, response scan, signed evidence write (rate limits raised for bench stability).make benchmarks/scripts/run-benchmarks.sh— runs gateway + existingBenchmarkPIIScan+BenchmarkEvidenceStore, prints a markdown table withgo version, OS, CPU, commit, and rawgo testlines.docs/reference/benchmarks.md— methodology, scope, exclusions (WAN RTT, retry/fallback until Provider fallback chains (error-driven, sovereignty-respecting) #138/Retries with backoff (recorded as evidence fact) #139), interpretation guide.Local sample (Apple M1 Max,
make benchmarks): gateway ~5.5 ms/req, PII ~0.08 ms/scan, evidence ~1360 writes/s — under the 15 ms budget with mock upstream.Test plan
make benchmarkssucceedsscripts/check-claim-discipline.shpassesCloses #119
Note
Low Risk
Documentation and benchmark harness only; no production gateway behavior changes beyond a new test with elevated rate limits for stability.
Overview
Adds a reproducible proof-bar for the README “under 15 ms excluding upstream” pipeline claim: operators run
make benchmarks(orscripts/run-benchmarks.sh) to get a markdown table of gateway overhead, PII scan latency, and evidence write throughput on their machine.New gateway benchmark
BenchmarkGatewayPipelineOverheadexercises a full non-streamingServeHTTPpath against a localhttptestupstream (OPA, PII, response scan, signed evidence), with rate limits raised so the bench does not 429. The runner aggregates that benchmark with existingBenchmarkPIIScanandBenchmarkEvidenceStore, records Go/OS/CPU/commit, and dumps rawgo testlines.docs/reference/benchmarks.mddocuments methodology, what is in/out of scope (no WAN RTT, no retry/fallback until Epic #113), and how to interpret results. LIMITATIONS and doc indexes now point at reproducible benchmarks instead of a vague “forthcoming” note; README and the request-lifecycle doc linkmake benchmarksalongside the optional docker/heyload harness.Reviewed by Cursor Bugbot for commit fa7270f. Configure here.