Recompiler: include RMW destination reads in rdna2::vgpr_uses and sgpr_uses #2134
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!2134
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2134"
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?
@Decodere on GitHub · 2026-11-25 05:42 UTC · original
Decodere:fix-336-rdna2-rmw-uses→main· +124 −1 · 1 files · 1 commits · openWhat is in it
Tracks implicit read-modify-write (RMW) destination reads in
rdna2::vgpr_uses()andrdna2::sgpr_uses()(crates/xcl/src/gpu/rdna2.rs) for RDNA2 instructions whose ISA table marksVDST/SDSTasinput: false, output: true:vgpr_uses(): extends the RMW accumulator list (V_FMAC_F32/V_MAC_F32/V_FMAC_LEGACY_F32) to includeV_FMAC_F16,V_PK_FMAC_F16,V_DOT2C_F32_F16, andV_DOT4C_I32_I8. Previously,recomp::partition::classifywipedLANE_IDtaint accumulated intoVDSTby those four instructions and falsely classified wave-cut-dependent shaders asTier::Exact. (V_WRITELANE_B32is intentionally not added, preservingmesh_wave.rs'svgpr_reads.first() == Noneexpectation.)sgpr_uses(): appendswtorforS_CMOV*(S_CMOV_B32,S_CMOV_B64,S_CMOVK_I32),S_ADDK_I32,S_MULK_I32,S_BITSET0_B32,S_BITSET0_B64,S_BITSET1_B32, andS_BITSET1_B64(matchingx64_masks::keeps_destination, withNULL125already excluded fromw). Previously,recomp::mesh_wave::analyzewiped mask taint onSDSTacross those scalar RMW ops and dropped mask-derivedS_CBRANCH_SCC*branches frommask_scc_branches.gpu::rdna2::testscovering directvgpr_uses(all 4 vector accumulators + negative controls includingV_DOT2_F32_F16,V_ADD_NC_U32,V_WRITELANE_B32), directsgpr_uses(all 9 scalar RMW ops,NULL125, and plain overwrites), and end-to-end taint propagation throughrecomp::partition::classifyandrecomp::mesh_wave::analyze.Part of #336
Tested
Environment: Windows 11 Home 26200, Intel Core i5-11400F, 32 GB RAM, NVIDIA GeForce RTX 4060 8 GB (driver 621.14, wave32), Rust 1.100.0, DXC
1.9.2609.5(01b62ad4).cargo test -j 4 -p xcl --lib gpu::rdna2::tests::rmw_ -- --nocapture): 0 passed, 3 failed (V_FMAC_F16omittedVDSTfromvgpr_usesreads,S_ADDK_I32omittedSDSTfromsgpr_usesreads, andpartition::classifyreturnedTier::ExactonV_MBCNT_LO_U32_B32->V_FMAC_F16->EXP).gpu::rdna2::tests20 passed / 0 failed (debug &--release),gpu::recomp::partition::tests44 passed / 0 failed,gpu::recomp::mesh_wave::tests13 passed / 0 failed (pure CPU tests, CI WARP-safe).cargo build --release --workspaceandcargo test --release --workspace -- --test-threads=4 --nocapture): 1,157 passed, 0 failed, 46 ignored across 21 test binaries (1101inxcllib,56across the remaining 20 binaries), with 27SKIPPEDlines on this RTX 4060:no wave64(RTX 4060 is wave32-only)per-lane form: refused(wave32 f16 arithmetic, f16 packed, f32 conversions)no d3d12SDKLayers.dll/no D3D12 debug layercannot disable the driver cache(Windows Developer Mode not enabled)no heap windowsRegression run
Paired 60 s runs via
scripts/smoke.ps1on cleanorigin/main(6020a33b) and clean PR head (5ea738c9):Main (
6020a33b16ba2de25b3aef5947552f2dc1831f09):PR (
5ea738c9377b677733621fa33e85f11f386b962c):Not tested
no wave64skips on RTX 4060), D3D12 debug layer tests (2 skips withoutd3d12SDKLayers.dll), driver cache disable toggle (1 skip without Windows Developer Mode), and heap-window OOM fallback (1 skip withoutXCL_HEAP_WINDOWS).title: 29640639(andpartition::classify/mesh_wave::analyzeare analysis passes not yet wired into runtime translation).AI use
Google Antigravity (Gemini 4 Neon) wrote the
rdna2::vgpr_uses/sgpr_usesfixes, unit tests, and this PR description. All pre-fix/post-fix unit tests, full release workspace tests, paired 60 s smoke runs, andscripts/pr_check.py --localvalidation were run locally on this machine.@DavidM1911 on GitHub · 2026-11-25 06:32 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
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.