GPU: textures picked by index: looked-at and fresh slots in turns; slots without memory looked at again after up to 20 s #1246
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1246
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1246"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Exopus-0x65f7ad0 on GitHub · 2026-11-26 01:53 UTC · original
Exopus-0x65f7ad0:pr/fair-due→main· +81 −14 · 2 files · 1 commits · openProblem
Faces whose textures are picked by index (the diner waitress, Lucia's close-ups, the extras) come out black, red or noisy in the opening cutscene, differently from run to run. cafeoh traced this in #821 to the texture queue: until a slot's turn comes, the shader reads an empty slot or an older view.
I added a counter line to the pass (passes, slots handed, slots looked at, why each pass stopped) and ran the cutscene on an 8 GB card with 16 GB of RAM:
TextureQueue::duehands out every slot looked at before ahead of every fresh one. In the cutscene, thousands of slots stream in a part at a time, or wait for memory that is not mapped yet. They are looked at again every 1, 2, 4… frames, at most(4000 / ms per frame).clamp(16, 256)frames, which at 4 fps means every 16 frames. So they filled each pass, and fresh slots (the shot on screen) rarely got a turn.Change
TextureQueue::dueserves the two kinds in turns, a slot looked at before first. The head of the order is unchanged (the existing test still holds), and a pass that takes only part of the backlog now reaches fresh slots.VICTORY_FAIR_DUE=0restores the old order.VICTORY_RELOOK_MS(default 20,000 ms, was 4,000 ms), clamped to 16–1,024 frames. The runtime's mappings already make such a slot due (texture_slots_remapped), so these looks only catch what that path does not tell.Tested
descriptor::host::tests::the_texture_queue_serves_looked_at_and_fresh_slots_in_turns. With 10 looked-at slots, 3 fresh ones and a pass of 6, a looked-at slot comes first and all 3 fresh slots are reached.the_texture_queue_serves_the_newest_writes_firstandslots_read_through_tables_leave_the_texture_queuestill pass (MSVC 1.98.1).The real limit after this is the cost of each look: reading the texture's bytes when its pages are out of memory, and creating the host texture. That is not changed here.
No game data in this PR (no captures, hashes, addresses or logs).
🤖 Generated with Claude Code
@UwUCammie on GitHub · 2026-11-26 02:29 UTC · original · edited 2026-11-26 02:46 UTC
I tried the queue change on an RX 7900 XT with RADV 26.3.1, Wine and vkd3d-proton. The interleaved-queue test passed. In the diner the server's face was still nearly black at both the first exchange and the later shot with her hand on her hip. Hair, forearms and the pink shirt drew in the same frames. The seated character had visible skin in both shots.
On the preceding build I saw the same missing face with
VICTORY_RELAY=0and=2. WithVICTORY_PAGE_WRITES=1on its own, the runtime counted 2,985 early uploads made due again by the end of the run. With this PR, the background heap worker and page writes enabled together, the defect was still visible. This worker waits for the next kick between passes. The combined run also had the ordered-pixel and face-buffer changes. This is a visual reproduction on another card, not an isolated measurement of queue throughput.Tested integration
I replayed the water order at fixed texture-copy budgets of 4 GiB and 8 GiB on the same build, once per budget. The server's forearms looked normal and her face was blotchy red on the same reply in both runs. At 4 GiB the queue had 24,862 slots due during the exchange, including 5,646 fully mapped entries whose textures had never received a host copy. I haven't traced those entries to the face draw. Matched dialogue results
@ArturoWolff on GitHub · 2026-11-26 02:52 UTC · original · edited 2026-11-26 03:27 UTC
I isolated the ordering part of Exopus-0x65f7ad0’s
faf709b5on the private #854-based receiving build described in the deferred-material trace. This is not a build of this PR head: I kept #1031’s bounded selection, the receiver’s original 4,000 ms re-look calculation and its 16–256 frame clamp. No worker chaining. A full-sort reference test for the alternating order and the receiver’s original ordering regression both passed (2 passed, 0 failed; the benchmark was ignored).The age of a null descriptor matters here. Each retail capture contained three recorded commands for the same deferred character pixel shader, with seven in-bounds material fields per command:
Every null in this table was due, had zero recorded looks, and had no host resource. The original-order capture reproduces old writes with an empty host slot, but not necessarily writes that were never inspected. In this receiver
lookscounts consecutive memory retries, not all inspections: the no-room path can hold a slot without incrementing it. Neither capture recorded the history of a specific write generation. In the alternating capture the outstanding writes were from that very frame. Counting nulls alone would miss this difference. Write age is not time continuously due. These are CPU observations at command recording, not measurements of the first service event, GPU consumption or skin pixels. The observations are not independent: two commands reference the same set of slots in each capture. Neither frame dump finished its image set.RTX 4060 8 GB, Linux, GE-Proton11-14 / vkd3d-proton
71cae09, Series X, 1920×1080. Same executable, separate byte-matched starting prefix/saves/title cache/driver cache, runs serialized with the host-memory guard enabled. Both reached the dark opening exterior and ended at the scheduled bound (~333 s), without a host OOM or logged device loss. The original-order run received A at the account picker; no qualifying prompt was captured in the alternating run, so no input was sent there. Different poses and material records: not a matched visual or performance result, and no claim about the full PR or AMD/Windows. A useful next measurement is whether each same-frame write is inspected and gets a usable view before the next draw that references that write generation.AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol Max).
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.