xcl shaders --precompile --only cs --pipelines: access violation in dxcompiler.dll with parallel DXC compiles, not with XCL_DXC_THREADS=1 #2741
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?
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T10:09:29Z.
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.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T12:10:28Z.
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.
Imported from ivall/xcl. Originally posted by mokkamokacaffe on 2026-11-26T12:12:02Z.
#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
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T16:54:21Z.
Update: reproduced under a debugger; the fault looks like a hardware bit flip, not a DXC bug
Outside XCL, no fault. A standalone C++ harness compiled the three
rtdirectionalshadowsprograms from the comment above (same arguments, a 64 MB stack and its ownIDxcCompiler3per thread, like XCL's pool) 3 at once and 12 jobs on 11 threads: no fault, peak commit 7.2 GB.Reproduced inside XCL. I reran the precompile from a translation cache rolled back to just before run 1's crash, with 11 DXC threads under
cdb. It faulted at record ~23,230, inside the same window as runs 1 and 2. The three programs above (records 23211–23213) were again among the four in flight. This run happened to load the Windows SDK'sdxcompiler.dll1.9.2602.17, not 1.9.2609.5. The fault is in the same function, now as a non-inlined call:So this is an ordinary pool compile (LCSSA calls SCEV
forgetLoop, which walks an instruction's users). The split validator was not running.The full dump does not show a dangling
Use; it shows a corrupted load.PushDefUseChildrenwalksI->UseListthroughUse::Next. The instruction's use list in memory is intact:UseList→Use 0x73d16970→Next = 0x00000000'73d16408→Next = null, with matchingPrevback-pointers. That secondUseis valid:Valpoints back at the instruction, and its operand array ends in a stop tag. But the register that loadedNextheld0x80000000'73d16408. That differs from the value in memory only in bit 63. The value with bit 63 set appears nowhere in the heap, only in the exception context on the stack. Nothing else in the process could have written thatUse(each compile's IR belongs to one thread). So the value changed between memory and the register.That replaces my "dangling
Use" reading above, which was a guess made without a dump. The rest fits hardware instability on this PC:-O1compiles. This holds across two different DXC builds.One flipped bit in one dump is strong evidence, but it is not proof. Next: a CPU and memory stress test on this machine, and a rerun of the window with the memory at JEDEC speed. A crash on other hardware would settle it. If you can run
xcl shaders <pack> --precompile --only cs --pipelineson another PC, please post whether it faults and at which offset.Claude Code (Claude Opus 5.5) wrote the harness, ran the reproduction, analysed the dump and wrote this comment.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-26T19:19:50Z.
Update: Prime95 finds hardware errors on this machine. This is most likely not a DXC or XCL bug.
On the PC where all the crashes happened, I ran Prime95 30.19b20's blend torture test for 2 hours: 12 threads, 20 GB, nothing else running. It reported 5
Hardware failure detectederrors (Rounding was 0.5, expected less than 0.4):All 37 self-tests that passed include every small FFT size (10K–18K), which runs inside the CPU cache. Only the large sizes failed, and those work out of main memory. This points at the RAM or the memory controller: four DIMMs from two different 3600 MT/s kits on a Zen 2 / B450 board. It fits the single flipped bit in the dump above and the crashes needing hours at full load.
Next on this machine: run the RAM at a lower speed, or one kit only. Then rerun the stress test and the precompile through the crash window. Unless someone reproduces the crash on hardware that passes a stress test, I'd treat this as "unstable hardware".
Claude Code (Claude Opus 5.5) ran the stress test and wrote this comment.
Imported from ivall/xcl. Originally posted by KOLESNiii on 2026-11-27T00:57:32Z.
Update: no longer reproduces since the memory was stabilised
The board's default AI Tweaker profile was running the RAM at tighter timings than the XMP profile of one of the two kits allows. I loosened the timings slightly, and the machine now passes both Prime95 and OCCT. Since then I haven't been able to reproduce the crash, and the
dxcompiler.dllaccess violation inllvm::Use::getImpliedUserhas not come back.That fits the earlier findings: the bit-63 flip in the dump, the Prime95 blend errors at the large FFT sizes only, and crashes that needed hours of full load on this PC. Mixing two kits with different XMP ratings under one tighter profile would explain all three. I'm treating this as unstable hardware, not a DXC or XCL bug.
I'll close this unless someone reproduces the fault on hardware that passes a stress test. If you see it, please post the
dxcompiler.dllversion, the fault offset, and your stress-test result.Claude Code (Claude Opus 5.5) drafted this comment.