scripts: tests_for.py names the tests that exercise a change (TESTS-FOR-CHANGE) #2390
Closed
syfyra wants to merge 1 commit from
upstream-pr/2390 into main
pull from: upstream-pr/2390
merge into: ProjectLeonida:main
ProjectLeonida:main
ProjectLeonida:claude/loop-total
ProjectLeonida:claude/pops-collision-seed
ProjectLeonida:claude/dstorage-hold-page-reads
ProjectLeonida:claude/host-image-copy-switch
ProjectLeonida:feat/gdk-lifecycle-window-hook
ProjectLeonida:claude/d16s8-uav-nvidia-fallback
ProjectLeonida:feat/mfplat-offline-shim
ProjectLeonida:claude/gameinput-slow-reader
ProjectLeonida:fix/rt-null-barrier-clear
ProjectLeonida:claude/depth-resolve-sample-positions
ProjectLeonida:integration/palmetto-parity
ProjectLeonida:claude/valu-literal-sext
ProjectLeonida:claude/slot74-pool-handle
ProjectLeonida:claude/rgb9e5-uint-alias-view
ProjectLeonida:claude/fssm-root-layout-tables
ProjectLeonida:feat/gdk-speech-display-lifecycle
ProjectLeonida:asset-audio-skip-current
ProjectLeonida:qemmhd/old-9940-rectangle-quad-lists
ProjectLeonida:feat/ws2-offline-shim
ProjectLeonida:qemmhd/rt-d16-unorm-uav
ProjectLeonida:feat/xs-device-stops-7-9
ProjectLeonida:qemmhd/rt-depth-same-base-shapes
ProjectLeonida:qemmhd/rt-lazy-attachment-variant
ProjectLeonida:feat/acphal-xma2-decoder
ProjectLeonida:asset-audio-skip
ProjectLeonida:codex/coord-claim-check-20261124-7e48
ProjectLeonida:feat/xs-frame-pacing-presentx
ProjectLeonida:feat/xs-device-vm-options
ProjectLeonida:old-pr/9844
ProjectLeonida:old-pr/9978
ProjectLeonida:old-pr/9815
ProjectLeonida:old-pr/10057
ProjectLeonida:old-pr/9874
ProjectLeonida:old-pr/9965
ProjectLeonida:old-pr/9863
ProjectLeonida:old-pr/10068
ProjectLeonida:old-pr/10066
ProjectLeonida:old-pr/10067
ProjectLeonida:old-pr/10007
ProjectLeonida:old-pr/10061
ProjectLeonida:old-pr/10065
ProjectLeonida:old-pr/10059
ProjectLeonida:old-pr/10063
ProjectLeonida:old-pr/10055
ProjectLeonida:old-pr/10062
ProjectLeonida:old-pr/10042
ProjectLeonida:old-pr/10041
ProjectLeonida:old-pr/10049
ProjectLeonida:old-pr/10047
ProjectLeonida:old-pr/10046
ProjectLeonida:old-pr/10045
ProjectLeonida:old-pr/10056
ProjectLeonida:old-pr/10043
ProjectLeonida:old-pr/10036
ProjectLeonida:old-pr/10034
ProjectLeonida:old-pr/9984
ProjectLeonida:old-pr/10052
ProjectLeonida:old-pr/10038
ProjectLeonida:old-pr/10033
ProjectLeonida:old-pr/10028
ProjectLeonida:old-pr/10050
ProjectLeonida:old-pr/9891
ProjectLeonida:old-pr/9889
ProjectLeonida:old-pr/10051
ProjectLeonida:old-pr/10019
ProjectLeonida:old-pr/10027
ProjectLeonida:old-pr/10029
ProjectLeonida:old-pr/10031
ProjectLeonida:old-pr/10026
ProjectLeonida:old-pr/9941
ProjectLeonida:old-pr/10030
ProjectLeonida:old-pr/10040
ProjectLeonida:old-pr/9990
ProjectLeonida:old-pr/10021
ProjectLeonida:old-pr/9962
ProjectLeonida:old-pr/10022
ProjectLeonida:old-pr/10020
ProjectLeonida:old-pr/10015
ProjectLeonida:old-pr/10025
ProjectLeonida:old-pr/9886
ProjectLeonida:old-pr/10048
ProjectLeonida:old-pr/10014
ProjectLeonida:old-pr/10011
ProjectLeonida:old-pr/9861
ProjectLeonida:old-pr/10010
ProjectLeonida:old-pr/10008
ProjectLeonida:old-pr/9860
ProjectLeonida:old-pr/10006
ProjectLeonida:old-pr/9920
ProjectLeonida:old-pr/9995
ProjectLeonida:old-pr/10000
ProjectLeonida:old-pr/10016
ProjectLeonida:old-pr/10004
ProjectLeonida:old-pr/10023
ProjectLeonida:old-pr/9982
ProjectLeonida:old-pr/9981
ProjectLeonida:old-pr/9983
ProjectLeonida:old-pr/9970
ProjectLeonida:old-pr/9969
ProjectLeonida:old-pr/9968
ProjectLeonida:old-pr/9971
ProjectLeonida:old-pr/9972
ProjectLeonida:old-pr/9942
ProjectLeonida:old-pr/9963
ProjectLeonida:old-pr/9960
ProjectLeonida:old-pr/9964
ProjectLeonida:old-pr/9985
ProjectLeonida:old-pr/9973
ProjectLeonida:old-pr/9862
ProjectLeonida:old-pr/9953
ProjectLeonida:old-pr/10017
ProjectLeonida:old-pr/9952
ProjectLeonida:old-pr/9955
ProjectLeonida:old-pr/9946
ProjectLeonida:old-pr/9954
ProjectLeonida:old-pr/9938
ProjectLeonida:old-pr/9956
ProjectLeonida:old-pr/9856
ProjectLeonida:old-pr/9947
ProjectLeonida:old-pr/9924
ProjectLeonida:old-pr/9961
ProjectLeonida:old-pr/9927
ProjectLeonida:old-pr/9979
ProjectLeonida:old-pr/10032
ProjectLeonida:old-pr/9926
ProjectLeonida:old-pr/5237
ProjectLeonida:old-pr/9951
ProjectLeonida:old-pr/9931
ProjectLeonida:old-pr/9902
ProjectLeonida:old-pr/9921
ProjectLeonida:old-pr/9994
ProjectLeonida:old-pr/9775
ProjectLeonida:old-pr/9768
ProjectLeonida:old-pr/9905
ProjectLeonida:old-pr/9936
ProjectLeonida:old-pr/9901
ProjectLeonida:old-pr/9904
ProjectLeonida:old-pr/9906
ProjectLeonida:old-pr/9988
ProjectLeonida:old-pr/9908
ProjectLeonida:old-pr/9909
ProjectLeonida:old-pr/9911
ProjectLeonida:old-pr/9912
ProjectLeonida:old-pr/9913
ProjectLeonida:old-pr/9887
ProjectLeonida:old-pr/9916
ProjectLeonida:old-pr/9919
ProjectLeonida:old-pr/9925
ProjectLeonida:old-pr/9933
ProjectLeonida:old-pr/9935
ProjectLeonida:old-pr/9918
ProjectLeonida:old-pr/9879
ProjectLeonida:old-pr/9880
ProjectLeonida:old-pr/9881
ProjectLeonida:old-pr/9996
ProjectLeonida:old-pr/9876
ProjectLeonida:old-pr/9892
ProjectLeonida:old-pr/9899
ProjectLeonida:old-pr/9915
ProjectLeonida:old-pr/9914
ProjectLeonida:old-pr/9872
ProjectLeonida:old-pr/9869
ProjectLeonida:old-pr/9866
ProjectLeonida:old-pr/9819
ProjectLeonida:old-pr/10012
ProjectLeonida:old-pr/9857
ProjectLeonida:old-pr/9893
ProjectLeonida:old-pr/9897
ProjectLeonida:old-pr/9928
ProjectLeonida:old-pr/9868
ProjectLeonida:old-pr/9917
ProjectLeonida:old-pr/9940
ProjectLeonida:old-pr/9873
ProjectLeonida:old-pr/9816
ProjectLeonida:old-pr/10009
ProjectLeonida:old-pr/9900
ProjectLeonida:old-pr/9966
ProjectLeonida:old-pr/9859
ProjectLeonida:old-pr/9843
ProjectLeonida:old-pr/9991
ProjectLeonida:old-pr/10058
ProjectLeonida:old-pr/9883
ProjectLeonida:old-pr/9838
ProjectLeonida:old-pr/9835
ProjectLeonida:old-pr/9959
ProjectLeonida:old-pr/9895
ProjectLeonida:old-pr/9837
ProjectLeonida:old-pr/9858
ProjectLeonida:old-pr/9865
ProjectLeonida:old-pr/9864
ProjectLeonida:old-pr/9840
ProjectLeonida:old-pr/9820
ProjectLeonida:old-pr/4669
ProjectLeonida:old-pr/9848
ProjectLeonida:old-pr/9850
ProjectLeonida:old-pr/9810
ProjectLeonida:old-pr/9799
ProjectLeonida:old-pr/9853
ProjectLeonida:old-pr/9875
ProjectLeonida:old-pr/9831
ProjectLeonida:old-pr/9796
ProjectLeonida:old-pr/9801
ProjectLeonida:old-pr/9813
ProjectLeonida:old-pr/9794
ProjectLeonida:old-pr/7417
ProjectLeonida:old-pr/9781
ProjectLeonida:old-pr/9806
ProjectLeonida:old-pr/9958
ProjectLeonida:old-pr/9809
ProjectLeonida:old-pr/9791
ProjectLeonida:old-pr/9792
ProjectLeonida:old-pr/10053
ProjectLeonida:old-pr/9784
ProjectLeonida:old-pr/9789
ProjectLeonida:old-pr/9849
ProjectLeonida:old-pr/9846
ProjectLeonida:old-pr/9773
ProjectLeonida:old-pr/9785
ProjectLeonida:old-pr/9803
ProjectLeonida:old-pr/9826
ProjectLeonida:old-pr/9839
ProjectLeonida:old-pr/9922
ProjectLeonida:old-pr/9948
ProjectLeonida:old-pr/7189
ProjectLeonida:old-pr/9957
ProjectLeonida:old-pr/9823
ProjectLeonida:old-pr/9807
ProjectLeonida:old-pr/9851
ProjectLeonida:old-pr/9774
ProjectLeonida:old-pr/9830
ProjectLeonida:old-pr/9836
ProjectLeonida:old-pr/9822
ProjectLeonida:old-pr/9783
ProjectLeonida:old-pr/9833
ProjectLeonida:old-pr/9890
ProjectLeonida:old-pr/9770
ProjectLeonida:old-pr/9769
ProjectLeonida:old-pr/9772
ProjectLeonida:old-pr/9787
ProjectLeonida:old-pr/9852
ProjectLeonida:old-pr/9834
ProjectLeonida:old-pr/9845
ProjectLeonida:old-pr/9871
ProjectLeonida:old-pr/9771
ProjectLeonida:old-pr/9776
ProjectLeonida:old-pr/10005
ProjectLeonida:old-pr/9949
ProjectLeonida:old-pr/9923
ProjectLeonida:old-pr/9805
ProjectLeonida:old-pr/9829
ProjectLeonida:old-pr/9790
ProjectLeonida:old-pr/9827
ProjectLeonida:old-pr/9929
ProjectLeonida:old-pr/9855
ProjectLeonida:old-pr/9934
ProjectLeonida:old-pr/9907
ProjectLeonida:old-pr/9910
ProjectLeonida:old-pr/9779
ProjectLeonida:old-pr/9780
ProjectLeonida:old-pr/9885
ProjectLeonida:old-pr/9882
ProjectLeonida:old-pr/9877
ProjectLeonida:old-pr/9998
ProjectLeonida:old-pr/4251
ProjectLeonida:old-pr/9987
ProjectLeonida:old-pr/9989
ProjectLeonida:old-pr/9950
ProjectLeonida:old-pr/9777
ProjectLeonida:old-pr/10044
ProjectLeonida:old-pr/9884
ProjectLeonida:old-pr/2906
ProjectLeonida:old-pr/5076
ProjectLeonida:old-pr/9937
ProjectLeonida:old-pr/9986
ProjectLeonida:old-pr/3014
ProjectLeonida:old-pr/9943
ProjectLeonida:old-pr/9939
ProjectLeonida:old-pr/4682
ProjectLeonida:old-pr/4765
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
ProjectLeonida/mandy!2390
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2390"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by syfyra on 2026-11-26T17:02:15Z.
Claimed in the coordination issue as: TESTS-FOR-CHANGE (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7197929842)
Depends on: none. It merges cleanly with the two open pull requests that also edit
CONTRIBUTING.md(#2151 and #2349, in another section), checked with thescripts/pr_overlap.pyof #2349.What and why
The maintainer guide says to run "the pull request's own tests", and AGENTS.md to run one test file while iterating. Which tests those are was guesswork: tests are found by their name, and a helper that many tools import has no test of its name.
tools/world_build.pyis named by seven test files, only two of them calledtest_world_build*, and six more reach it throughsandbox.py,sandbox_scene.pyand the two drawable tools.python -I scripts/tests_for.py [PATH ...]reads the repository and answers for the files or folders named, or with no argument for what the branch changes (committed against the merge base withorigin/main, plus modified and untracked files). For each file it lists the tests undertests/that reach it, with the reason:names it: the test imports the file as a module or names its path, as a quoted path or joined from quoted segments (os.path.join, pathlib/, Node'sjoin);imports: a module the test imports reaches the file through imports, with the module it goes through;folder: the test names the folder the file is in and nothing in it, so it reads what is there; for a Markdown file these aretests/test_docs_*.pyandtests/test_i18n_index.py, the set CI runs for a documentation change;fixture: the file is under afixturesfolder and a test beside that folder quotes its name;ctest: forruntime/, the ctest tests whose program is built from the file according toruntime/CMakeLists.txt: as a source, through a header a source includes, or through a library the program links.foreachloops andset()lists are followed.Then it prints the commands, split the way CI splits the tests:
python -Ifor a standalone file, pytest for a file with CI's pytest markers or no__main__block, the semantic runner,node --test, andctest -Rwith the names. Tests that name the file and changed tests always get a command; the wider reasons do when there are at most 20 of them, or with--all.--jsongives the whole report. It runs no test and writes nothing.On this repository (1,048 test files, 492
add_testentries):tools/world_build.py: 7 tests name it, 6 reach it through imports, 11 name thetoolsfolder.tools/rdna2spirv.py: 341 name it and 273 reach it through imports; the command list is 38 lines with the semantic suite as one of them.runtime/shims/ws2_offline.cpp: 16 ctest tests,ws2_offlineand 15 whose command runs a program that is built from it too (run_tiny_game,run_argv_modesand others).viewer/index.html:tests/test_viewer_streaming.cjsandtests/test_docs_repo_paths.pyname it, andtests/test_viewer_cdn_integrity.pyis one of the two that name the folder.What it cannot see, also said in its docstring: a path that is built at run time, and a ctest program that a CMake function or a generator expression builds. Of the 492
add_testentries, 15 run something it cannot place (gameinput,run_tiny_asyncand others) and one keeps a${...}in its name and is left out, so the ctest list is the least there is to run. Paths are matched in the case they have on disk, so Windows gives the same answer as Linux.CONTRIBUTING.mdgets one bullet under "Working on the code".Tested
Windows 11, Python 3.14.7, git 2.55.0:
python -I tests/test_tests_for.py: 32 tests. 28 run on a synthetic checkout of 62 small files kept as data intests/fixtures/tests_for_checkout.json(its paths would otherwise read as references of the test file to real files, which one of the tests checks), one on a throwaway git repository for the branch mode, and three on this repository.main, where the script does not exist.python -I scripts/tests_for.py tools/world_build.pytakes 1.8 s here.python -Ion the 13tests/test_docs_*.py,tests/test_i18n_index.py,tests/test_tool_stdout_encoding.py,tests/test_text_write_line_endings.pyandtests/test_ci_registration.py;python -I scripts/check_no_game_data.pyon the new files.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator rule in this change.)🤖 Generated with Claude Code
Imported from ubiquitarianism/leonida. Originally posted by wavehs on 2026-11-26T18:12:11Z.
Review: COMMENTED
macOS arm64 check of #2390 (TESTS-FOR-CHANGE). Everything this PR adds runs on macOS, so its own suite and the two big suites were measured here.
Tested head
25a8f9e91merged ontomainbdbc7e923as merge98c26ecab(clean; the branch is 108 commits behind but the diff is four added/replaced files).Environment: Apple M3 Pro, arm64 (subgroups 4..32), macOS 27.2.1, CPython 3.15.2, Apple clang 21.0.0, SPIRV-Tools v2026.4, llvm-mc 23.1.5, MoltenVK 1.4.0; KosmicKrisp and lavapipe = Mesa 26.3.0.
The new suite passes, and bites
python -I tests/test_tests_for.py: 32/32 OK at the head tree and 32/32 after merging ontobdbc7e923. It is fast (2.8-5.2 s).scripts/tests_for.pysabotaged soRepository.reachedstops following imports): 3 failures -test_imports_are_followed_and_say_which_module_they_go_through,test_commands_follow_the_runners,test_tests_are_listed_by_reason_then_by_name. The import graph and the command grouping are pinned.tools/rdna2spirv.py-> 341names it, 273imports(throughtests/semantic/support.py), 11folder;runtime/src/pe_loader.cpp-> 35 ctest;runtime/src/vulkan_replay.h-> 291 ctest;viewer/index.html-> the two viewer tests. The ctest mapping does follow the library/header links, which is the part most likely to be wrong.No regressions
mainbdbc7e923and at98c26ecab. Delta 0 (the new file is intests/, nottests/semantic/).mainand the merge; a line diff of the PASS/FAIL/SKIP output differs only in the per-run temp directory quoted in SKIP reasons. The failures are the pre-existing ones atmain(MV:cs_fma_fused,cs_imgatomic_ext,ps_ssharp; KK:cs_bvh,cs_bvh32,cs_imgatomic_ext,ps_cndmask_sign_mods,ps_valu16_mad_sel).cmake --build runtime/build -j8atmainfails atvk_null_descriptor_testwithglslangValidator: Failed to open file .../build/generated/cs_null_descriptors.spv(runtime/CMakeLists.txt:2266-2273writes intogenerated/without creating it; reproduced on two fresh build dirs).mkdir -p build/generatedthen the build reaches 100%. The GPU binaries (vk_compute_test,vk_store_test,vk_harness) were built before the abort, so the GPU numbers above are from the same tree; I have not counted the aborted build as a pass.Finding (low, real)
scripts/tests_for.py:344-357(expand_targets) never checks that a PATH exists. A mistyped path is silently treated as a file nothing names - and becausesurvey's folder reason does not look at the file either, it even lists tests that name the folder. Reproduced on this checkout:python -I scripts/tests_for.py tools/rdna2spirv.py-> 341names it, 273imports, exit 0.python -I scripts/tests_for.py tools/rdna2spiry.py(one letter wrong) ->folder (11)withtest_alu_frexp.py,test_bad_input_errors.py, ..., aRun:block, and exit 0.So a reviewer who mistypes a path runs eleven unrelated tests and thinks the change is covered; nothing distinguishes that from a file with genuinely no test. The docstring promises "Exit 0, or 2 on a usage or git error" (line 32). Add an existence check in
expand_targets(explicit arguments only, sochanged_filescan still report a file deleted between--baseand--head), e.g.if not os.path.lexists(full): raise GitError(f"{path} does not exist"), and a test beside the others.Nit
commands()(:422) collapses the ctest list to the whole-suite command whenever there are more than 40, even with--all, although--all's help says "commands for every test found, however many". Running the suite does run every test, so this is wording, not behaviour; either say so in the help or gate the collapse oneverythinglike the other reasons.No game files. AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by imShangLi on 2026-12-01T02:06:11Z.
VERIFY-2390 — Linux, Python 3.15, no GPU, no game files
Setup. PR head
25a8f9e9(1 commit, based ond5634def, which is 2 178 commits behind themainat the time of this run,d920d850). Merged into a clean worktree atd920d850— clean merge, no conflicts. Fedora Linux VM, Python 3.15.2, no Vulkan device needed for anything below.1. Its own suite
32/32. This is the part anyone can produce; the rest is what I went looking for.
2. Do its claims hold against ground truth
For 12 files I compared the report against an independent grep of
tests/for the file's stem (excluding a test's own filename), then read every divergence by hand.No false positives. Across all 12 files,
extra = 0: every test the tool reports undernames itreally does contain the file's name.Most divergences are correct exclusions, and there are a lot of them:
# awc_names.py labels a bank from an audio_manifest.json ...— a comment (tests/test_opus_tags.py:300)"sandbox-scene"used as a process label,sandboxin prose (tests/test_sandbox_scene.py:250)tests/semantic/test_*.pydocstrings saying "run_gpu_tests.py / check.py with LEONIDA_BARY_FALLBACK=1 check ps_bary" — the runner runs those tests; they do not test the runnertests/test_gamedata_index_report_paths.py:3naming its own path, which the tool correctly ignores (there is a test for that:test_a_test_that_names_its_own_path_is_not_its_own_test)On the full list rather than the
names itbucket the count drops from 39 to 31, and by inspection 29 of those 31 are correct. Two are not.3. Reverse control
This is the one that matters, because the tool's answer is the list a verifier runs first.
tools/meshlet_page.py:1047-1050:tests/test_tool_stdout_encoding.pyguards exactly this, two ways: a static check that every__main__block reconfigures stdout, andMeasuredCrashes, which runs each tool under a private-use-named folder and asserts noUnicodeEncodeError:Before any change:
The test reaches the file through
os.path.join(TOOLS, tool)wheretoolcomes from a list of bare filenames, so thenames itrule does not follow it, and the test never names thetoolsfolder either, sofolderdoes not catch it.All 19 listed tests PASS.
tests/test_tool_stdout_encoding.pyPASS.Mutation. Line 1049 replaced with
pass:test_tool_stdout_encoding.pyAfter the mutation
tests_for.pystill returns the same 19 tests, still withouttest_tool_stdout_encoding.py, and the one test that catches it says so by name:So for this change the tool prints nineteen green commands and omits the only test that fails. A contributor running what it prints gets no signal at all.
The tree was restored afterwards (
git statusclean,test_tool_stdout_encoding.pyback toOK).4. The same class, second instance
tests/test_zero_span.py:28-35runs nine scanners, including this one, throughrunpy.run_pathfrom a table keyed by bare tool name:tests_for.py --all tools/restofworld_index.pylists 19 tests;tests/test_zero_span.pyis not among them.5. Minor
The description's counts are from the old baseline. It says
tools/world_build.py: "7 tests name it, 6 reach it through imports, 11 name thetoolsfolder". Ond920d850that is 7 / 6 / 16. The first two match; the third has grown with the suite. Worth refreshing before merge, since a reviewer will compare against it.Verdict
Mergeable, and correct about everything it does claim. 32/32 on its own suite, zero false positives in the audited sample, and the reasons it gives hold up when read.
But it is not complete, and the gap points the dangerous way. It misses tests that reach a file through a data table of tool names, and those tend to be the tests that actually execute the file rather than mention it. For the case above, the recommended list is all-green while the real test fails.
Two ways to close it, either is enough:
runpy.run_path,subprocessor atools/join), or--help— "this list is not exhaustive; a green run here is not proof" — so nobody treats it as a complete answer.Nothing here needs game files or a GPU, so the same runs reproduce anywhere.
AI-assisted: yes — MiMo-V2.6-Flash (OpenCode). It built the worktree, wrote the grep cross-check and the mutation, and drafted this report; I read the divergent lines above rather than trusting either side.
Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-01T02:24:53Z.
Verified with its tests and used on a real file. It works, and for a Rust file it answers with the Python tests that reach it and none of the ones inside it - which is the gap worth knowing before this lands.
The suite, on
maind920d850dplus the range (its based5634defeis not behindmain, cherry-pick clean):So the tests are tied to the script and nothing else was needed to make 32 pass.
Used as a user would, on a file this repository argues about more than any other:
That is correct for what it models, and the model is Python.
host.rshas a module of 636 Rust tests that exercise it directly -host::refresh_tests::only_what_differs_goes_upamong them - and the tool names none.Why that matters here:
scripts/tests_for.pysays nothing aboutrust,.rs,cargoor#[test](I grepped for all four), andd3d12/is half this repository. For a Python change the answer is the one this tool gives; for a Rust change the answer is "two Python files reach this", which is not the question someone editinghost.rsis asking.What I would suggest, and it is the same suggestion I made on #2817 for a different reason: say the languages it covers in
--helpor in the output - one line,python only, saves a Rust contributor from concluding the file is untested - and, if the crate is worth it,cargo test -p <crate> <module>is a naming exercise the tool is already shaped for.One thing it gets right that is easy to miss:
imports (1): ... (through tools/game_gate.py)- it says which module the reachability goes through, not just that it exists. That is the part that makes the answer checkable by hand, and it is why the two names above are trustworthy even though the list is short.AI-assisted: yes - DeepSeek v4.1 (flash), which ran the suite, the control, and the tool.
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:51:33Z.
Review: COMMENTED
Draft review note:
TESTS-FOR-CHANGE(scripts/tests_for.py,tests/test_tests_for.py,CONTRIBUTING.md) is cleanly scoped and mergeable onmain, but remains a draft with no CI run (note also that Rust crate changes underd3d12/currently report only Python tests rather thancargo testtargets). Please run CI to green and mark ready for review when ready.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T12:36:22Z.
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.
(AI-assisted triage.)
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T13:01:56Z.
Review: CHANGES_REQUESTED
Now ready for review, requesting changes before merge:
scripts/tests_for.py:344-357): as reproduced by@wavehs,expand_targets()never verifies that an explicit CLI path exists; mistyping a path (e.g.,tools/rdna2spiry.py) exits 0 and prints unrelatedfoldertests instead of exiting 2 as promised inscripts/tests_for.py:32(Exit 0, or 2 on a usage or git error). Please fail closed on missing explicit CLI paths (while keeping deleted-path tolerance for git-diff targets) and add a test.--help/docstring: as noted by@fiestorraand@imShangLi, please state clearly in--help/output that coverage is Python/CTest-oriented (it does not list Rustcargo testsuites underd3d12/and is not exhaustive for bare-name data tables such astests/test_zero_span.py:28-35).(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T13:44:01Z.
Confirmed and isolated the missing explicit-path behavior mentioned in the review, at
25a8f9e91+9f27ba2e1. The PR now needs a local resolution inCONTRIBUTING.mdafter #2871. On the resolved tree the original 32 tests passed, while my new test rejected the current behavior of exiting 0 for a typo. Checking existence inexpand_targetsmade both missing file paths return 2 with no suggestions. A separate disposable Git test confirmed that a deleted file still appears in the branch-mode report. All 33 tests passed with the local change, and the local help text names its Python, Node.js and CTest scope.AI-assisted with OpenAI Codex (GPT-6).
Imported from ubiquitarianism/leonida. Originally posted by andrew-ai on 2026-12-02T00:47:48Z.
Branch-mode check on Windows at
25a8f9e91, using two clean fork checkouts and --based741a9f8f. For the PowerShell game-gate help branch (357778964), the selector found tests/test_game_gate.py by name and returned six default commands. Five came solely from folder matches, including test_run_wine_tests.py and test_x64_recomp_qemu_runner.py for the changed test file. For the NTFS report-path branch (d94b68ba1), it returned 17 default commands including test_report_paths.py and test_report_path_case.py. It marked 935 further tests as omitted, including test_report_source_collision.py, an end-to-end suite for tools that consume this helper. Both primary regression suites were selected. These examples illustrate why the reason field matters: a folder match can be incidental or it can cover a real downstream CLI. I checked selection only. Codex-assisted.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:49:59Z.
Closing: this pull request no longer applies to current
main(merge conflict inCONTRIBUTING.md), and open pull requests that have fallen out of step withmainare being closed so the list stays workable. If you still want this change, rebase it on currentmainand reopen it (or open a new pull request); it will be looked at again.AI-assisted (Claude Code).
Pull request closed