Repository navigation
Texture pass: stops after 128 slots held back for room, not 1,024 (VICTORY_TEXTURE_HELD_CAP) - #1095
bentsignal wants to merge 1 commit into
Conversation
…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>
|
Ran the texture-pass module tests at 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 All eight runnable tests pass, including 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. |
|
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.
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. |
|
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. |
…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>
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 withfull_card_pass()stops after 128 slots held for room instead of 1,024 (VICTORY_TEXTURE_HELD_CAP;VICTORY_TEXTURE_HELD_CAP=1024restores 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:
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