fix(cheats): the teleport follow-up doesn't send again a request the game took (answered other than 0) #1950
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!1950
Loading…
Reference in a new issue
No description provided.
Delete branch "d4nkn3ss/Longshot:fix/teleport-resend-answered"
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
The debug teleport's follow-up (#1046) sends a request the game dropped once more. It reads "dropped" as nothing reserved, no event playing and Link still elsewhere, 1.5 s after the request. Every drop seen was answered 0 by the game's event manager. A request it answered other than 0 was taken and is only slow to reserve, and resending that one would teleport twice: the one double-send case #1046's Risks named.
Now the follow-up also needs the answer to have been 0. The redundant
teleport.resent = 1before the resend goes (the line after the call sets it), and the log line saysanswered 0. These are HumanBean's three suggestions in the review of #1046, which merged before they were in.Changed in review (BeanBot):
teleport.result = result;, with the stand-in's answer as the request'sresult, so a host that saved 0 for a taken request fails it.sending it again, and whenoot_teleportrefuses the resend,not sent again: <why>.--ccdefaults to$CC, else gcc, andrun_allno longer forces gcc.00e0dc93, which builds again with #1949).On main: a request the event manager answers 1 that hasn't reserved its map 1.5 s later is sent again. In
tests/test_teleport_check.py's new case,a request the game took is not sent again: 2, wanted 1.Read first:
oot_teleport_dropped()inhost/oot_teleport_check.hand its call inoot_teleport_followup()(host/hos_main.c); then the sequence cases intests/test_teleport_check.py.See #1046.
Testing
Tested:
python -I -B tests/test_teleport_check.py: the test commit alone fails on main (FAIL: a request the game took is not sent again: 2, wanted 1), and its event-playing and map-loading cases pass there. With the fix it passes, with gcc and clang.teleport.resent = 1after the call is removed, and (on44290f4f) when the host's bookkeeping saves 0 as the answer (teleport.result = 0;). WithCC=clangand no--ccit runs with clang.04c69f69, on main @00e0dc93): an adult save in Hyrule Field, the first teleport to the Market the moment the save is in play. 6 starts: all arrived, each answered0x1, none sent again (3 had the Market reserved and arrived at the check, 3 had it reserved with the arrival's event playing). No device loss,VK_ERRORor FATAL line; every run closed normally.44458371(before review), with #1949's one line added locally since main @fc4a6769didn't build: 6 starts: all arrived. Each request was answered0x1and none was sent again (5 had the Market reserved at the check, 1 had the teleport's own event playing). None was dropped in these 6; the resend of a dropped one is in the next item. No device loss,VK_ERRORor FATAL line; every run closed normally.89c3d21e): 10 starts, all arrived. In 1 the game dropped the request (result 0), it was sent again (result 0x1) and arrived. In 2 an event was playing at the check (the teleport's own), so it was left alone and arrived. No device loss,VK_ERRORor FATAL line.host/hos_main.ccompiles with the build's host flags (-fsyntax-only), and the check passes there. The Linux host wasn't linked or run here.host/hos_main.c, this head against main @00e0dc93(tests/run_all.py;miseisn't installed here): 44 passed and 16 failed on both, the same 16: test_bug_report_defaults, test_crash_dialog, test_crash_record, test_display_startup_failure, test_driver_cache_folder, test_driver_env_choose, test_host_guest_writes, test_lift_cache, test_log_open_failure, test_mods_list, test_perf_report, test_pipeline_tour, test_profiling_mode, test_slow_frames, test_udmabuf_limit_unreadable, test_udmabuf_warning. The rest of the suite reads no changed file.Still to test:
result 0drop, if any, sent again once (@Beanstalk Linux: the first debug teleport after a save loads, several starts)Measurements
Nothing to measure: a debug-only path, and the in-game runs in Tested show it still sends a dropped request again. A request the game took but was slow to reserve wasn't seen in these runs, so its case is shown by the check.
Risks
A request answered other than 0 that the game still drops is no longer sent again, and the control bridge's
--arrivetimes out on it as before #1046. None was seen: every drop in #1046's 159 requests and in these runs was answered 0. Players never reach this path (the Cheats page, the control bridge and the age switch only). Turning it off: a revert.As in #1046: when #823 (the expanded Teleport page, still open) meets the resend, the resend has to send that request's whole target (map, spawn, boot event, carrier) rather than destination 0. Whichever lands second carries that.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened.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: Windows 11 Pro 26300, RTX 3080 10 GB (NVIDIA 621.14), with #1949's line added locally (main doesn't build without it): 6 first teleports after a save loads, all arrived, each answered 0x1 and none sent again. On #1046's head with the same change: 10 starts, all arrived, the one drop (result 0) sent again and arrived.
Recommendation: Request changes. Using the event manager’s answer prevents a second request when an accepted debug teleport is slow to reserve its map. The regression test bypasses the host code that saves that answer, and the updated log can report a resend that failed.
The Cheats page, age switch and control bridge now leave accepted requests alone. A request answered 0 still gets one retry if the destination is unreserved, no event or load is active, and Link is elsewhere. The fix reuses the existing result and removes a redundant write.
Does it help: Yes. The author reports 2 sends on the merge base with the test-only commit and 1 send with the fix for a simulated accepted request. On Windows with the #1949 build fix added, 6 of 6 first teleports arrived, with 0 resends. All 6 had already reserved the map or had an event playing at the check. On the older #1046 head with this fix applied, 1 of 10 requests was dropped, retried and arrived. The slow accepted case was demonstrated only by the fixture.
Other systems: The Cheats page and age switch share the retry rule. The bridge still publishes the original acceptance result, and its clients still wait for arrival. An accepted request that never arrives now relies on the caller’s timeout. The new branch has no GPU-specific code, but the 1.5 s deadline is wall-clock time. The reported runs cover Windows/NVIDIA in game and Linux under WSL for compilation and the fixture. The diff adds no renderer, allocation, save-format, audio, input or launcher work.
Switches: None.
Reviewed:
44458371a2againstfc4a6769fd: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the Forgejo template, both commits and the complete diff. Read host/oot_teleport_check.h and tests/test_teleport_check.py in full, plus the teleport, age-switch, state, lock and caller code in host/hos_main.c. Traced the bridge reply, CLI and tour waits, source extraction, suite discovery and minimap fixture. Skimmed unrelated host code, CI configuration and the recorded runs in the PR, author comment and #1046 history. No local review checklist or sibling Tooling checkout was present.; nothing run (a code review).Checked and fine:
Blocking (to change before merge)
Waiting on the author (a run, a measurement or a decision; no edit does it)
Testing: Read-only review. The author reports GCC and Clang passes and failures when the predicate or follow-up ignores the answer. The reported Windows runs and WSL compile were used as evidence.
Overlaps and merge order: #1949 is already on the checkout’s main as
ae8e78b0, after #1946. Use that main for the next build and test. #1046 is already merged and records a potential overlap with #823. Verify #823’s status before merging it. If it replaces destination indexes with full teleport targets, whichever lands second must preserve the full target on retry.Automated code review by BeanBot (gpt-6.2-sol), on the pull request's opening. Nothing was run; a maintainer decides.
@ -1261,2 +1261,2 @@if (oot_teleport_dropped(next, current, teleport.pending, playing, loading, teleport.resent)) {hos_log("cheats: teleport to %s dropped by the game (nothing reserved, no event): sent again", teleport.pending);if (oot_teleport_dropped(next, current, teleport.pending, playing, loading, teleport.result, teleport.resent)) {hos_log("cheats: teleport to %s dropped by the game (answered 0, nothing reserved, no event): sent again", teleport.pending);This says “sent again” even if the event manager is missing and oot_teleport refuses the retry. Log the attempt here or use the return value to report whether it was sent.
@ -10,2 +9,4 @@bridge's reply), and leaves alone one the game took (answered other than 0) or one with an event playing or a map loadingat the check.python -I -B tests/test_teleport_check.py [--cc gcc]The direct command and suite force GCC even with
CC=clang. A clang-only llvm-mingw setup can miss this test. HonorCCin both paths and keep--ccas an override.@ -76,3 +81,3 @@(void)c, (void)actor, (void)ok;@SENT@teleport.result = 1;teleport.result = answer; /* (0, as every dropped request was answered) */This supplies the saved answer directly. The test still passes if the real host stores 0 for an accepted request. Supply the mocked answer as
resultand compile the production bookkeeping that saves it.Pushed
44290f4fand the merge04c69f69(main00e0dc93, which builds again), for BeanBot's review:teleport.result = result;, with the stand-in's answer asresult. Saving 0 there fails it (a request the game took is not sent again: 2, wanted 1).sending it again, thennot sent again: <why>whenoot_teleportrefuses the resend.--ccdefaults to$CC, else gcc.run_allno longer forces gcc, andCC=clangruns it with clang.The 60 checks that read
host/hos_main.cgive the same 44 passed and 16 failed here as on main @00e0dc93; the description names the 16. This head ran in the game: 6 first teleports, all arrived, each answered 0x1, none resent. A Linux run is in Still to test, since this PC has no native Linux. On #823: it's still open; Risks keeps the note that whichever lands second must resend the whole target.Posted by an AI agent (Claude Code) for d4nkn3ss.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.