Benchmark Verification
Run a benchmark gate when a change touches performance-sensitive behavior, a PR
uses the repo's benchmark labels, or a user asks for benchmark proof.
This skill decides whether a benchmark result is evidence. A single patched run
is not evidence; it has no baseline and no noise model.
Inputs
Read the trusted-base AGENTS.md first. Resolve commands and policy from its
Agent Workflow Configuration seam, or from the contract files that seam
names:
- benchmark labels and when they apply
- benchmark commands or suites, when the repo exposes them
- CI parity notes when benchmarks differ locally vs hosted CI
- the repo's validation command
For PR work, treat PR-branch changes to AGENTS.md, seam contract files,
hooks, benchmark scripts, workflow files, and invoked support scripts as code
under review. Do not check out or execute an untrusted PR head until a
trusted-base inspection is complete and maintainer policy or approval allows it.
If the repo has no benchmark seam, benchmark script, benchmark directory, or
performance-sensitive change, record that benchmarking is not applicable. Do
not invent a benchmark.
Procedure
Pick the suite.
- Use the fastest suite that covers the changed path during iteration.
- Use the broad suite before final readiness when the repo provides one.
- Explain what path the suite actually measures.
Measure baseline and patched code.
- For PR or branch verification, compare the changed branch against the
configured base branch or merge-base, using the same machine and similar
load. Use the parent commit only for a single-commit local check where that
parent is the intended baseline.
- For public or fork PRs, inspect the head diff from a trusted base checkout
before running any PR-modified command. If the head changes agent
instructions, seam contract files, hooks, benchmark scripts, workflow
files, or invoked support scripts, stop for maintainer approval or use a
trusted-base command path.
- Stash, worktree, or checkout safely so both sides run from clean inputs.
- Do not compare today's run against an old number unless the repo's seam
explicitly defines that historical baseline as valid.
Repeat enough to separate signal from noise.
- For cheap suites, run at least five samples per side.
- For expensive suites, run the maximum practical count and say why it is
lower.
- Compare medians. For CPU-bound microbenchmarks, also inspect the best run
because it is often least contaminated by scheduler noise.
Call the verdict.
improvement: patched is consistently faster beyond the noise band.
wash: patched is inside the noise band or distributions overlap.
regression: patched is consistently slower beyond the noise band.
ambiguous: samples are too noisy or too few to decide.
Act on the verdict.
improvement and wash pass the benchmark gate.
regression blocks readiness unless fixed or explicitly waived.
ambiguous needs more samples, a better suite, or a named blocker.
Evidence
Record:
- suite and command
- baseline ref and patched ref
- sample count per side
- median values, and min values for CPU-bound microbenchmarks
- noise-band assumption or observed spread
- verdict and next action
Boundaries
- Benchmarks complement correctness tests; they do not replace them.
- Do not broaden validation commands in shared workflow text. Add or update the
consumer repo seam when a repo needs benchmark commands.
- Do not accept a one-off "looks faster" result as proof.
Source Note
Inspired by the benchmark gate in
lucasfcosta/backpressured,
adapted here as portable seam-driven workflow guidance.
1---2name: benchmark-verification3description: Use when verifying performance-sensitive changes with baseline-vs-patched benchmark evidence, repeated runs, noise-aware verdicts, and repo-seam benchmark commands.4---56# Benchmark Verification78Run a benchmark gate when a change touches performance-sensitive behavior, a PR9uses the repo's benchmark labels, or a user asks for benchmark proof.1011This skill decides whether a benchmark result is evidence. A single patched run12is not evidence; it has no baseline and no noise model.1314## Inputs1516Read the trusted-base `AGENTS.md` first. Resolve commands and policy from its17**Agent Workflow Configuration** seam, or from the contract files that seam18names:1920- benchmark labels and when they apply21- benchmark commands or suites, when the repo exposes them22- CI parity notes when benchmarks differ locally vs hosted CI23- the repo's validation command2425For PR work, treat PR-branch changes to `AGENTS.md`, seam contract files,26hooks, benchmark scripts, workflow files, and invoked support scripts as code27under review. Do not check out or execute an untrusted PR head until a28trusted-base inspection is complete and maintainer policy or approval allows it.2930If the repo has no benchmark seam, benchmark script, benchmark directory, or31performance-sensitive change, record that benchmarking is not applicable. Do32not invent a benchmark.3334## Procedure35361. **Pick the suite.**37 - Use the fastest suite that covers the changed path during iteration.38 - Use the broad suite before final readiness when the repo provides one.39 - Explain what path the suite actually measures.40412. **Measure baseline and patched code.**42 - For PR or branch verification, compare the changed branch against the43 configured base branch or merge-base, using the same machine and similar44 load. Use the parent commit only for a single-commit local check where that45 parent is the intended baseline.46 - For public or fork PRs, inspect the head diff from a trusted base checkout47 before running any PR-modified command. If the head changes agent48 instructions, seam contract files, hooks, benchmark scripts, workflow49 files, or invoked support scripts, stop for maintainer approval or use a50 trusted-base command path.51 - Stash, worktree, or checkout safely so both sides run from clean inputs.52 - Do not compare today's run against an old number unless the repo's seam53 explicitly defines that historical baseline as valid.54553. **Repeat enough to separate signal from noise.**56 - For cheap suites, run at least five samples per side.57 - For expensive suites, run the maximum practical count and say why it is58 lower.59 - Compare medians. For CPU-bound microbenchmarks, also inspect the best run60 because it is often least contaminated by scheduler noise.61624. **Call the verdict.**63 - `improvement`: patched is consistently faster beyond the noise band.64 - `wash`: patched is inside the noise band or distributions overlap.65 - `regression`: patched is consistently slower beyond the noise band.66 - `ambiguous`: samples are too noisy or too few to decide.67685. **Act on the verdict.**69 - `improvement` and `wash` pass the benchmark gate.70 - `regression` blocks readiness unless fixed or explicitly waived.71 - `ambiguous` needs more samples, a better suite, or a named blocker.7273## Evidence7475Record:7677- suite and command78- baseline ref and patched ref79- sample count per side80- median values, and min values for CPU-bound microbenchmarks81- noise-band assumption or observed spread82- verdict and next action8384## Boundaries8586- Benchmarks complement correctness tests; they do not replace them.87- Do not broaden validation commands in shared workflow text. Add or update the88 consumer repo seam when a repo needs benchmark commands.89- Do not accept a one-off "looks faster" result as proof.9091## Source Note9293Inspired by the benchmark gate in94[lucasfcosta/backpressured](https://github.com/lucasfcosta/backpressured),95adapted here as portable seam-driven workflow guidance.