GPU: keep textures the title rewrites in place in step (TV and phone video) #390

Open
Ahmet-Dedeler wants to merge 1 commit from upstream-pr/390 into main
Ahmet-Dedeler commented 2026-11-26 22:19:57 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by Ahmet-Dedeler on 2026-11-26T22:19:57Z.


The TV news in the game showed a colour ghost of the frame before (the reporter's arm and head in pink beside him). This fixes it.

The video planes are title textures the CPU rewrites in place: luma 2048x1088 (2,228,224 bytes) and chroma 1024x544 (557,056 bytes). The texture pass rechecks a texture 4, 12, 40, 120 and 400 frames after its upload. One found changed is looked at again the next frame, but a single unchanged look puts it back on that schedule. And a look only reads three 16 KiB strips (start, middle, end), which in a news shot are mostly still background. So each plane went stale on its own count. In my log the "changed after its upload" warning showed looks=1 with frames_after_upload 12 to 44, and the screen mixed one video frame's luma with another's chroma.

The change:

  • a slot found changed after its upload is marked live in the texture queue
  • a live slot is looked at every frame and fingerprinted whole (up to 4 MiB), so a change between the three strips is seen
  • after 120 unchanged looks in a row (the screen is off) it goes back to the normal schedule
  • VICTORY_LIVE_TEXTURES=0 turns it off

Rechecks are already served ahead of fresh slots on main, so nothing changes in the order. In my session about 25 slots went live (8 luma, 17 chroma planes), around 27 MB of reads a frame for the fingerprints.

Tested:

  • In game on an M5 Max (CrossOver + D3DMetal, Series S mode), on a Mac branch built on your main from 25 Nov: the ghost was gone in the same scene. The Mac branch keys this differently, so this PR is the same change written for current main. I have not run it in game on Windows.
  • New unit test for the live flag in the texture queue. It and the existing queue tests pass (victory-gpu lib tests under CrossOver). The tests that fail there (argument clamp, the indirect host-list tests, ambient and lightprobe pass builds, two view tests) fail the same way on main without this change.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings reports nothing new. Its two errors (list.rs totals, watch.rs open) are on main too.
<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:5517926279 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/390). Originally posted by [Ahmet-Dedeler](https://github.com/Ahmet-Dedeler) on 2026-11-26T22:19:57Z. --- The TV news in the game showed a colour ghost of the frame before (the reporter's arm and head in pink beside him). This fixes it. The video planes are title textures the CPU rewrites in place: luma 2048x1088 (2,228,224 bytes) and chroma 1024x544 (557,056 bytes). The texture pass rechecks a texture 4, 12, 40, 120 and 400 frames after its upload. One found changed is looked at again the next frame, but a single unchanged look puts it back on that schedule. And a look only reads three 16 KiB strips (start, middle, end), which in a news shot are mostly still background. So each plane went stale on its own count. In my log the "changed after its upload" warning showed `looks=1` with `frames_after_upload` 12 to 44, and the screen mixed one video frame's luma with another's chroma. The change: - a slot found changed after its upload is marked live in the texture queue - a live slot is looked at every frame and fingerprinted whole (up to 4 MiB), so a change between the three strips is seen - after 120 unchanged looks in a row (the screen is off) it goes back to the normal schedule - `VICTORY_LIVE_TEXTURES=0` turns it off Rechecks are already served ahead of fresh slots on main, so nothing changes in the order. In my session about 25 slots went live (8 luma, 17 chroma planes), around 27 MB of reads a frame for the fingerprints. Tested: - In game on an M5 Max (CrossOver + D3DMetal, Series S mode), on a Mac branch built on your main from 25 Nov: the ghost was gone in the same scene. The Mac branch keys this differently, so this PR is the same change written for current main. I have not run it in game on Windows. - New unit test for the live flag in the texture queue. It and the existing queue tests pass (`victory-gpu` lib tests under CrossOver). The tests that fail there (argument clamp, the indirect host-list tests, ambient and lightprobe pass builds, two view tests) fail the same way on main without this change. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` reports nothing new. Its two errors (`list.rs` `totals`, `watch.rs` `open`) are on main too.
akimfomin commented 2026-11-26 23:41:18 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by akimfomin on 2026-11-26T23:41:18Z.


The full fingerprint sees changes between strips once a texture is live. On a89d392, I added a synthetic 1024×544 byte plane and changed only bytes 64–68 KiB. The existing non-live fingerprint stayed identical and the live fingerprint changed. The focused Windows test passed. Function tested · Promotion check uses was_live.

One useful negative control: begin with a plain queue slot and repeatedly change only a gap between the sampled strips, then check whether it ever becomes live. This would tell us whether that class needs a bounded initial full check or an explicit source hint. It does not contradict the Mac result or reproduce the video's appearance on Windows. PortBridge · AI-assisted test report.

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:comment:7205762082 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/390#issuecomment-7205762082). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-26T23:41:18Z. --- The full fingerprint sees changes between strips once a texture is live. On `a89d392`, I added a synthetic 1024×544 byte plane and changed only bytes 64–68 KiB. The existing non-live fingerprint stayed identical and the live fingerprint changed. The focused Windows test passed. [Function tested](https://github.com/avatarmanz/VIctory-7900XTX/blob/a89d3921b9a43330a744a769085077941c3758c0/crates/victory-gpu/src/texture.rs#L1581-L1635) · [Promotion check uses `was_live`](https://github.com/avatarmanz/VIctory-7900XTX/blob/a89d3921b9a43330a744a769085077941c3758c0/crates/victory-gpu/src/draw.rs#L2519-L2547). One useful negative control: begin with a plain queue slot and repeatedly change only a gap between the sampled strips, then check whether it ever becomes live. This would tell us whether that class needs a bounded initial full check or an explicit source hint. It does not contradict the Mac result or reproduce the video's appearance on Windows. [PortBridge](https://github.com/akimfomin/PortBridge) · AI-assisted test report.
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/390:upstream-pr/390'
git switch 'upstream-pr/390'

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/390'
git switch 'upstream-pr/390'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/390'
git switch 'upstream-pr/390'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/390'
git switch 'main'
git merge --squash 'upstream-pr/390'
git switch 'main'
git merge --ff-only 'upstream-pr/390'
git switch 'main'
git merge 'upstream-pr/390'
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
avatarmanz/VIctory-7900XTX!390
No description provided.