texture queue: due slots from an index, not a walk of every slot #295
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/lobomfz--VIctory-xmem!295
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-295"
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?
@TreXito on GitHub · 2026-12-03 06:29 UTC · original
TreXito:texture-queue-due-index→main· +132 −27 · 1 files · 1 commits · merged 2026-12-03 16:26 UTCWhat
TextureQueue::scanwalked every slot of the queue each frame to find the due ones and to count the census (#188). The slots are aBTreeMap, and a standing scene keeps tens of thousands of them waiting, so the walk is pointer chasing over the whole map, under the queue lock, in the per-frame index pass that runs inline on whichever title thread binds first.Measured here (RDNA3, release build, standing at the house of the first save, timed with the CPU's cycle counter in a local profiling build):
heap_textures)scanChange
TextureQueuekeepsby_due, an ordered set of(due frame, slot)for every slot it holds, andkinds, the census counts (in part / recheck / away), updated where slots come and go or change:insert,take_out,edit_wait.samehands out&Waitingnow, so nothing else edits a slot.scantakes the due slots from the front ofby_dueand reads the counts. The due lists are put in slot order, as the walk gave them, so the result is the same (andin_ordersorts by write anyway).Waiting::kindnames the census classes once, for both.Tested
the_due_index_matches_a_walk_of_every_slot: 4,000 frames of random writes, looks, holds, wakes, partial uploads, rechecks, changes and removals over 300 slots; after every framescanmust equal a walk of every slot (the old code), and the index must hold exactly the slots.descriptor::tests under Wine: 39 pass (38 before, plus the new one).views_die_with_their_resourceaborts the test process here with or without this change, so it was skipped on both.scan1.9 ms → 1.5 µs a frame; the whole index pass 6.5 ms → 3.0 to 4.6 ms (per 20 s window).🤖 Generated with Claude Code
https://claude.ai/code/session_01WNCfbX5dPKJzSkgbf16GX4
@EdouardSence on GitHub · 2026-12-03 11:46 UTC · original
In-game A/B on RDNA 4: RX 9070 XT 16 GB + Ryzen 7 7800X3D, 32 GB, CachyOS kernel 7.3.5, Proton-CachyOS, Mesa 26.3.1 +
mesa.patchfromsetup.sh, resizable BAR on. Release builds of842767a(main) and842767a+ this PR (00e353f), identical except for a one-line per-frame frame-time log inpanel.rsand the scripted keys ungated for release.Defaults (Series X profile, RT on, no frame cap), same frozen save restored before every run, warm pipeline cache, alternating runs of 6 min, stats per frame over the time in the world after the first 45 s (~6,200-6,700 frames each):
The save spawns the player at a random spot, so I checked screenshots: PR run 5 and main run 6 landed on the same spot and view (30.3 / 16.8 / 129 vs 30.4 / 17.1 / 128). So no difference I can measure here, in either the average or the lows. It does no harm, and the scan time it removes may simply be hidden on this machine: the 1.9 ms you measured is on a title thread, and these frames are mostly bound elsewhere (per-frame p50 ~31 ms, slow frames dominated by the title's own work in earlier timelines). I did not time
scanitself, so this does not contradict your CPU measurement; it only says the gain is not visible in frame times on a fast CPU.AI assistance: Claude Code (Claude Opus 5.5) ran the builds and runs and wrote this report on the hardware above.
@lucamzanon on GitHub · 2026-12-03 13:23 UTC · original · edited 2026-12-03 13:25 UTC
Automated A/B/B/A Benchmark Feedback (RX 9070 XT / Linux RADV)
Test setup:
RADV GFX1201), Ryzen 7 5700X, 46 GB RAM, Ubuntu 26.04.1 LTS (kernel7.0.0-44-generic), repo-built Mesa 26.3.1 RADV + vkd3d-protonVICTORY_BENCH=rt,VICTORY_BENCH_MINUTES=2(first 60 s discarded, second 60 s measured), 2560x1440 → 4K FSR 4 Quality, no Frame GenerationA -> B -> B -> A(4 runs per scene), identical save restored before every run, shared warm pipeline cache (94,199 pipelines)main(842767a)00e353f)Results:
2m x 4)30.15 fps(30.4/29.9) /10.3030.45 fps(30.2/30.7) /10.25+1.00%avg /-0.49%1% low2m x 4)21.00 fps(21.2/20.8) /6.0021.15 fps(21.2/21.1) /6.25+0.71%avg /+4.17%1% lowSummary: Zero crashes or visual issues. Even though 4K RT on RX 9070 XT is heavily GPU-bound, both scenes came out slightly ahead on average FPS (
+0.7%–+1.0%) and Prison saw a nice +4.17% 1% low improvement (6.25vs6.00 fps). Clean win!github-bot referenced this pull request2026-12-03 21:17:06 +00:00