Repository navigation
rdna2spirv: write out a carry-out subtract of a register from itself (AMD Windows driver crash) (OLD-10058) - #1093
LewisCodesWebsites wants to merge 1 commit into
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>
|
Checked a17d0e7 merged into current
That SDWA check turned up a separate bug on main, not caused by this PR: for AI-assisted (Claude). |
KernelSmoker
left a comment
There was a problem hiding this comment.
Reviewed exact head a17d0e7. The focused semantic suite passed 6/6; generated same-operand wave32 SPIR-V passed spirv-as and spirv-val for Vulkan 1.2. I also built this PR's vk_compute_test target and ran the synthetic wave32 shader on an NVIDIA GeForce RTX 3090 (subgroup 32). All 32 dispatched lanes / 96 output words matched the fixture: active-lane D values, carry-in borrow bits, and wave mask popcount 2. This validates the translated shader behavior on NVIDIA; it does not reproduce or validate the reported AMD Windows driver crash. PR is GitHub-mergeable at review time.
|
Recommendation: [MERGE] Reasoning: Fixes the AMD Windows driver crash by emitting Impact level: 5/10 |
|
Tested a17d0e7 applied onto main 66d4f5a on an AMD Radeon RX 7900 XT. This is a discrete RDNA3 card on the current proprietary driver, a different one from the gfx1035/gfx1036 iGPUs where the crash was measured. Setup: AMD Radeon RX 7900 XT (RDNA3, gfx1100), AMD proprietary driver 32.0.32029.2010 (26.11.2), Windows 11 build 26300, VS 2022 RelWithDebInfo, Vulkan SDK 1.4.363.0, llvm-mc 23.1.5. No game files. The PR's repro on the GPU.
The CPU check. |
Claimed in the coordination issue as: OLD-10058 (#14)
Supersedes: #324 (carries forward old PR 10058 by @wail-arch, rebased onto
main3aa9754; their commit and authorship are kept, the only change is resolving adocs/design.mdconflict by adding the new contract row next to main's current pc-tail row)What and why
v_sub_co_u32/v_subrev_co_u32(and the_ci_forms) with the same register as both sources were translated toOpISubBorrow %x %x, and AMD's Windows driver crashes (0xC0000005inamdvlk64.dll) creating a native wave64 pipeline in which that borrow predicates a subgroup shuffle. x - x is always 0 with no borrow, so this writes the result out directly. It is the same crash as my finding in #14.Tested
python -I tools/crosslane_fuzz.py --ext --dpp --wave 64 --modes native --w64-native --no-maskdata --programs 1000 --seed 20261124:maingives 6 harness errors (exit 3221225477, all inamdvlk64.dllat the same offset); this branch gives 0 (999 match, 1 hyp_only).mainand runs with 0 mismatches on this branch.tests/semantic/test_sub_co_same_operand.py: 6/6.scripts/run_semantic_tests.py tests/semantic: 6173 of 6174 pass; the one failure,test_image_cube_store_glc, fails the same way onmainon this machine (FileNotFoundErrorlaunching a tool at line 282), so it is unrelated.tests/test_docs_design_rows.py,tests/test_docs_table_rows.py,tests/test_docs_links.py,tests/test_text_write_line_endings.py: OK.GPUs tested: AMD Radeon 660M (RDNA2 iGPU, gfx1035), Adrenalin 32.0.21045.1000 (Vulkan driver 2.0.353), Windows 11 26200
AI-assisted: yes (Claude and OpenCode ran the rebase and the tests; I reviewed them)
Checklist
mainand merges cleanly.docs/design.md, with how it was confirmed.🤖 Generated with Claude Code
https://claude.ai/code/session_015pRhqKwVhndiVZH8fawThh