Repository navigation
Conversation
Kam471
left a comment
There was a problem hiding this comment.
Ran at cdea51c1d on Windows 11, RTX 5070 Ti:
tests/semantic/test_w64_sdst_pair.py-> 3 tests, OK;test_wave64_halves_sdst_pair.py-> 9 tests, OK.test_wave64_halves.py101 OK,test_wave64_halves_soundness.py30 OK.- GPU emulated:
LEONIDA_W64_EMULATE=1 run_gpu_tests.py --filter sdst_pair-> 1/1 passed,cs_w64_sdst_pair->4871 4871 4871 70407 70407 4871 4871 4871; translator 1/1 +spirv-val. git diff --checkclean.
A VALU mask destination printed as one SGPR now consumes the SGPR pair in lane_masks.py/wave64_halves.py/the translator, and the docs note it; the new semantic and GPU fixture cover the pair write. No blocking issue.
|
Verified AI-assisted (Devin); no game files. |
|
Tested Result: pass; the new fixture passes on both GPUs and nothing else changes.
Tested and written by Claude (Claude Code), posting from @theswiss24's account. |
kacper-serewis
left a comment
There was a problem hiding this comment.
Independent operand census at cdea51c: 8,825 of 13,405 wave64 graphics listings contain a candidate single-SGPR mask destination (199,475 compare and 1,049 carry/secondary mask sites). Across all stages we found 18,870 candidates among 23,841 wave64 listings, versus 18,866/23,839 reported on #2231; discrepancy unresolved. Nine synthetic controls passed. The single-register and explicit-pair cases both reach tier A with equal interpreted exports; the lane-ID control remains tier C. Static candidate counts do not measure retail tier changes. AI-assisted CPU/cached inputs only.
|
AI-assisted (Claude Code). No game files; I cannot count the corpus, so this is a reading of the code only. @kacper-serewis about 18,870 of 23,841 against 18,866 of 23,839 on #2231: I see two possible causes in the code, and I cannot tell from here which one applies.
A count of the candidates for each mnemonic (counts only) can show it: if |
|
VERIFIED, no defects found at head Not a bug: Note it depends on #2231. AI-assisted review, no game files, no GPU. |
|
Tested
What this shows: on a 32-wide device the shapes ps_w64_a_sdst_pair.asm (hand-written, no game data; assembled for gfx1013 without a mattr line, like cs_w64_sdst_pair.asm)Expected words per pixel, with v_interp_p1_f32_e32 v2, v0, attr0.x
v_interp_p2_f32_e32 v2, v1, attr0.x
v_interp_p1_f32_e32 v3, v0, attr0.y
v_interp_p2_f32_e32 v3, v1, attr0.y
v_mul_f32_e32 v2, 0x42800000, v2
v_mul_f32_e32 v3, 0x42800000, v3
v_cvt_u32_f32_e32 v2, v2
v_cvt_u32_f32_e32 v3, v3
v_lshlrev_b32_e32 v6, 6, v3
v_add_nc_u32_e32 v6, v2, v6
v_mov_b32_e32 v7, v6
v_mov_b32_e32 v8, v6
v_mov_b32_e32 v9, v6
v_and_b32_e32 v4, 3, v2
s_bcnt1_i32_b64 s15, exec
v_cmp_ne_u32_e64 s14, 3, v4
s_and_saveexec_b64 s[10:11], s[14:15]
v_or_b32_e32 v9, 0x8000, v9
v_and_b32_e32 v4, v2, v3
v_and_b32_e32 v4, 4, v4
s_bcnt1_i32_b64 s15, exec
v_cmp_ne_u32_e64 s14, 0, v4
s_and_b64 vcc, exec, s[14:15]
s_cbranch_vccz 4
s_and_saveexec_b64 s[12:13], vcc
v_or_b32_e32 v6, 0x1000, v6
s_or_b64 exec, exec, s[12:13]
v_and_b32_e32 v4, 1, v2
v_and_b32_e32 v5, 1, v3
s_bcnt1_i32_b64 s15, exec
v_cmp_eq_u32_e64 s14, 1, v4
s_bcnt1_i32_b64 s17, exec
v_cmp_eq_u32_e64 s16, 1, v5
s_and_b64 s[18:19], s[14:15], s[16:17]
s_and_saveexec_b64 s[12:13], s[18:19]
v_or_b32_e32 v7, 0x2000, v7
s_or_b64 exec, exec, s[12:13]
s_bcnt1_i32_b64 s15, exec
v_cmp_lt_u32_e64 s14, v2, v3
s_and_saveexec_b64 s[12:13], s[14:15]
v_or_b32_e32 v8, 0x4000, v8
s_or_b64 exec, exec, s[10:11]
exp mrt0 v6, v7, v8, v9 done vm
s_endpgmAI-assisted (Claude Code; the shader was written by Codex and reviewed independently before the run). |
|
Census (TEST-1006) of Setup. Native mode, the 13,405 wave64 VS/PS/GS (picked by the FSSM wave-size flag and the carve-index stage), WSL Ubuntu, Python 3.14.4, llvm-mc 21.1.8, SPIRV-Tools v2026.1, CPU only. I compared three trees:
All three translate all 13,405, and all 13,405 pass
This PR on top of
So once #2231 prints the mask destination as the pair, reading it as the pair in #2231 on its own ( AI-assisted (Claude Code). Part of TEST-1006 on the coordination issue. |
|
Tested cdea51c on AMD Radeon 610M (RADV, Mesa 26.2.6), CachyOS Linux, selected with LEONIDA_VK_DEVICE=RADV: pass.
AI-assisted. |
|
Tested the three requested trees on CachyOS using the same 26,503 listings from my own 1.0.2.1 copy, native translation, CPU only. All 26,503 translated and passed
AI-assisted. These checks cover translation, validation and tier classification. They do not measure execution of promoted shaders on a wave64 GPU. |
|
Verified at head cdea51c merged with main 3faac55 at check time: all new and family tests pass on Linux — test_w64_halves_sdst_pair and test_w64_sdst_pair via unittest discover (re-run), lane-mask and wave64-halves regressions green, docs and newline guards green. One coordination note that matters: the branch is stacked on the still-open #2231 — its lane_masks/rdna2spirv core and its test are ancestors of this head and are verifiably NOT on main, so merging #4794 also lands #2231. Either merge #2231 first or know that this one carries it. GPU fixture not run here. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested
|
cdea51c to
abe1cd4
Compare
|
AI-assisted (Claude Code). No game files; CPU only (Windows 11, Python 3.14.7). Rebased on
The description has the new commit names for the census request ( |
|
Tested abe1cd4 on Windows 11, Python 3.14, CPU part only: pass. Full |
|
Tested abe1cd4 (main GPU fixture
CPU: Corpus (my own 1.0.2.1 copy, all 26,503 shaders,
504 shaders change tier, all upward: 296 C→B and 208 C→A; none goes down. First reasons: AI-assisted. |
|
Tested CPU tests (
|
| Build | Mode / VKC_SUBGROUP_SIZE |
Observed subgroup | out[0..7] |
Result |
|---|---|---|---|---|
PR #4794 (abe1cd4a) |
native wave64 (64) |
64 |
4871 4871 4871 70407 70407 4871 4871 4871 |
PASS |
PR #4794 (abe1cd4a) |
--wave64-emulate (32) |
32 |
4871 4871 4871 70407 70407 4871 4871 4871 |
PASS |
PR #4794 (abe1cd4a) |
--wave64-emulate (64) |
64 |
4871 4871 4871 70407 70407 4871 4871 4871 |
PASS |
Control (main 561b65a8) |
native wave64 (64) |
64 |
0 0 0 73735 73735 0 0 0 |
expected baseline fail |
Control (main 561b65a8) |
--wave64-emulate (32) |
32 |
0 0 0 73735 73735 0 0 0 |
expected baseline fail |
Not run here: carved retail disassembly corpus tier census. AI-assisted; no game data.
|
GPU part: tested abe1cd4 on AMD Radeon Graphics iGPU (gfx1036, RDNA2, Ryzen 9 9950X3D), Windows AMD driver 32.0.21042.62, Windows 11, MSVC RelWithDebInfo, |
|
Re-measured at the rebased head
AI-assisted (Claude Code). |
|
Completed the requested three-commit census at rebased head
For #2231 alone, 158 went C→A and 5 went C→B. For #4794 alone, 50 went C→A (27 pixel, 23 vertex) and 291 went C→B (2 pixel, 289 vertex). No shader moved down on either step. These are paired transitions on the same source digests, including all 13,405 tiered graphics listings. The binary comparison also covers the 13,098 entries outside the tier census. This replaces my earlier pre-rebase split for the current commits. I ran Retest after the rebase to |
The corpus is disassembled for gfx1013 without +wavefrontsize64, so the 64-bit SDST of a wave64 v_cmp_*_e64 or carry-out prints as one register (v_cmp_gt_f32_e64 s0, ...) while the wave writes s[0:1]. lane_masks.py took it as s0 alone, so s1 was unknown and a later s_and_b64 / s_or_b64 of two compare results took the 64-bit data path: SCC was each lane's own bit instead of the wave's vote, and s_bcnt1_i32_b64 of it counted data bits. lane_masks.step/analyse take the shader's wave size; mask_sdst widens a one-register VALU mask destination to the pair in wave64. rdna2spirv's valu_mask_dst writes both registers: since 804f4ae a pair read as a wave64 mask takes lanes 32-63 from the high register, which the one-register write left stale. Corpus (26,503 shaders): one-register SDSTs in 18,866 of 23,839 wave64 shaders; 18,868 translate differently, all wave64; the same 26,501 still translate and pass spirv-val as on main. New GPU test cs_w64_sdst_pair (corpus form) and tests/semantic/test_w64_sdst_pair.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R pair The corpus listings print the 64-bit mask destination of a wave64 v_cmp_*_e64 or carry-out as one register. write of one register, so the high register kept the taint, the tag and the reaching definitions of its old value, and a later 64-bit mask read of the pair was tier C (tainted-exec, stale-scalar) in an exact shader. operands() now widens that destination with lane_masks.mask_sdst (v_cmp with an SGPR destination, the carry-out of the VOP3b instructions). tests/semantic/test_wave64_halves_sdst_pair.py: each hand-written listing in the one-register and in the pair spelling, as one 64-lane wave and as two 32-lane waves. 5 of its 9 tests fail without the change. Builds on ItsNotRexed#2231. No game data. The corpus effect is not measured. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
abe1cd4 to
e701374
Compare
|
AI-assisted (Claude Code). No game files; CPU only (Windows 11, Python 3.14.7, Rebased on
The one failure is |
Claimed in the coordination issue as: new SHADER item (claim)
Depends on: #2231
This branch is
main1cc6e3c1with two commits: the commit of #2231 (8276a25c, replayed as27a372cf, author unchanged) and the commit of this pull request (e701374c). #2231 is open and conflicts withmainat this time;27a372cfhas my resolution (see "The replay of #2231"). The change of this pull request is the last commit only:tools/wave64_halves.py, one new test file, one sentence indocs/design.mdand one intests/semantic/README.md. The numbers in "Tested" are from the first headcdea51c1; my comments of the rebases have the runs at the later heads.Measured on the corpus (
Kev-Ball, own 1.0.2.1 copy, counts only, at the head before this rebase): this pull request alone moves 341 shaders out of tier C and changes 0 of 26,503 SPIR-V binaries. The table is in "Measured: the corpus".What and why
The corpus listings are disassembled for wave32. Thus the 64-bit mask destination of a wave64
v_cmp_*_e64or carry-out prints as one register:v_cmp_gt_f32_e64 s0, ...writess[0:1]. #2231 found this (284,353 compares in 18,866 wave64 shaders) and corrects the translator andtools/lane_masks.py.tools/wave64_halves.pyhas the same defect in its own operand table, and #2231 does not change that file.operands()takes the destination ass0only. Thens1keeps what the analysis knew about its old value:A later 64-bit read of
s[0:1]as a mask (s_and_saveexec_b64,s_and_b64, ...) gets that old state, and an exact shader is tier Ctainted-execorstale-scalar.The census of #4686 shows the size of the problem. @Kev-Ball ran
--census --whyon the corpus at a head without #2231. The largest rows are avcc_branchwhose producer is a SALU instruction and whose sources are av_cmpand one more writer (s_load,input,salu): that is a 64-bit mask instruction on a pair whose low register av_cmpwrote and whose high register still has an older value. A hand-written listing in the one-register spelling gives these same lines atmain, and the pair spelling of the same listing is tier A (details in my comment on #4686). About 3,700 of the 8,245 first reasons have a source of that form. #2231 removes the main part (the pair becomes a mask forlane_masks). This pull request removes the part that stays in the tier analysis after #2231.The change.
operands()widens the mask destination withlane_masks.mask_sdst(a, True)(the helper of #2231; this module analyses wave64 programs only):v_cmp*with an SGPR destination (notv_cmpx, not the VCC form);v_*_co_*,v_mad_u64_u32,v_mad_i64_i32,v_div_scale_*), the same list thatlane_masks.pyhas.A pair that the listing prints as a pair is not changed. Other one-register SGPR destinations (
v_readfirstlane_b32, SALU, scalar loads) are not changed.Why it is exact. The hardware writes the two registers (#2231: the listings are made without
+wavefrontsize64; its GPU testcs_w64_sdst_pairpasses on native wave64 devices). After the instruction, the two registers hold the new mask, so the old state of the high register cannot reach a later read. The change only makes the analysis of the one-register spelling equal to the analysis of the pair spelling, which was already there.Tested
Head
cdea51c1. 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.New test file
tests/semantic/test_wave64_halves_sdst_pair.py(9 tests). Each program is a hand-written vertex shader, written in the one-register spelling and in the pair spelling. It is translated and run onspirv_wave_interp.pyas one 64-lane wave and as two 32-lane waves.s_bcnt1_i32_b64of EXEC before the comparev_readfirstlane_b32of a varying valuev_add_co_u32_e64 v9, s14, ...) after a lane count in the high registers_and_b64 vcc, exec, s[14:15]and a vote; two compares ANDed; the compare intos_and_saveexec_b64tainted-exectainted-execcross-laneoperands()unit checks: which destinations become pairs and which do notNegative control: with
wave64_halves.pyof the commit before (main and #2231, without this change), 5 of the 9 tests fail: the first four rows are tier Ctainted-execin the one-register spelling, and the unit check fails. The census shapes (row five) are tier A there already; they pin the effect of #2231 on the tier.tests/semantic/test_wave64_halves.py,test_wave64_halves_soundness.py,test_w64_sdst_pair.py(of #2231)python -I -m unittest discover -s tests/semantictest_loop_ballot_barrier(5) andtest_vcmp16_opsel(1). These are the same 6 tests, by name, that fail on this machine onmain(measured at2d3369a4, 6,245 tests); none of them is in a file that this pull request or #2231 changespytestontests/test_wave64_halves_fixtures.py,test_lane_masks.py, the docs row tests,test_semantic_translator_use.py,test_text_write_line_endings.py,test_resource_hygiene.pyllvm-mc)python -I -m compileall -q tools tests,git diff --check,scripts/check_no_game_data.pyThe replay of #2231
8276a25conmainhas three conflicts. My resolutions, for the author of #2231 if they are useful:tools/lane_masks.py:mainaddedv_div_scale_f32/v_div_scale_f64to the VOP3b mask line, Translator: a wave64 VALU mask SDST printed as one SGPR is the SGPR pair #2231 changed the same line toput(state, mask_sdst(a[1], wave64), MASK). I kept the two changes.scripts/run_gpu_tests.py: the name tuple ofmainplus"cs_w64_sdst_pair".docs/design.md: the rows ofmainplus the row that Translator: a wave64 VALU mask SDST printed as one SGPR is the SGPR pair #2231 adds.After that,
tests/semantic/test_w64_sdst_pair.py(3 tests),tests/test_lane_masks.pyand the docs row tests pass.Measured: the corpus
Kev-Ballran the three-commit census that this section asked for (comment of 2026-11-23T14:20Z; native translation of the 26,503 listings of their own 1.0.2.1 copy, counts only, all translated and valid forspirv-valat each commit):main561b65a8mainand #2231 (f2b57f63)abe1cd4a)The census was made at the commits before the rebase on
main1cc6e3c1. The change of this pull request is the same after the rebase; the numbers on the newmainare not measured.Limits
v_cndmask_b32mask, aco_cicarry-in) is the subject of Translator: wave64 VOP3 v_cndmask mask and co_ci carry-in printed as sN read the SGPR pair; mask-data tier C (SHADER-200) #2241, not of this pull request.Overlap
MASK_LO/MASK_HIkinds oflane_masks. Without Translator: a wave64 VALU mask SDST printed as one SGPR is the SGPR pair #2231, each one-register compare leaves the high register without a mask kind, so I expect that wave64_halves: an SGPR-pair mask with one half overwritten is mask-half #4624 givesmask-halfto these pairs; with Translator: a wave64 VALU mask SDST printed as one SGPR is the SGPR pair #2231 they are complete pairs. I did not test that combination.WhyAnalysis) usesoperands()and gets the wider destination with no change.slistto the carry-out check ofoperands(); the rebase keeps it next to the wider destination. wave64_halves: a buffer_load with idxen at a wave-uniform address gives a wave-uniform VGPR (new SHADER item) #4630, SHADER-747: wave64_halves refuses a vote whose run side widens EXEC before the join #4541, wave64_halves: preserve destination taint on partial writes and reject asymmetric DPP row_mask #4373 and wave64_halves: a lane mask accumulated by lane-local defs is not stale (SHADER-821) #4656 (open) do not change the two lines ofoperands()that this pull request changes.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.🤖 Generated with Claude Code