Repository navigation
Textures picked by index: looked at again past the schedule, and read whole up to a size (HUD glyphs) - #956
Conversation
… whole up to a size Two opt-in switches for the recheck of textures picked by index, both off by default (with neither set nothing changes): - VICTORY_HEAP_RECHECK_EVERY=<frames>: a slot still unchanged at the last of RECHECK_FRAMES is looked at again every that many frames while it stays unchanged. - VICTORY_HEAP_RECHECK_WHOLE_MB=<n>: textures over 48 KiB and up to n MiB get a fingerprint of their whole memory besides the three 16 KiB windows (the windows' hash kept in the low 32 bits). The frame line counts the looks, the changes, and of those the ones found only after the schedule and only between the windows. In the prologue 28 % of the changes were only between the windows; with both switches on the cell's HUD prompts and subtitles read in full. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fxceless#917, fxceless#823 xmem) - fxceless#916: only mark title memory as written for SLOT_MEMORY shaders that can store by address - fxceless#896: coalesce pending texture change ranges instead of clearing at 32k capacity - fxceless#956: add opt-in VICTORY_HEAP_RECHECK_EVERY and VICTORY_HEAP_RECHECK_WHOLE_MB (default off) - fxceless#917: add opt-in VICTORY_AMBIENT stand-in for CS_ScreenProbes_TemporalResolve (default off) - fxceless#823 (HLE): coalesce map_alias contiguous runs into single section views
|
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 Build: diagnostics build of Counters at the end of the run (they fit yours):
The queue line overstates "waiting for their memory" with 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. |
…ip of every slice, preserving fxceless#956)
… whole up to a size (HUD glyphs) (fxceless#956) PR: fxceless#956 Head: c15f047 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d-project-vi e321a740) Port of felicienradio/cold-project-vi e321a740 (quietdom_). A texture slot picked by index whose title memory is not mapped keeps its host copy for VICTORY_TEXTURE_KEEP_MS (default 2000) before it is nulled: the title streams a texture's pages out and back in, and a null slot in between sampled nothing (white arms, red faces). The frame line says "N passed over unmapped (M kept their host copy, L let go)". Source: felicienradio/cold-project-vi@e321a740 Adapted: `Waiting` keeps both our `checked` (fxceless#956) and `mapped_at`; this branch has no `rechecks` set (dropped from the port); a whole upload looked at again (`recheck`, fxceless#956) also counts as a sighting; the frame line keeps both the new counts and fxceless#956's recheck counts. Added a queue test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… read whole up to a size (opt-in) Two switches for the recheck of textures picked by index, both off by default (with neither set nothing changes): - VICTORY_HEAP_RECHECK_EVERY=<frames>: a slot still unchanged at the last of RECHECK_FRAMES (400 frames on) is looked at again every that many frames while it stays unchanged. - VICTORY_HEAP_RECHECK_WHOLE_MB=<n>: textures over 48 KiB and up to n MiB are fingerprinted whole instead of three windows and their mips' starts; a texture the title draws into piece by piece (a glyph cache, HUD prompts, subtitles) changes between the windows. The frame line counts the looks, the changes, and the changes found only after the scheduled looks. Port of fxceless#956 (Victorywillbeours222, c15f047) onto the fork's fingerprint, which also reads each mip's start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017V7WBBU55HJVgqSgZRhMqc
… whole up to a size (fxceless#956) A texture picked by index is looked at again after an upload at 4, 12, 40, 120 and 400 frames, and then never again, each look a fingerprint of three 16 KiB windows (start, middle, end). The title fills some textures piece by piece long after the first upload (the HUD's glyph cache: button prompts in the prologue's cell showed only some letters, for good). Two switches, both off (nothing changes without them): - VICTORY_HEAP_RECHECK_EVERY=<frames>: a slot still unchanged at the last scheduled look is looked at again every that many frames while it stays unchanged. - VICTORY_HEAP_RECHECK_WHOLE_MB=<n>: memory over 48 KiB and up to n MiB is also fingerprinted whole (the windows' hash kept in the low 32 bits, so changes only the whole read saw are counted). The fill-ahead latch uses the same fingerprint, so with the switch its fills of that size are hashed whole too. The frame line counts looks, changes, changes after the scheduled looks and changes only between the windows. The author's measure (RTX 5080, the prologue, 10 min, EVERY=60 WHOLE_MB=8): 332,642 looks, 34,457 changes, 9,714 of them (28 %) only between the windows, 141 only after the schedule; the prompts and subtitles read in full; about 1 ms and 5 MB more texture preparation a frame.
… jobs not counted finished (fxceless#964), kernel copies when the copy fault handler cannot be registered (fxceless#990), textures picked by index rechecked after their schedule (fxceless#956, VICTORY_HEAP_RECHECK_EVERY/_WHOLE_MB, off), an unreadable pipeline library left alone (fxceless#959), shader-written textures the title reads copied back in the console's layout (fxceless#999, VICTORY_TEXTURE_BACK, off), a test retry (fxceless#952)
The 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 Textures picked by index: the recheck's fingerprint reads every mip of every slice #559 describes; this is a count of it in the game. A second run, with Card copies: a census, and an opt-in switch that leaves write-combining memory on the card (−11…−20 % frame, 3 GPUs) #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