[PR #1026] [CLOSED] TEST-LDS-CMPST-WAIT: wait for the last LDS read in cs_lds_b64_cmpst #1063

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1026
Author: @yawn-animals
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: test-lds-cmpst-wait


📝 Commits (1)

  • 40a2b1c TEST-LDS-CMPST-WAIT: wait for the last LDS read in cs_lds_b64_cmpst

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 runtime/test/shaders/cs_lds_b64_cmpst.asm (+1 -0)

📄 Description

Claimed in the coordination issue as: TEST-LDS-CMPST-WAIT (claim).

What and why

runtime/test/shaders/cs_lds_b64_cmpst.asm reads v11 with ds_read_b32 and uses it in the very next instruction, v_xor_b32_e32 v16, v10, v11, with no s_waitcnt lgkmcnt(0) in between.

  • Translated: the SPIR-V has no such race, so the GPU suite passes.
  • Native: the fixture's header derives its words from the RDNA2 ISA, so it should also be valid as native code. On real RDNA2 the v_xor reads v11 before the LDS load returns, using the stale value from the ds_write2st64_b64 block. Word 7 becomes 0x2468ABCD ^ 0x22220002 = 0x064AABCF instead of 0x3579BADC.

This adds the one missing wait. The expected output and the translator are unchanged. A scan of the fixture found no other LDS read result used before a wait.

Tested

RX 6800 XT (gfx1030), Arch Linux, kernel 7.3.4, Mesa 26.3.1. This repository's main is fce586c. The fixture blob is 0998d857 before and 400ff65c after, identical to LeonidaReforge's before and after (LeonidaReforge/Leonida#166).

before (main) after (this PR)
native, this tree's tools/hw_oracle (Linux DRM launcher), the fixture body as a raw kernel* word 7 0x064aabcf, DIFF 0x3579badc, MATCH (all 8 words)
translated, this tree's scripts/run_gpu_tests.py --filter cs_lds_b64_cmpst --require-pass on RADV PASS, … 0xbbbb000b 0x3579badc PASS, same words

* The only change for the raw-kernel ABI is the output store: buffer_store_dword … s[0:3] … offen is respelled as global_store_dword … s[2:3].

  • Other checks: python -I tests/test_shader_checks.py OK. The kernel log shows 0 ring timeouts and 0 page faults.
  • Translator interpreter: @akimfomin ran both versions through this repository's translator and CPU interpreter, with identical listings and all eight expected words (PortBridge PB-0019).
  • Not covered: other GPUs and the Windows launcher.

AI-assisted. Synthetic fixture only.

🤖 Generated with Claude Code


🔄 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/1026 **Author:** [@yawn-animals](https://github.com/yawn-animals) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `test-lds-cmpst-wait` --- ### 📝 Commits (1) - [`40a2b1c`](https://github.com/ubiquitarianism/leonida/commit/40a2b1c6b60aac005cbe2ecaf4b1130a630d6494) TEST-LDS-CMPST-WAIT: wait for the last LDS read in cs_lds_b64_cmpst ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/test/shaders/cs_lds_b64_cmpst.asm` (+1 -0) </details> ### 📄 Description Claimed in the coordination issue as: TEST-LDS-CMPST-WAIT ([claim](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7138548249)). ### What and why `runtime/test/shaders/cs_lds_b64_cmpst.asm` reads `v11` with `ds_read_b32` and uses it in the very next instruction, `v_xor_b32_e32 v16, v10, v11`, with no `s_waitcnt lgkmcnt(0)` in between. - **Translated:** the SPIR-V has no such race, so the GPU suite passes. - **Native:** the fixture's header derives its words from the RDNA2 ISA, so it should also be valid as native code. On real RDNA2 the `v_xor` reads `v11` before the LDS load returns, using the stale value from the `ds_write2st64_b64` block. Word 7 becomes `0x2468ABCD ^ 0x22220002 = 0x064AABCF` instead of `0x3579BADC`. This adds the one missing wait. The expected output and the translator are unchanged. A scan of the fixture found no other LDS read result used before a wait. ### Tested RX 6800 XT (gfx1030), Arch Linux, kernel 7.3.4, Mesa 26.3.1. This repository's `main` is `fce586c`. The fixture blob is `0998d857` before and `400ff65c` after, identical to LeonidaReforge's before and after (LeonidaReforge/Leonida#166). | | before (`main`) | after (this PR) | |---|---|---| | native, this tree's `tools/hw_oracle` (Linux DRM launcher), the fixture body as a raw kernel* | word 7 `0x064aabcf`, DIFF | `0x3579badc`, MATCH (all 8 words) | | translated, this tree's `scripts/run_gpu_tests.py --filter cs_lds_b64_cmpst --require-pass` on RADV | PASS, `… 0xbbbb000b 0x3579badc` | PASS, same words | \* The only change for the raw-kernel ABI is the output store: `buffer_store_dword … s[0:3] … offen` is respelled as `global_store_dword … s[2:3]`. - **Other checks:** `python -I tests/test_shader_checks.py` OK. The kernel log shows 0 ring timeouts and 0 page faults. - **Translator interpreter:** @akimfomin ran both versions through this repository's translator and CPU interpreter, with identical listings and all eight expected words ([PortBridge PB-0019](https://akimfomin.github.io/PortBridge/cases/pb-0019.html)). - **Not covered:** other GPUs and the Windows launcher. AI-assisted. Synthetic fixture only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:19:58 +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#1063
No description provided.