[PR #94] rdna2spirv: use OpAtomicStore for MSG_GS_ALLOC_REQ %ms_counts (SHADER-766) #147

Open
opened 2026-11-26 20:16:56 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/94
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: old-pr/9826


📝 Commits (1)

  • a63d296 rdna2spirv: use OpAtomicStore for MSG_GS_ALLOC_REQ %ms_counts (SHADER-766)

📊 Changes

2 files changed (+13 additions, -38 deletions)

View changed files

📝 tests/test_mesh_alloc_single_writer.py (+9 -26)
📝 tools/rdna2spirv.py (+4 -12)

📄 Description

Carried over from old PR 9826 by lordon1a in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9826, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
This branch conflicts with the current main and needs a rebase.
lordon1a: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116641828

What and why

On main@2d53a8055, s_sendmsg(MSG_GS_ALLOC_REQ) in tools/rdna2spirv.py gates OpStore %ms_counts on local_index == 0. When a non-zero wave sends the allocation — as in runtime/test/shaders/ms_wave_info_s3.asm, where wave 0 skips MSG_GS_ALLOC_REQ and wave 1 (local_index 64..127) executes it — %ms_counts is never written, causing ms_wave_info_s3 to render nothing ((-1, -1, -1, -1) clear color) on both native VK_EXT_mesh_shader and LEONIDA_MESH_COMPUTE=1.

Replaces the local_index == 0 guard + plain OpStore with OpAtomicStore %ms_counts %c2 %c0 %m (Workgroup scope, Relaxed semantics), followed by the shader's existing workgroup barrier, and updates tests/test_mesh_alloc_single_writer.py. (Re-opening cleanly on main@2d53a8055 after earlier SHADER-766 PRs #5741 / #5855 were closed in the reset; credit to their authors for the root-cause analysis.)

Verification (Windows 11 Home 26H2, MSYS2 clang64 LLVM 23.1.5 / SPIRV-Tools v2026.4, no game files)

  • Unit test: python -I tests/test_mesh_alloc_single_writer.py -v -> OK.
  • NVIDIA GeForce RTX 3070 Ti Laptop GPU (10de:24e0, driver 616.64, Vulkan 1.4.351):
    • Before fix (main): ms_wave_info_s3 FAIL (got (-1,-1,-1,-1)).
    • After fix (native VK_EXT_mesh_shader, --filter ms_): 5/6 passed, 1 skipped (ms_wave_info_s3: 4096/4096 pixels exact).
    • After fix (LEONIDA_W64_EMULATE=1, --filter ms_): 6/6 passed (ms_wave_info_s3: 4096/4096 pixels exact).
  • Intel(R) Iris(R) Xe Graphics (8086:46a6, driver 32.0.101.7088, Vulkan 1.4.323):
    • Before fix (main, LEONIDA_MESH_COMPUTE=1 + LEONIDA_W64_EMULATE=1): ms_wave_info_s3 FAIL (got (-1,-1,-1,-1)).
    • After fix (LEONIDA_MESH_COMPUTE=1 + LEONIDA_W64_EMULATE=1, --filter ms_): 6/6 passed (ms_wave_info_s3: 4096/4096 pixels exact).
  • python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_mesh_alloc_single_writer.py: clean (rc=0).
  • git diff --check: clean (rc=0).

AI-assisted.


🔄 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/94 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `old-pr/9826` --- ### 📝 Commits (1) - [`a63d296`](https://github.com/ubiquitarianism/leonida/commit/a63d2960a9658b9014474cbe6a2667a8a378932e) rdna2spirv: use OpAtomicStore for MSG_GS_ALLOC_REQ %ms_counts (SHADER-766) ### 📊 Changes **2 files changed** (+13 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_mesh_alloc_single_writer.py` (+9 -26) 📝 `tools/rdna2spirv.py` (+4 -12) </details> ### 📄 Description > Carried over from **old PR 9826** by `lordon1a` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9826`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > This branch conflicts with the current `main` and needs a rebase. > `lordon1a`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claim: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116641828 ### What and why On `main@2d53a8055`, `s_sendmsg(MSG_GS_ALLOC_REQ)` in `tools/rdna2spirv.py` gates `OpStore %ms_counts` on `local_index == 0`. When a non-zero wave sends the allocation — as in `runtime/test/shaders/ms_wave_info_s3.asm`, where wave 0 skips `MSG_GS_ALLOC_REQ` and wave 1 (`local_index` 64..127) executes it — `%ms_counts` is never written, causing `ms_wave_info_s3` to render nothing (`(-1, -1, -1, -1)` clear color) on both native `VK_EXT_mesh_shader` and `LEONIDA_MESH_COMPUTE=1`. Replaces the `local_index == 0` guard + plain `OpStore` with `OpAtomicStore %ms_counts %c2 %c0 %m` (Workgroup scope, Relaxed semantics), followed by the shader's existing workgroup barrier, and updates `tests/test_mesh_alloc_single_writer.py`. (Re-opening cleanly on `main@2d53a8055` after earlier SHADER-766 PRs `#5741` / `#5855` were closed in the reset; credit to their authors for the root-cause analysis.) ### Verification (Windows 11 Home 26H2, MSYS2 clang64 LLVM 23.1.5 / SPIRV-Tools v2026.4, no game files) - Unit test: `python -I tests/test_mesh_alloc_single_writer.py -v` -> **OK**. - **NVIDIA GeForce RTX 3070 Ti Laptop GPU** (`10de:24e0`, driver `616.64`, Vulkan `1.4.351`): - Before fix (`main`): `ms_wave_info_s3` **FAIL** (`got (-1,-1,-1,-1)`). - After fix (native `VK_EXT_mesh_shader`, `--filter ms_`): **5/6 passed, 1 skipped** (`ms_wave_info_s3`: `4096/4096 pixels exact`). - After fix (`LEONIDA_W64_EMULATE=1`, `--filter ms_`): **6/6 passed** (`ms_wave_info_s3`: `4096/4096 pixels exact`). - **Intel(R) Iris(R) Xe Graphics** (`8086:46a6`, driver `32.0.101.7088`, Vulkan `1.4.323`): - Before fix (`main`, `LEONIDA_MESH_COMPUTE=1 + LEONIDA_W64_EMULATE=1`): `ms_wave_info_s3` **FAIL** (`got (-1,-1,-1,-1)`). - After fix (`LEONIDA_MESH_COMPUTE=1 + LEONIDA_W64_EMULATE=1`, `--filter ms_`): **6/6 passed** (`ms_wave_info_s3`: `4096/4096 pixels exact`). - `python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/test_mesh_alloc_single_writer.py`: clean (`rc=0`). - `git diff --check`: clean (`rc=0`). AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#147
No description provided.