GPU: diagnostics builds log the title's asks for frame statistics #166

Closed
github-bot wants to merge 1 commit from github-bot/gh-166 into main AGit
Owner

@⁠illuminatedfellow on GitHub · 2026-11-25 18:13 UTC · original
illuminatedfellow:gpu/frame-statistics-probe → main · +44 −3 · 1 files · 1 commits · closed without merging

What

One commit, crates/victory-gpu/src/frame.rs only, 44 lines added:

  • The device's frame statistics method (slot 81, 0x288) still returns none: the count is set to 0 and the output is not touched.
  • Diagnostics builds log its 1st, 2nd, 4th, 8th... call at info level. Each line has the token, the kinds, the count the title passed in, whether it gave an output buffer, and our frame number:
    frame statistics asked for (none returned) call=… token=… kinds=… asked=… out=… frame=…
  • Every build counts the calls with one relaxed atomic add. Nothing else changes in a release build.
  • A test, statistics_return_none_and_are_counted, checks S_OK, a count of 0, an output buffer left as it was, a call with null pointers, and the counting.

Why

statistics is a stub here, upstream, in fxceless/victory-fork and in myokex/victory-amd. What its output records hold is not known, so nothing can be written there safely. Whether the title calls it at all is not known either.

One diagnostics run in the world answers that:

  • If it never logs: the title does not use the statistics, and the stub is fine.
  • If it does: the log shows how often and with what count and kinds. That is where to start if the title's pacing or frame timing turns out to depend on them.

This is meant as a small, safe first step. It does not change what the title sees.

Tested

  • Linux, Rust 1.98.1: the three frame:: tests pass, with and without --features diagnostics. (victory-gpu builds on Linux only with the two gates in my other PR, #165. They were applied for the test run and are not part of this branch.)
  • cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc, with and without --all-features: nothing new. The only warning in frame.rs is the unused wait at line 156, which is on main too.
  • Windows, GitHub Actions on my fork: the Windows job on this branch stops at Clippy, as on main. On a fork-only branch where clippy does not stop the job, cargo test --workspace gave: victory-gpu 113 passed, 0 failed, 4 ignored (this includes frame::tests::statistics_return_none_and_are_counted), core 11, formats 24, game 2, the app 1. It then stopped at the five xmem tests in victory-hle that fail on main too (#2, #8), so the crates after it did not run on Windows; this change does not touch them. The run is main plus #3's clippy fix, both of my PRs, and clippy set not to stop the job.
  • In the game: not by me (I have no Windows machine here). KernelSmoker ran it; see below.

frame.rs is also touched by #52, #103 and #154 (a lint attribute, a timing hook in wait and a test assertion). If one of them merges first, this needs at most a small rebase.

Run in the game

KernelSmoker ran a diagnostics build of 91ded33 for 60 seconds (their comment). Their setup was GE-Proton 10-34 / Wine 10.0 on Bazzite Linux 45 with an RTX 3090, a x86_64-pc-windows-gnu build, native d3d12,d3d12core,dxgi overrides, VICTORY_COPY_MEMORY=1, VICTORY_SPARSE=0 and --console series-x.

  • The title asks for statistics once per frame, from frame 5 on: call n comes at frame n + 4, up to call 4096 at frame 4100.
  • Each time it asks about the frame four before the current one: token = frame - 4.
  • The arguments never change: kinds=69888 (0x11100), asked=6 and a non-null output buffer.
  • With none returned, the title kept running through about 6,900 presented frames.
  • The three frame:: tests also passed there, with --features diagnostics, under Wine.

This is startup and menus, under Proton on NVIDIA. Gameplay in the world, native Windows and AMD were not covered.

What this suggests, not proven: 0x11100 reads as three 4-bit fields set to 1 at bits 8, 12 and 16, which could be the three event kinds (origin, vblank, flip). If so, asked=6 could be two records per kind. Filling the records stays a separate change, once their layout is known.

**@⁠illuminatedfellow** on GitHub · 2026-11-25 18:13 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/166) `illuminatedfellow:gpu/frame-statistics-probe` → `main` · +44 −3 · 1 files · 1 commits · closed without merging ## What One commit, `crates/victory-gpu/src/frame.rs` only, 44 lines added: - The device's frame statistics method (slot 81, `0x288`) still returns none: the count is set to 0 and the output is not touched. - Diagnostics builds log its 1st, 2nd, 4th, 8th... call at info level. Each line has the token, the kinds, the count the title passed in, whether it gave an output buffer, and our frame number: `frame statistics asked for (none returned) call=… token=… kinds=… asked=… out=… frame=…` - Every build counts the calls with one relaxed atomic add. Nothing else changes in a release build. - A test, `statistics_return_none_and_are_counted`, checks `S_OK`, a count of 0, an output buffer left as it was, a call with null pointers, and the counting. ## Why `statistics` is a stub here, upstream, in fxceless/victory-fork and in myokex/victory-amd. What its output records hold is not known, so nothing can be written there safely. Whether the title calls it at all is not known either. One diagnostics run in the world answers that: - **If it never logs:** the title does not use the statistics, and the stub is fine. - **If it does:** the log shows how often and with what count and kinds. That is where to start if the title's pacing or frame timing turns out to depend on them. This is meant as a small, safe first step. It does not change what the title sees. ## Tested - Linux, Rust 1.98.1: the three `frame::` tests pass, with and without `--features diagnostics`. (`victory-gpu` builds on Linux only with the two gates in my other PR, #165. They were applied for the test run and are not part of this branch.) - `cargo clippy -p victory-gpu --all-targets --target x86_64-pc-windows-msvc`, with and without `--all-features`: nothing new. The only warning in `frame.rs` is the unused `wait` at line 156, which is on `main` too. - Windows, GitHub Actions on my fork: the Windows job on this branch stops at Clippy, as on `main`. On a fork-only branch where clippy does not stop the job, `cargo test --workspace` gave: `victory-gpu` 113 passed, 0 failed, 4 ignored (this includes `frame::tests::statistics_return_none_and_are_counted`), core 11, formats 24, game 2, the app 1. It then stopped at the five `xmem` tests in `victory-hle` that fail on `main` too (#2, #8), so the crates after it did not run on Windows; this change does not touch them. [The run](https://github.com/illuminatedfellow/VIctory-Belobug-AMD/actions/runs/45671735105) is `main` plus #3's clippy fix, both of my PRs, and clippy set not to stop the job. - **In the game**: not by me (I have no Windows machine here). KernelSmoker ran it; see below. `frame.rs` is also touched by #52, #103 and #154 (a lint attribute, a timing hook in `wait` and a test assertion). If one of them merges first, this needs at most a small rebase. ## Run in the game KernelSmoker ran a diagnostics build of `91ded33` for 60 seconds ([their comment](https://git.gtahub.st/github/Belobug--VIctory-Belobug-AMD/pulls/166)). Their setup was GE-Proton 10-34 / Wine 10.0 on Bazzite Linux 45 with an RTX 3090, a `x86_64-pc-windows-gnu` build, native `d3d12,d3d12core,dxgi` overrides, `VICTORY_COPY_MEMORY=1`, `VICTORY_SPARSE=0` and `--console series-x`. - The title asks for statistics **once per frame**, from frame 5 on: call *n* comes at frame *n* + 4, up to call 4096 at frame 4100. - Each time it asks about the frame four before the current one: `token = frame - 4`. - The arguments never change: `kinds=69888` (`0x11100`), `asked=6` and a non-null output buffer. - With none returned, the title kept running through about 6,900 presented frames. - The three `frame::` tests also passed there, with `--features diagnostics`, under Wine. This is startup and menus, under Proton on NVIDIA. Gameplay in the world, native Windows and AMD were not covered. What this suggests, not proven: `0x11100` reads as three 4-bit fields set to 1 at bits 8, 12 and 16, which could be the three event kinds (origin, vblank, flip). If so, `asked=6` could be two records per kind. Filling the records stays a separate change, once their layout is known.
The device's frame statistics method returns none (the count is set to
0): what its output records hold is not known, so nothing can be
written there safely. Whether the title asks at all, and for what, was
not known either.

Diagnostics builds now log the 1st, 2nd, 4th, 8th... call at info level
with its token, kinds, the count the title passed in, whether it gave
an output buffer, and our frame number. One run in the world says
whether the title reads these statistics and how often, before anyone
works out the records.

Every build counts the calls (one relaxed atomic add); nothing else
changes: the count is still set to 0 and the records are not touched.
A test checks both, and that calls are counted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:03 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 18:36 UTC · original

Ran the diagnostics build of PR head 91ded33 (cargo build --profile diag -p victory --features diagnostics --locked --target x86_64-pc-windows-gnu, Rust 1.98.1) under GE-Proton 10-34 / Wine 10.0 on Bazzite Linux 45 (NVIDIA RTX 3090, native d3d12,d3d12core,dxgi=n overrides, VICTORY_COPY_MEMORY=1, VICTORY_SPARSE=0, --console series-x).

Unit tests (Windows GNU target under Wine)

  • victory_gpu ... frame:: --nocapture (with --features diagnostics): 3 passed, 0 failed (statistics_return_none_and_are_counted, waits_begun_together_take_different_ticks, waits_end_on_ticks_and_count_frames).
  • cargo check --workspace --all-targets --all-features --locked --target x86_64-pc-windows-gnu: passed with no new warnings in frame.rs.

60-second diagnostics run (startup / presentation frames)

The title does call frame::statistics once per frame starting at frame=5, consistently querying token = frame - 4 with kinds=69888 (0x11100), asked=6, and a non-null output buffer (out=true). The run reached presentation frame ~6896 (last frame presented power-of-two line at frame=4096; interactive in-world gameplay was not verified).

Captured frame statistics asked for lines:

2026-11-25T18:34:34.875441Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=1 token=1 kinds=69888 asked=6 out=true frame=5
2026-11-25T18:34:34.890174Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=2 token=2 kinds=69888 asked=6 out=true frame=6
2026-11-25T18:34:34.914732Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=4 token=4 kinds=69888 asked=6 out=true frame=8
2026-11-25T18:34:34.949674Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=8 token=8 kinds=69888 asked=6 out=true frame=12
2026-11-25T18:34:35.015734Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=16 token=16 kinds=69888 asked=6 out=true frame=20
2026-11-25T18:34:35.153067Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=32 token=32 kinds=69888 asked=6 out=true frame=36
2026-11-25T18:34:35.424525Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=64 token=64 kinds=69888 asked=6 out=true frame=68
2026-11-25T18:34:35.974211Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=128 token=128 kinds=69888 asked=6 out=true frame=132
2026-11-25T18:34:37.041017Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=256 token=256 kinds=69888 asked=6 out=true frame=260
2026-11-25T18:34:39.313256Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=512 token=512 kinds=69888 asked=6 out=true frame=516
2026-11-25T18:34:59.481405Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=1024 token=1024 kinds=69888 asked=6 out=true frame=1028
2026-11-25T18:35:04.506376Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=2048 token=2048 kinds=69888 asked=6 out=true frame=2052
2026-11-25T18:35:14.435615Z  INFO victory_gpu::frame: frame statistics asked for (none returned) call=4096 token=4096 kinds=69888 asked=6 out=true frame=4100

No game files or crash dumps are attached.

**@⁠KernelSmoker** on GitHub · 2026-11-25 18:36 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/166#issuecomment-7171140425) Ran the diagnostics build of PR head `91ded33` (`cargo build --profile diag -p victory --features diagnostics --locked --target x86_64-pc-windows-gnu`, Rust 1.98.1) under GE-Proton 10-34 / Wine 10.0 on Bazzite Linux 45 (NVIDIA RTX 3090, native `d3d12,d3d12core,dxgi=n` overrides, `VICTORY_COPY_MEMORY=1`, `VICTORY_SPARSE=0`, `--console series-x`). ### Unit tests (Windows GNU target under Wine) - `victory_gpu ... frame:: --nocapture` (with `--features diagnostics`): **3 passed, 0 failed** (`statistics_return_none_and_are_counted`, `waits_begun_together_take_different_ticks`, `waits_end_on_ticks_and_count_frames`). - `cargo check --workspace --all-targets --all-features --locked --target x86_64-pc-windows-gnu`: passed with no new warnings in `frame.rs`. ### 60-second diagnostics run (startup / presentation frames) The title **does** call `frame::statistics` once per frame starting at `frame=5`, consistently querying `token = frame - 4` with `kinds=69888` (`0x11100`), `asked=6`, and a non-null output buffer (`out=true`). The run reached presentation frame ~6896 (last `frame presented` power-of-two line at `frame=4096`; interactive in-world gameplay was not verified). Captured `frame statistics asked for` lines: ```text 2026-11-25T18:34:34.875441Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=1 token=1 kinds=69888 asked=6 out=true frame=5 2026-11-25T18:34:34.890174Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=2 token=2 kinds=69888 asked=6 out=true frame=6 2026-11-25T18:34:34.914732Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=4 token=4 kinds=69888 asked=6 out=true frame=8 2026-11-25T18:34:34.949674Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=8 token=8 kinds=69888 asked=6 out=true frame=12 2026-11-25T18:34:35.015734Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=16 token=16 kinds=69888 asked=6 out=true frame=20 2026-11-25T18:34:35.153067Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=32 token=32 kinds=69888 asked=6 out=true frame=36 2026-11-25T18:34:35.424525Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=64 token=64 kinds=69888 asked=6 out=true frame=68 2026-11-25T18:34:35.974211Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=128 token=128 kinds=69888 asked=6 out=true frame=132 2026-11-25T18:34:37.041017Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=256 token=256 kinds=69888 asked=6 out=true frame=260 2026-11-25T18:34:39.313256Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=512 token=512 kinds=69888 asked=6 out=true frame=516 2026-11-25T18:34:59.481405Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=1024 token=1024 kinds=69888 asked=6 out=true frame=1028 2026-11-25T18:35:04.506376Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=2048 token=2048 kinds=69888 asked=6 out=true frame=2052 2026-11-25T18:35:14.435615Z INFO victory_gpu::frame: frame statistics asked for (none returned) call=4096 token=4096 kinds=69888 asked=6 out=true frame=4100 ``` No game files or crash dumps are attached.
Author
Owner

@⁠illuminatedfellow on GitHub · 2026-11-25 19:03 UTC · original

Thank you for running it. This answers the question the PR asked: the title asks for statistics every frame from frame 5 on, about the frame four before the current one (token = frame - 4), always with kinds=0x11100 and room for 6 records, and it keeps running with none returned. I'll add your results to the description, noting they are from Proton on NVIDIA and from startup and menus, not the world.

**@⁠illuminatedfellow** on GitHub · 2026-11-25 19:03 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/166#issuecomment-7171765134) Thank you for running it. This answers the question the PR asked: the title asks for statistics every frame from frame 5 on, about the frame four before the current one (`token = frame - 4`), always with `kinds=0x11100` and room for 6 records, and it keeps running with none returned. I'll add your results to the description, noting they are from Proton on NVIDIA and from startup and menus, not the world.
github-bot closed this pull request 2026-11-26 16:05:09 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.