Skip to content

Stop waiting for deferred pipeline compiles - #2188

Merged
trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
Ondra97:codex/stop-waiting-on-deferred-pso
Nov 30, 2026
Merged

trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
Ondra97:codex/stop-waiting-on-deferred-pso

Conversation

@Ondra97

@Ondra97 Ondra97 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What it changes

The memory admission path can defer a title pipeline compile and notify its waiters. The frame wait previously treated an empty result as build work in progress and could spend the rest of its wait budget during the retry cooldown.

Stop the wait when the stage is deferred. Preserve the policy that skips repeat screen waits after a real timeout by checking how the wait ended.

How it was tested

  • cargo test -p victory-gpu --lib pipeline:: on Windows stable Rust 1.100.0: 71 passed, two ignored. The regression publishes a cooldown while notifying the same condition variable used in production and verifies the wait completes before the deadline.
  • Windows release build, staged asset policy and whitespace checks passed.
  • Warm A/B on the RTX 4070 Ti SUPER with the same save, Series X, 1440p DLSS Quality, RT and FG off, and the same prepared host pipeline library. Both versions visibly rendered the outdoor street. The camera positions differed, so this is a same-scene observational check.
  • In the common 95-second window, the control had a frame of at least 500 ms in 46 of 91 one-second reports. The patch had zero in 90. The median of the reported one-second p99 values was 503.5 ms and 121.8 ms respectively. The control repeatedly logged a draw drop for the same memory-deferred mesh PSO, while the patch logged no drops for that key in the window. Among 11 comparable FPS samples per build, medians were 8.7 and 12.0 rendered FPS with median draw counts 8,638 and 8,786. Ordinary frame costs remain above the 30 FPS target.
  • The warmed result does not establish recovery with an empty pipeline library.
  • Retested this patch on the proposed CI base from Restore Windows CI on main #2620 (f06505ea) with Windows Rust 1.98.1. The pipeline suite passed 71 tests, with two ignored. The regression confirmed the existing wait exits after a memory deferral without recording a timeout.

CI status

The Windows CI checks for this PR and upstream main (55d06914) stop in Clippy on the unused unwind_copy function in victory-loader. The CI restoration in #2620 is open and passed both Clippy gates and the full workspace test suite. PR CI · Main CI · CI restoration run

Checked for overlap

@ACSchafer

Copy link
Copy Markdown
Contributor

Data point for this PR, on an RTX 3080 10 GB, Ryzen 9 7900X3D, 32 GB RAM, Windows 11, Series X 1440p,
DLSS Quality, ray tracing off, 829188e9.

Plain release: frames held at about 300 ms (3.3 fps) for minutes, with 1.0-15.7 ms on the card and
27-43 ms preparing. 154-1,578 host pipelines failed with 0x8007000E per run. The PC's commit was the
limit, not the card: "the PC has 41 MB free and 145 MB left to commit", 188 compiles put off.

With this PR (and #2102, #2108, #2347, #2349): 15-19 fps in the same scene, but 630 pipelines still
failed and about 900 draws a frame were dropped (no shadows, a corrupted weapon wheel and map).

With a fixed 48-64 GB page file in place of a system-managed one (commit limit 62 GB to about 95 GB),
as docs/windows-memory.md advises: 7-12 pipeline failures a run, the UI and shadows back, about 14 fps
over 10 minutes with no crash. So this PR removes the 300 ms frames; the page file removes the failures
behind them. #2392 looks like the same story from the memory guard's side.

@dyshay

dyshay commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.

@dyshay

dyshay commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

We hit this independently on an RTX 4090, Series X profile at 1440p with ray tracing (64 GB RAM, system-managed page file). Two things combined:

  • The guard saw 2–4 GB of commit left, while the page file could still grow by about 70 GB. It put off every new compile.
  • The screen-pass wait slept for its whole budget although the compile had been put off. Every frame took 10 s (0.1 fps for the whole run, 245 compiles put off).

Our fix does the same two things as #2188 and #2392 together: the wait ends when the compile is put off, and the guard counts what the page file can still grow by. It is in dyshay/VIctory-NVIDIA. Same scene and settings, measured on the card:

median p95 compiles put off 10 s screen waits
before ~10,000 ms ~10,080 ms 4,000+ 23
after 69.6 ms 277 ms 2 0

So the change is confirmed on a second machine. The tests that reproduce the wait (10 s before, immediate after) are in our commit 06ff9b27 if you want them.

@Ondra97
Ondra97 marked this pull request as ready for review November 29, 2026 17:55
cursor Bot pushed a commit to FizedCodes/VIctory-NVIDIA that referenced this pull request Nov 29, 2026
v2026.11.29.01 black screen (0 draws, GPU idle): Create*PipelineState
0x8007000E was recorded as a permanent refuse while screen waits burned
10 s on deferred keys (upstream trustno1-coder#2303/trustno1-coder#2564/trustno1-coder#2182). Treat driver OOM like
a memguard deferral, leave the wait when retry_waits is set (trustno1-coder#2188),
default SCREEN_WAIT_ONCE on, serialize compiles near the commit floor
(VICTORY_COMPILE_SERIAL), and allow VICTORY_SUBMIT_PCORE=1 on hybrid CPUs.

Co-authored-by: FizedCodes <FizedCodes@users.noreply.github.com>
@ghptc

ghptc commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Thanks, @Ondra97. I tested #2188 (9fd78e8) with a small follow-up for a waiter that resumes after the memory-guard cooldown has already expired. If the PSO is still unbuilt and unqueued, the waiter can return without reporting a timeout. If a new request has already queued the PSO, the usual wait still applies. Follow-up-only diff

In a synthetic Win64 run under Proton, I armed the waiter before triggering the deferral. The original code consumed the 500 ms wait budget in both runs (500.044 and 500.047 ms). With #2188 and the follow-up, both waits returned in 0.006 ms without a timeout. The draw stayed unavailable in both versions. The expired-cooldown control returned for an idle PSO and still waited for a requeued one. All six selected tests passed. These timings measure the wait path in the fixture. Gameplay frame times were outside the test scope.

FormulaChenZen added a commit to FormulaChenZen/VIctory-NVIDIA that referenced this pull request Nov 30, 2026
…ng paths

Wake only draws waiting for the affected pipeline and stop waiting when its compile is deferred. Publish placed-view shapes through immutable numbered slots. Handle adjacent soft copies of the same physical page under bounded remapping locks. Keep large gaps out of initial write-watch queries, retain full in-flight hazard checks, and publish the exact observed pages using word masks.

Based in part on upstream profiles and changes in VIctory-NVIDIA trustno1-coder#2188, trustno1-coder#2804, trustno1-coder#3760 and trustno1-coder#3850.
@trustno1-coder
trustno1-coder merged commit 3f8b52e into trustno1-coder:main Nov 30, 2026
6 of 7 checks passed
trustno1-coder pushed a commit that referenced this pull request Nov 30, 2026
Depends on upstream PR #2188 at 9fd78e8. Keep recoverable D3D12 pipeline memory failures pending, space retries across workers, and stop waiting when no worker owns a deferred key. This is a dependency checkpoint for review after #2188 lands. The unmodified main wait loop can otherwise retain the full timeout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-fix Pull request: fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants