Repository navigation
tests/semantic: ballots and votes through the translator; drop the v_dot2acc_f16_f16 model (TEST-603) - #3261
Conversation
…dot2acc_f16_f16 model (TEST-603) test_ballot_votes.py modelled OpGroupNonUniform* in its own Python interpreter and never translated anything, so it passed whatever tools/rdna2spirv.py did. It now translates a wave64 and a wave32 compute listing and runs every lane with spirv_mini_interp.run_workgroup: a lane mask built in VCC from s4:s5, read through s_bcnt1, s_ff1, s_cmp_eq vcc/exec (vote all), s_cmp_lg vcc/0 (vote any), a per-lane v_cndmask, and s_and_saveexec with v_readfirstlane and s_bcnt1 exec (then EXEC restored), over 12 wave64 and 9 wave32 masks (lane 31/32 edges, halves, checkerboards). Expected values come from the input pattern only. Mutating the translator so s_bcnt1 or s_ff1 drop the high half of a lane mask fails the new file (8 and 3 failures); the old file passed 31/31 under both. test_alu_dot2acc_f16.py is removed: v_dot2acc_f16_f16 is no RDNA2 instruction (llvm-mc 21.1.8: "invalid instruction" for gfx1013, gfx1030 and gfx1100), the f16 dot2 forms that do exist (v_dot2_f32_f16, v_dot2c_f32_f16) are not on gfx1013 and the translator implements none of them, so there is nothing to translate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AI-assisted CPU review of The fixture can miss incomplete EXEC restoration for nonempty masks. The per-lane bit stores run before
|
|
@whattheflop, thanks: you were right. Fixed in
Windows 11, Python 3.12, CPU only. AI-assisted. |
From @whattheflop's review of ItsNotRexed#3261: the per-lane stores ran before s_and_saveexec and only two wave-wide values after the restore, so a restore that came too late passed for every nonempty mask. Each lane now writes a mark after the restore and every slot is asserted. Moving the restore below that store fails all 19 nonempty masks (8 wave32, 11 wave64); the listing as written passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AI-assisted CPU retest of Both revised listings assembled with WSL LLVM 21.1.8 on gfx1013 and gfx1030. Both translated modules passed Vulkan 1.3 SPIR-V validation. uv CPython 3.12.13, synthetic inputs only. |
|
Second check on Linux (CachyOS, Python 3.14.10 venv, llvm-mc 23.1.5, CPU only, no game files), head e8f5997.
No blocking issue. AI-assisted (Tacit). |
TEST-603, released to me by @tupacfan04 in #2891 and claimed in #3047: #3047 (comment)
What and why
Two files in
tests/semantic/checked their own models and never rantools/rdna2spirv.py, so they passed whatever the translator did. #2992's guard lists both asDEBT:.test_ballot_votes.pyis rewritten. It now translates a wave64 and a wave32 compute listing and runs every lane withspirv_mini_interp.run_workgroup.s_bcnt1(bit count);s_ff1(lowest lane, -1 when none);s_cmp_eq vcc, exec(vote all) ands_cmp_lg vcc, 0(vote any);v_cndmask(bit extract);s_and_saveexecwithv_readfirstlaneands_bcnt1 execunder the mask as EXEC, then EXEC restored.test_alu_dot2acc_f16.pyis removed. There is nothing to translate:v_dot2acc_f16_f16is not an instruction: llvm-mc 21.1.8 answers "invalid instruction" for gfx1013, gfx1030 and gfx1100.v_dot2_f32_f16,v_dot2c_f32_f16) are "not supported on this GPU" for gfx1013, the console's class.#2992'sDEBTentries for these two files can be dropped once both PRs are in. ItsDEBTdict isn't checked for stale entries, so neither PR has to wait for the other.Tested
Windows 11 Pro 26300, Python 3.12, CPU only. No GPU, llvm-mc or game files needed. llvm-mc was used only to check the mnemonics.
The new file:
python -m unittest discover -s tests/semantic -p test_ballot_votes.py: 3 tests OK.The full suite:
python -m unittest discover -s tests/semantic: 4080 tests OK.Negative control: I mutated
tools/rdna2spirv.pyso thats_bcnt1ors_ff1drop the high half of a lane mask (hi = self.cu(0)after theirwave_mask), then restored it.main)s_bcnt1s_ff1tests: a semantic test must reach tools/rdna2spirv.py #2992's guard: its
offenders()frompr-2992, with an emptyDEBT, on this tree reports onlytest_valu_div_fixup.py(TEST-545). The newtest_ballot_votes.pyreaches the translator.AI-assisted (Claude Code).
🤖 Generated with Claude Code