feat(victory-gpu): emit one-second FPS line on stdout #385

Merged
Lewandox merged 2 commits from upstream-pr/385 into main 2026-11-26 17:29:14 +00:00
Lewandox commented 2026-11-26 14:45:59 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-26T14:45:59Z.


Summary

Addresses the finding noted in docs/rust-full-status.md ("VIctory writes fps only to its window title. A stdout fps line in VIctory would let both launchers show it"):

  • Emit a compact, flushed, one-second FPS line on stdout (victory fps: {fps:.1} fps, {ms:.1} ms/frame, {draws:.0} draws/frame) from the existing victory-caption background thread in third_party/victory/crates/victory-gpu/src/host.rs, so Presenter::frame never blocks on a full stdout pipe and broken-pipe errors are safely ignored (unlike println!).
  • Enabled by default and opt-out via VICTORY_FPS_STDOUT=0 (matching VICTORY_OVERLAY=0).
  • Guard against non-finite or negative metrics via format_stdout_fps.
  • Add unit tests in host::stdout_fps_tests covering env parsing, formatting, non-finite/negative rejection, and newline-terminated flushing output.

Verification

  • cargo test -p victory-gpu --lib stdout_fps_tests (default features): 4 passed, 0 failed
  • cargo test -p victory-gpu --features diagnostics --lib stdout_fps_tests: 4 passed, 0 failed
  • cargo xtask policy (in third_party/victory): asset policy: 213 files ok
<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:6629119295 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/385). Originally posted by [Lewandox](https://github.com/Lewandox) on 2026-11-26T14:45:59Z. --- ## Summary Addresses the finding noted in `docs/rust-full-status.md` ("VIctory writes fps only to its window title. A stdout fps line in VIctory would let both launchers show it"): - Emit a compact, flushed, one-second FPS line on `stdout` (`victory fps: {fps:.1} fps, {ms:.1} ms/frame, {draws:.0} draws/frame`) from the existing `victory-caption` background thread in `third_party/victory/crates/victory-gpu/src/host.rs`, so `Presenter::frame` never blocks on a full stdout pipe and broken-pipe errors are safely ignored (unlike `println!`). - Enabled by default and opt-out via `VICTORY_FPS_STDOUT=0` (matching `VICTORY_OVERLAY=0`). - Guard against non-finite or negative metrics via `format_stdout_fps`. - Add unit tests in `host::stdout_fps_tests` covering env parsing, formatting, non-finite/negative rejection, and newline-terminated flushing output. ## Verification - `cargo test -p victory-gpu --lib stdout_fps_tests` (default features): 4 passed, 0 failed - `cargo test -p victory-gpu --features diagnostics --lib stdout_fps_tests`: 4 passed, 0 failed - `cargo xtask policy` (in `third_party/victory`): `asset policy: 213 files ok`
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
LooperSalty/AnyXboxX!385
No description provided.