test(vk): the replay write-order fixture cuts main's payload_short with payload (#231) #937

Open
mooki wants to merge 1 commit from mooki/Longshot:fix/replay-write-order-payload-short into main
Member

Type: test · Risk: low · Tested on: macOS 26.7.1, Apple M4 Max (game-free checks only, arm64 and x86_64) · Needs: none

Why

tests/test_replay_write_order.py, the check #440 added, fails on main before any of its cases runs: its fixture no longer builds. So #440's fix (the replay's own buffer writes kept in command order) has no working game-free check on any platform, and python -I -B tests/run_all.py fails on it for everyone.

The cause is the merge order. #440 (9e100854, merged 2026-11-15 14:41 CST) merged at a head based on aa95d35f, from before #231 (3d880bf6, merged 12:27 CST). #231 makes payload<T>() in gpu/vk/vk_replay.cpp copy a payload shorter than its type through payload_short, a function of its own. The test cuts payload<T>() out of the replay's source and builds it against its stand-ins, but not payload_short, so the build stops at "use of undeclared identifier 'payload_short'". The issue tracker (searched 2026-11-15 15:10 CST for the test's name, payload_short and "write order") has nothing that fits.

What changed

The test's fixture cuts payload_short out of vk_replay.cpp together with payload<T>(), where the source has it, so the check builds and runs again. No assertion, product code or other test changes.

  • tests: main() in tests/test_replay_write_order.py fills the @@PAYLOAD@@ stand-in with the [[gnu::noinline, gnu::cold]] void payload_short( block and then payload<T>() when the replay has payload_short (main's), and with payload<T>() alone when it does not (a source from before #231, given with --source). 7 lines added, 1 changed.
  • Design: why the test is what's wrong, not the code: payload_short is #231's intended out-of-line copy of a short payload, and #440's fix works with it unchanged; only the fixture, written on a base without it, is stale. This is the rebase sweep's commit for the same break on its rebased copy of #440 (9a1d4d92), cherry-picked without a conflict.

Measurements

Verdict: nothing to measure: a test fixture only; the game, its build and its timing are unchanged.

Flags and settings

None

Testing

Tested: game-free, on macOS 26.7.1, Apple M4 Max, Apple clang 21, arm64 and x86_64 (Rosetta: the fixture built with clang++ -arch x86_64 and run translated):

  • python -I -B tests/test_replay_write_order.py --headers <Vulkan-Headers/include> fails on main ceccd963, and again on 25e7d10f, on both architectures, before any case: t.cpp:273:9: error: use of undeclared identifier 'payload_short', then "FAIL: the cut-out write and clear did not build against the stand-ins". On this PR all 18 cases pass on both: first at d6f6ff82, then at head 3b17461e, the same patch rebased onto 25e7d10f.
  • The repaired check still catches what it protects: with --source pointing at main's gpu/ from just before #440 (adbdd4fc, which already has #231's payload_short), the same 10 cases fail on both architectures ("FAIL: 10 case(s): the replay's own writes do not all keep command order"), and the other 8 pass.
  • The full suite at 3b17461e (python -I -B tests/run_all.py --jobs 6, in a fresh HOME): 573 passed, 41 failed, 17 skipped. By name against main 7bacf846's run on this Mac (558 passed, 34 failed, 17 skipped; main has 47 commits since), the one status this PR changes is test_replay_write_order: pass here, FAIL on main (above). Every other difference is main's own since 7bacf846:
    • 24 other checks it added: 22 pass; test_crt_options (its fixture looks for constexpr int kVramBudgets = in the menu's source, which main's no longer has) and test_nonuniform_image_arrays ("create_device: no 'ci.pNext = &f;' before vkCreateDevice") fail. 3 it removed with #915: test_forge_pr, test_forge_session_lock, test_team_chat.
    • 5 that passed at 7bacf846 fail: test_fsr_uniform_ownership and test_parallel_init_order (their fixtures don't know #928's FpsRtWait), test_bug_report and test_hardware_report (since #915 they need MagicBeanDev/Tooling beside the checkout), test_gpu_hang_watch (its 2 s limit ended the process at 3.7 s, load average 21-27).
    • Those 7 fail the same way on main 25e7d10f, run by name on this Mac (the hang watch at 3.4 s, load average 32).
    • These 34 fail here and on main 7bacf846 on this Mac, by name: test_appimage_package_retry, test_appimage_player_build, test_collect_wide, test_control, test_crash_dialog, test_crash_record, test_env_on, test_game_layout, test_lift_cleanup_error, test_linux_preflight, test_longshot_ctl, test_low_memory_notice, test_make_game_cache, test_mem_gate, test_mem_gate_children, test_mirror_trim, test_missing_nup, test_oot_state_tap, test_options_budget_once, test_options_path, test_pcache_header_read, test_pipeline_cache_file, test_pipeline_cache_save, test_pipeline_play_cache, test_pipeline_tour, test_prof_symbols, test_program_cache_cleanup, test_program_cache_one_variant, test_readback_late, test_report_run, test_split_giants, test_vk_occlusion_queries, test_vk_pgo, test_walk_key.
    • The same 17 skipped. One crash report during the run, recorder_sync_test.exe-2026-11-15-155719.ips, from test_recorder_sync, which passed.

Not tested: Linux and Windows. On main the fixture calls a function it never cut out, so every compiler refuses it the same way [inference: not run there]. The change is Python that assembles the fixture's source; the C++ it adds is main's own payload_short, which vk_replay.cpp already builds with on every platform. The game: nothing in the game changes.

Must be tested: None: a test-only fix (a game-free fixture, no product code), so it needs no test request. macOS arm64 and x86_64 are covered under Tested; a run on Linux or Windows would confirm the "fails on main" side there.

Risks

What could break: test-only. If a later change renames or moves payload_short, the fixture no longer finds it and the check fails to build again, loudly, as on main now; it cannot pass without the replay's code.

Turning it off: revert the commit: that brings back main's build failure in this check.

Compatibility: Nothing changes: a test fixture only.

Issues

See #440 and #231.

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. (Test-only: Must be tested is None, no test request.)
  • Rebased on current main (25e7d10f, head 3b17461e). Main has since moved to 79b1fd8f (9 commits, none touching the test or the four sources it reads): this head merges onto it without a conflict, and the test passes on that merge, all 18 cases, on both architectures.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). On macOS at 3b17461e: 573 passed, 17 skipped, and 41 failures that also fail on main on this Mac (34 on 7bacf846, the other 7 on 25e7d10f), named under Testing.
  • 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:** macOS 26.7.1, Apple M4 Max (game-free checks only, arm64 and x86_64) · **Needs:** none ## Why `tests/test_replay_write_order.py`, the check #440 added, fails on main before any of its cases runs: its fixture no longer builds. So #440's fix (the replay's own buffer writes kept in command order) has no working game-free check on any platform, and `python -I -B tests/run_all.py` fails on it for everyone. The cause is the merge order. #440 (`9e100854`, merged 2026-11-15 14:41 CST) merged at a head based on `aa95d35f`, from before #231 (`3d880bf6`, merged 12:27 CST). #231 makes `payload<T>()` in `gpu/vk/vk_replay.cpp` copy a payload shorter than its type through `payload_short`, a function of its own. The test cuts `payload<T>()` out of the replay's source and builds it against its stand-ins, but not `payload_short`, so the build stops at "use of undeclared identifier 'payload_short'". The issue tracker (searched 2026-11-15 15:10 CST for the test's name, `payload_short` and "write order") has nothing that fits. ## What changed The test's fixture cuts `payload_short` out of `vk_replay.cpp` together with `payload<T>()`, where the source has it, so the check builds and runs again. No assertion, product code or other test changes. - tests: `main()` in `tests/test_replay_write_order.py` fills the `@@PAYLOAD@@` stand-in with the `[[gnu::noinline, gnu::cold]] void payload_short(` block and then `payload<T>()` when the replay has `payload_short` (main's), and with `payload<T>()` alone when it does not (a source from before #231, given with `--source`). 7 lines added, 1 changed. - Design: why the test is what's wrong, not the code: `payload_short` is #231's intended out-of-line copy of a short payload, and #440's fix works with it unchanged; only the fixture, written on a base without it, is stale. This is the rebase sweep's commit for the same break on its rebased copy of #440 (`9a1d4d92`), cherry-picked without a conflict. ## Measurements **Verdict:** nothing to measure: a test fixture only; the game, its build and its timing are unchanged. ### Flags and settings None ## Testing **Tested:** game-free, on macOS 26.7.1, Apple M4 Max, Apple clang 21, arm64 and x86_64 (Rosetta: the fixture built with `clang++ -arch x86_64` and run translated): - `python -I -B tests/test_replay_write_order.py --headers <Vulkan-Headers/include>` fails on main `ceccd963`, and again on `25e7d10f`, on both architectures, before any case: `t.cpp:273:9: error: use of undeclared identifier 'payload_short'`, then "FAIL: the cut-out write and clear did not build against the stand-ins". On this PR all 18 cases pass on both: first at `d6f6ff82`, then at head `3b17461e`, the same patch rebased onto `25e7d10f`. - The repaired check still catches what it protects: with `--source` pointing at main's `gpu/` from just before #440 (`adbdd4fc`, which already has #231's `payload_short`), the same 10 cases fail on both architectures ("FAIL: 10 case(s): the replay's own writes do not all keep command order"), and the other 8 pass. - The full suite at `3b17461e` (`python -I -B tests/run_all.py --jobs 6`, in a fresh HOME): 573 passed, 41 failed, 17 skipped. By name against main `7bacf846`'s run on this Mac (558 passed, 34 failed, 17 skipped; main has 47 commits since), the one status this PR changes is `test_replay_write_order`: pass here, FAIL on main (above). Every other difference is main's own since `7bacf846`: - 24 other checks it added: 22 pass; `test_crt_options` (its fixture looks for `constexpr int kVramBudgets =` in the menu's source, which main's no longer has) and `test_nonuniform_image_arrays` ("create_device: no 'ci.pNext = &f;' before vkCreateDevice") fail. 3 it removed with #915: `test_forge_pr`, `test_forge_session_lock`, `test_team_chat`. - 5 that passed at `7bacf846` fail: `test_fsr_uniform_ownership` and `test_parallel_init_order` (their fixtures don't know #928's `FpsRtWait`), `test_bug_report` and `test_hardware_report` (since #915 they need MagicBeanDev/Tooling beside the checkout), `test_gpu_hang_watch` (its 2 s limit ended the process at 3.7 s, load average 21-27). - Those 7 fail the same way on main `25e7d10f`, run by name on this Mac (the hang watch at 3.4 s, load average 32). - These 34 fail here and on main `7bacf846` on this Mac, by name: `test_appimage_package_retry`, `test_appimage_player_build`, `test_collect_wide`, `test_control`, `test_crash_dialog`, `test_crash_record`, `test_env_on`, `test_game_layout`, `test_lift_cleanup_error`, `test_linux_preflight`, `test_longshot_ctl`, `test_low_memory_notice`, `test_make_game_cache`, `test_mem_gate`, `test_mem_gate_children`, `test_mirror_trim`, `test_missing_nup`, `test_oot_state_tap`, `test_options_budget_once`, `test_options_path`, `test_pcache_header_read`, `test_pipeline_cache_file`, `test_pipeline_cache_save`, `test_pipeline_play_cache`, `test_pipeline_tour`, `test_prof_symbols`, `test_program_cache_cleanup`, `test_program_cache_one_variant`, `test_readback_late`, `test_report_run`, `test_split_giants`, `test_vk_occlusion_queries`, `test_vk_pgo`, `test_walk_key`. - The same 17 skipped. One crash report during the run, `recorder_sync_test.exe-2026-11-15-155719.ips`, from `test_recorder_sync`, which passed. **Not tested:** Linux and Windows. On main the fixture calls a function it never cut out, so every compiler refuses it the same way [inference: not run there]. The change is Python that assembles the fixture's source; the C++ it adds is main's own `payload_short`, which `vk_replay.cpp` already builds with on every platform. The game: nothing in the game changes. **Must be tested:** None: a test-only fix (a game-free fixture, no product code), so it needs no test request. macOS arm64 and x86_64 are covered under Tested; a run on Linux or Windows would confirm the "fails on main" side there. ## Risks **What could break:** test-only. If a later change renames or moves `payload_short`, the fixture no longer finds it and the check fails to build again, loudly, as on main now; it cannot pass without the replay's code. **Turning it off:** revert the commit: that brings back main's build failure in this check. **Compatibility:** Nothing changes: a test fixture only. ## Issues See #440 and #231. ## 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. (Test-only: Must be tested is None, no test request.) - [x] Rebased on current `main` (`25e7d10f`, head `3b17461e`). Main has since moved to `79b1fd8f` (9 commits, none touching the test or the four sources it reads): this head merges onto it without a conflict, and the test passes on that merge, all 18 cases, on both architectures. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). On macOS at `3b17461e`: 573 passed, 17 skipped, and 41 failures that also fail on main on this Mac (34 on `7bacf846`, the other 7 on `25e7d10f`), named under Testing. - [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.
test(vk): the replay write-order fixture cuts main's payload_short with payload (#231)
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_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 8s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 3s
3b17461e2b
#440 (9e100854) merged at a head based on aa95d35f, before #231 (3d880bf6), which makes payload<T>() copy a payload
shorter than its type through payload_short, a function of its own. tests/test_replay_write_order.py cuts payload<T>()
out of vk_replay.cpp, so on main since #440 its fixture does not build ("use of undeclared identifier 'payload_short'")
and the check fails before any case runs. It now cuts payload_short with it, where the source has it. No assertion or
product code changes: every case passes on arm64 and on x86_64 under Rosetta, and against the replay as it was before
#440 (--source at adbdd4fc) the same 10 cases still fail ("the replay's own writes do not all keep command order").

(cherry picked from commit 9a1d4d926a0210e287883a9e99537d0fd5631a64)

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
mooki changed title from WIP: test(vk): the replay write-order fixture cuts main's payload_short with payload (#231) to test(vk): the replay write-order fixture cuts main's payload_short with payload (#231) 2026-11-15 22:04:43 +00:00
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_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 8s
Third-party parts / As their notes say (pull_request) Successful in 12s
PR description / Description follows the template (pull_request_target) Successful in 3s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/replay-write-order-payload-short:mooki-fix/replay-write-order-payload-short'
git switch 'mooki-fix/replay-write-order-payload-short'
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!937
No description provided.