Skip to content

cs_imgatomic_ext: use the volume T# key vk_store_test now expects (GPU-IMG-ATOMIC-EXT-VOLUME-TAG) - #1518

Open
PierreEbele wants to merge 1 commit into
ProjectLeonida:mainfrom
PierreEbele:imgatomic-ext-volume-tag
Open

PierreEbele wants to merge 1 commit into
ProjectLeonida:mainfrom
PierreEbele:imgatomic-ext-volume-tag

Conversation

@PierreEbele

Copy link
Copy Markdown
Contributor

cs_imgatomic_ext fails on main (f783856) on every device:

FAIL  cs_imgatomic_ext      6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101

db19bbd gave the 4x4x4 volume in runtime/test/vk_store_test.cpp the D3D12 layer's whole-mip UAV tag (word 4 0x80000055, word 7 0xd7801800) and updated cs_imgatomic3d.asm to match. cs_imgatomic_ext.asm (#345) landed separately and still built the old 0x55 words in s12/s15. Its six 3D cases (swap/inc/dec/fmin/fmax/fcmpswap with glc, sint words 32..37) therefore missed the descriptor-table entry: the data registers kept their inputs and the volume was never touched.

This PR changes only those two s_mov_b32 lines, the same edit db19bbd made to cs_imgatomic3d.asm.

Tested on Mesa llvmpipe, Linux arm64. I ran python3 -I scripts/run_gpu_tests.py --build runtime/build/linux --filter cs_imgatomic natively, with LEONIDA_W64_EMULATE=1 and with LEONIDA_BARY_FALLBACK=1:

  • this branch: 3/3 passed in all three modes (cs_imgatomic, cs_imgatomic3d, cs_imgatomic_ext: all 64 words exact);
  • main's fixture: cs_imgatomic_ext fails as above (the full suite fails the same way in all three modes); the other two pass.

scripts/check_no_game_data.py is clean on the changed file.

Claimed in the coordination issue as: GPU-IMG-ATOMIC-EXT-VOLUME-TAG

AI-assisted.

🤖 Generated with Claude Code

@GeorgiyDemo

Copy link
Copy Markdown
Contributor

Tested 1bbf8a9b7 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main 0bc810504:

  • Rebuilt this head's vk_store_test (the binaries at the old build 66d4f5aa3 predate the db19bbd3 volume-tag change in runtime/test/vk_store_test.cpp).
  • GPU, --filter cs_imgatomic_ext: 1/1 PASS on MoltenVK 1.4.2 and 1/1 PASS on KosmicKrisp (Mesa 26.3.1) — "all 64 words of the uint image, the sint image and the volume exact".
  • Coverage: with the same binary and main's cs_imgatomic_ext.asm swapped in, the test FAILS with exactly the reported symptom: "6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101". So the two s_mov_b32 T# words are what fixes it.
  • --filter cs_imgatomic3d: PASS, the sibling volume fixture is unaffected.

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

@ytsodacan

ytsodacan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

[KEEP]

  • Change is minimal and correct: two s_mov_b32 lines in runtime/test/shaders/cs_imgatomic_ext.asm (s12 = 0x80000055, s15 = 0xd7801800), matching the volume T# tag db19bbd gave cs_imgatomic3d.asm.
  • Independent verification exists in the existing comment (MoltenVK and KosmicKrisp pass; main's fixture reproduces the failure), and no overlapping open PR was found.
  • Holding only because CI is still pending (linux-gpu-tools, macos, windows, no-game-data, change-scope); mergeStateStatus is UNSTABLE, no conflicts. Looks ready to merge once those go green.

@adrianmjim

Copy link
Copy Markdown

Checked 1bbf8a9b7 on AMD: Radeon RX 7900 XT (RDNA3), AMD driver 32.0.32029.2010 (26.11.2), Windows 11 build 26300, test programs from a main 42537e7b6 build.

  • main's fixture fails here the same way: cs_imgatomic_ext gives 6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101. It is the only failure in the whole GPU suite (244/263 passed, 18 skipped).
  • With this PR, --filter cs_imgatomic passes all three fixtures, natively and with LEONIDA_W64_EMULATE=1: cs_imgatomic, cs_imgatomic3d and cs_imgatomic_ext, "all 64 words of the uint image, the sint image and the volume exact".

No game files.

@3L1A5-1

3L1A5-1 commented Nov 25, 2026

Copy link
Copy Markdown

Checked 1bbf8a9b7 on NVIDIA, on native Windows: RTX 2060 SUPER 8 GB (Turing), driver 617.14, Windows 11 26300, 16 GB RAM. I used the test programs from a main 3f81d46ac build and ran scripts/run_gpu_tests.py --filter cs_imgatomic with only this PR's fixture swapped in.

  • main's fixture fails as described: cs_imgatomic_ext reports 6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101. cs_imgatomic and cs_imgatomic3d pass.
  • With this branch's fixture, all 3 tests pass natively (wave32) and with LEONIDA_W64_EMULATE=1. All 64 words are exact in each.

In the full suite on main 3f81d46ac, this is the only GPU test that fails here: 209/263 passed natively, 243/263 with LEONIDA_W64_EMULATE=1.

AI-assisted: yes

@minimob1337

Copy link
Copy Markdown

Tested on an RTX 4060 (NVIDIA 610.88, Windows 11, Vulkan SDK 1.4.363, llvm-mc 21.1.8) at main 237deb64c.

Without this PR, cs_imgatomic_ext fails: "6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101". None of the six 3D atomics touch the volume, and each data register keeps its D. With the same two-word T# change it passes, both native and with LEONIDA_W64_EMULATE=1.

A first-parent bisect of main puts the break at e79906a42 (the merge of #939). That merge made 3D atomics require the volume-UAV tag (docs/design.md, "1D and 3D texture UAVs") and updated cs_imgatomic3d's T#, but not this fixture's.

With the change applied, the full suite under LEONIDA_W64_EMULATE=1 is 244/263 passed, 19 skipped, 0 failed.

AI-assisted (Claude Code). No game files.

@mcpeacebir-lang

Copy link
Copy Markdown

Tested on real AMD hardware: RX 7800 XT (RDNA3, GFX1101), AMD 26.11.2 (LLPC), Windows 11, main 3f81d46.

Without this change: cs_imgatomic_ext fails 3 of 3 with "6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101", natively and under LEONIDA_W64_EMULATE=1.
With this PR's two-line change to cs_imgatomic_ext.asm: --filter cs_imgatomic passed 3 of 3 runs natively and 3 of 3 under LEONIDA_W64_EMULATE=1 (cs_imgatomic, cs_imgatomic3d, cs_imgatomic_ext: all 64 words exact).

@Tauwni

Tauwni commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Tested on an Apple M3 (macOS 26.5.1) at main 626d1281a, on three Vulkan drivers:

Driver main with this PR
MoltenVK 1.4.2 FAIL (20/20, 6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101) PASS
KosmicKrisp (Mesa 26.3.1) FAIL (20/20, same words) PASS
llvmpipe (Mesa 26.3.1) FAIL (same words) PASS

cs_imgatomic and cs_imgatomic3d pass on all three either way. On main the volume keeps every fill and sint words 32-37 hold their data registers, so none of the six 3D ops runs. The fixture passes at 367d91ef, where it was added; git bisect --first-parent gives #939 as the first bad commit, which is where 3D atomics started to require the volume UAV tag and cs_imgatomic3d got it (db19bbd34). Same two lines as here. AI-assisted (Claude Code).

Tauwni added a commit to Tauwni/leonida that referenced this pull request Nov 25, 2026
…g that ProjectLeonida#1518 adds (GPU-M3)

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

Copy link
Copy Markdown

Verified on current main (a73a57e) with Mesa llvmpipe on x86-64 (Mesa 25.2.8, LLVM 20.1.2, 256 bits, Ubuntu 24.04, no GPU). Runtime built with GCC and Ninja, llvm-mc 21.1.8.

  • main alone: cs_imgatomic_ext fails, "6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101".
  • With this PR's change to runtime/test/shaders/cs_imgatomic_ext.asm applied on top of a73a57e (it applies cleanly): run_gpu_tests.py --filter cs_imgatomic passes 3/3 (cs_imgatomic, cs_imgatomic3d, cs_imgatomic_ext) in 3 of 3 runs natively and in 3 of 3 runs with LEONIDA_W64_EMULATE=1.

AI-assisted: yes (Claude Code)

@Bonchaloo

Copy link
Copy Markdown

Verified on Apple M5 Max, macOS 27.3 (26C5047e), MoltenVK 1.4.2. On Leonida 1e0de21b0, cs_imgatomic_ext failed in both the default mode and with LEONIDA_W64_EMULATE=1: 6 of 64 signed-image words differed; word 32 was 0x0badf00d, expected 0x00000101.

Applied only this PR’s fixture diff from 1bbf8a9b7 to that checkout and kept the GPU harness binaries unchanged. Reran scripts/run_gpu_tests.py --filter cs_imgatomic_ext --require-pass with wave64 emulation off and on. Both passed: all 64 words matched for the unsigned image, signed image, and volume.

AI-assisted: yes.

@real-rusher

Copy link
Copy Markdown

Verified on two real GPUs on Windows 10 22H2 (19045.6456), with this PR's change to runtime/test/shaders/cs_imgatomic_ext.asm applied on main 73516a2 (it applies cleanly), standalone Vulkan test programs built with llvm-mingw, llvm-mc 23.1.6:

  • NVIDIA RTX PRO 3000 Blackwell Generation Laptop GPU (NVIDIA 610.47, Vulkan 1.4.341)
  • Intel Arrow Lake-HX iGPU (Intel 101.8132, Vulkan 1.4.325)

run_gpu_tests.py --filter cs_imgatomic: cs_imgatomic, cs_imgatomic3d and cs_imgatomic_ext pass 3/3 ("all 64 words of the uint image, the sint image and the volume exact") on both GPUs, native and with LEONIDA_W64_EMULATE=1. On main alone, cs_imgatomic_ext fails on both in both modes ("6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101"). Full runs are in #2348. This was also checked earlier on Mesa llvmpipe.

AI-assisted: yes (Claude Code)

…U-IMG-ATOMIC-EXT-VOLUME-TAG)

db19bbd gave the 4x4x4 volume in vk_store_test the D3D12 layer's whole-mip
UAV tag (word 4 0x80000055, word 7 0xd7801800) and updated cs_imgatomic3d.asm
to match. cs_imgatomic_ext.asm (ProjectLeonida#345) landed separately and still built the
old key, so its six 3D cases missed the descriptor-table entry and the fixture
failed on every device (6 of 64 sint words, first word 32 = 0x0badf00d).

AI-assisted.

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

qhukz13 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Confirmed on a GeForce GTX 1050 Ti 4 GB (Pascal), NVIDIA 582.66, Windows 10 19045 (profile S), test programs from main 39f52f39c, llvm-mc 21.1.8.

MEASURED:

  • main: cs_imgatomic_ext FAILS in every mode we ran (native, LEONIDA_W64_EMULATE=1, +MESH_COMPUTE, +BARY_FALLBACK): 6 of 64 sint words differ; first word 32: got 0x0badf00d, expected 0x00000101.
  • The same two-line change as this PR (s12 = 0x80000055, s15 = 0xd7801800): all 64 words of the uint image, the sint image and the volume exact.

One detail that may be worth a line in the PR: on main the volume is wrong too, not only the six sint words. Running vk_store_test cs_imgatomic_ext.spv words directly, all 64 volume words stay at their fill value 200 + i (the guard synthetic_uav(tsharp) in emit_image_atomic_extra is false, so all six 3D atomics are skipped). check.py stops at the first mismatching array (uint, sint, volume), so the report only ever shows the sint words.

AI-assisted (Claude Code).

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.