fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064) #2298
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2298
Loading…
Reference in a new issue
No description provided.
Delete branch "dazemc/Longshot:fix/oot-first-night"
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 save that still holds
HrlField_isFirstNightTime_Adult(0x8592aa82) can never leave 20:00. The game's fixed-time check (f_8347c020, called fromf_803edf70) zeroes the clock step while that Bool is 1 and quest0x4dbca27fis not Ready. The story event that should clear it never ran on the report's save, so the Sun's Song and Debug → Set time are overwritten and the clock snaps back to night (#1064). Clearing the Bool by hand made the clock run, so the state is the problem, not the clock code.This clears the flag when the save is outside Hyrule Field, where the first adult night cannot be.
oot_inventory_refresh(twice a second) already readsSequence_CurrentBanc; for a map that does not start withHyruleFieldand with no event running, it now writes 0 through the game's ownoot_gamedata_set_booland logs one line.HOS_OOT_FIRST_NIGHT_FIX=0turns the repair off for a run. Hyrule Field is left alone: the adult-in-the-Field stuck case still needs the first-night event, and is named under Risks.How to see it on main: take a save that stands outside Hyrule Field and set the Bool at
progress.sav0xe738 to 1 (the reporter's save, or a copy of the repository'smarket-entrance). Load it and read0x8592aa82through the control bridge (subscribe/watch --flags): it stays 1 on main. With this change it becomes 0 and the log saysoot: cleared the first adult night's time lock (the save was in Market_Child, outside Hyrule Field).Files to read first:
host/hos_main.c(oot_first_night_fixand its call inoot_inventory_refresh),tests/test_oot_first_night.py,gpu/vk/switches.def.Fixes #1064.
Testing
Tested: Linux (Arch, kernel 7.3.4-zen2, NVIDIA RTX 4070 Ti, driver 620.70.06), the game from
dev.py rtover the shared basea2dc5385, headless through the control bridge, one game at a time through the queue, from a copy of the repository'smarket-entrancesave withprogress.sav0xe738 set to 1:a2dc5385: the watch read0x8592aa82as 1 (six samples), and the run log had no clear line (main-20261122-124620/log.txt:1496ismap: Market_Child (child), and the log holds no clear line).409be93c(the build's own version line;git range-diff a2dc5385..409be93c 753fb5af..61cd6e8bshows the branch's two commits identical): the watch read 0, and the log hadoot: cleared the first adult night's time lockonce (fix-20261122-122723/log.txt:1483).409be93c(control-20261122-124735): the game reached play (map: Market_Child (child)at log:1626) and its log had no clear line (the repair writes nothing to a clear save). The live flag read timed out in the client's 2 s line window, so the control's value is the save's Bool (0), not a bridge sample. The first control,control-20261122-122936, stopped at intro (control: state boot -> intro at frame 1, log:244) and is not this evidence.tests/test_oot_first_night.pyon main @a2dc5385:FAIL: the flag is cleared outside Hyrule Field: flag 1 (want 0), clears 0 (want 1); here: PASS under gcc and clang, with the repair on and withHOS_OOT_FIRST_NIGHT_FIX=0; the negative control (the Hyrule Field check forced) fails at the same case.tests/run_all.py --jobs 4, which is notmise run test(that isrun_all.py --strict), and not at61cd6e8bon753fb5af: on the head before the switch row and the event guard it gave 826 passed, 20 failed, 107 skipped. All 20 failing files fail identically on maina2dc5385; only three of the 20 are named here (test_sim_turf_pools,test_switch_table,test_vibration_menu). At61cd6e8bon753fb5afonly the changed set has run (run_all.py --changed: 87 passed, 0 failed, 4 skipped), so the full strict suite has not run at this head; the box is unticked, and the run is to do after #2239's off/on pair (Checklist).host/hos_main.ccompiles for Windows with llvm-mingw (syntax-only, against the base's generated headers; the pack built it for Linux). Not linked or run on Windows; the Windows build and run is in Still to test.Still to test:
@Beanstalk a Windows run of the flag-set save).0x4dbca27fis not Ready: load it and see the clock advance after the repair (by hand, the reporter).Measurements
Verdict: fixed outside Hyrule Field:
0x8592aa82goes 1 → 0 and the clear line appears once. The control save (flag 0) on this PR reached play with no clear line. The A/B game runs were at409be93covera2dc5385;git range-diffshows the branch's two commits identical after the rebase to753fb5af, andgit diff 409be93c 61cd6e8b -- host/hos_main.c tests/test_oot_first_night.py tests/perf_pose_test.cis empty. Since61cd6e8b, the switch row's kind word and the test's compiler selection have changed. The switch kind is read only for the log labelswitches::reportprints, and the compiler selection change does not change the game code path. The clock lock itself is the reporter's quest state and is Still to test.Baseline: the A/B ran against
a2dc5385, the branch's pre-rebase base, and the base changed since:git diff --stat a2dc5385 753fb5afis 78 files, 8634 insertions, 5147 deletions,host/rx_backend.cand many tests among them. Among the files this change reads, the fix's own three are byte-identical across the bases (git diff a2dc5385 753fb5af -- host/hos_main.c tests/test_oot_first_night.py tests/perf_pose_test.cis empty);gpu/vk/switches.defdiffers between the bases in other switches' rows (added, removed and edited), while this PR's row is added by the branch and its text is unchanged since the run. So the base's other changes are outside the fix's own files, and the logic the A/B exercises is unchanged; the run does not need repeating for it.Setup: Arch, kernel 7.3.4-zen2, RTX 4070 Ti, NVIDIA 620.70.06; shared base
a2dc5385;market-entrancecopy with the flag set; one queue job, one game at a time; the flag read through the control bridge'ssubscribewithflags=0x8592aa82, six samples after the save is in play.a2dc5385409be93c0x8592aa82after loading the flag-set save (Market_Child)oot: cleared the first adult night's time locklineRisks
The repair only runs outside Hyrule Field and never while an event is playing. It writes the game's Bool in memory; a save keeps it only when the game saves. If a save legitimately holds the flag outside the Field (for example the escape's cutscene before the first-night event), the clock starts running once no event is playing; the log names the map, and
HOS_OOT_FIRST_NIGHT_FIX=0leaves the save as it is. The adult-in-Hyrule-Field stuck case is not repaired: the first-night event still has to run. No save, options, cache or file format changes; a revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit. (Rebased onto753fb5af. The in-game A/B ata2dc5385stands:git range-diffshows the branch's two commits identical, and of the files this change reads the fix's three are byte-identical across the bases; the base's other changes are outside the fix's own files.)mise run testpasses (any failure that also fails onmainis named). (Reason it is unticked: the strict suite has not been reported at this head.mise run testistests/run_all.py --strict(mise.toml:140-143). What has run istests/run_all.py --jobs 4on the head before the switch row and the event guard — 826 passed, 20 failed, 107 skipped — not--strictand not at61cd6e8bon753fb5af; only three of the 20 failures are named (test_sim_turf_pools,test_switch_table,test_vibration_menu), though all 20 were rerun on maina2dc5385and fail there too. At61cd6e8bon753fb5afthe changed set is 87 passed, 0 failed, 4 skipped (run_all.py --changed), not the whole suite. The strict suite had not been queued at4f01eae0: #2239's off/on pair held the PC until 18:04:49. The planned run wasmise run test -- --jobs 5underMemoryMax=12G, no swap, asdev.py queue run 1064-suite-4f01eae0 --mode light; a result at the current head is needed before the box is ticked.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.gpu/vk/switches.def. (The row sayskill: the repair is on by default andHOS_OOT_FIRST_NIGHT_FIX=0turns it off, which isdocs/dev/reference/switches.md:61'skill; the kind is only printed byswitches::report.)tests/that reads changed source is updated, not weakened. (tests/perf_pose_test.cgets a stand-in for the refresh's new call; the pose check itself is unchanged.)x86_64-w64-mingw32-clang -fsyntax-onlyonhost/hos_main.cagainst the base's generated headers; not linked or run. Linux: the pack's build. The Windows build and run stays in Still to test.)gpu/vk/switches.defnow sayskill, as the reference defines it; the code comment names the Hyrule Field limit.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
docs/dev/standards.md:13); the Windows half of Tier 1 has not run this change, and is in Still to test.)main, measured again or a comment says why the numbers still hold.Tested in game: Linux Arch (kernel 7.3.4-zen2), RTX 4070 Ti, NVIDIA 620.70.06; headless through the control bridge, one game at a time in the queue, from a copy of market-entrance with progress.sav 0xe738 set to 1: main
a2dc5385read 0x8592aa82 as 1 (six samples) and logged no clear line; this PR409be93cread 0 and logged 'oot: cleared the first adult night's time lock (the save was in Market_Child, outside Hyrule Field)' once. The flag-clear control reached play with no clear line; its live flag read timed out in the client's 2 s window. Still to test: Windows and the reporter's quest state.Rebase note, and the control's one gap.
a2dc5385; main is now753fb5af(10 commits: prompts, guide docs, Streamline, launcher, #2213's check fixes, #2228, #2258, #2193, #2227, #2194). None toucheshost/hos_main.cortests/test_oot_first_night.py;gpu/vk/switches.defdid, so a rebase would placeHOS_OOT_FIRST_NIGHT_FIXin the new order. The PR is mergeable but 10 commits behind; the in-game A/B ata2dc5385is the branch's base and still holds. I did not rebase without a word: a rebase gate returned confirm, so it is the maintainer's or the owner's call.Market_Childand its log had no clear line. Its live flag read timed out in the client's 2 s line window, so the control's value is the save's Bool (0), not a bridge sample. The main/fix A/B is the evidence: main read0x8592aa82as 1 (six samples), no line; this branch read 0 and logged the clear line once.fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)to WIP: fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)409be93cc861cd6e8bdbWIP: fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)to fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)@HumanBean: #1064's first-night clock fix is ready for the fork CI and a review.
a2dc5385read the flag 1 -> 0 with the clear line once; the changed set on head61cd6e8bis 87 passed, 0 failed, 4 skipped.a2dc5385, not the rebased head61cd6e8b; the rebase changed no host or test code, only the switch row's order (rebase note).61cd6e8b. Ready to merge is 0/4 until Windows and the reporter's quest state are tested.Checked the checklist at
61cd6e8bagainst the diff, the four runs underwork/runs-1064/, and currentmain753fb5af. The fix and the game-free test look sound; these are the entries I can't settle as written.mise run testis not the run quoted, and the full-suite numbers are stale.mise run testistests/run_all.py --strict(mise.toml:140-143). The body's 826 passed / 20 failed / 107 skipped came fromtests/run_all.py --jobs 4on the head before the switch row and the event guard, not at61cd6e8bon753fb5af; the head's 87 passed / 0 failed / 4 skipped is the changed set (--changed), not the whole suite.docs/dev/standards.md:84anddocs/dev/developing.md:205say a skip is not a pass. The 20 failures are said to fail onmaintoo, but only three are named. Settle with a fullmise run testat61cd6e8bon753fb5af(CI has the Vulkan/SPIR-V headers) and the full list of failures that also fail onmain, or untick the box and state the substitute and its limits.The Measurements table names the wrong commit for the After run. The table says
After: this PR @ 61cd6e8b, while the body's Testing says the game run was at409be93covera2dc5385. The exact proof is[hos BaseProcExecutor5] oot: cleared the first adult night's time lock (the save was in Market_Child, outside Hyrule Field)atfix-20261122-122723/log.txt:1483;main-20261122-124620/log.txt:1496hasmap: Market_Child (child)and no clear line. Change the After column to409be93c(or build and run61cd6e8b). The code path is identical:git range-diff a2dc5385..409be93c 753fb5af..61cd6e8bshows=for both commits, andgit diff 409be93c 61cd6e8b -- host/hos_main.c tests/test_oot_first_night.py tests/perf_pose_test.cis empty, so the run still proves the fix's code path; the table just names a commit that did not run.The baseline sentence says only
gpu/vk/switches.defchanged, but the base diff is 78 files.git diff --stat a2dc5385 753fb5afis 78 files, 8634 insertions, 5147 deletions, includinghost/rx_backend.cand many tests. Onlyswitches.defchanged among the files this change reads:git diff a2dc5385 753fb5af -- host/hos_main.c tests/test_oot_first_night.py tests/perf_pose_test.cis empty. Scope the sentence and say why the other base changes don't touch the fix's code path; the run does not need repeating for the logic, but the claim as written is false. The same scope is needed for the one-topic box's "the rebase changed no host or test file": the branch's two commits are identical, but the base did change host and test files.The switch's kind is wrong.
gpu/vk/switches.def:150hasSW(HOS_OOT_FIRST_NIGHT_FIX, attempt, ...), but the switch is on by default (host/hos_main.c:785,env_on_or(..., 1)) and=0turns the repair off.docs/dev/reference/switches.md:61defineskillfor exactly that;:62definesattemptas off for everyone, "an experiment nobody ships." Change the kind tokill.tests/test_switch_table.py:155-159only checks the kind is one of the six, so it passes either way. This is also the only evidence for "Docs updated", so that row currently misdocuments the switch.The control bullet describes the rerun, but the first control did not reach play.
control-20261122-122936stops atcontrol: state boot -> intro at frame 1(log line 244) and has nomap:line; it cannot support "the control save reached play."control-20261122-124735reachesmap: Market_Child (child)at log line 1626 and has no clear line. Name the rerun in Tested and say the first control stopped at intro; say which run the "live flag read timed out" caveat refers to.The Windows box says "builds", but the evidence is
-fsyntax-only: the body says "Windows not linked or run." Either link it, or reword the box/evidence to "compiles (syntax-only)" and keep the Windows run in Still to test.The Tier 1 hardware box is unticked with no reason. The in-game run is on an RTX 4070 Ti on Linux, which is Tier 1 (
docs/dev/standards.md:13); the body does not say whether that settles Tier 1 and Windows remains, or why not. Add the reason beside the box. (The other unticked merge boxes are clear: 0 reviews, and 10 checks pending / 1 successful.)Lines I could read:
fix-20261122-122723/log.txt:1482:[hos BaseProcExecutor5] map: Market_Child (child); line 1483:[hos BaseProcExecutor5] oot: cleared the first adult night's time lock (the save was in Market_Child, outside Hyrule Field).main-20261122-124620/log.txt:1496:[hos BaseProcExecutor3] map: Market_Child (child); no clear line anywhere in the log.control-20261122-124735/log.txt:1626:[hos BaseProcExecutor1] map: Market_Child (child); no clear line anywhere in the log.control-20261122-122936/log.txt:244:control: state boot -> intro at frame 1; nomap:line.fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)to WIP: fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)@HumanBean: the audit on #2298 stands on every point; this pass fixed the code and the description, and the PR is back to WIP until the strict suite runs.
kill(4f01eae0, one commit on61cd6e8b): the repair is on by default andHOS_OOT_FIRST_NIGHT_FIX=0turns it off, which is whatdocs/dev/reference/switches.md:61defines;:62'sattemptis off for everyone. No test pinned the kind —tests/test_switch_table.pychecks only that it is one of the six — so no test changed.61cd6e8b; the head is now4f01eae0, so that ask is stale. I am not re-asking in this pass.mise run testbox is unticked, with the run it actually had:tests/run_all.py --jobs 4on the head before the switch row and the event guard (826 passed, 20 failed, 107 skipped), not--strictand not at this head; only three of the 20 failures are named. The strict suite is not queued yet: #2239's off/on pair holds the PC until 18:04:49 and a queue job would void it. After it:mise run test -- --jobs 5underMemoryMax=12G, no swap, at4f01eae0.409be93c(not61cd6e8b) and say the three code files are identical across them; the baseline says 78 files changed in the base and scopes the claim to the files this change reads; the control citescontrol-20261122-124735(log:1626, no clear line) and says the earliercontrol-20261122-122936stopped at intro (log:244); the Windows box says syntax-only and not linked or run; Tier 1 is unticked because the run is an RTX 4070 Ti on Linux and Windows has not run.Approval and
pr readyare yours once the suite result is in.@review
Recommendation: Approve. The repair clears the flag in the reported Linux test, but the new check ignores the configured C compiler and can be skipped on supported setups. The reported clock lock and the normal first-night story sequence still need an in-game check. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.
The change clears a lingering first-adult-night flag outside Hyrule Field, with a switch to disable the repair. It leaves the Hyrule Field case unresolved and adds a default-on save-state modification whose effect on the normal story sequence has not yet been demonstrated.
Should fix (1): not blocking, but worth doing before merging.
tests/test_oot_first_night.py:21: The test hard-codes gcc instead of using the suite's selected C compiler. (more on the line) Do: Use the suite's {cc} placeholder and handle the selected compiler command consistently with other C tests.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
host/hos_main.c:786: The observed flag change has not been shown to restore the reporter's clock or to preserve the normal first-night sequence. (more on the line) Do: Run the affected quest state and a normal first-adult-night transition with the repair enabled; check that time advances in the stuck case and that the intended event and time lock still complete normally.@fixcan do L1.Checks: Still running: 9 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven for the reported clock lock: the Linux A/B observed the flag change from 1 to 0, but used a child save with the flag set artificially. The reporter's quest state and an advancing clock have not been tested.
Other systems: The repair runs during Link's updates on Windows and Linux, regardless of GPU, and can alter a flag later saved by the game. Windows was syntax-checked but not linked or run; the normal first-night sequence and the reporter's save remain untested.
Switches: HOS_OOT_FIRST_NIGHT_FIX is added, on by default; 0 disables the repair. Its row correctly identifies it as a kill switch, but the default's safety through the normal story sequence is unproven.
Reviewed:
4f01eae093against753fb5af68: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, the full diff, commit messages, the new test and perf_pose_test.c, and the changed host code with its caller and game-data helpers. Skimmed the switch reference and related tests. The rest of host/hos_main.c and switches.def were not read in full; recorded run files and the sibling Tooling checkout were unavailable.; nothing run (a code review).Checked and fine:
Testing: No commands from the pull request or tests were run, as requested. The supplied CI checks are still running.
Overlaps and merge order: Not checked; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -776,0 +783,4 @@static int oot_first_night_fix(Ctx *c, const char *map) {static int on = -1;if (on < 0) on = env_on_or("HOS_OOT_FIRST_NIGHT_FIX", 1);if (!on || !map[0] || !strncmp(map, "HyruleField", 11) || oot_event_playing(c)) return 0;L2 (should fix): The observed flag change has not been shown to restore the reporter's clock or to preserve the normal first-night sequence.
When: The recorded run uses a child Market save with the flag set artificially. The repair also clears a legitimately set flag outside the Field as soon as no event is playing, so the recorded run does not show what happens through the escape and first-night transition.
Do: Run the affected quest state and a normal first-adult-night transition with the repair enabled; check that time advances in the stuck case and that the intended event and time lock still complete normally.
@ -0,0 +18,4 @@import tempfilefrom pathlib import PathRUN_ALL_ARGS = ["--cc", "gcc"]L1 (should fix): The test hard-codes gcc instead of using the suite's selected C compiler.
When: On a supported clang-only machine, or when CC selects clang, run_all checks for gcc and skips this test if gcc is absent; when gcc is present it ignores CC. Thus the repair is not checked with the configured compiler and the strict suite can fail on a missing gcc.
Do: Use the suite's {cc} placeholder and handle the selected compiler command consistently with other C tests.
@fix
4f01eae093674fb6a3c9Recommendation: Approve. The code is ready: only testing is left (a run of the change itself). The repair clears the flag in the reported test state, but it has not yet been shown to restore the reporter’s clock or preserve the normal first-night sequence. Recommend approval; not approved on the forge.
What
@fixchangedI changed this pull request: the new head is
674fb6a3c9. I rebased it ontomain(6acae6aa87). I edited its description to match the change.Changed
Nothing was built or run: the checks run again on the new head.
The change clears a lingering first-night time lock outside Hyrule Field, with an event guard and a switch to disable the repair. The compiler-selection fix lets the game-free test use the suite’s selected compiler without changing the game repair.
Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
host/hos_main.c:786: The observed flag change has not been shown to restore the reporter's clock or to preserve the normal first-night sequence. When: The recorded run uses a child Market save with the flag set artificially. The repair also clears a legitimately set flag outside the Field as soon as no event is playing, so the recorded run does not show what happens through the escape and first-night transition. Do: Run the affected quest state and a normal first-adult-night transition with the repair enabled; check that time advances in the stuck case and that the intended event and time lock still complete normally.Checks: they run again on this head; a failure shows on the pull request.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven for the reported clock problem: the Linux A/B read the flag as 1 on main and 0 with the repair, but did not show the reporter’s clock advancing or the normal story sequence completing.
Other systems: The repair runs on Windows and Linux and can affect saves outside Hyrule Field; Windows and the normal first-night sequence have not been run. GPU-specific behavior is not implicated.
Switches: HOS_OOT_FIRST_NIGHT_FIX defaults on; setting it to 0 disables the repair. Its kill-switch classification matches that behavior, but the default’s safety for the normal story sequence remains unverified.
Reviewed:
674fb6a3c9against6acae6aa87: Read tests/test_oot_first_night.py and tests/compiler_command.py in full, the compiler fix diff, the relevant host refresh and setter context, repository rules and PR template. The much larger base-to-HEAD diff and other changed files were skimmed, not read in full; recorded runs were assessed from the supplied description and comments.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The supplied Linux game run and game-free test show the flag clearing; the reporter’s clock and normal first-night sequence still need in-game verification.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.
WIP: fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)to fix(oot): a save left outside Hyrule Field in the first adult night's time lock runs its clock again (#1064)