fix(gpu): verify moved-texture bytes before keeping old slot view (VICTORY_KEEP_SHOWN=checked) #280

Merged
Mikey970 merged 1 commit from upstream-pr/280 into main 2026-11-28 19:39:39 +00:00
Mikey970 commented 2026-11-27 20:40:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Mikey970 on 2026-11-27T20:40:24Z.


Problem

With VICTORY_KEEP_SHOWN=1, a descriptor slot rewritten with a texture of the same format and size at a different address (Kin::Moved) keeps showing the old texture until the new upload runs. That is right when the title moves a texture, but wrong when the streamer reuses a slot for a different texture of the same dimensions/format (e.g. an albedo where a mask or another character's map lived): the surface displays garbage/rainbow-noise texels in the G-buffer albedo until the upload finishes (reproducible on faces during the opening cutscene).

Fix

  • Adds VICTORY_KEEP_SHOWN=checked (opt-in; existing numeric 0/1/2 defaults unchanged).
  • On Kin::Moved, kept_meanwhile compares the first and last 4 KiB (or the whole buffer under 8 KiB) via crate::host::read_into. If both ends match, the old texture stays; if they differ or either address is unreadable, the slot falls back to the neutral texture until the new upload completes.
  • Extends the existing 5,000-rewrite log line with checked-kept vs checked-neutral counts.

Testing

  • Added unit test descriptor::host::bake_flip_tests::a_moved_texture_is_kept_only_with_the_same_ends (passed via cargo test -p victory-gpu).
  • Validated in-game on opening-cutscene captures: eliminated rainbow-noise face corruption with no measurable frame-time regression.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5532818626 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/280). Originally posted by [Mikey970](https://github.com/Mikey970) on 2026-11-27T20:40:24Z. --- ## Problem With `VICTORY_KEEP_SHOWN=1`, a descriptor slot rewritten with a texture of the same format and size at a different address (`Kin::Moved`) keeps showing the old texture until the new upload runs. That is right when the title moves a texture, but wrong when the streamer reuses a slot for a *different* texture of the same dimensions/format (e.g. an albedo where a mask or another character's map lived): the surface displays garbage/rainbow-noise texels in the G-buffer albedo until the upload finishes (reproducible on faces during the opening cutscene). ## Fix - Adds `VICTORY_KEEP_SHOWN=checked` (opt-in; existing numeric `0`/`1`/`2` defaults unchanged). - On `Kin::Moved`, `kept_meanwhile` compares the first and last 4 KiB (or the whole buffer under 8 KiB) via `crate::host::read_into`. If both ends match, the old texture stays; if they differ or either address is unreadable, the slot falls back to the neutral texture until the new upload completes. - Extends the existing 5,000-rewrite log line with checked-kept vs checked-neutral counts. ## Testing - Added unit test `descriptor::host::bake_flip_tests::a_moved_texture_is_kept_only_with_the_same_ends` (passed via `cargo test -p victory-gpu`). - Validated in-game on opening-cutscene captures: eliminated rainbow-noise face corruption with no measurable frame-time regression.
cloph-dsp commented 2026-11-28 02:52:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cloph-dsp on 2026-11-28T02:52:47Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #280 at head 48ff43c458d0659698fcb62d51f1d5a7d7727bdc, base (single-commit parent) f3534e6b09f113e369c3ade2a13ff3d711ce0cf1.
  • cargo test --locked -p victory-gpu --lib -- descriptor::host::bake_flip_tests::a_moved_texture_is_kept_only_with_the_same_ends --exact --test-threads=1 --quiet → 1 passed, 0 failed, 459 filtered, exit 0.
  • git grep -F for the test name on the base returned no hits (test is new on this PR); git diff --check f3534e6 HEAD clean (1 file, +109/-12).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2.
  • Only the named synthetic test (pure same_ends slice comparison, no GPU) was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). Pre-existing compiler warnings present.
  • GPU/driver: N/A (CPU-only). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232652107 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/280#issuecomment-7232652107). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T02:52:47Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #280 at head `48ff43c458d0659698fcb62d51f1d5a7d7727bdc`, base (single-commit parent) `f3534e6b09f113e369c3ade2a13ff3d711ce0cf1`. - `cargo test --locked -p victory-gpu --lib -- descriptor::host::bake_flip_tests::a_moved_texture_is_kept_only_with_the_same_ends --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 459 filtered, exit 0. - `git grep -F` for the test name on the base returned no hits (test is new on this PR); `git diff --check f3534e6 HEAD` clean (1 file, +109/-12). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`. - Only the named synthetic test (pure `same_ends` slice comparison, no GPU) was replayed; full workspace suite and clippy were not run locally (no clippy component on this toolchain). Pre-existing compiler warnings present. - GPU/driver: N/A (CPU-only). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
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
trustno1-coder/VIctory-NVIDIA!280
No description provided.