The opening video plays frame by frame: textures the guards cannot see change are hashed at every check, and frames get their statistics #602

Open
lukkasremondi wants to merge 2 commits from upstream-pr/602 into main
lukkasremondi commented 2026-11-25 02:57:39 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by lukkasremondi on 2026-11-25T02:57:39Z.


The Rockstar intro video played at 30 fps but stuttered, going back and forth. Fifty consecutive presented frames (300–349, saved with VICTORY_CAPTURE_FRAMES on a diagnostics build and hashed) cycled through three pictures, A B C A B C …, and one of the three was replaced by a new picture every eight frames: the title keeps three video frames in turn, and each reached the card eight frames late.

Why. The video's planes are placed textures in view memory that the title writes through another view, so the read-only guards never see a write to them. Such a texture is then hashed on its turn only, every eighth frame (HASH_EVERY, the textures taking turns to keep the cost down). Diagnostics in the video show it: textures 0.0 MB watched and changed, 1.6 MB hashed, 1.6 MB of them changed per frame, i.e. every hash of these textures finds them changed.

What changes

  • crates/victory-gpu/src/texture.rs: a texture whose hash found it changed is hashed at the next check too, and so on while it keeps changing (Last::changing, hash_due); once a hash finds it unchanged it is back to its turn. Textures that do not change cost what they did; the video's three planes come up every frame (their hashing was already paid, in turns). Unit test hash_due_tests.
  • crates/victory-gpu/src/frame.rs, queue.rs: GetFrameStatisticsX answers. The title asks after every present when the frame began and when it was flipped (kind=0x11100, room for 6 records); the clock said "no statistics" every time. It now keeps the last sixteen tokens' origin (when the origin wait handed the token out) and flip (the PresentX naming it), as the performance counter reads, and answers one record { u32 kind; …; i64 origin @0x10; i64 flip @0x18 } for a flipped frame, E_FAIL with none for a frame not flipped, E_INVALIDARG with no room. This alone did not change the video (measured: same cycle with it), but it is what the console gives the title; the record layout is as other layers report it. Unit test in frame::tests.

Tested — Windows 10 22H2 (19045), NVIDIA GeForce RTX 3080 10 GB, AMD Ryzen 5 1600, 16 GB; release and --profile diag builds, on 2119b0e plus upstream Marvisak/VIctory#175 for the Agility SDK (as PR #22 does); the branch is rebased on a803c87; VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024, no relay.

  • Before: frames 300–349 held three distinct pictures in a period-3 cycle (13 of 49 presented frames identical to the one before them in a run, the rest alternating among the three); a new picture entered every 8 frames.
  • After: the intro plays through smoothly by eye, confirmed on two separate runs of the fixed release build (the capture of the fixed build was closed before frame 300; numbers to follow if wanted).
  • cargo test -p victory-gpu --lib -- frame::tests hash_due_tests: 3 passed.
  • Menus and the prologue as before (3–5 fps, no device loss).

No game files, images or dumps are included. AI-assisted: Claude Code with Claude Fable 5.1 wrote the analysis scripts, the change and this description; the runs and the visual confirmation are mine.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6596161351 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/602). Originally posted by [lukkasremondi](https://github.com/lukkasremondi) on 2026-11-25T02:57:39Z. --- The Rockstar intro video played at 30 fps but stuttered, going back and forth. Fifty consecutive presented frames (300–349, saved with `VICTORY_CAPTURE_FRAMES` on a diagnostics build and hashed) cycled through three pictures, A B C A B C …, and one of the three was replaced by a new picture every eight frames: the title keeps three video frames in turn, and each reached the card eight frames late. **Why.** The video's planes are placed textures in view memory that the title writes through another view, so the read-only guards never see a write to them. Such a texture is then hashed on its turn only, every eighth frame (`HASH_EVERY`, the textures taking turns to keep the cost down). Diagnostics in the video show it: `textures 0.0 MB watched and changed, 1.6 MB hashed, 1.6 MB of them changed` per frame, i.e. every hash of these textures finds them changed. **What changes** - `crates/victory-gpu/src/texture.rs`: a texture whose hash found it changed is hashed at the next check too, and so on while it keeps changing (`Last::changing`, `hash_due`); once a hash finds it unchanged it is back to its turn. Textures that do not change cost what they did; the video's three planes come up every frame (their hashing was already paid, in turns). Unit test `hash_due_tests`. - `crates/victory-gpu/src/frame.rs`, `queue.rs`: `GetFrameStatisticsX` answers. The title asks after every present when the frame began and when it was flipped (`kind=0x11100`, room for 6 records); the clock said "no statistics" every time. It now keeps the last sixteen tokens' origin (when the origin wait handed the token out) and flip (the `PresentX` naming it), as the performance counter reads, and answers one record `{ u32 kind; …; i64 origin @0x10; i64 flip @0x18 }` for a flipped frame, `E_FAIL` with none for a frame not flipped, `E_INVALIDARG` with no room. This alone did not change the video (measured: same cycle with it), but it is what the console gives the title; the record layout is as other layers report it. Unit test in `frame::tests`. **Tested** — Windows 10 22H2 (19045), NVIDIA GeForce RTX 3080 10 GB, AMD Ryzen 5 1600, 16 GB; release and `--profile diag` builds, on `2119b0e` plus upstream Marvisak/VIctory#175 for the Agility SDK (as PR #22 does); the branch is rebased on `a803c87`; `VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024`, no relay. - Before: frames 300–349 held three distinct pictures in a period-3 cycle (13 of 49 presented frames identical to the one before them in a run, the rest alternating among the three); a new picture entered every 8 frames. - After: the intro plays through smoothly by eye, confirmed on two separate runs of the fixed release build (the capture of the fixed build was closed before frame 300; numbers to follow if wanted). - `cargo test -p victory-gpu --lib -- frame::tests hash_due_tests`: 3 passed. - Menus and the prologue as before (3–5 fps, no device loss). No game files, images or dumps are included. AI-assisted: Claude Code with Claude Fable 5.1 wrote the analysis scripts, the change and this description; the runs and the visual confirmation are mine. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
LeonardoS11 commented 2026-11-25 04:11:20 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by LeonardoS11 on 2026-11-25T03:21:46Z.


Tried on an RTX 3080 Ti, where the opening video had the same back-and-forth.

  • Windows 11, RTX 3080 Ti 12 GB, 64 GB RAM, diag build with diagnostics; main at c96b4f2 with this PR's two commits cherry-picked (no conflict), no environment switches — so with main's current defaults (the copy-back thread and late wait on), not the no-relay setup of the description.
  • cargo test -p victory-gpu --lib -- frame::tests hash_due_tests: 3 passed.
  • By eye, one run with the video left to play through (no input for 100 s): clearly better, most of the video now plays in order; a few scenes still go back and forth. I would put it at about nine tenths fixed. Before the PR the whole video did it.

Not checked: which scenes are left and whether they go with main's new defaults (the present as a flight) rather than with the texture hashing — I can run it again with VICTORY_RELAY=0 and with captured frames hashed the way the description did, if that helps.

(Run and the observation by me on the hardware above; this note written with Claude Code.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7151843220 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/602#issuecomment-7151843220). Originally posted by [LeonardoS11](https://github.com/LeonardoS11) on 2026-11-25T03:21:46Z. --- Tried on an RTX 3080 Ti, where the opening video had the same back-and-forth. - Windows 11, RTX 3080 Ti 12 GB, 64 GB RAM, `diag` build with `diagnostics`; `main` at c96b4f2 with this PR's two commits cherry-picked (no conflict), no environment switches — so with `main`'s current defaults (the copy-back thread and late wait on), not the no-relay setup of the description. - `cargo test -p victory-gpu --lib -- frame::tests hash_due_tests`: 3 passed. - By eye, one run with the video left to play through (no input for 100 s): clearly better, most of the video now plays in order; **a few scenes still go back and forth**. I would put it at about nine tenths fixed. Before the PR the whole video did it. Not checked: which scenes are left and whether they go with `main`'s new defaults (the present as a flight) rather than with the texture hashing — I can run it again with `VICTORY_RELAY=0` and with captured frames hashed the way the description did, if that helps. (Run and the observation by me on the hardware above; this note written with Claude Code.)
LeonardoS11 commented 2026-11-25 05:09:00 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by LeonardoS11 on 2026-11-25T04:34:29Z.


Follow-up on the same RTX 3080 Ti, now on top of main at 310c6eb.

  • 310c6eb with this PR's two commits (in a branch that also carries #186 and some opt-in diagnostics of ours, all off; no environment switches): the opening video played through in order, start to end. No scene went back and forth.
  • Plain 310c6eb, same machine, same night, run right after: the video goes back and forth again.

So here the fix is this PR, not something that came with the newer main, and the "few scenes left" I reported on c96b4f2 are gone on this base. One run each, judged by eye.

(Runs and the observation by me on the hardware above; this note written with Claude Code.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7152967917 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/602#issuecomment-7152967917). Originally posted by [LeonardoS11](https://github.com/LeonardoS11) on 2026-11-25T04:34:29Z. --- Follow-up on the same RTX 3080 Ti, now on top of `main` at 310c6eb. - 310c6eb with this PR's two commits (in a branch that also carries #186 and some opt-in diagnostics of ours, all off; no environment switches): the opening video played through in order, start to end. No scene went back and forth. - Plain 310c6eb, same machine, same night, run right after: the video goes back and forth again. So here the fix is this PR, not something that came with the newer `main`, and the "few scenes left" I reported on c96b4f2 are gone on this base. One run each, judged by eye. (Runs and the observation by me on the hardware above; this note written with Claude Code.)
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/602:upstream-pr/602'
git switch 'upstream-pr/602'

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/602'
git switch 'upstream-pr/602'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/602'
git switch 'upstream-pr/602'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/602'
git switch 'main'
git merge --squash 'upstream-pr/602'
git switch 'main'
git merge --ff-only 'upstream-pr/602'
git switch 'main'
git merge 'upstream-pr/602'
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
fxceless/victory-fork!602
No description provided.