Commit Graph

20 Commits

Author SHA1 Message Date
93d0c205ba f32_fuzz: judge v_mul_legacy_f32 omod -0 against the +0 the translator models
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>
2026-11-26 16:58:15 +01:00
6cdb668e8a f32_fuzz, cf_diff: import the translator where it is used (EGEN-FUZZ-LAZY-IMPORT)
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>
2026-11-24 00:04:40 +02:00
830cd6c71a Merge pull request #3978 from tedin7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:10:07 -05:00
440f89ad38 Merge pull request #3629 from Kam471
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:08:02 -05:00
fef61b247c tools: the RDNA2/3 hardware fuzzers and tests skip on gfx1170+ instead of failing (TEST-873) 2026-11-22 23:45:21 +01:00
9c4f333b74 cf_diff/f32_fuzz: print usage and exit 2 with no arguments 2026-11-22 22:07:32 +00:00
c420ad28d6 Merge pull request #3629 from Kam471 2026-11-22 17:03:05 -05:00
e3eba20b85 Merge pull request #3110 from eyyun 2026-11-22 17:00:38 -05:00
e37e6e136f cf_diff/f32_fuzz: print usage and exit 2 with no arguments 2026-11-22 21:06:33 +00:00
9550413bfd f32_fuzz: mark v_madmk_f32 GFX10.1-only in hw_oracle VALU_REMOVED 2026-11-22 23:36:54 +03:00
c57b33656b Merge pull request #3110 from eyyun 2026-11-22 15:14:52 -05:00
0fc50c5970 Merge pull request #2917 from Vonsek 2026-11-22 15:13:10 -05:00
06b52cf707 tools: add v_fmamk_f32 and v_madmk_f32 to f32_fuzz 2026-11-22 22:25:34 +03:00
07117ce0b1 fix(tests): compare packed u8 hardware results byte for byte
A packed integer result can share a bit pattern with a float NaN. Applying the float payload equivalence to this result hides corrupt output bytes.
2026-11-22 19:41:19 +01:00
a0f2f53a93 Merge pull request #2466 from Tim Elery 2026-11-22 13:15:30 -05:00
49b8901e34 rdna2spirv: return +0.0 from v_cubema_f32 when major axis is -0.0 2026-11-22 09:07:49 -08:00
09c3394b0c docs: measure VOP3 output modifiers on RDNA2 (gfx1031) (SHADER-353)
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>
2026-11-22 16:48:49 +01:00
ee84578afe f32_fuzz hw: assembler rejections fail the run, hedge the omod finding, zero_inf probes
- 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>
2026-11-22 10:00:49 +01:00
e6eaf06f7d f32_fuzz: optional hardware oracle (--oracle hw, translator,hw)
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>
2026-11-22 09:55:00 +01:00
ed6da6b699 FUZZ-3: float VALU differential fuzzer; v_mac_f32 unfused, conversion output modifiers
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>
2026-11-22 00:26:30 +01:00