mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-14 23:22:54 +00:00
* test(u8): de-flake regex linearity assertions The single-trial 2x input + 3x ratio bound was razor-thin: a real macOS CI run failed at ratio 3.01x with small=7.41ms / large=22.31ms - both above the 5ms noise floor but close enough that single-shot scheduler jitter pushed the ratio over. Replace the methodology with four stacked techniques: 1. Warmup runs before timing (let the JIT tier up) 2. Median of 5 trials per measurement (eliminates GC + jitter) 3. 4x input ratio (was 2x) - linear gives ~4x, O(n^2) gives ~16x 4. 8x ratio bound with a 20ms noise floor on the LARGE measurement Headroom: linear is expected at ~4x, bound is 8x = 2x safety margin. A real O(n^2) regression on a 4x input would clock 16x, well outside. Catastrophic backtracking is still caught by the absolute <500ms cap. Verified: 10 consecutive local runs all passed. * test(u8): address PR #1475 review — tighten floor + rename for accuracy Two follow-ups from Claude's review: 1. Floor semantics: revert to 'skip when BOTH measurements below floor' (AND, not single-check) and lower threshold from 20ms back to 5ms. Median-of-5 makes 5ms reliably resolvable above performance.now()'s ~10-100us band, so the higher floor was unnecessary defense. Closes the gap where an O(n^2) regression on a fast runner could stay under 500ms AND below 20ms-large to escape both detectors. 2. Rename assertSubLinearRatio -> assertNearLinearScaling. The bound is SIZE_RATIO * 2 = 8x on a 4x input = sub-quadratic with 2x headroom over linear, not strict sub-linearity. New name reflects the actual semantics. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| helpers | ||
| integration | ||
| unit | ||
| utils | ||