Repository navigation
test(csharp): Mode B slicer guard for the compound-assignment file shape (Part of #3320) - #5356
Merged
Merged
Conversation
…ape (Part of #3320) Profiling 135 of roslyn's/runtime's largest C# files (80 MB) found _slice_by_braces linear in file size, so no engine change: the residual Cartography_Mode_B_Braces cost is func_start match volume. 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 17, 2026 16:28
squid-protocol
enabled auto-merge (squash)
October 17, 2026 16:28
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 #3320
What
Test-only. #4999 already made C#
func_startlinear on adjacent[...]/<...>runs (roslynUserDefinedCompoundAssignmentOperatorsTests.cs: 60s timeout -> 0 functions became 1264 matches in 0.1s). The one item left on the issue was the residualcsharp::Cartography_Mode_B_Bracescost, so I profiled it instead of guessing.Finding: no engine defect in the brace slicer
_slice_by_braces0.38s.Test/and runtimeSystem.Runtime(80 MB), cProfile, 1 worker: 171s wall._slice_by_braces26.7s cumulative, 9.2s self (0.07s/file), roughly linear in size. The dominant cost iscoding_analysis(43.8s self), then regex search/sub. Nothing super-linear.Change
tests/extraction/languages/test_csharp_strict.py:test_csharp_mode_b_slicer_compound_assignment_file_shape_3320runs the synthetic compound-assignment file shape (4000 adjacent-bracket lines) through the real_slice_by_braces, asserting both methods are bounded and < 5s. #4999's tests only exercised the regex.Gates
pr_gates --fast6/6,--ratchets8 pass / 0 fail / 0 skipped. No golden bless (test-only; engine untouched).Class sweep
Same-mechanism siblings: none for the slicer.
func_startsiblings were swept in #4999 (53 regexes, none super-linear). Parity delta of #4999 (1829 phantom matches lost, 33 gained) is still awaiting owner acceptance on that PR's body.Cross-repo
None.
Lessons for agents
~/.cache/gitgalaxy/ruff-0.16.10/holdsbin/ruff, notruffat the top level.🤖 Generated with Claude Code