GPU: keep rechecking heap textures known to change in place #396

Open
github-bot wants to merge 1 commit from github-bot/gh-396 into a-publier AGit
Owner

@⁠iliyabeacon on GitHub · 2026-11-26 23:42 UTC · original
iliyabeacon:fix/recheck-changing-heap-textures → a-publier · +112 −48 · 2 files · 1 commits · open

Relates to #337.

A heap texture whose contents already changed without a descriptor notification now keeps its final 400-frame recheck interval. Textures with no observed in-place change still leave the queue after the fifth unchanged check. Rewriting the descriptor resets the tracking and discards recheck results for the previous write.

This covers the late-change case for textures that were observed changing during their original recheck window. The existing sampled fingerprint still limits which changes can be detected.

Validation

  • The scheduling test covers the existing backoff, retirement of unchanged textures, and repeated quiet checks for a known-changing texture.
  • The queue test covers the due frame, descriptor replacement, and a delayed result for the old write.

Tested on Windows with Rust 1.98.1 (x86_64-pc-windows-gnu).

  • cargo test --offline --locked -p victory-gpu --lib -- --test-threads=1 passed (398 passed, 34 ignored).
  • cargo test --offline --locked -p victory-gpu --features diagnostics --lib recheck -- --test-threads=1 passed (2 passed).
  • The standalone scheduling test failed as expected when the old retirement behavior was restored.

An in-game visual comparison and performance measurement remain to be done.

**@⁠iliyabeacon** on GitHub · 2026-11-26 23:42 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/396) `iliyabeacon:fix/recheck-changing-heap-textures` → `a-publier` · +112 −48 · 2 files · 1 commits · open Relates to #337. A heap texture whose contents already changed without a descriptor notification now keeps its final 400-frame recheck interval. Textures with no observed in-place change still leave the queue after the fifth unchanged check. Rewriting the descriptor resets the tracking and discards recheck results for the previous write. This covers the late-change case for textures that were observed changing during their original recheck window. The existing sampled fingerprint still limits which changes can be detected. ## Validation - The scheduling test covers the existing backoff, retirement of unchanged textures, and repeated quiet checks for a known-changing texture. - The queue test covers the due frame, descriptor replacement, and a delayed result for the old write. Tested on Windows with Rust 1.98.1 (x86_64-pc-windows-gnu). - `cargo test --offline --locked -p victory-gpu --lib -- --test-threads=1` passed (398 passed, 34 ignored). - `cargo test --offline --locked -p victory-gpu --features diagnostics --lib recheck -- --test-threads=1` passed (2 passed). - The standalone scheduling test failed as expected when the old retirement behavior was restored. An in-game visual comparison and performance measurement remain to be done.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:59:08 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 01:23 UTC · original

Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At bab2d75: cargo test --release -p victory-gpu --lib 398 passed, 0 failed, 34 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 01:23 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/396#issuecomment-7207244407) Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At `bab2d75`: `cargo test --release -p victory-gpu --lib` 398 passed, 0 failed, 34 ignored. AI-assisted (Claude Code); no game data.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-27 12:32 UTC · original

Tested on an RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 build 26300, Rust 1.98.1. Head bab2d75 vs base 4eb6cfd (a-publier), in release and in the diag profile with --features diagnostics.

  • victory-gpu --lib, release: head 398 passed, 0 failed, 34 ignored. Base: 396 passed. Same at default threads and with --test-threads=1. The only per-test difference is the 2 new tests.
  • Diag + diagnostics, --test-threads=1: head 446 passed, base 444 passed. Both fail the same test, timeline::report::tests::real_waits_are_recorded_with_who_ended_them (report.rs:950). It fails on base too, so it does not come from this PR.
  • Coverage gap: I made a variant where TextureQueue::checked ignores write and the draw pass never sets changed_in_place. Both new tests still pass, and so does the full release lib suite (398 passed, 0 failed). The host test's final None check still holds, because recheck already drops the stale write and written() resets the slot. So no test covers the write filter in checked, or the pass setting changed_in_place.
  • cargo clippy --workspace --all-targets -- -D warnings is clean, with default features and with --all-features.
  • cargo fmt --check already fails on base (142 files), and head has the same file count. The new one-line texture_slot_recheck signature in descriptor/host.rs and the TextureRecheck destructuring in draw.rs go over the 100-column limit.

Not tested: in game.

**@⁠adrianmjim** on GitHub · 2026-11-27 12:32 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/396#issuecomment-7218363210) Tested on an RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 build 26300, Rust 1.98.1. Head `bab2d75` vs base `4eb6cfd` (a-publier), in release and in the diag profile with `--features diagnostics`. - `victory-gpu --lib`, release: head 398 passed, 0 failed, 34 ignored. Base: 396 passed. Same at default threads and with `--test-threads=1`. The only per-test difference is the 2 new tests. - Diag + diagnostics, `--test-threads=1`: head 446 passed, base 444 passed. Both fail the same test, `timeline::report::tests::real_waits_are_recorded_with_who_ended_them` (report.rs:950). It fails on base too, so it does not come from this PR. - Coverage gap: I made a variant where `TextureQueue::checked` ignores `write` and the draw pass never sets `changed_in_place`. Both new tests still pass, and so does the full release lib suite (398 passed, 0 failed). The host test's final `None` check still holds, because `recheck` already drops the stale write and `written()` resets the slot. So no test covers the write filter in `checked`, or the pass setting `changed_in_place`. - `cargo clippy --workspace --all-targets -- -D warnings` is clean, with default features and with `--all-features`. - `cargo fmt --check` already fails on base (142 files), and head has the same file count. The new one-line `texture_slot_recheck` signature in descriptor/host.rs and the `TextureRecheck` destructuring in draw.rs go over the 100-column limit. Not tested: in game.
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 14:34 UTC · original · reviewed

AI-assisted static review (ChatGPT); I did not run tests.

**@⁠gut0to** on GitHub · 2026-11-27 14:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/396#pullrequestreview-6089710138) · **reviewed** AI-assisted static review (ChatGPT); I did not run tests.
@ -2481,0 +2506,4 @@
fingerprint: crate::texture::fingerprint(address, bytes),
unchanged_looks: 0,
uploaded: frame,
changed_in_place,
Author
Owner

@⁠gut0to on GitHub · 2026-11-27 14:34 UTC · original

The new tests cover the scheduling helper and descriptor-write identity separately, but not the State path that sets and carries changed_in_place through a fingerprint mismatch and its next recheck. If this flag is lost when the slot is rescheduled, periodic checks stop after the initial windows while the current tests still pass. Could you add a focused regression for mismatch → reschedule → unchanged follow-up, and verify the flag is cleared only when the descriptor is rewritten?

**@⁠gut0to** on GitHub · 2026-11-27 14:34 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/396#discussion_r4720629467) The new tests cover the scheduling helper and descriptor-write identity separately, but not the `State` path that sets and carries `changed_in_place` through a fingerprint mismatch and its next recheck. If this flag is lost when the slot is rescheduled, periodic checks stop after the initial windows while the current tests still pass. Could you add a focused regression for mismatch → reschedule → unchanged follow-up, and verify the flag is cleared only when the descriptor is rewritten?
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/396/head:github-bot/gh-396'
git switch 'github-bot/gh-396'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-396'
git switch 'github-bot/gh-396'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-396'
git switch 'github-bot/gh-396'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-396'
git switch 'a-publier'
git merge --squash 'github-bot/gh-396'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-396'
git switch 'a-publier'
git merge 'github-bot/gh-396'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.