bench-regression failed on the v0.4.1 release run and will keep failing on
every tag push until the threshold is re-baselined:
REGRESSION: structured_json_under_2mb_p95_ms regressed: 2664.682ms > 2500.000ms
error: bench failed, to rerun pass `-p tokenfold-core --bench compression_bench`
Run: https://github.com/snchimata/tokenfold/actions/runs/32210070277/job/95940853619
This is not a code regression
Four independent checks:
git diff 0e68d24..v0.4.1 -- crates/tokenfold-core/src/ crates/tokenfold-core/benches/
is empty — the 0.4.1 change set touched no core logic and no benchmark code.
Its only core-adjacent edit is the [[example]] declaration in Cargo.toml.
- The threshold value is unchanged at
2500.0 since v0.4.0.
compression_bench.rs's only diff since v0.4.0 is a doc-comment rewrite.
- v0.4.0's release run passed the same gate — consistent with variance around a
boundary, not a step change.
Root cause: hardware mismatch
benches/THRESHOLDS.toml records the baseline as measured on
AMD Ryzen 7 9800X3D (8c/16t), 31GB RAM, Windows at 1693.855ms, with the
threshold set to 2500.0 for ~1.48x headroom. bench-regression runs on a shared
ubuntu-latest runner, which is both slower and highly variable.
The file already anticipates exactly this:
Thresholds carry ~1.3-1.5x headroom over the measured baseline for runner
variance; tighten once bench-regression has run on a dedicated, fixed-spec
CI runner.
It also notes p95 here is "dominated by TiktokenEstimator::o200k_base()
reloading BPE ranks on every compress() call" — an I/O-and-parse cost that
scales with runner speed rather than with anything in the compression path.
Why it matters even though it doesn't block
The job is continue-on-error: true (release.yml#L76),
so the release completed normally. The problem is a permanently-red gate: once
people learn to ignore it, it stops catching the real regression it exists for.
Options
- Re-baseline on the CI runner class — measure
ubuntu-latest p95 over
several runs, set the threshold from that distribution, and record both the
hardware and the sample size in THRESHOLDS.toml.
- Move
bench-regression to a dedicated fixed-spec runner — what the
file's own comment recommends; the only option that makes a tight threshold
meaningful.
- Cache the estimator across
compress() calls — attacks the measured
dominant cost rather than the threshold, and is a real latency win for
callers, not just a green gate.
Please don't just raise the number to make it pass — that discards the signal
without recording why.
bench-regressionfailed on the v0.4.1 release run and will keep failing onevery tag push until the threshold is re-baselined:
Run: https://github.com/snchimata/tokenfold/actions/runs/32210070277/job/95940853619
This is not a code regression
Four independent checks:
git diff 0e68d24..v0.4.1 -- crates/tokenfold-core/src/ crates/tokenfold-core/benches/is empty — the 0.4.1 change set touched no core logic and no benchmark code.
Its only core-adjacent edit is the
[[example]]declaration inCargo.toml.2500.0since v0.4.0.compression_bench.rs's only diff since v0.4.0 is a doc-comment rewrite.boundary, not a step change.
Root cause: hardware mismatch
benches/THRESHOLDS.tomlrecords the baseline as measured onAMD Ryzen 7 9800X3D (8c/16t), 31GB RAM, Windows at 1693.855ms, with the
threshold set to 2500.0 for ~1.48x headroom.
bench-regressionruns on a sharedubuntu-latestrunner, which is both slower and highly variable.The file already anticipates exactly this:
It also notes p95 here is "dominated by
TiktokenEstimator::o200k_base()reloading BPE ranks on every
compress()call" — an I/O-and-parse cost thatscales with runner speed rather than with anything in the compression path.
Why it matters even though it doesn't block
The job is
continue-on-error: true(release.yml#L76),so the release completed normally. The problem is a permanently-red gate: once
people learn to ignore it, it stops catching the real regression it exists for.
Options
ubuntu-latestp95 overseveral runs, set the threshold from that distribution, and record both the
hardware and the sample size in
THRESHOLDS.toml.bench-regressionto a dedicated fixed-spec runner — what thefile's own comment recommends; the only option that makes a tight threshold
meaningful.
compress()calls — attacks the measureddominant cost rather than the threshold, and is a real latency win for
callers, not just a green gate.
Please don't just raise the number to make it pass — that discards the signal
without recording why.