Textures picked by index: looked at again past the schedule, and read whole up to a size (HUD glyphs) #956
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!956
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-956"
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?
@Victorywillbeours222 on GitHub · 2026-11-25 13:43 UTC · original
Victorywillbeours222:texture-recheck-every-whole→main· +139 −33 · 4 files · 2 commits · openThe problem
A texture picked by index is looked at again after an upload, at 4, 12, 40, 120 and 400 frames (
RECHECK_FRAMES), and then never again. Each look compares a fingerprint of three 16 KiB windows: the start, the middle and the end of the memory.The title fills some textures piece by piece, long after their first upload. The visible case is the HUD's glyph cache. In the prologue's cell, button prompts showed only some of their letters (
M d), and those letters stayed missing. A glyph written after the last look, or between the windows, never reached the host copy.The change (both switches off by default; with neither set nothing changes)
VICTORY_HEAP_RECHECK_EVERY=<frames>: a slot still unchanged at the last scheduled look is looked at again every that many frames, for as long as it stays unchanged. It still leaves the queue when it is written again or streamed out.VICTORY_HEAP_RECHECK_WHOLE_MB=<n>: textures over 48 KiB and up tonMiB get a fingerprint of their whole memory too, read in 48 KiB pieces.nMiB keep the three windows.Measured
RTX 5080 16 GB, Ryzen 7 5800X, diag build of
f85101bwith its frame-rate switches, Series S profile, the prologue (the diner, the title card, the cell). A 10-minute run withVICTORY_HEAP_RECHECK_EVERY=60 VICTORY_HEAP_RECHECK_WHOLE_MB=8:_EVERY)_WHOLE_MB)More than a quarter of the changes the title makes to these textures fall between the three windows. That is the gap #559 describes; this is a count of it in the game. A second run, with #868's switch on, found 9,005 of 28,590 (31 %).
With both switches on, the cell's HUD prompts and the subtitles read in full. Without them, letters are missing in the same scene (seen on
9376fd6).Cost: same tree, profile and scene, 10 minutes each, readings over 200 draws:
_EVERY=60,_WHOLE_MB=8)That is about 1 ms and 5 MB more a frame, for the textures uploaded again. The frame-rate difference is within run-to-run noise.
At that cost the switches could reasonably be on by default. They are left off here so other cards can measure first.
How it relates to other PRs
Checks
On
0b0074ewith only this change:cargo build --profile diag -p victory --features diagnostics: ok.cargo clippy -p victory-gpu --all-targets --features diagnostics: no new warnings. The three it prints are in code this change does not touch (draw.rs:2427,shadow.rs:2675,indirect.rs:2159).cargo test --profile diag -p victory-gpu --lib: 169 passed, 5 ignored, 1 failed. The failure isindirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which fails on0b0074ewithout this change too (2 of 2 runs) and passes now and then with or without it. It is the flaky software-adapter test thata253706's message mentions.cargo xtask policy: 179 files ok.🤖 Generated with Claude Code
@tippythetaidum on GitHub · 2026-11-25 16:47 UTC · original · edited 2026-11-25 16:50 UTC
Tried on an RTX 5080 16 GB (Windows 11, driver 621.14, Series X profile), the prologue from the cell to the salon. One 10-minute run with
VICTORY_HEAP_RECHECK_EVERY=60 VICTORY_HEAP_RECHECK_WHOLE_MB=8.Build: diagnostics build of
main3973179+ #24 + #927 + #823 + #606 + this PR + #1002 + #907. That run also carried a local diagnostic of mine that changes texture reads (pages not there read as a marker colour instead of zeros), so read the cost notes below with that in mind.Counters at the end of the run (they fit yours):
The queue line overstates "waiting for their memory" with
_EVERYset. With it, the texture queue line said 10,500 to 12,000 slots were waiting for their memory, all run long. In a run of the same build without the switches (and without my diagnostic), it fell from about 8,600 at the start of the world to 2,200 to 2,900, as before. The slots that_EVERYkeeps looking at stay in the queue asrecheckleft them,looks1 andmapped0, andTextureQueue::censuscounts every slot withlooks > 0andmapped == 0as waiting. So the line is about 9,000 too high: those textures are uploaded and fine. Counting slots that have acheckedfingerprint apart would fix the line.Cost: I can't separate it in this run. Frame times were about the same as without the switches (3 to 4 fps in the same scenes in both runs). The first 30 frames of the world were worse, though: characters whose skin colour had not arrived yet lit up as bright white figures. Correction: that run also entered the world with about 1,230 pipelines still being made, because other PRs in the stack changed the translator and the caches were cold. The runs I compared it with had none. That is the likelier cause, not this PR.
AI-assisted (Claude Code, Claude Opus 5.5). Counts and descriptions only, nothing from the game attached.
@Victorywillbeours222 on GitHub · 2026-11-26 13:27 UTC · original
Thanks for running it. The queue line is fixed in
a9040a8:TextureQueue::censusnow counts the slotsrecheckkeeps (those with acheckedfingerprint) apart from the ones waiting for their memory.slots_kept_for_another_look_are_not_waiting_for_their_memory). Thedescriptor::hosttests pass, and the changed hunks add no clippy or rustfmt findings.I haven't re-run it in game yet.
AI-assisted (Claude Code).
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.