fix(oot): let Gohma reach her ceiling position above 60 fps #1098
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!1098
Loading…
Reference in a new issue
No description provided.
Delete branch "PirateKingIsh/Longshot:fix/gohma-saved-turn-rate"
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?
Type: fix · Risk: medium · Tested on: Windows 11, RTX 5090 · Needs: one manual fight above 60 fps on another setup
All numerical results in this description are measured; caps, test inputs and hardware sizes are settings or configuration, and commits are identifiers.
Why
Above 60 fps, Gohma can keep circling the ceiling without reaching the next phase of the fight. Fixes #312. This corrects the saved steering rate without holding or lowering the frame rate.
PR #882 investigated the climb and proposed a frame-rate hold; it was closed unmerged in favor of a proper fix. A probe build recorded the climb's requested velocity: median 6.96627 game units/s at unit step and 6.77738 at median step 0.615338, over 164 and 532 updates respectively. Those climbs completed. The later ceiling circuits continued after the climb update had ended. The other update named there,
f_827a87e0, did not log in these fights. This points to the saved-rate loss below, not a need to hold the climb at 60 fps.How to reproduce
Seen on: Windows 11, RTX 5090, NVIDIA driver 621.24.
Settings and switches: Game frame rate cap 240 (setting; the room actually reached about 98-102 fps), Render resolution 100%,
HOS_DYNRES=0, FPS counter on, frame generation off. Separate control at the 60 cap setting. No custom hot list or play profile.Steps: On main at
903549ee, load a pre-boss Gohma save and play by hand. Let her complete several climbs without defeating her early. A normal first climb does not rule the problem out. Watch for prolonged perimeter circling without reaching the babies or vulnerable-eye phase; lowering the cap live to 60 rescued the reproduced state.Expected: She gets into position and the fight advances at frame rates above 60.
Actual: She can keep moving around the perimeter without progressing.
What changed
The steering update saves a rate for the next frame. Its existing clamp multiplies a turn that has already been scaled by the frame step by that step again. For a rate-limited turn, the saved fraction becomes step squared. The change converts both clamp bounds back to a rate for positive steps below one.
nx2/oot_patches.py: an anchor replacement inf_8263e8e0, the saved steering-rate update, for every caller. Both signed bounds use the existing guest division helper only for0 < step < 1; otherwise the original multiply and operands remain. Missing or ambiguous anchors keep the original code and warn.tests/test_saved_turn_rate.py: an authored, game-free fixture through the real patch function. It covers both signs, rate- and target-limited turns, repeated updates, steps 0.25, 0.42, 0.5, 0.66, 1 and 2 (test inputs), and scoping/idempotence/warning behavior. It reuses only the six necessary arithmetic anchor lines, not a lifted function body.README.md: remove the fixed Gohma fault from the high-cap warning, retain the intro-narration warning, and state the tested rates.docs/tested/: a separate self-contained record for each of PirateKingIsh's three fights on903549eeplus this change.Measurements
Verdict: The reproduced ceiling-circling fault did not occur in the two complete fights on the patched build; the complete 60-cap control was normal. This is correctness evidence, not a performance improvement or a failure rate.
Hardware: Windows 11, RTX 5090, NVIDIA 621.24, Ryzen 7 9800X3D, 64 GB installed RAM (hardware configuration).
Scene: Gohma's room, same pre-boss save source, 100% render setting with
HOS_DYNRES=0, 3416x1440 game picture, windowed, game's own upscaler, frame generation off, cap 240 or 60 as stated (settings).Method: Human-played fights, not identical scripted combat or interleaved performance pairs. Actual FPS is native frame count divided by summed frame time over fresh active boss-play bridge samples, excluding loading, pauses and cutscenes. Climb counts are external read-only bridge observations. Diagnostic probe rows are explicitly separated from production rows.
How to reproduce: Repeat the fight by hand through later climbs, then defeat Gohma; use the actual FPS counter to confirm the game is above 60. Run
python -I -B tests/test_saved_turn_rate.pyfor the game-free arithmetic reproduction.Build identity: Before gameplay was main at
903549ee(the probe-build rows added diagnostics only). After gameplay was903549eeplus this exact patch and test, before the rebase. The current PR commite1023786044641fe17af5f4df49a595d13c1f77fis based on7045ca7c; it was not built or played. Its source checks are reported separately below. The played patch and test are byte-identical to this commit'snx2/oot_patches.pyandtests/test_saved_turn_rate.py.903549eee1023786(change played on903549ee)Probe-build mechanism evidence follows. These rows are local diagnostic builds at
903549ee; the actor-limited experiment is not the production executable or this PR commit. Values are medians on selected rate-limited updates, not physical-angle measurements.The probe-only experiment had five normal climbs at 97.4941 fps. The patched build has no actor registration or native probe. Its external reads cannot atomically measure an instruction's input and output, so no production saved-fraction measurement is claimed.
Game-free output excerpts (no game data):
Flags and settings
None
Testing
Tested: Windows 11 / RTX 5090 / NVIDIA 621.24. The played build was
903549eeplus this change: two complete fights at 99.1491 and 98.1682 fps, one complete control at 59.9991 fps, FPS counter on, fixed 100% rendering. The first higher-cap fight included post-boss dialogue; no repeated jump was observed once, and no fix for that separate report is claimed. All 31 teleport destinations arrived without device loss; their short windows ranged from 59.2753 to 109.0821 fps. Those windows are arrival checks, not sustained high-rate fight proof; Water Temple did not reach above 60.The three fight records are:
docs/tested/2026-11-15-gohma-turn-rate-piratekingish-cap60.mddocs/tested/2026-11-15-gohma-turn-rate-piratekingish-high1.mddocs/tested/2026-11-15-gohma-turn-rate-piratekingish-high2.mdThe catalogue renderer accepts all three records.
tests/test_tested_configurations.pyhas the same single failure with and without them:test_cli_ascii_pipe_emits_the_arrow_containing_source_as_utf8compares Windows CRLF output against LF bytes. Its other 24 checks pass. The full-suite controls retain the new documentation and test on both sides and remove only the production correction.On current main
7045ca7c, rechecked without and with the production fix, with the new regression test present on both sides:The only status difference is the new test becoming a pass; skip reasons also match. The 26 failures common to both sides are:
Eleven intervening commits touch
nx2/or the reviewed high-FPS, frame-cap and FPS-counter paths (listed in EVIDENCE.md). The emitter, FP helpers,nx2/oot_patches.py,host/oot_high_fps.c/.handhost/frame_whole.hare unchanged. The host'snn_vi.cdid change its 30-FPS pacing, limiter restoration and step selection; the FPS counter changed too. A new shadow-resolution hook changes generated code in another function. Code inspection supports expecting the same emitted steering body, but runtime timing is not asserted identical, and current-main generated output was not rebuilt or byte-compared. No new base build or game launch was made for this rebase.Not tested: Gohma gameplay above about 100 fps; Linux, AMD and Intel; gameplay of the other callers (seven distinct AI files use this routine, measured census); builds with a hot list, custom aggressive FP emission, or guest FP exception/flush-to-zero behavior. The Builder's gcc.exe is a Clang wrapper, so there is no independent GNU GCC run. Current-main gameplay remains untested.
Must be tested:
Risks
What could break: This is a shared routine, not a Gohma-only override. Other callers have not had full gameplay testing. At a step of 1 or more the game's arithmetic is unchanged. The guard is step-based; a menu cap of 60 does not prove every sampled graph step equals one. Optional hot-list/custom emission shapes are outside the validated build scope.
Turning it off: No switch. Revert this commit.
Compatibility: No save format, options, shader/pipeline cache format or renderer ABI change. No new tool or runtime switch. The game's generated code is rebuilt normally when the source patch changes; this change does not require shader preparation.
Issues
Fixes #312
See #882 (closed, not merged; its frame-rate hold was not used).
Checklist
Everyone
type(scope): description) of the status line's type.main(fetched7045ca7c).python -I -B tests/run_all.pypasses (any failure that also fails onmainis named).third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers: Codex for implementation/tests/measurements; Claude for review.mainand passing here.docs/tested/for each new measured run (format indocs/tested-configurations.md).The gameplay proof is for a behavioral fix, not an interleaved performance benchmark. No claim is made that static screenshots prove a ceiling cycle. No new gameplay measurements were collected on the rebased branch.
All numerical results below are measured; caps and render resolution are settings. Windows 11, RTX 5090, NVIDIA 621.24: Gohma was played by hand on main
903549eeplus the exact patch and test now ine102378604. Two complete higher-cap fights were normal at 99.1491 and 98.1682 fps (2 and 4 climbs); a complete 60-cap control was normal at 59.9991 fps (3 climbs). Render resolution was fixed at 100%, FPS counter on, no FPS hold. The first higher-cap fight included the following dialogue, with no repeated jump observed once. All 31 teleport destinations arrived without device loss. The rebase onto7045ca7cwas checked with the new test, targeted checks and full suite without/with the fix; it was not rebuilt or played. Another setup still needs one manual fight above 60 fps.Code-only review of
e102378604; informational findings, with final approval left to another reviewer.No confirmed introduced defect found in the six-file diff. The replacement updates both signed clamp bounds together, preserves the original multiply outside positive steps below one, and leaves missing/ambiguous anchors untouched with a warning. The regression exercises the real patch pipeline, repeated rate retention and unchanged/unrelated paths; it also checks that the original arithmetic fails, rather than merely matching source text.
Still waiting on the validation already identified in this PR: one complete Gohma fight on another setup at an actual game rate above 60 FPS, including later ceiling cycles. The recorded Windows/RTX 5090 fights used the exact correction on
903549ee; they do not establish gameplay on this rebased head. The fixture supplies the register setup and substitutes floating-point helpers, so it cannot establish the full shared steering routine's callers or guest floating-point exception/flush-to-zero behavior. Keep those limits explicit when another reviewer assesses the final gameplay evidence.I read the patch integration, surrounding high-FPS handling, test and three fight records. The reviewed patch/high-FPS files have no intervening integration change on current main
623a0ca3beyond this patch being absent. The other open changes sharingoot_patches.pytarget different hooks; no direct duplicate identified. No tests, builds, generated game code or gameplay were run or inspected for this review.Checked on current main @
a413bf1c(Linux). The one commit cherry-picks cleanly: README auto-merged, no conflict markers.tests/test_saved_turn_rate.pypasses: the 62 arithmetic checks, the original arithmetic failing the same short-step checks, and the missing-anchor warning. Not played in game here. The fight above 60 fps on this PC (RTX 4070 Ti) is still open.