Repository navigation
perf: line-gate state_mutation for typescript, javascript, python (Part of #3171) - #6368
Merged
Merged
Conversation
…rt of #3171) Narrow the method-call arms `\s*\(` -> `[ \t]*\(` so pattern_is_line_local accepts the rule (same as cpp in #3170), then opt in via _line_gates. Zero match movement over the language-crucible corpus; bench: corpus 1.4-1.8x, dense loss 22-35%. Java benched a 46% dense loss: left ungated. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Owner
Author
|
No description provided. |
squid-protocol
marked this pull request as ready for review
October 24, 2026 06:11
Contributor
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.
Part of #3171
What
state_mutationin typescript, javascript and python is now line-gated (_line_gates). Their method-call arms used\s*\(, which can span a newline, sopattern_is_line_localrefused the rule ("class matches newline"). They now bind[ \t]*\(, the same narrowing cpp got in #3170. With that,build_line_gatebuilds a gate from the required literals (=,++,--,add,pop,set, ...).Class / Sibling gaps
Class:
state_mutationrules thatpattern_is_line_localrefuses only because of a\s*\(call arm. Checked by swapping every\s*\(for[ \t]*\(in each language's rule and re-running the check.line_gate_benchshows a 46% dense-case loss (bar 35%) and only a 1.1x corpus win, so it is left untouched.\snodes), csharp, kotlin, swift, scala, dart, groovy, solidity, perl. Each needs its own zero-movement proof and bench.Evidence
finditerspans compared on every crucible file (typescript 39 files / 6265 matches, javascript 33 / 3200, python 290 / 10316): 0 files moved.line_gate_bench.py(best of 7-11): corpus ts 1.5x, js 1.4x, python 1.8x; dense-case loss ts 28-35% in 6 of 7 runs (one run under load hit 37%), js 28-37% (one noisy run), python 16-18%.gate_parity_audit.py: zero violations (exact-parity leg covers the three new rules).golden-lock.sh crucible_check.py --update --yes): no drift.tests/core_engine/test_line_gates.py+test_rule_prefilter.py: pass; ts/js/python strict suites: 290 pass.Facts checked
line_gate_bench.pyis not run in CI, so the bench numbers are from this box only.Remaining slices
Rust and the other narrowable languages above;
how_to_add_a_language.mdstill lists only c/cpp/go/ada/yacc as shipped (not touched: 5-file cap).🤖 Generated with Claude Code