test(vk): five checks read the replay as the thread rewrite left it #1864

Merged
HumanBean merged 5 commits from zeldaootr/Longshot:checks-after-thread-rewrite into main 2026-11-20 15:59:56 +00:00
Contributor

Summary

Five game-free checks have failed on main since the renderer's threads were rewritten
(#1763): each cuts renderer source by its text, and the rewrite
reshaped that source. This brings each back to checking its rule against the code as it is now. No check is loosened,
and nothing outside tests/ changes.

  • tests/test_split_before_draw.py: the parallel replay's dry and worker modes are gone, so replay()'s guard before a
    plain draw is if (part_end_wanted && ... without !dry && !worker &&. The check looks for that guard; it still
    fails if a mesh draw or a dispatch can end a part.
  • tests/test_early_split_before_draw.py: the end after a readback's writer is guarded by if (early) { alone now.
    The check cuts that block and runs it as before; the fixture's unused dry/worker stand-ins are gone.
  • tests/test_hold_gpu.py: wait() is now a wrapper that times the wait for RX_VK_GPU_TIMELINE and hands it to
    wait_inner, which holds the old body. The check cuts wait_inner for the waiter's count and also checks that
    wait() hands every wait to wait_inner and counts no waiter itself.
  • tests/test_readback_early.py: the uniform update's guard lost !dry; and the rewrite started cutting
    vk_memory.cpp's part counters (with the new rec_part()) into the fixture, which still defined
    mem_rec_part/mem_in_place_part itself, so the fixture no longer compiled. The guard is matched as it is, and the
    counters now come from the source alone.
  • tests/test_readback_late.py: RX_VK_READBACK_LATE unset now also reads the newest submission's ranges late on a
    handheld (device_policy.h readback_late_newest), as its row in gpu/vk/switches.def says. The check looks for
    both parts of the unset branch and runs its cases on a handheld and on any other PC.

Read first: the five test files; gpu/vk/vk_replay.cpp replay(), wait()/wait_inner(), readback_late_wanted().

Testing

Tested: Linux, game-free only (nothing here runs in the game). Each of the five passes on this branch and fails on
main. Each was also run against a scratch copy of the source with the rule broken, and fails:

  • split before draw: a mesh draw added to the guard's ops ("replay() ends a part before a NOP_DRAW_MESH"); the
    part_end_wanted test dropped.
  • early split: early_split ending the part at once even where parts end only before a plain draw (fails on Intel);
    the RX_VK_READBACK_EARLY_GAP test dropped ("a writer before the gap's 16 draws ends its part at the 16th").
  • hold the GPU: a poll counted as a wait; the waiter counted after the wait instead of around it; wait() taking a
    path that skips wait_inner.
  • early readback: the uniform update no longer ending its part; rec_part() returning 0 (the fixture's part checks
    fail).
  • late readback: the handheld's newest added even when the switch is set (=0 on a handheld reads late); the
    default size left out on a handheld.

python -I -B tests/run_all.py on this branch and on main (89c3d21ea) on the same PC: main 784 passed, 69 failed;
this branch 788 passed, 65 failed. The five above pass here and no check that passes on main fails here. The other 64
fail on both and need what this PC lacks (tools, packages, Windows-only parts). tests/test_recording_admission.py
failed in this branch's full run once and is flaky on main too (1 of 8 runs alone failed on main, 2 of 6 here); this
change touches nothing it reads.

Still to test: None.

Measurements

Nothing to measure: a change to the checks only.

Risks

None for players: only tests/ changes. Overlaps
#949 in tests/test_split_before_draw.py and
tests/test_hold_gpu.py, in different lines (that pull replaces their own block with srccut's; this one edits the
checks' bodies), so the two merge without a conflict.

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.
  • mise run test passes (any failure that also fails on main is named).
  • 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.
  • 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.
## Summary Five game-free checks have failed on `main` since the renderer's threads were rewritten (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1763): each cuts renderer source by its text, and the rewrite reshaped that source. This brings each back to checking its rule against the code as it is now. No check is loosened, and nothing outside `tests/` changes. - `tests/test_split_before_draw.py`: the parallel replay's dry and worker modes are gone, so replay()'s guard before a plain draw is `if (part_end_wanted && ...` without `!dry && !worker &&`. The check looks for that guard; it still fails if a mesh draw or a dispatch can end a part. - `tests/test_early_split_before_draw.py`: the end after a readback's writer is guarded by `if (early) {` alone now. The check cuts that block and runs it as before; the fixture's unused `dry`/`worker` stand-ins are gone. - `tests/test_hold_gpu.py`: `wait()` is now a wrapper that times the wait for `RX_VK_GPU_TIMELINE` and hands it to `wait_inner`, which holds the old body. The check cuts `wait_inner` for the waiter's count and also checks that `wait()` hands every wait to `wait_inner` and counts no waiter itself. - `tests/test_readback_early.py`: the uniform update's guard lost `!dry`; and the rewrite started cutting `vk_memory.cpp`'s part counters (with the new `rec_part()`) into the fixture, which still defined `mem_rec_part`/`mem_in_place_part` itself, so the fixture no longer compiled. The guard is matched as it is, and the counters now come from the source alone. - `tests/test_readback_late.py`: `RX_VK_READBACK_LATE` unset now also reads the newest submission's ranges late on a handheld (`device_policy.h` `readback_late_newest`), as its row in `gpu/vk/switches.def` says. The check looks for both parts of the unset branch and runs its cases on a handheld and on any other PC. Read first: the five test files; `gpu/vk/vk_replay.cpp` `replay()`, `wait()`/`wait_inner()`, `readback_late_wanted()`. ## Testing **Tested:** Linux, game-free only (nothing here runs in the game). Each of the five passes on this branch and fails on `main`. Each was also run against a scratch copy of the source with the rule broken, and fails: - split before draw: a mesh draw added to the guard's ops ("replay() ends a part before a NOP_DRAW_MESH"); the `part_end_wanted` test dropped. - early split: `early_split` ending the part at once even where parts end only before a plain draw (fails on Intel); the `RX_VK_READBACK_EARLY_GAP` test dropped ("a writer before the gap's 16 draws ends its part at the 16th"). - hold the GPU: a poll counted as a wait; the waiter counted after the wait instead of around it; `wait()` taking a path that skips `wait_inner`. - early readback: the uniform update no longer ending its part; `rec_part()` returning 0 (the fixture's part checks fail). - late readback: the handheld's `newest` added even when the switch is set (`=0` on a handheld reads late); the default size left out on a handheld. `python -I -B tests/run_all.py` on this branch and on `main` (89c3d21ea) on the same PC: `main` 784 passed, 69 failed; this branch 788 passed, 65 failed. The five above pass here and no check that passes on `main` fails here. The other 64 fail on both and need what this PC lacks (tools, packages, Windows-only parts). `tests/test_recording_admission.py` failed in this branch's full run once and is flaky on `main` too (1 of 8 runs alone failed on `main`, 2 of 6 here); this change touches nothing it reads. **Still to test:** None. ## Measurements Nothing to measure: a change to the checks only. ## Risks None for players: only `tests/` changes. Overlaps https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/949 in `tests/test_split_before_draw.py` and `tests/test_hold_gpu.py`, in different lines (that pull replaces their own `block` with `srccut`'s; this one edits the checks' bodies), so the two merge without a conflict. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [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] 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.
The render thread rewrite removed the parallel replay, and with it replay()'s dry and worker modes:
the guard before a plain draw lost its `!dry && !worker &&`. The check now looks for the guard as it
is, `if (part_end_wanted &&`, followed by the three plain draws, a draw that will be recorded,
`split_part(cmd)` and the switch on the op; it still fails if a mesh draw or a dispatch can end a part.

Assisted-by: Claude
The render thread rewrite removed replay()'s dry and worker modes, so the end after a readback's
writer is now guarded by `if (early) {` alone. The check cuts that block and runs it with the
part's end before a plain draw, maybe_split, split_part and early_split as before; the fixture's
unused `dry` and `worker` stand-ins are gone with it.

Assisted-by: Claude
The render thread rewrite made wait() a wrapper that times the wait for RX_VK_GPU_TIMELINE and
hands it to wait_inner, which holds the body that was wait()'s, the waiter's count included. The
check now cuts wait_inner for the count around the wait for a queue's own recorded work, and checks
that wait() hands every wait to wait_inner and counts no waiter itself.

Assisted-by: Claude
The render thread rewrite dropped `!dry` from the uniform update's end after a waited-for range, and
started cutting vk_memory.cpp's part counters (with the new rec_part()) into the check's fixture,
which still defined mem_rec_part and mem_in_place_part itself: the fixture no longer compiled. The
check now looks for the update's guard as it is, and the counters come from the source alone.

Assisted-by: Claude
test(vk): the late readback check runs the handheld's default too
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
CI / Website build and checks (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 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
a6af679a68
The render thread rewrite made RX_VK_READBACK_LATE's default, unset, the culling camera block on
every PC and, on a handheld (device_policy.h readback_late_newest), the newest submission's ranges
too, as switches.def's row says. The check looks for both in readback_late_wanted's unset branch and
runs its cases on a handheld and on any other PC, with dev.policy's one field as a stand-in.

Assisted-by: Claude
zeldaootr changed title from WIP: test(vk): five checks read the replay as the thread rewrite left it to test(vk): five checks read the replay as the thread rewrite left it 2026-11-20 10:25:23 +00:00
Member

Possibly related, for context:

  • PR #949 test(checks): 99 more checks cut with srccut, not a copy of their own — Overlaps two modified test files; description acknowledges this.
Possibly related, for context: - PR #949 test(checks): 99 more checks cut with srccut, not a copy of their own — Overlaps two modified test files; description acknowledges this.
HumanBean deleted branch checks-after-thread-rewrite 2026-11-20 15:59:58 +00:00
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
CI / Website build and checks (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 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Some workflows are waiting to be reviewed.
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!1864
No description provided.