Residency: VICTORY_WAIT_RESIDENT=textures waits for textures only (opt-in) #654

Manually merged
github merged 1 commit from github-bot/gh-654 into main 2026-11-28 19:42:07 +00:00 AGit
Owner

@⁠bakdakonusuruz on GitHub · 2026-11-28 02:46 UTC · original
wait-resident-textures → main · +34 −10 · 1 files · 1 commits · merged 2026-11-28 19:39 UTC

Why

On an RTX 4090 most of the residency waits are for plain buffers. In a 4-minute run on the
prologue, the layer waited for new memory 59,000 to 62,000 times (17.0 to 19.2 s in all,
the longest 0.94 to 0.96 s) and for mappings 44,800 to 47,400 times (4.4 to 5.8 s). The
comment on wait_resident() places the device losses that the waits fixed in texture
blocks, not in buffers.

The same split was measured on an RTX 3080 in Belobug/VIctory-Belobug-AMD#346 (212,000
waits, 60.8 s, down to about 1,000) and on an RTX 3090 there.

What

crates/victory-gpu/src/host.rs only:

  • wait_resident_buffers(): false for VICTORY_WAIT_RESIDENT=0 and =textures.
  • buffer_not_resident(), buffer_resident(), buffer_mapped(): the existing helpers,
    skipped when buffers are not waited for.
  • The four buffer makers use them: upload_buffer, shared_buffer_now,
    mapped_card_buffer, uav_buffer. Texture blocks (pool.rs) and textures
    (resource.rs) are unchanged and still wait.

Unset, 1 and 0 behave as before.

Measured

RTX 4090 24 GB (driver 621.40), i7-13700K, 32 GB RAM, Windows 11 26200. Release build,
Series X at 2560x1440, DLSS quality. Same route (a new game, the first 4 minutes of
gameplay), stopped by a script at 4 minutes. Two pairs, the same build in each pair.

default VICTORY_WAIT_RESIDENT=textures
new-memory waits 62,000 / 59,000; 19.2 s / 17.0 s; longest 956 / 938 ms 1,000 to 1,999; 0.70 s / 0.70 s; longest 10.8 / 4.7 ms
mapping waits 47,400 / 44,800; 5.8 s / 4.4 s 1,000 to 1,199; 0.12 s / 0.13 s
errors, device loss none none

The counts with the switch are ranges because the log line comes every 1,000th (new
memory) and 200th (mapping) wait.

Frame time: in the first pair the mean did not move (39 ms both, p95 52 to 48 ms, max 60
to 51 ms). The second pair does not compare on frame time (frame generation was on in one
run only). So this PR claims the waits and the long stalls, not frame rate.

Not seen: no new texture corruption with the switch. The late textures on some faces and
arms were in both runs.

Not done

  • Default left as it was; whether textures should be the default on NVIDIA is the
    maintainer's call.
  • Not tested on other cards in this fork.
**@⁠bakdakonusuruz** on GitHub · 2026-11-28 02:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/654) `wait-resident-textures` → `main` · +34 −10 · 1 files · 1 commits · merged 2026-11-28 19:39 UTC ### Why On an RTX 4090 most of the residency waits are for plain buffers. In a 4-minute run on the prologue, the layer waited for new memory 59,000 to 62,000 times (17.0 to 19.2 s in all, the longest 0.94 to 0.96 s) and for mappings 44,800 to 47,400 times (4.4 to 5.8 s). The comment on `wait_resident()` places the device losses that the waits fixed in texture blocks, not in buffers. The same split was measured on an RTX 3080 in Belobug/VIctory-Belobug-AMD#346 (212,000 waits, 60.8 s, down to about 1,000) and on an RTX 3090 there. ### What `crates/victory-gpu/src/host.rs` only: - `wait_resident_buffers()`: false for `VICTORY_WAIT_RESIDENT=0` and `=textures`. - `buffer_not_resident()`, `buffer_resident()`, `buffer_mapped()`: the existing helpers, skipped when buffers are not waited for. - The four buffer makers use them: `upload_buffer`, `shared_buffer_now`, `mapped_card_buffer`, `uav_buffer`. Texture blocks (`pool.rs`) and textures (`resource.rs`) are unchanged and still wait. Unset, `1` and `0` behave as before. ### Measured RTX 4090 24 GB (driver 621.40), i7-13700K, 32 GB RAM, Windows 11 26200. Release build, Series X at 2560x1440, DLSS quality. Same route (a new game, the first 4 minutes of gameplay), stopped by a script at 4 minutes. Two pairs, the same build in each pair. | | default | `VICTORY_WAIT_RESIDENT=textures` | |---|---|---| | new-memory waits | 62,000 / 59,000; 19.2 s / 17.0 s; longest 956 / 938 ms | 1,000 to 1,999; 0.70 s / 0.70 s; longest 10.8 / 4.7 ms | | mapping waits | 47,400 / 44,800; 5.8 s / 4.4 s | 1,000 to 1,199; 0.12 s / 0.13 s | | errors, device loss | none | none | The counts with the switch are ranges because the log line comes every 1,000th (new memory) and 200th (mapping) wait. Frame time: in the first pair the mean did not move (39 ms both, p95 52 to 48 ms, max 60 to 51 ms). The second pair does not compare on frame time (frame generation was on in one run only). So this PR claims the waits and the long stalls, not frame rate. Not seen: no new texture corruption with the switch. The late textures on some faces and arms were in both runs. ### Not done - Default left as it was; whether `textures` should be the default on NVIDIA is the maintainer's call. - Not tested on other cards in this fork.
New plain buffers (upload, shared, mapped card and unordered access
buffers) are made resident and mapped without a wait; texture blocks
and textures still wait, where the device losses of 2026-11-25 lay.
Off unless set: the default is unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 02:48:37 +00:00
Author
Owner

@⁠Exopus-0x65f7ad0 on GitHub · 2026-11-28 18:22 UTC · original

Same result on an 8 GB card, where the memory waits are the stutter you can feel in play.

Setup: RTX 5060 Ti 8 GB (DXGI budget ~7.0 GB), 16 GB RAM, Windows 11 26300. v2026.11.28.03 + this PR (+ local commits). README launcher defaults: Series X, native 1440p, DLSS Quality, DLSS frame generation 2x. Prison opening: cutscene plus a scripted 90 s walk. The card is at its texture line most of the time (no room in 80–90 % of the room lines).

default VICTORY_WAIT_RESIDENT=textures
new-memory waits 39,000 in 6 min (23.4 s, longest 888 ms); without FG 72,000 in 9.5 min (44.8 s, longest 879 ms) 800 in 9.5 min (0.23 s, longest 22.6 ms)
frame lines (≥ 3,000 draws): median / p90 / worst ms/frame 79.6 / 172.3 / 1,913 71.6 / 97.7 / 463
rendered / shown fps (title, 2-s samples) ~14 / ~28 13.1 / 26.2
errors, device loss none none

Mean fps barely moves (the card is GPU- and copy-bound here), but the long hitches go away. With frame generation those were what made it feel stuttery. No device loss in this run. That fits the wait_resident() comment placing the 2026-11-25 losses in texture blocks, which still wait.

+1 for making textures the default once a few more people have run it. I've made it the default in my local build and will report back if a device loss shows up.

**@⁠Exopus-0x65f7ad0** on GitHub · 2026-11-28 18:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/654#issuecomment-7243739050) Same result on an 8 GB card, where the memory waits are the stutter you can feel in play. **Setup:** RTX 5060 Ti 8 GB (DXGI budget ~7.0 GB), 16 GB RAM, Windows 11 26300. `v2026.11.28.03` + this PR (+ local commits). README launcher defaults: Series X, native 1440p, DLSS Quality, **DLSS frame generation 2x**. Prison opening: cutscene plus a scripted 90 s walk. The card is at its texture line most of the time (`no room` in 80–90 % of the room lines). | | default | `VICTORY_WAIT_RESIDENT=textures` | |---|---|---| | new-memory waits | 39,000 in 6 min (23.4 s, longest **888 ms**); without FG 72,000 in 9.5 min (44.8 s, longest 879 ms) | **800** in 9.5 min (**0.23 s**, longest **22.6 ms**) | | frame lines (≥ 3,000 draws): median / p90 / worst ms/frame | 79.6 / 172.3 / 1,913 | 71.6 / **97.7** / **463** | | rendered / shown fps (title, 2-s samples) | ~14 / ~28 | 13.1 / 26.2 | | errors, device loss | none | **none** | Mean fps barely moves (the card is GPU- and copy-bound here), but the long hitches go away. With frame generation those were what made it feel stuttery. No device loss in this run. That fits the `wait_resident()` comment placing the 2026-11-25 losses in texture blocks, which still wait. +1 for making `textures` the default once a few more people have run it. I've made it the default in my local build and will report back if a device loss shows up.
github-bot referenced this pull request from a commit 2026-11-28 19:41:56 +00:00
github manually merged commit b0b2d7fc2f into main 2026-11-28 19:42:07 +00:00
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!654
No description provided.