Repository navigation
test: one source cutter for the checks (tests/srccut.py), 80 checks moved to it - #2914
Open
jordanella wants to merge 24 commits into
Open
jordanella wants to merge 24 commits into
jordanella wants to merge 24 commits into
Conversation
…k_menu.cpp readers 123 checks carry their own copy of a brace counter (def block) that counts braces in strings, character literals and comments too, and stops with a ValueError or IndexError when a marker is gone. tests/srccut.py is one cutter for all: block() counts braces outside literals (raw strings too), comments and preprocessor lines; between(); and a marker that is missing or appears twice stops the check with one message naming the source and the marker. The nine checks of gpu/vk/vk_menu.cpp with a copy of the old counter import it now. Each was run with SRCCUT_CHECK_NAIVE=1, which also cuts each block the old way and stops if the two differ: the same text in all nine. The dev-loop proposal's D2 (NotRexed#2636). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Nineteen checks of gpu/vk/vk_draw.cpp drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
9 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (9 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
8 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (8 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
8 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (8 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (3 run, 1 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (3 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (3 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (2 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (2 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (2 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (2 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (2 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (1 run, 0 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 checks drop their copy of the old brace counter. Each, run with SRCCUT_CHECK_NAIVE=1 against the committed version: the same text cut and the same result (0 run, 1 skipped for a tool this PC lacks). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…counter test_global_table_loop takes a start offset, and test_mesh_unreachable_outputs and test_vendor_translation return the block's positions, not its text: srccut.block is neither. Moved by a detector that looked at the counting line alone; the last two could not run here (no Vulkan headers), so the comparison did not catch them. Back as they were. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
123 checks carry their own copy of a brace counter (
def block) to cut a function out of a source file. The copies count braces inside strings, character literals and comments too, and when a function is renamed or reshaped they stop with a bareValueErrororIndexErrorthat doesn't say which source or marker: the trap AGENTS.md warns about ("Tests read the source"). This gives the checks one cutter and moves 80 of them to it, each shown to cut exactly what it cut before. The dev-loop proposal's D2 (#2636).Change
tests/srccut.py(new, standard library):block(text, marker): from the marker to the brace that closes the first{after it, counting braces outside string and character literals (raw strings too, and C++14 digit separators), comments and preprocessor lines;between(text, start, end);unique=Falsetakes the first on purpose);SRCCUT_CHECK_NAIVE=1also cuts each block the old way and stops if the two differ: what a migration runs to show it changed nothing.vk_menu.cpp,vk_draw.cpp,vk_memory.cpp,vk_texture.cpp,hookshot_env.h,hos_main.c, ...). Only exact copies of the plain counter moved.blockisn't the plain counter (a start offset; positions returned): restored as they were;unique=False;function,body,between, ...): later, by source file.Testing
main: each run asmainhas it and as moved withSRCCUT_CHECK_NAIVE=1, with its declared tools (the Builder's clang, the Vulkan headers): 80 of 80 pass both ways, no cut differs.tests/test_srccut.py(new): braces in strings, character literals, raw strings, comments and preprocessor lines; a fixture the old counter cut wrongly; a missing marker and a repeated one name the source;between; an unclosed block; the comparison with the old counter.run_all.py --changedruns a test helper's importers (srccut's) rather than every check.See #2636 (D2).
🤖 Generated with Claude Code