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
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#1895
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@microwave805 on GitHub · 2026-11-24 22:37 UTC · original
Static audit on
main @ 689f2dbfound two shader-routing / cache-correctness bugs incrates/xcl/src/gpu/recomp/pso.rsandcrates/xcl/src/gpu/dxil/coverage.rs:1.
XCL_DIRECT_DXIL=allignoressplit_wave64/upper_lanesfor wave64 VS/PS and caches broken DXIL under thesplit=1cache keycrates/xcl/src/gpu/recomp/pso.rs:365-373(compile_console_shaderdoes not passsplit_wave64todirect_graphics)crates/xcl/src/gpu/recomp/pso.rs:651-666(direct_graphicshardcodessplit: false)crates/xcl/src/gpu/recomp/pso.rs:258-263, 324-331(disk cache stores the result under{hash}_{stage}_{sampler_base}_{windows}_{split as u8}.bin)crates/xcl/src/gpu/dxil/kernel.rs:390(let split = split && !gfx;)crates/xcl/src/gpu/dxil/coverage.rs:254-255(translate_modealso forcessplit: falsefor VS/PS)recomp/emit.rs:4267) and the per-lane path (recomp/lower.rs:1100), Direct DXIL (gpu/dxil) has noupper_laneshandling for wave64 vertex/pixel shaders running on 32-lane hardware (NVIDIA, or AMD in wave32 graphics mode). WhenXCL_DIRECT_DXIL=allis set on a wave32 GPU (split_wave64 == true):direct_graphics()silently translates wave64 VS/PS withsplit: falseeven whenupper_lanes::analyze(&insts)finds cross-lane reads of lanes 32..63 (whichWaveReadLaneAt/WaveActiveBallotcannot provide in a 32-lane graphics wave), instead of falling back to the HLSLupper_lanespath.split=1filename (..._1.bin), poisoning the cache for wave32 GPUs.split_wave64intodirect_graphics()(andtranslate_mode()), and whenwave64 && split_wave64checkupper_lanes::analyzeand returnErr(...)to fall back to the HLSLupper_lanespath whenever any read is non-Native(matchingrecomp/lower.rs:1100).2.
XCL_DXIL_NO_OPTis omitted fromcache_allowed(), poisoning the translated disk cachecrates/xcl/src/gpu/recomp/pso.rs:560-573(cache_allowed)crates/xcl/src/gpu/dxil/module/opt.rs:352(std::env::var("XCL_DXIL_NO_OPT"))Module::optimize()readsXCL_DXIL_NO_OPT(phi,cse,dce, orall) to skip optimization passes for bisecting, butcache_allowed()does not checkXCL_DXIL_NO_OPT(andidentity()does not include it). Running once withXCL_DXIL_NO_OPT=allwrites 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#1409forXCL_SAFE_BARRIER=0.)"XCL_DXIL_NO_OPT"to the list of env vars incache_allowed()(pso.rs:561), and add a unit test inpso.rsverifyingcache_allowedreturnsfalsewhenXCL_DXIL_NO_OPTis set.AI use
main @ 689f2dband issue drafting.github-bot referenced this issue2026-11-26 05:24:37 +00:00
@oni-swr on GitHub · 2026-11-25 11:15 UTC · original
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.
@oni-swr on GitHub · 2026-11-25 12:02 UTC · original
Releasing our claim on #1895: PR #1913 / #2252 and merged PR #2013 already cover both items.
@YaBulochka on GitHub · 2026-11-25 12:29 UTC · original
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.
github-bot referenced this issue2026-11-26 06:18:30 +00:00
github-bot referenced this issue2026-11-26 07:52:45 +00:00