fix(ab): read options after warm-up and ignore unready area rows (#2349) #2443
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
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!2443
Loading…
Reference in a new issue
No description provided.
Delete branch "Cal/Longshot:fix/ab-locked-rows"
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
Fixes #2349.
dev.py abrefused to write up A/B runs (exit 3) at random when the four per-area Simulated turf rows from #2093 (sim_turf_density,sim_turf_fade_start,sim_turf_far_power,sim_turf_minimum_blades) read"Load an area"in one run and the area's numbers in another.run_one()inscripts/devtools/ab.pycalledoption_getright after teleporting, before the warm-up, racing withsim_turf_settings::tick()'s 750 ms stability window.How to see it on
main: runpython -I scripts/dev.py ab --scene kokiri-forest(orhyrule-field); if any run readsoption_getbeforesim_turf_settings::readybecomes true,differences()refuses the write-up withoptions sim_turf_density: A2 has '150', A1 'Load an area'.What changed:
scripts/devtools/ab.py(run_one): movestatusandoption_getto the end of thewarm-uploop (still beforestart = num(rows[-1], "at_ns")), so options are sampled once the area has settled.scripts/devtools/ab.py(what_ran,differences,UNREADY_ROW_TEXT): record option keys that were locked (fixed: True) with"Load an area"in"unready", and indifferences()compare all ready runs for each option key against the first ready runready[0]. Hardware-locked rows (e.g.upscaler: "Off") and disagreements among ready runs still faildifferences().tests/test_dev_ab.py: addtest_unready_area_rows_not_compared(covers unready first run, unready second run, disagreement among ready runs when the first is unready, and hardware-lockedupscalerstill differing) and assert intest_run_does_not_read_live_logthatoption_getruns aftersettled().Testing
Tested:
tests/test_dev_ab.py, Windows 11):mainwith test commit alone (c9d73c50): failed withAssertionError: Lists differ: ["options sim_turf_density: A2 has '150', A1 'Load an area'", ...]andAssertionError: False is not true : option_get read before warm-up settled.this PR @ bdf95122(rebased ontomain @ 8aa5ab87):Ran 35 tests in 7.955s — OK(run with-X utf8on Windows).tests/byte_compile_tracked.py: pass.nightly-763-0e32bc10):python -I -X utf8 scripts/dev.py ab --env HOS_COLLECT_WIDE=0 --set RX_VK_PRECOMPILE=0 --separate --runs 1 --seconds 10 --warmup 10 --scene kokiri-forest --runtime <nightly-763-0e32bc10>.A1: 395 frames, 39.6 fps;B1: 536 frames, 53.7 fps) booted, teleported toKokiriForest_Child, warmed up 10 s, sampledoption_getafter warm-up, measured 10 s, and stopped cleanly.results.jsonrecordedunready: []and identical settled values in both runs:sim_turf_fade_start: '8.0',sim_turf_density: '150',sim_turf_minimum_blades: '16',sim_turf_far_power: '1.00'(zerooptions sim_turf_*differences). (dev.py abitself exited 1 on an unrelated WindowsHOS_CONTROLper-run pipe-name difference.)Still to test:
mise run testandmise run lint): run the full suite and linter on Linux CI (expecting all checks green, by hand or once CI workflows are approved on this PR).Measurements
Verdict: eliminates random
sim_turf_*A/B refusals; tooling-only change toscripts/devtools/ab.pyandtests/test_dev_ab.py(not built into the game), so no game performance, memory, or build-time impact.8aa5ab87bdf95122tests/test_dev_ab.pytest_unready_area_rows_not_compared,test_run_does_not_read_live_log)7.955s)dev.py ab --scene kokiri-forest(sim_turf_*rows, RTX 4060 / Windows 11)A1 'Load an area'vsA2 '150')unready: [], identical settled values inA1andB1Risks
scripts/devtools/ab.py(developer A/B harness). Reverting the commit restores the previous behavior; nothing changes for players (saves,longshot_options.ini, caches, or game binaries are untouched).UNREADY_ROW_TEXT = "Load an area"matchesgpu/vk/menu/sim_turf_settings.h:379; if that string were reworded, the fallback would stop matching, though post-warmupoption_getsampling would still cover normal runs.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). — not run locally on Windows; waiting for Linux CI approval/runmain, 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.577bd5cca0bdf951222aRebased onto current main (
8aa5ab87), added Assisted-by trailers to both commits (c9d73c50,bdf95122), noted the unrelated Windows HOS_CONTROL pipe-name refusal during the local in-game run, and unticked mise run test until Linux CI runs.fix(ab): read options after warm-up and ignore unready area rows (#2349)to WIP: fix(ab): read options after warm-up and ignore unready area rows (#2349)WIP: fix(ab): read options after warm-up and ignore unready area rows (#2349)to fix(ab): read options after warm-up and ignore unready area rows (#2349)Thank you, Cal. #2797 now includes this same fix: the menu read after the warm-up, and the unready "Load an area" rows left out of the comparison (#2349). Your pull request came first, and #2797 carries your test and fix commits as you wrote them, with you as their author. The one addition built on them, starting the measured window at the first trace row after the menu read, carries
Co-authored-byfor you, and #2797's description credits you by name and links here. It also fixes the trace path andHOS_CONTROL, which stopabonmaintoday, so it supersedes this pull request once it merges. I'm not closing this one: that's for you or a maintainer. A review of #2797 from you would be very welcome.Closing this as superseded by #2797, which merged into
mainas6f5f99fceand carries this fix. Thank you, @Cal: you found and fixed it first, on 2026-11-24 (#2349).main's squashed commit credits you:Co-authored-by: Cal <[email protected]>. #2797's description names you and links here.mainat the time: an adjacent line inRUN_ONLY, and thepacks.runtime_romfsmock, whichmainno longer has.test_unready_area_rows_not_comparedis onmainas you wrote it.main, merging this pull request as well would only conflict.Pull request closed