WIP: feat(vk): RX_VK_PART_PLAN, a part plan checked against the replay #3279

Draft
klimovich008 wants to merge 6 commits from klimovich008/Longshot:perf/parallel-replay into main
Member

Summary

The render thread replays every command buffer of a frame alone. Where it is the limit, a second thread recording some of a
submission's parts could make the frame faster; the segment workers that tried it (RX_VK_PARALLEL, removed in #1763)
lost on most PCs and left a tail of faults, because their dry pass had to repeat every side effect the replay makes in
stream order and nothing ever compared it with the replay. This PR is the groundwork for doing it again safely, and
changes nothing a player sees:

  • One body for the state ops. The state ops (binds, viewports, conditions, ...) move out of replay()'s switch into
    apply_state (gpu/vk/vk_replay.cpp), which the replay and the new walk both call. Their logs run on the replay only.
  • The part plan (plan_run): a walk of a command buffer ahead of its replay, with the state alone, for where its
    parts end (maybe_split's own rule and limits, now in part_limits and part_ramps) and the state each begins with
    (NvnState, the ubo generations, the uniform updates before it). A render condition the game did not snap at its
    submit reads live memory, which the stream, the GPU and the replay's write-backs may change before the replay reads
    it: the walk reads memory as it is and marks the cuts after it inexact (a snapped one leaves them exact). The walk's
    occlusion queries stay in its copy of the state (occ_take / occ_counter_reset take plan).
  • RX_VK_PART_PLAN=check (diag, off): plan at each replay() and at each met wait, and compare the replay's state at
    every planned cut ("vk: part plan" lines; plan_at, one call an op in replay()'s loop). The recording is the same
    but for timing: the walks delay the replay, so a condition the game did not snap can read memory written in the
    meantime, as with any slower replay. =check-fault leaves the texture binds out of the walk: its control.
  • The design, why the segment workers lost, and what is left (the helper thread, RX_VK_PART_HELPERS, off by default, for
    PCs with spare cores): docs/dev/reference/parallel-replay.md.

Read first: apply_state, plan_run, plan_at and the call at the top of replay()'s loop.

Testing

Tested: on my PC: AMD Radeon RX 9070 XT (driver 26.11.2), Ryzen 7 5700X3D, Windows 11. The game runs used this change
on f359e262 (the pack's tree is f359e262 with the change cherry-picked: the same replay code). The last two commits after
them change only the check's summary line, the tests and the docs, and give the ramp's mode one helper (part_ramps,
the same mode == 1 as before).

  • RX_VK_PART_PLAN=check at Market center (the standard test's fountain save, the camera turning, uncapped): at 30,000
    cuts, 29,198 had the same state and 802 differed, none of them at an exact cut: all came after a render condition the
    game did not snap (9,057 cuts did). Of the replay's 39,929 own part ends, 29,997 were where planned and the other 9,932
    were skip-tail's (HOS_FRAME_SKIP_TAIL, which the walk does not model). =check-fault, the control: at 30,000 cuts,
    29,976 differ.
  • The standard test's A/B with the switch at its default: Measurements.
  • The replay bench of #3268 (at 0ae642a27, game-free),
    main 302cdf035 against this change (346530d6: the change without the check summary's two new counts): the same
    commands and picture in its draws and mixed scenes, with and without the Khronos validation layer's synchronization
    validation. Both sides showed the same two layer messages, neither about the replay: VALIDATION-SETTINGS and a
    cooperative-matrix SPIR-V VUID. =check there: 64 of 64 cuts the same state, all 64 of the replay's own part ends
    where planned (walks 35-45 us each); =check-fault: 64 of 64 differ.

tests/test_part_plan.py (game-free): plan_run, apply_state, part_limits, part_ramps, the occlusion functions,
the check's compare and plan_at cut from the source and run on op streams against a model of the replay, with the
real vk_state.h: cut placement (first part past 32, then 120, the 512 ceiling inside a pass; with
RX_VK_PART_ADAPTIVE on, 32, 120, then 240), the before-draw rule, the same state at every cut, conditions (snapped:
exact, its own words; live: inexact, both words read from memory), the stop at a wait and the walk after it, uniform
update counting, no occlusion side effects, a clear of no channels, the hook op by op (a met wait, a cut at a wait
compared, skip-tail's part end), =check-fault differs, every member named by the compare. 21 broken variants must fail
(a snapshot one op late, no stop at a wait, uniform updates of no bytes counted, the walk's queries noted for the part,
a live condition taken as exact, a condition's words not read (either word, or a snapped one's own), no cut exact, a
draw that opens no pass, a plain draw that is not drawn taken to begin a part, a clear of no channels that opens one, no
512-draw ceiling, the before-draw rule ignored, the legacy part lengths with RX_VK_PART_ADAPTIVE on, grid compared,
the walk after a wait begun one op late or from a count of 0, a cut at a wait not checked, a cut the check compares with
nothing, skip-tail's part end counted after its dispatch), and 2 of the source census (an NvnState member left out of
the compare, a state op handled in replay() itself); the source checks also hold maybe_split and plan_run to
part_limits and part_ramps.
Two existing checks that cut replay()'s cases by their labels now look inside replay() (the walk's draw case has the
same label); test_early_split_before_draw takes part_limits and part_ramps, and stubs of the plan's hook, into its
fixture. tests/run_all.py --changed origin/main (the 189 checks that read the changed files) on 346530d6: 178 passed,
7 failed, 13 skipped. The 7 fail on main 302cdf035 too, run the same way on this PC: test_dlssg, test_input_background,
test_present_acquire_ahead, test_present_held_image, test_present_image_free, test_present_semaphores,
test_vk_draw_overhead_lean. On the head, test_part_plan and the four checks the move touches pass, and mise run lint
passes.

Still to test:

  • This PC (as Tested): the picture against the base (shots every 300 presents at Market center, Kokiri and the
    adult Temple of Time route, still input), and the Khronos validation layer's synchronization validation at Market
    center with RX_VK_PART_PLAN unset and =check against two base runs, expecting the same pictures and no new
    VUIDs nor more of them (by hand, running now).
  • The Steam Deck, an NVIDIA RTX PC on Windows and an AMD RX 6000-9000 PC on Linux (RADV): main against this PR with
    RX_VK_PART_PLAN unset, expecting the same frame times within noise and no new errors in the log; and this PR with
    RX_VK_PART_PLAN=check, expecting its "vk: part plan" summary lines to count 0 cuts that differ at an exact cut
    (@Beanstalk, the request in the comments).

Measurements

Verdict: no gain meant (groundwork; the switch is off by default) and no cost the game shows: -0.2 % fps and
+2.3 % CPU ms, inside the standard test's 3-pair noise (about 2-3 % CPU ms). The replay bench alone, which times only
the per-draw path, puts the change 1.5-2 % slower, about 0.02 us a draw.

Setup: Windows 11, AMD Radeon RX 9070 XT (driver 26.11.2), Ryzen 7 5700X3D. In the game: the standard test (Market
center from a save at the fountain, the camera turning, HOS_FPS_MAX=240, 1280x720, a fixed 16:9 profile, a co-load),
3 alternating pairs, the medians; the change cherry-picked onto f359e262 (the same replay code as this head), the
switch at its default. Replay bench (#3268, game-free):
microseconds a draw over its fastest frames, 9 runs a side, once with main first and once with this change first.

Before: main @ f359e262 After: this PR @ f359e262 + 434836628's change
fps 93.59 93.44
CPU ms a frame 55.40 56.69
p99 frame, ms 14.97 15.16
worst frame, ms 24.5 20.2

The pairs' CPU ms: +3.2, -1.0, +2.5 %. std_test marks it diagnostic (under 5 % with 3 pairs).

Why the game's numbers still hold on this head's base, main 302cdf035: the change is the same text on both bases, and its
cost is per op in replay()'s loop, which the replay bench below measures on 302cdf035 itself: 1.5-2 %, about
0.02 us a draw, the same order as the game's +2.3 % CPU ms inside its noise.

Before: main @ 302cdf035 After: this PR @ 346530d6
bench, draws scene, us a draw (main first / this first) 1.117 / 1.111 1.133 / 1.131
bench, mixed scene, us a draw (main first / this first) 1.182 / 1.183 1.200 / 1.200

346530d6 is this head without the check summary's two new counts (diagnostic code only). On the earlier base (main
7bc53f841, 3 runs) the same change measured -3.0 % and -0.8 % a draw, so the sign follows the build's code layout as
much as the change. =check, off by default, costs its walks: 4-7 us each in the game, one at each command buffer's
replay and met wait.

Risks

The state ops now run through apply_state on every replay: a mistake in the move would change what a draw binds. The
moved code is the same text (its logs behind kReal), the source census checks no state op is left in replay(), the
replay bench records the same commands and picture as main, the game's picture and synchronization validation match the
base (Tested), the standard test above shows the cost, and the check mode compares the walk with the replay in the game.
RX_VK_PART_PLAN is off by default; with it off, the only other change is one test of a static an op. A revert is
enough. Nothing changes after updating: no setting, cache or shader stamp file is touched (vk_state.h and vk_api.h
are unchanged).

If #3117 lands, the mode it ramps in is part_ramps's one line, for maybe_split and the plan alike.

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 switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • 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 The render thread replays every command buffer of a frame alone. Where it is the limit, a second thread recording some of a submission's parts could make the frame faster; the segment workers that tried it (`RX_VK_PARALLEL`, removed in #1763) lost on most PCs and left a tail of faults, because their dry pass had to repeat every side effect the replay makes in stream order and nothing ever compared it with the replay. This PR is the groundwork for doing it again safely, and changes nothing a player sees: - **One body for the state ops.** The state ops (binds, viewports, conditions, ...) move out of `replay()`'s switch into `apply_state` (`gpu/vk/vk_replay.cpp`), which the replay and the new walk both call. Their logs run on the replay only. - **The part plan** (`plan_run`): a walk of a command buffer ahead of its replay, with the state alone, for where its parts end (`maybe_split`'s own rule and limits, now in `part_limits` and `part_ramps`) and the state each begins with (`NvnState`, the ubo generations, the uniform updates before it). A render condition the game did not snap at its submit reads live memory, which the stream, the GPU and the replay's write-backs may change before the replay reads it: the walk reads memory as it is and marks the cuts after it inexact (a snapped one leaves them exact). The walk's occlusion queries stay in its copy of the state (`occ_take` / `occ_counter_reset` take `plan`). - **`RX_VK_PART_PLAN=check`** (diag, off): plan at each `replay()` and at each met wait, and compare the replay's state at every planned cut ("vk: part plan" lines; `plan_at`, one call an op in `replay()`'s loop). The recording is the same but for timing: the walks delay the replay, so a condition the game did not snap can read memory written in the meantime, as with any slower replay. `=check-fault` leaves the texture binds out of the walk: its control. - The design, why the segment workers lost, and what is left (the helper thread, `RX_VK_PART_HELPERS`, off by default, for PCs with spare cores): `docs/dev/reference/parallel-replay.md`. Read first: `apply_state`, `plan_run`, `plan_at` and the call at the top of `replay()`'s loop. ## Testing **Tested:** on my PC: AMD Radeon RX 9070 XT (driver 26.11.2), Ryzen 7 5700X3D, Windows 11. The game runs used this change on f359e262 (the pack's tree is f359e262 with the change cherry-picked: the same replay code). The last two commits after them change only the check's summary line, the tests and the docs, and give the ramp's mode one helper (`part_ramps`, the same `mode == 1` as before). - `RX_VK_PART_PLAN=check` at Market center (the standard test's fountain save, the camera turning, uncapped): at 30,000 cuts, 29,198 had the same state and 802 differed, none of them at an exact cut: all came after a render condition the game did not snap (9,057 cuts did). Of the replay's 39,929 own part ends, 29,997 were where planned and the other 9,932 were skip-tail's (`HOS_FRAME_SKIP_TAIL`, which the walk does not model). `=check-fault`, the control: at 30,000 cuts, 29,976 differ. - The standard test's A/B with the switch at its default: Measurements. - The replay bench of [#3268](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3268) (at 0ae642a27, game-free), main 302cdf035 against this change (346530d6: the change without the check summary's two new counts): the same commands and picture in its draws and mixed scenes, with and without the Khronos validation layer's synchronization validation. Both sides showed the same two layer messages, neither about the replay: VALIDATION-SETTINGS and a cooperative-matrix SPIR-V VUID. `=check` there: 64 of 64 cuts the same state, all 64 of the replay's own part ends where planned (walks 35-45 us each); `=check-fault`: 64 of 64 differ. `tests/test_part_plan.py` (game-free): `plan_run`, `apply_state`, `part_limits`, `part_ramps`, the occlusion functions, the check's compare and `plan_at` cut from the source and run on op streams against a model of the replay, with the real `vk_state.h`: cut placement (first part past 32, then 120, the 512 ceiling inside a pass; with `RX_VK_PART_ADAPTIVE` on, 32, 120, then 240), the before-draw rule, the same state at every cut, conditions (snapped: exact, its own words; live: inexact, both words read from memory), the stop at a wait and the walk after it, uniform update counting, no occlusion side effects, a clear of no channels, the hook op by op (a met wait, a cut at a wait compared, skip-tail's part end), =check-fault differs, every member named by the compare. 21 broken variants must fail (a snapshot one op late, no stop at a wait, uniform updates of no bytes counted, the walk's queries noted for the part, a live condition taken as exact, a condition's words not read (either word, or a snapped one's own), no cut exact, a draw that opens no pass, a plain draw that is not drawn taken to begin a part, a clear of no channels that opens one, no 512-draw ceiling, the before-draw rule ignored, the legacy part lengths with `RX_VK_PART_ADAPTIVE` on, `grid` compared, the walk after a wait begun one op late or from a count of 0, a cut at a wait not checked, a cut the check compares with nothing, skip-tail's part end counted after its dispatch), and 2 of the source census (an `NvnState` member left out of the compare, a state op handled in `replay()` itself); the source checks also hold `maybe_split` and `plan_run` to `part_limits` and `part_ramps`. Two existing checks that cut `replay()`'s cases by their labels now look inside `replay()` (the walk's draw case has the same label); `test_early_split_before_draw` takes `part_limits` and `part_ramps`, and stubs of the plan's hook, into its fixture. `tests/run_all.py --changed origin/main` (the 189 checks that read the changed files) on 346530d6: 178 passed, 7 failed, 13 skipped. The 7 fail on main 302cdf035 too, run the same way on this PC: test_dlssg, test_input_background, test_present_acquire_ahead, test_present_held_image, test_present_image_free, test_present_semaphores, test_vk_draw_overhead_lean. On the head, test_part_plan and the four checks the move touches pass, and `mise run lint` passes. **Still to test:** - This PC (as Tested): the picture against the base (shots every 300 presents at Market center, Kokiri and the adult Temple of Time route, still input), and the Khronos validation layer's synchronization validation at Market center with `RX_VK_PART_PLAN` unset and `=check` against two base runs, expecting the same pictures and no new VUIDs nor more of them (by hand, running now). - The Steam Deck, an NVIDIA RTX PC on Windows and an AMD RX 6000-9000 PC on Linux (RADV): main against this PR with `RX_VK_PART_PLAN` unset, expecting the same frame times within noise and no new errors in the log; and this PR with `RX_VK_PART_PLAN=check`, expecting its "vk: part plan" summary lines to count 0 cuts that differ at an exact cut (@Beanstalk, the request in the comments). ## Measurements **Verdict:** no gain meant (groundwork; the switch is off by default) and no cost the game shows: -0.2 % fps and +2.3 % CPU ms, inside the standard test's 3-pair noise (about 2-3 % CPU ms). The replay bench alone, which times only the per-draw path, puts the change 1.5-2 % slower, about 0.02 us a draw. Setup: Windows 11, AMD Radeon RX 9070 XT (driver 26.11.2), Ryzen 7 5700X3D. In the game: the standard test (Market center from a save at the fountain, the camera turning, `HOS_FPS_MAX=240`, 1280x720, a fixed 16:9 profile, a co-load), 3 alternating pairs, the medians; the change cherry-picked onto f359e262 (the same replay code as this head), the switch at its default. Replay bench ([#3268](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3268), game-free): microseconds a draw over its fastest frames, 9 runs a side, once with main first and once with this change first. | | Before: main @ f359e262 | After: this PR @ f359e262 + 434836628's change | |---|---|---| | fps | 93.59 | 93.44 | | CPU ms a frame | 55.40 | 56.69 | | p99 frame, ms | 14.97 | 15.16 | | worst frame, ms | 24.5 | 20.2 | The pairs' CPU ms: +3.2, -1.0, +2.5 %. std_test marks it diagnostic (under 5 % with 3 pairs). Why the game's numbers still hold on this head's base, main 302cdf035: the change is the same text on both bases, and its cost is per op in replay()'s loop, which the replay bench below measures on 302cdf035 itself: 1.5-2 %, about 0.02 us a draw, the same order as the game's +2.3 % CPU ms inside its noise. | | Before: main @ 302cdf035 | After: this PR @ 346530d6 | |---|---|---| | bench, draws scene, us a draw (main first / this first) | 1.117 / 1.111 | 1.133 / 1.131 | | bench, mixed scene, us a draw (main first / this first) | 1.182 / 1.183 | 1.200 / 1.200 | 346530d6 is this head without the check summary's two new counts (diagnostic code only). On the earlier base (main 7bc53f841, 3 runs) the same change measured -3.0 % and -0.8 % a draw, so the sign follows the build's code layout as much as the change. `=check`, off by default, costs its walks: 4-7 us each in the game, one at each command buffer's replay and met wait. ## Risks The state ops now run through `apply_state` on every replay: a mistake in the move would change what a draw binds. The moved code is the same text (its logs behind `kReal`), the source census checks no state op is left in `replay()`, the replay bench records the same commands and picture as main, the game's picture and synchronization validation match the base (Tested), the standard test above shows the cost, and the check mode compares the walk with the replay in the game. `RX_VK_PART_PLAN` is off by default; with it off, the only other change is one test of a static an op. A revert is enough. Nothing changes after updating: no setting, cache or shader stamp file is touched (`vk_state.h` and `vk_api.h` are unchanged). If #3117 lands, the mode it ramps in is `part_ramps`'s one line, for `maybe_split` and the plan alike. ## 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 switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [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)
feat(vk): RX_VK_PART_PLAN, a part plan checked against the replay
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
434836628b
The groundwork for recording a submission's parts on a second thread
(docs/dev/reference/parallel-replay.md): a walk of each command buffer
ahead of its replay, with the state alone, for where its parts end
(maybe_split's rule) and the state each begins with (NvnState, the ubo
generations, the uniform updates before it).

- The state ops move out of replay()'s switch into apply_state, one body
  for the replay and the walk; their logs run on the replay only.
- maybe_split's limits come from part_limits, so the walk reads the
  same values.
- occ_take and occ_counter_reset take plan: the walk's queries stay in
  its copy of the state.
- A render condition the game did not snap at its submit reads live
  memory: the walk reads it as it is now and marks the cuts after it
  inexact. A snapped one leaves them exact.
- RX_VK_PART_PLAN=check plans at each replay() and after each met wait,
  and compares the replay's state at each planned cut (vk: part plan
  lines); the recording is unchanged. =check-fault drops the texture
  binds from the walk: the control. Off by default.

tests/test_part_plan.py: the walk cut from the source, on op streams
against a model of the replay, with 19 broken variants and 2 census
controls that must fail. test_early_split_before_draw,
test_mesh_log_counters and test_vk_occlusion_queries follow the move.

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

Tested in game: AMD Radeon RX 9070 XT (driver 26.11.2), Ryzen 7 5700X3D, Windows 11; Market center (the standard test's fountain save, camera turning, uncapped), the change on f359e262. RX_VK_PART_PLAN=check: at 30,000 cuts 802 differ, 0 of them at an exact cut (all after a render condition the game did not snap); 29,997 of the replay's 39,929 part ends where planned, the other 9,932 skip-tail's, which the walk does not model. =check-fault (the control): 29,976 of 30,000 differ. Switch off (the default): the standard test's 3-pair A/B, -0.2 % fps and +2.3 % CPU ms, within its noise. A picture comparison against the base is still to run (Still to test).

Tested in game: AMD Radeon RX 9070 XT (driver 26.11.2), Ryzen 7 5700X3D, Windows 11; Market center (the standard test's fountain save, camera turning, uncapped), the change on f359e262. RX_VK_PART_PLAN=check: at 30,000 cuts 802 differ, 0 of them at an exact cut (all after a render condition the game did not snap); 29,997 of the replay's 39,929 part ends where planned, the other 9,932 skip-tail's, which the walk does not model. =check-fault (the control): 29,976 of 30,000 differ. Switch off (the default): the standard test's 3-pair A/B, -0.2 % fps and +2.3 % CPU ms, within its noise. A picture comparison against the base is still to run (Still to test).
Member

Possibly related, for context:

  • PR #3117 WIP: perf(vk): the part ramp runs only when asked (RX_VK_PART_ADAPTIVE=ramp), lazy upload stays on — Open PR changes part-splitting thresholds in vk_replay.cpp.
Possibly related, for context: - PR #3117 WIP: perf(vk): the part ramp runs only when asked (RX_VK_PART_ADAPTIVE=ramp), lazy upload stays on — Open PR changes part-splitting thresholds in vk_replay.cpp.
fix(vk): the part plan's check after review: adaptive part lengths tested, 20 of each kind named
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
217a11fb54
- The summary names skip-tail's part ends only: RX_VK_READBACK_EARLY's count is reset by its own log line, so a total
  of it here could be short.
- tests/test_part_plan.py: a case with RX_VK_PART_ADAPTIVE on (parts of 32, 120, 240), and the cut at a wait must be
  compared, not only counted; two controls that must fail (the legacy part lengths, a check that compares nothing).
- switches.def and the doc: the first 20 exact and the first 20 inexact cuts that differ are named; the recording is
  the same but for timing (the walks delay the replay, so a condition the game did not snap can read newer memory);
  the part lengths as maybe_split has them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): maybe_split and the part plan ask one helper whether parts ramp
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
0bdbb49873
part_ramps(mode) is the one place that says which RX_VK_PART_ADAPTIVE mode
ramps the part lengths (32, 120, 240, 512): maybe_split and plan_run both
call it, so a change of that mode (as #3117 proposes) reaches both. The same
mode == 1 as before.

test_part_plan: the adaptive case ends its third part at exactly 240 work
ops (a pass closed at 239 and at 240, the next at 251), and the source
checks hold maybe_split to part_ramps. The doc: a part that may end only
before a plain draw ends at the next one a render condition or rasterizer
discard does not leave out, and readback-early's part ends are not told
apart in the summary.

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

On BeanBot's pointer to #3117: it is related. #3117 changes which RX_VK_PART_ADAPTIVE mode ramps the part lengths (mode == 1 to mode == 3 in maybe_split), and this PR's plan walk takes its part lengths by the same rule. Before 0bdbb4987 the walk had its own mode == 1, so #3117 landing after this would have left the plan ramping where maybe_split no longer does: the =check run would show it only as part ends not where planned, and no test would fail.

Since 0bdbb4987 both ask part_ramps(mode) (gpu/vk/vk_replay.cpp, beside part_limits), so #3117's change is one line there for both. tests/test_part_plan.py holds maybe_split to part_ramps, and its adaptive case and the legacy-thresholds broken variant check the walk's ramp. Whichever lands second, the merge touches the same maybe_split line, so it shows.

On BeanBot's pointer to #3117: it is related. #3117 changes which `RX_VK_PART_ADAPTIVE` mode ramps the part lengths (`mode == 1` to `mode == 3` in `maybe_split`), and this PR's plan walk takes its part lengths by the same rule. Before 0bdbb4987 the walk had its own `mode == 1`, so #3117 landing after this would have left the plan ramping where `maybe_split` no longer does: the `=check` run would show it only as part ends not where planned, and no test would fail. Since 0bdbb4987 both ask `part_ramps(mode)` (`gpu/vk/vk_replay.cpp`, beside `part_limits`), so #3117's change is one line there for both. `tests/test_part_plan.py` holds `maybe_split` to `part_ramps`, and its `adaptive` case and the `legacy-thresholds` broken variant check the walk's ramp. Whichever lands second, the merge touches the same `maybe_split` line, so it shows.
docs(vk): the part plan's doc says what the walk and the check do
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
d57f4e39c9
After review, no code change. maybe_split looks after each draw or
dispatch; a part waiting for a plain draw waits for one rendering is not
off for (a render condition, render enable off, rasterizer discard); no
walk while a frame dump is armed; =check-fault finds differences after a
texture bind; a synchronous replay goes on past an unmet wait; a texture
clear ends the walk's pass, and the open-pass count is where the replay's
pass was open and the plan's was not; a cut is inexact until the walk
starts again at a wait; the summary at the 64th cut and every 5,000th;
a part end wanted from before the command buffer is taken as the replay
takes it. The switch's row says the dump and the control's texture binds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(vk): the part plan's doc: the control's slot changes, early returns, walks begun
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2adaf2b62a
After review, no code change: =check-fault's differences come after a
texture bind that changes a slot; a synchronous replay goes on past an
unmet wait; where the replay's op returns early its pass and the plan's
can differ; the summary counts the walks begun.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs(vk): the part plan's doc: where the control must differ, and dump walks
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
f822522ca0
After review, no code change: =check-fault must differ at the cuts a walk
reaches after passing a texture bind that changes a slot (a walk that
starts again at a wait starts from the replay's state, the bind in it),
and the summary's walks count one a frame dump cut short.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/parallel-replay:klimovich008-perf/parallel-replay'
git switch 'klimovich008-perf/parallel-replay'
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!3279
No description provided.