Skip to content

tests: GPU fixture cs_imgload_tfe for the tfe status VGPR on image_load (SHADER-1266) - #8968

Draft
Aefekaa wants to merge 1 commit into
ItsNotRexed:mainfrom
Aefekaa:test/cs-imgload-tfe
Draft

Aefekaa wants to merge 1 commit into
ItsNotRexed:mainfrom
Aefekaa:test/cs-imgload-tfe

Conversation

@Aefekaa

@Aefekaa Aefekaa commented Nov 23, 2026

Copy link
Copy Markdown

Claim: #8868 (comment)

Problem. No GPU fixture in runtime/test/shaders sets tfe or lwe. So a run_gpu_tests.py run on a SHADER-1266 fix (#8471, and before it #8534 and #8771) shows only that nothing regressed: every module it builds is byte-identical with and without the fix, and the status write isn't run on a GPU.

Change.

  • New runtime/test/shaders/cs_imgload_tfe.asm: cs_imgload with tfe on both image_loads (v[7:8], v[11:12]). Each status VGPR is seeded with 1000 before its load, and both are added into the stored sum. Every texel is resident, so the status is 0 and the result is the same as cs_imgload's: vk_store_test ... load checks sint = 100 - (8y + x). A stale status moves every texel by 2000.
  • Registered next to cs_imgload in runtime/test/shaders/check.py and scripts/run_gpu_tests.py, and added to the two unit tests that list the vk_store_test fixtures (tests/test_run_gpu_tests.py, tests/test_shader_checks.py).
  • Only tfe: llvm-mc (23.1.6, gfx1013) rejects a two-VGPR vdata for lwe alone (see davyvs' note on rdna2spirv: write tfe/lwe status VGPR for image_sample* (SHADER-1266) #8471), so the lwe-only case stays open.

Red on main until a SHADER-1266 fix lands. There is no expected-failure mechanism, so this PR could wait as a draft, or land with the fix. Tell me which you prefer.

Tests (NVIDIA GeForce RTX 4060, NVIDIA 617.42, Vulkan 1.4.351, Windows 11 Pro 10.0.26200; main 867d922; llvm-mc 23.1.6, llvm-mingw 20261117, Vulkan-Headers 1.4.369):

translator cs_imgload_tfe texel (5,3)
main 867d922 FAIL, 64/64 sint texels bad 2071 (= 71 + 2 × 1000)
main + #8471's diff (d700498) FAIL, 64/64 bad 2071
main + #8771's diff (ac83842) PASS, 0 bad 71

This matches Technyze's ad-hoc run on an RTX 5080 in #8471. cs_imgload and cs_imgload_d16 pass in all three. Both modules pass spirv-val.

  • python -I scripts/run_gpu_tests.py --filter cs_imgload: 2/3 on main (cs_imgload_tfe FAIL), 3/3 with rdna2spirv: write the tfe/lwe status VGPR after every image read (SHADER-1266) #8771's change.
  • python -I tests/test_run_gpu_tests.py: 62 OK.
  • python -I tests/test_shader_checks.py: 84 tests, 15 errors. The same 15 errors occur on clean main (harness() got an unexpected keyword argument 'cwd' in Wave64Checks), so they're unrelated to this change.
  • compileall and git diff --check clean.

No game files. AI-assisted (Claude).

🤖 Generated with Claude Code

…ad (SHADER-1266)

No GPU fixture set tfe or lwe, so run_gpu_tests.py never reached the
status write a SHADER-1266 fix adds. cs_imgload_tfe is cs_imgload with
tfe on both image_loads: each status VGPR is seeded with 1000 and added
into the stored sum, so a stale status moves every texel by 2000 while a
correct one (0, every texel resident) gives cs_imgload's result, checked
by vk_store_test's unchanged load mode.

Registered next to cs_imgload in check.py and run_gpu_tests.py, and in
the two unit tests that list the vk_store_test fixtures. Red on main
until a SHADER-1266 fix lands; green with ItsNotRexed#8771's change on an RTX 4060.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Grimkeh Grimkeh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Independent Linux CPU review

What changed: GPU fixture cs_imgload_tfe for the tfe status VGPR on image_load (SHADER-1266); wired into check.py / run_gpu_tests.py and the store-helper skip path.

Checked: tests/test_run_gpu_tests.py::StoreHelperUnsupported — 2 passed. Broader test_shader_checks.Wave64Checks currently fail on both this tip and upstream/main with harness() got an unexpected keyword argument 'cwd' (pre-existing env/main issue, not introduced here).

Looks correct; no game files.

@nnonno91

Copy link
Copy Markdown

Independent Windows GPU verification of #8968 (9c4c5f9) on main 867d922. Windows 11 build 26200, Python 3.14.5, LLVM 23.1.6, SPIRV-Tools 2026.4, and the native Release vk_store_test built from the same main. Radeon gfx1036 (32.0.21042.62) and RTX 5090 (617.42). All fixtures were synthetic. AI-assisted.

Both GPUs returned the same signed-image results. Each table entry is “bad texels out of 64 / value at (5,3)”.

Translator on the same main PR's 32-bit cs_imgload_tfe Local packed d16 companion
main 64 / 2071 64 / 2071
#8471 at d700498 64 / 2071 64 / 2071
Archived #8771 at ac83842 0 / 71 0 / 71

The d16 companion starts from cs_imgload_d16.asm, seeds v8 and v12 with 1000, expands the two image_load destinations to v[7:8] and v[11:12] with the modifiers unorm tfe d16, and adds both status registers to the unpacked sum before storing. It runs through vk_store_test's load-d16 mode, including the saturation row. Both fixtures exercise fully resident loads.

The SPIR-V was byte-identical between main and #8471 for each fixture. All tested modules passed spirv-val --target-env vulkan1.2. In the unmodified #8968 filtered suite, both existing non-TFE controls passed on both GPUs with all three translators. The runner's 62 unit tests also 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.

3 participants