main() caught Unavailable only around the Oracle constructor. A missing AMD clang
(assemble) or a vk_harness exit 77 raised from run() escaped as a traceback with exit 1.
run() now returns 77 with the message on stderr, as the module docstring documents.
Test: Cli.test_unavailable_during_run_is_77 (fails on the old code), plus a ValueError case that still returns 2.
vk_harness takes VKH_COLOR_FORMAT=<VkFormat>:<bytes> for its color target
and writes the target's texels as stored. ps_oracle.py --format picks it
(the driver then picks the export format, as for a game pipeline), with
an integer-output const template for integer targets. docs gets the
export behaviour measured on gfx1036: 32_GR / 32_R take the last enabled
channels, a compr export reaches 16-bit UNORM/SNORM/UINT/SINT targets bit
for bit, FP16 targets get the halves as f16 (a NaN half becomes 0xfe00).
AI-assisted.
RADV returns VK_KHR_pipeline_binary data as one binary per stage
(radv_shader_serialize), not the AMD Windows driver's single PAL ELF, so
ps_oracle exited 77 on every Linux AMD GPU. Find the pixel stage, its
code, sizes, num_vgprs/num_sgprs and rsrc1 by values that must agree
(radv_shader_info's size changes between Mesa versions), replace the
code and raise the VGPR counts. GFX10 only (GFX11+ is refused with
"unsupported architecture"); --set stays PAL-only.
Checked on gfx1036 (RADV RAPHAEL_MENDOCINO, Mesa 26.3.1); an RX 9070 XT
(RADV GFX1201) is refused with exit 77.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hw_oracle launches compute kernels only. vk_harness can now write a
pipeline's VK_KHR_pipeline_binary data and build a pipeline from it
(VKH_BINARY_OUT / VKH_BINARY_IN). ps_oracle.py puts assembled ISA in
place of _amdgpu_ps_main in the driver's PAL ELF, raises the pixel
stage's register counts in the msgpack metadata, optionally changes
other metadata entries, and draws with it, reading every pixel's mrt0
words back.
Checked on gfx1036 (driver 26.10.1): v_interp of a varying and the
parameter words P0 / P10 come back as expected. Tests in
tests/test_ps_oracle.py, docs in docs/shader_validation.md.
AI-assisted.