Skip to content

fix(benchmarks): normalize Full build regression-gate metric per file count - #2559

Merged
carlos-alm merged 1 commit into
mainfrom
fix/issue-2455
Aug 17, 2026
Merged

carlos-alm merged 1 commit into
mainfrom
fix/issue-2455

Conversation

@carlos-alm

Copy link
Copy Markdown
Contributor

Summary

Full build in tests/benchmarks/regression-guard.test.ts compared raw fullBuildMs against 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-added KNOWN_REGRESSIONS entry 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:

  • Gate (tests/benchmarks/regression-guard.test.ts): the Full build check now compares perFileMs(fullBuildMs, files) instead of raw fullBuildMs. checkRegression gained an optional minAbsoluteDelta override — 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 new MIN_ABSOLUTE_DELTA_PER_FILE = 0.1 restores it at the right scale. No-op rebuild / 1-file rebuild are 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.
  • Report (scripts/update-incremental-report.ts): added a Full Build (ms/file) column to the historical table and "Latest results" summary (computed from the existing files/fullBuildMs fields already recorded on every entry — no benchmark JSON schema change needed, and it works retroactively across all history). The bottom ::warning regression 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: pruned 3.16.0:Full build. Verified via the real committed history: 3.17.0 vs 3.16.0 clears 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 rebuild is left in place (out of scope here).

Denominator choice: uses the existing files count already recorded per entry (which already excludes tests/benchmarks/resolution/fixtures/** via BENCHMARK_EXCLUDES), matching what the issue's own evidence table validated, rather than introducing a new src/+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 (with RUN_REGRESSION_GUARD=1) — all pass
  • Revert-verified: temporarily restored the raw-ms gate + the pruned KNOWN_REGRESSIONS entry and confirmed native engine — 3.17.0 vs 3.16.0 fails exactly as it did before this fix (Full build: 4844 → 6345 (+31%, threshold 25%)); restored the fix and confirmed green again
  • Revert-verified the report-generator test the same way
  • npm test (full suite) — 339 files, 5453 passed
  • npx tsc --noEmit — clean
  • npm run lint — clean

Closes #2455

… 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
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR normalizes incremental full-build regression checks and reporting by file count, preventing repository growth from being classified as an algorithmic slowdown.

  • Adds a dedicated ms/file noise floor and uses normalized full-build values in the release gate.
  • Adds normalized values and trends to the generated incremental benchmark report and warning annotation.
  • Removes the obsolete full-build exemption and adds focused normalization/reporting tests.

Confidence Score: 5/5

The 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

Filename Overview
tests/benchmarks/regression-guard.test.ts Normalizes the Full build gate by each entry's positive file count, adds a scale-appropriate absolute floor, and thoroughly tests the behavior.
scripts/update-incremental-report.ts Adds consistent ms/file display, historical trends, and normalized warning comparisons while pairing timing and file counts from the same entry.
tests/unit/update-incremental-report.test.ts Verifies the new report column, normalized value, independent trend, and latest-results output.

Reviews (1): Last reviewed commit: "fix(benchmarks): normalize Full build re..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Codegraph Impact Analysis

4 functions changed → 5 callers affected across 1 files

  • findPrevEntry in scripts/update-incremental-report.ts:85 (4 transitive callers)
  • perFileMs in scripts/update-incremental-report.ts:97 (4 transitive callers)
  • formatPerFile in scripts/update-incremental-report.ts:102 (4 transitive callers)
  • engineRow in scripts/update-incremental-report.ts:124 (2 transitive callers)

@carlos-alm
carlos-alm merged commit 714a999 into main Aug 17, 2026
28 checks passed
@carlos-alm
carlos-alm deleted the fix/issue-2455 branch August 17, 2026 21:31
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize "Full build" regression-gate metric per file count instead of raw ms

1 participant