fix(ui): menus and the item quick select follow a live switch of Ultrawide menus #2767

Open
bulldogsajr22 wants to merge 2 commits from bulldogsajr22/Longshot:fix/ultrawide-menus-live into main
Contributor

Summary

A change of Ultrawide menus during play didn't reach everything (#2630):

  • The pause menu stayed in the middle 16:9 after a switch to Extended once one of its pages had been shown for the first time at Centred (the game places the menu's root again only then): hearts, tabs, the item grid and the equipment columns, on every page; only its background widened. After a switch to Centred, its button bar stayed at Extended's place.
  • The item quick select's carousel didn't follow a switch on its first open after it:
    • to Centred, not opened since the save loaded: the selection box empty, the item to its right;
    • to Centred, opened at Extended before: the whole row and its Back prompt still at Extended's width and place;
    • to Extended, not opened since the save loaded: the box between two items, and the right side cut off after turning right 6;
    • to Extended, opened at Centred before: the row cut to the middle 16:9 on both sides (its slots counted for 16:9 as the save loaded).
      Reopened, the misaligned ones were right; the cut ones stayed cut. Switched with the carousel open, its row widened or narrowed off by half the change, the box between two items.
  • A HUD layout change made while a menu hides the HUD (the pause menu open) didn't reach it: closed, the whole HUD was still at the old layout's place, until the layout was changed again in play.

To see it on main at 21:9: load a save at Extended without opening the carousel; open the pause menu on Items and close it; switch to Centred in the Insert menu, open the pause menu and turn to System (its first showing), close it; switch to Extended and open it: still 16:9 on every page. For the carousel: load a save at Centred, switch to Extended before opening it, open it (between two items), turn right 6 (cut off).

What changes:

  • After a change of the row (or of the HUD layout, or its custom placement), each layout catches up as it is next calculated: its panes remake their transforms for 3 presents from its first calculation after the change, whenever it is next shown. Before, every pane was forced for 3 presents after the change, and a layout hidden then missed them (the calculate pass skips hidden panes, f_815461e0, and panes with no dirty bits, f_8154a730). The pause menu's root, calculated by the game only when one of its pages is first shown, kept the tree flag of a placement at Centred, so nothing made from it was planned at Extended. Where nothing is planned before or after the change (16:9 with the HUD's own places), every pane is forced for 3 presents as before. A custom HUD placement changed from one value to another counts as a change too (Hearts and magic's, the buttons' and the minimap's). The answer kept per thread for a layout's panes within a present is kept for its resource too, as the table keeps it, so a layout let go and another built at its address catches up.
  • The carousel's slots are counted for the picture's whole width whenever it is wider than 16:9, whatever the row says, and the strip is put back to the game's width once built when Centred. The engine counts them once, at its setup as the save loads (f_8151eb00). Started at Extended and switched to Centred, main already ran this way; reopened, the row stays inside the middle 16:9.
  • The carousel's scroll moves with its width. Its engine draws from the strip's left edge less its scroll, stored at [engine + 0x110] and [engine + 0xf4 + 0x14] (f_81522e30). The carousel scrolls to its selection at the width it has then (f_83794270) and reopens there, so a width change alone moved every item by half the change. Each width set by the planner now moves the scroll by as much, so the items stay where they are on screen.
  • A kept list's engine is read only once its pane is still in the layout and resource it was set up in (a layout let go, the engine's memory may be another's).
  • The strip is never drawn wider than its slots were counted for (the picture's shape is set at start, host/hos_main.c; this only matters if it ever changes live, as #142 would make it in a window).

Read first: hos_wide_ui_catch_up and the "lists kept at the screen's width" section in game/hos_wide_ui.c, then the new scenarios in tests/test_wide_ui.py (from the carousel's scroll on).

Fixes #2630. See #2621 (the carousel's slot count at Extended), #1892.

Testing

Tested: Windows 11 Pro (26H2, build 26300), Ryzen 9 9950X3D, RTX 5090, NVIDIA 621.40, 5120x2160 (21:9).

  • In the game, the same key sequences on main @ 22d0d200 and here, driven through the game's control bridge (HOS_CONTROL, headless, a screenshot after each step), the save in the Shadow Temple, at 2560x1080 (21:9), 3840x1080 (32:9) and 1920x1080 (16:9):
    • Started at Extended: switched to Centred and back with the pause menu and the carousel closed, ~10 s between a switch and the next open. Here: the pause menu at the edges on all four pages, the carousel aligned on its first open after each switch, both sides full after turning right 6 at Extended and inside the middle 16:9 at Centred. On main: the pause menu stuck at 16:9 on all four pages (once its pages had first been shown at Centred), the carousel's first open after the switch to Centred off by half the extra width, and back at Extended its row cut to the middle 16:9.
    • Started at Centred, switched to Extended: here the carousel is aligned and full on both sides after right 6 (also at 32:9); on main it is cut to the middle 16:9.
    • Switched while the pause menu or the carousel was open: both follow each switch.
    • The map menu (Key Items, Threads of Time, Map), the System page's Title Screen dialog, the load list, HUD layout switched with no menu open, Full width and Centred, black bars: as on main. Quit to the title and loaded again after a switch: pause menu and carousel right from the first open.
    • 16:9 and 16:10 (1728x1080, the Steam Deck's shape): every shot of the first sequence matches main's (mean difference under 2 of 255, from the animated background).
    • Each case of the Summary from a fresh start, one launch per case: on main each shows the bug as described (the pause menu only after one of its pages was first shown at Centred; opened and closed at Centred without turning a page, with 10 s or 1 s between switches and opens, it is right); here every one is right.
    • Random histories: three of 150 steps each in one running game (switches of the row with waits of 0 to 600 frames, HUD layout changes, pause pages turned, the carousel opened and turned, switches with either open, the map menu), a screenshot checked after each settled view against what the current setting should show (the pause hearts' and frame's place, the button bar's end, the carousel's row against reference shots of each position): 434 checks, none wrong. The same checker on main: 26 of 133 wrong, every case of the Summary among them.
    • HUD layout changed with the pause menu open, then closed: here the HUD is at the new layout's place (both directions); on main at the old one's (difference to here 8.9 and 8.6 of 255; changed in play, both alike).
    • Mouse (clicks posted to the game's window, windowed): after the switches that leave main's pause menu at 16:9, a click on Options where it is drawn opens Options, at Extended and, switched to Centred, at Centred.
  • The code with the first review's changes built on main @ 22d0d200 and run again the same way: two random histories of 150 steps, from Extended and from Centred, 144 and 147 views checked, none wrong; 16:9 and 16:10, the first sequence: as main's pictures (mean difference under 2 of 255).
  • This head (the second review's changes, on main @ 1413b1729) built on Windows beside main @ 1413b1729, both with DLSS 5 off (the exit fault #2807 fixes), and run the same way:
    • The review's case, at Custom: Hearts and magic and the buttons moved and made smaller with the pause menu open, then the menu closed: here both at their new places, as when the same change is made in play (mean difference 0.3 and 1.3 of 255); on main both at their old places (6.8 and 4.9).
    • Two random histories of 150 steps, from Extended and from Centred, 144 and 147 views checked: the pause menu, the button bar and the carousel row's place right in every one. The row's picture differs from the reference shots (taken with DLSS 5 on) by 2.0 to 3.8 of 255, against 0.5 to 2.2 before, over the checker's limit of 2.8 in 133 views; scored again by the row's edges, every one of those is the slot expected (at most 1.0, where main's wrong rows score 4.3 and more).
    • The first sequence at 16:9 (3840x2160) and 16:10 (2560x1600): every shot as main's (mean difference under 1.2 of 255). With the 21:9 picture letterboxed in a 16:9 window, the carousel follows the switches where main's doesn't, as at 21:9.
    • No GPU fault after any of the 12 launches.
  • On main @ 22d0d200 (nightly-895), the bug's cases as in #2630#issuecomment-87829, and two diagnostic runs logging each layout's placement and the carousel's width and scroll: the pause menu's root never placed again after the switch, and the carousel's width right through a misaligned open, with its stored scroll at the old width.
  • tests/test_wide_ui.py, new: the carousel's slots counted wide at Centred and the strip drawn at the game's width once built; its scroll across switches Centred -> Extended -> Centred, and a live wider shape capped; a pause menu placed at Centred, switched to Extended while closed and opened, its column out at the edge (and back); the HUD layout changed while the HUD is hidden, then shown (both ways); at 16:9 with nothing planned, main's force and no catch-up; the catch-up's window, a layout let go and rebuilt at its address (also asked again at once in the same present), and 3,000 layouts built after a change; a custom HUD placement changed from one value to another while the HUD is hidden (Hearts and magic, the buttons and the minimap, each); a kept list's engine not read once its layout is let go. The first commit adds the test alone: on main (a stand-in for the missing hos_wide_ui_catch_up that never forces) it fails first on the carousel's width, and 13 of its checks fail, 6 of them the bugs' behaviour (the carousel's width and scroll, the pause menu's column, the HUD's side); all pass here, with clang and gcc.
  • Each key line of the fix undone in turn (the scroll's move, the slots counted wide at Centred, the catch-up, its 3 presents, the old global force in its place, the catch-up at 16:9 with nothing planned, the width cap; since the second review, the custom placements tracked, the resource in the kept answer, the list's identity checked before its engine): the test fails each time, at the check for it.
  • game/hos_wide_ui.c and game/oot_wide_sites.c compiled alone with -Wall -Wextra, clang and gcc on Linux and llvm-mingw's clang for Windows: no warning, as on main; the game built with them on Windows (llvm-mingw) for the runs above.
  • tests/test_wide_sites.py: ui.calcDirty and ui.paneDirty keep their behaviour, with the catch-up beside hos_wide_ui_force.
  • mise run test (Ubuntu 24.04 on WSL, 32 at once) on the head, on main @ 1413b1729: 852 passed, 33 failed, 10 skipped (Windows-only). The same 33 fail on main @ 1413b1729 on this PC (852 passed there too; 14 of them since b22bfce2, fixtures behind main's code, such as pause_background_now and movie_now undeclared): test_bug_report, test_cloth_kernels, test_control_picture, test_crash_record, test_crt_options, test_dev_update, test_framegen_hdr, test_framegen_resources, test_guest_holes, test_input_background, test_lifter, test_linux_pressure, test_linux_saves_move, test_loaded_modules_drop, test_log_levels, test_menu_keys, test_oot_cloth, test_option_ids, test_perf_send, test_pipeline_tour, test_present_source_crop, test_program_cache_cleanup, test_program_cache_one_variant, test_screensaver, test_switch_table, test_temporal_present_bandwidth, test_upscaler_round_trip, test_vcore_video_acquire, test_video_catchup, test_video_hold_early, test_video_input_limit, test_windows_on_linux, test_xinput_thread. mise run lint passes.

Still to test:

  • Linux, AMD, 21:9: the Summary's two sequences (the pause menu, then the carousel): expecting the pause menu at the edges on every page, and the carousel aligned on its first open with both sides full after turning right 6 (@Beanstalk linux, amd).
  • Steam Deck (16:10): the Summary's two sequences: expecting the menus as on main (the carousel's changes apply only wider than 16:9; the catch-up applies as at 21:9, and this shape's pictures matched main's on this PC) (@Beanstalk).

Measurements

Verdict: the bug's cases are gone in the game (screenshots in the comment below, main above, this PR below) and the new checks fail on main and pass here. The added per-pane check costs about 1.3 ns a pane; frame rates in play, in the pause menu and in the carousel are the same as main's within the spread (0.4 %, 0.1 % and 0.2 % apart).

Setup: Windows 11 (26H2, build 26300), Ryzen 9 9950X3D, RTX 5090, NVIDIA 621.40. Measured at 6379846b on main @ 22d0d200. The head adds two reviews' changes. The first (where nothing is planned, main's force instead of the catch-up; the catch-up table's hash from the product's high bits; a rounding tolerance in the list's width cap; comments) leaves the work per pane at 21:9 as measured. The second (the custom placements tracked; the layout's resource in the answer kept per thread, one more load a pane; a kept list's identity checked before its engine) times the same as before it, the catch-up check alone interleaved with the first's (1.19 to 1.23 ns a pane, both). It is rebased onto main @ 1413b1729 as two commits (the test, then the fix); none of the 26 commits since 22d0d200 touch these files, so the numbers hold. The catch-up check timed alone (-O2, 40 layouts of 150 panes, 2,000 frames, two runs). In the game: scripts/dev.py queue run --mode timing, main and this PR interleaved (four pairs), each a fresh start of the Shadow Temple save at Extended, 2560x1080 headless, DLSS at 67 %, V-Sync and frame generation off, HOS_FPS_MAX=1000, warmed up until no frame waited for a pipeline or a shader for 5 s, then 45 s each in play, with the pause menu open and with the carousel open, from RX_VK_FRAME_TRACE; no cold frame in any window, the same vk: switches set line in all eight. The first three runs (main 1, this PR 1, main 2) ran about 5 fps lower in play than the five after them, on both sides alike, so the table takes the last two pairs, run once that had settled; every run is in the lines below the table. One pause window on each side recorded no frames (this PR's run 1, main's run 3). The frame rates are the same within the spread.

Before: main @ 22d0d200 After: this PR @ 6379846b
the pause menu after Full width -> Extended -> Centred -> Extended, closed at each switch 16:9 on all four pages at the edges on all four pages
the carousel's first open after a switch to Centred half the extra width off aligned
started at Centred, switched to Extended, right 6 (21:9 and 32:9) cut to the middle 16:9 full
started at Extended, to Centred and back, right 6 cut to the middle 16:9 full
the pause menu, a page first shown at Centred, then Extended 16:9 on all four pages at the edges
a HUD layout change with the pause menu open the HUD at the old layout's place at the new one's
random histories (3 x 150 steps), views checked 26 of 133 wrong 0 of 434 wrong
16:9 and 16:10, the same sequence the same pictures
in play, fps (runs 3 and 4, the median; 1% low) 103.4 (94.2) 103.8 (95.3)
the pause menu open, fps (runs 3 and 4; 1% low) 458.0 (373.1), run 4 alone 458.4 (373.9)
the carousel open, fps (runs 3 and 4; 1% low) 629.1 (103.5) 630.3 (103.5)
tests/test_wide_ui.py 13 checks fail (the first: the carousel's width) pass
the catch-up check, a frame of 6,000 panes none 7.8 / 8.0 µs (1.31 / 1.33 ns a pane); since the second review, the same as before it, timed interleaved (1.19 to 1.23 ns, both)
The lines the numbers come from

From RX_VK_FRAME_TRACE (longshot_frames.csv), 45 s in each place, in the order run (fps, 1% low fps, frames, cold frames; "-": the window recorded no frames):

main-1  main @ 22d0d200     play 98.2 / 79.4 / 4418 / 0 | pause 420.9 / 314.5 / 18939 / 0 | carousel 626.8 / 95.5 / 28203 / 0
fix-1   this PR @ 6379846b  play 99.0 / 85.8 / 4455 / 0 | pause - | carousel 629.5 / 98.0 / 28322 / 0
main-2  main @ 22d0d200     play 98.5 / 84.7 / 4430 / 0 | pause 432.9 / 320.5 / 19479 / 0 | carousel 628.2 / 98.7 / 28264 / 0
fix-2   this PR @ 6379846b  play 103.3 / 96.2 / 4649 / 0 | pause 471.3 / 362.3 / 21207 / 0 | carousel 632.3 / 102.5 / 28452 / 0
main-3  main @ 22d0d200     play 103.2 / 93.5 / 4645 / 0 | pause - | carousel 629.5 / 103.8 / 28325 / 0
fix-3   this PR @ 6379846b  play 104.0 / 95.1 / 4682 / 0 | pause 458.2 / 377.4 / 20619 / 0 | carousel 630.1 / 103.4 / 28349 / 0
main-4  main @ 22d0d200     play 103.5 / 94.9 / 4657 / 0 | pause 458.0 / 373.1 / 20610 / 0 | carousel 628.7 / 103.1 / 28289 / 0
fix-4   this PR @ 6379846b  play 103.6 / 95.5 / 4663 / 0 | pause 458.6 / 370.4 / 20639 / 0 | carousel 630.5 / 103.5 / 28371 / 0

The same in all eight runs:

[hos MainThread] vk: switches set (15): HOS_AUDIO=0 (kill), HOS_AUDIO_MUTE=1 (diag), HOS_CONTROL=longshot-perf (diag), HOS_CONTROL_MEM=ro (diag), HOS_DISCORD=0 (kill), HOS_FPS_MAX=1000 (player), HOS_HEADLESS=1 (diag), HOS_WINDOW_NOACTIVATE=1 (diag), HOS_WINDOW_SIZE=2560x1080 (tune), LONGSHOT_PROFILE=<a path> (player), LONGSHOT_SHADER_CACHE=<a path> (player), LONGSHOT_SHADER_STORE=<a path> (player), RX_VK_FRAME_TRACE=1 (diag), RX_VK_SHOT_H=1080 (diag), RX_VK_SHOT_W=2560 (diag)

And the game-free test, python -I -B tests/test_wide_ui.py --cc clang:

main @ 1413b1729 with this PR's first commit (the test alone):
FAIL: fixture  failed:
FAIL:2169 near(getf(list + PANE_W), 3840 / hos_wide_squeeze)
this PR:
PASS: the HUD's planner moves its layouts' side panes out to a wider screen's edges, and back
ok: hud-off
ok: keep

Screenshots, main above and this PR below, at the same spot: in the comment below (the pause menu stuck, its equipment page, the carousel's first open at Centred, back at Extended, cut off, the HUD after a change while hidden).

Risks

  • Each layout is fully recalculated for 3 presents from its first calculation after a change, as every pane was for 3 presents before. Where anything is planned (any shape but 16:9 with the HUD's own places), the game's start counts as a change, so this also holds for every layout built later (a menu as it is built), whose panes are dirty then anyway. A pane hidden inside a shown layout through those presents (another pause page, a HUD piece shown only now and then) is recalculated when shown, because its own animation or its parent's moves it, the same as on main; the in-game tests turned to every page after each switch, and the random histories turned pages in any order after switches made with the menu open or closed: every one was placed right.
  • At Centred above 16:9, the carousel has the slots of the whole width (the strip at the game's width cuts the rest off), as main already had after starting at Extended and switching.
  • Where anything is planned, the check runs for every pane the game calculates: about 8 µs a frame for 6,000 panes (Measurements). At 16:9 with the HUD's own places nothing is planned: a change forces every pane for 3 presents as on main, and no catch-up is looked up. At 16:9 and narrower, the carousel and its scroll are as on main.
  • A revert is enough. Nothing changes in saves, settings or caches.
  • #2434 ports these files to Rust (game/mods/widescreen) with the same behaviour as main (list_setup widens only at Extended); whichever lands second carries the other's change.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary A change of **Ultrawide menus** during play didn't reach everything (#2630): - **The pause menu** stayed in the middle 16:9 after a switch to Extended once one of its pages had been shown for the first time at Centred (the game places the menu's root again only then): hearts, tabs, the item grid and the equipment columns, on every page; only its background widened. After a switch to Centred, its **button bar** stayed at Extended's place. - **The item quick select's carousel** didn't follow a switch on its first open after it: - to Centred, not opened since the save loaded: the selection box empty, the item to its right; - to Centred, opened at Extended before: the whole row and its Back prompt still at Extended's width and place; - to Extended, not opened since the save loaded: the box between two items, and the right side cut off after turning right 6; - to Extended, opened at Centred before: the row cut to the middle 16:9 on both sides (its slots counted for 16:9 as the save loaded). Reopened, the misaligned ones were right; the cut ones stayed cut. Switched with the carousel open, its row widened or narrowed off by half the change, the box between two items. - **A HUD layout change made while a menu hides the HUD** (the pause menu open) didn't reach it: closed, the whole HUD was still at the old layout's place, until the layout was changed again in play. To see it on `main` at 21:9: load a save at Extended without opening the carousel; open the pause menu on Items and close it; switch to Centred in the Insert menu, open the pause menu and turn to System (its first showing), close it; switch to Extended and open it: still 16:9 on every page. For the carousel: load a save at Centred, switch to Extended before opening it, open it (between two items), turn right 6 (cut off). What changes: - After a change of the row (or of the HUD layout, or its custom placement), **each layout catches up as it is next calculated**: its panes remake their transforms for 3 presents from its first calculation after the change, whenever it is next shown. Before, every pane was forced for 3 presents after the change, and a layout hidden then missed them (the calculate pass skips hidden panes, `f_815461e0`, and panes with no dirty bits, `f_8154a730`). The pause menu's root, calculated by the game only when one of its pages is first shown, kept the tree flag of a placement at Centred, so nothing made from it was planned at Extended. Where nothing is planned before or after the change (16:9 with the HUD's own places), every pane is forced for 3 presents as before. A custom HUD placement changed from one value to another counts as a change too (Hearts and magic's, the buttons' and the minimap's). The answer kept per thread for a layout's panes within a present is kept for its resource too, as the table keeps it, so a layout let go and another built at its address catches up. - **The carousel's slots are counted for the picture's whole width whenever it is wider than 16:9**, whatever the row says, and the strip is put back to the game's width once built when Centred. The engine counts them once, at its setup as the save loads (`f_8151eb00`). Started at Extended and switched to Centred, `main` already ran this way; reopened, the row stays inside the middle 16:9. - **The carousel's scroll moves with its width.** Its engine draws from the strip's left edge less its scroll, stored at `[engine + 0x110]` and `[engine + 0xf4 + 0x14]` (`f_81522e30`). The carousel scrolls to its selection at the width it has then (`f_83794270`) and reopens there, so a width change alone moved every item by half the change. Each width set by the planner now moves the scroll by as much, so the items stay where they are on screen. - A kept list's engine is read only once its pane is still in the layout and resource it was set up in (a layout let go, the engine's memory may be another's). - The strip is never drawn wider than its slots were counted for (the picture's shape is set at start, `host/hos_main.c`; this only matters if it ever changes live, as #142 would make it in a window). Read first: `hos_wide_ui_catch_up` and the "lists kept at the screen's width" section in `game/hos_wide_ui.c`, then the new scenarios in `tests/test_wide_ui.py` (from the carousel's scroll on). Fixes #2630. See #2621 (the carousel's slot count at Extended), #1892. ## Testing **Tested:** Windows 11 Pro (26H2, build 26300), Ryzen 9 9950X3D, RTX 5090, NVIDIA 621.40, 5120x2160 (21:9). - In the game, the same key sequences on `main` @ 22d0d200 and here, driven through the game's control bridge (`HOS_CONTROL`, headless, a screenshot after each step), the save in the Shadow Temple, at 2560x1080 (21:9), 3840x1080 (32:9) and 1920x1080 (16:9): - Started at Extended: switched to Centred and back with the pause menu and the carousel closed, ~10 s between a switch and the next open. Here: the pause menu at the edges on all four pages, the carousel aligned on its first open after each switch, both sides full after turning right 6 at Extended and inside the middle 16:9 at Centred. On `main`: the pause menu stuck at 16:9 on all four pages (once its pages had first been shown at Centred), the carousel's first open after the switch to Centred off by half the extra width, and back at Extended its row cut to the middle 16:9. - Started at Centred, switched to Extended: here the carousel is aligned and full on both sides after right 6 (also at 32:9); on `main` it is cut to the middle 16:9. - Switched while the pause menu or the carousel was open: both follow each switch. - The map menu (Key Items, Threads of Time, Map), the System page's Title Screen dialog, the load list, HUD layout switched with no menu open, Full width and Centred, black bars: as on `main`. Quit to the title and loaded again after a switch: pause menu and carousel right from the first open. - 16:9 and 16:10 (1728x1080, the Steam Deck's shape): every shot of the first sequence matches `main`'s (mean difference under 2 of 255, from the animated background). - Each case of the Summary from a fresh start, one launch per case: on `main` each shows the bug as described (the pause menu only after one of its pages was first shown at Centred; opened and closed at Centred without turning a page, with 10 s or 1 s between switches and opens, it is right); here every one is right. - **Random histories:** three of 150 steps each in one running game (switches of the row with waits of 0 to 600 frames, HUD layout changes, pause pages turned, the carousel opened and turned, switches with either open, the map menu), a screenshot checked after each settled view against what the current setting should show (the pause hearts' and frame's place, the button bar's end, the carousel's row against reference shots of each position): 434 checks, none wrong. The same checker on `main`: 26 of 133 wrong, every case of the Summary among them. - HUD layout changed with the pause menu open, then closed: here the HUD is at the new layout's place (both directions); on `main` at the old one's (difference to here 8.9 and 8.6 of 255; changed in play, both alike). - Mouse (clicks posted to the game's window, windowed): after the switches that leave `main`'s pause menu at 16:9, a click on Options where it is drawn opens Options, at Extended and, switched to Centred, at Centred. - The code with the first review's changes built on `main` @ 22d0d200 and run again the same way: two random histories of 150 steps, from Extended and from Centred, 144 and 147 views checked, none wrong; 16:9 and 16:10, the first sequence: as `main`'s pictures (mean difference under 2 of 255). - This head (the second review's changes, on `main` @ 1413b1729) built on Windows beside `main` @ 1413b1729, both with DLSS 5 off (the exit fault #2807 fixes), and run the same way: - The review's case, at Custom: Hearts and magic and the buttons moved and made smaller with the pause menu open, then the menu closed: here both at their new places, as when the same change is made in play (mean difference 0.3 and 1.3 of 255); on `main` both at their old places (6.8 and 4.9). - Two random histories of 150 steps, from Extended and from Centred, 144 and 147 views checked: the pause menu, the button bar and the carousel row's place right in every one. The row's picture differs from the reference shots (taken with DLSS 5 on) by 2.0 to 3.8 of 255, against 0.5 to 2.2 before, over the checker's limit of 2.8 in 133 views; scored again by the row's edges, every one of those is the slot expected (at most 1.0, where `main`'s wrong rows score 4.3 and more). - The first sequence at 16:9 (3840x2160) and 16:10 (2560x1600): every shot as `main`'s (mean difference under 1.2 of 255). With the 21:9 picture letterboxed in a 16:9 window, the carousel follows the switches where `main`'s doesn't, as at 21:9. - No GPU fault after any of the 12 launches. - On `main` @ 22d0d200 (nightly-895), the bug's cases as in #2630#issuecomment-87829, and two diagnostic runs logging each layout's placement and the carousel's width and scroll: the pause menu's root never placed again after the switch, and the carousel's width right through a misaligned open, with its stored scroll at the old width. - `tests/test_wide_ui.py`, new: the carousel's slots counted wide at Centred and the strip drawn at the game's width once built; its scroll across switches Centred -> Extended -> Centred, and a live wider shape capped; a pause menu placed at Centred, switched to Extended while closed and opened, its column out at the edge (and back); the HUD layout changed while the HUD is hidden, then shown (both ways); at 16:9 with nothing planned, `main`'s force and no catch-up; the catch-up's window, a layout let go and rebuilt at its address (also asked again at once in the same present), and 3,000 layouts built after a change; a custom HUD placement changed from one value to another while the HUD is hidden (Hearts and magic, the buttons and the minimap, each); a kept list's engine not read once its layout is let go. The first commit adds the test alone: on `main` (a stand-in for the missing `hos_wide_ui_catch_up` that never forces) it fails first on the carousel's width, and 13 of its checks fail, 6 of them the bugs' behaviour (the carousel's width and scroll, the pause menu's column, the HUD's side); all pass here, with clang and gcc. - Each key line of the fix undone in turn (the scroll's move, the slots counted wide at Centred, the catch-up, its 3 presents, the old global force in its place, the catch-up at 16:9 with nothing planned, the width cap; since the second review, the custom placements tracked, the resource in the kept answer, the list's identity checked before its engine): the test fails each time, at the check for it. - `game/hos_wide_ui.c` and `game/oot_wide_sites.c` compiled alone with `-Wall -Wextra`, clang and gcc on Linux and llvm-mingw's clang for Windows: no warning, as on `main`; the game built with them on Windows (llvm-mingw) for the runs above. - `tests/test_wide_sites.py`: ui.calcDirty and ui.paneDirty keep their behaviour, with the catch-up beside `hos_wide_ui_force`. - `mise run test` (Ubuntu 24.04 on WSL, 32 at once) on the head, on `main` @ 1413b1729: 852 passed, 33 failed, 10 skipped (Windows-only). The same 33 fail on `main` @ 1413b1729 on this PC (852 passed there too; 14 of them since b22bfce2, fixtures behind `main`'s code, such as `pause_background_now` and `movie_now` undeclared): test_bug_report, test_cloth_kernels, test_control_picture, test_crash_record, test_crt_options, test_dev_update, test_framegen_hdr, test_framegen_resources, test_guest_holes, test_input_background, test_lifter, test_linux_pressure, test_linux_saves_move, test_loaded_modules_drop, test_log_levels, test_menu_keys, test_oot_cloth, test_option_ids, test_perf_send, test_pipeline_tour, test_present_source_crop, test_program_cache_cleanup, test_program_cache_one_variant, test_screensaver, test_switch_table, test_temporal_present_bandwidth, test_upscaler_round_trip, test_vcore_video_acquire, test_video_catchup, test_video_hold_early, test_video_input_limit, test_windows_on_linux, test_xinput_thread. `mise run lint` passes. **Still to test:** - Linux, AMD, 21:9: the Summary's two sequences (the pause menu, then the carousel): expecting the pause menu at the edges on every page, and the carousel aligned on its first open with both sides full after turning right 6 (@Beanstalk linux, amd). - Steam Deck (16:10): the Summary's two sequences: expecting the menus as on `main` (the carousel's changes apply only wider than 16:9; the catch-up applies as at 21:9, and this shape's pictures matched `main`'s on this PC) (@Beanstalk). ## Measurements **Verdict:** the bug's cases are gone in the game (screenshots in the comment below, `main` above, this PR below) and the new checks fail on `main` and pass here. The added per-pane check costs about 1.3 ns a pane; frame rates in play, in the pause menu and in the carousel are the same as `main`'s within the spread (0.4 %, 0.1 % and 0.2 % apart). Setup: Windows 11 (26H2, build 26300), Ryzen 9 9950X3D, RTX 5090, NVIDIA 621.40. Measured at 6379846b on `main` @ 22d0d200. The head adds two reviews' changes. The first (where nothing is planned, `main`'s force instead of the catch-up; the catch-up table's hash from the product's high bits; a rounding tolerance in the list's width cap; comments) leaves the work per pane at 21:9 as measured. The second (the custom placements tracked; the layout's resource in the answer kept per thread, one more load a pane; a kept list's identity checked before its engine) times the same as before it, the catch-up check alone interleaved with the first's (1.19 to 1.23 ns a pane, both). It is rebased onto `main` @ 1413b1729 as two commits (the test, then the fix); none of the 26 commits since 22d0d200 touch these files, so the numbers hold. The catch-up check timed alone (`-O2`, 40 layouts of 150 panes, 2,000 frames, two runs). In the game: `scripts/dev.py queue run --mode timing`, `main` and this PR interleaved (four pairs), each a fresh start of the Shadow Temple save at Extended, 2560x1080 headless, DLSS at 67 %, V-Sync and frame generation off, `HOS_FPS_MAX=1000`, warmed up until no frame waited for a pipeline or a shader for 5 s, then 45 s each in play, with the pause menu open and with the carousel open, from `RX_VK_FRAME_TRACE`; no cold frame in any window, the same `vk: switches set` line in all eight. The first three runs (`main` 1, this PR 1, `main` 2) ran about 5 fps lower in play than the five after them, on both sides alike, so the table takes the last two pairs, run once that had settled; every run is in the lines below the table. One pause window on each side recorded no frames (this PR's run 1, `main`'s run 3). The frame rates are the same within the spread. | | Before: main @ 22d0d200 | After: this PR @ 6379846b | |---|---|---| | the pause menu after Full width -> Extended -> Centred -> Extended, closed at each switch | 16:9 on all four pages | at the edges on all four pages | | the carousel's first open after a switch to Centred | half the extra width off | aligned | | started at Centred, switched to Extended, right 6 (21:9 and 32:9) | cut to the middle 16:9 | full | | started at Extended, to Centred and back, right 6 | cut to the middle 16:9 | full | | the pause menu, a page first shown at Centred, then Extended | 16:9 on all four pages | at the edges | | a HUD layout change with the pause menu open | the HUD at the old layout's place | at the new one's | | random histories (3 x 150 steps), views checked | 26 of 133 wrong | 0 of 434 wrong | | 16:9 and 16:10, the same sequence | | the same pictures | | in play, fps (runs 3 and 4, the median; 1% low) | 103.4 (94.2) | 103.8 (95.3) | | the pause menu open, fps (runs 3 and 4; 1% low) | 458.0 (373.1), run 4 alone | 458.4 (373.9) | | the carousel open, fps (runs 3 and 4; 1% low) | 629.1 (103.5) | 630.3 (103.5) | | `tests/test_wide_ui.py` | 13 checks fail (the first: the carousel's width) | pass | | the catch-up check, a frame of 6,000 panes | none | 7.8 / 8.0 µs (1.31 / 1.33 ns a pane); since the second review, the same as before it, timed interleaved (1.19 to 1.23 ns, both) | <details><summary>The lines the numbers come from</summary> From `RX_VK_FRAME_TRACE` (`longshot_frames.csv`), 45 s in each place, in the order run (fps, 1% low fps, frames, cold frames; "-": the window recorded no frames): ``` main-1 main @ 22d0d200 play 98.2 / 79.4 / 4418 / 0 | pause 420.9 / 314.5 / 18939 / 0 | carousel 626.8 / 95.5 / 28203 / 0 fix-1 this PR @ 6379846b play 99.0 / 85.8 / 4455 / 0 | pause - | carousel 629.5 / 98.0 / 28322 / 0 main-2 main @ 22d0d200 play 98.5 / 84.7 / 4430 / 0 | pause 432.9 / 320.5 / 19479 / 0 | carousel 628.2 / 98.7 / 28264 / 0 fix-2 this PR @ 6379846b play 103.3 / 96.2 / 4649 / 0 | pause 471.3 / 362.3 / 21207 / 0 | carousel 632.3 / 102.5 / 28452 / 0 main-3 main @ 22d0d200 play 103.2 / 93.5 / 4645 / 0 | pause - | carousel 629.5 / 103.8 / 28325 / 0 fix-3 this PR @ 6379846b play 104.0 / 95.1 / 4682 / 0 | pause 458.2 / 377.4 / 20619 / 0 | carousel 630.1 / 103.4 / 28349 / 0 main-4 main @ 22d0d200 play 103.5 / 94.9 / 4657 / 0 | pause 458.0 / 373.1 / 20610 / 0 | carousel 628.7 / 103.1 / 28289 / 0 fix-4 this PR @ 6379846b play 103.6 / 95.5 / 4663 / 0 | pause 458.6 / 370.4 / 20639 / 0 | carousel 630.5 / 103.5 / 28371 / 0 ``` The same in all eight runs: ``` [hos MainThread] vk: switches set (15): HOS_AUDIO=0 (kill), HOS_AUDIO_MUTE=1 (diag), HOS_CONTROL=longshot-perf (diag), HOS_CONTROL_MEM=ro (diag), HOS_DISCORD=0 (kill), HOS_FPS_MAX=1000 (player), HOS_HEADLESS=1 (diag), HOS_WINDOW_NOACTIVATE=1 (diag), HOS_WINDOW_SIZE=2560x1080 (tune), LONGSHOT_PROFILE=<a path> (player), LONGSHOT_SHADER_CACHE=<a path> (player), LONGSHOT_SHADER_STORE=<a path> (player), RX_VK_FRAME_TRACE=1 (diag), RX_VK_SHOT_H=1080 (diag), RX_VK_SHOT_W=2560 (diag) ``` And the game-free test, `python -I -B tests/test_wide_ui.py --cc clang`: ``` main @ 1413b1729 with this PR's first commit (the test alone): FAIL: fixture failed: FAIL:2169 near(getf(list + PANE_W), 3840 / hos_wide_squeeze) this PR: PASS: the HUD's planner moves its layouts' side panes out to a wider screen's edges, and back ok: hud-off ok: keep ``` </details> Screenshots, `main` above and this PR below, at the same spot: in the comment below (the pause menu stuck, its equipment page, the carousel's first open at Centred, back at Extended, cut off, the HUD after a change while hidden). ## Risks - **Each layout is fully recalculated for 3 presents from its first calculation after a change**, as every pane was for 3 presents before. Where anything is planned (any shape but 16:9 with the HUD's own places), the game's start counts as a change, so this also holds for every layout built later (a menu as it is built), whose panes are dirty then anyway. A pane hidden inside a shown layout through those presents (another pause page, a HUD piece shown only now and then) is recalculated when shown, because its own animation or its parent's moves it, the same as on `main`; the in-game tests turned to every page after each switch, and the random histories turned pages in any order after switches made with the menu open or closed: every one was placed right. - **At Centred above 16:9, the carousel has the slots of the whole width** (the strip at the game's width cuts the rest off), as `main` already had after starting at Extended and switching. - **Where anything is planned, the check runs for every pane the game calculates**: about 8 µs a frame for 6,000 panes (Measurements). At 16:9 with the HUD's own places nothing is planned: a change forces every pane for 3 presents as on `main`, and no catch-up is looked up. At 16:9 and narrower, the carousel and its scroll are as on `main`. - A revert is enough. Nothing changes in saves, settings or caches. - #2434 ports these files to Rust (`game/mods/widescreen`) with the same behaviour as `main` (`list_setup` widens only at Extended); whichever lands second carries the other's change. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The checks for #2630, before its fix: on main they fail for the bug.

- The item quick select's list counts its slots for the picture's whole
  width at Centred too, and is drawn at the game's width once built; its
  scroll moves with its width across switches, and a live wider shape is
  capped at what its slots were counted for.
- A pause menu placed at Centred, switched to Extended while closed and
  opened: its column out at the edge, and back.
- The HUD layout changed while the HUD is hidden (the pause menu open),
  then shown: its side follows the row, both ways.
- The catch-up's window, a layout let go and rebuilt at its address, and
  3,000 layouts built after a change.

main has no hos_wide_ui_catch_up: a stand-in that never forces, so the
check fails there on the carousel's width, not on a missing function.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012w3Td4tpZNoc9ZWbbfNyrH
fix(ui): menus and the item quick select follow a live switch of Ultrawide menus
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
cee3dfcc7b
A switch of the Ultrawide menus row (or of the HUD layout or its custom
placement) forced every pane to remake its transform for 3 presents. A layout
hidden then missed it: the calculate pass skips hidden panes and panes with no
dirty bits. So the pause menu stayed at 16:9 after a switch to Extended once
one of its pages had first been shown at Centred (its root, calculated again
only then, still noted as placed at Centred), its button bar stayed at
Extended's place after one to Centred, and a HUD layout changed with the pause
menu open didn't reach the HUD.

- Each layout now catches up for 3 presents from its first calculation
  after a change, whenever it is next shown (hos_wide_ui_catch_up, read by
  ui.calcDirty and ui.paneDirty beside hos_wide_ui_force). Where nothing is
  planned before or after the change (16:9 with the HUD's own places),
  every pane is forced for 3 presents as before.
- The item quick select's list counts its slots for the picture's whole
  width whatever the row says, and is drawn at the game's width when Centred.
  Counted at 16:9 its right side was cut off after a switch to Extended.
- Its engine's scroll moves by half each width change, so its first open
  after a switch, or a switch with it open, is no longer off by half the
  change.
- The list is never drawn wider than its slots were counted for.

Fixes #2630

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012w3Td4tpZNoc9ZWbbfNyrH
Author
Contributor

Tested in game: Windows 11 (26H2, build 26300), Ryzen 9 9950X3D, RTX 5090, NVIDIA 621.40; Shadow Temple save at 21:9 (2560x1080), also 32:9, 16:9 and 16:10, through the control bridge with a screenshot after each step, main @ 22d0d200 and this PR built on it: the pause menu (every page), its button bar, the item quick select and the HUD after live switches of Ultrawide menus and of the HUD layout, with the menus closed, open and the HUD hidden. Every case in #2630 right here and wrong on main; 5 random histories of 150 steps, 725 views checked, none wrong (main: 26 of 133 wrong); 16:9 and 16:10 the same pictures as main; frame rates as main's.

Tested in game: Windows 11 (26H2, build 26300), Ryzen 9 9950X3D, RTX 5090, NVIDIA 621.40; Shadow Temple save at 21:9 (2560x1080), also 32:9, 16:9 and 16:10, through the control bridge with a screenshot after each step, main @ 22d0d200 and this PR built on it: the pause menu (every page), its button bar, the item quick select and the HUD after live switches of Ultrawide menus and of the HUD layout, with the menus closed, open and the HUD hidden. Every case in #2630 right here and wrong on main; 5 random histories of 150 steps, 725 views checked, none wrong (main: 26 of 133 wrong); 16:9 and 16:10 the same pictures as main; frame rates as main's.
Author
Contributor

Screenshots at the same spot, main @ 22d0d200 above and this PR below, 21:9 (2560x1080), the Shadow Temple save:

  1. The pause menu at Extended after a page was first shown at Centred: on main still 16:9.
    the pause menu after the switch to Extended
  2. The same, its equipment page.
    the equipment page
  3. The item quick select's first open after a switch to Centred: on main off by half the extra width.
    the carousel's first open at Centred
  4. Back at Extended, the carousel's first open.
    the carousel back at Extended
  5. Then turned right 6: on main cut to the middle 16:9.
    the carousel after turning right 6
  6. The HUD after a HUD layout change made with the pause menu open: on main at the old layout's place.
    the HUD after a change while hidden
Screenshots at the same spot, `main` @ 22d0d200 above and this PR below, 21:9 (2560x1080), the Shadow Temple save: 1. The pause menu at Extended after a page was first shown at Centred: on `main` still 16:9. ![the pause menu after the switch to Extended](https://git.magicbean.dev/attachments/1fd199ce-35e3-44f4-9856-424fc5a50b86) 2. The same, its equipment page. ![the equipment page](https://git.magicbean.dev/attachments/1b5073c7-3500-4701-9666-ff2d255dee73) 3. The item quick select's first open after a switch to Centred: on `main` off by half the extra width. ![the carousel's first open at Centred](https://git.magicbean.dev/attachments/55256d74-75ab-4bbc-b104-3a1b186201d2) 4. Back at Extended, the carousel's first open. ![the carousel back at Extended](https://git.magicbean.dev/attachments/bf092c20-664f-43b6-a818-dd1b49a3e0c5) 5. Then turned right 6: on `main` cut to the middle 16:9. ![the carousel after turning right 6](https://git.magicbean.dev/attachments/4554dc5f-a8fc-4ef1-b88d-a40a6ef12bd7) 6. The HUD after a HUD layout change made with the pause menu open: on `main` at the old layout's place. ![the HUD after a change while hidden](https://git.magicbean.dev/attachments/c0b17733-21e6-4c3f-b83e-79ddbb4e291e)
bulldogsajr22 changed title from WIP: fix(ui): menus and the item quick select follow a live switch of Ultrawide menus to fix(ui): menus and the item quick select follow a live switch of Ultrawide menus 2026-11-29 01:07:04 +00:00
Author
Contributor

@Beanstalk linux, amd, and a Steam Deck: this head (HEAD) against main @ b22bfce2, the same steps on each.

  1. Graphics: on Linux AMD, Aspect ratio 21:9 and Output resolution 2560x1080; on the Steam Deck, its own shape (the default, 16:10). Restart the game so it applies from the start.
  2. The pause menu. Ultrawide menus (Insert menu) at Extended. Load the repo save kokiri-start and don't open the item quick select. Open the pause menu on Items and close it. Switch Ultrawide menus to Centred, open the pause menu, turn to System (its first showing), close it. Switch to Extended, open the pause menu: a screenshot of each of its four pages.
  3. The item quick select. Ultrawide menus at Centred, then restart the game. Load kokiri-start; on the Insert menu's Debug tab, Inventory: unlock all Items. Switch Ultrawide menus to Extended before opening the item quick select. Open it: a screenshot; turn right 6 times: a screenshot.

Expected on this PR at 21:9: in step 2 the pause menu's hearts, tabs and columns out at the screen's edges on every page; in step 3 the selection box on an item at the first open, and the row full to both edges after turning right 6. On main at 21:9: step 2's pause menu stays in the middle 16:9 on every page (only its background wide); step 3's box sits between two items, and after turning right 6 the row's right side is cut off. On the Steam Deck: every screenshot as on main (nothing in this PR applies narrower than 16:9 but the catch-up, which places the same as before there).

@Beanstalk linux, amd, and a Steam Deck: this head (`HEAD`) against `main` @ b22bfce2, the same steps on each. 1. Graphics: on Linux AMD, Aspect ratio **21:9** and Output resolution **2560x1080**; on the Steam Deck, its own shape (the default, 16:10). Restart the game so it applies from the start. 2. **The pause menu.** Ultrawide menus (Insert menu) at **Extended**. Load the repo save `kokiri-start` and don't open the item quick select. Open the pause menu on Items and close it. Switch Ultrawide menus to **Centred**, open the pause menu, turn to **System** (its first showing), close it. Switch to **Extended**, open the pause menu: a screenshot of each of its four pages. 3. **The item quick select.** Ultrawide menus at **Centred**, then restart the game. Load `kokiri-start`; on the Insert menu's Debug tab, Inventory: unlock all Items. Switch Ultrawide menus to **Extended** before opening the item quick select. Open it: a screenshot; turn right 6 times: a screenshot. Expected on this PR at 21:9: in step 2 the pause menu's hearts, tabs and columns out at the screen's edges on every page; in step 3 the selection box on an item at the first open, and the row full to both edges after turning right 6. On `main` at 21:9: step 2's pause menu stays in the middle 16:9 on every page (only its background wide); step 3's box sits between two items, and after turning right 6 the row's right side is cut off. On the Steam Deck: every screenshot as on `main` (nothing in this PR applies narrower than 16:9 but the catch-up, which places the same as before there).
Member

@bulldogsajr22 only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for cee3dfc, and the PR has changed since (f08ed9a), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@bulldogsajr22 only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `cee3dfc`, and the PR has changed since (`f08ed9a`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
Contributor

Why the Measurements still hold on this head (main @ b22bfce2), measured on main @ 22d0d200:

  • The 10 commits between (22d0d200..b22bfce2, #2728, #2724, #2743, #2750, #2736, #2732, #2730, #2741, #2760, #2731) touch none of this PR's files (game/hos_wide_ui.c, game/oot_wide_sites.c, tests/test_wide_ui.py, tests/test_wide_sites.py). Those that change the game's code (foliage impostors on the performance path, a Maxwell-only BC4 workaround, the Lens eye pass's scan, logs, audio, mods) may move both sides' frame rates alike, not what this PR adds: the catch-up check per pane, timed alone at about 1.3 ns a pane.
  • The head's review changes after the measured 6379846b (main's force where nothing is planned, the table's hash, a rounding tolerance in the width cap, comments) leave the work per pane at 21:9 as measured; that code built on 22d0d200 was checked again in the game (two random histories, 291 views, none wrong; 16:9 and 16:10 as main's pictures).
Why the Measurements still hold on this head (`main` @ b22bfce2), measured on `main` @ 22d0d200: - The 10 commits between (22d0d200..b22bfce2, #2728, #2724, #2743, #2750, #2736, #2732, #2730, #2741, #2760, #2731) touch none of this PR's files (`game/hos_wide_ui.c`, `game/oot_wide_sites.c`, `tests/test_wide_ui.py`, `tests/test_wide_sites.py`). Those that change the game's code (foliage impostors on the performance path, a Maxwell-only BC4 workaround, the Lens eye pass's scan, logs, audio, mods) may move both sides' frame rates alike, not what this PR adds: the catch-up check per pane, timed alone at about 1.3 ns a pane. - The head's review changes after the measured 6379846b (`main`'s force where nothing is planned, the table's hash, a rounding tolerance in the width cap, comments) leave the work per pane at 21:9 as measured; that code built on 22d0d200 was checked again in the game (two random histories, 291 views, none wrong; 16:9 and 16:10 as `main`'s pictures).
Member
@review
BeanBot left a comment

Recommendation: Approve. The reported game runs show the menu and HUD fixes working, with frame rates within the measured spread. The requested Linux AMD and Steam Deck runs and the head’s CI checks are still pending. Nothing blocking is left. Recommend approval; not approved on the forge.

The change makes the pause menu, item carousel and hidden HUD catch up after live layout changes. It adds per-pane catch-up bookkeeping and list scroll tracking; the reported cost is about 1.3 ns per pane on the tested PC.

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes. On the author’s Windows RTX 5090 runs, the reported bug cases reproduced on main and were corrected by the change; 725 views across five random histories had no reported errors. The game-free checks reportedly fail on main and pass with the fix.

Other systems: The change affects layout calculation and list placement on Windows and Linux, including narrower screens. Windows runs covered 21:9, 32:9, 16:9 and 16:10; Linux AMD and Steam Deck runs remain pending.

Switches: None added, changed or removed.

Reviewed: cee3dfcc7b against b22bfce247: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, commit messages and the four changed files and their diff, with surrounding layout and hook code. The named docs/review-checklist.md and sibling Tooling checkout were absent. Skimmed the recorded run results and screenshots’ descriptions; screenshots themselves were unavailable. No translations or generated files changed.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance trailers.
  • No game files, generated files, renderer API definitions or switch table entries are changed.
  • The new checks exercise width, scroll and catch-up behavior and the author reports mutation checks for the key lines.

Testing: No code or tests were run during review. The author reports game-free checks and Windows game runs; CI and the requested Linux AMD and Steam Deck runs remain pending.

Overlaps and merge order: The description identifies #2434 as an overlapping Rust port; whichever merges second must carry the other change.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The reported game runs show the menu and HUD fixes working, with frame rates within the measured spread. The requested Linux AMD and Steam Deck runs and the head’s CI checks are still pending. Nothing blocking is left. Recommend approval; not approved on the forge. The change makes the pause menu, item carousel and hidden HUD catch up after live layout changes. It adds per-pane catch-up bookkeeping and list scroll tracking; the reported cost is about 1.3 ns per pane on the tested PC. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. On the author’s Windows RTX 5090 runs, the reported bug cases reproduced on main and were corrected by the change; 725 views across five random histories had no reported errors. The game-free checks reportedly fail on main and pass with the fix. **Other systems:** The change affects layout calculation and list placement on Windows and Linux, including narrower screens. Windows runs covered 21:9, 32:9, 16:9 and 16:10; Linux AMD and Steam Deck runs remain pending. **Switches:** None added, changed or removed. **Reviewed:** cee3dfcc7b8c against b22bfce247dd: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, commit messages and the four changed files and their diff, with surrounding layout and hook code. The named docs/review-checklist.md and sibling Tooling checkout were absent. Skimmed the recorded run results and screenshots’ descriptions; screenshots themselves were unavailable. No translations or generated files changed.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance trailers. - No game files, generated files, renderer API definitions or switch table entries are changed. - The new checks exercise width, scroll and catch-up behavior and the author reports mutation checks for the key lines. **Testing:** No code or tests were run during review. The author reports game-free checks and Windows game runs; CI and the requested Linux AMD and Steam Deck runs remain pending. **Overlaps and merge order:** The description identifies #2434 as an overlapping Rust port; whichever merges second must carry the other change. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
futondestroyer left a comment

Recommendation: Request changes. The Windows evidence supports the ultrawide menu fix. Two paths still bypass the per-layout catch-up guarantee.

  1. Track the effective custom HUD settings, game/hos_wide_ui.c:1298. Changing Hearts and magic or Action and item buttons from one non-default position or scale to another leaves place_groups and transform true. The current signature omits the packed values, so generation stays the same. The transform change sets the old global force for two presents in plan(). A HUD hidden through those presents can still miss the update. Track the effective packed options as generation inputs and exercise the hidden HUD with a change from one custom value to another.
  2. Identify the layout lifetime on the TLS fast path, game/hos_wide_ui.c:818. The fast path returns before it loads the resource. After an expired layout is replaced at the same address on the same thread and present, the replacement can inherit the old layout's false result. The new fixture queries a different layout between the original and replacement, discarding the very cache entry that needs testing. Evaluate the replacement directly after the old lookup in the same present and validate identity before returning a cached result.

The list's cached engine is read before checking the incoming pane's current layout/resource, also worth guarding at game/hos_wide_ui.c:1392. An old pane address can be reused after teardown; verify the live pane identity first and make invalidation testable before following the old engine's owner. This is a source-level lifetime risk, with no crash observed in the author's runs.

Evidence. The author reports five Windows RTX 5090 random histories with 0/725 incorrect views and a baseline with 26/133 incorrect. The matched 21:9 comparison measured 103.4 vs 103.8 FPS in play, 458.0 vs 458.4 in Pause and 629.1 vs 630.3 in the carousel, within spread. The measurements use the earlier functional head 6379846b on 22d0d200, and the author reran two visual histories with the final source. The real merge base is b22bfce2, with the live Forge target at 01d6878b. The four files touched here are unchanged between those base commits. The description check passed. All 10 workflow jobs are blocked by required conditions, and the previously requested Linux AMD/Steam Deck farm run still awaits BigBeans approval. CI · Farm status

Overlap. The merged #95 introduced the HUD planner this modifies. The closed #287 is a different fix for keeping ultrawide side bars closed during area loading. The active overlap is the draft Rust widescreen migration #2434, which will need to carry whichever behavior lands first. No switches changed.

Exact review head: cee3dfcc7b. Reviewed the complete four-file diff and relevant callers and fixtures. Code-only review.

**Recommendation: Request changes.** The Windows evidence supports the ultrawide menu fix. Two paths still bypass the per-layout catch-up guarantee. 1. **Track the effective custom HUD settings, game/hos_wide_ui.c:1298.** Changing Hearts and magic or Action and item buttons from one non-default position or scale to another leaves `place_groups` and `transform` true. The current signature omits the packed values, so generation stays the same. The transform change sets the old global force for two presents in `plan()`. A HUD hidden through those presents can still miss the update. Track the effective packed options as generation inputs and exercise the hidden HUD with a change from one custom value to another. 2. **Identify the layout lifetime on the TLS fast path, game/hos_wide_ui.c:818.** The fast path returns before it loads the resource. After an expired layout is replaced at the same address on the same thread and present, the replacement can inherit the old layout's false result. The new fixture queries a different layout between the original and replacement, discarding the very cache entry that needs testing. Evaluate the replacement directly after the old lookup in the same present and validate identity before returning a cached result. The list's cached engine is read before checking the incoming pane's current layout/resource, also worth guarding at `game/hos_wide_ui.c:1392`. An old pane address can be reused after teardown; verify the live pane identity first and make invalidation testable before following the old engine's owner. This is a source-level lifetime risk, with no crash observed in the author's runs. **Evidence.** The author reports five Windows RTX 5090 random histories with 0/725 incorrect views and a baseline with 26/133 incorrect. The matched 21:9 comparison measured 103.4 vs 103.8 FPS in play, 458.0 vs 458.4 in Pause and 629.1 vs 630.3 in the carousel, within spread. The measurements use the earlier functional head `6379846b` on `22d0d200`, and the author reran two visual histories with the final source. The real merge base is `b22bfce2`, with the live Forge target at `01d6878b`. The four files touched here are unchanged between those base commits. The description check passed. All 10 workflow jobs are blocked by required conditions, and the previously requested Linux AMD/Steam Deck farm run still awaits BigBeans approval. [CI](https://git.magicbean.dev/MagicBeanDev/Longshot/actions/runs/57211) · [Farm status](https://beanstalk.magicbean.dev/prs/2767) **Overlap.** The merged #95 introduced the HUD planner this modifies. The closed #287 is a different fix for keeping ultrawide side bars closed during area loading. The active overlap is the draft Rust widescreen migration #2434, which will need to carry whichever behavior lands first. No switches changed. Exact review head: cee3dfcc7b8c0fb86362bc07706bb23d4d8baf6e. Reviewed the complete four-file diff and relevant callers and fixtures. Code-only review.
@ -781,0 +815,4 @@
if (!layout) return 0;
const uint32_t present = __atomic_load_n(&ui_presents, __ATOMIC_RELAXED);
static _Thread_local struct { uint64_t layout; uint32_t present, generation; int force; } last; /* (a layout's panes come together) */
if (last.layout == layout && last.present == present && last.generation == generation) return last.force;
Member

[P2] Validate the current resource before returning the TLS result. A new layout at the same address in the same present can reuse a false result. The existing fixture first queries a different layout, replacing the TLS entry; test immediate reuse instead.

[P2] Validate the current resource before returning the TLS result. A new layout at the same address in the same present can reuse a false result. The existing fixture first queries a different layout, replacing the TLS entry; test immediate reuse instead.
@ -1237,9 +1298,12 @@ void hos_wide_ui_tick(void) {
const float now[13] = {ex, ey, fit, (float)on, r, fill_x, fill_y, (float)fade_free, (float)transform, (float)place_groups,
Member

[P2] Include effective custom Health and Buttons options in the catch-up signature. A change between nondefault positions or scales leaves these booleans unchanged. A hidden HUD can miss the short global force window and reopen stale. Add a hidden-layout adjustment test.

[P2] Include effective custom Health and Buttons options in the catch-up signature. A change between nondefault positions or scales leaves these booleans unchanged. A hidden HUD can miss the short global force window and reopen stale. Add a hidden-layout adjustment test.
bulldogsajr22 force-pushed fix/ultrawide-menus-live from cee3dfcc7b
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to f08ed9af30
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 9s
beanstalk/approval waiting for a BigBean's 👍 on the request
2026-11-29 17:02:04 +00:00
Compare
Author
Contributor

Pushed f08ed9af3 (ea56666b1 the test, then the fix, rebased onto main @ 1413b1729), answering @futondestroyer's review (#2767 (comment)). Thanks, all three were real gaps:

  1. The effective custom HUD placements are tracked (inline). hos_wide_ui_tick now keeps Hearts and magic's, the buttons' and the minimap's effective placements (the default where the layout isn't Custom), and any change of them starts the catch-up, from one custom value to another too. Before, only the minimap's did. New check: at Custom, Hearts and magic, then the buttons, then the minimap, each moved and made smaller while the HUD is hidden, then its root calculated again: it catches up each time. With any one of the three left out of the comparison, the check fails there.
  2. The cached answer is checked against the layout's resource (inline). hos_wide_ui_catch_up loads the layout's resource before the per-thread fast path and keeps it in the cached key, which is the identity the table already used. The fixture now asks the old layout, swaps in a new one at the same address, and asks again at once in the same present, with nothing in between: it catches up. With the resource left out of the key, it gets the old false and the check fails.
  3. A kept list's engine is followed only after its pane's identity is checked. kept_list first checks that the pane's live layout is the one the engine was set up in, with the same resource, and only then reads the engine's owner and pane index. The conditions are the same, in an order that never reads a let-go engine. New check: the list's layout let go and rebuilt at its address, the engine's memory left behind; the next frames don't read the engine (its owner's address is watched) and don't move its scroll. With the engine read first, the check fails.

Each new check fails with its own change undone and passes here, with clang and gcc. game/hos_wide_ui.c compiles with no warning with llvm-mingw for Windows and with gcc and clang on Linux, as before; test_hud_layout.py, test_hud_layout_row.py, test_title_card_*.py and test_wide_sites.py (the other checks that read it) pass. The description's Testing says what ran in the game on this head.

Pushed `f08ed9af3` (`ea56666b1` the test, then the fix, rebased onto `main` @ 1413b1729), answering @futondestroyer's review (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2767#issuecomment-90215). Thanks, all three were real gaps: 1. **The effective custom HUD placements are tracked** ([inline](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2767#issuecomment-90213)). `hos_wide_ui_tick` now keeps Hearts and magic's, the buttons' and the minimap's effective placements (the default where the layout isn't Custom), and any change of them starts the catch-up, from one custom value to another too. Before, only the minimap's did. New check: at Custom, Hearts and magic, then the buttons, then the minimap, each moved and made smaller while the HUD is hidden, then its root calculated again: it catches up each time. With any one of the three left out of the comparison, the check fails there. 2. **The cached answer is checked against the layout's resource** ([inline](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2767#issuecomment-90214)). `hos_wide_ui_catch_up` loads the layout's resource before the per-thread fast path and keeps it in the cached key, which is the identity the table already used. The fixture now asks the old layout, swaps in a new one at the same address, and asks again at once in the same present, with nothing in between: it catches up. With the resource left out of the key, it gets the old `false` and the check fails. 3. **A kept list's engine is followed only after its pane's identity is checked.** `kept_list` first checks that the pane's live layout is the one the engine was set up in, with the same resource, and only then reads the engine's owner and pane index. The conditions are the same, in an order that never reads a let-go engine. New check: the list's layout let go and rebuilt at its address, the engine's memory left behind; the next frames don't read the engine (its owner's address is watched) and don't move its scroll. With the engine read first, the check fails. Each new check fails with its own change undone and passes here, with clang and gcc. `game/hos_wide_ui.c` compiles with no warning with llvm-mingw for Windows and with gcc and clang on Linux, as before; `test_hud_layout.py`, `test_hud_layout_row.py`, `test_title_card_*.py` and `test_wide_sites.py` (the other checks that read it) pass. The description's Testing says what ran in the game on this head.
Author
Contributor

@Beanstalk linux, amd, and a Steam Deck: this head (f08ed9a, after futondestroyer's review) against main @ 1413b1729, the same steps on each. (Asked again: the earlier request was for cee3dfc.)

  1. Graphics: on Linux AMD, Aspect ratio 21:9 and Output resolution 2560x1080; on the Steam Deck, its own shape (the default, 16:10). Restart the game so it applies from the start.
  2. The pause menu. Ultrawide menus (Insert menu) at Extended. Load the repo save kokiri-start and don't open the item quick select. Open the pause menu on Items and close it. Switch Ultrawide menus to Centred, open the pause menu, turn to System (its first showing), close it. Switch to Extended, open the pause menu: a screenshot of each of its four pages.
  3. The item quick select. Ultrawide menus at Centred, then restart the game. Load kokiri-start; on the Insert menu's Debug tab, Inventory: unlock all Items. Switch Ultrawide menus to Extended before opening the item quick select. Open it: a screenshot; turn right 6 times: a screenshot.
  4. The HUD moved while hidden (the review's case). Insert menu, Graphics: HUD layout Custom, Hearts and magic horizontal -10 and Action and item buttons horizontal -10. In play, open the pause menu, then the Insert menu over it: set both horizontals to 10 and both sizes to 85; close both: a screenshot. Then set both horizontals to 0 and back to 10 in play: a screenshot.

Expected on this PR at 21:9: in step 2 the pause menu's hearts, tabs and columns out at the screen's edges on every page; in step 3 the selection box on an item at the first open, and the row full to both edges after turning right 6. On main at 21:9: step 2's pause menu stays in the middle 16:9 on every page (only its background wide); step 3's box sits between two items, and after turning right 6 the row's right side is cut off. Step 4, here: both screenshots alike, Hearts and magic and the buttons at their new places; on main the first shows them at their old places. On the Steam Deck: every screenshot as on main (nothing in this PR applies narrower than 16:9 but the catch-up, which places the same as before there).

@Beanstalk linux, amd, and a Steam Deck: this head (`f08ed9a`, after futondestroyer's review) against `main` @ 1413b1729, the same steps on each. (Asked again: the earlier request was for `cee3dfc`.) 1. Graphics: on Linux AMD, Aspect ratio **21:9** and Output resolution **2560x1080**; on the Steam Deck, its own shape (the default, 16:10). Restart the game so it applies from the start. 2. **The pause menu.** Ultrawide menus (Insert menu) at **Extended**. Load the repo save `kokiri-start` and don't open the item quick select. Open the pause menu on Items and close it. Switch Ultrawide menus to **Centred**, open the pause menu, turn to **System** (its first showing), close it. Switch to **Extended**, open the pause menu: a screenshot of each of its four pages. 3. **The item quick select.** Ultrawide menus at **Centred**, then restart the game. Load `kokiri-start`; on the Insert menu's Debug tab, Inventory: unlock all Items. Switch Ultrawide menus to **Extended** before opening the item quick select. Open it: a screenshot; turn right 6 times: a screenshot. 4. **The HUD moved while hidden** (the review's case). Insert menu, Graphics: HUD layout **Custom**, Hearts and magic horizontal **-10** and Action and item buttons horizontal **-10**. In play, open the pause menu, then the Insert menu over it: set both horizontals to **10** and both sizes to **85**; close both: a screenshot. Then set both horizontals to 0 and back to 10 in play: a screenshot. Expected on this PR at 21:9: in step 2 the pause menu's hearts, tabs and columns out at the screen's edges on every page; in step 3 the selection box on an item at the first open, and the row full to both edges after turning right 6. On `main` at 21:9: step 2's pause menu stays in the middle 16:9 on every page (only its background wide); step 3's box sits between two items, and after turning right 6 the row's right side is cut off. Step 4, here: both screenshots alike, Hearts and magic and the buttons at their new places; on `main` the first shows them at their old places. On the Steam Deck: every screenshot as on `main` (nothing in this PR applies narrower than 16:9 but the catch-up, which places the same as before there).
Member

@bulldogsajr22 only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@bulldogsajr22 only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Some checks are pending
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 9s
beanstalk/approval waiting for a BigBean's 👍 on the request
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/ultrawide-menus-live:bulldogsajr22-fix/ultrawide-menus-live'
git switch 'bulldogsajr22-fix/ultrawide-menus-live'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2767
No description provided.