Skip to content

tests: pin the dot2 refusal instead of a self-built oracle for a GFX11-only instruction - #3342

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
bobcatchris:test/dot2-refusal-only
Nov 23, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
bobcatchris:test/dot2-refusal-only

Conversation

@bobcatchris

Copy link
Copy Markdown
Contributor

What and why

tests/semantic/test_alu_dot2_f16.py (1,116 lines, 43 tests) modelled v_dot2_f16_f16 and v_dot2acc_f16_f16 in its own interpreter, built its own SPIR-V and executed that in spirv_mini_interp. Only 2 of its 43 tests call support.translate_lines at all, and both do it to assert the translator refuses the instruction:

$ grep -c 'support.translate_lines' tests/semantic/test_alu_dot2_f16.py
2
$ grep -c 'def test_' tests/semantic/test_alu_dot2_f16.py
43

So 41 of them cannot fail when the translator changes — the TEST-603 class — and the docstring attributed the instruction to the RDNA2 / GFX10 ISA.

Measured with llvm-mc (AOMP 16.0-45, LLVM 17.0.0git, -arch=amdgcn, four-operand VOP3P form):

instruction gfx1100 gfx1030 gfx1013
v_dot2_f16_f16 encodes not supported on this GPU not supported on this GPU
v_dot2acc_f16_f16 invalid instruction invalid instruction invalid instruction
v_dot2c_f16_f16 invalid instruction invalid instruction invalid instruction

The packed half dot product is GFX11-only, so it is not part of the ISA this project translates; the accumulating spellings do not assemble at all; and docs/design.md has no row for either (its v_dot2_* rows are the packed integer dot products). The contract that remains true is the refusal, so the two tests that pin it move to tests/semantic/test_alu_dot2_f16_unsupported.py, which records the measurement above, cites the llvm-mc build, and fails if rdna2spirv ever stops naming the instruction in its Unsupported message.

Precedent: #3098 removes tests/semantic/test_alu_dot2acc_f16.py (−1,146) for the same TEST-603 reason. I did not touch that file to avoid duplicating that PR; this is its f16 sibling.

Correction to the finding on the board: the claim was that this file's import rdna2spirv is unused and would be flagged by #2992's guard. It is used — test_translator_unsupported_rejection and test_translator_accumulating_unsupported_rejection assert rdna2spirv.Unsupported (the old lines 931 and 945). The ISA-scope half of the finding holds; the unused-import half does not.

Tested

Overlay on origin/main 16282101, Windows, Python 3.12.0, no GPU, no game data:

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change; this records that no rule exists for these instructions.)

…1 instruction

tests/semantic/test_alu_dot2_f16.py modelled v_dot2_f16_f16 and
v_dot2acc_f16_f16 in its own interpreter, built its own SPIR-V and executed
that in spirv_mini_interp. Only 2 of its 43 tests touched rdna2spirv, both to
assert the translator refuses the instruction (Unsupported), so 41 of them
could not fail when the translator changed, and its docstring placed the
instruction in the RDNA2/GFX10 ISA.

llvm-mc (AOMP 16.0-45, LLVM 17.0.0git, -arch=amdgcn, four-operand VOP3P) says
v_dot2_f16_f16 encodes for gfx1100 only and is "not supported on this GPU" for
gfx1030 and gfx1013, while v_dot2acc_f16_f16 and v_dot2c_f16_f16 are "invalid
instruction" on all three. The refusal is the real contract, so the two tests
that pin it move to test_alu_dot2_f16_unsupported.py, which records the
measurement in its docstring; instead of carving the middle out of the old
file, it is deleted. tests/semantic/test_alu_dot2acc_f16.py is the same class
and is removed by ItsNotRexed#3098.
@bobcatchris

Copy link
Copy Markdown
Contributor Author

Compared with #3261 (@TheHoracio's). They do not overlap: this PR removes tests/semantic/test_alu_dot2_f16.py (the self-built oracle for v_dot2_f16/v_dot2acc_f16) and keeps a 75-line refusal test for the GFX11-only instruction; #3261 removes tests/semantic/test_alu_dot2acc_f16.py, a different file, and adds the ballot/vote coverage. Both can merge as they stand; the second one to rebase only has to keep the other deletion. No change needed from @TheHoracio for this PR.

AI-assisted.

@Dom-in

Dom-in commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested b9306d1 merged onto main f847748 (clean merge) on Windows 11, Python 3.13, llvm-mc 21: pytest tests/semantic/test_alu_dot2_f16_unsupported.py: 2 passed. The new test runs rdna2spirv.py and checks that it refuses both instructions, so unlike the removed 1,116-line file (a model written in the test) it depends on the translator. This matches the TEST-603-style findings in #2891.

AI-assisted (Claude Code); runs on my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants