Skip to content

Tests: fuzz UINT/SINT image loads - #1087

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
caua-an:feat/image-load-integer
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
caua-an:feat/image-load-integer

Conversation

@caua-an

@caua-an caua-an commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extend the synthetic image_load fuzzer to cover R8G8B8A8_UINT and R8G8B8A8_SINT through the corresponding storage-image views.
  • Convert the loaded integers to exactly representable floats before readback, preserving exact values for these 8-bit formats (wider integer formats remain outside this coverage).
  • Exercise every nonzero dmask for each format, and add CPU oracle, conversion, and negative-control tests.

Claim: coordination comment. The tracker currently lists the same claim twice as FUZZ-18 and FUZZ-19.

Testing

Linux (Zorin OS 18.1), RX 7600, RADV Mesa 26.2.4, LLVM 21.1.8:

  • python3 -m pytest -q tests/test_image_fuzz.py: 37 passed.
  • LLVM_MC=/usr/bin/llvm-mc-21 LEONIDA_VK_VALIDATION=1 VK_LOADER_LAYERS_DISABLE="~implicit~" python3 -I tools/image_fuzz.py --programs 90 --seed 11: 90/90 matched, no skips.
  • Same command with --seed 7600: 90/90 matched, no skips.
  • Negative control: modifying an expected SINT texel was detected against GPU readback.

Synthetic inputs only; no game files. AI-assisted (OpenCode).

@kapitche

Copy link
Copy Markdown
Contributor

Tested dd380ef on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51, llvm-mc 23.1.6):

RTX 4080 SUPER (32.0.16.1714) Intel UHD 770 (32.0.101.6129)
image_fuzz.py --self-test ok (6 formats) ok
--programs 90 --seed 11 90/90 match 0 ran, 90 skipped
--programs 90 --seed 7600 90/90 match 0 ran, 90 skipped
ctest 50/50 —

On Intel every program skips with the device does not support the set, including the existing R32_SFLOAT ones. This driver has no shaderStorageImageReadWithoutFormat, so it isn't a regression from this PR, just no new coverage on this GPU.

One idea, outside this PR: these integer formats are only read through typed R8G8B8A8_UINT/_SINT views. If the fuzz shader's OpTypeImage declared Rgba8ui/Rgba8i instead of Unknown, the new formats would run on devices like this one too.

@undeadhuman37

Copy link
Copy Markdown
Contributor

Tested dd380ef on NVIDIA GeForce RTX 4070 SUPER, driver 621.01, Windows 11 Home 25H2 (26200.9974), VS 2022 Build Tools, Vulkan SDK 1.4.363.1, llvm-mc 21.1.8: pass

  • Build: 0 warnings. ctest: 51/51 passed.
  • image_fuzz.py --self-test: ok (6 formats).
  • image_fuzz.py --programs 90 --seed 1: 90/90 match (all 15 masks for all 6 formats).
  • image_fuzz.py --programs 30 --seed 2 --formats R8G8B8A8_UINT,R8G8B8A8_SINT: 30/30 match.
  • Not run: tests/test_image_fuzz.py (no pytest here).

AI-assisted. No game files.

@quackottu quackottu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested dd380ef on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • Build ok. ctest: 100% tests passed, 0 tests failed out of 50 (gameinput disabled, no SDL3).
  • tests/test_image_fuzz.py: 37 passed (llvm-mc 21.1.8). I didn't run a vk_image_fuzz seed sweep beyond what the test runs.
  • 44 test programs exit 0 with 0 validation messages.
  • Same on main, not from this PR: d3d12_clear_test (NVIDIA 0.5 tie rounding, #521), vk_binary_occlusion_test (needs an input file), and the 3 VUID-vkCreateDevice-ppEnabledExtensionNames-01387 in d3d12_fence_timing_test/d3d12_vulkan_device_test (#1027).

@ItsNotRexed
ItsNotRexed merged commit c22afe3 into ItsNotRexed:main Nov 22, 2026
10 of 11 checks passed
ICUMADETHIS added a commit to ICUMADETHIS/Leonida that referenced this pull request Nov 22, 2026
…ed 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, ItsNotRexed#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 (ItsNotRexed#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>
ICUMADETHIS added a commit to ICUMADETHIS/Leonida that referenced this pull request Nov 22, 2026
…ed 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, ItsNotRexed#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 (ItsNotRexed#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants