Skip to content

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 into
fxceless:mainfrom
lukkasremondi:intro-video-textures
Open

lukkasremondi wants to merge 2 commits into
fxceless:mainfrom
lukkasremondi:intro-video-textures

Conversation

@lukkasremondi

Copy link
Copy Markdown

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

lukka and others added 2 commits November 24, 2026 21:34
The title asks after every present when the frame it presented began and
when it was flipped; the clock answered "no statistics" every time. The
opening video then showed three frames in turn, each kept for eight
frames (captured frames 300-329 cycled through three images, one of them
replaced every eight frames): the player seems to release a video buffer
only once its frame is reported flipped, or after a time-out.

The clock now keeps the last sixteen tokens' origins (taken when the
origin wait hands the token out) and flips (taken at the PresentX that
names the token), as the performance counter reads, and answers one
record `{ kind; ...; origin @0x10; flip @0x18 }` for a flipped frame,
E_FAIL with no record for one not flipped yet, E_INVALIDARG with no room.
The record's layout is the console's, as other layers report it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The opening video showed its frames in turn, three at a time, each kept
for eight frames (captured frames 300-349: three pictures cycling, one of
them replaced every eight frames). Its planes are placed textures in view
memory that the title writes through another view, so the read-only
guards never see a write, and such a texture is hashed only on its turn,
every eighth frame (the textures taking turns to keep the cost down).

A texture whose hash found it changed is now hashed at the next check
too, and so on while it keeps changing; once a hash finds it unchanged it
is back to its turn. The video's three planes then come up every frame
(diagnostics: 1.6 MB hashed and changed per frame already, now every
frame instead of per turn); textures that do not change cost the same as
before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@LeonardoS11

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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 Speed up tiled texture copies with fixed-size chunks #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.)

RENOxDECEPTION added a commit to RENOxDECEPTION/victory-fork that referenced this pull request Nov 25, 2026
…e (textures the guards cannot see change are hashed at every check; frame statistics)
RENOxDECEPTION added a commit to RENOxDECEPTION/victory-fork that referenced this pull request Nov 25, 2026
…k while it changes (the intro video no longer steps back)

# Conflicts:
#	crates/victory-gpu/src/queue.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants