feat(victory): frame-rate counter at the top left of the game window #225

Merged
LooperSalty merged 1 commit from upstream-pr/225 into main 2026-11-25 19:09:30 +00:00
LooperSalty commented 2026-11-25 18:57:29 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-25T18:57:29Z.


Change

A frame-rate counter in large bold text at the top left of the game window, asked by the maintainer to follow fps while playing.

  • third_party/victory/crates/victory-gpu/src/fps_overlay.rs: ported from rorodev6/victory 4ddc0c1 (GPL-3.0-or-later). A layered, click-through, top-most window on its own thread reads the frames presented every 250 ms and shows the rate over the last second. No frame time, nothing drawn into the title's picture, no GPU work.
  • Changes from the source: reads our queue::presented() counter; the character height is configurable with VICTORY_FPS_OVERLAY_SIZE=<pixels> (default 54, bounded 16-240) and the window scales with it. VICTORY_FPS_OVERLAY=0 hides it.
  • Started next to the "presenting to a window" log line in host.rs; module registered in lib.rs (Windows only).
  • THIRD_PARTY.md: rorodev6/victory added to the sources of third_party/victory (rule 10).

Verification

  • cargo build --profile diag -p victory --features diagnostics (third_party/victory): OK.
  • cargo test -p victory-gpu --features diagnostics fps_overlay: 2 passed (size parsing and bounds, window scaling). They fail without the port.
  • Tried in game by the maintainer after merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwHrL4tW8PW9t9yQ4GbErX

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:6611542205 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-25T18:57:29Z. --- ## Change A frame-rate counter in large bold text at the top left of the game window, asked by the maintainer to follow fps while playing. - `third_party/victory/crates/victory-gpu/src/fps_overlay.rs`: ported from rorodev6/victory `4ddc0c1` (GPL-3.0-or-later). A layered, click-through, top-most window on its own thread reads the frames presented every 250 ms and shows the rate over the last second. No frame time, nothing drawn into the title's picture, no GPU work. - Changes from the source: reads our `queue::presented()` counter; the character height is configurable with `VICTORY_FPS_OVERLAY_SIZE=<pixels>` (default 54, bounded 16-240) and the window scales with it. `VICTORY_FPS_OVERLAY=0` hides it. - Started next to the "presenting to a window" log line in `host.rs`; module registered in `lib.rs` (Windows only). - `THIRD_PARTY.md`: rorodev6/victory added to the sources of `third_party/victory` (rule 10). ## Verification - `cargo build --profile diag -p victory --features diagnostics` (third_party/victory): OK. - `cargo test -p victory-gpu --features diagnostics fps_overlay`: 2 passed (size parsing and bounds, window scaling). They fail without the port. - Tried in game by the maintainer after merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01LwHrL4tW8PW9t9yQ4GbErX
chatgpt-codex-connector[bot] commented 2026-11-25 18:57:40 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T18:57:40Z.


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-25T19:04:18.762751Z 297cc12 Manual request
ℹ️ 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.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7171635053 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225#issuecomment-7171635053). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T18:57:40Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"297cc12ac268350b945a37c35325cb9630550eb9","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <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-25T19:04:18.762751Z">2026-11-25T19:04:18.762751Z</relative-time> | `297cc12` | Manual request | <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>
chatgpt-codex-connector[bot] commented 2026-11-25 18:58:35 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T18:58:35Z.

Review: COMMENTED


💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 297cc12ac2

ℹ️ 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".

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review:6063296641 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225#pullrequestreview-6063296641). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T18:58:35Z. **Review:** COMMENTED --- <!-- codex-review-receipt:v1 --> ### 💡 Codex Review Here are some automated review suggestions for this pull request. **Reviewed commit:** `297cc12ac2` <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>
chatgpt-codex-connector[bot] commented 2026-11-25 18:58:35 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T18:58:35Z.

Code review location: third_party/victory/crates/victory-gpu/src/fps_overlay.rs; line 14

@@ -0,0 +1,275 @@
+//! A frame-rate counter over the top-left corner of our window.
+//!
+//! A borderless layered top-most window on a thread of its own (not owned
+//! by the presented window, whose thread may be the title's: an owned
+//! window would join the two threads' input), clicks pass through it,
+//! black is its transparent colour; it shows only while the presented
+//! window is in front. Every 250 ms it reads the frames presented so far
+//! (`crate::queue::presented`), follows our window's client corner and
+//! draws the rate over the last second. Nothing touches the title's
+//! picture or the GPU. `VICTORY_FPS_OVERLAY=0` leaves it out;
+//! `VICTORY_FPS_OVERLAY_SIZE=<pixels>` sets the character height (default 54).
+//!
+//! Source: rorodev6/victory, commit 4ddc0c1 (`crates/victory-gpu/src/fps_overlay.rs`),
+//! GPL-3.0-or-later; ported with a configurable size.

P1 Badge Include the required upstream attribution trailers

This file explicitly identifies itself as a port of rorodev6/victory commit 4ddc0c1, but the reviewed commit message contains neither the required Source: trailer nor a Co-authored-by: trailer crediting the upstream author. The source comment and THIRD_PARTY.md entry do not satisfy the separate commit-attribution requirement in AGENTS.md rule 10. Include both trailers in the port's commit message to preserve the required provenance and authorship.

AGENTS.md reference: AGENTS.md:L59-L59

Useful? React with 👍 / 👎.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review-comment:4699505712 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225#discussion_r4699505712). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T18:58:35Z. **Code review location:** `third_party/victory/crates/victory-gpu/src/fps_overlay.rs`; line 14 ~~~~diff @@ -0,0 +1,275 @@ +//! A frame-rate counter over the top-left corner of our window. +//! +//! A borderless layered top-most window on a thread of its own (not owned +//! by the presented window, whose thread may be the title's: an owned +//! window would join the two threads' input), clicks pass through it, +//! black is its transparent colour; it shows only while the presented +//! window is in front. Every 250 ms it reads the frames presented so far +//! (`crate::queue::presented`), follows our window's client corner and +//! draws the rate over the last second. Nothing touches the title's +//! picture or the GPU. `VICTORY_FPS_OVERLAY=0` leaves it out; +//! `VICTORY_FPS_OVERLAY_SIZE=<pixels>` sets the character height (default 54). +//! +//! Source: rorodev6/victory, commit 4ddc0c1 (`crates/victory-gpu/src/fps_overlay.rs`), +//! GPL-3.0-or-later; ported with a configurable size. ~~~~ --- **<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Include the required upstream attribution trailers** This file explicitly identifies itself as a port of rorodev6/victory commit `4ddc0c1`, but the reviewed commit message contains neither the required `Source:` trailer nor a `Co-authored-by:` trailer crediting the upstream author. The source comment and `THIRD_PARTY.md` entry do not satisfy the separate commit-attribution requirement in `AGENTS.md` rule 10. Include both trailers in the port's commit message to preserve the required provenance and authorship. AGENTS.md reference: [AGENTS.md:L59-L59](https://github.com/LooperSalty/AnyXboxX/blob/297cc12ac268350b945a37c35325cb9630550eb9/AGENTS.md#L59-L59) Useful? React with 👍 / 👎. <!-- codex-code-review-finding:v1 -->
LooperSalty commented 2026-11-25 19:02:45 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-25T19:02:45Z.

Code review location: third_party/victory/crates/victory-gpu/src/fps_overlay.rs; line 14

@@ -0,0 +1,275 @@
+//! A frame-rate counter over the top-left corner of our window.
+//!
+//! A borderless layered top-most window on a thread of its own (not owned
+//! by the presented window, whose thread may be the title's: an owned
+//! window would join the two threads' input), clicks pass through it,
+//! black is its transparent colour; it shows only while the presented
+//! window is in front. Every 250 ms it reads the frames presented so far
+//! (`crate::queue::presented`), follows our window's client corner and
+//! draws the rate over the last second. Nothing touches the title's
+//! picture or the GPU. `VICTORY_FPS_OVERLAY=0` leaves it out;
+//! `VICTORY_FPS_OVERLAY_SIZE=<pixels>` sets the character height (default 54).
+//!
+//! Source: rorodev6/victory, commit 4ddc0c1 (`crates/victory-gpu/src/fps_overlay.rs`),
+//! GPL-3.0-or-later; ported with a configurable size.

The trailers are in the commit message of 297cc12 (last paragraph), and git interpret-trailers --parse reads them:

Source: rorodev6/victory 4ddc0c1 (crates/victory-gpu/src/fps_overlay.rs)
Co-authored-by: rorodev6 <[email protected]>

so rule 10 is met (source comment in the file, THIRD_PARTY.md row, and both trailers). Resolving.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:review-comment:4699550360 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225#discussion_r4699550360). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-25T19:02:45Z. **Code review location:** `third_party/victory/crates/victory-gpu/src/fps_overlay.rs`; line 14 ~~~~diff @@ -0,0 +1,275 @@ +//! A frame-rate counter over the top-left corner of our window. +//! +//! A borderless layered top-most window on a thread of its own (not owned +//! by the presented window, whose thread may be the title's: an owned +//! window would join the two threads' input), clicks pass through it, +//! black is its transparent colour; it shows only while the presented +//! window is in front. Every 250 ms it reads the frames presented so far +//! (`crate::queue::presented`), follows our window's client corner and +//! draws the rate over the last second. Nothing touches the title's +//! picture or the GPU. `VICTORY_FPS_OVERLAY=0` leaves it out; +//! `VICTORY_FPS_OVERLAY_SIZE=<pixels>` sets the character height (default 54). +//! +//! Source: rorodev6/victory, commit 4ddc0c1 (`crates/victory-gpu/src/fps_overlay.rs`), +//! GPL-3.0-or-later; ported with a configurable size. ~~~~ --- The trailers are in the commit message of `297cc12` (last paragraph), and `git interpret-trailers --parse` reads them: ``` Source: rorodev6/victory 4ddc0c1 (crates/victory-gpu/src/fps_overlay.rs) Co-authored-by: rorodev6 <[email protected]> ``` so rule 10 is met (source comment in the file, `THIRD_PARTY.md` row, and both trailers). Resolving.
LooperSalty commented 2026-11-25 19:02:48 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-25T19:02:48Z.


@codex review

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7171747221 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225#issuecomment-7171747221). Originally posted by [LooperSalty](https://github.com/LooperSalty) on 2026-11-25T19:02:48Z. --- @codex review
chatgpt-codex-connector[bot] commented 2026-11-25 19:04:17 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-25T19:04:17Z.


Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 297cc12ac2

ℹ️ 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".

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7171780267 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/225#issuecomment-7171780267). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-25T19:04:17Z. --- <!-- codex-review-receipt:v1 --> Codex Review: Didn't find any major issues. Keep it up! **Reviewed commit:** `297cc12ac2` <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>
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!225
No description provided.