Repository navigation
Tools: hardware oracle for f32_fuzz — 46,967 f32 VALU programs on real AMD hardware, 0 model mismatches; omod turns -0 into +0 - #1248
Conversation
Kernel(mode=...) writes the .amdhsa_ieee_mode / dx10_clamp / float_denorm_mode / float_round_mode directives; valu_skip_reason lists the f32 opcodes GFX11 and gfx1030 do not have. 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g, 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>
|
I confirmed the signed-zero finding for RDNA2 gfx1036 on For
The independent ±1 controls scaled by the specified factors in the first two modes and stayed ±1 in the other two. Placement matters: with v4= I also drew a source-built translated pixel shader that exports the unmodified/mul:2/mul:4/div:2 results in RGBA, with quadrants containing +0, −0, +1 and −1. Against the measured 0x1c0 expectation, on RTX 5080 and on this Radeon the unmodified channel matched all 4,096 pixels, while each modified channel retained −0 in precisely the 1,024 negative-zero pixels. All other words matched. This covers |
|
Tested ee84578 on CPU only (Windows 11; no AMD GPU, no AMD clang or HIP runtime here): pass as a code read, and the two PRs in
Code read: Not verified here: every hardware number in the description — the 46,967 programs, the 57 omod signed-zero programs and the |
This continues the hardware oracle from #1160 (
salu_diff) and #1202 (crosslane_fuzz), both merged. The finding it produced is here in #1006.What and why
tools/f32_fuzz.py(FUZZ-3) gains--oracle hwand--oracle translator,hw. The same seeded VOP1/VOP2/VOP3 f32 programs (neg/abs, clamp, omod) run natively in wave32 on an AMD GPU. The results are compared bit-exactly againstF32Model, the model written from the RDNA2 ISA guide, which no one had checked against hardware.0x1c0, which is IEEE off, f32 denormals flushed and DX10_CLAMP on. This is the state the corpus implies for the game's shaders (docs/design.md, the omod row). Each mode's MODE word is read back on the hardware (s_getreg), so a float-mode directive that didn't take fails loudly.tools/hw_oracle/asm.pygets per-kernel float MODE for this.v_mad_f32,v_mac_f32,v_madak_f32,v_madmk_f32andv_mad_legacy_f32exist only on GFX10.1 (gfx1010/1011/1013, the console's family). llvm-mc and AMD clang reject them for gfx1030 and GFX11, and the fused replacements round once, so they would be different instructions. The oracle skips them with a reason and never substitutes. Their unfused semantics cannot be measured on any RDNA2 desktop card either.--negative-controland--perturb NAMEre-judge the same hardware words against six deliberately wrong models, for example an unfused FMA or the DX90·xrule removed.cancelandzero_infprobes make sure even the weak ones are caught at small sample sizes.Results: Radeon 880M (gfx1150, RDNA3.5), driver 26.11.2
46,967 programs (seeds 1–6): 0 mismatches where the model has an answer.
"match" accepts any NaN for any NaN. Payload, sign and quiet bit are in the informational tables. The model includes the RDNA2 min/max/med3 NaN rules measured in #634, and they hold on gfx1150.
Finding: VOP3 omod and signed zero.
mul:2,mul:4anddiv:2turn a −0 result into +0 on gfx1150, while the model and the translator keep −0. Intranslator,hw, 6 of 6 such programs follow the model. LLVM notes that omod mishandles signed zeros (SIFoldOperands.cpp), and D30209 describes −0 being forced to +0 before the modifier. RDNA2 is not measured, so this is likely a translator difference but not confirmed. It is not fixed in this PR.Informational (gfx1150 only; RDNA2 is not measured):
SIFoldOperands.cppsays the same about both cases.v_rcp/rsq/sqrt/exp/log_f32flush in both modes, as Coordinating who works on what (3) (moved to #1006) #634 measured on RDNA2.v_cmp_class_f32classifies a denormal as a denormal in both modes.0xffc00000.Tested
py -I tests/test_f32_fuzz.py(25 tests),tests/test_hw_oracle.pyandf32_fuzz --self-test: green. Without hardware the hardware tests are skipped and the tool exits 77.ee84578a).--oracle hw --programs 400 --seed 31 --probes 12 --negative-controlgave 0 mismatches, 1 known deviation and 0 assembler rejections, and caught all six perturbed models.--oracle translator,hw(1,500 programs, seed 3): 0 mismatches.An independent review checked several things:
Its findings are fixed:
v_min_legacy_f32claim;AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (There is no translator change. The new row records the measurement.)🤖 Generated with Claude Code