GPU: keep PSO compile deferrals local to each attempt #3648

Closed
ghptc wants to merge 1 commit from upstream-pr/3648 into main
ghptc commented 2026-11-30 02:49:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ghptc on 2026-11-30T02:49:39Z.


What changes

A PSO compile that the memory admission guard defers currently returns the same HRESULT as a native allocation failure. That can log a driver refusal and reach the diagnostic Create path while admission has declined the compile. The direct prewarmer reuses a thread across builds, so the previous attempt's thread-local deferral can also stick around for the next PSO.

Carry the admission decision as a result local to each creation attempt. A guard deferral skips driver diagnostics and fallback and leaves the PSO pending for its existing cooldown. A native error keeps its original HRESULT and takes the existing failure path. Library hits still return before the Create gate. The patch uses the wait logic and library counters in upstream main.

This addresses classification and the fallback on a denied attempt. The existing VICTORY_SHADER_CAPS=1 retry after a genuine driver failure still uses its direct Create path. The patch adds no driver OOM recovery, and the tests cover no gameplay or FPS claims.

Credit Gabriele Cabrini for the deferral diagnosis in #2743 and steven-seagull27 for the related classification and CAPS controls in #2578. Those proposals consult a thread-local flag. This patch carries the guard result to the caller for each attempt.

Validation

Built the exact upstream port a73a90e9c54c81dc0860986a79be6b247326d1a9 for x86_64-pc-windows-msvc with Cargo offline. Seven selected libtests passed under headless Proton. They cover a denied permit followed by genuine E_INVALIDARG and E_OUTOFMEMORY, isolation across threads, pending state, panic handling and the existing compute wait accounting. The tests use synthetic results and do not need a GPU or game data.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5558084312 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3648). Originally posted by [ghptc](https://github.com/ghptc) on 2026-11-30T02:49:39Z. --- ## What changes A PSO compile that the memory admission guard defers currently returns the same HRESULT as a native allocation failure. That can log a driver refusal and reach the diagnostic Create path while admission has declined the compile. The direct prewarmer reuses a thread across builds, so the previous attempt's thread-local deferral can also stick around for the next PSO. Carry the admission decision as a result local to each creation attempt. A guard deferral skips driver diagnostics and fallback and leaves the PSO pending for its existing cooldown. A native error keeps its original HRESULT and takes the existing failure path. Library hits still return before the Create gate. The patch uses the wait logic and library counters in upstream main. This addresses classification and the fallback on a denied attempt. The existing `VICTORY_SHADER_CAPS=1` retry after a genuine driver failure still uses its direct Create path. The patch adds no driver OOM recovery, and the tests cover no gameplay or FPS claims. Credit Gabriele Cabrini for the deferral diagnosis in [#2743](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2743) and steven-seagull27 for the related classification and CAPS controls in [#2578](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2578). Those proposals consult a thread-local flag. This patch carries the guard result to the caller for each attempt. ## Validation Built the exact upstream port `a73a90e9c54c81dc0860986a79be6b247326d1a9` for `x86_64-pc-windows-msvc` with Cargo offline. Seven selected libtests passed under headless Proton. They cover a denied permit followed by genuine `E_INVALIDARG` and `E_OUTOFMEMORY`, isolation across threads, pending state, panic handling and the existing compute wait accounting. The tests use synthetic results and do not need a GPU or game data.
trustno1-coder commented 2026-12-01 18:50:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:50:11Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321640975 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3648#issuecomment-7321640975). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:50:11Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!3648
No description provided.