A performance panel on screen: FPS, frame times, GPU/CPU load, VRAM and RAM #57

Manually merged
github merged 6 commits from github-bot/gh-57 into main 2026-11-26 20:10:21 +00:00 AGit
Owner

@⁠TaynanGT on GitHub · 2026-11-26 19:52 UTC · original
TaynanGT:feat/perf-panel → main · +1007 −157 · 9 files · 6 commits · merged 2026-11-26 19:58 UTC

A performance panel in the top-left corner, on by default, so clips and screenshots show what the build runs at, at what resolution and on what PC: FPS (coloured against the target), frame time with a graph, 1% low and worst frame, draws per frame, GPU name and load, VRAM (with what the layer itself holds), CPU name with per-core bars, the game's RAM and the PC's. F3 hides it; scripts\play.ps1 -NoPanel starts without it.

  • The HUD is Belo's, from Belobug/VIctory-Belobug-AMD (commit authored by beloooo).
  • GPU load comes from Windows' "GPU Engine" counters for this process on the game's adapter, the busiest engine, as Task Manager shows it. The panel labels it APP; when Windows has no sample it falls back to an estimate from the queue's idle time, labelled EST.
  • The panel's upload buffers are not reused while the GPU still reads them.
  • The panel exists in diagnostics builds, the default of play.ps1 and of every measurement in the README.

Checked: ci-local.ps1 (clippy both ways, tests, xtask) green together with #55; a Series S run with the panel on screen on the RTX 4090: 22 fps, GPU APP 87%, readings matching the log.

🤖 Generated with Claude Code

Series S gameplay clip

Series S gameplay on an RTX 4090 with the performance panel visible.

https://github.com/user-attachments/assets/bd07891c-c53f-4f46-9b7e-80463c379b84

**@⁠TaynanGT** on GitHub · 2026-11-26 19:52 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/57) `TaynanGT:feat/perf-panel` → `main` · +1007 −157 · 9 files · 6 commits · merged 2026-11-26 19:58 UTC A performance panel in the top-left corner, on by default, so clips and screenshots show what the build runs at, at what resolution and on what PC: FPS (coloured against the target), frame time with a graph, 1% low and worst frame, draws per frame, GPU name and load, VRAM (with what the layer itself holds), CPU name with per-core bars, the game's RAM and the PC's. F3 hides it; `scripts\play.ps1 -NoPanel` starts without it. - The HUD is Belo's, from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD) (commit authored by beloooo). - GPU load comes from Windows' "GPU Engine" counters for this process on the game's adapter, the busiest engine, as Task Manager shows it. The panel labels it `APP`; when Windows has no sample it falls back to an estimate from the queue's idle time, labelled `EST`. - The panel's upload buffers are not reused while the GPU still reads them. - The panel exists in diagnostics builds, the default of `play.ps1` and of every measurement in the README. Checked: `ci-local.ps1` (clippy both ways, tests, xtask) green together with #55; a Series S run with the panel on screen on the RTX 4090: 22 fps, GPU `APP 87%`, readings matching the log. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ### Series S gameplay clip Series S gameplay on an RTX 4090 with the performance panel visible. https://github.com/user-attachments/assets/bd07891c-c53f-4f46-9b7e-80463c379b84
A failed call leaves the table (release runs its provider's cleanup while
the block is still the title's) before its status shows. XAsyncGetStatus
with wait found no call in that gap and returned E_PENDING at once; the
test run_returns_the_work_result caught it now and then on CI. The wait
now also holds while no call is in flight and the status still reads
pending, which ends as soon as the status is published (or the call
being begun enters the table).

A test stalls a failed completion after its cleanup and checks the wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
views_off_their_elements_get_a_copy_of_their_bytes put its views 8 bytes
into a page of a heap allocation. Their copy is the 4 MiB window around
them, and when that page was 1 in 57 the structured view's offset in the
window fell on its 456-byte elements, so it rightly needed no copy of its
own and the test failed (twice on CI today). The offset is now picked off
that grid.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From Belobug/VIctory-Belobug-AMD e9428969 ("RX 9070 XT fixes & HUD ported
onto upstream c9c932c"), the panel part: host/panel.rs as it stands on
a-publier, and the VRAM breakdown it reads (shadow::vram_breakdown, with
the count of by-address arenas placed on the card).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clips and screenshots of a run then carry the frame rate and frame
times, the resolution, the GPU and CPU with their load, and the VRAM and
RAM the game uses. F3 still hides it while playing. The README's option
table says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The GPU figure was the frame time minus the queue's idle counter, an
estimate rather than a reading. A thread
now samples PDH's "GPU Engine" counters once a second for this process on
the game's adapter and shows the busiest engine, as Task Manager does. The
panel labels the figure APP when it comes from Windows and EST when it
falls back to the estimate. The adapter LUID in the counter names is upper
case hex, so the prefix is matched ignoring case.

The panel's upload buffers are not reused while the GPU still reads them:
with all four in flight the last panel stays on screen, and a resize frees
the old set once its fence has passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The panel only exists in diagnostics builds, so the VRAM breakdown it reads
is compiled with it. The NtQuerySystemInformation pointer's transmute names
both function types, as clippy asks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:54:28 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 19:52 UTC · original · edited 2026-11-26 19:55 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T19:54:40.364101Z 5963f41 PR opened
🔒 Security Review ✅ Completed 2026-11-26T19:55:58.528168Z 5963f41 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 19:52 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/57#issuecomment-7202054909) · edited 2026-11-26 19:55 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"5963f41556a228d06e67149242c4e34a1a6a9c37","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":"5963f41556a228d06e67149242c4e34a1a6a9c37","has_any_findings":null,"has_unresolved_findings":null,"status":"completed"}} --> <!-- codex-security-review:v1 {"blockingSeverityThreshold":"P0","headSha":"5963f41556a228d06e67149242c4e34a1a6a9c37","mergeGateEnabled":false,"pullRequestNumber":57,"repository":"TaynanGT/Vice-Tay","status":"completed"} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-26T19:54:40.364101Z">2026-11-26T19:54:40.364101Z</relative-time> | `5963f41` | PR opened | | 🔒 **Security Review** | ✅ **Completed** <relative-time datetime="2026-11-26T19:55:58.528168Z">2026-11-26T19:55:58.528168Z</relative-time> | `5963f41` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
github manually merged commit a7e664b978 into main 2026-11-26 20:10:21 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 19:54 UTC · original · reviewed

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5963f41556

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback".

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 19:54 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/57#pullrequestreview-6079827934) · **reviewed** <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `5963f41556` <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@⁠codex address that feedback". </details>
@ -385,0 +911,4 @@
&buffers.card,
D3D12_RESOURCE_STATE_COPY_SOURCE,
D3D12_RESOURCE_STATE_COPY_DEST,
)]);
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-26 19:54 UTC · original

P2 Badge Account for buffer decay before refreshing the panel

On every HUD refresh after the first upload, this barrier assumes the card buffer remains in COPY_SOURCE from the previous presentation. D3D12 buffers decay to COMMON when their ExecuteCommandLists operation completes, even after explicit transitions, so buffers.uploaded does not establish the resource's current state. Consequently, the next refresh records a mismatched StateBefore, producing resource-state validation errors when the D3D12 debug layer is enabled. Remove this inter-submission barrier and allow promotion from COMMON to COPY_DEST, while retaining the transition between the upload and texture copy within the current submission.

Useful? React with 👍 / 👎.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-26 19:54 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/57#discussion_r4712860532) **<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Account for buffer decay before refreshing the panel** On every HUD refresh after the first upload, this barrier assumes the card buffer remains in `COPY_SOURCE` from the previous presentation. D3D12 buffers decay to `COMMON` when their `ExecuteCommandLists` operation completes, even after explicit transitions, so `buffers.uploaded` does not establish the resource's current state. Consequently, the next refresh records a mismatched `StateBefore`, producing resource-state validation errors when the D3D12 debug layer is enabled. Remove this inter-submission barrier and allow promotion from `COMMON` to `COPY_DEST`, while retaining the transition between the upload and texture copy within the current submission. Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
@ -385,0 +911,4 @@
&buffers.card,
D3D12_RESOURCE_STATE_COPY_SOURCE,
D3D12_RESOURCE_STATE_COPY_DEST,
)]);
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-26 20:03 UTC · original

I checked five separate upload and copy submissions with GPU-based validation enabled. On both the RTX 4090 and the Radeon iGPU, the submitted bytes matched on every iteration and there were zero D3D12 errors, both with the existing barrier and with implicit promotion.

Buffers do decay to COMMON between submissions. The D3D12 documentation also allows a promotable state such as COPY_SOURCE as StateBefore on a resource in COMMON. Removing the barrier would save work, but the existing transition is valid for this buffer.

**@⁠TaynanGT** on GitHub · 2026-11-26 20:03 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/57#discussion_r4712921484) I checked five separate upload and copy submissions with GPU-based validation enabled. On both the RTX 4090 and the Radeon iGPU, the submitted bytes matched on every iteration and there were zero D3D12 errors, both with the existing barrier and with implicit promotion. Buffers do decay to `COMMON` between submissions. [The D3D12 documentation](https://learn.microsoft.com/en-us/windows/win32/direct3d12/using-resource-barriers-to-synchronize-resource-states-in-direct3d-12#performance-implications) also allows a promotable state such as `COPY_SOURCE` as `StateBefore` on a resource in `COMMON`. Removing the barrier would save work, but the existing transition is valid for this buffer.
This discussion has been locked. Commenting is limited to contributors.
No description provided.