Repository navigation
D3D12.X: the driver's compile of a compute pipeline is kept on disk - #634
Conversation
|
Test run of Tested
Review: A refused blob is deleted and the pipeline built as before, inside Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
xcl-dev#636 keeps the driver's blob of a translated compute program in memory: its second build in one run is made from it. The first build of every run still goes through the driver's compiler. On an NVIDIA GPU (RTX 5090) that is 5 - 27 s for each of a retail title's larger compute programs when its world loads: the title dispatches without them meanwhile and is ended by its watchdog before all are built, so the next run starts the same compiles again. A blob whose build took 250 ms or longer is also written to the DXIL cache directory (driver\, under the hash of the DXIL and the flags), and a build that finds none in memory reads it from there. A blob the driver refuses (another driver, adapter or root signature) is dropped and the program compiled as before. XCL_PSO_DISK_CACHE=0 turns it off. Assisted-by: Claude Code (Claude Fable 5.2)
|
Independent real-driver cache check on RTX 3060 12 GB, driver 610.88 (32.0.16.1088), i5-8400, Windows 11 Home 26200.9974, Rust 1.100.0 x86_64-pc-windows-msvc, SDK DXC 1.9.2602.17, debug. Tested: unmodified
No skips. All three used the real RTX 3060 backend. The temporary threshold edit was reverted. Not tested: default 250 ms save path on a long compile, real-driver rejection of a stale blob, full suite, or retail loading. This checks saving and reuse with a synthetic shader, with no speedup claim. AI use: OpenAI Codex (GPT-6) ran the local checks and drafted this report. |
aab6789 to
9182f27
Compare
|
Tested
Not tested
AI use
|
|
Tested On merge All three dispatches matched 2,459,136 expected words each. A scratch extension to RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, Windows 11 build 26300, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug. Not tested Driver rejection, async builds, and retail behavior. AI use Codex with GPT-6.2 Sol adapted the scratch fixture, ran the tests, and drafted the report. |
… and stops at a never-written GPU counter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
NVIDIA / wave32 retail data point: the on-disk driver-blob cache works across runs on an RTX 3080 Ti with GTA VI (Series 1.0.2.1). Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01), main Suite at this commit: 692 passed / 0 failed / 41 ignored, 2 internal Run pair (150 s cap each):
Both runs still end in the pre-existing #232 null write (113 s / 102 s); the cache neither causes nor prevents it. Not tested: AMD/Intel, cache invalidation on driver change, other titles. AI use: Gentle Shell (Pi coding agent), model qwen4-max: ran the suite and the run pair and wrote this report from the logs; a human reviews it before posting. No code changes. |
The page opened with the title and a paragraph; what a reader looks for first (which games, how to build, where to ask) was a scroll away, and the environment switches a user needs were spread over the text or only in HANDOFF.md. - a centred header: tagline, badges (Discord, CI, licence, platform), and links to the page's sections - how XCL works as three rows (native code, console libraries, shaders) - "Switches for a run": the eight variables a user is most likely to set, each checked against the code on main - the Pipelines row names what main has since ivall#634 / ivall#636 / ivall#690 No statement about what works was changed. The test count (ivall#485) and a Contributing section (ivall#453) are left to their open pull requests. Assisted-by: Claude Code (Claude Fable 5.2)
…; --pipeline-min-kb The driver's compiled form of each compute pipeline the precompile builds is written where a title's compute pipeline looks first (real::driver_cache, xcl-dev#634), under the same DXIL + flags name. Programs already kept are skipped, so a long run resumes. --pipeline-min-kb N builds only programs of at least N KB of DXIL (the slow driver compiles). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebased onto #636, which this now builds on. #636 keeps the driver's blob of a translated compute program in memory: its second build in one run is made from it. The first build of every run still goes through the driver's compiler. On an NVIDIA GPU that is seconds for each of a retail title's larger compute programs when its world loads (5 – 27 s each measured here, up to 0.5 MB of DXIL): the title dispatches without them meanwhile and is ended by its watchdog before all are built, so the next run starts the same compiles again. This writes those blobs to disk and reads them in the next run.
What is in it
crates/xcl/src/hle/d3d12x/real.rs,mod driver_cache: the file name (fnv64of the DXIL, its length and the flags, in<DXIL cache>\driver\), reading a kept blob, writing one under a temporary name first, dropping one the driver refused, and the log lines (powers of two).translated_compute_pso: when D3D12.X: a translated compute program built again gets the driver's blob of its first build #636'scompute_blobhas none, the blob kept on disk is passed asCachedPSO; refused (another driver, adapter or root signature), the file is removed and the program compiled as before. After a build without a blob, whatkeep_compute_blobkept is also written to disk when the build took 250 ms or longer.XCL_PSO_DISK_CACHE=0turns it off.Tested
cargo build --workspace, thencargo test --workspace -- --test-threads=4: 692 passed, 0 failed, 41 ignored.gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.maindoes (its watchdog, ~100 s in); this PR does not change that by itself.Regression run
main:
```
xcl-smoke v1
commit: dd2ae9a
gpu: NVIDIA GeForce RTX 5090
title: NYCMain
seconds: 60
exit: 0x0
frames shown: 1611 (PresentX 1611)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14482 MB
Not tested
note, not by a driver refusing one.AI use