Skip to content

refbench v0.1.0: one-core, load-gated, interleaved reference benchmarks - #1

Merged
tannevaled merged 4 commits into
mainfrom
w0-refbench
Nov 7, 2026
Merged

tannevaled merged 4 commits into
mainfrom
w0-refbench

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

First version of the shared reference-benchmark tool (wave W0 of the performance campaign, go-scikit/roadmap#27; design in docs/performance-campaign.md, section 3).

  • Interleaved, alternating rounds; one core on both sides; load gate before every round (wait or refuse) with the load recorded before and after each round; reference error stops the run.
  • Verdict on medians and quartiles; docs/perf.json (schema 1, strict reader, fuzzed) and docs/perf-table.md.
  • Python worker through uv run --no-project --python 3.12.12 --with-requirements refs.txt, refs.txt pinned with hashes (numpy 2.5.4, scipy 1.18.1). The real worker was run once through uv locally (REFBENCH_UV), versions and protocol checked; no timing was taken (load was above the gate).
  • CI mode: allocations vs perf.json, table vs perf.json, every public function registered or exempt with a reason.
  • refbench table|check|issues|load; issues drafts only.
  • 100 % statement coverage, fuzz targets for the perf.json reader, the worker reply reader and the exemption file reader (seed corpus committed), govulncheck in CI.

Reuse: loadavg is imported from go-fleettools/fleettools v0.81.0 (it belongs in a module of its own; noted in the README). abbench's alternation rule and stats' JSON-lines worker are re-implemented in the library's shape, not copied.

🤖 Generated with Claude Code

tannevaled and others added 4 commits November 7, 2026 20:45
Library and cobra command for wave W0 of the go-scikit performance campaign
(go-scikit/roadmap#27):

- Case registry naming the public function measured; Run alternates the order
  of the two sides per round, gates on the 1-minute load before every round
  (fleettools/loadavg, wait or refuse), records the load before and after each
  round, runs Go under GOMAXPROCS=1 and references under single-thread env,
  stops on a reference error.
- Median/quartile verdict (slower, tie, faster); perf.json (schema 1, strict
  reader, fuzzed) and perf-table.md writers; deferred reports for
  allocation-only recording.
- JSON-lines worker, embedded Python worker run through
  `uv run --no-project --python 3.12.12 --with-requirements refs.txt`, with
  refs.txt pinned with hashes; BuildC for C workers without cgo.
- CI mode: allocations equal perf.json, table equals what perf.json
  generates, every public function has a case or a named exemption.
- refbench table|check|issues|load; issues drafts, never files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ndows clock test

- rbtest.Perf runs the CI mode, or a measurement or an allocation-only
  recording with flags, so no repository repeats the glue. A closed load gate
  skips with the reason and writes nothing.
- CIConfig.Paths exposes the default file locations.
- The alternation test used a Go body that did not scale with iterations, which
  a coarse clock (windows) could not calibrate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Opening a path below a file is "not exist" on Windows and "not a directory" on
Unix, so the 100% gate failed on Windows only. The open is now replaceable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A body that cycles through records allocated only on the first one in the
count, which hid the exact-stage allocations of the degenerate records.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit d9fd575 into main Nov 7, 2026
4 checks passed
@tannevaled
tannevaled deleted the w0-refbench branch November 7, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant