Commit Graph

11 Commits

Author SHA1 Message Date
ac58ddc504 fmisc_diff: do not judge the class bits of a NaN whose quiet bit is unmodelled
A fuzzed sNaN through v_fmamk_f32 into v_cmp_class_f32 flipped a result
bit on both Vulkan GPUs against the reference model. The model returns a
canonical quiet NaN for v_fmamk_f32, but on gfx1036 under the game's MODE
the hardware mostly returns the NaN source's word and only sometimes
quiets a signalling one (f32_hw_s5.log), so whether the result tests as
signalling or quiet is not something the model can know. Track registers
holding such a computed NaN (st["nanf"], set by v_fmamk_f32 with a
signalling or already-fuzzy NaN operand and propagated through the
pass-through ops and register moves) and raise Uncertain when
v_cmp_class_f32 reads one, instead of reporting a mismatch that is a
model gap, not a translator bug.

Co-Authored-By: Devin <noreply@cognition.ai>
2026-11-30 22:31:48 +00:00
6dece92317 Merge TreXito's unmerged PRs: translator fixes, fuzzers, CPU emulation, xapu/chad shims
Merged from the TreXito/mangrove copy of the original repository, which carried
contributor pull requests that were never merged here.

Kept: rdna2spirv fixes (ds_append/ds_consume, v_ldexp_f16 under MODE.FP_ROUND,
thread-group SGPR, fma exact), the differential fuzzers (dot, vint, wint, vrel, cvt,
f16misc, salu, mode) with their tests, the exe/import fail-fast and int3 cause tools,
Zen 2 instruction emulation (cpu_emulation.h) and the xapu.dll/chad.dll shims.

Not taken, because they conflict with different implementations already on main:
the D3D12 Xbox-ABI layer, xmem, acphal, loader TLS, f64_diff, DirectStorage (needs the
typed-error zlib inflate), and the copy's own MANGROVE.md and README changes.
2026-11-23 19:42:33 -05:00
87ce00625c Merge #5561 (fix/fmisc-omod-snan) 2026-11-23 21:45:35 +00:00
d2901fa549 fmisc_diff: validate the hardware rows before the Vulkan comparison
With --oracle hw,vk, run_suite called vk_verdict on each hardware row
before check() validated it, so a None row raised a TypeError and a
short or empty row an IndexError, both uncaught by main() (traceback,
exit 1). A None batch also reached len(hw). check_hw_rows() now refuses
a None batch, a wrong result count, and a None or sub-4-word row right
after oracle.run(), before either comparison path; str rows (skip
reasons) pass as before. main-level hw,vk regressions cover None, []
and a 2-word row, as the review asked.

AI-assisted (Claude Code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 23:40:19 +02:00
5c6d6cc1f8 fmisc_diff: reject truncated, short, or None hardware oracle results 2026-11-23 23:18:53 +02:00
a284bad1e9 pk16_diff, vint_diff, sdwa_diff, wint_diff: --oracle hw,vk runs the translated programs on a Vulkan GPU (#6306)
Squash-merged after diff review of PR #6306 - pk16_diff, vint_diff, sdwa_diff, wint_diff: --oracle hw,vk runs the translated programs on a Vulkan GPU
2026-11-23 08:25:41 -06:00
bf891c2705 fmisc_diff: do not judge an output modifier on a signalling-NaN result
The reference kept a signalling NaN through mul:2 / mul:4 / div:2, while the
translator's OpFMul quiets it, so a later v_cmp_class_f32 differed (seed 202,
program 53: v_ldexp_f32 v5, -|v18|, v1 mul:2 with v18 = 0x7f800001, then a
class test on bit 0). What the hardware does is not measured, so the program
is now skipped as "output modifier on a signalling NaN", like the clamp of a
NaN. Quiet NaNs and sNaNs without an omod are judged as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 11:22:48 +00:00
70b1f7ccbe Merge pull request #4629 from TreXito
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:16:37 -05:00
ead3511834 fmisc_diff: v_fract_f32 passes a NaN through, +-inf gives 0xffc00000 (gfx1036)
The reference returned 0x7fc00000 for any NaN or infinity. docs/design.md ("Float min/max/med3 with NaN, v_fract")
records the gfx1036 measurement: a NaN operand comes back unchanged, a signalling one too, and +-inf gives exactly
0xffc00000. The translator follows that, so a v_cmp_class_f32 of a fract'd signalling NaN reported a false
mismatch: fmisc_diff --programs 8000 --seed 775101, program 177 (v_fract_f32 of 0x7f800001, then a class mask with
bit 0 and not bit 1: reference 0, translated 1.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 03:11:24 +00:00
da96d1fac9 test: a run where every program was skipped is not a success (cf_diff, mem_diff, shader_diff, fmisc_diff) 2026-11-23 02:27:39 +01:00
94955e12c3 tools: fmisc_diff.py, a differential fuzzer for f32 misc ops and float compares
A separate exact-rational ISA model for v_fract_f32, v_frexp_mant/exp_f32, v_ldexp_f32, v_cvt_u32/i32_f32, v_cvt_off_f32_i4, v_fmamk_f32, the 16 v_cmp_*_f32 conditions and v_cmp_class_f32, with neg/abs, omod and clamp and every source kind within the constant-bus rules, compared one lane at a time with rdna2spirv run in tests/semantic/spirv_mini_interp.py, optionally with the hardware through tools/hw_oracle (run under IEEE off, f32 denormals flushed). Denormals, NaN payloads read as integers, clamp of a NaN and omod giving a zero are counted skips. v_cmp_class_f32 with neg/abs on a signalling NaN only with --known.

AI-assisted.
2026-11-22 18:19:02 +01:00