Commit Graph

2 Commits

Author SHA1 Message Date
719565bbc7 image_fuzz: --oracle hw, the image_load fetches as native kernels with a per-family T#
Runs the same texel fetches as raw compute kernels on the AMD GPU through tools/hw_oracle/: a linear texture the
kernel carries in its own code (256-byte aligned, found with s_getpc_b64), a T# built in s[8:15] for the GPU's family
(hw_oracle/tsharp.py: GFX11 on gfx11xx, GFX10 on gfx103x/gfx10xx), image_load with every dmask for one texel per lane,
all four result registers stored and compared word for word with the CPU model. --oracle translator,hw runs both on
the same textures; --negative-control checks seven wrong models and a wrong T# FORMAT are caught. Exit 77 without the
tools. gfx1150 is RDNA3.5, not RDNA2: the docs say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:16:24 +01:00
ed64990837 salu_diff: optional hardware oracle (--oracle hw), reference s_bfe past bit 31
tools/hw_oracle wraps the generated scalar programs in GFX10/GFX11 kernels,
assembles them with AMD clang and runs them through the HIP runtime of the
AMD Windows driver (hw_oracle.c, loaded with LoadLibrary, no SDK). salu_diff
compares the hardware's three SGPRs + SCC with the reference, alone or
together with the translator. A missing tool prints "unavailable" and exits 77.

First finding: s_bfe_i32 with offset + width > 32 stops the field at bit 31
on gfx1150 (width = min(width, 32 - offset)); the reference followed the
pseudocode literally. The translator already did the hardware thing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:43:11 +01:00