Repository navigation
Conversation
Tier C has about 3 reasons per shader, and a reason name does not say which missing rule is behind it.
analyse(..., why=True) now gives, for a tier C program, one line per reason in program order:
reason|sink|producer@exec|source@exec|source of the source
with instruction families only: the instruction where the reason was found, the first instruction that
made the value depend on the partition, the instructions that wrote the producer's operands and the ones
that wrote the operands of those, and if EXEC was the launch mask at the producer and at the source writes.
- WhyAnalysis is a subclass of Analysis that wraps entry, block, join and step with two side tables. It
runs as a second pass for tier C programs only, and its result is dropped if it fails or finds other
reasons, so it cannot change a tier.
- rdna2spirv.py --wave64-why writes the lines to the index as wave64_graphics_why. Without the option the
index and the translation time are as before. The emitted SPIR-V is the same in the two cases.
- wave64_halves.py --census <index> --why [--top N] prints the counts: the first reason of each shader,
its marginals by sink, producer and source, and the first site of each reason. No names, no code.
tests/semantic/test_wave64_halves_why.py: 14 hand-written tier C listings with the lines derived by hand.
No game data. Not run on the corpus.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…a vote The census of ItsNotRexed#4686 on the corpus has about 1,400 first reasons that are a refused vote (unsafe-vote-branch), and its lines do not say why vote() refused the branch. WhyAnalysis now wraps vote(): when the base class reports unsafe-vote-branch or unsafe-execz-branch, it adds one line reason|condition|run:family|other:family with the condition that failed (no-narrowing, other-side-joins, other-side-exits, the two together, one-way) and the instruction family at the start of the side that runs on a yes vote and of the other side ("join" when that side has no code of its own). analyse(..., why=True) gives the distinct lines in program order (at most 8) as "vote_why"; rdna2spirv.py --wave64-why writes them to the index as wave64_graphics_vote_why; wave64_halves.py --census --why counts them by condition, by first line and by line. No tier and no SPIR-V changes; without the option the index is as before. tests/semantic/test_wave64_halves_vote_why.py: 9 hand-written listings with the lines derived by hand. Builds on ItsNotRexed#4686. No game data. Not run on the corpus. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Completed the Xbox 1.0.2.1 corpus run on I also counted distinct shaders to separate prevalence from the first refusal. Of the 6,496 tier-C shaders with recorded refused votes, 6,235 contain Across all tagged shaders, 2,287 record multiple distinct reason/condition pairs and 656 reach the eight-line cap. These are counts of recorded evidence, not estimates of tier promotions. AI-assisted QA. |
|
Tested d7ee0e7 on Windows 11, Python 3.14, CPU part only: pass. Full |
|
Package corpus census completed on a 40-core Linux server with the 1.0.2.1 package and 64 GiB RAM. 26,503 entries translated and the merged index passed; 29 FSPX entries: 21 translated, 8 undecodable by the existing fallback. All 8,245 tier-C entries carried wave64_graphics_why. Aggregate:
Refused-vote conditions:
Top first refused-vote shapes:
No shader names or shader code are included. Counts only. AI-assisted (Copilot). |
Claimed in the coordination issue as: new SHADER item (claim)
Depends on: #4686
This branch is #4686 (
9295fa29, one commit onmain561b65a8) with one commit on top (d7ee0e7f). The change of this pull request is the last commit only.What and why
The census of #4686 on the corpus (8,245 tier C shaders) has about 1,400 shaders whose first reason is a refused vote:
unsafe-vote-branch | vcc_branch | ...(541 + 456 + 160 in the largest rows) andunsafe-vote-branch | scc_branch | ...(424). Its lines say where the voted mask came from. They do not say whyvote()refused the branch, and that is what decides which rule can help: a run side that does some scalar work before it narrows EXEC, an if/else (#5747 tried that shape), or an early exit.This pull request adds that information to the same option. It changes no tier and no emitted SPIR-V.
1.
tools/rdna2spirv.py --wave64-whyalso writeswave64_graphics_vote_whyfor a tier C shader that has a refused vote: the distinct lines of its refused votes, in program order, at most 8.reasonunsafe-vote-branch(a vote on a mask) orunsafe-execz-branch(a vote on EXEC)conditionvote()that failed, see belowrun:familyother:familyjoinwhen that side has no code of its ownno-narrowingother-side-joinsother-side-exitsno-narrowing+other-side-joins,no-narrowing+other-side-exitsone-wayFor a vote on EXEC the run side needs no narrowing, so the condition is
other-side-joinsorother-side-exits. A line has reason names, condition names and instruction families only. Examples from the hand-written tests:The second line is a run side that loads a scalar and then narrows. The third is the two-sided if/else of #5747.
2.
tools/wave64_halves.py --census <index.json> --whyprints, after the tables of #4686:How it is made.
WhyAnalysis(the second analysis pass of #4686) wrapsvote(). The base class decides. When it reports one of the two reasons, the wrapper calls the same helpers thatvote()uses (narrows,reaches,past_jumps) to name the condition. No line of the base class changes.Tested
Head
d7ee0e7f. Windows 11 Pro (10.0.26200), Python 3.14.7, CPU only. No GPU. Nollvm-mcand no SPIRV-Tools on this machine, so I did not build the GPU fixtures and I did not runspirv-val. No game files.tests/semantic/test_wave64_halves_vote_why.pytests/semantic/test_wave64_halves_why.py(of #4686; two of its tests now ignore the new key)tests/semantic/test_wave64_halves.py,test_wave64_halves_soundness.pytests/semantic/test_wave64*.py,test_w64*.py, the interpreter test and the twosaveexectestspython -I -m unittest discover -s tests/semanticmain561b65a8: 6,150 tests, OK; #46869295fa29: 6,162 tests, OK)pyteston the wave64 fixture tests,test_lane_masks.py,test_shader_index.py, the docs row tests and the hygiene testsllvm-mc)python -I -m compileall -q tools tests,scripts/check_no_game_data.pyWhat the new tests check, all on hand-written vertex listings:
--wave64-whythe index entry has no new key; with it, the tier, the reasons and all other keys of the entry are the same.The command line from start to end (added later, with
llvm-mc21.1.8 and SPIRV-Tools v2026.4 on this machine): three hand-written vertex listings throughrdna2spirv.py <disasm> --out <dir>with and without--wave64-why, thenwave64_halves.py --census <index> --why. The two runs exit 0; the index entries are equal apart from the two_whykeys; the.spvfiles are byte-identical; the census prints the two sets of tables.tests/test_wave64_halves_fixtures.pywith the tools: 10 passed, 0 skipped.Request: please run it on the corpus
I have no copy of the game. If you have your own copy and LLVM 21 or newer, please translate the wave64 VS/PS/GS with the option and post the counts (the output has no shader name and no code):
The useful parts are the line "refused votes by condition" and the table "first refused vote of a shader". They show if the refused votes are mostly run sides that do not start with the narrowing (and which instruction family comes first), if/else shapes, or early exits.
Limits
run:andother:name only the first instruction of each side.Overlap
census()loop for the checks of entry fields: a small text merge for the one that merges second.tools/wave64_halves.py. This pull request adds methods toWhyAnalysisand does not changevote(); a pull request that adds a parameter tovote()is covered, because the wrapper passes all other arguments on.AI-assisted: yes (Claude Code). It wrote the change and ran all the checks above on this machine.
Checklist
docs/design.md, with how it was confirmed. (No new rule; the row describes the new index key and the census tables.)🤖 Generated with Claude Code