DXIL: fix compact SGPR liveness for RMW/CMOV SALU and Wave32 masks #2604
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2604
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2604"
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?
@AlpPesen on GitHub · 2026-11-26 01:27 UTC · original
AlpPesen:amd-dev/fix-compact-sgpr-liveness→amd-dev· +66 −9 · 1 files · 1 commits · openFixes two SGPR liveness bugs in
amd-dev's compact DXIL micro-block emitter (crates/xcl/src/gpu/dxil/compact.rs):use/ killed indef:inst_sreg_scc_use_defonly treatedS_CMOVK_I32as a conditional write. Inrdna2_spec.rs,S_CMOV_B32,S_CMOV_B64,S_ADDK_I32,S_MULK_I32,S_BITSET0_B32/B64, andS_BITSET1_B32/B64declareSDSTwithinput: false, output: true, so predecessor micro-blocks could elide storingSDSTto its alloca slot and feed stale/zero data into the successor.s[v + 1]: VALU mask writers (V_CMP_*,V_ADD_CO_*, etc.) declaresize: 64inrdna2_spec.rs, but in Wave32 (!wave64) they only write the low SGPR and leaves[v + 1]intact.What is in it
lw.wave64intocompute_live_outandinst_sreg_scc_use_defincrates/xcl/src/gpu/dxil/compact.rs.S_CMOV*as conditional writes (addSDSTtou, omit fromdef) andS_ADDK_I32/S_MULK_I32/S_BITSET{0,1}_B{32,64}as read-modify-write (addSDSTto bothuanddef).defwidth to 1 SGPR for non-S_*64-bit mask outputs when!wave64.cmov_and_rmw_salu_read_sdst_and_wave32_valu_keeps_hi_sgprincompact::liveness_tests.Tested
rustc 1.100.0, DXC1.9.2602.17.cargo test -p xcl --lib gpu::dxil::compact: 12 passed, 0 failed, 0 ignored, 0 skipped.Not tested
Regression run
AI use
amd-devcompact.rsliveness, implemented the fix and unit test, ran the tests and pairedscripts/smoke.ps1runs, and drafted this PR description.@DavidM1911 on GitHub · 2026-11-26 01:56 UTC · original
Verification on RTX 3060 Ti (Windows 11), head merged with current
main:cargo test -p xcl --lib: the parallel run aborts (0xc0000409) and the--test-threads=1rerun finishes with 10 real failures (1528 passed / 10 failed / 27 ignored):Note the branch carries ~19 commits on top of
main(stacked work incl. the frame-wait-window, sparse lazy-commit and texture-cache changes), so the failures may belong to an earlier layer rather than the compact-SGPR fix itself — but the merged head does not pass as it stands.— Devin
@DarkPanda69 on GitHub · 2026-11-26 02:00 UTC · original
NVIDIA wave32-only run (listed as untested), plus an RX 9070 XT: the new test passes on both, and nothing else changes against
amd-devin the direct-DXIL GPU suite.Head
281d8f0applied onamd-devb5c0275, debug, Windows 11 Pro 26200,XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4onamd-devand with the PR, card chosen withXCL_ADAPTER:amd-devOn both cards, the only result change is the new
cmov_and_rmw_salu_read_sdst_and_wave32_valu_keeps_hi_sgpr(ok), with no new skips. All the failures are the same onamd-devwithout this PR:dispatch_chain_native_wave64_builds_whole,a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier,f32_programs_on_the_gpu;gpu_fract_f32_edges;fuzz_validate_and_gpu_1(#2115),gpu_f32_compares_with_nan,gpu_float_compares_random.Not tested: Intel, Linux / Wine, a title.
AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.