Skip to content

fix(lint): raise interpreter scaling cap to 15 s (DRO-4114) - #21

Merged
lutz-grex merged 1 commit into
mainfrom
fix/interpreter-scaling-cap
Nov 27, 2026
Merged

lutz-grex merged 1 commit into
mainfrom
fix/interpreter-scaling-cap

Conversation

@Cyro292

@Cyro292 Cyro292 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Unblocks the v0.4.1 release. Linear: DRO-4114. No version bump: after merge, v0.4.1 moves to the merge commit and Publish runs again. Nothing was published for 0.4.1.

Why it failed

The Publish run failed in bun tools/lint-spec.ts with one problem:

interpreter scaling: "pwd:": 3029 ms at 100 KB, 29494 ms at 1 MB
  • The interpreter stress test fills 1 MB with pwd: (about 250,000 keys) and runs the redactor over it. pwd: is the slowest attack because it is the shortest key.
  • Measured alone, it took ~1.2 s at 100 KB and ~10.7 s at 1 MB, over the 10 s absolute cap. The 29 s figure is the first measurement, taken while the JS and Python scaling runs shared the runner.
  • Growth is linear: ~9x for 10x input; the allowed ratio is 30x. No ReDoS, no regression in shape.

Strange that it passed before?

No. The same attack passed on the PR CI at ~8.8 s (#19) and before that at ~8.5 s. It measured 10.7–10.9 s on main and in Publish. The cap left only ~15% headroom, so a small runner slowdown was just enough to cross it. #20 looked green because it didn't touch the spec, so spec-scaling was skipped; Publish always runs the full lint.

Run pwd: at 1 MB Result
main after #17 8469 ms pass
#19 branch 8769 ms pass
main after #19 10935 ms fail
Publish v0.4.1 10668 ms fail

Change

  • tools/lib/scaling-run.ts: MAX_INTERPRETER_MS_AT_LARGE 10 s → 15 s, with a comment saying why. The 30x growth check is unchanged.
  • tools/lib/scaling-run.test.ts: new test pins 12 s (linear) as passing and 16 s as still failing.
  • spec/SPEC.md: the scaling section now says 15 s. Not hashed; tools/sync-spec --check passes.

Verification

  • New test fails at 10 s, passes at 15 s. bun test tools/lib: 29 pass. tsc --noEmit clean.
  • bun tools/lint-spec.ts --only-scaling passes locally (a faster Mac; this PR's spec-scaling job is the real runner check).
  • Reviewed by the author and independently; a replay of the Publish timings with the retry logic passes at 15 s.

Follow-up (not in this PR)

  • spec/SPEC.md says retries take "the best time per size"; the interpreter run actually keeps the whole attempt with the fewest problems.

Change brief (private): https://app.notion.com/p/424ad8f2ae5781ad8aa8d3413b21cc6c

The v0.4.1 Publish run failed in lint-spec: the `pwd:` interpreter attack
took 10.7 s at 1 MB alone, over the 10 s absolute cap. It grows ~9x from
100 KB to 1 MB (allowed 30x), so this is runner variance, not a ReDoS:
the same attack passed at ~8.8 s on the PR branch's CI. 15 s leaves
headroom; the growth check is unchanged.
@Cyro292
Cyro292 requested a review from lutz-grex November 27, 2026 10:25
@lutz-grex
lutz-grex merged commit 314fbcb into main Nov 27, 2026
11 checks passed
@lutz-grex
lutz-grex deleted the fix/interpreter-scaling-cap branch November 27, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants