The translator turns a -0 v_mul_legacy_f32 result into +0 under an output
modifier (the measured IEEE-off rule, docs/design.md), but the translator side
of check() still expected the ISA-text model's -0, so
f32_fuzz --programs 1500 --seed 53 reported a false mismatch (program 246).
The hardware side is unchanged: it already files this as dev_omod_neg_zero.
AI-assisted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both tools set sys.dont_write_bytecode and imported rdna2spirv at the
top, so on a checkout without __pycache__ every start compiled the
translator before parsing the arguments: about 20 s to print a usage
line, which made test_no_arguments_prints_usage time out (5 s) in
tests/test_f32_fuzz.py and tests/test_cf_diff.py. They now import it in
the functions that use it.
Also removes the second, identical CliTests class in
tests/test_f32_fuzz.py, which replaced the first one at import.
Supersedes #5056, which conflicts with main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/f32_fuzz.py --oracle hw, seeds 1 to 6, on an RX 6700 XT (gfx1031,
AMD Windows driver 26.11.2): 39,101 programs, 0 mismatch, 66 omod -0 -> +0
deviations. mul:2/mul:4/div:2 behave as measured on gfx1150: applied with
IEEE off and f32 denormals flushed (a -0 result becomes +0), ignored by the
ALU ops with denormals kept (the transcendental and cube ops still apply
them), ignored with MODE.IEEE = 1.
- docs/design.md: merge the two duplicated "Output modifiers on hardware"
rows (one said RDNA2 was unmeasured, the other cited gfx1036) and add the
gfx1031 numbers.
- docs/shader_validation.md: the gfx1031 run and its omod table.
- tools/f32_fuzz.py: omod_label no longer counts a -0 result that the omod
cannot change as "applied" (65 such programs showed up as "applied" in
the ieee column); widen the table's label column; drop "RDNA2 unmeasured".
- tests/test_f32_fuzz.py: the omod_label labels, the -0 case included.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- own 'asm rej' column; any rejection outside the GFX11 table exits 2
- known deviation omod_neg_zero only where the omod was active
- omod wording/citations (SIFoldOperands.cpp, D30209), v_min_legacy_f32 is in no GFX10/11 part
- zero_inf probes so the DX9-multiply negative control is caught at small sizes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runs the FUZZ-3 programs natively wave32 and judges the hardware against F32Model, with MODE
probes, known deviations, denormal/NaN/clamp/omod tables, probes and a negative control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/f32_fuzz.py runs seeded VOP1/VOP2/VOP3 float programs (neg/abs, clamp,
omod) through an exact-arithmetic RDNA2 model and through the translated
SPIR-V in tests/semantic's interpreter, and compares them bit-exact.
Denormals, and inputs the emitted SPIR-V leaves undefined, are counted
separately instead of being compared.
Translator fixes it found:
- v_mac_f32 is the VOP2 form of v_mad_f32 (product rounded before the add),
not of v_fma_f32 (LLVM getNewFMAInst: V_MAC_F32 -> V_MAD_F32_e64). It
emitted Fma.
- VOP3 clamp and mul:2/mul:4/div:2 were dropped on v_cvt_f32_i32/u32,
v_cvt_f32_ubyte0..3, v_cvt_f32_f16 and v_rcp_iflag_f32 (LLVM
VOPProfileI2F: $src0, $clamp, $omod).
Interpreter: RoundEven keeps the sign of a zero result; Fma rounds once
(it double-rounded through a double); adds OpFDiv, OpIsNan, OpIsInf,
Floor/Ceil/Trunc/Exp2/Log2/Sqrt/InverseSqrt, raising where SPIR-V or
GLSL.std.450 leave the result undefined.
Pinned by runtime/test/shaders/ps_f32_mods.asm (check.py, run_gpu_tests.py,
tests/semantic/test_f32_valu.py) and tests/test_f32_fuzz.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>