Textures wait as known holes after the title maps them: title_memory_remapped must release the range's holes (late textures, "blob" people) #2029

Closed
opened 2026-11-29 08:04:04 +00:00 by github-bot · 4 comments
Owner

@⁠birdneststream on GitHub · 2026-11-29 08:00 UTC · original

Found while running the layer under Proton on an RTX 5090 (Linux); the fix is in our fork's tree and tested there. Diffs are against current main (e1f2eb60) and compile there.

What happens

With known holes on (the default when light() is on), guard() records a placeholder block that is wholly uncommitted as absent and held as a known hole (watch.rs, the known_holes() && placeholder(block) branch) — and guard() never asks about a held block again (g.absent.range(..).filter(|block| !g.held.contains(*block))).

A texture's placeholder is guarded long before the title streams the texture's pages into it. When the title maps them (MapViewOfFile3 into the placeholder → title_memory_remapped), the hook opens the guards but leaves the block held: the texture pass is answered "known, nothing there" until look_at_holes() works round to it — a hundredth of the held holes per call. Until then the texture is "waiting for their memory", and people are blobs.

title_memory_allocated and kernel_writing both release the range's holes; title_memory_remapped was the one mapping path that did not.

Evidence (RTX 5090, Proton Experimental / GE-Proton11-14, vkd3d-proton 71cae091, 2026-11-29)

Same scene, two starts of the same build a few minutes apart:

  • before: textures picked by index, the queue: 3015 slots, 205 of them due …, 156 waiting for their memory (a build before placeholders were recognised under Wine: 0 waiting)
  • texture threads: texture refreshes per frame, all threads: 35.8 ms, of them … 27.7 ms asking the write watch and the guards (before: 12.5 ms … 1.5 ms asking)
  • after the fix: 0 waiting for their memory; textures served for the first time … 0.3 frames after they were due; the player's "blob people between scenes" is gone.

This is not Wine-specific: with known holes on it happens wherever a placeholder is guarded before its view is mapped. The texture reports of the last days (#1943, #1924, #1179's family) read like it.

The change

diff --git a/crates/victory-gpu/src/watch.rs b/crates/victory-gpu/src/watch.rs
index 14bad641a..b88b37e75 100644
--- a/crates/victory-gpu/src/watch.rs
+++ b/crates/victory-gpu/src/watch.rs
@@ -3126,7 +3126,26 @@ pub fn title_memory_reading_now() -> Option<Reading> {
 /// write access is given back.
 pub fn title_memory_remapped(at: usize, len: usize) {
     crate::texback::remapped(at, len);
-    open(&mut title_memory_changed(at, len), at, at.saturating_add(len));
+    let mut g = title_memory_changed(at, len);
+    open(&mut g, at, at.saturating_add(len));
+    // A view is there now: what was known of the place as a hole is not true
+    // of it any more. A block held as a known hole is never asked about
+    // (`guard` leaves held blocks out), so a texture whose placeholder was
+    // guarded before the title mapped its pages was told "known, nothing
+    // there" until `look_at_holes` reached it, a hundredth of the holes at a
+    // time: 156 textures "waiting for their memory" where none should wait,
+    // and people as blobs until the holes came round (2026-11-29, RTX 5090
+    // under Proton). As `kernel_writing` forgets for the kernel's writes.
+    if known_holes() {
+        let (first, last) = (at / BLOCK, at.saturating_add(len).div_ceil(BLOCK));
+        for block in g.held.range(first..last).collect::<Vec<_>>() {
+            g.held.remove(block);
+            PUBLISHED.clear(block);
+        }
+        for block in g.absent.range(first..last).collect::<Vec<_>>() {
+            g.absent.remove(block);
+        }
+    }
 }
 
 /// The runtime is about to unmap title memory `[at, at + len)`: it is

watch tests: 53/53 here (under wine-staging 11.22, where the four known-holes tests pass since our placeholder fix — #1601 is the same idea).

**@⁠birdneststream** on GitHub · 2026-11-29 08:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2029) Found while running the layer under Proton on an RTX 5090 (Linux); the fix is in our fork's tree and tested there. Diffs are against current `main` (`e1f2eb60`) and compile there. ## What happens With known holes on (the default when `light()` is on), `guard()` records a placeholder block that is wholly uncommitted as absent and **held** as a known hole (`watch.rs`, the `known_holes() && placeholder(block)` branch) — and `guard()` never asks about a held block again (`g.absent.range(..).filter(|block| !g.held.contains(*block))`). A texture's placeholder is guarded long before the title streams the texture's pages into it. When the title maps them (`MapViewOfFile3` into the placeholder → `title_memory_remapped`), the hook opens the guards but leaves the block held: the texture pass is answered "known, nothing there" until `look_at_holes()` works round to it — **a hundredth of the held holes per call**. Until then the texture is "waiting for their memory", and people are blobs. `title_memory_allocated` and `kernel_writing` both release the range's holes; `title_memory_remapped` was the one mapping path that did not. ## Evidence (RTX 5090, Proton Experimental / GE-Proton11-14, vkd3d-proton 71cae091, 2026-11-29) Same scene, two starts of the same build a few minutes apart: - before: `textures picked by index, the queue: 3015 slots, 205 of them due …, 156 waiting for their memory` (a build before placeholders were recognised under Wine: `0 waiting`) - texture threads: `texture refreshes per frame, all threads: 35.8 ms, of them … 27.7 ms asking the write watch and the guards` (before: `12.5 ms … 1.5 ms asking`) - after the fix: `0 waiting for their memory`; textures `served for the first time … 0.3 frames after they were due`; the player's "blob people between scenes" is gone. This is not Wine-specific: with known holes on it happens wherever a placeholder is guarded before its view is mapped. The texture reports of the last days (#1943, #1924, #1179's family) read like it. ## The change ```diff diff --git a/crates/victory-gpu/src/watch.rs b/crates/victory-gpu/src/watch.rs index 14bad641a..b88b37e75 100644 --- a/crates/victory-gpu/src/watch.rs +++ b/crates/victory-gpu/src/watch.rs @@ -3126,7 +3126,26 @@ pub fn title_memory_reading_now() -> Option<Reading> { /// write access is given back. pub fn title_memory_remapped(at: usize, len: usize) { crate::texback::remapped(at, len); - open(&mut title_memory_changed(at, len), at, at.saturating_add(len)); + let mut g = title_memory_changed(at, len); + open(&mut g, at, at.saturating_add(len)); + // A view is there now: what was known of the place as a hole is not true + // of it any more. A block held as a known hole is never asked about + // (`guard` leaves held blocks out), so a texture whose placeholder was + // guarded before the title mapped its pages was told "known, nothing + // there" until `look_at_holes` reached it, a hundredth of the holes at a + // time: 156 textures "waiting for their memory" where none should wait, + // and people as blobs until the holes came round (2026-11-29, RTX 5090 + // under Proton). As `kernel_writing` forgets for the kernel's writes. + if known_holes() { + let (first, last) = (at / BLOCK, at.saturating_add(len).div_ceil(BLOCK)); + for block in g.held.range(first..last).collect::<Vec<_>>() { + g.held.remove(block); + PUBLISHED.clear(block); + } + for block in g.absent.range(first..last).collect::<Vec<_>>() { + g.absent.remove(block); + } + } } /// The runtime is about to unmap title memory `[at, at + len)`: it is ``` `watch` tests: 53/53 here (under wine-staging 11.22, where the four known-holes tests pass since our placeholder fix — #1601 is the same idea).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 08:04:04 +00:00
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-29 08:00 UTC · original

Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

**@⁠github-actions[bot]** on GitHub · 2026-11-29 08:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2029#issuecomment-7252824412) Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
Author
Owner

@⁠birdneststream on GitHub · 2026-11-29 08:02 UTC · original

PR with the change: #2033 (one commit on main).

**@⁠birdneststream** on GitHub · 2026-11-29 08:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2029#issuecomment-7252845105) PR with the change: #2033 (one commit on `main`).
Author
Owner

@⁠birdneststream on GitHub · 2026-11-29 08:06 UTC · original

Correction, and my apologies: the before/after I quoted here does not hold. Re-measured over whole runs of the two builds (before and after this change, same scenes, VICTORY_CPU_LOG=1): waiting for their memory has the same median (156 before, 157 after), and the texture threads' "asking the write watch and the guards" is unchanged by this change (28.8 ms a frame mean in the build that has it).

What did fix the late textures on our machine was something else: the layer's "keep this thread on the fast cores" request is a no-op under Wine (SetThreadSelectedCpuSets is stored and never applied; probed below), so the copy and texture threads ran mostly on the E-cores. Backing it with an affinity mask took the texture threads' asking from 28.8 to 7.8 ms a frame and the copies from 28 % to 100 % on the fast cores — see the next issue.

The change proposed here is still consistent with kernel_writing and title_memory_allocated (both release the range's holes; title_memory_remapped was the one mapping path that did not), but I have no measurement showing an effect, so I am closing its PR. Sorry for the noise.

**@⁠birdneststream** on GitHub · 2026-11-29 08:06 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2029#issuecomment-7252888660) Correction, and my apologies: the before/after I quoted here does not hold. Re-measured over whole runs of the two builds (before and after this change, same scenes, `VICTORY_CPU_LOG=1`): `waiting for their memory` has the same median (156 before, 157 after), and the texture threads' "asking the write watch and the guards" is unchanged by this change (28.8 ms a frame mean in the build that has it). What did fix the late textures on our machine was something else: the layer's "keep this thread on the fast cores" request is a no-op under Wine (`SetThreadSelectedCpuSets` is stored and never applied; probed below), so the copy and texture threads ran mostly on the E-cores. Backing it with an affinity mask took the texture threads' asking from 28.8 to 7.8 ms a frame and the copies from 28 % to 100 % on the fast cores — see the next issue. The change proposed here is still consistent with `kernel_writing` and `title_memory_allocated` (both release the range's holes; `title_memory_remapped` was the one mapping path that did not), but I have no measurement showing an effect, so I am closing its PR. Sorry for the noise.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-11-30 15:37 UTC · original

Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is v2026.11.30.01.

If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run:

  1. The play log: the newest victory-nvidia-play-<date>-<time>-<number>.log in %LOCALAPPDATA%\victory\logs\.
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, plus the newest .crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\ if there is one from that run.
**@⁠trustno1-coder** on GitHub · 2026-11-30 15:37 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/2029#issuecomment-7283307196) Closing this because it was opened before v2026.11.29.01, and a great deal has changed since then. The latest release is [v2026.11.30.01](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.30.01). If this still happens, or still applies, on the latest release, please open a new issue. For a bug, attach both logs from that run: 1. The play log: the newest `victory-nvidia-play-<date>-<time>-<number>.log` in `%LOCALAPPDATA%\victory\logs\`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, plus the newest `.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\` if there is one from that run.
This discussion has been locked. Commenting is limited to contributors.
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#2029
No description provided.