Repository navigation
fix(benchmarks): normalize Full build regression-gate metric per file count - #2559
Merged
Merged
Conversation
… count Full build compared raw fullBuildMs against a fixed release baseline, so corpus growth and legitimate per-file work growth (new persisted-evidence tables, new resolution passes) kept tripping the gate release over release even with zero algorithmic regression, requiring a hand-added KNOWN_REGRESSIONS entry roughly every cycle (#2081, #2412, #2436). Gate and report now compare fullBuildMs/files instead. The 3.16.0:Full build exemption is no longer needed: 3.17.0 vs 3.16.0 clears the normalized threshold on both engines without it (native +16.1% ms/file vs the raw +31.0%; wasm +8.9% vs the raw +22.9%). 3.16.0:1-file rebuild is left as-is — out of scope per the issue, since that metric's flakiness looks dominated by near-zero-baseline jitter rather than corpus size. Impact: 4 functions changed, 2 affected
Contributor
Greptile SummaryThe PR normalizes incremental full-build regression checks and reporting by file count, preventing repository growth from being classified as an algorithmic slowdown.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or non-blocking defects identified. The gate and report consistently normalize full-build timing using matched timing and file-count entries, reject invalid denominators, preserve existing checks for other metrics, and cover the new behavior with focused tests. Important Files Changed
Reviews (1): Last reviewed commit: "fix(benchmarks): normalize Full build re..." | Re-trigger Greptile |
Contributor
Codegraph Impact Analysis4 functions changed → 5 callers affected across 1 files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full buildintests/benchmarks/regression-guard.test.tscompared rawfullBuildMsagainst a fixed release baseline. Corpus growth and legitimate per-file work growth (new persisted-evidence tables, new resolution passes) are not regressions, but the gate had no way to tell them apart from a real algorithmic slowdown — requiring a hand-addedKNOWN_REGRESSIONSentry roughly every release cycle (#2081/#2107, #2412, #2436).Per #2412's own "Suggested directions" (normalize by file count, previously unscoped), this normalizes "Full build" to
fullBuildMs / files:tests/benchmarks/regression-guard.test.ts): theFull buildcheck now comparesperFileMs(fullBuildMs, files)instead of rawfullBuildMs.checkRegressiongained an optionalminAbsoluteDeltaoverride — the existing 10ms floor was calibrated for raw-ms metrics and would never fire on ms/file values (~5-25), silently disabling noise filtering; a newMIN_ABSOLUTE_DELTA_PER_FILE = 0.1restores it at the right scale.No-op rebuild/1-file rebuildare untouched — per the issue,1-file rebuild's flakiness looks dominated by near-zero-baseline jitter rather than corpus size, so it's a separate problem.scripts/update-incremental-report.ts): added aFull Build (ms/file)column to the historical table and "Latest results" summary (computed from the existingfiles/fullBuildMsfields already recorded on every entry — no benchmark JSON schema change needed, and it works retroactively across all history). The bottom::warningregression annotation was switched to the same normalized figure so it doesn't keep firing on growth-driven commits the hard gate no longer flags.KNOWN_REGRESSIONS: pruned3.16.0:Full build. Verified via the real committed history:3.17.0 vs 3.16.0clears the normalized threshold on both engines without the exemption (native +16.1% ms/file vs the raw +31.0%; wasm +8.9% vs the raw +22.9%).3.16.0:1-file rebuildis left in place (out of scope here).Denominator choice: uses the existing
filescount already recorded per entry (which already excludestests/benchmarks/resolution/fixtures/**viaBENCHMARK_EXCLUDES), matching what the issue's own evidence table validated, rather than introducing a newsrc/+crates/-only counting mechanism.Test plan
npx vitest run tests/benchmarks/regression-guard.test.ts tests/unit/update-incremental-report.test.ts tests/unit/incremental-report-trend-fallback.test.ts(withRUN_REGRESSION_GUARD=1) — all passKNOWN_REGRESSIONSentry and confirmednative engine — 3.17.0 vs 3.16.0fails exactly as it did before this fix (Full build: 4844 → 6345 (+31%, threshold 25%)); restored the fix and confirmed green againnpm test(full suite) — 339 files, 5453 passednpx tsc --noEmit— cleannpm run lint— cleanCloses #2455