Repository navigation
Conversation
…ation (TEST-853) The f16/f64 change moved v_cmp(x)_class_f64 onto the unified Gen.cmp_class, which left the older f64-only Gen.cmp_class_f64 and its dispatch branch unreachable. The two malformed-operand checks lived only in that dead copy, so `v_cmp_class_f64_e64 s4, v[0:1], -v2` and `v_cmpx_class_f64_e64 s4, v[0:1], 0x1` translated with the modifier silently dropped instead of being refused. src1 of a class compare is the integer class mask, and v_cmpx has no VDST, so restore both checks in the live function for every class width, drop the unreachable duplicate, and record the rejections in the docs/design.md contract rows.
|
Tested TEST-853 passed on exact head The translator refused three synthetic f64 listings before GPU submission: a negated mask and a register-pair mask both raised For the positive controls I built the head’s Vulkan harness. A pixel shader ran both an ordinary comparison writing s4 and a three-operand cmpx explicitly writing exec_lo. I restored EXEC before export to make mismatch results observable. One representative of each of the ten binary64 classes was supplied at draw time, including sNaN with payload only in the low dword, signed zeros and subnormals. Each input was drawn twice: once with its own class bit set and once with only the neighbouring class bit set. Bits 10–31 of the mask were set in both runs. Both instructions returned the expected match/mismatch for every pixel in all 20 draws (4,096 pixels each). The SPIR-V passed Vulkan 1.2 validation without the Float64 capability. All lanes had the same input within each draw. AI-assisted check (Codex). AI-assisted verification. |
|
Tested
AI-assisted testing with Codex. All inputs were synthetic. |
|
Tested
|
|
@AirKyzzZ thanks — recorded, and the review note matches what the change does. The two removing-a-copy details you checked are the reason the delete is in the same commit as the guard: Nothing to change from this report. Three independent GPU runs now agree on this head: RTX 5090 on Linux (595.99.02), RTX 3070 on Windows 11 (617.14), and yours on RTX 2060 / Windows 10 (566.14), with the w64-emulate run at parity with CI on |
|
Code read + CPU tests, a4fb7f3: pass — Full-suite context from the same branch: |
|
@dcastell1 recorded, and it lines up with my own run of the whole suite on Four independent checks now agree on |
bobcatchris
left a comment
There was a problem hiding this comment.
Verified at a4fb7f3 on a clean checkout (Windows, Python 3.12, CPU only):
python -I tests/semantic/test_cmp_class_f64.py— 6/6 OK (main aa2988c: FAILED, failures=2, matching TEST-853).python -I tests/semantic/test_alu_cmp_class_f16_f64.py— 4/4 OK with the two added rejection subtests.python -m compileall -q tools/rdna2spirv.py— clean.- The diagnosis is right and the fix goes to the root: the unified
Gen.cmp_classgained the mask-modification (neg/abs/pair) andv_cmpxdestination checks so they apply to all three types, and the dead f64-onlycmp_class_f64copy (−99 lines, unreachable since the unified branch started shadowing it) is removed. f64 stays routed through the unified path, whose docstring already covers the bitwise lo/hi lowering withoutFloat64. - The contract row in
docs/design.mdis updated to match (both the f16/f64 row and the f64 row). - Overlap note for the coordinator: #3885 fixes the same two subtests the minimal way (route f64 to the dead handler instead of deleting it — 3 lines). I reviewed and verified both; this one is the more complete fix (checks reach f32/f16 too, dead code gone, docs in step), so if both are still open at merge time this is the one I'd take, with #3885 rebasing or closing.
Unblocks 2 of the 9 red semantic tests on main. Approving.
AI-assisted.
|
Closing this one: Evidence from a clean
That also makes #3885, the other claim on this item, unnecessary unless its author is carrying something different. Thanks to @bobcatchris (approve), @AirKyzzZ and @dcastell1 for the code reads and the CPU run, and to the four hardware checks that were recorded here; all of them describe behaviour |
Claimed in the coordination issue as: TEST-853
What and why
Two subtests of
tests/semantic/test_cmp_class_f64.pyfail onmain: a negated class-mask operand onv_cmp_class_f64and an explicit non-EXEC destination onv_cmpx_class_f64translate instead of raisingUnsupported.The checks were not wrong, they were unreachable.
7438b8ffadded f64 to the unifiedGen.cmp_class, andGen._insnnow reaches that branch first, so the older f64-onlyGen.cmp_class_f64and its dispatch branch after it were left as dead code. The mask check (-v2, pair mask) and thev_cmpxdestination check lived only in that dead copy, so both malformed forms were accepted and thenegwas silently dropped: the shader then tests the unmodified mask.Both forms are malformed on RDNA2: VOPC/VOP3 src1 of a class compare is the 10-bit integer class mask, not a float operand, and
v_cmpxwrites EXEC only (no VDST). So the translator side is the one to fix, and the assertions stay as they are.tools/rdna2spirv.py: the two guards are restored in the liveGen.cmp_class, before anything is emitted, for every class width (f32/f16/f64 share the mask operand and thev_cmpxdestination rule). The unreachable duplicateGen.cmp_class_f64and its dead dispatch branch are removed, so the two copies cannot drift apart again. A 3-operandv_cmpxthat does nameexec/exec_lois still accepted, as before.docs/design.md: the two contract rows now list the mask andv_cmpx-destination rejections, and the f64 row namesGen.cmp_classinstead of the removed method. No new rule is introduced; the existing rows already described these operands as rejected, so there is nothing new to confirm.tests/semantic/test_alu_cmp_class_f16_f64.py: two rejection cases at a non-f64 width (f16), so the shared guard is covered outside the f64 test that found this.Behaviour change for anything outside the tests: an
abs/neg/pair on the mask and a non-EXECv_cmpxdestination are now refused for f32/f16 as well. Nothing in the repository (semantic fixtures orruntime/test/shaders) uses either form, and the translator no longer emits code that silently ignores a modifier.Tested
Windows 11, CPU only; no GPU, no game files.
python -m unittest discover -s tests/semantic -p test_cmp_class_f64.py, onmain(aa2988cc): 6 tests,FAILED (failures=2); with this PR: 6 tests,OK.python -m unittest discover -s tests/semantic -p test_alu_cmp_class_f16_f64.py: 4 tests,OK.python -m unittest discover -s tests/semantic -p "test_cmp_class_f32*": 5 tests,OK;-p "test_valu_f32_class*": 18 tests,OK.python -m unittest discover -s tests/semantic, Python 3.14.6, 365 test files): 363 files pass, 2 fail —test_loop_ballot_barrier.py(3 failures, 2 errors) andtest_mutations.py(2 failures,v_mul_legacy_f32guard). Both fail identically onmainataa2988cc, so they are pre-existing and not from this change.python -m compileall -q make_game.py tools tests: exit 0.No shader-corpus run: the change only refuses forms that were previously accepted, and the rows in
docs/design.mdwere already recorded as rejected.Checklist
docs/design.md, with how it was confirmed. — No new rule; the existing f16/f64 and f32 class rows are updated to match the code.Depends on: nothing.