Skip to content

D3D12.X: reuse offline compute blobs on single-node devices - #3257

Closed
moombathepilot wants to merge 1 commit into
xcl-dev:mainfrom
moombathepilot:d3d12x/single-node-compute-cache
Closed

moombathepilot wants to merge 1 commit into
xcl-dev:mainfrom
moombathepilot:d3d12x/single-node-compute-cache

Conversation

@moombathepilot

@moombathepilot moombathepilot commented Nov 29, 2026 •

Copy link
Copy Markdown

Offline precompile saves compute pipeline blobs with D3D12 node mask 0. A title requesting mask 1 on a single-node device looks under a different cache key and rebuilds the pipeline. This change uses mask 0 for translated compute in that case, so runtime can reuse the offline blob. Related to #3182.

What is in it

  • Normalize the translated compute descriptor on single-node devices before cache lookup and pipeline creation.
  • Add a regression test for the offline cache key and linked-adapter masks, and document the behavior in the README.

Tested

  • AMD Radeon RX 7800 XT, driver 32.0.32029.2010, Ryzen 7 5700X3D, Windows build 26300.9974, rustc 1.100.0. Release builds passed on both revisions.
  • With XCL_PSO_DISK_CACHE=1, main rebuilt compute shader 1e32f25121c1552f in 408 ms. The patch loaded its offline driver blob and logged 0 ms in the driver.
  • Focused compute_blob_tests run passed 7 tests, with 0 failures and 0 ignored.
  • After building the workspace on both revisions, cargo test --workspace --offline --locked --no-fail-fast -- --test-threads=4 --nocapture (separate target directories) reported 2,609 passed, 4 failed, 49 ignored, and 12 SKIPPED notices on the patch. Main (fa204595) reported 2,608 passed, 4 failed, 49 ignored, and 12 SKIPPED notices. Both runs failed the same DXIL fuzz test, mesh shader-cache test, and two-pass driver-cache integration test (parent and child).

Regression run

main:

xcl-smoke v1
commit: fa204595a488c60c6c5f905244f0172072c9c2a9
gpu: AMD Radeon RX 7800 XT
title: retail game
seconds: 60
exit: 0x0
frames shown: 1583 (PresentX 1583)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16085 MB

PR:

xcl-smoke v1
commit: b7017ec04a83ffe1cd34fdafcf8ef593ebd58b19
gpu: AMD Radeon RX 7800 XT
title: retail game
seconds: 60
exit: 0x0
frames shown: 1600 (PresentX 1600)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 14950 MB

Not tested

  • Linked-adapter hardware, NVIDIA, Intel, or time to the first playable frame.

AI use

  • OpenAI Codex (GPT-6, exact variant unavailable) diagnosed the cache miss, wrote the fix and regression test, ran the local checks, and drafted this description. I reviewed the PR description and test results before submitting this pull request.

Translated compute used the title's node mask 1 while offline precompile used 0. Use the single-node descriptor for both so the runtime finds the offline blob. On an RX 7800 XT the target pipeline went from a 408 ms driver build to a disk-cache hit.
@github-actions github-actions Bot added area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks) labels Nov 29, 2026
@moombathepilot
moombathepilot marked this pull request as ready for review November 29, 2026 01:43
@andrewDoing

Copy link
Copy Markdown
Contributor

Confirmed offline-to-runtime reuse on an NVIDIA RTX 5070 12 GB, Ryzen 7 5700X3D, Windows, at b7017ec. GetNodeCount returned 1. Five fresh processes used the same synthetic 2,044-byte compute DXIL and ABI root signature. The test overlay called the production offline builder (Pipelines::make_required, Whole) and runtime compute_container (Whole) with the native CreateComputePipelineState method. Each runtime call returned a valid pipeline.

Initial cache Requested node mask Result
Empty A, offline builder 0 Created one pipeline, reused zero
Offline-seeded A 1 Driver accepted the stored blob
Offline-seeded A 0 Driver accepted the stored blob
Empty B, runtime 1 Cold build, persisted blob
Runtime-seeded B 0 Driver accepted the stored blob

Both directories contained the same single driver filename, d2b0d1c8253fd47c-7fc-0.pso, 1,358 bytes. Each warm process logged one pipeline made from the driver blob of an earlier run. XCL_PSO_DISK_CACHE=1 and XCL_PSO_DISK_CACHE_MIN_MS=0 allowed this tiny cold runtime control to persist. Coverage is the whole translated compute PSO path on one physical node; linked adapters, guest dispatch and title load times were outside this test.

OpenAI Codex wrote the test-only overlay, ran the controls and drafted this report.

@andrewDoing

Copy link
Copy Markdown
Contributor

Maintainer cross-reference: #3214 independently addresses the same offline mask-0 / runtime mask-1 compute cache miss. The heads diverged from 765b2c5; neither contains the other. Both have working single-node evidence, including AMD here and NVIDIA on both threads.

The policy difference matters when selecting one implementation. Here compute_container checks GetNodeCount, and on a single-node device changes the descriptor and its derived RAM, library and disk keys to mask 0. On a linked device it preserves mask 1. In #3214 the descriptor stays exactly as requested, but RAM, library and disk naming alias 1 to 0 on every device. Masks 2 and above remain distinct in both. Combining both patches would therefore reintroduce linked-device key aliasing even with this PR's node-count check. Neither thread has linked-device validation. I would choose one implementation for the shared use case and keep the linked-device policy an explicit decision.

AI use: OpenAI Codex compared the two exact diffs, ancestry and published test controls.

@moombathepilot

moombathepilot commented Nov 29, 2026 •

Copy link
Copy Markdown
Author

Closing as a duplicate of #3214. I confirmed that #3214 reuses the offline compute blob on an RX 7800 XT. The AMD test report is on that PR. Thanks to @andrewDoing for pointing me to #3214 and for independently testing #3257 on NVIDIA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:d3d12 D3D12.X runtime, command lists, resources, sparse memory area:docs-ci Documentation, scripts, workflows, repo governance gpu:both Code affects both AMD and NVIDIA GPUs (scope tag; see needs:*-test for remaining checks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants