Skip to content

Texture pass: stops after 128 slots held back for room, not 1,024 (VICTORY_TEXTURE_HELD_CAP) - #1095

Closed
bentsignal wants to merge 1 commit into
trustno1-coder:mainfrom
bentsignal:texture-held-cap
Closed

bentsignal wants to merge 1 commit into
trustno1-coder:mainfrom
bentsignal:texture-held-cap

Conversation

@bentsignal

Copy link
Copy Markdown
Contributor

What this fixes

With the card at the texture line (resource::room_line), the texture pass looks at slot after slot it can only hold back for room (Told::Held), up to 1,024 of them per pass before it stops. Each such look costs the recording thread some 15-20 us and makes nothing.

At a cutscene's cuts on a 16 GB card (Windows giving the process ~10.9 GB, frame generation on), a per-second texture line showed passes holding 6,000-35,000 slots a second, costing 150-550 ms a second of the recording thread, about 12 ms a frame, up to 48 ms in one pass at a cut. The slots held were served a median 0.9 s after their write.

The change

draw.rs: a pass with full_card_pass() stops after 128 slots held for room instead of 1,024 (VICTORY_TEXTURE_HELD_CAP; VICTORY_TEXTURE_HELD_CAP=1024 restores the old behaviour). The slots it did not reach stay due for the next pass, and the pass still serves everything else it meets before the cap.

Measured

RTX 5070 Ti 16 GB, Ryzen 9 9900X, Windows 11. Series X profile, 2560x1440, DLSS Quality, frame generation 3x, release, pipelines warmed. First cutscene, back to back runs.

This was measured together with two changes that are not in this PR: sweeps counting as pressed while the pass finds no room (a follow-up to #340) and a launcher texture line of 93 % with frame generation. All three together:

before after
fps 23.3 29.7
frames over 50 ms 4.6 /s 2.2 /s
texture slots held back for room ~9,800 /s ~1,200 /s
a held slot served after its write (median) 919 ms ~220 ms

The cap's own share was not measured apart. What it acts on is the recording thread's time in looks at held slots; the texture passes cost ~12 ms a frame before, and with all three their per-slot looks still cost ~7-10 ms a frame. The picture was as before.

Tests

  • cargo check --locked -p victory-gpu.
  • cargo test --locked -p victory-gpu --lib draw::: 8 passed, 1 ignored.

Setup

Own dump of the title. No game files are attached or quoted.

This change and its testing were done with an AI assistant (Claude Code), and the results were checked on my machine.

🤖 Generated with Claude Code

…CTORY_TEXTURE_HELD_CAP)

With the card at the texture line every look at a slot that can only be held
back costs the recording thread some 15-20 us and makes nothing. At a
cutscene's cuts on a 16 GB card, passes held 6,000-35,000 slots a second and
took 150-550 ms a second. The slots not reached stay due for the next pass.
VICTORY_TEXTURE_HELD_CAP=1024 restores the old cap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Aniseto

Aniseto commented Nov 28, 2026

Copy link
Copy Markdown

Ran the texture-pass module tests at 17e6568 on an NVIDIA Blackwell desktop part:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, Rust 1.98.1 (48a229cea 2026-09-01, pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env), debug build.

VICTORY_D3D12_ADAPTER=NVIDIA cargo test -p victory-gpu --lib draw:: -- --test-threads=1
8 passed; 0 failed; 1 ignored; 0 measured; 480 filtered out      (exit 0)

All eight runnable tests pass, including a_frames_pass_runs_share_texspk_cap and staging_budget_scales_with_vram_budget; spans_of_a_pass is ignored in this tree. The PR's reported gain is CPU time in the recording thread on a 16 GB card (150-550 ms/s spent looking at slots held for room, ~12 ms/frame); these tests only cover the pass bookkeeping, so I am not claiming an FPS measurement. The PR has no comments yet, so this is the first datapoint in the thread and the first from an RTX 5070 Ti.

Not tested: a retail title, the 128-vs-1024 cap A/B, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

@Exopus-0x65f7ad0

Copy link
Copy Markdown

A same-build A/B of just the cap, since the PR says its own share wasn't measured apart.

Setup: RTX 5060 Ti 8 GB, 16 GB RAM, Windows 11. 63b902f + this PR (+ local commits), one binary, only VICTORY_TEXTURE_HELD_CAP changed through the launcher (checked in the log header). README defaults: Series X 1440p, DLSS Quality, no frame generation. Prison opening: cutscene plus a scripted 90 s walk. One run each. World frames are the 5-s frame lines with ≥ 4,000 draws.

cap 128 (new default) cap 1024 (old)
frame lines 65 78
fps, median 16.7 18.2
ms/frame, median / p90 59.7 / 78.0 54.7 / 80.6
"preparing", median 38.8 ms 37.5 ms
texture pass "telling the queue what came of each slot", mean per 5 s 63 ms 43 ms
walk, title-bar fps mean (2-s samples) 14.7 15.2

So on this card and scene I see no gain from the cap. Both arms are within run-to-run noise of each other, and if anything 1024 came out slightly ahead. The likely reason: here the pass costs only ~10 ms per second of telling the queue, far from the 150–550 ms per second you measured at the cutscene cuts with frame generation 3x. The prison opening on an 8 GB card at Series X 1440p doesn't produce those held-slot storms, even though the card is at its texture line.

That doesn't contradict your numbers. It just says the cap's effect is scene- and setup-specific, and that 128 costs nothing measurable where it doesn't help. A cutscene-cut run with frame generation would be the case that shows it.

@trustno1-coder

Copy link
Copy Markdown
Owner

Thanks for this. I'm closing it without merging because it conflicts with the current main in several places (main has moved a lot since it was opened, with about 100 pull requests merged today), and I can't resolve that safely on your behalf. If you'd still like it in, please rebase it on the current main and open a new pull request.

iGlideForever pushed a commit to iGlideForever/VIctory-iGL-NVIDIA that referenced this pull request Nov 28, 2026
…lock

Per texture a draw reads through a view, draw::readable took up to four
mutexes that every recording thread shares:

- PLACED_TEXTURES in resource::texture_at (descriptor::host::
  placed_texture), for each view the title places in its memory without
  a resource object (device 0x230, its streamed textures);
- TARGETS_AT in resource::alias_of, for each placed texture the title
  fills;
- HOST_WRITTEN in texture::upload_from, for each texture read;
- STAGING in texture::staged_from, on a read from another first level.

Placed views: each thread keeps the placed textures it found (256
slots, by address and description as asked). Nothing takes a texture
out of PLACED_TEXTURES, so what a thread found holds.

alias_of: a texture keeps its "no target at my memory" answer with the
change count of its memory's bucket (1,024 counters by 64 KiB block,
bumped under TARGETS_AT's lock when a target enters it). While the
count is unchanged the answer stands without the lock; a target leaving
the table cannot make "none" wrong. A texture with a target is looked
up as before.

Host-written and staged level: each texture keeps whether the host
wrote it (set with the set entry) and the first level its staging
buffer holds (written under STAGING's lock wherever the table gains or
loses the entry: staging, unstage, the idle sweep; forget runs as the
texture goes). upload_from reads them without the locks.

Same answers as the locked lookups; the tables stay for every other
reader. The tests hold each table's lock on one thread and read on
another: with the locked lookups the read waits.

Source: port of the idea of Marvisak/VIctory#3274 (KainanP), first
ported as LooperSalty/AnyXboxX#444 onto the Neptune base;
this is its port onto the Vice-Tay base (trustno1-coder#454).

Picked from upstream e6e7c9e98, applied onto our tree (compile and clippy checked, not run on a GPU).

(ported from commit 42d61974606d6e356e5dcd754d610f6ff10ae3fc of Fayberr/Victory-United integ/c25-rndne)

[iGL: ported by hand: the commit's tree is about 3,400 commits from ours, so
both files conflicted. Same changes: the three marks in Hosted (beside
slot_evicted/slot_returned), TARGET_CHANGES bumped where TARGETS_AT gains a
texture (its only insert here), the kept "no target" answer in alias_with,
the per-thread placed-texture finds around texture_at (PLACED_TEXTURES has no
removal here either), and staged_first kept with STAGING in the same four
places it changes here (the idle sweep, unstage, the insert in staging;
forget as the texture goes). read_marks_tests.rs as it was. gpu tests: 474
passed. Run 114332 (26 min, with the memory stack off): no stale texture
seen; at equal draws 5-18 % faster than run 222820 together with trustno1-coder#1179,
trustno1-coder#1095 and main 63b902f.]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

4 participants