Texture lane: the whole cost is waiting for the remap lock, and VICTORY_TEXTURE_NO_WAIT removes it (with numbers) #178

Open
opened 2026-11-26 03:37:38 +00:00 by github-bot · 7 comments
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 22:13 UTC · original

The texture lane's cost during streaming is not reading, hashing or asking — it is all waiting for title memory to hold still, and VICTORY_TEXTURE_NO_WAIT=1 removes it entirely. Measured here (RX 7900 XT/RDNA3, RADV, Mesa 26.3.1, Proton Experimental experimental-11.0-20261112, fork 4e17478, diag build, three ~3-minute runs in the same loading/streaming phase, 0.1–0.5 fps, no other switches).

texture refreshes per frame, all threads, four counters in the frame line:

run refreshes texture lane, median max asking, median hold-still, median hold-still, max
4e17478 as it is 103 34.3 ms 4 112 ms 7.3 ms 20.2 ms 4 076 ms
with the guard released after the copy (below) 90 53.7 ms 5 645 ms 8.4 ms 34.0 ms 5 221 ms
VICTORY_TEXTURE_NO_WAIT=1 94 16.7 ms 1 082 ms 13.2 ms 0.0 ms 0.0 ms

And in the frames where textures was seconds, the whole of it was this wait — 5 644 of 5 645 ms in one frame, 5 220 of 5 221 in another — while asking was 26–485 ms and the texture's own lock 0.

With the switch, the wait is 0 in every one of 94 windows, and the refresh either reads in place or, while the runtime holds the mapping lock, reads through the kernel: 3–7 refreshes a frame did that, and 0–2 a frame were left for the next refresh because a page was not there. So what the docstring warns about (a texture showing a frame later) is at most two textures a frame, and never a partly read one.

What this is not. I assumed first that the wait was a convoy of our own making — every refresh holding the read guard through its hashing and detiling, so the runtime's remap waited for us and then we waited for it. That is plausible from the code (texture.rs:661-742 hashed and detiled under let _mapped), so I measured it: copying the texture out of title memory under the guard and dropping it before blake3 and detile changes nothing (row 2 above — the wait is the same or worse, and the title's remap is what everyone is waiting for, not another reader). The patch is not worth merging on its own; the run that says so is the useful part.

So the order of the fix is the opposite of what the wait suggests: not "make the readers quicker" but "do not take the lock to read a texture at all". title_memory_reading_now() already exists for this, refresh_unlocked already reads through the kernel and already counts what it defers, and the switches VICTORY_TEXTURE_GUARD and VICTORY_TEXTURE_COPY show the path was thought through.

Proposal: make no_wait the default (VICTORY_TEXTURE_NO_WAIT=0 to get the old behaviour), or simply always try_read and fall back — the cost of a kernel read is 0.6 ms a megabyte against 0.3 in place, and 25.6 MB a frame pays 15 ms instead of waiting 1.1–5.2 s for a remap to finish. A smaller follow-up, if the remap lock turns out to matter elsewhere (it is also taken in draw.rs:2199 and xmem.rs:1176): say in the frame line who held it and for how long, since that is the number nobody has.

The second-order question this raises, which I have not measured: why the runtime's remap takes as long as it does. If it is one VirtualAlloc of a large region under a single lock, per-block locking (watch.rs already tracks blocks for guards) would let a texture read proceed unless its own blocks are being remapped.

Nothing from the title is in the logs; they hold only the counters above.

**@⁠rostaddotcc** on GitHub · 2026-11-24 22:13 UTC · [original](https://github.com/fxceless/victory-fork/issues/178) The texture lane's cost during streaming is not reading, hashing or asking — it is all `waiting for title memory to hold still`, and `VICTORY_TEXTURE_NO_WAIT=1` removes it entirely. Measured here (RX 7900 XT/RDNA3, RADV, Mesa 26.3.1, Proton Experimental `experimental-11.0-20261112`, fork `4e17478`, diag build, three ~3-minute runs in the same loading/streaming phase, `0.1–0.5 fps`, no other switches). `texture refreshes per frame, all threads`, four counters in the frame line: | run | refreshes | texture lane, median | max | asking, median | **hold-still, median** | **hold-still, max** | |---|---:|---:|---:|---:|---:|---:| | `4e17478` as it is | 103 | 34.3 ms | 4 112 ms | 7.3 ms | 20.2 ms | **4 076 ms** | | with the guard released after the copy (below) | 90 | 53.7 ms | 5 645 ms | 8.4 ms | 34.0 ms | **5 221 ms** | | `VICTORY_TEXTURE_NO_WAIT=1` | 94 | 16.7 ms | 1 082 ms | 13.2 ms | **0.0 ms** | **0.0 ms** | And in the frames where `textures` was seconds, the whole of it was this wait — 5 644 of 5 645 ms in one frame, 5 220 of 5 221 in another — while asking was 26–485 ms and the texture's own lock 0. With the switch, the wait is 0 in every one of 94 windows, and the refresh either reads in place or, while the runtime holds the mapping lock, reads through the kernel: **3–7 refreshes a frame** did that, and **0–2 a frame** were left for the next refresh because a page was not there. So what the docstring warns about (a texture showing a frame later) is at most two textures a frame, and never a partly read one. **What this is not.** I assumed first that the wait was a convoy of our own making — every refresh holding the read guard through its hashing and detiling, so the runtime's remap waited for us and then we waited for it. That is plausible from the code (`texture.rs:661-742` hashed and detiled under `let _mapped`), so I measured it: copying the texture out of title memory under the guard and dropping it before `blake3` and `detile` changes nothing (row 2 above — the wait is the same or worse, and the title's remap is what everyone is waiting for, not another reader). The patch is not worth merging on its own; the run that says so is the useful part. So the order of the fix is the opposite of what the wait suggests: not "make the readers quicker" but "do not take the lock to read a texture at all". `title_memory_reading_now()` already exists for this, `refresh_unlocked` already reads through the kernel and already counts what it defers, and the switches `VICTORY_TEXTURE_GUARD` and `VICTORY_TEXTURE_COPY` show the path was thought through. **Proposal:** make `no_wait` the default (`VICTORY_TEXTURE_NO_WAIT=0` to get the old behaviour), or simply always `try_read` and fall back — the cost of a kernel read is 0.6 ms a megabyte against 0.3 in place, and 25.6 MB a frame pays 15 ms instead of waiting 1.1–5.2 s for a remap to finish. A smaller follow-up, if the remap lock turns out to matter elsewhere (it is also taken in `draw.rs:2199` and `xmem.rs:1176`): say in the frame line who held it and for how long, since that is the number nobody has. The second-order question this raises, which I have not measured: why the runtime's remap takes as long as it does. If it is one `VirtualAlloc` of a large region under a single lock, per-block locking (`watch.rs` already tracks blocks for guards) would let a texture read proceed unless its own blocks are being remapped. Nothing from the title is in the logs; they hold only the counters above.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:38 +00:00
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-24 22:18 UTC · original

#175 landed the better version of this while I was writing it up: scoping the mapping lock to the affected ranges keeps the in-place read (0.3 ms a megabyte, no deferral) and takes the wait to zero, where VICTORY_TEXTURE_NO_WAIT=1 is the blunt version that reads through the kernel and defers 0–2 textures a frame. If #175 merges, the switch here is only the fallback for a remap whose extent is unknown.

Keeping this open for the numbers and one thing #175 does not answer: 4 076 ms was the worst single-window wait, and my run cannot say how long one remap holds the lock, only how long everyone waited. Whoever instruments the writer side should put that in the frame line next to the reader counters.

**@⁠rostaddotcc** on GitHub · 2026-11-24 22:18 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7146061247) #175 landed the better version of this while I was writing it up: scoping the mapping lock to the affected ranges keeps the in-place read (0.3 ms a megabyte, no deferral) and takes the wait to zero, where `VICTORY_TEXTURE_NO_WAIT=1` is the blunt version that reads through the kernel and defers 0–2 textures a frame. If #175 merges, the switch here is only the fallback for a remap whose extent is unknown. Keeping this open for the numbers and one thing #175 does not answer: 4 076 ms was the worst single-window wait, and my run cannot say how long one remap holds the lock, only how long everyone waited. Whoever instruments the writer side should put that in the frame line next to the reader counters.
Author
Owner

@⁠sawetco on GitHub · 2026-11-25 00:30 UTC · original

On native Windows I measured the deferred-read counter during the transition into the first playable scene. It can get appreciably higher than the 0–2 per frame in the Proton run.

On an RTX 5070 (621.24), Ryzen 5 7600X, Windows 11, I ran the same local build based on 90228a7 twice, with the same Series X save, initial renderer cache, timed inputs, relay 2 and shader loop limit 256. Only VICTORY_TEXTURE_NO_WAIT changed. With it enabled, 64 of 79 fallback-counter reports between 88 and 215 seconds averaged more than two deferrals per frame. The median was 17.7. The peak report averaged 140 reads through the kernel and 83 left for a later refresh per frame. These are refresh attempts across threads. The counters do not tell us how many distinct textures were involved or how many frames any one texture waited.

Peak reported mapping wait during the streaming transition fell from 4572 ms/frame across threads to zero. Once the prison scene settled, the two runs presented 550 frames in 189.0 s and 486 in 163.0 s (2.91 and 2.98 FPS). This was one run per setting on a downstream build. For a default fallback decision, the deferral distribution during streaming seems worth tracking alongside reader wait time. I did not measure writer lock duration or run #175 in this comparison.

AI-assisted local measurement and write-up (Codex).

**@⁠sawetco** on GitHub · 2026-11-25 00:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7148581029) On native Windows I measured the deferred-read counter during the transition into the first playable scene. It can get appreciably higher than the 0–2 per frame in the Proton run. On an RTX 5070 (621.24), Ryzen 5 7600X, Windows 11, I ran the same local build based on `90228a7` twice, with the same Series X save, initial renderer cache, timed inputs, relay 2 and shader loop limit 256. Only `VICTORY_TEXTURE_NO_WAIT` changed. With it enabled, 64 of 79 fallback-counter reports between 88 and 215 seconds averaged more than two deferrals per frame. The median was 17.7. The peak report averaged **140 reads through the kernel and 83 left for a later refresh per frame**. These are refresh attempts across threads. The counters do not tell us how many distinct textures were involved or how many frames any one texture waited. Peak reported mapping wait during the streaming transition fell from 4572 ms/frame across threads to zero. Once the prison scene settled, the two runs presented 550 frames in 189.0 s and 486 in 163.0 s (2.91 and 2.98 FPS). This was one run per setting on a downstream build. For a default fallback decision, the deferral distribution during streaming seems worth tracking alongside reader wait time. I did not measure writer lock duration or run #175 in this comparison. AI-assisted local measurement and write-up (Codex).
Author
Owner

@⁠0xmp3 on GitHub · 2026-11-25 03:52 UTC · original

Negative result on the obvious fix for this: raising the staging budget does not drain the queue, and it destabilises the title. Recording it so nobody spends an evening on it.

Setup: Windows 11 26300, RX 9070 XT (RDNA4, driver 32.0.32015.7029), Ryzen 5 5600, 64 GB RAM, fork c96b4f2, diag build, VICTORY_SHADER_OPT=59 VICTORY_RELAY=2 VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1 VICTORY_INPLACE=1.

Baseline (default VICTORY_TEXTURE_STAGE_MS=250, so 750 ms under catch-up): ten-plus minutes in the world, no crash. The queue of textures picked by index grows the whole time and never drains:

uploaded   455 → 49,169 textures  (+82/s, 34 MB/s)
waiting      431 → 13,357         (growing +22/s)

So demand (~104/s) exceeds supply (~82/s) and the scene never finishes texturing — which is what "untextured surfaces slowly resolving" looks like on screen.

VICTORY_TEXTURE_STAGE_MS=500 (so 1,500 ms per pass under catch-up) — two runs, both died in the title, on a read of 0xffffffffffffffff (a failed lookup dereferenced unchecked):

run fault when
1 victory-image-…dll+0x4f400a9 03:46:30, in the menus/credits, 12–358 draws/frame
2 victory-image-…dll+0x108557 03:50:15, same stage

Different offsets, same signature. Private memory through run 2:

12,746 MB → 15,403 MB → 25,300 MB → 28,012 MB     (PC free: 39,979 → 25,693 MB)
memory let go since the start: ... 33 staging buffers

and the operator saw system RAM approach ~40 GB with CPU around 50% before each crash.

So the budget is not the lever: more staging per pass retains more staging buffers per unit time, memory climbs faster than the backlog drains, an allocation fails, and the title dies on the null. The supply problem needs the lane to stop sharing the frame-recording thread — the code comment already says the pass costs "1.6–2.2 s of each of the world's first twenty frames" on that thread — rather than a longer pass on the same thread.

Two things I did not test, in case they are useful to whoever picks this up: VICTORY_TEXTURE_CATCHUP=0 (the plain budget, 250 ms, worth knowing whether the default catch-up is itself a stability risk at large backlogs), and whether the staging buffers seen accumulating are the per-partly-streamed-texture ones that the code notes were once kept "for good".

No game data; numbers, offsets and timings from VIctory's own log. AI-assisted (Hermes Agent).

**@⁠0xmp3** on GitHub · 2026-11-25 03:52 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7152326218) Negative result on the obvious fix for this: **raising the staging budget does not drain the queue, and it destabilises the title.** Recording it so nobody spends an evening on it. Setup: Windows 11 26300, RX 9070 XT (RDNA4, driver 32.0.32015.7029), Ryzen 5 5600, 64 GB RAM, fork `c96b4f2`, diag build, `VICTORY_SHADER_OPT=59 VICTORY_RELAY=2 VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1 VICTORY_INPLACE=1`. **Baseline (default `VICTORY_TEXTURE_STAGE_MS=250`, so 750 ms under catch-up):** ten-plus minutes in the world, no crash. The queue of textures picked by index grows the whole time and never drains: ``` uploaded 455 → 49,169 textures (+82/s, 34 MB/s) waiting 431 → 13,357 (growing +22/s) ``` So demand (~104/s) exceeds supply (~82/s) and the scene never finishes texturing — which is what "untextured surfaces slowly resolving" looks like on screen. **`VICTORY_TEXTURE_STAGE_MS=500`** (so 1,500 ms per pass under catch-up) — two runs, **both died in the title**, on a read of `0xffffffffffffffff` (a failed lookup dereferenced unchecked): | run | fault | when | |---|---|---| | 1 | `victory-image-…dll+0x4f400a9` | 03:46:30, in the menus/credits, 12–358 draws/frame | | 2 | `victory-image-…dll+0x108557` | 03:50:15, same stage | Different offsets, same signature. Private memory through run 2: ``` 12,746 MB → 15,403 MB → 25,300 MB → 28,012 MB (PC free: 39,979 → 25,693 MB) memory let go since the start: ... 33 staging buffers ``` and the operator saw system RAM approach ~40 GB with CPU around 50% before each crash. So the budget is not the lever: more staging per pass retains more staging buffers per unit time, memory climbs faster than the backlog drains, an allocation fails, and the title dies on the null. The supply problem needs the lane to stop sharing the frame-recording thread — the code comment already says the pass costs "1.6–2.2 s of each of the world's first twenty frames" on that thread — rather than a longer pass on the same thread. Two things I did not test, in case they are useful to whoever picks this up: `VICTORY_TEXTURE_CATCHUP=0` (the plain budget, 250 ms, worth knowing whether the default catch-up is itself a stability risk at large backlogs), and whether the staging buffers seen accumulating are the per-partly-streamed-texture ones that the code notes were once kept "for good". No game data; numbers, offsets and timings from VIctory's own log. AI-assisted (Hermes Agent).
Author
Owner

@⁠0xmp3 on GitHub · 2026-11-25 03:54 UTC · original

One addendum from the repeat run, because it names the mechanism better than the memory curve did: the run reached the world
before it died, and its worst frame was a single frame copying 4,286.8 MB —

8490 draws/frame
copies 5348.5 ms for 4286.8 MB      (365.5 ms on the GPU, 258.1 ms copying back 127.3 MB)
textures picked by index: 24,539 uploaded (6,770 MB), 17,846 waiting, 225 passed over unmapped
buffer views left null as the host would refuse them: 10

So it is not a gradual leak: one frame copies 4.3 GB in 5.3 s, which is exactly the RAM/CPU spike seen before the crash. At 8,490 draws with 17,846 textures still queued, the copy path is doing the work the GPU should be doing — the GPU read 365 ms in a ~9 s frame.

For contrast, the same run's ordinary frames: 199.6 ms of copies for 318.1 MB, and a menu frame with 0.0 ms on the GPU. So the budget increase didn't redistribute work, it let a single frame's copy set grow until the allocation failed.

Two related signals in the same frame: 225 passed over unmapped textures and buffer views left null as the host would refuse them: 10, both rising through the run — resources the layer wanted and could not make.

No game data; numbers from VIctory's own log. AI-assisted (Hermes Agent).

**@⁠0xmp3** on GitHub · 2026-11-25 03:54 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7152347007) One addendum from the repeat run, because it names the mechanism better than the memory curve did: the run reached the world before it died, and its worst frame was a **single frame copying 4,286.8 MB** — ``` 8490 draws/frame copies 5348.5 ms for 4286.8 MB (365.5 ms on the GPU, 258.1 ms copying back 127.3 MB) textures picked by index: 24,539 uploaded (6,770 MB), 17,846 waiting, 225 passed over unmapped buffer views left null as the host would refuse them: 10 ``` So it is not a gradual leak: **one frame copies 4.3 GB in 5.3 s**, which is exactly the RAM/CPU spike seen before the crash. At 8,490 draws with 17,846 textures still queued, the copy path is doing the work the GPU should be doing — the GPU read 365 ms in a ~9 s frame. For contrast, the same run's ordinary frames: `199.6 ms of copies for 318.1 MB`, and a menu frame with `0.0 ms on the GPU`. So the budget increase didn't redistribute work, it let a single frame's copy set grow until the allocation failed. Two related signals in the same frame: `225 passed over unmapped` textures and `buffer views left null as the host would refuse them: 10`, both rising through the run — resources the layer wanted and could not make. No game data; numbers from VIctory's own log. AI-assisted (Hermes Agent).
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-25 06:40 UTC · original

@⁠sawetco's A/B is the most useful thing in this thread and it corrects part of the proposal I opened it with, so it is worth stating plainly:

The wait counter sums across threads, and removing the wait did not shorten the frame. His two runs, same save and timed inputs, only VICTORY_TEXTURE_NO_WAIT different: mapping wait 4 572 ms/frame → 0, presented frames 550 in 189.0 s against 486 in 163.0 s (2.91 and 2.98 FPS). So the lane's seconds were largely parallel waiting — fifteen threads each blocked, not the submitting thread blocked for the sum. My "make no_wait the default" was written as if that sum were the critical path; on his numbers it is not, and a default flip would buy the picture lag (his peak: 140 reads through the kernel and 83 deferrals per frame, median 17.7 deferrals during the transition, against 0–2 in my Proton run) for no frame rate.

Two things follow, and they change what I would measure next:

  1. "all threads" is the wrong denominator for a decision. The number that matters is the longest wait on whichever thread is on the critical path — normally the submitting one. My windows were 8 478 ms frames with 5 645 ms of summed wait across threads, which was already a hint that the sum could not all be serial.

  2. Nobody has measured the writer. The title's remap takes the mapping lock alone, and every reader in the sum is waiting for that one writer. If the writer is slowed by readers holding the lock through their hashing and detiling — which is what my reader-guard experiment probed, with no change in this counter, as expected, since it measures readers — then the win is in remap duration, not in reader wait. A counter of "how long the title's mapping change held the lock" (and how many there were) would tell us whether that is worth anything; it does not exist today.

For the record from the same ground as the original numbers: with the switch, 3–7 refreshes a frame went through the kernel and 0–2 were left for the next frame on Linux/Proton, so the deferral cost is much smaller there than on native Windows. That still does not make it a frame-rate win.

**@⁠rostaddotcc** on GitHub · 2026-11-25 06:40 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7155033133) @⁠sawetco's A/B is the most useful thing in this thread and it corrects part of the proposal I opened it with, so it is worth stating plainly: **The wait counter sums across threads, and removing the wait did not shorten the frame.** His two runs, same save and timed inputs, only `VICTORY_TEXTURE_NO_WAIT` different: mapping wait 4 572 ms/frame → 0, presented frames 550 in 189.0 s against 486 in 163.0 s (2.91 and 2.98 FPS). So the lane's seconds were largely *parallel* waiting — fifteen threads each blocked, not the submitting thread blocked for the sum. My "make `no_wait` the default" was written as if that sum were the critical path; on his numbers it is not, and a default flip would buy the picture lag (his peak: 140 reads through the kernel and 83 deferrals *per frame*, median 17.7 deferrals during the transition, against 0–2 in my Proton run) for no frame rate. Two things follow, and they change what I would measure next: 1. **"all threads" is the wrong denominator for a decision.** The number that matters is the longest wait on whichever thread is on the critical path — normally the submitting one. My windows were 8 478 ms frames with 5 645 ms of summed wait across threads, which was already a hint that the sum could not all be serial. 2. **Nobody has measured the *writer*.** The title's remap takes the mapping lock alone, and every reader in the sum is waiting for that one writer. If the writer is slowed by readers holding the lock through their hashing and detiling — which is what my reader-guard experiment probed, with no change in *this* counter, as expected, since it measures readers — then the win is in remap duration, not in reader wait. A counter of "how long the title's mapping change held the lock" (and how many there were) would tell us whether that is worth anything; it does not exist today. For the record from the same ground as the original numbers: with the switch, 3–7 refreshes a frame went through the kernel and 0–2 were left for the next frame on Linux/Proton, so the deferral cost is much smaller there than on native Windows. That still does not make it a frame-rate win.
Author
Owner

@⁠rostaddotcc on GitHub · 2026-11-25 06:49 UTC · original

I went and measured the writer, since I said nobody had. Numbers from a 400-second streaming run on Linux/Proton (RX 7900 XT, RADV, vkd3d-proton 3.2.0, 8dd30ab + the counter in #766):

per frame
the title's mapping changes 1 721–5 041
the mapping lock held, all changes together 3 844–8 020 ms
the longest single change 46–175 ms
readers' summed wait, same windows 194–2 475 ms
frame 4 000–8 000 ms

Reading that: the title remaps thousands of times a frame, in short changes averaging about 1.5 ms, and the lock is held for most of the frame. So the readers' wait is not one long remap that could be interrupted or overlapped better — there is simply rarely a free moment — and the occasional 175 ms change is the outlier that shows up as a multi-second "textures" window.

That also explains why #175 removes the wait outright rather than shortening it: a reader's own range is only being remapped in the change that touches it, so with range scoping almost every wait disappears instead of shrinking.

Two consequences I would flag before anyone tunes this further:

  1. The lock is held across the whole map operation (XMemMapPhysicalPages holds it from unmap through mapping every run of pages again). If the title asks for many small page windows — which 3 000–5 000 changes a frame suggests — then each change pays for the view teardown and re-mapping of its own window, and the aggregate is the frame. Anything that makes one change cheaper moves everything in the lane.
  2. The counter is diagnostics-only and free with the feature off; it is in #766 if it is wanted upstream.
**@⁠rostaddotcc** on GitHub · 2026-11-25 06:49 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7155205000) I went and measured the writer, since I said nobody had. Numbers from a 400-second streaming run on Linux/Proton (RX 7900 XT, RADV, vkd3d-proton 3.2.0, `8dd30ab` + the counter in #766): | per frame | | |---|---:| | the title's mapping changes | 1 721–5 041 | | the mapping lock held, all changes together | 3 844–8 020 ms | | the longest single change | 46–175 ms | | readers' summed wait, same windows | 194–2 475 ms | | frame | 4 000–8 000 ms | Reading that: the title remaps **thousands of times a frame**, in short changes averaging about 1.5 ms, and the lock is held for most of the frame. So the readers' wait is not one long remap that could be interrupted or overlapped better — there is simply rarely a free moment — and the occasional 175 ms change is the outlier that shows up as a multi-second "textures" window. That also explains why #175 removes the wait outright rather than shortening it: a reader's own range is only being remapped in the change that touches it, so with range scoping almost every wait disappears instead of shrinking. Two consequences I would flag before anyone tunes this further: 1. **The lock is held across the whole map operation** (`XMemMapPhysicalPages` holds it from `unmap` through mapping every run of pages again). If the title asks for many small page windows — which 3 000–5 000 changes a frame suggests — then each change pays for the view teardown and re-mapping of its own window, and the aggregate is the frame. Anything that makes one change cheaper moves everything in the lane. 2. The counter is diagnostics-only and free with the feature off; it is in #766 if it is wanted upstream.
Author
Owner

@⁠iGoldenNinja on GitHub · 2026-11-25 14:50 UTC · original · edited 2026-11-25 15:15 UTC

The same remap-wait counter grew again much later in the prologue on an RTX 5080. This is a native Series X run on the Astral 16 GB, NVIDIA 617.14, Windows 11 Pro 25H2 build 26200.9974, Ryzen 9 5900X and 32 GB. Renderer 92a72df, warm caches, VICTORY_TEXTURE_NO_WAIT off. I marked the prison window and the later shop arrival in the same launch.

First minute after marker Complete renderer reports Median renderer frame Median remap read-lock wait per renderer frame Displayed FPS
Prison window 10 387.5 ms 1.15 ms 2.366
Shop cinematic 8 2,830.5 ms 1,280.15 ms 0.426

All eight shop renderer reports exceeded 300 ms/frame of reader wait. That counter sums work across texture threads, as the earlier native RTX 5070 comparison illustrates. PresentMon separately measured 26 display intervals in the shop minute with a longest interval of 5,865.505 ms. These markers cover different scene workloads. The run shows the contention and slowdown recurring during later streaming, with the effect of enabling the fallback at that checkpoint still open. Pinned route and measurement report

November 25 fresh-process follow-up. On the same native Series X RTX 5080 setup and renderer 92a72df, two new processes loaded independent writable copies of the same checkpoint and reached the post-arrest interview. Both used the same binary and warm cache. The second enabled VICTORY_TEXTURE_NO_WAIT=1.

Across eight control and nine opt-in renderer reports, median summed texture-thread read-lock wait fell from 1,504.7 to 0.0 ms per renderer frame. The opt-in build recorded median 202.5 kernel reads and 53.3 deferred refreshes per frame. Both display windows started on the interview close-up and diverged at later cuts. They averaged 0.388 and 1.476 displayed FPS respectively with different workloads. Both windows were after the shop. The opt-in run still showed a dark face before skin detail appeared. These runs verify checkpoint restoration and execution of the nonblocking fallback on the RTX 5080. The effect on shop performance is still open. Pinned report

**@⁠iGoldenNinja** on GitHub · 2026-11-25 14:50 UTC · [original](https://github.com/fxceless/victory-fork/issues/178#issuecomment-7165911077) · edited 2026-11-25 15:15 UTC The same remap-wait counter grew again much later in the prologue on an RTX 5080. This is a native Series X run on the Astral 16 GB, NVIDIA 617.14, Windows 11 Pro 25H2 build 26200.9974, Ryzen 9 5900X and 32 GB. Renderer `92a72df`, warm caches, `VICTORY_TEXTURE_NO_WAIT` off. I marked the prison window and the later shop arrival in the same launch. | First minute after marker | Complete renderer reports | Median renderer frame | Median remap read-lock wait per renderer frame | Displayed FPS | | --- | ---: | ---: | ---: | ---: | | Prison window | 10 | 387.5 ms | 1.15 ms | 2.366 | | Shop cinematic | 8 | 2,830.5 ms | 1,280.15 ms | 0.426 | All eight shop renderer reports exceeded 300 ms/frame of reader wait. That counter sums work across texture threads, as [the earlier native RTX 5070 comparison](https://git.gtahub.st/github/fxceless--victory-fork/issues/178) illustrates. PresentMon separately measured 26 display intervals in the shop minute with a longest interval of 5,865.505 ms. These markers cover different scene workloads. The run shows the contention and slowdown recurring during later streaming, with the effect of enabling the fallback at that checkpoint still open. [Pinned route and measurement report](https://github.com/iGoldenNinja/victory-fork/blob/ee7e0d8d81a457de02498d75908405b1510b72d5/docs/rtx5080-prison-story.md) **November 25 fresh-process follow-up.** On the same native Series X RTX 5080 setup and renderer `92a72df`, two new processes loaded independent writable copies of the same checkpoint and reached the post-arrest interview. Both used the same binary and warm cache. The second enabled `VICTORY_TEXTURE_NO_WAIT=1`. Across eight control and nine opt-in renderer reports, median summed texture-thread read-lock wait fell from **1,504.7 to 0.0 ms per renderer frame**. The opt-in build recorded median **202.5 kernel reads** and **53.3 deferred refreshes** per frame. Both display windows started on the interview close-up and diverged at later cuts. They averaged **0.388 and 1.476 displayed FPS** respectively with different workloads. Both windows were after the shop. The opt-in run still showed a dark face before skin detail appeared. These runs verify checkpoint restoration and execution of the nonblocking fallback on the RTX 5080. The effect on shop performance is still open. [Pinned report](https://github.com/iGoldenNinja/victory-fork/blob/a93208343b67a75896f456568fdde5e99e038932/docs/rtx5080-story-restore.md)
This discussion has been locked. Commenting is limited to contributors.
No description provided.