mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1004] [MERGED] rdna2spirv: SDWA selects of v_{add,sub,subrev}_co_ci_u32 go to the sources, not the carry-out (SHADER-SDWA-CARRY-SEL) #1042
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1042
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1004
Author: @thesubtleties
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:sdwa-carry-sel📝 Commits (1)
073b8bbrdna2spirv: SDWA selects of v_{add,sub,subrev}_co_ci_u32 go to the sources, not the carry-out (SHADER-SDWA-CARRY-SEL)📊 Changes
3 files changed (+113 additions, -1 deletions)
View changed files
📝
docs/design.md(+1 -1)➕
tests/semantic/test_sdwa_carry.py(+110 -0)📝
tools/rdna2spirv.py(+2 -0)📄 Description
Claimed in the coordination issue as: SHADER-SDWA-CARRY-SEL
What and why
v_add_co_ci_u32_sdwa,v_sub_co_ci_u32_sdwaandv_subrev_co_ci_u32_sdwaprint the carry-out between the destination and the sources (v4, vcc_lo, v2, v3, vcc_lo). The SDWA setup assumed the sources start at operand 1, sosrc0_selwent to the carry-out (and was lost) andsrc1_selwent to src0. Any non-DWORD source selector gave a wrong value with no error. The selects now go to operands 2 and 3 for the printed form.Tested
tests/semantic/test_sdwa_carry.py(all 49 selector pairs per op in wave32, a sample in wave64,sext(),dst_sel): 164 failures without the fix, all pass with it.scripts/run_semantic_tests.pyon base3ed8e50b: 470 files / 6165 tests, 0 failed; with the fix 471 / 6170, 0 failed. Rebased since; the SDWA and carry tests were rerun after the rebase.run_gpu_tests.pyon3ed8e50b, per-test results identical with and without the fix: 201/252 (3080 native), 233/252 (3080,LEONIDA_W64_EMULATE=1), 234/252 (gfx1036 RADV); the only failures are the two known tfe fixtures (#31). No GPU fixture uses the new path, so these are regression checks.GPUs tested: NVIDIA RTX 3080 (620.73.04) and AMD RDNA2 iGPU gfx1036 (RADV, Mesa 26.3.1), CachyOS Linux 7.3.5
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.