[PR #178] [CLOSED] GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention #232

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/178
Author: @Andretuta
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: old-pr/9912


📝 Commits (7)

  • 559ce67 GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention
  • f4734c0 test_atomic_contend_fixture: runs under python -I
  • 1c49799 Merge remote-tracking branch 'origin/main' into HEAD
  • 69a488b cs_w32_atomic_contend: word 2 uses D = 19, so an inc and a dec can't give the same word
  • cef6d5a Merge remote-tracking branch 'origin/main' into HEAD
  • 0cda998 Merge remote-tracking branch 'origin/main' into HEAD
  • ce27f4d Merge remote-tracking branch 'origin/main' into HEAD

📊 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

Carried over from old PR 9912 by LouisRiverstone in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9912, 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.
LouisRiverstone: 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):

buffer_atomic_inc/dec (#2448) are OpAtomicCompareExchange loops. Their tests run them in one lane, or in the CPU interpreter, which runs lanes in lockstep. @TheMrBeez checked the loops under contention by hand on #3097, but nothing in the suite does. This GPU fixture, runtime/test/shaders/cs_w32_atomic_contend.asm, has all 32 lanes of a wave32 group run every op on the same dwords, so the loops race for real on a GPU.

Re-submission of #4331. #4331 was closed unmerged during the 2026-11-23 22:45 UTC cleanup, along with the other open PRs. This is the same branch, now merged with current main.

Checked on #4331 by: theswiss24 (two NVIDIA GPUs), vibryxcx (RX 6800), radv-tinker (AMD Radeon RX 9070 XT), javdc (Steam Deck LCD), sovljanskii (Apple M4), nicknickalive (RTX 5090), Mortify7612 (AMD Radeon RX 9060 XT), Itschotsch (RTX 4090), lukasas74 (RTX 5080), YordiLorenzo (RTX 5090), matheusfermiano-source (main 867d922f0)), nicolasabosch (RTX 4070 Laptop GPU).

No game files.

AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with main.


🔄 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/178 **Author:** [@Andretuta](https://github.com/Andretuta) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `old-pr/9912` --- ### 📝 Commits (7) - [`559ce67`](https://github.com/ubiquitarianism/leonida/commit/559ce6717b92e620bfca97474d5f50337b5ec03c) GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention - [`f4734c0`](https://github.com/ubiquitarianism/leonida/commit/f4734c0ad169cefc96edb8243bbef0bd00116fe5) test_atomic_contend_fixture: runs under python -I - [`1c49799`](https://github.com/ubiquitarianism/leonida/commit/1c49799e5ebdac3067289789ab6a26c17e3956a3) Merge remote-tracking branch 'origin/main' into HEAD - [`69a488b`](https://github.com/ubiquitarianism/leonida/commit/69a488b42551bf469fcf8b734732e03173122535) cs_w32_atomic_contend: word 2 uses D = 19, so an inc and a dec can't give the same word - [`cef6d5a`](https://github.com/ubiquitarianism/leonida/commit/cef6d5a083007a2f2042ca4bfd7717cd79b98d26) Merge remote-tracking branch 'origin/main' into HEAD - [`0cda998`](https://github.com/ubiquitarianism/leonida/commit/0cda9988f154affe624456919f5c9c4b3fbcffb3) Merge remote-tracking branch 'origin/main' into HEAD - [`ce27f4d`](https://github.com/ubiquitarianism/leonida/commit/ce27f4dfe843cca8d72a417816155bd077562e93) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 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 > Carried over from **old PR 9912** by `LouisRiverstone` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9912`, 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. > `LouisRiverstone`: 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): `buffer_atomic_inc`/`dec` (`#2448`) are `OpAtomicCompareExchange` loops. Their tests run them in one lane, or in the CPU interpreter, which runs lanes in lockstep. `@TheMrBeez` checked the loops under contention by hand on `#3097`, but nothing in the suite does. This GPU fixture, `runtime/test/shaders/cs_w32_atomic_contend.asm`, has **all 32 lanes of a wave32 group run every op on the same dwords**, so the loops race for real on a GPU. Re-submission of `#4331`. `#4331` was closed unmerged during the 2026-11-23 22:45 UTC cleanup, along with the other open PRs. This is the same branch, now merged with current `main`. Checked on `#4331` by: theswiss24 (two NVIDIA GPUs), vibryxcx (RX 6800), radv-tinker (AMD Radeon RX 9070 XT), javdc (Steam Deck LCD), sovljanskii (Apple M4), nicknickalive (RTX 5090), Mortify7612 (AMD Radeon RX 9060 XT), Itschotsch (RTX 4090), lukasas74 (RTX 5080), YordiLorenzo (RTX 5090), matheusfermiano-source (main 867d922f0)), nicolasabosch (RTX 4070 Laptop GPU). No game files. AI-assisted (Claude Code): I reviewed the change and re-ran its tests on the merge with `main`. --- <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:13 +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#232
No description provided.