deps(regex): take perex 0.1.4 — required-text search starts at the requested start - #10201
proggeramlug wants to merge 2 commits into
Conversation
perex 0.1.4 (published 2026-09-13T12:17:29Z from 0d3d3f2) starts the initial required-text search at the requested start on ASCII storage for programs carrying the forward-admission claim. Before this, a pattern such as /[a-z]+[0-9]+ /g paid for every earlier occurrence of its required text on each search, so JS exec/test loops over it were O(lastIndex) per call. Checksum 1542e48011813fbdf3c075da4a4ed53ee93c816eef62e36eb5064a6fd2be10a5, verified against the downloaded crate. Locked with a one-time publish-age override approved for this version only. Claude-Session: https://claude.ai/code/session_01Da12JXeG5XuVBma5yWp5C9
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe workspace updates ChangesWorkspace dependency update
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The dependency update is narrowly scoped and presents no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Takes perex 0.1.4, a lock bump with no Perry source change. Part of #10165.
Problem
After #10183, JS
exec/testloops still went quadratic for any pattern with required text after a class quantifier, such as/([a-z]+)([0-9]+) /gor/[a-z]+[0-9]+ /yon ASCII subjects. Each search cost O(lastIndex): for 2,000execs starting near the end of a subject, the time doubled with its length (776 / 1,573 / 3,156 ms at 100k / 200k / 400k units), even though the remaining length was fixed.Perry's path for these patterns is identical to the fast ones. The perex session placed the cause in Perex. Such patterns carry a "forward admission" claim: every match consumes the required text at or after its own start. The initial required-text search always began at byte 0, so the candidate bound then stepped through every earlier occurrence, each a charged round trip.
Change
perex 0.1.4 (published 2026-09-13T12:17:29Z from
0d3d3f2) starts that initial search at the requested start. This applies on ASCII storage, where the requested start is also a byte offset, and only for programs carrying the claim. Programs without the claim (for example a condition inside a lookbehind), non-ASCII storage and UTF-16 storage are unchanged. The Perex-side witnesses (every-start equivalence against the claim cleared, a bounded-work test near the end of a subject, fault injections, differentials) are in perex.1542e48011813fbdf3c075da4a4ed53ee93c816eef62e36eb5064a6fd2be10a5, verified against the downloadedperex-0.1.4.crate.CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE=allow, approved by Ralph for 0.1.4 only. Every build and test below ran with the override unset, resolving from the lock.Witness (perrymaster, release builds, main + this change vs
#10183's head on 0.1.3, 2 alternating rounds)2,000
execs per row on"ab12 ".repeat(n):/[a-z]+[0-9]+ /g, starting at 0/[a-z]+[0-9]+ /g, starting at len − 10,000/[a-z]+[0-9]+/g(control, no trailing text)Whole loops,
while (re.exec(s))/while (re.test(s))to exhaustion:/([a-z]+)([0-9]+) /y/[a-z]+[0-9]+ /y,test/([a-z]+)([0-9]+) /yover"ab12 ".repeat(n)(reproducer row)Every result matches Node. Other rows of the #10183 reproducer are unchanged within noise. Non-ASCII
exec/matchAllloops remain quadratic (28 s at n = 40,000); that is the separate cross-call position work.Validation (
--locked, override unset)cargo metadata --locked,cargo fetch --lockedcargo check -p perry-runtime --no-default-features --features full --lib(regex feature off): passgc::tests::runtime_roots::perex: 91 passed;regex::: 71 passed;cargo test -p perry-perex: 27 passed, 1 ignoredperry-runtimesuite, lint gates and clippy run on the merge train.https://claude.ai/code/session_01Da12JXeG5XuVBma5yWp5C9
Summary by CodeRabbit