Repository navigation
Conversation
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the scaling-guardrail input sizing changes.
No open issues 🎉
What changed in this PR
This PR stabilizes the performance scaling guardrail for fast substitution and escape cases by increasing their input sizes to reduce timing distortion on CI.
Changes:
- Adds an optional per-case input size, keeping the 6,000 default.
- Uses 24,000 for four fast cases while preserving existing ratio thresholds and output checks.
| File | Description |
|---|---|
test/performance/scaling-check.ts |
Supports per-case input sizes and enlarges four fixtures for more reliable timing. |
Review effort: Balanced
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
A test-only change to test/performance/scaling-check.ts that stabilizes the scaling guardrail against coarse CPU-clock quantization.
- Per-case input size —
TextCheckCasegains an optionaln, threaded throughdefineTextCheckas a trailing parameter that defaults toSUBSTITUTION_CHECK_N(6,000), so existing cases keep their current size. - Larger fixtures for four fast cases —
COARSE_CLOCK_TEXT_CHECK_N(24,000) raises N for the three substitution cases and one escape case whose 6,000-sized runs sit at roughly one clock tick, moving their N/4N samples to ~5ms/~20ms and out of the zero-or-one-tick range. - No threshold or expectation changes — ratio bounds, retry/early-exit logic, and expected-result checks are untouched, so the guardrail still distinguishes linear from quadratic behavior.
I verified the four affected checks pass locally with ratios around 4-5, and the remaining text cases already measure at least ~2ms at N, so the selection covers the near-tick cases on this host. format:check, typecheck, lint, and the PR CI are green.
big-pickle (free) | 𝕏

Summary
Allow an individual text scaling case to select a larger input size, then raise
Nfrom 6,000 to 24,000 for four substitution and escape cases whose smaller samples can finish near one CPU clock tick.On coarse or busy CI clocks, a sample near that boundary can be reported as
0.000msor1.000ms, making the measured4N / Nratio unrepresentative or impossible to calculate. The larger fixtures keep those cases measurable while preserving the same ratio thresholds and expected output checks. All other text cases retain the existing default size.Testing
corepack yarn test:scalingThe affected cases completed with measurable ratios inside the existing plausibility floor and scaling threshold.