[textures] How often a guarded texture nothing wrote is hashed, by a switch (VICTORY_TEXTURE_HASH_EVERY; 8 as before) #4531

Closed
github-bot wants to merge 1 commit from github-bot/gh-4530 into main AGit
Owner

@⁠AS-AI-DEV on GitHub · 2026-11-30 22:00 UTC · original
AS-AI-DEV:texture-hash-every → main · +13 −2 · 1 files · 1 commits · closed without merging

What it changes

A guarded texture that nothing wrote is still hashed every eighth frame, for what its guard cannot see (a write to its pages through another view). The 8 is a constant in crates/victory-gpu/src/texture.rs. On my PC that hash re-reads about 36 MB of texture memory a frame on the submitting thread, in views where almost nothing changes.

This makes the interval a switch: VICTORY_TEXTURE_HASH_EVERY=<n> (1 to 1,024). Unset it is 8, so nothing changes for anyone who does not set it. A larger number hashes less a frame and finds such a change later (n frames at most).

The idea is from Leslie-d-a/victory-nvidia-hwrt, which runs 64; the lines are mine (13 added, 2 removed, one file).

How it was tested

  • GPU and profile: RTX 5060 Ti 16 GB, Ryzen 7 5800X, 32 GB RAM; Series X, 1080p to 1440p, DLSS performance, frame generation 3x, ray tracing off.
  • Walking runs (on 41adb55; the hashing code is the same on e1251c3): a fixed walking route from a save in a house, 3 runs a side, all ended normally, frames of 6,000 draws and more.
  • Before (8): texture bytes read a frame 36.4 MB, the frame line's "preparing" 38.4 ms, the submitting thread 44.1 ms; fps 19.3 / 18.3 / 17.3 / 16.1 at about 7,000 / 8,000 / 9,000 / 10,000 draws.
  • After (64): texture bytes read a frame 6.2 MB, "preparing" 32.4 ms, the submitting thread 40.5 ms; fps equal within the draw bands (-0.7 to +0.5).
  • After (64 with the existing VICTORY_TEXTURE_TURN_SPREAD=1): the submitting thread 38.5 ms; fps 19.6 / 19.5 / 18.0 / 16.5 (+0.3 to +1.2 in each band); the longest frame of a second 64 against 71 ms; seconds with a frame over 100 ms 8 % both. TURN_SPREAD alone gave nothing.
  • Memory and card memory unchanged. Pictures from two places of a run looked right.
  • On e1251c3 I have less: two standing starts a side (texture bytes read a frame 33 against 51 MB; the views differed between starts, so I do not quote fps), and a 35-minute play session at 64 in which I saw no wrong texture.
  • The cost, to be plain about it: a change the guard cannot see shows up to n frames late, about 3.5 s at 64 and 18 fps. That is why the default stays 8.
  • For shader changes, the wave sizes tested: not a shader change.
  • cargo test passed for the crates it touches: yes (victory-gpu). cargo clippy -p victory-gpu --all-targets with and without --all-features reports nothing in the lines this adds (it stops at two lints that are on main already).

A two-minute check on another PC

Nothing changes unless the switch is set, so the default path needs no test. To see what it does on your card:

  1. Start as usual, stand still in any scene for a minute, and note two things in the log's frame line (fps, ms/frame (… preparing: copies … MB, textures … ms … MB; …)): the textures … MB figure and the submitting thread: … ms.
  2. Start again with VICTORY_TEXTURE_HASH_EVERY=64 and VICTORY_TEXTURE_TURN_SPREAD=1, stand in the same place, and compare the same two figures.

On my PC the textures figure falls to about a sixth and the submitting thread by about 5 ms. If the card is the limit on yours, the frame rate may not move; the thread time and the bytes still should.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: none found for this constant.

🤖 Generated with Claude Code

**@⁠AS-AI-DEV** on GitHub · 2026-11-30 22:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4530) `AS-AI-DEV:texture-hash-every` → `main` · +13 −2 · 1 files · 1 commits · closed without merging ## What it changes A guarded texture that nothing wrote is still hashed every eighth frame, for what its guard cannot see (a write to its pages through another view). The 8 is a constant in `crates/victory-gpu/src/texture.rs`. On my PC that hash re-reads about 36 MB of texture memory a frame on the submitting thread, in views where almost nothing changes. This makes the interval a switch: `VICTORY_TEXTURE_HASH_EVERY=<n>` (1 to 1,024). Unset it is 8, so nothing changes for anyone who does not set it. A larger number hashes less a frame and finds such a change later (n frames at most). The idea is from Leslie-d-a/victory-nvidia-hwrt, which runs 64; the lines are mine (13 added, 2 removed, one file). ## How it was tested - GPU and profile: RTX 5060 Ti 16 GB, Ryzen 7 5800X, 32 GB RAM; Series X, 1080p to 1440p, DLSS performance, frame generation 3x, ray tracing off. - Walking runs (on 41adb55; the hashing code is the same on e1251c3): a fixed walking route from a save in a house, 3 runs a side, all ended normally, frames of 6,000 draws and more. - Before (8): texture bytes read a frame 36.4 MB, the frame line's "preparing" 38.4 ms, the submitting thread 44.1 ms; fps 19.3 / 18.3 / 17.3 / 16.1 at about 7,000 / 8,000 / 9,000 / 10,000 draws. - After (64): texture bytes read a frame 6.2 MB, "preparing" 32.4 ms, the submitting thread 40.5 ms; fps equal within the draw bands (-0.7 to +0.5). - After (64 with the existing `VICTORY_TEXTURE_TURN_SPREAD=1`): the submitting thread 38.5 ms; fps 19.6 / 19.5 / 18.0 / 16.5 (+0.3 to +1.2 in each band); the longest frame of a second 64 against 71 ms; seconds with a frame over 100 ms 8 % both. `TURN_SPREAD` alone gave nothing. - Memory and card memory unchanged. Pictures from two places of a run looked right. - On e1251c3 I have less: two standing starts a side (texture bytes read a frame 33 against 51 MB; the views differed between starts, so I do not quote fps), and a 35-minute play session at 64 in which I saw no wrong texture. - The cost, to be plain about it: a change the guard cannot see shows up to n frames late, about 3.5 s at 64 and 18 fps. That is why the default stays 8. - For shader changes, the wave sizes tested: not a shader change. - `cargo test` passed for the crates it touches: yes (`victory-gpu`). `cargo clippy -p victory-gpu --all-targets` with and without `--all-features` reports nothing in the lines this adds (it stops at two lints that are on main already). ## A two-minute check on another PC Nothing changes unless the switch is set, so the default path needs no test. To see what it does on your card: 1. Start as usual, stand still in any scene for a minute, and note two things in the log's frame line (`fps, ms/frame (… preparing: copies … MB, textures … ms … MB; …)`): the `textures … MB` figure and `the submitting thread: … ms`. 2. Start again with `VICTORY_TEXTURE_HASH_EVERY=64` and `VICTORY_TEXTURE_TURN_SPREAD=1`, stand in the same place, and compare the same two figures. On my PC the `textures` figure falls to about a sixth and the submitting thread by about 5 ms. If the card is the limit on yours, the frame rate may not move; the thread time and the bytes still should. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: none found for this constant. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The hash that finds what a texture's guard cannot see (a write through
another view of its pages) is taken every eighth frame, a fixed number.
The switch sets it (1 to 1,024); unset, 8 as before, and nothing changes.
A larger number hashes less a frame and finds such a change later
(n frames at most). The idea is from Leslie-d-a/victory-nvidia-hwrt,
which uses 64; these lines are mine.

Measured on a Ryzen 7 5800X, RTX 5060 Ti 16 GB, 32 GB RAM (Series X,
1080p to 1440p, DLSS performance, frame generation 3x), on 41adb55: a
fixed walking route from a save in a house, 3 runs a side, all ended
normally, frames of 6,000 draws and more:
- 64: texture bytes read a frame 36.4 -> 6.2 MB, the frame line's
  "preparing" 38.4 -> 32.4 ms, the submitting thread 44.1 -> 40.5 ms;
  fps equal within the draw bands (-0.7 to +0.5).
- 64 with VICTORY_TEXTURE_TURN_SPREAD=1: the submitting thread 38.5 ms,
  fps +0.3 to +1.2 in each of four draw bands (19.6/19.5/18.0/16.5
  against 19.3/18.3/17.3/16.1), the longest frame of a second 64 against
  71 ms, seconds with a frame over 100 ms 8 % both.
- TURN_SPREAD alone: nothing.
Memory and card memory unchanged. Pictures from two places of a run
with both looked right. On e1251c3 the hashing code is the same; there I
have two standing starts a side only (texture bytes read a frame 33
against 51 MB) and a 35-minute play session at 64 without a wrong
texture seen. The cost: a change behind a guard shows up to n frames
late (about 3.5 s at 64 and 18 fps).

Co-Authored-By: AS-AI-DEV <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 22:02:44 +00:00
github-bot force-pushed github-bot/gh-4530 from adf3a58b22 to ee57f7a53e 2026-12-01 03:28:24 +00:00 Compare
Author
Owner

@⁠DoubleD17 on GitHub · 2026-12-01 14:04 UTC · original

A measurement of VICTORY_TEXTURE_HASH_EVERY=64 against 8 with this branch. It also measures #4494, which sets the same interval to 64 in code.

Setup

  • Hardware: RTX 5070 12 GB (driver 621.40), Ryzen 7 5800X (8 cores, 16 threads), 64 GB RAM, Windows 11.
  • Build: one release build, main 5fabb46e with this PR and #4397 merged (no conflict). #4397's switch was at 0 in both arms.
  • Arms: --set VICTORY_TEXTURE_HASH_EVERY=8 (as main) against =64.
  • Profile: Series X, 2560x1440 DLAA, frame generation off, ray tracing off.
  • Runs: idle camera from the same starting point, 150 s from the first world frame, four runs per arm, alternated.
  • Caveat: someone used the PC during two runs of each arm (64: runs 3 and 4; 8: runs 3 and 4). The texture figure below holds in all of them; the frame-rate figures are best read from runs 1 and 2.

Texture refreshes, all threads, per frame (the "texture refreshes per frame, all threads" line, mean of each run's 150 s):

HASH_EVERY run 1 run 2 run 3 run 4
8 17.85 ms 18.44 ms 19.81 ms 18.06 ms
64 9.63 ms 11.01 ms 10.49 ms 11.60 ms

That is about 8 ms a frame less across all threads (-45 %), in every run. It is more than the "about 3 ms" in #4494.

Submitting thread and frame rate

  • "In its submissions", the runs with no one at the PC: 54.8 and 56.0 ms at 8, against 51.7 and 52.2 ms at 64.
  • Light view (the seconds where the idle camera's heavier view is not on screen):
    • runs 1 and 2: preparation -0.4 and -2.7 ms, fps +1.8 and +2.6 %;
    • over all four: -1.6 ms and +1.8 %, inside the spread of the controls in that batch.

Picture: 80 frames per run; we looked at every frame a frame-to-frame check flagged.

  • At 64, two frames were flagged. Both are the one-frame kind we also see on main and in the 8 runs here: the whole picture briefly from a slightly different camera position.
  • The risk the doc names, a write through another view seen up to 64 frames late, cannot show with an idle camera. It is not covered here.

Not tested: movement, textures written through another view, Series S, frame generation on, other cards.

AI Assisted

**@⁠DoubleD17** on GitHub · 2026-12-01 14:04 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4530#issuecomment-7313656495) A measurement of `VICTORY_TEXTURE_HASH_EVERY=64` against `8` with this branch. It also measures #4494, which sets the same interval to 64 in code. **Setup** - **Hardware:** RTX 5070 12 GB (driver 621.40), Ryzen 7 5800X (8 cores, 16 threads), 64 GB RAM, Windows 11. - **Build:** one release build, main 5fabb46e with this PR and #4397 merged (no conflict). #4397's switch was at `0` in both arms. - **Arms:** `--set VICTORY_TEXTURE_HASH_EVERY=8` (as main) against `=64`. - **Profile:** Series X, 2560x1440 DLAA, frame generation off, ray tracing off. - **Runs:** idle camera from the same starting point, 150 s from the first world frame, four runs per arm, alternated. - **Caveat:** someone used the PC during two runs of each arm (`64`: runs 3 and 4; `8`: runs 3 and 4). The texture figure below holds in all of them; the frame-rate figures are best read from runs 1 and 2. **Texture refreshes, all threads, per frame** (the "texture refreshes per frame, all threads" line, mean of each run's 150 s): | `HASH_EVERY` | run 1 | run 2 | run 3 | run 4 | |---|---|---|---|---| | 8 | 17.85 ms | 18.44 ms | 19.81 ms | 18.06 ms | | 64 | **9.63 ms** | **11.01 ms** | **10.49 ms** | **11.60 ms** | That is about 8 ms a frame less across all threads (-45 %), in every run. It is more than the "about 3 ms" in #4494. **Submitting thread and frame rate** - **"In its submissions", the runs with no one at the PC:** 54.8 and 56.0 ms at `8`, against 51.7 and 52.2 ms at `64`. - **Light view** (the seconds where the idle camera's heavier view is not on screen): - runs 1 and 2: preparation -0.4 and -2.7 ms, fps +1.8 and +2.6 %; - over all four: -1.6 ms and +1.8 %, inside the spread of the controls in that batch. **Picture:** 80 frames per run; we looked at every frame a frame-to-frame check flagged. - At `64`, two frames were flagged. Both are the one-frame kind we also see on main and in the `8` runs here: the whole picture briefly from a slightly different camera position. - The risk the doc names, a write through another view seen up to 64 frames late, cannot show with an idle camera. It is not covered here. **Not tested:** movement, textures written through another view, Series S, frame generation on, other cards. AI Assisted
github-bot closed this pull request 2026-12-01 18:43:09 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:38 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4530#issuecomment-7321259353) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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!4531
No description provided.