bench(install): record tool versions in results; fix --cwd; re-measure bun 1.3.14 - #549
bench(install): record tool versions in results; fix --cwd; re-measure bun 1.3.14#549colinhacks wants to merge 4 commits into
Conversation
Add tests/bench/install/provenance.sh and source it from run.sh, run-warm-gvs.sh, and cold-cas.sh so every emitted results JSON carries a top-level `env` object: platform, arch, UTC timestamp, 1-min load average, and a per-tool `versions` map. The map is keyed by tool so a new tool needs no schema change, and `env` is added as a new key without altering the existing per-tool timing blocks (backward-compatible). Motivation: a committed result previously recorded no tool versions, platform, or arch, so a benchmark could not be audited for what it measured — a stale package manager on the bench host would silently produce numbers indistinguishable from a current one. Claude-Session: https://claude.ai/code/session_012YZZHCGHavGXcAkYbqKzFN
nub's `install` no longer accepts `--cwd` after the subcommand (it is a top-level flag: `nub --cwd <dir> install ...`). run-warm-gvs.sh and run.sh's cold leg used the old `install --frozen-lockfile --cwd <dir>` form, which current nub rejects with "unexpected argument '--cwd'", so the nub leg exited non-zero and hyperfine aborted the run. Move --cwd ahead of `install` at every affected call site; run.sh's warm leg already used the correct order. Claude-Session: https://claude.ai/code/session_012YZZHCGHavGXcAkYbqKzFN
…stamped) Add provenance-carrying warm results for simple, t3, tanstack-start, and the gvs-eligible/ineligible pair, measured with bun 1.3.14, pnpm 10.15.1, and nub 0.5.0. Each file records its tool versions, platform, and the 1-min load average under which it ran (env.load_1min 53-166). Context: - On the bench host, bare `bun` resolves to an old build (0.5.7) that does not honor the harness's `--cwd`, so it installs the wrong project rather than the fixture; these runs force bun 1.3.14 explicitly and record it, which the new env block now proves. - The host was heavily loaded during measurement (load recorded per file), so the absolute wall-clock numbers are inflated and are not comparable to the quiet-runner CI numbers; the recorded load makes that auditable. - nub was built with LTO disabled because the host could not complete the LTO link under memory pressure; install is I/O-bound, so this is within measurement noise for these numbers. Claude-Session: https://claude.ai/code/session_012YZZHCGHavGXcAkYbqKzFN
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — a benchmark-harness-only PR (tests/bench/install/, no runtime code) that adds provenance stamping, fixes --cwd placement, and re-measures warm results with bun 1.3.14.
- Add
provenance.shwithbench_env_json/bench_inject_env— dependency-free helpers that emit a compactenvobject (platform/arch/timestamp/load_1min/per-toolversions) and prepend it as the first key of hyperfine's JSON by rewriting the leading{viatail -c +2. Empty and(not installed)tools are dropped;\and"are JSON-escaped. Injection verified to produce valid JSON. - Fix
--cwdplacement across the nub install legs —--cwdis a top-level global consumed pre-verb (cli.rs:1514); the subcommand equivalent is-C/--dir, so the oldnub install --cwd <dir>form exited non-zero and aborted the hyperfine run. Corrected at every nub call site inrun-warm-gvs.shandrun.sh's cold leg. Thebun ... --cwdpost-subcommand uses are bun's own flag and are correctly left alone. - Re-measure warm result JSONs with bun 1.3.14 for
simple,t3,tanstack-start, and thegvs-eligible/ineligiblepair, each now carrying theenvprovenance block.
I verified the --cwd-is-top-level premise directly against cli.rs and confirmed the byte-rewrite injection composes into valid JSON against the committed result files. load_1min parsing handles both the macOS (load averages:) and Linux (load average:) uptime formats.
ℹ️ Committed result JSONs were measured on a heavily loaded host
The re-measured warm result files were taken on a host at load ~131, and some contain only 6 timed samples rather than the harness's RUNS=12 (the run was cut short). The PR body already discloses the load and the LTO-disabled build and frames these as auditable-but-not-comparable to the quiet-runner CI numbers, so this is a scope note rather than a defect — worth a follow-up re-measure on a quiet host if these files are ever intended to be cited as headline numbers.
Claude Opus | 𝕏
…12 runs Re-run the warm results on a quieter host (load 38-93, down from ~131-166) with 12 timed runs for every fixture (the gvs pair previously used 6). Absolute wall-clock is lower and less contended; each file's env.load_1min records the exact conditions. Supersedes the earlier higher-load result files. Claude-Session: https://claude.ai/code/session_012YZZHCGHavGXcAkYbqKzFN

What
Three changes to the install-benchmark harness (
tests/bench/install/):provenance.sh, sourced byrun.sh,run-warm-gvs.sh, andcold-cas.sh. Every results JSON now carries a top-levelenvobject:platform,arch,timestamp_utc,load_1min, and a per-toolversionsmap. Added as a new key, keyed by tool so a new tool needs no schema change; the per-tool timing blocks are unchanged.--cwdplacement — nub'sinstallno longer accepts--cwdafter the subcommand (it is top-level:nub --cwd <dir> install …; the subcommand form is-C/--dir).run-warm-gvs.shandrun.sh's cold leg used the old form, so their nub leg exited non-zero and hyperfine aborted the run. Fixed at every nub call site;run.sh's warm leg already used the correct order, and thebun … --cwduses are bun's own flag and left alone.simple,t3,tanstack-start, and thegvs-eligible/ineligiblepair, 12 runs each.Why
A committed result recorded no tool versions, so a benchmark could not be audited for what it measured. On the bench host, bare
bunresolved to 0.5.7 (a 2023 npm-global install), which ignores the harness's--cwdand installed the repo's own dependencies instead of the fixture — a fixture-independent ~150–360 ms exit-0 "install" that never touched the fixture (reproduced across four fixtures). That stale install has since been removed from the host, so barebunis now 1.3.14 and installs the fixture as intended. The pre-provenance results still cannot be attributed to a bun version, which is exactly what theenvblock prevents from recurring.Warm bun means — committed (no provenance) vs re-measured (bun 1.3.14)
The committed numbers cannot be trusted — no version recorded, and some (e.g. monorepo at 266 ms) are indistinguishable from today's broken 0.5.7. The re-measured numbers are auditable.
Caveats
env.load_1minper file), so absolute wall-clock still carries some inflation and is not a substitute for the quiet-runner CI numbers. The recorded load makes the conditions explicit.cold-*, monorepo, large) are also unverifiable; they are left in place and can be pruned or re-measured on a quiet host.Refs #500