xcl shaders --precompile --only cs --pipelines: access violation in dxcompiler.dll with parallel DXC compiles, not with XCL_DXC_THREADS=1 #2751
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#2751
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?
@KOLESNiii on GitHub · 2026-11-26 10:09 UTC · original
What happens
On the retail pack (26,503 records),
xcl shaders shaders.rpf --precompile --only cs --pipelinesends twice in a row with0xc0000005insidedxcompiler.dllat the same offset. It is not the out-of-memory abort of #1598 (LLVM ERROR: out of memory,0xc0000409). Commit was not sampled during runs 1 and 2; in run 3 it stayed at half the limit (below).23200/26503 (8981 s)0xc0000005,dxcompiler.dll+0xc387723200/26503 (47 s)XCL_DXC_THREADS=123600/26503 (1754 s)Application log, both crashes: faulting module
dxcompiler.dll1.9.2609.5 (time stamp0x6aba15db), exception0xc0000005, fault offset0x00000000000c3877.Run 3 (one DXC thread) compiled every compute record from 22,158 to 23,620 without an error, including the window where runs 1 and 2 crashed. System commit peaked at 25.0 GB of a 50.0 GB limit, with ~17 GB of RAM available (sampled every 10 s).
Where
Records are claimed in pack order (an atomic counter in
shaders::precompile), so the window is the same each run. Around 23,200 the progress count is the record index (checked in run 3's per-record log), and both crashes came after23200/and before23400/was printed. With 13 translating threads, the DXC compile that faulted was one of records ~23,150–23,413: 271 compute records, mostlyscattering_transmittance_system(129),rtdirectionalshadows(40),shadowmask(32),ptx_prerender(18),ShallowWaterSim(17). Which compiles run at the same time is not deterministic: completion order depends on the 13 translating threads, 11 DXC threads and 4 pipeline threads.Because every record in that window compiles alone, this looks like a fault that needs concurrent DXC compiles. It is not proven yet, and the rest of the pack (23,620–26,503) has not been compiled. I found no other report of a fault inside
dxcompiler.dll: #1487's one symbolized access violation is in a test fixture's fence, and #688 gives each compiler thread its own heap for speed, not for a crash. Whether #688 changes this one is untested.To reproduce, the DXIL cache must not already hold these records (run 3 filled it), so set
XCL_DXIL_CACHEto an empty folder.--limitcounts from record 0, so for now that means the whole pack up to ~23,400.Setup
5f61e93:maine1d84b7plus three D3D12.X mirror-sync commits that the precompile path does not run; run 3 also had a local per-record log line inshaders::precompileXCL_DXC_DIR), 11 DXC threads by default, 4 memory windowsNot checked
XCL_DXC_PROCESS=1(#1638)AI use
Claude Code (Claude Opus 5.5) ran the precompiles and the single-thread diagnostic, read the crash entries, and wrote this report.
@KOLESNiii on GitHub · 2026-11-26 12:10 UTC · original
Update: where it faults, and a correction to the report above
The fault, symbolized. With the PDB from the DXC v1.9.2609 release (
pdb_2026_09_29.zip; dbghelp loads it only under the name the DLL records,dxcompiler_full.pdb),dxcompiler.dll+0xc3877is inllvm::Use::getUser, in its inlinedgetImpliedUserloop:The loop walks a
User'sUsearray 24 bytes at a time until it finds a stop tag. It runs into an unmapped page only when the memory it walks has no stop tags (zeroed or released), so DXC dereferenced aUseof aUserthat had already been freed: a dangling pointer inside DXC's IR. The WER reports of both crashes have no dump and no stack, and the release PDB has no line numbers, so the caller is not known yet.XCL's use of DXC. Each
xcl-dxc-*pool thread creates and keeps its ownIDxcCompiler3(thread-local), and every compile's objects are created, used and released on that thread; no DXC object crosses threads. Upstream calls this supported (microsoft/DirectXShaderCompiler#8259: separate instances "can be used simultaneously"), though they recommend processes. In this command the only other caller ofdxcompiler.dllis the validator inmodule/split.rs: a compute program of more than 8 MB of HLSL takes the direct translator, which on a 32-lane GPU can split it and validates each piece on the translating thread.What was running at the crashes (from cache file times):
.dxil+ translation entries) and driver PSO blobs were written.rtdirectionalshadows, 6.7–7.4 MB of HLSL each, just under the 8 MB limit, so DXC compiles them at-O1:CS_RTShadowTrace32HQ_TiledFarOnly(df45a39c275d0db5)CS_RTShadowTrace32TemporalHQ_TiledFarOnly(f9d73adcc1ad69ef)CS_RTShadowTrace32TemporalHQ_OneOver2RPP_TiledFarOnly(7b468aa4210b1810)Correction. Run 3 differed from runs 1 and 2 in two ways, not one: one DXC thread, and all its direct-translator programs came from the translation cache, so the split validator never ran. "Not with
XCL_DXC_THREADS=1" is therefore not yet evidence that the fault needs concurrent compiles.Next. Compile the three programs' HLSL with the same arguments (
-E main -T cs_6_6 -HV 2021 -O1) together and alone, in threads of one process and in separatedxc.exeprocesses, outside XCL, and under full page heap to catch a use-after-free with one thread and get the freeing stack.Claude Code (Claude Opus 5.5) symbolized the offset, read the code and the cache timeline, and wrote this comment.
@mokkamokacaffe on GitHub · 2026-11-26 12:12 UTC · original
#1638 now has a clean rebase onto current
mainfor testing:e8f0c3853b74dc1d866cacc9a4366746d0429945, branchmokkamokacaffe:shaders/rebase-dxc-worker-processes.The worker path is relevant to this failure because an access violation that ends
dxcompiler.dll's worker closes the protocol pipe; the parent reports that compile as failed, discards the dead per-thread worker, and starts a replacement for the next request. This is expected containment behavior, not yet a confirmed fix for this issue's root cause.Could the failing pack window be repeated from an empty
XCL_DXIL_CACHEwith:Please leave
XCL_DXC_THREADSat its default so the same parallel pressure remains, and use the samexcl shaders <pack> --precompile --only cs --pipelinescommand. The useful results are:xcl.exestays alive past records 23,200–23,400.DXC worker process ended (...)line and its exit code.A successful contained run would show that #1638 prevents the
dxcompiler.dllfault from ending the precompile, but it would not by itself identify why DXC faults under concurrency.AI use