[PR #868] tests: GPU fixture cs_w32_atomic_contend for buffer_atomic_inc/dec contention (OLD-9912) #906

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

📋 Pull Request Information

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

Base: main ← Head: test/old-9912-gpu-atomic-contend


📝 Commits (3)

  • dc9e327 GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention
  • c74c89b test_atomic_contend_fixture: runs under python -I
  • 34005bd cs_w32_atomic_contend: word 2 uses D = 19, so an inc and a dec can't give the same word

📊 Changes

5 files changed (+182 additions, -3 deletions)

View changed files

📝 runtime/test/shaders/check.py (+3 -1)
➕ runtime/test/shaders/cs_w32_atomic_contend.asm (+47 -0)
📝 scripts/run_gpu_tests.py (+4 -2)
➕ tests/semantic/fixtures/disasm/cs_w32_atomic_contend.s (+29 -0)
➕ tests/semantic/test_atomic_contend_fixture.py (+99 -0)

📄 Description

Claimed in the coordination issue as: OLD-9912

Summary

Carries forward old-pr/9912 (carried-over draft #178) onto current main (f3e26be7c), preserving the original author's (Luiz Neves) three commits:

  • GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention
  • test_atomic_contend_fixture: runs under python -I
  • cs_w32_atomic_contend: word 2 uses D = 19, so an inc and a dec can't give the same word

Rebase adjustments

  • Resolved append-list conflicts in runtime/test/shaders/check.py and scripts/run_gpu_tests.py against current main.
  • Kept main's dynamic tests/semantic/regen_fixtures.py and added the ; regen_fixtures: this source has a translator fixture in tests/semantic/fixtures/disasm marker line to runtime/test/shaders/cs_w32_atomic_contend.asm.

Testing & Hardware Verification

  • AI-assisted: yes (rebase, conflict resolution, and test execution).
  • Synthetic fixtures only: no game data used (python -I scripts/check_no_game_data.py clean on all touched files).
  • GPU & Driver: NVIDIA GeForce RTX 5070, Driver 591.74, Windows 11 (LEONIDA_VK_VALIDATION=1, VKC_SUBGROUP_SIZE=32).
  • Live GPU run (runtime/test/shaders/build.py + vk_compute_test.exe cs_w32_atomic_contend.spv 1 dump):
    1 shaders: 1 translated, 1 pass spirv-val
    device: NVIDIA GeForce RTX 5070 (subgroup 32..32) (validation on)
    compute subgroup size: 32
    1 groups x 64: 0 mismatches
    out[0..7] = 4008636174 4008636141 11 4008636110 4 4008636173 4008636111 4008636141
    
    Matches expected [0xEEEEEF0E, 0xEEEEEEED, 0xB, 0xEEEEEECE, 0x4, 0xEEEEEF0D, 0xEEEEEECF, 0xEEEEEEED] under real 32-lane hardware CAS contention with 0 mismatches and 0 Vulkan validation errors.
  • CPU / unit tests:
    • python -I tests/semantic/test_atomic_contend_fixture.py -v: 4/4 OK
    • python -I tests/test_regen_fixtures.py: 7/7 OK
    • python -I tests/test_text_write_line_endings.py: 3/3 OK

🔄 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/868 **Author:** [@TanmaySatyam](https://github.com/TanmaySatyam) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/old-9912-gpu-atomic-contend` --- ### 📝 Commits (3) - [`dc9e327`](https://github.com/ubiquitarianism/leonida/commit/dc9e3273403344bca1e90531984c932368c8f2f6) GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention - [`c74c89b`](https://github.com/ubiquitarianism/leonida/commit/c74c89b8cadb69668ea2273201c29805e8932cdf) test_atomic_contend_fixture: runs under python -I - [`34005bd`](https://github.com/ubiquitarianism/leonida/commit/34005bd2bf747dca216969b55541d07c780f3913) cs_w32_atomic_contend: word 2 uses D = 19, so an inc and a dec can't give the same word ### 📊 Changes **5 files changed** (+182 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/shaders/check.py` (+3 -1) ➕ `runtime/test/shaders/cs_w32_atomic_contend.asm` (+47 -0) 📝 `scripts/run_gpu_tests.py` (+4 -2) ➕ `tests/semantic/fixtures/disasm/cs_w32_atomic_contend.s` (+29 -0) ➕ `tests/semantic/test_atomic_contend_fixture.py` (+99 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9912 ### Summary Carries forward `old-pr/9912` (carried-over draft #178) onto current `main` (`f3e26be7c`), preserving the original author's (`Luiz Neves`) three commits: - `GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention` - `test_atomic_contend_fixture: runs under python -I` - `cs_w32_atomic_contend: word 2 uses D = 19, so an inc and a dec can't give the same word` ### Rebase adjustments - Resolved append-list conflicts in `runtime/test/shaders/check.py` and `scripts/run_gpu_tests.py` against current `main`. - Kept `main`'s dynamic `tests/semantic/regen_fixtures.py` and added the `; regen_fixtures: this source has a translator fixture in tests/semantic/fixtures/disasm` marker line to `runtime/test/shaders/cs_w32_atomic_contend.asm`. ### Testing & Hardware Verification - **AI-assisted:** yes (rebase, conflict resolution, and test execution). - **Synthetic fixtures only:** no game data used (`python -I scripts/check_no_game_data.py` clean on all touched files). - **GPU & Driver:** NVIDIA GeForce RTX 5070, Driver 591.74, Windows 11 (`LEONIDA_VK_VALIDATION=1`, `VKC_SUBGROUP_SIZE=32`). - **Live GPU run (`runtime/test/shaders/build.py` + `vk_compute_test.exe cs_w32_atomic_contend.spv 1 dump`):** ```text 1 shaders: 1 translated, 1 pass spirv-val device: NVIDIA GeForce RTX 5070 (subgroup 32..32) (validation on) compute subgroup size: 32 1 groups x 64: 0 mismatches out[0..7] = 4008636174 4008636141 11 4008636110 4 4008636173 4008636111 4008636141 ``` Matches expected `[0xEEEEEF0E, 0xEEEEEEED, 0xB, 0xEEEEEECE, 0x4, 0xEEEEEF0D, 0xEEEEEECF, 0xEEEEEEED]` under real 32-lane hardware CAS contention with 0 mismatches and 0 Vulkan validation errors. - **CPU / unit tests:** - `python -I tests/semantic/test_atomic_contend_fixture.py -v`: 4/4 OK - `python -I tests/test_regen_fixtures.py`: 7/7 OK - `python -I tests/test_text_write_line_endings.py`: 3/3 OK --- <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#906
No description provided.