xcl shaders --precompile --only cs --pipelines: access violation in dxcompiler.dll with parallel DXC compiles, not with XCL_DXC_THREADS=1 #2751

Open
opened 2026-11-26 11:14:42 +00:00 by github-bot · 2 comments
Owner

@⁠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 --pipelines ends twice in a row with 0xc0000005 inside dxcompiler.dll at 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).

run cache last progress line pipelines made end
1, 11 DXC threads (default) empty 23200/26503 (8981 s) 1,050, 0 refused 0xc0000005, dxcompiler.dll+0xc3877
2, 11 DXC threads run 1's 23200/26503 (47 s) 1,225, 0 refused same, same offset
3, XCL_DXC_THREADS=1 run 2's 23600/26503 (1754 s) 1,450, 0 refused no crash; stopped by hand at record 23,620

Application log, both crashes: faulting module dxcompiler.dll 1.9.2609.5 (time stamp 0x6aba15db), exception 0xc0000005, fault offset 0x00000000000c3877.

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 after 23200/ and before 23400/ was printed. With 13 translating threads, the DXC compile that faulted was one of records ~23,150–23,413: 271 compute records, mostly scattering_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_CACHE to an empty folder. --limit counts from record 0, so for now that means the whole pack up to ~23,400.

Setup

  • NVIDIA GeForce RTX 2070 SUPER (wave32 only, so split wave64), Windows 11 Home 26300, release build
  • XCL at 5f61e93: main e1d84b7 plus three D3D12.X mirror-sync commits that the precompile path does not run; run 3 also had a local per-record log line in shaders::precompile
  • DXC 1.9.2609.5 (XCL_DXC_DIR), 11 DXC threads by default, 4 memory windows

Not checked

  • Whether 2 or 4 DXC threads also crash, or XCL_DXC_PROCESS=1 (#1638)
  • Which program DXC was compiling at the fault (no crash dump was taken)
  • AMD, and other DXC versions

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 10:09 UTC · [original](https://github.com/xcl-dev/xcl/issues/2751) **What happens** On the retail pack (26,503 records), `xcl shaders shaders.rpf --precompile --only cs --pipelines` ends twice in a row with `0xc0000005` inside `dxcompiler.dll` at 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). | run | cache | last progress line | pipelines made | end | |---|---|---|---|---| | 1, 11 DXC threads (default) | empty | `23200/26503 (8981 s)` | 1,050, 0 refused | `0xc0000005`, `dxcompiler.dll+0xc3877` | | 2, 11 DXC threads | run 1's | `23200/26503 (47 s)` | 1,225, 0 refused | same, same offset | | 3, `XCL_DXC_THREADS=1` | run 2's | `23600/26503 (1754 s)` | 1,450, 0 refused | no crash; stopped by hand at record 23,620 | Application log, both crashes: faulting module `dxcompiler.dll` 1.9.2609.5 (time stamp `0x6aba15db`), exception `0xc0000005`, fault offset `0x00000000000c3877`. 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 after `23200/` and before `23400/` was printed. With 13 translating threads, the DXC compile that faulted was one of records ~23,150–23,413: 271 compute records, mostly `scattering_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_CACHE` to an empty folder. `--limit` counts from record 0, so for now that means the whole pack up to ~23,400. **Setup** - NVIDIA GeForce RTX 2070 SUPER (wave32 only, so split wave64), Windows 11 Home 26300, release build - XCL at `5f61e93`: `main` `e1d84b7` plus three D3D12.X mirror-sync commits that the precompile path does not run; run 3 also had a local per-record log line in `shaders::precompile` - DXC 1.9.2609.5 (`XCL_DXC_DIR`), 11 DXC threads by default, 4 memory windows **Not checked** - Whether 2 or 4 DXC threads also crash, or `XCL_DXC_PROCESS=1` (#1638) - Which program DXC was compiling at the fault (no crash dump was taken) - AMD, and other DXC versions **AI use** Claude Code (Claude Opus 5.5) ran the precompiles and the single-thread diagnostic, read the crash entries, and wrote this report.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 11:14:42 +00:00
Author
Owner

@⁠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+0xc3877 is in llvm::Use::getUser, in its inlined getImpliedUser loop:

1800C3870: lea  rax,[rdx+10h]
1800C3874: mov  rcx,rdx
1800C3877: mov  eax,dword ptr [rax]     ; <- fault: tag bits of the next Use's Prev
1800C3879: add  rdx,18h
1800C387D: and  eax,3
1800C3880: je   1800C3870               ; tags 0/1: keep walking

The loop walks a User's Use array 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 a Use of a User that 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 own IDxcCompiler3 (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 of dxcompiler.dll is the validator in module/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):

  • Run 1's direct-translator entries were written at 02:49:58–02:50:02, about six minutes before its crash at 02:55:53. In the two minutes before each crash only pool compiles (.dxil + translation entries) and driver PSO blobs were written.
  • Run 3 spent its first 25 minutes on three compiles of ~8 minutes each, none of which run 1 or run 2 finished, so they were most likely running at both crashes. All three are 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)
  • No Resource-Exhaustion-Detector event in the System log around either crash. In run 3 system commit stayed at 16–23 GB of 50 GB while those three compiled one at a time.

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 separate dxc.exe processes, 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.

**@⁠KOLESNiii** on GitHub · 2026-11-26 12:10 UTC · [original](https://github.com/xcl-dev/xcl/issues/2751#issuecomment-7191661043) **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+0xc3877` is in `llvm::Use::getUser`, in its inlined `getImpliedUser` loop: ``` 1800C3870: lea rax,[rdx+10h] 1800C3874: mov rcx,rdx 1800C3877: mov eax,dword ptr [rax] ; <- fault: tag bits of the next Use's Prev 1800C3879: add rdx,18h 1800C387D: and eax,3 1800C3880: je 1800C3870 ; tags 0/1: keep walking ``` The loop walks a `User`'s `Use` array 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 a `Use` of a `User` that 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 own `IDxcCompiler3` (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 of `dxcompiler.dll` is the validator in `module/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): - Run 1's direct-translator entries were written at 02:49:58–02:50:02, about six minutes before its crash at 02:55:53. In the two minutes before each crash only pool compiles (`.dxil` + translation entries) and driver PSO blobs were written. - Run 3 spent its first 25 minutes on three compiles of ~8 minutes each, none of which run 1 or run 2 finished, so they were most likely running at both crashes. All three are `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`) - No Resource-Exhaustion-Detector event in the System log around either crash. In run 3 system commit stayed at 16–23 GB of 50 GB while those three compiled one at a time. **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 separate `dxc.exe` processes, 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.*
Author
Owner

@⁠mokkamokacaffe on GitHub · 2026-11-26 12:12 UTC · original

#1638 now has a clean rebase onto current main for testing: e8f0c3853b74dc1d866cacc9a4366746d0429945, branch mokkamokacaffe: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_CACHE with:

XCL_DXC_PROCESS=1

Please leave XCL_DXC_THREADS at its default so the same parallel pressure remains, and use the same xcl shaders <pack> --precompile --only cs --pipelines command. The useful results are:

  • Whether the parent xcl.exe stays alive past records 23,200–23,400.
  • Any DXC worker process ended (...) line and its exit code.
  • Whether later records continue compiling through a replacement worker.
  • Final progress, compiled/error counts, peak commit, and whether the run finishes.
  • Exact XCL commit, DXC version, Windows build, CPU, and GPU.

A successful contained run would show that #1638 prevents the dxcompiler.dll fault from ending the precompile, but it would not by itself identify why DXC faults under concurrency.

AI use

  • OpenAI Codex (GPT-6.2 Astra Ultra) reviewed #2751 against #1638's worker-failure path and drafted this test request.
**@⁠mokkamokacaffe** on GitHub · 2026-11-26 12:12 UTC · [original](https://github.com/xcl-dev/xcl/issues/2751#issuecomment-7191694557) #1638 now has a clean rebase onto current `main` for testing: [`e8f0c3853b74dc1d866cacc9a4366746d0429945`](https://github.com/mokkamokacaffe/xcl/commit/e8f0c3853b74dc1d866cacc9a4366746d0429945), branch [`mokkamokacaffe:shaders/rebase-dxc-worker-processes`](https://github.com/mokkamokacaffe/xcl/tree/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_CACHE` with: ```text XCL_DXC_PROCESS=1 ``` Please leave `XCL_DXC_THREADS` at its default so the same parallel pressure remains, and use the same `xcl shaders <pack> --precompile --only cs --pipelines` command. The useful results are: - Whether the parent `xcl.exe` stays alive past records 23,200–23,400. - Any `DXC worker process ended (...)` line and its exit code. - Whether later records continue compiling through a replacement worker. - Final progress, compiled/error counts, peak commit, and whether the run finishes. - Exact XCL commit, DXC version, Windows build, CPU, and GPU. A successful contained run would show that #1638 prevents the `dxcompiler.dll` fault from ending the precompile, but it would not by itself identify why DXC faults under concurrency. **AI use** - OpenAI Codex (GPT-6.2 Astra Ultra) reviewed #2751 against #1638's worker-failure path and drafted this test request.
This discussion has been locked. Commenting is limited to contributors.
No description provided.