Repository navigation
Tests: GPU test for 16-bit float v_cmpx compares (all 16 f16 predicates, e32 and e64) - #2607
Conversation
…, e32 and e64) Two pixel tests, ps_vcmp_f16 (e32, VCC) and ps_vcmp_f16_e64 (SGPR destination, swapped operands), with NaN, +-0, +-inf, f16 denormals and junk high halves. Words derived by hand in the headers; semantic fixture and test added. AI-assisted.
…es, e32 and e64) Two pixel tests, ps_vcmpx_f16 (e32) and ps_vcmpx_f16_e64 (swapped operands), on the operand pairs of ps_vcmp_f16: the EXEC result of each predicate, VCC kept, and EXEC only ANDed. Words derived by hand in the headers; semantic fixture and test added. AI-assisted.
|
Tested Test programs built from All four fixtures assemble, pass |
|
Tested |
docs/design.md AI-assisted.
|
Rechecked in game MODE (IEEE off, DX10_CLAMP on, f32 denorm flush): same words. AI-assisted. |
|
Tested
No game files. AI-assisted (Claude Code). |
|
Apple M2 data for these newly merged f16 compare fixtures (macOS 26.4, MoltenVK 1.4.2 direct, subgroup 4..32, llvm-mc 23.1.6, Python 3.13.18, upstream/main f847748): they FAIL here, unlike the NVIDIA and AMD runs on this PR. Full suite: 203 shaders translated/validated; 120/199 passed, 74 skipped, 5 failed. The four relevant failures (all 4096/4096 mismatches) are ps_vcmp_f16, ps_vcmp_f16_e64, ps_vcmpx_f16 and ps_vcmpx_f16_e64, with got/want word lists in the finding at #3381 (comment) and in #166. All four differ only in the second word's low half by 0x0c00 (bits 10-11 of an f16 result). The fixtures include NaN, inf, +-0 and f16 denormal operands; I have not determined whether this is a MoltenVK f16 special-value limitation or a translator expectation issue. No new issue from me; synthetic shaders only, no game files. AI-assisted. |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-GPU-VCMPX-F16, #2516 (comment)
Depends on: #2531 (this branch is stacked on it; the diff against main also shows that PR's commit until it merges).
What and why
#2531 covers
v_cmp_*_f16. The 16v_cmpx_{f,lt,eq,le,gt,lg,ge,o,u,nge,nlg,ngt,nle,neq,nlt,tru}_f16forms had only CPU tests (nlgaside). This adds two pixel tests modelled on #2464 and #2531, with hand-derived words in the headers:ps_vcmpx_f16: e32 form.ps_vcmpx_f16_e64: e64 form (no SDST) with swapped operands.The same seven operand pairs as #2531 (less, greater, +0 vs -0, quiet and signalling NaN, +-inf, f16 denormals, junk high halves). Each compare runs alone: EXEC is copied out and restored after it, so a lane that stayed active shows as 1. Two extra bits per word test the EXEC and VCC effects: VCC set by
v_cmp_tru_f16must survive av_cmpx_f_f16that empties EXEC (bit 29 = 1), and a truev_cmpx_tru_f16after an emptied EXEC must not bring lanes back (bit 28 = 0). Registered incheck.py,run_gpu_tests.py,regen_fixtures.py(fixtures regenerated), plustests/semantic/test_vcmpx_f16.pyand a sentence in the existing design.md row. No translator change.Tested
run_gpu_tests.py --filter ps_vcmpx_f16: 2/2, 4096/4096 pixels exact on NVIDIA GeForce RTX 5080 (driver 616.92) and AMD Radeon RDNA2 iGPU (driver 26.10.1); device line confirmed for both.compare()the v_cmpx branch stored the compare result into%activeinstead ofactive & result; both tests fail on both GPUs (bit 28 set in all four words). Reverted.python -m unittest discover -s tests/semantic(2573 tests),regen_fixtures.py --check,tests/test_shader_checks.py: OK.Checklist
docs/design.md, with how it was confirmed (no new rule; the existing row names the new tests).AI-assisted.