Repository navigation
tests: pin the dot2 refusal instead of a self-built oracle for a GFX11-only instruction - #3342
Conversation
…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.
|
Compared with #3261 (@TheHoracio's). They do not overlap: this PR removes AI-assisted. |
|
Tested b9306d1 merged onto AI-assisted (Claude Code); runs on my machine. |
What and why
tests/semantic/test_alu_dot2_f16.py(1,116 lines, 43 tests) modelledv_dot2_f16_f16andv_dot2acc_f16_f16in its own interpreter, built its own SPIR-V and executed that inspirv_mini_interp. Only 2 of its 43 tests callsupport.translate_linesat all, and both do it to assert the translator refuses the instruction: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):v_dot2_f16_f16not supported on this GPUnot supported on this GPUv_dot2acc_f16_f16invalid instructioninvalid instructioninvalid instructionv_dot2c_f16_f16invalid instructioninvalid instructioninvalid instructionThe 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.mdhas no row for either (itsv_dot2_*rows are the packed integer dot products). The contract that remains true is the refusal, so the two tests that pin it move totests/semantic/test_alu_dot2_f16_unsupported.py, which records the measurement above, cites the llvm-mc build, and fails ifrdna2spirvever stops naming the instruction in itsUnsupportedmessage.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 itsf16sibling.Correction to the finding on the board: the claim was that this file's
import rdna2spirvis unused and would be flagged by #2992's guard. It is used —test_translator_unsupported_rejectionandtest_translator_accumulating_unsupported_rejectionassertrdna2spirv.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/main16282101, Windows, Python 3.12.0, no GPU, no game data:python -IB tests/semantic/test_alu_dot2_f16_unsupported.py→ 2 tests, OK.python -m unittest discover -s tests/semantic -p "test_alu_dot2_f16_unsupported.py"(the CI invocation) → 2 tests, OK.grep -rn 'build_spirv_dot2\|ref_dot2_f16\|Dot2Interpreter'outside the deleted file → onlytests/semantic/test_alu_dot2acc_f16.py, which carries its own copies and is removed by BUILD-880, TEST-614, TEST-605, TEST-603: report writers, non-ASCII GPU-suite paths, multithread timeouts, real ballot tests #3098. Nothing imports the deleted module.Checklist
docs/design.md, with how it was confirmed. (No translator change; this records that no rule exists for these instructions.)