GPU test cs_w32_atomic_contend: buffer_atomic_inc/dec under contention #178

Closed
Andretuta wants to merge 7 commits from upstream-pr/178 into main
Andretuta commented 2026-11-24 02:36:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Andretuta on 2026-11-24T02:36:42Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5465025792 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/178). Originally posted by [Andretuta](https://github.com/Andretuta) on 2026-11-24T02:36:42Z. --- > 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`.
ImLele69 commented 2026-11-24 11:37:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ImLele69 on 2026-11-24T11:37:26Z.


Tested on Linux, merged onto main 21625bca8 (PR head ce27f4dfe, merges cleanly).

GPU: NVIDIA GeForce RTX 2070 SUPER (Turing, subgroup 32), proprietary driver 620.70.06, Fedora 44, llvm-mc 22.1.8, SPIRV-Tools 2026.1.

Run This PR main alone
run_gpu_tests.py native 198/249 passed, 49 skipped 197/248 passed, 49 skipped
LEONIDA_W64_EMULATE=1 230/249 passed, 17 skipped 229/248 passed, 17 skipped
run_semantic_tests.py tests/semantic 466 files, 6112 tests, 0 files failed in 105 s with 16 jobs 465 files, 6108 tests, 0 files failed

New fixture cs_w32_atomic_contend: PASS in both modes.

The only failures in both runs are the known cs_imgload_tfe / cs_imgload_d16_tfe pair (#31), as on main. No regressions.

AI-assisted: yes (Claude Code ran the build and tests on my machine; numbers are the runners' own output).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7130336259 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/178#issuecomment-7130336259). Originally posted by [ImLele69](https://github.com/ImLele69) on 2026-11-24T11:37:26Z. --- Tested on Linux, merged onto `main` `21625bca8` (PR head `ce27f4dfe`, merges cleanly). GPU: NVIDIA GeForce RTX 2070 SUPER (Turing, subgroup 32), proprietary driver 620.70.06, Fedora 44, llvm-mc 22.1.8, SPIRV-Tools 2026.1. | Run | This PR | `main` alone | |---|---|---| | `run_gpu_tests.py` native | 198/249 passed, 49 skipped | 197/248 passed, 49 skipped | | `LEONIDA_W64_EMULATE=1` | 230/249 passed, 17 skipped | 229/248 passed, 17 skipped | | `run_semantic_tests.py tests/semantic` | 466 files, 6112 tests, 0 files failed in 105 s with 16 jobs | 465 files, 6108 tests, 0 files failed | New fixture `cs_w32_atomic_contend`: PASS in both modes. The only failures in both runs are the known `cs_imgload_tfe` / `cs_imgload_d16_tfe` pair (#31), as on `main`. No regressions. AI-assisted: yes (Claude Code ran the build and tests on my machine; numbers are the runners' own output).
aslan2142 commented 2026-11-24 19:19:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-24T19:19:17Z.


This carry-over of old upstream PR 9912 has been taken over in #868, so I'm closing this draft as #17 describes. The branch old-pr/9912 stays.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7141924004 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/178#issuecomment-7141924004). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-24T19:19:17Z. --- This carry-over of old upstream PR 9912 has been taken over in #868, so I'm closing this draft as #17 describes. The branch `old-pr/9912` stays. AI-assisted (Claude Code, Claude Opus 5.5).

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!178
No description provided.