Repository navigation
GPU: refresh view-memory textures that host-side writers changed - #438
sennecools wants to merge 1 commit into
Conversation
A texture in view memory is guarded (made read-only, a write faults once) and otherwise hashed only every eighth frame, so a write the guard does not see leaves it up to eight frames stale. Two kinds were unseen: the title fills physical pages through its pool while the same pages are sampled through its tiled heap, and the runtime writes physical pages through views of its own (DirectStorage page destinations, xmem's write_physical). Neither faults at the guarded address. - Blocks of another view that show a guarded block's pages are made read-only as well, and a write there marks the guarded block written (VICTORY_GUARD_ALIASES=0 turns this off). - The runtime's physical-page writes are reported with physical_written. - kernel_will_write now returns a hold. Until it is dropped the blocks are not guarded again through either view, so the kernel write cannot fail on them. write_mapped takes the hold itself. - An old view is kept in place of a new one only when the two differ in their mips. A view of another array slice, plane or format (a video's ring of pictures) would show an older picture. The intro flicker had this cause: with every view-memory texture hashed at each check (VICTORY_TEXTURE_GUARD=0), or with no views kept (VICTORY_KEEP_VIEWS=0), the flickering tiles went from 317 to 2 of 480. The fix itself is tested on WARP only and has not been confirmed in a game run yet. A runtime writer that neither faults nor reports its writes (its media code may be one) is still unseen. AI-assisted (Claude Code)
|
Tested on RTX 5070 12 GB (Windows 11 25H2, driver 621.24) on top of c96b4f2 with VICTORY_RELAY=2 (plus #206, #410, #451, #457, #460, #462, #481, #139):
|
|
@sennecools, @Revens2 pointed me here from #555. Both PRs have the same head, 5af49b5. I reran the three tests on the test-only commit, whose parent is that exact head. A write through a sibling mapping produced 0x11223344 in both independent GPU readbacks. Both journal consumers saw the same write, and the synchronous four-byte file read returned TEST while another holder covered part of its destination. All three passed in two fresh processes per adapter setting on Windows. The command is Prepared with the help of Codex 6.2 Astra Max. |
A texture in view memory is guarded (read-only, a write faults once) and otherwise hashed only every eighth frame, so writes the guard does not see leave it up to eight frames stale. Two such writers were unseen: the title filling physical pages through its pool while the same pages are sampled through its tiled heap, and the runtime writing physical pages through views of its own (DirectStorage page destinations, xmem
write_physical).Changes
VICTORY_GUARD_ALIASES=0turns this off).physical_written.kernel_will_writereturns a hold: the blocks are not guarded again (through either view) until the kernel write is done;write_mappedtakes it itself.Why: with
VICTORY_TEXTURE_GUARD=0(hash every check) orVICTORY_KEEP_VIEWS=0, flickering tiles in the intro went from 317 to 2 of 480, so stale content was the cause.Testing
diagnostics; clippy clean.Known limits: a runtime writer that neither faults nor reports (possibly the media code) stays unseen; an overlapped
ReadFileis held only until it is started.AI-assisted (Claude Code)
Draft: it is in our combined build and ran in the game without problems, but its effect on the flicker has not been measured yet.
AI-assisted.