WIP: test(input): give the Walk key fixture the Skip title screen's input hook #497

Draft
mooki wants to merge 1 commit from mooki/Longshot:fix/test-walk-key into main
Member

Why

tests/test_walk_key.py fails on main before any of its assertions runs: its fixture no longer links. So the Walk key
(#66) has no working game-free check, on any platform.

What changed

  • tests: the fixture in tests/test_walk_key.py defines an empty hos_oot_autoload_input() (Skip title screen off),
    the same stand-in tests/test_input_background.py has had since #399. No assertion, product code or other test
    changes.

Why the test is what's wrong, not the code: #399 (ecb0f612) made read_input() in host/nn_hid.c call
hos_oot_autoload_input() (host/oot_autoload.c, the Skip title screen row's presses), and gave the fixture in
tests/test_input_background.py an empty stand-in. #66 (8c1844a9), merged 34 seconds later, added
tests/test_walk_key.py, which also compiles read_input() on its own, but was written on a base without that call.
The call is the intended behaviour; only the new fixture is stale.

Flags and settings

None.

Measurements

main: 9c9d69ed09 (2026-11-14)
this PR: fix/test-walk-key @ 5f3e15404a
Hardware: Apple M4 Max (16 CPUs), 64 GB, macOS 26.7.1, Apple clang 21 (the test runs gcc, which is Apple clang here).
Game-free: no GPU, no game
Scene: none (a test fixture only)
Method: tests/run_all.py test_walk_key in turn: main, this PR, main, this PR. The result is pass or fail, the same in
both rounds, so there is no timing median. A scratch copy with Walk broken shows the repaired check still catches it.
The full game-free suite on both sides, compared by test name.
How to reproduce: python -I -B tests/test_walk_key.py in each checkout (needs a C compiler)

main @ 9c9d69ed this PR @ 5f3e1540
tests/test_walk_key.py, round 1 FAIL: does not link PASS
tests/test_walk_key.py, round 2 FAIL: does not link PASS
full game-free suite on macOS (tests/run_all.py --jobs 6) 533 passed, 20 failed, 17 skipped 534 passed, 19 failed, 17 skipped
main @ 9c9d69ed:
FAIL: test_walk (__main__.WalkKeyTests.test_walk)
AssertionError: 1 != 0 : Undefined symbols for architecture arm64:
  "_hos_oot_autoload_input", referenced from:
      _read_input in t-5cb531.o
ld: symbol(s) not found for architecture arm64

this PR @ 5f3e1540:
1 passed, 0 failed, 0 skipped in 1 s

The repaired check still detects what it protects. In a scratch copy of this PR's files, walk_held() in
host/nn_hid.c made to return 0 at once (Walk never held):

AssertionError: 1 != 0 : defaults: FAIL line 512: st[0] == 0 && near_share(st[1], WALK_SPEED_DEFAULT)
...
(28 FAIL lines; the same copy without the change: OK)

Testing

Tested:

  • On an Apple M4 Max with macOS 26.7.1, game-free only.
  • tests/test_walk_key.py fails on main and passes here, in two rounds run in turn.
  • The broken-Walk scratch copy fails the repaired check (28 failed checks); the unmodified copy passes.
  • The full suite on both sides, compared by test name (main at 10:35 CST, this PR at 10:42 CST, 180 s each, trees
    clean before and after).
    • Only one status changed: tests/test_walk_key.py, FAIL on main, passes here.
    • The same 19 checks fail on both. Main lacks the macOS port's fixes, so they fail on a Mac whatever this PR does:
      test_appimage_package_retry, test_collect_wide, test_control, test_crash_record, test_game_layout,
      test_longshot_ctl, test_low_memory_notice, test_mem_gate, test_mem_gate_children, test_mirror_trim,
      test_oot_state_tap, test_pcache_header_read, test_pipeline_cache_file, test_pipeline_cache_save,
      test_pipeline_play_cache, test_prof_symbols, test_program_cache_cleanup, test_program_cache_one_variant,
      test_report_run.
    • One crash report appeared during this PR's run: a guard binary in a temporary folder, started by Python, killed by
      SIGSEGV. That is the deliberate fault-outside case of tests/test_linux_driver_fault_guard.py, which passed
      [inference from the name, parent and time; main's run left none].

Not tested:

  • Linux and Windows. On main the fixture calls a function nothing defines, which GNU ld and lld refuse as well as Apple's
    linker [inference: not run there]; the fix is one empty C function, which tests/test_input_background.py already
    compiles on every platform.
  • The game: nothing in the game changes.

Needs other testers: None needed to merge: a game-free fixture, no product code. Running it on Linux or Windows
would confirm the "fails on main" side there.

Screenshots

Nothing on screen.

Risk and rollback

Test-only. The empty stand-in means this check never presses through the title screen; the Skip title presses have
their own check (tests/test_skip_title.py), and the Walk check never exercised them. Reverting the commit restores the
link failure.

Reviewer notes

  • Overlaps: every open PR head was searched (fetched at about 10:09 CST): none adds this stand-in to
    tests/test_walk_key.py. #319 changes read_input()'s window gate in host/nn_hid.c but not this test; they apply
    independently.
  • #331 and #338 repair tests/test_pad_layout.py, which main already fixed in #66; on 9c9d69ed it passes.

Issues

See #66 and #399.

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. Two rounds in turn; the results are pass or fail and the same in both rounds, so there is no timing median.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
## Why `tests/test_walk_key.py` fails on main before any of its assertions runs: its fixture no longer links. So the Walk key (#66) has no working game-free check, on any platform. ## What changed - tests: the fixture in `tests/test_walk_key.py` defines an empty `hos_oot_autoload_input()` (Skip title screen off), the same stand-in `tests/test_input_background.py` has had since #399. No assertion, product code or other test changes. Why the test is what's wrong, not the code: #399 (`ecb0f612`) made `read_input()` in `host/nn_hid.c` call `hos_oot_autoload_input()` (`host/oot_autoload.c`, the Skip title screen row's presses), and gave the fixture in `tests/test_input_background.py` an empty stand-in. #66 (`8c1844a9`), merged 34 seconds later, added `tests/test_walk_key.py`, which also compiles `read_input()` on its own, but was written on a base without that call. The call is the intended behaviour; only the new fixture is stale. ## Flags and settings None. ## Measurements main: 9c9d69ed09e2c24965d35f1696aa5c8dd8fe6e40 (2026-11-14) this PR: fix/test-walk-key @ 5f3e15404a10a2bb6eb4e050d6852579ed3be8fc Hardware: Apple M4 Max (16 CPUs), 64 GB, macOS 26.7.1, Apple clang 21 (the test runs `gcc`, which is Apple clang here). Game-free: no GPU, no game Scene: none (a test fixture only) Method: `tests/run_all.py test_walk_key` in turn: main, this PR, main, this PR. The result is pass or fail, the same in both rounds, so there is no timing median. A scratch copy with Walk broken shows the repaired check still catches it. The full game-free suite on both sides, compared by test name. How to reproduce: `python -I -B tests/test_walk_key.py` in each checkout (needs a C compiler) | | main @ 9c9d69ed | this PR @ 5f3e1540 | |---|---|---| | `tests/test_walk_key.py`, round 1 | FAIL: does not link | PASS | | `tests/test_walk_key.py`, round 2 | FAIL: does not link | PASS | | full game-free suite on macOS (`tests/run_all.py --jobs 6`) | 533 passed, 20 failed, 17 skipped | 534 passed, 19 failed, 17 skipped | ``` main @ 9c9d69ed: FAIL: test_walk (__main__.WalkKeyTests.test_walk) AssertionError: 1 != 0 : Undefined symbols for architecture arm64: "_hos_oot_autoload_input", referenced from: _read_input in t-5cb531.o ld: symbol(s) not found for architecture arm64 this PR @ 5f3e1540: 1 passed, 0 failed, 0 skipped in 1 s ``` The repaired check still detects what it protects. In a scratch copy of this PR's files, `walk_held()` in `host/nn_hid.c` made to return 0 at once (Walk never held): ``` AssertionError: 1 != 0 : defaults: FAIL line 512: st[0] == 0 && near_share(st[1], WALK_SPEED_DEFAULT) ... (28 FAIL lines; the same copy without the change: OK) ``` ## Testing **Tested:** - On an Apple M4 Max with macOS 26.7.1, game-free only. - `tests/test_walk_key.py` fails on main and passes here, in two rounds run in turn. - The broken-Walk scratch copy fails the repaired check (28 failed checks); the unmodified copy passes. - The full suite on both sides, compared by test name (main at 10:35 CST, this PR at 10:42 CST, 180 s each, trees clean before and after). - Only one status changed: `tests/test_walk_key.py`, FAIL on main, passes here. - The same 19 checks fail on both. Main lacks the macOS port's fixes, so they fail on a Mac whatever this PR does: `test_appimage_package_retry`, `test_collect_wide`, `test_control`, `test_crash_record`, `test_game_layout`, `test_longshot_ctl`, `test_low_memory_notice`, `test_mem_gate`, `test_mem_gate_children`, `test_mirror_trim`, `test_oot_state_tap`, `test_pcache_header_read`, `test_pipeline_cache_file`, `test_pipeline_cache_save`, `test_pipeline_play_cache`, `test_prof_symbols`, `test_program_cache_cleanup`, `test_program_cache_one_variant`, `test_report_run`. - One crash report appeared during this PR's run: a `guard` binary in a temporary folder, started by Python, killed by SIGSEGV. That is the deliberate `fault-outside` case of `tests/test_linux_driver_fault_guard.py`, which passed [inference from the name, parent and time; main's run left none]. **Not tested:** - Linux and Windows. On main the fixture calls a function nothing defines, which GNU ld and lld refuse as well as Apple's linker [inference: not run there]; the fix is one empty C function, which `tests/test_input_background.py` already compiles on every platform. - The game: nothing in the game changes. **Needs other testers:** None needed to merge: a game-free fixture, no product code. Running it on Linux or Windows would confirm the "fails on main" side there. ## Screenshots Nothing on screen. ## Risk and rollback Test-only. The empty stand-in means this check never presses through the title screen; the Skip title presses have their own check (`tests/test_skip_title.py`), and the Walk check never exercised them. Reverting the commit restores the link failure. ## Reviewer notes - Overlaps: every open PR head was searched (fetched at about 10:09 CST): none adds this stand-in to `tests/test_walk_key.py`. #319 changes `read_input()`'s window gate in `host/nn_hid.c` but not this test; they apply independently. - #331 and #338 repair `tests/test_pad_layout.py`, which main already fixed in #66; on 9c9d69ed it passes. ## Issues See #66 and #399. ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. Two rounds in turn; the results are pass or fail and the same in both rounds, so there is no timing median. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened.
test(input): give the Walk key fixture the Skip title screen's input hook
All checks were successful
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
CI / Conventional Commit title (pull_request) Successful in 3s
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Third-party parts / As their notes say (pull_request) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
5f3e15404a
#399 made host/nn_hid.c's read_input call hos_oot_autoload_input() and gave
tests/test_input_background.py's fixture an empty one. #66, merged 34 seconds
later, added tests/test_walk_key.py, which compiles read_input alone but was
written before that call existed, so on main its fixture no longer links
(undefined hos_oot_autoload_input) and the check fails before any assertion.

The fixture now defines the same empty hook (Skip title screen off), as
test_input_background does. No assertion or product code changes.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
All checks were successful
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
CI / Conventional Commit title (pull_request) Successful in 3s
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Third-party parts / As their notes say (pull_request) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/test-walk-key:mooki-fix/test-walk-key'
git switch 'mooki-fix/test-walk-key'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!497
No description provided.