tooling: match scan shader stage tags as whole tokens #1522
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1529"
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 R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T13:43:14Z.
Change
detect_shader_stageintools/scan_unsupported_shaders.pyclassified a shader by substring tests on its lowercased path ("ps_" in lower,"_cs" in lower, and so on). Substrings of unrelated words matched, which skews the per-stage breakdown in the scan report. Onmain:mainloops_cs.s(containsps_)shaders/bumps_vs.txt(containsps_)tex_cs_ps5.s(contains_ps)cs/copy.s(directory test needed a leading slash)The change matches
ps,csandvsonly as whole tokens of a path component, where tokens are split on_,.and-.pixel,computeandvertexmatch only as a whole directory component. Matching stays case insensitive and\is still read as/. The name shapes that existing tests and callers use keep their classification (shaders/pixel/ps_draw.bin,cs_dispatch.bin,shaders/vertex/vs_main.s,ps_test.bin,unknown_kernel.bin).Judgement call for the maintainer: when a path carries whole tags of two stages (for example
ps_cs_x.s), the first of pixel, compute, vertex wins. That is the order the old code tested, so such names keep their old result.tex_cs_ps5.sis not ambiguous under the token rule:ps5is a different token fromps, so it classifies as compute. Ifps5should count as a pixel tag, that needs a decision on what the suffix means. I did not find a naming convention for it in the repository and did not invent one.Behavior changes beyond the four names:
a/ps/x.sandps/x.snow match without a leading slash, andblur.ps.smatches on a.delimiter. Names that only matched through a tag embedded in a word now fall tootheror to the stage of their real tag.Open PRs #1466, #713 and #528 also edit
tools/scan_unsupported_shaders.py, in the lowering tables. None of their diffs touchesdetect_shader_stage, and a test merge of this branch with #1466 is clean.Verification
Windows 11, Python 3.14.5, base
origin/main1ca0dec1.mainplus the new test (original tool file):Ran 141 tests,FAILED (failures=1, skipped=18). The failure is the newtest_detect_shader_stage_whole_tokens_only, first assertionloops_cs.s:'pixel' != 'compute'.Ran 141 tests,OK (skipped=18).main:loops_cs.spixel,shaders/bumps_vs.txtpixel,tex_cs_ps5.spixel,cs/copy.sother,blur_cs.scompute.The 18 skips are the existing LLVM-only tests (no LLVM on this machine). Not run: the other checks in the
AGENTS.mdlist and the C++ and ctest targets; this change touches no lowering or GPU path.Evidence and follow-up
The new test covers the four misclassified names, controls for each stage (suffix,
-and.delimiters, upper case, backslash path, long directory names) and the two-tag precedence rule.docs/experiments.mdhas no text on stage detection, so no doc change. No game files or dumps; names are synthetic.AI-assisted.