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

Open
github-bot wants to merge 1 commit from github-bot/gh-390 into main AGit
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-26 22:19 UTC · original
Ahmet-Dedeler:live-video-textures → main · +160 −14 · 3 files · 1 commits · open

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.
**@⁠Ahmet-Dedeler** on GitHub · 2026-11-26 22:19 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/390) `Ahmet-Dedeler:live-video-textures` → `main` · +160 −14 · 3 files · 1 commits · open 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.
A TV's news video is a set of title textures the CPU rewrites in place:
a 1080p video's luma plane (2048x1088 bytes) and chroma planes
(1024x544). After a look that found a plane unchanged, the next look
backed off to 12, 40, 120 frames, and a look reads only three 16 KiB
strips of a 2 MB plane, which are often still background in a news shot.
Each plane went stale on its own count (12 to 44 frames late in one log),
so the screen showed one video frame's luma under another's chroma: a
colour ghost of the picture before.

A slot found changed after its upload with nothing to tell of it is now
live: 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 plain looks. Rechecks are
already served ahead of fresh slots. VICTORY_LIVE_TEXTURES=0 turns it off.

Seen on macOS (M5 Max, CrossOver, D3DMetal): the ghost on the TV news
was gone with this on, same scene. The texture queue logic is the same on
every platform.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:56:28 +00:00
Author
Owner

@⁠akimfomin on GitHub · 2026-11-26 23:41 UTC · original

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.

**@⁠akimfomin** on GitHub · 2026-11-26 23:41 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/390#issuecomment-7205762082) 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 can be merged automatically.
This branch is out-of-date with the base branch
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/390/head:github-bot/gh-390'
git switch 'github-bot/gh-390'

Merge

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