mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 12:58:38 +00:00
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>
11 lines
723 B
Python
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").
|
|
"""
|