mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1118] [MERGED] rdna2spirv: redirect absent subgroup lanes before OpGroupNonUniformShuffle in ds_permute (OLD-9829) #1153
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#1153
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/1118
Author: @ambroseautomation
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:carry/old-9829-ds-permute-guard📝 Commits (1)
2d4dce4rdna2spirv: redirect absent subgroup lanes before OpGroupNonUniformShuffle in ds_permute📊 Changes
2 files changed (+38 additions, -4 deletions)
View changed files
📝
tests/semantic/test_ds_permute.py(+30 -0)📝
tools/rdna2spirv.py(+8 -4)📄 Description
Claimed in the coordination issue as: OLD-9829 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140912852)
What and why
Carries forward
old-pr/9829(draft #97, original commit authorLewandoxpreserved; indexed in #17), rebased cleanly onto currentmain.Fixes undefined behavior in
ds_permute(tools/rdna2spirv.py): previously,OpGroupNonUniformShufflereceived raw source lane IDs even for absent invocations in partial waves, masking the result only afterward. In SPIR-V/Vulkan, shuffling from an absent invocation is undefined behavior even if the result is masked. This change redirects absent source lanes to the current invocation's own lane viaOpSelectgated byOpGroupNonUniformBallotBitExtractbeforeOpGroupNonUniformShuffle, matchingds_lane_read.Adds
test_shuffles_redirect_absent_lanes_via_ballot_selectintests/semantic/test_ds_permute.pycovering compute wave32, compute wave64, pixel shaders, and a 7-lane partial-wave execution check.Tested
python -m unittest discover -s tests/semantic -p test_ds_permute.py -v: 7 tests, OK.python -I scripts/run_semantic_tests.py tests/semantic: 470 files, 6,169 tests, 0 files failed.python -m compileall -q make_game.py tools tests: exit 0.python -I scripts/check_no_game_data.py tools/rdna2spirv.py tests/semantic/test_ds_permute.py: exit 0 (no game data).GPUs tested: n/a (CPU SPIR-V interpreter semantic suite on Windows 11 Pro 64-bit, Python 3.12.10)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — UB guard on existingds_permuterule)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.