test(vk): three checks read the source again after #1300 and #1291: the swapchain's Linux start, the PGO_ENV switch, the exit fixture's vk_new.h #1363

Open
dukenheimer wants to merge 3 commits from dukenheimer/Longshot:test/rc7-check-skew into main
Contributor

Type: test · Risk: low · Tested on: Windows 11, RTX 5090 (clang 23.1.5, llvm-mingw); Linux (WSL Ubuntu 24.04, g++ 13.3) · Needs: none

Why

The rc.7 release check found three game-free checks failing on main. The game is fine: in each case a merged change
moved the source, and the check still reads it the old way. Contributors see these failures on every run and have to
check by hand that they aren't theirs. These three are separate from the five that #1323 fixes.

  • test_vk_swapchain_compat (#1300): start() in gpu/vk/vk_main.cpp gained a small #ifdef _WIN32 / #else / #endif at its top. The check took the first #else as "Linux startup", so it said open_window_surface(true) was gone, though Linux startup is unchanged. Fails on Windows and Linux.
  • test_switch_table (#1300): RX_VK_PGO_FILE's row is read through host/pgo_rt.c's getenv(PGO_ENV). nx2/build.py passes -DPGO_ENV="RX_VK_PGO_FILE" for the renderer's copy, so no C file holds the literal, and the check reported nothing reads the row. Fails on Windows and Linux; #727's description notes it too.
  • test_recorder_sync (#1291): vk_recorder.h now includes vk_new.h. #1291 added it to the sync fixture's folder but not to the exit fixture's (Windows only), so the exit DLL doesn't build. Fails on Windows.

The diagnosis is the PC release-check runner's, from rc.7.

Prior work: none found for these three. Searched test_switch_table, test_vk_swapchain_compat, test_recorder_sync, vk_new.h, PGO_ENV and the team chat. #1323 (madebyjordan) fixes five other checks. #1309 (HumanBean, WIP) widens test_switch_table to the HOS_ and LONGSHOT_ names but doesn't handle the PGO_ENV read. This PR's change is a separate function and a separate call, so the two don't conflict; whichever lands second keeps both. #727 and #1321 list these checks among main's failures.

What changed

Each check now reads the source as it is, and still fails when what it guards is broken.

  • tests/test_vk_swapchain_compat.py: linux_part() keeps the non-Windows branch of each #ifdef _WIN32 in start() (and the #ifndef _WIN32 branches, with nested blocks kept whole). It requires the same four items there as before.
  • tests/test_switch_table.py: defined_reads() treats each -DNAME="RX_..." in nx2/*.py as a read of that name, if a source under gpu/ or host/ calls getenv(NAME). Either one alone counts as no read. The docstring says so.
  • tests/test_recorder_sync.py: fixture_dir() writes the headers for both fixtures (the sync test and the Windows exit test), so a header added for one reaches the other.

Measurements

Verdict: pass. All three fail on main and pass here. Each still fails when the source it guards is broken.

Hardware: Windows 11, RTX 5090, clang 23.1.5 (llvm-mingw, the Builder's), Python 3.14; WSL Ubuntu 24.04, g++ 13.3, Python 3.12
Scene: none: game-free checks
Method: each check run alone on main and on this PR, on Windows and Linux; then each run against a source changed to break what it guards, then put back
How to reproduce: python -I -B tests/run_all.py --exact tests/test_switch_table.py tests/test_vk_swapchain_compat.py tests/test_recorder_sync.py on main and on this branch

Before: main @ 544229a2 After: this PR @ 4047cd3f
test_vk_swapchain_compat, Windows / Linux FAIL / FAIL pass / pass
test_switch_table, Windows / Linux FAIL / FAIL pass / pass
test_recorder_sync, Windows / Linux FAIL (exit DLL: vk_new.h not found) / pass (exit part Windows only) pass (301 s) / pass
Before: main @ 544229a2
test_vk_swapchain_compat: Linux Vulkan startup no longer checks open_window_surface(true)
test_switch_table: FAIL: the switch table and the source disagree:
  RX_VK_PGO_FILE has a row and nothing reads it: delete the row, or make it GONE(...) if players set it
test_recorder_sync (Windows):    62 | #include "vk_new.h"   // (NewNothrow: the ring's and the arena's nothrow new keep their null at the commit limit)
FAIL        19.5s  tests/test_recorder_sync.py

After: this PR @ 4047cd3f
test_vk_swapchain_compat: PASS: Vulkan swapchain respects surface limits and Linux startup reports failures
test_switch_table: ok: 571 switches (diag 189, tune 73, kill 177, attempt 58, hw 48, player 26), 10 removed, 580 names read
test_recorder_sync (Windows): pass     301.5s  tests/test_recorder_sync.py

Each check broken on purpose (Windows; then the source put back):
- vk_main.cpp start(): the Linux branch's open_window_surface(true) made (false), the Windows branch's kept:
  Linux Vulkan startup no longer checks open_window_surface(true)
- vk_main.cpp: the Linux zero-size message reworded: Linux Vulkan startup no longer checks SDL returned zero drawable size
- host/pgo_rt.c: getenv(PGO_ENV) made getenv("HOS_PGO"): RX_VK_PGO_FILE has a row and nothing reads it
- nx2/build.py: -DPGO_ENV="RX_VK_PGO_FILE" removed: RX_VK_PGO_FILE has a row and nothing reads it
- test_recorder_sync keeps its own control, the exit fixture with the old recorder (exit_broken)

Flags and settings

None

Testing

Tested:

  • The three checks on main and on this PR, Windows (clang 23.1.5) and Linux (WSL Ubuntu 24.04, g++ 13.3): table above. Each was also run against a broken source (above).
  • python -I -B tests/run_all.py (Windows 11, clang 23.1.5, 12 jobs, MAGICBEAN_TOOLING set): this PR 626 passed, 43 failed, 52 skipped; main @ 544229a2 in a clean checkout, the same run, 623 passed, 46 failed. The three failing on main and not here are this PR's. None fails here and not on main. The 43 that fail on both, on this PC, several fixed by #1323 (madebyjordan) and #1299: test_auto_handheld, test_bug_report_defaults, test_cpu_report, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_discover, test_display_startup_failure, test_dlss_feature_size, test_failed_compile_keeps_objects, test_framegen_preset, test_fsr_uniform_ownership, test_guest_imported, test_hud_layout_row, test_import_reach, test_invalidate_vcore, test_job_queue, test_lift_lookups, test_linux_preflight, test_linux_pressure, test_mirror_budget, test_missing_nup, test_pads_after_menu, test_parallel_init_order, test_pending_guest_import, test_perf_report, test_pipeline_play_cache, test_present_thread, test_profiling_mode, test_readback_timeout_source, test_replay_write_order, test_rumble_menu, test_run_all_changed, test_slow_frames, test_staging_burst, test_target_image_pool, test_tested_configurations, test_upscaler_round_trip, test_upscaler_rows, test_vcore_escape, test_vk_occlusion_queries, test_walk_key, test_walk.

Not tested: test_recorder_sync's exit part on Linux: it runs only on Windows (exit_test returns None elsewhere), so the check can't fail on Linux for this reason. Its Linux run is in the table.

Must be tested:

  • None

Risks

What could break: Only these three checks. A source that breaks what they guard still fails them (shown above).

Turning it off: revert the commit

Compatibility: Nothing changes: tests only.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • 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.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
**Type:** test · **Risk:** low · **Tested on:** Windows 11, RTX 5090 (clang 23.1.5, llvm-mingw); Linux (WSL Ubuntu 24.04, g++ 13.3) · **Needs:** none ## Why The rc.7 release check found three game-free checks failing on main. The game is fine: in each case a merged change moved the source, and the check still reads it the old way. Contributors see these failures on every run and have to check by hand that they aren't theirs. These three are separate from the five that #1323 fixes. - `test_vk_swapchain_compat` (#1300): `start()` in `gpu/vk/vk_main.cpp` gained a small `#ifdef _WIN32 / #else / #endif` at its top. The check took the first `#else` as "Linux startup", so it said `open_window_surface(true)` was gone, though Linux startup is unchanged. Fails on Windows and Linux. - `test_switch_table` (#1300): `RX_VK_PGO_FILE`'s row is read through `host/pgo_rt.c`'s `getenv(PGO_ENV)`. `nx2/build.py` passes `-DPGO_ENV="RX_VK_PGO_FILE"` for the renderer's copy, so no C file holds the literal, and the check reported nothing reads the row. Fails on Windows and Linux; #727's description notes it too. - `test_recorder_sync` (#1291): `vk_recorder.h` now includes `vk_new.h`. #1291 added it to the sync fixture's folder but not to the exit fixture's (Windows only), so the exit DLL doesn't build. Fails on Windows. The diagnosis is the PC release-check runner's, from rc.7. Prior work: none found for these three. Searched `test_switch_table`, `test_vk_swapchain_compat`, `test_recorder_sync`, `vk_new.h`, `PGO_ENV` and the team chat. #1323 (madebyjordan) fixes five other checks. #1309 (HumanBean, WIP) widens `test_switch_table` to the `HOS_` and `LONGSHOT_` names but doesn't handle the `PGO_ENV` read. This PR's change is a separate function and a separate call, so the two don't conflict; whichever lands second keeps both. #727 and #1321 list these checks among main's failures. ## What changed Each check now reads the source as it is, and still fails when what it guards is broken. - `tests/test_vk_swapchain_compat.py`: `linux_part()` keeps the non-Windows branch of each `#ifdef _WIN32` in `start()` (and the `#ifndef _WIN32` branches, with nested blocks kept whole). It requires the same four items there as before. - `tests/test_switch_table.py`: `defined_reads()` treats each `-DNAME="RX_..."` in `nx2/*.py` as a read of that name, if a source under `gpu/` or `host/` calls `getenv(NAME)`. Either one alone counts as no read. The docstring says so. - `tests/test_recorder_sync.py`: `fixture_dir()` writes the headers for both fixtures (the sync test and the Windows exit test), so a header added for one reaches the other. ## Measurements **Verdict:** pass. All three fail on main and pass here. Each still fails when the source it guards is broken. Hardware: Windows 11, RTX 5090, clang 23.1.5 (llvm-mingw, the Builder's), Python 3.14; WSL Ubuntu 24.04, g++ 13.3, Python 3.12 Scene: none: game-free checks Method: each check run alone on main and on this PR, on Windows and Linux; then each run against a source changed to break what it guards, then put back How to reproduce: `python -I -B tests/run_all.py --exact tests/test_switch_table.py tests/test_vk_swapchain_compat.py tests/test_recorder_sync.py` on main and on this branch | | Before: main @ 544229a2 | After: this PR @ 4047cd3f | |---|---|---| | `test_vk_swapchain_compat`, Windows / Linux | FAIL / FAIL | pass / pass | | `test_switch_table`, Windows / Linux | FAIL / FAIL | pass / pass | | `test_recorder_sync`, Windows / Linux | FAIL (exit DLL: `vk_new.h` not found) / pass (exit part Windows only) | pass (301 s) / pass | ``` Before: main @ 544229a2 test_vk_swapchain_compat: Linux Vulkan startup no longer checks open_window_surface(true) test_switch_table: FAIL: the switch table and the source disagree: RX_VK_PGO_FILE has a row and nothing reads it: delete the row, or make it GONE(...) if players set it test_recorder_sync (Windows): 62 | #include "vk_new.h" // (NewNothrow: the ring's and the arena's nothrow new keep their null at the commit limit) FAIL 19.5s tests/test_recorder_sync.py After: this PR @ 4047cd3f test_vk_swapchain_compat: PASS: Vulkan swapchain respects surface limits and Linux startup reports failures test_switch_table: ok: 571 switches (diag 189, tune 73, kill 177, attempt 58, hw 48, player 26), 10 removed, 580 names read test_recorder_sync (Windows): pass 301.5s tests/test_recorder_sync.py Each check broken on purpose (Windows; then the source put back): - vk_main.cpp start(): the Linux branch's open_window_surface(true) made (false), the Windows branch's kept: Linux Vulkan startup no longer checks open_window_surface(true) - vk_main.cpp: the Linux zero-size message reworded: Linux Vulkan startup no longer checks SDL returned zero drawable size - host/pgo_rt.c: getenv(PGO_ENV) made getenv("HOS_PGO"): RX_VK_PGO_FILE has a row and nothing reads it - nx2/build.py: -DPGO_ENV="RX_VK_PGO_FILE" removed: RX_VK_PGO_FILE has a row and nothing reads it - test_recorder_sync keeps its own control, the exit fixture with the old recorder (exit_broken) ``` ### Flags and settings None ## Testing **Tested:** - The three checks on main and on this PR, Windows (clang 23.1.5) and Linux (WSL Ubuntu 24.04, g++ 13.3): table above. Each was also run against a broken source (above). - `python -I -B tests/run_all.py` (Windows 11, clang 23.1.5, 12 jobs, `MAGICBEAN_TOOLING` set): this PR 626 passed, 43 failed, 52 skipped; main @ 544229a2 in a clean checkout, the same run, 623 passed, 46 failed. The three failing on main and not here are this PR's. None fails here and not on main. The 43 that fail on both, on this PC, several fixed by #1323 (madebyjordan) and #1299: `test_auto_handheld`, `test_bug_report_defaults`, `test_cpu_report`, `test_crash_dialog`, `test_crt_options`, `test_damage_debug_menu`, `test_discover`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_failed_compile_keeps_objects`, `test_framegen_preset`, `test_fsr_uniform_ownership`, `test_guest_imported`, `test_hud_layout_row`, `test_import_reach`, `test_invalidate_vcore`, `test_job_queue`, `test_lift_lookups`, `test_linux_preflight`, `test_linux_pressure`, `test_mirror_budget`, `test_missing_nup`, `test_pads_after_menu`, `test_parallel_init_order`, `test_pending_guest_import`, `test_perf_report`, `test_pipeline_play_cache`, `test_present_thread`, `test_profiling_mode`, `test_readback_timeout_source`, `test_replay_write_order`, `test_rumble_menu`, `test_run_all_changed`, `test_slow_frames`, `test_staging_burst`, `test_target_image_pool`, `test_tested_configurations`, `test_upscaler_round_trip`, `test_upscaler_rows`, `test_vcore_escape`, `test_vk_occlusion_queries`, `test_walk_key`, `test_walk`. **Not tested:** `test_recorder_sync`'s exit part on Linux: it runs only on Windows (`exit_test` returns None elsewhere), so the check can't fail on Linux for this reason. Its Linux run is in the table. **Must be tested:** - None ## Risks **What could break:** Only these three checks. A source that breaks what they guard still fails them (shown above). **Turning it off:** revert the commit **Compatibility:** Nothing changes: tests only. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [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. ### When it applies - [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.
#1300 put an #ifdef _WIN32 / #else / #endif at the top of vk_main.cpp's
start() (the environment's names for switches::report), and the check took the
first #else up to the first #endif as Linux startup: that block, which holds
none of what it looks for. It failed on main on Windows and Linux ("no longer
checks open_window_surface(true)") though the Linux startup is unchanged.

linux_part() now keeps the non-Windows branch of each #ifdef _WIN32 in start()
(nested blocks inside them whole), and the same items are required there. A
Linux branch without open_window_surface(true), or without the zero-size
message, still fails it while the Windows branch keeps its own.

Diagnosis: the PC's release-check runner, rc.7.
Assisted-by: GitHub Copilot (Claude Opus 5.5)
Co-authored-by: Copilot App <[email protected]>
#1300's RX_VK_PGO_FILE row is read by host/pgo_rt.c's getenv(PGO_ENV), with
PGO_ENV="RX_VK_PGO_FILE" passed by nx2/build.py (-DPGO_ENV) for the renderer's
copy: no "RX_VK_PGO_FILE" literal in C, so the check said nothing reads it, on
Windows and Linux (#727 notes it too).

defined_reads() takes each -DNAME="RX_..." in nx2/*.py whose NAME a source
under gpu/ or host/ reads with getenv(NAME) as a read of that name, at both
places. The define without the getenv, or the getenv without the define, is
still no read.

Diagnosis: the PC's release-check runner, rc.7.
Assisted-by: GitHub Copilot (Claude Opus 5.5)
Co-authored-by: Copilot App <[email protected]>
test(vk): the recorder exit fixture has vk_new.h too: one helper writes both fixtures' headers
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
4047cd3f4a
#1291 made vk_recorder.h include vk_new.h and added it to the sync fixture's
folder, not to the exit fixture's (Windows only), so the exit DLL didn't build
and test_recorder_sync failed on Windows. fixture_dir() now writes the headers
for both, so a header added to one is in the other.

Diagnosis: the PC's release-check runner, rc.7.
Assisted-by: GitHub Copilot (Claude Opus 5.5)
Co-authored-by: Copilot App <[email protected]>
TrashPanda approved these changes 2026-11-17 09:56:24 +00:00
TrashPanda left a comment

The three game-free checks read the source as it is now, and they still fail when the thing they guard is gone. I read head 4047cd3f. It applies onto current main. This can merge as it is.

test_vk_swapchain_compat keeps the non-Windows branch of each _WIN32 test in start(), so the Linux open_window_surface(true) and the zero-size message stay required, and the Windows copy of that call does not satisfy them. test_switch_table counts RX_VK_PGO_FILE as read only when nx2/build.py passes -DPGO_ENV="RX_VK_PGO_FILE" and a source under gpu/ or host/ calls getenv(PGO_ENV). test_recorder_sync writes vk_new.h for the Windows exit fixture as well as the sync fixture. Must be tested names nothing. #1309 also edits the switch-table check; the two combine, and that one is still WIP.

The three game-free checks read the source as it is now, and they still fail when the thing they guard is gone. I read head `4047cd3f`. It applies onto current main. This can merge as it is. `test_vk_swapchain_compat` keeps the non-Windows branch of each `_WIN32` test in `start()`, so the Linux `open_window_surface(true)` and the zero-size message stay required, and the Windows copy of that call does not satisfy them. `test_switch_table` counts `RX_VK_PGO_FILE` as read only when `nx2/build.py` passes `-DPGO_ENV="RX_VK_PGO_FILE"` and a source under `gpu/` or `host/` calls `getenv(PGO_ENV)`. `test_recorder_sync` writes `vk_new.h` for the Windows exit fixture as well as the sync fixture. Must be tested names nothing. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1309 also edits the switch-table check; the two combine, and that one is still WIP.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request has changes conflicting with the target branch.
  • tests/test_switch_table.py
  • tests/test_vk_swapchain_compat.py
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'test/rc7-check-skew:dukenheimer-test/rc7-check-skew'
git switch 'dukenheimer-test/rc7-check-skew'
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!1363
No description provided.