Repository navigation
Conversation
…r_uses Track implicit destination reads for RDNA2 read-modify-write instructions whose ISA spec marks VDST/SDST as output-only: - In vgpr_uses(), include V_FMAC_F16, V_PK_FMAC_F16, V_DOT2C_F32_F16, and V_DOT4C_I32_I8 alongside V_FMAC_F32 / V_MAC_F32 / V_FMAC_LEGACY_F32 so partition::classify preserves accumulator taint. - In sgpr_uses(), include S_CMOV* (S_CMOV_B32/B64, S_CMOVK_I32), S_ADDK_I32, S_MULK_I32, and S_BITSET0/1_B32/B64 (matching x64_masks::keeps_destination) so mesh_wave::analyze preserves mask taint on RMW scalar destinations (while keeping NULL 125 excluded). Part of xcl-dev#336 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
rdna2.rs analysis soundness, verbatim from upstream head 5ea738c: vector FMA/DOT accumulators (V_FMAC_F16, V_PK_FMAC_F16, V_DOT2C_F32_F16, V_DOT4C_I32_I8) read VDST; scalar conditional/RMW ops (S_CMOV*, S_ADDK_I32, S_MULK_I32, S_BITSET0/1_B32/B64) read SDST (NULL 125 stays excluded). Feeds partition/mesh_wave/x64 taint soundness. Adds the three upstream regression tests verbatim (all fail pre-fix).
|
Nothing has happened on this PR for 3 days, so it is marked |
|
No open PR changes AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
merge-check claim |
|
merge-check |
What 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.