Repository navigation
Conversation
…hanges reload::changes previously missed two classes of invalidations for cached s_load_dword* available-expression reuse: - VOPC SDWA with SD=1 writes SDST from its extension word (VOPC_VOP_SDWA_SDST_ENC) instead of VCC, which was invisible to d.enc (ENC_VOPC). When such a compare overwrote a cached load's base or offset SGPR, the next s_load_dword* stayed available and returned stale data. Check super::lower::ext_encoding(d) when d.variant == Variant::Sdwa and OR pair(r, 2) into regs whenever SD == 1 and SDST < 128 (excluding NULL = 125). - BUFFER_GL0_INV and BUFFER_GL1_INV use ENC_MUBUF (where writes is false) and DS_GWS_BARRIER was omitted from the barrier list, so none of them invalidated cached scalar loads. Match all cache-invalidation/barrier instructions alongside memory-writing encodings. Add unit tests covering VOPC SDWA SDST (base lo/hi, wave64 pair overlap, SOFFSET, SD=0 and SDST=NULL negative controls), BUFFER_GL0_INV / BUFFER_GL1_INV / DS_GWS_BARRIER (and S_ICACHE_INV control), and an end-to-end direct DXIL disassembly + wave32 GPU execution test. Part of xcl-dev#1401 Part of xcl-dev#1833 Assisted-by: Google Antigravity (Gemini 4 Neon)
|
AMD native wave64 run (listed as untested), plus an RTX 3060, paired against Head
Per-test comparison: on both cards the only differences are the 3 new Not tested: |
…#2127, xcl-dev#2476, xcl-dev#2479, xcl-dev#2467, xcl-dev#2444, xcl-dev#2447, xcl-dev#2448 Integrates compositor RT tracking fix (xcl-dev#2480), split shader cache budget (xcl-dev#2475), foreign-thread deferred release (xcl-dev#2474), Wine 4-thread DXC cap (xcl-dev#2127), DXIL feature/reload fixes (xcl-dev#2476, xcl-dev#2479), DXC loader cleanup (xcl-dev#2467), console xcl-dev#14 null ppv guard (xcl-dev#2444), root-sig flag stripping (xcl-dev#2447), and two-pass stream canonicalization (xcl-dev#2448). Assisted-by: Antigravity (Gemini 4 Neon)
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
|
bmjask
left a comment
There was a problem hiding this comment.
No concrete source-level defect found. SDWA/SDST and pair(r,2) invalidation match lowering semantics, and new cache-invalidating names are conservative; coverage includes aliases, GWS, and Direct-DXIL wave32 execution. Current Windows CI is green. Residual disclosed gap: no native-wave64 live run or hardware DS_GWS_BARRIER execution. I found no blocker.
|
Test run on exact head Tested
Regression run (60 s, default settings) main: this PR: No crash or device removal; frames 104 % of Not tested
AI use
|
Fix 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.