dxil: track VOPC SDWA SDST and buffer/GWS cache barriers in reload::changes #2479
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!2479
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2479"
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 19:51 UTC · original
Decodere:fix-dxil-reload-sdwa-inv→main· +78 −4 · 1 files · 1 commits · openFix two missed invalidations in
reload::changesfor direct DXILs_load_dword*available-expression reuse:VOPCSDWA writes toSDST(SD=1) andBUFFER_GL0_INV/BUFFER_GL1_INV/DS_GWS_BARRIERcache barriers. Part of #1401. Part of #1833.What is in it
crates/xcl/src/gpu/dxil/reload.rs(changes):if scalar_out, whend.variant == rdna2::Variant::Sdwa, inspectsuper::lower::ext_encoding(d)(VOPC_VOP_SDWA_SDST_ENC): ifSD == 1andSDST < 128 && SDST != 125(NULL), ORpair(r, 2)intoregsso overwriting a cached load's base or offset SGPR invalidates subsequent repeats.S_BARRIER | S_DCACHE_INV | S_GL1_INV | BUFFER_GL0_INV | BUFFER_GL1_INV | DS_GWS_BARRIERbefore/alongside memory-writing encodings (ENC_MUBUF | ENC_MTBUF | ENC_FLAT | ENC_FLAT_GLBL | ENC_FLAT_SCRATCH | ENC_MIMG | ENC_SMEM) soENC_MUBUFcache invalidations andDS_GWS_BARRIERend available loads.crates/xcl/src/gpu/dxil/reload.rs(tests):vopc_sdwa_sdst_invalidates_address_registers: verifiesSD=1targeting base low (s4), wave64 pair overlap (s3,s8), base high (s5), andSOFFSET(s9) invalidates repeated loads, while negative controlsSD=0, SDST=4(writesVCC) andSD=1, SDST=125(NULL) preserve reuse.cache_invalidations_and_gws_barrier_end_available_loads: verifiesBUFFER_GL0_INV,BUFFER_GL1_INV, andDS_GWS_BARRIERend available loads, whileS_ICACHE_INVpreserves reuse.vopc_sdwa_sdst_reloads_updated_base_in_direct_dxil: verifies direct DXIL translation emits a second@dx.op.rawBufferLoadafterV_CMP_EQ_U32(VOPC_VOP_SDWA_SDST_ENC,SD=1, SDST=4), validates with DXC 1.9, and executes live on wave32 hardware (cleanly skipped on non-wave32/WARP adapters) confirming(s4, s12, s13) == (0x10, mem[0], mem[4]).Tested
dxil.dll1.9.2609.5, release build.reload::changesfix (onorigin/main06055a7): all 3 new tests failed (0 passed, 3 failed:BUFFER_GL0_INV,base SDST=s3, and direct DXIL11 != 12rawBufferLoads).cargo test --release -p xcl --lib -- gpu::dxil::reload::tests:: --nocapture:9 passed, 0 failed, 0 ignored(0.23 s,0skipped; live wave32 GPU execution passed).XCL_ADAPTER=warp:9 passed, 0 failed, 0 ignored(0.02 s; pure-CPU analysis, DXC 1.9 validation, andrawBufferLoadcount assertions all passed; live wave32 GPU execution cleanly skipped withno wave32).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture(RTX 4060):1416 passed, 0 failed, 46 ignoredacross37test binaries (183/183gpu::dxil::*passed;29pre-existingSKIPPEDGPU/environment checks:21no wave64,3per-lane wave32 refused,3no D3D12 debug layer,1no heap windows,1cannot disable driver cache;0skipped ingpu::dxil::reload::tests).Regression run
main:
PR:
Not tested
d3d12SDKLayers.dll.DS_GWS_BARRIER(covered at thereload::analyzelevel).AI use
reload::changesinvalidation fixes, wrote the unit and direct DXIL GPU tests, ran the test and smoke suites, and drafted this PR description.@DarkPanda69 on GitHub · 2026-11-25 20:14 UTC · original
AMD native wave64 run (listed as untested), plus an RTX 3060, paired against
mainwith the direct translator on for the whole GPU suite.Head
d423c90applied onmain6d12f58, debug, Windows 11 Pro 26200,XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu:: --test-threads=4, onmainand on this PR for each card:mainPer-test comparison: on both cards the only differences are the 3 new
reload::tests(cache_invalidations_and_gws_barrier_end_available_loads,vopc_sdwa_sdst_invalidates_address_registers,vopc_sdwa_sdst_reloads_updated_base_in_direct_dxil, all ok). No existing test changes result or skip state. The 2 RX 9070 XT failures are the AMD fuzz seeds tracked in #2115, the same onmain.Not tested:
DS_GWS_BARRIERexecuted on the GPU, the D3D12 debug layer, a title.AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
@DavidM1911 on GitHub · 2026-11-25 20:34 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!
@SlopTart on GitHub · 2026-11-25 20:37 UTC · original · edited 2026-11-25 20:47 UTC
gpu_suite (cold cache): 164 passed / 3 failed, no crashes. The three are the known baseline on this lane (seed-1003 fuzz, mad/mac contraction, and the promoted-UAV-clear driver gap, PR #2490); none caused by this PR. Notegpu_depth_buffer_created_for_unordered_access_is_placedis green on main now, #2466 did its job on this lane.Targeted run of the new non-suite tests (
vopc_sdwa_sdst_invalidates_address_registers,vopc_sdwa_sdst_reloads_updated_base_in_direct_dxil,cache_invalidations_and_gws_barrier_end_available_loads): 3 passed.@xpatfussy69x on GitHub · 2026-11-25 22:09 UTC · original
Test run on exact head
d423c90(d423c902918bcac16c8e8fe6192e85e2003c16b0, on its base06055a7), clean tree.Tested
cargo test --workspace -- --test-threads=4: 1416 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo)cargo test -p xcl --lib reload: 9 passed, 0 failedvopc_sdwa_sdst_invalidates_address_registers: ok, not skippedcache_invalidations_and_gws_barrier_end_available_loads: ok, not skippedvopc_sdwa_sdst_reloads_updated_base_in_direct_dxil: ok, not skippedRegression run (60 s, default settings)
main:
this PR:
No crash or device removal; frames 104 % of
main's, peak commit 100 %.Not tested
XCL_DIRECT_DXIL=1: a regression check onlymain(tested on its own base; it merges intoe1d84b7without conflicts)AI use
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.