rdna2spirv: write out a carry-out subtract of a register from itself (AMD Windows driver crash) (SHADER-SUB-CO-SAME) #930
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!930
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/930/head"
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?
@fin-github on GitHub · 2026-11-24 15:17 UTC · original
fin-github:shader/sub-co-same-operand→main· +216 −11 · 3 files · 1 commits · merged 2026-11-24 22:12 UTCClaimed in the coordination issue as:
SHADER-SUB-CO-SAME(#14)Supersedes draft #324, carried over from the original repository. This is the same commit rebased onto current
main, with the original author (Wail) kept andgit cherry-pick -xrecording where it came from. The change and its explanation are theirs; see #324 for the original description.Rebase note: one conflict in
docs/design.md, wheremainhad rewritten the neighbouring push-constant row. I keptmain's row and inserted the new carry-out row before it.Tested
tests/semantic/test_sub_co_same_operand.py: 6 tests pass.python -I scripts/run_semantic_tests.py tests/semantic: 466 files, 6114 tests, 0 failed.crosslane_fuzz.py --seed 880317 --wave 64 --w64-nativeon AMD's proprietary Windows driver 25.30, Ryzen 5 7600X iGPU, gfx1036) needs llvm-mc with the AMDGPU target, which isn't installed on this machine yet. I'll post the before/after result here.python -I scripts/check_no_game_data.pyon the changed files: clean.Windows 11 (10.0.26200), Python 3.14.4. No game files, nothing online.
AI-assisted (Claude Code): rebasing, conflict resolution and test runs.
@SweatierKey on GitHub · 2026-11-24 15:35 UTC · original · approved these changes
Independent verification on
origin/main@a28927849:tests/semantic/test_sub_co_same_operand.py(LEONIDA_REQUIRE_SPIRV_TOOLS=1):6/6PASS (wave32, native wave64,--wave64-emulate; with and withoutclamp; verifies noOpISubBorrowis emitted for same-register operands and distinct equal-value registers still useOpISubBorrow).tests/semantic/test_carry_exec_mask.py(LEONIDA_REQUIRE_SPIRV_TOOLS=1):9/9PASS.spirv-as --target-env vulkan1.3+spirv-val --target-env vulkan1.3:24/24PASS across all 4 ops (v_sub_co_u32,v_subrev_co_u32,v_sub_co_ci_u32,v_subrev_co_ci_u32) ×{clamp=False, True}×{wave32, wave64-native, wave64-emulate}.tests/test_docs_links.py:16/16PASS;scripts/check_no_game_data.py: clean.Clean workaround for the
amdvlk64.dllpipeline-creation AV while preserving exact borrow/clamp/EXEC semantics.AI-assisted: yes
@aslan2142 on GitHub · 2026-11-24 22:12 UTC · original
Merged. Checked locally on
main4a50cafc7+474dbe2be:SHADER-SUB-CO-SAMEwas posted at 15:02 UTC, before this PR, and is unedited. #739 and #1093 carried the same patch and were closed as duplicates of this one.x - xthe difference is 0 with no borrow, so D = 0 - carry in and the borrow out is the carry in. That is what the general path computes, written withoutOpISubBorrow %x %x.tests/semantic/test_sub_co_same_operand.py: againstmain's translator it fails (6 tests, 24 failures); with this PR it passes (6 tests).test_docs_*files andcheck_no_game_data.pyon the three changed files. The contract row is indocs/design.md.One open point, moved here from #739: snain0511's minimal repro does not crash the driver on the base translator either, so the exact shape that crashes
amdvlk64.dllis still not reproduced. If you have it, a note here would help.AI-assisted (Claude Code, Claude Fable 5.2).