Repository navigation
rdna2spirv: implement v_cmp_class_f64 and v_cmpx_class_f64 - #2535
Conversation
|
Independent GPU verification at For each wave configuration, all 2,048 classification results matched an independent binary64 bit-pattern oracle (512 inputs, each tested unmodified, negated, absolute, and negative absolute). The inputs covered all ten classes, including signaling NaNs and subnormals with payloads solely in the low word. The unmodified comparisons used E32 into VCC with a VGPR mask. The modified E64 comparisons wrote SGPR masks and ignored a set bit above bit 9. A pair of E32/E64 EXEC-only compares also matched all 1,024 output slots per wave configuration. Pre-disabled lanes stayed disabled even with matching input, and a distinct VCC-selected value survived both compares. All six PR CPU tests passed as well. The wave64 evidence here is for the translator's emulation path on NVIDIA. |
|
Independent native RDNA2 hardware verification (AMD Radeon(TM) Graphics \gfx1036, Windows driver \32.0.21042.62, via \ ools/hw_oracle/\ in both wave32 and wave64, both \lush\ \MODE=0x1c0\ and \ieee\ \MODE=0x3c0): All rules implemented here match real \gfx1036\ silicon:
|
|
Tested head 37bdaa8 merged onto AI-assisted (Claude Code); runs on my machine. |
37bdaa8 to
685d16e
Compare
|
Tested 37bdaa8 on an RTX 5090 (driver 616.92), Windows 11, Vulkan SDK 1.4.363. The GPU test programs were built from the same tree:
AI-assisted (Claude Code). |
|
Tested Runtime and test programs built from this head (MSVC 14.51, Ninja, RelWithDebInfo), native Windows
No suite shader uses AI-assisted (Claude Code); I checked the results. |
|
Heads-up from a GPU test run (RTX 4080, Windows 11 Pro 10.0.26200, Python 3.12.10): two of this PR's rejection tests fail on current So AI-assisted (ZCode agent): the verification was executed by a coding agent on this machine. |
Implements
v_cmp_class_f64andv_cmpx_class_f64intools/rdna2spirv.py(claimed in #2300 (comment)). Separate from #2254 (v_cmp_class_f16/v_cmpx_class_f16).What & Why
Gen.cmp_class_f64forv_cmp_class_f64(e32/e64, writing VCC or an SGPR lane mask) andv_cmpx_class_f64(e32/e64, narrowing EXEC).0sNaN,1qNaN,2-inf,3-normal,4-subnormal,5-0,6+0,7+subnormal,8+normal,9+inf) using pure 32-bit%uintbit extraction on(lo, hi)— noFloat64capability required, so it works on devices withoutshaderFloat64and executes directly inspirv_mini_interp.fimm), sign-extended inline integers (-16..64), 32-bit literals in bits[63:32](per RDNA2 ISA), and VOP3abs/negsign-bit modifiers onsrc0(absclears bit 63 first,negflips bit 63 second, without quieting sNaN).0forv_cmp_class_f64and stay inactive forv_cmpx_class_f64; invalid operands/masks/destinations/modifiers raiseUnsupported.Changes
tools/rdna2spirv.py: addedGen.cmp_class_f64and dispatch forv_cmp_class_f64/v_cmpx_class_f64.tests/semantic/test_cmp_class_f64.py: added CPU semantic tests covering all 10 classes (including payloads solely in the low 32 bits), complementary/high-bit masks, SGPR pairs,fimm/inline/literal constants,abs/neg/-|x|,v_cmpx_class_f64EXEC narrowing, inactive lanes, absence ofOpCapability Float64, and rejected forms.docs/design.md: added the translator contract table row (marked Not GPU-verified).Verification
python -I), CPU-only (not GPU-verified), synthetic fixtures only (no game files).python -m compileall -q make_game.py tools tests— passpython -I tests/semantic/test_cmp_class_f64.py -v— 6/6 passpython -I tests/semantic/test_vop3_const_mods.py -v— 10/10 passpython -I tests/test_shader_meta.py— 15/15 passpython -I tests/test_docs_links.py— 5/5 passpython -I tests/test_docs_repo_paths.py— 2/2 passpython -I tests/test_text_write_line_endings.py— 2/2 passpython -I tests/test_isa_coverage.py— 10 pass, 3 skipped (no local ISA XML)AI-assisted (Gemini).