Repository navigation
D3D12.X: a translated compute program built again gets the driver's blob of its first build - #636
Conversation
…lob of its first build A retail title creates some of its big compute pipelines more than once while loading (14 programs of 105 - 222 KB DXIL, each twice). Every creation went through the driver's compiler again: 3 - 6 s the first time, 13 - 30 s the second, with the title's thread waiting. After a translated compute PSO of 16 KB of DXIL or more is built, its GetCachedBlob is kept (by DXIL hash, root signature and flags; 512 MB at most) and passed as CachedPSO when the same program is built again. A blob the driver does not take is dropped and the program is compiled as before. The PSO log line now says how long the build took and whether a blob was used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test run of Tested
Review: A refused blob is forgotten and the program compiled as before, and a reused build skips the 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. |
|
Tested Confirmed a same-process D3D12 driver blob hit on merge Both dispatches matched all 493,056 expected 32-bit values. The focused test passed (1 passed, 0 failed, no runtime skip). The D3D12 debug layer logged no errors and reported live objects at process exit. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, DXC 1.8.2502.11, Rust 1.99.1 MSVC, debug. Command Not tested Async pipeline scheduling, blob rejection, AMD, and retail behavior. AI use Codex with GPT-6.2 Sol adapted the test, ran it, and drafted this report. |
…iver blob reuse, in-place detiling) Conflict in bind.rs execute_indirect: upstream's skip of a still-building pipeline kept; with xcl-dev#533 / xcl-dev#267 the bounded wait hands it the stand-in, which is then skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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)
…ner, then a stack overflow at 118 s Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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)
Part of #505. A retail title creates some of its big compute pipelines more than once while it loads its world (the "built once or twice" in #505). Each creation went through the driver's compiler again, with the title's thread waiting. On an RTX 4060 Ti, 14 programs of 105 – 222 KB of DXIL were each built twice: 3 – 6 s the first time, 13 – 30 s the second.
After a translated compute PSO of 16 KB of DXIL or more is built, its
GetCachedBlobis kept in memory, keyed by the DXIL's hash, the root signature and the flags (512 MB in all at most). When the same program is built again, the blob goes in asCachedPSO. A blob the driver does not take is dropped and the program is compiled as before. Programs under 16 KB are not kept: the driver builds them in milliseconds.What is in it
crates/xcl/src/hle/d3d12x/real.rs:translated_compute_psolooks the program up (compute_blob), passes the blob asCachedPSO, falls back to a plain build when the driver refuses it (forget_compute_blob), and keeps the blob of a new build (keep_compute_blob, the adopted PSO's PCGetCachedBlobthroughorig_fn). A program waiting for a blob does not take aBIG_COMPILESslot. The PSO's log line now gives the build time and says when a blob was used.a_blob_is_found_only_for_the_same_program_root_signature_and_flags_and_is_forgotten.Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4onb9f3d0f: 681 passed, 0 failed, 41 ignored. SKIPPED on this adapter (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.105004 B DXIL, 2 ms, the driver's blob of an earlier buildand31940 B DXIL, 0 ms, …where the same programs had taken 13 – 30 s the second time in the run before. No blob was refused by the driver.Regression run
The 60 s run does not reach the world, where the title builds programs a second time, so these show the change does no harm early on; the first run of the PR head showed 1019 frames (its last 6 s at 5 fps), a second run 1417, the block below.
Not tested
GetCachedBlob/CachedPSO.AI use
🤖 Generated with Claude Code