F3: a second panel, translucent bars over the picture #4541

Closed
M4gnif1cus wants to merge 2 commits from upstream-pr/4541 into main
M4gnif1cus commented 2026-11-30 22:07:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by M4gnif1cus on 2026-11-30T22:07:18Z.


Related: #3982, #4539

What it changes

F3 now cycles to the existing panel (the slim one from #4634), then to a second, more detailed one, then off. The existing panel looks and measures as before; rebased onto f5c3d243.

F3 second panel

The panel on a black background (a temporary change for this capture only), 1:35 into a session with the settings below.

  • Top: frame rate with a 30 s graph (with frame generation, the rate shown and the base rate, FG ×N), 1 % and 0.1 % lows, card, processor, RAM and VRAM, latency, what limits the frame, draw calls and draws dropped.
  • Bottom: the last 30 s of frame times, and for the session P95, P99, max, pacing, time at 30 and 60 fps, severe stutters and longest pause.
  • Only play counts: loading screens and the settling after a load are left out, and so are the title's pause, its menus, the map and the settings overlay. Those come from the title's own flags (the ones the input code already reads), so they are exact, not guessed from draw counts; paused frames stay on the graph in grey and coming back is not taken for a new load. On another build of the title the panel falls back to draw counts.
  • victory_gpu::in_play() exposes that state (Some(true) in play, Some(false) paused or in a menu, None when the flags cannot be read), so other measurements can count the same frames (see #4376). The flags are now also read with the native mouse hook off, through their own base, so the mouse code behaves as before.
  • It is painted on its own thread; the frame only records the copy and the blend. Sensors are read on another thread (NVML and system counters); anything unavailable shows "--".

A bug in the existing panel (not changed here)

While comparing the two I found that the existing panel shows the frame rate too high, about 7 % at 30 fps (see #4539). This panel does not have that error, so the two disagree until it is fixed.

  • Where: Panel::frame in crates/victory-gpu/src/host/panel.rs.
  • Why: since #2565 the window starts over whenever frames == 0, which is also true right after every report. Each window then begins at its first frame and counts it: N frames over N - 1 intervals. FRAME ... MS and the per-frame counters are divided by the same N, so they read low.
  • Fixed separately in #4695 (start over only after the panel was hidden, with a test); #4634's slim panel had kept the same check.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 5070 Ti Laptop 12 GB (driver 621.40), Core Ultra 9 275HX, 96 GB, Windows 11. Series X, 2560×1440, DLSS Performance, frame generation off, ray tracing off. Frame generation ×2 was checked on an earlier revision of this panel.
  • Before / After: all figures below are from the engine's own frame-rate line (5 s averages), not from either panel, measured on my local build of e1251c31 with this panel code (before the pause detection, which only affects paused frames), same scene, controls locked, each run started with the card at 35 °C or below.

6 minutes in one session, the two panels swapped every 20 s (the sample at each swap left out; median of 26 and 27 samples):

Existing panel This panel
Frame rate 30.0 fps 29.9 fps
Frame time 33.4 ms 33.4 ms
CPU: preparing the frame 26.5 ms 26.7 ms
of it, copies 12.2 ms 12.1 ms
of it, textures 1.2 ms 1.1 ms
Waiting on the GPU 0.2 ms 0.2 ms
Copying back 9.6 ms 9.7 ms
Draws / dropped 4,537 / 122 4,536 / 122

Card over the whole session: 70 °C, 108 W, 2,512 MHz (median).

1 minute from the start, one run each:

Existing panel No panel This panel
Frame rate 30.3 fps 29.3 fps 30.2 fps
Frame time 33.0 ms 34.1 ms 33.2 ms
CPU: preparing the frame 26.5 ms 26.9 ms 26.3 ms
of it, copies 12.1 ms 11.9 ms 12.2 ms
Waiting on the GPU 0.0 ms 0.3 ms 0.0 ms
Copying back 9.9 ms 9.4 ms 9.5 ms
Draws / dropped 4,421 / 112 4,341 / 131 4,442 / 119

No difference beyond the variation between runs (about ±1 fps here).

What this panel itself costs: on the frame thread, 12–14 µs per frame on average, 0.3–0.84 ms at most (its own counter, over about 300 frames in each run). In the capture above it reads the card 90 % busy at 102 W, CPU 29.4 ms and GPU 29.3 ms a frame, limited by the GPU.

  • For shader changes, the wave sizes tested (32 and/or 64 lanes): no changes to the shader translator
  • Pause detection checked in game: pause menu, its Game submenu and the store's offline notice are detected and drawn grey, not counted; play resumes counting at once.
  • Both panels checked in game on f5c3d243, swapping every 20 s: each draws, F3 order unchanged, no errors.
  • cargo test passed for the crates it touches: cargo test -p victory-gpu -p victory-hle (rustc 1.99.1, WARP) on f5c3d243: victory-gpu 1110 passed; victory-hle 468 passed, 1 failed (modules::xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it), which fails the same way on main without this change when the whole suite runs and passes on its own (timing). Clippy (-D warnings): the only warnings are the five main has since #4634 (font.rs 213 and 260, menu.rs .is_multiple_of(), two collapsible ifs in panel.rs's notice and advisor), none in the files this adds or in its changes.

Why it is cheap

  • Painted off the frame thread. A painter thread draws the panel twice a second with GDI (Segoe UI) and a glyph cache; the frame thread only records a copy and a blend.
  • Only what changed is uploaded. The painter compares rows and writes the changed ones straight into the upload buffer; nothing is mapped or copied on the frame thread.
  • Sensors on their own thread, every 500 ms: NVML for the card (temperature, power, clock, limits), system counters for the processor and memory. Missing values show "--" instead of blocking.
  • Scene brightness for the shade is measured on the card every 400 ms by a small compute pass; its shader compiles off the frame thread and nothing is read back to the CPU.
  • Fixed memory however long you play: session figures come from a 0.1 ms histogram, and the frame-time list is capped.
  • F3 from the window's own key messages, so a press between two frames is not lost and no extra polling is needed.
  • Nothing is drawn or measured while the panel is hidden.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3920, #3634 (panel.rs), #3982 (proposal for a new look of the overlays); replaces my closed #3229.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5574635725 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4541). Originally posted by [M4gnif1cus](https://github.com/M4gnif1cus) on 2026-11-30T22:07:18Z. --- Related: #3982, #4539 ## What it changes F3 now cycles to the existing panel (the slim one from #4634), then to a second, more detailed one, then off. The existing panel looks and measures as before; rebased onto f5c3d243. ![F3 second panel](https://raw.githubusercontent.com/M4gnif1cus/VIctory-NVIDIA/panel-f3-captura/panel-f3.png) *The panel on a black background (a temporary change for this capture only), 1:35 into a session with the settings below.* - Top: frame rate with a 30 s graph (with frame generation, the rate shown and the base rate, FG ×N), 1 % and 0.1 % lows, card, processor, RAM and VRAM, latency, what limits the frame, draw calls and draws dropped. - Bottom: the last 30 s of frame times, and for the session P95, P99, max, pacing, time at 30 and 60 fps, severe stutters and longest pause. - Only play counts: loading screens and the settling after a load are left out, and so are the title's pause, its menus, the map and the settings overlay. Those come from the title's own flags (the ones the input code already reads), so they are exact, not guessed from draw counts; paused frames stay on the graph in grey and coming back is not taken for a new load. On another build of the title the panel falls back to draw counts. - **`victory_gpu::in_play()`** exposes that state (`Some(true)` in play, `Some(false)` paused or in a menu, `None` when the flags cannot be read), so other measurements can count the same frames (see #4376). The flags are now also read with the native mouse hook off, through their own base, so the mouse code behaves as before. - It is painted on its own thread; the frame only records the copy and the blend. Sensors are read on another thread (NVML and system counters); anything unavailable shows "--". ### A bug in the existing panel (not changed here) While comparing the two I found that the existing panel shows the frame rate too high, about 7 % at 30 fps (see #4539). This panel does not have that error, so the two disagree until it is fixed. - Where: `Panel::frame` in `crates/victory-gpu/src/host/panel.rs`. - Why: since #2565 the window starts over whenever `frames == 0`, which is also true right after every report. Each window then begins at its first frame **and counts it**: N frames over N - 1 intervals. `FRAME ... MS` and the per-frame counters are divided by the same N, so they read low. - Fixed separately in #4695 (start over only after the panel was hidden, with a test); #4634's slim panel had kept the same check. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): RTX 5070 Ti Laptop 12 GB (driver 621.40), Core Ultra 9 275HX, 96 GB, Windows 11. Series X, 2560×1440, DLSS Performance, frame generation off, ray tracing off. Frame generation ×2 was checked on an earlier revision of this panel. - Before / After: all figures below are from the engine's own frame-rate line (5 s averages), not from either panel, measured on my local build of e1251c31 with this panel code (before the pause detection, which only affects paused frames), same scene, controls locked, each run started with the card at 35 °C or below. **6 minutes in one session, the two panels swapped every 20 s** (the sample at each swap left out; median of 26 and 27 samples): | | Existing panel | This panel | |---|---|---| | Frame rate | 30.0 fps | 29.9 fps | | Frame time | 33.4 ms | 33.4 ms | | CPU: preparing the frame | 26.5 ms | 26.7 ms | | of it, copies | 12.2 ms | 12.1 ms | | of it, textures | 1.2 ms | 1.1 ms | | Waiting on the GPU | 0.2 ms | 0.2 ms | | Copying back | 9.6 ms | 9.7 ms | | Draws / dropped | 4,537 / 122 | 4,536 / 122 | Card over the whole session: 70 °C, 108 W, 2,512 MHz (median). **1 minute from the start, one run each:** | | Existing panel | No panel | This panel | |---|---|---|---| | Frame rate | 30.3 fps | 29.3 fps | 30.2 fps | | Frame time | 33.0 ms | 34.1 ms | 33.2 ms | | CPU: preparing the frame | 26.5 ms | 26.9 ms | 26.3 ms | | of it, copies | 12.1 ms | 11.9 ms | 12.2 ms | | Waiting on the GPU | 0.0 ms | 0.3 ms | 0.0 ms | | Copying back | 9.9 ms | 9.4 ms | 9.5 ms | | Draws / dropped | 4,421 / 112 | 4,341 / 131 | 4,442 / 119 | No difference beyond the variation between runs (about ±1 fps here). **What this panel itself costs:** on the frame thread, 12–14 µs per frame on average, 0.3–0.84 ms at most (its own counter, over about 300 frames in each run). In the capture above it reads the card 90 % busy at 102 W, CPU 29.4 ms and GPU 29.3 ms a frame, limited by the GPU. - For shader changes, the wave sizes tested (32 and/or 64 lanes): no changes to the shader translator - Pause detection checked in game: pause menu, its Game submenu and the store's offline notice are detected and drawn grey, not counted; play resumes counting at once. - Both panels checked in game on f5c3d243, swapping every 20 s: each draws, F3 order unchanged, no errors. - `cargo test` passed for the crates it touches: `cargo test -p victory-gpu -p victory-hle` (rustc 1.99.1, WARP) on f5c3d243: victory-gpu 1110 passed; victory-hle 468 passed, 1 failed (`modules::xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_it`), which fails the same way on main without this change when the whole suite runs and passes on its own (timing). Clippy (`-D warnings`): the only warnings are the five main has since #4634 (`font.rs` 213 and 260, `menu.rs` `.is_multiple_of()`, two collapsible `if`s in `panel.rs`'s notice and advisor), none in the files this adds or in its changes. ## Why it is cheap - **Painted off the frame thread.** A painter thread draws the panel twice a second with GDI (Segoe UI) and a glyph cache; the frame thread only records a copy and a blend. - **Only what changed is uploaded.** The painter compares rows and writes the changed ones straight into the upload buffer; nothing is mapped or copied on the frame thread. - **Sensors on their own thread**, every 500 ms: NVML for the card (temperature, power, clock, limits), system counters for the processor and memory. Missing values show "--" instead of blocking. - **Scene brightness for the shade** is measured on the card every 400 ms by a small compute pass; its shader compiles off the frame thread and nothing is read back to the CPU. - **Fixed memory however long you play:** session figures come from a 0.1 ms histogram, and the frame-time list is capped. - **F3 from the window's own key messages**, so a press between two frames is not lost and no extra polling is needed. - Nothing is drawn or measured while the panel is hidden. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3920, #3634 (`panel.rs`), #3982 (proposal for a new look of the overlays); replaces my closed #3229. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
M4gnif1cus commented 2026-11-30 23:18:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by M4gnif1cus on 2026-11-30T23:18:11Z.


Update: after rebasing onto 7d93ee07, which fixes those three warnings on main, CI / check passes on this pull request.


About the failing CI / check: it stops at the first Clippy step, on three warnings in files this pull request does not touch, which main has as well:

  • crates/victory-gpu/src/host.rs:5092: manual implementation of .is_multiple_of()
  • crates/victory-gpu/src/shadow.rs:7197: method ranged is never used
  • crates/victory-shader/src/emit/lower.rs:114: field loop_caps is never read

I ran the same command locally (cargo clippy --workspace --all-targets --locked -- -D warnings) on main (e1251c31) and on this branch: both give exactly these three and nothing else, so the files this adds or changes (hud.rs, overlay.rs, panel.rs, menu.rs, streamline.rs, lifecycle.rs) pass. Other recent pull requests fail at the same step. My toolchain here is 1.99.1 (with -A deprecated for the fetch_update renames that 1.99 flags and the pinned 1.98.1 does not).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7294956676 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4541#issuecomment-7294956676). Originally posted by [M4gnif1cus](https://github.com/M4gnif1cus) on 2026-11-30T23:18:11Z. --- **Update:** after rebasing onto 7d93ee07, which fixes those three warnings on main, `CI / check` passes on this pull request. --- About the failing `CI / check`: it stops at the first Clippy step, on three warnings in files this pull request does not touch, which main has as well: - `crates/victory-gpu/src/host.rs:5092`: manual implementation of `.is_multiple_of()` - `crates/victory-gpu/src/shadow.rs:7197`: method `ranged` is never used - `crates/victory-shader/src/emit/lower.rs:114`: field `loop_caps` is never read I ran the same command locally (`cargo clippy --workspace --all-targets --locked -- -D warnings`) on main (e1251c31) and on this branch: both give exactly these three and nothing else, so the files this adds or changes (`hud.rs`, `overlay.rs`, `panel.rs`, `menu.rs`, `streamline.rs`, `lifecycle.rs`) pass. Other recent pull requests fail at the same step. My toolchain here is 1.99.1 (with `-A deprecated` for the `fetch_update` renames that 1.99 flags and the pinned 1.98.1 does not).
M4gnif1cus commented 2026-12-01 01:58:43 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by M4gnif1cus on 2026-12-01T01:58:43Z.


Rebased onto f5c3d243 after #4634: F3 now cycles #4634's slim panel, then this one, then off; both checked in game. If CI / check fails again it is at Clippy, on the five warnings main has had since #4634 (font.rs, menu.rs, panel.rs's notice and advisor), none in this pull request's changes.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7298099996 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4541#issuecomment-7298099996). Originally posted by [M4gnif1cus](https://github.com/M4gnif1cus) on 2026-12-01T01:58:43Z. --- Rebased onto f5c3d243 after #4634: F3 now cycles #4634's slim panel, then this one, then off; both checked in game. If `CI / check` fails again it is at Clippy, on the five warnings main has had since #4634 (`font.rs`, `menu.rs`, `panel.rs`'s notice and advisor), none in this pull request's changes.
trustno1-coder commented 2026-12-01 18:38:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:38:05Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321251836 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4541#issuecomment-7321251836). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:38:05Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

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
trustno1-coder/VIctory-NVIDIA!4541
No description provided.