WIP: feat(menu): type and save a custom output size in the Insert menu #51
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!51
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:menu-text-fields"
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?
Why
Players should be able to type a monitor size that the Insert menu does not list, without editing the options file. This also gives later text settings a shared editor rather than another keyboard handler.
Draft for one remaining runtime check: the frame-time comparison awaits a quiet machine. The new Longshot menu and saved-size proof is complete; the shared-load comparison below is too variable to establish no cost while the menu is closed.
The closed-menu timing limitation remains open. All earlier evidence below keeps its actually tested identity.
What changed
output_res=<width>x<height>representation remain intact.take_textfollowsscreen_sizein bothMkwVkHostand its positional initializer. Main'snvn_program_created, live frame-rate-cap option 53, in-play Debug callbacks and Dev FPS level are retained. No numeric option ID is added or renumbered. The executable and renderer must come from the same build.This answers Joey-Magnus's review of the original change: the display-mode work is already in the base, and
custom_output/output_extrasare retained. The later program-created callback consumed API 21, so this addition correctly uses 22 rather than the review's then-next 21.Implementation map:
gpu/vk/vk_menu.cppownstext_edit,output_field_apply,restart_valueand the focusedmenu_tickpath;host/rx_backend.cownshost_take_textand the queue.host/display.c,host/posix/display_sdl.candhost/hos_sdl.cfeed it.gpu/vk/vk_api.h,gpu/vk/vk_menu_keys.h,gpu/vk/vk_ui.handgpu/vk/menu_i18n.hcarry the interface, paste prompts and revised hint.tests/test_menu_text_field.py,tests/test_menu_keys.py,tests/test_menu_restart_slots.pyandtests/screensaver_test.ccarry the source-fixture coverage.Flags and settings
The table covers changed behavior as well as newly introduced names. Runtime evidence remains the carried Linux/RTX 4090 evidence at
7677d2f12; source contracts and untested interactions are not new runtime results. There is no new global enable switch, no new numeric option ID, and no new production command-line or build flag.RX_VK_MENU_SCRIPTTYPE:textup to the next comma and focusedHOME,END,BACK,DEL,LEFT,RIGHT,ENTER,ESC; existing pad confirm/back events reach the fieldoutput_field_applyand takes effect after restartultrawide=1); a non-16:9 output size retains its own shapeoutput_reswidthxheight, not a list index; accepted custom dimensions are rounded down to multiples of 8, at least 640x360, at most 5120x2880's pixels, from 5:4 to 48:9ultrawideoutput_resHOS_OUTPUT_REStests/test_menu_text_field.py --cxx-xselects the language)g++for direct invocation; the whole-suite runner supplies its selected C++ compilerThe README option table and custom-size explanation, plus
docs/development.md's scripted-input and options-file references, are updated. The test driver's--cxxusage is documented in its own module.HOS_DISPLAY_MODES, capture/timing switches, the Quality preset, Profile, frame-rate cap and screen-mode policy are unchanged; their values below are reproduction settings, not new defaults.Measurements
Branch state: on main
d725b3631982ed0035ea3ac9cbe1677e9fad260c; headd5b2ff117905fa9ad4a5def759efa52f7a5c1078; whole game-free suite on this head:511 passed, 1 failed, 20 skipped(maind725b3631982ed0035ea3ac9cbe1677e9fad260c:510 passed, 1 failed, 20 skipped); the commits are unchanged by rebases apart from the results table.The sole failure in both suites in the branch-state block is
tests/test_updater_asset_digest.py: local .NET cannot resolveMicrosoft.AspNetCore.App.Ref (= 10.0.13)(NU1100). The historical suites below also include this failure.main:
d4a69456c9(measured baseline, 2026-11-12)this PR: menu-text-fields @
7677d2f12e(code built and tested, 2026-11-12)Previously submitted branch head:
70373b9a1c9cf106b49e82b7010360762c877c60; code built and tested @7677d2f12e123fa79df8b3f6604b6fec7933bce2. The final commit adds the measured configuration rows only.Between measured main
d4a69456and maind725b3631982ed0035ea3ac9cbe1677e9fad260c, changes are confined to forge scripts/workflow, documentation/rules and tests, not the host or renderer. The functional observations therefore remain relevant to the same runtime change, but all rows and outputs below retain their original measured commits. They are not reruns on the current head, and the noisy closed-menu observations do not become conclusive through a rebase.No new game build, Windows execution or game run is claimed for this rebase.
Hardware: RTX 4090 24 GB, NVIDIA 615.78.08; Core i9-13900K, 96 GB RAM; Arch Linux 7.2.15-1-omarchy.
Scene: title / Insert menu, 2048x1152 before editing; saved-size start at 1920x800. Closed-menu observations: child Link standing in Kokiri Forest from the same copied save, 1280x720, default 60 cap, game's upscaler, FG off, no overlays, windowless. Authored display modes 1920x1080 and 2560x1080, not physical monitor enumeration.
Method: same release-profile build on both sides, rebuilt host and renderer; one baseline menu run, a 100 s scripted edit, then a separate 45 s start using its saved options. For the closed-menu comparison: one 80 s warm-up per build, then main/branch/main/branch, 80 s each; common 35–65 s renderer-frame windows, with the first boundary interval excluded. These headless CPU intervals follow offscreen submission; they are not GPU time or display latency. Whole game-free suite with the default compiler on the branch; the main suite is the day's shared pinned-base run.
How to reproduce:
d4a69456against code7677d2f1. Keep separate disposable options/save storage, the game's upscaler, frame generation off and no overlays. The menu captures used precompile off (RX_VK_PRECOMPILE=0), windowless output, and authoredHOS_DISPLAY_MODES=1920x1080,2560x1080, not physical display enumeration.output_res. The retained edit is a 100 s scripted run;RX_VK_MENU_SCRIPTsupplies the timed menu keys andTYPE:textactions documented above.HOS_OUTPUT_RES. Check the startuppicture 1920x800/camera ratio 2.4000lines, both size rows, and the absence of a restart marker.RX_VK_FRAME_LOGrenderer CSVs; warm each build for 80 s, then run main/PR/main/PR for 80 s each. Read the same 35–65 s interval after excluding the first boundary interval. Keep every run and its load/journal receipt; the retained shared-load runs below fail the predeclared 5% same-build consistency rule. A quiet repeat is still needed, not a speed conclusion from these rows.python -I -B tests/test_menu_text_field.py --cxx g++; the complete source suite ispython -I -B tests/run_all.py. These are reproduction commands, not new receipts. The text-field driver has no--sourceoption: a baseline comparison needs the corresponding pinned-source fixture setup, not an invented flag.Try it: Insert → Graphics → Custom output size → Enter → type
1920x800→ Enter. Closing the menu offers the existing restart question. This changes the saved size, not the running game's picture until its next start.d4a694567677d2f1The base suite was run once for all moved pull requests of this day, on that commit. The shared base also fails two bounded-time cases in
tests/test_appimage_package_retry.py; that test passes on this branch. A duplicate base run completed before the shared-base policy: 507/2/20, with the same .NET failure and a shaderbatch-build error intest_bake_skeleton.py; both non-.NET checks pass here. No failed result was erased or relabelled green. These checks have not yet been run on a forge runner.All three new functional game runs ended at their requested bounds (game exit 124), with zero fatal, crash, device-loss, virtual-core-escape, kernel-fault and NVRM counts and complete journal coverage. The menu edit's load was 226.31 → 122.12; the saved start's 87.82 → 64.20. Neither duration nor frame rate from those captures is a performance measurement.
Closed-menu observations, under shared load — inconclusive. The same-build spread is too large to say anything: median-frame repeat spread is 7.39% on main and 23.40% on the branch; mean-frame repeat spread is 15.00% and 29.36%. Both exceed the 5% same-build consistency rule set before reading the data. The branch's observed medians are higher, but these noisy runs do not establish causation or “no cost when off”. The frame-time comparison awaits a quiet machine. No run is discarded.
d4a694567677d2f1Actual reader output from the retained renderer CSVs, in run order:
The game state and inspected pictures put all four runs in the same saved forest scene, with the menu closed. All four ended at their bounds with game exit 124, zero fatal/crash/device-loss/escape/kernel/NVRM counts and complete journal coverage. These observations meet the requested interleaving, not the evidence needed for a no-cost conclusion.
Current-main source suite, separate from the historical runtime comparison
Main ran the whole game-free suite once for all PRs using the branch-state block's base:
python -I -B tests/run_all.py --jobs 6 --strict, default compiler, fresh HOME. It finished at 2026-11-12T19:12:28-06:00 under heavy shared load; the one-minute load after the run was 62.6. This is a source-suite receipt, not another game or frame-time measurement.The earlier
d4a69456/7677d2f1tables and failures remain historical evidence at those exact identities. The refreshed branch's full suite ran 2026-11-12 19:10:40–19:16:36 local, using the repository default compiler and fresh HOME/XDG. Execution took 234 s on main and 247 s on the branch, not a performance comparison. No base suite was duplicated.Testing
Tested: on this PC (Arch Linux, RTX 4090 with NVIDIA 615.78.08, i9-13900K), the current-head whole game-free suite; earlier text-field, menu-key, restart-slot and screensaver checks and the text-field negative control against main retain their measured commits above. Three translation units compiled for the Windows target; not run on Windows. In the game, compared main's title/Insert → Graphics page with scripted typing and caret movement on code
7677d2f1, committed1920x800, switched through listed sizes and back, then started a separate process to check the saved picture size, both menu rows and absence of a restart marker. The retained closed-menu runs stood in Kokiri Forest with the same save and settings.Tested but not measured: the title/Insert-menu typing, caret, listed-choice and saved-size functional captures on main
d4a69456and code7677d2f1, and the historical Hookshot4914fdeccaptures. Their durations and frame rates are not performance measurements. The closed-menu captures did produce the retained renderer-interval numbers, but the shared-load spread makes them inconclusive rather than evidence of no cost.Not tested: the closed-menu frame-time comparison still awaits a quiet machine. Physical keyboard/clipboard on Linux, mouse/controller, IME, SDL2, Steam Deck, AMD/Intel, a real window on Linux, monitor changes, HDR, long sessions, or other gameplay areas. These checks used scripted input, authored display modes and bounded windowless scenes on this PC. Refusal/cancellation and empty-field behavior are covered game-free, not by these new game captures. No test request was posted during this move.
The current head has not been rebuilt or run in the game. Earlier build/game/syntax evidence retains its named sources. The three cross-target syntax captures stop before execution and do not reach the text test's later C-queue compile. No new hosted Windows check is claimed.
Needs other testers:
1920x800in Custom output size, cancel once and commit once, expecting passing fixtures, input focus restored after cancellation and the saved size on the next start (request to open)Screenshots
main @
d4a69456/ this PR @7677d2f1: baseline Graphics page, then partial text, caret, commit, listed choice and saved-size start.this PR @
7677d2f1: saved 1920x800 next start; the baseline is main @d4a69456in the first panel.main @
d4a69456/ this PR @7677d2f1: both interleaved pairs at the same saved scene; visual agreement does not settle the timing gap.Historical Hookshot @ 4914fdec: earlier edit/list-choice sequence, not a new Longshot or rebased-head run.
Historical Hookshot @ 4914fdec: earlier saved-size start, not a new Longshot or rebased-head run.
Every listed picture was inspected. The earlier Hookshot evidence is retained with its original build identity, not used as a substitute for the new runs.
Risk and rollback
A stuck focus could withhold game/menu input; a mixed executable/renderer pair is rejected. ASCII-only entry is a deliberate limitation, not Unicode/IME support.
Stop editing with Esc/controller Back, then leave the menu to return input to the game; closing the menu also cancels the edit. Unset
RX_VK_MENU_SCRIPTto stop scripted input. A committed size is restored by selecting the prior size and restarting; the running picture is not changed by an edit. There is no feature-disable switch: a full rollback reverts the paired host and renderer changes together and deploys a matching executable/renderer pair, rather than mixing API 21 and 22.Dynamic output/shape lists and restart tracking are the other risk: a custom edit must not lose the startup size, reuse a stale shape index, or misreport a pending restart. The quiet closed-menu cost check remains open; the shared-load numbers are not a no-regression guarantee.
Reviewer notes
gpu/vk/vk_api.hand the positionalvk_hostinitializer inhost/rx_backend.c:take_textfollowsscreen_size, while main'snvn_program_created, option 53 and existing callbacks remain intact.gpu/vk/vk_menu.cpp, readoutput_field_apply,output_choice_of,restart_valueand the focused branch ofmenu_tick. Check dynamiccustom_output/output_extrasmembership, the retained startup size, remapped shape/Later state, cancellation and persistence, rather than treating the old fixed list as current.tests/test_menu_text_field.pyalongsidetests/test_menu_keys.py,tests/test_menu_restart_slots.pyandtests/screensaver_test.c. Their source extraction boundaries changed with the implementation; existing checks are retained. The syntax-only receipt does not cover native Windows execution or the later C-queue compile.Issues
Original pull request: https://github.com/NotRexed/Hookshot/issues/2594
Original proposal: https://github.com/NotRexed/Hookshot/issues/2269
Dependent co-op draft: https://github.com/NotRexed/Hookshot/issues/2274
No matching issue was found in Longshot's complete public issue list on 2026-11-12. These old numbers are not Forgejo issue numbers.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.docs/tested-configurations.mdfor each measured run.MKWVK_API_VERSIONbumped (gpu/vk/vk_api.h'sMkwVkHostorMkwVkRendererchanged).mainand passing here. Historical negative control retained; the test also passes in the exact-head full suite.tests/that reads changed source updated in this PR, not weakened.Moved from NotRexed/Hookshot#2594.
Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 [email protected]
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
Discussion carried over from NotRexed/Hookshot#2594
Every comment that was readable on the original thread when it was copied on 2026-11-12, in order, unchanged except that issue and pull request numbers are written as links to the old repository and names carry no @. Comments by an account that has since been closed there could no longer be read and are missing; where a reply quotes them, the quote remains.
mooki000, 2026-11-12 01:49 UTC (comment, original):
Rebased onto
main(85e3df35on6f7ab2a7) and the Windows check repaired; the description's first block says what changed and what ran on the new head.The Windows failure of the first run was in the test, not in the feature:
tests/test_menu_text_field.pybuilds a fixture from the menu's source, which callsgetenv(throughhost/hos_wide_size.h) andsscanf. Microsoft's headers mark both deprecated, and with warnings as errors the fixture did not compile on the Windows runner. The generated sources now start with_CRT_SECURE_NO_WARNINGS, like main's other fixtures; the screensaver test's template had the same trap and got the same line. I could only check this with a Windows-target syntax compile here, so the Windows job on this head is the proof.The rebase met the merged Bug report row (NotRexed/Hookshot#2347) in two places in
gpu/vk/vk_menu.cpp; both sides are kept. The game run in the description (typing a size, the caret, committing) was made before the rebase, oncefdafbb, and is labelled so.mooki000, 2026-11-12 05:27 UTC (comment, original):
Rebased onto current main (
edaef2a9) asfaf1c9b1; nothing in what it does has changed.gpu/vk/vk_api.h: NotRexed/Hookshot#1930 took API version 19 for the ocarina note bindings, so this one is 20 (it addstake_textat the end of the host table; all of main's ids are kept).gpu/vk/vk_menu.cpp: merged without conflict beside NotRexed/Hookshot#2574's reset hook, NotRexed/Hookshot#2435's keyboard prompts and NotRexed/Hookshot#2347's Bug report row.gpu/vk/menu_i18n.h: this change rewords one hint of the Output resolution row ("Your own size, from Custom output size below."), and since NotRexed/Hookshot#1864 every catalogue has that hint. Its entry is replaced in all 13 catalogues, none removed. The reworded translations were written with a language model on top of the existing ones; corrections are welcome.The text-field, menu-key, restart-slot, translation and switch checks pass on the new head with GCC 16.2.1 and Clang 23.1.3; the Windows-target syntax pass of the changed host files has no error. The whole suite: 470 passed, 1 failed, 20 skipped; the one is
test_input_background.pyunder Clang, which fails the same way on untouched main (a variable set and not used in a fixture this pull request does not touch).Joey-Magnus, 2026-11-12 14:33 UTC (review: comment, original):
I merged this into current main. tests/test_menu_text_field.py (all three parts), test_menu_keys.py, test_menu_restart_slots.py, test_menu_i18n.py, test_output_resolution.py, test_menu_setting_walk.py, test_utf8_paths.py and test_env_on.py pass.
I checked the SDL event offsets by hand against SDL2's and SDL3's structs:
All match. The SDL3 text pointer is copied right away in
event_text. The queue in host/rx_backend.c:216 is locked and drops input while no field is focused. Text input is only on while a field has focus, so no input method window opens over the game.The one thing in the way is NotRexed/Hookshot#2566. Both claim MKWVK_API_VERSION 20 for a new MkwVkHost member (
take_texthere,screen_sizethere). Merging NotRexed/Hookshot#2566 on top of this conflicts in vk_api.h, vk_menu.cpp, menu_i18n.h, rx_backend.c and readme.md. You've already offered to rebase if NotRexed/Hookshot#2566 goes first. In that casetake_textgoes afterscreen_sizeat version 21, and the Custom output size has to fit NotRexed/Hookshot#2566's per-screen list (custom_output/output_extras).mooki000, 2026-11-12 14:34 UTC (comment, original):
Thanks for checking the event offsets by hand. Agreed on the order: NotRexed/Hookshot#2566 first. I am testing NotRexed/Hookshot#2566 on Linux now (its head
ea303801), and I am preparing this branch on top of it so it can follow straight after:take_textafterscreen_sizeat API version 21, and the custom output size fitted to NotRexed/Hookshot#2566's per-screen list (custom_output/output_extras). I will push that rebase when NotRexed/Hookshot#2566 lands, with the tests you ran repeated on it.mooki000, 2026-11-12 18:54 UTC (comment, original):
Rebased onto
15d4ae8c6now that NotRexed/Hookshot#2566 is merged; final headc102f6f5.API 22: NotRexed/Hookshot#2566 took 20 for
screen_size, and NotRexed/Hookshot#2760 took 21 fornvn_program_created;take_textfollowsscreen_size.A typed listed size reuses its choice. An unlisted size joins its shape's choices; NotRexed/Hookshot#2566's modes and monitor/native marks stay unchanged.
All 22 final checks pass with GCC 16.2.1 and Clang 23.1.3: the 19 requested checks, both changed NotRexed/Hookshot#2788 drivers, and the README check. A full run of the project's checks in my fork, Windows included, is green on this exact head.
Earlier full suite: 496 passed, 4 failed, 20 skipped. Two compiler-invocation failures passed after repair; the two main failures were subsequently fixed by NotRexed/Hookshot#2861 and NotRexed/Hookshot#2883.
The two game runs were on
4914fdec(main8cf9a524), Linux/RTX4090, windowless.The menu run typed
1920x800, moved the caret, committed, selected listed2560x1080and3440x1440, then returned to the custom size; rows and saved sizes agree.The next start logs
picture 1920x800andcamera ratio 2.4000: NotRexed/Hookshot#2566's rule gives this non-16:9 size its own picture/camera shape; the row shows 21:9.Both games exited 124 with zero fatal/crash/device-loss/kernel/NVRM/vcore-escape counts. A closing-pipe error in the first observer was recovered from existing receipts, without repeating that game.
The final head adds a clean rebase over five merges, one touching the menu file, and a docs-only commit. That combination was checked game-free only, not run in the game.
Not tested: Windows gameplay, a real window, HDR, physical keyboard/clipboard/controller input, IME or SDL2. No performance claim.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
Rebased
70373b9aonto maind725b3631asd5b2ff117and updated the description to the new template. Functional evidence, uploaded pictures and inconclusive shared-load rows retain measured commitsd4a69456and7677d2f1; intervening main changes are scripts, documentation, rules and tests only. The exact rebased head's whole suite is 511 passed, 1 failed and 20 skipped; the sole failure is the same local .NET reference-pack failure as current main. This remains WIP until the closed-menu comparison can be made on a quiet machine.70373b9a1ctod5b2ff1179Added the Testing section and updated its checklist. Added one branch base/suite block, consolidated duplicate results and simplified the supporting wording; everything else is unchanged.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.