rdna2spirv: add --int64-atomics option for 64-bit OpAtomicExchange on *_atomic_swap_x2 (SHADER-868) #251

Open
github-bot wants to merge 1 commit from github-bot/gh-251 into main AGit
Owner

@⁠kotekompotek on GitHub · 2026-11-24 02:53 UTC · original
kotekompotek:work/shader-868-atomic-swap-x2 → main · +639 −32 · 12 files · 1 commits · open

Claimed in the coordination issue as: SHADER-868 (#14)

What and why

  • Addressed @⁠ubiquitarianism's review feedback on this opt-in feature PR (ds_wrxchg_rtn_b64 is untouched).
  • Added --int64-atomics flag forwarding in make_game.py (FALLBACK_FLAGS and CLI parser) alongside tools/rdna2spirv.py and runtime/test/shaders/build.py (LEONIDA_INT64_ATOMICS=1).
  • Updated the Global atomics and buffer_atomic_{and,or,xor,swap}_x2 rows in docs/design.md to document opt-in --int64-atomics vs the default 32-bit dword-pair approximation.
  • Added GPU shader fixture runtime/test/shaders/cs_atomic_swap_x2_int64.asm, registered it in runtime/test/shaders/check.py, scripts/run_gpu_tests.py, and tests/semantic/regen_fixtures.py (tests/semantic/fixtures/disasm/cs_atomic_swap_x2_int64.s).
  • Updated in commit 14eaf6052: enabled shaderBufferInt64Atomics on VkPhysicalDeviceVulkan12Features in runtime/shims/d3d12_vulkan_device.cpp (recorded in runtime/shims/d3d12_com.h, asserted in runtime/test/d3d12_vulkan_device_test.cpp), replaced the single-thread cs_atomic_swap_x2_int64.asm fixture with a 64-thread tearing check, and added dedicated --int64-atomics runner pass in scripts/run_gpu_tests.py.

Tested

On commit 14eaf6052:

  • python -I tests/semantic/regen_fixtures.py --check (OK)
  • python -I tests/semantic/test_atomic_swap_x2_int64.py (6/6 OK via spirv_mini_interp.run_workgroup, 64 threads + 14 = OpAtomicExchange %ulong)
  • tests/semantic/test_fixtures.py & tests/semantic/test_regen_fixtures.py (OK)
  • All 12 tests/test_docs_*.py (OK)
  • compileall (OK)
  • MSVC /W4 compile-check of runtime/shims/d3d12_vulkan_device.cpp & runtime/test/d3d12_vulkan_device_test.cpp (OK)
  • Note: live RDNA2/Vulkan hardware execution of the 64-thread tearing fixture not available locally.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • 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.
**@⁠kotekompotek** on GitHub · 2026-11-24 02:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251) `kotekompotek:work/shader-868-atomic-swap-x2` → `main` · +639 −32 · 12 files · 1 commits · open Claimed in the coordination issue as: SHADER-868 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why - Addressed @⁠ubiquitarianism's review feedback on this opt-in feature PR (`ds_wrxchg_rtn_b64` is untouched). - Added `--int64-atomics` flag forwarding in `make_game.py` (`FALLBACK_FLAGS` and CLI parser) alongside `tools/rdna2spirv.py` and `runtime/test/shaders/build.py` (`LEONIDA_INT64_ATOMICS=1`). - Updated the `Global atomics` and `buffer_atomic_{and,or,xor,swap}_x2` rows in `docs/design.md` to document opt-in `--int64-atomics` vs the default 32-bit dword-pair approximation. - Added GPU shader fixture `runtime/test/shaders/cs_atomic_swap_x2_int64.asm`, registered it in `runtime/test/shaders/check.py`, `scripts/run_gpu_tests.py`, and `tests/semantic/regen_fixtures.py` (`tests/semantic/fixtures/disasm/cs_atomic_swap_x2_int64.s`). - Updated in commit `14eaf6052`: enabled `shaderBufferInt64Atomics` on `VkPhysicalDeviceVulkan12Features` in `runtime/shims/d3d12_vulkan_device.cpp` (recorded in `runtime/shims/d3d12_com.h`, asserted in `runtime/test/d3d12_vulkan_device_test.cpp`), replaced the single-thread `cs_atomic_swap_x2_int64.asm` fixture with a 64-thread tearing check, and added dedicated `--int64-atomics` runner pass in `scripts/run_gpu_tests.py`. ### Tested On commit `14eaf6052`: - `python -I tests/semantic/regen_fixtures.py --check` (`OK`) - `python -I tests/semantic/test_atomic_swap_x2_int64.py` (`6/6 OK` via `spirv_mini_interp.run_workgroup`, 64 threads + 14 `= OpAtomicExchange %ulong`) - `tests/semantic/test_fixtures.py` & `tests/semantic/test_regen_fixtures.py` (`OK`) - All 12 `tests/test_docs_*.py` (`OK`) - `compileall` (`OK`) - MSVC `/W4` compile-check of `runtime/shims/d3d12_vulkan_device.cpp` & `runtime/test/d3d12_vulkan_device_test.cpp` (`OK`) - Note: live RDNA2/Vulkan hardware execution of the 64-thread tearing fixture not available locally. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:50:32 +00:00
Author
Owner

@⁠Mouad-Scriptz-0 on GitHub · 2026-11-24 03:00 UTC · original

I tested this on a GPU. The 64-bit path works, and it fixes a real tearing problem. Some suggestions to help it land are at the end.

Hardware: Intel Meteor Lake graphics (ANV, Mesa 26.2.7, Fedora 45, shaderBufferInt64Atomics = true). I used vk_compute_test from main 84347bbb6 and this branch at 06de9fea0.

1. Single thread, exact. This is a temporary variant of cs_global_mem_ext (one thread) that does global_atomic_swap_x2 … glc and buffer_atomic_swap_x2 … offen glc, then reads back the old values and the memory. main, this PR without the flag and this PR with LEONIDA_INT64_ATOMICS=1 all give the expected 0xF 0xF00000 0xAAAA0001 0xBBBB0002 0x12345678 0x9ABCDEF0 0xCCCC0003 0xDDDD0004. With the flag, spirv-dis shows OpAtomicExchange %ulong twice and OpCapability Int64Atomics, and the module passes spirv-val.

2. Contention. Here 40 groups × 64 threads each swap {x, ~x} (with x unique per thread) into the same 8 bytes using buffer_atomic_swap_x2 glc. A returned old pair is counted as torn when hi != ~lo; the 0xEEEEEEEE fill is excluded. Results over 8 runs of 2560 threads each:

translator torn old pairs per run
main 2455–2494 (~96%)
this PR, default (flag off) 2455–2490
this PR, LEONIDA_INT64_ATOMICS=1 0, 8 of 8 runs

On RDNA2 these instructions are single 64-bit atomics, so the returned old value never tears. Two 32-bit atomics per element (what main emits) tear almost every time under contention. With the flag on, this PR gets that right.

The contention fixture (hand-written, no game data). It replaces cs_global_mem_ext.asm to reuse its FSSM header and run line: vk_compute_test <spv> 40 dump
; out[0] - 0xEEEEEEEE = torn count, out[1] - 0xEEEEEEEE = threads that ran (2560), out[2..3] = final pair
v_lshl_add_u32 v1, s4, 6, v0
v_add_nc_u32_e32 v1, 1, v1
v_not_b32_e32 v2, v1
v_mov_b32_e32 v3, 8
buffer_atomic_swap_x2 v[1:2], v3, s[0:3], 0 offen glc
s_waitcnt vmcnt(0)
v_not_b32_e32 v4, v1
v_xor_b32_e32 v5, v4, v2
v_xor_b32_e32 v6, v1, v2
v_min_u32_e32 v5, 1, v5
v_min_u32_e32 v6, 1, v6
v_and_b32_e32 v5, v5, v6
v_mov_b32_e32 v7, 0
buffer_atomic_add v5, v7, s[0:3], 0 offen
v_mov_b32_e32 v8, 1
v_mov_b32_e32 v9, 4
buffer_atomic_add v8, v9, s[0:3], 0 offen
s_waitcnt vmcnt(0)
s_endpgm

Suggestions:

  • The fix never runs as wired. --int64-atomics is off by default, and only build.py turns it on, through LEONIDA_INT64_ATOMICS. make_game.py and scripts/run_gpu_tests.py never pass it, so no game shader and no CI or GPU-suite run uses the 64-bit path. One option is to turn it on by default: the module already records shaderBufferInt64Atomics in its metadata, so pipeline creation can refuse it on a device without the feature. The other is to have make_game.py pass it when the device reports the feature.
  • The title doesn't match the diff. It names ds_wrxchg_rtn_b64 (LDS), but the diff changes only global_atomic_swap_x2 and buffer_atomic_swap_x2. Retitling it, for example to "rdna2spirv: 64-bit OpAtomicExchange for global/buffer_atomic_swap_x2 (SHADER-868)", would avoid confusion. Note that ds_wrxchg_rtn_b64 would need shaderSharedInt64Atomics, which this Intel GPU reports as false.
  • Project process. CONTRIBUTING.md and AGENTS.md ask for three things this PR doesn't have yet:
    • a claim in #14 (the commit message says SHADER-868, an ID from the old repository);
    • a row in the docs/design.md contract table saying how the rule was confirmed;
    • a GPU fixture. The contention fixture above could become one, with the stress check in scripts/run_gpu_tests.py.

No game files. AI-assisted (Claude Code).

**@⁠Mouad-Scriptz-0** on GitHub · 2026-11-24 03:00 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7120690010) I tested this on a GPU. The 64-bit path works, and it fixes a real tearing problem. Some suggestions to help it land are at the end. **Hardware:** Intel Meteor Lake graphics (ANV, Mesa 26.2.7, Fedora 45, `shaderBufferInt64Atomics = true`). I used `vk_compute_test` from `main` `84347bbb6` and this branch at `06de9fea0`. **1. Single thread, exact.** This is a temporary variant of `cs_global_mem_ext` (one thread) that does `global_atomic_swap_x2 … glc` and `buffer_atomic_swap_x2 … offen glc`, then reads back the old values and the memory. `main`, this PR without the flag and this PR with `LEONIDA_INT64_ATOMICS=1` all give the expected `0xF 0xF00000 0xAAAA0001 0xBBBB0002 0x12345678 0x9ABCDEF0 0xCCCC0003 0xDDDD0004`. With the flag, `spirv-dis` shows `OpAtomicExchange %ulong` twice and `OpCapability Int64Atomics`, and the module passes `spirv-val`. **2. Contention.** Here 40 groups × 64 threads each swap `{x, ~x}` (with `x` unique per thread) into the same 8 bytes using `buffer_atomic_swap_x2 glc`. A returned old pair is counted as torn when `hi != ~lo`; the `0xEEEEEEEE` fill is excluded. Results over 8 runs of 2560 threads each: | translator | torn old pairs per run | |---|---| | `main` | 2455–2494 (~96%) | | this PR, default (flag off) | 2455–2490 | | this PR, `LEONIDA_INT64_ATOMICS=1` | **0, 8 of 8 runs** | On RDNA2 these instructions are single 64-bit atomics, so the returned old value never tears. Two 32-bit atomics per element (what `main` emits) tear almost every time under contention. With the flag on, this PR gets that right. <details><summary>The contention fixture (hand-written, no game data). It replaces <code>cs_global_mem_ext.asm</code> to reuse its FSSM header and run line: <code>vk_compute_test &lt;spv&gt; 40 dump</code></summary> ```asm ; out[0] - 0xEEEEEEEE = torn count, out[1] - 0xEEEEEEEE = threads that ran (2560), out[2..3] = final pair v_lshl_add_u32 v1, s4, 6, v0 v_add_nc_u32_e32 v1, 1, v1 v_not_b32_e32 v2, v1 v_mov_b32_e32 v3, 8 buffer_atomic_swap_x2 v[1:2], v3, s[0:3], 0 offen glc s_waitcnt vmcnt(0) v_not_b32_e32 v4, v1 v_xor_b32_e32 v5, v4, v2 v_xor_b32_e32 v6, v1, v2 v_min_u32_e32 v5, 1, v5 v_min_u32_e32 v6, 1, v6 v_and_b32_e32 v5, v5, v6 v_mov_b32_e32 v7, 0 buffer_atomic_add v5, v7, s[0:3], 0 offen v_mov_b32_e32 v8, 1 v_mov_b32_e32 v9, 4 buffer_atomic_add v8, v9, s[0:3], 0 offen s_waitcnt vmcnt(0) s_endpgm ``` </details> **Suggestions:** - **The fix never runs as wired.** `--int64-atomics` is off by default, and only `build.py` turns it on, through `LEONIDA_INT64_ATOMICS`. `make_game.py` and `scripts/run_gpu_tests.py` never pass it, so no game shader and no CI or GPU-suite run uses the 64-bit path. One option is to turn it on by default: the module already records `shaderBufferInt64Atomics` in its metadata, so pipeline creation can refuse it on a device without the feature. The other is to have `make_game.py` pass it when the device reports the feature. - **The title doesn't match the diff.** It names `ds_wrxchg_rtn_b64` (LDS), but the diff changes only `global_atomic_swap_x2` and `buffer_atomic_swap_x2`. Retitling it, for example to "rdna2spirv: 64-bit OpAtomicExchange for global/buffer_atomic_swap_x2 (SHADER-868)", would avoid confusion. Note that `ds_wrxchg_rtn_b64` would need `shaderSharedInt64Atomics`, which this Intel GPU reports as `false`. - **Project process.** [CONTRIBUTING.md](https://github.com/ubiquitarianism/leonida/blob/main/CONTRIBUTING.md) and [AGENTS.md](https://github.com/ubiquitarianism/leonida/blob/main/AGENTS.md) ask for three things this PR doesn't have yet: - a claim in #14 (the commit message says SHADER-868, an ID from the old repository); - a row in the `docs/design.md` contract table saying how the rule was confirmed; - a GPU fixture. The contention fixture above could become one, with the stress check in `scripts/run_gpu_tests.py`. No game files. AI-assisted (Claude Code).
Author
Owner

@⁠ubiquitarianism on GitHub · 2026-11-24 03:14 UTC · original

Not merging yet. This adds an opt-in feature rather than fixing a bug, and ds_wrxchg_rtn_b64 isn't touched. Please:

  • retitle it;
  • update the buffer_atomic_{and,or,xor,swap}_x2 row in docs/design.md, which currently calls the dword-wise tearing an accepted approximation;
  • add a GPU fixture under runtime/test/shaders, built with LEONIDA_INT64_ATOMICS=1, and say which device and driver ran it;
  • pass the flag through make_game.py; today only build.py reads it.
**@⁠ubiquitarianism** on GitHub · 2026-11-24 03:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7120907058) Not merging yet. This adds an opt-in feature rather than fixing a bug, and `ds_wrxchg_rtn_b64` isn't touched. Please: - retitle it; - update the `buffer_atomic_{and,or,xor,swap}_x2` row in `docs/design.md`, which currently calls the dword-wise tearing an accepted approximation; - add a GPU fixture under `runtime/test/shaders`, built with `LEONIDA_INT64_ATOMICS=1`, and say which device and driver ran it; - pass the flag through `make_game.py`; today only `build.py` reads it.
Author
Owner

@⁠Sangonapou on GitHub · 2026-11-24 05:06 UTC · original

Tested a48dc6e7 on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass, regression check

Runtime built at this head with scripts\build_runtime.ps1 (MSVC 19.51, VS Build Tools 2026); llvm-mc 23.1.6 (conda-forge), SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0. No game files. This PR adds no GPU fixture, so this checks the translator change on the GPU suite.

  • Full run_gpu_tests.py: 257 shaders, 257 translated, 257 pass spirv-val; native 197/248 passed, 49 skipped; LEONIDA_W64_EMULATE=1 229/248 passed, 17 skipped, the same counts as main ece4ba5b. The only failures, cs_imgload_tfe and cs_imgload_d16_tfe, fail identically on main ece4ba5b on this card (main: native 197/248, emulated 229/248), the same pair as #31 / #336.
  • CPU: tests/semantic/test_atomic_swap_x2_int64.py 4 OK.
**@⁠Sangonapou** on GitHub · 2026-11-24 05:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7122625016) Tested a48dc6e7 on NVIDIA GeForce RTX 3080 Ti Laptop (Ampere, subgroup 32..32), NVIDIA 621.24, Vulkan 1.4.357, Windows 11 Pro (build 26300): pass, regression check Runtime built at this head with `scripts\build_runtime.ps1` (MSVC 19.51, VS Build Tools 2026); `llvm-mc` 23.1.6 (conda-forge), SPIRV-Tools 2026.4, Vulkan SDK 1.4.363.0. No game files. This PR adds no GPU fixture, so this checks the translator change on the GPU suite. - Full `run_gpu_tests.py`: 257 shaders, 257 translated, 257 pass spirv-val; native 197/248 passed, 49 skipped; `LEONIDA_W64_EMULATE=1` 229/248 passed, 17 skipped, the same counts as `main` `ece4ba5b`. The only failures, `cs_imgload_tfe` and `cs_imgload_d16_tfe`, fail identically on `main` `ece4ba5b` on this card (main: native 197/248, emulated 229/248), the same pair as #31 / #336. - CPU: `tests/semantic/test_atomic_swap_x2_int64.py` 4 OK.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-24 15:35 UTC · original

Updated per feedback and rebased cleanly onto current main as a single commit (8435a8069):

  1. Retitled to reflect opt-in --int64-atomics on buffer_atomic_swap_x2 / global_atomic_swap_x2 (ds_wrxchg_rtn_b64 untouched).
  2. Updated the Global atomics and buffer_atomic_{and,or,xor,swap}_x2 rows in docs/design.md.
  3. Added runtime/test/shaders/cs_atomic_swap_x2_int64.asm (wired into build.py via LEONIDA_INT64_ATOMICS=1, check.py, run_gpu_tests.py, and tests/semantic/regen_fixtures.py). Note: llvm-mc/spirv-as are not installed locally, so physical GPU execution could not be run on this host; CPU verification via spirv_mini_interp and all translator/doc/CI tests pass.
  4. Forwarded --int64-atomics through make_game.py (FALLBACK_FLAGS and CLI parser, tested in test_atomic_swap_x2_int64.py and test_docs_cli_flags.py).
**@⁠kotekompotek** on GitHub · 2026-11-24 15:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7136284722) Updated per feedback and rebased cleanly onto current `main` as a single commit (`8435a8069`): 1. Retitled to reflect opt-in `--int64-atomics` on `buffer_atomic_swap_x2` / `global_atomic_swap_x2` (`ds_wrxchg_rtn_b64` untouched). 2. Updated the `Global atomics` and `buffer_atomic_{and,or,xor,swap}_x2` rows in `docs/design.md`. 3. Added `runtime/test/shaders/cs_atomic_swap_x2_int64.asm` (wired into `build.py` via `LEONIDA_INT64_ATOMICS=1`, `check.py`, `run_gpu_tests.py`, and `tests/semantic/regen_fixtures.py`). Note: `llvm-mc`/`spirv-as` are not installed locally, so physical GPU execution could not be run on this host; CPU verification via `spirv_mini_interp` and all translator/doc/CI tests pass. 4. Forwarded `--int64-atomics` through `make_game.py` (`FALLBACK_FLAGS` and CLI parser, tested in `test_atomic_swap_x2_int64.py` and `test_docs_cli_flags.py`).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 16:05 UTC · original

I ran 8435a8069 merged onto main a28927849 on two AMD GPUs, Mesa 26.3.1 RADV on Linux, with the validation layer on. Both report shaderBufferInt64Atomics = true:

  • AMD Ryzen 9 7950X3D iGPU (RDNA2, gfx1036);
  • AMD Radeon RX 7900 XTX (RDNA3).

The 64-bit path does fix tearing. I used Mouad-Scriptz-0's contention test: 2,560 threads swapping {x, ~x} into one element with glc, 8 runs.

GPU default, buffer / global --int64-atomics, buffer / global
7950X3D iGPU 8 / 8 torn per run 0 / 0
RX 7900 XTX 235–423 / 303–436 torn per run 0 / 0

No regressions.

  • Full run_gpu_tests.py: main 231/249, this PR 232/250 (+ the new fixture) on both GPUs.
  • Semantic suite: 0 failed.
  • A 2,000-shader corpus slice is byte-identical with and without the flag. No game shader uses *_atomic_swap_x2.

Still open from Mouad-Scriptz-0's review: the claim in #14, run_gpu_tests.py passing the flag, and a multi-thread fixture. The new fixture passes with and without the flag here, because a single thread can't tear.

Two more points:

  • The game runtime doesn't enable shaderBufferInt64Atomics on its device (runtime/shims/d3d12_vulkan_device.cpp:9565-9593). make_game.py --int64-atomics output would use a feature the device wasn't created with.
  • docs/design.md:289 and :497 still end with "Not GPU-verified", and the Global atomics row keeps the old unconditional tearing sentence. The docstrings at tools/rdna2spirv.py:3011 and :3156 describe the old behaviour.

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

**@⁠aslan2142** on GitHub · 2026-11-24 16:05 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7137114728) I ran `8435a8069` merged onto `main` `a28927849` on two AMD GPUs, Mesa 26.3.1 RADV on Linux, with the validation layer on. Both report `shaderBufferInt64Atomics = true`: - AMD Ryzen 9 7950X3D iGPU (RDNA2, gfx1036); - AMD Radeon RX 7900 XTX (RDNA3). **The 64-bit path does fix tearing.** I used Mouad-Scriptz-0's contention test: 2,560 threads swapping `{x, ~x}` into one element with `glc`, 8 runs. | GPU | default, buffer / global | `--int64-atomics`, buffer / global | |---|---|---| | 7950X3D iGPU | 8 / 8 torn per run | 0 / 0 | | RX 7900 XTX | 235–423 / 303–436 torn per run | 0 / 0 | **No regressions.** - Full `run_gpu_tests.py`: `main` 231/249, this PR 232/250 (+ the new fixture) on both GPUs. - Semantic suite: 0 failed. - A 2,000-shader corpus slice is byte-identical with and without the flag. No game shader uses `*_atomic_swap_x2`. **Still open from Mouad-Scriptz-0's review:** the claim in #14, `run_gpu_tests.py` passing the flag, and a multi-thread fixture. The new fixture passes with and without the flag here, because a single thread can't tear. **Two more points:** - The game runtime doesn't enable `shaderBufferInt64Atomics` on its device (`runtime/shims/d3d12_vulkan_device.cpp:9565-9593`). `make_game.py --int64-atomics` output would use a feature the device wasn't created with. - `docs/design.md:289` and `:497` still end with "Not GPU-verified", and the Global atomics row keeps the old unconditional tearing sentence. The docstrings at `tools/rdna2spirv.py:3011` and `:3156` describe the old behaviour. AI-assisted (Claude Code, Claude Opus 5.5).
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-24 18:31 UTC · original

@⁠aslan2142 @⁠Mouad-Scriptz-0 Updated in commit 14eaf6052:

  1. Enabled shaderBufferInt64Atomics on VkPhysicalDeviceVulkan12Features in runtime/shims/d3d12_vulkan_device.cpp, recorded shader_buffer_int64_atomics in runtime/shims/d3d12_com.h, and asserted it in runtime/test/d3d12_vulkan_device_test.cpp.
  2. Replaced the single-thread cs_atomic_swap_x2_int64.asm fixture (and regenerated .s via regen_fixtures.py) with a 64-thread (2 wave32 waves, 4 rounds = 256 buffer_atomic_swap_x2 + 256 global_atomic_swap_x2 via s_barrier and Device-scope atomics) tearing check (EXPECTED_FIXTURE = [0, 0, 256, 256, 1, 1, 0xDEAD0001, 0x9ABCDEF0]).
  3. Updated runtime/test/shaders/build.py, runtime/test/shaders/check.py, scripts/run_gpu_tests.py (int64_atomics() helper + dedicated --int64-atomics pass merging its index.json entry without clobbering 32-bit defaults), tests/semantic/test_atomic_swap_x2_int64.py, tools/rdna2spirv.py docstrings, and docs/design.md.
  4. Verified locally on 14eaf6052: regen_fixtures.py --check OK, test_atomic_swap_x2_int64.py (6/6 OK), test_fixtures.py & test_regen_fixtures.py OK, all 12 test_docs_*.py OK, compileall OK, MSVC /W4 compile-check of d3d12_vulkan_device.cpp & d3d12_vulkan_device_test.cpp OK. (llvm-mc, CTest Vulkan run, and RDNA2 hardware are not present on this Windows GTX 1050 host, so CI / hardware GPU run on the updated fixture is pending.)
**@⁠kotekompotek** on GitHub · 2026-11-24 18:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7140762506) @⁠aslan2142 @⁠Mouad-Scriptz-0 Updated in commit `14eaf6052`: 1) Enabled `shaderBufferInt64Atomics` on `VkPhysicalDeviceVulkan12Features` in `runtime/shims/d3d12_vulkan_device.cpp`, recorded `shader_buffer_int64_atomics` in `runtime/shims/d3d12_com.h`, and asserted it in `runtime/test/d3d12_vulkan_device_test.cpp`. 2) Replaced the single-thread `cs_atomic_swap_x2_int64.asm` fixture (and regenerated `.s` via `regen_fixtures.py`) with a 64-thread (2 wave32 waves, 4 rounds = 256 `buffer_atomic_swap_x2` + 256 `global_atomic_swap_x2` via `s_barrier` and Device-scope atomics) tearing check (`EXPECTED_FIXTURE = [0, 0, 256, 256, 1, 1, 0xDEAD0001, 0x9ABCDEF0]`). 3) Updated `runtime/test/shaders/build.py`, `runtime/test/shaders/check.py`, `scripts/run_gpu_tests.py` (`int64_atomics()` helper + dedicated `--int64-atomics` pass merging its `index.json` entry without clobbering 32-bit defaults), `tests/semantic/test_atomic_swap_x2_int64.py`, `tools/rdna2spirv.py` docstrings, and `docs/design.md`. 4) Verified locally on `14eaf6052`: `regen_fixtures.py --check` OK, `test_atomic_swap_x2_int64.py` (6/6 OK), `test_fixtures.py` & `test_regen_fixtures.py` OK, all 12 `test_docs_*.py` OK, `compileall` OK, MSVC `/W4` compile-check of `d3d12_vulkan_device.cpp` & `d3d12_vulkan_device_test.cpp` OK. (`llvm-mc`, CTest Vulkan run, and RDNA2 hardware are not present on this Windows GTX 1050 host, so CI / hardware GPU run on the updated fixture is pending.)
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 07:44 UTC · original

Rebased on current ubi/main (3f81d46ac) and pushed. Conflicts resolved against the newer main changes; test suite for the touched area passes locally (xs_proxy_mock_test PASS on Windows; the int64-atomics semantic tests 6/6 and test_rdna2_decode 21/21 where applicable).

AI-assisted: yes

**@⁠kotekompotek** on GitHub · 2026-11-25 07:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/251#issuecomment-7156208558) Rebased on current ubi/main (3f81d46ac) and pushed. Conflicts resolved against the newer main changes; test suite for the touched area passes locally (xs_proxy_mock_test PASS on Windows; the int64-atomics semantic tests 6/6 and test_rdna2_decode 21/21 where applicable). AI-assisted: yes
This pull request has changes conflicting with the target branch.
  • runtime/test/shaders/build.py
  • tools/rdna2spirv.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/251/head:github-bot/gh-251'
git switch 'github-bot/gh-251'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-251'
git switch 'github-bot/gh-251'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-251'
git switch 'github-bot/gh-251'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-251'
git switch 'main'
git merge --squash 'github-bot/gh-251'
git switch 'main'
git merge --ff-only 'github-bot/gh-251'
git switch 'main'
git merge 'github-bot/gh-251'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.