test: the game-free checks and the website's build pass on main again #2171

Merged
HumanBean merged 1 commit from HumanBean/Longshot:test/main-checks-pass into main 2026-11-22 00:30:35 +00:00
Owner

Summary

main's game-free checks had drifted far from the code. Run in CI's image (catthehacker/ubuntu:act-24.04, tests/run_all.py --strict, both shards), about 115 of ~925 failed. The website's build also failed, so longshot.magicbean.dev hasn't deployed since. With this PR, 1 check fails (test_dev_packs, below) and the website builds and passes its checks.

Most of it is checks that went stale (about 105 test files). They cut code out of the source and compile it, or look for text in it, and the code moved on. Each was brought up to date, checking the same thing it did. Typical changes:

  • cuts and stand-ins for renamed or added code;
  • markers that now matched a new forward declaration;
  • fixtures that now give a module everything it reads;
  • expectations for deliberate changes, with the PR named in a comment. Examples: the parallel replay's segments are gone (#1763), the menu rows moved into modules (#1774), the mods table merges since #2092.

Where a check covered something that was removed on purpose, only that part went, with the reason beside it.

One check was flaky, not stale. test_prepare_stall's busy-compile case burned one thread, and the watchdog counts a process as busy at half a CPU. With checks running 24 at once on a loaded PC, that one thread sometimes fell below the line, and the fake compile was stopped at 4 s instead of 12 s: 1 run in 5 failed even alone. It now burns two. Six runs in a row passed.

What the checks rightly caught, fixed in the source:

  • gpu/render/rx_nvn.h: its _Static_asserts are C11, and g++ refuses them in C++. Since #1855, menu/widescreen.cpp includes the header through vk_api.h, and every g++-built menu check broke. They now go through NVN_STATIC_ASSERT: static_assert in C++, _Static_assert in C.
  • gpu/vk/vk_colour_vision.cpp, gpu/vk/vk_replay.cpp: vk_work.h is the last include again, as its macros require (#1832, #2103).
  • nx2/cmpflags.py: a batch's subtraction V was detected by _fa^_fb. That text is also in ADDS/CMN's ~(_fa^_fb), so batches with no subtraction were rewritten one instruction at a time. It now looks for the exact text it replaces. The lift's output is unchanged to the byte.
  • host/mods.c: modcache/mods_json.txt, which tells a build where the mods list is, was only written at start. So when the Mods tab first wrote a --user folder's mods.json, a build before the next start read the game folder's list instead. The note is now refreshed after each write.
  • gpu/vk/menu_i18n.h: #1859 changed the Output resolution help, and the 13 tables still translated the old text. They're translated again.
  • nx2/build.py: since #1914, vk_vma.cpp calls vmaGetAllocationInfo2, which is VMA 3.1. The build fell back to a system VMA, and Ubuntu 24.04's is 3.0, so vk_vma.cpp failed to compile there. A VMA header without it is now passed over (HEADER_NEEDS, header_declares), and such a build says VMA is missing. Players' builds use the packaged v3.3.0 and see no change. test_target_reuse_memory and test_cpm_discovery check this rule, including an old VMA given as LONGSHOT_VMA_HEADERS.
  • scripts/devtools/packs.py: FSR 4's own cache (longshot_fsr4_pipelines.bin) is classified. scripts/tours/drive.py: #1582's "an input recording is playing" refusal counts as permanent.

The website (website/src/repo-docs/graphics-settings.ts, docs/user/):

  • The ReShade rows from #1861 had empty Default cells and no condition saying when they're shown. They now have both, with a new badge, "With the User ReShade preset".
  • DLSS model and FSR 4 model now say where they show.
  • The reader now knows the ReShade module's two actions and its &user_pick value, each registered by key, the same way the monitor selector is. An unknown action or value still fails the build. Rescan ReShade presets gains the menu help the card needs.
  • Three game names in recent docs (place names, and AMD's "Navi 2", which the filter can't tell from the character) are reworded.

CI: the checks need lz4 and unicorn (both pinned in requirements.txt) and lld. These are added to Forgejo's ci.yml, CircleCI's shared.yml and mise run test-deps.

Still failing: test_dev_packs's "a game patch shows in the objects". packs.build_scripts follows imports inside functions: build.py imports chunks in a function, and chunks.edit_c imports oot_patches. So nx2/oot_patches.py counts as one of the build's scripts, and a game-patch change keeps both modules. That wastes time but is never wrong. Narrowing it risks a pack that reuses a stale build, so it's left for its own change.

Read first: gpu/render/rx_nvn.h, nx2/build.py (header_package), host/mods.c (write_state), nx2/cmpflags.py. Then the tests by area.

Related: Tooling #27 fixes the release tests that fail the launcher's CI.

Testing

Tested: game-free only.

  • Both shards of tests/run_all.py --strict ran in CI's own image (catthehacker/ubuntu:act-24.04, Ubuntu 24.04's g++ and clang, the pinned headers, glslang 16.6.0) from a depth-1 checkout of this commit. Shard 1 failed only test_dev_packs; shard 2 failed none. Results are in a comment below.
  • scripts/website_check.sh passed in the same image: 20 pages built, check-site.ts clean, 91 of 91 unit tests.
  • This PR has not run in the game. The person I work for asked to open it without a run.

Still to test:

  • Linux or Windows, any GPU: start the game, open the menu, and check that the Graphics tab's ReShade rows and the Output resolution help read right, in English and one other language (by hand).
  • Linux, a --user folder with no mods.json: switch a mod in the Mods tab, and check that modcache/mods_json.txt in the game folder names the user folder's mods.json before the next start (by hand).
  • Any OS: a game build still finds the packaged VMA and builds the renderer (build: the Vulkan back end: ... VMA ... in the build log) (by hand).

Measurements

Nothing to measure. These are checks, docs and CI, plus source fixes that change no hot path: cmpflags' output is unchanged to the byte, and the other source changes are a C++ static assert, include order, a note file after a save, and menu text.

Risks

  • Build: a source build that used a distribution's VMA 3.0 now says VMA is missing, where it used to stop at a compile error in vk_vma.cpp. Players' builds are unaffected.
  • Mods: the mods note is written after each save of the list. It's the same file the start already wrote, under the same rules (none with HOS_OPTIONS_FILE, removed when the list is beside the game).
  • Everything else is test, docs or CI. 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 in the game: opened without a run, as asked; the game-free runs are in Testing)
  • mise run test passes (any failure that also fails on main is named). (tests/run_all.py --strict, both shards, in CI's image: only test_dev_packs, which fails on main too, named above)
  • 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.
  • Docs updated.
  • 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 `main`'s game-free checks had drifted far from the code. Run in CI's image (`catthehacker/ubuntu:act-24.04`, `tests/run_all.py --strict`, both shards), about 115 of ~925 failed. The website's build also failed, so longshot.magicbean.dev hasn't deployed since. With this PR, 1 check fails (`test_dev_packs`, below) and the website builds and passes its checks. **Most of it is checks that went stale** (about 105 test files). They cut code out of the source and compile it, or look for text in it, and the code moved on. Each was brought up to date, checking the same thing it did. Typical changes: - cuts and stand-ins for renamed or added code; - markers that now matched a new forward declaration; - fixtures that now give a module everything it reads; - expectations for deliberate changes, with the PR named in a comment. Examples: the parallel replay's segments are gone (#1763), the menu rows moved into modules (#1774), the mods table merges since #2092. Where a check covered something that was removed on purpose, only that part went, with the reason beside it. One check was flaky, not stale. `test_prepare_stall`'s busy-compile case burned one thread, and the watchdog counts a process as busy at half a CPU. With checks running 24 at once on a loaded PC, that one thread sometimes fell below the line, and the fake compile was stopped at 4 s instead of 12 s: 1 run in 5 failed even alone. It now burns two. Six runs in a row passed. **What the checks rightly caught, fixed in the source:** - `gpu/render/rx_nvn.h`: its `_Static_assert`s are C11, and g++ refuses them in C++. Since #1855, `menu/widescreen.cpp` includes the header through `vk_api.h`, and every g++-built menu check broke. They now go through `NVN_STATIC_ASSERT`: `static_assert` in C++, `_Static_assert` in C. - `gpu/vk/vk_colour_vision.cpp`, `gpu/vk/vk_replay.cpp`: `vk_work.h` is the last include again, as its macros require (#1832, #2103). - `nx2/cmpflags.py`: a batch's subtraction V was detected by `_fa^_fb`. That text is also in ADDS/CMN's `~(_fa^_fb)`, so batches with no subtraction were rewritten one instruction at a time. It now looks for the exact text it replaces. The lift's output is unchanged to the byte. - `host/mods.c`: `modcache/mods_json.txt`, which tells a build where the mods list is, was only written at start. So when the Mods tab first wrote a `--user` folder's `mods.json`, a build before the next start read the game folder's list instead. The note is now refreshed after each write. - `gpu/vk/menu_i18n.h`: #1859 changed the Output resolution help, and the 13 tables still translated the old text. They're translated again. - `nx2/build.py`: since #1914, `vk_vma.cpp` calls `vmaGetAllocationInfo2`, which is VMA 3.1. The build fell back to a system VMA, and Ubuntu 24.04's is 3.0, so `vk_vma.cpp` failed to compile there. A VMA header without it is now passed over (`HEADER_NEEDS`, `header_declares`), and such a build says VMA is missing. Players' builds use the packaged v3.3.0 and see no change. `test_target_reuse_memory` and `test_cpm_discovery` check this rule, including an old VMA given as `LONGSHOT_VMA_HEADERS`. - `scripts/devtools/packs.py`: FSR 4's own cache (`longshot_fsr4_pipelines.bin`) is classified. `scripts/tours/drive.py`: #1582's "an input recording is playing" refusal counts as permanent. **The website** (`website/src/repo-docs/graphics-settings.ts`, `docs/user/`): - The ReShade rows from #1861 had empty Default cells and no condition saying when they're shown. They now have both, with a new badge, "With the User ReShade preset". - *DLSS model* and *FSR 4 model* now say where they show. - The reader now knows the ReShade module's two actions and its `&user_pick` value, each registered by key, the same way the monitor selector is. An unknown action or value still fails the build. *Rescan ReShade presets* gains the menu help the card needs. - Three game names in recent docs (place names, and AMD's "Navi 2", which the filter can't tell from the character) are reworded. **CI:** the checks need `lz4` and `unicorn` (both pinned in `requirements.txt`) and `lld`. These are added to Forgejo's `ci.yml`, CircleCI's `shared.yml` and `mise run test-deps`. **Still failing:** `test_dev_packs`'s "a game patch shows in the objects". `packs.build_scripts` follows imports inside functions: `build.py` imports `chunks` in a function, and `chunks.edit_c` imports `oot_patches`. So `nx2/oot_patches.py` counts as one of the build's scripts, and a game-patch change keeps both modules. That wastes time but is never wrong. Narrowing it risks a pack that reuses a stale build, so it's left for its own change. Read first: `gpu/render/rx_nvn.h`, `nx2/build.py` (`header_package`), `host/mods.c` (`write_state`), `nx2/cmpflags.py`. Then the tests by area. Related: [Tooling #27](https://git.magicbean.dev/MagicBeanDev/Tooling/pulls/27) fixes the release tests that fail the launcher's CI. ## Testing **Tested:** game-free only. - Both shards of `tests/run_all.py --strict` ran in CI's own image (`catthehacker/ubuntu:act-24.04`, Ubuntu 24.04's g++ and clang, the pinned headers, glslang 16.6.0) from a depth-1 checkout of this commit. Shard 1 failed only `test_dev_packs`; shard 2 failed none. Results are in a comment below. - `scripts/website_check.sh` passed in the same image: 20 pages built, `check-site.ts` clean, 91 of 91 unit tests. - **This PR has not run in the game.** The person I work for asked to open it without a run. **Still to test:** - Linux or Windows, any GPU: start the game, open the menu, and check that the Graphics tab's ReShade rows and the Output resolution help read right, in English and one other language (by hand). - Linux, a `--user` folder with no `mods.json`: switch a mod in the Mods tab, and check that `modcache/mods_json.txt` in the game folder names the user folder's `mods.json` before the next start (by hand). - Any OS: a game build still finds the packaged VMA and builds the renderer (`build: the Vulkan back end: ... VMA ...` in the build log) (by hand). ## Measurements Nothing to measure. These are checks, docs and CI, plus source fixes that change no hot path: `cmpflags`' output is unchanged to the byte, and the other source changes are a C++ static assert, include order, a note file after a save, and menu text. ## Risks - **Build:** a source build that used a distribution's VMA 3.0 now says VMA is missing, where it used to stop at a compile error in `vk_vma.cpp`. Players' builds are unaffected. - **Mods:** the mods note is written after each save of the list. It's the same file the start already wrote, under the same rules (none with `HOS_OPTIONS_FILE`, removed when the list is beside the game). - Everything else is test, docs or CI. 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 in the game: opened without a run, as asked; the game-free runs are in Testing) - [x] `mise run test` passes (any failure that also fails on `main` is named). (`tests/run_all.py --strict`, both shards, in CI's image: only `test_dev_packs`, which fails on `main` too, named above) - [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] Docs updated. - [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)
test: the game-free checks pass on main again
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) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 11s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 18s
CI / Website build and checks (pull_request) Successful in 5m48s
380db5c6fe
Fixes for the checks that had gone stale against the code: cuts and stand-ins for renamed or
new code, expectations for deliberate changes, and fixtures that miss nothing; and one flaky
one (test_prepare_stall's busy compile, on two threads). Source fixes for what the checks
rightly caught: rx_nvn.h's static asserts in C++, vk_work.h as the last include, cmpflags'
subtraction test, the mods list's note after a write, the Output resolution help's
translations, and the build passing over a VMA older than 3.1. The website builds again: the
ReShade rows' conditions, defaults and help, two registered actions and a value, and three
passages reworded. CI installs lz4, unicorn and lld for the checks that need them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

Game-free runs, in CI's image (ghcr.io/catthehacker/ubuntu:act-24.04; Ubuntu 24.04's g++ and clang, lld; the pinned SPIR-V and Vulkan headers; glslang 16.6.0; zstandard pillow numpy lz4 unicorn as ci.yml installs them). Each run used a depth-1 checkout of the commit, with python -I -B tests/run_all.py --strict --shard N/2, both shards at once on a 24-thread PC.

Shard 1 Shard 2
main (8aa74983, Forgejo's dispatched run) 404 passed, 53 failed 401 passed, 62 failed
this PR (8116b31, before the test_prepare_stall fix) 455 passed, 1 failed (test_dev_packs) 462 passed, 1 failed (test_prepare_stall, flaky: fixed in 380db5c6)
this PR, test_prepare_stall alone, after the fix 6 runs, 6 passed

The shard-1 summary also counts test_dev_packs twice ("2 failed"). It's the only check that failed there.

scripts/website_check.sh, same image: the site built (20 pages), check-site.ts was clean, and 91 of 91 tests passed. On main the build stops at "Incomplete graphics setting".

Nothing ran in the game; this PR was opened without a game run, as the person I work for asked.

**Game-free runs, in CI's image** (`ghcr.io/catthehacker/ubuntu:act-24.04`; Ubuntu 24.04's g++ and clang, `lld`; the pinned SPIR-V and Vulkan headers; glslang 16.6.0; `zstandard pillow numpy lz4 unicorn` as `ci.yml` installs them). Each run used a depth-1 checkout of the commit, with `python -I -B tests/run_all.py --strict --shard N/2`, both shards at once on a 24-thread PC. | | Shard 1 | Shard 2 | |---|---|---| | `main` (8aa74983, Forgejo's dispatched run) | 404 passed, 53 failed | 401 passed, 62 failed | | this PR (8116b31, before the `test_prepare_stall` fix) | 455 passed, 1 failed (`test_dev_packs`) | 462 passed, 1 failed (`test_prepare_stall`, flaky: fixed in 380db5c6) | | this PR, `test_prepare_stall` alone, after the fix | 6 runs, 6 passed | | The shard-1 summary also counts `test_dev_packs` twice ("2 failed"). It's the only check that failed there. `scripts/website_check.sh`, same image: the site built (20 pages), `check-site.ts` was clean, and 91 of 91 tests passed. On `main` the build stops at "Incomplete graphics setting". Nothing ran in the game; this PR was opened without a game run, as the person I work for asked.
HumanBean force-pushed test/main-checks-pass from 380db5c6fe
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) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 11s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 15s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 18s
CI / Website build and checks (pull_request) Successful in 5m48s
to ff55a4b520
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) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 8s
CI / Workflow lint (actionlint) (pull_request) Successful in 8s
CI / Website build and checks (pull_request) Failing after 41s
Third-party parts / As their notes say (pull_request) Successful in 9s
CI / Conventional Commit title (pull_request) Successful in 18s
PR description / Description follows the template (pull_request_target) Failing after 14s
2026-11-22 00:24:50 +00:00
Compare
Author
Owner

Rebased onto main (a053f9e1). The old head was 380db5c6, the new one is ff55a4b5. The conflicts were in four files, and main had fixed part of the same thing in parallel. The website reader and the ReShade rows' docs now take main's own fix: its "with User selected" badge and its registered ReShade rows. This PR's duplicates of those are gone. tests/test_menu_keys.py takes main's fixture. tests/test_device_policy.py keeps both added switches (acquire_ahead from here, bc_small_runs from main). The full run and the website check are going again in CI's image on the new head; their results will follow here.

Rebased onto main (a053f9e1). The old head was 380db5c6, the new one is ff55a4b5. The conflicts were in four files, and main had fixed part of the same thing in parallel. The website reader and the ReShade rows' docs now take main's own fix: its "with User selected" badge and its registered ReShade rows. This PR's duplicates of those are gone. tests/test_menu_keys.py takes main's fixture. tests/test_device_policy.py keeps both added switches (acquire_ahead from here, bc_small_runs from main). The full run and the website check are going again in CI's image on the new head; their results will follow here.
HumanBean changed title from WIP: test: the game-free checks and the website's build pass on main again to test: the game-free checks and the website's build pass on main again 2026-11-22 00:30:28 +00:00
HumanBean deleted branch test/main-checks-pass 2026-11-22 00:30:35 +00:00
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!2171
No description provided.