[PR #335] [MERGED] GPU fixture cs_imgstore_cube: image_store on dim:SQ_RSRC_IMG_CUBE (GPU-CUBE-STORE) #386

Closed
opened 2026-11-26 20:17:43 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/335
Author: @milk4sale
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @aslan2142

Base: main ← Head: gpu-test/cube-store


📝 Commits (1)

  • 0d27fdc GPU fixture cs_imgstore_cube: image_store on dim:SQ_RSRC_IMG_CUBE (GPU-CUBE-STORE)

📊 Changes

6 files changed (+207 additions, -14 deletions)

View changed files

📝 docs/design.md (+1 -1)
📝 runtime/test/shaders/check.py (+2 -1)
➕ runtime/test/shaders/cs_imgstore_cube.asm (+95 -0)
📝 runtime/test/vk_store_test.cpp (+102 -8)
📝 scripts/run_gpu_tests.py (+3 -0)
📝 tests/test_shader_checks.py (+4 -4)

📄 Description

Claimed in the coordination issue as: GPU-CUBE-STORE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7120639163)

Depends on: none. It builds on #44 (DOC-CUBE-STORE, merged), whose "Typed image stores" row said a cube store was "not GPU-verified: no GPU fixture covers a cube store yet". It touches vk_store_test.cpp, check.py, run_gpu_tests.py and test_shader_checks.py, which #213 also changes. The two don't overlap in meaning (#213 keeps 2D-array storage at bindings 11/12/13 and adds 26-28 for 1D arrays), but whichever lands second may need a textual rebase.

What and why

The translator writes image_store ... dim:SQ_RSRC_IMG_CUBE through a six-layer 2D-array storage view (bindings 11/12/13 for float/uint/sint, coordinates (x, y, face)), as the runtime binds a cube UAV (runtime/src/vulkan_bindless.h). Until now only tests/semantic/test_image_cube_store_glc.py checked that, on the CPU. This adds the GPU fixture:

  • runtime/test/shaders/cs_imgstore_cube.asm: three T#s (FORMAT 56 rgba8 unorm, 20 r32 uint, 21 r32 sint; word3 TYPE = 0xB, SQ_RSRC_IMG_CUBE). 64 threads each store to their texel on all six faces, with per-face values so a wrong layer shows: rgba8 (x/7, y/7, face/5, 1), uint 100 + 1000·face + 8y + x, sint -(1000·face + 8y + x).
  • vk_store_test cs_imgstore_cube.spv cube: three cube-compatible 8x8 images of six layers, each bound through a six-layer VK_IMAGE_VIEW_TYPE_2D_ARRAY storage view at index 1-3 of bindings 11/12/13. All six layers are read back and every texel of every face is checked. The other modes are unchanged: they keep their 8 bindings and do not create the cube images.
  • scripts/run_gpu_tests.py and runtime/test/shaders/check.py run it the way they run cs_imgstore. tests/test_shader_checks.py counts the seventh vk_store_test case and fakes its output.
  • docs/design.md, "Typed image stores": the cube sentence names the fixture and the GPUs it passed on, replacing "not GPU-verified".

Tested

On main 1c7f5b510 plus this commit, CachyOS (kernel 7.3.3), llvm-mc 23.1.4, SPIRV-Tools v2026.4, GCC 16.2.1:

GPU Driver cs_imgstore_cube native LEONIDA_W64_EMULATE=1
NVIDIA RTX 4070 Ti (Ada, subgroup 32) 620.70.06 PASS: 0/0/0 bad of 384 texels each PASS
Radeon 610M, Ryzen 9 7900X iGPU (gfx1036, RDNA2) RADV Mesa 26.2.6 PASS PASS
  • Negative control: the same fixture with the face held at 0 translates and passes spirv-val, and fails on both GPUs (rgba8 320 bad, uint 384, sint 384). Face 4 texel (5,3) reads 182 109 204 255 / 4129 / -4029 in the passing runs, as the fixture predicts.
  • cs_imgstore still passes on both GPUs, native and emulated.
  • scripts/run_semantic_tests.py tests/semantic: 463 files, 6,075 tests, 0 failed. ctest: 70/70 (2 skipped as on main). node --test tests/test_viewer_streaming.cjs: 57/57.
  • python -I tests/test_*.py for every standard-library test file: all pass except test_rdna2_decode.py, which fails the same way on main here (llvm-mc 23.1.4 prints op_sel:[0,1] where the decoder gives op_sel:[0,1,0,0]). The 30 pytest-based test files were not run (pytest is not installed on this machine).
  • Not run under the Khronos validation layer: it isn't installed here.
  • scripts/check_no_game_data.py on the new fixture: clean.

AI-assisted: yes (Claude Code)

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No new rule: this GPU-confirms the existing cube store row.)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/335 **Author:** [@milk4sale](https://github.com/milk4sale) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `gpu-test/cube-store` --- ### 📝 Commits (1) - [`0d27fdc`](https://github.com/ubiquitarianism/leonida/commit/0d27fdcf9a1e511bad33247b9753f3d3fa78d326) GPU fixture cs_imgstore_cube: image_store on dim:SQ_RSRC_IMG_CUBE (GPU-CUBE-STORE) ### 📊 Changes **6 files changed** (+207 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) 📝 `runtime/test/shaders/check.py` (+2 -1) ➕ `runtime/test/shaders/cs_imgstore_cube.asm` (+95 -0) 📝 `runtime/test/vk_store_test.cpp` (+102 -8) 📝 `scripts/run_gpu_tests.py` (+3 -0) 📝 `tests/test_shader_checks.py` (+4 -4) </details> ### 📄 Description Claimed in the coordination issue as: GPU-CUBE-STORE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7120639163) Depends on: none. It builds on #44 (DOC-CUBE-STORE, merged), whose "Typed image stores" row said a cube store was "**not GPU-verified**: no GPU fixture covers a cube store yet". It touches `vk_store_test.cpp`, `check.py`, `run_gpu_tests.py` and `test_shader_checks.py`, which #213 also changes. The two don't overlap in meaning (#213 keeps 2D-array storage at bindings 11/12/13 and adds 26-28 for 1D arrays), but whichever lands second may need a textual rebase. ### What and why The translator writes `image_store ... dim:SQ_RSRC_IMG_CUBE` through a six-layer 2D-array storage view (bindings 11/12/13 for float/uint/sint, coordinates (x, y, face)), as the runtime binds a cube UAV (`runtime/src/vulkan_bindless.h`). Until now only `tests/semantic/test_image_cube_store_glc.py` checked that, on the CPU. This adds the GPU fixture: - `runtime/test/shaders/cs_imgstore_cube.asm`: three T#s (FORMAT 56 rgba8 unorm, 20 r32 uint, 21 r32 sint; word3 TYPE = 0xB, `SQ_RSRC_IMG_CUBE`). 64 threads each store to their texel on all six faces, with per-face values so a wrong layer shows: rgba8 `(x/7, y/7, face/5, 1)`, uint `100 + 1000·face + 8y + x`, sint `-(1000·face + 8y + x)`. - `vk_store_test cs_imgstore_cube.spv cube`: three cube-compatible 8x8 images of six layers, each bound through a six-layer `VK_IMAGE_VIEW_TYPE_2D_ARRAY` storage view at index 1-3 of bindings 11/12/13. All six layers are read back and every texel of every face is checked. The other modes are unchanged: they keep their 8 bindings and do not create the cube images. - `scripts/run_gpu_tests.py` and `runtime/test/shaders/check.py` run it the way they run `cs_imgstore`. `tests/test_shader_checks.py` counts the seventh `vk_store_test` case and fakes its output. - `docs/design.md`, "Typed image stores": the cube sentence names the fixture and the GPUs it passed on, replacing "not GPU-verified". ### Tested On `main` `1c7f5b510` plus this commit, CachyOS (kernel 7.3.3), llvm-mc 23.1.4, SPIRV-Tools v2026.4, GCC 16.2.1: | GPU | Driver | `cs_imgstore_cube` native | `LEONIDA_W64_EMULATE=1` | |---|---|---|---| | NVIDIA RTX 4070 Ti (Ada, subgroup 32) | 620.70.06 | PASS: 0/0/0 bad of 384 texels each | PASS | | Radeon 610M, Ryzen 9 7900X iGPU (gfx1036, RDNA2) | RADV Mesa 26.2.6 | PASS | PASS | - Negative control: the same fixture with the face held at 0 translates and passes spirv-val, and fails on both GPUs (rgba8 320 bad, uint 384, sint 384). Face 4 texel (5,3) reads `182 109 204 255` / `4129` / `-4029` in the passing runs, as the fixture predicts. - `cs_imgstore` still passes on both GPUs, native and emulated. - `scripts/run_semantic_tests.py tests/semantic`: 463 files, 6,075 tests, 0 failed. `ctest`: 70/70 (2 skipped as on main). `node --test tests/test_viewer_streaming.cjs`: 57/57. - `python -I tests/test_*.py` for every standard-library test file: all pass except `test_rdna2_decode.py`, which fails the same way on `main` here (llvm-mc 23.1.4 prints `op_sel:[0,1]` where the decoder gives `op_sel:[0,1,0,0]`). The 30 pytest-based test files were not run (pytest is not installed on this machine). - Not run under the Khronos validation layer: it isn't installed here. - `scripts/check_no_game_data.py` on the new fixture: clean. AI-assisted: yes (Claude Code) ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No new rule: this GPU-confirms the existing cube store row.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:43 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#386
No description provided.