Skip to content

Memory guard: a compile put off is no refused pipeline, and the explainer says so - #2743

Open
gabrielecabrini wants to merge 1 commit into
trustno1-coder:mainfrom
gabrielecabrini:fix/memguard-deferral-not-a-failure
Open

gabrielecabrini wants to merge 1 commit into
trustno1-coder:mainfrom
gabrielecabrini:fix/memguard-deferral-not-a-failure

Conversation

@gabrielecabrini

Copy link
Copy Markdown
Contributor

What

A driver compile the memory guard puts off (crate::compilemem → memguard::refuse_compile) returns memguard::refusal(), the driver's own E_OUTOFMEMORY. Every Err from pipeline creation goes through refused::failed, so pipelines the guard was still going to make again were counted as refused for the run, with reason 0x8007000e. The F2 explainer then showed the draws they leave out as THEIR SHADERS CANNOT BE CONVERTED YET / NOTHING ON YOUR SIDE, when the cause was the PC's memory.

Evidence

A 29-minute Linux run (Series S, RTX 4070 SUPER 12 GB, 31 GB RAM, Proton Experimental, 2026-11-29):

pipeline failures: 46 host pipelines failed (5 compute 0x8007000e; 9 graphics 0x8007000e; 32 mesh 0x8007000e) ... retried=0
  • 45 of the 46 keys never got a host pipeline line afterwards.
  • The guard logged memory guard: a compile is put off ... reason="the commit left would fall under its floor" more than 1,024 times, with free_commit_mb between 2,905 and 3,765 against the 4,096 MB floor for the whole session.

None of those were driver refusals; all were deferrals that kept being deferred.

Fix

  • pipeline/refused.rs: failed and retry return early while memguard::deferred() is set for the thread. make_with takes the flag before the build and again only after it, so it is still set when host.rs calls them. retry (VICTORY_SHADER_CAPS=1) would otherwise have made the pipeline straight from the driver, past the guard.
  • memguard.rs: put_off() exposes the count of compiles put off.
  • host/panel.rs: a twelfth panel counter. When compiles were put off in the last half second, the note reads NOTE: N DRAWS SKIPPED, NO MEMORY FOR THEIR SHADERS / CLOSE OTHER APPS, OR GIVE THE PC MORE SWAP OR PAGE FILE. Otherwise the note is as before.

Admission, floors and defaults are unchanged.

Tests

  • New a_compile_put_off_for_memory_is_no_failure: a put-off compile is neither recorded nor retried; a driver refusal still is.
  • the_advisor_names_what_limits_the_frame_rate also checks the memory note and its width.
  • The refused, panel and memguard tests pass (16, cross-built with cargo xwin, run under Proton).
  • clippy -p victory-gpu reports nothing in the changed lines; the only panel.rs warning (:149, is_multiple_of) is already on main.
  • pipeline::make::tests::a_waiting_draw_raises_the_worker_making_its_pipeline fails under Proton with and without this change.

…iner says so

A driver compile the memory guard puts off returns the driver's own
E_OUTOFMEMORY (memguard::refusal), and every Err went through
refused::failed. So pipelines the guard was still to make again were
counted as refused for the run: a Linux run's summary read "46 host
pipelines failed (... 0x8007000e)", all of them put off for the commit
floor, with free commit at 2.9 to 3.8 GB for the whole session
(2026-11-29). The VICTORY_SHADER_CAPS retry would also have made such a
pipeline straight from the driver, past the guard.

refused::failed and refused::retry now return early while
memguard::deferred() is set for the thread (make_with takes the flag
before the build and again only after it, so it is still set there).

The F2 explainer showed the draws those pipelines leave out as
"THEIR SHADERS CANNOT BE CONVERTED YET / NOTHING ON YOUR SIDE". With
compiles put off in the last half second (memguard::put_off, a new
panel counter) it now says "NO MEMORY FOR THEIR SHADERS" and suggests
closing apps or more swap or page file.

a_compile_put_off_for_memory_is_no_failure covers failed and retry;
the advisor test covers the new note.
@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 S with ray tracing, and Series X, DLSS Quality). Frame times will follow here.

@SergDi

SergDi commented Nov 30, 2026

Copy link
Copy Markdown

Independent Windows confirmation on base 41adb55167fa778fcaa5dc36fa18a1fa8dacd657 plus this PR's f046d18000653e5cb496325688a5ef2bf96b7f61, RTX 4080 16 GB / Ryzen 5 7600 / 32 GB RAM / driver 610.88.

RED/GREEN: applying only a_compile_put_off_for_memory_is_no_failure to base fails at put off: not recorded (left 1, right 0). With the full PR, the focused suites pass: pipeline::refused 1, host::panel 9, memguard 6 (cargo test --locked --release -p victory-gpu --lib <filter> -- --test-threads=1 --nocapture).

The misclassification also occurs in my existing ordinary logs: several failure keys are immediately preceded by guard deferrals. Guard logging is sampled, so not every key has direct timestamp adjacency; I do not infer an actual driver refusal from the HRESULT alone.

Separate induced runtime check: process-local VICTORY_COMMIT_FLOOR_MB=7168, cold cache, copied save, 1440p DLAA, FG/RT off, THIN0. With this PR alone, the guard's so_far counter reached at least 512, while host pipeline failed keys stayed 0 and no pipeline-failures summary appeared. Base runs at the same floor recorded 252 and 86 failed keys over their full runs. This is classification evidence, not a paired FPS comparison.

The patch does not fix the wait loop: its run still had 10 screen waits of 10000 ms in the 120 s window / 12 over the full run. I tested #3398 separately for that behavior.

Limits: the new F2 text did not render in the severely stalled runtime capture, so panel wording is verified by unit tests only. Preservation of real driver-refusal reporting is likewise covered by the unit test; I did not induce a real driver OOM. The periodic compilemem counter can remain stale under starvation, so I used the guard's counter rather than treating sampled log-line counts as total deferrals.

AI assistance: Claude performed the isolated tests and analysis; Codex reviewed the evidence. No raw title logs or memory dumps are attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants