Skip to content

tests: correct resident TFE status expectations (SHADER-1266) - #892

Merged
aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
moffington:fix/shader-1266-tfe-fixtures
Nov 24, 2026
Merged

aslan2142 merged 2 commits into
ProjectLeonida:mainfrom
moffington:fix/shader-1266-tfe-fixtures

Conversation

@moffington

Copy link
Copy Markdown
Contributor

Fixes #31.
Claimed in the coordination issue as: SHADER-1266

Summary

  • Updates runtime/test/shaders/cs_imgload_tfe.asm and runtime/test/shaders/cs_imgload_d16_tfe.asm so resident image_load ... tfe checks preservation of each pre-seeded status VGPR rather than expecting 0.
  • Preserves tools/rdna2spirv.py untouched.
  • Seeds distinct values (v8 = 0x3e8, v12 = 0x7d0) before the two image_load ... tfe instructions and independently checks both via (v8 ^ 0x3e8) | (v12 ^ 0x7d0) added into v11, so zeroing or modifying either status VGPR shifts every texel.

Context & Related Work

Validation (Linux, NVIDIA GeForce RTX 3060, Driver 615.78.08, Vulkan 1.4.351)

  • Native (scripts/run_gpu_tests.py): 258/258 translated and spirv-val valid; 200/249 passed, 49 skipped, 0 failed (cs_imgload_tfe and cs_imgload_d16_tfe both pass with r32 sint (sint view): 0 bad, texel(5,3) = 71, 0 regressions vs. main).
  • Wave64-emulated (LEONIDA_W64_EMULATE=1): 258/258 translated and spirv-val valid; 232/249 passed, 17 skipped, 0 failed (0 regressions vs. main).
  • Negative control: Applying the status-zeroing translator diff to tools/rdna2spirv.py causes run_gpu_tests.py --filter tfe to fail both corrected fixtures (0/2 passed: cs_imgload_tfe and cs_imgload_d16_tfe both FAIL, 64 bad, texel(5,3) = 2111).
  • Hygiene: scripts/check_no_game_data.py passed on both modified .asm files.

Limitations

  • Covers resident image_load ... tfe (32-bit and d16 2D) only; sparse-page NACK (status != 0) and lwe behavior remain outside this measurement.

No game files and nothing online. AI-assisted.

@SweatierKey SweatierKey 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.

Independent A/B hardware verification on NVIDIA GeForce RTX 5070 Ti (driver 616.92, Windows 11, Vulkan 1.4) against origin/main@a28927849:

Built & validated (runtime/test/shaders/build.py + spirv-val --target-env vulkan1.3, both native and LEONIDA_W64_EMULATE=1):

  • cs_imgload_tfe + cs_imgload_d16_tfe: 2 translated, 2 pass spirv-val in both modes.

A/B execution via vk_store_test.exe (load / load-d16):

  • Before (origin/main@a28927849): both cs_imgload_tfe and cs_imgload_d16_tfe fail in native and LEONIDA_W64_EMULATE=1 with r32 sint (sint view): 64 bad, texel(5,3) = 2071 (rc=1).
  • After (8afbba14b): both cs_imgload_tfe and cs_imgload_d16_tfe pass in native and LEONIDA_W64_EMULATE=1 with 0 bad on all 3 views (rgba8 unorm, r32 uint, r32 sint, texel(5,3) = 71, rc=0).
  • scripts/check_no_game_data.py: clean.

Clean minimal fix matching the resident-TFE semantics measured on hardware.

GPUs tested: NVIDIA GeForce RTX 5070 Ti (driver 616.92, Windows 11)
AI-assisted: yes

@LewisStephens99

Copy link
Copy Markdown

Independent verification on NVIDIA RTX A2000 12GB, Windows 11, NVIDIA 32.0.16.2114, Vulkan 1.4.363, LLVM-MC 21.1.8:n- python -I scripts/run_gpu_tests.py --build runtime/build/vulkan-full --work --filter imgload: 4/4 passed (cs_imgload, cs_imgload_d16, cs_imgload_tfe, cs_imgload_d16_tfe), all spirv-val valid.n- tests/test_image_load_typed.py: 23/23 passed.nnNo game files or retail assets used. AI-assisted.

@morodirule

Copy link
Copy Markdown

Independent Linux/RTX 4070 verification of the fixture-only fix (no game files): built cs_imgload_tfe + cs_imgload_d16_tfe from head 8afbba1 with runtime/test/shaders/build.py (2 translated, 2 spirv-val clean) and ran vk_store_test load on NVIDIA GeForce RTX 4070, driver 620.70.06, Vulkan 1.4.357, Arch Linux. Both now report 0 bad in all three views with texel(5,3)=71 (expected 100-(8*3+5)); the old fixtures on this same card failed the r32 sint view with 64 bad / texel(5,3)=2071. This matches the PR premise: resident image_load tfe preserves the seeded status VGPRs (0x3e8/0x7d0) through the current translator. Not claiming; review evidence only.

@thesubtleties

Copy link
Copy Markdown
Contributor

Tested 8afbba14b merged onto 1504c1af6, Linux: RTX 3080 (620.73.04) 201/250 native and 233/250 with LEONIDA_W64_EMULATE=1; gfx1036 iGPU (RADV, Mesa 26.3.1) 234/250; 0 failed. Only the two tfe fixtures change from main. Merged with #291 as well, both fail again (2111), so they are mutually exclusive. Compile-only evidence for preservation: RADV emits v_lshrrev_b64 v[2:3], 0, 0 before image_load … tfe, with the old value as an operand, and LLVM llc for gfx1036 zeroes both VGPRs first. This is indirect, and I did not measure the hardware. No game files. AI-assisted (Claude Code).

aslan2142 added a commit that referenced this pull request Nov 24, 2026
Tested 0d27fdc merged locally onto main 1504c1a: cs_imgstore_cube passes everywhere, and nothing else changes state.

Devices: RADV, Mesa 26.3.1, Linux:
- AMD Radeon RX 7900 XTX (RDNA3, gfx1100);
- Ryzen 9 7950X3D iGPU (RDNA2, gfx1036);
- llvmpipe.

New fixture, 10 runs each with run_gpu_tests.py --filter cs_imgstore_cube --require-pass:
- 10/10 natively and 10/10 with LEONIDA_W64_EMULATE=1 on all three devices, 0 bad for all three cube images;
- the validation layer, with sync validation on, reports nothing on either AMD GPU.

Regressions, main vs main + #335:
- Full run_gpu_tests.py on both GPUs, native and emulated: 232/250 → 233/251. The only change is the new PASS.
- Every existing vk_store_test fixture keeps its state.
- tests/test_shader_checks.py and tests/semantic/test_image_cube_store_glc.py pass on both trees.

CI: this head's checks are still queued on GitHub, so I ran the Linux jobs locally. They give the same result on both trees. The only failures are already on main:
- cs_imgload_tfe and cs_imgload_d16_tfe (#31, fixed by #892);
- tests/test_tool_stdout_encoding.py.

AI-assisted (Claude Code, Claude Opus 5.5).
@syntaxixr

syntaxixr commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Tested 8afbba1 on AMD Radeon RX 6600 (RDNA2, Navi 23 / GFX1032), AMD Windows driver 26.6.4 (32.0.21043.19003), Windows 10 19045, llvm-mc 23.1.6, SPIRV-Tools v2026.4, reusing a runtime build of main 3ed8e50 (this PR only touches the two fixtures):

main 3ed8e50 this PR
run_gpu_tests.py --filter imgload, native cs_imgload_tfe, cs_imgload_d16_tfe FAIL (64 bad, texel(5,3) = 2071) 4/4 PASS, texel(5,3) = 71
same, LEONIDA_W64_EMULATE=1 same two FAIL 4/4 PASS

So AMD's proprietary Windows compiler on native wave64 hardware also preserves the seeded status VGPR on resident reads. Full record in #1017. No game files. AI-assisted.

@aslan2142

Copy link
Copy Markdown
Collaborator

Reviewed and merging. The fixtures were wrong, not the translator: a resident image_load ... tfe keeps the seeded status VGPR.

AI-assisted (Claude Code, Claude Opus 5.5).

@aslan2142
aslan2142 merged commit 3295055 into ProjectLeonida:main Nov 24, 2026
5 checks passed
quartz-heron-58 added a commit to quartz-heron-58/leonida that referenced this pull request Nov 24, 2026
…X4080-WIN-REFRESH)

The record named d42773d and the two tfe failures, which pass since
ProjectLeonida#892. On current main run_gpu_tests.py gives 203/252 native and 235/252
with LEONIDA_W64_EMULATE=1, 0 failed in both.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
DominusMayo added a commit to DominusMayo/leonida that referenced this pull request Nov 24, 2026
run_gpu_tests.py: 235/252 passed, 17 skipped, no failures, native and
with LEONIDA_W64_EMULATE=1; the two imgload tfe fixtures pass since ProjectLeonida#892.
ctest: 292 passed, 12 skipped, 4 failed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
QemmHD added a commit that referenced this pull request Nov 24, 2026
Merging.

**Why merged:** GPU-RTX4080-WIN-REFRESH: the author's own RTX4080.txt (from #541) re-run at 71f99e2: 203/252 native and 235/252 emulated, 0 failed. The tfe failures are gone after #892, and a History line keeps the old numbers.

**Why it's good:** Record update, docs tests 47 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 6293c1c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests) gives 571 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. Security read of the three-dot diff: no binaries, game data, downloads, network calls, new env vars or build/CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
@GeorgiyDemo

Copy link
Copy Markdown
Contributor

Tested 8afbba14b on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), binaries from main d0da7dade:

  • main, scripts at main: cs_imgload_tfe and cs_imgload_d16_tfe FAIL with r32 sint (sint view): 64 bad, texel(5,3) = 2071; the other two pass (2/4).
  • This head: 4/4 PASS on MoltenVK 1.4.2 and 4/4 on KosmicKrisp (Mesa 26.3.1), every texel at 71.

Conflict worth settling before merge: #291 (rdna2spirv: zero the tfe/lwe status VGPR on image_load) makes the same two fixtures pass by having the translator write 0 into the status VGPR, while this PR changes the fixtures to expect the resident status to be left unchanged. I ran the two together — #291's translator with these two .asm files — and both fixtures FAIL (2/4) on MoltenVK, so the two PRs encode opposite expectations and only one can land as written. Either the fixtures accept both behaviours or one of the two approaches is dropped.

AI-assisted; synthetic fixtures only, no game data.

quartz-heron-58 added a commit to quartz-heron-58/leonida that referenced this pull request Nov 24, 2026
Brings in the tfe fixture fix (ProjectLeonida#892) that the Runtime workflow's GPU tests need.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Mouad-Scriptz-0 pushed a commit to Mouad-Scriptz-0/leonida that referenced this pull request Nov 24, 2026
…xture fix (GPU-INTEL-MTL-TFE)

ProjectLeonida#892 corrected cs_imgload_tfe and cs_imgload_d16_tfe to expect the
seeded status kept. At main 0b45fdc both pass on this Intel GPU,
native and with LEONIDA_W64_EMULATE=1.

AI-assisted.
tengotengo added a commit to tengotengo/leonida that referenced this pull request Nov 25, 2026
Andretuta pushed a commit that referenced this pull request Nov 25, 2026
… no failures left (GPU-4070TI-RERUN)

The record from 84347bb listed two failures, cs_imgload_tfe and cs_imgload_d16_tfe. Both pass since #892
(SHADER-1266), and the four fixtures added since then pass too: 261 shaders translated and valid, native 203/252
with 49 skipped, LEONIDA_W64_EMULATE=1 235/252 with 17 skipped, no failure in either, ctest 74/74.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tengotengo added a commit to tengotengo/leonida that referenced this pull request Nov 26, 2026
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.

AMD Radeon 780M (RDNA3 iGPU, driver 26.10.2): cs_imgload_tfe and cs_imgload_d16_tfe fail on main - the tfe fetch status VGPR is read but never written

8 participants