- p.benchmark(name) adds the `benchmark` target kind, built and linked
like an executable (graph lowering, compdb, IDE runnables and the
installer default destination all handle it).
- vbs bench builds only the benchmark targets (or the --target subset),
runs each binary --samples times (default 3) with VBS_BENCH=1, keeps the
best wall-clock time, and compares against --baseline
(default <build>/.vbs/bench_baseline.json) with --max-regression PCT
(default 5). The first run records the baseline; --update-baseline
rewrites it while merging entries for benchmarks not selected.
- Baselines carry os/architecture/compiler/profile; comparison across
machines warns and skips the gate instead of failing noisy CI.
- --json FILE writes a schema-versioned results document (per-benchmark
status, samples, baseline, regression percent).
- vbs metadata bumps to schema v2 (new `benchmark` kind, corrected
`header_only` enum); metadata-v1.schema.json is retained per the
schema versioning rule, and the schema test fixture now declares a
benchmark target.
Verified: bench_records_baseline_and_enforces_regression_gate covers
recording, passing, crafted-slow/fast baselines, JSON results,
--update-baseline, machine mismatch, no-benchmark and invalid options;
the schema test passes against v2; vbs_core_tests 8/8; CLI contracts
pass; clang-format clean.