Skip to content

Tests: verify high sampled-image slot reuse and its live neighbour - #1221

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:codex/bindless-high-slot-reuse
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
evilclanker9000:codex/bindless-high-slot-reuse

Conversation

@evilclanker9000

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #1006 (comment)

What and why

The high-index draw added in #1199 checks an initial binding. Extend that test to keep two high-index sampled views live, free the gradient slot, sample its zero fallback, reuse it for a one-texel blue view, then sample the orange neighbour. Count readbacks as they happen because the capacity check can skip these draws.

Tested

  • Windows, MSVC 19.44, validation enabled. RTX 5080 (32.0.16.1692) and Radeon Graphics (32.0.21045.16010) both returned 24 draws, 0 bad pixels and largest absolute channel error 0. Each draw reads 4096 RGBA32F pixels using the translated, source-built ps_tex fixture. Both configurations used image index 9098 and sampler index 2102.
  • For the negative control, temporarily suppressing only the fallback image write on removal at indices >=5000 left the old gradient in the freed slot on RTX 5080. Across the two configurations exactly 8192 pixels differed, with maximum absolute channel error 1. Restoring the write returned to zero errors.
  • CTest bindless_sizing passed. The GPU suite invocation with --filter ps_tex.asm passed (1 translated and 1 validated). No translator change.
  • AI-assisted.

Checklist

  • No game data, keys or decryption, including in logs or reports quoted here.
  • New translator rule in the contract table (not applicable).

A far-slot read alone cannot detect a stale descriptor after removal or a rewrite of the adjacent live view. Read the fallback, the replacement and its neighbour through the translated texture shader.
@LocranKing

Copy link
Copy Markdown
Contributor

Tested 4c80129 on NVIDIA GeForce RTX 3060 Ti (driver 621.01, Vulkan 1.4.357), Windows 11 Home Build 26200 x64, MSVC 14.44.35207, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and VK_LOADER_LAYERS_DISABLE=~implicit~: pass.

  • scripts\build_runtime.ps1 (Ninja RelWithDebInfo): clean build, 0 warnings/errors (built gta6rt.exe).
  • python -I scripts/run_gpu_tests.py --filter ps_tex: 10 translated, 10 pass spirv-val; 9/9 GPU tests passed (including ps_tex).
  • Direct vk_bindless_test.exe <vs_tri.spv> <ps_tex.spv> (validation on): both descriptor-set modes (update after bind, partially bound and no flags) reached high-slot index 9098 of 65536 2D images and 2102 of 3936 samplers and ran all high-slot reuse/live-neighbour readbacks (bindless: 24 draws read back, 0 bad pixels, largest error 0, exit 0).

AI-assisted. No game files.

@kapitche

Copy link
Copy Markdown
Contributor

Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. ctest: 57/57. run_gpu_tests.py --filter ps_tex (vk_bindless_test):

  • RTX 4080 SUPER: ps_tex 24 draws, 0 bad pixels.
  • Intel UHD 770: ps_tex 8 draws, 0 bad pixels.

The other ps_tex* cases match main. Intel skips the same 3 for maintenance8 and shaderResourceMinLod.

@dcastell1

Copy link
Copy Markdown
Contributor

Tested 4c80129 on an RTX 5090 (Blackwell), Windows 11 Pro 10.0.26300.9974, NVIDIA 621.24, official Vulkan SDK 1.4.363.1:

  • d3d12_descriptor_test: exit 0 with LEONIDA_VK_VALIDATION=1, 0 VUID-/validation errors.
  • The high sampled-image slot reuse and its live neighbour resolve correctly; the other descriptor, bindless, MSAA, B4G4R4A4/B5G5R5A1 and copy checks pass unchanged.

No game files were used.

@Dom-in

Dom-in commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 4c80129 on AMD Radeon RX 9070 (RDNA4), AMD 26.11.2 (LLPC), Windows 11 Pro 26300, MSVC 14.44, with the sizes from #1199 on this card (65536 2D images, 4096 samplers): pass.

  • run_gpu_tests.py --filter ps_tex: ps_tex bindless: 24 draws read back, 0 bad pixels, largest error 0; the other 8 texture tests pass too.
  • Negative control, the same one you used: in remove_image, skip the fallback write_image for indices >= 5000. Then FAIL ps_tex 10 freed high slot pixel (5, 0): got 0 0 0.501961 1, want 0 0 0 0, so the new draw catches a freed slot that still shows the old gradient on RDNA4 as well. With the write restored it passes again.

AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit 7a1e1cd into ItsNotRexed:main Nov 22, 2026
11 checks passed
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.

6 participants