fix(ui): menus and the item quick select follow a live switch of Ultrawide menus #2767
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2767
Loading…
Reference in a new issue
No description provided.
Delete branch "bulldogsajr22/Longshot:fix/ultrawide-menus-live"
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
A change of Ultrawide menus during play didn't reach everything (#2630):
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.
To see it on
mainat 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:
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.f_8151eb00). Started at Extended and switched to Centred,mainalready ran this way; reopened, the row stays inside the middle 16:9.[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.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_upand the "lists kept at the screen's width" section ingame/hos_wide_ui.c, then the new scenarios intests/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).
main@22d0d200and 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):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.mainit is cut to the middle 16:9.main. Quit to the title and loaded again after a switch: pause menu and carousel right from the first open.main's (mean difference under 2 of 255, from the animated background).maineach 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.main: 26 of 133 wrong, every case of the Summary among them.mainat the old one's (difference to here 8.9 and 8.6 of 255; changed in play, both alike).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.main@22d0d200and 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: asmain's pictures (mean difference under 2 of 255).main@1413b1729) built on Windows besidemain@1413b1729, both with DLSS 5 off (the exit fault #2807 fixes), and run the same way:mainboth at their old places (6.8 and 4.9).main's wrong rows score 4.3 and more).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 wheremain's doesn't, as at 21:9.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: onmain(a stand-in for the missinghos_wide_ui_catch_upthat 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.game/hos_wide_ui.candgame/oot_wide_sites.ccompiled alone with-Wall -Wextra, clang and gcc on Linux and llvm-mingw's clang for Windows: no warning, as onmain; 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 besidehos_wide_ui_force.mise run test(Ubuntu 24.04 on WSL, 32 at once) on the head, onmain@1413b1729: 852 passed, 33 failed, 10 skipped (Windows-only). The same 33 fail onmain@1413b1729on this PC (852 passed there too; 14 of them sinceb22bfce2, fixtures behindmain's code, such aspause_background_nowandmovie_nowundeclared): 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 lintpasses.Still to test:
main(the carousel's changes apply only wider than 16:9; the catch-up applies as at 21:9, and this shape's pictures matchedmain's on this PC) (@Beanstalk).Measurements
Verdict: the bug's cases are gone in the game (screenshots in the comment below,
mainabove, this PR below) and the new checks fail onmainand 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 asmain'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 ontomain@1413b1729as two commits (the test, then the fix); none of the 26 commits since22d0d200touch 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,mainand 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, fromRX_VK_FRAME_TRACE; no cold frame in any window, the samevk: switches setline in all eight. The first three runs (main1, this PR 1,main2) 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.22d0d200tests/test_wide_ui.pyThe 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):The same in all eight runs:
And the game-free test,
python -I -B tests/test_wide_ui.py --cc clang:Screenshots,
mainabove 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
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.mainalready had after starting at Extended and switching.main, and no catch-up is looked up. At 16:9 and narrower, the carousel and its scroll are as onmain.game/mods/widescreen) with the same behaviour asmain(list_setupwidens only at Extended); whichever lands second carries the other's change.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.tests/that reads changed source is updated, not weakened.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
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 @
22d0d200and 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.Screenshots at the same spot,
main@22d0d200above and this PR below, 21:9 (2560x1080), the Shadow Temple save:mainstill 16:9.mainoff by half the extra width.maincut to the middle 16:9.mainat the old layout's place.WIP: fix(ui): menus and the item quick select follow a live switch of Ultrawide menusto fix(ui): menus and the item quick select follow a live switch of Ultrawide menus@Beanstalk linux, amd, and a Steam Deck: this head (
HEAD) againstmain@b22bfce2, the same steps on each.kokiri-startand 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.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
mainat 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 onmain(nothing in this PR applies narrower than 16:9 but the catch-up, which places the same as before there).@bulldogsajr22 only members of
BigBeanscan start the farm.One of them can approve this request by reacting 👍 to it or to this comment.This request was forcee3dfc, and the PR has changed since (f08ed9a), so a 👍 no longer approves it. Comment@Beanstalkagain to ask for the new commit.Why the Measurements still hold on this head (
main@b22bfce2), measured onmain@22d0d200: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.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 on22d0d200was checked again in the game (two random histories, 291 views, none wrong; 16:9 and 16:10 asmain's pictures).@review
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:
cee3dfcc7bagainstb22bfce247: 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:
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: Request changes. The Windows evidence supports the ultrawide menu fix. Two paths still bypass the per-layout catch-up guarantee.
place_groupsandtransformtrue. The current signature omits the packed values, so generation stays the same. The transform change sets the old global force for two presents inplan(). 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.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
6379846bon22d0d200, and the author reran two visual histories with the final source. The real merge base isb22bfce2, with the live Forge target at01d6878b. 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 statusOverlap. 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.@ -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;[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,[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.
cee3dfcc7bf08ed9af30Pushed
f08ed9af3(ea56666b1the test, then the fix, rebased ontomain@1413b1729), answering @futondestroyer's review (#2767 (comment)). Thanks, all three were real gaps:hos_wide_ui_ticknow 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.hos_wide_ui_catch_uploads 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 oldfalseand the check fails.kept_listfirst 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.ccompiles 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_*.pyandtest_wide_sites.py(the other checks that read it) pass. The description's Testing says what ran in the game on this head.@Beanstalk linux, amd, and a Steam Deck: this head (
f08ed9a, after futondestroyer's review) againstmain@1413b1729, the same steps on each. (Asked again: the earlier request was forcee3dfc.)kokiri-startand 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.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
mainat 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; onmainthe first shows them at their old places. On the Steam Deck: every screenshot as onmain(nothing in this PR applies narrower than 16:9 but the catch-up, which places the same as before there).@bulldogsajr22 only members of
BigBeanscan start the farm. One of them can approve this request by reacting 👍 to it or to this comment.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.