Guarded textures' turn hash (every 8th frame) reads ~30 MB/frame and found nothing in ~30 min; make the interval a switch? #886

Closed
opened 2026-11-28 08:34:09 +00:00 by MoisesAbdalla · 5 comments
MoisesAbdalla commented 2026-11-28 08:34:09 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by MoisesAbdalla on 2026-11-28T08:34:09Z.


On a Ryzen 7 5700X (8 cores) + RTX 5060 Ti 16 GB, 63b902f, Series X, 1440p, DLSS Performance, frame generation 2x, the first boat ride: our frame is held by the CPU (the submitting thread and the title's own threads), the card is idle 10-15 ms a frame.

In Staging::refresh_timed (texture.rs), a guarded texture that nothing wrote is still hashed whole every HASH_EVERY = 8 frames, by its address, for a write the guard cannot see (through another view of its pages). I counted the refreshes that read the texture, by why, per frame on the boat:

why textures MB
a write seen (write watch or guard) 1-5 0.1-0.2
its turn (every 8th frame) 38-44 26-36
hot 10-140 0.1-0.7
nothing to ask 4-54 0.4-7.7

And every change a turn or hot hash found that no write the guard saw explains (found_blind): 0 in 1,443 frame-rate lines (two runs, about 30 minutes of cutscenes and boat). The diagnostics copystat line agrees: 0.0 changes the guard did not see in every line of four runs.

With the interval as a switch and VICTORY_AB flipping it between 8 and 64 every 15 s in one run (78 phases of 15 s in the world, over two runs):

  • turn reads: from ~30 MB to ~4 MB a frame;
  • neighbouring phases with draws within 600 of each other (32 pairs): -2.5 ms a frame (SE 0.8) with 64;
  • p90 frame time, regressed on draws: -8.3 ms (SE 3.6);
  • median, regressed on draws: -1.5 ms (SE 1.9);
  • no frozen or late texture seen.

The patch I measured with (default unchanged, 8):

  • VICTORY_TEXTURE_HASH_EVERY=<n> (1 to 1024) in place of the constant;
  • in diagnostics builds, VICTORY_TEXTURE_HASH_RARE under VICTORY_AB (with VICTORY_TEXTURE_HASH_RARE_N, 64 by default);
  • a counter of found_blind and one frame-rate line of the refreshes that read the texture, by why.

Happy to open a pull request with it if that is useful, or to run something else on this machine.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6661955078 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/886). Originally posted by [MoisesAbdalla](https://github.com/MoisesAbdalla) on 2026-11-28T08:34:09Z. --- On a Ryzen 7 5700X (8 cores) + RTX 5060 Ti 16 GB, 63b902f, Series X, 1440p, DLSS Performance, frame generation 2x, the first boat ride: our frame is held by the CPU (the submitting thread and the title's own threads), the card is idle 10-15 ms a frame. In `Staging::refresh_timed` (texture.rs), a guarded texture that nothing wrote is still hashed whole every `HASH_EVERY = 8` frames, by its address, for a write the guard cannot see (through another view of its pages). I counted the refreshes that read the texture, by why, per frame on the boat: | why | textures | MB | |---|---|---| | a write seen (write watch or guard) | 1-5 | 0.1-0.2 | | **its turn (every 8th frame)** | **38-44** | **26-36** | | hot | 10-140 | 0.1-0.7 | | nothing to ask | 4-54 | 0.4-7.7 | And every change a turn or hot hash found that no write the guard saw explains (`found_blind`): **0 in 1,443 frame-rate lines** (two runs, about 30 minutes of cutscenes and boat). The diagnostics `copystat` line agrees: `0.0 changes the guard did not see` in every line of four runs. With the interval as a switch and `VICTORY_AB` flipping it between 8 and 64 every 15 s in one run (78 phases of 15 s in the world, over two runs): - turn reads: from ~30 MB to ~4 MB a frame; - neighbouring phases with draws within 600 of each other (32 pairs): **-2.5 ms a frame (SE 0.8)** with 64; - p90 frame time, regressed on draws: **-8.3 ms (SE 3.6)**; - median, regressed on draws: -1.5 ms (SE 1.9); - no frozen or late texture seen. The patch I measured with (default unchanged, 8): - `VICTORY_TEXTURE_HASH_EVERY=<n>` (1 to 1024) in place of the constant; - in diagnostics builds, `VICTORY_TEXTURE_HASH_RARE` under `VICTORY_AB` (with `VICTORY_TEXTURE_HASH_RARE_N`, 64 by default); - a counter of `found_blind` and one frame-rate line of the refreshes that read the texture, by why. Happy to open a pull request with it if that is useful, or to run something else on this machine.
github-actions[bot] commented 2026-11-28 08:34:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-28T08:34:17Z.


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)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7236668987 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/886#issuecomment-7236668987). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:34:17Z. --- 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)
Robotniq commented 2026-11-28 21:40:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Robotniq on 2026-11-28T21:40:15Z.


A data point that supports the change, from an RTX 3070 Ti 8 GB / i7-13700F (Series S, DLSS Quality, 5-minute scripted runs on one route):

  • Every 8th frame (as is): 19.5 to 24.6 MB hashed a frame across 5 runs (median about 20 MB). Every copystat line (about 280) says "0.0 changes the guard did not see".
  • The interval made a switch and set to 64: median 4.5 MB hashed a frame, and the hash alone still found 0 changes. Median fps after the first minute: 25.5 against 25.3, inside the noise here.

We keep 64 in our local launcher.

Measured with AI assistance (Claude Code); the runs were made on my machine.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246186525 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/886#issuecomment-7246186525). Originally posted by [Robotniq](https://github.com/Robotniq) on 2026-11-28T21:40:15Z. --- A data point that supports the change, from an RTX 3070 Ti 8 GB / i7-13700F (Series S, DLSS Quality, 5-minute scripted runs on one route): - **Every 8th frame (as is):** 19.5 to 24.6 MB hashed a frame across 5 runs (median about 20 MB). Every copystat line (about 280) says "0.0 changes the guard did not see". - **The interval made a switch and set to 64:** median 4.5 MB hashed a frame, and the hash alone still found 0 changes. Median fps after the first minute: 25.5 against 25.3, inside the noise here. We keep 64 in our local launcher. Measured with AI assistance (Claude Code); the runs were made on my machine.
MoisesAbdalla commented 2026-11-28 21:49:38 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by MoisesAbdalla on 2026-11-28T21:49:38Z.


A follow-up in a repeatable scene: four unattended runs of the same save (cutscenes, then Jason standing on the boat, no input; diagnostics build of 63b902f + the patch, everything else default), alternating the default with VICTORY_TEXTURE_HASH_EVERY=64, frame-rate lines from 430 to 560 s after start (~4,000 draws a frame in all four):

run ms/frame (mean of 25-26 lines) fps median turn hashes
default (8) 51.49 19.50 30-33 MB/frame
64 50.66 19.75 2-5 MB/frame
default (8) 51.73 19.30 31-33 MB/frame
64 49.22 19.90 3-5 MB/frame

64 against 8: -1.67 ms a frame (SE 0.27), both pairs in the same direction (-0.8, -2.5). Still no change found that the guard had not seen.

Thanks for the second machine's numbers above: on this CPU-bound 8-core box the same change shows up as frame time.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246302364 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/886#issuecomment-7246302364). Originally posted by [MoisesAbdalla](https://github.com/MoisesAbdalla) on 2026-11-28T21:49:38Z. --- A follow-up in a repeatable scene: four unattended runs of the same save (cutscenes, then Jason standing on the boat, no input; diagnostics build of 63b902f + the patch, everything else default), alternating the default with `VICTORY_TEXTURE_HASH_EVERY=64`, frame-rate lines from 430 to 560 s after start (~4,000 draws a frame in all four): | run | ms/frame (mean of 25-26 lines) | fps median | turn hashes | |---|---|---|---| | default (8) | 51.49 | 19.50 | 30-33 MB/frame | | 64 | 50.66 | 19.75 | 2-5 MB/frame | | default (8) | 51.73 | 19.30 | 31-33 MB/frame | | 64 | 49.22 | 19.90 | 3-5 MB/frame | 64 against 8: **-1.67 ms a frame (SE 0.27)**, both pairs in the same direction (-0.8, -2.5). Still no change found that the guard had not seen. Thanks for the second machine's numbers above: on this CPU-bound 8-core box the same change shows up as frame time.
kalberts0089-hash commented 2026-11-29 09:23:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kalberts0089-hash on 2026-11-29T09:23:54Z.


@MoisesAbdalla thanks. Here's a data point on what the hash alone costs, from an i7-13700KF. I can't run the game here, so I timed digest() (texture.rs:1052) on slices of a 512 MB random pool, which means the reads come from DRAM. Single thread, opt-level 3, median of 60:

MB hashed ms
4 ~0.34
20 ~1.7
30 ~2.7
36 ~3.3

That's about 11-12 GB/s, or ~0.085 ms per MB. Going from 30 to 4 MB a frame saves ~2.2-2.6 ms on whichever thread runs the refresh, the same order as your -2.5 / -1.67 ms. For Robotniq's 20 to 4.5 MB it predicts ~1.3 ms, but their frame time moved only ~0.3 ms. My guess is that thread wasn't what held their frame. Reading the title's memory in place may cost more than my buffer.

There's still no switch on main / v2026.11.29.01 (829188e): HASH_EVERY = 8 is a const at texture.rs:2192. #1712 (VICTORY_TEXTURE_TURN_SPREAD=1) only spreads the turns across the 8 frames, so the average bytes per frame stay the same. It might help p90 but not the mean (not measured).

On the risk of 64: a blind change is caught up to N frames late (~0.4 s at 8, ~3.2 s at 64, at 20 fps). After the first catch, found_blind keeps the texture hot for HOT_FRAMES = 64 (texture.rs:243), and new textures start hot. So textures written every frame, like the video ring, recover at any N. Only rare blind writes, more than 64 frames apart, get slower. A switch that defaults to 8 looks low-risk.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7253735899 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/886#issuecomment-7253735899). Originally posted by [kalberts0089-hash](https://github.com/kalberts0089-hash) on 2026-11-29T09:23:54Z. --- @MoisesAbdalla thanks. Here's a data point on what the hash alone costs, from an i7-13700KF. I can't run the game here, so I timed `digest()` (texture.rs:1052) on slices of a 512 MB random pool, which means the reads come from DRAM. Single thread, opt-level 3, median of 60: | MB hashed | ms | |---|---| | 4 | ~0.34 | | 20 | ~1.7 | | 30 | ~2.7 | | 36 | ~3.3 | That's about 11-12 GB/s, or ~0.085 ms per MB. Going from 30 to 4 MB a frame saves ~2.2-2.6 ms on whichever thread runs the refresh, the same order as your -2.5 / -1.67 ms. For Robotniq's 20 to 4.5 MB it predicts ~1.3 ms, but their frame time moved only ~0.3 ms. My guess is that thread wasn't what held their frame. Reading the title's memory in place may cost more than my buffer. There's still no switch on main / v2026.11.29.01 (829188e): `HASH_EVERY = 8` is a const at texture.rs:2192. #1712 (`VICTORY_TEXTURE_TURN_SPREAD=1`) only spreads the turns across the 8 frames, so the average bytes per frame stay the same. It might help p90 but not the mean (not measured). On the risk of 64: a blind change is caught up to N frames late (~0.4 s at 8, ~3.2 s at 64, at 20 fps). After the first catch, `found_blind` keeps the texture hot for `HOT_FRAMES = 64` (texture.rs:243), and new textures start hot. So textures written every frame, like the video ring, recover at any N. Only rare blind writes, more than 64 frames apart, get slower. A switch that defaults to 8 looks low-risk.
trustno1-coder commented 2026-11-29 23:07:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-29T23:07:35Z.


Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed).

If it still happens on v2026.11.29.05, please open a new issue with the newest play log from %LOCALAPPDATA%\victory\logs\ and crashes.log, and we'll look at it there.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7264216587 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/886#issuecomment-7264216587). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-29T23:07:35Z. --- Closing this one: it was reported on v2026.11.28.02 or earlier, and a lot has changed since (crash fixes, memory, shaders, warm-up and speed). If it still happens on [v2026.11.29.05](https://github.com/trustno1-coder/VIctory-NVIDIA/releases/tag/v2026.11.29.05), please open a new issue with the newest play log from `%LOCALAPPDATA%\victory\logs\` and `crashes.log`, and we'll look at it there.
Sign in to join this conversation.
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#886
No description provided.