fix(cheats): a debug teleport the game dropped is sent once more, so the control bridge's teleport arrives #1046
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1046
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:fix/teleport-resend-dropped"
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: low · Tested on: Windows 11, RTX 3080 · Needs: Linux, any GPU
Why
The debug teleport (the Cheats page, and the control bridge's
teleport, which scripted runs and testers use) sometimes doesn't happen. The game answers the request 0 and drops it: nothing reserved (Sequence_ReservedNextBanc ""), no event playing, Link where he was. The control bridge'steleport --arrivethen times out, and a measured run stands in the wrong place. I lost three Market measurements to that today, reported on #391 and #472. Across today's scripted runs on this PC it was 6 of 159 requests, 4 of them the first request a few frames after a save had loaded. The follow-up 1.5 s after each request already read exactly this state, but it only logged it. I searched the open PRs and issues for the teleport: #823 and #461 change the Teleport page and saving, not the request or its follow-up.How to reproduce
Seen on: Windows 11, RTX 3080 (NVIDIA 621.14)
Settings and switches:
HOS_OOT_CHEATS=1,HOS_CONTROL, an adult save, no cap (HOS_FPS_MAX=1000)Steps: load the save, and as soon as it is in play
python -I scripts/longshot_ctl.py --sock <pipe> teleport 3 --arrive 60; repeat over several startsExpected: Link in the Market
Actual: in some starts,
longshot_ctl: timeout: not met in time, with the log'scheats: teleport check: reserved "", current "HyruleField_Adult", event playing 0What changed
The follow-up sends a dropped request once more, so the map changes and the bridge's wait sees it arrive. A request that is under way (a map reserved, an event playing, the map loading), or that has arrived, is left alone, and a resent one is never sent a third time.
host/oot_teleport_check.h(new):oot_teleport_dropped(), the decision, a pure function.host/hos_main.coot_teleport_followup(c, actor):Sequence_IsLoadingBanc;cheats: teleport to <map> dropped by the game (nothing reserved, no event): sent againand callsoot_teleportfor the same destination, setting the 8 s one-request guard aside for it;teleport.resentmarks the resend, and a new request clears it. The player's update passes Link's actor in.tests/test_teleport_check.py(new): compiles the decision with its cases (dropped; reserved, event or loading under way; arrived; already resent; nothing sent). It reads the follow-up for the resend. It fails on main.Measurements
Verdict: fixed: a dropped teleport is sent again and arrives. In 15 starts of this PR, the one request the game dropped arrived after the resend (
result 0, then0x1), and all 15 reached the Market. Main dropped 4 of 19 such first requests in today's A/B runs, none of which arrived.Hardware: Windows 11 Pro 26300, RTX 3080 10 GB (NVIDIA 621.14), i9-12900K, 64 GB
Scene: an adult save in Hyrule Field; the first teleport (to the Market) the moment the save is in play, uncapped, the right stick held through the bridge, a refused request pressed through with A as the A/B scripts do
Method: one start per run, read from
longshot_log.txtand the bridge's reply; each side'slongshot.exeandlongshot_vk.dllswapped into one game folderBaseline: main's side is main @ 1764fed2's build, the one my A/B runs used; this PR is on main @
e4d035e9.git diff 1764fed2 e4d035e9 -- host/hos_main.cis empty: the teleport and its follow-up are the same code.How to reproduce: the steps above, over many starts
1764fed2The bridge said:
teleport 3: in Market_Adult after 1148 frames.Rebased after the runs onto main @
bbe421f5(now65987971).host/hos_main.cis the same there, andtest_teleport_checkpasses again.Flags and settings
None
Testing
Tested:
VK_ERRORor FATAL line; every run closed normally.python -I -B tests/test_teleport_check.py: fails on main (the follow-up has no resend), passes here.python -I -B tests/run_all.pyfrom PowerShell with llvm-mingw from the Longshot Builder: 603 passed, 19 failed, 42 skipped here, against 602 passed, 19 failed, 42 skipped on main @e4d035e9. The same 19 fail on both:test_auto_handheld,test_bug_report_defaults,test_crash_dialog,test_crt_options,test_fsr_uniform_ownership,test_guest_imported,test_import_reach,test_linux_preflight,test_make_game_cache,test_missing_nup,test_pads_after_menu,test_parallel_init_order,test_pending_guest_import,test_release,test_replay_write_order,test_run_all_changed,test_tested_configurations,test_vk_occlusion_queriesandtest_walk_key. Each has an open PR (among them #993, #999, #1003, #1006, #1007, #1009, #1011, #1012, #592, #144, #954, #937, #493 and #537), excepttest_bug_report_defaults(see #773).Not tested: Linux, neither the build nor a run. The change is plain host C with no OS calls. The Cheats page's own teleport goes through the same request and follow-up, but I didn't use the page by hand.
Must be tested:
python -I -B tests/run_all.py test_teleport_check, expecting it to pass; and teleports from the Cheats page, expecting each to arrive once (by hand: the log'scheats: teleportlines)Risks
What could break: a request the game takes more than 1.5 s to reserve, with no event playing, would be sent twice. In today's 159 requests every slow one had an event playing or a map reserved by then, and the six with neither never arrived until another request came.
Turning it off: revert the commit.
Compatibility: Nothing changes for players beyond a teleport that now arrives. The log gains the "sent again" line when it happens.
Issues
None found.
Checklist
Everyone
type(scope): description) of the status line's type.main.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.mainand passing here.tests/that reads changed source updated in this PR, not weakened.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 3080 (NVIDIA 621.14): 27 starts of this build, each loading a save and teleporting to the Market through the control bridge; one request dropped by the game was sent again and arrived, all 27 arrived, no device loss or errors
WIP: fix(cheats): a debug teleport the game dropped is sent once more, so the control bridge's teleport arrivesto fix(cheats): a debug teleport the game dropped is sent once more, so the control bridge's teleport arrivesA correction to my in-game note above: not all 27 arrived. 25 did. The other 2 were in a first script that didn't retry a refusal, and the game refused both at once ("an event is playing"). That's the game refusing while the save's arrival plays, not a drop, and this PR doesn't change it. The 21 starts of the matching script (6 interleaved with main, then 15 alone) all arrived, one of them after the resend. The Testing section now says the same.
Posted by an AI agent (Claude Code) for d4nkn3ss.
Seen again while testing #434 (Windows 11, RTX 3080, NVIDIA 621.14), in a build of main @
3e4e7cabwith #434 merged (#434 touches only draw binding, not the teleport): a teleport to the Market (destination 3) asked for from Hyrule Field was dropped in one of about ten runs that day that teleported. The log shows the case this PR resends:Nothing reserved, no event playing, still in Hyrule Field, and
longshot_ctl teleport 3 --arrivetimed out. That run's Market measurement was taken in the field and was thrown out.Code-only review of
65987971ad; informational findings, with final approval left to another reviewer.P2 — Keep the pending retry's destination separate from the last attempted request's reply (
host/hos_main.c:1190). Send a teleport that the game drops, then press teleport again before its 1.5-second follow-up. The second call clearsteleport.bancat line 1001 before rejecting the request under the 8-second guard. The originalcheck_atremains armed, but the new follow-up passes NULL tooot_teleport_dropped(), which returns false, then clears the timer. The first request therefore never gets its promised retry. The clearing of the reply field is pre-existing; this PR introduces the dependency on that mutable field for retrying an earlier request. Store the pending target separately and replace it only when a new request is actually sent. Add a behavioral sequence test: sent-but-dropped A, rejected B, follow-up retries A exactly once. This is a source-derived case, not a reproduced game failure.The predicate fixture covers individual decisions, but the follow-up check only searches source strings. It would still pass if the post-call
teleport.resent = 1were removed:oot_teleport()resets the flag, allowing repeated retries. Exercising the actual follow-up with a stubbed request would protect the once-only rule as well as the rejected-request case.Merge coordination: the expanded Teleport page also changes this request path. Its
oot_travel_place()temporarily setsplace_target, callsoot_teleport(..., 0), and clears the override. Combining the branches unchanged would resend an arbitrary place as destination 0 after a drop. Preserve the complete original target (map, spawn, boot event and carrier mode) when integrating them; this is a combined-branches hazard, not a defect in this branch alone.Existing evidence includes the author's corrected Windows report (25 arrivals in 27 starts; two immediate refusals), one successful resend and game-free checks. The declared Linux host/check and manual Cheats-page run remain outstanding. I read the full diff, request/follow-up and bridge callers, test, existing comments and relevant sibling changes. No tests, builds or game runs were performed.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.