[PR #507] [MERGED] TEST-LDS-U8-D16-GPUAV: restrict LDS fixture accesses to lane zero #555

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/507
Author: @csmith105
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD

Base: main ← Head: codex/lds-u8-d16-fixture


📝 Commits (1)

  • d4eacf7 Restrict LDS byte-read fixture accesses to lane zero

📊 Changes

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

View changed files

📝 runtime/test/shaders/cs_w32_lds_u8_d16.asm (+2 -1)
📝 tests/semantic/fixtures/disasm/cs_w32_lds_u8_d16.s (+1 -1)
📝 tests/semantic/test_lds_read_u8_d16.py (+31 -3)

📄 Description

Claimed as TEST-LDS-U8-D16-GPUAV.

What and why

cs_w32_lds_u8_d16 lets all 32 lanes store the same LDS word before restricting output to lane zero. Matching values do not make those concurrent stores safe: GPU-assisted validation reports six shared-memory data-race errors on an RTX 3080.

Move the existing EXEC mask ahead of the LDS accesses. Lane zero now performs every LDS access and output store, preserving the eight expected byte-read/sign-extension results. Run the CPU fixture with all 32 invocations and observe LDS writes, so serialized execution cannot hide the original race: the regression sees 32 writes before the fix and exactly one afterward. No translator or native harness changes.

Tested

  • Native Windows, RTX 3080: original fixture exits 1 with six GPUAV shared-memory race errors; corrected fixture exits 0, with all eight output words unchanged. Both translate and pass spirv-val (1/1). Repeated the corrected GPU run after rebasing onto a960c06fd.
  • Full semantic suite before rebase: 465 files, 6,105 tests, zero failed files (397 seconds, eight jobs).
  • Three focused CPU tests and fixture regeneration check pass, including after rebase. The new write-count test fails against the original fixture.
  • Python compile check, CLI help, changed-file data-policy check and git diff --check pass.
  • Rebase from 8f481cf16 to a960c06fd is clean. Upstream changes do not touch these files; its translator edit concerns SDWA conversion encodings, which this fixture does not use.

GPU validation used SPIRV-Tools 2026.4, Khronos validation layers 1.4.357.0, LEONIDA_VK_VALIDATION=1 and VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1. This is a wave32 fixture (subgroup 32); the runner's global LEONIDA_W64_EMULATE=1 does not change its mode. Only hand-written synthetic shaders were used.

GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 build 26300.

AI-assisted: yes (Codex).

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No new translator rule; existing fixture correction only.

🔄 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/507 **Author:** [@csmith105](https://github.com/csmith105) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `codex/lds-u8-d16-fixture` --- ### 📝 Commits (1) - [`d4eacf7`](https://github.com/ubiquitarianism/leonida/commit/d4eacf7d056d7cf928f1c67ee38fb2b76ce612ac) Restrict LDS byte-read fixture accesses to lane zero ### 📊 Changes **3 files changed** (+34 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/shaders/cs_w32_lds_u8_d16.asm` (+2 -1) 📝 `tests/semantic/fixtures/disasm/cs_w32_lds_u8_d16.s` (+1 -1) 📝 `tests/semantic/test_lds_read_u8_d16.py` (+31 -3) </details> ### 📄 Description Claimed as [TEST-LDS-U8-D16-GPUAV](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7123850612). ### What and why `cs_w32_lds_u8_d16` lets all 32 lanes store the same LDS word before restricting output to lane zero. Matching values do not make those concurrent stores safe: GPU-assisted validation reports six shared-memory data-race errors on an RTX 3080. Move the existing EXEC mask ahead of the LDS accesses. Lane zero now performs every LDS access and output store, preserving the eight expected byte-read/sign-extension results. Run the CPU fixture with all 32 invocations and observe LDS writes, so serialized execution cannot hide the original race: the regression sees 32 writes before the fix and exactly one afterward. No translator or native harness changes. ### Tested - Native Windows, RTX 3080: original fixture exits 1 with six GPUAV shared-memory race errors; corrected fixture exits 0, with all eight output words unchanged. Both translate and pass `spirv-val` (1/1). Repeated the corrected GPU run after rebasing onto `a960c06fd`. - Full semantic suite before rebase: 465 files, 6,105 tests, zero failed files (397 seconds, eight jobs). - Three focused CPU tests and fixture regeneration check pass, including after rebase. The new write-count test fails against the original fixture. - Python compile check, CLI help, changed-file data-policy check and `git diff --check` pass. - Rebase from `8f481cf16` to `a960c06fd` is clean. Upstream changes do not touch these files; its translator edit concerns SDWA conversion encodings, which this fixture does not use. GPU validation used SPIRV-Tools 2026.4, Khronos validation layers 1.4.357.0, `LEONIDA_VK_VALIDATION=1` and `VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1`. This is a wave32 fixture (subgroup 32); the runner's global `LEONIDA_W64_EMULATE=1` does not change its mode. Only hand-written synthetic shaders were used. GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 610.88, Windows 11 build 26300. AI-assisted: yes (Codex). ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No new translator rule; existing fixture correction only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:16 +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#555
No description provided.