fix(gpu): average copy statistics over the full reporting interval #87

Merged
jeremygold02 merged 1 commit from upstream-pr/87 into main 2026-11-24 07:48:47 +00:00
jeremygold02 commented 2026-11-24 00:21:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T00:21:43Z.


The frame-rate meter updates about once a second. The detailed copy counters accumulate until they are logged about every five seconds. Dividing those counters by the last frame-rate sample inflated the reported submissions, copied bytes and time spent checking for writes per frame.

Count presentations across the full copy-statistics interval and reset that count when the logger drains the counters. The change is confined to diagnostics builds.

Verification

  • Exercised the real meter and copy-counter drain with 50 copies across successive windows of two and three presentations. The baseline reported 16.67 copies per frame (50 / 3). The change reported 10 (50 / 5), including on 35b054e.
  • A saved trace showed five presentations between two reports and one in the final frame-rate sample. The old log reported 178 submissions per frame for that interval. The full-interval average is 35.6.
  • cargo check --locked -p victory-gpu passed with and without --features diagnostics on Windows.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6571701363 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/87). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T00:21:43Z. --- The frame-rate meter updates about once a second. The detailed copy counters accumulate until they are logged about every five seconds. Dividing those counters by the last frame-rate sample inflated the reported submissions, copied bytes and time spent checking for writes per frame. Count presentations across the full copy-statistics interval and reset that count when the logger drains the counters. The change is confined to diagnostics builds. **Verification** - Exercised the real meter and copy-counter drain with 50 copies across successive windows of two and three presentations. The baseline reported 16.67 copies per frame (50 / 3). The change reported 10 (50 / 5), including on `35b054e`. - A saved trace showed five presentations between two reports and one in the final frame-rate sample. The old log reported 178 submissions per frame for that interval. The full-interval average is 35.6. - `cargo check --locked -p victory-gpu` passed with and without `--features diagnostics` on Windows.
DaviTostes commented 2026-11-24 06:54:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T01:14:08Z.


Tested b304b7d with the diagnostics feature on the Windows build under Wine 11.22 + vkd3d-proton 3.1 (Arch Linux x86_64, AMD RX 9060 XT, RADV 26.3.1), with a native Microsoft d3dcompiler_47: pass, no regression.

  • victory_gpu (diagnostics): 38 passed, 2 failed — the two environment-only failures (a_rejected_blob_gives_an_empty_library, and #128's upload skip).
  • Built with --features diagnostics; the diff adds no test, so this only shows nothing else broke.

No game data used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7118896411 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/87#issuecomment-7118896411). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T01:14:08Z. --- Tested `b304b7d` with the **diagnostics** feature on the Windows build under **Wine 11.22 + vkd3d-proton 3.1** (Arch Linux x86_64, AMD RX 9060 XT, RADV 26.3.1), with a native Microsoft `d3dcompiler_47`: **pass, no regression**. - `victory_gpu` (diagnostics): **38 passed, 2 failed** — the two environment-only failures (`a_rejected_blob_gives_an_empty_library`, and #128's upload skip). - Built with `--features diagnostics`; the diff adds no test, so this only shows nothing else broke. No game data used.
mercuryVM commented 2026-11-24 07:04:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T07:04:09Z.

Review: APPROVED


Tested b304b7d on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (227 passed, 0 failed; the branch is based on an old main). cargo check -p victory-gpu --features diagnostics is clean.

  • The fix is right. copystat::log drains counters gathered over about 5 s, so it must divide by the presentations in that same window, not by the last 1 s frame-rate sample. copy_stats_frames counts every frame() call and is reset by mem::take exactly when the counters are drained.
  • It is a diagnostics-only field and code path. Release builds are unchanged.

The branch is far behind main, and host.rs has changed a lot since, so it may need a rebase before it merges.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035010957 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/87#pullrequestreview-6035010957). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T07:04:09Z. **Review:** APPROVED --- Tested b304b7d on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (227 passed, 0 failed; the branch is based on an old main). `cargo check -p victory-gpu --features diagnostics` is clean. - The fix is right. `copystat::log` drains counters gathered over about 5 s, so it must divide by the presentations in that same window, not by the last 1 s frame-rate sample. `copy_stats_frames` counts every `frame()` call and is reset by `mem::take` exactly when the counters are drained. - It is a diagnostics-only field and code path. Release builds are unchanged. The branch is far behind main, and `host.rs` has changed a lot since, so it may need a rebase before it merges. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-24 08:01:47 +00:00
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
Marvisak/VIctory!87
No description provided.