D3D12.X: optional graphics-only pipeline preloading #828

Open
github-bot wants to merge 1 commit from github-bot/gh-828 into main AGit
Owner

@⁠Prime1997 on GitHub · 2026-11-24 06:17 UTC · original
Prime1997:contrib/graphics-only-preload → main · +83 −13 · 2 files · 1 commits · open

Adds XCL_PSO_PRELOAD=graphics as an optional admission policy for #690. Remembered graphics pipelines remain eligible for preloading; compute pipelines keep their required first-bind build and wait. Unset, 1, 0, and unrecognized values retain their previous behavior.

This PR is ready for review. Our two Windows suite runs reproduced the cubemap assertion tracked in #718. The failures and isolated reruns are recorded under Tested.

What is in it

  • pso_async.rs: filter pipeline type before starting/enqueueing preload workers; preserve pending-job ownership. A scheduling regression checks five settings in fresh processes, nonzero real-result selection at first use and exact-once completion.
  • README documents the option. Authored on official e50836b; cleanly mergeable with checked main beaa245.

Tested

  • Windows 11 build 26200, Intel Core i5-10400, RTX 3060 Ti, driver 32.0.16.1714, Rust 1.100.0 MSVC. One Cargo build job; debug tests, release startup runs.
  • Focused hle::d3d12x::pso_async::used_tests: 3 passed, 0 failed, 0 ignored on identical source immediately before b1530ac was committed. These scheduling cases also passed in both exact-head full runs.
  • Clean b1530ac5454469703db46e3c6366b6264486684e: cargo build --locked --workspace, cargo test --locked --workspace --no-run and cargo build --locked --release --workspace passed, with fresh synthetic title/DLL fixtures and the packaged DXC pair.
  • cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture: 702 passed, 3 failed, 41 ignored, twice with unchanged source/settings. Both hit placed_title_textures_share_vram_and_preserve_pixels at the cubemap reuse assertion, then PoisonError in transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory. Each exact failing case passed 1/0/0 in a fresh isolated process. Both full attempts explicitly skipped gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware because this adapter has no wave64. Optional samples/XG oracle were unset.
  • Separate candidate-only feature check: 90-second title limit, graphics, DXC threads 2, private clone of an earlier 196-set history, hidden desktop, verified hard job-memory backstop and no input. Actual report: exit 0, no crash/removal/OOM/guard stop, 542 presents, 15,462 MiB sampled peak process commit. Two preload threads logged graphics PSO successes and at least 512 completed preload jobs; that counter includes refusals (40 known MS-in-AS translation refusals), not 512 successful PSOs. One compute PSO built on another thread, none logged on the observed preload threads. Frame 500 had a readable Account Picker/Player 1 footer over a uniform dark background.

Independent hardware results

  • On an RTX 3080 Ti, thehollowedone compared graphics-only and full preloading. Both produced all 1,536 expected compute readback values. Hardware check
  • On an RTX 3060 12 GB, Anon64 reached world loading at about 55 seconds in both runs. Both ended at the title's watchdog, at 116 seconds on main and 104 seconds with graphics-only preloading. Each setting was tested once. Loading comparison

Regression run

Two fresh 60-second runs of the same title, each on a unique non-input Win32 desktop, offline, no input, distinct initially empty XCL data/DXIL caches, and the same adapter/DXC pair. Defaults were used; the feature check above is separate. Vendor/OS caches were not reset. Presentation counts are used only for the startup threshold.

Baseline:

xcl-smoke v1
commit: e50836bdf6f5c026f281d545ed86fb2f07ba6e6a
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 295 (PresentX 295)
presents per 2 s (last 3): 13 13 13
device removals: 0
crashes: 0
peak commit: 15393 MB

Candidate:

xcl-smoke v1
commit: b1530ac5454469703db46e3c6366b6264486684e
gpu: NVIDIA GeForce RTX 3060 Ti
title: 419239bf
seconds: 60
exit: 0x0
frames shown: 286 (PresentX 287)
presents per 2 s (last 3): 13 13 12
device removals: 0
crashes: 0
peak commit: 15371 MB

Not tested

  • Both local full-suite attempts on this head reproduced the #718 failures described above.
  • The 60-second empty-history runs establish startup compatibility only. No warm-history default-policy control or longer prologue/gameplay run was performed; memory/FPS gains and a loading-crash fix are not established.
  • AMD/Intel adapters, wave64 hardware and console-reference texture accuracy.

AI use

  • OpenAI Codex (GPT-6; exact model variant unavailable in this agent context): implementation, tests, independent source review, actual local validation, and description. The counts and observations above came from the named runs.

I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord

**@⁠Prime1997** on GitHub · 2026-11-24 06:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/828) `Prime1997:contrib/graphics-only-preload` → `main` · +83 −13 · 2 files · 1 commits · open Adds `XCL_PSO_PRELOAD=graphics` as an optional admission policy for #690. Remembered graphics pipelines remain eligible for preloading; compute pipelines keep their required first-bind build and wait. Unset, `1`, `0`, and unrecognized values retain their previous behavior. This PR is ready for review. Our two Windows suite runs reproduced the cubemap assertion tracked in #718. The failures and isolated reruns are recorded under **Tested**. **What is in it** - `pso_async.rs`: filter pipeline type before starting/enqueueing preload workers; preserve pending-job ownership. A scheduling regression checks five settings in fresh processes, nonzero real-result selection at first use and exact-once completion. - README documents the option. Authored on official `e50836b`; cleanly mergeable with checked main `beaa245`. **Tested** - Windows 11 build 26200, Intel Core i5-10400, RTX 3060 Ti, driver 32.0.16.1714, Rust 1.100.0 MSVC. One Cargo build job; debug tests, release startup runs. - Focused `hle::d3d12x::pso_async::used_tests`: **3 passed, 0 failed, 0 ignored** on identical source immediately before `b1530ac` was committed. These scheduling cases also passed in both exact-head full runs. - Clean `b1530ac5454469703db46e3c6366b6264486684e`: `cargo build --locked --workspace`, `cargo test --locked --workspace --no-run` and `cargo build --locked --release --workspace` passed, with fresh synthetic title/DLL fixtures and the packaged DXC pair. - `cargo test --locked --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **702 passed, 3 failed, 41 ignored**, twice with unchanged source/settings. Both hit `placed_title_textures_share_vram_and_preserve_pixels` at the cubemap reuse assertion, then `PoisonError` in `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory`. Each exact failing case passed **1/0/0** in a fresh isolated process. Both full attempts explicitly skipped `gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware` because this adapter has no wave64. Optional samples/XG oracle were unset. - Separate candidate-only feature check: 90-second title limit, `graphics`, DXC threads 2, private clone of an earlier 196-set history, hidden desktop, verified hard job-memory backstop and no input. Actual report: exit 0, no crash/removal/OOM/guard stop, **542 presents**, **15,462 MiB** sampled peak process commit. Two preload threads logged graphics PSO successes and at least 512 completed preload jobs; that counter includes refusals (40 known MS-in-AS translation refusals), not 512 successful PSOs. One compute PSO built on another thread, none logged on the observed preload threads. Frame 500 had a readable Account Picker/Player 1 footer over a uniform dark background. **Independent hardware results** - On an RTX 3080 Ti, thehollowedone compared graphics-only and full preloading. Both produced all 1,536 expected compute readback values. [Hardware check](https://github.com/ivall/xcl/pull/828#issuecomment-7124357188) - On an RTX 3060 12 GB, Anon64 reached world loading at about 55 seconds in both runs. Both ended at the title's watchdog, at 116 seconds on main and 104 seconds with graphics-only preloading. Each setting was tested once. [Loading comparison](https://github.com/ivall/xcl/pull/828#issuecomment-7124275978) **Regression run** Two fresh 60-second runs of the same title, each on a unique non-input Win32 desktop, offline, no input, distinct initially empty XCL data/DXIL caches, and the same adapter/DXC pair. Defaults were used; the feature check above is separate. Vendor/OS caches were not reset. Presentation counts are used only for the startup threshold. Baseline: ``` xcl-smoke v1 commit: e50836bdf6f5c026f281d545ed86fb2f07ba6e6a gpu: NVIDIA GeForce RTX 3060 Ti title: 419239bf seconds: 60 exit: 0x0 frames shown: 295 (PresentX 295) presents per 2 s (last 3): 13 13 13 device removals: 0 crashes: 0 peak commit: 15393 MB ``` Candidate: ``` xcl-smoke v1 commit: b1530ac5454469703db46e3c6366b6264486684e gpu: NVIDIA GeForce RTX 3060 Ti title: 419239bf seconds: 60 exit: 0x0 frames shown: 286 (PresentX 287) presents per 2 s (last 3): 13 13 12 device removals: 0 crashes: 0 peak commit: 15371 MB ``` **Not tested** - Both local full-suite attempts on this head reproduced the #718 failures described above. - The 60-second empty-history runs establish startup compatibility only. No warm-history default-policy control or longer prologue/gameplay run was performed; memory/FPS gains and a loading-crash fix are not established. - AMD/Intel adapters, wave64 hardware and console-reference texture accuracy. **AI use** - OpenAI Codex (GPT-6; exact model variant unavailable in this agent context): implementation, tests, independent source review, actual local validation, and description. The counts and observations above came from the named runs. I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. [Test coordination on Discord](https://discord.gg/gK3y7WRRY)
XCL_PSO_PRELOAD=graphics keeps remembered graphics pipelines eligible for
preloading while compute pipelines retain their ordinary first-bind build
and wait. Unset, 1, 0 and unrecognized values retain their existing behavior.
The existing queues, workers and exact-once job ownership are unchanged.

Extend #690 with an opt-in admission policy, not a default or dispatch change.
The CPU scheduling regression runs five policy values in fresh processes and
checks actual remembered graphics/compute submission and real-value selection.

Assisted-by: OpenAI Codex (GPT-6; exact model variant unavailable)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:55 +00:00
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 06:43 UTC · original

Regression runs for this PR's head b1530ac and for its base main e50836b, on a retail title (same title, 60 s each), made with scripts/smoke.ps1 (release, clean tree at each commit) and pasted unedited, for Regression run.

main:

xcl-smoke v1
commit: e50836bdf6f5c026f281d545ed86fb2f07ba6e6a
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1648 (PresentX 1648)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16639 MB

this PR:

xcl-smoke v1
commit: b1530ac5454469703db46e3c6366b6264486684e
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16713 MB

Tested

  • NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974, Rust 1.90.0

Not tested

  • the unit tests on this machine
  • XCL_PSO_PRELOAD=graphics itself: these runs use the default, which this PR leaves as it was (a world-loading run with graphics follows separately)

Report written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 06:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7124221846) Regression runs for this PR's head `b1530ac` and for its base `main` `e50836b`, on a retail title (same title, 60 s each), made with `scripts/smoke.ps1` (release, clean tree at each commit) and pasted unedited, for **Regression run**. main: ``` xcl-smoke v1 commit: e50836bdf6f5c026f281d545ed86fb2f07ba6e6a gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1648 (PresentX 1648) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16639 MB ``` this PR: ``` xcl-smoke v1 commit: b1530ac5454469703db46e3c6366b6264486684e gpu: NVIDIA GeForce RTX 3060 title: retail-title seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16713 MB ``` **Tested** - NVIDIA GeForce RTX 3060 12 GB (driver 581.80, wave32), Intel Core i9-14900KF, Windows 11 25H2 26200.9974, Rust 1.90.0 **Not tested** - the unit tests on this machine - `XCL_PSO_PRELOAD=graphics` itself: these runs use the default, which this PR leaves as it was (a world-loading run with `graphics` follows separately) Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠Anon64 on GitHub · 2026-11-24 06:46 UTC · original

World-loading run with XCL_PSO_PRELOAD=graphics, for the mode itself (the smoke runs above use the default). This PR's head b1530ac merged onto main beaa245 (clean merge), release, XCL_NETWORK=0, A pressed every 4 s from 20 s (XCL_PRESS_A_AT), warm caches, same RTX 3060 12 GB as above. One run each, so a difference of a few seconds is within what these runs vary by.

main beaa245 + this PR, XCL_PSO_PRELOAD=graphics
world loading from ~55 s ~55 s
frames stop ~90 s ~80 s
title's watchdog (+0x23cf683) 116 s 104 s
Wait64BitValueX timeouts 0 0
slowest compute pipeline build 526 KB DXIL, 20.7 s 508 KB DXIL, 7.9 s
video memory at the end (12 GB card) 14.1 GB 14.2 GB

So on this machine graphics-only preloading does not get the title further. For context: thread dumps on #754 (my comment there) show the title's threads blocked in resolve_wait on a compute pipeline both with the build-ahead threads holding it and with preloading off, so leaving compute out of the preload moves which thread builds the pipeline but not that the title waits for it.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

**@⁠Anon64** on GitHub · 2026-11-24 06:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7124275978) World-loading run with `XCL_PSO_PRELOAD=graphics`, for the mode itself (the smoke runs above use the default). This PR's head `b1530ac` merged onto `main` `beaa245` (clean merge), release, `XCL_NETWORK=0`, A pressed every 4 s from 20 s (`XCL_PRESS_A_AT`), warm caches, same RTX 3060 12 GB as above. One run each, so a difference of a few seconds is within what these runs vary by. | | `main` `beaa245` | + this PR, `XCL_PSO_PRELOAD=graphics` | |---|---|---| | world loading from | ~55 s | ~55 s | | frames stop | ~90 s | ~80 s | | title's watchdog (`+0x23cf683`) | 116 s | 104 s | | `Wait64BitValueX` timeouts | 0 | 0 | | slowest compute pipeline build | 526 KB DXIL, 20.7 s | 508 KB DXIL, 7.9 s | | video memory at the end (12 GB card) | 14.1 GB | 14.2 GB | So on this machine graphics-only preloading does not get the title further. For context: thread dumps on #754 (my comment there) show the title's threads blocked in `resolve_wait` on a compute pipeline both with the build-ahead threads holding it and with preloading off, so leaving compute out of the preload moves which thread builds the pipeline but not that the title waits for it. Written with Claude Code (Claude Opus 5.5) from runs on this machine.
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 06:51 UTC · original

Native D3D12 check

I tested b1530ac applied to beaa245 on Windows 11 build 26300, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, release. The policy source matched the PR head exactly.

I extended the stock wave64 compute readback fixture to seed one remembered compute shader with a cold DXIL cache. With XCL_PSO_PRELOAD=1, the preload worker completed its pipeline before the first bind. With graphics, the pipeline was still pending at bind and that bind resolved it. Both modes built one real pipeline and matched all 1,536 expected GPU readback values. Each mode passed 1/1. The stock used_tests passed 3/3. Zero failures, ignores or skips.

cargo test --release --offline --locked -p xcl --lib hle::d3d12x::pso_async::used_tests -- --nocapture --test-threads=1
cargo test --release --offline --locked -p xcl --test gpu_compute_e2e console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --exact --nocapture --test-threads=1

This checks the compute dispatch contract on hardware. It leaves the world-loading performance question open.

AI use
Codex (GPT-6, exact variant unavailable) extended the scratch fixture, ran the tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 06:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7124357188) **Native D3D12 check** I tested [`b1530ac`](https://github.com/ivall/xcl/commit/b1530ac5454469703db46e3c6366b6264486684e) applied to [`beaa245`](https://github.com/ivall/xcl/commit/beaa245ca04e212f064efc7cafcdce104bc5c0a2) on Windows 11 build 26300, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, release. The policy source matched the PR head exactly. I extended the stock wave64 compute readback fixture to seed one remembered compute shader with a cold DXIL cache. With `XCL_PSO_PRELOAD=1`, the preload worker completed its pipeline before the first bind. With `graphics`, the pipeline was still pending at bind and that bind resolved it. Both modes built one real pipeline and matched all 1,536 expected GPU readback values. Each mode passed 1/1. The stock `used_tests` passed 3/3. Zero failures, ignores or skips. `cargo test --release --offline --locked -p xcl --lib hle::d3d12x::pso_async::used_tests -- --nocapture --test-threads=1` `cargo test --release --offline --locked -p xcl --test gpu_compute_e2e console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --exact --nocapture --test-threads=1` This checks the compute dispatch contract on hardware. It leaves the world-loading performance question open. **AI use** Codex (GPT-6, exact variant unavailable) extended the scratch fixture, ran the tests and drafted this report.
Author
Owner

@⁠dcastell1 on GitHub · 2026-11-24 06:54 UTC · original

Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on main@beaa245:

patch -p1 < this PR            # clean, no fuzz
cargo test --workspace -- --test-threads=4
exit 0

All green: the graphics-only pipeline preload builds and runs, the workspace has no new failure against main on this box (737 passed there), and nothing else changes verdict. Restored the tree afterwards; no game data, hardware adapter, no Wine.

AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.

**@⁠dcastell1** on GitHub · 2026-11-24 06:54 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7124421825) Verified on Windows 11 10.0.26300, NVIDIA GeForce RTX 5090 (driver 621.24), Rust 1.100.0 MSVC 14.44.35207, debug build, on `main@beaa245`: ``` patch -p1 < this PR # clean, no fuzz cargo test --workspace -- --test-threads=4 exit 0 ``` All green: the graphics-only pipeline preload builds and runs, the workspace has no new failure against `main` on this box (737 passed there), and nothing else changes verdict. Restored the tree afterwards; no game data, hardware adapter, no Wine. AI-assisted (opencode): applied the patch to a built tree, ran the suite, reverted it.
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 07:17 UTC · original

Linux / AMD RDNA3 datapoint.

Merged state: head b1530ac onto main a1672ef, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 705 passed, 11 failed, 41 ignored. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Graphics-only pipeline preloading tests green; no new failures.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 07:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7124834960) Linux / AMD RDNA3 datapoint. **Merged state:** head `b1530ac` onto main `a1672ef`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **705 passed, 11 failed, 41 ignored**. Failures are the known Wine-lane set from my #42 rows plus #718 trio members; nothing here fails because of your change. Graphics-only pipeline preloading tests green; no new failures. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠Prime1997 on GitHub · 2026-11-24 08:14 UTC · original

I'm gunna push this for ready to review as I want to know what others think as well.

Even if we passed this for others to test, I want to know what the main reviewers think.

-Prime.

**@⁠Prime1997** on GitHub · 2026-11-24 08:14 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7125888539) I'm gunna push this for ready to review as I want to know what others think as well. Even if we passed this for others to test, I want to know what the main reviewers think. -Prime.
Author
Owner

@⁠Royalflamejlh on GitHub · 2026-11-24 14:53 UTC · original

Linux (Wine + vkd3d-proton) + NVIDIA test of b1530ac on main 09940bb, 6 alternated runs of 100 s: with the default preload the title's burst of pipeline creation after its loading screen starts crawled in 3 of 3 runs and it never reached its world load; with XCL_PSO_PRELOAD=graphics it was normal in 3 of 3. Under Wine this switch is the difference between reaching the world load and not, and below is why.

Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, VKD3D_CONFIG=ignore_shared_fence. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled to x86_64-pc-windows-gnu (rustc 1.98.0), DXC 1.9.2609.5, XCL_NETWORK=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s through XCL_PRESS_AT. used-pipelines.txt held 1,131 shader sets from earlier runs that had reached the world load. b1530ac merged onto 09940bb without conflicts; it conflicts with main since #891 was merged.

Tested

  • cargo test --release -p xcl --lib preload_policy under Wine, on the merge: 1 passed, 0 failed.
default, run 1 / 2 / 3 XCL_PSO_PRELOAD=graphics, run 1 / 2 / 3
[SHADER] lines from 60 s to 80 s 1,009 / 1,231 / 2 10,465 / 10,465 / 10,468
DirectStorage requests from 70 s to 100 s 93 / 1,032 / 1,815 51,231 / 49,340 / 62,198
presents from 80 s to 100 s 570 / 583 / 580 (the loading pictures, 29 fps) 68 / 118 / 113 (the world loading)
compute builds of 5 s or more before 100 s 1 / 2 / 1 (14 s to 83 s long, 568 KB to 1.4 MB of DXIL) 0 / 0 / 0
compute PSO with the translated console CS lines 365 / 367 / 370 8 / 8 / 15
pipelines built ahead (last count logged) 1,024 / 1,024 / 1,024 1,024 / 1,024 / 1,024

Run 3 with graphics ended at 98.2 s in the copy_from fault of #662 (msvcrt.dll+0xa4f9), which #684 fixes and this tree does not have; the default runs never got that far. XCL_PSO_PRELOAD=0 on 09940bb without this change was also normal in 3 of 3 runs (10,465 lines each), so graphics keeps the graphics preload at no cost seen here.

Why the default crawls under Wine (thread dumps at 90 s and 110 s of a slow default run on main beaa245 + #684; ntdll.dll frames named with nm on Wine's ntdll.dll)

title, 5 threads:  RtlEnterCriticalSection < RtlFreeHeap < RtlReAllocateHeap < RawVec<rdna2::Decoded>::grow_one < gpu::xbox::parse < real::translated_mesh_stream < dxc::cached_only < real::dev_create_pipeline_state < game+0x2479a8d
                   RtlEnterCriticalSection < RtlAllocateHeap < gpu::rdna2::decode < gpu::xbox::parse < gpu::shader::capture < null::capture_stream_desc < real::dev_create_pipeline_state
xcl-dxc-0:         RtlEnterCriticalSection < RtlAllocateHeap < combase.dll+0x181f6 < dxcompiler.dll+0xdb83e < …           (the same in both dumps, 20 s apart)
xcl-pso-pre-2:     dxc::compile < dxc::compile_cached_in < pso::console_to_dxil_in < real::translated_compute_pso < real::build_compute      (waits for that compile)

The preload worker is building a remembered compute pipeline whose DXIL is not in the cache, and DXC takes 23 to 50 s for these programs, allocating from the process heap all the while. The title's five pipeline-creation threads allocate from the same heap as XCL parses each shader, and under Wine that heap has one critical section for these sizes. Sampled 40 times over 2 s in another slow run, each of the five used 14 to 18% of a core and was in a futex wait in about 70% of the samples.

Read

  • pso_async.rs:250: with graphics a remembered compute pipeline is not queued at all, so nothing compiles it ahead and its first bind builds it, as with the preload off. That is what the table shows: 8 to 15 compute builds logged by 100 s against about 365, and none long. The cost moves to the first bind in the world load, which is the stall #533 and #891 are about; these 100 s runs end before it.
  • pso_async.rs:247: the default stays All, so a Wine user gets the crawl unless they know the switch. Would graphics as the default under Wine be in scope here, or is that for a separate change? I have not run Windows and do not know whether the default hurts there; its heap does not have this one lock. #688 takes the other way to the same end: with DXC on heaps of its own, the default preload was normal here in 3 of 3 runs (main 67a3735, same machine).

Not tested: past 100 s; this switch together with #684 and XCL_PSO_WAIT_MS; native Windows; Proton's Wine; the rest of the test suite; AMD and Intel.

AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the title with XCL_PRESS_AT, took the thread dumps and samples, named the frames and wrote this report.

**@⁠Royalflamejlh** on GitHub · 2026-11-24 14:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7135121518) Linux (Wine + vkd3d-proton) + NVIDIA test of `b1530ac` on `main` `09940bb`, 6 alternated runs of 100 s: with the default preload the title's burst of pipeline creation after its loading screen starts crawled in 3 of 3 runs and it never reached its world load; with `XCL_PSO_PRELOAD=graphics` it was normal in 3 of 3. Under Wine this switch is the difference between reaching the world load and not, and below is why. **Setup:** Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch, `VKD3D_CONFIG=ignore_shared_fence`. RTX 4070 12 GB (driver 615.71.09, 32-lane waves), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled to `x86_64-pc-windows-gnu` (rustc 1.98.0), DXC 1.9.2609.5, `XCL_NETWORK=0`. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s through `XCL_PRESS_AT`. `used-pipelines.txt` held 1,131 shader sets from earlier runs that had reached the world load. `b1530ac` merged onto `09940bb` without conflicts; it conflicts with `main` since #891 was merged. **Tested** - `cargo test --release -p xcl --lib preload_policy` under Wine, on the merge: 1 passed, 0 failed. | | default, run 1 / 2 / 3 | `XCL_PSO_PRELOAD=graphics`, run 1 / 2 / 3 | |---|---|---| | `[SHADER]` lines from 60 s to 80 s | 1,009 / 1,231 / 2 | 10,465 / 10,465 / 10,468 | | DirectStorage requests from 70 s to 100 s | 93 / 1,032 / 1,815 | 51,231 / 49,340 / 62,198 | | presents from 80 s to 100 s | 570 / 583 / 580 (the loading pictures, 29 fps) | 68 / 118 / 113 (the world loading) | | compute builds of 5 s or more before 100 s | 1 / 2 / 1 (14 s to 83 s long, 568 KB to 1.4 MB of DXIL) | 0 / 0 / 0 | | `compute PSO with the translated console CS` lines | 365 / 367 / 370 | 8 / 8 / 15 | | pipelines built ahead (last count logged) | 1,024 / 1,024 / 1,024 | 1,024 / 1,024 / 1,024 | Run 3 with `graphics` ended at 98.2 s in the `copy_from` fault of #662 (`msvcrt.dll+0xa4f9`), which #684 fixes and this tree does not have; the default runs never got that far. `XCL_PSO_PRELOAD=0` on `09940bb` without this change was also normal in 3 of 3 runs (10,465 lines each), so `graphics` keeps the graphics preload at no cost seen here. **Why the default crawls under Wine** (thread dumps at 90 s and 110 s of a slow default run on `main` `beaa245` + #684; `ntdll.dll` frames named with `nm` on Wine's `ntdll.dll`) ``` title, 5 threads: RtlEnterCriticalSection < RtlFreeHeap < RtlReAllocateHeap < RawVec<rdna2::Decoded>::grow_one < gpu::xbox::parse < real::translated_mesh_stream < dxc::cached_only < real::dev_create_pipeline_state < game+0x2479a8d RtlEnterCriticalSection < RtlAllocateHeap < gpu::rdna2::decode < gpu::xbox::parse < gpu::shader::capture < null::capture_stream_desc < real::dev_create_pipeline_state xcl-dxc-0: RtlEnterCriticalSection < RtlAllocateHeap < combase.dll+0x181f6 < dxcompiler.dll+0xdb83e < … (the same in both dumps, 20 s apart) xcl-pso-pre-2: dxc::compile < dxc::compile_cached_in < pso::console_to_dxil_in < real::translated_compute_pso < real::build_compute (waits for that compile) ``` The preload worker is building a remembered compute pipeline whose DXIL is not in the cache, and DXC takes 23 to 50 s for these programs, allocating from the process heap all the while. The title's five pipeline-creation threads allocate from the same heap as XCL parses each shader, and under Wine that heap has one critical section for these sizes. Sampled 40 times over 2 s in another slow run, each of the five used 14 to 18% of a core and was in a `futex` wait in about 70% of the samples. **Read** - `pso_async.rs:250`: with `graphics` a remembered compute pipeline is not queued at all, so nothing compiles it ahead and its first bind builds it, as with the preload off. That is what the table shows: 8 to 15 compute builds logged by 100 s against about 365, and none long. The cost moves to the first bind in the world load, which is the stall #533 and #891 are about; these 100 s runs end before it. - `pso_async.rs:247`: the default stays `All`, so a Wine user gets the crawl unless they know the switch. Would `graphics` as the default under Wine be in scope here, or is that for a separate change? I have not run Windows and do not know whether the default hurts there; its heap does not have this one lock. #688 takes the other way to the same end: with DXC on heaps of its own, the default preload was normal here in 3 of 3 runs (`main` `67a3735`, same machine). **Not tested:** past 100 s; this switch together with #684 and `XCL_PSO_WAIT_MS`; native Windows; Proton's Wine; the rest of the test suite; AMD and Intel. **AI use:** Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the title with `XCL_PRESS_AT`, took the thread dumps and samples, named the frames and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 10:38 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 10:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/828#issuecomment-7159977024) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • README.md
  • crates/xcl/src/hle/d3d12x/pso_async.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/828/head:github-bot/gh-828'
git switch 'github-bot/gh-828'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-828'
git switch 'github-bot/gh-828'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-828'
git switch 'github-bot/gh-828'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-828'
git switch 'main'
git merge --squash 'github-bot/gh-828'
git switch 'main'
git merge --ff-only 'github-bot/gh-828'
git switch 'main'
git merge 'github-bot/gh-828'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.