feat(menu): save and resume when restarting for changed settings #2607
Open
mooki000 wants to merge 6 commits from
mooki000/restart-in-place-next into main
pull from: mooki000/restart-in-place-next
merge into: MagicBeanDev:main
MagicBeanDev:main
MagicBeanDev:github/pr/2893
MagicBeanDev:github/pr/2890
MagicBeanDev:github/pr/2887
MagicBeanDev:github/pr/2878
MagicBeanDev:github/pr/2875
MagicBeanDev:github/pr/2874
MagicBeanDev:github/pr/2873
MagicBeanDev:github/pr/2871
MagicBeanDev:github/pr/2756
MagicBeanDev:github/pr/2897
MagicBeanDev:github/pr/2896
MagicBeanDev:github/pr/2718
MagicBeanDev:github/pr/2842
MagicBeanDev:github/pr/2691
MagicBeanDev:github/pr/2895
MagicBeanDev:github/pr/2743
MagicBeanDev:github/pr/2765
MagicBeanDev:github/pr/2708
MagicBeanDev:github/pr/2732
MagicBeanDev:github/pr/2755
MagicBeanDev:github/pr/2817
MagicBeanDev:github/pr/2876
MagicBeanDev:release-please--branches--main
MagicBeanDev:release-please--branches--main--release-notes
MagicBeanDev:github/pr/2778
MagicBeanDev:github/pr/2888
MagicBeanDev:github/pr/2866
MagicBeanDev:github/pr/2877
MagicBeanDev:github/pr/2800
MagicBeanDev:github/pr/2829
MagicBeanDev:github/pr/2850
MagicBeanDev:github/pr/2889
MagicBeanDev:github/pr/2882
MagicBeanDev:github/pr/2860
MagicBeanDev:github/pr/2849
MagicBeanDev:github/pr/2886
MagicBeanDev:github/pr/2794
MagicBeanDev:github/pr/2840
MagicBeanDev:github/pr/2830
MagicBeanDev:github/pr/2834
MagicBeanDev:github/pr/2719
MagicBeanDev:github/pr/2742
MagicBeanDev:github/pr/2741
MagicBeanDev:github/pr/2820
MagicBeanDev:github/pr/2771
MagicBeanDev:github/pr/2859
MagicBeanDev:github/pr/2858
MagicBeanDev:github/pr/2823
MagicBeanDev:github/pr/2757
MagicBeanDev:github/pr/2769
MagicBeanDev:github/pr/2844
MagicBeanDev:github/pr/2843
MagicBeanDev:github/pr/2673
MagicBeanDev:github/pr/2855
MagicBeanDev:github/pr/2739
MagicBeanDev:github/pr/2807
MagicBeanDev:github/pr/2851
MagicBeanDev:github/pr/2789
MagicBeanDev:github/pr/2814
MagicBeanDev:github/pr/2818
MagicBeanDev:github/pr/2774
MagicBeanDev:github/pr/2772
MagicBeanDev:github/pr/2750
MagicBeanDev:github/pr/2786
MagicBeanDev:github/pr/2785
MagicBeanDev:github/pr/2782
MagicBeanDev:github/pr/2779
MagicBeanDev:github/pr/2775
MagicBeanDev:github/pr/2706
MagicBeanDev:github/pr/2766
MagicBeanDev:github/pr/2747
MagicBeanDev:github/pr/2759
MagicBeanDev:github/pr/2745
MagicBeanDev:github/pr/2740
MagicBeanDev:github/pr/2733
MagicBeanDev:github/pr/2725
MagicBeanDev:github/pr/2727
MagicBeanDev:github/pr/2728
MagicBeanDev:github/pr/2729
MagicBeanDev:github/pr/2721
MagicBeanDev:github/pr/2722
MagicBeanDev:github/pr/2715
MagicBeanDev:github/pr/2714
MagicBeanDev:github/pr/2707
MagicBeanDev:github/pr/2703
MagicBeanDev:github/pr/2705
MagicBeanDev:github/pr/2697
MagicBeanDev:github/pr/2679
MagicBeanDev:github/pr/2676
MagicBeanDev:github/pr/2669
MagicBeanDev:docs/what-hookshot-connects-to
MagicBeanDev:fix/hdr-encode-test
MagicBeanDev:fix/main-tests
MagicBeanDev:fix/play-cache-files
MagicBeanDev:perf/game-barrier-order
MagicBeanDev:feat/heap-lazy
MagicBeanDev:feat/texture-detail
MagicBeanDev:perf/astc-opaque-bc1
MagicBeanDev:fix/fs-dir-lock
MagicBeanDev:fix/framegen-native-kept
MagicBeanDev:fix/update-no-downgrade
MagicBeanDev:port/k10-gcn-f16-mirrors
MagicBeanDev:fix/framegen-mult-cap
MagicBeanDev:chore/release-as-2.1.1
MagicBeanDev:perf/pcache-load-switch
MagicBeanDev:fix/prepare-progress-log
MagicBeanDev:fix/update-closes-stale-game
MagicBeanDev:fix/hdr-scaled-sampled
MagicBeanDev:perf/first-start-preset
MagicBeanDev:perf/zero-upload
MagicBeanDev:fix/vcore-escape-2s
MagicBeanDev:test/fake-gh-atomic
MagicBeanDev:perf/batch-idle-flush
MagicBeanDev:test/finish-stub-a
MagicBeanDev:chore/record-2.1.0
MagicBeanDev:fix/main-red-tests
MagicBeanDev:fix/test-display-startup-driver-cache
MagicBeanDev:feat/mesh-shader-mode
MagicBeanDev:fix/menu-probes-at-startup
MagicBeanDev:fix/fps-counter-classic
MagicBeanDev:fix/test-log-batch-flake
MagicBeanDev:fix/narrow-screen-hud
MagicBeanDev:ci/prereleases
MagicBeanDev:release/v2.0.15
MagicBeanDev:hotfix/v2.0.15
MagicBeanDev:fix/present-ahead-replay
MagicBeanDev:release/v2.0.13
MagicBeanDev:fix/bracket-paths-2013
MagicBeanDev:fix/hdr-overlays-2013
MagicBeanDev:fix/fps-counter-scale-2013
MagicBeanDev:fix/stick-seen-at-rest
MagicBeanDev:hotfix/menu-fits-screen
MagicBeanDev:fix/f1-always-opens-menu
MagicBeanDev:fix/ini-keep-lines
MagicBeanDev:claude/cranky-pike-7cf247
MagicBeanDev:perf/texture-answer-flat
MagicBeanDev:fix/stamp-test-modules
MagicBeanDev:fix/appimage-fonts
MagicBeanDev:fix/display-awake
MagicBeanDev:release/v2.0.12
MagicBeanDev:fix/discord-windows
MagicBeanDev:rc/v2.0.12-tests
MagicBeanDev:fix/dlss-keep-feature
MagicBeanDev:rc/v2.0.12
MagicBeanDev:button-icons
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
autorelease: pending
autorelease: tagged
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
github_actions
Pull requests that update GitHub Actions code
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
testing wanted
wontfix
This will not be worked on
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
2 participants
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/Hookshot!2607
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki000/restart-in-place-next"
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?
Draft until #1560 lands: this carries #1560's commit (co-authored by its author) so that it can be read and tested as a whole; when #1560 merges I drop that commit and rebase.
What this is for: applying a restart-only setting should not mean returning to the title and manually loading an older save. With Restart in place on, Restart asks the game to autosave, relaunches and loads that save. What is measured: game-free checks on this branch based on main
6ff87f59, with GCC 16.2.1 and Clang 23.1.3, and three headless RTX 4090 cases: the new output size takes effect after relaunch, cancellation keeps the original process running, and a saved restart returns to the same logged position in Kokiri Forest. The save-run interval contains one known kernel mapping-refusal line, not an all-zero kernel result. Not measured: Windows runtime, AMD, Steam Deck, physical input, monitor restoration or performance.This uses the title-loading work in #1560, credited to Nicholas Gower in its separate dependency commit. That pull request is still open.
Problem
host/hos_relaunch.c, but do not ask the game for a fresh save or resume it.main()skippedhos_display_loop()without a window. Changing that condition alone is not enough: main's no-SDL loop only sleeps and never reads the queued Restart/Quit requests.What changed
hos_hid_tapis kept, not duplicated.host/oot_restart.chands the relaunch path a one-use environment note. The restarted game accepts it only while its slot and file time still match the newest save. It then uses the title-loading path regardless of the Skip title screen row. Physical and control-client input is held out of that automatic title passage, not ordinary launches with Skip title screen alone.How to try it
Open the Insert menu, change a setting marked as requiring a restart, then use Gameplay → Restart and confirm it, or choose Restart now when closing the menu. With Restart in place on, allow the autosave to finish. If the game refuses one, the menu asks before proceeding to the title. Esc cancels the pending restart. Turning Restart in place off keeps the ordinary title-screen restart.
Game-free checks
Production head
2a3c6f5con6ff87f59; test-only fixture repair7f924403. Arch Linux, kernel7.2.15-1-omarchy. Complete runs usedtests/run_all.py --strict --jobs 8, serially through the idle/core-dump wrapper. The Clang run also mapped inherited literal GCC fixture commands to Clang; tests with other explicit tool requirements retained them.The pushed head
14a058b1has the same production tree as the tested build; the later commits change the file-open fixture and record the three runs.Both full suites pass the restart-in-place, skip-title, startup, background-input, menu restart/slots/keys/tuning and option-ID checks. The new feature tests fail on main's missing Gameplay rows. The compiled startup fixture fails main's headless idle, Restart and Quit cases; its other ten cases pass.
One failure was caused by this change: the extracted OpenFile fixture lacked the new restart observer. The test-only repair adds a recording observer, keeps every existing core-ownership assertion and checks successful, refused and failed writes. The repaired check passes with both compilers. Against main, it fails at
a successful write tells restart in place its guest path once. Production code did not change after the build.The remaining failure sets reproduce on byte-identical main sources:
test_depth_sample_types.pyandtest_unsigned_image_types.pyreject a static local in a constexpr function under C++20.test_vram_budget_row.pyrejects unusedkVramMinimumOnlyunder-Werror.test_env_on.pyrejects main's set-means-onHOS_FPS_LOGread.These unrelated fixes are not included. The raw full suites are not relabelled as green after the fixture repair. No core dumps were found.
Every test/fixture path was compared with main and the pre-rebase branch by Git blob. Only seven files differ from main. Their guards and assertions were compared separately: no check is missing. The headless worker-wait assertion now checks entry into the request loop; the old Ultrawide row assertion follows main's Aspect ratio rename. The restart-in-place and skip-title tests themselves are unchanged from the pre-rebase branch.
In the game
Arch Linux, kernel
7.2.15-1-omarchy, RTX 4090, NVIDIA615.78.08, i9-13900K; production head2a3c6f5con6ff87f59. Headless, stock input/menu scripts, 1280x720 captures, ordinary shared GPU queue. The build reused a completed matching lift after asserting the lift inputs and HLE set; it is not a mixed host/renderer build.execve)execve)All three ran once on 2026-11-11 and ended at their planned wall limits (exit 124), with zero fatal/crash/device-loss counts. The title case's scheduler escapes occurred during its first startup. These shared-load runs are not a performance or general stability comparison.
The title case's log, in order:
Panel 1 shows 1920x1080 with the restart-required marker; panel 2 the Gameplay/Restart confirmation; panel 3 the replacement image at the title with Continue/New Game. The new output size is established by the log, not by the scaled capture.
Cancellation: the log says
restart: the game saved a moment ago and takes no autosave for another 1357 updates: waiting, thenrestart: cancelled 2997 ms after Restart. There is one startup banner and no restart-close line. Its only startup output-size line remains 2048x1152. The inspected picture after cancellation still marks the selected 1920x1080 as requiring a restart, and the final picture shows play continuing.Save loaded: the game took its autosave request, wrote
slot_02/progress.savand reportedrestart: the game saved slot_02 10021 ms after Restart: restarting to continue there. The replacement logs 1920x1080, accepts the continuation note for that slot and logsskip title: loaded, the player is running. It returns to Kokiri Forest, beside the mossy rock near Link's house, 52.8 s after Restart, with 0.00 m displacement in the rounded position log. The camera view differs: this is a save/load, not restoration of every process state.Kernel exception: title and cancellation have no NVRM line. The save-run interval contains one
NVRM: memMap_IMPL: CPU mapping not supported for addressSpace: 0x1, the known mapping refusal, and no Xid or kmemsysDoCacheOp line. Both game images log that dma-buf imports are disabled on NVIDIA; the global kernel line cannot be attributed to a process from this evidence. My check for zero kernel lines therefore fails for that run and is reported as failed; the three functional checks pass. It was not rerun.Not tested
Windows runtime, AMD and Steam Deck; physical controllers/keyboard/mouse; a moved window returning to the same monitor; co-op reconnection; long sessions; corrupt saves; other areas; Restart in place off in a current-build game run. No frame-rate or stutter improvement is claimed. The headless harness cannot establish window placement.
Risks
execve, so the replacement image keeps the PID. Windows uses a new process and its inherited environment block; that runtime path was not exercised here.Overlaps
The open-head scan and conflict hunks were read. No combined game run with those branches is claimed.
Questions for you
Can #1560 land first so its dependency commit can be dropped from this branch? The headless menu repair is also isolated as its own commit.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
WIP: feat(menu): save and resume when restarting for changed settingsto feat(menu): save and resume when restarting for changed settingsRebased
14a058b1onto current main87991bc8asff3f413d, preserving all six commits and their complete messages/trailers, including Nicholas Gower's exact #1560 co-author line. Resolutions retain both sets of historical test records, main's current prompts/camera/Bug report/reset behavior, and the updated Restart explanation in all 13 catalogues; save/resume behavior and defaults are unchanged. On the first rebase, GCC passed 137 selected checks and Clang 136 with only main's background-input fixture warning; the suite was 471 passed / 1 inherited failure / 20 skipped. Main then moved only by #2671; the final rebase changes no PR file blob. Feature/fixture checks and main negatives were rerun with both compilers, along with #2671's offline test and Windows-target host syntax (zero errors under the documented platform supplement). The final PR gate passes. The suite was not repeated, and no new game run or native Windows execution is claimed; this remains a draft carrying #1560. Sources: the #2607 evidence and final-handoff ledger above.