fix(ui): the area title card's frame reaches the HUD's sides on wider screens #1841
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1841
Loading…
Reference in a new issue
No description provided.
Delete branch "PirateKingIsh/Longshot:fix/title-card-hud-sides"
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
On a screen wider than 16:9, leave Link's house for the first time: the large area title card keeps its ornamental frame centred at the original width while the game fills the screen. This change extends the connecting lines to the HUD's sides and keeps the corner and middle ornaments at their original size. It draws the same artwork in three strips per quarter, including the shadows.
The frame follows the existing HUD reach: the screen's sides on supported ultrawide shapes, the middle 12:5 at 32:9, and the middle 16:9 at 48:9. Middle 16:9 HUD layout, 16:9 pictures and narrower pictures retain the original drawing. Narrower screens are not fixed by this change. Refs #1699.
The old RULE_WIDEN entries never acted on these eight panes: that rule accepts a horizontal midpoint near zero, while the quarter panes have midpoints at -960 and +960. Applying a whole-pane stretch would also stretch the baked ornaments. Read
host/hos_wide_ui.cfor the strip preparation and drawing, thennx2/oot_wide.pyand its integration innx2/oot_patches.py. The planner publishes the HUD choice once per frame; preparation records it for each pane, and drawing consumes that record even during a live HUD-layout change. Missing or changed lift anchors warn and restore preparation, drawing and arena reset before compilation. Records may be reused while their constants remain alive; the game's allocator-reset hook retires them before that memory can be recycled. Repeated fallback warnings are bounded per kind. The player guide explains the HUD reaches; the README remains a feature summary.Testing
Tested: Windows 11, RTX 5090, NVIDIA 621.24. Review changes were played at
98178224, built with the committed hot list. The branch adds commits on reviewed head707298e0; it has not been rebased. Main was fetched through8f462db5without moving the checkout. Comparisons use the retained main068fb8ebexecutable and the identical renderer, as in the reviewed measurements.At 5120×2160, Render resolution set and read back at 100%, frame generation off, FPS counter on and the 60 cap:
Each counted case had zero guard failures, unused preparations, missing slots and draw fallbacks, across all eight pane kinds. All recorded draws used three strips; no repeated draw of a preparation occurred in these runs. Captures while the menu was being exercised remain local. Capture-window rates were 59.373, 59.196 and 58.338 FPS respectively; they are not performance comparisons.
A further check on
98178224used adult Forest Temple and child Kakariko, outside Kokiri's introduction. PirateKingIsh pressed Start during Forest Temple's large card and later in Kakariko's card; the game ignored it while both frames were visible, and both stayed wide. Forest Temple had 3,576 matched preparation/draw pairs (447 per pane kind), Kakariko 3,632 (454 per kind). Every kind had zero guard failures, unused preparations, missing slots and draw fallbacks; no preparation was drawn again. Capture-window rates were 59.341 and 59.676 FPS. The unchanged-main068fb8ebForest Temple control also ignored Start during the card. The game's pause menu could not be opened over the card on these entries, so an open pause menu over a card and the retained-preparation reuse path were not exercised. Adult Kakariko showed no large card and is excluded from the two-card result.Earlier production
707298e0checks remain labelled as such: Kokiri, Middle 16:9 and a live HUD change each way gave 7,248 matched pairs; Forest Temple's other frame art gave 3,616 matched pairs and PirateKingIsh's “Looked right throughout.” Earlier probe checks covered 21:9, 64:27, 32:9, 48:9, the full fade, Kakariko and the compact place-name banner, including an accepted centre-ornament overlay.The real patch/host fixture fails on reviewed
707298e0for repeated warnings and passes here. Removing the new reset call deliberately makes it fail. It checks repeated draws across long delays and layout changes, retirement despite identical recycled descriptors, picture-address reuse, narrow/idle fast paths with zero guest-memory reads, independent mirrored strips, and rollback when any of the three anchors is absent or changed. The original regression still fails on main for drawing one quarter. The complete changed host file built with llvm-mingw; generated output contains all three hooks and keeps their registers in context. A second agent reviewed ownership, counters and tests cold. Synthetic tests do not model the game's scheduler; the synchronous hooks rely on its existing exclusion of allocator reset from active allocation/drawing.The Windows collection used the same compiler, permissions and platform skips: main 761 passed / 59 failed / 51 skipped; this change 762 / 58 / 51. No new failure.
tests/test_job_queue.pyremains isolated after it interrupted earlier unchanged-main commands; it is not a pass.tests/test_vbytes.pytimed out on both sides. This was the directtests/run_all.pycollection, not a claimed all-greenmise run test. Pinned lint tools were not installed.Checks that fail on both main and this change
tests/test_appimage_player_build.pytests/test_auto_handheld.pytests/test_bug_report_defaults.pytests/test_capture_read_once.pytests/test_capture_readback_visibility.pytests/test_crash_dialog.pytests/test_crt_options.pytests/test_damage_debug_menu.pytests/test_dev_ab.pytests/test_dev_build.pytests/test_dev_migrate.pytests/test_dev_packs.pytests/test_display_startup_failure.pytests/test_dlss_feature_size.pytests/test_draw_stream_visibility.pytests/test_failed_compile_keeps_objects.pytests/test_frame_overlap.pytests/test_fsr_image_retirement.pytests/test_fsr_uniform_ownership.pytests/test_game_menu_mouse_buttons.pytests/test_guest_imported.pytests/test_high_fps_fixes.pytests/test_host_guest_writes.pytests/test_hud_layout_row.pytests/test_libc_hooks.pytests/test_lift_cache.pytests/test_linux_preflight.pytests/test_linux_pressure.pytests/test_make_game_ngx.pytests/test_mise_build.pytests/test_missing_nup.pytests/test_mods_list.pytests/test_ngx_sdk.pytests/test_pads_after_menu.pytests/test_parallel_init_order.pytests/test_pending_guest_import.pytests/test_pipeline_play_cache.pytests/test_portable_builder_home.pytests/test_portable_builder_startup.pytests/test_prepare_cache_save.pytests/test_present_queue_default.pytests/test_present_source_crop.pytests/test_present_thread.pytests/test_profiling_mode.pytests/test_psychov35_fsr3_fg.pytests/test_readback_timeout_source.pytests/test_replay_write_order.pytests/test_sdiv_overflow.pytests/test_slow_frames.pytests/test_song_note_cue.pytests/test_staging_burst.pytests/test_texel_buffer_ownership.pytests/test_upscaler_rows.pytests/test_vbytes.pytests/test_vcore_escape.pytests/test_vk_occlusion_queries.pytests/test_walk_key.pytests/test_work_lock.pyStill to test:
Measurements
All observational numbers are measured; aspect ratios, cap values, settings and test thresholds describe configuration. Tables give the median of two runs and their full range.
Verdict: The wider frame remained joined through the Insert menu and capture hitches. The four matched no-card runs below answer the generic-hook cost question. Main CPU changed by +0.050 ms/frame; the two-run ranges overlap. There is no clear slowdown in these samples. This capped comparison does not establish uncapped throughput or screen pacing.
No-card setup: main, patch, main, patch; 3840×2160 (16:9), Render 100%, 60 cap, no frame generation, same private save, unchanged renderer and warmed caches. Each 25-second window began 1,800 native presents after the same door input, after the title card. The window includes the tail of the introductory scene followed by idle play; it is not stationary throughout. Sampled positions and scene states matched across all four runs; the sampled camera differed by at most 0.1 degree. No screenshots or per-pane logging during these runs. Selection uses the frame trace's host clock. This measures the same no-card sequence, not uncapped throughput.
068fb8eb98178224As a separate check of a stationary spot, the same recordings were also analysed from seconds 13 through 25 of every window. Scene-status samples, not performance values, selected this common interval: the introduction had ended and Link was still. These shorter samples are not extra runs or an isolated measure of the hooks. They show why a small CPU difference should not be presented as a reliable gain or loss.
068fb8eb98178224With widening disabled (16:9/narrower or Middle 16:9) and no retained records, each generic preparation adds one atomic read after the game's original allocation, and each draw adds one atomic read before returning to the game's drawing. Arena resets also have an idle atomic check. On a wider screen between cards, drawing has that same idle fast path; preparation still identifies panes because widening is planned. While records exist, unrelated picture draws search the small host table without reading pane names from guest memory.
The earlier card-cost and pixel measurements below used reviewed
707298e0, not the new head. They remain evidence for geometry and the earlier cost; the new head's measurement above is specifically no-card.Earlier card-cost setup: 5120×2160, Render 100%, cap 60, frame generation off, the same private save and renderer. Two warmed runs per arm, main/patch/main/patch; each 25-second window covered the door opening, entry and complete card, without screenshots or per-pane diagnostics. The earlier renderer recording/submission median increased by 0.015 ms/frame; both patched runs were above the main range. Those are not new-head card-cost measurements.
068fb8eb707298e0Risks
The large card's eight frame/shadow panes use three independently allocated strips per visible quarter. Preparation records the choice; drawing does not reread the setting. A picture can retain its constants, so records are reusable until replacement, a descriptor/identity mismatch, or reset of the same allocator. A second preparation replaces the earlier record; if it was never drawn, the unused count increases with its warning bounded. Descriptor equality alone is insufficient because memory can be recycled. The reset hook introduces no asynchronous work and runs inside the game's original reset call. Incorrect ownership would risk stale constants; the tests cover retirement and reuse but not the entire game scheduler. The observed menu and hitch cases did not reuse an older preparation, and a loading transition cutting a card short was not tested. Guards retain the game's drawing, and each unexpected event logs only its first occurrence per kind; opt-in trace logging retains totals.
No new switch. Middle 16:9 retains the original frame, or revert the change. Saves, game assets and user settings are not migrated. The compact place-name banner remains outside the changed pane set. AMD/Intel-specific presentation tasks were removed as requested: this is host code using the unchanged renderer, with no GPU-specific change. Linux CI is still unverified here.
Checklist
Ready for review
068fb8eb; the title is a Conventional Commit. Additive review commits remain on that reviewed base, without a rebase or force-push, as requested for this round.mise run testpasses (any failure that also fails onmainis named). Direct Windows runner results, shared failures, skips and the isolated check are disclosed above; no all-green claim.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.Windows 11, RTX 5090, NVIDIA 621.24. Played production commit
707298e0dd, built with the shipped hot list. At 5120x2160, Render 100%, frame generation off and the 60 cap, the first Kokiri card extended to the HUD's sides with joined lines and unchanged ornaments. Middle 16:9 retained the original frame. Changed the HUD layout once each way while the card showed; matched all 7248 preparation/draw pairs with no fallback, unused set or mixed choice. Four screenshot-free runs alternated main068fb8eband this commit; actual rates and scatter are in the description. Earlier probe checks also covered 21:9, 32:9, 48:9, Kakariko and the compact place-name banner. Linux, AMD and Intel remain untested.Verdict: Request changes. The fix works and is well guarded: on screens wider than 16:9 the area title card's frame reaches the HUD's sides, its ornaments keep their size, and every unexpected state falls back to the game's own drawing. One thing to change first: four of those fallbacks log a line on every prepare or draw of every frame pane, with no limit, so a fallback that keeps happening writes about 8 lines a frame for as long as the card shows.
For ultrawide players, the first area title card (and every one after) gets a frame that fits the picture instead of a 16:9 frame floating in the middle. It improves on the code it replaces: the old
RULE_WIDENentries for these eight panes never acted (their midpoints are at ±960), and a whole-pane stretch would have stretched the ornaments. The cost is two hooks on the generic picture prepare and draw (PicturePane_PrepareDraw,PicturePane_IssueDraw), which every UI picture now passes through, and those two functions now stay in context rather than locals.Reviewed:
707298e0against068fb8eb(its merge base, the current base): all of thehos_wide_ui.cchange and the planner around it (visit,hos_wide_ui_tick),oot_wide.py, theoot_patches.pychange and howtouches()keeps patched functions in context (nx2/lift.py), the tick's callers (do_present→wide_sides_tick→host_wide_menus),a64.h'sGuestContext, the new test and the fixtures it imports (test_hud_layout.py,test_wide_ui.py,srccut.py), and the other callers ofoot_patches.report. I also checked the anchors against the workspace's notes on the game's layout code (PicturePane_PrepareDraw/IssueDraw,f_8154f1c0copying the uniform block to GPU memory). Only skimmed: the README line. Nothing run (a code review).Fixed in this review: nothing.
Checked and fine:
touches()runspatch_fileon each function's text, and both anchors change it. Soc->x[19],x[20],x[1],x[2]andx[31]hold live values at the prepare site, and the arguments are read before the original call.hos_wide_title_preparemakes the game's own call first and copiesCtxafter it. Each strip's call restarts from that copy with the original arguments, the copy is restored at the end, and the params andoutbuffers are written back. The game sees exactly the original call's result.wide_sides_tickindo_present), not per generated frame, so frame generation can't age a preparation beyond the one-frame allowance.1920 + E, the strips meet edge to edge in place and in source and effect coordinates, the right quarters are mirrored (out[2 - i],1 - …), andEper shape matcheshos_hud_reach(600 at 21:9, 640 at 64:27, 672 at 32:9, 0 at 48:9, Middle and 16:9 and narrower).picture + 0x48.title_card_original), and the existingreport()callers that pass counts without the title card print the warning and open no file.mainby behaviour (one set allocated, one draw), not by a missing name, and covers all eight panes, three reaches, mirroring, restoration and the anchors split across files.Blocking (to change before merge)
host/hos_wide_ui.c:769,:804,:806,:832: "title guard failed", "title unused preparation", "title no state slot" and "title draw fallback" are plainhos_loglines on every prepare or draw. Each fires in exactly the cases the guards exist for (a card whose constants don't match the guard, a pane prepared and not drawn, or drawn twice), and each would then repeat every frame for all 8 panes while the card shows. A 4-second card at 60 fps is about 2,000 lines, in every log and bug report. Log the first occurrence per kind (as "unknown frame pane name" already does at:727), with a count, or letlog_leftbudget them as the planner's own traces are, and log the per-pane traces behindlog_eachat trace level.Suggestions (the author may take or leave)
host/hos_wide_ui.c:816: every picture draw in the game now runstitle_kind(6 to 8 guest loads and a name compare), and every picture prepare does too, including at 16:9 and on the Steam Deck, where the plan is always 0. One atomic count of prepared-but-not-drawn strip sets would let the draw skiptitle_kindwhen it is zero, and prepare could skip it while the plan is 0 and nothing is pending, so most frames pay one atomic load.README.md:78: the README's feature list is the project's summary; this level of detail (reaches per shape, which modes keep the original) fits better in the player guide, next to the HUD layout row indocs/user/graphics-and-controls.md.Questions
Testing: Windows 11, RTX 5090, NVIDIA 621.24, by the author: 5120×2160 (64:27) on the production build, Middle 16:9, a live HUD-layout change each way during the card, 7,248 matched pairs, and four interleaved measured runs. The earlier probe builds covered 21:9, 32:9 and 48:9, a second area and the compact banner. AMD and Intel runs aren't needed for this change: it is host CPU code that issues the game's own draw three times through the unchanged renderer, so a GPU or driver can't make it behave differently; I'd drop them from Still to test. Linux: the new test compiles the whole new host block with GCC, so CI's Ubuntu source checks cover its portability once they run; they are waiting to be approved on this head. The pause and hitch case above is the run that's still missing.
Overlaps and merge order: #1855 (futondestroyer, WIP: live gameplay HUD placement) changes the same three files,
hos_wide_ui.c's planner and tick included, and will conflict. This one is ready and smaller, so it goes first, and the HUD placement PR rebases over it, keepingtitle_plan_tickfed from the reach it computes. #1821 (hook sites, WIP, mine) touchesoot_patches.pyonly, with no conflict; the two text anchors here are candidates to become hook sites once it lands.@ -75,6 +75,9 @@ The player guide, also at [longshot.magicbean.dev](https://longshot.magicbean.dewhich keeps the game and itself up to date (stable and nightly channels).- **Modern graphics:** Vulkan, any resolution, ultrawide and 4:3 with the HUD kept in place, frame rates above 60, andupscaling and frame generation with NVIDIA DLSS, AMD FSR 3.1 and FSR 4, and Intel XeSS.On screens wider than 16:9, the area title card's frame follows the HUD layout and its reach: the screen's sides,Suggestion: this detail fits the player guide (
docs/user/graphics-and-controls.md, by the HUD layout row) better than the README's feature summary.@ -570,0 +766,4 @@if (ext > 0 && alpha > 0) {if ((flags & 7) != 3 || fabsf(title_float(original + 0xb0) - 1920) > .01f ||fabsf(title_float(original + 0xb4) - 1080) > .01f) {hos_log("wide UI: title guard failed kind %d; game's drawing retained", kind);Blocking 1: this line is written on every prepare of every frame pane while the guard fails, about 8 lines a frame for as long as the card shows. Once per kind with a count (as
:727does), or underlog_left, would keep the signal without the flood.@ -570,0 +801,4 @@}title_leave();if (unused)hos_log("wide UI: title unused preparation seq %llu", (unsigned long long)unused);Blocking 1: the same for "unused preparation" and "no state slot" (
:806). A pane prepared and not drawn repeats this every frame.@ -570,0 +813,4 @@}int hos_wide_title_draw(Ctx *c, void (*draw)(Ctx *)) {uint64_t picture = c->x[0], pane = recomp_load64(c, c->x[1] + 8), layout = 0;int kind = title_kind(c, pane, &layout);Suggestion: every picture draw in the game reaches here, at 16:9 too. An atomic count of pending strip preparations would let this skip
title_kindon almost every frame.@ -570,0 +829,4 @@uint32_t now = title_plan_epoch(); /* frame age only; no option or extension is read here */if (!state.valid || state.used || state.layout != layout || state.material != recomp_load64(c, picture + 0x30) ||memcmp(original, state.original, 24) || (uint32_t)(now - state.epoch) > 1) {hos_log("wide UI: title draw fallback kind %d pane %llx seq %llu prepared %u now %u valid %d used %d", kind,Blocking 1: the same for the draw fallback. A pane drawn without its prepare (or twice) writes this on each draw, every frame.
Thanks for the review. The follow-up commits are
8c52266aand98178224, on top of the reviewed head; no rebase.98178224, I pressed Start during Forest Temple's large card, then later during child Kakariko's large card: the game ignored Start both times while the frame was visible, and the frame stayed wide. Forest Temple had 3,576 preparation/draw pairs and Kakariko 3,632, with zero guard, unused, missing-slot or fallback counts for every pane kind. The unchanged-main068fb8ebForest Temple control also ignored Start during the card. So the game's pause menu could not be opened over the card on either entry; this is not a test with the pause menu open. No reused preparation occurred; that path remains covered synthetically, not demonstrated in a game run. The earlier Insert-menu repeat had 3,576 pairs and the hitch case 3,448, also with zero fallback categories and no visible snap. Four earlier capture frames took about 158–160 ms. Forest Temple's other frame art now has coverage on this head as well as the earlier707298e0run.068fb8ebversus98178224, after the same entrance/card. Main CPU: 2.579 (runs 2.522–2.636) → 2.629 (runs 2.437–2.822) ms/frame. Main CPU changed by +0.050 ms/frame; the two-run ranges overlap. There is no clear slowdown in these samples. This capped comparison does not establish uncapped throughput or screen pacing. FPS, mean/p99 frame time and full scatter are in the updated description. All numbers here are measured.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.