Shaders: xcl pipelines compiles a run's queued pipelines outside the title #759
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!759
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-759"
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?
@oishigeso on GitHub · 2026-11-24 04:44 UTC · original
oishigeso:pipelines-3-tool→main· +1341 −31 · 11 files · 15 commits · draftPart 3 of 3 for #755. Stacked on #758; its own commits are the eight after #758's head.
xcl pipelines <game | data folder | pipelines.bin> [--watch]reads the journal from part 2 andmakes each pipeline on its own D3D12 device, the way the title would:
prep_graphicsfor VS /PS, and for compute the same path with XCL's ABI root signature. It uses the GPU the title's
xcl.tomlnames. Afterwards the DXIL cache, the driver's cache anddriver_cache(#634) holdwhat the title asks for. Run it before the next run, or next to the running title with
--watch, which follows the journal and takes the used pipelines first.Translation and DXC run on half the cores at below-normal priority; the driver's compiles run a
few at a time (
XCL_PIPELINE_THREADS). Progress is kept inpipelines.donefor this binary,and failures are retried by the next run. It must be the same xcl.exe as the title's. GS / HS /
DS and mesh pipelines are left to the title.
Unlike #690, which builds the pipelines an earlier run used, inside the title, this one covers
every queued pipeline, and none of the work happens in the title's process.
Two small changes it needs:
pso::set_mem_windows: the run's memory windows come from the journal, becauseprep_graphicstranslates throughconsole_to_dxil_forlike the title does.shader::readableno longer creates the UMA (uma::existing). Without this, the tool reserved12 GiB of windows and a 512 MB coherent window just for a pointer check.
704 lines: the command (
pipelines.rs) is 581 of them, with its tests, and it does nothing on itsown if split.
What is in it
crates/xcl/src/pipelines.rs,crates/xcl/src/main.rs,crates/xcl/src/lib.rs,README), with its tests; a console control handler removes
.tryingon Ctrl+C, so what wascut short is made again by the next run (a crash still leaves it to the title)
warm(crates/xcl/src/hle/d3d12x/real.rs): one journal entry made on a plain device, withthe switch-form fallback of #680
pso::set_mem_windows(crates/xcl/src/gpu/recomp/pso.rs),uma::existing(
crates/xcl/src/gpu/uma.rs, used bycrates/xcl/src/gpu/shader.rs),launcher::resolve_locationmadepub(crate)(crates/xcl/src/launcher.rs)Tested
main9e3831e:cargo test -p xcl --lib -- pipeline heap_window --test-threads=1: 14 passed, 0 failed (with #680's heap-window tests).d9cea04: the tool replays a run's heap-window flag and, like the title, makes a pipeline the driver refuses with heap windows again in the switch form (with_switch_fallback)bbf56a8(Ctrl+C) and a merge ofmainc160d86(#1426; thexcl shaders --directhelp and this command's both kept inmain.rs): the same 14 tests passdd66d20, #758'sc02d059merged in:cargo test -p xcl --lib -- pipeline heap_window pso_journal --test-threads=1: 16 passed, 0 failed; the run below is on this headXCL_HEAP_WINDOWS=1(exit 0x0, 437 frames), thenxcl pipelines --limit 100without it on that journal:4 memory windows (from the descriptor heap), made 100, failed 0; the run's earlier switch-form frames were left outcargo test --workspace -- --test-threads=4: 659 passed, 3 failed, 21 ignored; the 3 failures (title_textures::placed_title_textures_share_vram_and_preserve_pixels,title_textures::transitions_apply_when_their_list_is_submitted,vram::d32s8_targets_take_their_own_size_of_video_memory) fail onmain(f4ce27c) the same way in a full run (657 passed, 3 failed there) and pass alone; no GPU test SKIPPEDcache (
XCL_DXIL_CACHE). Run A: empty cache – the title compiled 4 programs itself (hits 0,misses 4). Then
xcl pipelinesfor 8 min into a second empty cache (50 895 of the journal's57 798 pipelines, 17/s at first and ~870/s at the end, as later pipelines share already
compiled shaders). Run B on that cache alone: hits 4, misses 0, 0 compilations in the title
(
report.json→d3d12.dxil_cache). Both runs on the same build, exit 0x0, no crashRegression run
main:
PR (this PR's head commit; the title is run through a folder named RetailTitle):
Not tested
--watchnext to a running titlecome first)
driver_cachematters most), Intel, RDNA4XCL_DIRECT_DXIL(#1426): the tool translates throughconsole_to_dxil_foras the title does,so it follows the variable, but the journal does not record it: the tool has to run with the
title's setting, or it fills the cache of the other backend
AI use
c02d059: the journal opens off the title's threads) into pipelines-3-tool dd66d20995@crosettiremi on GitHub · 2026-11-24 05:00 UTC · original
Native AMD follow-up on exact clean head
6dd5c1d: offline compilation eliminated all eight in-title DXIL compilations in a paired 60-second menu capture.RX 7900 XT (20 GiB), Windows 11 build 26100, SDK DXC 1.9.2602.17. Same release executable, fresh copies of the same Series S-profile save/config, networking off and no input in either timed run. The driver-managed Windows cache was shared.
The cold run recorded 55,064 graphics and 2,734 compute entries, 5,651 shader records and four used markers. I copied six original pipeline records and their dependencies into a separate sample journal, including all four marked used (three graphics and one compute), plus two more compute pipelines. The same executable ran
xcl pipelineson the sample with one worker and one driver compile at a time. First pass: made 6, failed 0, skipped 0. Resume: 6 done before, made 0. A fresh progress file with the same cache: made 6, failed 0. The selection retained the original frame bytes. Both menu runs exited 0 and ended at 60 presents per two-second interval.The workspace reported 703 passed, 0 failed, 41 ignored. One counted pass printed a runtime skip for the missing xgameruntime.dll debug-layer fixture. This covers journal capture, resume and DXIL reuse at the menu. The six-entry sample did not establish driver-blob reuse or world-loading stability. Codex (GPT-6) ran the tests and prepared this report.
@JoaoPauluu on GitHub · 2026-11-24 05:28 UTC · original
Test report: #759 under Wine (Linux, NVIDIA):
xcl pipelinesdies of a stack overflow in a warm thread, on the same journal entries every timeI ran the whole flow on GTA VI under Wine / vkd3d-proton: a run that writes the journal,
xcl pipelineson it, then a second run. The journal and most of the command work. Butxcl pipelinesends with a Rust stack overflow in one of itsxcl-warm-*threads, after about 50,600 of 53,315 pipelines. Every rerun stops the same way within 1–2 s, a few entries further on.Setup
experimental-11.0-20261112(wine-11.0), vkd3d-proton v3.1 (4522cc1a) + the patch from #257, DXVK from Proton, DXC 1.9.2609,DXVK_CONFIG="dxgi.hideNvidiaGpu = False"x86_64-pc-windows-gnu(mingw-w64-gcc 16.2.0), release build of this PR's head6dd5c1d(with #757 and #758 under it)scripts/linux/smoke.shfrom #257,XCL_NETWORK=0, a new emptyXCL_DATA_ROOT; the DXIL cache (outside the data root) was warm from earlier runs1. First run (writes the journal)
pipeline journal <data>\RockstarGamesInc.28872443D20A7\cache\pipelines.bin: Sharing violation. (os error 32) – none in this run<data>\RockstarGamesInc.28872443D20A7\cache\pipelines.binwas written during that run (102,084,864 bytes). I didn't look into which process held it; XCL runs the title in a second process.exit: killed (no exit)(the process outlived the 15 s grace).2.
xcl pipelines <data>\RockstarGamesInc.28872443D20A7(same Wine environment,XCL_DXC_DIRset)<data>\RockstarGamesInc.28872443D20A7\cache\pipelines.bin: 53315 pipelines to make (225 the title used), 0 done before, 3503 shaders; 4 memory windows; 6 threads, 4 driver compiles at once50600 done, 2715 left (233.9/s …)and32 driver blobs kept on disk for the next run, then the process ended: exit code 5 after 256 s, withthread 'xcl-warm-2' (1896) has overflowed its stackin its output.pipelines.donewas written (405,176 bytes).<data>\RockstarGamesInc.28872443D20A7\cache\pipelines.bin: 7161 pipelines to make (3 the title used), 50646 done before, 5659 shaders; 4 memory windows; 6 threads, 4 driver compiles at once, thenthread 'xcl-warm-3' (360) has overflowed its stack, exit 5 after 2 s. A third run: 50649 done before,thread 'xcl-warm-0' (464) has overflowed its stack, exit 5 after 1 s.3. Second run (same data root, after the CLI)
<data>\RockstarGamesInc.28872443D20A7\cache\pipelines.bin(57043 entries from earlier runs) –xcl pipelinescompiles them outside the titleexit: 0x0; first presents at 22 s (the first run: 28 s).(
peak commit: 0 MBis XCL reading 0 MB committed under Wine, see #257.)Not tested
--watch; a cold DXIL cache; which journal entries overflow the stack; amainpair for the title runsAI use: Claude Code (Claude Opus 5.5) built the commit, ran everything above on the machine above and wrote this report. The blocks, counts and log lines are pasted from those runs (data-folder paths shortened to
<data>). The account owner asked for test reports to be posted while they were away and has not reviewed this one.@oishigeso on GitHub · 2026-11-24 06:06 UTC · original
Thanks @anes66, and @crosettiremi and @JoaoPauluu for the runs on #757 / #759.
The
pipelines.donereset was a real bug: the file was opened for appending, and on Windows an append handle can't be truncated, soset_len(0)failed unseen.a0390eaopens it for writing instead (a file of another binary starts over, a torn last record is cut off, an open error ends the run with 2) and adds a test for both. I wrote the fix here rather than taking d2a3e01 so the PR stays one author's; the report is credited in the commit.A fresh review of the whole stack afterwards found four more of the same kind, now fixed:
b617c88(#758): a journal write error (a full disk) left half a frame mid-file and noted it as written. A frame is now written whole or cut back, and the journal is off for the rest of the run. An input-layout count from the file is checked against the bytes there before allocating.ab1479a:--watchkept a torn frame's bytes after the next run cut it and wrote over it, misaligning everything after; the unparsed tail is now read again on each poll (test added). The tool built the oldest run's memory windows; it now builds the newest run's.pipelines.doneis opened without write sharing, so a second tool on the same journal is refused.Still open (not fixed here): the tool's device takes the first adapter matching the title's
d3d12_adapterwithout the title's fallback toauto, and the wave32 split flags aren't in the journal, so a different adapter than the title's would compile under other cache keys. Both only matter with several GPUs.New smoke runs on the fixed heads are in #758's and this PR's descriptions.
xcl pipelines) #755@oishigeso on GitHub · 2026-11-24 06:55 UTC · original
@JoaoPauluu thanks for the Wine run, and sorry, I missed your report when I wrote the reply above.
The last ~5 % of a journal are the title's huge compute pipelines: on an RX 6700 XT one took 62 s and 1.5–3 GB in the driver. The tool had two problems there, both fixed now:
dc39e5c: the title makes those one at a time, and only with 3 GB of commit free (BIG_COMPILES,wait_for_commit), but only on itsxcl-pso*threads. The tool'sxcl-warm-*threads went around that rule and ran up to four at once. They now take the same turn.dc39e5c: what a run is making is noted inpipelines.trying, which a run that ends by itself removes. After a crash, the next run leaves those pipelines to the title and goes on. Tested here by stopping a run: the next one printedthe last run ended while making 6 pipelines: left to the titleand continued with the remaining 5 937.788e366: the tool now keeps 6 GB of commit free for DXC (it was 2 GB without--watch).The stack overflow itself I can't reproduce on Windows: there the driver compiles these without a crash. Under Wine the driver compile is vkd3d-proton's DXIL→SPIR-V in the calling thread (64 MB of stack, as the title's own compile threads have), so I suspect the #611 kind of deep recursion on those shaders; the title would meet it too when it builds them. With the change above, a re-run goes past them instead of ending every time.
The
Sharing violationon the journal: only one process writes it at a time (by design). On Windows each run logs one journal open; under Wine a second process of the same run seems to have opened it. If you still have that run's log, does it show twopipeline journallines with different thread ids?mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@milas6669 on GitHub · 2026-11-24 08:34 UTC · original · edited 2026-11-24 08:43 UTC
Test report for the
xcl pipelinestool, on this PR's head788e366with its stack (#758 and the earlier parts) merged ontomain09940bb(clean merge, release build, 9 commits over main).Tested
XCL_NETWORK=0, warm DXIL cache from earlier runs, 4095 MB coherent window.scripts/smoke.ps1. It wrotecache\pipelines.bin(124,907 KB, about 58,970 queued pipelines).xcl pipelines <game folder>with the game closed. It made 51,000 of the 58,970 pipelines in about 22 minutes: it printed about 1,070 pipelines a second around 50,500 done, then it stopped advancing at 51,000 done / 7,953 left. In the last 11 minutes it did 100 pipelines, and in the 90 s before I stopped it none, while using about 2.6 cores and 3.4 GB. The lines just before were driver compiles of 767 KB / 614 KB programs taking 13.5 s and 7.1 s each. I stopped it by hand (so its exit code 1 is mine); at this speed the remaining 7,953 would have taken hours. I did not check whetherpipelines.doneresumes.compute PSO with the translated console CSlines in the title's logpipelines built ahead of their first use/ mesh refusedNot tested
--watch, graphics pipelines separately, AMDAI use
@S1m0ne1997 on GitHub · 2026-11-24 12:21 UTC · original
Test report:
xcl pipelineson a retail journal, RTX 4090 / Windows. It works and is the most useful tool of the stack here. In one process the driver compiles stop scaling: NVIDIA's compiler serializes on the process heap lock.Setup: RTX 4090 (driver 621.24), Ryzen 9 9950X3D (32 threads), 47 GB RAM, Windows 11 26300, release. Tree:
main47efa2e+ this PR's 8 commits (clean cherry-pick) + #688 + #744 + #820 + #684. Tests:pso_journal1 passed,pipelines::3 passed,driver_cache4 passed,pso_async3 passed.pipelines.bin(128 MB): 58 752 pipelines to make (1 358 the title used), 6 102 shaders. About 51 500 were done within minutes (graphics, and compute already indriver_cache). What remains is compute programs of 250 KB – 1.2 MB of DXIL, 30 – 150 s each in the driver.XCL_PIPELINE_THREADS=8+XCL_BIG_COMPILES=8(#820) used 3 – 6.5 of 32 cores; 24 + 24 used 3.2 – 6.5 cores and wrote no blob in 2 min. A stack sample of the same pattern (in--precompile --pipelines, 32 driver compiles) showed 32 threads innvgpucomp64: 19 waiting inRtlAllocateHeapand 13 inRtlFreeHeapon the process heap's critical section, 1 running. That is the contention #688 removes for DXC, but the driver's compiler takes no allocator.XCL_PIPELINES_SHARD=k/nmakes a process take only the pipelines whose hash is k modulo n, with its ownpipelines.<k>of<n>.done/.trying, and read the unsharded.done. With 4 processes × 6 driver compiles (--threads 8,XCL_DXC_THREADS=4), the four used 25.7 of 32 cores, about 20 compute blobs a minute, 4 – 8.5 GB each. Memory is then the limit, and the 6 GB commit reserve kept it in bounds.If a shard option (or several
xcl pipelinesprocesses coordinated through the done file) fits this PR, I can send the change as a follow-up on top of it.AI use: Claude Code with Claude Opus 5.5 applied the stack, ran the builds, tests and passes, took the stack samples and wrote and posted this comment at my request.
@JoaoPauluu on GitHub · 2026-11-24 13:10 UTC · original
@oishigeso, answers to your question, and a rerun on this PR's head
788e366under Wine.The
Sharing violation: the log of that run (6dd5c1d) has only onepipeline journalline, the warning at 2.204 s on thread 904. There is no second line on another thread and no successful open. The 102 MB journal was still written during that run, so something did open it, but that log does not show what. On788e366, with another new, empty data root, I could not reproduce it: one line,pipeline journal: … (0 entries from earlier runs)at 3.301 s, no warning, and onexcl.exe runprocess (understart.exe) at 10 s. I tried to see which Linux processes heldpipelines.binopen, but under Wine the file descriptors are held bywineserver, so that check shows nothing either way. That leaves it unexplained: one run hit it, one did not.xcl pipelineson788e366(same journal throughout: 57 807 pipelines, 5 659 shaders, 4 memory windows; tool output with 6 threads and 4 driver compiles):thread 'xcl-warm-5' has overflowed its stackat about 50 600 done, after 52 sthe last run ended while making 6 pipelines: left to the title, 50 655 done beforethread 'xcl-warm-3' has overflowed its stackafter 408 s (97 more done)pipelines.donelast changed about 1 min in, then nothing for the ~19 min until mytimeout 1200stopped itpipelines.tryingworks as described: each rerun printed the message, did not start those 6 pipelines, and went on with the rest.Title runs (
scripts/linux/smoke.sh, 60 s, before and after the tool runs): 961 and 950 frames,exit: 0x0, no device removal, no crash. The second run read the journal with 63 694 entries. Under Wine,peak commitreads 0 MB, so it is left out.Tested
788e366, release, cross-built forx86_64-pc-windows-gnu, no uncommitted changes. Retail title 1.0.2.1.Not tested
--watch; native Windows; why run 3 stopped advancing.AI use
@claudetools-gh on GitHub · 2026-11-24 13:38 UTC · original · edited 2026-11-24 13:40 UTC
Test report for #759 (with #744 and #573) on NVIDIA, retail title 1.0.2.1: precompiling outside the title cuts the skipped compute work by 85 %.
Setup
main47efa2eplus #744, #759, #573, #1044, #1045, #1046, #1099 (local branch, not pushed),XCL_NETWORK=0.XCL_PSO_WAIT_MS=50(#891), same package, same launch.What we did
xcl pipelines <game>ran outside the title for about 70 min. It got through the used pipelines and grewdriver\from 452 to 865 compute blobs, then we stopped it to measure.Result (same point in the run, ~190–200 s)
+0x23cf683)The intro cinematic plays with sound and letterbox bars, but the scene stays grey/black. Graphics pipelines are warmed only into NVIDIA's own cache, so the draws improve less than the dispatches.
Two things that helped, offered as ideas
--shard i/nlocally: process i takes the hashes withhash % n == iand keeps its ownpipelines.done{i}of{n}/.trying{i}of{n}. Five processes at below-normal priority kept the CPU busy without slowing the desktop. The bottleneck is the ~1,800 compute programs over 256 KB of DXIL, at 30–60 s each in the driver.pipelines.doneis keyed only by the exe. After a driver update every pipeline still counts as done while the driver refuses the blobs. Adding the adapters' VendorId/DeviceId andCheckInterfaceSupportUMD version tobinary_key()fixes it..tryingkeeps every hash a run attempted until a clean exit, and Ctrl+C is the only way to end--watch. The next start then marks finished and failed pipelines as "left to the title". Keeping only in-flight hashes in.trying(add beforewarm, remove after) avoids it.w64 > 0 || (!wave32 && detect_wave64)) keeps a mislabelled wave64 program correct.Not tested
-O1for the giant (>8 MB HLSL) programs shortens the driver's compile. #1096 measured that it does not on an RTX 3050.AI-assisted.
@Filip722 on GitHub · 2026-11-24 13:26 UTC · original · edited 2026-11-24 13:47 UTC
Tested
4522cc1and dxil-spirv1dc543f.788e366af54169678bb6f5f43ad3f3e43ec0824cand its earlier stack on47efa2e, with local Series X loading changes and a private diagnostic that put the journal ID in the existing PSO wait warning. The focused journal tests passed 1/1 under Proton. Replaying 32 previously built compute records succeeded in 1.0 s.xcl pipelines <journal> --threads 1 --limit 32on the baseline test runtime. A local dxil-spirv dominance experiment on matched cache copies also replayed 7/7 in 130.0 s. Neither run reported a replay failure. The baseline added four driver blobs.This shows that the offline compiler can finish the exact entries that missed the in-title deadline.
A cache-status trace confirmed that all four recurrent compute timeouts found a saved blob and entered the driver before the bind deadline. Each blob was 112 bytes and contained only the vkd3d-proton compatibility metadata chunk.
With
VKD3D_CONFIG=pipeline_library_app_cacheenabled for the offline replay, all seven entries completed in 131.6 s. The four matching cache keys received full blobs totaling 10.2 MB, with inline SPIR-V and Vulkan pipeline cache data. The subsequent title launch used the normal cache configuration and reached 2,442 sampled presents before the watchdog. Three of the original compute timeouts still occurred inside the driver.Not tested
Native Windows, AMD, and rendered gameplay.
AI use
OpenAI Codex with GPT-6.2-Sol high prepared the local instrumentation, ran the tests, and wrote this report.
@oishigeso on GitHub · 2026-11-24 15:04 UTC · original
Thanks @milas6669, @S1m0ne1997, @JoaoPauluu, @Filip722 and @claudetools-gh for five reports in one day.
The slow last ~7,000. What looked like a stop at ~51,000 is the title's biggest compute programs (250 KB – 1.2 MB of DXIL), 30 – 150 s each in NVIDIA's compiler, as @S1m0ne1997's stack samples show. 3407393 prints progress every 10 s, including how many are being made right now, and says once that the biggest programs are slow and that stopping and re-running is safe.
Fixed in 3407393 (with a test each):
pipelines.donewas keyed by the xcl binary only, so after a driver update the pipelines the driver had dropped still counted as done. The key now also holds the adapter's vendor and device ID and its driver version (CheckInterfaceSupport), so a new driver starts the file over..tryingheld every pipeline a run had started (@claudetools-gh): after Ctrl+C (the only way to end--watch), the next run left the failed ones to the title instead of trying them again. Finished ones were not affected (they are inpipelines.doneand were filtered out). It now holds only the pipelines being made at that moment.xcl-warm-*under Wine (@JoaoPauluu): the workers had 64 MB, the same as the title's pipeline threads, and the driver's compile of these programs runs on them. They now reserve 512 MB (address space only). I can't run Wine here, so this is the likely cure, not a proven one. A rerun would tell.Several processes (@S1m0ne1997, @claudetools-gh): both of you found that one process doesn't scale on NVIDIA because of the compiler's heap lock, and both wrote a shard option. That fits better as its own follow-up PR on top of this one than inside it, so it can be reviewed and credited separately. @S1m0ne1997 offered first. Yes, please send it.
Prebuilt pipelines still timing out under Proton (@Filip722): on Windows the title found all 50,562 prebuilt pipelines in the driver's cache with none rebuilt (#755). Under Proton the driver cache is vkd3d-proton's and the driver's, so whether those four were reused is the open question, as you say. A run with
VKD3D_DEBUG=infoand the driver's shader cache log would show whether they were taken from the cache. I can't check it here.Tested (3407393)
cargo test -p xcl --lib pipeline -- --test-threads=1: 9 passed, 0 failed, including the two new ones (trying_holds_only_the_pipelines_being_made,another_gpu_or_driver_starts_the_done_file_over)scripts/smoke.ps1, 60 s: exit 0x0, 396 frames, 0 device removals, 0 crashes, peak commit 17197 MBNot tested
AI use
@3L1A5-1 on GitHub · 2026-11-24 15:40 UTC · original
Notes from running this on a slow 8 GB machine against today's
main, in case they save you time. RTX 2060 SUPER 8 GB (617.14), i5-9400F (6 cores), 16 GB RAM, Windows 11 26300, retail 1.0.2.1, release.1. It no longer builds on
main.25c6f7e("a big pipeline build the title waits for does not wait for its turn") replacedBIG_COMPILES.acquire()+wait_for_commit()withbig_compile_turn(slots, commit_free, wanted). Merged ontomain930e8b4,real.rs(the offline compute path) fails withno method named acquire found for struct Slotsandcannot find function wait_for_commit. Locally I replaced those three lines with:(no title thread waits in the tool, so
wantedis always false). #1278 has the same two calls infinish_pso's path, and needs the same change there.2. The
.tryingbehaviour from the review above, confirmed. I stopped a run with a kill while it was on one big compute program. The next start printedthe last run ended while making 50895 pipelines: left to the title. About 50,800 of those had been made; only the few in flight had not.3. Numbers from this machine (
--threads 3, the journal of one run: 58,748 pipelines, 269 the title used, 6,098 shaders):compile_slotsused in the tool's big-compile path as well, giants get their own slot, so they no longer hold up the rest. I did not measure how much that changes the total.AI use: Claude Code (Claude Opus 5.5) built and ran this and wrote the notes.
@anes66 on GitHub · 2026-11-24 05:06 UTC · original · edited 2026-11-24 17:00 UTC
Follow-up patch index (full measurements and limitations remain below):
Native NVIDIA follow-up on
6dd5c1d7c36652cfecef6ad517828b443c140715: the clean workspace passed, and a synthetic CLI regression exposed a Windows progress-file reset problem.The test builds one compute journal from the existing synthetic console CS fixture, runs
xcl pipelineswith an isolated empty DXIL cache, then resumes it. Those steps succeed: made 1, then made 0 with 1 done before. After changing one bit of the saved binary key to simulate executable replacement, the third run makes the pipeline again but leaves a 32-bytepipelines.donecontaining the old record followed by the new key/hash. It should replace the original 16-byte record. The test fails on that final assertion before the fix.Patch: d2a3e01, directly on this PR's head. The file now opens for writing, truncates and rewinds a fresh record, or seeks to the end of valid progress. Initialization errors return 2 instead of being ignored. The new test checks cold compilation, unchanged resume, and exact progress replacement after key invalidation. With the fix, all three CLI passes succeed and the file returns to the original 16 bytes. No change to shader translation or pipeline descriptors.
Tested on Windows 10 Pro 19045, RTX 3060 12 GB, driver 32.0.16.2114, Rust/MSVC 1.100.0, SDK DXC 1.9.2602.17 and Agility 1.620.2:
Build passed. Clean PR head: 703 passed / 0 failed / 41 ignored. Patched tree: 704 passed / 0 failed / 41 ignored. Both runs printed two
no wave64skips:gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. Sample-gated tests had noXCL_SAMPLE_*inputs, so their counted passes do not establish title coverage.Not tested: retail title smoke, graphics journal replay,
--watchalongside a running title, or driver-blob reuse. The tiny compute pipeline may compile below the 250 ms persistence threshold; this is a CLI/progress regression test, not evidence of driver-cache reuse. Runtime code changed, so the patch still needs the project's main/head title smoke before merge.AI use: Codex (GPT-6; exact variant unavailable) investigated, wrote the patch and synthetic test, ran validation, and prepared this report.
Follow-up: 26d7532 extends the same synthetic test with a complete journal frame containing an incomplete compute payload. Two subsequent CLI processes each report made 0 / failed 1, retry that record, and preserve the exact successful progress bytes. This covers unreadable journal entries staying retryable; it does not simulate a driver compile failure. Test-only follow-up, no additional runtime changes. The full workspace was rerun with the command above: 704 passed / 0 failed / 41 ignored, exit 0, with the same two native-wave64 skips. Tool, model, hardware and coverage limits remain as reported above.
Native NVIDIA follow-up on
34073938054ee91c360fc45a3ee20053ce8eda5dThanks for fixing the progress reset and crediting the report. I tested the current head and ported only the synthetic CLI test, with no runtime changes. All inputs are generated from the existing
console_cs/programfixture.Tested: Windows 10 Pro 19045, RTX 3060 12 GB / driver 32.0.16.2114, Ryzen 7 9800X3D, Rust 1.100.0 MSVC, DXC 1.9.2602.17, Agility 1.620.2, debug.
The clean-head build passed. Workspace results were inconsistent, so this is not a consistently green suite report:
Each run printed the same two native-wave64 skips:
gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware. Samples were unset; sample-gated counted passes are not title coverage.The two patched parallel runs failed in
placed_title_textures_share_vram_and_preserve_pixels(placement readback mismatch), thentransitions_apply_when_their_list_is_submittedandd32s8_targets_take_their_own_size_of_video_memory(poisoned locks). All three passed separately withcargo test --locked -p xcl --lib <full-name> -- --exact --show-output. The serial run also failedensure_mapped_with_query_holes_skips_uncommitted_pages_on_readbackandgpu_mirror_upload_follows_cpu_writes_and_later_mapping_changes. The clean rerun hit the original three pluscpu_writes::tests::writes_land_after_the_queue. These failures were in the unchanged library test binary, before the added integration test ran. The cause of the texture/sparse failures has not been established here.CLI regression: 1 passed / 0 failed in the focused run, and it passed in all three patched workspace runs. It checks:
pipelines.donereturns 2 without altering saved progress or creating.trying;.trying.Not tested: real-title smoke, graphics replay,
--watch, a real driver update, driver/DXC crash recovery, Wine/Proton, AMD/Intel, or driver-blob reuse. The sharing check holds the file from the test process; it is not two concurrent CLI warmers. #1335 already covers a separate crash/interrupt follow-up; this patch does not change that logic.Optional test-only patch against this exact head (
git apply --checkpassed):Synthetic CLI regression patch (90 added lines)
AI use: Codex (GPT-6; exact variant unavailable) ported the test, ran the validation, and prepared this follow-up.
Current-main integration: build failure reproduced and fixed
I also confirmed @3L1A5-1's build report. After resolving the merge with
mainfc0462b4f442f390e7b9b637c168271b7720935f,cargo check --locked -p xcl --lib -j 4failed with E0599 (Slots::acquire) and E0425 (wait_for_commit) in the offline compute warmer.82bd8fd is a tested integration tree with parents
fc0462band your unchanged head3407393. The offline call becomes:The tool has no waiting title thread; the title path keeps main's
build_is_wantedpredicate. Merge resolution retains main's demand-aware worker code, collision-safe driver-cache writes, sparse fixes and CI tests; it keeps this stack's graphics preparation and journal callbacks. Main's Discord URL is retained too.On the same RTX 3060 / Windows 10 / Rust 1.100.0 MSVC / DXC 1.9 / Agility 1.620.2 setup:
cargo build --locked --workspace -j 4: passed.cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=4 --show-output: integration before the optional CLI test 774 passed / 0 failed / 41 ignored; final tree with it 775 / 0 / 41, exit 0.pipeline_journal_cli_compiles_and_resumes: 1 passed / 0 failed. It executes the generated compute journal in child CLI processes and checks progress/retry behavior.Both workspace runs printed the same two native-wave64 skips. Samples remain unset. This validates the merge tree, not the old head by itself; it does not establish stable title behavior, a large-program driver compile, graphics replay,
--watch, Wine, or main/head retail smoke. Runtime code changed, so the required title smoke is still outstanding before merge.AI use: Codex (GPT-6; exact variant unavailable) resolved and checked the integration, ported the synthetic test, ran these commands and prepared this update.
New regression: an existing but invalid blob was counted as complete
1e7047b fixes a separate issue in
warm's compute branch, on top of the tested82bd8fdintegration.The old
is_file()shortcut returnedOk(())without asking the driver to load the file. In the synthetic CLI test I wroteinvalid cached journal pipelineinto the matching driver-cache file, removed progress, and replayed the same journal. The tool printedmade 1, failed 0and wrote completed progress, but the invalid bytes remained untouched. The new assertion fails before the fix.The patch loads the blob into
CachedPSO, asks the driver to create the pipeline, and falls back to a normal compile after dropping a refused blob. Valid blobs are reused and left unchanged. It retains the existing driver-slot and big-compile admission guards and updates the README. The 26-line regression extension also seeds a valid blob via the same executable'sxcl shaders --precompile --pipelines, then requires the warmer's actual driver-blob-hit message.Measured with the fix: invalid blob refused and removed/replaced, normal creation succeeds; the valid blob is accepted and stays byte-identical. Focused CLI test 1 passed / 0 failed. Build passed; full workspace 775 passed / 0 failed / 41 ignored, exit 0, with the same two native-wave64 skips. Commands and native RTX 3060 setup are unchanged from the integration report above.
This matters when
.donestarts over while incompatible files remain, including the situation the driver-key change is intended to cover. I did not change the installed driver: the regression uses an invalid synthetic blob. No retail smoke, Wine, AMD/Intel or large-program timing measurement. Runtime changed, so main/head title smoke remains required before merge. Static-sampler key separation (#1420) and NodeMask normalization (#1368) are separate changes.AI use: Codex (GPT-6; exact variant unavailable) reproduced the failure, wrote the patch and regression, ran the tests and prepared this follow-up.
CLI help regression
ffc40b3 adds a one-line help guard and a standalone CLI regression on top of
1e7047b.Before the fix,
xcl pipelines --helptried to open a path named--helpand exited 2. The new test reproduces that failure. It now checks all four forms (--help,-h, and each after a missing target path) withXCL_ADAPTERdeliberately set to a nonmatching name: each exits 0, prints the command's options, and leaves stderr empty. No GPU or title data is needed for the test.Focused test 1 passed / 0 failed; build passed; full workspace 776 passed / 0 failed / 41 ignored, exit 0, the same two native-wave64 skips. This is still the
fc0462b-based integration, not a fresh merge of every later main change. No retail smoke. Codex (GPT-6; exact variant unavailable) wrote the guard/test, ran validation, and prepared this update.Combined #759 / #1420 native cache check
83ac24b combines the #759 integration/cache/help fixes (
ffc40b3) with #1420's rebased867d307on mainb7aa9f3. The clean merge initially failed E0061: the journal warmer still supplied two arguments to the new three-argumentdriver_cache::path. It now passes&compiled.samplers.A new synthetic native-driver regression goes beyond the filename unit test:
The focused test
journal_warmer_reuses_offline_blobs_for_distinct_static_samplerspassed 1 / 0, no skips. A control that supplied an empty sampler slice to the warmer made the code compile but failed its cache-hit assertion. The corrected caller passed. The shared journal encoder is the existing synthetic fixture, factored for reuse.Full results on the RTX 3060 / Windows 10 / Rust 1.100.0 / DXC 1.9 / Agility 1.620.2 setup:
cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=1 --show-output: 780 passed / 0 failed / 41 ignored, exit 0, two native-wave64 skips.--test-threads=4: 777 / 3 / 41, five explicit skips. Failures werelist_x::tests::write_buffer_immediate_on_open_existing_heap_visible_to_cpu,rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang, andtimestamps_outside_unified_memory_land_after_the_queue, at queue creation. Additional no-device skips were the console depth-target test, shader-cache-session fallback test and placed-texture test. The cause of these parallel failures is unresolved; this is not a green default-suite claim.Samples were unset. The new regression compiles pipelines and checks cache loading; it does not dispatch the sampler shaders or compare rendered output. No retail title smoke, Wine, AMD/Intel, native wave64, or real driver update. #1368 is not part of this integration.
AI use: Codex (GPT-6; exact variant unavailable) prepared the integration and fixture, reproduced the API/caller failures, ran validation and wrote this update.
Invalid option values could start an unlimited pass
f5a2e21 is a separate input-validation fix on
ffc40b3.Reproduced with the one-record synthetic journal:
--limitwith no value selectedusize::MAX, compiled the pipeline, wrote progress and exited 0. The new assertion expects 2 and fails before the patch. Missing/invalid--threadsvalues also fell back to the default. The patch validates supported options before journal/device resolution, rejects bad values and unknown arguments, preserves first-value precedence, and keeps--limit 0valid.The no-GPU CLI suite covers ten invalid forms plus the four help forms (2 test functions passed). The journal regression (1 passed) checks that bad limits produce no cache/progress files; limit 0 creates only the 8-byte key and compiles nothing.
Build passed. Full serial workspace: 777 passed / 0 failed / 41 ignored, two native-wave64 skips. Parallel run: 775 / 2 / 41, four skips (two wave64, console depth target/no GPU, placed textures/no device); the rotating-queue and mid-list-write64/wait64 tests failed creating queues. Those parallel failures remain unresolved. No title smoke. Same hardware/toolchain and commands as above, with the reported test-thread setting.
Codex (GPT-6; exact variant unavailable) reproduced the behavior, wrote the parser/regressions and ran validation.
Invalid journal headers were reported as successful empty work
3a1be15, on
f5a2e21, checks the journal header before GPU selection or progress creation.Before the fix, an ASCII
.bincontainingnot an XCL pipeline journalexited 0 and created an 8-byte.donefile. With the fix it exits 2 withinvalid pipeline journal header; an already-existing progress file also stays unchanged (hash checked).Four no-GPU CLI cases cover wrong magic, an unsupported full header under
--watch, and empty/short non-watch input. They require error 2 before the deliberately nonmatching adapter can be selected and no new progress files. The existing GPU journal test checks that--watch --limit 0still accepts empty and partial initial headers. Complete frames and torn payload handling are unchanged; live appending beside a running title was not tested.Focused CLI 3 test functions passed; focused journal 1 passed; build passed. Full serial workspace 778 passed / 0 failed / 41 ignored, two native-wave64 skips. Parallel workspace 777 / 1 / 41, four skips;
mid_list_write64_wait64_split_avoids_cycle_and_reuses_sparesfailed at queue creation. The extra skips were the console depth target and placed textures (no device). This remains an unresolved parallel GPU-test limitation, not a green default-suite result. No title smoke or proprietary inputs.Codex (GPT-6; exact variant unavailable) reproduced the input behavior, wrote the validation/regressions and ran these checks.
@oishigeso on GitHub · 2026-11-24 17:08 UTC · original
Thanks @3L1A5-1. Right on all three.
main: the stack is now rebased ontomain930e8b4. The tool's big compute compile takesbig_compile_turn(&BIG_COMPILES, big_compile_commit_free, || false), as you wrote, and it is fixed in the commit that first made that call, so every commit of the stack builds. Each of the three heads was built, tested and run again (descriptions updated)..trying: that is the behaviour fixed in 3407393 (now 9d5c58c after the rebase). With a rebuilt binary the done file starts over, so the old.tryingcounted nearly everything. It now holds only the pipelines in flight.--threads 3, every worker that takes a big program waits for the one big slot, so a single 97 s compile can stop everything. Giving the giants their own lane, as #1278'scompile_slotsdoes, fits better as a follow-up once that lands than inside this PR.Tested (9d5c58c, on
930e8b4)cargo test -p xcl --lib pipeline -- --test-threads=1: 11 passed, 0 failedscripts/smoke.ps1, 60 s: exit 0x0, 352 frames, 0 device removals, 0 crashes, peak commit 19056 MBNot tested
mainafter930e8b4(the stack merges into them without conflicts and the functions it calls are unchanged, but it was not built on them)AI use
@JoaoPauluu on GitHub · 2026-11-24 19:20 UTC · original
A rerun at
dd66d20(this PR's head, with the 512 MB warm stacks): the stack overflow still happens under Wine, and the tool then stops making progress.Tested
x86_64-pc-windows-gnu,dd66d20, no uncommitted changes. Retail title 1.0.2.1.exit: 0x0, one journal line, noSharing violation;pipelines.bin122,854,761 bytes.xcl pipelines <title data dir>, first run: exit code 3 after 7 s. The log ends after8 driver blobs kept on disk for the next run, with no panic or error text. It left 266 pipelines done and a 48-bytepipelines.trying.the last run ended while making 6 pipelines: left to the title,57541 pipelines to make (0 the title used), 266 done before, 5659 shaders. Progress went at about 50/s, then: After 50,399 the count did not move again:pipelines.donestopped changing, and the process was still running when my 900 s cap killed it (exit 124). So the process did not exit on the overflow; the remaining workers finished a few more pipelines and then everything stalled with 6 "being made".Not tested
xcl-warm-5was making when it overflowed (the log does not name it), whether a longer wait gets past the stall, whether the first run's exit 3 is the same overflow, native Windows.AI use
@itsd-effex on GitHub · 2026-11-24 20:35 UTC · original
@oishigeso a heads-up for the next rebase:
dd66d20merges intomain4178e88without conflicts, but the result doesn't build, because of #1524 (724b9e2, "limit concurrent huge pipeline compiles"), merged today:let bytes = vs_dxil.len() + ps_dxil…intranslated_graphics_pso_once; this PR has moved those intoGraphicsPrep::_dxil.BIG_DRIVER_COMPILE;warm_oncestill gates on it. #1524's own gate (huge_pso_bytes(),compile_slots,XCL_HUGE_PSO_CONCURRENCY) only applies onxcl-pso*threads, and the tool's workers arexcl-warm-*, sowarm_onceneeds its own call.What I used locally to build (one way, not necessarily the right one):
With that,
xcl pipelinesbuilds and runs onmain4178e88(plus #688, #684, #1321, #1660; Linux, Proton Experimental's Wine). I haven't run the tests on that tree.AI use
@itsd-effex on GitHub · 2026-11-24 20:57 UTC · original
@JoaoPauluu @oishigeso possibly the cause of the warm-worker overflow above: #1805. On this machine the
xcl-warm-*workers overflow the whole 512 MB stack within ~5 s on 12 big compute programs only withXCL_DIRECT_DXIL=1; the same 12 build in 23 s with it off. Was direct DXIL on in that run?AI use
@VolenNakov on GitHub · 2026-11-24 21:30 UTC · original
Stacked
--shard k/nforxcl pipelinesis in #1826 (same syntax as #1502'sxcl shaders --shard): n processes on one journal, each with its own.done/.trying, because NVIDIA's driver builds about one big pipeline at a time per process (2.1 → 9.6–10.6 of 12 cores busy here). Feel free to fold the commit into this PR if that is simpler.Small thing seen while testing it:
Queue::left()counts a pipeline the title used twice when it is also inrest(1 766 of 58 748 here), so the "left" figures run high by that many.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
@joeypercia on GitHub · 2026-11-25 08:59 UTC · original
Two notes for anyone timing what this tool saves, from an equivalent graphics-only prototype I wrote before I found this stack (withdrawn on #2088; I'm not opening it).
%LOCALAPPDATA%\D3DSCacheas well. On Windows 11 with driver 621.40, the D3D12 driver cache forxcl.exelives there (per-executable folders holdingVEN_10DE.dxcachefiles), not inNVIDIA\DXCache. With only XCL'sdxil\driver\blobs removed, my first "cold" run built every pipeline in milliseconds and showed no saving at all.f7e08e6),XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1. The run's 146 graphics builds took 459 s of driver time, 141 of them over 1 s, and the device was removed at 407 s. With the same pipelines built ahead, they took 0.8 s and the run reached the 12 GB removal at 171 s. The offline pass built 2,026 of 2,044 recorded pipelines (18 used shaders missing fromshaders.rpf, 0 failed) in 263 s on the 4070 Ti and 551 s on an RDNA2 iGPU.These numbers come from my code, not from this PR. I'd expect the same order of saving from
xcl pipelines, but I haven't measured it.AI use
@DavidM1911 on GitHub · 2026-11-25 11:16 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@JoaoPauluu on GitHub · 2026-11-25 12:49 UTC · original
@itsd-effex: no, direct DXIL was off.
XCL_DIRECT_DXILwas unset in the game run and in bothxcl pipelinesruns atdd66d20, and at that commit it is off unless set (gpu/dxil/kernel.rs:43). So that run used the HLSL → DXC path.The overflow on the HLSL path shows up elsewhere too. On #2070 (
0fd51f9andmaincbc296a),xcl shaders --precompile --only cs --pipelineswithXCL_DIRECT_DXILunset overflowed all four pipeline threads within about two minutes on both commits (report). #1805 may still explain part of it, but it does not explain these runs. I have not found which programs overflow or where, because no debugger was attached.AI use
mainreaches on Windows; the obstacle is replaced vtables — proposal: proxies #175@itsd-effex on GitHub · 2026-11-25 13:39 UTC · original · edited 2026-11-25 15:10 UTC
Linux / NVIDIA: the title never reads what
xcl pipelinesbuilt. Each process gets its own NVIDIA cache file.On Linux, the title and the host use two different files of NVIDIA's shader disk cache (
…fe7.bin/.tocand…fe8, in the sameGLCache/<id>/<id>/folder). My guess is that NVIDIA gives each process open at the same time its own file; I haven't confirmed that beyond these runs. In a title run, the hostxcl.exe runopens the GPU first and takesfe7.title.exe, which owns the D3D12 device and builds every pipeline, getsfe8.xcl pipelinesruns alone, so it writesfe7, a file the title's device never opens.ls -l /proc/<pid>/fdduring a run shows the host holdingfe7and the title holdingfe8.Measured
ec207194,main1a0bbe3+ this PR (dd66d20, merged by hand) + #1860,XCL_DIRECT_DXIL=1. NVIDIA cache in a private__GL_SHADER_DISK_CACHE_PATHwith__GL_SHADER_DISK_CACHE_SIZE=20 GB.xcl pipelinesover the 2,167 pipelines the title had used, then started the title. Its first compute pipelines all missed: 4–33 s each in the driver, for example a 721,608-byte program at 31 s.fe7);vkd3d-proton.cachecopied into the title's overlay, on its own, without the swap;XCL_PSO_DISK_CACHE=0in the tool.fe7andfe8(.binand.toc) before starting the title, the same pipelines took 1–6 ms. In the next run, 27 of the first 28 logged compiles were hits.Workaround: swap the two files after a precompile and before the title. For another precompile, swap them back first, so the tool appends to the title's file.
A possible fix in XCL: make the tool's device the second process's, for example by having the tool's parent create a device of its own before it starts the workers. The other way round also works: the host
xcl runwould not open the GPU before the title does. I haven't tried either.A second, smaller trap: the tool builds the memory-window form recorded by the journal's latest run. After one title run with
XCL_HEAP_WINDOWS=1, it prints4 memory windows (from the descriptor heap)and58816 pipelines from a run with other memory windows left out. A title started without heap windows then misses everything the tool just built, and the other way round. The setting has to be the same for the title runs that fill the journal, the tool, and the run that uses it.This probably also explains part of "the offline pass and the title use different caches" on #2003. Any Linux "warm" measurement made with this tool may have been warmed by earlier title runs rather than by the tool. Mine from last night were.
Confirmed later the same day (A/B): the same early compute pipelines (0.27–0.84 MB of DXIL), the same NVIDIA cache snapshot, and only the title's
vkd3d-proton.cachedifferent:vkd3d-proton.cachevkd3d-proton.cachein the title's overlaySo both steps count: the title's process needs the tool's NVIDIA cache file (most of the saving), and it needs the tool's
vkd3d-proton.cache(shader identifiers, per @voiceovarian1-max on #2003). Copy the tool'svkd3d-proton.cache.writeas well: vkd3d-proton only merges it into the main file on its next start.Written with Claude Code (Claude Opus 5.5).
@kole07139 on GitHub · 2026-11-25 15:35 UTC · original
This PR merged with current
main, conflicts resolved, for @oishigeso to take or leave:kole07139/xclpipelines-3-tool-on-main(cc2ac52, onmain06c9f55). It builds and the whole suite passes; numbers from one retail-title cycle (run →xcl pipelines→ run) on an 8 GB card below. It also answers @itsd-effex's point above on Windows: the graphics pipelinesxcl pipelinesmakes now go into XCL's own driver blob cache, which the title loads itself, not only into the driver's cache.What the merge needed
gpu/uma.rs:uma::existing()kept, withmain's new doc line onget().hle/d3d12x/real.rs:main'stranslated_graphics_pso_onceis split again intoprep_graphicsand the rest. Onmainit now has the graphics blob cache (#1836), the lazy check before the GS path, #1524's slots and #2044.prep_graphicsnow also returns the static samplers, becausegraphics_blob_keyneeds them.XCL_DEBUG_NO_STENCIL/XCL_DEBUG_NO_CULLswitches moved intographics_debug_switches, sowarmkeys a pipeline the way the title does.go_backgroundkeeps both the journal hook andmain'simage_only.warm, adapted tomain:compile_slots/big_compile_headroom.driver_cache::graphics_path, under the key the title looks it up with. It is not kept when the rect-list GS had to be dropped, as increate_graphics_pso_cached.cc2ac52: since #2080 the title builds a split direct-DXIL compute program as its pieces, with their own root signature.warmnow returns an error for such a program and leaves it to the title, as it does for GS / HS / DS. Otherwise it would make the whole program, a pipeline the title never asks for.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4:main1a0bbe3(beforecc2ac52): 1258 passed, 0 failed, 46 ignored, 25 SKIPPED (20no wave64, 3 per-lane forms refused, 1 Developer Mode, 1no heap windows);cc2ac52: 1273 passed, 0 failed, 46 ignored, 26 SKIPPED (21no wave64, 3 per-lane forms refused, 1 Developer Mode, 1no heap windows).cargo test -p xcl --lib -- pipeline heap_window journal --test-threads=1: 24 passed, 0 failed on both heads.1a0bbe3merge, beforecc2ac52. Settings:XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_NETWORK=0, the same exe in place for every step. Compute pipelines were precompiled first (xcl shaders --precompile --only cs --pipelines, 2 689 made, 0 refused).xcl pipelines <game>.0x887a0006at 151.8 s and the title's0x80000003. That is the removal several reports on #1452 / #505 show once a run gets that far, so I do not read it as this PR's.1a0bbe3merge, beforecc2ac52; the suite numbers cover both heads.Not tested
cc2ac52.--watch.XCL_DIRECT_DXILunset).AI use: Claude Code (Claude Opus 5.5) resolved the conflicts, adapted
warm, ran the tests and the runs, and wrote this comment. I checked it before posting.@itsd-effex on GitHub · 2026-11-25 18:13 UTC · original
Follow-up to my comment above (Linux / NVIDIA): two more traps for
xcl pipelines1. NVIDIA's cache file stops taking entries at 4 GiB. Each entry in the
.tocis 24 bytes: a 16-byte key, then a 32-bit offset and a 32-bit size into the.bin. Once the.binpasses 2^32 bytes, the driver can no longer index anything new..bin, but each one is lost..binreached 4,296,160,144 bytes at the end of a precompile. Over the next two title runs it grew to 5.1 GB, while the.tocstayed byte-identical. A 2.4 MB compute program built in the first run (in 1,033 s) missed again in the second. This happened with both a timed exit and a window close.__GL_SHADER_DISK_CACHE_SIZEdoes not lift this; the limit is per file.What helped:
.tocchanges after a run, by comparing it with a copy.With an empty folder, the
.tocis written while the title runs, not at exit.2. With
XCL_HEAP_WINDOWS=1, the title does not reuse what the tool built, even with the files swapped as above. The title reuses its own builds across runs in this mode: 29 of 29 hit in the next run. Without heap windows, the tool's builds did hit, on my earlier build. Measured onmain68a284a+ this PR + #1860 + #2301 (cherry-picked), RTX 3080 Ti, NVIDIA 620.73.04, vkd3d-protonec207194:VKD3D_SHADER_DUMP_PATH(a Unix path) for three compute pipelines from the tool and from the title gives byte-identical files:.dxil,.spvand.rs..tocgrew by exactly four entries.So in heap mode, the driver's key differs on something outside the SPIR-V and the root signature, presumably pipeline or device state. I haven't found which yet. Until then, a heap-windows precompile does nothing for the title on Linux/NVIDIA.
Written with Claude Code (Claude Opus 5.5).
@itsd-effex on GitHub · 2026-11-25 18:58 UTC · original
Follow-up (Linux / NVIDIA, heap windows): the driver's cache key seems to depend on the order a process creates pipelines
In my comment above I wrote that with
XCL_HEAP_WINDOWS=1, the title does not reuse whatxcl pipelinesbuilt. I've narrowed it down. Same setup: RTX 3080 Ti, NVIDIA 620.73.04, vkd3d-protonec207194(which usesVK_EXT_descriptor_heap), andmain68a284a+ this PR + #1860 + #2301.What vkd3d-proton gives the driver is the same in both processes. I used the Vulkan
api_dumplayer:vkCreateDeviceis identical in the tool and intitle.exe;vkCreateComputePipelinesof the same two pipelines is identical: flags (DESCRIPTOR_HEAP_BIT), the descriptor-heap mapping info with its embedded samplers, and the SPIR-V size;VKD3D_SHADER_DUMP_PATH, the DXIL, SPIR-V and root signatures are byte-identical.What I ruled out. I gave the tool a copy of the title's NVIDIA cache file, in the tool's slot. Four compute pipelines the title had built still missed: about 20 s, and four new
.tocentries. That held with the tool run astitle.exe's file name, and also with the title'svkd3d-proton.cachein the tool's folder.What moves the key: the order of creation, within one process. I added a local switch that makes the journal's pipelines on the title's own device right after device creation, so the title's creation order changes. Two runs of the same binary:
Title-to-title reuse works otherwise, because the title creates pipelines in about the same order each run. Even so, one pipeline in four of a set I tracked missed again in the next run.
My guess at the cause, not verified: the driver assigns something per process in creation order, maybe slots for the embedded samplers of
VK_EXT_descriptor_heappipelines, and bakes it into the compiled program and its key. Without heap windows, the tool's builds did hit in the title on my earlier build.What follows, on this driver:
What does work in heap mode is the title's own runs: each run keeps what it built, and the next run gets further.
Written with Claude Code (Claude Opus 5.5).
@itsd-effex on GitHub · 2026-11-25 20:05 UTC · original
Correction to my comment above: creation order does not move the NVIDIA cache key. The cache file does. The "heap-window precompiles never help" conclusion was wrong.
Same setup (RTX 3080 Ti, NVIDIA 620.73.04, vkd3d-proton
ec207194,XCL_HEAP_WINDOWS=1). These tests use throwaway caches:.tocrowsxcl pipelines, 24 small compute shaders, one thread, empty cache…fe6,…fe7,…fe8); full set, and every other shadervkd3d-proton.cacheWhat I now think is going on:
GLCache/<…>/<…>/:<id>fe6,fe7,fe8, and so on. Which one a process gets isn't fixed by the program or by start order. The same tool run wrotefe7once andfe6the next time. My guess is it takes the first file no other process has open. My earlier "seeded" tests put the cache in one guessed file, and the process used another..binand.toc) is copied over every slot file. I'm running a full precompile that way now and will report whether it shortens the next title run.The in-title warm-up result above (9 pipelines that missed again) is still unexplained. I no longer think creation order explains it.
Written with Claude Code (Claude Opus 5.5).
@Kalmarv on GitHub · 2026-11-25 23:26 UTC · original
The graphics half of the journal replay (#1826's
xcl pipelines) builds every graphics pipeline but keeps none of them, so the title builds them all again.real::warm_oncecreates each journaled graphics PSO. Unlike the compute branch, it never writes the driver's blob todriver/gfx-{graphics_blob_key}.pso, which is wheretranslated_graphics_psolooks at runtime. After a full replay the title still findsdriver blob absentfor each one. This local patch, onmain6d12f58a+ #1826, keys and keeps the blob likecreate_graphics_pso_cacheddoes, and skips entries already on disk:Measured with title: ea3b5e4d on an RTX 5070 Ti, title runs of up to 600 s from a cold start, all on the same compute precompile. Each run's journal was appended to the same file, so later replays covered more pipelines.
The replay itself took 39 s at 16 threads when the driver's own cache was warm, and 927 s when it was empty.
One thing to know for anyone measuring this: NVIDIA's DXCache is keyed by the exe's path and name, not its contents. A replay run under another exe name warms a cache the title never reads, and with that cache empty each blob-supplied create still takes 60–125 ms (median). A normal precompile then play uses one exe, so it isn't affected.
With the patch, no graphics or compute pipeline is built on the title's threads in that run. The run still drops under 1 FPS after about 90 s, so that drop has a cause other than shader builds.
AI use: Claude Code (Claude Opus 5.5) wrote the patch, ran the replays and title runs, and wrote this comment.
@Alm0stSurely on GitHub · 2026-11-26 00:01 UTC · original · edited 2026-11-26 00:24 UTC
A follow-up to the RTX 3080 Ti cache observation above. I could reproduce the effect of keeping the launcher's preflight process alive on an RTX 5080 under Proton.
Tested
Ryzen 9 9950X3D, RTX 5080, NVIDIA 620.73.04, Proton Experimental and a local vkd3d-proton build. The child replayed the same two
CreateComputePipelineStatecalls, in order, from fresh copies of the same warm cache. One run per configuration, withVKD3D_CONFIG=single_queue,no_upload_hvv.All six calls succeeded and returned the expected blobs. The child executable was identical across runs (SHA-256
cfd96275fb3752e5160eac394cc0ad6b2b50a3bf7dcccaea3cd643a897356190). The last case used a separate controller. This prompted an opt-in launcher patch against main08db8020that waits for the preflight helper to exit before starting the title.Not tested
This replay measures PSO creation time. It does not establish an in-game FPS gain or prove a per-shader driver-cache hit. The paired retail smoke runs on stock Proton Experimental both selected the RTX 5080 with
VKD3D_CONFIG=single_queue. Main08db8020and the local candidateb7b28988each exited with status 3 and one recorded crash before the first frame. Game stability and FPS remain unverified on this patch.AI use
OpenAI Codex with GPT-6.2 Astra prepared the harness, analyzed the runs and drafted this report.
@KDenKC on GitHub · 2026-11-26 02:03 UTC · original
@kole07139, your integration (
cc2ac52) on the retail title, native Windows, RTX 5090. The prewarm takes the graphics wall out: in-title cold graphics driver time 348 s → 10 s, and the title reaches its world (frames again at 152.1 s, against none by 200 s without it). One capture / warm / run cycle with a control, all on one executable.Tree:
dd53c77=main08db802+ #684e56dbc3+ #2404809da30+ yourpipelines-3-tool-on-main@cc2ac52, + #25513567b2e. #2551 is in so the whole forms of split compute programs are precompiled; without it the title stops on those before the graphics matter (#2088). Merged cleanly, no resolution needed.Setup
XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_TRACE=1 XCL_NETWORK=0, 200 s per run, the same scripted input.--used-only), all graphics driver blobs removed. Each run started from its own copy.Cycle
pipelines.bin= 127,937,780 bytes.xcl pipelines <copied journal> --threads 4withXCL_PIPELINE_THREADS=2, stopped at a 20-minute budget: 57,217 of 58,750 journal pipelines made (2,230 of them the title used), ~48/s at the end, 500 graphics blobs written todriver/gfx-*.pso(from 0).0x887a0005(the heap limit of #2403, unrelated to the prewarm)The candidate's remaining stop (126 → 152 s) isn't graphics builds. The only builds over 1.5 s in it were whole forms loaded from blobs at 126–128 s, and one whole form #2551 hadn't precompiled started cold at 150.9 s.
On the threads above: @Kalmarv noted that the graphics half of the replay builds every pipeline but keeps none (#759). With
cc2ac52, the graphics pipelines are kept: 500 blobs written, and 263 of them loaded by the title. @itsd-effex's notes on NVIDIA's cache file (4 GiB cap, and the correction that creation order doesn't move the key: #759) apply to the 1,269 builds that came back through NVIDIA's own cache here.For #758 / #759: both are still open and conflict with
main;cc2ac52is the version that builds on currentmain. If @oishigeso takes it into #759, these numbers are for that head plus the stack above.Not tested
AI use: Claude Code (Claude Opus 5.5) built the tree, ran the cycle, measured the logs and wrote this comment.
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.Merge
Merge the changes and update on Forgejo.