[PR #966] rdna2spirv: keep DATA0 for equal paired LDS write offsets (SHADER-LDS-EQUAL-WRITES) #1003

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

📋 Pull Request Information

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

Base: main ← Head: portbridge/paired-lds-data0


📝 Commits (1)

  • 9ae6f12 rdna2spirv: keep DATA0 for equal paired LDS write offsets

📊 Changes

4 files changed (+85 additions, -8 deletions)

View changed files

📝 docs/design.md (+1 -1)
➕ tests/semantic/fixtures/lds_write2_equal_offsets.asm (+32 -0)
➕ tests/semantic/test_lds_write2_equal_offsets.py (+39 -0)
📝 tools/rdna2spirv.py (+13 -7)

📄 Description

Claimed in the coordination issue as: SHADER-LDS-EQUAL-WRITES

What and why

For compute-shader ds_write2 and ds_write2st64 (b32 and b64), equal offsets now emit only the DATA0 store. Both operands are still validated. Distinct offsets store both values, and paired reads are unchanged. AMD RDNA 2 ISA §10.4.3, printed p. 96

PortBridge linked THE-PRO-GAME’s finding in VIctory #1088 to the same lowering here. The XCL result uses the same rule.

Tested

  • Base a2892784: the hand-written fixture returned DATA1 in all five equal-offset cases, including the implicit zero-offset case. Existing paired read/write controls passed.
  • At 9ae6f12, all 379 LDS semantic tests passed without skips, including the five address cases and three malformed-operand controls. The no-game-data guard passed.
  • One synthetic shader translated and passed SPIR-V validation for Vulkan 1.3 on each tree. The baseline read DATA1 in all eight output words. The patch read all eight expected DATA0 words and emitted 8 instead of 16 volatile LDS stores.
  • A wider semantic sweep before the input-validation adjustment ran 6,109 tests. The only failing file with SPIR-V Tools enabled hit a Windows LLVM_MC path issue. All nine tests in that file passed after normalizing the path. The final head was retested with the LDS suite and Vulkan fixture.

GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 617.14, Windows 11 build 28000. All inputs are synthetic. AMD, retail inputs and the separate legacy geometry path were outside this check.

AI-assisted: yes, Codex assisted implementation and ran the checks.

Checklist

  • Based on main (a2892784 for the baseline comparison). GitHub reports a clean merge with current main.
  • One topic.
  • No game data, keys or decryption.
  • The translator rule and verification are in the existing docs/design.md contract row.

🔄 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/966 **Author:** [@akimfomin](https://github.com/akimfomin) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `portbridge/paired-lds-data0` --- ### 📝 Commits (1) - [`9ae6f12`](https://github.com/ubiquitarianism/leonida/commit/9ae6f1253ffc45cc1ebf774dcaa630959111ccb0) rdna2spirv: keep DATA0 for equal paired LDS write offsets ### 📊 Changes **4 files changed** (+85 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+1 -1) ➕ `tests/semantic/fixtures/lds_write2_equal_offsets.asm` (+32 -0) ➕ `tests/semantic/test_lds_write2_equal_offsets.py` (+39 -0) 📝 `tools/rdna2spirv.py` (+13 -7) </details> ### 📄 Description Claimed in the coordination issue as: [SHADER-LDS-EQUAL-WRITES](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136537901) ### What and why For compute-shader `ds_write2` and `ds_write2st64` (b32 and b64), equal offsets now emit only the DATA0 store. Both operands are still validated. Distinct offsets store both values, and paired reads are unchanged. [AMD RDNA 2 ISA §10.4.3, printed p. 96](https://docs.amd.com/api/khub/documents/Et~wpu9g~Ffl7d9q0QZ~Og/content#page=104) [PortBridge](https://github.com/akimfomin/PortBridge) linked [THE-PRO-GAME’s finding in VIctory #1088](https://github.com/Marvisak/VIctory/pull/1088) to the same lowering here. The [XCL result](https://github.com/ivall/xcl/issues/42#issuecomment-7136754354) uses the same rule. ### Tested - Base `a2892784`: the hand-written fixture returned DATA1 in all five equal-offset cases, including the implicit zero-offset case. Existing paired read/write controls passed. - At `9ae6f12`, all **379 LDS semantic tests passed** without skips, including the five address cases and three malformed-operand controls. The no-game-data guard passed. - One synthetic shader translated and passed SPIR-V validation for Vulkan 1.3 on each tree. The baseline read DATA1 in all eight output words. The patch read all eight expected DATA0 words and emitted 8 instead of 16 volatile LDS stores. - A wider semantic sweep before the input-validation adjustment ran 6,109 tests. The only failing file with SPIR-V Tools enabled hit a Windows `LLVM_MC` path issue. All nine tests in that file passed after normalizing the path. The final head was retested with the LDS suite and Vulkan fixture. GPUs tested: NVIDIA RTX 4070 Ti SUPER, driver 617.14, Windows 11 build 28000. All inputs are synthetic. AMD, retail inputs and the separate legacy geometry path were outside this check. AI-assisted: yes, Codex assisted implementation and ran the checks. ### Checklist - [x] Based on `main` (`a2892784` for the baseline comparison). GitHub reports a clean merge with current `main`. - [x] One topic. - [x] No game data, keys or decryption. - [x] The translator rule and verification are in the existing `docs/design.md` contract row. --- <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#1003
No description provided.