Skip to content

GPU: keep unrelated pipeline library loads from blocking each other - #1442

Open
Filip722 wants to merge 1 commit into
fxceless:mainfrom
Filip722:gpu/pipeline-library-exact-name-lock
Open

Filip722 wants to merge 1 commit into
fxceless:mainfrom
Filip722:gpu/pipeline-library-exact-name-lock

Conversation

@Filip722

Copy link
Copy Markdown
Contributor

Summary

Serialize D3D12 library loads when they refer to the same pipeline name. The current 64 shared lock slots can also serialize unrelated names. A foreground compute load can then wait seconds for a different pipeline's native load.

A warmed checkpoint replay on an RTX 5060 Laptop showed two such collisions on the title thread during the same loading frame. The wait before the native call was 7.627 s for a load taking 1.128 ms, and 14.819 s for a load taking 42.419 ms. In each case the delay matched a different name holding the same slot. The title reached its loading watchdog.

Track names only for the duration of each load and release the registry lock before calling D3D12. A load of the same name still waits until the first completes. The existing all-library lock option and store/save synchronization keep their current behavior.

Verification

  • Windows MSVC release tests under GE-Proton11-14 on Bazzite 44. The synthetic collision failed at main 9a9091d and passed with the patch. The same-name serialization test passed on both builds.
  • Five focused pipeline-library tests passed with the patch. The staged asset policy passed for the changed file.
  • Hardware trace used NVIDIA 615.78.08 and vkd3d-proton 3.2.0 (cae8353ed7959c4+).

Assisted by Codex (GPT-6.2-Sol High).

@Filip722

Filip722 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

I replayed the checkpoint on the RTX 5060 with the same GE-Proton11-14 runtime, launch settings and starting native caches. Changing only the name-lock implementation reduced the two measured waits before the native load from 7.627 s and 14.819 s to 26 µs and 37 µs. Both loads returned successfully.

The later recording threads still spent up to 28.1 s on a series of compute pipeline builds in one loading frame, and the title still reached its watchdog. This verifies removal of the unrelated-name delays on hardware. World entry remains open.

The first Windows CI run stops in unchanged shader code at the Clippy errors addressed by #1440. The staged asset policy for this PR passes; a full local scan also reports the file-size failures already present on this base in host.rs and lower.rs.

A separate CI integration branch combines this patch with the shared lint and file-size fixes at 0206a5a6ac6aa089a906649bb04cfefb13e9e5a4. Both Windows MSVC workspace Clippy modes, the full 246-file policy scan, the pipeline regressions, and the RTX IEEE comparison fixture passed locally. The PR branch remains scoped to the pipeline lock.

Assisted by Codex (GPT-6.2-Sol High).

@UwUCammie

Copy link
Copy Markdown

Both name-lock tests passed on my RX 7900 XT with RADV 26.3.1, Wine 11.22 and GE vkd3d-proton cae8353ed7959c4. The AMD branch's existing empty-library test failed on that stack until I also applied the null-blob fix from AMD #4. With both patches, all seven library tests passed. The AMD backport keeps the name-lock change separate. A cold story boot still needs its own timing.

@lukinhasnojento

Copy link
Copy Markdown

Follow-up test context (2026-11-27): a later build using the pipeline pre-build approach in PR #1226, with early-use keys identified from a prior run involving the #1450/#1442 changes, advanced into the prologue without reproducing +0x23cf683 in the observed window. The tested build was based on the pre-build PR, not this PR, so this is not evidence that #1442 prevents the watchdog. Performance remained very low and draws were still dropped; this is a preliminary single-run observation, not a confirmed fix. No game files, derived assets, screenshots, or raw logs are attached.

Copy link
Copy Markdown

For c13e2a39, I compared the relevant behavior with klbf-lab #56. Compare two unrelated cache keys populated concurrently, with a same-key writer as a serialization control. Keep adapter-key generation and atomic publication explicit. This is a pinned source comparison; the suggested case still needs a receiving-side run.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants