You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shaders: XCL_DIRECT_DXIL=all ignores split_wave64 / upper_lanes for wave64 VS/PS (poisoning split=1 cache), and XCL_DXIL_NO_OPT bypasses cache_allowed() #1895
Static audit on main @ 689f2db found two shader-routing / cache-correctness bugs in crates/xcl/src/gpu/recomp/pso.rs and crates/xcl/src/gpu/dxil/coverage.rs:
1. XCL_DIRECT_DXIL=all ignores split_wave64 / upper_lanes for wave64 VS/PS and caches broken DXIL under the split=1 cache key
Where:
crates/xcl/src/gpu/recomp/pso.rs:365-373 (compile_console_shader does not pass split_wave64 to direct_graphics)
crates/xcl/src/gpu/dxil/coverage.rs:254-255 (translate_mode also forces split: false for VS/PS)
Root cause: Unlike the HLSL path (recomp/emit.rs:4267) and the per-lane path (recomp/lower.rs:1100), Direct DXIL (gpu/dxil) has no upper_lanes handling for wave64 vertex/pixel shaders running on 32-lane hardware (NVIDIA, or AMD in wave32 graphics mode). When XCL_DIRECT_DXIL=all is set on a wave32 GPU (split_wave64 == true):
direct_graphics() silently translates wave64 VS/PS with split: false even when upper_lanes::analyze(&insts) finds cross-lane reads of lanes 32..63 (which WaveReadLaneAt / WaveActiveBallot cannot provide in a 32-lane graphics wave), instead of falling back to the HLSL upper_lanes path.
The resulting wave64-only DXIL is persisted into the translated disk cache under the split=1 filename (..._1.bin), poisoning the cache for wave32 GPUs.
Fix direction: Pass split_wave64 into direct_graphics() (and translate_mode()), and when wave64 && split_wave64 check upper_lanes::analyze and return Err(...) to fall back to the HLSL upper_lanes path whenever any read is non-Native (matching recomp/lower.rs:1100).
2. XCL_DXIL_NO_OPT is omitted from cache_allowed(), poisoning the translated disk cache
Root cause:Module::optimize() reads XCL_DXIL_NO_OPT (phi, cse, dce, or all) to skip optimization passes for bisecting, but cache_allowed() does not check XCL_DXIL_NO_OPT (and identity() does not include it). Running once with XCL_DXIL_NO_OPT=all writes unoptimized DXIL into the persistent disk cache under the normal identity, silently serving unoptimized shaders on all subsequent normal runs. (Same class of bug as #1409 for XCL_SAFE_BARRIER=0.)
Fix direction: Add "XCL_DXIL_NO_OPT" to the list of env vars in cache_allowed() (pso.rs:561), and add a unit test in pso.rs verifying cache_allowed returns false when XCL_DXIL_NO_OPT is set.
AI use
Antigravity (Gemini 4 Neon): static code audit on main @ 689f2db and issue drafting.
Taking #1895: respect split_wave64 / upper_lanes under XCL_DIRECT_DXIL=all for wave64 VS/PS and enforce cache_allowed() when XCL_DXIL_NO_OPT is set, with cache/translator regression tests.
Status check on current main (568e7db), in case it saves someone a re-audit:
crates/xcl/src/gpu/recomp/pso.rs:760fn direct_graphics(blob, stage, sampler_base, windows) still takes no split_wave64, and line 767 still builds KernelOptions { wave64: ..., split: false, ... }.
the cache key does carry split, so the "poisoning" half is unchanged until that is passed through.
So as of 568e7db the split half of #1895 is still present in the tree; #1913/#2252 are the fix and are still open. The cache half is covered by #2013, as @oni-swr said.
No action wanted from this comment - just recording the exact line and the state, so the next person reading the issue does not have to grep it again. I will re-check after #2252 lands.
Activity
Wave 9: integrate xcl-dev#1913 (guard wave64 graphics direct DXIL, fixes
Shaders: bypass caches when DXIL optimization is disabled (#1895)
oni-swr commentedon Nov 25, 2026
Taking #1895: respect split_wave64 / upper_lanes under XCL_DIRECT_DXIL=all for wave64 VS/PS and enforce cache_allowed() when XCL_DXIL_NO_OPT is set, with cache/translator regression tests.
dxil: refuse wave64 VS/PS with upper-lane reads in 32-lane mode (xcl-…
oni-swr commentedon Nov 25, 2026
Releasing our claim on #1895: PR #1913 / #2252 and merged PR #2013 already cover both items.
YaBulochka commentedon Nov 25, 2026
Status check on current
main(568e7db), in case it saves someone a re-audit:crates/xcl/src/gpu/recomp/pso.rs:760fn direct_graphics(blob, stage, sampler_base, windows)still takes nosplit_wave64, and line 767 still buildsKernelOptions { wave64: ..., split: false, ... }.split, so the "poisoning" half is unchanged until that is passed through.So as of
568e7dbthe split half of #1895 is still present in the tree; #1913/#2252 are the fix and are still open. The cache half is covered by #2013, as @oni-swr said.No action wanted from this comment - just recording the exact line and the state, so the next person reading the issue does not have to grep it again. I will re-check after #2252 lands.
dxil: refuse wave64 VS/PS with upper-lane reads in 32-lane mode (xcl-…