Repository navigation
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
Conversation
…rocmem line says what holds the host private Root cause of the v2026.11.29.01 freeze on PCs with a managed page file (trustno1-coder#2142, trustno1-coder#2182, trustno1-coder#2286, trustno1-coder#2293, trustno1-coder#2303, trustno1-coder#2550): the compile memory gate (new in this release, 60a08ef) put off every driver compile while the commit left was under VICTORY_COMMIT_FLOOR_MB (4096). A page file that Windows manages grows only once the commit comes near the limit, so a gate that keeps the commit away from it never sees it grow: on a 32 GB PC the commit left sat at 2.0-2.9 GB for the rest of the run, 4,096-16,384 compiles were put off, 1,250-2,551 pipelines were never made (each logged as "host pipeline failed 0x8007000e": the gate's own refusal) and every frame waited 10 s for a pass over the screen. The host-address growth itself (3.3 -> 16.9 GB in two minutes) follows the card: the card's own memory in use rose 0.8 -> 7.7 GB and the shared memory 0.8 -> 5.2 GB (4,016 host copies of title memory, 4.5 GB, at world entry), both backed by the process's commit under WDDM; v2026.11.28.03 builds reached 26-30 GB private the same way. Now, with no compile running, one still starts while the commit left is over VICTORY_COMMIT_SINGLE_FLOOR_MB (1024) plus the least a compile takes (256 MB); a figure at or over the commit floor turns that off. Over the commit floor nothing changes. The process memory line also says how much of the host private is the card's own memory in use and the shared memory, the rest, the regions at host addresses and the small private ones among them, and the gate's counts (running, most at once, put off, let through alone). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 10 s for one
A pipeline the driver refuses with E_OUTOFMEMORY (or the commit limit's
error) is asked again once the spare upload, shared, scratch and read-back
buffers are let go (ported from our commit-fix oom.rs); refused again, it
is put off like a compile the gate holds back, not recorded as refused for
the run. VICTORY_PIPELINE_OOM_RETRY=0: as before.
A pipeline put off waits 1 s before it is tried again, then 2, 4 and at
most 8 s each further time (was 1 s for ever): it is never given up on,
and a PC short of memory is not asked a thousand compiles a second.
The gate's own refusal carries E_OUTOFMEMORY and was logged and counted
as "host pipeline failed ... 0x8007000e" (1,250-2,551 a run): a make put
off is now counted apart in the failures line ("makes put off for
memory"), and the VICTORY_SHADER_CAPS retry no longer goes round the gate.
Waits: a draw stops waiting for a pipeline once it is put off (nothing
makes it before its pause is over). While compiles are being put off
(the last two seconds) passes over the screen wait at most
VICTORY_SCREEN_WAIT_SHORT_MS (50) a frame in all, instead of the screen's
10 s: the pass is left out of the frame until its pipeline is made, which
goes on meanwhile.
The process memory line counts the pipelines the driver refused for
memory and made later.
Tests: the retry of a create refused for memory, the growing pause, the
cut waits and screen budget, a wait that ends with the put-off, a make put
off is not a failure, a driver refusal is told to the maker.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e title loads meanwhile The gate learns what a compile takes from the process's private bytes over its length. The card's own memory in use and the memory it shares with the PC are backed by the process's commit too, and grow with what the title loads: at world entry they grew 6.8 GB in five seconds while 21 compiles ran, which raised a compile's expected cost from 256 to 1,272 MB, and with it what the gate held back for the compiles running (so compiles were put off with 2-3 GB of commit left). They are now taken off the private bytes the gate measures by (the figures the memory line reads once a second). Test: a compile alongside 6 GB of card loading is measured as its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…der#3474) Port of trustno1-coder#3474 (fixes trustno1-coder#2293), three conflicts with trustno1-coder#2580 in pipeline/make.rs and refused.rs, merged by hand. Under the commit floor compiles go one at a time instead of all being put off (compilemem.rs, memguard.rs, procmem.rs); a memory refusal (the guard's put-off or a driver 0x8007000E) is retried with back-off, not recorded as a permanent failure, and no frame waits 10 s for one; a compile's cost is measured without the card memory the title loads meanwhile. Merge choices: trustno1-coder#2580's wait_loop already ends a wait on a put-off build (retry_waits), so the PR's wait_cut helper, its WAIT_SLICE and its inline loop were dropped; the PR's starved screen-pass budget (screen_or_wait_budget, 50 ms while compiles are put off) is kept and its test reduced to the budget asserts; refused.rs keeps both test modules. Upstream: 32 GB PC, black screen at 0.2 fps reproduced 4 times and gone with the PR; not tried on a 3080 here, and with a warm shader cache the starved path should not engage, so this run only checks for regressions.
ThePerfomance
left a comment
There was a problem hiding this comment.
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.
…mary failed() counted put-off makes without marking the summary changed, so summary(false) stayed quiet and the count first showed at exit; a hung run closed by force never printed it. The deferred branch now sets changed too. The line's contents come from summary_line(), and a test checks that one put-off make is reported once and a second look with nothing new stays quiet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Good catch, thanks for testing. Pushed: the deferred branch now marks the summary changed, so |
|
Test report for #3474 (head 92fa413), merged onto main 41adb55. 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 ( Negative controls, one line changed each:
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.
Failures by test over the three runs:
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 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). |
|
Thanks for the check, especially breaking it on purpose to see the tests catch it. Looks like everything works as it should. |
|
#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.
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. |
|
I tested the accounting interaction of this PR ( Integration used this PR's If the intended UI contract is “both kinds of memory put-off receive the memory explanation”, the combined tree has a reproducible mismatch:
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 Two useful accounting distinctions from the matrix/code review:
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 --nocaptureAI 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 testdiff --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 testdiff --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 |
|
#3813's latest RTX 5080 report adds an independent I checked how this PR combines with #3788. A direct cherry-pick conflicted in 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 @Damaschni if you can do a matched rerun, the next useful comparison is the exact Please preserve the original Git authors when taking the commits. If my conflict resolution is folded into another commit, use |
|
@andrewpozdnakov7-jpg, here is the RTX 5080 rerun you asked for. I built the exact
|
Fixes #2293. Related: #2520, #3435, #3094, #3107 (the same
0x8007000Epipeline 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
0x8007000Eare 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:
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. Theprocmemline now says what holds the host's private memory.pipeline/make.rs,pipeline/refused.rs,pipeline/library.rs). A memory refusal (the guard's put-off or a driver0x8007000E) 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.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):

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

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

fps over time, all three runs:

How it was tested
0x8007000Elines, 17 screen waits of 10 s, 0.2 fps in the world (under 1 fps the whole time).0x8007000E, 0 screen waits; 12 compiles put off and made later; played 22.5 minutes, median 13.1 fps, never under 1 fps.70ad17b9…) on the same PC, with lighter settings (Series S, DLSS Ultra Performance, 60 fps cap), never reached the world: 1,1670x8007000Elines 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.main(41adb55): the branch builds and thevictory-gpulib suite passes, apart fromshader_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 onmainwithout this PR.host::card_steps::tests::places_written_after_sending_are_learnedfailed in one run; it fails intermittently without these commits too. It was not played onmain; the play evidence above is on the v2026.11.29.01 base.cargo testpassed for the crates it touches: yes (victory-gpu, see the one unrelated failure above).Checked for overlap
All three PRs at a glance
🤖 Generated with Claude Code