Skip to content

victory-gpu: let the texture pass spend more of a frame on cards over 12 GB and while catching up; turn texture catch-up on - #532

Merged
trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
henriazz10:perf/texture-streaming-rtx50
Nov 28, 2026
Merged

trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
henriazz10:perf/texture-streaming-rtx50

Conversation

@henriazz10

Copy link
Copy Markdown
Contributor

Summary

  • Root cause: apps/victory/src/play.rs set VICTORY_TEXSPK_PASS_MS=8, VICTORY_TEXTURE_CATCHUP=0, and VICTORY_TEXTURE_STAGE_MS=16. In crates/victory-gpu/src/draw.rs (State::heap_textures), texspk_pass_ms() clamped every frame's combined texture passes (early_textures + heap_textures) to 8 ms even when the card had gigabytes of free VRAM (0 held back for room, 0 at their bytes in victory-nvidia-play-20261127-233030-46360.log) and thousands of due slots (1,462-4,218 due, 1-8 frames late, 93 passes stopped at their time).
  • Fix:
    • Added texspk_cap_ms(base_cap_ms, vram_budget, room, pressured, catchup_active) in crates/victory-gpu/src/draw.rs: keeps base_cap_ms (8 ms) on <= 12 GiB cards, full cards (!room), or pressured host RAM; doubles the cap (16 ms) when vram_budget > 12 GiB and room is true; and triples the cap (24 ms, matching the 3x catch-up span and per_frame byte budget) when catchup_active (on_time >= 1024 && room && !pressured).
    • Enabled VICTORY_TEXTURE_CATCHUP=1 and raised VICTORY_TEXTURE_STAGE_MS=24 in apps/victory/src/play.rs. Safe on 12 GB cards because catch-up only activates when on_time >= 1024 && room && !pressured.
  • Files touched:
    • crates/victory-gpu/src/draw.rs
    • apps/victory/src/play.rs

Negative Control

Before implementing texspk_cap_ms scaling:

  • Command: cargo test -p victory-gpu --lib texspk_cap_scales_with_vram_and_catchup
  • Result: exit 1 (thread 'draw::tests::texspk_cap_scales_with_vram_and_catchup' panicked at crates\victory-gpu\src\draw.rs:6006:9: assertion 'left == right' failed: left: 8, right: 24)

Commands & Checks

  • cargo test -p victory-gpu --lib texspk_cap_scales_with_vram_and_catchup: exit 0 (1 passed; 0 failed)
  • cargo test -p victory --locked: exit 0 (23 passed; 0 failed unit + 2 passed; 0 failed integration)
  • git diff --check: exit 0
  • cargo fmt --all -- --check: exit 1 (pre-existing formatting diffs on main 64d4931 in untouched files and untouched lines of draw.rs / play.rs)
  • cargo clippy --workspace --all-targets --locked -- -D warnings: exit 101 (pre-existing clippy::precedence error in crates/victory-formats/src/texture.rs:1346)
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: exit 101 (same pre-existing error in crates/victory-formats/src/texture.rs:1346)
  • cargo test --workspace --locked: exit 101 (435 passed, 2 pre-existing failures in crates/victory-gpu/src/indirect.rs: host_list_budget_starts_empty_at_each_submission and warp_batch_charges_every_execution)

Before / After Game Runs

  • Environment: Windows 11 build 26300, NVIDIA GeForce RTX 5080 (16 GB), driver 616.92
  • Command (each run 60 s, release build, VICTORY_WARMUP_RESTART=0):
    victory.exe play <dump>\game_scarlett_master.exe --set VICTORY_WARMUP_RESTART=0
  • Before Run 1 (victory-nvidia-play-20261128-000026-51684.log):
    • Initial 5 s burst: 414.5 fps, 5 slots, 0 due (oldest 0 frames ago), 0 waiting, 13 stopped at their time (next 5 s: 14 stopped at their time, 0 slots, 0 due); steady title screen 419.9 fps.
  • Before Run 2 (victory-nvidia-play-20261128-000149-64144.log):
    • Steady title screen 430.0 fps, 0 slots, 0 due (oldest 0 frames ago), 0 waiting.
  • After Run 1 (victory-nvidia-play-20261128-000626-30924.log):
    • Initial 5 s burst: 422.1 fps, 5 slots, 0 due (oldest 0 frames ago), 0 waiting, 11 stopped at their time (next 5 s: 7 stopped at their time, 0 slots, 0 due, 427.2 fps).
  • After Run 2 (victory-nvidia-play-20261128-000757-40524.log):
    • Initial 5 s burst: 429.8 fps, 0 slots, 0 due (oldest 0 frames ago), 0 waiting, 5 stopped at their time (next 5 s: 8 stopped at their time, 428.1 fps).

Hand test in play (reviewer)

The runs above never left the title screen, so they say nothing about streaming. The user then played a build of this branch together with #516 (cherry-picked on top, main 64d4931) on the RTX 5080: open water, the bridge, mangroves, with DLSS frame generation on at times. Window title: 16-18 fps rendered (32 fps with frame generation) at 3900-6250 draws/frame; dedicated card memory peaked at 13.3 of 16 GB. The user called it the best build so far ("the best so far"). That is a subjective comparison, not a measurement, and it does not separate this change from #516. Some rectangular patches on the water, under the bridge, are still visible; those are left for a separate change.

What Was Not Tested

  • Unattended 60 s runs stop at the title screen (no controller/keyboard input to press A and enter street gameplay, where 1,462-4,218 due-slot bursts occur); the in-game catch-up path (on_time >= 1024) is verified by unit test texspk_cap_scales_with_vram_and_catchup and analyzed against victory-nvidia-play-20261127-233030-46360.log.

AI-assisted. Gemini 4 Hydrogen (Antigravity CLI) wrote the change and ran the checks; Claude Code reviewed it.

🤖 Generated with Claude Code

@Machad3x

Copy link
Copy Markdown

Tested in a batch on an RTX 3080 Ti + Ryzen 7 5700X, 1440p, DLSS Quality, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s run into the prison cell scene. Batch: #516, #501, #498, #497, #532, #521.
Result: alive for the whole run, 61.5-63.9 ms/frame, 1 draw/frame dropped (not from this batch), no shader or pipeline refused.
No problem found in this PR.

MystifiedSky added a commit to MystifiedSky/VIctory-NVIDIA-Improved that referenced this pull request Nov 28, 2026
@trustno1-coder
trustno1-coder merged commit dcc09b0 into trustno1-coder:main Nov 28, 2026
krolyxon added a commit to krolyxon/VIctory-NVIDIA-proton that referenced this pull request Nov 28, 2026
Conflicts:
- watch.rs: trustno1-coder#933's protect_here/protect_run split kept, upstream's soft
  views parameter passed through both.
- shadow.rs: upstream's has_pending and PageMerge landing loop taken (on
  trustno1-coder#1298's copied tuple); trustno1-coder#1184's lazy landing applied to upstream's
  outside_sorted_into parts.
- pool.rs: trustno1-coder#814's take_from_with (one empty block made ahead) kept; its
  base is the same trustno1-coder#661 change upstream merged.
- card_steps.rs: upstream's taken whole (VICTORY_PLACED_FILLS, trustno1-coder#740);
  trustno1-coder#1298's card_steps part dropped.
- draw.rs: upstream's trustno1-coder#532 values; trustno1-coder#814's cached slot handle kept inside
  upstream's rest() timing.
- descriptor/host.rs: upstream's TextureQueue ordering taken whole; trustno1-coder#814's
  VICTORY_DUE_FRESH_FIRST and its play.rs default dropped. A test module
  both sides added was kept once.
- emit/mod.rs, send.rs: both sides kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants