WIP: feat(host): HOS_BOOT_SAVE starts the game in a save, with no title screen and no presses #1577
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1577
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/boot-save"
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
Test runs that start from a save have to press A through the title screen and the save list, and those presses race
the game's start (#659). A new test switch,
HOS_BOOT_SAVE, starts the game straight in a save with no title screenand no presses: the game takes the same path a Continue would and loads the save its own way. Nothing changes for
players: the switch is off unless set.
HOS_BOOT_SAVE=1loads the newest save,=slot_NNthat slot (00 to 05). No save, a Master Quest slot, or a slotwithout its
caption.savkeeps the title.Sequence/NormalTitle.module.ainb, the host points the "a save exists" branch past the titlescreen at the step Continue → save card → Yes ends in, and once the graph starts it makes the save list's pick for
the chosen slot. Everything after that is the game's own load.
statusgainsboot_save(off,waiting,picked,loaded,refused,failed), so atest driver knows when to press and when not to.
Read first:
host/oot_boot_save.c(the switch, the start's state),host/oot_title_graph.c(the one link changed),hos_oot_boot_save_writeinhost/hos_main.c(the pick).See #659, #1539.
Testing
Tested: Windows 11 Pro N 22631, RTX 3080 (driver 621.14), Ryzen 9 3900X, from the repository save
kokiri-startthrough the control bridge, at
1786d810(this head):HOS_BOOT_SAVE=1: in play in Kokiri Forest with 0 presses andstatus.boot_saveloaded; the picture is the forest5 s into play and after a 120-frame stick push, which moves Link 1.52 m, the same as the pressed start.
Two such starts against two pressed ones (
RX_VK_LOAD=create, warm): 14.5 and 13.7 s from the game's first frame toin play with 0 presses, against 18.6 and 17.2 s with 16 and 13 presses; all four moved Link 1.52 m and drew the
forest (649 to 679 draws a frame).
(mooki's Linux run; reproduced here: 0 m moved, 3,197 draws a frame against 641). Its save branch's selector was
still running, turned to the title screen, and held the picture and the input. This head no longer puts it back.
tests/test_boot_save.py(synthetic graphs: the one link changed and no other byte, refusals, everytruncation, the slot choice, the read hook, the bridge state, the copies staying changed in play),
tests/test_skip_title.py,tests/test_control.py,tests/test_switch_table.py,tests/test_doc_anchors.py,built with the Builder's llvm-mingw.
Still to test:
kokiri-startsave withHOS_BOOT_SAVE=1and no presses, expecting play in KokiriForest with
status.boot_saveloaded, the picture there and the stick moving Link; and the same save with the switchunset, expecting the title as before (
@Beanstalk linux; the farm runs its nearest plan: pictures before and after astick push with the switch on and off, the save-pick log line, no crash)
Measurements
Verdict: the switch's start is about 4 s faster than pressing through the title (14.1 s against 17.9 s from the
game's first frame to in play, medians), with 0 presses instead of 13 to 16, and ends in the same place every time.
Setup: Windows 11 Pro N 22631, RTX 3080 (621.14), Ryzen 9 3900X, 64 GB;
kokiri-start, defaults, headless,HOS_AUDIO=0,RX_VK_LOAD=create(warm caches, the same load mode for every run); one runtime, the switch set andunset, 2 interleaved runs each through the job queue. Measured from the game's first frame (the bridge's state leaving
boot, after the pipelines are prepared) to in play (stateplay, a fresh snapshot, no event, no load, held 2 s), andfrom launch. Unset: A pressed once a second until in play (the Test Farm agent's start), which is main's start: unset,
nothing of this PR runs.
Baseline: this PR's own build with the switch unset, which takes main's start (unset, nothing of this PR runs), so
both sides share one runtime and its caches.
1786d810, switch unset, A pressed1786d810,HOS_BOOT_SAVE=1Longer blocks agree: 5 runs of each back to back in timing mode, on an experiment build of this head's code (two more
graph edits in it, turned off by a variable): 25.6 s pressed (24.2 to 32.3) against 19.8 s with the switch (18.1 to
34.2). With those two edits on (the title's background scene and the opening's preload left out) the block took
20.4 s: no gain, so they are not in this PR.
Risks
Nothing for players: unset, nothing of this runs. Set, a game file read differently from this build (another version)
is left as it is and the title shows (
boot_saverefused); the pick is made only for a slot the caption manager hasa usable record of, and gives up after 90 s (
failed). With the switch set, Back to title loads the save again: thereis no title in such a run. Turning it off: unset
HOS_BOOT_SAVE. Beanstalk#91 (the Test Farm agent's start) uses theswitch under this name.
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 testpasses (any failure that also fails onmainis named).tests/run_all.pyon Windows with the Builder's llvm-mingw at1786d810: 706 passed, 60 failed, 124 skipped (no Vulkan headers on this PC, Linux-only); the 60 rerun on this branch and on its baseafc4d1adfail on both alike, none on the branch alone.The 60, failing on
afc4d1adtooAuto-controlled,test_appimage_player_build.py,test_auto_handheld.py,test_bug_report_defaults.py,test_build_long_paths.py,test_capture_read_once.py,test_crash_dialog.py,test_crash_record.py,test_crt_options.py,test_damage_debug_menu.py,test_dev_ab.py,test_dev_build.py,test_dev_migrate.py,test_dev_packs.py,test_device_lost_exit.py,test_discover.py,test_display_startup_failure.py,test_dlss_feature_size.py,test_failed_compile_keeps_objects.py,test_flush_nothing_held.py,test_frame_overlap.py,test_game_menu_mouse_buttons.py,test_gpu_wait_stats.py,test_guest_imported.py,test_high_fps_fixes.py,test_host_guest_writes.py,test_hud_layout_row.py,test_job_queue.py,test_libc_hooks.py,test_lift_cache.py,test_lift_lookups.py,test_linux_preflight.py,test_linux_pressure.py,test_longshot_ctl.py,test_make_game_cache.py,test_make_game_ngx.py,test_mise_build.py,test_missing_nup.py,test_mods_list.py,test_ngx_sdk.py,test_pads_after_menu.py,test_pending_guest_import.py,test_pipeline_play_cache.py,test_prepare_cache_save.py,test_present_semaphores.py,test_profiling_mode.py,test_psychov35_fsr3_fg.py,test_readback_timeout_source.py,test_reflex_swapchain_lifetime.py,test_renderer_new_handler.py,test_renhdrum.py,test_sdiv_overflow.py,test_slow_frames.py,test_song_note_cue.py,test_sparse_mirror.py,test_upscaler_rows.py,test_vcore_escape.py,test_vcore_mask0.py,test_walk.py,test_walk_key.pyMeasured 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
gpu/vk/switches.def.tests/that reads changed source is updated, not weakened.fe0c661b, this head still to build: Still to test)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: RTX 3080, driver 621.14, Windows 11: the kokiri-start repository save through the control bridge with HOS_OOT_BOOT_SAVE=1, 4 of 4 starts in play in Kokiri Forest with no presses and no title screen (status.boot_save waiting, picked, loaded); 3 interleaved pressed starts with it unset ended at the same position, facing, hearts and rupees
Possibly related, for context:
Retested at
aa1948c7(the head: the once-a-run change and the run file now in the runtime). The Test Farm agent's start from MagicBeanDev/Beanstalk#91 (HOS_OOT_BOOT_SAVE=slot_00, A only while status.boot_save does not carry the start), 2 runs on each side of an A/B over base310e7c9d: this PR 0 presses, boot_save loaded; the base alone no boot_save, 16 and 12 presses. All four in play in Kokiri Forest at the same position and facing. RTX 3080, 621.14, Windows 11.@Beanstalk linux (any GPU): start from the kokiri-start repository save with HOS_OOT_BOOT_SAVE=1 and no presses, expecting play in Kokiri Forest with status.boot_save "loaded"; and the same save with the switch unset, expecting the title as before. This PR's Linux build has not run anywhere yet.
Beanstalk test farm · an earlier run: commit
aa1948c(the newer results are in a comment below)Commit
aa1948c· tier reviewed · approved by dyst · dashboardWhat will be tested · AI plan (
gpt-6.1-terra)On Linux, the plan compares the kokiri-start save in Kokiri Forest with the new boot-save switch enabled on the PR, and checks the title screen with the switch unset. A failed gameplay or title-state check, crash, or substantial title-screen image difference fails the plan. The runs take about 22 minutes per tester. The farm schema cannot assert status.boot_save or guarantee a no-press save start, and its title start cannot supply the repository save, so those requested checks remain unverified.
1(PR only).kokiri-start, then take the picture kokiri-save; 1 run on each side.Started at 11:43 UTC.
Estimate: done in about 40 min, from the queue and the testers online now.
6e06faff: once the save is in play, the title graph's save branch is put back in the copy the game keeps (only if those bytes are still that graph with the change in it), so a later Back to title is the title. In the game (RTX 3080, Windows 11): 'boot save: in play: the title's graph is as the game shipped it again', in play in Kokiri Forest with 0 presses. One other run of that pair never drew a frame within my driver's 600 s: the freshly copied runtime was still preparing its pipelines (18422 of 34822 at the cut-off), before any of this runs; the next run, with the preparation kept, got in. The Test Farm's agent allows 900 s for that.Two cold reviews by a second agent, and their fixes (
dd40ea31,fe0c661b):Checks catch the reviewers' mutations (tried: the length check, a changed-on-arrival file recorded, the give-up counted from the wrong moment). run_all on
dd40ea31: no failure main430eef4fdoes not also have on this PC. Atfe0c661bin the game: 3 of 3 starts in play with 0 presses (RTX 3080, Windows 11). Pre-existing note: seven other functions in hos_main.c still copy the whole Ctx back and can drop a kick; left for its own PR.Linux run of this head (
fe0c661be), the open item in the description. The host builds on Linux from this head as it stands (on its own base, not rebased, no errors). The switch picks the right save every time, with no presses; after that the picture is black and the stick does nothing, details below.What was run
HOS_FS_TRACE=1was on so the log shows each save file the game opens.play, a fresh game snapshot, no event, no load) against the save's own flags; the lastprogress.savthe game opened is the asked slot's;status.boot_save; the host's presses (noskip title: pressingline, the row off).The switch picks the right save
status.boot_saveat that frameHOS_OOT_BOOT_SAVE=slot_00HOS_OOT_BOOT_SAVE=slot_01HOS_OOT_BOOT_SAVE=slot_02HOS_OOT_BOOT_SAVE=slot_03HOS_OOT_BOOT_SAVE=slot_04HOS_OOT_BOOT_SAVE=slot_05HOS_OOT_BOOT_SAVE=17 of 7 loaded their own save, 0 presses,
boot_saveloadedeach time. The first run on a fresh copy took 79.4 s to the first controllable frame (a slow first start); the other six took 16.0 to 18.6 s (median 17.3), 8.9 to 11.5 s after the first status pastboot. For the description's check,HOS_OOT_BOOT_SAVE=1with the kokiri-start save alone:status.boot_saveloaded, Kokiri Forest, child, 3 hearts as that save's README says, no presses, first controllable frame at 14.7 s (and 13.2 s in a second run).What did not match: the picture is black and Link does not answer input
shottook with the switch on was black (mean grey 0): at the first controllable frame and at 5 s in all 7 six-slot runs, and at 10, 20 and 40 s in slot_02 and in kokiri-start. The bridge saidplay, the frame counter kept advancing, and the log shows the scene being drawn (about 2,240 draws a frame in the slot_02 run, about 690 when the same save is loaded by another route). The same build with no switch and the Skip title row on shows its picture as usual (mean grey 0.53), so the capture works there.stickpushed forward for 120 frames moved Link 0 units, 5 s after the first controllable frame (slot_02) and 45 s after (slot_02 and kokiri-start). On the same build with no switch and the row on, the same push moved him 11.9 units; with another route that loads slot_02 it moved him 13.0 units.No switch, and refused starts
status.boot_savemenu, no game at 39.5 s)offoff=slot_02, row onloaded=slot_03, in a folder with slots 00 to 02 and slot_04 only (no slot_03 folder)off=slot_04, in that folder (its slot_04 is an empty progress.sav with no caption.sav)off=slot_06, in the six-slot folder (no such folder)off=2offboot_savereadsofffor a refused request as it does for no request, so only the log says why. Not tried: a Master Quest slot that exists, the graph left unchanged (refused), a failed pick (failed), Back to title after the start, co-op rooms.One note on
=1: in the same six-slot folder the Skip title row alone (no switch) logged slot_03 as the most recent save, and the game loaded slot_01's save (by its map), while=1loaded slot_03's.--load-slot, if you want itWe have a
--load-slot <0 to 5|newest>argument (andHOS_LOAD_SLOT) in a branch we have not opened a PR for. It reaches the same point another way: it leaves the title's graph alone, finishes the title's waits and presses A once at the save list, so it needs one press where yours needs none. It refuses a number outside 0 to 5, a non-number, a missing or empty slot (log line, title stays), and the Skip title row stands aside. On the same six saves and the same checks: 7 of 7 right, 1 A press each, first controllable frame 14.5 to 18.3 s (median 15.6; the first run 61.4 s) on this busy machine, so no speed claim in either direction. Its pictures show the scene within 5 s of the first controllable frame (3 of the 7 first-frame pictures are still the load's fade), and the same stick push moves Link in slot_02.If you would like it, we could offer it as a thin layer on your switch instead:
--load-slot Nandnewestwould only choose the slot, give the refusals above and hand the start toHOS_OOT_BOOT_SAVE, and we would drop our own route rather than keep two. Only if you want that; the switch is yours and we are not asking you to change it.Overlap with our PR 61 (restart in place)
Both change
host/oot_autoload.c. Git merges PR 61 with this head with no text conflict there. In PR 61,read_inputinhost/nn_hid.ccallshos_oot_autoload_input()only while a demand word is armed, and the word is armed only for a restart or the Skip title row. The switch's tick (the pick, the give-ups, putting the graph back) is called from that function, so with PR 61 and the row off it would not run. This is from reading the code; we have not built the two together. Whichever lands second adds one arming condition for the switch where the word is armed and keeps it armed until the start is over. We will make that change on our side if PR 61 lands second.mooki referenced this pull request2026-11-18 23:19:34 +00:00
fe0c661bee367f9bd5dfWIP: feat(host): HOS_OOT_BOOT_SAVE starts the game in a save, with no title screen and no pressesto WIP: feat(host): HOS_BOOT_SAVE starts the game in a save, with no title screen and no pressesThanks for the Linux run: the black picture and the dead stick were real, and not Linux only. Reproduced on Windows (RTX 3080) at the rebased
fe0c661b: 0 m for a 120-frame stick push and 3,197 draws a frame against 641 for the pressed start, the same shape as your 2,240 against 690.Cause:
6e06faffput the title's graph back as shipped once the player was seen, but NormalTitle's save-branch selector was still running then. It turned to the title screen, which held the picture and the input over the loaded forest. With the put-back off, the same build draws the forest and the push moves Link 1.52 m, as the pressed start does.Fixed in
1786d810: the copies the game keeps stay changed, so with the switch set there is no title, and Back to title loads the save again (documented). The undo is left only for a change that lost the race with the start's refusal, before the graph runs. Also on this branch: rebased on main, and the switch renamed toHOS_BOOT_SAVE(Beanstalk#91 follows).On your other points:
boot_savereadsofffor a refused request as for none: kept, and documented that way; the log says why.=1choosing slot_03 where the Skip title row loaded slot_01:=1takes the newestprogress.savby its time, and the row's choice is its own code, not changed here. Worth an issue of its own if the row is the one that is wrong.--load-slotas a thin layer on the switch would be welcome, if you still want it once this lands.Measured at
1786d810(Windows, RTX 3080, warm, 2 interleaved runs each): 14.1 s from the game's first frame to in play with 0 presses, against 17.9 s pressed (13 to 16 presses).@Beanstalk linux (any GPU): start from the kokiri-start repository save with HOS_BOOT_SAVE=1 and no presses, expecting play in Kokiri Forest with status.boot_save "loaded", the picture there and the stick moving Link; and the same save with the switch unset, expecting the title as before.
Beanstalk test farm · ✅ passed
Commit
1786d81· approved by dyst (reviewed) · dashboard⚠️ Note: The save-start driver presses through the title when the switch is unset, so this plan cannot check that the unset run remains at the title without presses.
⚠️ Note: The schema cannot assert status.boot_save or measure Link’s position; the pick log and before/after pictures are proxies, not proof of the requested status or movement.
Done (started 2026-11-20 23:14 UTC, last report 01:00 UTC). Run 2: re-planned by dyst. Comment
@Beanstalkto run it again.linuxWhat was tested
What will be tested · AI plan (
gpt-6.1-terra)On Linux, compare the PR’s boot-save start with its normal pressed start using the kokiri-start save, over about 10–12 minutes. The plan checks for play in Kokiri Forest, the save-pick log, and pictures before and after a stick push; a missing pick, wrong state or map, crash, or substantial picture difference fails. The farm cannot directly verify the bridge status or Link’s displacement, or leave the unset save start at the title.
HOS_BOOT_SAVE) and off; main is not built or run.1(PR only).kokiri-start, then take the picture before-stick to compare with the switch off, move the stick, take the picture after-stick to compare with the switch off; 1 run on each side.Measurements on `linux`, for the PR description
Verdict: pass on linux (2 reports): no rule failed and no PR run crashed.
Hardware: 1: linux+amd+radv+dgpu
AMD Radeon RX 6600 (RADV NAVI23), 26.2.6AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpuNVIDIA GeForce RTX 5070, 620.70.6AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAMScene: kokiri-boot-save, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: this PR built once and run with its PR-only switches on and off on the same PC in one session, game starts alternating (ABBA); kokiri-boot-save: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (
@Beanstalkon this PR runs it again)1786d81, switch off1786d81, switch onHOS_BOOT_SAVE=1 (PR only)· expected log lines missingFlags and settings
HOS_BOOT_SAVE1As Markdown for the PR description:
The testers' hardware
linuxAMD Radeon RX 6600 (RADV NAVI23), 26.2.6AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAMlinuxNVIDIA GeForce RTX 5070, 620.70.6AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM@Beanstalk test it anyway
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.