perf(vk): add O(1) generation-guarded dynamic state and vertex-stream bind skips (RX_VK_DRAW_DYN_LEAN) #3046

Open
siantm wants to merge 2 commits from siantm/Longshot:perf/vk-draw-dyn-lean into main
Contributor

Summary

Every draw call on the Vulkan replay thread (mkw_vk_replay) packed and memcmp'd ~250 bytes of dynamic graphics state (dyn_pack() + dyn_same() inside dynamic_state()) and assembled three 16-entry vertex stream arrays (vaddr, vsize, vstride_key) before calling vertex_set_same() and cross-TU gpu_bind_stamp(), even though 87.4% of dynamic_state() calls reuse the exact same dynamic state and 33.2% of draws reuse the exact same vertex streams without an intervening state change. This PR eliminates that redundant per-draw CPU work behind RX_VK_DRAW_DYN_LEAN (default 1, =0 legacy, =check parity, HOS_AB wired), delivering +0.86% FPS (+0.88% frame-avg, 95% CI +0.48% to +1.22%) while cutting cmds_ms by -5.37%, draw_ms by -1.89%, and improving 1% Low (+0.46 fps) and 0.1% Low (+3.24 fps).

What this changes:

  • Per-thread O(1) generation counters (gpu/vk/draw_dyn_lean.h, gpu/vk/vk_replay.cpp): Adds trivial-POD, constinit tl_dyn_state_gen and tl_vbuf_state_gen counters bumped on every relevant NvnState mutation (NOP_VIEWPORTS, NOP_SCISSOR, NOP_DEPTH_RANGE, NOP_BIND_STATE kinds 0..5, NOP_STENCIL, NOP_POLY_OFFSET, NOP_BLEND_COLOR, NOP_PRIMITIVE_RESTART, NOP_DEPTH_CLAMP, NOP_RASTER_DISCARD, NOP_BIND_VSTREAM, NOP_BIND_VBUF), cross-queue switches in use_queue_state(), and draw_begin_recording().
  • Compact hot-line skip keys (gpu/vk/vk_draw.cpp):
    • Stores {dyn_gen, at_sig, wm_key, topo_key, mesh_key} on DynFast (with targets_dyn_sig() hashing all 8 color_format slots, width, height, n, depth, and depth_format, and wm_key carrying the full 48-bit program_wm_sig() plus sw() debug bits), allowing dynamic_state() to exit in O(1) when !dump_on() and all keys match. Like main's packed comparison, the skip also needs no pipeline hook by program and the hooks' generation the state was made under (DynFast::hooks_gen, #2822).
    • Stores vbuf_gen alongside stamp on VertexSet, skipping vertex-array packing, gpu_bind_stamp(), and vertex_set_same() via inline g_bind_stamp_fast when unchanged.
    • Keeps zero edits to vk_state.h, vk_internal.h, vk_shader.cpp, vk_bank.cpp, vk_api.h, eden/, sirit/, compat/, or third_party/.
  • Parity validation & switch registration (gpu/vk/switches.def, tests/test_vk_draw_dyn_lean.py, tests/test_thinlto_tls.py): tests/test_vk_draw_dyn_lean.py compiles the production dynamic_state(), vertex-stream block and replay() state cases and runs modes 0/1/check/HOS_AB against each other; tests/test_thinlto_tls.py covers the header's thread_locals across translation units. Adds RX_VK_DRAW_DYN_LEAN=check validating same_packed, vertex_set_same(), and g_bind_stamp_fast == gpu_bind_stamp() with periodic 100k summaries (0 mismatches across 13.9M+ live checks).

Key files to read first: gpu/vk/draw_dyn_lean.h, gpu/vk/vk_draw.cpp, gpu/vk/vk_replay.cpp, gpu/vk/switches.def, and tests/test_vk_draw_dyn_lean.py.

Testing

Tested: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4):

  • Live RX_VK_DRAW_DYN_LEAN=check 30 s parity run in market (2368 frames, 78.9 fps, 1% low 55.7 fps, 0 crashes): 13,900,000+ live checks (dyn: 7,014,044 calls / 6,127,828 hits = 87.4%; vbuf: 6,885,956 calls / 2,284,907 hits = 33.2%), 0 mismatches.
  • 3×90 s (89 paired periods) + 5×90 s (149 paired periods, 32,456 frames) queued in-run HOS_AB=RX_VK_DRAW_DYN_LEAN=0,3,0 benchmarks in market (1280x720, 50% internal res, V-Sync off, uncapped HOS_FPS_MAX=1000) via dev.py ab.
  • Rebased onto origin/main @ 455b08373 at 1500288e9, compiled full renderer (longshot-builder dev compile --only renderer: 270 units / 114 compiled, 0 failed, longshot_vk.dll 17 MB), and ran strict tests/run_all.py:
    • python -I -X utf8 -B tests/run_all.py --strict targeted 15-test Vulkan/draw suite with RX_CPM set (test_vk_draw_dyn_lean.py, test_same_dyn.py, test_draw_binds.py, test_push_state.py, test_same_draw.py, test_vertex_bind.py, test_vertex_bind_range.py, test_vk_cmd_fast.py, test_recorder_parts.py, test_inline_write_order.py, test_replay_write_order.py, test_desc_counts.py, test_hos_ab.py, test_tls_objects.py, test_vk_braces.py): 15 passed, 0 failed, 0 skipped.
    • tests/run_all.py --strict --changed origin/main: 242 passed (before RX_CPM was set; remaining failures were missing RX_CPM Vulkan/SPIR-V headers, missing MSVC link.exe, or pre-existing origin/main fixture staleness unrelated to RX_VK_DRAW_DYN_LEAN, including test_switch_table.py [LONGSHOT_LAUNCHER_STARTUP], test_fallback_pipeline_state.py [kPushSize/push_stages/cmd_fast_on from #2949], test_flat_map.py, test_compute_warm_apart.py, test_ub_snapshot_gpu_writes.py).
    • python -I -X utf8 tests/test_vk_draw_dyn_lean.py --cxx clang++ and --cxx g++ (both PASS, 5,000-draw parity + 14 MUST_FAIL mutants caught on each).
  • After review (rebased onto origin/main @ b4d56f526, head 48ff07500): the PR's 19 checks run one by one (test_vk_draw_dyn_lean, test_thinlto_tls, test_tls_objects, test_fallback_pipeline_state, test_hos_ab, test_program_hooks, test_switch_table, test_same_dyn, test_same_draw, test_draw_binds, test_push_state, test_desc_counts, test_vertex_bind, test_vertex_bind_range, test_vk_cmd_fast, test_recorder_parts, test_inline_write_order, test_replay_write_order, test_vk_braces): 19 passed. test_vk_draw_dyn_lean.py: the production code with clang++ and g++, 2×12,000-draw traces identical in all modes, 30 production-text mutants caught. No renderer build and no game run after the rebase.

Still to test:

  • By hand (a person with the game on Tier 1 systems): base against head (merge base vs this head, interleaved) at player settings (normal resolution, Auto quality) in the target and a heavy area: average and 1% low FPS, frame times. The measurements below are on/off in one older build at 50% internal and uncapped.
  • CI Windows/Linux unit & renderer checks: run full mise run test and renderer build on the rebased head (@Beanstalk run mise run test, expecting RX_VK_DRAW_DYN_LEAN tests green and pre-existing baseline status unchanged).
  • Linux (RADV), AMD Windows, Steam Deck: smoke run, performance comparison and RX_VK_DRAW_DYN_LEAN=check parity sweep in market (@Beanstalk run RX_VK_DRAW_DYN_LEAN=check, expecting 0 mismatches and no regressions).

Measurements

Verdict: faster: +0.86% FPS (-0.107 ms mean frame time, 95% CI +0.48% to +1.22%, 149 paired periods across 5×90 s in-run HOS_AB sessions; 1% Low +0.46 fps, 0.1% Low +3.24 fps, cmds_ms -5.37%, draw_ms -1.89%).

Setup: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4); Market, child (crowded) (window 804x581); quality preset Custom, resolution 50% (768x432), output res 1280x720, frame generation Off, vsync Off; uncapped (HOS_FPS_MAX=1000); the frame trace (RX_VK_FRAME_TRACE=1), 90 s each after a warm-up until no frame waited for a pipeline, 5 runs, RX_VK_DRAW_DYN_LEAN flipped every 3 s within each run (HOS_AB=RX_VK_DRAW_DYN_LEAN=0,3,0); dev.py ab.

Baseline: both columns are one build, v3.2.0-211-gfe3d8427d (measured on main @ d53dbe94b, then cleanly rebased onto origin/main @ 455b08373 at 1500288e9 where #2949 is orthogonal to dyn_pack/vertex_set_same): RX_VK_DRAW_DYN_LEAN=0 (side 1) against RX_VK_DRAW_DYN_LEAN unset / 1 (side 0) on it.

Before, RX_VK_DRAW_DYN_LEAN=0: this PR @ fe3d8427 After, RX_VK_DRAW_DYN_LEAN unset: this PR @ fe3d8427 Δ
FPS (pooled perf.py ab) 79.8 80.5 +0.86%
Mean frame time 12.54 ms 12.43 ms -0.11 ms
Median frame time 12.24 ms 12.14 ms -0.10 ms
P99 frame time 16.25 ms 16.14 ms -0.11 ms
Avg / P50 / 1% Low / 0.1% Low FPS 79.79 / 81.70 / 61.61 / 46.00 80.49 / 82.37 / 62.07 / 49.24 +0.88% / +0.82% / +0.75% / +7.04%
cmds_ms 2.429 ms 2.298 ms -0.130 ms (-5.37%)
draw_ms 7.170 ms 7.034 ms -0.136 ms (-1.89%)
wait_gpu_ms 1.376 ms 1.260 ms -0.116 ms (-8.45%)
main_cpu_ms 4.260 ms 4.216 ms -0.043 ms (-1.02%)
Frames >= 50 ms per minute 0.00 0.00 +0.00
3x90s pilot (89 periods, pre-promotion): side 0 (ON) 79.96 fps vs side 1 (OFF) 79.20 fps (+0.97%, 95% CI +0.52% to +1.47%)
5x90s confirmation (149 periods, 32456 frames):
AB1: 6507 frames, side 0 (ON) 80.6 fps, side 1 (OFF) 80.0 fps (-0.73% when OFF)
AB2: 6097 frames, side 0 (ON) 80.4 fps, side 1 (OFF) 79.4 fps (-1.26% when OFF)
AB3: 6501 frames, side 0 (ON) 80.8 fps, side 1 (OFF) 79.7 fps (-1.36% when OFF)
AB4: 6261 frames, side 0 (ON) 80.0 fps, side 1 (OFF) 80.0 fps (+0.07% when OFF)
AB5: 6226 frames, side 0 (ON) 80.5 fps, side 1 (OFF) 79.8 fps (-0.98% when OFF)
POOLED_DIFF: 149 periods, side 1 - side 0 = +0.1066 ms (+0.858%, fps -0.850%), 95% CI [+0.0593, +0.1513] ms (+0.477% to +1.217%)
[hos host] vk: switches set (10): HOS_AB=RX_VK_DRAW_DYN_LEAN=0,3,0 (diag), HOS_AUDIO_MUTE=1 (diag), HOS_CONTROL=<id> (diag), HOS_DISCORD=0 (kill), HOS_ENV_FILE=<a path> (diag), HOS_FPS_MAX=1000 (player), HOS_WINDOW_NOACTIVATE=1 (diag), LONGSHOT_BUILD_NAME=<name> (diag), LONGSHOT_PROFILE=<a path> (player), RX_VK_FRAME_TRACE=1 (diag)

Risks

  • Missing generation bump on future state mutations: Any new code path mutating NvnState dynamic-state or vertex-stream fields must bump tl_dyn_state_gen or tl_vbuf_state_gen (validated continuously when running RX_VK_DRAW_DYN_LEAN=check).
  • Rollback / toggle: Setting RX_VK_DRAW_DYN_LEAN=0 reverts to legacy dyn_pack/dyn_same and vertex_set_same on every draw at runtime, or reverting the commit removes it cleanly.
  • No save/options/cache impact: Saves, longshot_options.ini, and shader/pipeline caches (LONGSHOT_SHADER_STAMP) are untouched.

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.
  • 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 Every draw call on the Vulkan replay thread (`mkw_vk_replay`) packed and memcmp'd ~250 bytes of dynamic graphics state (`dyn_pack()` + `dyn_same()` inside `dynamic_state()`) and assembled three 16-entry vertex stream arrays (`vaddr`, `vsize`, `vstride_key`) before calling `vertex_set_same()` and cross-TU `gpu_bind_stamp()`, even though 87.4% of `dynamic_state()` calls reuse the exact same dynamic state and 33.2% of draws reuse the exact same vertex streams without an intervening state change. This PR eliminates that redundant per-draw CPU work behind `RX_VK_DRAW_DYN_LEAN` (default `1`, `=0` legacy, `=check` parity, `HOS_AB` wired), delivering **+0.86% FPS** (`+0.88%` frame-avg, 95% CI **+0.48% to +1.22%**) while cutting `cmds_ms` by **-5.37%**, `draw_ms` by **-1.89%**, and improving `1% Low` (**+0.46 fps**) and `0.1% Low` (**+3.24 fps**). What this changes: - **Per-thread O(1) generation counters (`gpu/vk/draw_dyn_lean.h`, `gpu/vk/vk_replay.cpp`):** Adds trivial-POD, `constinit` `tl_dyn_state_gen` and `tl_vbuf_state_gen` counters bumped on every relevant `NvnState` mutation (`NOP_VIEWPORTS`, `NOP_SCISSOR`, `NOP_DEPTH_RANGE`, `NOP_BIND_STATE` kinds `0..5`, `NOP_STENCIL`, `NOP_POLY_OFFSET`, `NOP_BLEND_COLOR`, `NOP_PRIMITIVE_RESTART`, `NOP_DEPTH_CLAMP`, `NOP_RASTER_DISCARD`, `NOP_BIND_VSTREAM`, `NOP_BIND_VBUF`), cross-queue switches in `use_queue_state()`, and `draw_begin_recording()`. - **Compact hot-line skip keys (`gpu/vk/vk_draw.cpp`):** - Stores `{dyn_gen, at_sig, wm_key, topo_key, mesh_key}` on `DynFast` (with `targets_dyn_sig()` hashing all 8 `color_format` slots, `width`, `height`, `n`, `depth`, and `depth_format`, and `wm_key` carrying the full 48-bit `program_wm_sig()` plus `sw()` debug bits), allowing `dynamic_state()` to exit in O(1) when `!dump_on()` and all keys match. Like main's packed comparison, the skip also needs no pipeline hook by program and the hooks' generation the state was made under (`DynFast::hooks_gen`, #2822). - Stores `vbuf_gen` alongside `stamp` on `VertexSet`, skipping vertex-array packing, `gpu_bind_stamp()`, and `vertex_set_same()` via inline `g_bind_stamp_fast` when unchanged. - Keeps zero edits to `vk_state.h`, `vk_internal.h`, `vk_shader.cpp`, `vk_bank.cpp`, `vk_api.h`, `eden/`, `sirit/`, `compat/`, or `third_party/`. - **Parity validation & switch registration (`gpu/vk/switches.def`, `tests/test_vk_draw_dyn_lean.py`, `tests/test_thinlto_tls.py`):** `tests/test_vk_draw_dyn_lean.py` compiles the production `dynamic_state()`, vertex-stream block and `replay()` state cases and runs modes 0/1/check/HOS_AB against each other; `tests/test_thinlto_tls.py` covers the header's thread_locals across translation units. Adds `RX_VK_DRAW_DYN_LEAN=check` validating `same_packed`, `vertex_set_same()`, and `g_bind_stamp_fast == gpu_bind_stamp()` with periodic 100k summaries (`0` mismatches across `13.9M+` live checks). Key files to read first: `gpu/vk/draw_dyn_lean.h`, `gpu/vk/vk_draw.cpp`, `gpu/vk/vk_replay.cpp`, `gpu/vk/switches.def`, and `tests/test_vk_draw_dyn_lean.py`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4): - Live `RX_VK_DRAW_DYN_LEAN=check` 30 s parity run in `market` (`2368` frames, `78.9 fps`, `1% low 55.7 fps`, `0` crashes): **`13,900,000+` live checks (`dyn`: `7,014,044` calls / `6,127,828` hits = `87.4%`; `vbuf`: `6,885,956` calls / `2,284,907` hits = `33.2%`), `0` mismatches**. - 3×90 s (`89` paired periods) + 5×90 s (`149` paired periods, `32,456` frames) queued in-run `HOS_AB=RX_VK_DRAW_DYN_LEAN=0,3,0` benchmarks in `market` (`1280x720`, 50% internal res, V-Sync off, uncapped `HOS_FPS_MAX=1000`) via `dev.py ab`. - Rebased onto `origin/main @ 455b08373` at `1500288e9`, compiled full renderer (`longshot-builder dev compile --only renderer`: `270` units / `114` compiled, `0` failed, `longshot_vk.dll` 17 MB), and ran strict `tests/run_all.py`: - `python -I -X utf8 -B tests/run_all.py --strict` targeted 15-test Vulkan/draw suite with `RX_CPM` set (`test_vk_draw_dyn_lean.py`, `test_same_dyn.py`, `test_draw_binds.py`, `test_push_state.py`, `test_same_draw.py`, `test_vertex_bind.py`, `test_vertex_bind_range.py`, `test_vk_cmd_fast.py`, `test_recorder_parts.py`, `test_inline_write_order.py`, `test_replay_write_order.py`, `test_desc_counts.py`, `test_hos_ab.py`, `test_tls_objects.py`, `test_vk_braces.py`): **15 passed, 0 failed, 0 skipped**. - `tests/run_all.py --strict --changed origin/main`: **242 passed** (before `RX_CPM` was set; remaining failures were missing `RX_CPM` Vulkan/SPIR-V headers, missing MSVC `link.exe`, or pre-existing `origin/main` fixture staleness unrelated to `RX_VK_DRAW_DYN_LEAN`, including `test_switch_table.py` [`LONGSHOT_LAUNCHER_STARTUP`], `test_fallback_pipeline_state.py` [`kPushSize`/`push_stages`/`cmd_fast_on` from `#2949`], `test_flat_map.py`, `test_compute_warm_apart.py`, `test_ub_snapshot_gpu_writes.py`). - `python -I -X utf8 tests/test_vk_draw_dyn_lean.py --cxx clang++` and `--cxx g++` (both PASS, `5,000`-draw parity + `14 MUST_FAIL` mutants caught on each). - After review (rebased onto `origin/main @ b4d56f526`, head `48ff07500`): the PR's 19 checks run one by one (`test_vk_draw_dyn_lean`, `test_thinlto_tls`, `test_tls_objects`, `test_fallback_pipeline_state`, `test_hos_ab`, `test_program_hooks`, `test_switch_table`, `test_same_dyn`, `test_same_draw`, `test_draw_binds`, `test_push_state`, `test_desc_counts`, `test_vertex_bind`, `test_vertex_bind_range`, `test_vk_cmd_fast`, `test_recorder_parts`, `test_inline_write_order`, `test_replay_write_order`, `test_vk_braces`): **19 passed**. `test_vk_draw_dyn_lean.py`: the production code with clang++ and g++, 2×12,000-draw traces identical in all modes, 30 production-text mutants caught. No renderer build and no game run after the rebase. **Still to test:** - By hand (a person with the game on Tier 1 systems): base against head (merge base vs this head, interleaved) at player settings (normal resolution, Auto quality) in the target and a heavy area: average and 1% low FPS, frame times. The measurements below are on/off in one older build at 50% internal and uncapped. - CI Windows/Linux unit & renderer checks: run full `mise run test` and renderer build on the rebased head (`@Beanstalk` run `mise run test`, expecting `RX_VK_DRAW_DYN_LEAN` tests green and pre-existing baseline status unchanged). - Linux (RADV), AMD Windows, Steam Deck: smoke run, performance comparison and `RX_VK_DRAW_DYN_LEAN=check` parity sweep in `market` (`@Beanstalk` run `RX_VK_DRAW_DYN_LEAN=check`, expecting `0 mismatches` and no regressions). ## Measurements **Verdict:** faster: **+0.86% FPS** (`-0.107 ms` mean frame time, 95% CI **`+0.48%` to `+1.22%`**, `149` paired periods across 5×90 s in-run `HOS_AB` sessions; `1% Low +0.46 fps`, `0.1% Low +3.24 fps`, `cmds_ms -5.37%`, `draw_ms -1.89%`). Setup: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4); Market, child (crowded) (window `804x581`); quality preset Custom, resolution 50% (`768x432`), output res `1280x720`, frame generation Off, vsync Off; uncapped (`HOS_FPS_MAX=1000`); the frame trace (`RX_VK_FRAME_TRACE=1`), 90 s each after a warm-up until no frame waited for a pipeline, 5 runs, `RX_VK_DRAW_DYN_LEAN` flipped every 3 s within each run (`HOS_AB=RX_VK_DRAW_DYN_LEAN=0,3,0`); `dev.py ab`. **Baseline:** both columns are one build, `v3.2.0-211-gfe3d8427d` (measured on `main @ d53dbe94b`, then cleanly rebased onto `origin/main @ 455b08373` at `1500288e9` where `#2949` is orthogonal to `dyn_pack`/`vertex_set_same`): `RX_VK_DRAW_DYN_LEAN=0` (`side 1`) against `RX_VK_DRAW_DYN_LEAN` unset / `1` (`side 0`) on it. | | Before, RX_VK_DRAW_DYN_LEAN=0: this PR @ fe3d8427 | After, RX_VK_DRAW_DYN_LEAN unset: this PR @ fe3d8427 | Δ | |---|---|---|---| | FPS (pooled `perf.py ab`) | 79.8 | 80.5 | +0.86% | | Mean frame time | 12.54 ms | 12.43 ms | -0.11 ms | | Median frame time | 12.24 ms | 12.14 ms | -0.10 ms | | P99 frame time | 16.25 ms | 16.14 ms | -0.11 ms | | Avg / P50 / 1% Low / 0.1% Low FPS | 79.79 / 81.70 / 61.61 / 46.00 | 80.49 / 82.37 / 62.07 / 49.24 | +0.88% / +0.82% / +0.75% / +7.04% | | `cmds_ms` | 2.429 ms | 2.298 ms | -0.130 ms (-5.37%) | | `draw_ms` | 7.170 ms | 7.034 ms | -0.136 ms (-1.89%) | | `wait_gpu_ms` | 1.376 ms | 1.260 ms | -0.116 ms (-8.45%) | | `main_cpu_ms` | 4.260 ms | 4.216 ms | -0.043 ms (-1.02%) | | Frames >= 50 ms per minute | 0.00 | 0.00 | +0.00 | ```text 3x90s pilot (89 periods, pre-promotion): side 0 (ON) 79.96 fps vs side 1 (OFF) 79.20 fps (+0.97%, 95% CI +0.52% to +1.47%) 5x90s confirmation (149 periods, 32456 frames): AB1: 6507 frames, side 0 (ON) 80.6 fps, side 1 (OFF) 80.0 fps (-0.73% when OFF) AB2: 6097 frames, side 0 (ON) 80.4 fps, side 1 (OFF) 79.4 fps (-1.26% when OFF) AB3: 6501 frames, side 0 (ON) 80.8 fps, side 1 (OFF) 79.7 fps (-1.36% when OFF) AB4: 6261 frames, side 0 (ON) 80.0 fps, side 1 (OFF) 80.0 fps (+0.07% when OFF) AB5: 6226 frames, side 0 (ON) 80.5 fps, side 1 (OFF) 79.8 fps (-0.98% when OFF) POOLED_DIFF: 149 periods, side 1 - side 0 = +0.1066 ms (+0.858%, fps -0.850%), 95% CI [+0.0593, +0.1513] ms (+0.477% to +1.217%) [hos host] vk: switches set (10): HOS_AB=RX_VK_DRAW_DYN_LEAN=0,3,0 (diag), HOS_AUDIO_MUTE=1 (diag), HOS_CONTROL=<id> (diag), HOS_DISCORD=0 (kill), HOS_ENV_FILE=<a path> (diag), HOS_FPS_MAX=1000 (player), HOS_WINDOW_NOACTIVATE=1 (diag), LONGSHOT_BUILD_NAME=<name> (diag), LONGSHOT_PROFILE=<a path> (player), RX_VK_FRAME_TRACE=1 (diag) ``` ## Risks - **Missing generation bump on future state mutations:** Any new code path mutating `NvnState` dynamic-state or vertex-stream fields must bump `tl_dyn_state_gen` or `tl_vbuf_state_gen` (validated continuously when running `RX_VK_DRAW_DYN_LEAN=check`). - **Rollback / toggle:** Setting `RX_VK_DRAW_DYN_LEAN=0` reverts to legacy `dyn_pack`/`dyn_same` and `vertex_set_same` on every draw at runtime, or reverting the commit removes it cleanly. - **No save/options/cache impact:** Saves, `longshot_options.ini`, and shader/pipeline caches (`LONGSHOT_SHADER_STAMP`) are untouched. ## 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] 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.
perf(vk): O(1) generation-guarded dynamic state & vertex-bind skips (RX_VK_DRAW_DYN_LEAN)
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
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
1500288e9d
Adds gpu/vk/draw_dyn_lean.h and wires RX_VK_DRAW_DYN_LEAN (default 1, 0 legacy, 2/=check parity, HOS_AB-flippable between recordings) to avoid per-draw dyn_pack/dyn_same and 16-stream vertex_set_same packing/scans when neither NvnState nor Targets/pipeline keys/bind stamp changed:

- Per-thread trivial POD generation counters (tl_dyn_state_gen, tl_vbuf_state_gen) bumped on every relevant NvnState mutation in vk_replay.cpp, on queue state switches (use_queue_state), and in draw_begin_recording().
- Compact hot-line key fields on DynFast (dyn_gen, at_sig, wm_key with full 48-bit program_wm_sig + sw_sig, topo_key, mesh_key) and VertexSet (vbuf_gen, stamp) in vk_draw.cpp, with !dump_on() guard and key refresh on redundant binds.
- =check parity mode validating dyn_same and vertex_set_same + g_bind_stamp_fast == gpu_bind_stamp() with periodic 100k summaries.
- Zero edits to vk_state.h, vk_internal.h, vk_shader.cpp, vk_bank.cpp, vk_api.h, eden/, sirit/, compat/, or third_party/.

Assisted-by: Antigravity (Google DeepMind)
Author
Contributor

Tested in game: Windows 11 RTX 4060: 30s live RX_VK_DRAW_DYN_LEAN=check (13.9M+ checks, 0 mismatches) and 5x90s HOS_AB in market (+0.86% fps, 95% CI +0.48%..+1.22%, cmds_ms -5.37%)

Tested in game: Windows 11 RTX 4060: 30s live RX_VK_DRAW_DYN_LEAN=check (13.9M+ checks, 0 mismatches) and 5x90s HOS_AB in market (+0.86% fps, 95% CI +0.48%..+1.22%, cmds_ms -5.37%)
Member

Possibly related, for context:

  • PR #2132 WIP: perf(vk): a draw's state compares in x86-64 assembly (dynamic state, vertex set, binding range, pipeline key) — Overlapping optimization of per-draw Vulkan state comparisons and vertex-set checks
  • PR #2059 perf(vk): a draw keeps its pipeline and dynamic state while the NVN state they are made from stands — Related generation-based reuse of Vulkan dynamic state and draw state
  • issue #402 Deck: the frame is CPU-bound in the submission path, not GPU-bound (16 fps at 50% internal, GPU-bound wait 0.4 ms) — Documents CPU cost in Vulkan per-draw submission path
Possibly related, for context: - PR #2132 WIP: perf(vk): a draw's state compares in x86-64 assembly (dynamic state, vertex set, binding range, pipeline key) — Overlapping optimization of per-draw Vulkan state comparisons and vertex-set checks - PR #2059 perf(vk): a draw keeps its pipeline and dynamic state while the NVN state they are made from stands — Related generation-based reuse of Vulkan dynamic state and draw state - issue #402 Deck: the frame is CPU-bound in the submission path, not GPU-bound (16 fps at 50% internal, GPU-bound wait 0.4 ms) — Documents CPU cost in Vulkan per-draw submission path
Member
@review
BeanBot left a comment

Recommendation: Request changes. The new cross-translation-unit thread-local variables do not follow the repository’s COFF ThinLTO rule, and the main parity test exercises a copy of the fast-path decisions rather than the production decisions. The reported performance gain also needs confirmation against the base at player settings and on the other affected Tier 1 systems.

The change skips repeated dynamic-state packing and vertex-stream comparisons during Vulkan replay. It adds generation tracking and a diagnostic switch, trading a larger cache-invalidation surface and per-draw key work for a reported small CPU saving.

Blocking (1): must change before merging.

  1. L1 gpu/vk/draw_dyn_lean.h:13: The new namespace-scope inline thread-local variables omit the required constinit qualifier. (more on the line) Do: Mark all four new inline thread-local variables constinit and cover their cross-translation-unit identity in the ThinLTO TLS check.

Should fix (2): not blocking, but worth doing before merging.

  • L2 tests/test_vk_draw_dyn_lean.py:280: The parity harness models the fast-path decisions instead of executing the production decisions it claims to validate. (more on the line) Do: Extract and exercise the actual dynamic-state and vertex-binding decisions from vk_draw.cpp, including their invalidation paths, and demonstrate that undoing the production fast path fails the test.
  • L3 tests/test_vk_draw_dyn_lean.py:982: The baseline harness inherits the MUTANT environment variable. (more on the line) Do: Run the baseline with MUTANT removed from its environment, and set it explicitly only for each mutant run.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4: The claimed gain has not been measured against the merge base at settings representative of players. When: The supplied runs compare on and off in an older PR build at 50% internal resolution and uncapped FPS; they do not establish the effect of the current head against its base at the device’s normal resolution and Auto quality. Do: Run interleaved base-versus-head measurements at player settings in the target and heavy areas, reporting average and 1% low FPS and frame times.
  • L5: The enabled-by-default replay change still needs coverage on the other affected Tier 1 systems. When: Only Windows NVIDIA live parity is reported, while the same fast skips run on Linux, AMD RADV and Steam Deck; the PR itself lists Linux parity as still to test. Do: Run game and check-mode parity sweeps and representative performance comparisons on the affected Windows and Linux Tier 1 configurations, including RADV and Steam Deck.

@fix can do L1, L2 and L3.

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven at player settings. The PR reports +0.86% FPS and -5.37% cmds_ms across 149 paired periods on Windows RTX 4060, but compares switch settings in a pre-rebase PR build at 50% internal resolution and an uncapped frame rate, rather than the merge base and head at the settings players use.

Other systems: The replay path affects Vulkan draws on Windows and Linux, NVIDIA and AMD, including Steam Deck, as well as fallback rendering paths. The supplied live parity and performance evidence covers Windows on one NVIDIA GPU; Linux RADV and other Tier 1 coverage remain outstanding.

Switches: RX_VK_DRAW_DYN_LEAN is added as a kill switch, default on; 0 selects the legacy comparison path and check or 2 enables parity checks. Its row and HOS_AB wiring are present, but the default’s performance has not been measured across affected platforms.

Reviewed: 1500288e9d against 455b083738: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the commit and production diff, the new header, the changed dynamic-state and vertex-binding sections and replay mutations, and the new test’s harness and driver. Skimmed the remaining changed test sections and surrounding renderer references; did not read the entirety of the large vk_draw.cpp and vk_replay.cpp files. docs/review-checklist.md and ../Tooling/AGENTS.md were unavailable.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance.
  • The new switch has a switches.def row and HOS_AB registration.
  • The visible replay mutations of fields packed by dyn_pack and the vertex stream fields have corresponding generation bumps.
  • The changed files contain no committed build output or apparent game-derived assets.

Testing: Read-only review; no builds, tests, scripts or game runs were executed. The supplied CI checks are still running.

Overlaps and merge order: Not checked; network access is unavailable.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The new cross-translation-unit thread-local variables do not follow the repository’s COFF ThinLTO rule, and the main parity test exercises a copy of the fast-path decisions rather than the production decisions. The reported performance gain also needs confirmation against the base at player settings and on the other affected Tier 1 systems. The change skips repeated dynamic-state packing and vertex-stream comparisons during Vulkan replay. It adds generation tracking and a diagnostic switch, trading a larger cache-invalidation surface and per-draw key work for a reported small CPU saving. **Blocking (1)**: must change before merging. 1. **L1** `gpu/vk/draw_dyn_lean.h:13`: The new namespace-scope inline thread-local variables omit the required constinit qualifier. (more on the line) **Do:** Mark all four new inline thread-local variables constinit and cover their cross-translation-unit identity in the ThinLTO TLS check. **Should fix (2)**: not blocking, but worth doing before merging. - **L2** `tests/test_vk_draw_dyn_lean.py:280`: The parity harness models the fast-path decisions instead of executing the production decisions it claims to validate. (more on the line) **Do:** Extract and exercise the actual dynamic-state and vertex-binding decisions from vk_draw.cpp, including their invalidation paths, and demonstrate that undoing the production fast path fails the test. - **L3** `tests/test_vk_draw_dyn_lean.py:982`: The baseline harness inherits the MUTANT environment variable. (more on the line) **Do:** Run the baseline with MUTANT removed from its environment, and set it explicitly only for each mutant run. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The claimed gain has not been measured against the merge base at settings representative of players. *When:* The supplied runs compare on and off in an older PR build at 50% internal resolution and uncapped FPS; they do not establish the effect of the current head against its base at the device’s normal resolution and Auto quality. **Do:** Run interleaved base-versus-head measurements at player settings in the target and heavy areas, reporting average and 1% low FPS and frame times. - **L5**: The enabled-by-default replay change still needs coverage on the other affected Tier 1 systems. *When:* Only Windows NVIDIA live parity is reported, while the same fast skips run on Linux, AMD RADV and Steam Deck; the PR itself lists Linux parity as still to test. **Do:** Run game and check-mode parity sweeps and representative performance comparisons on the affected Windows and Linux Tier 1 configurations, including RADV and Steam Deck. `@fix` can do L1, L2 and L3. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven at player settings. The PR reports +0.86% FPS and -5.37% cmds_ms across 149 paired periods on Windows RTX 4060, but compares switch settings in a pre-rebase PR build at 50% internal resolution and an uncapped frame rate, rather than the merge base and head at the settings players use. **Other systems:** The replay path affects Vulkan draws on Windows and Linux, NVIDIA and AMD, including Steam Deck, as well as fallback rendering paths. The supplied live parity and performance evidence covers Windows on one NVIDIA GPU; Linux RADV and other Tier 1 coverage remain outstanding. **Switches:** RX_VK_DRAW_DYN_LEAN is added as a kill switch, default on; 0 selects the legacy comparison path and check or 2 enables parity checks. Its row and HOS_AB wiring are present, but the default’s performance has not been measured across affected platforms. **Reviewed:** 1500288e9d5c against 455b083738f4: Read AGENTS.md, CONTRIBUTING.md, the PR template, standards, the commit and production diff, the new header, the changed dynamic-state and vertex-binding sections and replay mutations, and the new test’s harness and driver. Skimmed the remaining changed test sections and surrounding renderer references; did not read the entirety of the large vk_draw.cpp and vk_replay.cpp files. docs/review-checklist.md and ../Tooling/AGENTS.md were unavailable.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance. - The new switch has a switches.def row and HOS_AB registration. - The visible replay mutations of fields packed by dyn_pack and the vertex stream fields have corresponding generation bumps. - The changed files contain no committed build output or apparent game-derived assets. **Testing:** Read-only review; no builds, tests, scripts or game runs were executed. The supplied CI checks are still running. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -0,0 +10,4 @@
// Bumped on every mutation of any NvnState field read by dyn_pack(), on queue state switch,
// and at draw_begin_recording(). 0 is reserved as invalid in cached keys.
inline thread_local uint64_t tl_dyn_state_gen = 1;
Member

L1 (blocking): The new namespace-scope inline thread-local variables omit the required constinit qualifier.

When: These counters and mode are used from both vk_draw.cpp and vk_replay.cpp in the Windows COFF ThinLTO build. The repository explicitly requires constinit on inline thread-local state to keep cross-translation-unit TLS linking safe.

Do: Mark all four new inline thread-local variables constinit and cover their cross-translation-unit identity in the ThinLTO TLS check.

**L1** (blocking): The new namespace-scope inline thread-local variables omit the required constinit qualifier. *When:* These counters and mode are used from both vk_draw.cpp and vk_replay.cpp in the Windows COFF ThinLTO build. The repository explicitly requires constinit on inline thread-local state to keep cross-translation-unit TLS linking safe. **Do:** Mark all four new inline thread-local variables constinit and cover their cross-translation-unit identity in the ThinLTO TLS check.
@ -0,0 +277,4 @@
}
// Model dynamic_state using exact dyn_pack + dyn_same + draw_dyn_lean key logic
void model_dynamic_state(const NvnState& s, const Targets& at, VkPrimitiveTopology topo, bool mesh, const Program& p) {
Member

L2 (should fix): The parity harness models the fast-path decisions instead of executing the production decisions it claims to validate.

When: For example, removing the fast-return body from dynamic_state() leaves the source-wiring needles present and leaves model_dynamic_state() unchanged, so the 5,000-draw and mutant checks can still pass without testing the production optimization.

Do: Extract and exercise the actual dynamic-state and vertex-binding decisions from vk_draw.cpp, including their invalidation paths, and demonstrate that undoing the production fast path fails the test.

**L2** (should fix): The parity harness models the fast-path decisions instead of executing the production decisions it claims to validate. *When:* For example, removing the fast-return body from dynamic_state() leaves the source-wiring needles present and leaves model_dynamic_state() unchanged, so the 5,000-draw and mutant checks can still pass without testing the production optimization. **Do:** Extract and exercise the actual dynamic-state and vertex-binding decisions from vk_draw.cpp, including their invalidation paths, and demonstrate that undoing the production fast path fails the test.
@ -0,0 +979,4 @@
str(cpp), "-o", str(exe),
]
subprocess.run(cmd, check=True)
subprocess.run([str(exe)], check=True)
Member

L3 (should fix): The baseline harness inherits the MUTANT environment variable.

When: When a developer or CI environment already has MUTANT set to one of these names, the supposedly normal run activates that mutant and fails before the intended mutant checks.

Do: Run the baseline with MUTANT removed from its environment, and set it explicitly only for each mutant run.

**L3** (should fix): The baseline harness inherits the MUTANT environment variable. *When:* When a developer or CI environment already has MUTANT set to one of these names, the supposedly normal run activates that mutant and fails before the intended mutant checks. **Do:** Run the baseline with MUTANT removed from its environment, and set it explicitly only for each mutant run.
siantm force-pushed perf/vk-draw-dyn-lean from 1500288e9d
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
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
to 48ff075008
Some checks reported errors
PR description / Title and description (pull_request_target) Successful in 6s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/nvidia 0/1 pass, 2 error
beanstalk/windows+nvidia 0/1 pass, 2 error
beanstalk/amd 0/1 pass, 2 error
beanstalk/windows+amd 0/1 pass, 2 error
beanstalk/linux+radv 0/1 pass, 2 error
beanstalk/intel 0/1 pass, 2 error
beanstalk/steamdeck 0/1 pass, 2 error
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
2026-12-03 15:54:44 +00:00
Compare
Author
Contributor

Rebased onto origin/main @ b4d56f526 and pushed 48ff07500 (the rebased PR commit 8b028cd7b, then one commit for L1–L3). The branch merges cleanly into today's origin/main (9a1f19b46).

Rebase. The conflicts came from #2822 (the mods' pipeline hooks in dynamic_state()) and from the RX_VK_DMABUF_PIECE_MB row that left switches.def. Both sides are kept. Main's hook conditions are now one reusable term (gpu/vk/vk_draw.cpp:7389). It means no dump, no pipeline hook by program, and the hooks' generation the state was made under. The O(1) skip (can_skip_dyn, :7399) and the packed comparison (same_packed) both require it. hooks_gen sits with the other keys in DynFast (:7147). A hook by shape depends on the target's n, depth, width and height, and all of those are in at_sig.

L1 (blocking): done.

  • All four inline thread_locals in gpu/vk/draw_dyn_lean.h are now constinit (lines 14, 18, 24, 34).
  • tests/test_thinlto_tls.py now compiles that header into both of its translation units, natively and with -flto=thin -fuse-ld=lld. It checks:
    • each variable has the same address from either file;
    • a bump made in one file is seen in the other;
    • a new thread gets its own copies at the constant initializers.
  • It also fails if an inline thread_local in that header has no constinit.

L2: done. tests/test_vk_draw_dyn_lean.py no longer models the decisions. It cuts the production text and compiles it:

  • from vk_draw.cpp: dynamic_state(), dyn_pack(), the switch's mode and check functions, CmdBound, and draw()'s pipeline bind and vertex-stream block;
  • from vk_replay.cpp: the state cases of replay(), payload() and use_queue_state();
  • vk_state.h's NvnState, and draw_dyn_lean.h whole.

Only the Vulkan commands, the buffer lookup, the bind stamp and the host are stand-ins. Each Vulkan command is logged with its arguments.

  • Directed checks. A draw identical to the one before packs nothing, reads no bind stamp and records no command. Each of these makes the next draw work its state out again, and the draw after that skip again:
    • every replayed state op (all 17 variants);
    • a queue switch, a recording start, a masked clear;
    • each Targets field, including color_format[5]/[7] past n and a depth format without its texture;
    • topology, mesh, write masks (including signature bits past 32), the debug switches;
    • pipeline hooks by shape and by program, a dump, a bind-stamp change, a fallback pipeline.
  • Random traces (2 seeds × 12,000 draws). Modes 0, 1, check, and HOS_AB flips 0/1 and 1/check record the same Vulkan commands, draw by draw. =check finds 5,591–6,123 dynamic-state hits and 3,857–5,046 vertex-stream hits, with 0 mismatches. Compared with mode 0, =1 packs and reads the stamp exactly once less for each of those hits.
  • Undoing the production fast path fails the test. There are 30 edits of the production text, and each one is compiled and must fail:
    • undo_dyn_fast_path turns off the O(1) return (your example). It fails over 70 checks, starting with "an identical draw packs no dynamic state". undo_vbuf_fast_path fails a similar number.
    • The others drop one key field each (generation, targets, topology, write masks, mesh, switches, 32-bit write masks, and four parts of targets_dyn_sig), break bump_dyn/bump_vbuf, or remove the bump from each replay() case and from use_queue_state(). All 30 are caught.
  • The test also fails if a replay() case it doesn't run starts writing a field that dyn_pack() or the vertex block reads.

L3: done. There is no MUTANT variable any more: each mutant is a source edit compiled separately. The compiled check runs with every RX_ variable removed from the caller's environment, because the cut code reads RX_VK_DRAW_DYN_LEAN and RX_VK_FOOTPRINT*.

L4: not done. I haven't measured base against head at player settings. The numbers in the description compare on and off in one older build, at 50% internal resolution with FPS uncapped. This round made no game runs and no renderer build (the PC's GPU is shared). This still needs interleaved base-vs-head runs at normal resolution and Auto quality, in the target area and a heavy one. I've added it to Still to test.

L5: not done. Only Windows on an RTX 4060 has run, both the live =check parity run and the A/B. Linux RADV, AMD on Windows and Steam Deck still need RX_VK_DRAW_DYN_LEAN=check parity sweeps and performance comparisons, from the farm or someone with that hardware. Still to test now says so.

Tested (this round, Windows 11, llvm-mingw clang++/g++): I ran the PR's 19 checks one by one through dev.py queue, each as python -I -B tests/<check>.py with its RUN_ALL_ARGS. All 19 passed:
test_vk_draw_dyn_lean, test_thinlto_tls, test_tls_objects, test_fallback_pipeline_state, test_hos_ab, test_program_hooks, test_switch_table, test_same_dyn, test_same_draw, test_draw_binds, test_push_state, test_desc_counts, test_vertex_bind, test_vertex_bind_range, test_vk_cmd_fast, test_recorder_parts, test_inline_write_order, test_replay_write_order, test_vk_braces.

tests/run_all.py itself doesn't start on this PC: its shader step fails to link because MSVC link.exe is missing. That's why the checks ran one by one.

Rebased onto `origin/main @ b4d56f526` and pushed `48ff07500` (the rebased PR commit `8b028cd7b`, then one commit for L1–L3). The branch merges cleanly into today's `origin/main` (9a1f19b46). **Rebase.** The conflicts came from #2822 (the mods' pipeline hooks in `dynamic_state()`) and from the `RX_VK_DMABUF_PIECE_MB` row that left `switches.def`. Both sides are kept. Main's hook conditions are now one `reusable` term (`gpu/vk/vk_draw.cpp:7389`). It means no dump, no pipeline hook by program, and the hooks' generation the state was made under. The O(1) skip (`can_skip_dyn`, :7399) and the packed comparison (`same_packed`) both require it. `hooks_gen` sits with the other keys in `DynFast` (:7147). A hook by shape depends on the target's n, depth, width and height, and all of those are in `at_sig`. **L1 (blocking): done.** - All four inline thread_locals in `gpu/vk/draw_dyn_lean.h` are now `constinit` (lines 14, 18, 24, 34). - `tests/test_thinlto_tls.py` now compiles that header into both of its translation units, natively and with `-flto=thin -fuse-ld=lld`. It checks: - each variable has the same address from either file; - a bump made in one file is seen in the other; - a new thread gets its own copies at the constant initializers. - It also fails if an inline `thread_local` in that header has no `constinit`. **L2: done.** `tests/test_vk_draw_dyn_lean.py` no longer models the decisions. It cuts the production text and compiles it: - from `vk_draw.cpp`: `dynamic_state()`, `dyn_pack()`, the switch's mode and check functions, `CmdBound`, and `draw()`'s pipeline bind and vertex-stream block; - from `vk_replay.cpp`: the state cases of `replay()`, `payload()` and `use_queue_state()`; - `vk_state.h`'s `NvnState`, and `draw_dyn_lean.h` whole. Only the Vulkan commands, the buffer lookup, the bind stamp and the host are stand-ins. Each Vulkan command is logged with its arguments. - **Directed checks.** A draw identical to the one before packs nothing, reads no bind stamp and records no command. Each of these makes the next draw work its state out again, and the draw after that skip again: - every replayed state op (all 17 variants); - a queue switch, a recording start, a masked clear; - each Targets field, including `color_format[5]`/`[7]` past `n` and a depth format without its texture; - topology, mesh, write masks (including signature bits past 32), the debug switches; - pipeline hooks by shape and by program, a dump, a bind-stamp change, a fallback pipeline. - **Random traces** (2 seeds × 12,000 draws). Modes 0, 1, check, and HOS_AB flips 0/1 and 1/check record the same Vulkan commands, draw by draw. `=check` finds 5,591–6,123 dynamic-state hits and 3,857–5,046 vertex-stream hits, with 0 mismatches. Compared with mode 0, `=1` packs and reads the stamp exactly once less for each of those hits. - **Undoing the production fast path fails the test.** There are 30 edits of the production text, and each one is compiled and must fail: - `undo_dyn_fast_path` turns off the O(1) return (your example). It fails over 70 checks, starting with "an identical draw packs no dynamic state". `undo_vbuf_fast_path` fails a similar number. - The others drop one key field each (generation, targets, topology, write masks, mesh, switches, 32-bit write masks, and four parts of `targets_dyn_sig`), break `bump_dyn`/`bump_vbuf`, or remove the bump from each `replay()` case and from `use_queue_state()`. All 30 are caught. - The test also fails if a `replay()` case it doesn't run starts writing a field that `dyn_pack()` or the vertex block reads. **L3: done.** There is no `MUTANT` variable any more: each mutant is a source edit compiled separately. The compiled check runs with every `RX_` variable removed from the caller's environment, because the cut code reads `RX_VK_DRAW_DYN_LEAN` and `RX_VK_FOOTPRINT*`. **L4: not done.** I haven't measured base against head at player settings. The numbers in the description compare on and off in one older build, at 50% internal resolution with FPS uncapped. This round made no game runs and no renderer build (the PC's GPU is shared). This still needs interleaved base-vs-head runs at normal resolution and Auto quality, in the target area and a heavy one. I've added it to Still to test. **L5: not done.** Only Windows on an RTX 4060 has run, both the live `=check` parity run and the A/B. Linux RADV, AMD on Windows and Steam Deck still need `RX_VK_DRAW_DYN_LEAN=check` parity sweeps and performance comparisons, from the farm or someone with that hardware. Still to test now says so. **Tested (this round, Windows 11, llvm-mingw clang++/g++):** I ran the PR's 19 checks one by one through `dev.py queue`, each as `python -I -B tests/<check>.py` with its `RUN_ALL_ARGS`. All 19 passed: `test_vk_draw_dyn_lean`, `test_thinlto_tls`, `test_tls_objects`, `test_fallback_pipeline_state`, `test_hos_ab`, `test_program_hooks`, `test_switch_table`, `test_same_dyn`, `test_same_draw`, `test_draw_binds`, `test_push_state`, `test_desc_counts`, `test_vertex_bind`, `test_vertex_bind_range`, `test_vk_cmd_fast`, `test_recorder_parts`, `test_inline_write_order`, `test_replay_write_order`, `test_vk_braces`. `tests/run_all.py` itself doesn't start on this PC: its shader step fails to link because MSVC `link.exe` is missing. That's why the checks ran one by one.
Owner

@review
@beanstalk

@review @beanstalk
Member
Beanstalk test farm · an earlier run: commit 48ff075 (the newer results are in a comment below)

Commit 48ff075 · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The 15% regression limits cannot confirm the claimed 0.86% gain; the farm does not measure the reported replay command and draw timings or run the requested unit-test suite.
⚠️ Note: Check mode reports mismatches but this plan does not require a periodic summary, so a run without a mismatch line alone does not prove that parity checks were exercised.
⚠️ Note: The fixed CPU-oriented settings do not reproduce player-selected Auto quality or the Deck's clock settings.

Summary, written by AI (gpt-6.1-terra) from the numbers below:

The change could not be judged on any target: nvidia, windows+nvidia, amd, windows+amd, linux+radv, intel, and steamdeck all reported errors. Every report encountered the same baseline tools.lock error on the SDL URLs before producing scenario results, so there are no performance or parity numbers to compare. Steam Deck has two error reports, although the test description also says it is waiting for an online tester.

Done (started 06:39 UTC, last report 23:25 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
nvidia ⚠️ couldn't be judged 2 1 2 — — none
windows+nvidia ⚠️ couldn't be judged 2 1 2 — — none
amd ⚠️ couldn't be judged 2 1 2 — — none
windows+amd ⚠️ couldn't be judged 2 1 2 — — none
linux+radv ⚠️ couldn't be judged 2 1 2 — — none
intel ⚠️ couldn't be judged 2 1 2 — — none
steamdeck ⚠️ couldn't be judged 2 1 2 — — none

Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.

  • nvidia, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • nvidia, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • windows+nvidia, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • windows+nvidia, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • amd, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • amd, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • windows+amd, report 1: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • windows+amd, report 2: main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's
  • and 6 more, in the reports
What was tested

What will be tested · AI plan (gpt-6.1-terra)

The farm will compare main and the PR in Market and Kokiri Forest, with three 30-second samples per place and side at fixed, uncapped CPU-oriented settings. A separate check-mode sweep will look for dynamic-state and vertex-buffer parity mismatches; still-scene pictures will also be compared. Crashes, reported mismatches, excessive picture differences, or frame-time regressions over 15% fail the plan. The Steam Deck target will wait for an online tester. No tester online now matches steamdeck: that target waits for one.

  • Where: nvidia (1-2 reports), windows+nvidia (1-2 reports), amd (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports), steamdeck (1-2 reports).
  • Matrix: 1 cell, each on main and the PR: RX_VK_DRAW_DYN_LEAN check (PR only).
  • replay-performance: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 30 s (after 10 s warm-up), teleport to Kokiri Forest, take the picture forest to compare with main, measure forest for 30 s (after 10 s warm-up); 3 runs on each side.
  • parity-sweep: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0), then teleport to Market, teleport to Kokiri Forest; 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame time (p99) in forest is more than 15% above main; or frame time (worst 1%) in forest is more than 15% above main; or frame time (p99) in market is more than 15% above main; or frame time (worst 1%) in market is more than 15% above main; or a picture differs from main by more than 20%; or forbidden log lines is above 0.
  • Time: about 51 min of game runs per tester (8 game starts), plus the two builds.
Measurements on `nvidia`, for the PR description

Verdict: could not be judged on nvidia (2 reports).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss NVIDIA GeForce RTX 5090, 621.47.0 AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 4090, 621.40.0 13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on nvidia (2 reports).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 4090, 621.40.0` `13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
Measurements on `windows+nvidia`, for the PR description

Verdict: could not be judged on windows+nvidia (2 reports).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0 AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss NVIDIA GeForce RTX 5090, 621.47.0 AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on windows+nvidia (2 reports).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
Measurements on `amd`, for the PR description

Verdict: could not be judged on amd (2 reports).

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.3.1 AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on amd (2 reports).

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
Measurements on `windows+amd`, for the PR description

Verdict: could not be judged on windows+amd (2 reports).

Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM; 2: windows+amd+amd-proprietary+igpu+window+xess AMD Radeon(TM) Graphics, 2.0.279 AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on windows+amd (2 reports).

Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM`; 2: windows+amd+amd-proprietary+igpu+window+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
Measurements on `linux+radv`, for the PR description

Verdict: could not be judged on linux+radv (2 reports).

Hardware: 1: linux+amd+radv+igpu AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8 AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.3.1 AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+radv (2 reports).

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8` `AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
Measurements on `intel`, for the PR description

Verdict: could not be judged on intel (2 reports).

Hardware: 1: windows+intel+intel-proprietary+igpu+window Intel(R) UHD Graphics 630, 0.404.2115 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM; 2: linux+intel+anv+igpu Intel(R) Graphics (RKL GT1), 26.2.4 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on intel (2 reports).

Hardware: 1: windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`; 2: linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
Measurements on `steamdeck`, for the PR description

Verdict: could not be judged on steamdeck (2 reports).

Hardware: 1: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM; 2: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_DRAW_DYN_LEAN switch the PR adds (set on the PR side only) check not in main the PR's default parity-sweep, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on steamdeck (2 reports).

Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`  
Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested |
The testers' hardware
Target Report Ran on
nvidia 1 windows+nvidia+nvidia-proprietary+dgpu+window+dlss NVIDIA GeForce RTX 5090, 621.47.0 AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM
nvidia 2 windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 4090, 621.40.0 13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM
windows+nvidia 1 windows+nvidia+nvidia-proprietary+dgpu+window NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0 AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM
windows+nvidia 2 windows+nvidia+nvidia-proprietary+dgpu+window+dlss NVIDIA GeForce RTX 5090, 621.47.0 AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM
amd 1 linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.3.1 AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM
amd 2 linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
windows+amd 1 windows+amd+amd-proprietary+dgpu+window+fsr4 AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM
windows+amd 2 windows+amd+amd-proprietary+igpu+window+xess AMD Radeon(TM) Graphics, 2.0.279 AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM
linux+radv 1 linux+amd+radv+igpu AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8 AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM
linux+radv 2 linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.3.1 AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM
intel 1 windows+intel+intel-proprietary+igpu+window Intel(R) UHD Graphics 630, 0.404.2115 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM
intel 2 linux+intel+anv+igpu Intel(R) Graphics (RKL GT1), 26.2.4 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM
steamdeck 1 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM
steamdeck 2 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>48ff075</code> (the newer results are in a comment below)</summary> Commit `48ff075` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/3046) ⚠️ **Note:** The 15% regression limits cannot confirm the claimed 0.86% gain; the farm does not measure the reported replay command and draw timings or run the requested unit-test suite. ⚠️ **Note:** Check mode reports mismatches but this plan does not require a periodic summary, so a run without a mismatch line alone does not prove that parity checks were exercised. ⚠️ **Note:** The fixed CPU-oriented settings do not reproduce player-selected Auto quality or the Deck's clock settings. > **Summary**, written by AI (`gpt-6.1-terra`) from the numbers below: > > The change could not be judged on any target: nvidia, windows+nvidia, amd, windows+amd, linux+radv, intel, and steamdeck all reported errors. Every report encountered the same baseline tools.lock error on the SDL URLs before producing scenario results, so there are no performance or parity numbers to compare. Steam Deck has two error reports, although the test description also says it is waiting for an online tester. Done (started 06:39 UTC, last report 23:25 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `nvidia` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_003f0e289abddb99) [2](https://beanstalk.magicbean.dev/reports/rp_3815bc0ca023a2ed) | — | — | none | | `windows+nvidia` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_e9fb17b4f915fb9c) [2](https://beanstalk.magicbean.dev/reports/rp_93fc01047bfd7f99) | — | — | none | | `amd` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_32efa5475411e56d) [2](https://beanstalk.magicbean.dev/reports/rp_e0f0781cf893df4b) | — | — | none | | `windows+amd` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_98f1347aff859fdb) [2](https://beanstalk.magicbean.dev/reports/rp_dc3ded212aa541f8) | — | — | none | | `linux+radv` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_034b6f803b560bdd) [2](https://beanstalk.magicbean.dev/reports/rp_a4be6d359b85df08) | — | — | none | | `intel` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_0574623f40cb729f) [2](https://beanstalk.magicbean.dev/reports/rp_2ee96b604f7b0ccd) | — | — | none | | `steamdeck` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_aaa0deb7e1862d35) [2](https://beanstalk.magicbean.dev/reports/rp_8deb764d3694234a) | — | — | none | **Couldn't be judged**: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own. - `nvidia`, [report 1](https://beanstalk.magicbean.dev/reports/rp_003f0e289abddb99): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `nvidia`, [report 2](https://beanstalk.magicbean.dev/reports/rp_3815bc0ca023a2ed): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `windows+nvidia`, [report 1](https://beanstalk.magicbean.dev/reports/rp_e9fb17b4f915fb9c): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `windows+nvidia`, [report 2](https://beanstalk.magicbean.dev/reports/rp_93fc01047bfd7f99): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `amd`, [report 1](https://beanstalk.magicbean.dev/reports/rp_32efa5475411e56d): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `amd`, [report 2](https://beanstalk.magicbean.dev/reports/rp_e0f0781cf893df4b): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `windows+amd`, [report 1](https://beanstalk.magicbean.dev/reports/rp_98f1347aff859fdb): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - `windows+amd`, [report 2](https://beanstalk.magicbean.dev/reports/rp_dc3ded212aa541f8): `main's tools.lock: tools.lock line 32 (sdl): its first URLs are not Longshot's store's` - and 6 more, in the reports <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The farm will compare main and the PR in Market and Kokiri Forest, with three 30-second samples per place and side at fixed, uncapped CPU-oriented settings. A separate check-mode sweep will look for dynamic-state and vertex-buffer parity mismatches; still-scene pictures will also be compared. Crashes, reported mismatches, excessive picture differences, or frame-time regressions over 15% fail the plan. The Steam Deck target will wait for an online tester. No tester online now matches steamdeck: that target waits for one. - **Where:** nvidia (1-2 reports), windows+nvidia (1-2 reports), amd (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports), steamdeck (1-2 reports). - **Matrix:** 1 cell, each on main and the PR: RX_VK_DRAW_DYN_LEAN `check` (PR only). - **replay-performance:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`), then teleport to Market, take the picture market to compare with main, measure market for 30 s (after 10 s warm-up), teleport to Kokiri Forest, take the picture forest to compare with main, measure forest for 30 s (after 10 s warm-up); 3 runs on each side. - **parity-sweep:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`), then teleport to Market, teleport to Kokiri Forest; 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame time (p99) in forest is more than 15% above main; or frame time (worst 1%) in forest is more than 15% above main; or frame time (p99) in market is more than 15% above main; or frame time (worst 1%) in market is more than 15% above main; or a picture differs from main by more than 20%; or forbidden log lines is above 0. - **Time:** about 51 min of game runs per tester (8 game starts), plus the two builds. </details> <details><summary>Measurements on `nvidia`, for the PR description</summary> **Verdict:** could not be judged on nvidia (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 4090, 621.40.0` `13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on nvidia (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 4090, 621.40.0` `13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `windows+nvidia`, for the PR description</summary> **Verdict:** could not be judged on windows+nvidia (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on windows+nvidia (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `amd`, for the PR description</summary> **Verdict:** could not be judged on amd (2 reports). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on amd (2 reports). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `windows+amd`, for the PR description</summary> **Verdict:** could not be judged on windows+amd (2 reports). Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM`; 2: windows+amd+amd-proprietary+igpu+window+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on windows+amd (2 reports). Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM`; 2: windows+amd+amd-proprietary+igpu+window+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `linux+radv`, for the PR description</summary> **Verdict:** could not be judged on linux+radv (2 reports). Hardware: 1: linux+amd+radv+igpu `AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8` `AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+radv (2 reports). Hardware: 1: linux+amd+radv+igpu `AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8` `AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `intel`, for the PR description</summary> **Verdict:** could not be judged on intel (2 reports). Hardware: 1: windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`; 2: linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on intel (2 reports). Hardware: 1: windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`; 2: linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `steamdeck`, for the PR description</summary> **Verdict:** could not be judged on steamdeck (2 reports). Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on steamdeck (2 reports). Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` Scene: replay-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); parity-sweep, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); replay-performance: 3 game starts a side, market 30 s after 10 s warm-up, forest 30 s after 10 s warm-up; parity-sweep: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_DRAW_DYN_LEAN` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | parity-sweep, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_003f0e289abddb99) | windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM` | | `nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_3815bc0ca023a2ed) | windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 4090, 621.40.0` `13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM` | | `windows+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_e9fb17b4f915fb9c) | windows+nvidia+nvidia-proprietary+dgpu+window `NVIDIA GeForce RTX 3050 Ti Laptop GPU, 621.1.0` `AMD Ryzen 7 5800H with Radeon Graphics, 16 GB RAM` | | `windows+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_93fc01047bfd7f99) | windows+nvidia+nvidia-proprietary+dgpu+window+dlss `NVIDIA GeForce RTX 5090, 621.47.0` `AMD Ryzen 9 9950X3D 16-Core Processor, 48 GB RAM` | | `amd` | [1](https://beanstalk.magicbean.dev/reports/rp_32efa5475411e56d) | linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM` | | `amd` | [2](https://beanstalk.magicbean.dev/reports/rp_e0f0781cf893df4b) | linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | | `windows+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_98f1347aff859fdb) | windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM` | | `windows+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_dc3ded212aa541f8) | windows+amd+amd-proprietary+igpu+window+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM` | | `linux+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_034b6f803b560bdd) | linux+amd+radv+igpu `AMD Radeon 760M Graphics (RADV PHOENIX), 26.0.8` `AMD Ryzen 5 230 w/ Radeon 760M Graphics, 16 GB RAM` | | `linux+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_a4be6d359b85df08) | linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.3.1` `AMD Ryzen 5 7600X3D 6-Core Processor, 32 GB RAM` | | `intel` | [1](https://beanstalk.magicbean.dev/reports/rp_0574623f40cb729f) | windows+intel+intel-proprietary+igpu+window `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM` | | `intel` | [2](https://beanstalk.magicbean.dev/reports/rp_2ee96b604f7b0ccd) | linux+intel+anv+igpu `Intel(R) Graphics (RKL GT1), 26.2.4` `11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz, 128 GB RAM` | | `steamdeck` | [1](https://beanstalk.magicbean.dev/reports/rp_aaa0deb7e1862d35) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` | | `steamdeck` | [2](https://beanstalk.magicbean.dev/reports/rp_8deb764d3694234a) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` | </details> </details>
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The code and test fixes address the first three ledger items, but the performance gain against the merge base and coverage on other affected Tier 1 systems remain unverified. CI is still running. Recommend approval; not approved on the forge.

The change skips redundant Vulkan dynamic-state and vertex-stream work on repeated draws. It adds generation tracking, cache keys and parity checks; its player-setting performance benefit remains unproven.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4: The claimed gain has not been measured against the merge base at settings representative of players. When: The supplied runs compare on and off in an older PR build at 50% internal resolution and uncapped FPS; they do not establish the effect of the current head against its base at the device’s normal resolution and Auto quality. Do: Run interleaved base-versus-head measurements at player settings in the target and heavy areas, reporting average and 1% low FPS and frame times.
  • L5: The enabled-by-default replay change still needs coverage on the other affected Tier 1 systems. When: Only Windows NVIDIA live parity is reported, while the same fast skips run on Linux, AMD RADV and Steam Deck; the PR itself lists Linux parity as still to test. Do: Run game and check-mode parity sweeps and representative performance comparisons on the affected Windows and Linux Tier 1 configurations, including RADV and Steam Deck.

Since the last review (on 1500288e9d)
Resolved: L1 (The new namespace-scope inline thread-local variables omit the required constinit qualifie…); L2 (The parity harness models the fast-path decisions instead of executing the production deci…); L3 (The baseline harness inherits the MUTANT environment variable.)
Still open: L4 (The claimed gain has not been measured against the merge base at settings representative o…); L5 (The enabled-by-default replay change still needs coverage on the other affected Tier 1 sys…)

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven: the reported 0.86% FPS gain and 0.48%–1.22% confidence interval come from on/off measurements in one older build at 50% internal resolution, not merge base versus this head at representative player settings.

Other systems: The replay path affects Vulkan rendering across Windows and Linux, GPU vendors and Steam Deck. The reported live parity run covers Windows on an RTX 4060; Linux RADV, AMD Windows and Steam Deck runs remain outstanding.

Switches: RX_VK_DRAW_DYN_LEAN is added as a developer kill switch, default on; 0 selects the legacy comparisons and check validates fast-path parity. The default's performance benefit across player settings and affected systems remains unverified.

Reviewed: 48ff075008 against b4d56f5264: Read the repository rules, contribution guide, PR template, generation header, TLS test and relevant production diff; inspected the parity harness and related test and switch changes. The full large renderer files and parity harness were not read in full. The review checklist and neighboring Tooling AGENTS.md were unavailable.; nothing run (a code review).

Checked and fine:

  • The rebase preserves the pipeline-hook generation and by-program conditions in both dynamic-state comparison paths.
  • The TLS test checks cross-translation-unit identity and per-thread initialization.

Testing: No commands from the project were run. The author reports 19 checks passing on the rebased head, but no renderer build or game run after the rebase; CI is still running. The maintainer's Test Farm request could not be carried out under the read-only and closed-network constraints.

Overlaps and merge order: none found


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The code and test fixes address the first three ledger items, but the performance gain against the merge base and coverage on other affected Tier 1 systems remain unverified. CI is still running. Recommend approval; not approved on the forge. The change skips redundant Vulkan dynamic-state and vertex-stream work on repeated draws. It adds generation tracking, cache keys and parity checks; its player-setting performance benefit remains unproven. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The claimed gain has not been measured against the merge base at settings representative of players. *When:* The supplied runs compare on and off in an older PR build at 50% internal resolution and uncapped FPS; they do not establish the effect of the current head against its base at the device’s normal resolution and Auto quality. **Do:** Run interleaved base-versus-head measurements at player settings in the target and heavy areas, reporting average and 1% low FPS and frame times. - **L5**: The enabled-by-default replay change still needs coverage on the other affected Tier 1 systems. *When:* Only Windows NVIDIA live parity is reported, while the same fast skips run on Linux, AMD RADV and Steam Deck; the PR itself lists Linux parity as still to test. **Do:** Run game and check-mode parity sweeps and representative performance comparisons on the affected Windows and Linux Tier 1 configurations, including RADV and Steam Deck. **Since the last review** (on 1500288e9d5c) Resolved: L1 (The new namespace-scope inline thread-local variables omit the required constinit qualifie…); L2 (The parity harness models the fast-path decisions instead of executing the production deci…); L3 (The baseline harness inherits the MUTANT environment variable.) Still open: L4 (The claimed gain has not been measured against the merge base at settings representative o…); L5 (The enabled-by-default replay change still needs coverage on the other affected Tier 1 sys…) **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: the reported 0.86% FPS gain and 0.48%–1.22% confidence interval come from on/off measurements in one older build at 50% internal resolution, not merge base versus this head at representative player settings. **Other systems:** The replay path affects Vulkan rendering across Windows and Linux, GPU vendors and Steam Deck. The reported live parity run covers Windows on an RTX 4060; Linux RADV, AMD Windows and Steam Deck runs remain outstanding. **Switches:** RX_VK_DRAW_DYN_LEAN is added as a developer kill switch, default on; 0 selects the legacy comparisons and check validates fast-path parity. The default's performance benefit across player settings and affected systems remains unverified. **Reviewed:** 48ff07500851 against b4d56f526449: Read the repository rules, contribution guide, PR template, generation header, TLS test and relevant production diff; inspected the parity harness and related test and switch changes. The full large renderer files and parity harness were not read in full. The review checklist and neighboring Tooling AGENTS.md were unavailable.; nothing run (a code review). **Checked and fine:** - The rebase preserves the pipeline-hook generation and by-program conditions in both dynamic-state comparison paths. - The TLS test checks cross-translation-unit identity and per-thread initialization. **Testing:** No commands from the project were run. The author reports 19 checks passing on the rebased head, but no renderer build or game run after the rebase; CI is still running. The maintainer's Test Farm request could not be carried out under the read-only and closed-network constraints. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner

AMD Lab Market A/B: PR head 48ff07500851 merged onto main ee9e1ed76, using RX_VK_DRAW_DYN_LEAN=0 (A) and RX_VK_DRAW_DYN_LEAN=1 (B) on the same build.

Within the run-to-run spread. Median average FPS changed by -0.89%.

Metric A (0) B (1)
Average FPS, each capture 60.64 / 59.68 / 60.79 60.62 / 59.60 / 60.10
Average FPS, median 60.64 60.10
1% low FPS (1000 ÷ p99), median 51.18 51.56
Median frame time 16.44 ms 16.64 ms
p99 frame time, median 19.54 ms 19.40 ms
Frames of 50 ms or more, each capture 0 / 0 / 0 0 / 0 / 0

Market (child), headless Linux 7.3.3-1-cachyos, Core i7-9700K, Radeon RX 580 with Mesa RADV 3:26.2.6-1, 1280x720 output at 33% render scale, uncapped with V-Sync and frame generation off. Three alternating pairs, 60 seconds per capture after warm-up, each a timing job of the queue.

Time a frame (each capture) A B
Renderer's CPU thread (replay, submit) 9.34 / 9.62 / 9.39 ms 9.32 / 9.41 / 9.32 ms
GPU time 12.20 / 12.20 / 12.20 ms 12.20 / 12.40 / 12.60 ms

No difference on this PC beyond run-to-run noise, in fps or in the CPU thread's time (median 9.39 ms off, 9.32 ms on). The RX 580 lab can't be made cleanly CPU-bound, so the CPU thread row is the one to read for this change.

AMD Lab Market A/B: PR head `48ff07500851` merged onto `main` `ee9e1ed76`, using `RX_VK_DRAW_DYN_LEAN=0` (A) and `RX_VK_DRAW_DYN_LEAN=1` (B) on the same build. **Within the run-to-run spread.** Median average FPS changed by **-0.89%**. | Metric | A (`0`) | B (`1`) | |---|---:|---:| | Average FPS, each capture | 60.64 / 59.68 / 60.79 | 60.62 / 59.60 / 60.10 | | Average FPS, median | 60.64 | 60.10 | | 1% low FPS (1000 ÷ p99), median | 51.18 | 51.56 | | Median frame time | 16.44 ms | 16.64 ms | | p99 frame time, median | 19.54 ms | 19.40 ms | | Frames of 50 ms or more, each capture | 0 / 0 / 0 | 0 / 0 / 0 | Market (child), headless Linux 7.3.3-1-cachyos, Core i7-9700K, Radeon RX 580 with Mesa RADV 3:26.2.6-1, 1280x720 output at 33% render scale, uncapped with V-Sync and frame generation off. Three alternating pairs, 60 seconds per capture after warm-up, each a timing job of the queue. | Time a frame (each capture) | A | B | |---|---:|---:| | Renderer's CPU thread (replay, submit) | 9.34 / 9.62 / 9.39 ms | 9.32 / 9.41 / 9.32 ms | | GPU time | 12.20 / 12.20 / 12.20 ms | 12.20 / 12.40 / 12.60 ms | No difference on this PC beyond run-to-run noise, in fps or in the CPU thread's time (median 9.39 ms off, 9.32 ms on). The RX 580 lab can't be made cleanly CPU-bound, so the CPU thread row is the one to read for this change.
siantm force-pushed perf/vk-draw-dyn-lean from 48ff075008
Some checks reported errors
PR description / Title and description (pull_request_target) Successful in 6s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/nvidia 0/1 pass, 2 error
beanstalk/windows+nvidia 0/1 pass, 2 error
beanstalk/amd 0/1 pass, 2 error
beanstalk/windows+amd 0/1 pass, 2 error
beanstalk/linux+radv 0/1 pass, 2 error
beanstalk/intel 0/1 pass, 2 error
beanstalk/steamdeck 0/1 pass, 2 error
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
to 823a6107f1
Some checks are pending
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) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
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
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 6s
2026-12-05 09:26:32 +00:00
Compare
Member

Beanstalk test farm

Commit 823a610 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `823a610` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/3046) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
Contributor

Rebased onto current main: head 823a6107 on base 7bc53f84 (was 48ff0750 on b4d56f52). Mergeable again.

Rebase. The conflicts were with #3048 (RX_VK_DRAW_OVERHEAD_LEAN), which landed in the same places:

  • gpu/vk/switches.def, tests/test_hos_ab.py, the includes and draw_begin_recording() in gpu/vk/vk_draw.cpp: both sides kept (both switches, both *_begin_recording() calls).
  • draw()'s vertex-stream block: this PR's generation-guarded skip around main's slow path, with main's lean_bind_stamp() kept wherever main had it (the vstamp, vb_stamp, kept_vb and final stamp reads), so RX_VK_DRAW_OVERHEAD_LEAN still decides how the slow path reads the stamp. One consequence: with RX_VK_DRAW_OVERHEAD_LEAN on, lean_bind_stamp() returns g_bind_stamp_fast, so this PR's check mode compares the fast stamp with itself there; the fast stamp against gpu_bind_stamp() is then checked by RX_VK_DRAW_OVERHEAD_LEAN=check. With it at 0, this PR's check compares the two as before.
  • tests/test_vk_draw_dyn_lean.py: the production-skips harness got a lean_bind_stamp() stub (the =0 form, gpu_bind_stamp() itself), the same as tests/test_fallback_pipeline_state.py has on main. Folded into the second commit.

Checks run (Windows 11, llvm-mingw clang++, through the PC's job queue):

  • python -I -B tests/run_all.py --exact tests/test_vk_draw_dyn_lean.py tests/test_fallback_pipeline_state.py tests/test_hos_ab.py tests/test_thinlto_tls.py tests/test_draw_binds.py tests/test_vk_draw_overhead_lean.py tests/test_switch_table.py tests/test_tls_objects.py tests/test_switches_removed.py: 8 passed; test_vk_draw_dyn_lean.py failed to compile its production harness (no lean_bind_stamp in it), fixed as above.
  • python -I -B tests/run_all.py --exact tests/test_vk_draw_dyn_lean.py after the fix: passed (the parity harness, its randomized trace and the must-fail mutants).
  • No runtime build or game run for this rebase.

HumanBean's AMD Lab A/B (RX 580, Linux RADV, Market, 48ff0750 on ee9e1ed7, switch 0 against 1 on one build): within the run-to-run spread. Median average fps -0.89% (60.64 → 60.10), 1% low 51.18 → 51.56, p99 frame time 19.54 → 19.40 ms. The renderer's CPU thread median 9.39 ms off → 9.32 ms on (each capture 9.34 / 9.62 / 9.39 against 9.32 / 9.41 / 9.32). No measurable difference on that PC; as you note it is GPU-limited (12.2 ms GPU time), so it can't show the CPU-side gain either way. Thank you for running it.

L4 (base against head at player settings, average and 1% low) and L5 (game and check-mode parity sweeps on the other Tier 1 systems: Linux, RADV, Steam Deck): still open. I have only the one Windows RTX 4060 PC, so these need the farm or someone with that hardware. The AMD Lab run above is the only non-NVIDIA data so far, and it compares the switch on one build, not base against head.

Beanstalk: the 2026-12-04 run couldn't be judged on any target; every report stopped at main's tools.lock SDL URLs before measuring, so it says nothing about this PR either way. A re-run on the rebased head needs a BigBeans member to start it.

Rebased onto current main: head `823a6107` on base `7bc53f84` (was `48ff0750` on `b4d56f52`). Mergeable again. **Rebase.** The conflicts were with #3048 (`RX_VK_DRAW_OVERHEAD_LEAN`), which landed in the same places: - `gpu/vk/switches.def`, `tests/test_hos_ab.py`, the includes and `draw_begin_recording()` in `gpu/vk/vk_draw.cpp`: both sides kept (both switches, both `*_begin_recording()` calls). - `draw()`'s vertex-stream block: this PR's generation-guarded skip around main's slow path, with main's `lean_bind_stamp()` kept wherever main had it (the `vstamp`, `vb_stamp`, `kept_vb` and final stamp reads), so `RX_VK_DRAW_OVERHEAD_LEAN` still decides how the slow path reads the stamp. One consequence: with `RX_VK_DRAW_OVERHEAD_LEAN` on, `lean_bind_stamp()` returns `g_bind_stamp_fast`, so this PR's check mode compares the fast stamp with itself there; the fast stamp against `gpu_bind_stamp()` is then checked by `RX_VK_DRAW_OVERHEAD_LEAN=check`. With it at 0, this PR's check compares the two as before. - `tests/test_vk_draw_dyn_lean.py`: the production-skips harness got a `lean_bind_stamp()` stub (the `=0` form, `gpu_bind_stamp()` itself), the same as `tests/test_fallback_pipeline_state.py` has on main. Folded into the second commit. **Checks run** (Windows 11, llvm-mingw clang++, through the PC's job queue): - `python -I -B tests/run_all.py --exact tests/test_vk_draw_dyn_lean.py tests/test_fallback_pipeline_state.py tests/test_hos_ab.py tests/test_thinlto_tls.py tests/test_draw_binds.py tests/test_vk_draw_overhead_lean.py tests/test_switch_table.py tests/test_tls_objects.py tests/test_switches_removed.py`: 8 passed; `test_vk_draw_dyn_lean.py` failed to compile its production harness (no `lean_bind_stamp` in it), fixed as above. - `python -I -B tests/run_all.py --exact tests/test_vk_draw_dyn_lean.py` after the fix: passed (the parity harness, its randomized trace and the must-fail mutants). - No runtime build or game run for this rebase. **HumanBean's AMD Lab A/B** (RX 580, Linux RADV, Market, `48ff0750` on `ee9e1ed7`, switch 0 against 1 on one build): within the run-to-run spread. Median average fps -0.89% (60.64 → 60.10), 1% low 51.18 → 51.56, p99 frame time 19.54 → 19.40 ms. The renderer's CPU thread median 9.39 ms off → 9.32 ms on (each capture 9.34 / 9.62 / 9.39 against 9.32 / 9.41 / 9.32). No measurable difference on that PC; as you note it is GPU-limited (12.2 ms GPU time), so it can't show the CPU-side gain either way. Thank you for running it. **L4** (base against head at player settings, average and 1% low) and **L5** (game and check-mode parity sweeps on the other Tier 1 systems: Linux, RADV, Steam Deck): still open. I have only the one Windows RTX 4060 PC, so these need the farm or someone with that hardware. The AMD Lab run above is the only non-NVIDIA data so far, and it compares the switch on one build, not base against head. **Beanstalk**: the 2026-12-04 run couldn't be judged on any target; every report stopped at main's `tools.lock` SDL URLs before measuring, so it says nothing about this PR either way. A re-run on the rebased head needs a BigBeans member to start it.
Owner

AMD lab A/B/A/B, GPU-bound: main 7bc53f841 (A) against this PR's head 823a6107 merged onto it (B), two builds, the switch at its default. AMD lab PC: Linux 7.3.3-1-cachyos, Core i7-9700K, 15 GB RAM, Radeon RX 580 with Mesa RADV 3:26.2.6-1. Standing in the Market (child), 100 % render scale, headless, uncapped, V-Sync and frame generation off, 90 s per run after a 15 s warm-up, each a timing job in the queue.

No measurable difference when the GPU is the limit.

3840x2160, GPU-bound (card 95-96 % busy, about 38 ms of GPU time in a 41 ms frame):

A1 B1 A2 B2
Average fps 23.82 24.01 24.49 23.79
1 % low (1000 / p99) 20.9 21.3 21.9 21.5
Median frame 41.99 ms 41.75 ms 40.80 ms 42.11 ms
p99 frame 47.93 ms 47.00 ms 45.75 ms 46.50 ms
draw_ms, mean 6.12 6.06 6.08 6.01
cmds_ms, mean 1.96 1.90 1.99 1.89

1920x1080, not fully GPU-bound (about 15.5 ms of GPU time in a 19.5 ms frame):

A1 B1 A2 B2
Average fps 51.43 50.82 51.13 50.58
1 % low (1000 / p99) 45.8 44.9 44.8 44.5
Median frame 19.40 ms 19.60 ms 19.56 ms 19.70 ms
p99 frame 21.84 ms 22.28 ms 22.32 ms 22.45 ms
draw_ms, mean 6.03 6.01 6.11 6.16
cmds_ms, mean 1.92 1.89 1.96 1.93
  • At 4K the two pairs go opposite ways in fps. At 1080p B was about 1 % lower in both pairs, and the earlier lab run here (48ff0750, switch 0 against 1) showed -0.9 %. Too small to call a regression from these runs, and not a gain either.
  • cmds_ms was lower on B in all four pairs, by 0.03-0.10 ms, in the direction the description measured. With the GPU or the frame's pacing as the limit it doesn't become fps.
  • No Vulkan errors in the logs, no run flagged noisy.

Not covered: heavier areas, a player's Auto settings, a CPU-bound case, check mode, Steam Deck. Two runs per side, one view.

**AMD lab A/B/A/B, GPU-bound:** `main` `7bc53f841` (A) against this PR's head `823a6107` merged onto it (B), two builds, the switch at its default. AMD lab PC: Linux 7.3.3-1-cachyos, Core i7-9700K, 15 GB RAM, Radeon RX 580 with Mesa RADV 3:26.2.6-1. Standing in the Market (child), 100 % render scale, headless, uncapped, V-Sync and frame generation off, 90 s per run after a 15 s warm-up, each a timing job in the queue. **No measurable difference when the GPU is the limit.** 3840x2160, GPU-bound (card 95-96 % busy, about 38 ms of GPU time in a 41 ms frame): | | A1 | B1 | A2 | B2 | |---|---:|---:|---:|---:| | Average fps | 23.82 | 24.01 | 24.49 | 23.79 | | 1 % low (1000 / p99) | 20.9 | 21.3 | 21.9 | 21.5 | | Median frame | 41.99 ms | 41.75 ms | 40.80 ms | 42.11 ms | | p99 frame | 47.93 ms | 47.00 ms | 45.75 ms | 46.50 ms | | `draw_ms`, mean | 6.12 | 6.06 | 6.08 | 6.01 | | `cmds_ms`, mean | 1.96 | 1.90 | 1.99 | 1.89 | 1920x1080, not fully GPU-bound (about 15.5 ms of GPU time in a 19.5 ms frame): | | A1 | B1 | A2 | B2 | |---|---:|---:|---:|---:| | Average fps | 51.43 | 50.82 | 51.13 | 50.58 | | 1 % low (1000 / p99) | 45.8 | 44.9 | 44.8 | 44.5 | | Median frame | 19.40 ms | 19.60 ms | 19.56 ms | 19.70 ms | | p99 frame | 21.84 ms | 22.28 ms | 22.32 ms | 22.45 ms | | `draw_ms`, mean | 6.03 | 6.01 | 6.11 | 6.16 | | `cmds_ms`, mean | 1.92 | 1.89 | 1.96 | 1.93 | - At 4K the two pairs go opposite ways in fps. At 1080p B was about 1 % lower in both pairs, and the earlier lab run here (`48ff0750`, switch 0 against 1) showed -0.9 %. Too small to call a regression from these runs, and not a gain either. - `cmds_ms` was lower on B in all four pairs, by 0.03-0.10 ms, in the direction the description measured. With the GPU or the frame's pacing as the limit it doesn't become fps. - No Vulkan errors in the logs, no run flagged noisy. Not covered: heavier areas, a player's Auto settings, a CPU-bound case, check mode, Steam Deck. Two runs per side, one view.
dyst left a comment

Recommendation: Wait (on a base-against-head measurement of the current head at player settings, and one game run of this head). The code looks correct and I found nothing to change, but the gain is small and measured only as on/off inside an older build. The current head (two rebases later, including #2822's hooks in this same function) has had no renderer build and no game run.

For a player: less CPU work on the Vulkan replay thread for each draw. A draw whose dynamic state and vertex streams have not changed skips the packing and memcmp and the stream-array build. It records the same Vulkan commands, so nothing on screen should change. It makes the code a little more complex: every new writer of these NvnState fields must bump a generation.

Does it help: Unproven against main. The +0.86% fps (95% CI +0.48% to +1.22%, 149 periods, cmds_ms -5.37%) compares RX_VK_DRAW_DYN_LEAN=0 with =1 in one build (fe3d8427d, before the #2822 merge), on one RTX 4060, at 50% internal and uncapped. Its =0 side is not main. dynamic_state() builds at_sig (five mix64 rounds), wm_key, sw_sig and the key compares before it tests the mode (gpu/vk/vk_draw.cpp:7607-7617), and stores the keys after. So =0 pays a per-draw cost main doesn't, and the on/off delta overstates the gain over main. With about 3,000 dynamic_state() calls a frame, that cost could be a sizeable part of the CI's lower bound. The author's L4 (merge base against this head, interleaved, at player resolution and Auto quality, in Market and a heavy area) is still owed and decides this.
Other systems: CPU-only. When the keys are right, the command stream is identical on every vendor, OS and driver, so correctness can't differ by GPU. Only the size of the gain can, probably larger on the Deck's CPU. The farm run at 48ff075 couldn't be judged on any target (main's tools.lock SDL URLs, an infrastructure failure, not this PR). A =check sweep on another machine is still wanted but is not a blocker.
Switches: RX_VK_DRAW_DYN_LEAN, kill, default on (1), =0 legacy, =check parity, wired into HOS_AB and read at each recording's start. On is the right default for a CPU-side skip that records identical commands. Remove it (GONE) once settled.
Reviewed: 823a6107f against 7bc53f841. Read in full where changed: gpu/vk/draw_dyn_lean.h, the switches.def row, every vk_draw.cpp and vk_replay.cpp hunk. Also read the code they rely on: dyn_pack, the whole of dynamic_state (no early return between the pack and the key store), CmdBound::reset*, draw_state_disturbed, lean_bind_stamp, program_wm_sig, use_queue_state, NOP_BIND_STATE, every caller of draw/dynamic_state and every NvnState field write in gpu/vk. Skimmed: the four test files. Nothing run.
Fixed in this review: nothing.
Checked and fine:

  • Every field dyn_pack() reads from NvnState is written only in replay() cases that now bump (BIND_STATE kinds 0-5 cover blend, color, chmask, ms, poly and ds). The vertex block's vbuf/vstream are bumped too. The other NvnState writes in gpu/vk (vk_draw.cpp:3365-3375, vk_shader.cpp) are local states for pipeline builds that never reach dynamic_state(). The batch draw(cmd, s, batch) reuses the same s.
  • A queue switch (including a new queue state copied from *cur_state) and a recording start bump both generations. reset_keeping_index, reset (pre-bloom, stand-ins, draw_state_disturbed) and the fallback-pipeline drop clear the keys.
  • program_wm_sig uses bits 0-47, so sw_sig << 48 can't alias it. dump_on() and program hooks still block reuse through reusable, and shape hooks stay covered by hooks_gen plus at_sig.
  • at_sig is a 64-bit hash compared only with the previous draw's: a collision is negligible.
  • The thread_locals are constinit and trivial, and the ThinLTO test covers them.

Blocking
None in the code.

Suggestions

  1. gpu/vk/vk_draw.cpp:11996: the vertex skip compares the stored stamp with g_bind_stamp_fast directly. With RX_VK_DRAW_OVERHEAD_LEAN=0 (that kill switch's "use gpu_bind_stamp()" mode, lean_bind_stamp, :5008), this PR quietly brings back the dependence on the cached stamp. That kill switch should still remove it. Add draw_overhead_lean_mode != 0 to can_skip_vbuf, or take fast_stamp from lean_bind_stamp() in that mode.
  2. To make the on/off A/B like-for-like with main, compute at_sig/wm_key only when tl_mode != 0. The base-against-head run settles the question either way.
  3. Testing describes 48ff075. Add a line for 823a6107f (what ran on it), and a short =check run in game on this head, since #2822's reusable term is new since the measured build.

Testing: in game on Windows 11 with an RTX 4060, at fe3d8427d only: a 30 s =check run (13.9M checks, 0 mismatches) and the 5×90 s on/off A/B. At 48ff075: the PR's 19 checks one by one (not run_all.py or mise run test; CI not run). Missing: base against head at player settings (holds the merge), any build or run of 823a6107f, and a judged farm run.
Overlaps and merge order: #2958 (RX_VK_DRAW_SELF_FAST), #2959 (RX_VK_PIPE_VB_FAST, sparse vertex binding), #2981 (RX_VK_REPLAY_FAST, replay dispatch) and #2954 are the same author's per-draw fast paths in vk_draw.cpp's draw()/vertex block and replay(), and #2959 and #2981 are not mergeable now. Merge this first (it is mergeable and the smallest), then rebase those onto it, each re-measured against the new main. #3080 (neutral names, WIP) and #3116 (renderer split, WIP) will touch the same lines; they go after.

**Recommendation: Wait (on a base-against-head measurement of the current head at player settings, and one game run of this head).** The code looks correct and I found nothing to change, but the gain is small and measured only as on/off inside an older build. The current head (two rebases later, including #2822's hooks in this same function) has had no renderer build and no game run. For a player: less CPU work on the Vulkan replay thread for each draw. A draw whose dynamic state and vertex streams have not changed skips the packing and memcmp and the stream-array build. It records the same Vulkan commands, so nothing on screen should change. It makes the code a little more complex: every new writer of these `NvnState` fields must bump a generation. **Does it help:** Unproven against `main`. The +0.86% fps (95% CI +0.48% to +1.22%, 149 periods, `cmds_ms` -5.37%) compares `RX_VK_DRAW_DYN_LEAN=0` with `=1` in one build (fe3d8427d, before the #2822 merge), on one RTX 4060, at 50% internal and uncapped. Its `=0` side is not `main`. `dynamic_state()` builds `at_sig` (five `mix64` rounds), `wm_key`, `sw_sig` and the key compares before it tests the mode (`gpu/vk/vk_draw.cpp:7607-7617`), and stores the keys after. So `=0` pays a per-draw cost `main` doesn't, and the on/off delta overstates the gain over `main`. With about 3,000 `dynamic_state()` calls a frame, that cost could be a sizeable part of the CI's lower bound. The author's L4 (merge base against this head, interleaved, at player resolution and Auto quality, in Market and a heavy area) is still owed and decides this. **Other systems:** CPU-only. When the keys are right, the command stream is identical on every vendor, OS and driver, so correctness can't differ by GPU. Only the size of the gain can, probably larger on the Deck's CPU. The farm run at 48ff075 couldn't be judged on any target (main's `tools.lock` SDL URLs, an infrastructure failure, not this PR). A `=check` sweep on another machine is still wanted but is not a blocker. **Switches:** `RX_VK_DRAW_DYN_LEAN`, kill, default on (1), `=0` legacy, `=check` parity, wired into `HOS_AB` and read at each recording's start. On is the right default for a CPU-side skip that records identical commands. Remove it (`GONE`) once settled. **Reviewed:** 823a6107f against 7bc53f841. Read in full where changed: `gpu/vk/draw_dyn_lean.h`, the `switches.def` row, every `vk_draw.cpp` and `vk_replay.cpp` hunk. Also read the code they rely on: `dyn_pack`, the whole of `dynamic_state` (no early return between the pack and the key store), `CmdBound::reset*`, `draw_state_disturbed`, `lean_bind_stamp`, `program_wm_sig`, `use_queue_state`, `NOP_BIND_STATE`, every caller of `draw`/`dynamic_state` and every `NvnState` field write in `gpu/vk`. Skimmed: the four test files. Nothing run. **Fixed in this review:** nothing. **Checked and fine:** - Every field `dyn_pack()` reads from `NvnState` is written only in `replay()` cases that now bump (`BIND_STATE` kinds 0-5 cover blend, color, chmask, ms, poly and ds). The vertex block's `vbuf`/`vstream` are bumped too. The other `NvnState` writes in `gpu/vk` (`vk_draw.cpp:3365-3375`, `vk_shader.cpp`) are local states for pipeline builds that never reach `dynamic_state()`. The batch `draw(cmd, s, batch)` reuses the same `s`. - A queue switch (including a new queue state copied from `*cur_state`) and a recording start bump both generations. `reset_keeping_index`, `reset` (pre-bloom, stand-ins, `draw_state_disturbed`) and the fallback-pipeline drop clear the keys. - `program_wm_sig` uses bits 0-47, so `sw_sig << 48` can't alias it. `dump_on()` and program hooks still block reuse through `reusable`, and shape hooks stay covered by `hooks_gen` plus `at_sig`. - `at_sig` is a 64-bit hash compared only with the previous draw's: a collision is negligible. - The thread_locals are `constinit` and trivial, and the ThinLTO test covers them. **Blocking** None in the code. **Suggestions** 1. `gpu/vk/vk_draw.cpp:11996`: the vertex skip compares the stored stamp with `g_bind_stamp_fast` directly. With `RX_VK_DRAW_OVERHEAD_LEAN=0` (that kill switch's "use `gpu_bind_stamp()`" mode, `lean_bind_stamp`, :5008), this PR quietly brings back the dependence on the cached stamp. That kill switch should still remove it. Add `draw_overhead_lean_mode != 0` to `can_skip_vbuf`, or take `fast_stamp` from `lean_bind_stamp()` in that mode. 2. To make the on/off A/B like-for-like with `main`, compute `at_sig`/`wm_key` only when `tl_mode != 0`. The base-against-head run settles the question either way. 3. Testing describes 48ff075. Add a line for 823a6107f (what ran on it), and a short `=check` run in game on this head, since #2822's `reusable` term is new since the measured build. **Testing:** in game on Windows 11 with an RTX 4060, at fe3d8427d only: a 30 s `=check` run (13.9M checks, 0 mismatches) and the 5×90 s on/off A/B. At 48ff075: the PR's 19 checks one by one (not `run_all.py` or `mise run test`; CI not run). Missing: base against head at player settings (holds the merge), any build or run of 823a6107f, and a judged farm run. **Overlaps and merge order:** #2958 (`RX_VK_DRAW_SELF_FAST`), #2959 (`RX_VK_PIPE_VB_FAST`, sparse vertex binding), #2981 (`RX_VK_REPLAY_FAST`, replay dispatch) and #2954 are the same author's per-draw fast paths in `vk_draw.cpp`'s `draw()`/vertex block and `replay()`, and #2959 and #2981 are not mergeable now. Merge this first (it is mergeable and the smallest), then rebase those onto it, each re-measured against the new `main`. #3080 (neutral names, WIP) and #3116 (renderer split, WIP) will touch the same lines; they go after.
Some checks are pending
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) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
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
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 6s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
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 'perf/vk-draw-dyn-lean:siantm-perf/vk-draw-dyn-lean'
git switch 'siantm-perf/vk-draw-dyn-lean'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
6 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!3046
No description provided.