Merge train 183: #10207 - #10208
Merged
Merged
Merge train 183: #10207#10208
Conversation
added 3 commits
September 13, 2026 14:26
…h limit (#10164) `String.prototype.replace`, `replaceAll` and `split` threw "Regular expression memory limit exceeded" once an operation's list reached 8,388,608 entries: `List::push` refused past `SCRATCH_BYTES / 8`. A replacement stores three entries per output piece and a callback replace appends two pieces per match, so `'ab12 cd345;'.repeat(n).replace(/[0-9]+/g, cb)` threw from exactly 699,050 records, where Node finishes in about 235 ms. That limit is for native scratch buffers; these lists are ordinary GC arrays whose length follows the subject. The cap is removed. The lists are bounded by what can be allocated, and output by the existing maximum-string-length check on piece units. The work budget has been unlimited since #10176 for the same reason. Test: a `replaceAll` over one match more than the former cap allows now produces the complete output; with the cap restored the same test aborts on the thrown error. Claude-Session: https://claude.ai/code/session_01RJkA4Fhqz9J5F5fzDk5HWv
|
Caution Review failedThe pull request is closed. ℹ️ 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 (5)
📝 WalkthroughWalkthroughThe regex runtime no longer applies the fixed scratch-buffer entry cap to operation lists. A regression test verifies large global replacement output. Workspace version documentation updates to ChangesRegex list capacity
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge train 183: lands #10207 (stop capping replace and split output lists at the scratch limit; part of #10164) at head
7b10d913b6, plus the workspace version bump to 0.5.1556.Both PR commits were cherry-picked onto
0956673b5without conflicts.mainhas not moved since the PR's base, so the tree before the bump is byte-identical to the PR head.Review:
List::pushno longer refuses atSCRATCH_BYTES / 8entries, which capped a callbackreplaceover'ab12 cd345;'at about 700,000 records with "Regular expression memory limit exceeded". The list is a GC array.List::getindexes withas u32, butjs_array_push_f64at lengthu32::MAXtakes the spec path and throws aRangeErrorfrom ArraySetLength, so the list can never silently wrap. Reaching that length would need an array of about 34 GB.Local validation of this branch (perrymaster, Linux x86_64,
--locked):cargo metadata --locked,cargo fmt --all -- --checkcargo check -p perry-runtime --no-default-features --features full --lib(regex feature off): 0 warningscargo check -p perry-runtime --lib --tests: no warnings outside the knownglobal_this_webassembly.rsdead codecargo test -p perry-runtime --lib -- --test-threads=1: 3725 passed, 1 failed. The failure isnative_stack::tests::stack_top_respects_custom_thread_stack_sizes, red on main. The suite includes the newperex_replace_output_is_not_capped_by_the_scratch_limit.cargo clippy -p perry-runtime --lib --tests: the same 12approx_constanterrors, and the warning diff is identical to train 181'sscripts/run_lint_gates.shscript tier: 76 of 77 pass. The failure is public benchmark evidence freshness, identical on main.gc_runtime_root_holders.pypasses;check_changeset_fragment.sh PerryTS/perry 10207: passhttps://claude.ai/code/session_01Da12JXeG5XuVBma5yWp5C9
Summary by CodeRabbit
New Features
replace,replaceAll, andsplitoperations by removing the previous fixed entry limit.Bug Fixes
Chores