Repository navigation
fmisc_diff: --oracle hw,vk runs the translated programs on a Vulkan GPU, wave32 or wave64 - #5931
evilclanker9000 wants to merge 2 commits into
Conversation
…PU, wave32 or wave64 fmisc_diff judged the translator in spirv_mini_interp only. --oracle hw,vk also runs each program through llvm-mc, rdna2spirv.py and vk_compute_test as one wave of 32 or 64 identical lanes (tools/vk_fuzz_run.py, shared with other fuzzers) and judges lane 0's four words against the hardware's. The seeds are computed from the buffer fill at run time: the AMD Windows driver folds an ordered compare of a literal NaN to true in a wave32 pipeline. Seeds 11 to 13 (600 programs each): Radeon wave32 and wave64 and RTX 5080 wave32 show only the denormal gap and omod turning -0 into +0 (ItsNotRexed#1281), no mismatch. AI-assisted.
|
An RDNA4 data point for the constant-folding note, on the same driver version. AMD Radeon RX 9070 XT (gfx1201), AMD 26.10.1, Windows 11. The fold. A standalone probe: 16 Run-time seeds are still the safe default. The note could say the fold was seen on gfx1036, rather than on the AMD Windows driver in general. There's no positive control here, since this card shows no fold, and RDNA3 is not tested. spirv-val isn't installed here, so the modules were assembled with the repo's The new mode on RDNA4.
The other tools that can't run their hardware oracle on GFX12 print "hardware oracle unavailable" and exit 77 ( Synthetic programs only. AI-assisted (Claude Code). No game files. |
|
Tested
Unlike Synthetic fuzzer programs only; no game files. |
|
Partial check of ca802e8 on AMD Radeon Graphics iGPU (gfx1036, RDNA2, Ryzen 9 9950X3D), Windows AMD driver 32.0.21042.62, Windows 11, MSVC RelWithDebInfo, |
|
Checked One scope note for the maintainers, verified on this machine: the AI-assisted (OpenCode / DeepSeek V4.1 Flash + GLM-5.3): the agent ran the suite sandboxed on the toolchain above. |
Conflicts: docs/shader_validation.md, tools/fmisc_diff.py, tools/vk_fuzz_run.py Main now carries the same change (vk_fuzz_run.all_skipped, per_lane runs), so the merge result equals main. AI-assisted.
|
Tested d6ddfb9 on RX 5700 XT (RDNA1, gfx1010, RADV NAVI10), Mesa 26.3.1, Linux 6.18: pass
LLVM AI-assisted (Claude Code). |
Requested by Lucas · project thread
Claimed in the coordination issue as: EGEN-FMISC-VK, #5032 (comment)
What and why
fmisc_diff(f32 conversions, frexp/ldexp, fract, the 16 float compares, class) judges the translator only inspirv_mini_interp, which cannot see a driver's denormal, NaN and rounding rules. The same kind of check inf32_fuzz --oracle hw,vk(#5351) found real bugs the interpreter fuzzers missed (#5399, #5589), so this brings it tofmisc_diff.--oracle hw,vkruns each program as one wave of 32 or, with--wave 64, 64 identical lanes through llvm-mc (gfx1013),rdna2spirv.pyandvk_compute_teston the deviceLEONIDA_VK_DEVICEpicks, and judges lane 0's four words against the hardware's (hardware kernels run in the same wave size; lane masks become 64-bit pairs). Newtools/vk_fuzz_run.pyholds that runner so other fuzzers can use it (pk16/vint/wint/sdwa would be next). Differences are classeddenormal(the reference declines the program for a denormal),omod_neg_zero(an output modifier made the hardware's -0 a +0, the translated -0 stayed: #1281 is the open fix) andmismatch, which fails the run.The seeds are computed from the buffer fill at run time (
--vk-constantskeeps literals). Reason: on the AMD Windows driver (26.10.1) a wave32 pipeline folds an ordered compare of two literal operands with a NaN to true (v_cmp_lt_f32 vcc_lo, -10.0, qNaNgives 1; wave64 and the RTX 5080 give 0; with run-time operands all three are right: 44 of 120 compare/NaN combinations wrong in wave32). That is the driver's constant folding of a NaN literal, not something the translator can do anything about, and it would bury the runs in false mismatches.Tested
mismatch: no new translator bug in this family.v_fract_f32sabotaged toFloorin the translator makes 56 of 80 programs mismatch on the Radeon.tests/test_fmisc_diff.pygainsVulkanOracle(program text, wave64 spelling, wave64 kernel, verdict classes, the--oracle vkguard); 25 tests OK.test_docs_*OK,compileallOK.docs/shader_validation.mddocuments the mode and the numbers.AI-assisted: yes.
Checklist
docs/design.mdrow.