GPU: the present logs what the title presents whenever it changes #834

Open
KyleS98 wants to merge 3 commits from upstream-pr/835 into main
KyleS98 commented 2026-11-25 09:52:49 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-25T09:52:49Z.


The present now logs what the title presents, whenever that changes: the number of planes, the first plane's resources, and the format and size of the resource we show (the first plane's first resource). It's an info line on victory_gpu::queue, a few lines a run, in release and diagnostics builds alike.

Asked for in #798, where one RTX 4070 SUPER shows a black screen on the Series S profile while a 3090 Ti and a 5070 Ti show the world. Comparing this line between machines tells whether the title hands us something different to present.

RUST_LOG=warn,victory_gpu::queue=info
what the title presents changed (we show the first plane's first resource) frame=1 planes=2 resources=1 format=28 width=1920 height=1080

format=-1 means the first plane has no resource, or we hold no host copy of it.

Tested

RTX 3090 Ti, Windows 11, diag build of this branch (9376fd6 plus this commit), --console series-s, 150 s run: the line above at frame 1, no other change in that run, no crash. The same commit on a tree with more changes logged the same single line across an 8-minute run (cutscene, cell, corridor). cargo clippy -p victory-gpu adds no warnings.

🤖 Generated with Claude Code

<!-- greyfinch-sync:fxceless/victory-fork:issue:6601761221 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/835). Originally posted by [KyleS98](https://github.com/KyleS98) on 2026-11-25T09:52:49Z. --- The present now logs what the title presents, whenever that changes: the number of planes, the first plane's resources, and the format and size of the resource we show (the first plane's first resource). It's an `info` line on `victory_gpu::queue`, a few lines a run, in release and diagnostics builds alike. Asked for in #798, where one RTX 4070 SUPER shows a black screen on the Series S profile while a 3090 Ti and a 5070 Ti show the world. Comparing this line between machines tells whether the title hands us something different to present. ``` RUST_LOG=warn,victory_gpu::queue=info what the title presents changed (we show the first plane's first resource) frame=1 planes=2 resources=1 format=28 width=1920 height=1080 ``` `format=-1` means the first plane has no resource, or we hold no host copy of it. ### Tested RTX 3090 Ti, Windows 11, diag build of this branch (9376fd6 plus this commit), `--console series-s`, 150 s run: the line above at frame 1, no other change in that run, no crash. The same commit on a tree with more changes logged the same single line across an 8-minute run (cutscene, cell, corridor). `cargo clippy -p victory-gpu` adds no warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MamaLeVrai commented 2026-11-25 13:06:01 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by MamaLeVrai on 2026-11-25T12:23:55Z.


Test report: this PR's head (76de854) no longer merges into main f85101b (RX 6950 XT machine; a trial merge): conflict in crates/victory-gpu/src/queue.rs. I did not resolve it. No game data.

AI-assisted (Claude Code); no game data.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7162318721 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/835#issuecomment-7162318721). Originally posted by [MamaLeVrai](https://github.com/MamaLeVrai) on 2026-11-25T12:23:55Z. --- Test report: this PR's head (`76de854`) no longer merges into `main` `f85101b` (RX 6950 XT machine; a trial merge): conflict in `crates/victory-gpu/src/queue.rs`. I did not resolve it. No game data. AI-assisted (Claude Code); no game data.
DoubleD17 commented 2026-11-25 21:05:39 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by DoubleD17 on 2026-11-25T20:37:39Z.

Review: COMMENTED


Please skip present_shape before it does any work when this INFO event is disabled. In 873ce1b0d97d558c50c6d380428cf367f957934b the hook runs on every Windows present, including those queued by send_behind. The event is filtered only after the resource lookup, GetDesc, and the global LAST mutex. Present path

host_resource is a stateful lookup. It takes the resource lock and refreshes last-use bookkeeping for a resolved texture, and it may create the host copy. The ordinary present paths already look up the resource. Gate the entire hook with an INFO event-enabled check for the queue target, and consider reusing the resource selected by the ordinary present path when collecting its description. This is a static finding. Frame-time impact was not measured. Resource lookup ┬╖ Last-use update

AI-assisted.

<!-- greyfinch-sync:fxceless/victory-fork:review:6064635190 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/835#pullrequestreview-6064635190). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-25T20:37:39Z. **Review:** COMMENTED --- Please skip `present_shape` before it does any work when this INFO event is disabled. In `873ce1b0d97d558c50c6d380428cf367f957934b` the hook runs on every Windows present, including those queued by `send_behind`. The event is filtered only after the resource lookup, `GetDesc`, and the global `LAST` mutex. [Present path](https://github.com/fxceless/victory-fork/blob/873ce1b0d97d558c50c6d380428cf367f957934b/crates/victory-gpu/src/queue.rs#L1372-L1436) `host_resource` is a stateful lookup. It takes the resource lock and refreshes last-use bookkeeping for a resolved texture, and it may create the host copy. The ordinary present paths already look up the resource. Gate the entire hook with an INFO event-enabled check for the queue target, and consider reusing the resource selected by the ordinary present path when collecting its description. This is a static finding. Frame-time impact was not measured. [Resource lookup](https://github.com/fxceless/victory-fork/blob/873ce1b0d97d558c50c6d380428cf367f957934b/crates/victory-gpu/src/resource.rs#L2011-L2027) ┬╖ [Last-use update](https://github.com/fxceless/victory-fork/blob/873ce1b0d97d558c50c6d380428cf367f957934b/crates/victory-gpu/src/resource.rs#L1384-L1391) AI-assisted.
KyleS98 commented 2026-11-26 08:04:55 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by KyleS98 on 2026-11-26T07:11:03Z.


@DoubleD17 done in 3fd42b6: present_shape now returns before it looks anything up unless the INFO event is enabled (tracing::enabled!), so at the default log level the present path does nothing new: no resource lookup, no GetDesc, no lock. I left the hook finding the resource itself instead of taking it from the ordinary present path, so that it stays one piece that can be removed; with the gate that second lookup only happens in runs that asked for the line.

@MamaLeVrai thanks for the merge check. The branch is merged up to main 46bf535 and no longer conflicts.

Checked on an RTX 3090 Ti, Series S profile, 270 s from boot into the prologue with victory_gpu::queue=info: the line is written once (frame=1 planes=2 resources=1 format=28 width=1920 height=1080), no crash, no device loss.

AI-assisted (Claude Code, Claude Fable 5.2).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7185183458 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/835#issuecomment-7185183458). Originally posted by [KyleS98](https://github.com/KyleS98) on 2026-11-26T07:11:03Z. --- @DoubleD17 done in `3fd42b6`: `present_shape` now returns before it looks anything up unless the INFO event is enabled (`tracing::enabled!`), so at the default log level the present path does nothing new: no resource lookup, no `GetDesc`, no lock. I left the hook finding the resource itself instead of taking it from the ordinary present path, so that it stays one piece that can be removed; with the gate that second lookup only happens in runs that asked for the line. @MamaLeVrai thanks for the merge check. The branch is merged up to `main` `46bf535` and no longer conflicts. Checked on an RTX 3090 Ti, Series S profile, 270 s from boot into the prologue with `victory_gpu::queue=info`: the line is written once (`frame=1 planes=2 resources=1 format=28 width=1920 height=1080`), no crash, no device loss. AI-assisted (Claude Code, Claude Fable 5.2).
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/835:upstream-pr/835'
git switch 'upstream-pr/835'

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