test(go): tighten O(n^2) tripwire budget 10s -> 5s (#1848 U3)

The fixed path is ~250ms; a quadratic regression at 400 structs is ~25s. 5s keeps
~20x headroom over the fixed path while tripping a ~20x regression (vs the prior
~40x). Correctness is guarded separately by the U1 golden test, so this stays a
pure perf tripwire.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gergo Magyar 2026-05-30 09:38:32 +00:00 • committed by Gergo Magyar
parent 5f0841c8bc
commit e12b526e07

View file

@ -438,7 +438,7 @@ describe('Go scope-capture O(n^2) regression tripwire', () => {
it('parses a 400-struct file in well under the O(n^2) tripwire budget', () => {
const STRUCT_COUNT = 400;
const BUDGET_MS = 10_000; // coarse: ~40x the fixed path, ~3x under a quadratic regression
const BUDGET_MS = 5_000; // coarse: ~20x the fixed path (~250ms), trips a ~20x regression; a quadratic regression at 400 structs is ~25s
const src = generateGoStructSource(STRUCT_COUNT);
emitGoScopeCaptures(src, 'tripwire-warmup.go'); // warm up the parser/query JIT