perf(vk): inline active-UB envelope, grass_reach guard, and O(1) L1 ReadSpanTable #2976

Merged
HumanBean merged 1 commit from siantm/Longshot:perf/vk-ubo-ssbo-fast into main 2026-12-02 16:53:10 +00:00
Contributor

Summary

Speeds up uniform buffer (FT_UBO) and storage buffer (FT_STORAGE) binding resolution in gpu/vk/ under RX_VK_UBO_SSBO_FAST (default on 1).

Before this change:

  1. Every uniform_range() call called grass_words() + grass_reach() even when grass distance scaling was at its default 1.0f, called stream_reserve() + ub_overlay() even when no pending inline ub_updates overlapped the UBO range, and walked gpu_buffer_bind() / pools_mu on read-only UBO/SSBO bindings.
  2. In build_descriptors(), when tex_desc_memo::ssbo_lookup missed for a read-only SSBO, FT_STORAGE re-read addr and size via stage_cbuf_word() instead of reusing the already decoded values.

With RX_VK_UBO_SSBO_FAST:

  1. ubo_ssbo_fast.h adds a lock-free atomic UbActiveEnvelope (g_ub_active) maintained on ub_updates push/prune/bench_frame in vk_replay.cpp so uniform_range() skips stream_reserve() + ub_overlay() when no active update overlaps.
  2. ubo_ssbo_fast_begin_recording() caches rec_grass_reach per recording (reading HOS_AB on RX_VK_UBO_SSBO_FAST) so uniform_range() skips grass_words() when rec_grass_reach == 1.0f.
  3. ubo_ssbo_fast.h provides an L1-resident 64 × 2-way direct-mapped MRU ReadSpanTable (alignas(64), keyed by (addr >> 20) & 63) backed by g_bind_stamp_fast and gpu_buffer_bind_with_span() in vk_memory.cpp (with strict < 1 TB, synced_epoch, pool_base, and sparse_has guards) for UBO and read-only (!d.is_written && !bare && !wide_n) SSBO binds, while leaving FT_VERTEX / d.ibuf untouched and reusing decoded (addr, size) on SSBO memo misses.

First read ubo_ssbo_fast.h, vk_draw.cpp, and vk_memory.cpp.

Testing

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

  • python -X utf8 -I tests/test_vk_ubo_ssbo_fast.py --cxx clang++ --headers ... passed (ReadSpanTable O(1) bucketing, 2-way MRU swap, cross-1MB spans, stamp invalidation, sparse/virtual-address/overflow guards, 2,000-op UbActiveEnvelope oracle, HOS_AB mode 0/1/2 parity, source wiring, and 9 broken variants caught).
  • python -X utf8 -I tests/test_hos_ab.py, tests/test_flat_map.py, tests/test_saveload_warm_cache.py, tests/test_switches_removed.py, tests/test_bind_memo.py, tests/test_ub_gap.py, tests/test_sparse_mirror.py, and clang++ -fsyntax-only on vk_memory.cpp, vk_replay.cpp, and vk_draw.cpp passed.
  • Live Market smoke (RX_VK_UBO_SSBO_FAST=1, 15 s): 1,209 frames, 0 cold frames, RUN_ERROR=None.
  • Live Market parity (RX_VK_UBO_SSBO_FAST=check, 25 s): 51,000,000+ checks (20.57M ReadSpanTable hits, 24.46M ub_bypasses), 0 mismatches, RUN_ERROR=None.
  • Queued in-run HOS_AB (HOS_AB=RX_VK_UBO_SSBO_FAST=0,3,0, 5×90 s, 147 paired periods in Market): 5/5 runs won, zero crashes/errors.

Still to test:

  • macOS / Linux / AMD / Intel: run dev.py ab in Market and smoke-check RX_VK_UBO_SSBO_FAST=check by hand (by hand).

Measurements

Verdict: faster: +1.71% fps, mean frame time -0.214 ms (95% interval +1.29% to +2.18% faster vs RX_VK_UBO_SSBO_FAST=0).

Setup: Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40, Vulkan 1.4); Market, child (crowded), 50% res (768x432), output res 1280x720, frame generation Off, vsync Off, uncapped (HOS_FPS_MAX=1000), queued in-run HOS_AB=RX_VK_UBO_SSBO_FAST=0,3,0 across 5×90 s runs (147 paired periods; 16,485 ON frames vs 16,212 OFF frames).

Baseline: both columns are one build, 23ba22c0e on perf/vk-ubo-ssbo-fast (main @ 495ed9fe2): RX_VK_UBO_SSBO_FAST=0 (Before) against RX_VK_UBO_SSBO_FAST unset (After).

Before, RX_VK_UBO_SSBO_FAST=0: this PR @ 23ba22c0 After, RX_VK_UBO_SSBO_FAST unset: this PR @ 23ba22c0 Δ
fps 80.04 81.41 +1.71%
mean frame time 12.50 ms 12.29 ms -0.21 ms
median frame time 12.24 ms 12.04 ms -0.20 ms
p99 frame time 15.62 ms 15.35 ms -0.27 ms
1% low fps 64.10 65.19 +1.70%
0.1% low fps 51.79 52.25 +0.89%
desc_ms 2.749 ms 2.488 ms -9.49% (-0.261 ms)
draw_ms 7.302 ms 7.053 ms -3.40% (-0.249 ms)
wait_gpu_ms 1.819 ms 1.557 ms -14.37% (-0.261 ms)

Risks

Set RX_VK_UBO_SSBO_FAST=0 to disable UbActiveEnvelope, rec_grass_reach, and ReadSpanTable (falling back to unconditional ub_overlay + gpu_buffer_bind), or RX_VK_UBO_SSBO_FAST=check to verify live parity (0 mismatches across 51.0M+ checks). Shader cache and pipeline cache are untouched.

Assisted-by: Antigravity

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 Speeds up uniform buffer (`FT_UBO`) and storage buffer (`FT_STORAGE`) binding resolution in `gpu/vk/` under `RX_VK_UBO_SSBO_FAST` (default on `1`). Before this change: 1. Every `uniform_range()` call called `grass_words()` + `grass_reach()` even when grass distance scaling was at its default `1.0f`, called `stream_reserve()` + `ub_overlay()` even when no pending inline `ub_updates` overlapped the UBO range, and walked `gpu_buffer_bind()` / `pools_mu` on read-only UBO/SSBO bindings. 2. In `build_descriptors()`, when `tex_desc_memo::ssbo_lookup` missed for a read-only SSBO, `FT_STORAGE` re-read `addr` and `size` via `stage_cbuf_word()` instead of reusing the already decoded values. With `RX_VK_UBO_SSBO_FAST`: 1. [ubo_ssbo_fast.h](gpu/vk/ubo_ssbo_fast.h) adds a lock-free atomic `UbActiveEnvelope` (`g_ub_active`) maintained on `ub_updates` push/prune/`bench_frame` in [vk_replay.cpp](gpu/vk/vk_replay.cpp) so `uniform_range()` skips `stream_reserve()` + `ub_overlay()` when no active update overlaps. 2. `ubo_ssbo_fast_begin_recording()` caches `rec_grass_reach` per recording (reading `HOS_AB` on `RX_VK_UBO_SSBO_FAST`) so `uniform_range()` skips `grass_words()` when `rec_grass_reach == 1.0f`. 3. `ubo_ssbo_fast.h` provides an L1-resident `64 × 2`-way direct-mapped MRU `ReadSpanTable` (`alignas(64)`, keyed by `(addr >> 20) & 63`) backed by `g_bind_stamp_fast` and `gpu_buffer_bind_with_span()` in [vk_memory.cpp](gpu/vk/vk_memory.cpp) (with strict `< 1 TB`, `synced_epoch`, `pool_base`, and `sparse_has` guards) for UBO and read-only (`!d.is_written && !bare && !wide_n`) SSBO binds, while leaving `FT_VERTEX` / `d.ibuf` untouched and reusing decoded `(addr, size)` on SSBO memo misses. First read [ubo_ssbo_fast.h](gpu/vk/ubo_ssbo_fast.h), [vk_draw.cpp](gpu/vk/vk_draw.cpp), and [vk_memory.cpp](gpu/vk/vk_memory.cpp). ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40, Vulkan 1.4). - `python -X utf8 -I tests/test_vk_ubo_ssbo_fast.py --cxx clang++ --headers ...` passed (`ReadSpanTable` O(1) bucketing, 2-way MRU swap, cross-1MB spans, stamp invalidation, sparse/virtual-address/overflow guards, 2,000-op `UbActiveEnvelope` oracle, `HOS_AB` mode `0/1/2` parity, source wiring, and 9 broken variants caught). - `python -X utf8 -I tests/test_hos_ab.py`, `tests/test_flat_map.py`, `tests/test_saveload_warm_cache.py`, `tests/test_switches_removed.py`, `tests/test_bind_memo.py`, `tests/test_ub_gap.py`, `tests/test_sparse_mirror.py`, and `clang++ -fsyntax-only` on `vk_memory.cpp`, `vk_replay.cpp`, and `vk_draw.cpp` passed. - Live Market smoke (`RX_VK_UBO_SSBO_FAST=1`, 15 s): `1,209` frames, `0` cold frames, `RUN_ERROR=None`. - Live Market parity (`RX_VK_UBO_SSBO_FAST=check`, 25 s): **`51,000,000+` checks (`20.57M` `ReadSpanTable` hits, `24.46M` `ub_bypasses`), `0` mismatches**, `RUN_ERROR=None`. - Queued in-run `HOS_AB` (`HOS_AB=RX_VK_UBO_SSBO_FAST=0,3,0`, 5×90 s, `147` paired periods in Market): `5/5` runs won, zero crashes/errors. **Still to test:** - macOS / Linux / AMD / Intel: run `dev.py ab` in Market and smoke-check `RX_VK_UBO_SSBO_FAST=check` by hand (`by hand`). ## Measurements **Verdict:** faster: +1.71% fps, mean frame time -0.214 ms (95% interval +1.29% to +2.18% faster vs `RX_VK_UBO_SSBO_FAST=0`). Setup: Windows 11, NVIDIA GeForce RTX 4060 (driver 621.40, Vulkan 1.4); Market, child (crowded), 50% res (`768x432`), output res `1280x720`, frame generation Off, vsync Off, uncapped (`HOS_FPS_MAX=1000`), queued in-run `HOS_AB=RX_VK_UBO_SSBO_FAST=0,3,0` across 5×90 s runs (`147` paired periods; `16,485` ON frames vs `16,212` OFF frames). Baseline: both columns are one build, `23ba22c0e` on `perf/vk-ubo-ssbo-fast` (`main` @ `495ed9fe2`): `RX_VK_UBO_SSBO_FAST=0` (Before) against `RX_VK_UBO_SSBO_FAST` unset (After). | | Before, RX_VK_UBO_SSBO_FAST=0: this PR @ 23ba22c0 | After, RX_VK_UBO_SSBO_FAST unset: this PR @ 23ba22c0 | Δ | |---|---|---|---| | fps | 80.04 | 81.41 | +1.71% | | mean frame time | 12.50 ms | 12.29 ms | -0.21 ms | | median frame time | 12.24 ms | 12.04 ms | -0.20 ms | | p99 frame time | 15.62 ms | 15.35 ms | -0.27 ms | | 1% low fps | 64.10 | 65.19 | +1.70% | | 0.1% low fps | 51.79 | 52.25 | +0.89% | | `desc_ms` | 2.749 ms | 2.488 ms | -9.49% (-0.261 ms) | | `draw_ms` | 7.302 ms | 7.053 ms | -3.40% (-0.249 ms) | | `wait_gpu_ms` | 1.819 ms | 1.557 ms | -14.37% (-0.261 ms) | ## Risks Set `RX_VK_UBO_SSBO_FAST=0` to disable `UbActiveEnvelope`, `rec_grass_reach`, and `ReadSpanTable` (falling back to unconditional `ub_overlay` + `gpu_buffer_bind`), or `RX_VK_UBO_SSBO_FAST=check` to verify live parity (`0` mismatches across `51.0M+` checks). Shader cache and pipeline cache are untouched. Assisted-by: Antigravity ## 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): inline active-UB envelope, grass_reach guard, and O(1) 64x2-way L1 ReadSpanTable (RX_VK_UBO_SSBO_FAST)
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
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
23ba22c0ec
Author
Contributor

Tested in game: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4, driver 621.40), Market: RX_VK_UBO_SSBO_FAST=1 (1209 frames, RUN_ERROR=None), =check (51.0M+ checks, 0 mismatches), 5x90s HOS_AB (147 periods, +1.71% FPS, 95% CI +1.29%..+2.18%, desc_ms -9.49%)

Tested in game: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4, driver 621.40), Market: RX_VK_UBO_SSBO_FAST=1 (1209 frames, RUN_ERROR=None), =check (51.0M+ checks, 0 mismatches), 5x90s HOS_AB (147 periods, +1.71% FPS, 95% CI +1.29%..+2.18%, desc_ms -9.49%)
Member

Possibly related, for context:

  • PR #2920 perf(vk): add per-thread texture/sampler and read-only SSBO descriptor memos — Merged read-only SSBO descriptor memo; same build_descriptors path, this PR optimizes remaining binds and cache misses.
Possibly related, for context: - PR #2920 perf(vk): add per-thread texture/sampler and read-only SSBO descriptor memos — Merged read-only SSBO descriptor memo; same build_descriptors path, this PR optimizes remaining binds and cache misses.
Member
@review
BeanBot left a comment

Recommendation: Approve. The new span cache bypasses binding bookkeeping used to choose mirrors, and its tests do not exercise the production span-population logic. The claimed performance gain also needs comparison against the base at player settings and testing on the affected Tier 1 systems. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change caches read-only buffer bindings, skips unnecessary uniform overlays, and caches grass reach per recording. It reduces descriptor work in the reported Windows/NVIDIA run, at the cost of a new cache and invalidation path whose effects on mirror selection and other systems remain unmeasured.

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

  • L1 gpu/vk/vk_draw.cpp:4591: A span hit skips the pool heat accounting performed by gpu_buffer_bind for distinct bindings. (more on the line) Do: Preserve the pool's heat accounting on span hits, or change the mirror selection accounting so it remains representative of these bindings.
  • L2 tests/test_vk_ubo_ssbo_fast.py:102: The span safety tests exercise a reimplementation of span population rather than the production function. (more on the line) Do: Compile the production span-population logic with suitable stand-ins and add broken controls for its residency and synchronization guards.
  • L3: The AI assistance is named in the PR description but the commit has no assistance trailer. When: The sole commit lacks Assisted-by or Co-Authored-By even though the checklist says AI assistance is recorded with trailers. Do: Add the applicable assistance trailer to the commit and keep the checklist accurate.

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

  • L4: The reported A/B does not establish the gain against the base at settings players use. When: Both measured sides run the PR build, and the 50% resolution Market run can amplify CPU-side savings compared with the normal preset and output resolution. Do: Compare the named base and PR builds in interleaved runs at the device's normal preset and resolution, including the target and a heavy area, with FPS, lows and frame times.
  • L5: The default-on renderer path has not been exercised on AMD Windows or Linux, NVIDIA Linux, or Steam Deck. When: These systems use the changed buffer binding and mirror paths, while the only reported game and parity runs are on Windows with NVIDIA. Do: Run representative gameplay and check-mode parity on the affected Tier 1 systems, and compare performance and frame pacing with the base.

@fix can do L1, L2 and L3.

Checks: Still running: 11 checks.

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

Does it help: Unproven against the base. The author reports +1.71% FPS and a 0.21 ms mean frame-time reduction over five Windows RTX 4060 runs in Market, but both sides used the PR build and the test used 50% rendering resolution.

Other systems: The binding path affects UBOs and read-only SSBOs on Windows and Linux, including AMD, NVIDIA and Steam Deck. The submitted live parity and timing evidence covers only Windows on an RTX 4060; sparse mirrors, mirror-budget pressure and other drivers need coverage.

Switches: RX_VK_UBO_SSBO_FAST is added, default on; 0 disables the fast paths and check compares results. Its table row is present, but the default has not been measured across supported Tier 1 systems.

Reviewed: 23ba22c0ec against 495ed9fe2a: Read the repository rules, PR template and standards, the complete production diff, the new helper header, changed binding and replay code in context, and the relevant test harness and wiring checks. Skimmed the remainder of the large changed source and test files. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The new switch has a switches.def row and a documented off and check mode.
  • The active-envelope push, prune and benchmark reset paths are wired in the diff.
  • No changed file is a game artifact, generated shader, third-party file or renderer API definition.

Testing: No code or tests were run, as requested. The author reports a Windows/NVIDIA live smoke, check-mode parity and five in-run A/B measurements; CI is still running.

Overlaps and merge order: Unknown; network access was unavailable.


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

**Recommendation: Approve.** The new span cache bypasses binding bookkeeping used to choose mirrors, and its tests do not exercise the production span-population logic. The claimed performance gain also needs comparison against the base at player settings and testing on the affected Tier 1 systems. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change caches read-only buffer bindings, skips unnecessary uniform overlays, and caches grass reach per recording. It reduces descriptor work in the reported Windows/NVIDIA run, at the cost of a new cache and invalidation path whose effects on mirror selection and other systems remain unmeasured. **Should fix (3)**: not blocking, but worth doing before merging. - **L1** `gpu/vk/vk_draw.cpp:4591`: A span hit skips the pool heat accounting performed by gpu_buffer_bind for distinct bindings. (more on the line) **Do:** Preserve the pool's heat accounting on span hits, or change the mirror selection accounting so it remains representative of these bindings. - **L2** `tests/test_vk_ubo_ssbo_fast.py:102`: The span safety tests exercise a reimplementation of span population rather than the production function. (more on the line) **Do:** Compile the production span-population logic with suitable stand-ins and add broken controls for its residency and synchronization guards. - **L3**: The AI assistance is named in the PR description but the commit has no assistance trailer. *When:* The sole commit lacks Assisted-by or Co-Authored-By even though the checklist says AI assistance is recorded with trailers. **Do:** Add the applicable assistance trailer to the commit and keep the checklist accurate. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported A/B does not establish the gain against the base at settings players use. *When:* Both measured sides run the PR build, and the 50% resolution Market run can amplify CPU-side savings compared with the normal preset and output resolution. **Do:** Compare the named base and PR builds in interleaved runs at the device's normal preset and resolution, including the target and a heavy area, with FPS, lows and frame times. - **L5**: The default-on renderer path has not been exercised on AMD Windows or Linux, NVIDIA Linux, or Steam Deck. *When:* These systems use the changed buffer binding and mirror paths, while the only reported game and parity runs are on Windows with NVIDIA. **Do:** Run representative gameplay and check-mode parity on the affected Tier 1 systems, and compare performance and frame pacing with the base. `@fix` can do L1, L2 and L3. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the base. The author reports +1.71% FPS and a 0.21 ms mean frame-time reduction over five Windows RTX 4060 runs in Market, but both sides used the PR build and the test used 50% rendering resolution. **Other systems:** The binding path affects UBOs and read-only SSBOs on Windows and Linux, including AMD, NVIDIA and Steam Deck. The submitted live parity and timing evidence covers only Windows on an RTX 4060; sparse mirrors, mirror-budget pressure and other drivers need coverage. **Switches:** RX_VK_UBO_SSBO_FAST is added, default on; 0 disables the fast paths and check compares results. Its table row is present, but the default has not been measured across supported Tier 1 systems. **Reviewed:** 23ba22c0eca6 against 495ed9fe2aaa: Read the repository rules, PR template and standards, the complete production diff, the new helper header, changed binding and replay code in context, and the relevant test harness and wiring checks. Skimmed the remainder of the large changed source and test files. docs/review-checklist.md and ../Tooling/AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The new switch has a switches.def row and a documented off and check mode. - The active-envelope push, prune and benchmark reset paths are wired in the diff. - No changed file is a game artifact, generated shader, third-party file or renderer API definition. **Testing:** No code or tests were run, as requested. The author reports a Windows/NVIDIA live smoke, check-mode parity and five in-run A/B measurements; CI is still running. **Overlaps and merge order:** Unknown; network access was unavailable. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -4561,0 +4588,4 @@
if (ubo_ssbo_fast_mode == 0) return gpu_buffer_bind(addr, size, false);
const uint64_t stamp = g_bind_stamp_fast.load(std::memory_order_relaxed);
if (ubo_ssbo_fast_mode == 1) {
BufferRef b;
Member

L1 (should fix): A span hit skips the pool heat accounting performed by gpu_buffer_bind for distinct bindings.

When: When many UBO or SSBO ranges in one pool hit the same cached span, only the first miss adds its size to the pool's heat. Under mirror budget pressure, mirrors_by_heat can treat that heavily used pool as cold and give its mirror to a less-used pool, causing subsequent GPU reads to come from guest memory.

Do: Preserve the pool's heat accounting on span hits, or change the mirror selection accounting so it remains representative of these bindings.

**L1** (should fix): A span hit skips the pool heat accounting performed by gpu_buffer_bind for distinct bindings. *When:* When many UBO or SSBO ranges in one pool hit the same cached span, only the first miss adds its size to the pool's heat. Under mirror budget pressure, mirrors_by_heat can treat that heavily used pool as cold and give its mirror to a less-used pool, causing subsequent GPU reads to come from guest memory. **Do:** Preserve the pool's heat accounting on span hits, or change the mirror selection accounting so it remains representative of these bindings.
@ -0,0 +99,4 @@
static void fake_maybe_populate(const FakePool& p, uint64_t gpu, VkBuffer buf, ReadSpan* span_out) {
#ifdef MUTATE_IGNORE_SPARSE_GUARD
const bool sparse_ok = g_sparse_has_ok || p.sparse;
Member

L2 (should fix): The span safety tests exercise a reimplementation of span population rather than the production function.

When: Removing the sparse residency or synchronization guard from maybe_populate_read_span in vk_memory.cpp leaves fake_maybe_populate unchanged, and the source wiring checks only require that the production function exists. The tests therefore still pass when that production guard is broken.

Do: Compile the production span-population logic with suitable stand-ins and add broken controls for its residency and synchronization guards.

**L2** (should fix): The span safety tests exercise a reimplementation of span population rather than the production function. *When:* Removing the sparse residency or synchronization guard from maybe_populate_read_span in vk_memory.cpp leaves fake_maybe_populate unchanged, and the source wiring checks only require that the production function exists. The tests therefore still pass when that production guard is broken. **Do:** Compile the production span-population logic with suitable stand-ins and add broken controls for its residency and synchronization guards.
siantm force-pushed perf/vk-ubo-ssbo-fast from 23ba22c0ec
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
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 44ad52d5ea
Some checks failed
PR description / Title and description (pull_request_target) Successful in 4s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 2/1 fail
beanstalk/linux+nvidia 0/1 pass, 0 running, 2 queued
beanstalk/windows+amd 0/1 pass, 1 running, 1 queued
beanstalk/linux+radv 2/1 fail
beanstalk/intel 0/1 pass, 0 running, 2 queued
beanstalk/steamdeck 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
2026-12-02 10:37:46 +00:00
Compare
Author
Contributor

Addressed L1, L2, and L3 in 44ad52d5e:

  • L1 (Pool::heat on ReadSpanTable hits): Added uint64_t* heat_ptr to ReadSpan (populated with &p.heat in maybe_populate_read_span) and shared read_span_heat_of(size) (RX_VK_MIRROR_HEAT_CAP_KB cap) between Pool::heat_of and ReadSpanTable::lookup. Span hits in mode 1 now atomically add read_span_heat_of(size) to *heat_ptr via std::atomic_ref<uint64_t> (memory_order_relaxed), while =check mode passes count_heat=false so gpu_buffer_bind doesn't double-count.
  • L2 (production span population in tests): Factored maybe_populate_read_span (and ReadSpanPoolView / ReadSpanMirrorState) into gpu/vk/ubo_ssbo_fast.h so vk_memory.cpp and tests/test_vk_ubo_ssbo_fast.py compile and exercise the same production residency, sync, virtual-address, and stamp guards directly (replacing fake_maybe_populate). Added ignore_sync_guard and skip_heat_on_span_hit MUST_FAIL controls (11 total) plus ignore_sparse_guard mutating the production header directly, and added --cxx/$CXX/Windows DLL PATH discovery.
  • L3 (commit trailer): Amended the commit with Assisted-by: Antigravity (Google DeepMind).

Re-verified after the final edit: test_vk_ubo_ssbo_fast.py (--cxx clang++, --cxx g++, and default discovery; 11/11 MUST_FAIL controls caught), test_hos_ab.py --cc clang, test_tls_objects.py, test_vk_braces.py, ubo_ssbo_fast.h (clang++ -std=c++20 -Wall -Wextra -Werror -fsyntax-only), and clang++ -fsyntax-only on vk_memory.cpp, vk_draw.cpp, and vk_replay.cpp. (L4/L5 live player-settings baseline and multi-GPU Tier 1 runs remain in Still to test.)

Addressed L1, L2, and L3 in `44ad52d5e`: - **L1 (`Pool::heat` on `ReadSpanTable` hits):** Added `uint64_t* heat_ptr` to `ReadSpan` (populated with `&p.heat` in `maybe_populate_read_span`) and shared `read_span_heat_of(size)` (`RX_VK_MIRROR_HEAT_CAP_KB` cap) between `Pool::heat_of` and `ReadSpanTable::lookup`. Span hits in mode 1 now atomically add `read_span_heat_of(size)` to `*heat_ptr` via `std::atomic_ref<uint64_t>` (`memory_order_relaxed`), while `=check` mode passes `count_heat=false` so `gpu_buffer_bind` doesn't double-count. - **L2 (production span population in tests):** Factored `maybe_populate_read_span` (and `ReadSpanPoolView` / `ReadSpanMirrorState`) into `gpu/vk/ubo_ssbo_fast.h` so `vk_memory.cpp` and `tests/test_vk_ubo_ssbo_fast.py` compile and exercise the same production residency, sync, virtual-address, and stamp guards directly (replacing `fake_maybe_populate`). Added `ignore_sync_guard` and `skip_heat_on_span_hit` `MUST_FAIL` controls (11 total) plus `ignore_sparse_guard` mutating the production header directly, and added `--cxx`/`$CXX`/Windows DLL `PATH` discovery. - **L3 (commit trailer):** Amended the commit with `Assisted-by: Antigravity (Google DeepMind)`. Re-verified after the final edit: `test_vk_ubo_ssbo_fast.py` (`--cxx clang++`, `--cxx g++`, and default discovery; 11/11 `MUST_FAIL` controls caught), `test_hos_ab.py --cc clang`, `test_tls_objects.py`, `test_vk_braces.py`, `ubo_ssbo_fast.h` (`clang++ -std=c++20 -Wall -Wextra -Werror -fsyntax-only`), and `clang++ -fsyntax-only` on `vk_memory.cpp`, `vk_draw.cpp`, and `vk_replay.cpp`. (L4/L5 live player-settings baseline and multi-GPU Tier 1 runs remain in Still to test.)
Owner

@review
@beanstalk

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

Commit 44ad52d · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The fixed CPU-focused settings do not measure the requested device-specific player preset and resolution, and the 15% regression thresholds cannot establish the claimed 1.71% speedup.
⚠️ Note: Check mode reports detected mismatches, but the plan does not require a minimum number of checks or guarantee that every cache and grass branch is exercised.
⚠️ Note: macOS is not covered by the farm's available platform tags.

Started at 15:45 UTC.

Estimate: done in about 9 h, 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 ❌ fail (an outlier) 2 1 2 7.8 → 7.7 (−1%) — none
linux+nvidia ⏳ queued 0 of 1 — — —
windows+amd 🔄 running 0 of 1 — — —
linux+radv ❌ fail (an outlier) 2 1 2 10.7 → 11.1 (+4%) — none
intel ⏳ queued 0 of 1 — — —
steamdeck ⏳ queued 0 of 1 — — —

Why it failed

  • windows+nvidia: binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) log_forbidden_hits.max: 0.0 → 321.0; limit 0.0
  • windows+nvidia: binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) screenshot.max_diff: 0.1 → 0.2; limit 0.2
  • windows+nvidia: binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) log_forbidden_hits.max: 0.0 → 584.0; limit 0.0
  • linux+radv: binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) log_forbidden_hits.max: 0.0 → 516.0; limit 0.0
  • linux+radv: binding-performance field.frametime_1pct_low_ms.max_delta_pct: 18.2 → 23.6 (+29.6%); limit 15.0
  • linux+radv: binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) log_forbidden_hits.max: 0.0 → 473.0; limit 0.0
What was tested

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

The farm will compare main and the PR in the Market and Hyrule Field on NVIDIA, AMD, Intel and Steam Deck systems, including the named Windows and Linux driver paths. Three starts per side will measure 20 seconds per place at an uncapped, fixed 720p render size; two further starts per side will exercise the PR's parity-check mode and compare still pictures. Crashes, reported parity mismatches, excessive picture differences, or frame-time regressions over 15% fail the plan. No tester online now matches linux+nvidia: that target waits for one.

  • Where: windows+nvidia (1-2 reports), linux+nvidia (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_UBO_SSBO_FAST check (PR only).
  • binding-performance: 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 20 s (after 5 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 5 s warm-up); 3 runs on each side.
  • binding-parity: 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-check to compare with main, teleport to Hyrule Field, take the picture field-check to compare with main; 2 runs 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 a picture differs from main by more than 20%; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or frame time (worst 1%) is more than 15% above main.
  • Time: about 58 min of game runs per tester (10 game starts), plus the two builds.
Measurements on `windows+nvidia`, for the PR description

Verdict: fail on windows+nvidia (2 reports): binding-parity log_forbidden_hits.max; binding-parity screenshot.max_diff failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 3070, 621.35.0 AMD Ryzen 5 5600X3D 6-Core Processor, 32 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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)

Before: main @ 495ed9f After: this PR @ 44ad52d
binding-performance · field · frame time (p99) (ms) 7.8 7.7 (−1%)
binding-performance · market · frame time (p99) (ms) 13.8 13.4 (−3%)
binding-performance · forbidden log lines 0.0 0.0
binding-performance · field · frame time (worst 1%) (ms) 8.5 8.5 (−0%)
binding-performance · market · frame time (worst 1%) (ms) 19.7 19.3 (−2%)
binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) · forbidden log lines 0.0 452.5

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_UBO_SSBO_FAST switch the PR adds (set on the PR side only) check not in main the PR's default binding-parity, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** fail on windows+nvidia (2 reports): `binding-parity log_forbidden_hits.max`; `binding-parity screenshot.max_diff` failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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)

| | Before: main @ 495ed9f | After: this PR @ 44ad52d |
|---|---|---|
| binding-performance · field · frame time (p99) (ms) | 7.8 | 7.7 (−1%) |
| binding-performance · market · frame time (p99) (ms) | 13.8 | 13.4 (−3%) |
| binding-performance · forbidden log lines | 0.0 | 0.0 |
| binding-performance · field · frame time (worst 1%) (ms) | 8.5 | 8.5 (−0%) |
| binding-performance · market · frame time (worst 1%) (ms) | 19.7 | 19.3 (−2%) |
| binding-parity · `RX_VK_UBO_SSBO_FAST=check (PR only)` · forbidden log lines | 0.0 | 452.5 |

**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_UBO_SSBO_FAST` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | binding-parity, main without it → the PR with check: not measured | untested |
Measurements on `linux+radv`, for the PR description

Verdict: fail on linux+radv (2 reports): binding-parity log_forbidden_hits.max; binding-performance field.frametime_1pct_low_ms.max_delta_pct (+29.6%) failed.

Hardware: 1: linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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)

Before: main @ 495ed9f After: this PR @ 44ad52d
binding-performance · field · frame time (p99) (ms) 10.7 11.1 (+4%)
binding-performance · market · frame time (p99) (ms) 15.1 14.1 (−7%)
binding-performance · forbidden log lines 0.0 0.0
binding-performance · field · frame time (worst 1%) (ms) 14.1 17.0 (+21%)
binding-performance · market · frame time (worst 1%) (ms) 21.4 19.6 (−8%)
binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only) · forbidden log lines 0.0 494.5

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_UBO_SSBO_FAST switch the PR adds (set on the PR side only) check not in main the PR's default binding-parity, main without it → the PR with check: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** fail on linux+radv (2 reports): `binding-parity log_forbidden_hits.max`; `binding-performance field.frametime_1pct_low_ms.max_delta_pct (+29.6%)` failed.

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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)

| | Before: main @ 495ed9f | After: this PR @ 44ad52d |
|---|---|---|
| binding-performance · field · frame time (p99) (ms) | 10.7 | 11.1 (+4%) |
| binding-performance · market · frame time (p99) (ms) | 15.1 | 14.1 (−7%) |
| binding-performance · forbidden log lines | 0.0 | 0.0 |
| binding-performance · field · frame time (worst 1%) (ms) | 14.1 | 17.0 (+21%) |
| binding-performance · market · frame time (worst 1%) (ms) | 21.4 | 19.6 (−8%) |
| binding-parity · `RX_VK_UBO_SSBO_FAST=check (PR only)` · forbidden log lines | 0.0 | 494.5 |

**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_UBO_SSBO_FAST` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | binding-parity, main without it → the PR with check: not measured | untested |
The testers' hardware
Target Report Ran on
windows+nvidia 1 windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 3070, 621.35.0 AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM
windows+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
linux+radv 1 linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM
linux+radv 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
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>44ad52d</code> (the newer results are in a comment below)</summary> Commit `44ad52d` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2976) ⚠️ **Note:** The fixed CPU-focused settings do not measure the requested device-specific player preset and resolution, and the 15% regression thresholds cannot establish the claimed 1.71% speedup. ⚠️ **Note:** Check mode reports detected mismatches, but the plan does not require a minimum number of checks or guarantee that every cache and grass branch is exercised. ⚠️ **Note:** macOS is not covered by the farm's available platform tags. Started at 15:45 UTC. **Estimate:** done in about 9 h, 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` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_f5ec9f1bfebf3be9) [2](https://beanstalk.magicbean.dev/reports/rp_5e7daf8aeba77df2) | 7.8 → 7.7 (−1%) | — | none | | `linux+nvidia` | ⏳ queued | 0 of 1 | — | — | — | | `windows+amd` | 🔄 running | 0 of 1 | — | — | — | | `linux+radv` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_bb53b00106e53d8d) [2](https://beanstalk.magicbean.dev/reports/rp_5f37e5a267f4d2bc) | 10.7 → 11.1 (+4%) | — | none | | `intel` | ⏳ queued | 0 of 1 | — | — | — | | `steamdeck` | ⏳ queued | 0 of 1 | — | — | — | **Why it failed** - `windows+nvidia`: `binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only)` `log_forbidden_hits.max`: `0.0 → 321.0; limit 0.0` - `windows+nvidia`: `binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only)` `screenshot.max_diff`: `0.1 → 0.2; limit 0.2` - `windows+nvidia`: `binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only)` `log_forbidden_hits.max`: `0.0 → 584.0; limit 0.0` - `linux+radv`: `binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only)` `log_forbidden_hits.max`: `0.0 → 516.0; limit 0.0` - `linux+radv`: `binding-performance` `field.frametime_1pct_low_ms.max_delta_pct`: `18.2 → 23.6 (+29.6%); limit 15.0` - `linux+radv`: `binding-parity · RX_VK_UBO_SSBO_FAST=check (PR only)` `log_forbidden_hits.max`: `0.0 → 473.0; limit 0.0` <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 the Market and Hyrule Field on NVIDIA, AMD, Intel and Steam Deck systems, including the named Windows and Linux driver paths. Three starts per side will measure 20 seconds per place at an uncapped, fixed 720p render size; two further starts per side will exercise the PR's parity-check mode and compare still pictures. Crashes, reported parity mismatches, excessive picture differences, or frame-time regressions over 15% fail the plan. No tester online now matches linux+nvidia: that target waits for one. - **Where:** windows+nvidia (1-2 reports), linux+nvidia (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_UBO_SSBO_FAST `check` (PR only). - **binding-performance:** 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 20 s (after 5 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 5 s warm-up); 3 runs on each side. - **binding-parity:** 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-check to compare with main, teleport to Hyrule Field, take the picture field-check to compare with main; 2 runs 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 a picture differs from main by more than 20%; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or frame time (worst 1%) is more than 15% above main. - **Time:** about 58 min of game runs per tester (10 game starts), plus the two builds. </details> <details><summary>Measurements on `windows+nvidia`, for the PR description</summary> **Verdict:** fail on windows+nvidia (2 reports): `binding-parity log_forbidden_hits.max`; `binding-parity screenshot.max_diff` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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) | | Before: main @ 495ed9f | After: this PR @ 44ad52d | |---|---|---| | binding-performance · field · frame time (p99) (ms) | 7.8 | 7.7 (−1%) | | binding-performance · market · frame time (p99) (ms) | 13.8 | 13.4 (−3%) | | binding-performance · forbidden log lines | 0.0 | 0.0 | | binding-performance · field · frame time (worst 1%) (ms) | 8.5 | 8.5 (−0%) | | binding-performance · market · frame time (worst 1%) (ms) | 19.7 | 19.3 (−2%) | | binding-parity · `RX_VK_UBO_SSBO_FAST=check (PR only)` · forbidden log lines | 0.0 | 452.5 | **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_UBO_SSBO_FAST` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | binding-parity, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on windows+nvidia (2 reports): `binding-parity log_forbidden_hits.max`; `binding-parity screenshot.max_diff` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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) | | Before: main @ 495ed9f | After: this PR @ 44ad52d | |---|---|---| | binding-performance · field · frame time (p99) (ms) | 7.8 | 7.7 (−1%) | | binding-performance · market · frame time (p99) (ms) | 13.8 | 13.4 (−3%) | | binding-performance · forbidden log lines | 0.0 | 0.0 | | binding-performance · field · frame time (worst 1%) (ms) | 8.5 | 8.5 (−0%) | | binding-performance · market · frame time (worst 1%) (ms) | 19.7 | 19.3 (−2%) | | binding-parity · `RX_VK_UBO_SSBO_FAST=check (PR only)` · forbidden log lines | 0.0 | 452.5 | **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_UBO_SSBO_FAST` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | binding-parity, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>Measurements on `linux+radv`, for the PR description</summary> **Verdict:** fail on linux+radv (2 reports): `binding-parity log_forbidden_hits.max`; `binding-performance field.frametime_1pct_low_ms.max_delta_pct (+29.6%)` failed. Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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) | | Before: main @ 495ed9f | After: this PR @ 44ad52d | |---|---|---| | binding-performance · field · frame time (p99) (ms) | 10.7 | 11.1 (+4%) | | binding-performance · market · frame time (p99) (ms) | 15.1 | 14.1 (−7%) | | binding-performance · forbidden log lines | 0.0 | 0.0 | | binding-performance · field · frame time (worst 1%) (ms) | 14.1 | 17.0 (+21%) | | binding-performance · market · frame time (worst 1%) (ms) | 21.4 | 19.6 (−8%) | | binding-parity · `RX_VK_UBO_SSBO_FAST=check (PR only)` · forbidden log lines | 0.0 | 494.5 | **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_UBO_SSBO_FAST` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | binding-parity, main without it → the PR with check: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on linux+radv (2 reports): `binding-parity log_forbidden_hits.max`; `binding-performance field.frametime_1pct_low_ms.max_delta_pct (+29.6%)` failed. Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 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: binding-performance, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0, HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0); binding-parity, from the repository's save market-entrance (vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=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); binding-performance: 3 game starts a side, market 20 s after 5 s warm-up, field 20 s after 5 s warm-up; binding-parity: 2 game starts 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) | | Before: main @ 495ed9f | After: this PR @ 44ad52d | |---|---|---| | binding-performance · field · frame time (p99) (ms) | 10.7 | 11.1 (+4%) | | binding-performance · market · frame time (p99) (ms) | 15.1 | 14.1 (−7%) | | binding-performance · forbidden log lines | 0.0 | 0.0 | | binding-performance · field · frame time (worst 1%) (ms) | 14.1 | 17.0 (+21%) | | binding-performance · market · frame time (worst 1%) (ms) | 21.4 | 19.6 (−8%) | | binding-parity · `RX_VK_UBO_SSBO_FAST=check (PR only)` · forbidden log lines | 0.0 | 494.5 | **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_UBO_SSBO_FAST` | switch the PR adds (set on the PR side only) | `check` | not in main | the PR's default | binding-parity, main without it → the PR with check: not measured | untested | ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_f5ec9f1bfebf3be9) | windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 3070, 621.35.0` `AMD Ryzen 5 5600X3D 6-Core Processor, 32 GB RAM` | | `windows+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_5e7daf8aeba77df2) | 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` | | `linux+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_bb53b00106e53d8d) | linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` | | `linux+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_5f37e5a267f4d2bc) | linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | </details> </details>
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The heat accounting and test changes address the editable ledger items, and the commit now records AI assistance. The performance gain against the base at representative settings and coverage of the remaining Tier 1 systems are still outstanding. Recommend approval; not approved on the forge.

The change caches read-only buffer bindings and skips unnecessary uniform-buffer work to reduce renderer overhead. It adds cache and synchronization complexity; its reported gain has not yet been established against the base at player settings.

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

  • L4: The reported A/B does not establish the gain against the base at settings players use. When: Both measured sides run the PR build, and the 50% resolution Market run can amplify CPU-side savings compared with the normal preset and output resolution. Do: Compare the named base and PR builds in interleaved runs at the device's normal preset and resolution, including the target and a heavy area, with FPS, lows and frame times.
  • L5: The default-on renderer path has not been exercised on AMD Windows or Linux, NVIDIA Linux, or Steam Deck. When: These systems use the changed buffer binding and mirror paths, while the only reported game and parity runs are on Windows with NVIDIA. Do: Run representative gameplay and check-mode parity on the affected Tier 1 systems, and compare performance and frame pacing with the base.

Since the last review (on 23ba22c0ec)
Resolved: L1 (A span hit skips the pool heat accounting performed by gpu_buffer_bind for distinct bindin…); L2 (The span safety tests exercise a reimplementation of span population rather than the produ…); L3 (The AI assistance is named in the PR description but the commit has no assistance trailer.)
Still open: L4 (The reported A/B does not establish the gain against the base at settings players use.); L5 (The default-on renderer path has not been exercised on AMD Windows or Linux, NVIDIA Linux,…)

Checks: Still running: 10 checks.

Also noticed (1; not asked for, not blocking)
  • The maintainer requested a Test Farm run; the outstanding hardware coverage remains to be arranged.
More: does it help, other systems, switches, what was read

Does it help: Unproven against the base: the reported Windows RTX 4060 in-build A/B shows +1.71% FPS and a 0.21 ms reduction in mean frame time over five runs, but compares switch settings in the same PR build at 50% resolution. No representative base-versus-head result was supplied.

Other systems: The default-on Vulkan path affects Windows and Linux across GPU vendors, including Steam Deck. Windows NVIDIA Market smoke and parity runs were reported; AMD Windows and Linux, NVIDIA Linux, and Steam Deck runs remain outstanding.

Switches: RX_VK_UBO_SSBO_FAST is added, defaults on, and accepts 0 and check modes. Its default still needs representative base measurements and the outstanding hardware runs.

Reviewed: 44ad52d5ea against 495ed9fe2a: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the commit message, the changed span header and relevant binding and heat-accounting code. Inspected the supplied range-diff and test changes; the full changed renderer and test files were not read. docs/review-checklist.md does not exist.; nothing run (a code review).

Checked and fine:

  • The test exercises the production sparse, synchronization and stamp guards.
  • Check mode avoids counting heat twice.

Testing: The author reports game-free checks and Windows NVIDIA game runs. No code or tests were run during this review; CI checks are still running. The Test Farm could not be contacted because the network is closed.

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


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 heat accounting and test changes address the editable ledger items, and the commit now records AI assistance. The performance gain against the base at representative settings and coverage of the remaining Tier 1 systems are still outstanding. Recommend approval; not approved on the forge. The change caches read-only buffer bindings and skips unnecessary uniform-buffer work to reduce renderer overhead. It adds cache and synchronization complexity; its reported gain has not yet been established against the base at player settings. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported A/B does not establish the gain against the base at settings players use. *When:* Both measured sides run the PR build, and the 50% resolution Market run can amplify CPU-side savings compared with the normal preset and output resolution. **Do:** Compare the named base and PR builds in interleaved runs at the device's normal preset and resolution, including the target and a heavy area, with FPS, lows and frame times. - **L5**: The default-on renderer path has not been exercised on AMD Windows or Linux, NVIDIA Linux, or Steam Deck. *When:* These systems use the changed buffer binding and mirror paths, while the only reported game and parity runs are on Windows with NVIDIA. **Do:** Run representative gameplay and check-mode parity on the affected Tier 1 systems, and compare performance and frame pacing with the base. **Since the last review** (on 23ba22c0eca6) Resolved: L1 (A span hit skips the pool heat accounting performed by gpu_buffer_bind for distinct bindin…); L2 (The span safety tests exercise a reimplementation of span population rather than the produ…); L3 (The AI assistance is named in the PR description but the commit has no assistance trailer.) Still open: L4 (The reported A/B does not establish the gain against the base at settings players use.); L5 (The default-on renderer path has not been exercised on AMD Windows or Linux, NVIDIA Linux,…) **Checks:** Still running: 10 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The maintainer requested a Test Farm run; the outstanding hardware coverage remains to be arranged. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the base: the reported Windows RTX 4060 in-build A/B shows +1.71% FPS and a 0.21 ms reduction in mean frame time over five runs, but compares switch settings in the same PR build at 50% resolution. No representative base-versus-head result was supplied. **Other systems:** The default-on Vulkan path affects Windows and Linux across GPU vendors, including Steam Deck. Windows NVIDIA Market smoke and parity runs were reported; AMD Windows and Linux, NVIDIA Linux, and Steam Deck runs remain outstanding. **Switches:** RX_VK_UBO_SSBO_FAST is added, defaults on, and accepts 0 and check modes. Its default still needs representative base measurements and the outstanding hardware runs. **Reviewed:** 44ad52d5eaad against 495ed9fe2aaa: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the commit message, the changed span header and relevant binding and heat-accounting code. Inspected the supplied range-diff and test changes; the full changed renderer and test files were not read. docs/review-checklist.md does not exist.; nothing run (a code review). **Checked and fine:** - The test exercises the production sparse, synchronization and stamp guards. - Check mode avoids counting heat twice. **Testing:** The author reports game-free checks and Windows NVIDIA game runs. No code or tests were run during this review; CI checks are still running. The Test Farm could not be contacted because the network is closed. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner

Independent Linux Market A/B on PR head 44ad52d5eaad. RX_VK_UBO_SSBO_FAST defaults to on in this revision.

Inconclusive in this short capture. Median average FPS changed by +2.19%.

Metric Off (0) On (1)
Average FPS, each run 119.61 / 108.01 123.66 / 108.93
Average FPS, median 113.81 116.29
1% low FPS (1000 ÷ p99) 75.08 76.56
Median frame time 8.37 ms 8.25 ms
p99 frame time 13.48 ms 13.37 ms
Frames of 50 ms or more, each run 3 / 5 0 / 5

Market (child), Linux 7.3.3-1-cachyos, RTX 3090, NVIDIA 620.70.06, 1280x720, 50% (640x360), uncapped with V-Sync and frame generation off. Two interleaved 30-second captures per side on the same PR binary, each after pipeline warm-up. Frame-time and 1% low rows report the median across the two captures.

The repeats on at least one side differ by more than 10%, so the average FPS delta is sensitive to the run chosen.

Independent Linux Market A/B on PR head `44ad52d5eaad`. `RX_VK_UBO_SSBO_FAST` defaults to on in this revision. **Inconclusive in this short capture.** Median average FPS changed by **+2.19%**. | Metric | Off (`0`) | On (`1`) | |---|---:|---:| | Average FPS, each run | 119.61 / 108.01 | 123.66 / 108.93 | | Average FPS, median | 113.81 | 116.29 | | 1% low FPS (1000 ÷ p99) | 75.08 | 76.56 | | Median frame time | 8.37 ms | 8.25 ms | | p99 frame time | 13.48 ms | 13.37 ms | | Frames of 50 ms or more, each run | 3 / 5 | 0 / 5 | Market (child), Linux 7.3.3-1-cachyos, RTX 3090, NVIDIA 620.70.06, 1280x720, 50% (640x360), uncapped with V-Sync and frame generation off. Two interleaved 30-second captures per side on the same PR binary, each after pipeline warm-up. Frame-time and 1% low rows report the median across the two captures. The repeats on at least one side differ by more than 10%, so the average FPS delta is sensitive to the run chosen.
Owner
@rebase
Member

I rebased this pull request onto main (d63291898b): the new head is 2d9f4bd891.

Conflicts resolved

  • gpu/vk/vk_draw.cpp: Kept both fast-path headers and recording initialization calls.
  • tests/test_hos_ab.py: Kept both switch registrations.

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` (d63291898b91): the new head is 2d9f4bd891ed. **Conflicts resolved** - gpu/vk/vk_draw.cpp: Kept both fast-path headers and recording initialization calls. - tests/test_hos_ab.py: Kept both switch registrations. 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-ubo-ssbo-fast from 44ad52d5ea
Some checks failed
PR description / Title and description (pull_request_target) Successful in 4s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 2/1 fail
beanstalk/linux+nvidia 0/1 pass, 0 running, 2 queued
beanstalk/windows+amd 0/1 pass, 1 running, 1 queued
beanstalk/linux+radv 2/1 fail
beanstalk/intel 0/1 pass, 0 running, 2 queued
beanstalk/steamdeck 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 2d9f4bd891
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Failing after 12s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 14s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m33s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 4m56s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m28s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m43s
CI / Website build and checks (pull_request) Failing after 36s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 19m30s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 39m56s
2026-12-02 16:52:48 +00:00
Compare
Member

Beanstalk test farm

Commit 2d9f4bd · 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 `2d9f4bd` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2976) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
HumanBean deleted branch perf/vk-ubo-ssbo-fast 2026-12-02 16:53:11 +00:00
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported gain has not been measured against the base at representative player settings, and the default-on path still needs coverage on AMD and Steam Deck. The independent NVIDIA Linux run is useful but was inconclusive for performance. Recommend approval; not approved on the forge.

The change reduces Vulkan uniform and read-only storage buffer binding work through an overlap envelope, a cached grass setting and a span table. It adds cache invalidation and parity-checking complexity in exchange for a reported improvement that still needs a base comparison.

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

  • L4: The reported A/B does not establish the gain against the base at settings players use. When: Both measured sides run the PR build, and the 50% resolution Market run can amplify CPU-side savings compared with the normal preset and output resolution. Do: Compare the named base and PR builds in interleaved runs at the device's normal preset and resolution, including the target and a heavy area, with FPS, lows and frame times.
  • L5: The default-on renderer path has not been exercised on AMD Windows, AMD Linux or Steam Deck. When: Those systems run the new buffer-binding path by default, but no game run on them is reported. Do: Run the default path and check mode on AMD Windows, AMD Linux and Steam Deck and report the results.

Since the last review (on 44ad52d5ea)
Still open: L4 (The reported A/B does not establish the gain against the base at settings players use.); L5 (The default-on renderer path has not been exercised on AMD Windows, AMD Linux or Steam Dec…)

Checks: Still running: 11 checks.

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

Does it help: Unproven against the base. The author's Windows RTX 4060 test reported +1.71% FPS and a 0.21 ms mean frame-time reduction over five 90-second runs, but compared switch modes in one PR build at 50% resolution. An independent Linux RTX 3090 test reported +2.19% median average FPS across two runs per side, with over 10% variation between repeats.

Other systems: The default-on Vulkan path affects buffer binding and uniform updates across GPU vendors and operating systems. Windows NVIDIA has a live parity run with zero reported mismatches; NVIDIA Linux has an independent short A/B run. AMD Windows, AMD Linux and Steam Deck runs remain missing.

Switches: RX_VK_UBO_SSBO_FAST is added and defaults to on; 0 uses the legacy paths and check compares results. The switch is listed in switches.def, but the default's coverage remains incomplete on the hardware named in L5.

Reviewed: 2d9f4bd891 against d63291898b: Read the repository rules and the relevant renderer diff; reviewed the changed draw paths and switch wiring. Skimmed the test and recorded run claims. The large renderer files and test files were not read in full, and the full template and referenced standards were not reviewed.; nothing run (a code review).

Checked and fine:

  • The independent NVIDIA Linux A/B exercised the default-on path without a reported crash.
  • The PR reports zero mismatches across more than 51 million Windows NVIDIA check-mode checks.

Testing: No commands from the project or tests were run. The author reports game-free checks and Windows NVIDIA game runs; the independent Linux capture is recorded as inconclusive. CI is still running.

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


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. The reported gain has not been measured against the base at representative player settings, and the default-on path still needs coverage on AMD and Steam Deck. The independent NVIDIA Linux run is useful but was inconclusive for performance. Recommend approval; not approved on the forge. The change reduces Vulkan uniform and read-only storage buffer binding work through an overlap envelope, a cached grass setting and a span table. It adds cache invalidation and parity-checking complexity in exchange for a reported improvement that still needs a base comparison. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported A/B does not establish the gain against the base at settings players use. *When:* Both measured sides run the PR build, and the 50% resolution Market run can amplify CPU-side savings compared with the normal preset and output resolution. **Do:** Compare the named base and PR builds in interleaved runs at the device's normal preset and resolution, including the target and a heavy area, with FPS, lows and frame times. - **L5**: The default-on renderer path has not been exercised on AMD Windows, AMD Linux or Steam Deck. *When:* Those systems run the new buffer-binding path by default, but no game run on them is reported. **Do:** Run the default path and check mode on AMD Windows, AMD Linux and Steam Deck and report the results. **Since the last review** (on 44ad52d5eaad) Still open: L4 (The reported A/B does not establish the gain against the base at settings players use.); L5 (The default-on renderer path has not been exercised on AMD Windows, AMD Linux or Steam Dec…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven against the base. The author's Windows RTX 4060 test reported +1.71% FPS and a 0.21 ms mean frame-time reduction over five 90-second runs, but compared switch modes in one PR build at 50% resolution. An independent Linux RTX 3090 test reported +2.19% median average FPS across two runs per side, with over 10% variation between repeats. **Other systems:** The default-on Vulkan path affects buffer binding and uniform updates across GPU vendors and operating systems. Windows NVIDIA has a live parity run with zero reported mismatches; NVIDIA Linux has an independent short A/B run. AMD Windows, AMD Linux and Steam Deck runs remain missing. **Switches:** RX_VK_UBO_SSBO_FAST is added and defaults to on; 0 uses the legacy paths and check compares results. The switch is listed in switches.def, but the default's coverage remains incomplete on the hardware named in L5. **Reviewed:** 2d9f4bd891ed against d63291898b91: Read the repository rules and the relevant renderer diff; reviewed the changed draw paths and switch wiring. Skimmed the test and recorded run claims. The large renderer files and test files were not read in full, and the full template and referenced standards were not reviewed.; nothing run (a code review). **Checked and fine:** - The independent NVIDIA Linux A/B exercised the default-on path without a reported crash. - The PR reports zero mismatches across more than 51 million Windows NVIDIA check-mode checks. **Testing:** No commands from the project or tests were run. The author reports game-free checks and Windows NVIDIA game runs; the independent Linux capture is recorded as inconclusive. CI is still running. **Overlaps and merge order:** Not checked; the network is closed. </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>
Owner

AMD Lab Market A/B on PR head 2d9f4bd891ed, using RX_VK_UBO_SSBO_FAST=0 and RX_VK_UBO_SSBO_FAST=1 on the same build.

Faster in these captures. Median average FPS changed by +5.93%.

Metric A (0) B (1)
Average FPS, each capture 53.27 / 53.65 / 54.36 56.67 / 57.39 / 56.83
Average FPS, median 53.65 56.83
1% low FPS (1000 ÷ p99), median 27.03 46.08
Median frame time 18.23 ms 17.41 ms
p99 frame time, median 37.00 ms 21.70 ms
Frames of 50 ms or more, each capture 9 / 15 / 5 1 / 0 / 2

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 and 50% (640x360) render scale, uncapped with V-Sync and frame generation off. Three alternating pairs, 40 seconds per capture after warm-up.

After warm-up, the harness still flagged pipeline or shader activity in 20 / 45 / 18 frames on side A and 2 / 3 / 2 on side B across the three captures. The FPS and tail numbers include those frames.

AMD Lab Market A/B on PR head `2d9f4bd891ed`, using `RX_VK_UBO_SSBO_FAST=0` and `RX_VK_UBO_SSBO_FAST=1` on the same build. **Faster in these captures.** Median average FPS changed by **+5.93%**. | Metric | A (`0`) | B (`1`) | |---|---:|---:| | Average FPS, each capture | 53.27 / 53.65 / 54.36 | 56.67 / 57.39 / 56.83 | | Average FPS, median | 53.65 | 56.83 | | 1% low FPS (1000 ÷ p99), median | 27.03 | 46.08 | | Median frame time | 18.23 ms | 17.41 ms | | p99 frame time, median | 37.00 ms | 21.70 ms | | Frames of 50 ms or more, each capture | 9 / 15 / 5 | 1 / 0 / 2 | 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 and 50% (640x360) render scale, uncapped with V-Sync and frame generation off. Three alternating pairs, 40 seconds per capture after warm-up. After warm-up, the harness still flagged pipeline or shader activity in 20 / 45 / 18 frames on side A and 2 / 3 / 2 on side B across the three captures. The FPS and tail numbers include those frames.
Author
Contributor

About the farm's binding-parity · RX_VK_UBO_SSBO_FAST=check failures (log_forbidden_hits 321 and 584 on windows+nvidia, 516 and 473 on linux+radv): those hits are the check's periodic summary lines, not mismatches.

  • In check mode, ubo_ssbo_fast_log_summary_if_due() (gpu/vk/vk_draw.cpp:4964-4971 on main @ 1e782fa4b) logs vk: ubo_ssbo_fast check: N checks, … hits, … misses, … ub_bypasses, M mismatches once every 100,000 checks. The word mismatches in that line matches the farm's forbidden pattern, even when M is 0.
  • The PR-side log of report rp_f5ec9f1bfebf3be9 (GTX windows+nvidia) ends with ubo_ssbo_fast check: 32200000 checks … 0 mismatches, then 32,300,000 and 32,400,000, all with 0 mismatches. That is about 324 summary lines over the run; the two PR runs counted 318 and 324 hits.
  • A real mismatch logs a different line: ubo_ssbo_fast span mismatch (…), ub_active mismatch (…) or ssbo addr/size mismatch (…) (vk_draw.cpp:4997, :5132, :5693). None of those appear in the log ends I read.

So the check-mode cells say the parity check ran and found nothing. For the farm to pass a check-mode run, either its pattern has to skip these summary lines or the summary has to be worded differently. I haven't changed either.

Measurements since: the AMD Lab RX 580 pairs were faster (+5.93% median FPS, p99 37.00 → 21.70 ms). HumanBean's Linux RTX 3090 pairs were inconclusive (+2.19%, with repeats more than 10% apart). The farm's linux+radv Field 1% low (+29.6%) failed on one PC in that earlier run; I have not followed it up.

About the farm's `binding-parity · RX_VK_UBO_SSBO_FAST=check` failures (`log_forbidden_hits` 321 and 584 on `windows+nvidia`, 516 and 473 on `linux+radv`): those hits are the check's periodic summary lines, not mismatches. - In check mode, `ubo_ssbo_fast_log_summary_if_due()` (`gpu/vk/vk_draw.cpp:4964-4971` on `main` @ `1e782fa4b`) logs `vk: ubo_ssbo_fast check: N checks, … hits, … misses, … ub_bypasses, M mismatches` once every 100,000 checks. The word `mismatches` in that line matches the farm's forbidden pattern, even when M is 0. - The PR-side log of [report rp_f5ec9f1bfebf3be9](https://beanstalk.magicbean.dev/reports/rp_f5ec9f1bfebf3be9) (GTX `windows+nvidia`) ends with `ubo_ssbo_fast check: 32200000 checks … 0 mismatches`, then 32,300,000 and 32,400,000, all with `0 mismatches`. That is about 324 summary lines over the run; the two PR runs counted 318 and 324 hits. - A real mismatch logs a different line: `ubo_ssbo_fast span mismatch (…)`, `ub_active mismatch (…)` or `ssbo addr/size mismatch (…)` (`vk_draw.cpp:4997`, `:5132`, `:5693`). None of those appear in the log ends I read. So the check-mode cells say the parity check ran and found nothing. For the farm to pass a check-mode run, either its pattern has to skip these summary lines or the summary has to be worded differently. I haven't changed either. Measurements since: the AMD Lab RX 580 pairs were faster (+5.93% median FPS, p99 37.00 → 21.70 ms). HumanBean's Linux RTX 3090 pairs were inconclusive (+2.19%, with repeats more than 10% apart). The farm's `linux+radv` Field 1% low (+29.6%) failed on one PC in that earlier run; I have not followed it up.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 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!2976
No description provided.