WIP: fix(test): test_input_movie compiles with clang again: the teleport stub's unused counter goes #2188

Draft
dyst wants to merge 1 commit from dyst/Longshot:fix/input-movie-clang into main
Member

Summary

tests/test_input_movie.py has failed on Windows since #1582 merged: its glue's stand-in for hos_oot_teleport_cancel counts its calls in tp_cancels, which nothing reads. Clang (the Builder's llvm-mingw) stops at -Wunused-but-set-global under -Werror: glue.c:54:59: error: variable 'tp_cancels' set but not used. GCC on Linux doesn't warn there. The stub counts nothing now; no case asserted the count.

Read first: the two lines in tests/test_input_movie.py.

Testing

Tested: not run yet. Found with tests/run_all.py on main 1101b6127 (Windows 11, llvm-mingw): the compile error above.

Still to test:

  • Windows: python -I -B tests/run_all.py --exact tests/test_input_movie.py, expecting it to pass (by hand)

Measurements

Nothing to measure: a check's stub.

Risks

None for the game: only a check changes. Reverting is enough.

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

  • 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

## Summary `tests/test_input_movie.py` has failed on Windows since #1582 merged: its glue's stand-in for `hos_oot_teleport_cancel` counts its calls in `tp_cancels`, which nothing reads. Clang (the Builder's llvm-mingw) stops at `-Wunused-but-set-global` under `-Werror`: `glue.c:54:59: error: variable 'tp_cancels' set but not used`. GCC on Linux doesn't warn there. The stub counts nothing now; no case asserted the count. Read first: the two lines in `tests/test_input_movie.py`. ## Testing **Tested:** not run yet. Found with `tests/run_all.py` on main `1101b6127` (Windows 11, llvm-mingw): the compile error above. **Still to test:** - Windows: `python -I -B tests/run_all.py --exact tests/test_input_movie.py`, expecting it to pass (by hand) ## Measurements Nothing to measure: a check's stub. ## Risks None for the game: only a check changes. Reverting is enough. ## Checklist ### Ready for review - [x] 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. Not run yet. - [ ] `mise run test` passes (any failure that also fails on `main` is named). Not run yet. - [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] 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)
fix(test): test_input_movie compiles with clang again: the teleport stub's unused counter goes
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
CI / Website build and checks (pull_request) Failing after 20s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 11s
CI / Conventional Commit title (pull_request) Successful in 24s
PR description / Description follows the template (pull_request_target) Successful in 28s
CI / Workflow lint (actionlint) (pull_request) Successful in 34s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
ddf378115b
The glue's stand-in for hos_oot_teleport_cancel counted its calls in tp_cancels, which nothing reads: clang (the Builder's
llvm-mingw) stops at -Wunused-but-set-global under -Werror, so the check has failed on Windows since #1582 merged. The stub
counts nothing now; no case asserted the count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dazemc left a comment

Read of ddf37811 (one file, two lines) on main a2dc5385. The removal itself is safe and weakens nothing. The finding is that the check still does not compile with clang as declared, so the fix's own premise and its Windows run do not exercise the clang toolchain.

1. RUN_ALL_ARGS = ["--cc", "gcc"] is a literal, not the configured compiler (tests/test_input_movie.py:42). run_all resolves {cc} as CC or which("gcc", "clang") (tests/run_all.py:139) β€” on a Windows Builder with only llvm-mingw that is clang β€” but the literal gcc is passed as-is, and parse_compiler("gcc") only checks that a gcc exists (tests/run_all.py:267-274, tests/compiler_command.py:44-50). So on mise run test / CI (run_all.py --strict, mise.toml:141-143) a Windows PC without a gcc does not compile the glue at all: the check fails as not found: gcc (--strict) (or is skipped without --strict), and main()'s own SKIP: no gcc covers a direct run (:1049-1055). On a PC with a GCC, the glue is compiled by GCC, not clang β€” and -Wunused-but-set-global is GCC's group (13+), which is the likely source of the diagnostic quoted in the body. Either way the clang path is not exercised, so "compiles with clang again" is not what this PR proves, and the Still-to-test ("run it on Windows, expecting it to pass") can pass without it. The declaration should be ["--cc", "{cc}"] β€” as tests/test_input_background.py:43 and tests/test_control_picture.py:15 already do β€” and then the run really compiles the glue with llvm-mingw's clang. The glue uses no GNU-only feature beyond -std=gnu11, which clang takes.

2. The stub removal is safe. tp_cancels had no reader: on main it appears only in its declaration and its increment, and at this head nowhere (git grep tp_cancels β€” two lines on main, none here); no case or log prints it (the glue's teleport output is tp_pending/tp_until's TELEPORT line). The stub is still defined with the same no-op behaviour, and it is still the symbol the code under test calls (host/input_movie.c:855, 1105), so the cancel path is still linked and run; only the counter that nothing observed goes. Nothing in the test is weakened.

3. Scope. Test-only, exactly tests/test_input_movie.py (+2/βˆ’2); no game code, no generated files. hos_oot_teleport_cancel's (void)ticket keeps the parameter used, so the same -Werror flags stay quiet.

4. The WIP state. Testing says "not run yet", and the Still-to-test should name the compiler: with the current declaration the run proves GCC (or a missing compiler), and with {cc} it proves the Windows clang. One direct run with the fixed declaration on a Windows PC is the evidence this PR needs; on Linux it can be checked with --cc "{cc}" on the head (both gcc and clang, if both are installed), which is the cheap half before the Windows run.

No approval (WIP), and no claim on it.

**Read of `ddf37811` (one file, two lines) on main `a2dc5385`.** The removal itself is safe and weakens nothing. The finding is that the check still does not compile with clang as declared, so the fix's own premise and its Windows run do not exercise the clang toolchain. **1. `RUN_ALL_ARGS = ["--cc", "gcc"]` is a literal, not the configured compiler** (`tests/test_input_movie.py:42`). `run_all` resolves `{cc}` as `CC` or `which("gcc", "clang")` (`tests/run_all.py:139`) β€” on a Windows Builder with only llvm-mingw that is **clang** β€” but the literal `gcc` is passed as-is, and `parse_compiler("gcc")` only checks that a `gcc` exists (`tests/run_all.py:267-274`, `tests/compiler_command.py:44-50`). So on `mise run test` / CI (`run_all.py --strict`, `mise.toml:141-143`) a Windows PC without a `gcc` does not compile the glue at all: the check fails as `not found: gcc (--strict)` (or is skipped without `--strict`), and `main()`'s own `SKIP: no gcc` covers a direct run (`:1049-1055`). On a PC with a GCC, the glue is compiled by **GCC**, not clang β€” and `-Wunused-but-set-global` is GCC's group (13+), which is the likely source of the diagnostic quoted in the body. Either way the clang path is not exercised, so "compiles with clang again" is not what this PR proves, and the Still-to-test ("run it on Windows, expecting it to pass") can pass without it. The declaration should be `["--cc", "{cc}"]` β€” as `tests/test_input_background.py:43` and `tests/test_control_picture.py:15` already do β€” and then the run really compiles the glue with llvm-mingw's clang. The glue uses no GNU-only feature beyond `-std=gnu11`, which clang takes. **2. The stub removal is safe.** `tp_cancels` had no reader: on main it appears only in its declaration and its increment, and at this head nowhere (`git grep tp_cancels` β€” two lines on main, none here); no case or log prints it (the glue's teleport output is `tp_pending`/`tp_until`'s `TELEPORT` line). The stub is still defined with the same no-op behaviour, and it is still the symbol the code under test calls (`host/input_movie.c:855, 1105`), so the cancel path is still linked and run; only the counter that nothing observed goes. Nothing in the test is weakened. **3. Scope.** Test-only, exactly `tests/test_input_movie.py` (+2/βˆ’2); no game code, no generated files. `hos_oot_teleport_cancel`'s `(void)ticket` keeps the parameter used, so the same `-Werror` flags stay quiet. **4. The WIP state.** Testing says "not run yet", and the Still-to-test should name the compiler: with the current declaration the run proves GCC (or a missing compiler), and with `{cc}` it proves the Windows clang. One direct run with the fixed declaration on a Windows PC is the evidence this PR needs; on Linux it can be checked with `--cc "{cc}"` on the head (both gcc and clang, if both are installed), which is the cheap half before the Windows run. No approval (WIP), and no claim on it.
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
CI / Website build and checks (pull_request) Failing after 20s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Third-party parts / As their notes say (pull_request) Successful in 11s
CI / Conventional Commit title (pull_request) Successful in 24s
PR description / Description follows the template (pull_request_target) Successful in 28s
CI / Workflow lint (actionlint) (pull_request) Successful in 34s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 30s
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/input-movie-clang:dyst-fix/input-movie-clang'
git switch 'dyst-fix/input-movie-clang'
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!2188
No description provided.