fix(fps-counter): the counter's sizes are the old counter's again, at every setting and screen #3238
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3238
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/fps-counter-old-sizes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The FPS counter is the size it was before the mod API again, at every setting and screen size.
Before #2822 the renderer drew the counter (
gpu/vk/vk_menu.cppdraw_fpsatd984fd704^). Its sizes were:720th of its height.
the rest, and every digit as wide as the others.
Since the counter became a system mod (
game/mods/fps-counter), every size grows with the screen, Auto ignores theMenu size, the edge gap is 16, its texts are the UI's own font drawn about 1.3 times bigger, and its numbers shift
sideways as their digits change. At 4K, Small was 2.6 times its old size.
To see it on main: Debug > FPS counter size Small at 1080p, then at 4K (it grows), or Auto with Gameplay > Menu size
Small against Large (it does not change).
Pixels a point, before #2822 → main (16:9, Menu size Medium unless said); this PR gives the left numbers again:
The counter needed five small additions to the mod API, each its own commit, for any mod to use:
longshot/uiscreen(): the picture's size in pixels, for what keeps one size in pixels whatever the window.font:"ui"(the default) or"game", the game's menu fonts the renderer already hands the UI from theplayer's own files. A mod picks by name and never gets the font.
shadowWidth,shadowRing(all round),dropShadow.fontVariantNumeric: "tabular"/tabular: true: every digit one width (OpenTypetnum).The counter (
counter.tsoldSize,say,plan;main.tsx) uses them:the old counter did (it hears the menu through
longshot/settings-host), worked out again when the window isresized with the menu open.
It reads the Menu size and the compact menu through mod.toml's
reads. Keys are unchanged.Keeps HumanBean's #3144 ("FPS" no longer cut off: the width estimate). Replaces Veix's Small of 1.3 from #3071 with the
old fixed size, as asked; #3071's menu scaling is untouched.
Read first:
game/mods/fps-counter/src/counter.ts(oldSize,say,plan), thengame/crates/ui/src/text.rs(
TextFont,stack_for,tabular) andgame/crates/ui/src/canvas.rs(the text command's new parts).Written with AI assistance (Claude).
Testing
Tested: Windows 11, RTX 5080, driver 621.47. Ran this PR's runtime against nightly-880 (
86fdb213, the counter's codeas at
d984fd704^) headless, withRX_VK_SHOT_MENU=1shots, on the title screen.3840x2160, 1920x1200 and 1280x800: the number's top, right edge, width and height match the old counter within 1-3
px.
RX_VK_UI_GAME_FONT=0(no game font): the counter falls back to Atkinson at the same sizes.frame time only, at the full and the compact menu (Medium and Large). There is no old shot of this: nightly-880 has
no
menu_keyheadless.#3238 (comment)
Checks:
longshot-builder mod test game/mods/fps-counter: 21 passed, the sizes at 720p, 1080p, 4K and 8K (Small's "FPS" 13pixels at 8K) and the menu open with the window resized included. The new size, Menu size and menu-open tests fail on
main's counter (the number at 42 where the old one drew it at 37.8).
cargo test -p game-ui -p script -p longshot-game: all pass (201, 214, 92 and the rest), new tests for each APIaddition included.
cargo clippyon game-ui, script, api and longshot-game: clean (with-A clippy::large_const_arrays -A unused_importsfor two warnings in host-sys and build-core, crates this PR does not touch). rustfmt clean.mise run lint: passes.api'sa_walked_reshade_folder_counts_a_change_once_two_walks_agreefails, as it does on clean main on Windows.mise run test -- --jobs 12(Windows): 846 passed, 13 failed, 52 skipped. Twelve fail on clean main on Windows too(test_lifter, test_present_acquire_ahead, test_stack_commit, test_no_game_title, test_present_held_image,
test_sync_watch_event, test_turf_budget, test_present_geometry_trace, test_present_image_free, test_ui_renderer,
test_dlssg, test_no_map_reload); none reads a file this PR changes. test_recorder_parts failed in the full run and
passes alone, on main
7bc53f841and on this PR alike.Still to test:
places above and no missing letters (@Beanstalk the FPS counter's sizes on Linux)
nightly-880 (by hand, or the Test Farm)
(@Beanstalk)
Measurements
Verdict: no change in frame rate measurable on this PC. The counter's script costs more only in the frames where
it lays its texts out again, four a second: about 0.02 ms more at FPS, 0.05 at Graph, 0.1 at Dev; and 0.26 ms more in
the frame after a counter setting changes. Its average frame is within 0.02 ms of main's.
Setup: Windows 11, RTX 5080, driver 621.47, Ryzen 9 9900X3D. In the game:
dev.py abon one runtime (this PR's), side Athe system mods with main's counter (
HOS_SYSTEM_MODS_DIR), side B this PR's, the counter at Dev(
LONGSHOT_SET=system/fps-counter:fps_counter=5), Hyrule Field, uncapped, 67% render, 60 s each, interleavedA1 B1 A2 B2 A3 B3. Other jobs shared the PC, and moved the rate by 25% between pairs.
Baseline: main's counter (the system mod at
3a0f7d8f7: no commit since touches it) against this PR's counter, both on oneruntime of this PR (
HOS_SYSTEM_MODS_DIR), so only the counter differs. The runs were before the rebase onto7bc53f841(no file in common) and before the Dev grid's rows were measured rather than estimated.
3a0f7d8f73b220702af143e96f1)1cec5fe1b)One run of this PR (B1) had a 1% low dip the other two did not repeat. The script worst frame is the fake game's
budget test (Dev at Large, a level switched every 30 frames: the first frame of a view), on the same busy PC; main's
own went over its 2 ms ceiling once there. Of the 0.26 ms, about half is the texts' new options (the outline's step and
ring, the drop shadow, the font, tabular: 1.78 ms with them left out) and half the counter's own layout. The
four-a-second frames are where it reads the numbers and lays the texts out again (
texts():planand the head drawnagain), with the graph's own frames between them as on main; the fake game's frames with the counter on for 15 s at
each level, main's counter and this PR's side by side, at
f143e96f1.1cec5fe1bthen keeps the Dev lines' widths whiletheir values stay (0.84 to 0.81 ms at Dev); the rest is spread over the texts' options, the Dev lines measured as drawn
and the head's ring, none more than about 0.03 ms of it alone.
Risks
(much smaller at 4K than on main), Auto follows the Menu size, the counter moves under the banner while the Insert
menu is open. No setting or saved value changes; keys are the same. A revert is enough.
the new parts is as before). The counter now holds
settings.host(to hear the menu open) and reads two of theInterface mod's settings.
the frame after a setting changes (Measurements).
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
A style's font (inherited, as the other text properties) and d.text's and d.measure's: "ui", the UI's own (Atkinson Hyperlegible Next, the default), or "game", the game's menu fonts read from the player's own files, which the renderer already gives the UI (vk_ui.cpp tell_fonts): those first, the one whose weight is nearest the text's first (its DemiBold for a bold text), then the UI's; the UI's alone where the files have none. A mod picks one by name and never gets the fonts themselves. text::TextFont on TextStyle; Fonts keeps the host's families with their weights (Fonts::add) and builds the family list of each text from it (stack_for). The main thread's Measurer has the same fonts (text::host_font, from game_ui_font; Measurer::measure adds those it lacks), so measure() measures a "game" text as it is drawn. A Canvas text command takes the font as an optional 10th part ("ui", "game" or null), the fake game's canvas() shows it. Tests: the host's fonts first, by weight, the UI's for the letters they lack; the measurer's; a style's font parsed and inherited; a Canvas text's. Docs: ui.md, game/DESIGN.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>d.text's shadowWidth (the outline's step, virtual px, 0 to 16; left out: a 28th of the size, a pixel at least, as before), shadowRing (eight copies round the text, the sides too, not the four diagonals) and dropShadow { color, y } (a copy straight down, over the outline, under the text). For a text drawn as a renderer's own overlay drew it: the FPS counter's number had its outline all round, its other texts a soft outline with a darker copy a step down. A Canvas text command takes them as optional 11th to 14th parts (shadowWidth, shadowRing, dropColor, dropY: null or left out, as before); the fake game's canvas() shows them. Test: they are parsed and checked. Docs: ui.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11, RTX 5080, driver 621.47: this PR's runtime against nightly-880 (the counter as before the mod API), headless shots at 1080p, 1440p, 4K, 1920x1200 and 1280x800, every counter size and Menu size, the FPS and Breakdown levels, all four corners: the number's place and size within 1-3 px of the old counter. Also Japanese, no game font, a 480-line screen, the Insert menu open (full and compact) and a real window: as expected. Frame rate with the counter at Dev in Hyrule Field: no change measurable (3 interleaved pairs).
The mod API additions in this PR, for the API's reviewers. Each is its own commit and optional: a mod that uses none of them works as before.
screen(), the window's size in pixels (longshot/ui). The picture's width and height in pixels, and its pixels a virtual px (h / 1080, orw / 1920narrower than 16:9); null before the first frame. Everything else in the UI is virtual px, which grow with the window; this is for what keeps one size in pixels whatever the window (the counter's Small, Medium and Large). The core keeps its last present's size (game_ui::core::picture), the main thread reads it (api::services::ui::screen_now, the UI nativescreen).A text's font:
"ui"or"game"(a style'sfont, inherited;d.textandd.measure'sfont)."ui"is the default, Atkinson Hyperlegible Next."game"puts the game's menu fonts first: the onesvk_ui.cpptell_fontsalready hands the UI from the player's own files, the one nearest the text's weight first (its DemiBold for a bold text), the UI's where the files have none. A mod picks by name and never gets the fonts. The main thread's measurer adds the same fonts (text::host_font), someasure()measures a"game"text as it is drawn. Code:text::TextFont,Fonts::stack_for.A Canvas text's outline (
d.text):shadowWidth(the outline's step, virtual px; left out: a 28th of the size, as before),shadowRing(eight copies round the text, the sides too, not the four diagonals) anddropShadow: { color, y }(a copy straight down, over the outline, under the text). Left out, an outline is as before.Canvas text down to 6 virtual px (was 8): the engine's own least (
caps::TEXT_PX_MIN); a style'sfontSizealready went that low. The counter's Small on a 4K screen had 12-pixel labels, 6 virtual px there.Tabular digits (a style's
fontVariantNumeric: "tabular", inherited;d.textandd.measure'stabular: true): the font's tabular figures (OpenTypetnum), every digit one width, so a number that changes does not shift sideways. The counter first drew each digit in a cell of its own, as the old counter did; that doubled its worst frame (a Canvas text a digit), and this costs nothing extra.A Canvas text command takes the new parts as optional 10th to 15th items (
font,shadowWidth,shadowRing,dropColor,dropY,tabular); a command without them is parsed as before, and the fake game'scanvas()shows them for tests. Each has tests ingame-ui(text, style, canvas). Docs:docs/modding/ui.md,game/DESIGN.md,docs/modding/api-schema.md.The counter also uses two things the API already had:
longshot/settings-host(itschangedevent,settings.host, a system mod's) to hear the Insert menu open and shut, and mod.toml'sreadsfor the Interface mod'smenu_sizeandcompact_menu.The full suite ran (Windows, --jobs 12): 846 passed, 13 failed. Twelve fail on clean main too, none reads a file this PR changes; test_recorder_parts failed only under the full run's load and passes alone on main and here. Named in Testing.
Measurements name their commits and baseline (main's counter against this PR's on one runtime). The screenshots box is out: the shots are made from the game, so they stay on my PC; Testing says what they showed.
@Beanstalk the FPS counter's size on Linux and on an AMD or Intel GPU: turn Debug > FPS counter on at Breakdown, then try each FPS counter size (Auto, Small, Medium, Large) at 1080p and at 4K (or the biggest the screen has), and with the Insert menu open. Expected: Small, Medium and Large stay the same pixel size whatever the resolution (Small is small at 4K), Auto grows with the window and with Gameplay > Menu size, the numbers have a dark outline and do not shift sideways as they change, nothing is cut off at the top or the right, and while the menu is open the counter sits at the top right under the menu's banner showing only the FPS and the frame time.
WIP: fix(fps-counter): the counter's sizes are the old counter's again, at every setting and screento fix(fps-counter): the counter's sizes are the old counter's again, at every setting and screenScreenshots: nightly-880 (the counter before the mod API) on the left, this PR on the right. Headless, the title screen, RTX 5080, Windows 11. Each picture's rows: Auto, Small, Medium, Large, then Auto with the Menu size Small and Large. The frame rates differ between shots only because of other jobs on the PC.
1080p, the FPS level and the Breakdown level:


1080p, the other three corners, and with the Insert menu open (this PR only: nightly-880 cannot open its menu headless):

1440p, 4K (Small stays small) and 1280x800 (the Steam Deck's size), the FPS level:



The Dev grid's rows paired as before, at 1080p:

A 1920x480 screen at Large: both give up the footer's last lines alike:

Menu language Japanese (the new counter translates every label, the old one only a few):

The compact menu open, Medium and Large Menu size (this PR): the counter under the smaller banner:

No game menu font (

RX_VK_UI_GAME_FONT=0, right) against the game's (left), this PR: the same sizes in Atkinson:Recommendation: Approve. The counter’s fixed sizes cease to be fixed above 4K, and resizing with the Insert menu open leaves its banner offset based on the old window. The reported Windows comparison supports the fix at the tested resolutions, but the remaining platform runs are still needed. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
Restores the counter’s old sizing, spacing, font and menu-open placement, and adds reusable UI text and screen APIs. The additions increase text rendering and measurement work; the reported frame-rate comparison is too noisy to quantify that cost.
Should fix (2): not blocking, but worth doing before merging.
game/mods/fps-counter/src/counter.ts:211: The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently large screens. (more on the line) Do: Allow the counter’s required smaller virtual text sizes through the Canvas API and add an 8K fixed-size layout test.game/mods/fps-counter/src/main.tsx:143: Refreshing the screen size does not recompute the open menu’s banner offset. (more on the line) Do: Recompute underBanner from the new screen and current compact-menu setting whenever the screen changes, and test resizing while the menu is open.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1 and L2.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the tested Windows setup: the author reports the number’s position and size within 1–3 px of nightly-880 across the tested sizes and resolutions. The three frame-rate pairs do not establish a performance change: other work moved the rate by 25% between pairs, and the comparison used this PR’s runtime on both sides.
Other systems: The shared text APIs affect mod UI on both Windows and Linux, including font fallback and text measurement. The reported visual run covers Windows on NVIDIA; Linux, Steam Deck, AMD or Intel, and a real-window comparison of the open menu remain outstanding.
Switches: None added, changed or removed.
Reviewed:
3b220702afagainst7bc53f8413: Read the repository rules, PR template, standards, description, comments, commit messages and the principal counter and UI API changes. Skimmed the remaining changed files and tests; the full diff output was truncated, so not every changed code file was read in full. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run for this review. CI was still running; the author reports game-free tests and Windows game runs.
Overlaps and merge order: Not checked; the network was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as llun took it out of WIP. Nothing was run; a maintainer decides.
@ -59,0 +208,4 @@return w;}/** A text's size, virtual px, for `pt` points at `t` (Plan's): within a Canvas text's 6 to 96. */export const textPx = (pt: number, t: number): number => Math.min(96, Math.max(6, pt * t));L1 (should fix): The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently large screens.
When: At 7680×4320, Small’s 12-point labels should be 12 physical pixels, or 3 virtual pixels at scale 4. This clamp draws them at 6 virtual pixels, or 24 physical pixels, while the surrounding layout remains sized for 12; text can also be clipped or overlap.
Do: Allow the counter’s required smaller virtual text sizes through the Canvas API and add an 8K fixed-size layout test.
@ -72,3 +140,4 @@/** The texts read and drawn again (four times a second). */function texts(): void {kept.screen = screen() ?? SCREEN_1080; // (the window may have been resized: no event says so)L2 (should fix): Refreshing the screen size does not recompute the open menu’s banner offset.
When: Open the Insert menu with a fixed counter size, then resize the window: texts() updates kept.screen and recalculates the counter scale, but kept.under still contains the offset calculated for the former screen. The counter can sit at the wrong distance from, or overlap, the resized banner until the menu or a setting changes.
Do: Recompute underBanner from the new screen and current compact-menu setting whenever the screen changes, and test resizing while the menu is open.
Screenshots are in (the comment above): Testing links them and the screenshots box is back, ticked.
Pushed BeanBot's L1 and L2 (four commits) and the 8K measuring fix they showed; Testing, the checks and Measurements updated (the script cost measured again).
Thanks: both done, four commits on top.
L2 (resized with the menu open):
7784bd806. When the picture's size changes (texts()reads it four times a second), the place under the banner is worked out again from the new size and the compact menu as it is. The menu-open test now resizes the window to 1280x1024 with the menu open: the number's line was at 81.9 virtual px without the fix, 119 with it (under the new banner).L1 (8K):
2159c7b6blets Canvas text down to 2 virtual px (Small's 12-pixel labels are 3 at 7680x4320), andf43db67a8has the counter use it, with 8K in the size test (Small's "FPS" at 13 pixels). In the game that first showed a second fault:d.measuremeasures through a style, whosefontSizeis 6 at the least, so a 3-px text was measured at the default size, about eight times too wide (its digits spread across the line, its values over the names).07afe0e03measures a Canvas text under 6 at 6 and scales it (the host measures at a virtual px a pixel, so the size is in proportion; no extra measure), andf143e96f1does the same for the counter's Dev grid, with a test: at Small, the frame time line at 8K is a quarter as wide in virtual px as at 1080p (it was 250 for 15). A 7680x4320 run of the game now lays Small out as at 1080p.L3: the Test Farm request is above; the menu open against nightly-880 in a real window is in Still to test, by hand (the old build has no
menu_key, and a synthetic Insert does not reach the game).The script cost is in Measurements, measured again on
f143e96f1: the worst frame 1.90 ms against main's 1.64 (5 interleaved runs, a busy PC; the frame after a level switch), half of it the texts' new options, half the counter's layout; the other frames as on main.Measurements: the counter's four-a-second frames measured too (main's counter against this one, each level, fake game). They cost about 0.02 ms more at FPS, 0.05 at Graph and 0.2 at Dev, not only the frame after a setting change as the description said before; the average frame is within 0.02 ms of main's.
1cec5fe1btrims the counter's four-a-second update at Dev: each Dev line's width is kept while its value stays the same, and the outline colours and digit widths are looked up more cheaply. Nothing drawn changes (22 mod tests pass; a Dev shot in the game matches). The update frames at Dev: 0.70 ms on main, 0.84 before, 0.81 now (fake game, interleaved). The rest of the extra is spread thin across the parts, none more than about 0.03 ms on its own.@review
Recommendation: Approve. The reported Windows runs show the restored counter sizes, including at 8K. The fixed-size text still grows on sufficiently large screens, and the listed platform and menu-open runs remain outstanding. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
Restores the old FPS counter’s sizing, placement, font treatment and menu-open behavior, with optional additions to the mod UI API. It improves the counter’s consistency at a measured script cost of about 0.1 ms on Dev update frames four times a second.
Should fix (1): not blocking, but worth doing before merging.
game/mods/fps-counter/src/counter.ts:211: The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently large screens. When: At 7680×4320, Small’s 12-point labels should be 12 physical pixels, or 3 virtual pixels at scale 4. This clamp draws them at 6 virtual pixels, or 24 physical pixels, while the surrounding layout remains sized for 12; text can also be clipped or overlap. Do: Allow the counter’s required smaller virtual text sizes through the Canvas API and add an 8K fixed-size layout test.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Since the last review (on
3b220702af)Resolved: L2 (Refreshing the screen size does not recompute the open menu’s banner offset.)
Still open: L1 (The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently lar…); L3 (The changed counter and shared text path still need the platform and menu-open runs listed…)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the reported Windows cases: the author reports matching the old counter within 1–3 pixels at tested sizes, plus an 8K run. The minimum text size still prevents fixed pixel sizes at larger resolutions.
Other systems: The shared Canvas text and font paths also affect mods and Linux. Windows NVIDIA rendering was reported tested; Linux, Steam Deck, AMD or Intel, and comparison with the old menu-open behavior in a real window remain untested.
Switches: No switches added, changed or removed.
Reviewed:
1cec5fe1b5against7bc53f8413: Read the repository rules and pull request template, the changes since the ledger, and the counter code around sizing, measuring and menu placement. Skimmed the earlier shared text and runtime diff, tests, reported runs and comments; did not read every changed code file in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run the project were executed. The author reports game-free tests and Windows game runs; CI is still running.
Overlaps and merge order: Not checked; network access is unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
L1 is already fixed at
1cec5fe1b; nothing at 6 is left on the drawing side:counter.ts:213textPxclamps to 2..96 (not 6): Small's 12-point labels at 7680x4320 are 3 virtual px.canvas.rs:503takes a Canvas text's size from 2 (2159c7b6b), andruntime.jstextSizeaccepts 2..96.runtime.js:2490d.measure, and the counter'srunWidth): a text under 6 is measured at 6 and scaled down, because a style'sfontSizestarts at 6. The width comes out for the size drawn (07afe0e03,f143e96f1), as the review's own "Checked and fine" says.L3: the Linux, Steam Deck and AMD/Intel runs need a BigBean's
@Beanstalk. The menu-open comparison against nightly-880 in a real window is still in Still to test.Beanstalk test farm
Commit
82fb4b9· approved by nobody yet · dashboardA member of
BigBeanscan review this commit and comment@Beanstalkto test it.@review
Recommendation: Approve. The counter restores the old sizing through the tested 8K case, but the requested platform and menu-open comparisons remain outstanding. At still larger resolutions, the minimum text size can make fixed-size labels grow. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
Restores the counter’s former sizing, placement and appearance and adds optional mod UI APIs. It adds some script work to counter updates.
Should fix (1): not blocking, but worth doing before merging.
game/mods/fps-counter/src/counter.ts:211: The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently large screens. When: At 7680×4320, Small’s 12-point labels should be 12 physical pixels, or 3 virtual pixels at scale 4. This clamp draws them at 6 virtual pixels, or 24 physical pixels, while the surrounding layout remains sized for 12; text can also be clipped or overlap. Do: Allow the counter’s required smaller virtual text sizes through the Canvas API and add an 8K fixed-size layout test.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Since the last review (on
1cec5fe1b5)Still open: L1 (The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently lar…); L3 (The changed counter and shared text path still need the platform and menu-open runs listed…)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports sizes and positions within 1–3 pixels of the old counter across the tested Windows resolutions. The reported Dev update frames cost about 0.1 ms more four times a second; average frame time was within 0.02 ms of main.
Other systems: The shared text and Canvas APIs can affect mods and rendering across operating systems and GPUs. Windows NVIDIA was tested; Linux, Steam Deck and Windows AMD or Intel runs remain outstanding.
Switches: No switches added, changed or removed.
Reviewed:
1cec5fe1b5against7bc53f8413: Read AGENTS.md, CONTRIBUTING.md, the PR template, commit list, ledger, comments and reported CI. Inspected the counter sizing and menu-resize diff, Canvas text limits, runtime measurement and relevant tests; the remaining changed files and full diff were not read in full. docs/review-checklist.md is absent.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run. The author reports Windows NVIDIA game and headless comparisons and game-free tests; CI is still running.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
L1, beyond 8K: kept as is, on purpose.
Small's 12-pixel labels are 12 / (height / 1080) virtual px: 6 at 4K, 3 at 8K, both drawn at their size. The Canvas floor is 2 (not 6 any more), so a label is drawn larger than 12 pixels only on a picture over 6480 lines high, past 8K (at 16K: 16 pixels, not 12). Lowering the floor further would change the mod API's limit for every mod, for a screen no player has, and would only move the edge (1 reaches 12960 lines). The 8K case is covered by the two 8K tests and the in-game 7680x4320 run.
@rebase
I rebased this pull request onto
main(fec5798ecb): the new head is82fb4b9d60.Conflicts resolved
game/mods/fps-counter/src/main.tsxNothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
1cec5fe1b582fb4b9d60Recommendation: Approve. The counter’s restored sizes are shown working through 8K on Windows NVIDIA, but the remaining platform and real-window menu comparison runs have not been reported. The fixed-size text still grows at 16K, a minor limitation of the current minimum. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
Restores the old counter’s sizing, placement, font treatment and menu-open layout, while adding reusable optional UI APIs. The extra layout work costs about 0.1 ms on four Dev update frames per second in the reported measurements.
Should fix (1): not blocking, but worth doing before merging.
game/mods/fps-counter/src/counter.ts:211: The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently large screens. When: At 7680×4320, Small’s 12-point labels should be 12 physical pixels, or 3 virtual pixels at scale 4. This clamp draws them at 6 virtual pixels, or 24 physical pixels, while the surrounding layout remains sized for 12; text can also be clipped or overlap. Do: Allow the counter’s required smaller virtual text sizes through the Canvas API and add an 8K fixed-size layout test.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Since the last review (on
1cec5fe1b5)Still open: L1 (The six-virtual-pixel minimum makes fixed-size counter text grow again on sufficiently lar…); L3 (The changed counter and shared text path still need the platform and menu-open runs listed…)
Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Yes for the tested configurations: the author reports positions and sizes within 1–3 pixels of the old counter across 1080p–4K and other resolutions, plus correct Small layout at 8K. The reported frame-rate comparison found no measurable change on the tested PC; other platform runs remain outstanding.
Other systems: The shared text and Canvas APIs can affect mods and rendering across platforms. Windows NVIDIA was tested; Linux, Steam Deck and Windows AMD or Intel results remain outstanding.
Switches: No switches added, changed or removed.
Reviewed:
82fb4b9d60againstfec5798ecb: Read AGENTS.md, CONTRIBUTING.md and main.tsx; inspected counter.ts, the Canvas size limit, the main.tsx diff and commit list. The remaining changed files and full repository review rules were not read in full.; nothing run (a code review).Checked and fine:
Testing: No commands that build or run project code were executed. The author reports Windows NVIDIA game and game-free tests; CI is still running.
Overlaps and merge order: none found
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.