Files
mandy/tools/hw_oracle/__init__.py
AlxcBTW 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

11 lines
723 B
Python

"""Optional hardware oracle: run small hand-written AMD GPU programs natively and read the result back.
asm.py program text -> GFX10/GFX11 kernels, HSA metadata, the SALU opcodes that differ (no hardware needed)
runner.py finds AMD clang, the HIP runtime DLL and a host C compiler, builds hw_oracle.c, runs kernels
tsharp.py image T# words per family (gfx10, gfx11) and the raw kernel that image_loads a texture (tools/image_fuzz.py)
hw_oracle.c the launcher: loads a code object through the driver's HIP runtime and dumps each kernel's output words
Everything here is optional. When a tool is missing, runner.Unavailable is raised and callers exit 77.
See docs/shader_validation.md ("Hardware oracle").
"""