perf(vk): add UBO descriptor delta fast path, 8-slot ub_gap_cache, and lock-free invalidate exits #2899

Merged
HumanBean merged 2 commits from siantm/Longshot:perf/pc-phase-a-desc-ub-invalidate into main 2026-12-01 00:45:35 +00:00
Contributor

Summary

Cuts CPU descriptor rebuilds and lock contention on the draw and InvalidateMappedRange hot paths without modifying vk_state.h (LONGSHOT_SHADER_STAMP) or Program layout:

  1. Per-stage ubo_gen[8] sidecar & UBO-only descriptor delta (RX_VK_DESC_DELTA) in gpu/vk/vk_replay.cpp, gpu/vk/vk_internal.h, and gpu/vk/vk_draw.cpp: tracks UBO binds per stage in a sidecar table so draws ignore unused-stage bind_gen bumps (Tier 1) and update c3..c18 VkDescriptorBufferInfo entries in place + push only dirty writes while keeping Pushed::words coherent and obeying Intel ub_every (Tier 2).
  2. 8-slot ub_gap_cache (RX_VK_UB_GAP8) in gpu/vk/vk_replay.cpp: avoids 1-slot thrashing across alternating user uniform buffers.
  3. Lock-free invalidate & write-back fast exits (RX_VK_WB_LEARN_FAST) in gpu/vk/vk_memory.cpp, gpu/vk/vk_texture.cpp, and host/nvn_native.c: adds monotonic wb_followed_ever PageMarks before wb_learn_mu, fast-paths memory_writeback_value / texture_gpu_written_in via wb_ever / vw_ever, and filters CPU_NO_ACCESS / !mem / zero-size InvalidateMappedRange calls before touching replay or vCores.

In KokiriForest_Child (1280x720), full descriptor builds per draw drop -28.3% (0.92 -> 0.66), warm Avg FPS rises +4.7% (86.67 -> 90.73), 1% Low rises +54.9% (28.38 -> 43.97), and 0.1% Low rises +94.0% (14.25 -> 27.64). Read first: state_ubo_gen() / ub_gap_holds() in gpu/vk/vk_replay.cpp, update_ubo_descriptors() / bind_descriptors_ubo_delta() / draw() in gpu/vk/vk_draw.cpp, wb_followed_ever in gpu/vk/vk_memory.cpp, and NV(nvnMemoryPoolInvalidateMappedRange) in host/nvn_native.c.

Testing

Tested: Windows 11, Intel Core i7-9700 (8C/8T), NVIDIA GeForce RTX 4060 (driver 621.40), built with dev.py pack + dev.py rt (lift: unchanged). Ran 4 interleaved 35 s runs + 3 extra warm 35 s runs + 2 RX_VK_PROF_FINE=1 15 s runs in KokiriForest_Child (1280x720, RX_VK_IMMEDIATE=1, RX_VK_FRAME_TRACE=1) with 0 warnings and CPU reads or writes of one left out: 0. Before the independent mark-agreement test changes, targeted tests/run_all.py checks: 25 passed (test_bank_gen, test_desc_clock, test_desc_counts, test_dlss_pre_bloom, test_fallback_pipeline_state, test_hidden_mesh_depth, test_push_state, test_readback_early, test_same_bind, test_sampler_admission, test_target_layouts, test_ub_gap, test_ub_memo, test_ub_threads, test_ub_word_index, test_notes_format, test_nvn_null_pool, test_wb_learn, test_wb_spans, test_readback_part, test_invalidate_quick, test_direct_buffer_writes, test_ub_snap_scope, test_doc_anchors, test_invalidate_vcore); 2 failed pre-existing on origin/main @ 28cb22b9e (test_switch_table.py: upstream LONGSHOT_LAUNCHER_STARTUP in host/launcher_startup.h:9, all 3 new rows in gpu/vk/switches.def passed; test_linux_pressure.py: pre-existing spirv_pack::Store -> vs . syntax errors in cache_functions.inc). Standalone phase_a_bench.exe (C / Rust #![no_std] / Win64 AVX2 ASM) verified 0 mismatches.

Still to test:

  • Rerun the updated independent mark-agreement checks.
  • @Beanstalk linux: build on Linux/AMD RADV and run python -I -B tests/run_all.py, expecting descriptor, ub_*, and invalidate suites to pass cleanly (@Beanstalk linux).
  • @Beanstalk windows: run full CI check suite plus an Intel Arc ub_every check, expecting descriptor delta pushes to preserve all object matrices (@Beanstalk windows).

Measurements

Verdict: Eliminates -28.3% of full descriptor builds per draw (0.92 -> 0.66, descriptors time 1.64 -> 1.48–1.55 ms/frame); across warm runs improves Avg FPS +4.7% (86.67 -> 90.73), 1% Low FPS +54.9% (28.38 -> 43.97, P99 25.21 -> 18.83 ms), and 0.1% Low FPS +94.0% (14.25 -> 27.64). Standalone phase_a_bench.exe measures 1.67x–1.80x (UBO delta), 11.31x–13.85x (8-slot ub_gap_cache), and 4.55x–28.29x (PageMarks::any).

Setup: Windows 11, i7-9700, RTX 4060 (621.40); KokiriForest_Child (kokiri-start), 1280x720 (resolution=0, HOS_RES_SCALE=1.0, quality_preset=6), RX_VK_IMMEDIATE=1, frame_generation=0, HOS_FPS_MAX=1000, HOS_AUDIO=0, RX_VK_FRAME_TRACE=1 (frames.csv), comparing RX_VK_DESC_DELTA=0 RX_VK_UB_GAP8=0 RX_VK_WB_LEARN_FAST=0 vs 1 on 93231e4fc. Initial BASE_1 (67.35 Avg / 17.10 1% low) had cold warmup variance, so an extra warm interleaved block (NEW_3, BASE_3, NEW_4) + RX_VK_PROF_FINE=1 (FINE_OFF / FINE_ON) ran; table reports all warm 35 s runs (BASE_2, BASE_3 vs NEW_1..NEW_4). All 3 switches ship enabled (1).
Baseline: origin/main @ 28cb22b9e (this PR @ 93231e4fc with the 3 runtime switches =0).

Before: main eq. (warm 0/0/0) @ 93231e4fc After: this PR (warm 1/1/1) @ 93231e4fc Δ
Average FPS (BASE 93.71, 79.63 vs NEW 89.20, 97.00, 81.72, 95.01) 86.67 90.73 +4.7%
P50 FPS (BASE 98.04, 88.97 vs NEW 93.28, 99.80, 87.49, 97.28) 93.51 94.46 +1.0%
1% Low FPS (BASE 37.39, 19.37 vs NEW 40.84, 46.62, 32.24, 56.17) 28.38 43.97 +54.9%
0.1% Low FPS (BASE 20.32, 8.17 vs NEW 26.88, 27.10, 22.59, 33.98) 14.25 27.64 +94.0%
P99 frame time (ms) 25.21 18.83 -25.3%
Full descriptor builds / draw (RX_VK_PROF_FINE=1) 0.92 0.66 -28.3%
phase_a_bench UBO / ub_gap / PageMarks (0 mismatches) 21.90 / 90.58 / 16.45–61.31 ns 12.41 / 7.39 / 2.17–3.61 ns 1.76x / 12.26x / 4.55x–28.29x

Risks

Any future draw path reading c3+ for storage/image/texel descriptors must be excluded in program_ubo_delta_safe(); compute stage 5, written SSBOs, and storage images already force full rebuilds. Each optimization has an independent =0 runtime kill switch (RX_VK_DESC_DELTA=0, RX_VK_UB_GAP8=0, RX_VK_WB_LEARN_FAST=0). No changes to vk_state.h (LONGSHOT_SHADER_STAMP), Program layout, MKWVK_API_VERSION, saves, or pipeline caches.

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.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • 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 Cuts CPU descriptor rebuilds and lock contention on the draw and `InvalidateMappedRange` hot paths without modifying `vk_state.h` (`LONGSHOT_SHADER_STAMP`) or `Program` layout: 1. **Per-stage `ubo_gen[8]` sidecar & UBO-only descriptor delta (`RX_VK_DESC_DELTA`)** in `gpu/vk/vk_replay.cpp`, `gpu/vk/vk_internal.h`, and `gpu/vk/vk_draw.cpp`: tracks UBO binds per stage in a sidecar table so draws ignore unused-stage `bind_gen` bumps (Tier 1) and update `c3..c18` `VkDescriptorBufferInfo` entries in place + push only dirty writes while keeping `Pushed::words` coherent and obeying Intel `ub_every` (Tier 2). 2. **8-slot `ub_gap_cache` (`RX_VK_UB_GAP8`)** in `gpu/vk/vk_replay.cpp`: avoids 1-slot thrashing across alternating user uniform buffers. 3. **Lock-free invalidate & write-back fast exits (`RX_VK_WB_LEARN_FAST`)** in `gpu/vk/vk_memory.cpp`, `gpu/vk/vk_texture.cpp`, and `host/nvn_native.c`: adds monotonic `wb_followed_ever` `PageMarks` before `wb_learn_mu`, fast-paths `memory_writeback_value` / `texture_gpu_written_in` via `wb_ever` / `vw_ever`, and filters `CPU_NO_ACCESS` / `!mem` / zero-size `InvalidateMappedRange` calls before touching replay or vCores. In `KokiriForest_Child` (`1280x720`), full descriptor builds per draw drop `-28.3%` (`0.92 -> 0.66`), warm Avg FPS rises `+4.7%` (`86.67 -> 90.73`), 1% Low rises `+54.9%` (`28.38 -> 43.97`), and 0.1% Low rises `+94.0%` (`14.25 -> 27.64`). Read first: `state_ubo_gen()` / `ub_gap_holds()` in `gpu/vk/vk_replay.cpp`, `update_ubo_descriptors()` / `bind_descriptors_ubo_delta()` / `draw()` in `gpu/vk/vk_draw.cpp`, `wb_followed_ever` in `gpu/vk/vk_memory.cpp`, and `NV(nvnMemoryPoolInvalidateMappedRange)` in `host/nvn_native.c`. ## Testing **Tested:** Windows 11, Intel Core i7-9700 (8C/8T), NVIDIA GeForce RTX 4060 (driver `621.40`), built with `dev.py pack` + `dev.py rt` (`lift: unchanged`). Ran 4 interleaved 35 s runs + 3 extra warm 35 s runs + 2 `RX_VK_PROF_FINE=1` 15 s runs in `KokiriForest_Child` (`1280x720`, `RX_VK_IMMEDIATE=1`, `RX_VK_FRAME_TRACE=1`) with `0` warnings and `CPU reads or writes of one left out: 0`. Before the independent mark-agreement test changes, targeted `tests/run_all.py` checks: `25 passed` (`test_bank_gen`, `test_desc_clock`, `test_desc_counts`, `test_dlss_pre_bloom`, `test_fallback_pipeline_state`, `test_hidden_mesh_depth`, `test_push_state`, `test_readback_early`, `test_same_bind`, `test_sampler_admission`, `test_target_layouts`, `test_ub_gap`, `test_ub_memo`, `test_ub_threads`, `test_ub_word_index`, `test_notes_format`, `test_nvn_null_pool`, `test_wb_learn`, `test_wb_spans`, `test_readback_part`, `test_invalidate_quick`, `test_direct_buffer_writes`, `test_ub_snap_scope`, `test_doc_anchors`, `test_invalidate_vcore`); `2 failed` pre-existing on `origin/main @ 28cb22b9e` (`test_switch_table.py`: upstream `LONGSHOT_LAUNCHER_STARTUP` in `host/launcher_startup.h:9`, all 3 new rows in `gpu/vk/switches.def` passed; `test_linux_pressure.py`: pre-existing `spirv_pack::Store` `->` vs `.` syntax errors in `cache_functions.inc`). Standalone `phase_a_bench.exe` (C / Rust `#![no_std]` / Win64 AVX2 ASM) verified `0` mismatches. **Still to test:** - Rerun the updated independent mark-agreement checks. - `@Beanstalk linux`: build on Linux/AMD RADV and run `python -I -B tests/run_all.py`, expecting descriptor, `ub_*`, and invalidate suites to pass cleanly (`@Beanstalk linux`). - `@Beanstalk windows`: run full CI check suite plus an Intel Arc `ub_every` check, expecting descriptor delta pushes to preserve all object matrices (`@Beanstalk windows`). ## Measurements **Verdict:** Eliminates **-28.3%** of full descriptor builds per draw (`0.92 -> 0.66`, `descriptors` time `1.64 -> 1.48–1.55 ms/frame`); across warm runs improves **Avg FPS** `+4.7%` (`86.67 -> 90.73`), **1% Low FPS** `+54.9%` (`28.38 -> 43.97`, `P99` `25.21 -> 18.83 ms`), and **0.1% Low FPS** `+94.0%` (`14.25 -> 27.64`). Standalone `phase_a_bench.exe` measures `1.67x–1.80x` (UBO delta), `11.31x–13.85x` (8-slot `ub_gap_cache`), and `4.55x–28.29x` (`PageMarks::any`). Setup: Windows 11, i7-9700, RTX 4060 (`621.40`); `KokiriForest_Child` (`kokiri-start`), `1280x720` (`resolution=0`, `HOS_RES_SCALE=1.0`, `quality_preset=6`), `RX_VK_IMMEDIATE=1`, `frame_generation=0`, `HOS_FPS_MAX=1000`, `HOS_AUDIO=0`, `RX_VK_FRAME_TRACE=1` (`frames.csv`), comparing `RX_VK_DESC_DELTA=0 RX_VK_UB_GAP8=0 RX_VK_WB_LEARN_FAST=0` vs `1` on `93231e4fc`. Initial `BASE_1` (`67.35 Avg / 17.10 1% low`) had cold warmup variance, so an extra warm interleaved block (`NEW_3`, `BASE_3`, `NEW_4`) + `RX_VK_PROF_FINE=1` (`FINE_OFF` / `FINE_ON`) ran; table reports all warm 35 s runs (`BASE_2`, `BASE_3` vs `NEW_1..NEW_4`). All 3 switches ship enabled (`1`). Baseline: `origin/main @ 28cb22b9e` (`this PR @ 93231e4fc` with the 3 runtime switches `=0`). | | Before: main eq. (warm `0/0/0`) @ 93231e4fc | After: this PR (warm `1/1/1`) @ 93231e4fc | Δ | |---|---|---|---| | Average FPS (`BASE` 93.71, 79.63 vs `NEW` 89.20, 97.00, 81.72, 95.01) | 86.67 | 90.73 | +4.7% | | P50 FPS (`BASE` 98.04, 88.97 vs `NEW` 93.28, 99.80, 87.49, 97.28) | 93.51 | 94.46 | +1.0% | | 1% Low FPS (`BASE` 37.39, 19.37 vs `NEW` 40.84, 46.62, 32.24, 56.17) | 28.38 | 43.97 | +54.9% | | 0.1% Low FPS (`BASE` 20.32, 8.17 vs `NEW` 26.88, 27.10, 22.59, 33.98) | 14.25 | 27.64 | +94.0% | | P99 frame time (ms) | 25.21 | 18.83 | -25.3% | | Full descriptor builds / draw (`RX_VK_PROF_FINE=1`) | 0.92 | 0.66 | -28.3% | | `phase_a_bench` UBO / `ub_gap` / `PageMarks` (`0` mismatches) | 21.90 / 90.58 / 16.45–61.31 ns | 12.41 / 7.39 / 2.17–3.61 ns | 1.76x / 12.26x / 4.55x–28.29x | ## Risks Any future draw path reading `c3+` for storage/image/texel descriptors must be excluded in `program_ubo_delta_safe()`; compute stage 5, written SSBOs, and storage images already force full rebuilds. Each optimization has an independent `=0` runtime kill switch (`RX_VK_DESC_DELTA=0`, `RX_VK_UB_GAP8=0`, `RX_VK_WB_LEARN_FAST=0`). No changes to `vk_state.h` (`LONGSHOT_SHADER_STAMP`), `Program` layout, `MKWVK_API_VERSION`, saves, or pipeline caches. ## 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 (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. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [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 UBO descriptor delta fast path, 8-slot ub_gap_cache, and lock-free invalidate exits
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/windows+amd 0/1 pass, 0 running, 2 queued
beanstalk/linux+radv 0/1 pass, 1 running, 1 queued
beanstalk/intel 0/1 pass, 0 running, 2 queued
beanstalk/windows+intel+gpu-arc-* 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
93231e4fc5
Assisted-by: Antigravity
Author
Contributor

Tested in game: Windows 11, i7-9700, RTX 4060 (621.40), KokiriForest_Child 1280x720: -28.3% full descriptor builds per draw (0.92 -> 0.66), warm Avg FPS +4.7% (86.67 -> 90.73), 1% Low +54.9% (28.38 -> 43.97), 0.1% Low +94.0% (14.25 -> 27.64), 0 warnings, 0 left-out CPU R/W.

Tested in game: Windows 11, i7-9700, RTX 4060 (621.40), KokiriForest_Child 1280x720: -28.3% full descriptor builds per draw (0.92 -> 0.66), warm Avg FPS +4.7% (86.67 -> 90.73), 1% Low +54.9% (28.38 -> 43.97), 0.1% Low +94.0% (14.25 -> 27.64), 0 warnings, 0 left-out CPU R/W.
Member

Possibly related, for context:

  • PR #1851 perf(vk): a draw rebuilds only the descriptors whose sources changed (RX_VK_DESC_SPLIT) — Earlier UBO-only descriptor delta optimization; closed without measurable gain and overlapping approach
  • PR #2339 WIP: perf(vk): cache Task/Mesh c2/c0 banks by stage gen and pointer_table per stage — Open renderer cache optimization in adjacent Vulkan replay state code; possible overlap to review
Possibly related, for context: - PR #1851 perf(vk): a draw rebuilds only the descriptors whose sources changed (RX_VK_DESC_SPLIT) — Earlier UBO-only descriptor delta optimization; closed without measurable gain and overlapping approach - PR #2339 WIP: perf(vk): cache Task/Mesh c2/c0 banks by stage gen and pointer_table per stage — Open renderer cache optimization in adjacent Vulkan replay state code; possible overlap to review
Owner

@review
@beanstalk

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

Commit 93231e4 · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The farm cannot run the requested Python or full CI suites, or establish that every Intel object matrix and invalidate edge case is exercised by these gameplay scenes.
⚠️ Note: Descriptor-build counts, 0.1% lows and standalone microbenchmark results are not measured; the plan measures gameplay frame times instead.
⚠️ Note: The three optimization switches are not isolated individually; the comparison tests the PR's shipping defaults against main.

Started at 00:31 UTC.

Estimate: done in about 4 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 🔄 running 0 of 1 — — —
windows+amd ⏳ queued 0 of 1 — — —
linux+radv 🔄 running 0 of 1 — — —
intel ⏳ queued 0 of 1 — — —
windows+intel+gpu-arc-* (GPU "arc *") ⏳ queued 0 of 1 — — —
What was tested

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

The plan compares main and the PR on NVIDIA, AMD and Intel hardware, including Windows Intel Arc and Linux RADV; the Arc target will wait if no matching tester is online. Three starts per side measure uncapped CPU-limited gameplay for 35 seconds each in Kokiri Forest and Market, with stationary picture comparisons for rendering errors. A crash, a picture difference beyond the allowed tolerance, or a frame-time regression beyond 15% fails the PR on the affected target. No tester online now matches windows+intel+gpu-arc-*: that target waits for one.

  • Where: windows+nvidia (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports), windows+intel+gpu-arc-* (GPU "arc *", 1-2 reports).
  • descriptors-and-writeback: from the repository's save kokiri-start (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 Kokiri Forest, take the picture forest to compare with main, measure forest for 35 s (after 10 s warm-up), teleport to Market, take the picture market to compare with main, measure market for 35 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 frame time (p99) is more than 15% above main; or frame time (worst 1%) is more than 15% above main.
  • Time: about 40 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>93231e4</code> (the newer results are in a comment below)</summary> Commit `93231e4` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2899) ⚠️ **Note:** The farm cannot run the requested Python or full CI suites, or establish that every Intel object matrix and invalidate edge case is exercised by these gameplay scenes. ⚠️ **Note:** Descriptor-build counts, 0.1% lows and standalone microbenchmark results are not measured; the plan measures gameplay frame times instead. ⚠️ **Note:** The three optimization switches are not isolated individually; the comparison tests the PR's shipping defaults against main. Started at 00:31 UTC. **Estimate:** done in about 4 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` | 🔄 running | 0 of 1 | — | — | — | | `windows+amd` | ⏳ queued | 0 of 1 | — | — | — | | `linux+radv` | 🔄 running | 0 of 1 | — | — | — | | `intel` | ⏳ queued | 0 of 1 | — | — | — | | `windows+intel+gpu-arc-*` (GPU "arc *") | ⏳ queued | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares main and the PR on NVIDIA, AMD and Intel hardware, including Windows Intel Arc and Linux RADV; the Arc target will wait if no matching tester is online. Three starts per side measure uncapped CPU-limited gameplay for 35 seconds each in Kokiri Forest and Market, with stationary picture comparisons for rendering errors. A crash, a picture difference beyond the allowed tolerance, or a frame-time regression beyond 15% fails the PR on the affected target. No tester online now matches windows+intel+gpu-arc-*: that target waits for one. - **Where:** windows+nvidia (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports), windows+intel+gpu-arc-* (GPU "arc *", 1-2 reports). - **descriptors-and-writeback:** from the repository's save `kokiri-start` (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 Kokiri Forest, take the picture forest to compare with main, measure forest for 35 s (after 10 s warm-up), teleport to Market, take the picture market to compare with main, measure market for 35 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 frame time (p99) is more than 15% above main; or frame time (worst 1%) is more than 15% above main. - **Time:** about 40 min of game runs per tester (6 game starts), plus the two builds. </details> </details>
BeanBot left a comment

Recommendation: Request changes. The change weakens existing checks for missed write-back and texture marks, which can hide stale GPU data reaching the CPU. Its reported performance gain is also unproven against the base commit and across the affected systems.

The change tries to reduce descriptor rebuilding, uniform-update lookup and invalidate locking. It adds three enabled-by-default switches and more cached state; the available runs show fewer descriptor builds but do not yet establish a reliable player-facing speedup.

Blocking (1): must change before merging.

  1. L1 gpu/vk/vk_texture.cpp:4964: The new early exits make the existing mark-agreement checks compare the marks against themselves, so those checks no longer detect missing marks. (more on the line) Do: Keep an independent locked-table reference in both agreement tests, or run the reference lookups with the fast exits disabled, and add cases that fail when a covered page is omitted from either mark.

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

  • L2: The measurements do not establish the claimed frame-rate gain against main. When: The before runs are the PR with its switches disabled, while some new work remains active; their FPS spread overlaps the enabled runs, and only one scene and machine are reported. Do: Run several interleaved warm comparisons of the base commit and this head in the target and a heavy player scene, at player settings, and report per-run FPS and frame times.
  • L3: The enabled renderer and synchronization paths still need game coverage on the other systems they affect. When: Linux/AMD RADV, Steam Deck and Intel's uniform-snapshot path have no reported game run; the change can alter descriptor contents and CPU waits on those paths. Do: Use the Test Farm or comparable machines to exercise rendering and readbacks on the affected Tier 1 systems, and check Intel's uniform snapshot path, recording the results.

@fix can do L1.

Checks: Still running: 10 checks.

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

Does it help: Unproven. On one Windows/NVIDIA setup, full descriptor builds fell from 0.92 to 0.66 per draw. The reported warm FPS runs overlap substantially: 79.63–93.71 before and 81.72–97.00 after. The before runs use this PR with switches off, rather than the base commit.

Other systems: Descriptor reuse and invalidate behavior affect Windows and Linux, NVIDIA, AMD and Intel GPUs, Steam Deck, texture readbacks and GPU-written buffers. Only Windows/NVIDIA game results are supplied; the Intel snapshot path and the other Tier 1 systems remain unverified.

Switches: RX_VK_DESC_DELTA, RX_VK_UB_GAP8 and RX_VK_WB_LEARN_FAST are added as kill switches, all defaulting to on, with rows in switches.def. Their defaults are not yet supported by measurements on the other affected systems. RX_VK_WB_LEARN_FAST=0 also does not disable the new texture or host invalidate exits.

Reviewed: 93231e4fc5 against 28cb22b9ed: Read the PR description, comment, commit and diff; AGENTS.md, CONTRIBUTING.md, the PR template, standards, page_marks.h and wb_learn.h. Read the changed regions and related descriptor, replay, write-back, texture and host paths, plus the affected test fixtures. The large changed source files were not read in full. docs/review-checklist.md and ../Tooling/AGENTS.md are absent. No generated files or translations changed.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance.
  • The diff contains no game-derived output, generated shader files, third-party changes or renderer API version change.
  • The per-stage sidecar is accessed on the replay path protected by replay_mu.
  • The new switches have entries in the switch table.

Testing: No code, tests or project scripts were run, as requested. CI is still running. The maintainer's Beanstalk request could not be submitted within the specified no-network and no-script limits.

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: Request changes.** The change weakens existing checks for missed write-back and texture marks, which can hide stale GPU data reaching the CPU. Its reported performance gain is also unproven against the base commit and across the affected systems. The change tries to reduce descriptor rebuilding, uniform-update lookup and invalidate locking. It adds three enabled-by-default switches and more cached state; the available runs show fewer descriptor builds but do not yet establish a reliable player-facing speedup. **Blocking (1)**: must change before merging. 1. **L1** `gpu/vk/vk_texture.cpp:4964`: The new early exits make the existing mark-agreement checks compare the marks against themselves, so those checks no longer detect missing marks. (more on the line) **Do:** Keep an independent locked-table reference in both agreement tests, or run the reference lookups with the fast exits disabled, and add cases that fail when a covered page is omitted from either mark. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: The measurements do not establish the claimed frame-rate gain against main. *When:* The before runs are the PR with its switches disabled, while some new work remains active; their FPS spread overlaps the enabled runs, and only one scene and machine are reported. **Do:** Run several interleaved warm comparisons of the base commit and this head in the target and a heavy player scene, at player settings, and report per-run FPS and frame times. - **L3**: The enabled renderer and synchronization paths still need game coverage on the other systems they affect. *When:* Linux/AMD RADV, Steam Deck and Intel's uniform-snapshot path have no reported game run; the change can alter descriptor contents and CPU waits on those paths. **Do:** Use the Test Farm or comparable machines to exercise rendering and readbacks on the affected Tier 1 systems, and check Intel's uniform snapshot path, recording the results. `@fix` can do L1. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. On one Windows/NVIDIA setup, full descriptor builds fell from 0.92 to 0.66 per draw. The reported warm FPS runs overlap substantially: 79.63–93.71 before and 81.72–97.00 after. The before runs use this PR with switches off, rather than the base commit. **Other systems:** Descriptor reuse and invalidate behavior affect Windows and Linux, NVIDIA, AMD and Intel GPUs, Steam Deck, texture readbacks and GPU-written buffers. Only Windows/NVIDIA game results are supplied; the Intel snapshot path and the other Tier 1 systems remain unverified. **Switches:** RX_VK_DESC_DELTA, RX_VK_UB_GAP8 and RX_VK_WB_LEARN_FAST are added as kill switches, all defaulting to on, with rows in switches.def. Their defaults are not yet supported by measurements on the other affected systems. RX_VK_WB_LEARN_FAST=0 also does not disable the new texture or host invalidate exits. **Reviewed:** 93231e4fc56d against 28cb22b9ed23: Read the PR description, comment, commit and diff; AGENTS.md, CONTRIBUTING.md, the PR template, standards, page_marks.h and wb_learn.h. Read the changed regions and related descriptor, replay, write-back, texture and host paths, plus the affected test fixtures. The large changed source files were not read in full. docs/review-checklist.md and ../Tooling/AGENTS.md are absent. No generated files or translations changed.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance. - The diff contains no game-derived output, generated shader files, third-party changes or renderer API version change. - The per-stage sidecar is accessed on the replay path protected by replay_mu. - The new switches have entries in the switch table. **Testing:** No code, tests or project scripts were run, as requested. CI is still running. The maintainer's Beanstalk request could not be submitted within the specified no-network and no-script limits. **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>
@ -4958,6 +4961,7 @@ void texture_describe_written(uint64_t lo, uint64_t size, std::string& out) {
}
bool texture_gpu_written_in(uint64_t lo, uint64_t size) {
if (size && !texture_gpu_written_ever(lo, size)) return false;
Member

L1 (blocking): The new early exits make the existing mark-agreement checks compare the marks against themselves, so those checks no longer detect missing marks.

When: If vw_note marks too short a range, texture_gpu_written_in now returns false from the same mark before examining vw, so agree-vw accepts the missed texture. The analogous memory_writeback_value exit makes agree-wb accept a missed wb_ever mark, potentially hiding an invalidate that skips a GPU write-back wait.

Do: Keep an independent locked-table reference in both agreement tests, or run the reference lookups with the fast exits disabled, and add cases that fail when a covered page is omitted from either mark.

**L1** (blocking): The new early exits make the existing mark-agreement checks compare the marks against themselves, so those checks no longer detect missing marks. *When:* If vw_note marks too short a range, texture_gpu_written_in now returns false from the same mark before examining vw, so agree-vw accepts the missed texture. The analogous memory_writeback_value exit makes agree-wb accept a missed wb_ever mark, potentially hiding an invalidate that skips a GPU write-back wait. **Do:** Keep an independent locked-table reference in both agreement tests, or run the reference lookups with the fast exits disabled, and add cases that fail when a covered page is omitted from either mark.
Owner
@fix
BeanBot force-pushed perf/pc-phase-a-desc-ub-invalidate from 93231e4fc5
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/windows+amd 0/1 pass, 0 running, 2 queued
beanstalk/linux+radv 0/1 pass, 1 running, 1 queued
beanstalk/intel 0/1 pass, 0 running, 2 queued
beanstalk/windows+intel+gpu-arc-* 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 0e96053ad9
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-01 00:42:08 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The optimization reduces descriptor builds in the reported run, but its frame-rate gain against main and its behavior on other affected systems remain unverified. Recommend approval; not approved on the forge.

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

Changed

  • Independent mark-agreement checks: Updated tests/invalidate_quick_test.cpp:93 to read the locked tables directly and added cases for omitted covered pages. Tests were not run, as requested.

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

The pull request reduces descriptor rebuilding and avoids some cache and synchronization work. The test fix checks the lock-free marks against the underlying locked tables, at the cost of additional test code.

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

  • L2: The measurements do not establish the claimed frame-rate gain against main. When: The before runs are the PR with its switches disabled, while some new work remains active; their FPS spread overlaps the enabled runs, and only one scene and machine are reported. Do: Run several interleaved warm comparisons of the base commit and this head in the target and a heavy player scene, at player settings, and report per-run FPS and frame times.
  • L3: The enabled renderer and synchronization paths still need game coverage on the other systems they affect. When: Linux/AMD RADV, Steam Deck and Intel's uniform-snapshot path have no reported game run; the change can alter descriptor contents and CPU waits on those paths. Do: Use the Test Farm or comparable machines to exercise rendering and readbacks on the affected Tier 1 systems, and check Intel's uniform snapshot path, recording the results.

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

Also noticed (2; not asked for, not blocking)
  • The updated independent mark-agreement checks have not yet been run.
  • The base-to-head diff includes additional commits and files beyond the pull request's listed files.
More: does it help, other systems, switches, what was read

Does it help: Unproven. The reported Windows/NVIDIA runs show full descriptor builds falling from 0.92 to 0.66 per draw and average FPS rising from 86.67 to 90.73, but compare switch settings on the PR head rather than builds of main and the PR.

Other systems: The renderer and synchronization paths also affect Linux, AMD, Intel and other driver configurations. The supplied game run covers Windows with NVIDIA; Linux/AMD and Intel Arc coverage remains outstanding.

Switches: RX_VK_DESC_DELTA, RX_VK_UB_GAP8 and RX_VK_WB_LEARN_FAST are added and default to 1. Their enabled defaults lack measurements against main and coverage on the other affected systems.

Reviewed: 0e96053ad9 against 19f9da05ea: Read the test fix and tests/invalidate_quick_test.cpp in full, the test harness and relevant mark and table implementations, the PR description, comments, ledger and available repository rules. Skimmed the original renderer diff and commit list; the full base-to-head diff and all changed code files were not read in full. Tooling's adjacent AGENTS.md and docs/review-checklist.md were unavailable.; nothing run (a code review).

Checked and fine:

  • The agreement helpers read the write-back pages and texture list under their locks independently of the fast lookups.
  • The added cases check that omitted covered pages are detected.
  • The test-only fix leaves the renderer optimizations in place.

Testing: No commands from the project or tests were run. The author reports Windows/NVIDIA game testing before the test fix; the updated checks and other hardware runs remain outstanding.

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 fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The optimization reduces descriptor builds in the reported run, but its frame-rate gain against main and its behavior on other affected systems remain unverified. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 0e96053ad915. I rebased it onto `main` (19f9da05eac9). I edited its description to match the change. **Changed** - **Independent mark-agreement checks**: Updated tests/invalidate_quick_test.cpp:93 to read the locked tables directly and added cases for omitted covered pages. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. The pull request reduces descriptor rebuilding and avoids some cache and synchronization work. The test fix checks the lock-free marks against the underlying locked tables, at the cost of additional test code. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: The measurements do not establish the claimed frame-rate gain against main. *When:* The before runs are the PR with its switches disabled, while some new work remains active; their FPS spread overlaps the enabled runs, and only one scene and machine are reported. **Do:** Run several interleaved warm comparisons of the base commit and this head in the target and a heavy player scene, at player settings, and report per-run FPS and frame times. - **L3**: The enabled renderer and synchronization paths still need game coverage on the other systems they affect. *When:* Linux/AMD RADV, Steam Deck and Intel's uniform-snapshot path have no reported game run; the change can alter descriptor contents and CPU waits on those paths. **Do:** Use the Test Farm or comparable machines to exercise rendering and readbacks on the affected Tier 1 systems, and check Intel's uniform snapshot path, recording the results. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The updated independent mark-agreement checks have not yet been run. - The base-to-head diff includes additional commits and files beyond the pull request's listed files. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported Windows/NVIDIA runs show full descriptor builds falling from 0.92 to 0.66 per draw and average FPS rising from 86.67 to 90.73, but compare switch settings on the PR head rather than builds of main and the PR. **Other systems:** The renderer and synchronization paths also affect Linux, AMD, Intel and other driver configurations. The supplied game run covers Windows with NVIDIA; Linux/AMD and Intel Arc coverage remains outstanding. **Switches:** RX_VK_DESC_DELTA, RX_VK_UB_GAP8 and RX_VK_WB_LEARN_FAST are added and default to 1. Their enabled defaults lack measurements against main and coverage on the other affected systems. **Reviewed:** 0e96053ad915 against 19f9da05eac9: Read the test fix and tests/invalidate_quick_test.cpp in full, the test harness and relevant mark and table implementations, the PR description, comments, ledger and available repository rules. Skimmed the original renderer diff and commit list; the full base-to-head diff and all changed code files were not read in full. Tooling's adjacent AGENTS.md and docs/review-checklist.md were unavailable.; nothing run (a code review). **Checked and fine:** - The agreement helpers read the write-back pages and texture list under their locks independently of the fast lookups. - The added cases check that omitted covered pages are detected. - The test-only fix leaves the renderer optimizations in place. **Testing:** No commands from the project or tests were run. The author reports Windows/NVIDIA game testing before the test fix; the updated checks and other hardware runs remain outstanding. **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 fix. Nothing was run; a maintainer decides.</sub>
Member

Beanstalk test farm

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

I rebased this pull request onto main (a5cae004d8): the new head is 6520237434.

Conflicts resolved

  • gpu/vk/vk_draw.cpp: Kept the base branch’s texture descriptor memoization and the pull request’s UBO delta safety check.

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` (a5cae004d841): the new head is 6520237434ee. **Conflicts resolved** - gpu/vk/vk_draw.cpp: Kept the base branch’s texture descriptor memoization and the pull request’s UBO delta safety check. 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/pc-phase-a-desc-ub-invalidate from 0e96053ad9
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 6520237434
Some checks failed
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 6s
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Failing after 11s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 15s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 4m9s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m15s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 8m1s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 7m24s
CI / Website build and checks (pull_request) Failing after 30s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 32m0s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 40m1s
2026-12-01 00:45:07 +00:00
Compare
HumanBean deleted branch perf/pc-phase-a-desc-ub-invalidate 2026-12-01 00:45:36 +00:00
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The claimed frame-rate gain still needs a comparison against main, and the enabled renderer paths need game coverage on other affected systems. Recommend approval; not approved on the forge.

The change reduces descriptor rebuilding and adds cache and lock-free fast paths. It adds renderer and synchronization complexity in exchange for a potential performance gain that has not yet been established against main.

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

  • L2: The measurements do not establish the claimed frame-rate gain against main. When: The before runs are the PR with its switches disabled, while some new work remains active; their FPS spread overlaps the enabled runs, and only one scene and machine are reported. Do: Run several interleaved warm comparisons of the base commit and this head in the target and a heavy player scene, at player settings, and report per-run FPS and frame times.
  • L3: The enabled renderer and synchronization paths still need game coverage on the other systems they affect. When: Linux/AMD RADV, Steam Deck and Intel's uniform-snapshot path have no reported game run; the change can alter descriptor contents and CPU waits on those paths. Do: Use the Test Farm or comparable machines to exercise rendering and readbacks on the affected Tier 1 systems, and check Intel's uniform snapshot path, recording the results.

Since the last review (on 0e96053ad9)
Still open: L2 (The measurements do not establish the claimed frame-rate gain against main.); L3 (The enabled renderer and synchronization paths still need game coverage on the other syste…)

Checks: Still running: 11 checks.

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

Does it help: Unproven. The reported Windows RTX 4060 runs show 86.67 to 90.73 average FPS and 0.92 to 0.66 full descriptor builds per draw, but compare switches off and on in the PR build rather than the PR against main.

Other systems: The descriptor and synchronization paths affect Windows and Linux across GPU vendors and drivers. The supplied game run covers Windows with NVIDIA; Linux/AMD and Intel Arc game coverage remains outstanding.

Switches: RX_VK_DESC_DELTA, RX_VK_UB_GAP8 and RX_VK_WB_LEARN_FAST are new kill switches, all defaulting on and listed in switches.def. Their defaults remain subject to the outstanding performance and hardware coverage.

Reviewed: 6520237434 against a5cae004d8: Read AGENTS.md, CONTRIBUTING.md and the complete PR diff; compared the rebased draw diff with the earlier version. The changed code files and supporting callers were not read in full; the PR template, standards, recorded runs and tests were only skimmed.; nothing run (a code review).

Checked and fine:

  • The supplied changed-lines list is empty, and the rebase moves the draw addition without changing its PR diff.
  • The three new switches have entries in switches.def.

Testing: No commands from the project or tests were run. The author reports Windows/NVIDIA game runs and targeted checks; the updated mark-agreement checks and Linux and Intel coverage remain outstanding. 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 claimed frame-rate gain still needs a comparison against main, and the enabled renderer paths need game coverage on other affected systems. Recommend approval; not approved on the forge. The change reduces descriptor rebuilding and adds cache and lock-free fast paths. It adds renderer and synchronization complexity in exchange for a potential performance gain that has not yet been established against main. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2**: The measurements do not establish the claimed frame-rate gain against main. *When:* The before runs are the PR with its switches disabled, while some new work remains active; their FPS spread overlaps the enabled runs, and only one scene and machine are reported. **Do:** Run several interleaved warm comparisons of the base commit and this head in the target and a heavy player scene, at player settings, and report per-run FPS and frame times. - **L3**: The enabled renderer and synchronization paths still need game coverage on the other systems they affect. *When:* Linux/AMD RADV, Steam Deck and Intel's uniform-snapshot path have no reported game run; the change can alter descriptor contents and CPU waits on those paths. **Do:** Use the Test Farm or comparable machines to exercise rendering and readbacks on the affected Tier 1 systems, and check Intel's uniform snapshot path, recording the results. **Since the last review** (on 0e96053ad915) Still open: L2 (The measurements do not establish the claimed frame-rate gain against main.); L3 (The enabled renderer and synchronization paths still need game coverage on the other syste…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported Windows RTX 4060 runs show 86.67 to 90.73 average FPS and 0.92 to 0.66 full descriptor builds per draw, but compare switches off and on in the PR build rather than the PR against main. **Other systems:** The descriptor and synchronization paths affect Windows and Linux across GPU vendors and drivers. The supplied game run covers Windows with NVIDIA; Linux/AMD and Intel Arc game coverage remains outstanding. **Switches:** RX_VK_DESC_DELTA, RX_VK_UB_GAP8 and RX_VK_WB_LEARN_FAST are new kill switches, all defaulting on and listed in switches.def. Their defaults remain subject to the outstanding performance and hardware coverage. **Reviewed:** 6520237434ee against a5cae004d841: Read AGENTS.md, CONTRIBUTING.md and the complete PR diff; compared the rebased draw diff with the earlier version. The changed code files and supporting callers were not read in full; the PR template, standards, recorded runs and tests were only skimmed.; nothing run (a code review). **Checked and fine:** - The supplied changed-lines list is empty, and the rebase moves the draw addition without changing its PR diff. - The three new switches have entries in switches.def. **Testing:** No commands from the project or tests were run. The author reports Windows/NVIDIA game runs and targeted checks; the updated mark-agreement checks and Linux and Intel coverage remain outstanding. 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>
Author
Contributor

Follow-up now that this is merged (018dd2ef4, 1 Dec), covering BeanBot's open items.

L1 (blocking, mark-agreement checks): BeanBot's @fix resolved this before the merge. tests/invalidate_quick_test.cpp now checks the lock-free marks against the locked tables directly and has cases for an omitted covered page. @fix didn't run it, so I ran it on main (see Testing below).

L2 (gain against main) and L3 (other systems): still open, and I'm not going to claim the gain from here.

  • The farm never tested this PR. HumanBean's @beanstalk run on 93231e4 was cancelled when @fix pushed a new head, and the head that merged (6520237) was never approved for a run (dashboard: no reports).
  • My own numbers compare this PR's switches off and on in one binary on one PC (i7-9700 / RTX 4060, Kokiri Forest), and their FPS ranges overlap. As BeanBot says, that's not a base-vs-head comparison. The −28 % full descriptor builds per draw is a real count. The "+4.7 % FPS / +55 % 1 % low" is not established.
  • Not tested anywhere: Linux/RADV, Steam Deck, and Intel's uniform-snapshot path (ub_every). These still need the farm or a tester. All three switches (RX_VK_DESC_DELTA, RX_VK_UB_GAP8, RX_VK_WB_LEARN_FAST) have a =0 kill switch if a system shows a problem.

CI on the head: "Game-free checks" 1/2 and 2/2, "Website" and "Third-party parts" failed on 6520237. The same four checks also failed on main's own push runs at the merges around it (19f9da05e, f439f2bb9, 018dd2ef4), and #3057 later fixed main's checks. So these failures are not this PR's. I couldn't open the CI job logs to match them test by test.

Testing (this comment): on a clean main @ b4d56f526 worktree, Windows / llvm-mingw:

  • tests/test_invalidate_quick.py (@fix's independent mark-agreement cases): pass (266 s) in my #2858 worktree on main b4d56f526 (#2858 doesn't touch tests/invalidate_quick_test.cpp or gpu/vk/vk_texture.cpp). On a clean main 1e782fa4b its compile ran into the check's own 300 s limit while the PC's queue was fully loaded, so no result there.
  • tests/test_direct_buffer_writes.py (changed by this PR): 11 of 11 cases pass on clean main 1e782fa4b. I lifted the check's 60 s compile limit, which the loaded PC couldn't meet.
  • tests/test_invalidate_vcore.py: the vulkan case passes. The fallback case failed at its 2 s wait for the producer thread (tests/invalidate_vcore_test.cpp:122), with the check running at below-normal priority on a fully loaded PC. I can't tell that apart from load from here. It needs CI or a rerun on an idle PC.
Follow-up now that this is merged (018dd2ef4, 1 Dec), covering BeanBot's open items. **L1 (blocking, mark-agreement checks):** BeanBot's `@fix` resolved this before the merge. `tests/invalidate_quick_test.cpp` now checks the lock-free marks against the locked tables directly and has cases for an omitted covered page. `@fix` didn't run it, so I ran it on `main` (see Testing below). **L2 (gain against main) and L3 (other systems):** still open, and I'm not going to claim the gain from here. - The farm never tested this PR. HumanBean's `@beanstalk` run on `93231e4` was cancelled when `@fix` pushed a new head, and the head that merged (`6520237`) was never approved for a run ([dashboard](https://beanstalk.magicbean.dev/prs/2899): no reports). - My own numbers compare this PR's switches off and on in one binary on one PC (i7-9700 / RTX 4060, Kokiri Forest), and their FPS ranges overlap. As BeanBot says, that's not a base-vs-head comparison. The −28 % full descriptor builds per draw is a real count. The "+4.7 % FPS / +55 % 1 % low" is not established. - Not tested anywhere: Linux/RADV, Steam Deck, and Intel's uniform-snapshot path (`ub_every`). These still need the farm or a tester. All three switches (`RX_VK_DESC_DELTA`, `RX_VK_UB_GAP8`, `RX_VK_WB_LEARN_FAST`) have a `=0` kill switch if a system shows a problem. **CI on the head:** "Game-free checks" 1/2 and 2/2, "Website" and "Third-party parts" failed on `6520237`. The same four checks also failed on `main`'s own push runs at the merges around it (19f9da05e, f439f2bb9, 018dd2ef4), and #3057 later fixed `main`'s checks. So these failures are not this PR's. I couldn't open the CI job logs to match them test by test. **Testing (this comment):** on a clean `main` @ `b4d56f526` worktree, Windows / llvm-mingw: - `tests/test_invalidate_quick.py` (`@fix`'s independent mark-agreement cases): **pass** (266 s) in my #2858 worktree on `main` `b4d56f526` (#2858 doesn't touch `tests/invalidate_quick_test.cpp` or `gpu/vk/vk_texture.cpp`). On a clean `main` `1e782fa4b` its compile ran into the check's own 300 s limit while the PC's queue was fully loaded, so no result there. - `tests/test_direct_buffer_writes.py` (changed by this PR): **11 of 11 cases pass** on clean `main` `1e782fa4b`. I lifted the check's 60 s compile limit, which the loaded PC couldn't meet. - `tests/test_invalidate_vcore.py`: the `vulkan` case passes. The `fallback` case **failed** at its 2 s wait for the producer thread (`tests/invalidate_vcore_test.cpp:122`), with the check running at below-normal priority on a fully loaded PC. I can't tell that apart from load from here. It needs CI or a rerun on an idle PC.
Member

@siantm this PR is closed or unknown to the farm.

@siantm this PR is closed or unknown to the farm.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!2899
No description provided.