diff options
| author | SuarezPM <SuarezPM@users.noreply.github.com> | 2026-11-22 00:58:07 -0300 |
|---|---|---|
| committer | SuarezPM <SuarezPM@users.noreply.github.com> | 2026-11-22 01:56:25 -0300 |
| commit | e6c767bdd3ff8086282caf8155f6ae9b48dc9ed5 (patch) | |
| tree | b194748d533b7151b9e20426f1e4d7be32c141ea /runtime/src/main.cpp | |
| parent | 067d3e8b97189fcf272dc699fdbb871eae496660 (diff) | |
Tools: image_load differential fuzzer with a GPU harness
AI-assisted. docs/shader_validation.md said "Not covered yet: images", and
FUZZ-1..13 touch VALU, memory, LDS, crosslane and control flow but not a single
image instruction. This is the first slice of that gap:
- runtime/test/vk_image_fuzz.cpp: headless harness that binds one 2D sampled
image from a key=value spec (format, size, texels, T# key) through the
bindless set and the descriptor table, draws a 64x64 full-screen triangle with
a caller-supplied VS/PS, and dumps RGBA32F. It enables the without-format
storage-image reads/writes and fragment atomics the translated image path
declares, and fails on validation errors with LEONIDA_VK_VALIDATION=1.
- tools/image_fuzz.py: assembles a pixel shader that reads one texel with
image_load (dmask 0xf, T# in s[8:15]), translates it with rdna2spirv.py, runs
the harness, and compares every pixel with an independent CPU oracle for the
T# format. A fetch is a memory read, so the oracle is exact.
- tests/test_image_fuzz.py: the oracle, the texel mapping, the T# word and the
generated shader, without a GPU.
Covered: R8G8B8A8_UNORM, R16G16B16A16_SFLOAT, R32G32B32A32_SFLOAT and
R32_SFLOAT, at 8/16/32/64 square sizes that divide the draw; a fifth of the
values are NaN, +-inf, +-0 or denormals.
Not covered yet: dmask variants, UINT/SINT formats (they read through the
storage views), mips, 1D/2D-array/3D/cube, image_sample/gather with filters and
borders, and texel offsets with VK_KHR_maintenance8.
Verified on an NVIDIA RTX 2060 SUPER (Linux, 620.73.04, Vulkan 1.4.357):
40/40 programs match under LEONIDA_VK_VALIDATION=1; ctest 11/11; the GPU suite
is unchanged with a clean build. Synthetic fixtures only, no game data.
Diffstat (limited to 'runtime/src/main.cpp')
0 files changed, 0 insertions, 0 deletions