perf(vk): add RX_VK_DESC_SPAN_FAST pool-span cache, non-wiping tex_desc_memo, empty ub_overlay exit, and UBO skip #2952

Merged
HumanBean merged 2 commits from siantm/Longshot:perf/vk-span-memo-desc-fast into main 2026-12-02 18:00:17 +00:00
Contributor

Summary

Eliminates four per-draw CPU bottlenecks across buffer binding, descriptor memo invalidation, uniform overlay scanning, and UBO descriptor updates (RX_VK_DESC_SPAN_FAST, default 1, supporting in-run HOS_AB flipping per recording):

  1. 8-entry TLS Pool-Span Cache (gpu/vk/vk_memory.cpp): After O(1) bind_memo misses (keeping exact (guest, size) repeats lock-free and loop-free), span_memo_hit() resolves varying offsets/sizes inside active non-sparse read-only MIRROR_ON pools without taking pools_mu or calling pool_of(). Uses a single-stamp SpanMemoTable with O(1) stamp invalidation, O(1) swap-to-slot-0 promotion, and 64-hit batched relaxed p->heat updates flushed safely only on same-stamp eviction.
  2. Non-Wiping tex_desc_memo (gpu/vk/tex_desc_memo.h, gpu/vk/vk_draw.cpp): When registrations_generation() advances with sampler_registrations_generation() unchanged, sync_generations updates reg_gen without wiping valid cached slots. lookup() lazily verifies texture_slot_version(slot) once per generation (reg_checked) for touched entries; peek() verifies it when needed. slot_ver is sampled before texture resolution and checked again before storing to prevent store races.
  3. Empty ub_overlay Early Exit (gpu/vk/vk_replay.cpp): Returns UINT64_MAX immediately on first == lim before walking ub_gap_holds.
  4. Dirty-Tracked UBO Descriptor Skip (gpu/vk/vk_draw.cpp): Caches (addr, size, ub_gen, bind_stamp, cap_view) per dynamic UBO slot (3..18) inside DescWriter::UboEntry so unchanged UBO bindings skip uniform_range() and gpu_buffer_bind() calls completely across draws within the same state/generation.

Read first: gpu/vk/vk_memory.cpp (SpanMemoTable, gpu_buffer_bind), gpu/vk/tex_desc_memo.h (sync_generations_slow, lookup, peek), gpu/vk/vk_draw.cpp (update_ubo_descriptors), and gpu/vk/vk_replay.cpp (ub_overlay).

Assisted-by: Antigravity

Testing

Tested: Windows 11, NVIDIA GeForce RTX 4060 (build-windows/rt-Longshot, v3.2.0-189-ga3fb05aaf on main @ 55773e361):

  • Live Market (market, 30 s) with RX_VK_TEX_DESC_MEMO=check RX_VK_DESC_SPAN_FAST=1: 36,800,000+ checks, 35,552,727 hits (96.6%), 0 mismatches, 0 errors (2058 frames).
  • Market 5x90s CPU-bound in-run HOS_AB (145 periods): 0 crashes, 0 Vulkan/runtime errors, 0.00 frames >= 50 ms on both sides.
  • python -X utf8 -I tests/test_vk_desc_span_fast.py: PASS: span cache, non-wiping tex_desc_memo, empty ub_overlay, and UBO skip parity verified.
  • python -X utf8 -I tests/test_direct_buffer_writes.py: direct buffer writes: 11 cases, 0 failed.
  • python -X utf8 -I tests/test_hos_ab.py --cc clang: PASS (verified RX_VK_DESC_SPAN_FAST wired via host->ab_value).

Still to test:

  • Linux host compile, full test suite, and live gameplay parity check under RADV (@Beanstalk).

Measurements

Verdict: Faster: +1.37% FPS (-0.188 ms mean frame time, 95% CI +0.95% to +1.80% strictly excluding 0 across 145 paired periods), -6.95% desc_ms (-0.207 ms), and +1.44% 1% Low FPS (59.74 vs 58.89), with all 5/5 individual runs winning (-1.05% to -1.55%). Ships enabled by default (RX_VK_DESC_SPAN_FAST=1).

Setup: Windows 11, NVIDIA RTX 4060; Market, child (crowded) (1280x720, 50% internal res 768x432, V-Sync Off, Framegen Off, HOS_FPS_MAX=1000, RX_VK_FRAME_TRACE=1), 5x90s runs after pipeline warm-up (145 paired 3 s HOS_AB periods, 14,956 ON / 14,745 OFF frames; dev.py ab + perf.py ab).

Baseline: Both sides ran on the same build (v3.2.0-189-ga3fb05aaf on main @ 55773e361) flipping RX_VK_DESC_SPAN_FAST every 3 s within each run (HOS_AB=RX_VK_DESC_SPAN_FAST=0,3,0).

Metric Before, RX_VK_DESC_SPAN_FAST=0: this PR @ a3fb05aa After, RX_VK_DESC_SPAN_FAST unset: this PR @ a3fb05aa Δ
Avg FPS 72.80 73.82 +1.37%
Mean frame time 13.73 ms 13.54 ms -0.19 ms (95% CI +0.95%..+1.80%)
Median (P50) 13.47 ms (74.24 fps) 13.27 ms (75.30 fps) -0.20 ms (+1.43% fps)
1% Low (P99) 16.99 ms (58.89 fps) 16.79 ms (59.74 fps) -0.20 ms (+1.44% 1% Low)
desc_ms mean 2.973 ms 2.767 ms -0.207 ms (-6.95%)
draw_ms mean 8.003 ms 7.792 ms -0.212 ms (-2.65%)
cmds_ms mean 2.535 ms 2.533 ms -0.002 ms (-0.08%)
wait_gpu_ms mean 2.611 ms 2.444 ms -0.166 ms (-6.37%)
50 ms+ frames / min 0.00 0.00 +0.00

(Pooled 0.1% Low was 46.06 ON vs 48.92 OFF FPS due to 2 unrelated ~22–24 ms OS scheduling spikes in AB4/AB5 where draw_ms was 7.5–9.3 ms and desc_ms was 2.5–3.3 ms; p99 and desc_ms/cmds_ms/draw_ms all improved cleanly across all 5 runs.)

Risks

  • Low risk: SpanMemoTable caches Pool* only while gpu_bind_stamp() matches the active submission/pool generation and never caches sparse or non-MIRROR_ON pools; non-wiping tex_desc_memo checks per-slot slot_ver on reg_gen changes; update_ubo_descriptors skips only when (addr, size, ub_gen, bind_stamp, cap_view) are all unchanged.
  • The span cache, non-wiping memo, and UBO skip can be toggled off at runtime via RX_VK_DESC_SPAN_FAST=0. No save, cache, or shader stamp changes.

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 (targeted suites and live RX_VK_TEX_DESC_MEMO=check pass on Windows; full suite and Linux CI / @Beanstalk pending).
  • Measured against main, or Measurements says why there is nothing to measure (RX_VK_DESC_SPAN_FAST=0 vs unset via in-run HOS_AB on main @ 55773e361).
  • 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 (RX_VK_DESC_SPAN_FAST).
  • A check under tests/ that reads changed source is updated, not weakened (test_direct_buffer_writes.py).
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (Linux host compile pending).
  • 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 Eliminates four per-draw CPU bottlenecks across buffer binding, descriptor memo invalidation, uniform overlay scanning, and UBO descriptor updates (`RX_VK_DESC_SPAN_FAST`, default `1`, supporting in-run `HOS_AB` flipping per recording): 1. **8-entry TLS Pool-Span Cache (`gpu/vk/vk_memory.cpp`)**: After O(1) `bind_memo` misses (keeping exact `(guest, size)` repeats lock-free and loop-free), `span_memo_hit()` resolves varying offsets/sizes inside active non-sparse read-only `MIRROR_ON` pools without taking `pools_mu` or calling `pool_of()`. Uses a single-stamp `SpanMemoTable` with O(1) stamp invalidation, O(1) swap-to-slot-0 promotion, and 64-hit batched relaxed `p->heat` updates flushed safely only on same-stamp eviction. 2. **Non-Wiping `tex_desc_memo` (`gpu/vk/tex_desc_memo.h`, `gpu/vk/vk_draw.cpp`)**: When `registrations_generation()` advances with `sampler_registrations_generation()` unchanged, `sync_generations` updates `reg_gen` without wiping valid cached slots. `lookup()` lazily verifies `texture_slot_version(slot)` once per generation (`reg_checked`) for touched entries; `peek()` verifies it when needed. `slot_ver` is sampled before texture resolution and checked again before storing to prevent store races. 3. **Empty `ub_overlay` Early Exit (`gpu/vk/vk_replay.cpp`)**: Returns `UINT64_MAX` immediately on `first == lim` before walking `ub_gap_holds`. 4. **Dirty-Tracked UBO Descriptor Skip (`gpu/vk/vk_draw.cpp`)**: Caches `(addr, size, ub_gen, bind_stamp, cap_view)` per dynamic UBO slot (`3..18`) inside `DescWriter::UboEntry` so unchanged UBO bindings skip `uniform_range()` and `gpu_buffer_bind()` calls completely across draws within the same state/generation. Read first: `gpu/vk/vk_memory.cpp` (`SpanMemoTable`, `gpu_buffer_bind`), `gpu/vk/tex_desc_memo.h` (`sync_generations_slow`, `lookup`, `peek`), `gpu/vk/vk_draw.cpp` (`update_ubo_descriptors`), and `gpu/vk/vk_replay.cpp` (`ub_overlay`). Assisted-by: Antigravity ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 (`build-windows/rt-Longshot`, `v3.2.0-189-ga3fb05aaf` on `main @ 55773e361`): - Live Market (`market`, 30 s) with `RX_VK_TEX_DESC_MEMO=check RX_VK_DESC_SPAN_FAST=1`: `36,800,000+` checks, `35,552,727` hits (`96.6%`), **`0 mismatches`**, 0 errors (`2058` frames). - Market 5x90s CPU-bound in-run `HOS_AB` (`145` periods): 0 crashes, 0 Vulkan/runtime errors, `0.00` frames >= 50 ms on both sides. - `python -X utf8 -I tests/test_vk_desc_span_fast.py`: `PASS: span cache, non-wiping tex_desc_memo, empty ub_overlay, and UBO skip parity verified`. - `python -X utf8 -I tests/test_direct_buffer_writes.py`: `direct buffer writes: 11 cases, 0 failed`. - `python -X utf8 -I tests/test_hos_ab.py --cc clang`: `PASS` (verified `RX_VK_DESC_SPAN_FAST` wired via `host->ab_value`). **Still to test:** - Linux host compile, full test suite, and live gameplay parity check under RADV (`@Beanstalk`). ## Measurements **Verdict:** Faster: **+1.37% FPS** (`-0.188 ms` mean frame time, 95% CI **`+0.95% to +1.80%`** strictly excluding 0 across 145 paired periods), **`-6.95%` `desc_ms`** (`-0.207 ms`), and **`+1.44%` 1% Low FPS** (`59.74 vs 58.89`), with all 5/5 individual runs winning (`-1.05%` to `-1.55%`). Ships enabled by default (`RX_VK_DESC_SPAN_FAST=1`). Setup: Windows 11, NVIDIA RTX 4060; `Market, child (crowded)` (`1280x720`, 50% internal res `768x432`, V-Sync Off, Framegen Off, `HOS_FPS_MAX=1000`, `RX_VK_FRAME_TRACE=1`), 5x90s runs after pipeline warm-up (`145` paired 3 s `HOS_AB` periods, `14,956` ON / `14,745` OFF frames; `dev.py ab` + `perf.py ab`). Baseline: Both sides ran on the same build (`v3.2.0-189-ga3fb05aaf` on `main @ 55773e361`) flipping `RX_VK_DESC_SPAN_FAST` every 3 s within each run (`HOS_AB=RX_VK_DESC_SPAN_FAST=0,3,0`). | Metric | Before, RX_VK_DESC_SPAN_FAST=0: this PR @ a3fb05aa | After, RX_VK_DESC_SPAN_FAST unset: this PR @ a3fb05aa | Δ | |---|---:|---:|---:| | Avg FPS | 72.80 | 73.82 | **+1.37%** | | Mean frame time | 13.73 ms | 13.54 ms | **-0.19 ms (95% CI +0.95%..+1.80%)** | | Median (P50) | 13.47 ms (74.24 fps) | 13.27 ms (75.30 fps) | **-0.20 ms (+1.43% fps)** | | 1% Low (P99) | 16.99 ms (58.89 fps) | 16.79 ms (59.74 fps) | **-0.20 ms (+1.44% 1% Low)** | | `desc_ms` mean | 2.973 ms | 2.767 ms | **-0.207 ms (-6.95%)** | | `draw_ms` mean | 8.003 ms | 7.792 ms | **-0.212 ms (-2.65%)** | | `cmds_ms` mean | 2.535 ms | 2.533 ms | **-0.002 ms (-0.08%)** | | `wait_gpu_ms` mean | 2.611 ms | 2.444 ms | **-0.166 ms (-6.37%)** | | 50 ms+ frames / min | 0.00 | 0.00 | +0.00 | *(Pooled 0.1% Low was `46.06` ON vs `48.92` OFF FPS due to 2 unrelated ~22–24 ms OS scheduling spikes in AB4/AB5 where `draw_ms` was `7.5–9.3 ms` and `desc_ms` was `2.5–3.3 ms`; `p99` and `desc_ms`/`cmds_ms`/`draw_ms` all improved cleanly across all 5 runs.)* ## Risks - Low risk: `SpanMemoTable` caches `Pool*` only while `gpu_bind_stamp()` matches the active submission/pool generation and never caches sparse or non-`MIRROR_ON` pools; non-wiping `tex_desc_memo` checks per-slot `slot_ver` on `reg_gen` changes; `update_ubo_descriptors` skips only when `(addr, size, ub_gen, bind_stamp, cap_view)` are all unchanged. - The span cache, non-wiping memo, and UBO skip can be toggled off at runtime via `RX_VK_DESC_SPAN_FAST=0`. No save, cache, or shader stamp changes. ## 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. - [ ] `mise run test` passes (targeted suites and live `RX_VK_TEX_DESC_MEMO=check` pass on Windows; full suite and Linux CI / `@Beanstalk` pending). - [x] Measured against `main`, or Measurements says why there is nothing to measure (`RX_VK_DESC_SPAN_FAST=0` vs unset via in-run `HOS_AB` on `main @ 55773e361`). - [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` (`RX_VK_DESC_SPAN_FAST`). - [x] A check under `tests/` that reads changed source is updated, not weakened (`test_direct_buffer_writes.py`). - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths (Linux host compile pending). - [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): add RX_VK_DESC_SPAN_FAST pool-span cache, non-wiping tex_desc_memo, empty ub_overlay exit, and UBO skip
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 0/1 pass, 2 running, 0 queued
beanstalk/radv 0/1 pass, 2 running, 0 queued
beanstalk/amd 0/1 pass, 2 running, 0 queued
beanstalk/nvidia 0/1 pass, 2 running, 0 queued
beanstalk/intel 0/1 pass, 0 running, 2 queued
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
a3fb05aafe
Assisted-by: Antigravity
Author
Contributor

Tested in game: Market CPU-bound 5x90s in-run HOS_AB (145 periods): +1.37% FPS (73.8 vs 72.8, 95% CI +0.95%..+1.80%), -6.95% desc_ms, +1.44% 1% Low, RX_VK_TEX_DESC_MEMO=check 0 mismatches

Tested in game: Market CPU-bound 5x90s in-run HOS_AB (145 periods): +1.37% FPS (73.8 vs 72.8, 95% CI +0.95%..+1.80%), -6.95% desc_ms, +1.44% 1% Low, RX_VK_TEX_DESC_MEMO=check 0 mismatches
Owner

@beanstalk

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

Commit a3fb05a · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The run can catch substantial regressions but cannot reliably establish the claimed 1.37% speedup or measure descriptor-specific time.
⚠️ Note: The farm does not run the requested full test suite or the in-run switch-flipping and texture-memo mismatch checks in this plan.

Started at 15:20 UTC.

Estimate: done in about 2 h 45 min, from the queue and the testers online now; some jobs can't start yet.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
windows+nvidia 🔄 running 0 of 1 — — —
radv 🔄 running 0 of 1 — — —
amd 🔄 running 0 of 1 — — —
nvidia 🔄 running 0 of 1 — — —
intel ⏳ queued 0 of 1 — — —
What was tested

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

The farm will compare the PR with main on Windows NVIDIA, RADV, AMD, NVIDIA and Intel systems using three starts per side. Each start visits the Market and Hyrule Field, captures stationary pictures, and measures uncapped frame times for 30 seconds per place after warm-up at 1280x720. A crash, a picture difference above the allowed tolerance, or a frame-time regression above 15% fails the PR.

  • Where: windows+nvidia (1-2 reports), radv (1-2 reports), amd (1-2 reports), nvidia (1-2 reports), intel (1-2 reports).
  • descriptor-gameplay: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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 Hyrule Field, take the picture field to compare with main, measure field for 30 s (after 10 s warm-up); 3 runs on each side.
  • Measured: crashes, frame times, stutters and hitches.
  • The PR fails if: it crashes; or a picture differs from main by more than 20%; or median frame time is more than 15% above main; or frame time (p99) is more than 15% above main; or frame time (worst 1%) is more than 15% above main.
  • Time: about 39 min of game runs per tester (6 game starts), plus the two builds.
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>a3fb05a</code> (the newer results are in a comment below)</summary> Commit `a3fb05a` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2952) ⚠️ **Note:** The run can catch substantial regressions but cannot reliably establish the claimed 1.37% speedup or measure descriptor-specific time. ⚠️ **Note:** The farm does not run the requested full test suite or the in-run switch-flipping and texture-memo mismatch checks in this plan. Started at 15:20 UTC. **Estimate:** done in about 2 h 45 min, from the queue and the testers online now; some jobs can't start yet. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows+nvidia` | 🔄 running | 0 of 1 | — | — | — | | `radv` | 🔄 running | 0 of 1 | — | — | — | | `amd` | 🔄 running | 0 of 1 | — | — | — | | `nvidia` | 🔄 running | 0 of 1 | — | — | — | | `intel` | ⏳ queued | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The farm will compare the PR with main on Windows NVIDIA, RADV, AMD, NVIDIA and Intel systems using three starts per side. Each start visits the Market and Hyrule Field, captures stationary pictures, and measures uncapped frame times for 30 seconds per place after warm-up at 1280x720. A crash, a picture difference above the allowed tolerance, or a frame-time regression above 15% fails the PR. - **Where:** windows+nvidia (1-2 reports), radv (1-2 reports), amd (1-2 reports), nvidia (1-2 reports), intel (1-2 reports). - **descriptor-gameplay:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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 Hyrule Field, take the picture field to compare with main, measure field for 30 s (after 10 s warm-up); 3 runs on each side. - **Measured:** crashes, frame times, stutters and hitches. - **The PR fails if:** it crashes; or a picture differs from main by more than 20%; or median frame time is more than 15% above main; or frame time (p99) is more than 15% above main; or frame time (worst 1%) is more than 15% above main. - **Time:** about 39 min of game runs per tester (6 game starts), plus the two builds. </details> </details>
Owner
@review
BeanBot left a comment

Recommendation: Approve. The span cache drops batched heat at submission boundaries, changing mirror selection on memory-constrained GPUs. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change caches pool spans and texture descriptors, avoids empty overlay scans, and skips unchanged UBO resolution. It reports a small CPU-bound gain, but adds cache invalidation and mirror-policy risks that need correction and measurement.

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

  • L1 gpu/vk/vk_memory.cpp:5495: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. (more on the line) Do: Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test.
  • L4: The checklist says the full test task passed, but the testing section reports only targeted suites and says the full suite is still to test. When: A reviewer reading the checked mise run test box would be told the full task passed despite the stated remaining work. Do: Untick the box until the full task passes and record its result.

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

  • L2: Measure the complete change against the base at settings players use. When: The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. Do: Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread.
  • L3: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. When: Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. Do: Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene.

@fix can do L1 and L4.

Checks: Still running: 10 checks.

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

Does it help: Unproven against the base: the reported five paired runs on Windows RTX 4060 show +1.37% average FPS and +1.44% 1% low with the switch on versus off in the PR build. The switch-off path still contains changes, and the low-resolution setup does not establish the gain at players’ normal settings.

Other systems: The changed paths run on both Windows and Linux, across GPU vendors, including Intel’s uniform-snapshot path and low-VRAM mirror selection. Windows NVIDIA gameplay was reported; AMD, Linux NVIDIA, RADV and Steam Deck gameplay remain unreported.

Switches: RX_VK_DESC_SPAN_FAST is added as a kill switch, default on, with a switches.def row and recording-boundary HOS_AB support. Its default has only been measured on one Windows NVIDIA setup; the off mode does not restore every base-path change.

Reviewed: a3fb05aafe against 55773e3613: Read repository rules, the PR template, standards, commit and all changed production hunks, including tex_desc_memo.h in full, and traced the surrounding UBO, memory, registration and descriptor paths. Read the new test’s fixture and runner, and the other test changes; skimmed unrelated portions of the large changed production and test files. docs/review-checklist.md and the sibling Tooling checkout were absent.; nothing run (a code review).

Checked and fine:

  • The commit records its AI assistance trailer.
  • The new switch has a table row, and the renderer API and shaders are unchanged.
  • The span lookup checks zero length and unsigned range overflow before accepting a hit.
  • Texture memo entries check the slot version after a registration-generation change, and sampler-generation changes invalidate the table.

Testing: No code or tests were run, as requested. The supplied Windows gameplay and targeted-test results were read; CI is still running.

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


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

**Recommendation: Approve.** The span cache drops batched heat at submission boundaries, changing mirror selection on memory-constrained GPUs. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change caches pool spans and texture descriptors, avoids empty overlay scans, and skips unchanged UBO resolution. It reports a small CPU-bound gain, but adds cache invalidation and mirror-policy risks that need correction and measurement. **Should fix (2)**: not blocking, but worth doing before merging. - **L1** `gpu/vk/vk_memory.cpp:5495`: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. (more on the line) **Do:** Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test. - **L4**: The checklist says the full test task passed, but the testing section reports only targeted suites and says the full suite is still to test. *When:* A reviewer reading the checked mise run test box would be told the full task passed despite the stated remaining work. **Do:** Untick the box until the full task passes and record its result. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: Measure the complete change against the base at settings players use. *When:* The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. **Do:** Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread. - **L3**: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. *When:* Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. **Do:** Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene. `@fix` can do L1 and L4. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the base: the reported five paired runs on Windows RTX 4060 show +1.37% average FPS and +1.44% 1% low with the switch on versus off in the PR build. The switch-off path still contains changes, and the low-resolution setup does not establish the gain at players’ normal settings. **Other systems:** The changed paths run on both Windows and Linux, across GPU vendors, including Intel’s uniform-snapshot path and low-VRAM mirror selection. Windows NVIDIA gameplay was reported; AMD, Linux NVIDIA, RADV and Steam Deck gameplay remain unreported. **Switches:** RX_VK_DESC_SPAN_FAST is added as a kill switch, default on, with a switches.def row and recording-boundary HOS_AB support. Its default has only been measured on one Windows NVIDIA setup; the off mode does not restore every base-path change. **Reviewed:** a3fb05aafe5d against 55773e36136a: Read repository rules, the PR template, standards, commit and all changed production hunks, including tex_desc_memo.h in full, and traced the surrounding UBO, memory, registration and descriptor paths. Read the new test’s fixture and runner, and the other test changes; skimmed unrelated portions of the large changed production and test files. docs/review-checklist.md and the sibling Tooling checkout were absent.; nothing run (a code review). **Checked and fine:** - The commit records its AI assistance trailer. - The new switch has a table row, and the renderer API and shaders are unchanged. - The span lookup checks zero length and unsigned range overflow before accepting a hit. - Texture memo entries check the slot version after a registration-generation change, and sampler-generation changes invalidate the table. **Testing:** No code or tests were run, as requested. The supplied Windows gameplay and targeted-test results were read; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -5471,0 +5492,4 @@
if (span_memo_tbl.stamp != stamp) {
span_memo_tbl.stamp = stamp;
span_memo_tbl.count = 0;
span_memo_tbl.evict_idx = 0;
Member

L1 (should fix): Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision.

When: A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory.

Do: Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test.

**L1** (should fix): Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. *When:* A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. **Do:** Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test.
Owner
@fix
BeanBot force-pushed perf/vk-span-memo-desc-fast from a3fb05aafe
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 0/1 pass, 2 running, 0 queued
beanstalk/radv 0/1 pass, 2 running, 0 queued
beanstalk/amd 0/1 pass, 2 running, 0 queued
beanstalk/nvidia 0/1 pass, 2 running, 0 queued
beanstalk/intel 0/1 pass, 0 running, 2 queued
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 a583c817c3
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 9s
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Failing after 11s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 15s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 4m19s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m28s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 8m50s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 7m10s
CI / Website build and checks (pull_request) Failing after 35s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 28m25s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 45m43s
2026-12-01 15:42:25 +00:00
Compare
Member

Beanstalk test farm

Commit f345491 · 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 `f345491` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2952) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
BeanBot left a comment

Recommendation: Approve. The span cache still loses pending pool heat at stamp changes, and the net performance gain and behavior on remaining Tier 1 systems remain unmeasured. The reported Windows A/B result is promising but does not measure the complete change against the base. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is a583c817c3. I rebased it onto main (c88b4f3d15). I edited its description to match the change.

Not done

  • Preserve span-cache heat across submissions: A safe fix needs to make pending heat visible before mirror selection while coordinating thread-local caches with pool invalidation and lifetime, and add coverage for repeated short submissions. I did not find a complete fix that preserves the batched fast path.

Nothing was built or run: the checks run again on the new head.

The change reduces descriptor and buffer-binding work during rendering. It adds caching complexity and can undercount mirror-pool heat; the reported in-run comparison shows lower descriptor time on one Windows NVIDIA system.

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

  • L1 gpu/vk/vk_memory.cpp:5495: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. When: A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. Do: Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test.

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

  • L2: Measure the complete change against the base at settings players use. When: The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. Do: Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread.
  • L3: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. When: Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. Do: Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene.

@fix can do L1.

Checks: they run again on this head; a failure shows on the pull request.

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

Does it help: Unproven for the complete change: the reported five Windows RTX 4060 runs show +1.37% FPS and +1.44% 1% low with the switch on versus off in the same PR build, but do not compare the complete PR with its base.

Other systems: The changed renderer paths can affect Vulkan drivers and memory-budget decisions on Windows and Linux, including AMD, Intel and Steam Deck systems. The supplied results cover Windows on NVIDIA; remaining Tier 1 gameplay and performance runs are pending.

Switches: RX_VK_DESC_SPAN_FAST is added as a developer kill switch, default on. The same-build A/B favors on in the reported scenario, but base-versus-head and remaining hardware measurements are needed to establish the default's net effect.

Reviewed: a583c817c3 against c88b4f3d15: Read repository guidance and the pull request template, the relevant renderer diff, span-cache heat accounting and mirror-selection references, the revised description, and the supplied review evidence. The full changed source files and test files were not read in full; recorded runs were reviewed from the description.; nothing run (a code review).

Checked and fine:

  • The revised description no longer claims the full test task passed.
  • The fix diff is empty and does not remove the pull request's optimizations.

Testing: The author reports Windows NVIDIA gameplay and targeted checks; Linux compilation, the full suite, and RADV gameplay remain pending. No commands from the project were run in this review.

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


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

**Recommendation: Approve.** The span cache still loses pending pool heat at stamp changes, and the net performance gain and behavior on remaining Tier 1 systems remain unmeasured. The reported Windows A/B result is promising but does not measure the complete change against the base. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is a583c817c3ad. I rebased it onto `main` (c88b4f3d1573). I edited its description to match the change. **Not done** - **Preserve span-cache heat across submissions**: A safe fix needs to make pending heat visible before mirror selection while coordinating thread-local caches with pool invalidation and lifetime, and add coverage for repeated short submissions. I did not find a complete fix that preserves the batched fast path. Nothing was built or run: the checks run again on the new head. The change reduces descriptor and buffer-binding work during rendering. It adds caching complexity and can undercount mirror-pool heat; the reported in-run comparison shows lower descriptor time on one Windows NVIDIA system. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `gpu/vk/vk_memory.cpp:5495`: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. *When:* A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. **Do:** Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: Measure the complete change against the base at settings players use. *When:* The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. **Do:** Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread. - **L3**: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. *When:* Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. **Do:** Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene. `@fix` can do L1. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the complete change: the reported five Windows RTX 4060 runs show +1.37% FPS and +1.44% 1% low with the switch on versus off in the same PR build, but do not compare the complete PR with its base. **Other systems:** The changed renderer paths can affect Vulkan drivers and memory-budget decisions on Windows and Linux, including AMD, Intel and Steam Deck systems. The supplied results cover Windows on NVIDIA; remaining Tier 1 gameplay and performance runs are pending. **Switches:** RX_VK_DESC_SPAN_FAST is added as a developer kill switch, default on. The same-build A/B favors on in the reported scenario, but base-versus-head and remaining hardware measurements are needed to establish the default's net effect. **Reviewed:** a583c817c3ad against c88b4f3d1573: Read repository guidance and the pull request template, the relevant renderer diff, span-cache heat accounting and mirror-selection references, the revised description, and the supplied review evidence. The full changed source files and test files were not read in full; recorded runs were reviewed from the description.; nothing run (a code review). **Checked and fine:** - The revised description no longer claims the full test task passed. - The fix diff is empty and does not remove the pull request's optimizations. **Testing:** The author reports Windows NVIDIA gameplay and targeted checks; Linux compilation, the full suite, and RADV gameplay remain pending. No commands from the project were run in this review. **Overlaps and merge order:** Not checked; network access is unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
Owner
@fix
Member

Nothing needed changing: the review's items are already done.

Not done

  • Preserve span-cache heat across stamp changes: A safe fix needs to account for pending heat from every recording thread before mirror selection while protecting pool lifetimes across retirement and eviction. I could not establish a complete fix that preserves the batched span-cache optimization; the repeated-short-submission test remains to be added.

For the author (no edit does these)

  • L1 gpu/vk/vk_memory.cpp:5495: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. When: A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. Do: Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test.
  • L2: Measure the complete change against the base at settings players use. When: The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. Do: Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread.
  • L3: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. When: Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. Do: Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene.

Nothing was pushed.


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

Nothing needed changing: the review's items are already done. **Not done** - **Preserve span-cache heat across stamp changes**: A safe fix needs to account for pending heat from every recording thread before mirror selection while protecting pool lifetimes across retirement and eviction. I could not establish a complete fix that preserves the batched span-cache optimization; the repeated-short-submission test remains to be added. **For the author** (no edit does these) - **L1** `gpu/vk/vk_memory.cpp:5495`: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. *When:* A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. **Do:** Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test. - **L2**: Measure the complete change against the base at settings players use. *When:* The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. **Do:** Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread. - **L3**: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. *When:* Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. **Do:** Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Member

#2952: Deck measurement

Measurements on a Steam Deck LCD (RADV VANGOGH, Mesa 26.2.0-devel, Vulkan 1.4, AC power, GPU clock pinned at 1600 MHz), 2026-12-01.

Build: base 87045899 plus a dev-pack of main (4908cc6d) with #2932, #2946 and #2952 merged (merge head e72783d7), renderer and host both from that tree. Settings per arm: 1280x800 output, the game's own upscaler, quality preset Custom/0, shadows 1, V-Sync off, no fps cap, no overlays. Route: slot 05 save, Hyrule Field anchor, 1,200 presents of warm-up, then three passes of walking, panning, full-stick turns and a walk-and-circle. Play window is 30-97 % of each frame trace. Arms are separate launches, interleaved in time, identical except for the switch set.

HOS_AB is not usable on this platform yet: the A/B thread does not start (ab: the A/B's thread did not start). Root cause: glibc refuses a thread stack smaller than the executable's static TLS block plus a guard page and a rest stack, and this host binary's block is 61,936 bytes, so the 64 KiB CreateThread request in host/hos_ab.c is refused with EINVAL. A fix (a CreateThread stack under the executable's static TLS block) is in review as #2971, so these numbers come from separate launches rather than the in-run A/B.

50 % render, stack of the three switches, 5 runs on against 4 off:

metric on off delta permutation p
fps 36.07 35.17 +0.90 (+2.57 %) 0.048
mean frame 27.74 ms 28.44 ms -0.71 ms (-2.48 %) 0.056
median frame 26.70 ms 27.50 ms -0.80 ms (-2.89 %) 0.008
p99 frame 52.6 ms 53.6 ms -2.0 % within spread
frames over 60 ms 0.63 % 0.64 % none within spread

Median ranges are separated (worst on-run 27.07 ms, best off-run 27.10 ms); fps ranges overlap. Run-to-run spread on this machine is 3-12 %, larger than the effect, so the medians are the firmer statement. p is an exact permutation test over run labels (all 126 splits of nine runs; 0.008 is the floor of that test).

Phase medians, two paired samples (ms, on against off): desc_ms 2.81/2.78 against 3.18 (-11.6 %/-12.6 %), programs_ms 1.45/1.44 against 1.62 (-10.5 %/-11.1 %), draw_ms 10.13/9.94 against 10.76 (-5.9 %/-7.6 %), cmds_ms 4.37/4.24 against 4.45 (-1.8 %/-4.7 %), game_ms unchanged in one sample and -6.0 % in the other (noise).

100 % render (the Deck's default), 3 runs a side: fps 31.34 against 30.67 (+2.21 %, p 0.15), median frame 31.12 against 31.34 ms (-0.22 ms, p 0.25). The host phases move the same way (desc_ms -7.5 to -10.4 %, programs_ms -8.9 to -12.1 %, draw_ms -2.9 to -6.8 %, render -1.8 to -2.7 %), but gpu_wait_ms rises by 0.91 to 1.01 ms (+36 to +42 %) in all three pairs, so at native resolution the host saving is largely spent waiting for the GPU. That is expected for a GPU-bound frame and is not a fault of the change.

Limits: one scene, one save, one machine; Deck LCD only; the switches were moved together, so this table does not separate the three PRs from each other. Raw traces are on my Deck and archived locally, available on request.

For this PR specifically: the pool-span cache and the non-wiping texture memo are measurable on their own. A build with #2952 and #2958 but without #2946 gives desc_ms -5.1 to -8.5 % across three paired samples (2.76-2.82 ms against 2.95-3.03 ms), so roughly half of what the full three-switch stack shows, with #2958 adding the draw_ms part.

#2952 merges cleanly with #2932, and with #2958 except in tests/test_hos_ab.py; it conflicts with #2954 in vk_draw.cpp.

## #2952: Deck measurement Measurements on a Steam Deck LCD (RADV VANGOGH, Mesa 26.2.0-devel, Vulkan 1.4, AC power, GPU clock pinned at 1600 MHz), 2026-12-01. Build: base `87045899` plus a dev-pack of `main` (`4908cc6d`) with #2932, #2946 and #2952 merged (merge head `e72783d7`), renderer and host both from that tree. Settings per arm: 1280x800 output, the game's own upscaler, quality preset Custom/0, shadows 1, V-Sync off, no fps cap, no overlays. Route: slot 05 save, Hyrule Field anchor, 1,200 presents of warm-up, then three passes of walking, panning, full-stick turns and a walk-and-circle. Play window is 30-97 % of each frame trace. Arms are separate launches, interleaved in time, identical except for the switch set. `HOS_AB` is not usable on this platform yet: the A/B thread does not start (`ab: the A/B's thread did not start`). Root cause: glibc refuses a thread stack smaller than the executable's static TLS block plus a guard page and a rest stack, and this host binary's block is 61,936 bytes, so the 64 KiB `CreateThread` request in `host/hos_ab.c` is refused with EINVAL. A fix (a `CreateThread` stack under the executable's static TLS block) is in review as #2971, so these numbers come from separate launches rather than the in-run A/B. **50 % render, stack of the three switches, 5 runs on against 4 off:** | metric | on | off | delta | permutation p | |---|---|---|---|---| | fps | 36.07 | 35.17 | +0.90 (+2.57 %) | 0.048 | | mean frame | 27.74 ms | 28.44 ms | -0.71 ms (-2.48 %) | 0.056 | | median frame | 26.70 ms | 27.50 ms | -0.80 ms (-2.89 %) | 0.008 | | p99 frame | 52.6 ms | 53.6 ms | -2.0 % | within spread | | frames over 60 ms | 0.63 % | 0.64 % | none | within spread | Median ranges are separated (worst on-run 27.07 ms, best off-run 27.10 ms); fps ranges overlap. Run-to-run spread on this machine is 3-12 %, larger than the effect, so the medians are the firmer statement. p is an exact permutation test over run labels (all 126 splits of nine runs; 0.008 is the floor of that test). Phase medians, two paired samples (ms, on against off): `desc_ms` 2.81/2.78 against 3.18 (-11.6 %/-12.6 %), `programs_ms` 1.45/1.44 against 1.62 (-10.5 %/-11.1 %), `draw_ms` 10.13/9.94 against 10.76 (-5.9 %/-7.6 %), `cmds_ms` 4.37/4.24 against 4.45 (-1.8 %/-4.7 %), `game_ms` unchanged in one sample and -6.0 % in the other (noise). **100 % render (the Deck's default), 3 runs a side:** fps 31.34 against 30.67 (+2.21 %, p 0.15), median frame 31.12 against 31.34 ms (-0.22 ms, p 0.25). The host phases move the same way (`desc_ms` -7.5 to -10.4 %, `programs_ms` -8.9 to -12.1 %, `draw_ms` -2.9 to -6.8 %, render -1.8 to -2.7 %), but `gpu_wait_ms` rises by 0.91 to 1.01 ms (+36 to +42 %) in all three pairs, so at native resolution the host saving is largely spent waiting for the GPU. That is expected for a GPU-bound frame and is not a fault of the change. Limits: one scene, one save, one machine; Deck LCD only; the switches were moved together, so this table does not separate the three PRs from each other. Raw traces are on my Deck and archived locally, available on request. For this PR specifically: the pool-span cache and the non-wiping texture memo are measurable on their own. A build with #2952 and #2958 but without #2946 gives `desc_ms` -5.1 to -8.5 % across three paired samples (2.76-2.82 ms against 2.95-3.03 ms), so roughly half of what the full three-switch stack shows, with #2958 adding the `draw_ms` part. #2952 merges cleanly with #2932, and with #2958 except in `tests/test_hos_ab.py`; it conflicts with #2954 in `vk_draw.cpp`.
Member

One caveat to add to the table above, from a second pass over the same traces: the size of the effect depends on where the trace is windowed. Trimming to 30-97 % gives +2.6 % fps and -2.9 % median frame; 20-90 % gives +3.7 % and -2.8 %; 40-99 % gives +1.4 % and -2.0 %. The direction is the same in all three, and I did not choose a window after the fact, but treat 2-3 % as a range rather than a point.

Two further limits worth naming: the arms ran in blocks (switch set A, then B) rather than strictly alternating, so thermal or cache drift cannot be separated from the switch set with these runs; and with nine runs the smallest attainable permutation p is 0.008, which is exactly the median's value, so that figure is the floor of the test rather than a precise probability.

One caveat to add to the table above, from a second pass over the same traces: the size of the effect depends on where the trace is windowed. Trimming to 30-97 % gives +2.6 % fps and -2.9 % median frame; 20-90 % gives +3.7 % and -2.8 %; 40-99 % gives +1.4 % and -2.0 %. The direction is the same in all three, and I did not choose a window after the fact, but treat 2-3 % as a range rather than a point. Two further limits worth naming: the arms ran in blocks (switch set A, then B) rather than strictly alternating, so thermal or cache drift cannot be separated from the switch set with these runs; and with nine runs the smallest attainable permutation p is 0.008, which is exactly the median's value, so that figure is the floor of the test rather than a precise probability.
Member
@review
BeanBot left a comment

Recommendation: Approve. The pending heat can still be lost when the pool stamp changes. The complete performance gain against the base and coverage on the remaining affected Tier 1 systems also remain unverified. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change reduces per-draw descriptor and buffer-binding work, at the cost of additional caches and invalidation logic. Pending batched heat can be omitted from mirror-budget decisions.

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

  • L1 gpu/vk/vk_memory.cpp:5495: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. When: A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. Do: Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test. (for the author: @fix couldn't: Both span_memo_hit and span_memo_store reset the table on a stamp mismatch without accounting for pending_heat; mirrors_by_heat subsequently uses pool heat for budget decisions.)

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

  • L2: Measure the complete change against the base at settings players use. When: The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. Do: Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread.
  • L3: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. When: Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. Do: Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene.

Since the last review (on a583c817c3)
Still open: L1 (Changing the stamp discards pending heat rather than accounting for it before the next mir…); L2 (Measure the complete change against the base at settings players use.); L3 (Check gameplay and performance on the remaining Tier 1 systems affected by the renderer pa…)

Checks: Failing on this head, which is behind its base, where they pass: PR description / Title and description (pull_request_target), CI / Third-party parts and guide screenshots (pull_request), CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request), CI / Website build and checks (pull_request), CI / Game-free checks (run_all.py, part 1/2) (pull_request), CI / Game-free checks (run_all.py, part 2/2) (pull_request). @rebase (or @fix) brings it up to date and runs them again; not held against it.

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

Does it help: Unproven for the complete change against the base. The author's Windows RTX 4060 in-run switch comparison reports +1.37% FPS and +1.44% 1% low over five runs; the Deck results combine this PR with other changes and do not isolate its full gain.

Other systems: The paths affect Vulkan rendering on Windows and Linux across GPU vendors. The supplied results cover Windows NVIDIA and a combined-change Steam Deck RADV run; the remaining Tier 1 configurations and Linux gameplay parity are not established.

Switches: RX_VK_DESC_SPAN_FAST is added as a per-recording kill switch, default on. The default has a positive Windows A/B result, but its complete-change gain and behavior across the remaining Tier 1 systems are not yet established.

Reviewed: a583c817c3 against c88b4f3d15: Read AGENTS.md and CONTRIBUTING.md, the relevant standards and the span-cache and mirror-selection code; inspected the diff and the supplied measurements. The large changed code files and generated test fixture were not read in full; the diff output was truncated. The adjacent Tooling rules were unavailable.; nothing run (a code review).

Checked and fine:

  • The switch is registered in gpu/vk/switches.def and is sampled per recording.
  • The Deck report includes native-resolution measurements and states the limits of its combined-change comparison.

Testing: No commands that build or run project code were executed. The author reports Windows gameplay and targeted checks; Linux host compilation, full suite, and live RADV parity remain listed as pending.

Overlaps and merge order: The Deck report says #2952 conflicts with #2954 in vk_draw.cpp and with #2958 in tests/test_hos_ab.py; it reports a clean merge with #2932. No merge order is established.


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

**Recommendation: Approve.** The pending heat can still be lost when the pool stamp changes. The complete performance gain against the base and coverage on the remaining affected Tier 1 systems also remain unverified. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change reduces per-draw descriptor and buffer-binding work, at the cost of additional caches and invalidation logic. Pending batched heat can be omitted from mirror-budget decisions. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `gpu/vk/vk_memory.cpp:5495`: Changing the stamp discards pending heat rather than accounting for it before the next mirror-budget decision. *When:* A mirrored pool with fewer than 64 distinct span hits in each submission loses those hits whenever mirror_epoch advances. On cards using mirrors_by_heat, its heat is understated relative to wanted pools, so the policy can evict a frequently read mirror and make subsequent reads use system memory. **Do:** Preserve or safely flush pending heat while the pool is still alive before invalidation and before mirror selection, and cover repeated short submissions in the test. *(for the author: `@fix` couldn't: Both span_memo_hit and span_memo_store reset the table on a stamp mismatch without accounting for pending_heat; mirrors_by_heat subsequently uses pool heat for budget decisions.)* **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: Measure the complete change against the base at settings players use. *When:* The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. **Do:** Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread. - **L3**: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. *When:* Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. **Do:** Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene. **Since the last review** (on a583c817c3ad) Still open: L1 (Changing the stamp discards pending heat rather than accounting for it before the next mir…); L2 (Measure the complete change against the base at settings players use.); L3 (Check gameplay and performance on the remaining Tier 1 systems affected by the renderer pa…) **Checks:** Failing on this head, which is behind its base, where they pass: `PR description / Title and description (pull_request_target)`, `CI / Third-party parts and guide screenshots (pull_request)`, `CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request)`, `CI / Website build and checks (pull_request)`, `CI / Game-free checks (run_all.py, part 1/2) (pull_request)`, `CI / Game-free checks (run_all.py, part 2/2) (pull_request)`. `@rebase` (or `@fix`) brings it up to date and runs them again; not held against it. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the complete change against the base. The author's Windows RTX 4060 in-run switch comparison reports +1.37% FPS and +1.44% 1% low over five runs; the Deck results combine this PR with other changes and do not isolate its full gain. **Other systems:** The paths affect Vulkan rendering on Windows and Linux across GPU vendors. The supplied results cover Windows NVIDIA and a combined-change Steam Deck RADV run; the remaining Tier 1 configurations and Linux gameplay parity are not established. **Switches:** RX_VK_DESC_SPAN_FAST is added as a per-recording kill switch, default on. The default has a positive Windows A/B result, but its complete-change gain and behavior across the remaining Tier 1 systems are not yet established. **Reviewed:** a583c817c3ad against c88b4f3d1573: Read AGENTS.md and CONTRIBUTING.md, the relevant standards and the span-cache and mirror-selection code; inspected the diff and the supplied measurements. The large changed code files and generated test fixture were not read in full; the diff output was truncated. The adjacent Tooling rules were unavailable.; nothing run (a code review). **Checked and fine:** - The switch is registered in gpu/vk/switches.def and is sampled per recording. - The Deck report includes native-resolution measurements and states the limits of its combined-change comparison. **Testing:** No commands that build or run project code were executed. The author reports Windows gameplay and targeted checks; Linux host compilation, full suite, and live RADV parity remain listed as pending. **Overlaps and merge order:** The Deck report says #2952 conflicts with #2954 in vk_draw.cpp and with #2958 in tests/test_hos_ab.py; it reports a clean merge with #2932. No merge order is established. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
fix(vk): flush span-memo pending heat safely across stamp changes and submissions
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 4s
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
2d068bda8a
Addresses review feedback (L1):
- Flush SpanMemoTable::pending_heat to live imported pools (checked under pools_mu via span_memo_live_pool) on stamp mismatch in span_memo_hit/span_memo_store without dereferencing evicted/retired Pool pointers.
- Flush span_memo pending_heat in memory_end_submission() and at the start of memory_begin_submission() before mirror_epoch++, periodic heat decay, and mirrors_by_heat().
- Avoid re-locking pools_mu when span_memo_store is called from the locked gpu_buffer_bind path.
- Extend tests/test_vk_desc_span_fast.py to cover repeated short submissions (< 64 hits), mirror-freed live pools across stamp changes, deleted Pool* safety with co-resident live pools, and submission-boundary flushes before mirrors_by_heat().

Assisted-by: Antigravity (Google DeepMind)
Author
Contributor

Addressed L1 in commit \2d068bda8\ (on top of \583c817c):

  • Safe flush on stamp changes (\gpu/vk/vk_memory.cpp): Added \span_memo_flush(bool mu_held)\ + \span_memo_live_pool(lo, p)\ so \span_memo_hit\ and \span_memo_store\ flush any \pending_heat\ to still-live \imported\ pools (validated under \pools_mu\ without dereferencing evicted/retired \Pool*) before resetting \span_memo_tbl. The locked \gpu_buffer_bind\ call site passes \mu_held = true\ so it never re-locks \pools_mu.
  • **Submission-boundary flush before \mirrors_by_heat()**: \memory_end_submission()\ and the start of \memory_begin_submission()\ (before \mirror_epoch++, periodic heat decay, and \mirrors_by_heat()) call \span_memo_flush(true)\ so pools with < 64\ distinct span hits per submission have all heat accounted for before mirror-budget eviction decisions.
  • Test coverage (\ ests/test_vk_desc_span_fast.py): Added coverage for 64 repeated short submissions (< 64\ hits each) across \mirror_epoch\ stamp changes in \span_memo_hit\ and \span_memo_store, mirror-freed live pools across \pools_gen++, deleted \Pool*\ safety alongside live pools, and submission-boundary flushes before periodic decay and \mirrors_by_heat().
  • Checks run: \ ests/test_vk_desc_span_fast.py\ (\clang++\ & \g++), \ ests/test_direct_buffer_writes.py\ (\clang++\ & \g++), \ ests/test_bind_memo.py\ (\clang++\ & \g++), \ ests/test_hos_ab.py --cc clang, \ ests/test_tls_objects.py, \ ests/test_vk_braces.py, and \ ests/test_doc_anchors.py\ all passed.
Addressed **L1** in commit \2d068bda8\ (on top of \583c817c\): - **Safe flush on stamp changes (\gpu/vk/vk_memory.cpp\)**: Added \span_memo_flush(bool mu_held)\ + \span_memo_live_pool(lo, p)\ so \span_memo_hit\ and \span_memo_store\ flush any \pending_heat\ to still-live \imported\ pools (validated under \pools_mu\ without dereferencing evicted/retired \Pool*\) before resetting \span_memo_tbl\. The locked \gpu_buffer_bind\ call site passes \mu_held = true\ so it never re-locks \pools_mu\. - **Submission-boundary flush before \mirrors_by_heat()\**: \memory_end_submission()\ and the start of \memory_begin_submission()\ (before \mirror_epoch++\, periodic heat decay, and \mirrors_by_heat()\) call \span_memo_flush(true)\ so pools with \< 64\ distinct span hits per submission have all heat accounted for before mirror-budget eviction decisions. - **Test coverage (\ ests/test_vk_desc_span_fast.py\)**: Added coverage for 64 repeated short submissions (\< 64\ hits each) across \mirror_epoch\ stamp changes in \span_memo_hit\ and \span_memo_store\, mirror-freed live pools across \pools_gen++\, deleted \Pool*\ safety alongside live pools, and submission-boundary flushes before periodic decay and \mirrors_by_heat()\. - **Checks run**: \ ests/test_vk_desc_span_fast.py\ (\clang++\ & \g++\), \ ests/test_direct_buffer_writes.py\ (\clang++\ & \g++\), \ ests/test_bind_memo.py\ (\clang++\ & \g++\), \ ests/test_hos_ab.py --cc clang\, \ ests/test_tls_objects.py\, \ ests/test_vk_braces.py\, and \ ests/test_doc_anchors.py\ all passed.
Owner
@rebase
Member

I rebased this pull request onto main (7efa6701a4): the new head is f345491dd8.

Conflicts resolved

  • gpu/vk/vk_draw.cpp: Resolve slot 3 again when Grass distance is read live.
  • tests/direct_buffer_writes_test.cpp: Supply read-span stubs for the extracted binding function.
  • tests/test_vk_desc_span_fast.py: Supply read-span stubs and cover the live Grass distance path. Tests were not run, as requested.
  • Also changed, beyond the conflict: tests/direct_buffer_writes_test.cpp, tests/test_vk_desc_span_fast.py
  • tests/test_vk_desc_span_fast.py: Included the production heat and bind-stamp helpers in the extracted fixture.
  • tests/test_direct_buffer_writes.py: Included the same helpers when needed by the extracted source, preserving support for older source overrides.
  • Also changed, beyond the conflict: tests/test_direct_buffer_writes.py, tests/test_vk_desc_span_fast.py

Nothing was built or run: read the resolution before merging.


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

I rebased this pull request onto `main` (7efa6701a423): the new head is f345491dd886. **Conflicts resolved** - gpu/vk/vk_draw.cpp: Resolve slot 3 again when Grass distance is read live. - tests/direct_buffer_writes_test.cpp: Supply read-span stubs for the extracted binding function. - tests/test_vk_desc_span_fast.py: Supply read-span stubs and cover the live Grass distance path. Tests were not run, as requested. - Also changed, beyond the conflict: `tests/direct_buffer_writes_test.cpp`, `tests/test_vk_desc_span_fast.py` - tests/test_vk_desc_span_fast.py: Included the production heat and bind-stamp helpers in the extracted fixture. - tests/test_direct_buffer_writes.py: Included the same helpers when needed by the extracted source, preserving support for older source overrides. - Also changed, beyond the conflict: `tests/test_direct_buffer_writes.py`, `tests/test_vk_desc_span_fast.py` Nothing was built or run: read the resolution before merging. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
BeanBot force-pushed perf/vk-span-memo-desc-fast from 2d068bda8a
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 4s
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 f345491dd8
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 9s
CI / What the change needs (pull_request) Successful in 10s
CI / Third-party parts and guide screenshots (pull_request) Failing after 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Failing after 16s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m38s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m15s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m27s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m34s
CI / Website build and checks (pull_request) Failing after 33s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 18m36s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 34m17s
2026-12-02 17:43:58 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. Pending span-cache heat is now flushed before it is discarded and before mirror-budget decisions. The complete change still needs a base-versus-head measurement and gameplay and performance checks on the remaining affected Tier 1 systems. Recommend approval; not approved on the forge.

The change reduces descriptor and buffer-binding work during draws, at the cost of additional caching and invalidation logic. The heat fix preserves the optimization while accounting for pending cache hits.

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

  • L2: Measure the complete change against the base at settings players use. When: The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. Do: Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread.
  • L3: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. When: Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. Do: Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene.

Since the last review (on a583c817c3)
Resolved: L1 (Changing the stamp discards pending heat rather than accounting for it before the next mir…)
Still open: L2 (Measure the complete change against the base at settings players use.); L3 (Check gameplay and performance on the remaining Tier 1 systems affected by the renderer pa…)

Checks: Still running: 11 checks.

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

Does it help: Unproven for the complete change against the base. The reported Windows in-run comparison shows +1.37% average FPS and +1.44% 1% low, but compares switch positions within the PR build; the Deck measurements include other changes.

Other systems: The renderer paths affect Windows and Linux across GPU vendors. Windows NVIDIA and Deck RADV results are reported; the remaining affected Tier 1 systems lack reported gameplay and performance results.

Switches: RX_VK_DESC_SPAN_FAST is added as a developer kill switch, default on, with in-run HOS_AB support. Its default still needs validation against the base and on the remaining affected Tier 1 systems.

Reviewed: f345491dd8 against 7efa6701a4: Read the repository rules, PR template, production diff, heat-flush implementation and its submission and binding call sites; inspected the UBO change and test diff. Large changed files and the new test were not read in full. The linked Tooling rules and docs/review-checklist.md were unavailable in the checkout.; nothing run (a code review).

Checked and fine:

  • The locked buffer-bind path passes mu_held=true, avoiding a second acquisition of pools_mu.
  • The rebase guards slot 3 against skipping live Grass distance updates when the UBO recording cache is off.
  • The heat fix retains the span-cache fast path.

Testing: No code or tests were run during this review. The author reports targeted checks and Windows gameplay; the supplied CI checks are still running.

Overlaps and merge order: The Deck report says #2952 merges cleanly with #2932, conflicts with #2958 in tests/test_hos_ab.py, and conflicts with #2954 in vk_draw.cpp; merge order is not established.


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

**Recommendation: Approve.** The code is ready: only testing is left. Pending span-cache heat is now flushed before it is discarded and before mirror-budget decisions. The complete change still needs a base-versus-head measurement and gameplay and performance checks on the remaining affected Tier 1 systems. Recommend approval; not approved on the forge. The change reduces descriptor and buffer-binding work during draws, at the cost of additional caching and invalidation logic. The heat fix preserves the optimization while accounting for pending cache hits. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: Measure the complete change against the base at settings players use. *When:* The reported comparison flips the new switch within the PR build; the empty overlay exit and other changes still run on its off side, so the reported delta is not the net change from main. **Do:** Run several interleaved base-versus-head measurements in the target and heavy scenes at the device’s normal resolution and preset, reporting average and 1% lows, frame times and spread. - **L3**: Check gameplay and performance on the remaining Tier 1 systems affected by the renderer paths. *When:* Only Windows RTX 4060 gameplay is reported; Linux NVIDIA, AMD on Windows and RADV, and Steam Deck also execute these paths, including different mirror budgets and driver behavior. **Do:** Run representative gameplay parity and frame-time checks on those systems, including a mirror-budget-constrained scene. **Since the last review** (on a583c817c3ad) Resolved: L1 (Changing the stamp discards pending heat rather than accounting for it before the next mir…) Still open: L2 (Measure the complete change against the base at settings players use.); L3 (Check gameplay and performance on the remaining Tier 1 systems affected by the renderer pa…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the complete change against the base. The reported Windows in-run comparison shows +1.37% average FPS and +1.44% 1% low, but compares switch positions within the PR build; the Deck measurements include other changes. **Other systems:** The renderer paths affect Windows and Linux across GPU vendors. Windows NVIDIA and Deck RADV results are reported; the remaining affected Tier 1 systems lack reported gameplay and performance results. **Switches:** RX_VK_DESC_SPAN_FAST is added as a developer kill switch, default on, with in-run HOS_AB support. Its default still needs validation against the base and on the remaining affected Tier 1 systems. **Reviewed:** f345491dd886 against 7efa6701a423: Read the repository rules, PR template, production diff, heat-flush implementation and its submission and binding call sites; inspected the UBO change and test diff. Large changed files and the new test were not read in full. The linked Tooling rules and docs/review-checklist.md were unavailable in the checkout.; nothing run (a code review). **Checked and fine:** - The locked buffer-bind path passes mu_held=true, avoiding a second acquisition of pools_mu. - The rebase guards slot 3 against skipping live Grass distance updates when the UBO recording cache is off. - The heat fix retains the span-cache fast path. **Testing:** No code or tests were run during this review. The author reports targeted checks and Windows gameplay; the supplied CI checks are still running. **Overlaps and merge order:** The Deck report says #2952 merges cleanly with #2932, conflicts with #2958 in tests/test_hos_ab.py, and conflicts with #2954 in vk_draw.cpp; merge order is not established. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch perf/vk-span-memo-desc-fast 2026-12-02 18:00:17 +00:00
Author
Contributor

Thank you @BeanBot for the rebase and the review. This PR is merged now (1ce8f5899), so this comment only records where its open items stand; nothing was pushed.

  • The rebase onto 7efa670: the resolution re-resolves UBO slot 3 when the Grass distance is read live (!(e.slot == 3 && ubo_ssbo_fast_mode != 1) before the span-cache skip in update_ubo_descriptors), which keeps main's live Grass distance path; the test stubs were extended to match. I read it and found nothing to change.
  • L2 (base against head at player settings): not run. The only other-system numbers are @omgitsgela's Steam Deck LCD runs (separate launches, HOS_AB does not start on the Deck yet): with #2952 and #2958 but without #2946, desc_ms −5.1 % to −8.5 % over three paired samples; with the three switches together at 50 % render, median frame −2.89 % and fps +2.57 %, the p99 within spread. Those stack several PRs, so they do not isolate this one against main.
  • L3 (other Tier 1 systems): no farm results exist for this PR (the run on a3fb05a was cancelled by a push, and the head after the rebase was not approved for the farm). Linux NVIDIA, Windows and Linux AMD and a mirror-budget-limited scene still need the farm or someone with the hardware. I have one Windows RTX 4060 here and ran nothing new for this comment.
Thank you @BeanBot for the rebase and the review. This PR is merged now (1ce8f5899), so this comment only records where its open items stand; nothing was pushed. - **The rebase onto `7efa670`:** the resolution re-resolves UBO slot 3 when the Grass distance is read live (`!(e.slot == 3 && ubo_ssbo_fast_mode != 1)` before the span-cache skip in `update_ubo_descriptors`), which keeps main's live Grass distance path; the test stubs were extended to match. I read it and found nothing to change. - **L2 (base against head at player settings):** not run. The only other-system numbers are @omgitsgela's Steam Deck LCD runs (separate launches, `HOS_AB` does not start on the Deck yet): with #2952 and #2958 but without #2946, `desc_ms` −5.1 % to −8.5 % over three paired samples; with the three switches together at 50 % render, median frame −2.89 % and fps +2.57 %, the p99 within spread. Those stack several PRs, so they do not isolate this one against main. - **L3 (other Tier 1 systems):** no farm results exist for this PR (the run on `a3fb05a` was cancelled by a push, and the head after the rebase was not approved for the farm). Linux NVIDIA, Windows and Linux AMD and a mirror-budget-limited scene still need the farm or someone with the hardware. I have one Windows RTX 4060 here and ran nothing new for this comment.
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!2952
No description provided.