fix(tours): a teleport the game did not take is asked again after 5 s, not 60 s, so dev.py ab runs no longer fail at the first one #1922

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/tour-teleport-not-taken into main 2026-11-21 00:04:44 +00:00
Owner

Summary

dev.py ab runs were failing at their first teleport, and the ones that didn't lost a minute there. The runs teleport right after the save loads, and at that moment the game's event manager often turns the first request down (the bridge answers sent, accepted: false). map_change (scripts/tours/drive.py) then waited the full arrive_s (60 s) for an arrival that can't come before it asked again. The teleport's budget is in frames (7,200: two minutes at 60 fps); uncapped at ~90 fps that is ~80 s, so the 60 s wait plus the retry ran past it and the run failed: 3 of 8 runs in two Market A/Bs on my PC, which threw both write-ups away.

A send the game did not take is now waited for NOT_TAKEN_S (5 s) before asking again; a request the game took still gets arrive_s. The refused first teleport now costs ~7 s, and a map that is never left (the Haunted Wasteland case: sent, not taken) still fails after five sends, in ~35 s instead of ~5 min.

Read first: map_change in scripts/tours/drive.py.

Testing

Tested: Linux, RTX 3090 (NVIDIA 620.x), Ryzen 9 7900X: dev.py ab --a RX_VK_ACQUIRE_AHEAD=0 --b RX_VK_ACQUIRE_AHEAD=1 --scene market --seconds 30 --runs 2 from this branch (on #1574's runtime): all four runs measured, two of them after a refused first teleport (~7 s lost each); each run 84-91 s from start to the end of its measurement. Before, from main's driver, the same A/B twice: 3 of 8 runs failed with teleport {'to': 3}: not done after ~7500 frames, each after a 60 s wait following sent, not moved (accepted False, ...). tests/test_pipeline_tour.py gains a check: five sends to a map that is never left, with the usual arrive_s=60, must take under 5 x 60 x (NOT_TAKEN_S + 10) frames (main's driver takes 18,000+, so it fails there); I haven't run it on my PC (CI runs it).

Still to test:

  • Linux and Windows: mise run test, tests/test_pipeline_tour.py among it, expecting a pass (by hand: CI on this pull request)

Measurements

Nothing to measure in the game: this changes the test driver's waits, not the game. The time it saves: ~55 s a run that hits a refused first teleport, and no failed runs from it (3 of 8 before).

Risks

A request the game takes late (after 5 s of accepted: false) is now asked for again sooner, up to five times; a request never taken fails after ~35 s instead of ~5 min, with the same message. Only the tours and dev.py ab use it; nothing changes for players.

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 test passes (any failure that also fails on main is named).
  • Measured 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

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e3aEPBsd7QfUkaatjP

## Summary `dev.py ab` runs were failing at their first teleport, and the ones that didn't lost a minute there. The runs teleport right after the save loads, and at that moment the game's event manager often turns the first request down (the bridge answers `sent`, `accepted: false`). `map_change` (`scripts/tours/drive.py`) then waited the full `arrive_s` (60 s) for an arrival that can't come before it asked again. The teleport's budget is in frames (7,200: two minutes at 60 fps); uncapped at ~90 fps that is ~80 s, so the 60 s wait plus the retry ran past it and the run failed: 3 of 8 runs in two Market A/Bs on my PC, which threw both write-ups away. A send the game did not take is now waited for `NOT_TAKEN_S` (5 s) before asking again; a request the game took still gets `arrive_s`. The refused first teleport now costs ~7 s, and a map that is never left (the Haunted Wasteland case: sent, not taken) still fails after five sends, in ~35 s instead of ~5 min. Read first: `map_change` in `scripts/tours/drive.py`. ## Testing **Tested:** Linux, RTX 3090 (NVIDIA 620.x), Ryzen 9 7900X: `dev.py ab --a RX_VK_ACQUIRE_AHEAD=0 --b RX_VK_ACQUIRE_AHEAD=1 --scene market --seconds 30 --runs 2` from this branch (on #1574's runtime): all four runs measured, two of them after a refused first teleport (~7 s lost each); each run 84-91 s from start to the end of its measurement. Before, from main's driver, the same A/B twice: 3 of 8 runs failed with `teleport {'to': 3}: not done after ~7500 frames`, each after a 60 s wait following `sent, not moved (accepted False, ...)`. `tests/test_pipeline_tour.py` gains a check: five sends to a map that is never left, with the usual `arrive_s=60`, must take under `5 x 60 x (NOT_TAKEN_S + 10)` frames (main's driver takes 18,000+, so it fails there); I haven't run it on my PC (CI runs it). **Still to test:** - Linux and Windows: `mise run test`, `tests/test_pipeline_tour.py` among it, expecting a pass (by hand: CI on this pull request) ## Measurements Nothing to measure in the game: this changes the test driver's waits, not the game. The time it saves: ~55 s a run that hits a refused first teleport, and no failed runs from it (3 of 8 before). ## Risks A request the game takes late (after 5 s of `accepted: false`) is now asked for again sooner, up to five times; a request never taken fails after ~35 s instead of ~5 min, with the same message. Only the tours and `dev.py ab` use it; nothing changes for players. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e3aEPBsd7QfUkaatjP
fix(tours): a teleport the game did not take is asked again after 5 s, not 60 s, so dev.py ab runs no longer fail at the first one
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 13s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 22s
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Third-party parts / As their notes say (pull_request) Successful in 25s
PR description / Description follows the template (pull_request_target) Failing after 8s
CI / Website build and checks (pull_request) Failing after 2m10s
f7722d5098
dev.py ab's runs teleport right after the save loads, when the game's event manager often turns the
first request down (accepted false). map_change waited the full 60 s for an arrival that could not
come, then asked again; uncapped at ~90 fps that used up the teleport's 7200-frame budget, and the
run failed (3 of 8 runs in two A/Bs on an RTX 3090). A send the game did not take is now waited for
NOT_TAKEN_S (5 s): the refused first teleport costs ~7 s, and a map that is never left (sent, not
taken) still fails after five sends, in ~35 s instead of ~5 min.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e3aEPBsd7QfUkaatjP
Author
Owner

Tested in game: Linux, RTX 3090, Ryzen 9 7900X: dev.py ab Market A/B, 4 of 4 runs measured (2 after a refused first teleport, ~7 s lost each); before, 3 of 8 failed at it.

Tested in game: Linux, RTX 3090, Ryzen 9 7900X: dev.py ab Market A/B, 4 of 4 runs measured (2 after a refused first teleport, ~7 s lost each); before, 3 of 8 failed at it.
BeanBot left a comment

Recommendation: Request changes. A refused same-map reload can be reported as successful after five seconds without a reload, corrupting the tour's underwater results. The regression test also cannot demonstrate the claimed behavioral failure on the base because it references a constant that does not exist there.

The change shortens waits after rejected teleport and age requests, which can save tour and A/B runs time. It also needs to handle same-map reloads correctly and make the regression test independent of the new implementation.

Does it help: Unproven: the author reports 3 of 8 base-driver runs failed after a 60-second wait, while 4 branch runs completed, including 2 with roughly 7 seconds lost to a rejected request. Those runs are useful evidence, but the description does not establish matched, interleaved runs at the named base and head or report the new test passing on head and failing for the bug on base.
Other systems: The shared driver also handles age switches and same-map underwater reloads; the latter can falsely succeed after a rejected request. The change does not run in the player game or change GPU, save, audio or input code. The fake bridge test is Linux-only; the requested Linux and Windows suite results and CI results are pending.
Switches: None.

Reviewed: f7722d5098 against a106df16b2: Read AGENTS.md, CONTRIBUTING.md, the PR template, the diff, commit, changed driver, relevant fake bridge test and bridge acceptance and reload paths. Skimmed the rest of the large test file, standards and bridge documentation. docs/review-checklist.md and the adjacent Tooling checkout were absent; no recorded runs or generated files were included.; nothing run (a code review).
Checked and fine:

  • Accepted requests and replies without an accepted field retain the existing arrival timeout.
  • The change introduces no downloads, deletion, external access or player-facing switches.
  • The commit records AI assistance; the diff is limited to the stated driver and test.

Blocking (to change before merge)

  1. scripts/tours/drive.py:235: For an underwater same-map reload with accepted=false, the shortened wait times out and the existing want(state) fallback is always true for the reload caller. The driver reports success without retrying or seeing a load, so the tour can record underwater coverage in the wrong state. Require evidence of a reload before success and retry or fail when it was not taken; cover this path with a fake-bridge test.
  2. tests/test_pipeline_tour.py:676: The assertion reads drive.NOT_TAKEN_S, which does not exist on the base. Applying this test to the base therefore raises AttributeError instead of failing on the excessive wait, and tying the bound to the implementation constant can also let an excessive constant pass. Use an independent behavioral limit and demonstrate the test failing on the base and passing on head.

Suggestions (the author may take or leave)

  • Add a transient rejected-then-accepted request test within the normal frame budget, alongside the never-taken case.
  • Record the pending suite and CI results and complete the PR's measurement details before merge.

Testing: Read-only review; no scripts, builds or tests were run. The author reports the new test and suite have not yet been run.
Overlaps and merge order: Not checked: the network is closed and no overlapping pull requests were supplied.


Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A refused same-map reload can be reported as successful after five seconds without a reload, corrupting the tour's underwater results. The regression test also cannot demonstrate the claimed behavioral failure on the base because it references a constant that does not exist there. The change shortens waits after rejected teleport and age requests, which can save tour and A/B runs time. It also needs to handle same-map reloads correctly and make the regression test independent of the new implementation. **Does it help:** Unproven: the author reports 3 of 8 base-driver runs failed after a 60-second wait, while 4 branch runs completed, including 2 with roughly 7 seconds lost to a rejected request. Those runs are useful evidence, but the description does not establish matched, interleaved runs at the named base and head or report the new test passing on head and failing for the bug on base. **Other systems:** The shared driver also handles age switches and same-map underwater reloads; the latter can falsely succeed after a rejected request. The change does not run in the player game or change GPU, save, audio or input code. The fake bridge test is Linux-only; the requested Linux and Windows suite results and CI results are pending. **Switches:** None. **Reviewed:** f7722d5098c5 against a106df16b273: Read AGENTS.md, CONTRIBUTING.md, the PR template, the diff, commit, changed driver, relevant fake bridge test and bridge acceptance and reload paths. Skimmed the rest of the large test file, standards and bridge documentation. docs/review-checklist.md and the adjacent Tooling checkout were absent; no recorded runs or generated files were included.; nothing run (a code review). **Checked and fine:** - Accepted requests and replies without an accepted field retain the existing arrival timeout. - The change introduces no downloads, deletion, external access or player-facing switches. - The commit records AI assistance; the diff is limited to the stated driver and test. **Blocking** (to change before merge) 1. scripts/tours/drive.py:235: For an underwater same-map reload with accepted=false, the shortened wait times out and the existing want(state) fallback is always true for the reload caller. The driver reports success without retrying or seeing a load, so the tour can record underwater coverage in the wrong state. Require evidence of a reload before success and retry or fail when it was not taken; cover this path with a fake-bridge test. 2. tests/test_pipeline_tour.py:676: The assertion reads drive.NOT_TAKEN_S, which does not exist on the base. Applying this test to the base therefore raises AttributeError instead of failing on the excessive wait, and tying the bound to the implementation constant can also let an excessive constant pass. Use an independent behavioral limit and demonstrate the test failing on the base and passing on head. **Suggestions** (the author may take or leave) - Add a transient rejected-then-accepted request test within the normal frame budget, alongside the never-taken case. - Record the pending suite and CI results and complete the PR's measurement details before merge. **Testing:** Read-only review; no scripts, builds or tests were run. The author reports the new test and suite have not yet been run. **Overlaps and merge order:** Not checked: the network is closed and no overlapping pull requests were supplied. --- <sub>Automated code review by BeanBot (gpt-6.1-terra), on the pull request's opening. Nothing was run; a maintainer decides.</sub>
@ -229,3 +233,3 @@
# (reload: a teleport to the map Link is in, whose wait for that map is met at once: the load's end instead)
wait = {"event": "map", "map": r.get("map")} if cmd == "teleport" and not reload else {"event": "loading_end"}
w = g.ask("wait", timeout=arrive_s, **wait)
w = g.ask("wait", timeout=arrive_s if r.get("accepted", True) else min(arrive_s, NOT_TAKEN_S), **wait)
Member

For reload=true, the caller's want predicate is always true. If this request is not accepted, the five-second timeout falls through to that predicate and reports success without a reload, so the underwater tour records the wrong state. Please require evidence of the load and retry or fail when it was not taken.

For reload=true, the caller's want predicate is always true. If this request is not accepted, the five-second timeout falls through to that predicate and reports success without a reload, so the underwater tour records the wrong state. Please require evidence of the load and retry or fail when it was not taken.
@ -668,0 +673,4 @@
except drive.Failed as e:
if "five times" not in str(e):
raise
if fake.frame - start > 5 * 60 * (drive.NOT_TAKEN_S + 10):
Member

This constant does not exist on the base, so the test raises AttributeError there instead of failing on the long wait. Please use an independent behavior limit and verify the test fails for the wait on base and passes on head.

This constant does not exist on the base, so the test raises AttributeError there instead of failing on the long wait. Please use an independent behavior limit and verify the test fails for the wait on base and passes on head.
HumanBean changed title from WIP: fix(tours): a teleport the game did not take is asked again after 5 s, not 60 s, so dev.py ab runs no longer fail at the first one to fix(tours): a teleport the game did not take is asked again after 5 s, not 60 s, so dev.py ab runs no longer fail at the first one 2026-11-21 00:04:27 +00:00
HumanBean deleted branch fix/tour-teleport-not-taken 2026-11-21 00:04:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1922
No description provided.