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

Open
Filip722 wants to merge 1 commit from upstream-pr/1442 into main
Filip722 commented 2026-11-27 07:25:34 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T07:25:34Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:issue:5522862337 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1442). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-27T07:25:34Z. --- ## 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 commented 2026-11-27 07:28:33 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-27T07:28:33Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7212506815 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1442#issuecomment-7212506815). Originally posted by [Filip722](https://github.com/Filip722) on 2026-11-27T07:28:33Z. --- 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](https://github.com/Filip722/victory-fork/tree/review/ci-name-lock-9a) 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 commented 2026-11-27 07:36:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-27T07:36:05Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7212631923 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1442#issuecomment-7212631923). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-27T07:36:05Z. --- 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](https://github.com/jtrudeau1530/VIctory-7900XTX/pull/4). With both patches, all seven library tests passed. The [AMD backport](https://github.com/jtrudeau1530/VIctory-7900XTX/pull/60) keeps the name-lock change separate. A cold story boot still needs its own timing.
lukinhasnojento commented 2026-11-27 14:53:36 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by lukinhasnojento on 2026-11-27T14:53:36Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7221362441 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1442#issuecomment-7221362441). Originally posted by [lukinhasnojento](https://github.com/lukinhasnojento) on 2026-11-27T14:53:36Z. --- 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.
akimfomin commented 2026-11-28 01:56:30 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by akimfomin on 2026-11-28T01:56:30Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7232019736 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1442#issuecomment-7232019736). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-28T01:56:30Z. --- For `c13e2a39`, I compared the relevant behavior with [klbf-lab #56](https://github.com/PastiiJay/klbf-lab/pull/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.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1442:upstream-pr/1442'
git switch 'upstream-pr/1442'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1442'
git switch 'upstream-pr/1442'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1442'
git switch 'upstream-pr/1442'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1442'
git switch 'main'
git merge --squash 'upstream-pr/1442'
git switch 'main'
git merge --ff-only 'upstream-pr/1442'
git switch 'main'
git merge 'upstream-pr/1442'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1442
No description provided.