A crash in the harness (the ANV SIGSEGV in vkCreateGraphicsPipelines of #1429)
printed only "FAIL (harness error)". The failure line now says how the harness
ended (exit N, killed by SIGSEGV, or a Windows NTSTATUS such as 0xc0000005
access violation) and its last stderr line, followed by the last 20 lines of
stderr (stdout when stderr is empty).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default was runtime/build/linux, which only a Linux build that follows docs/testing.md has. Following
docs/shader_validation.md (cmake --build runtime/build --target vk_image_fuzz, then run with no --build), every
run stopped with "vk_image_fuzz not found". Default to runtime/build like lds_fuzz and valu_fuzz, and look in its
RelWithDebInfo/Release subfolder with compute_fixture.find_test_program as lds_fuzz does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both harnesses create a pipeline layout with the 144-byte translated
user-data block and never checked maxPushConstantsSize, so on a
128-byte device (Intel Arc, some AMD drivers) they failed validation
instead of skipping, although every pixel was exact. Each now prints
"unsupported: need 144 push constant bytes, device has N" and exits
77 before creating anything, as vk_texture_test does since 0c84bff;
the range uses the same constant.
run_gpu_tests.py already reported ps_tex's 77 as SKIP; image_fuzz.py
skipped it with a fixed message and now quotes the harness's
unsupported line. CPU tests cover both runners' 77 path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vonsek reproduced a blind spot: +0.0 == -0.0 in Python, so a wrong binding that returns +0 where the texture holds -0 passed silently (4096/4096 raw words differ, compare() reported none; 192/4096 on a generated float case).
same_component() now compares the packed f32 words and keeps the any-NaN policy (payloads are not modelled). Two CPU regressions: one flips a single output channel from -0 to +0 and expects exactly that pixel; the other feeds a different NaN payload and expects no mismatch. 40/40 programs still match on the RTX 2060 SUPER with validation, so the GPU preserves signed zeros for these formats.
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.