GPU: hash a guarded texture at every check while it keeps changing (#269) #343
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!343
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-343"
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?
@PAYS0 on GitHub · 2026-11-24 23:41 UTC · original
PAYS0:fix/texture-guard-recent-changes→main· +110 −13 · 1 files · 2 commits · openFixes #269.
Problem
With
VICTORY_TEXTURE_GUARDon (the default), a texture in view memory that the guard saw no write to is hashed only every eighth frame (HASH_EVERY, by address so textures take turns). The code already notes that a write through another view is not seen by the guard. The startup screens and intro are evidently written that way, so they were shown up to eight frames stale: repeated frames, jumping and flicker. #269 bisected it to this switch alone, and four more people in that thread confirmedVICTORY_TEXTURE_GUARD=0removes it.Fix
Lastgainschanged: the frame a hash last found the texture's memory changed. A newLast::rehashsets it, and every hashing path uses it (partly mapped, through the copy, in place, and the unlocked read).guard_skips. ForRECENTLY_CHANGED(16, two turns) frames after a change, a texture is not skipped.VICTORY_TEXTURE_GUARD=0.Testing
guard_tests::a_still_texture_takes_its_turnandguard_tests::a_changing_texture_is_hashed_at_every_frame, including frame counter wrap-around.cargo test -p victory-gpuon Windows 11 at this commit: 112 passed, 0 failed (1 ignored benchmark). No clippy warnings intexture.rs, with or without--features diagnostics.VICTORY_TEXTURE_GUARD=0stays the workaround until then.Developed with Claude Code on Claude Opus 5.5.
🤖 Generated with Claude Code
@avt0m4t48 on GitHub · 2026-11-24 23:52 UTC · original
I checked
366ccb7against2119b0ewith the exact refresh functions, real BLAKE3, and one synthetic 64 KiB file mapped at two addresses. The harness passed 6/6 on main and 8/8 on this branch with the guard both enabled and disabled. Requiring the branch's cadence on main failed.The discovery interval depends on when that slot is checked. With a slot used every third host frame, eight checks can take 24 host frames. If the old image is present at every scheduled hash, neither version enters the hot window. This is a useful control for a follow-up capture, especially given that #115 has intro results from AMD and NVIDIA using direct alias-write tracking.
Both models returned to the normal cadence once the texture settled. The harness mocked Windows guard, remap and detile operations. Game output and frame time still need a native run. Verified with Codex assistance.
@PAYS0 on GitHub · 2026-11-24 23:57 UTC · original
Thanks for running this. Pushed a follow-up (
c4dc17e): a texture's first hash no longer opens the every-frame window, so a newly read static texture is back to main's cadence; one that changes enters it at its first changed digest. The "original contents at every scheduled hash" case is unchanged, as you say; only seeing the writes catches it, which is what #115 does at the source. This PR is meant to complement that: the hash net under the guard reacts within a frame, instead of up to eight, for any write path the guard still misses. Happy to rebase on #115 or close this if the maintainer prefers.@kaayzouee on GitHub · 2026-11-25 01:21 UTC · original
Duplicate of #159?
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.