D3D12.X: optional graphics-only pipeline preloading #822
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/828"
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 Prime1997 on 2026-11-24T06:17:53Z.
Adds
XCL_PSO_PRELOAD=graphicsas 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.e50836b; cleanly mergeable with checked mainbeaa245.Tested
hle::d3d12x::pso_async::used_tests: 3 passed, 0 failed, 0 ignored on identical source immediately beforeb1530acwas committed. These scheduling cases also passed in both exact-head full runs.b1530ac5454469703db46e3c6366b6264486684e:cargo build --locked --workspace,cargo test --locked --workspace --no-runandcargo build --locked --release --workspacepassed, 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 hitplaced_title_textures_share_vram_and_preserve_pixelsat the cubemap reuse assertion, thenPoisonErrorintransitions_apply_when_their_list_is_submittedandd32s8_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 skippedgpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardwarebecause this adapter has no wave64. Optional samples/XG oracle were unset.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
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:
Candidate:
Not tested
AI use
I use a temporary Discord to coordinate my work. Anyone helping test XCL or compare results is welcome. Test coordination on Discord
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-24T06:43:14Z.
Regression runs for this PR's head
b1530acand for its basemaine50836b, on a retail title (same title, 60 s each), made withscripts/smoke.ps1(release, clean tree at each commit) and pasted unedited, for Regression run.main:
this PR:
Tested
Not tested
XCL_PSO_PRELOAD=graphicsitself: these runs use the default, which this PR leaves as it was (a world-loading run withgraphicsfollows separately)Report written with Claude Code (Claude Opus 5.5) from runs on this machine.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-24T06:46:26Z.
World-loading run with
XCL_PSO_PRELOAD=graphics, for the mode itself (the smoke runs above use the default). This PR's headb1530acmerged ontomainbeaa245(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.mainbeaa245XCL_PSO_PRELOAD=graphics+0x23cf683)Wait64BitValueXtimeoutsSo 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_waiton 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.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T06:51:11Z.
Native D3D12 check
I tested
b1530acapplied tobeaa245on 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. Withgraphics, 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 stockused_testspassed 3/3. Zero failures, ignores or skips.cargo test --release --offline --locked -p xcl --lib hle::d3d12x::pso_async::used_tests -- --nocapture --test-threads=1cargo 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=1This 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.
Imported from ivall/xcl. Originally posted by dcastell1 on 2026-11-24T06:54:58Z.
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:All green: the graphics-only pipeline preload builds and runs, the workspace has no new failure against
mainon 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.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T07:17:52Z.
Linux / AMD RDNA3 datapoint.
Merged state: head
b1530aconto maina1672ef, 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.
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-24T08:14:13Z.
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.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-24T14:53:39Z.
Linux (Wine + vkd3d-proton) + NVIDIA test of
b1530aconmain09940bb, 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; withXCL_PSO_PRELOAD=graphicsit 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 tox86_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 throughXCL_PRESS_AT.used-pipelines.txtheld 1,131 shader sets from earlier runs that had reached the world load.b1530acmerged onto09940bbwithout conflicts; it conflicts withmainsince #891 was merged.Tested
cargo test --release -p xcl --lib preload_policyunder Wine, on the merge: 1 passed, 0 failed.XCL_PSO_PRELOAD=graphics, run 1 / 2 / 3[SHADER]lines from 60 s to 80 scompute PSO with the translated console CSlinesRun 3 with
graphicsended at 98.2 s in thecopy_fromfault of #662 (msvcrt.dll+0xa4f9), which #684 fixes and this tree does not have; the default runs never got that far.XCL_PSO_PRELOAD=0on09940bbwithout this change was also normal in 3 of 3 runs (10,465 lines each), sographicskeeps 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
mainbeaa245+ #684;ntdll.dllframes named withnmon Wine'sntdll.dll)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
futexwait in about 70% of the samples.Read
pso_async.rs:250: withgraphicsa 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 staysAll, so a Wine user gets the crawl unless they know the switch. Wouldgraphicsas 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 (main67a3735, 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.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T10:38:39Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by bmjask on 2026-11-29T22:46:07Z.
Review: COMMENTED
Critical review of current head
b1530ac5. I found no source-level correctness blocker in filtering preload admission to graphics while leaving first-bind compute builds intact; existing Windows GPU readbacks compare both modes. The branch conflicts with current main, so its policy needs rebasing onto today's preload scheduler. Please preserve a cold-cache compute first-bind regression and compare world-entry time and compile-thread utilization, because graphics-only preloading trades startup contention for a possible compute stall later. No local Windows run.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:39:58Z.
Review (head
b1530ac5, diff read, not a merge-check; it conflicts with main, so not built or run):pso_async.rswas 394 lines at this base and is about 13k on main; thepreload()it edits no longer exists. Preloading is now split between the ranked preload of pipelines an earlier run used (ecf7e400, ~4581) and a backlog for pipelines no run used, with its own compute lane (send_ahead~5054,preload_backlog~4973), so a "graphics only" mode would need a decision about both.XCL_CS_PSO_WAIT_MS) instead of waiting, so the README line "compute pipelines still build and wait at their first bind" would be wrong. Open #889 goes the other way (build compute ahead). No gain was measured.Fine: correct on its own base, default unchanged, and the child-process test checks each setting. Recommendation: close; reopen against main's preload code only with a measured need.
AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.