D3D12.X: build console pipelines at their first use (retail title: 45+ GB → 17 GB) #162

Closed
github-bot wants to merge 4 commits from gh-pr/162/head into gh-pr/162/base
Owner

@⁠Sr-0w on GitHub · 2026-11-23 18:01 UTC · original
Sr-0w:lazy-pso → main · +184 −24 · 3 files · 4 commits · closed without merging

Problem

The retail title (GDK) creates ~51 000 distinct pipelines in its first 30 s (measured: a translation-keyed cache found only 33 duplicates). Built at creation, each stays in AMD's driver heap (amdxc64.dll, ~400 KB per pipeline, measured with an NtAllocateVirtualMemory trace): private commit climbed past 45 GB and the system ran out of commit.

While the shader queue was long, title threads without a stand-in waited in their own Create*PipelineState call behind thousands of background DXC jobs (most held by wait_for_memory). The game's watchdog (+0x2215a60) kills the process when a thread stays silent ~30 s.

Change

  • pso_async::submit_lazy: pipelines with console shaders (graphics without HS/DS/GS, compute) get their stand-in at creation and are sent to the workers on their first resolve. resolve_wait (compute) builds a not-yet-sent pipeline on the spot. XCL_LAZY_PSO=0 restores build-at-creation.
  • dxc::urgent: compiles requested from a title thread that waits for them (the sync fallbacks with no stand-in) run immediately on their own xcl-dxc-urgent thread, not behind the pool queue / memory gate (still counted in WORKING).
  • Stand-ins get pc_topology_type (console rect list 19 / 0 were refused with 0x80070057, so the title waited for the full translation instead).

Result (retail title 1.0.2.1, AMD GPU, 64 GB)

private commit after 60 s
before 45+ GB, rising until the system runs out
this PR 16.9 GB, flat

No more watchdog kill from starved pipeline creation. (The game then stops on Xbox depth-format issues: separate PR.)

Test plan

  • cargo test --release -p xcl --lib: 534 passed; the 1 failure (gpu_wave64_ps_whole_wave_reductions) also fails on main
  • Retail title: peak private memory 16.9 GB over 90 s (was 45+ GB); log shows pipelines are built at their first use (n created so far)
  • Another title with many pipelines, to check the first-use build causes no visible hitches (XCL_LAZY_PSO=0 to compare)

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-23 18:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/162) `Sr-0w:lazy-pso` → `main` · +184 −24 · 3 files · 4 commits · closed without merging ## Problem The retail title (GDK) creates **~51 000 distinct pipelines in its first 30 s** (measured: a translation-keyed cache found only 33 duplicates). Built at creation, each stays in AMD's driver heap (`amdxc64.dll`, ~400 KB per pipeline, measured with an `NtAllocateVirtualMemory` trace): private commit climbed past 45 GB and the system ran out of commit. While the shader queue was long, title threads without a stand-in waited in their own `Create*PipelineState` call behind thousands of background DXC jobs (most held by `wait_for_memory`). The game's watchdog (`+0x2215a60`) kills the process when a thread stays silent ~30 s. ## Change - `pso_async::submit_lazy`: pipelines with console shaders (graphics without HS/DS/GS, compute) get their stand-in at creation and are **sent to the workers on their first `resolve`**. `resolve_wait` (compute) builds a not-yet-sent pipeline on the spot. `XCL_LAZY_PSO=0` restores build-at-creation. - `dxc::urgent`: compiles requested from a title thread that waits for them (the sync fallbacks with no stand-in) run immediately on their own `xcl-dxc-urgent` thread, not behind the pool queue / memory gate (still counted in `WORKING`). - Stand-ins get `pc_topology_type` (console rect list `19` / `0` were refused with `0x80070057`, so the title waited for the full translation instead). ## Result (retail title 1.0.2.1, AMD GPU, 64 GB) | | private commit after 60 s | |---|---| | before | 45+ GB, rising until the system runs out | | this PR | **16.9 GB**, flat | No more watchdog kill from starved pipeline creation. (The game then stops on Xbox depth-format issues: separate PR.) ## Test plan - [x] `cargo test --release -p xcl --lib`: 534 passed; the 1 failure (`gpu_wave64_ps_whole_wave_reductions`) also fails on `main` - [x] Retail title: peak private memory 16.9 GB over 90 s (was 45+ GB); log shows `pipelines are built at their first use (n created so far)` - [ ] Another title with many pipelines, to check the first-use build causes no visible hitches (`XCL_LAZY_PSO=0` to compare) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GTA VI (retail, GDK) creates ~51 000 distinct pipelines in its first 30 s. Each one built at
creation stays in AMD's driver heap (~400 KB): commit went past 45 GB and the system ran out.
Pipelines with console shaders now get their stand-in at creation and are built the first time
they are bound (pso_async::submit_lazy, sent to the workers on the first `resolve`; compute is
waited for as before). XCL_LAZY_PSO=0 builds them all at creation as before.

A title thread with no stand-in waits in its own call for the translation: its DXC compiles
now run at once on a thread of their own (dxc::urgent) instead of queueing behind thousands of
background jobs held by the memory gate. GTA VI's watchdog killed the game when one of its
threads stayed silent ~30 s. resolve_wait builds a pipeline nobody sent yet on the spot.

Stand-ins also get the PC topology type (pc_topology_type): the console's rect list / none were
refused (0x80070057) and the title waited in the call instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B
# Conflicts:
#	crates/xcl/src/hle/d3d12x/pso_async.rs
With GTA VI's compute pipelines built at their first dispatch the device was removed ~20 s in
(an invalid call, nothing from the debug layer before it); with graphics ones only it runs at
30 fps. Compute pipelines are far fewer and their first bind waits for them anyway.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B
Built at creation, GTA VI's thousands of compute pipelines took 60+ GB of commit in AMD's driver
within a minute and the game never left its loading screen (no dispatch at all in 80 s). The
device removal this deferral once caused was not the deferral: invalid UAVs of depth buffers
(fixed in #163) used by the dispatches it let the game reach. With both, GTA VI reaches its
title screen and menus. `XCL_LAZY_COMPUTE=0` builds them at creation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:13:09 +00:00
github-bot closed this pull request 2026-11-26 04:13:09 +00:00
Author
Owner

@⁠Krigsexe on GitHub · 2026-11-23 18:07 UTC · original · edited 2026-11-23 18:08 UTC

Heads-up: this repo isn't about any specific retail title. Naming a build version and binary offset in a public PR is a quick way to get the whole repo DMCA'd. Better to keep it generic to D3D12.X pipeline creation. @⁠Sr-0w & @⁠claude

**@⁠Krigsexe** on GitHub · 2026-11-23 18:07 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7109686317) · edited 2026-11-23 18:08 UTC Heads-up: this repo isn't about any specific retail title. Naming a build version and binary offset in a public PR is a quick way to get the whole repo DMCA'd. Better to keep it generic to D3D12.X pipeline creation. @⁠Sr-0w & @⁠claude
Author
Owner

@⁠ryosen0 on GitHub · 2026-11-23 18:12 UTC · original

Tested pull/162/head (lazy-pso, commit 73c8e74) on this title, Windows 11 host, RTX 3060 Ti (wave32), XCL_NETWORK=0:

The null-write crash is unchanged — game_scarlett_master.exe+0x2215c35 (write at address 0x0), identical registers to the non-lazy run:

rax=0x140004380 rbx=0x0 rcx=0x4189374bc6a7f0 rbp=0x0 r8=0x7ffea000
on the stack: game_scarlett_master.exe+0x71b9a20, game_scarlett_master.exe+0x2215eca

Differences with lazy-pso:

  • crash surfaces earlier, ~50 s (vs ~93 s build-at-creation);
  • translated_pipelines: 3 (most now deferred to first use), failed_pipelines: 641, presents: 2, unique shaders 4,536 — same ballpark;
  • the failed PSOs still log PSO stream rejected (0x80070057), the fallback version too.

Two conclusions this rules in/out:

  1. The crash is not the ~30 s watchdog at +0x2215a60 — +0x2215c35 is a different site (+0x1d5 away), and lazy building changed the timing without moving the crash. So it's a genuine null-deref, not a thread-silence kill.
  2. The title dereferences the result of a rejected console-shader pipeline (rbx=0, rbp=0, static rax=0x140004380) regardless of when that pipeline was built. The 0x80070057 rejections — topology type 3, 2 render targets, DSV format 118, HS false, GS false — look like the upstream cause; this matches the AS/MS subobject suspicion in HANDOFF. PR #163 (D16S8 depth formats) is likely relevant since DSV format 118 (D16S8) is in that rejected stream.

Happy to re-run any candidate fix (AS/MS numbering, or #163) on this title and report register-level diffs — fast turnaround on our side.

**@⁠ryosen0** on GitHub · 2026-11-23 18:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7109822119) Tested `pull/162/head` (lazy-pso, commit 73c8e74) on this title, Windows 11 host, RTX 3060 Ti (wave32), `XCL_NETWORK=0`: **The null-write crash is unchanged** — `game_scarlett_master.exe+0x2215c35 (write at address 0x0)`, identical registers to the non-lazy run: ``` rax=0x140004380 rbx=0x0 rcx=0x4189374bc6a7f0 rbp=0x0 r8=0x7ffea000 on the stack: game_scarlett_master.exe+0x71b9a20, game_scarlett_master.exe+0x2215eca ``` Differences with lazy-pso: - crash surfaces **earlier, ~50 s** (vs ~93 s build-at-creation); - `translated_pipelines: 3` (most now deferred to first use), `failed_pipelines: 641`, `presents: 2`, unique shaders 4,536 — same ballpark; - the failed PSOs still log `PSO stream rejected (0x80070057), the fallback version too`. Two conclusions this rules in/out: 1. **The crash is not the ~30 s watchdog** at `+0x2215a60` — `+0x2215c35` is a different site (+0x1d5 away), and lazy building changed the timing without moving the crash. So it's a genuine null-deref, not a thread-silence kill. 2. The title dereferences the result of a **rejected console-shader pipeline** (rbx=0, rbp=0, static `rax=0x140004380`) regardless of when that pipeline was built. The `0x80070057` rejections — `topology type 3, 2 render targets, DSV format 118, HS false, GS false` — look like the upstream cause; this matches the AS/MS subobject suspicion in HANDOFF. PR #163 (D16S8 depth formats) is likely relevant since DSV format 118 (D16S8) is in that rejected stream. Happy to re-run any candidate fix (AS/MS numbering, or #163) on this title and report register-level diffs — fast turnaround on our side.
Author
Owner

@⁠gefydev on GitHub · 2026-11-23 18:11 UTC · original · edited 2026-11-23 19:05 UTC

Update 18:16 UTC: main moved to 956a476 while I measured. Its resolve_wait now also builds a pipeline no worker has started, so on the same bench main is at 0.58 / 0.60 / 0.62 s for the last one and 7.35 / 7.39 / 7.36 s for all 200. The main row below is the older db5dc26. The queue wait is no longer a difference between this PR and main; the lazy build is, and points 1 and 2 are about that. This PR conflicts with main now.


I had a smaller change for the same wait ready (a waited-for pipeline moves ahead of the queue) and found this PR in my last duplicate check, so I did not open mine. I tested this one instead.

Machine: Ryzen 5 1600 (6C/12T), 16 GB RAM, ~13.5 GB commit free, GTX 1650 4 GB (driver 32.0.16.2124, 32-lane waves), Windows 11 26300, DXC from SDK 10.0.26100. No retail title was run here. PR head 73c8e74 on db5dc26, debug build.

Tests: cargo test --workspace: 535 lib tests pass, 0 fail, 2 SKIPPED (no wave64). The other suites pass. e2e passes after cargo build --workspace; my first run failed only because I had not built the test title.

Synthetic bench: 200 pipelines, each one DXC compile of a different CS, no cache, no driver PSO, 11 DXC threads. 3 runs each.

wait for the last one all 200
main db5dc26, submit 7.33 / 7.25 / 7.24 s 7.38 / 7.36 / 7.38 s
this PR, submit 0.35 / 0.34 / 0.31 s 7.35 / 7.36 / 7.38 s
this PR, submit_lazy, 1 title thread, all used – 45.2 / 45.5 / 45.5 s
this PR, submit_lazy, 4 title threads, all used – 11.9 / 11.9 / 11.9 s

The main runs and this PR's were not interleaved with each other (minutes apart on the same machine). The wait behind the queue is gone. Two things I noticed:

  1. counts() still counts every unfinished Pending, so lazy pipelines that were never used count as building (measured: 200 of 200 before any use). present::show_compiling treats queued > 0 as active, so from reading the code the window title would say "compiling shaders: … N pipelines queued" for the whole run, and report.json background_pipelines would include them. Counting only those that were sent (queued) or whose job is already taken would fix it.

  2. When pipelines are used right after they are bound, they are built one at a time per title thread. resolve at bind sends the pipeline, but the draw / dispatch that follows takes the job back in resolve_wait if no worker got it first, so the worker pool seems to stay mostly idle (45 s against 7.4 s above). It is the worst case (every pipeline used, bind then use at once, no other work between them) and it does not count what you save by never building the rest, so it may well be the right trade for a title that creates ~51 000. It is the first-use hitch your last test-plan item asks about. Each waiting thread also skips wait_for_memory, so the gate's limit does not hold for them.

My version's tests (queue order, waiting twice, a blocked worker) are yours if useful; I can send them as a patch.

**@⁠gefydev** on GitHub · 2026-11-23 18:11 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7109799830) · edited 2026-11-23 19:05 UTC **Update 18:16 UTC:** `main` moved to `956a476` while I measured. Its `resolve_wait` now also builds a pipeline no worker has started, so on the same bench `main` is at 0.58 / 0.60 / 0.62 s for the last one and 7.35 / 7.39 / 7.36 s for all 200. The `main` row below is the older `db5dc26`. The queue wait is no longer a difference between this PR and `main`; the lazy build is, and points 1 and 2 are about that. This PR conflicts with `main` now. --- I had a smaller change for the same wait ready (a waited-for pipeline moves ahead of the queue) and found this PR in my last duplicate check, so I did not open mine. I tested this one instead. **Machine:** Ryzen 5 1600 (6C/12T), 16 GB RAM, ~13.5 GB commit free, GTX 1650 4 GB (driver 32.0.16.2124, 32-lane waves), Windows 11 26300, DXC from SDK 10.0.26100. No retail title was run here. PR head `73c8e74` on `db5dc26`, debug build. **Tests:** `cargo test --workspace`: 535 lib tests pass, 0 fail, 2 SKIPPED (no wave64). The other suites pass. e2e passes after `cargo build --workspace`; my first run failed only because I had not built the test title. **Synthetic bench:** 200 pipelines, each one DXC compile of a different CS, no cache, no driver PSO, 11 DXC threads. 3 runs each. | | wait for the last one | all 200 | |---|---|---| | `main` `db5dc26`, `submit` | 7.33 / 7.25 / 7.24 s | 7.38 / 7.36 / 7.38 s | | this PR, `submit` | **0.35 / 0.34 / 0.31 s** | 7.35 / 7.36 / 7.38 s | | this PR, `submit_lazy`, 1 title thread, all used | – | 45.2 / 45.5 / 45.5 s | | this PR, `submit_lazy`, 4 title threads, all used | – | 11.9 / 11.9 / 11.9 s | The `main` runs and this PR's were not interleaved with each other (minutes apart on the same machine). The wait behind the queue is gone. Two things I noticed: 1. **`counts()` still counts every unfinished `Pending`, so lazy pipelines that were never used count as building** (measured: 200 of 200 before any use). `present::show_compiling` treats `queued > 0` as active, so from reading the code the window title would say "compiling shaders: … N pipelines queued" for the whole run, and `report.json` `background_pipelines` would include them. Counting only those that were sent (`queued`) or whose `job` is already taken would fix it. 2. **When pipelines are used right after they are bound, they are built one at a time per title thread.** `resolve` at bind sends the pipeline, but the draw / dispatch that follows takes the job back in `resolve_wait` if no worker got it first, so the worker pool seems to stay mostly idle (45 s against 7.4 s above). It is the worst case (every pipeline used, bind then use at once, no other work between them) and it does not count what you save by never building the rest, so it may well be the right trade for a title that creates ~51 000. It is the first-use hitch your last test-plan item asks about. Each waiting thread also skips `wait_for_memory`, so the gate's limit does not hold for them. My version's tests (queue order, waiting twice, a blocked worker) are yours if useful; I can send them as a patch.
Author
Owner

@⁠Sr-0w on GitHub · 2026-11-23 19:19 UTC · original

Found the cause of the device removal I attributed to deferring compute pipelines: invalid UAV descriptors on depth buffers whose UAV flag #163 drops, used by a dispatch. #163 now writes a null view for them. With that, deferring compute pipelines too works (XCL_LAZY_COMPUTE=1 locally): private memory stays around 20 GB at 35 s, vs 60+ GB and rising without it. The game then gets further (it creates those shadow-map UAVs) and stops at ~35 s on a memset to a null pointer in title code (+0x5ebea33, a 256 KB R32_FLOAT buffer whose allocation returned null). I am investigating that before proposing compute deferral again.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-23 19:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7111439051) Found the cause of the device removal I attributed to deferring compute pipelines: invalid UAV descriptors on depth buffers whose UAV flag #163 drops, used by a dispatch. #163 now writes a null view for them. With that, deferring compute pipelines too works (`XCL_LAZY_COMPUTE=1` locally): private memory stays around 20 GB at 35 s, vs 60+ GB and rising without it. The game then gets further (it creates those shadow-map UAVs) and stops at ~35 s on a `memset` to a null pointer in title code (`+0x5ebea33`, a 256 KB R32_FLOAT buffer whose allocation returned null). I am investigating that before proposing compute deferral again. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠gw1337x on GitHub · 2026-11-23 20:19 UTC · original

Setup: AMD Radeon RX 7800 XT (RDNA3, 16 GB), driver 32.0.32015.7029, 32 GB RAM, Windows 11 Pro 26200, GTA VI retail, XCL_NETWORK=0, release build.
Test branch: main 956a476 + #170 (incl. #163 @ 634c423) + #162 @ 641f551 + #168 @ 070a737 + xg.rs of #169 + #176 + #164.

Data point for compute deferral, with the view-format fixes I posted on #163 and #168 in place: deferring compute pipelines works on this machine and it is what makes the difference with 32 GB of RAM.

XCL_TRACE_ALLOC (#164): without compute deferral, amdxc64.dll grows 4.7 → 23 → 48 GB (15 / 30 / 45 s), all under translated_compute_pso → CreateComputePipelineState. Private commit of the game process reaches 76–90 GB, the working set drops to ~0 (paging), and the game's watchdog (+0x2215c35) fires at 50–54 s. A warm translation cache made no difference. XCL_DXC_THREADS=4 made no difference either.

at 30 s build-at-creation compute deferred too
process private commit 48–57 GB 35 GB
amdxc64.dll (tracer, cumulative) 23 GB 7.5 GB

(I restored the compute branch of 73c8e74 behind XCL_LAZY_COMPUTE=1.)

Related: dxc::wait_for_memory checks ullAvailPageFile, which on a system-managed page file keeps growing (the commit limit went 84.8 → 113 GB during a run), so the gate never held anything back while physical memory was exhausted.

Next stop with deferral on: DEVICE_HUNG (0x887a0006) at ~26 s. In a debug-layer run of the same build, the last error before it stopped was IASetIndexBuffer: pDesc->BufferLocation 0x...2480 does not belong to any existing Resource or Heap (title memory outside the GPU windows, I think).

🤖 Generated with Claude Code

**@⁠gw1337x** on GitHub · 2026-11-23 20:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7112913908) **Setup:** AMD Radeon RX 7800 XT (RDNA3, 16 GB), driver 32.0.32015.7029, 32 GB RAM, Windows 11 Pro 26200, GTA VI retail, `XCL_NETWORK=0`, release build. Test branch: `main` 956a476 + #170 (incl. #163 @ 634c423) + #162 @ 641f551 + #168 @ 070a737 + `xg.rs` of #169 + #176 + #164. Data point for compute deferral, with the view-format fixes I posted on #163 and #168 in place: deferring compute pipelines works on this machine and it is what makes the difference with 32 GB of RAM. `XCL_TRACE_ALLOC` (#164): without compute deferral, `amdxc64.dll` grows 4.7 → 23 → 48 GB (15 / 30 / 45 s), all under `translated_compute_pso` → `CreateComputePipelineState`. Private commit of the game process reaches 76–90 GB, the working set drops to ~0 (paging), and the game's watchdog (`+0x2215c35`) fires at 50–54 s. A warm translation cache made no difference. `XCL_DXC_THREADS=4` made no difference either. | at 30 s | build-at-creation | compute deferred too | |---|---|---| | process private commit | 48–57 GB | **35 GB** | | `amdxc64.dll` (tracer, cumulative) | 23 GB | **7.5 GB** | (I restored the compute branch of 73c8e74 behind `XCL_LAZY_COMPUTE=1`.) Related: `dxc::wait_for_memory` checks `ullAvailPageFile`, which on a system-managed page file keeps growing (the commit limit went 84.8 → 113 GB during a run), so the gate never held anything back while physical memory was exhausted. Next stop with deferral on: `DEVICE_HUNG` (`0x887a0006`) at ~26 s. In a debug-layer run of the same build, the last error before it stopped was `IASetIndexBuffer: pDesc->BufferLocation 0x...2480 does not belong to any existing Resource or Heap` (title memory outside the GPU windows, I think). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-23 20:33 UTC · original

I tested disposal, concurrent first use and build failure at the scheduler boundary on PR head 641f55143864349fa3a5dd02557512af8fe0e43d and main 956a476bf738a098f39df4f4c8acef682e43030f (Windows x64 MSVC, Rust 1.99.0). These were synthetic closures. The surrounding D3D12.X tests ran on the RTX 5070 Ti workstation.

Check main, eager submit PR head, lazy submit
Release the stand-in before its first bind Job ran Job dropped without running
First graphics bind during a gated build Returned stand-in Returned stand-in
Two waiting callers, then successful completion Both got the real result, one build Same
Two waiting callers, then a build returning zero Both got the stand-in, one build Same

Repeated binding after failure continued to return the stand-in. The first draw can still block while a build is in flight: crates/xcl/src/hle/d3d12x/bind.rs:291 calls resolve_wait before drawing. A nonblocking graphics bind alone therefore gives no bound on first-draw latency.

The PR adds no tests. The affected module plus two reviewer tests gave 56 pass / 0 fail on the PR head and 55 pass / 1 fail on main; the eager-disposal negative control accounts for the difference. The fixtures cover two concurrent waiters and an ordinary failed build. Driver compilation time, frame-time distribution, process memory and retail execution were outside this test. AI-assisted review.

**@⁠Kalmarv** on GitHub · 2026-11-23 20:33 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7113225143) I tested disposal, concurrent first use and build failure at the scheduler boundary on PR head `641f55143864349fa3a5dd02557512af8fe0e43d` and main `956a476bf738a098f39df4f4c8acef682e43030f` (Windows x64 MSVC, Rust 1.99.0). These were synthetic closures. The surrounding D3D12.X tests ran on the RTX 5070 Ti workstation. | Check | main, eager submit | PR head, lazy submit | |---|---|---| | Release the stand-in before its first bind | Job ran | Job dropped without running | | First graphics bind during a gated build | Returned stand-in | Returned stand-in | | Two waiting callers, then successful completion | Both got the real result, one build | Same | | Two waiting callers, then a build returning zero | Both got the stand-in, one build | Same | Repeated binding after failure continued to return the stand-in. The first draw can still block while a build is in flight: `crates/xcl/src/hle/d3d12x/bind.rs:291` calls `resolve_wait` before drawing. A nonblocking graphics bind alone therefore gives no bound on first-draw latency. The PR adds no tests. The affected module plus two reviewer tests gave 56 pass / 0 fail on the PR head and 55 pass / 1 fail on main; the eager-disposal negative control accounts for the difference. The fixtures cover two concurrent waiters and an ordinary failed build. Driver compilation time, frame-time distribution, process memory and retail execution were outside this test. AI-assisted review.
Author
Owner

@⁠Sr-0w on GitHub · 2026-11-23 20:42 UTC · original

Compute pipelines are deferred again, now by default (XCL_LAZY_COMPUTE=0 turns it off). The device removal this deferral caused earlier came from invalid depth-buffer UAVs, which #163 now fixes. Without the deferral, GTA VI makes no dispatch in 80 s and reaches 96 GB of commit. With it, it stays around 20–40 GB and gets to its title screen and menus. Screenshots are in #203. Marked ready for review.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-23 20:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7113437813) Compute pipelines are deferred again, now by default (`XCL_LAZY_COMPUTE=0` turns it off). The device removal this deferral caused earlier came from invalid depth-buffer UAVs, which #163 now fixes. Without the deferral, GTA VI makes no dispatch in 80 s and reaches 96 GB of commit. With it, it stays around 20–40 GB and gets to its title screen and menus. Screenshots are in #203. Marked ready for review. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠ivall on GitHub · 2026-11-23 20:52 UTC · original

Main now creates console pipelines at their first use by default (956a476 + 38b05b7: pso_async::lazy, XCL_LAZY_PSO=0 turns it off). A graphics pipeline is translated and sent to the workers at its first resolve, and a compute pipeline is built at its first bind. With that, and the page-based placement of GPU-owned textures in 38b05b7, the retail game reaches its first menu at ~19 GB of commit. This branch now conflicts with main. Could you check against current main whether anything here is still needed, for example the disposal and concurrent-first-use behaviour Kalmarv tested?

**@⁠ivall** on GitHub · 2026-11-23 20:52 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7113688740) Main now creates console pipelines at their first use by default (956a476 + 38b05b7: `pso_async::lazy`, `XCL_LAZY_PSO=0` turns it off). A graphics pipeline is translated and sent to the workers at its first resolve, and a compute pipeline is built at its first bind. With that, and the page-based placement of GPU-owned textures in 38b05b7, the retail game reaches its first menu at ~19 GB of commit. This branch now conflicts with main. Could you check against current main whether anything here is still needed, for example the disposal and concurrent-first-use behaviour Kalmarv tested?
Author
Owner

@⁠Sr-0w on GitHub · 2026-11-23 22:08 UTC · original

Checked against current main (7a033c8): main already builds console pipelines at first use, graphics at first resolve and compute at first bind. With it, the retail game gets past its title screen and into its world without this branch. The only thing left here is dropping a deferred build whose stand-in is released before its first bind (the disposal case Kalmarv tested). It saves some wasted compiles but isn't needed for correctness, and I haven't measured a difference from it. Closing. I can reopen a small PR for that part alone if you want it.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-23 22:08 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7115367998) Checked against current main (7a033c8): main already builds console pipelines at first use, graphics at first resolve and compute at first bind. With it, the retail game gets past its title screen and into its world without this branch. The only thing left here is dropping a deferred build whose stand-in is released before its first bind (the disposal case Kalmarv tested). It saves some wasted compiles but isn't needed for correctness, and I haven't measured a difference from it. Closing. I can reopen a small PR for that part alone if you want it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠Sr-0w on GitHub · 2026-11-23 19:03 UTC · original · edited 2026-11-25 13:07 UTC

Update after 956a476 ("Retail game reaches 30 fps"):

  • Merged main into this branch. pso_async now keeps your job / complete structure and only adds the first-use part (queued, submit_lazy, send).
  • Compute pipelines are no longer deferred. On top of 956a476, building GTA VI's compute pipelines at their first dispatch got the device removed ~20 s in (0x887a0001, nothing from the debug layer before it). I bisected my 4 PRs on top of main and only this deferral did it. With graphics deferral only, it runs at 30 fps like main.
  • The memory win is no longer measurable on main. Private commit during the first minute: main 13 → 18 → 30 → 38 → 39 GB, this branch 15 → 19 → 27 → 38 → 44 GB. Both then hit the same spike (up to 162 GB on main here, 64 GB RAM): with XCL_TRACE_ALLOC (#164) it is amdxc64.dll compiling pipelines plus XCL's translation of big compute shaders (translate / emit, called from dev_create_compute_pso on a title thread). That matches the 1 MB ray-tracing programs in HANDOFF.

Converting to draft: as it stands, this does not earn its complexity on current main. The dxc::urgent part (compiles for a title thread that waits, run ahead of the queue) may still be worth taking on its own. Tell me if you want it split out.

🤖 Generated with Claude Code

**@⁠Sr-0w** on GitHub · 2026-11-23 19:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7111020602) · edited 2026-11-25 13:07 UTC Update after 956a476 ("Retail game reaches 30 fps"): - Merged `main` into this branch. `pso_async` now keeps your `job` / `complete` structure and only adds the first-use part (`queued`, `submit_lazy`, `send`). - **Compute pipelines are no longer deferred.** On top of 956a476, building GTA VI's compute pipelines at their first dispatch got the device removed ~20 s in (`0x887a0001`, nothing from the debug layer before it). I bisected my 4 PRs on top of `main` and only this deferral did it. With graphics deferral only, it runs at 30 fps like `main`. - **The memory win is no longer measurable on `main`.** Private commit during the first minute: `main` 13 → 18 → 30 → 38 → 39 GB, this branch 15 → 19 → 27 → 38 → 44 GB. Both then hit the same spike (up to 162 GB on `main` here, 64 GB RAM): with `XCL_TRACE_ALLOC` (#164) it is `amdxc64.dll` compiling pipelines plus XCL's translation of big compute shaders (`translate` / `emit`, called from `dev_create_compute_pso` on a title thread). That matches the 1 MB ray-tracing programs in HANDOFF. Converting to draft: as it stands, this does not earn its complexity on current `main`. The `dxc::urgent` part (compiles for a title thread that waits, run ahead of the queue) may still be worth taking on its own. Tell me if you want it split out. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@⁠Kalmarv on GitHub · 2026-11-25 14:19 UTC · original

@⁠Sr-0w no need to split out dxc::urgent for my sake. You measured that it doesn't earn its complexity on current main, and I agree with keeping it out. Thanks for checking.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

**@⁠Kalmarv** on GitHub · 2026-11-25 14:19 UTC · [original](https://github.com/xcl-dev/xcl/pull/162#issuecomment-7165099812) @⁠Sr-0w no need to split out `dxc::urgent` for my sake. You measured that it doesn't earn its complexity on current `main`, and I agree with keeping it out. Thanks for checking. AI use: Claude Code (Claude Opus 5.5) wrote this reply.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.