Skip to content

Textures picked by index: looked at again past the schedule, and read whole up to a size (HUD glyphs) - #956

Open
Victorywillbeours222 wants to merge 1 commit into
fxceless:mainfrom
Victorywillbeours222:texture-recheck-every-whole
Open

Victorywillbeours222 wants to merge 1 commit into
fxceless:mainfrom
Victorywillbeours222:texture-recheck-every-whole

Conversation

@Victorywillbeours222

Copy link
Copy Markdown

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 to n MiB get a fingerprint of their whole memory too, read in 48 KiB pieces.
    • The windows' hash is kept in the low 32 bits, so a change that only the whole read saw can be counted.
    • Textures above n MiB keep the three windows.
  • New counters on the frame line: looks, changes, changes found after the scheduled looks, and changes found only between the sampled windows.

Measured

RTX 5080 16 GB, Ryzen 7 5800X, diag build of f85101b with its frame-rate switches, Series S profile, the prologue (the diner, the title card, the cell). A 10-minute run with VICTORY_HEAP_RECHECK_EVERY=60 VICTORY_HEAP_RECHECK_WHOLE_MB=8:

looks at uploaded textures 332,642
changes found (uploaded again) 34,457
… only after the scheduled looks (_EVERY) 141
… only between the three windows (_WHOLE_MB) 9,714 (28 %)

How it relates to other PRs

Checks

On 0b0074e with 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 is indirect::tests::warp_budget_saturates_without_wraparound_and_preserves_draw_fields, which fails on 0b0074e without this change too (2 of 2 runs) and passes now and then with or without it. It is the flaky software-adapter test that a253706's message mentions.
  • cargo xtask policy: 179 files ok.
  • Numbers only; no game data, captures or screenshots.

🤖 Generated with Claude Code

… 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>
e4glevlr added a commit to e4glevlr/victory-fork that referenced this pull request Nov 25, 2026
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
@tippythetaidum

tippythetaidum commented Nov 25, 2026 •

Copy link
Copy Markdown

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 main 3973179 + #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):

looks 387,859
changed (uploaded again) 51,728
changed only after the scheduled looks 1,479
changed only between the sampled windows 14,317

The queue line overstates "waiting for their memory" with _EVERY set. 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 _EVERY keeps looking at stay in the queue as recheck left them, looks 1 and mapped 0, and TextureQueue::census counts every slot with looks > 0 and mapped == 0 as waiting. So the line is about 9,000 too high: those textures are uploaded and fine. Counting slots that have a checked fingerprint 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.

CernyMuzCZ pushed a commit to CernyMuzCZ/vitezstvi-fork that referenced this pull request Nov 25, 2026
akus-elinius pushed a commit to akus-elinius/victory-fork that referenced this pull request Nov 25, 2026
… whole up to a size (HUD glyphs) (fxceless#956)


PR: fxceless#956
Head: c15f047

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
akus-elinius pushed a commit to akus-elinius/victory-fork that referenced this pull request Nov 25, 2026
…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>
triippywhale pushed a commit to triippywhale/victory-fork that referenced this pull request Nov 25, 2026
… 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
PiloteCode pushed a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
… 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.
PiloteCode added a commit to PiloteCode/victory-fork that referenced this pull request Nov 25, 2026
… 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants