Fix stale frames for guarded textures #32

Open
S1M40 wants to merge 2 commits from upstream-pr/32 into main
S1M40 commented 2026-11-25 04:11:29 +00:00 (Migrated from github.com)
First-time contributor

Imported from Zettrox/ztrx. Originally posted by S1M40 on 2026-11-25T04:07:10Z.


Summary

Textures in guarded view memory were hashed only once every eight frames when the guard saw no writes. Updates made through another view could therefore leave video frames stale. After a hash detects a change, this keeps checking the texture every frame for 16 frames, then returns it to the existing staggered schedule.

Related to the repeated/stale video frames in #24 and #5. This change does not claim to fix the prologue-video crash reported in #24.

Validation

  • cargo test -p victory-gpu --locked (112 passed, 1 ignored)
  • cargo test -p victory-gpu --all-features --locked (119 passed, 1 ignored)
  • cargo build --release -p victory --locked

RX 7700XT

tested in-game.

<!-- greyfinch-sync:Zettrox/ztrx:issue:6596981185 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/32). Originally posted by [S1M40](https://github.com/S1M40) on 2026-11-25T04:07:10Z. --- ## Summary Textures in guarded view memory were hashed only once every eight frames when the guard saw no writes. Updates made through another view could therefore leave video frames stale. After a hash detects a change, this keeps checking the texture every frame for 16 frames, then returns it to the existing staggered schedule. Related to the repeated/stale video frames in #24 and #5. This change does not claim to fix the prologue-video crash reported in #24. ## Validation - `cargo test -p victory-gpu --locked` (112 passed, 1 ignored) - `cargo test -p victory-gpu --all-features --locked` (119 passed, 1 ignored) - `cargo build --release -p victory --locked` RX 7700XT tested in-game.
S1M40 commented 2026-11-25 05:09:08 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by S1M40 on 2026-11-25T04:31:52Z.


Loading screen is now perfectly locked 30fps with no errors reported.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7152927070 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/32#issuecomment-7152927070). Originally posted by [S1M40](https://github.com/S1M40) on 2026-11-25T04:31:52Z. --- Loading screen is now perfectly locked 30fps with no errors reported.
pluvialmoon commented 2026-11-25 05:09:09 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by pluvialmoon on 2026-11-25T05:08:01Z.


same problem with issue5 and this PR works

<!-- greyfinch-sync:Zettrox/ztrx:comment:7153480283 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/32#issuecomment-7153480283). Originally posted by [pluvialmoon](https://github.com/pluvialmoon) on 2026-11-25T05:08:01Z. --- same problem with issue5 and this PR works
PikPakPik commented 2026-11-25 08:09:09 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by PikPakPik on 2026-11-25T07:33:41Z.

Review: APPROVED


Tested on an AMD RX 9060 XT (RDNA4, 16 GB, driver 32.0.32029.2010), Windows 11: it works.

<!-- greyfinch-sync:Zettrox/ztrx:review:6053517512 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/32#pullrequestreview-6053517512). Originally posted by [PikPakPik](https://github.com/PikPakPik) on 2026-11-25T07:33:41Z. **Review:** APPROVED --- Tested on an AMD RX 9060 XT (RDNA4, 16 GB, driver 32.0.32029.2010), Windows 11: it works.
futurepro62 commented 2026-11-25 16:13:07 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by futurepro62 on 2026-11-25T15:14:50Z.


Full-suite run on Windows, since this PR has no test report yet. Tested exact head 798ecbb (on its base 90b529f).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (rust-toolchain.toml), DXC + dxil.dll 1.9.2602.17, debug.
  • cargo test --workspace --locked: 499 passed, 0 failed, 7 ignored (main 90b529f on this machine: 492 passed, 0 failed, 7 ignored).
  • cargo clippy --workspace --all-targets --locked -- -D warnings (the CI lint step): passed.
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (the CI lint step): passed.
  • The new tests ran and passed: still_textures_take_turns_unless_the_guard_saw_a_write, recently_changed_textures_are_hashed_each_frame, a_texture_is_hashed_once_per_frame_unless_the_guard_saw_a_write.

Not tested

  • AMD (ztrx targets NVIDIA), a release build, the game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Zettrox/ztrx:comment:7166536430 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/32#issuecomment-7166536430). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T15:14:50Z. --- Full-suite run on Windows, since this PR has no test report yet. Tested exact head `798ecbb` (on its base `90b529f`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (`rust-toolchain.toml`), DXC + dxil.dll 1.9.2602.17, debug. - `cargo test --workspace --locked`: **499 passed, 0 failed, 7 ignored** (main `90b529f` on this machine: 492 passed, 0 failed, 7 ignored). - `cargo clippy --workspace --all-targets --locked -- -D warnings` (the CI lint step): passed. - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (the CI lint step): passed. - The new tests ran and passed: `still_textures_take_turns_unless_the_guard_saw_a_write`, `recently_changed_textures_are_hashed_each_frame`, `a_texture_is_hashed_once_per_frame_unless_the_guard_saw_a_write`. **Not tested** - AMD (ztrx targets NVIDIA), a release build, the game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/32:upstream-pr/32'
git switch 'upstream-pr/32'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/32'
git switch 'upstream-pr/32'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/32'
git switch 'upstream-pr/32'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/32'
git switch 'main'
git merge --squash 'upstream-pr/32'
git switch 'main'
git merge --ff-only 'upstream-pr/32'
git switch 'main'
git merge 'upstream-pr/32'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Zettrox/ztrx!32
No description provided.