Commit Graph

5 Commits

Author SHA1 Message Date
fd17f11a5c Translator: typed image_load fetches UINT/SINT formats from the sampled arrays (SHADER-151)
UINT/SINT image_load read the uint/sint storage arrays with OpImageRead, so
every typed load declared StorageImageReadWithoutFormat (missing on Intel
Xe-LP, #619), and read-only integer textures, which the runtime binds only in
the sampled arrays, read the fallback or past the 256-entry storage arrays.
They now fetch through uint/sint aliases of the dimension's sampled array;
a lookup miss takes the float path.

vk_store_test load fills the images before the dispatch, runs without
shaderStorageImageReadWithoutFormat and fails a module that declares it.
vk_image_fuzz no longer requires the without-format features, and binds
its UINT/SINT cases (#1087) as sampled images, as the runtime binds a
read-only texture, instead of storage-only images.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:37:47 +00:00
71eea4a73e GPU tests: vk_bindless_test and vk_image_fuzz skip below 144 push constant bytes (TEST-149)
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>
2026-11-22 01:52:32 -06:00
dd380ef2fb Tests: fuzz integer image loads 2026-11-22 03:46:54 -03:00
dbc428d83c vk_image_fuzz: name the missing device feature, one per line
The skip message said 'lacks ... or the without-format reads/writes', which cost kapitche a vulkaninfo round trip on an Intel UHD 770. It now prints the exact features that are missing, plus the reason when the without-format ones are involved: the translated image_load declares those capabilities for every shader, because its uint/sint path is chosen from the T# FORMAT at run time.
2026-11-22 01:56:25 -03:00
e6c767bdd3 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.
2026-11-22 01:56:25 -03:00