Textures: prefetch is held back for low commit only, not for low free physical memory #4349

Closed
github-bot wants to merge 14 commits from github-bot/gh-4348 into main AGit
Owner

@⁠harrisotiropoulos-jpg on GitHub · 2026-11-30 19:12 UTC · original
harrisotiropoulos-jpg:fix/texture-prefetch-commit → main · +1016 −849 · 33 files · 14 commits · closed without merging

What it changes

Texture prefetch is held to 64 MB a frame under host memory pressure, which guards against commit running out. The limit was taken from the overall pressure flag (residency::pressured), which also turns on at 3 GiB of free physical memory. On a 32 GB PC with a large page file that held textures back for whole sessions with commit plentiful.

  • Prefetch's share now follows commit headroom alone (texture_pressured), with the same lines: on at 4 GiB, off at 6 GiB.
  • The limits for critically low commit (16 MB) and for much live staging on PCs with limited RAM (64 MB) are unchanged.
  • Everything else the pressure flag does is unchanged, including the texture pass's time ceiling and catch-up.
  • VICTORY_PREFETCH_PRESSURE=physical restores the old rule. The warning's text says what it now limits, and a line says when the commit limit turns on or off.

This changes the default: with little physical memory free, a frame may prefetch more than before and so use more RAM while uploading. Say so if you would rather have it opt-in.

How it was tested

  • GPU and profile: RTX 4080 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; Series X, 1440p, DLSS performance, frame generation 2x, with and without ray tracing.
  • Before: in a run of 28 Nov (1.2 GB free, 30 GB left to commit) pressure stayed on for the session: 160 slots due at the median, 2,551 at most, the oldest up to 3,897 frames, with 55-110 MB of staging. On 30 Nov it turned on in all five runs looked at, with 2.4-3.0 GB free and 46-49 GB left to commit (a build on v2026.11.30.02 without this change).
  • After: the same change was in builds played on 28 Nov (19 logs), based on main of that day. I have no like-for-like before/after of texture waits, so the benefit in play is not shown. This branch on current main was built and unit tested, not played.
  • Wave sizes: no shader change.
  • cargo test --release -p victory-gpu --lib: no. 1,132 passed (one new: the rule and its hysteresis) and 2 failed: list::thin::tests::bindings_record_no_work and shader_cache::tests::every_switch_of_the_translator_is_in_the_key. Both fail on main (e1251c319) too. Clippy reports nothing in the lines changed; its CI step fails on main's own findings (#4297, #4166).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3584 (settings that move the physical lines, defaults unchanged; it edits next_pressure in the same file, so a conflict is possible), #3478 (the texture pass's time under RAM pressure, not its bytes)

🤖 Generated with Claude Code

**@⁠harrisotiropoulos-jpg** on GitHub · 2026-11-30 19:12 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4348) `harrisotiropoulos-jpg:fix/texture-prefetch-commit` → `main` · +1016 −849 · 33 files · 14 commits · closed without merging ## What it changes Texture prefetch is held to 64 MB a frame under host memory pressure, which guards against commit running out. The limit was taken from the overall pressure flag (`residency::pressured`), which also turns on at 3 GiB of free physical memory. On a 32 GB PC with a large page file that held textures back for whole sessions with commit plentiful. - Prefetch's share now follows commit headroom alone (`texture_pressured`), with the same lines: on at 4 GiB, off at 6 GiB. - The limits for critically low commit (16 MB) and for much live staging on PCs with limited RAM (64 MB) are unchanged. - Everything else the pressure flag does is unchanged, including the texture pass's time ceiling and catch-up. - `VICTORY_PREFETCH_PRESSURE=physical` restores the old rule. The warning's text says what it now limits, and a line says when the commit limit turns on or off. This changes the default: with little physical memory free, a frame may prefetch more than before and so use more RAM while uploading. Say so if you would rather have it opt-in. ## How it was tested - GPU and profile: RTX 4080 16 GB, Ryzen 7 9800X3D, 32 GB, Windows 11; Series X, 1440p, DLSS performance, frame generation 2x, with and without ray tracing. - Before: in a run of 28 Nov (1.2 GB free, 30 GB left to commit) pressure stayed on for the session: 160 slots due at the median, 2,551 at most, the oldest up to 3,897 frames, with 55-110 MB of staging. On 30 Nov it turned on in all five runs looked at, with 2.4-3.0 GB free and 46-49 GB left to commit (a build on v2026.11.30.02 without this change). - After: the same change was in builds played on 28 Nov (19 logs), based on main of that day. I have no like-for-like before/after of texture waits, so the benefit in play is not shown. This branch on current main was built and unit tested, not played. - Wave sizes: no shader change. - `cargo test --release -p victory-gpu --lib`: no. 1,132 passed (one new: the rule and its hysteresis) and 2 failed: `list::thin::tests::bindings_record_no_work` and `shader_cache::tests::every_switch_of_the_translator_is_in_the_key`. Both fail on main (e1251c319) too. Clippy reports nothing in the lines changed; its CI step fails on main's own findings (#4297, #4166). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3584 (settings that move the physical lines, defaults unchanged; it edits `next_pressure` in the same file, so a conflict is possible), #3478 (the texture pass's time under RAM pressure, not its bytes) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
VICTORY_PREFETCH_PRESSURE=physical restores the old rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 19:15:37 +00:00
github-bot closed this pull request 2026-12-01 18:43:48 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:42 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:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4348#issuecomment-7321381299) 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!4349
No description provided.