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

Closed
github-bot wants to merge 1 commit from github-bot/gh-3648 into main AGit
Owner

@⁠ghptc on GitHub · 2026-11-30 02:49 UTC · original
ghptc:fix/pso-attempt-deferral → main · +209 −163 · 6 files · 1 commits · closed without merging

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.

**@⁠ghptc** on GitHub · 2026-11-30 02:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3648) `ghptc:fix/pso-attempt-deferral` → `main` · +209 −163 · 6 files · 1 commits · closed without merging ## 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://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/2743) and steven-seagull27 for the related classification and CAPS controls in [#2578](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/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.
Carry memory admission separately from a native creation error. The guard leaves the existing maker cooldown in place and skips driver diagnostics and fallback. Direct prewarming cannot carry a deferral into the next pipeline. Keep genuine HRESULTs and report admission deferrals separately from native creation refusals.

Credits for the deferral diagnostics discussion: Gabriele Cabrini (#2743) and steven-seagull27 (#2578). This change uses a per-attempt result.

Ported to upstream without the fork's per-stage PSO outcome counters.
The typed creation and completion results are independent of pipeline
wait changes from #2188.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 02:52:50 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:50 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3648#issuecomment-7321640975) 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.
github-bot closed this pull request 2026-12-01 18:58:06 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3648
No description provided.