Repository navigation
Conversation
|
Independent Vulkan run at
The wave64 results here cover NVIDIA's emulated path. |
|
Verified on Linux (CachyOS), Python 3.14.10, CPU only. An AMD RX 570 is present but was not used: no Vulkan or hardware-oracle runs were attempted, so the gfx1036 hardware claims (tools/hw_oracle, f32_fuzz with the hw oracle) could not be re-checked here. Head tested: 0599b38 Commands and results:
Negative control (tools/rdna2spirv.py replaced with origin/main 4947579): test_cmp_class_f64.py fails with 49 subtest errors, 48 "rdna2spirv.Unsupported: v_cmp_class_f64" and 1 for v_cmpx_class_f64; test_valu_f32_class_rndne.py fails 9 subtests, e.g. test_snan_source_modifiers_keep_snan (-|v1|) reporting "OpFNegate unexpectedly found". Branch file restored afterwards; worktree clean. GPU-dependent paths (hardware oracle, Vulkan shader checks) were intentionally skipped. |
Addresses the finding reported by @Vonsek in #2300 (#2300 (comment)) and adds hardware-verified
v_cmp_class_f64/v_cmpx_class_f64translation.Claimed in: #2300 (comment)
Summary of changes
v_cmp_class_f32/v_cmpx_class_f32bitwise source modifiers (tools/rdna2spirv.pyGen.cmp_class)Gen.cmp_classloadedS0viasrc_f(), which routed VOP3abs/negthroughOpExtInst FAbs/OpFNegatebefore bitcasting back to%uint. In SPIR-V/Vulkan (and hardware FP units), floatFAbs/OpFNegateare not guaranteed to preserve signalling NaNs or denormals.gfx1036, wave32 & wave64,flush0x1c0&ieee0x3c0viatools/hw_oracle/):-v0,|v0|, and-|v0|onsNaN(0x7f800001/0xff800001) all classify as0x001(sNaN, never quieted toqNaN) and subnormals stay subnormal.Gen.cmp_classnow reads the unmodified uint viasrc_u()and appliesabs(& 0x7FFFFFFF) andneg(^ 0x80000000) bitwise, eliminating the float round-trip while preservingOpFNegate/FAbselsewhere (e.g.tests/test_rcp_iflag_mods.py).v_cmp_class_f64/v_cmpx_class_f64(tools/rdna2spirv.pyGen.cmp_class_f64)(lo, hi)so noOpCapability Float64is required.gfx1036(wave32 & wave64,flush&ieee):S1[9:0]), mask bits[31:10]ignored.abs/negapplied bitwise onhi[31], keeping binary64sNaNsignalling.-16..64sign-extend to 64 bits (1->+denormal,-1->qNaN,0->+0.0).lo = 0, hi = lit), compatible both with current parser output and with PR fix(shader): place f64 literal words in the upper half (SHADER-366) #2057'sf64_literalflag.0.5,-1.0, etc.) expand to exact binary64,nullreads as+0.0, SGPR/VGPR pairs supported.v_cmpx_class_f64narrows%active(EXEC) without touchingVCC, and inactive lanes write0to the destination mask.Tests & documentation
tests/semantic/test_valu_f32_class_rndne.py: addedtest_snan_source_modifiers_keep_snanverifying-v1,|v1|,-|v1|onsNaNinputs forv_cmp_class_f32_e64andv_cmpx_class_f32_e64and asserting noOpFNegate/FAbsis emitted.tests/semantic/test_cmp_class_f64.py: semantic tests covering all 10 binary64 classes (including low-word-only significands), bitwiseneg/absonsNaN/qNaN/zeros/subnormals/infs, inline constants, 32-bit literals, SGPR pairs,null, ignored upper mask bits, wave64,v_cmpx_class_f64EXEC narrowing & VCC preservation, and absence ofOpCapability Float64.docs/design.md: added the hardware-confirmed contract row.Verification
gfx1036), Windows driver32.0.21042.62(native RDNA2 ISA probes viatools/hw_oracle/).python -m unittest discover -s tests/semantic -p test_valu_f32_class_rndne.py -v: 19/19 OKpython -m unittest discover -s tests/semantic -p test_cmp_class_f64.py -v: 5/5 OKpython -m unittest discover -s tests/semantic -p test_vop3_const_mods.py -v: 10/10 OKpython -m unittest discover -s tests/semantic -p test_value*.py -v: 31/31 OKpython -I tests/test_rcp_iflag_mods.py -v: 5/5 OKpython -I tests/test_f32_fuzz.py -v(with livegfx1036hardware test): 25/25 OKpython -I tools/f32_fuzz.py --oracle translator,hw --ops v_cmp_class_f32 --programs 200 --seed 1: 200/200 translator match (0 mismatch), 212/212gfx1036hardware match (0 mismatch, 12 denorm skipped by model)python -m compileall -q make_game.py tools tests+tests/semantic/regen_fixtures.py --check+test_docs_links.py,test_docs_list_items.py,test_docs_repo_paths.py,test_tool_startup.py,test_tool_stdout_encoding.py,test_text_write_line_endings.py,test_shader_checks.py(60/60): all OK