Repository navigation
rdna2spirv: write out a carry-out subtract of a register from itself (AMD Windows driver crash) (SHADER-SUB-CO-SAME) - #930
Merged
aslan2142 merged 1 commit intoNov 24, 2026
Conversation
…(AMD Windows driver crash) v_sub_co_u32 / v_subrev_co_u32 and their _ci_ forms with the same operand twice were translated to OpISubBorrow %x %x. AMD's Windows driver dies with an access violation (0xC0000005 in amdvlk64.dll, 32.0.21037.1004 and 32.0.21045.29003, gfx1036) creating a native wave64 compute pipeline in which that borrow predicates the value operand of an OpGroupNonUniformShuffle. x - x is 0 with no borrow, so these forms now emit D = 0 - carry in and borrow out = carry in, with no OpISubBorrow. Values are unchanged; other operand pairs are translated as before. Found with crosslane_fuzz.py --seed 880317 --wave 64 --w64-native --no-maskdata --dpp --ext --programs 400 on a Ryzen 9 9950X3D iGPU: programs 1 and 181 were harness errors (exit 3221225477) and now match (399 of 400 match; the other differs only in a hypothesis op, as before). - docs/design.md: contract row "Carry-out subtract of a register from itself" - tests/semantic/test_sub_co_same_operand.py: values and borrow mask in wave32 and native wave64, the emitted form with --wave64-emulate Not counted over the corpus, and two different registers holding equal values still reach OpISubBorrow. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
SweatierKey
approved these changes
Nov 24, 2026
SweatierKey
left a comment
Contributor
There was a problem hiding this comment.
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.dll pipeline-creation AV while preserving exact borrow/clamp/EXEC semantics.
AI-assisted: yes
This was referenced Nov 24, 2026
rdna2spirv: write out a carry-out subtract of a register from itself (AMD Windows driver crash)
#324
Closed
Collaborator
|
Merged. Checked locally on
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 AI-assisted (Claude Code, Claude Fable 5.2). |
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 68d1331. No conflicts; the merged tree was tested before the push (every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main alone since ProjectLeonida#930). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 24, 2026
aslan2142
pushed a commit
that referenced
this pull request
Nov 24, 2026
…from a class of its module (TEST-CI-REG-LOCAL-MIXIN) tests/test_ci_registration.py fails on main since 540d511 (the merge of #930) and passes on its parent: test_every_selected_file_exposes_a_test_to_its_runner reports tests/semantic/test_sub_co_same_operand.py as a file the semantic job collects nothing from. `python -m unittest discover -s tests/semantic -p test_sub_co_same_operand.py` runs 6 tests there. Its three TestCase classes have no test method of their own: they take them from a mixin class defined in the same file, one TestCase per wave size. defines_a_test looked at a TestCase's own body and at a base imported from another module, not at a base defined in the module. It now also counts the test* methods of the classes of the module a TestCase derives from, directly or through other classes of the module, and an imported base reached that way. unittest's loader lists a class's tests with dir(), so these are the tests it runs. The new test writes eight small modules, runs unittest discover on them once and holds the scan to what the runner collected: a mixin above the TestCase, two classes up, beside a TestCase base without tests, an imported mixin named directly and through a local class (a test each), and a base without tests, a mixin no TestCase derives from and a mixin without a TestCase (none). With main's defines_a_test put back, four of the five cases with a test fail, and so does the repository check. Over the repository at 51a6074: the scan lists the same 997 test files; of the 473 the semantic job selects, main's scan found a test in 472 and this one in 473, and test_sub_co_same_operand.py is the only file the two disagree on (none of the pytest job's 36). unittest's loader collects tests from all 473 (6191 tests, no import failure), so main's scan disagreed with the runner on that one file and this one on none. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as:
SHADER-SUB-CO-SAME(#14 (comment))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.