Memory guard: no black screen at 0.2 fps on 32 GB PCs (one compile at a time under the commit floor, refused pipelines made again, no 10 s screen waits) #3474

Closed
nyxctura wants to merge 4 commits from upstream-pr/3474 into main
nyxctura commented 2026-11-29 23:44:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nyxctura on 2026-11-29T23:44:12Z.


Fixes #2293. Related: #2520, #3435, #3094, #3107 (the same 0x8007000E pipeline failures and 0.1–0.3 fps stall).

What it changes

On a 32 GB PC with a system-managed page file, the title commits 22–27 GB in the world. The memory guard then puts driver compiles off, and pipelines that the driver refuses with 0x8007000E are recorded as failed for good. Their draws are dropped from then on, and the screen pass waits 10 s every frame for a pipeline that never comes (ms=10000 made=false). The result is a black picture with the HUD at 0.2 fps, about two minutes after loading in, reproduced 4 times, including after a reboot and with every cache deleted.

Three commits:

  1. One compile at a time under the commit floor (compilemem.rs, memguard.rs, procmem.rs). Below the floor, compiles are let through one by one instead of all being put off, so they keep making progress without stacking their peaks. The procmem line now says what holds the host's private memory.
  2. Pipelines refused for memory are made again later (pipeline/make.rs, pipeline/refused.rs, pipeline/library.rs). A memory refusal (the guard's put-off or a driver 0x8007000E) is retried with back-off instead of being recorded as a permanent failure, and no frame waits 10 s for one: the draw is dropped for that frame only.
  3. A compile's cost is measured without the card memory the title loads meanwhile (compilemem.rs, host.rs). The gate measured commit growth during a compile, and that growth included the title's own streaming, so compiles looked several times larger than they were and the gate closed for good.

Screenshots

Before, v2026.11.29.01 as released (2 min after loading in):
image 1

Before, official v2026.11.29.03 (same PC, lighter settings):
image 2

After, v2026.11.29.01 + this PR (same PC):
image 3

fps over time, all three runs:
image 4

How it was tested

  • PC: RTX 5070 12 GB (driver 621.40), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 25H2, page file system-managed.
  • Profile: Series X, 1080p → 1440p, DLSS Performance, frame generation 2x, 30 fps cap, ray tracing off.
  • Before (v2026.11.29.01 as released): 2,550 pipelines failed for good, 2,559 0x8007000E lines, 17 screen waits of 10 s, 0.2 fps in the world (under 1 fps the whole time).
  • After (v2026.11.29.01 + these commits): 0 failed, 0 0x8007000E, 0 screen waits; 12 compiles put off and made later; played 22.5 minutes, median 13.1 fps, never under 1 fps.
  • Still present upstream: the official v2026.11.29.03 binary (sha256 70ad17b9…) on the same PC, with lighter settings (Series S, DLSS Ultra Performance, 60 fps cap), never reached the world: 1,167 0x8007000E lines and 5 ten-second screen waits, with ~11 GB of RAM free on average. The files this PR touches are unchanged between .01 and .03.
  • On current main (41adb551): the branch builds and the victory-gpu lib suite passes, apart from shader_cache::tests::every_switch_of_the_translator_is_in_the_key (VICTORY_SCALAR_SPLITS is not read by the translator any more), which fails the same way on main without this PR. host::card_steps::tests::places_written_after_sending_are_learned failed in one run; it fails intermittently without these commits too. It was not played on main; the play evidence above is on the v2026.11.29.01 base.
  • Not a shader change.
  • cargo test passed for the crates it touches: yes (victory-gpu, see the one unrelated failure above).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3347, #3426, #3398, #2886, #3379.
    • #3347 turns the compile admission off by default. This PR keeps the guard on (it protects PCs with less memory) and makes it let compiles through one at a time instead.
    • #3426 and #3398 also retry deferred pipelines and stop waiting for them; that part overlaps with commit 2.
    • Commits 1 and 3 (serialising compiles under the floor, and measuring a compile's cost without the title's concurrent streaming) are not in any of them.
    • #3379 scales the floor for 16 GB PCs; this PR is about 32 GB PCs and is compatible with it.

All three PRs at a glance

scorecard

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5556437795 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474). Originally posted by [nyxctura](https://github.com/nyxctura) on 2026-11-29T23:44:12Z. --- Fixes #2293. Related: #2520, #3435, #3094, #3107 (the same `0x8007000E` pipeline failures and 0.1–0.3 fps stall). ## What it changes On a 32 GB PC with a system-managed page file, the title commits 22–27 GB in the world. The memory guard then puts driver compiles off, and pipelines that the driver refuses with `0x8007000E` are recorded as failed for good. Their draws are dropped from then on, and the screen pass waits 10 s every frame for a pipeline that never comes (`ms=10000 made=false`). The result is a black picture with the HUD at 0.2 fps, about two minutes after loading in, reproduced 4 times, including after a reboot and with every cache deleted. Three commits: 1. **One compile at a time under the commit floor** (`compilemem.rs`, `memguard.rs`, `procmem.rs`). Below the floor, compiles are let through one by one instead of all being put off, so they keep making progress without stacking their peaks. The `procmem` line now says what holds the host's private memory. 2. **Pipelines refused for memory are made again later** (`pipeline/make.rs`, `pipeline/refused.rs`, `pipeline/library.rs`). A memory refusal (the guard's put-off or a driver `0x8007000E`) is retried with back-off instead of being recorded as a permanent failure, and no frame waits 10 s for one: the draw is dropped for that frame only. 3. **A compile's cost is measured without the card memory the title loads meanwhile** (`compilemem.rs`, `host.rs`). The gate measured commit growth during a compile, and that growth included the title's own streaming, so compiles looked several times larger than they were and the gate closed for good. ## Screenshots **Before, v2026.11.29.01 as released** (2 min after loading in): ![image 1](https://raw.githubusercontent.com/nyxctura/VIctory-NVIDIA/pr-images/1-before-v2911-black.png) **Before, official v2026.11.29.03** (same PC, lighter settings): ![image 2](https://raw.githubusercontent.com/nyxctura/VIctory-NVIDIA/pr-images/2-official-v2911-03-stall.png) **After, v2026.11.29.01 + this PR** (same PC): ![image 3](https://raw.githubusercontent.com/nyxctura/VIctory-NVIDIA/pr-images/3-after-fix-in-world.png) **fps over time, all three runs:** ![image 4](https://raw.githubusercontent.com/nyxctura/VIctory-NVIDIA/pr-images/4-pr1-fps-chart.png) ## How it was tested - **PC:** RTX 5070 12 GB (driver 621.40), Ryzen 7 7800X3D, 32 GB RAM, Windows 11 25H2, page file system-managed. - **Profile:** Series X, 1080p → 1440p, DLSS Performance, frame generation 2x, 30 fps cap, ray tracing off. - **Before (v2026.11.29.01 as released):** 2,550 pipelines failed for good, 2,559 `0x8007000E` lines, 17 screen waits of 10 s, 0.2 fps in the world (under 1 fps the whole time). - **After (v2026.11.29.01 + these commits):** 0 failed, 0 `0x8007000E`, 0 screen waits; 12 compiles put off and made later; played 22.5 minutes, median 13.1 fps, never under 1 fps. - **Still present upstream:** the official v2026.11.29.03 binary (sha256 `70ad17b9…`) on the same PC, with lighter settings (Series S, DLSS Ultra Performance, 60 fps cap), never reached the world: 1,167 `0x8007000E` lines and 5 ten-second screen waits, with ~11 GB of RAM free on average. The files this PR touches are unchanged between .01 and .03. - **On current `main` (41adb551):** the branch builds and the `victory-gpu` lib suite passes, apart from `shader_cache::tests::every_switch_of_the_translator_is_in_the_key` (`VICTORY_SCALAR_SPLITS is not read by the translator any more`), which fails the same way on `main` without this PR. `host::card_steps::tests::places_written_after_sending_are_learned` failed in one run; it fails intermittently without these commits too. It was not played on `main`; the play evidence above is on the v2026.11.29.01 base. - Not a shader change. - `cargo test` passed for the crates it touches: yes (`victory-gpu`, see the one unrelated failure above). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3347, #3426, #3398, #2886, #3379. - #3347 turns the compile admission off by default. This PR keeps the guard on (it protects PCs with less memory) and makes it let compiles through one at a time instead. - #3426 and #3398 also retry deferred pipelines and stop waiting for them; that part overlaps with commit 2. - Commits 1 and 3 (serialising compiles under the floor, and measuring a compile's cost without the title's concurrent streaming) are not in any of them. - #3379 scales the floor for 16 GB PCs; this PR is about 32 GB PCs and is compatible with it. ## All three PRs at a glance ![scorecard](https://raw.githubusercontent.com/nyxctura/VIctory-NVIDIA/pr-images/11-scorecard.png) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ThePerfomance commented 2026-11-30 04:18:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ThePerfomance on 2026-11-30T04:18:22Z.

Review: COMMENTED


Thanks for tackling the low-memory stalls, @nyxctura. In my run of 6cb6b38, the exit summary reported 731 deferred pipeline builds and zero permanent failures. The deferred count first appeared in the summary at exit.

Could the deferred branch in refused::failed set changed = true when it increments put_off? That would let summary(false) report the updated count when the queue drains, which helps when a hung run has to be force-closed. A small test could check that one deferral produces a summary and that a second call without new events stays quiet.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6106834520 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#pullrequestreview-6106834520). Originally posted by [ThePerfomance](https://github.com/ThePerfomance) on 2026-11-30T04:18:22Z. **Review:** COMMENTED --- Thanks for tackling the low-memory stalls, @nyxctura. In my run of `6cb6b38`, the exit summary reported 731 deferred pipeline builds and zero permanent failures. The deferred count first appeared in the summary at exit. Could the deferred branch in `refused::failed` set `changed = true` when it increments `put_off`? That would let `summary(false)` report the updated count when the queue drains, which helps when a hung run has to be force-closed. A small test could check that one deferral produces a summary and that a second call without new events stays quiet.
nyxctura commented 2026-11-30 04:35:29 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nyxctura on 2026-11-30T04:35:29Z.


Good catch, thanks for testing. Pushed: the deferred branch now marks the summary changed, so summary(false) reports put-off makes as they happen instead of only at exit. Added the test you described (one deferral gives a summary line, a second call with nothing new stays quiet); it fails without the change.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7268909837 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7268909837). Originally posted by [nyxctura](https://github.com/nyxctura) on 2026-11-30T04:35:29Z. --- Good catch, thanks for testing. Pushed: the deferred branch now marks the summary changed, so `summary(false)` reports put-off makes as they happen instead of only at exit. Added the test you described (one deferral gives a summary line, a second call with nothing new stays quiet); it fails without the change.
upipibi commented 2026-11-30 05:18:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-11-30T05:18:58Z.


Test report for #3474 (head 92fa4133), merged onto main 41adb551. Synthetic tests only: no title run, no game files, so this does not show the black screen going away in a title.

Setup: RTX 3070 8 GB, driver 621.40, 32 GB RAM, Windows 11 (10.0.26100), rustc 1.98.1.

The ten new tests (compilemem, pipeline::make, pipeline::refused, pipeline::library, procmem): 10 passed, 0 failed, 3/3 runs. They are logic tests and make no device.

Negative controls, one line changed each:

Change Test Result
A: the gate in compilemem.rs never lets the single compile through under the commit floor (if false && verdict == Verdict::Commit && self.running.is_empty() && single_fits(..)) under_the_commit_floor_one_compile_still_runs_alone fails at compilemem.rs:612: alone, over the single floor, left Commit, right Allow
B: wait_cut in pipeline/make.rs ignores put_off waits_are_cut_for_pipelines_put_off_for_memory fails at make.rs:1848: put off: nothing makes it now
B a_wait_ends_when_its_pipeline_is_put_off fails at make.rs:1884: ended with the put-off: 513.0485ms

So the tests do pin the two behaviours the description leads with: one compile still runs under the floor, and a wait ends when its pipeline is put off.

cargo test -p victory-gpu --lib --locked, three runs of each tree in turn

Tree Run 1 Run 2 Run 3
PR 929 passed, 3 failed 929 passed, 3 failed 931 passed, 1 failed
Main 41adb551 919 passed, 3 failed 921 passed, 1 failed 919 passed, 3 failed

Failures by test over the three runs:

Test PR Main
shader_cache::tests::every_switch_of_the_translator_is_in_the_key 3 3
host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started 2 2
host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue 1 1
host::card_steps::tests::places_written_after_sending_are_learned 0 1
watch::tests::a_late_fault_leaves_the_guard_taken_since 1 0

None is one of the PR's tests. The first fails on main every time; the next three come and go on both trees. The last one failed once on the PR tree and not in main's three runs here; this PR does not touch watch.rs, and I have seen other watch:: tests fail now and then on main today, so I read it as the same kind, but three runs cannot settle that.

Not tested: the memory guard in a title on a 32 GB PC with a system-managed page file, which is the case #2293 is about.

Tested with the help of Claude Code (Claude Fable 5.2).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269551725 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7269551725). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-30T05:18:58Z. --- Test report for #3474 (head 92fa4133), merged onto main 41adb551. Synthetic tests only: no title run, no game files, so this does not show the black screen going away in a title. **Setup:** RTX 3070 8 GB, driver 621.40, 32 GB RAM, Windows 11 (10.0.26100), rustc 1.98.1. **The ten new tests** (`compilemem`, `pipeline::make`, `pipeline::refused`, `pipeline::library`, `procmem`): 10 passed, 0 failed, 3/3 runs. They are logic tests and make no device. **Negative controls**, one line changed each: | Change | Test | Result | |---|---|---| | A: the gate in `compilemem.rs` never lets the single compile through under the commit floor (`if false && verdict == Verdict::Commit && self.running.is_empty() && single_fits(..)`) | `under_the_commit_floor_one_compile_still_runs_alone` | **fails** at `compilemem.rs:612`: `alone, over the single floor`, left `Commit`, right `Allow` | | B: `wait_cut` in `pipeline/make.rs` ignores `put_off` | `waits_are_cut_for_pipelines_put_off_for_memory` | **fails** at `make.rs:1848`: `put off: nothing makes it now` | | B | `a_wait_ends_when_its_pipeline_is_put_off` | **fails** at `make.rs:1884`: `ended with the put-off: 513.0485ms` | So the tests do pin the two behaviours the description leads with: one compile still runs under the floor, and a wait ends when its pipeline is put off. **`cargo test -p victory-gpu --lib --locked`, three runs of each tree in turn** | Tree | Run 1 | Run 2 | Run 3 | |---|---|---|---| | PR | 929 passed, 3 failed | 929 passed, 3 failed | 931 passed, 1 failed | | Main 41adb551 | 919 passed, 3 failed | 921 passed, 1 failed | 919 passed, 3 failed | Failures by test over the three runs: | Test | PR | Main | |---|---|---| | `shader_cache::tests::every_switch_of_the_translator_is_in_the_key` | 3 | 3 | | `host::menu::tests::a_change_is_saved_at_once_however_the_game_was_started` | 2 | 2 | | `host::uav_pool::tests::host_list_uav_pool_lifecycle_retire_trim_and_info_queue` | 1 | 1 | | `host::card_steps::tests::places_written_after_sending_are_learned` | 0 | 1 | | `watch::tests::a_late_fault_leaves_the_guard_taken_since` | 1 | 0 | None is one of the PR's tests. The first fails on main every time; the next three come and go on both trees. The last one failed once on the PR tree and not in main's three runs here; this PR does not touch `watch.rs`, and I have seen other `watch::` tests fail now and then on main today, so I read it as the same kind, but three runs cannot settle that. Not tested: the memory guard in a title on a 32 GB PC with a system-managed page file, which is the case #2293 is about. *Tested with the help of Claude Code (Claude Fable 5.2).*
nyxctura commented 2026-11-30 05:32:38 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nyxctura on 2026-11-30T05:32:38Z.


Thanks for the check, especially breaking it on purpose to see the tests catch it. Looks like everything works as it should.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269767309 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7269767309). Originally posted by [nyxctura](https://github.com/nyxctura) on 2026-11-30T05:32:38Z. --- Thanks for the check, especially breaking it on purpose to see the tests catch it. Looks like everything works as it should.
andrewpozdnakov7-jpg commented 2026-11-30 09:52:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-11-30T09:52:47Z.


#3813 now has a matched hardware comparison on an RTX 4070 Ti Super 16 GB with 32 GB system RAM. The reporter used the same settings, cleared the shader cache and preloaded for each run. The build with #3474 reached the scene. Reporter and three logs

I counted the outcomes in the attached play logs.

Build Distinct keys in the failure counter Failed screen waits Outcome reported
v2026.11.28.03 0 0 Loaded the scene
v2026.11.29.05 575 with 0x8007000e 9,940 ms and 10,000 ms Black screen while loading
Build with #3474 0 reported as failed, 1,933 build attempts put off 734 ms and 635 ms Loaded the scene

The patched run still has long frames and logged low system commit. This comparison confirms that the reporter can reach the scene and that the failure counter stayed at zero in that run.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7274810082 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7274810082). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-30T09:52:47Z. --- #3813 now has a matched hardware comparison on an RTX 4070 Ti Super 16 GB with 32 GB system RAM. The reporter used the same settings, cleared the shader cache and preloaded for each run. The build with #3474 reached the scene. [Reporter and three logs](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3813#issuecomment-7274512430) I counted the outcomes in the attached play logs. | Build | Distinct keys in the failure counter | Failed screen waits | Outcome reported | | --- | --- | --- | --- | | `v2026.11.28.03` | 0 | 0 | Loaded the scene | | `v2026.11.29.05` | 575 with `0x8007000e` | 9,940 ms and 10,000 ms | Black screen while loading | | Build with #3474 | 0 reported as failed, 1,933 build attempts put off | 734 ms and 635 ms | Loaded the scene | The patched run still has long frames and logged low system commit. This comparison confirms that the reporter can reach the scene and that the failure counter stayed at zero in that run.
SergDi commented 2026-11-30 10:39:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by SergDi on 2026-11-30T10:39:02Z.


I tested the accounting interaction of this PR (92fa4133) and #2743 (f046d180) on 41adb551, using synthetic Windows tests with Rust 1.98.1. This is a local integration experiment, not a failure claim against either PR alone.

Integration used this PR's refused.rs guards, #2743's panel and put_off() getter, and its refusal test. The key behavioral difference is deliberate: this PR puts driver-memory refusals off for retry, while #2743 alone only excludes guard deferrals from failed keys.

If the intended UI contract is “both kinds of memory put-off receive the memory explanation”, the combined tree has a reproducible mismatch:

  • Guard put-off: the panel says NO MEMORY.
  • Driver-memory put-off: DRIVER_REFUSED increments but put_off() reads only REFUSED. The panel instead says THEIR SHADERS CANNOT BE CONVERTED YET / NOTHING ON YOUR SIDE.

The contract test below fails for the driver branch. Summing the two counters only in the panel-facing getter makes it pass; separate per-cause counters remain available. This is a proposal for the combined configuration, not a change to the retry policy.

Evidence: #2743 characterization 2/2; this PR's matrix 3/3; combined matrix+contract 3 passed / 1 expected RED; with the getter proposal 4/4 and selected modules 82/82. Tests ran with --test-threads=1 because counters are global. One separate release-mode procmem test failed identically on clean 41adb551; it is not attributed to this PR. Strict release/no-deps Clippy had the same 30 diagnostic locations as the base, after accounting for line shifts; not a clean Clippy pass.

Two useful accounting distinctions from the matrix/code review:

  • Seen.put_off counts events per ask, not unique pipelines. A single pipeline can contribute repeatedly.
  • Second-ask successes are counted internally by SECOND, but only sampled so_far messages expose them; there is no getter/final total. Success after a later back-off has no separate counter.

The contract patch applies to that combined tree; the getter proposal applies after it. The policy choice to retry a driver OOM is separate from whether the panel explains a pending retry accurately. No game/OOM-stress run or FPS claim is part of this check.

cargo test --locked --release -p victory-gpu --lib a_put_off_for_memory_gets_the_memory_note_whoever_put_it_off -- --test-threads=1 --nocapture

AI assistance: Claude prepared and ran the synthetic matrix; Codex reviewed the evidence and scope. No game data is included.

contract-test-on-combined.patch — synthetic integration test
diff --git a/crates/victory-gpu/src/host/panel.rs b/crates/victory-gpu/src/host/panel.rs
index f16fddac..db3f7a33 100644
--- a/crates/victory-gpu/src/host/panel.rs
+++ b/crates/victory-gpu/src/host/panel.rs
@@ -1059,6 +1059,26 @@ mod tests {
         }
     }
 
+    /// OOM contract (local experiment, phase 4; #3474 + #2743 combined):
+    /// draws skipped while compiles are put off for memory get the memory
+    /// note, whether the guard put them off or the driver refused them for
+    /// memory (both are made again later), never "cannot be converted yet".
+    #[test]
+    fn a_put_off_for_memory_gets_the_memory_note_whoever_put_it_off() {
+        let note = |put_off: u64| advice(&Sample { fps: 20.0, ms: 50.0, dropped: 47.0, put_off: put_off as f64, ..Sample::default() });
+        crate::memguard::take_deferred();
+        let before = crate::memguard::put_off();
+        crate::memguard::refuse_compile("oom contract", crate::memguard::Verdict::Commit, None);
+        crate::memguard::take_deferred();
+        let gate = note(crate::memguard::put_off() - before);
+        assert!(gate.iter().any(|l| l.contains("NO MEMORY")), "the guard's: {gate:?}");
+        let before = crate::memguard::put_off();
+        crate::memguard::put_off_for_driver("oom contract");
+        crate::memguard::take_deferred();
+        let driver = note(crate::memguard::put_off() - before);
+        assert!(driver.iter().any(|l| l.contains("NO MEMORY")), "the driver's: {driver:?}");
+    }
+
     #[test]
     fn counters_that_went_back_to_nothing_count_from_there() {
         let (mut a, mut b) = (Counters::default(), Counters::default());
put-off-counts-both-causes.patch — local proposal after the contract test
diff --git a/crates/victory-gpu/src/memguard.rs b/crates/victory-gpu/src/memguard.rs
index 0acc7e89..41e537a8 100644
--- a/crates/victory-gpu/src/memguard.rs
+++ b/crates/victory-gpu/src/memguard.rs
@@ -177,10 +177,12 @@ pub(crate) fn put_off_for_driver(what: &str) {
     DEFERRED.set(true);
 }
 
-/// Compiles put off since the start (the F2 explainer tells the draws they
-/// leave out from those whose shaders do not translate).
+/// Compiles put off for memory since the start, the gate's ([`REFUSED`]) and
+/// those the driver refused for memory ([`DRIVER_REFUSED`]): both are made
+/// again later, so the F2 explainer tells the draws they leave out from those
+/// whose shaders do not translate. The two stay apart in their own counters.
 pub(crate) fn put_off() -> u64 {
-    REFUSED.load(Ordering::Relaxed)
+    REFUSED.load(Ordering::Relaxed) + DRIVER_REFUSED.load(Ordering::Relaxed)
 }
 
 /// Whether a compile on this thread was refused by the guard since the last
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7275890183 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7275890183). Originally posted by [SergDi](https://github.com/SergDi) on 2026-11-30T10:39:02Z. --- I tested the accounting interaction of this PR (`92fa4133`) and #2743 (`f046d180`) on `41adb551`, using synthetic Windows tests with Rust 1.98.1. This is a **local integration experiment**, not a failure claim against either PR alone. Integration used this PR's `refused.rs` guards, #2743's panel and `put_off()` getter, and its refusal test. The key behavioral difference is deliberate: this PR puts driver-memory refusals off for retry, while #2743 alone only excludes guard deferrals from failed keys. If the intended UI contract is **“both kinds of memory put-off receive the memory explanation”**, the combined tree has a reproducible mismatch: - Guard put-off: the panel says `NO MEMORY`. - Driver-memory put-off: `DRIVER_REFUSED` increments but `put_off()` reads only `REFUSED`. The panel instead says `THEIR SHADERS CANNOT BE CONVERTED YET` / `NOTHING ON YOUR SIDE`. The contract test below fails for the driver branch. Summing the two counters **only in the panel-facing getter** makes it pass; separate per-cause counters remain available. This is a proposal for the combined configuration, not a change to the retry policy. **Evidence:** #2743 characterization 2/2; this PR's matrix 3/3; combined matrix+contract **3 passed / 1 expected RED**; with the getter proposal **4/4** and selected modules **82/82**. Tests ran with `--test-threads=1` because counters are global. One separate release-mode procmem test failed identically on clean `41adb551`; it is not attributed to this PR. Strict release/no-deps Clippy had the same 30 diagnostic locations as the base, after accounting for line shifts; not a clean Clippy pass. Two useful accounting distinctions from the matrix/code review: - `Seen.put_off` counts events per ask, not unique pipelines. A single pipeline can contribute repeatedly. - Second-ask successes **are counted internally** by `SECOND`, but only sampled `so_far` messages expose them; there is no getter/final total. Success after a later back-off has no separate counter. The contract patch applies to that combined tree; the getter proposal applies after it. The policy choice to retry a driver OOM is separate from whether the panel explains a pending retry accurately. No game/OOM-stress run or FPS claim is part of this check. ```powershell cargo test --locked --release -p victory-gpu --lib a_put_off_for_memory_gets_the_memory_note_whoever_put_it_off -- --test-threads=1 --nocapture ``` AI assistance: Claude prepared and ran the synthetic matrix; Codex reviewed the evidence and scope. No game data is included. <details> <summary>contract-test-on-combined.patch — synthetic integration test</summary> ```diff diff --git a/crates/victory-gpu/src/host/panel.rs b/crates/victory-gpu/src/host/panel.rs index f16fddac..db3f7a33 100644 --- a/crates/victory-gpu/src/host/panel.rs +++ b/crates/victory-gpu/src/host/panel.rs @@ -1059,6 +1059,26 @@ mod tests { } } + /// OOM contract (local experiment, phase 4; #3474 + #2743 combined): + /// draws skipped while compiles are put off for memory get the memory + /// note, whether the guard put them off or the driver refused them for + /// memory (both are made again later), never "cannot be converted yet". + #[test] + fn a_put_off_for_memory_gets_the_memory_note_whoever_put_it_off() { + let note = |put_off: u64| advice(&Sample { fps: 20.0, ms: 50.0, dropped: 47.0, put_off: put_off as f64, ..Sample::default() }); + crate::memguard::take_deferred(); + let before = crate::memguard::put_off(); + crate::memguard::refuse_compile("oom contract", crate::memguard::Verdict::Commit, None); + crate::memguard::take_deferred(); + let gate = note(crate::memguard::put_off() - before); + assert!(gate.iter().any(|l| l.contains("NO MEMORY")), "the guard's: {gate:?}"); + let before = crate::memguard::put_off(); + crate::memguard::put_off_for_driver("oom contract"); + crate::memguard::take_deferred(); + let driver = note(crate::memguard::put_off() - before); + assert!(driver.iter().any(|l| l.contains("NO MEMORY")), "the driver's: {driver:?}"); + } + #[test] fn counters_that_went_back_to_nothing_count_from_there() { let (mut a, mut b) = (Counters::default(), Counters::default()); ``` </details> <details> <summary>put-off-counts-both-causes.patch — local proposal after the contract test</summary> ```diff diff --git a/crates/victory-gpu/src/memguard.rs b/crates/victory-gpu/src/memguard.rs index 0acc7e89..41e537a8 100644 --- a/crates/victory-gpu/src/memguard.rs +++ b/crates/victory-gpu/src/memguard.rs @@ -177,10 +177,12 @@ pub(crate) fn put_off_for_driver(what: &str) { DEFERRED.set(true); } -/// Compiles put off since the start (the F2 explainer tells the draws they -/// leave out from those whose shaders do not translate). +/// Compiles put off for memory since the start, the gate's ([`REFUSED`]) and +/// those the driver refused for memory ([`DRIVER_REFUSED`]): both are made +/// again later, so the F2 explainer tells the draws they leave out from those +/// whose shaders do not translate. The two stay apart in their own counters. pub(crate) fn put_off() -> u64 { - REFUSED.load(Ordering::Relaxed) + REFUSED.load(Ordering::Relaxed) + DRIVER_REFUSED.load(Ordering::Relaxed) } /// Whether a compile on this thread was refused by the guard since the last ``` </details>
andrewpozdnakov7-jpg commented 2026-11-30 13:31:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-11-30T13:31:27Z.


#3813's latest RTX 5080 report adds an independent .05 reproduction. Series X recorded 1,349 driver OOM failures at 45.6/46.0 GiB of system commit with 3.5 GiB of physical memory free. Series S still recorded 808 failures with only two pipeline workers. The matched RTX 4070 Ti Super run remains the result on this PR.

I checked how this PR combines with #3788. A direct cherry-pick conflicted in pipeline/make.rs. I resolved it in a review branch based on release main 41adb551. The branch keeps the four #3474 commits, #3788 and the reviewer's reservation fix with their original Git authors. The combined wait keeps the memory-deferral exit and short budget from #3474, plus the cumulative screen allowance and concurrent reservation from #3788.

Native Windows diagnostics tests passed 75/75 across pipeline making, the library, refusal accounting, compile admission, memory guard and process memory. The 36 pipeline-making tests also passed with four test threads. The same synthetic unmade pass with scaled 300/20 ms budgets measured 304, 30 and 30 ms across three frames. The legacy switch produced 314, 312 and 315 ms. The concurrent reservation and early memory-deferral tests passed. Asset policy passed for all seven outgoing source files. The whole-tree check still flags the same unchanged frame_users.rs file on release main and the branch.

@Damaschni if you can do a matched rerun, the next useful comparison is the exact 92fa4133 patch on .05 with your same Series X settings and existing Windows commit limit. Please note whether the opening reaches the first playable frame, the driver refusals versus deferred retries, and whether the image is complete.

Please preserve the original Git authors when taking the commits. If my conflict resolution is folded into another commit, use Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

RTX 5080 follow-up. Damaschni's exact-head 92fa4133 rerun recorded zero permanent pipeline failures, zero driver OOM messages, zero 10-second screen waits, and 5,078 deferral events. The first frame with at least 500 draws appeared after 73 seconds, with a median of 0.7 FPS over 32 samples. The diagnostic capture showed credits and loading art while the sampled 3D frames were black. The first controllable frame remains unverified. The system-managed commit limit was 49.75 GiB in this run versus 46.0 GiB in the stock report.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7279967738 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7279967738). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-30T13:31:27Z. --- [#3813's latest RTX 5080 report](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3813#issuecomment-7279624520) adds an independent `.05` reproduction. Series X recorded 1,349 driver OOM failures at 45.6/46.0 GiB of system commit with 3.5 GiB of physical memory free. Series S still recorded 808 failures with only two pipeline workers. The [matched RTX 4070 Ti Super run](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7274810082) remains the result on this PR. I checked how this PR combines with [#3788](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3788#issuecomment-7279567441). A direct cherry-pick conflicted in `pipeline/make.rs`. I resolved it in a [review branch](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/tree/review/3474-3788-compatible-waits) based on release main `41adb551`. The branch keeps the four #3474 commits, #3788 and [the reviewer's reservation fix](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/1d2f2cc794cb0ef4407e59e3eec36953e12b9935) with their original Git authors. The combined wait keeps the memory-deferral exit and short budget from #3474, plus the cumulative screen allowance and concurrent reservation from #3788. Native Windows diagnostics tests passed 75/75 across pipeline making, the library, refusal accounting, compile admission, memory guard and process memory. The 36 pipeline-making tests also passed with four test threads. The same synthetic unmade pass with scaled 300/20 ms budgets measured 304, 30 and 30 ms across three frames. The legacy switch produced 314, 312 and 315 ms. The concurrent reservation and early memory-deferral tests passed. Asset policy passed for all seven outgoing source files. The whole-tree check still flags the same unchanged `frame_users.rs` file on release main and the branch. @Damaschni if you can do a matched rerun, the next useful comparison is the exact `92fa4133` patch on `.05` with your same Series X settings and existing Windows commit limit. Please note whether the opening reaches the first playable frame, the driver refusals versus deferred retries, and whether the image is complete. Please preserve the original Git authors when taking the commits. If my conflict resolution is folded into another commit, use `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. RTX 5080 follow-up. [Damaschni's exact-head 92fa4133 rerun](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7280820733) recorded zero permanent pipeline failures, zero driver OOM messages, zero 10-second screen waits, and 5,078 deferral events. The first frame with at least 500 draws appeared after 73 seconds, with a median of 0.7 FPS over 32 samples. The diagnostic capture showed credits and loading art while the sampled 3D frames were black. The first controllable frame remains unverified. The system-managed commit limit was 49.75 GiB in this run versus 46.0 GiB in the stock report.
Damaschni commented 2026-11-30 14:05:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Damaschni on 2026-11-30T14:05:33Z.


@andrewpozdnakov7-jpg, here is the RTX 5080 rerun you asked for. I built the exact 92fa4133 head on the .05 base (41adb551). Same Series X settings as my original report: 2560×1440 output, DLSS Quality, frame generation off. RTX 5080 16 GB, 32 GB RAM, Windows 11 build 26300, driver 621.14. This release run used the offscreen window and scripted Enter.

  • Intro progress. The first frame with at least 500 draws was logged 73 s after launch (about 34 s after Enter). Median FPS after that marker was 0.7 across 32 logged samples. The run was stopped after about 4 min 46 s.
  • Pipeline outcome. 0 permanent host-pipeline failures, 0 driver OOM messages, and 5,078 compile deferral events in the last compile memory summary. Repeated deferrals of the same pipeline can contribute more than once. There were zero logged 10 s screen waits.
  • System commit. At peak usage, 48.83 / 49.75 GiB was committed with 3.17 GiB of physical memory available. The page-file setting was system managed for both runs. The original .05 sample was 45.6 / 46.0 GiB, so the observed commit limits differed.
  • Image check. A separate diagnostics build of the same commit, using a copy of the release run's cache, captured visible credits and loading art. The sampled 3D frames were black. A complete scene and the first controllable gameplay frame remain unverified.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7280820733 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7280820733). Originally posted by [Damaschni](https://github.com/Damaschni) on 2026-11-30T14:05:33Z. --- @andrewpozdnakov7-jpg, here is the RTX 5080 rerun you [asked for](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7279967738). I built the exact `92fa4133` head on the `.05` base (`41adb551`). Same Series X settings as my [original report](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/3813#issuecomment-7279624520): 2560×1440 output, DLSS Quality, frame generation off. RTX 5080 16 GB, 32 GB RAM, Windows 11 build 26300, driver 621.14. This release run used the offscreen window and scripted Enter. - **Intro progress.** The first frame with at least 500 draws was logged 73 s after launch (about 34 s after Enter). Median FPS after that marker was **0.7** across 32 logged samples. The run was stopped after about 4 min 46 s. - **Pipeline outcome.** **0 permanent host-pipeline failures**, **0 driver OOM messages**, and **5,078 compile deferral events** in the last `compile memory` summary. Repeated deferrals of the same pipeline can contribute more than once. There were zero logged 10 s screen waits. - **System commit.** At peak usage, **48.83 / 49.75 GiB** was committed with **3.17 GiB** of physical memory available. The page-file setting was system managed for both runs. The original `.05` sample was **45.6 / 46.0 GiB**, so the observed commit limits differed. - **Image check.** A separate diagnostics build of the same commit, using a copy of the release run's cache, captured visible credits and loading art. The sampled 3D frames were black. A complete scene and the first controllable gameplay frame remain unverified.
andrewpozdnakov7-jpg commented 2026-12-01 11:23:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T11:23:12Z.


Thanks for rerunning 92fa4133. The play log recorded zero permanent pipeline failures and zero 10-second screen waits. Median FPS was still 0.7, and the sampled 3D frames in the separate diagnostics capture were black. The first playable frame remains unconfirmed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7309567913 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7309567913). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T11:23:12Z. --- Thanks for rerunning `92fa4133`. The play log recorded zero permanent pipeline failures and zero 10-second screen waits. Median FPS was still 0.7, and the sampled 3D frames in the separate diagnostics capture were black. The first playable frame remains unconfirmed.
trustno1-coder commented 2026-12-01 18:52:02 +00:00 (Migrated from github.com)

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


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:7321703920 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3474#issuecomment-7321703920). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:52:02Z. --- 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!3474
No description provided.