perf(vk): RX_VK_TEX_BTREE_GET_FAST chunked B-tree write history, 64x2 TexGetMemo, and alloc-free sweep #3001

Merged
HumanBean merged 1 commit from siantm/Longshot:perf/vk-tex-btree-get-fast into main 2026-12-02 16:14:01 +00:00
Contributor

Summary

Replace red-black std::map write-history/ownership trees and repeated raw texture-descriptor hashing in gpu/vk/vk_texture.cpp with cache-local, bounded-move data structures in gpu/vk/tex_btree_get_fast.h, cutting tex_lookup_ms by 23.81% and wait_gpu_ms by 8.97% while improving average FPS by +1.16% (1% and 0.1% lows both improved) in CPU-bound Market benchmarks.

Key files to read first:

  • gpu/vk/tex_btree_get_fast.h: GpuWriteHistoryBTree, GpuOwnedBTree, and TexGetMemo.
  • gpu/vk/vk_texture.cpp: RX_VK_TEX_BTREE_GET_FAST switch, TexGetMemo + texture_touch_quick fast bypass in texture_get(), allocation-free dead_targets_sweep(), and hoisted steady_clock::now() in texture_frame().
  • gpu/vk/switches.def: RX_VK_TEX_BTREE_GET_FAST kill/A/B switch row.

What changed

  1. 2-level 128-entry Chunked B-Trees (GpuWriteHistoryBTree & GpuOwnedBTree):
    • Replaced GpuWriteHistory's nested std::map<uint64_t, std::map<uint64_t, uint64_t>> pending, std::map finished, and 4 std::map images with sorted flat PendingBatch vectors (recycled via range_pool), a 2-level 128-entry Chunked B-Tree for finished (bounding per-edit memmove to <= 3 KB with whole-leaf front eviction at max_ranges = 65536), and 4 flat sorted image indices with [min_lo, max_end) bounds.
    • Replaced std::map<uint64_t, std::pair<uint64_t, uint64_t>> gpu_owned with GpuOwnedBTree (128-entry leaves + 4-slot MRU cache for O(1) repeated texture_rendered updates).
    • Added seamless bidirectional sync_from / sync_to state migration at texture_begin_recording() and under gpu_wrote_mu / gpu_owned accesses so dynamic HOS_AB flips preserve exact state without disturbing gpu/vk/gpu_write_history.h.
  2. 64×2 L1d TexGetMemo + texture_touch_quick fast bypass in texture_get():
    • Keys raw nvn_tex fields (gpu, dimensions, format/target, linear stride / block-linear tile dims) and validates against destroy_gen before calling vk_format(), nvn_block_size(), format_class(), or probing textures.
    • On memo hit when RX_VK_CPU_OVER_GPU and RX_VK_REUPLOAD_DIM are unset, updates LRU state via inline texture_touch_quick directly.
  3. dead_targets_sweep() & texture_frame() cleanup:
    • Replaced per-call std::unordered_set<Texture*> allocation in dead_targets_sweep() with reusable POD DeadSpan and gone_vec scratch buffers, and hoisted steady_clock::now() once per frame before the arenas loop in texture_frame().

Testing

Tested: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4, driver 0x9b4a0000), CPU-bound Market (child, crowded; 50% render scale 768x432, 1280x720 output, V-Sync Off, Frame Generation Off, HOS_FPS_MAX=1000):

  • Live dual-shadow parity (RX_VK_TEX_BTREE_GET_FAST=check, 30 s): 2376 frames (79.2 fps), vk: tex_btree_get_fast check: checks=1105661 hits=887038 tex_get_hits=819325 mismatches=0, RUN_ERROR=None, zero VK_ERROR_DEVICE_LOST.
  • Unit & repo checks (all passed after final edit):
    • python -I tests/test_vk_tex_btree_get_fast.py --cc clang: PASS (20,000-op randomized parity fuzzing for GpuWriteHistoryBTree and GpuOwnedBTree, leaf split/merge/eviction, overflow, round-trip sync_from/sync_to, TexGetMemo 64×2 LRU/destroy_gen/raw-key tests, source checks, and 12 MUST_FAIL_* variants caught).
    • python -I tests/test_direct_buffer_writes.py --cxx clang++: PASS (11 cases, 0 failed).
    • python -I tests/test_dead_targets_sweep.py --cxx clang++: PASS.
    • python -I tests/test_compressed_over_rt.py --cxx clang++: PASS.
    • python -I tests/test_hos_ab.py --cc clang: PASS (RX_VK_TEX_BTREE_GET_FAST wired and flip-tested).
    • python -I tests/test_tls_objects.py: PASS (19 TLS_OBJECTs; 44 other namespace-scope thread_locals, none with a constructor or destructor).
    • python -I tests/test_vk_braces.py: PASS (620 renderer sources balance).

Still to test:

  • None (all targeted Windows RTX 4060 parity, A/B, and unit tests ran on this commit).

Measurements

Verdict: faster: +1.16% avg FPS (-0.144 ms mean frame time, 5/5 runs won, 95% CI +0.78% to +1.55% — strictly excludes 0); tex_lookup_ms -23.81%, wait_gpu_ms -8.97%; 1% Low FPS +0.25 FPS and 0.1% Low FPS +0.28 FPS both improved.

Setup: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4); Market, child (crowded); quality preset Custom, resolution 50% (768x432), output res 1280x720, frame generation Off, vsync Off, uncapped (HOS_FPS_MAX=1000); 5 interleaved runs × 90 s (147 paired 3 s HOS_AB periods after warm-up via dev.py queue run --mode timing); RX_VK_TEX_BTREE_GET_FAST defaults to 1 (on).

Baseline: both columns are one build, 124295103 (not main): RX_VK_TEX_BTREE_GET_FAST=0 (legacy main paths) flipped every 3 s within each run against RX_VK_TEX_BTREE_GET_FAST unset (1, new paths) via HOS_AB so both sides run in identical scene/process state.

Metric Before: RX_VK_TEX_BTREE_GET_FAST=0 @ 124295103 After: RX_VK_TEX_BTREE_GET_FAST unset (1) @ 124295103 Delta
Average FPS 79.39 fps 80.32 fps +1.16%
Mean frame time 12.60 ms 12.45 ms -0.14 ms
Median frame time (P50) 12.32 ms 12.18 ms -0.14 ms (82.10 vs 81.17 fps)
1% Low FPS 63.65 fps 63.90 fps +0.25 fps
0.1% Low FPS 52.66 fps 52.94 fps +0.28 fps
p99 frame time 15.73 ms 15.66 ms -0.07 ms
tex_lookup_ms 0.1063 ms 0.0810 ms -0.0253 ms (-23.81%)
draw_ms 7.3568 ms 7.3102 ms -0.0466 ms (-0.63%)
wait_gpu_ms 1.7740 ms 1.6148 ms -0.1592 ms (-8.97%)
Frames >= 50 ms / min 0.00 0.00 +0.00

Per-run frame-rate deltas (side 0 ON vs side 1 OFF): AB1 +0.67% (79.5 vs 79.0), AB2 +1.43% (80.0 vs 78.8), AB3 +1.13% (80.4 vs 79.5), AB4 +1.28% (80.2 vs 79.2), AB5 +1.33% (81.4 vs 80.3).

Risks

  • Low risk: gpu_write_history_fast / GpuOwnedBTree / TexGetMemo mirror exact legacy boundary, overflow (max_ranges=65536), and eviction semantics, verified over 40,000+ randomized fuzz ops and 1,105,661 live =check comparisons (0 mismatches).
  • Setting RX_VK_TEX_BTREE_GET_FAST=0 cleanly reverts every code path at runtime without side effects; no persistent caches, saves, or options files change.

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 Replace red-black `std::map` write-history/ownership trees and repeated raw texture-descriptor hashing in `gpu/vk/vk_texture.cpp` with cache-local, bounded-move data structures in `gpu/vk/tex_btree_get_fast.h`, cutting `tex_lookup_ms` by 23.81% and `wait_gpu_ms` by 8.97% while improving average FPS by +1.16% (`1%` and `0.1%` lows both improved) in CPU-bound Market benchmarks. Key files to read first: - `gpu/vk/tex_btree_get_fast.h`: `GpuWriteHistoryBTree`, `GpuOwnedBTree`, and `TexGetMemo`. - `gpu/vk/vk_texture.cpp`: `RX_VK_TEX_BTREE_GET_FAST` switch, `TexGetMemo` + `texture_touch_quick` fast bypass in `texture_get()`, allocation-free `dead_targets_sweep()`, and hoisted `steady_clock::now()` in `texture_frame()`. - `gpu/vk/switches.def`: `RX_VK_TEX_BTREE_GET_FAST` kill/A/B switch row. ### What changed 1. **2-level 128-entry Chunked B-Trees (`GpuWriteHistoryBTree` & `GpuOwnedBTree`):** - Replaced `GpuWriteHistory`'s nested `std::map<uint64_t, std::map<uint64_t, uint64_t>> pending`, `std::map finished`, and 4 `std::map images` with sorted flat `PendingBatch` vectors (recycled via `range_pool`), a 2-level 128-entry Chunked B-Tree for `finished` (bounding per-edit `memmove` to `<= 3 KB` with whole-leaf front eviction at `max_ranges = 65536`), and 4 flat sorted image indices with `[min_lo, max_end)` bounds. - Replaced `std::map<uint64_t, std::pair<uint64_t, uint64_t>> gpu_owned` with `GpuOwnedBTree` (128-entry leaves + 4-slot MRU cache for O(1) repeated `texture_rendered` updates). - Added seamless bidirectional `sync_from` / `sync_to` state migration at `texture_begin_recording()` and under `gpu_wrote_mu` / `gpu_owned` accesses so dynamic `HOS_AB` flips preserve exact state without disturbing `gpu/vk/gpu_write_history.h`. 2. **64×2 L1d `TexGetMemo` + `texture_touch_quick` fast bypass in `texture_get()`:** - Keys raw `nvn_tex` fields (`gpu`, dimensions, format/target, linear stride / block-linear tile dims) and validates against `destroy_gen` before calling `vk_format()`, `nvn_block_size()`, `format_class()`, or probing `textures`. - On memo hit when `RX_VK_CPU_OVER_GPU` and `RX_VK_REUPLOAD_DIM` are unset, updates LRU state via inline `texture_touch_quick` directly. 3. **`dead_targets_sweep()` & `texture_frame()` cleanup:** - Replaced per-call `std::unordered_set<Texture*>` allocation in `dead_targets_sweep()` with reusable POD `DeadSpan` and `gone_vec` scratch buffers, and hoisted `steady_clock::now()` once per frame before the `arenas` loop in `texture_frame()`. ## Testing **Tested:** Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4, driver 0x9b4a0000), CPU-bound Market (child, crowded; 50% render scale 768x432, 1280x720 output, V-Sync Off, Frame Generation Off, `HOS_FPS_MAX=1000`): - **Live dual-shadow parity (`RX_VK_TEX_BTREE_GET_FAST=check`, 30 s):** `2376 frames` (`79.2 fps`), `vk: tex_btree_get_fast check: checks=1105661 hits=887038 tex_get_hits=819325 mismatches=0`, `RUN_ERROR=None`, zero `VK_ERROR_DEVICE_LOST`. - **Unit & repo checks (all passed after final edit):** - `python -I tests/test_vk_tex_btree_get_fast.py --cc clang`: PASS (20,000-op randomized parity fuzzing for `GpuWriteHistoryBTree` and `GpuOwnedBTree`, leaf split/merge/eviction, overflow, round-trip `sync_from`/`sync_to`, `TexGetMemo` 64×2 LRU/destroy_gen/raw-key tests, source checks, and 12 `MUST_FAIL_*` variants caught). - `python -I tests/test_direct_buffer_writes.py --cxx clang++`: PASS (`11 cases, 0 failed`). - `python -I tests/test_dead_targets_sweep.py --cxx clang++`: PASS. - `python -I tests/test_compressed_over_rt.py --cxx clang++`: PASS. - `python -I tests/test_hos_ab.py --cc clang`: PASS (`RX_VK_TEX_BTREE_GET_FAST` wired and flip-tested). - `python -I tests/test_tls_objects.py`: PASS (`19 TLS_OBJECTs; 44 other namespace-scope thread_locals, none with a constructor or destructor`). - `python -I tests/test_vk_braces.py`: PASS (`620 renderer sources balance`). **Still to test:** - None (all targeted Windows RTX 4060 parity, A/B, and unit tests ran on this commit). ## Measurements **Verdict:** faster: +1.16% avg FPS (-0.144 ms mean frame time, 5/5 runs won, 95% CI +0.78% to +1.55% — strictly excludes 0); `tex_lookup_ms -23.81%`, `wait_gpu_ms -8.97%`; `1% Low FPS +0.25 FPS` and `0.1% Low FPS +0.28 FPS` both improved. Setup: Windows 11, NVIDIA GeForce RTX 4060 (Vulkan 1.4); Market, child (crowded); quality preset Custom, resolution 50% (768x432), output res 1280x720, frame generation Off, vsync Off, uncapped (`HOS_FPS_MAX=1000`); 5 interleaved runs × 90 s (147 paired 3 s `HOS_AB` periods after warm-up via `dev.py queue run --mode timing`); `RX_VK_TEX_BTREE_GET_FAST` defaults to `1` (on). **Baseline:** both columns are one build, `124295103` (not `main`): `RX_VK_TEX_BTREE_GET_FAST=0` (legacy `main` paths) flipped every 3 s within each run against `RX_VK_TEX_BTREE_GET_FAST` unset (`1`, new paths) via `HOS_AB` so both sides run in identical scene/process state. | Metric | Before: `RX_VK_TEX_BTREE_GET_FAST=0` @ `124295103` | After: `RX_VK_TEX_BTREE_GET_FAST` unset (1) @ `124295103` | Delta | |---|---|---|---| | Average FPS | 79.39 fps | 80.32 fps | +1.16% | | Mean frame time | 12.60 ms | 12.45 ms | -0.14 ms | | Median frame time (P50) | 12.32 ms | 12.18 ms | -0.14 ms (82.10 vs 81.17 fps) | | 1% Low FPS | 63.65 fps | 63.90 fps | +0.25 fps | | 0.1% Low FPS | 52.66 fps | 52.94 fps | +0.28 fps | | p99 frame time | 15.73 ms | 15.66 ms | -0.07 ms | | `tex_lookup_ms` | 0.1063 ms | 0.0810 ms | -0.0253 ms (-23.81%) | | `draw_ms` | 7.3568 ms | 7.3102 ms | -0.0466 ms (-0.63%) | | `wait_gpu_ms` | 1.7740 ms | 1.6148 ms | -0.1592 ms (-8.97%) | | Frames >= 50 ms / min | 0.00 | 0.00 | +0.00 | Per-run frame-rate deltas (side 0 ON vs side 1 OFF): AB1 `+0.67%` (`79.5 vs 79.0`), AB2 `+1.43%` (`80.0 vs 78.8`), AB3 `+1.13%` (`80.4 vs 79.5`), AB4 `+1.28%` (`80.2 vs 79.2`), AB5 `+1.33%` (`81.4 vs 80.3`). ## Risks - Low risk: `gpu_write_history_fast` / `GpuOwnedBTree` / `TexGetMemo` mirror exact legacy boundary, overflow (`max_ranges=65536`), and eviction semantics, verified over 40,000+ randomized fuzz ops and 1,105,661 live `=check` comparisons (`0` mismatches). - Setting `RX_VK_TEX_BTREE_GET_FAST=0` cleanly reverts every code path at runtime without side effects; no persistent caches, saves, or options files change. ## 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 - [x] Everything in Still to test has run, its results in Tested. - [x] 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.
vk: add RX_VK_TEX_BTREE_GET_FAST 2-level chunked B-Tree & TexGetMemo (Wave 16A)
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
1242951037
Author
Contributor

Tested in game: Windows 11 RTX 4060 CPU-bound Market: RX_VK_TEX_BTREE_GET_FAST=check 1,105,661 checks / 819,325 tex_get_hits / 0 mismatches; 5x90s HOS_AB 5/5 won (+1.16% avg FPS, 95% CI +0.78%..+1.55%, 1% Low +0.25 FPS, 0.1% Low +0.28 FPS, tex_lookup_ms -23.81%, wait_gpu_ms -8.97%)

Tested in game: Windows 11 RTX 4060 CPU-bound Market: RX_VK_TEX_BTREE_GET_FAST=check 1,105,661 checks / 819,325 tex_get_hits / 0 mismatches; 5x90s HOS_AB 5/5 won (+1.16% avg FPS, 95% CI +0.78%..+1.55%, 1% Low +0.25 FPS, 0.1% Low +0.28 FPS, tex_lookup_ms -23.81%, wait_gpu_ms -8.97%)
Member

Possibly related, for context:

  • PR #2920 perf(vk): add per-thread texture/sampler and read-only SSBO descriptor memos — Merged adjacent Vulkan texture descriptor memo optimization; possible hot-path overlap.
Possibly related, for context: - PR #2920 perf(vk): add per-thread texture/sampler and read-only SSBO descriptor memos — Merged adjacent Vulkan texture descriptor memo optimization; possible hot-path overlap.
Member
@review
BeanBot left a comment

Recommendation: Approve. The claimed AI attribution is absent from the commit. The reported performance gain also needs a comparison with the base and testing on the other 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 replaces texture write-history and ownership maps with chunked structures, memoizes texture lookups, and reuses sweep storage. It adds substantial renderer code and migration logic; the reported A/B gain does not yet establish the net gain against the base.

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

  • L2 tests/test_vk_tex_btree_get_fast.py:13: The test runner forces clang instead of using the selected compiler. (more on the line) Do: Pass the runner's selected C++ compiler through the cxx placeholder and honor it without silently substituting another compiler.

Nits (2): optional.

  • L1: The checklist says AI assistance is recorded, but the PR's only commit has neither required attribution trailer. When: The checked AI-assistance box asserts attribution was recorded, while commit 124295103 contains no Assisted-by or Co-Authored-By trailer. Do: Add the applicable attribution trailer to the commit, or correct the checklist if AI assistance was not used.
  • L3 gpu/vk/switches.def:810: The switch row says mode 0 uses the legacy sweep, but the sweep's result collection and removal also changed in that mode. (more on the line) Do: Describe the remaining mode-0 sweep changes accurately, or restore the original sweep in mode 0.

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

  • L4: The net performance effect against the base at settings players use is unknown. When: Both benchmark columns run this PR, including mode checks, migration and changed sweep code; the reported +1.16% cannot establish the full change's effect against 56823e27a1. Do: Run interleaved base-versus-head measurements in the target and heavy scenes at the device's normal resolution and preset, reporting frame-time distribution and memory as well as FPS.
  • L5: The default-on renderer paths have not been tested on AMD Windows. When: The supplied parity and timing runs cover NVIDIA Windows only, while AMD Windows uses the same changed texture and ownership paths. Do: Run representative gameplay and base-versus-head frame-time measurements on Tier 1 AMD Windows hardware.
  • L6: The default-on renderer paths have not been tested on Tier 1 Linux systems. When: No NVIDIA Linux, AMD RADV Linux or Steam Deck gameplay or timing results accompany the Windows-only run. Do: Run representative gameplay and base-versus-head frame-time measurements on NVIDIA Linux, AMD RADV and Steam Deck.

@fix can do L1, L2 and L3.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • tests/test_vk_tex_btree_get_fast.py:464: Is there a concrete texture_get input and state for which the quick-return path currently produces an incorrect result?

Checks: Still running: 10 checks.

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

Does it help: Unproven. The PR reports 79.39 to 80.32 FPS and 0.1063 to 0.0810 ms texture lookup time over five Windows RTX 4060 runs, but both sides use the PR build and its switching and migration code. There is no measurement against base 56823e27a1 at player settings.

Other systems: The changed texture lookup, ownership, write tracking and eviction paths run across GPUs and both operating systems, including Steam Deck. The supplied game run covers Windows on an RTX 4060; AMD Windows, NVIDIA and AMD Linux, and Steam Deck results are not supplied. The check-mode run compares memoized pointers but does not execute the default mode's quick return.

Switches: RX_VK_TEX_BTREE_GET_FAST is added, defaults to 1, accepts 0 and check, and is listed in switches.def. Its default is supported by an RTX 4060 in-process A/B only; its effect on other supported systems and against the base remains unmeasured.

Reviewed: 1242951037 against 56823e27a1: Read AGENTS.md, CONTRIBUTING.md, the PR template, the relevant standards, the commit and diff, the new header and test, and surrounding texture, write-history and test-runner paths. Skimmed the remaining portions of the large renderer files and existing test harness; did not read every changed code file in full. docs/review-checklist.md and ../Tooling/AGENTS.md were not present.; nothing run (a code review).

Checked and fine:

  • The new switch has a switches.def row.
  • The changed-file list contains no apparent game-derived output, generated shader files or third-party changes.
  • The renderer API structures and version are unchanged.
  • The supplied check-mode run reports zero mismatches in 1,105,661 checks.

Testing: No code, scripts or tests were run during review. The author reports Windows RTX 4060 gameplay, parity and unit checks; CI was still running on this head.

Overlaps and merge order: Not checked; 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 claimed AI attribution is absent from the commit. The reported performance gain also needs a comparison with the base and testing on the other 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 replaces texture write-history and ownership maps with chunked structures, memoizes texture lookups, and reuses sweep storage. It adds substantial renderer code and migration logic; the reported A/B gain does not yet establish the net gain against the base. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `tests/test_vk_tex_btree_get_fast.py:13`: The test runner forces clang instead of using the selected compiler. (more on the line) **Do:** Pass the runner's selected C++ compiler through the cxx placeholder and honor it without silently substituting another compiler. **Nits (2)**: optional. - **L1**: The checklist says AI assistance is recorded, but the PR's only commit has neither required attribution trailer. *When:* The checked AI-assistance box asserts attribution was recorded, while commit 124295103 contains no Assisted-by or Co-Authored-By trailer. **Do:** Add the applicable attribution trailer to the commit, or correct the checklist if AI assistance was not used. - **L3** `gpu/vk/switches.def:810`: The switch row says mode 0 uses the legacy sweep, but the sweep's result collection and removal also changed in that mode. (more on the line) **Do:** Describe the remaining mode-0 sweep changes accurately, or restore the original sweep in mode 0. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The net performance effect against the base at settings players use is unknown. *When:* Both benchmark columns run this PR, including mode checks, migration and changed sweep code; the reported +1.16% cannot establish the full change's effect against 56823e27a13a. **Do:** Run interleaved base-versus-head measurements in the target and heavy scenes at the device's normal resolution and preset, reporting frame-time distribution and memory as well as FPS. - **L5**: The default-on renderer paths have not been tested on AMD Windows. *When:* The supplied parity and timing runs cover NVIDIA Windows only, while AMD Windows uses the same changed texture and ownership paths. **Do:** Run representative gameplay and base-versus-head frame-time measurements on Tier 1 AMD Windows hardware. - **L6**: The default-on renderer paths have not been tested on Tier 1 Linux systems. *When:* No NVIDIA Linux, AMD RADV Linux or Steam Deck gameplay or timing results accompany the Windows-only run. **Do:** Run representative gameplay and base-versus-head frame-time measurements on NVIDIA Linux, AMD RADV and Steam Deck. `@fix` can do L1, L2 and L3. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - `tests/test_vk_tex_btree_get_fast.py:464`: Is there a concrete texture_get input and state for which the quick-return path currently produces an incorrect result? **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The PR reports 79.39 to 80.32 FPS and 0.1063 to 0.0810 ms texture lookup time over five Windows RTX 4060 runs, but both sides use the PR build and its switching and migration code. There is no measurement against base 56823e27a13a at player settings. **Other systems:** The changed texture lookup, ownership, write tracking and eviction paths run across GPUs and both operating systems, including Steam Deck. The supplied game run covers Windows on an RTX 4060; AMD Windows, NVIDIA and AMD Linux, and Steam Deck results are not supplied. The check-mode run compares memoized pointers but does not execute the default mode's quick return. **Switches:** RX_VK_TEX_BTREE_GET_FAST is added, defaults to 1, accepts 0 and check, and is listed in switches.def. Its default is supported by an RTX 4060 in-process A/B only; its effect on other supported systems and against the base remains unmeasured. **Reviewed:** 12429510371d against 56823e27a13a: Read AGENTS.md, CONTRIBUTING.md, the PR template, the relevant standards, the commit and diff, the new header and test, and surrounding texture, write-history and test-runner paths. Skimmed the remaining portions of the large renderer files and existing test harness; did not read every changed code file in full. docs/review-checklist.md and ../Tooling/AGENTS.md were not present.; nothing run (a code review). **Checked and fine:** - The new switch has a switches.def row. - The changed-file list contains no apparent game-derived output, generated shader files or third-party changes. - The renderer API structures and version are unchanged. - The supplied check-mode run reports zero mismatches in 1,105,661 checks. **Testing:** No code, scripts or tests were run during review. The author reports Windows RTX 4060 gameplay, parity and unit checks; CI was still running on this head. **Overlaps and merge order:** Not checked; 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>
@ -807,6 +807,7 @@ SW(RX_VK_TEST_SUBMIT_REFUSE, diag, int, "off: the driver's answers", "Answers th
SW(RX_VK_TEST_VRAM_MB, diag, int, "the card's real VRAM", "Treats the card's VRAM as at most n MB wherever the renderer sizes something by it, to play a smaller card.")
SW(RX_VK_TEX_AHEAD, attempt, bool, "off: a texture is made and uploaded at the first draw that samples it", "=1 makes and uploads in light frames, before their first draw, the block-compressed textures an earlier load drew (listed in cache/longshot_textures_drawn.bin).")
SW(RX_VK_TEX_AHEAD_MS, tune, float, "12 ms", "<n>: the time in ms a light frame may spend preparing textures ahead of their first draw, with RX_VK_TEX_AHEAD=1.")
SW(RX_VK_TEX_BTREE_GET_FAST, kill, enum, "on (1): 2-level 128-entry chunked B-Tree for GPU write history and gpu_owned, 64x2 TexGetMemo with texture_touch_quick bypass, and reused sweep/arena helpers", "=0 (or off, false, no): uses legacy std::map GpuWriteHistory and gpu_owned, direct texture_get, and legacy sweep/arena loops; =check: keeps both in lockstep and logs any mismatch; any other value: on (HOS_AB may flip).")
Member

L3 (nit): The switch row says mode 0 uses the legacy sweep, but the sweep's result collection and removal also changed in that mode.

When: With the switch off, dead_targets_sweep still uses gone_vec and GoneSet instead of the base's unordered_set, so disabling it does not restore the entire legacy sweep.

Do: Describe the remaining mode-0 sweep changes accurately, or restore the original sweep in mode 0.

**L3** (nit): The switch row says mode 0 uses the legacy sweep, but the sweep's result collection and removal also changed in that mode. *When:* With the switch off, dead_targets_sweep still uses gone_vec and GoneSet instead of the base's unordered_set, so disabling it does not restore the entire legacy sweep. **Do:** Describe the remaining mode-0 sweep changes accurately, or restore the original sweep in mode 0.
@ -0,0 +10,4 @@
import subprocess
import tempfile
RUN_ALL_ARGS = ["--cc", "clang"]
Member

L2 (should fix): The test runner forces clang instead of using the selected compiler.

When: With CC or CXX selecting GCC or a particular toolchain and clang++ also installed, run_all passes --cc clang and this fixture compiles with clang++, so the selected compiler never checks the new header.

Do: Pass the runner's selected C++ compiler through the cxx placeholder and honor it without silently substituting another compiler.

**L2** (should fix): The test runner forces clang instead of using the selected compiler. *When:* With CC or CXX selecting GCC or a particular toolchain and clang++ also installed, run_all passes --cc clang and this fixture compiles with clang++, so the selected compiler never checks the new header. **Do:** Pass the runner's selected C++ compiler through the cxx placeholder and honor it without silently substituting another compiler.
siantm force-pushed perf/vk-tex-btree-get-fast from 1242951037
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 729410444a
Some checks are pending
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 5s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 1/1 pass
beanstalk/windows+amd 1/1 pass
beanstalk/linux+radv 2/1 pass
beanstalk/intel 0/1 pass, 0 running, 0 queued
beanstalk/steamdeck 0/1 pass, 0 running, 0 queued
beanstalk/linux+nvidia 0/1 pass, 0 running, 0 queued
2026-12-02 10:15:23 +00:00
Compare
Author
Contributor

Addressed review feedback in 729410444:

  • L1 (AI attribution trailer): Added Assisted-by: Antigravity (Google DeepMind) to the commit message.
  • L2 (tests/test_vk_tex_btree_get_fast.py): Changed RUN_ALL_ARGS to ["--cxx", "{cxx}"] and updated compiler resolution to use tests/compiler_command.py (--cxx, --cc, CXX, then c++/g++/clang++) and fail without substituting another compiler when an explicitly requested compiler is missing. Running with g++ -std=c++20 -Wall -Wextra -Werror caught a -Wsign-compare (pos + 1 >= kLeafHalf in gpu/vk/tex_btree_get_fast.h:128), fixed with static_cast<std::size_t>(pos) + 1 >= kLeafHalf.
  • L3 (gpu/vk/switches.def): Updated the RX_VK_TEX_BTREE_GET_FAST row so =0 accurately notes that dead_targets_sweep uses legacy by_start overlap and per-arena clock loops while still collecting/removing dead targets via the reused gone_vec/GoneSet storage.
  • Question (texture_touch_quick_inline): When RX_VK_TEX_BTREE_GET_FAST=1, the quick-return path in texture_get only fires when !cpu_over_gpu, !reupload_dim, !freed_listed, !reuse_retire, and either !for_sampling, (gpu_written && !released && !only_cleared), or (uploaded && checked_epoch == epoch) — all states where upload_defer(*tex) is false (since upload_defer requires !uploaded && !gpu_written) and texture_touch would immediately return tex.

Checks re-run after the final edit:

  • python -I tests/test_vk_tex_btree_get_fast.py (--cxx clang++, --cxx g++, --cc gcc, CXX=clang++, and default discovery): PASS (including all 12 MUST_FAIL_* variants; --cxx nonexistent-cxx-12345 fails cleanly with exit 1)
  • python -I tests/test_dead_targets_sweep.py --cxx clang++: PASS
  • python -I tests/test_direct_buffer_writes.py: PASS (11 cases, 0 failed)
  • python -I tests/test_compressed_over_rt.py: PASS
  • python -I tests/test_hos_ab.py --cc clang: PASS
  • python -I tests/test_tls_objects.py: PASS (19 TLS_OBJECTs; 44 other namespace-scope thread_locals)
  • python -I tests/test_vk_braces.py: PASS (620 renderer sources)
Addressed review feedback in 729410444: - **L1 (AI attribution trailer):** Added `Assisted-by: Antigravity (Google DeepMind)` to the commit message. - **L2 (`tests/test_vk_tex_btree_get_fast.py`):** Changed `RUN_ALL_ARGS` to `["--cxx", "{cxx}"]` and updated compiler resolution to use `tests/compiler_command.py` (`--cxx`, `--cc`, `CXX`, then `c++`/`g++`/`clang++`) and fail without substituting another compiler when an explicitly requested compiler is missing. Running with `g++ -std=c++20 -Wall -Wextra -Werror` caught a `-Wsign-compare` (`pos + 1 >= kLeafHalf` in `gpu/vk/tex_btree_get_fast.h:128`), fixed with `static_cast<std::size_t>(pos) + 1 >= kLeafHalf`. - **L3 (`gpu/vk/switches.def`):** Updated the `RX_VK_TEX_BTREE_GET_FAST` row so `=0` accurately notes that `dead_targets_sweep` uses legacy `by_start` overlap and per-arena clock loops while still collecting/removing dead targets via the reused `gone_vec`/`GoneSet` storage. - **Question (`texture_touch_quick_inline`):** When `RX_VK_TEX_BTREE_GET_FAST=1`, the quick-return path in `texture_get` only fires when `!cpu_over_gpu`, `!reupload_dim`, `!freed_listed`, `!reuse_retire`, and either `!for_sampling`, `(gpu_written && !released && !only_cleared)`, or `(uploaded && checked_epoch == epoch)` — all states where `upload_defer(*tex)` is false (since `upload_defer` requires `!uploaded && !gpu_written`) and `texture_touch` would immediately return `tex`. **Checks re-run after the final edit:** - `python -I tests/test_vk_tex_btree_get_fast.py` (`--cxx clang++`, `--cxx g++`, `--cc gcc`, `CXX=clang++`, and default discovery): PASS (including all 12 `MUST_FAIL_*` variants; `--cxx nonexistent-cxx-12345` fails cleanly with exit 1) - `python -I tests/test_dead_targets_sweep.py --cxx clang++`: PASS - `python -I tests/test_direct_buffer_writes.py`: PASS (11 cases, 0 failed) - `python -I tests/test_compressed_over_rt.py`: PASS - `python -I tests/test_hos_ab.py --cc clang`: PASS - `python -I tests/test_tls_objects.py`: PASS (19 `TLS_OBJECT`s; 44 other namespace-scope `thread_local`s) - `python -I tests/test_vk_braces.py`: PASS (620 renderer sources)
Owner

@review
@beanstalk

@review @beanstalk
Member

Beanstalk test farm · 🔄 testing (4 of 6 reports so far)

Commit 7294104 · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The farm does not measure the claimed texture-lookup or GPU-wait timings directly, and these samples cannot reliably establish the reported 1.16% gain.
⚠️ Note: This plan tests the shipped default against main, not live switch migration or the dual-shadow parity mode; it uses fixed CPU-oriented settings rather than each device's normal preset and resolution.

Done (started 14:54 UTC, last report 15:45 UTC). Comment @Beanstalk to run it again.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
windows+nvidia ✅ pass 1 1 5.9 → 6.0 (+2%) 7,247 → 7,151 (−1%) none
linux+nvidia ⏳ queued 0 of 1 — — —
windows+amd ✅ pass 1 1 9.1 → 8.9 (−3%) 7,947 → 8,043 (+1%) none
linux+radv ✅ pass (an outlier) 2 1 2 34.3 → 16.7 (−51%) 7,638 → 7,659 (+0%) none
intel ⏳ queued 0 of 1 — — —
steamdeck ⏳ queued 0 of 1 — — —
What was tested

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

The farm will compare the PR with main on Windows NVIDIA and AMD, Linux NVIDIA and RADV, Intel, and Steam Deck systems. Three starts per side will exercise the crowded Market and Hyrule Field at uncapped frame rates and a fixed 720p output, with 30 seconds of measurement per place after warm-up. It will compare frame-time distributions and VRAM use, and take stationary pictures to catch texture or rendering errors. Crashes, picture differences above the allowed tolerance, or frame-time regressions above 15% will fail the PR. 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).
  • texture-gameplay: from the repository's save market-entrance (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0; switches HOS_OUTPUT_RES=1280x720, RX_VK_AUTO_TUNE=0), then teleport to Market, take the picture market to compare with main, measure market for 30 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 30 s (after 10 s warm-up); 3 runs on each side.
  • Measured: crashes, frame times, stutters and hitches, VRAM use, memory and CPU time.
  • The PR fails if: it crashes; or a picture differs from main by more than 20%; or median frame time is more than 15% above main; or frame time (p99) is more than 15% above main; or frame time (worst 1%) is more than 15% above main.
  • Time: about 39 min of game runs per tester (6 game starts), plus the two builds.
Measurements on `windows+nvidia`, for the PR description

Verdict: pass on windows+nvidia (1 report): no rule failed and no PR run crashed.

Hardware: 1: 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: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 56823e2 After: this PR @ 7294104
texture-gameplay · field · median frame time (ms) 4.9 4.9 (−0%)
texture-gameplay · market · median frame time (ms) 7.1 7.0 (−1%)
texture-gameplay · field · frame time (p99) (ms) 5.9 6.0 (+2%)
texture-gameplay · market · frame time (p99) (ms) 8.8 8.8 (−1%)
texture-gameplay · field · frame time (worst 1%) (ms) 6.4 6.8 (+6%)
texture-gameplay · market · frame time (worst 1%) (ms) 9.9 9.7 (−2%)
texture-gameplay · field · peak VRAM (MB) 7,247 7,151 (−1%)
texture-gameplay · market · peak VRAM (MB) 5,575 5,511 (−1%)

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on windows+nvidia (1 report): no rule failed and no PR run crashed.

Hardware: 1: 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: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 56823e2 | After: this PR @ 7294104 |
|---|---|---|
| texture-gameplay · field · median frame time (ms) | 4.9 | 4.9 (−0%) |
| texture-gameplay · market · median frame time (ms) | 7.1 | 7.0 (−1%) |
| texture-gameplay · field · frame time (p99) (ms) | 5.9 | 6.0 (+2%) |
| texture-gameplay · market · frame time (p99) (ms) | 8.8 | 8.8 (−1%) |
| texture-gameplay · field · frame time (worst 1%) (ms) | 6.4 | 6.8 (+6%) |
| texture-gameplay · market · frame time (worst 1%) (ms) | 9.9 | 9.7 (−2%) |
| texture-gameplay · field · peak VRAM (MB) | 7,247 | 7,151 (−1%) |
| texture-gameplay · market · peak VRAM (MB) | 5,575 | 5,511 (−1%) |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `windows+amd`, for the PR description

Verdict: pass on windows+amd (1 report): no rule failed and no PR run crashed.

Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM
Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 56823e2 After: this PR @ 7294104
texture-gameplay · field · median frame time (ms) 7.1 6.9 (−2%)
texture-gameplay · market · median frame time (ms) 9.8 9.7 (−0%)
texture-gameplay · field · frame time (p99) (ms) 9.1 8.9 (−3%)
texture-gameplay · market · frame time (p99) (ms) 13.2 12.4 (−7%)
texture-gameplay · field · frame time (worst 1%) (ms) 10.0 9.9 (−0%)
texture-gameplay · market · frame time (worst 1%) (ms) 15.9 14.5 (−9%)
texture-gameplay · field · peak VRAM (MB) 7,947 8,043 (+1%)
texture-gameplay · market · peak VRAM (MB) 5,760 5,664 (−2%)

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on windows+amd (1 report): no rule failed and no PR run crashed.

Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM`  
Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 56823e2 | After: this PR @ 7294104 |
|---|---|---|
| texture-gameplay · field · median frame time (ms) | 7.1 | 6.9 (−2%) |
| texture-gameplay · market · median frame time (ms) | 9.8 | 9.7 (−0%) |
| texture-gameplay · field · frame time (p99) (ms) | 9.1 | 8.9 (−3%) |
| texture-gameplay · market · frame time (p99) (ms) | 13.2 | 12.4 (−7%) |
| texture-gameplay · field · frame time (worst 1%) (ms) | 10.0 | 9.9 (−0%) |
| texture-gameplay · market · frame time (worst 1%) (ms) | 15.9 | 14.5 (−9%) |
| texture-gameplay · field · peak VRAM (MB) | 7,947 | 8,043 (+1%) |
| texture-gameplay · market · peak VRAM (MB) | 5,760 | 5,664 (−2%) |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `linux+radv`, for the PR description

Verdict: pass on linux+radv (2 reports): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; 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 @ 56823e2 After: this PR @ 7294104
texture-gameplay · field · median frame time (ms) 7.9 7.9 (−1%)
texture-gameplay · market · median frame time (ms) 11.2 10.9 (−3%)
texture-gameplay · field · frame time (p99) (ms) 34.3 16.7 (−51%)
texture-gameplay · market · frame time (p99) (ms) 39.7 39.1 (−2%)
texture-gameplay · field · frame time (worst 1%) (ms) 40.7 36.5 (−10%)
texture-gameplay · market · frame time (worst 1%) (ms) 46.6 44.4 (−5%)
texture-gameplay · field · peak VRAM (MB) 7,638 7,659 (+0%)
texture-gameplay · market · peak VRAM (MB) 5,232 5,332 (+2%)

Flags and settings

None: the plan varied no setting, switch or build option.

As Markdown for the PR description:

## Measurements

**Verdict:** pass on linux+radv (2 reports): no rule failed and no PR run crashed.

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`  
Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; 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 @ 56823e2 | After: this PR @ 7294104 |
|---|---|---|
| texture-gameplay · field · median frame time (ms) | 7.9 | 7.9 (−1%) |
| texture-gameplay · market · median frame time (ms) | 11.2 | 10.9 (−3%) |
| texture-gameplay · field · frame time (p99) (ms) | 34.3 | 16.7 (−51%) |
| texture-gameplay · market · frame time (p99) (ms) | 39.7 | 39.1 (−2%) |
| texture-gameplay · field · frame time (worst 1%) (ms) | 40.7 | 36.5 (−10%) |
| texture-gameplay · market · frame time (worst 1%) (ms) | 46.6 | 44.4 (−5%) |
| texture-gameplay · field · peak VRAM (MB) | 7,638 | 7,659 (+0%) |
| texture-gameplay · market · peak VRAM (MB) | 5,232 | 5,332 (+2%) |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
windows+nvidia 1 windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess NVIDIA GeForce RTX 4090, 621.40.0 13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM
windows+amd 1 windows+amd+amd-proprietary+dgpu+window+fsr4 AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM
linux+radv 1 linux+amd+radv+dgpu AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
linux+radv 2 linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
<!-- beanstalk:sticky --> ### Beanstalk test farm · 🔄 testing (4 of 6 reports so far) Commit `7294104` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/3001) ⚠️ **Note:** The farm does not measure the claimed texture-lookup or GPU-wait timings directly, and these samples cannot reliably establish the reported 1.16% gain. ⚠️ **Note:** This plan tests the shipped default against main, not live switch migration or the dual-shadow parity mode; it uses fixed CPU-oriented settings rather than each device's normal preset and resolution. Done (started 14:54 UTC, last report 15:45 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows+nvidia` | ✅ pass | 1 [1](https://beanstalk.magicbean.dev/reports/rp_7dc6a0ce7c61bb8a) | 5.9 → 6.0 (+2%) | 7,247 → 7,151 (−1%) | none | | `linux+nvidia` | ⏳ queued | 0 of 1 | — | — | — | | `windows+amd` | ✅ pass | 1 [1](https://beanstalk.magicbean.dev/reports/rp_7b71d0d371fc9881) | 9.1 → 8.9 (−3%) | 7,947 → 8,043 (+1%) | none | | `linux+radv` | ✅ pass (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_844dc1905866e138) [2](https://beanstalk.magicbean.dev/reports/rp_6e7e5092805ca1aa) | 34.3 → 16.7 (−51%) | 7,638 → 7,659 (+0%) | none | | `intel` | ⏳ queued | 0 of 1 | — | — | — | | `steamdeck` | ⏳ queued | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The farm will compare the PR with main on Windows NVIDIA and AMD, Linux NVIDIA and RADV, Intel, and Steam Deck systems. Three starts per side will exercise the crowded Market and Hyrule Field at uncapped frame rates and a fixed 720p output, with 30 seconds of measurement per place after warm-up. It will compare frame-time distributions and VRAM use, and take stationary pictures to catch texture or rendering errors. Crashes, picture differences above the allowed tolerance, or frame-time regressions above 15% will fail the PR. 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). - **texture-gameplay:** from the repository's save `market-entrance` (settings vsync=2, resolution=1, frame_rate_cap=6, quality_preset=0, frame_generation=0; switches `HOS_OUTPUT_RES=1280x720`, `RX_VK_AUTO_TUNE=0`), then teleport to Market, take the picture market to compare with main, measure market for 30 s (after 10 s warm-up), teleport to Hyrule Field, take the picture field to compare with main, measure field for 30 s (after 10 s warm-up); 3 runs on each side. - **Measured:** crashes, frame times, stutters and hitches, VRAM use, memory and CPU time. - **The PR fails if:** it crashes; or a picture differs from main by more than 20%; or median frame time is more than 15% above main; or frame time (p99) is more than 15% above main; or frame time (worst 1%) is more than 15% above main. - **Time:** about 39 min of game runs per tester (6 game starts), plus the two builds. </details> <details><summary>Measurements on `windows+nvidia`, for the PR description</summary> **Verdict:** pass on windows+nvidia (1 report): no rule failed and no PR run crashed. Hardware: 1: 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: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 56823e2 | After: this PR @ 7294104 | |---|---|---| | texture-gameplay · field · median frame time (ms) | 4.9 | 4.9 (−0%) | | texture-gameplay · market · median frame time (ms) | 7.1 | 7.0 (−1%) | | texture-gameplay · field · frame time (p99) (ms) | 5.9 | 6.0 (+2%) | | texture-gameplay · market · frame time (p99) (ms) | 8.8 | 8.8 (−1%) | | texture-gameplay · field · frame time (worst 1%) (ms) | 6.4 | 6.8 (+6%) | | texture-gameplay · market · frame time (worst 1%) (ms) | 9.9 | 9.7 (−2%) | | texture-gameplay · field · peak VRAM (MB) | 7,247 | 7,151 (−1%) | | texture-gameplay · market · peak VRAM (MB) | 5,575 | 5,511 (−1%) | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on windows+nvidia (1 report): no rule failed and no PR run crashed. Hardware: 1: 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: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 56823e2 | After: this PR @ 7294104 | |---|---|---| | texture-gameplay · field · median frame time (ms) | 4.9 | 4.9 (−0%) | | texture-gameplay · market · median frame time (ms) | 7.1 | 7.0 (−1%) | | texture-gameplay · field · frame time (p99) (ms) | 5.9 | 6.0 (+2%) | | texture-gameplay · market · frame time (p99) (ms) | 8.8 | 8.8 (−1%) | | texture-gameplay · field · frame time (worst 1%) (ms) | 6.4 | 6.8 (+6%) | | texture-gameplay · market · frame time (worst 1%) (ms) | 9.9 | 9.7 (−2%) | | texture-gameplay · field · peak VRAM (MB) | 7,247 | 7,151 (−1%) | | texture-gameplay · market · peak VRAM (MB) | 5,575 | 5,511 (−1%) | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `windows+amd`, for the PR description</summary> **Verdict:** pass on windows+amd (1 report): no rule failed and no PR run crashed. Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM` Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 56823e2 | After: this PR @ 7294104 | |---|---|---| | texture-gameplay · field · median frame time (ms) | 7.1 | 6.9 (−2%) | | texture-gameplay · market · median frame time (ms) | 9.8 | 9.7 (−0%) | | texture-gameplay · field · frame time (p99) (ms) | 9.1 | 8.9 (−3%) | | texture-gameplay · market · frame time (p99) (ms) | 13.2 | 12.4 (−7%) | | texture-gameplay · field · frame time (worst 1%) (ms) | 10.0 | 9.9 (−0%) | | texture-gameplay · market · frame time (worst 1%) (ms) | 15.9 | 14.5 (−9%) | | texture-gameplay · field · peak VRAM (MB) | 7,947 | 8,043 (+1%) | | texture-gameplay · market · peak VRAM (MB) | 5,760 | 5,664 (−2%) | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on windows+amd (1 report): no rule failed and no PR run crashed. Hardware: 1: windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM` Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 56823e2 | After: this PR @ 7294104 | |---|---|---| | texture-gameplay · field · median frame time (ms) | 7.1 | 6.9 (−2%) | | texture-gameplay · market · median frame time (ms) | 9.8 | 9.7 (−0%) | | texture-gameplay · field · frame time (p99) (ms) | 9.1 | 8.9 (−3%) | | texture-gameplay · market · frame time (p99) (ms) | 13.2 | 12.4 (−7%) | | texture-gameplay · field · frame time (worst 1%) (ms) | 10.0 | 9.9 (−0%) | | texture-gameplay · market · frame time (worst 1%) (ms) | 15.9 | 14.5 (−9%) | | texture-gameplay · field · peak VRAM (MB) | 7,947 | 8,043 (+1%) | | texture-gameplay · market · peak VRAM (MB) | 5,760 | 5,664 (−2%) | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `linux+radv`, for the PR description</summary> **Verdict:** pass on linux+radv (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; 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 @ 56823e2 | After: this PR @ 7294104 | |---|---|---| | texture-gameplay · field · median frame time (ms) | 7.9 | 7.9 (−1%) | | texture-gameplay · market · median frame time (ms) | 11.2 | 10.9 (−3%) | | texture-gameplay · field · frame time (p99) (ms) | 34.3 | 16.7 (−51%) | | texture-gameplay · market · frame time (p99) (ms) | 39.7 | 39.1 (−2%) | | texture-gameplay · field · frame time (worst 1%) (ms) | 40.7 | 36.5 (−10%) | | texture-gameplay · market · frame time (worst 1%) (ms) | 46.6 | 44.4 (−5%) | | texture-gameplay · field · peak VRAM (MB) | 7,638 | 7,659 (+0%) | | texture-gameplay · market · peak VRAM (MB) | 5,232 | 5,332 (+2%) | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on linux+radv (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` Scene: texture-gameplay, 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); texture-gameplay: 3 game starts a side, market 30 s after 10 s warm-up, field 30 s after 10 s warm-up; 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 @ 56823e2 | After: this PR @ 7294104 | |---|---|---| | texture-gameplay · field · median frame time (ms) | 7.9 | 7.9 (−1%) | | texture-gameplay · market · median frame time (ms) | 11.2 | 10.9 (−3%) | | texture-gameplay · field · frame time (p99) (ms) | 34.3 | 16.7 (−51%) | | texture-gameplay · market · frame time (p99) (ms) | 39.7 | 39.1 (−2%) | | texture-gameplay · field · frame time (worst 1%) (ms) | 40.7 | 36.5 (−10%) | | texture-gameplay · market · frame time (worst 1%) (ms) | 46.6 | 44.4 (−5%) | | texture-gameplay · field · peak VRAM (MB) | 7,638 | 7,659 (+0%) | | texture-gameplay · market · peak VRAM (MB) | 5,232 | 5,332 (+2%) | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_7dc6a0ce7c61bb8a) | windows+nvidia+nvidia-proprietary+dgpu+window+dlss+xess `NVIDIA GeForce RTX 4090, 621.40.0` `13th Gen Intel(R) Core(TM) i7-13700K, 32 GB RAM` | | `windows+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_7b71d0d371fc9881) | windows+amd+amd-proprietary+dgpu+window+fsr4 `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 7950X 16-Core Processor, 128 GB RAM` | | `linux+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_844dc1905866e138) | linux+amd+radv+dgpu `AMD Radeon RX 9070 XT (RADV GFX1201), 26.3.1` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | | `linux+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_6e7e5092805ca1aa) | linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` | </details>
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported A/B result does not establish the net gain against the base, and Tier 1 AMD Windows and Linux coverage is still missing. CI is also still running. Recommend approval; not approved on the forge.

The change replaces texture write-history and ownership maps with cache-local structures, adds a texture lookup memo, and reuses sweep storage. It adds substantial renderer complexity for a reported small frame-rate gain whose net effect against the base remains unmeasured.

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

  • L4: The net performance effect against the base at settings players use is unknown. When: Both benchmark columns run this PR, including mode checks, migration and changed sweep code; the reported +1.16% cannot establish the full change's effect against 56823e27a1. Do: Run interleaved base-versus-head measurements in the target and heavy scenes at the device's normal resolution and preset, reporting frame-time distribution and memory as well as FPS.
  • L5: The default-on renderer paths have not been tested on AMD Windows. When: The supplied parity and timing runs cover NVIDIA Windows only, while AMD Windows uses the same changed texture and ownership paths. Do: Run representative gameplay and base-versus-head frame-time measurements on Tier 1 AMD Windows hardware.
  • L6: The default-on renderer paths have not been tested on Tier 1 Linux systems. When: No NVIDIA Linux, AMD RADV Linux or Steam Deck gameplay or timing results accompany the Windows-only run. Do: Run representative gameplay and base-versus-head frame-time measurements on NVIDIA Linux, AMD RADV and Steam Deck.

Since the last review (on 1242951037)
Resolved: L1 (The checklist says AI assistance is recorded, but the PR's only commit has neither require…); L2 (The test runner forces clang instead of using the selected compiler.); L3 (The switch row says mode 0 uses the legacy sweep, but the sweep's result collection and re…)
Still open: L4 (The net performance effect against the base at settings players use is unknown.); L5 (The default-on renderer paths have not been tested on AMD Windows.); L6 (The default-on renderer paths have not been tested on Tier 1 Linux systems.)

Checks: Still running: 10 checks.

Also noticed (1; not asked for, not blocking)
  • The maintainer requested a Beanstalk run; no farm request or result is available in the supplied evidence.
More: does it help, other systems, switches, what was read

Does it help: Unproven: five Windows RTX 4060 in-process A/B runs reported +1.16% average FPS and -23.81% texture lookup time, but both sides used the PR build and mode 0 still includes changed sweep storage. A comparison against the base at player settings is missing.

Other systems: The default-on texture paths affect Vulkan rendering across vendors and operating systems. Windows NVIDIA parity was reported with 1,105,661 checks and no mismatches; AMD Windows, Tier 1 Linux and Steam Deck results are not reported.

Switches: RX_VK_TEX_BTREE_GET_FAST is added, defaults to on, supports off and check modes, and can be flipped through HOS_AB. The default's net performance benefit against the base remains unproven.

Reviewed: 729410444a against 56823e27a1: Read AGENTS.md, CONTRIBUTING.md, the PR template, the commit message, the changed compiler-selection code and shared compiler helper, the changed B-tree expression, and the switch and sweep references. The remaining diff and new renderer header were skimmed; not every changed code file was read in full. docs/review-checklist.md and the neighboring Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The signedness fix preserves the split boundary calculation.
  • The author reports compiler-selection checks and Windows NVIDIA parity passing after the fix.

Testing: No code or tests were run during this review. CI is still running; the reported game and test results are author-supplied.

Overlaps and merge order: Not checked.


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 reported A/B result does not establish the net gain against the base, and Tier 1 AMD Windows and Linux coverage is still missing. CI is also still running. Recommend approval; not approved on the forge. The change replaces texture write-history and ownership maps with cache-local structures, adds a texture lookup memo, and reuses sweep storage. It adds substantial renderer complexity for a reported small frame-rate gain whose net effect against the base remains unmeasured. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The net performance effect against the base at settings players use is unknown. *When:* Both benchmark columns run this PR, including mode checks, migration and changed sweep code; the reported +1.16% cannot establish the full change's effect against 56823e27a13a. **Do:** Run interleaved base-versus-head measurements in the target and heavy scenes at the device's normal resolution and preset, reporting frame-time distribution and memory as well as FPS. - **L5**: The default-on renderer paths have not been tested on AMD Windows. *When:* The supplied parity and timing runs cover NVIDIA Windows only, while AMD Windows uses the same changed texture and ownership paths. **Do:** Run representative gameplay and base-versus-head frame-time measurements on Tier 1 AMD Windows hardware. - **L6**: The default-on renderer paths have not been tested on Tier 1 Linux systems. *When:* No NVIDIA Linux, AMD RADV Linux or Steam Deck gameplay or timing results accompany the Windows-only run. **Do:** Run representative gameplay and base-versus-head frame-time measurements on NVIDIA Linux, AMD RADV and Steam Deck. **Since the last review** (on 12429510371d) Resolved: L1 (The checklist says AI assistance is recorded, but the PR's only commit has neither require…); L2 (The test runner forces clang instead of using the selected compiler.); L3 (The switch row says mode 0 uses the legacy sweep, but the sweep's result collection and re…) Still open: L4 (The net performance effect against the base at settings players use is unknown.); L5 (The default-on renderer paths have not been tested on AMD Windows.); L6 (The default-on renderer paths have not been tested on Tier 1 Linux systems.) **Checks:** Still running: 10 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The maintainer requested a Beanstalk run; no farm request or result is available in the supplied evidence. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: five Windows RTX 4060 in-process A/B runs reported +1.16% average FPS and -23.81% texture lookup time, but both sides used the PR build and mode 0 still includes changed sweep storage. A comparison against the base at player settings is missing. **Other systems:** The default-on texture paths affect Vulkan rendering across vendors and operating systems. Windows NVIDIA parity was reported with 1,105,661 checks and no mismatches; AMD Windows, Tier 1 Linux and Steam Deck results are not reported. **Switches:** RX_VK_TEX_BTREE_GET_FAST is added, defaults to on, supports off and check modes, and can be flipped through HOS_AB. The default's net performance benefit against the base remains unproven. **Reviewed:** 729410444a3b against 56823e27a13a: Read AGENTS.md, CONTRIBUTING.md, the PR template, the commit message, the changed compiler-selection code and shared compiler helper, the changed B-tree expression, and the switch and sweep references. The remaining diff and new renderer header were skimmed; not every changed code file was read in full. docs/review-checklist.md and the neighboring Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The signedness fix preserves the split boundary calculation. - The author reports compiler-selection checks and Windows NVIDIA parity passing after the fix. **Testing:** No code or tests were run during this review. CI is still running; the reported game and test results are author-supplied. **Overlaps and merge order:** Not checked. </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 729410444a3b. RX_VK_TEX_BTREE_GET_FAST defaults to on in this revision.

Faster with the switch on. Median average FPS changed by +1.67%.

Metric Off (0) On (1)
Average FPS, each run 123.44 / 122.86 126.69 / 123.72
Average FPS, median 123.15 125.20
1% low FPS (1000 ÷ p99) 89.80 88.54
Median frame time 7.93 ms 7.75 ms
p99 frame time 11.14 ms 11.29 ms
Frames of 50 ms or more, each run 0 / 0 0 / 0

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.

Independent Linux Market A/B on PR head `729410444a3b`. `RX_VK_TEX_BTREE_GET_FAST` defaults to on in this revision. **Faster with the switch on.** Median average FPS changed by **+1.67%**. | Metric | Off (`0`) | On (`1`) | |---|---:|---:| | Average FPS, each run | 123.44 / 122.86 | 126.69 / 123.72 | | Average FPS, median | 123.15 | 125.20 | | 1% low FPS (1000 ÷ p99) | 89.80 | 88.54 | | Median frame time | 7.93 ms | 7.75 ms | | p99 frame time | 11.14 ms | 11.29 ms | | Frames of 50 ms or more, each run | 0 / 0 | 0 / 0 | 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.
HumanBean deleted branch perf/vk-tex-btree-get-fast 2026-12-02 16:14:02 +00:00
Owner

AMD Lab Market A/B on PR head 729410444a3b, using RX_VK_TEX_BTREE_GET_FAST=0 and RX_VK_TEX_BTREE_GET_FAST=1 on the same build.

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

Metric A (0) B (1)
Average FPS, each capture 58.16 / 55.05 / 56.14 56.56 / 55.26 / 55.65
Average FPS, median 56.14 55.65
1% low FPS (1000 ÷ p99), median 27.24 40.12
Median frame time 17.33 ms 17.52 ms
p99 frame time, median 36.72 ms 24.92 ms
Frames of 50 ms or more, each capture 1 / 16 / 8 6 / 12 / 4

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 5 / 51 / 32 frames on side A and 13 / 35 / 20 on side B across the three captures. The FPS and tail numbers include those frames.

AMD Lab Market A/B on PR head `729410444a3b`, using `RX_VK_TEX_BTREE_GET_FAST=0` and `RX_VK_TEX_BTREE_GET_FAST=1` on the same build. **Within the run-to-run spread.** Median average FPS changed by **-0.87%**. | Metric | A (`0`) | B (`1`) | |---|---:|---:| | Average FPS, each capture | 58.16 / 55.05 / 56.14 | 56.56 / 55.26 / 55.65 | | Average FPS, median | 56.14 | 55.65 | | 1% low FPS (1000 ÷ p99), median | 27.24 | 40.12 | | Median frame time | 17.33 ms | 17.52 ms | | p99 frame time, median | 36.72 ms | 24.92 ms | | Frames of 50 ms or more, each capture | 1 / 16 / 8 | 6 / 12 / 4 | 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 5 / 51 / 32 frames on side A and 13 / 35 / 20 on side B across the three captures. The FPS and tail numbers include those frames.
Author
Contributor

This was merged (head 7294104) before I answered. Here is a summary of the results posted since. The description can't be edited after the merge (our forge tooling refuses merged PRs), so they are recorded here.

Test farm (Beanstalk, main @ 56823e2 against 7294104): passed on all 4 reports, no crashes, pictures within main's own spread. Frame time p99 (ms), main → PR, fixed 720p CPU-oriented settings:

Tester Market Hyrule Field VRAM peak (MB)
RTX 4090, Windows 8.83 → 8.79 (−0.5%) 5.91 → 6.04 (+2.2%) 7,247 → 7,151
RX 9070 XT, Windows 13.23 → 12.37 (−6.5%) 9.14 → 8.87 (−2.9%) 7,947 → 8,043
RX 9070 XT, RADV, Linux 17.11 → 16.22 (−5.2%) 13.02 → 11.60 (−10.9%) 7,638 → 7,659
RX 7900 XTX, RADV, Linux 62.28 → 61.94 (−0.5%) 55.67 → 21.89 (−60.7%, an outlier) —

The linux+nvidia, Intel and Steam Deck jobs were still queued when it merged and have no report.

@HumanBean's A/Bs, RX_VK_TEX_BTREE_GET_FAST=0 against =1 on the same build: thanks.

  • Linux Market, RTX 3090: +1.67% median FPS (123.15 → 125.20). p99 went from 11.14 to 11.29 ms and the 1% low from 89.80 to 88.54 FPS, both within the spread.
  • AMD Lab Market, RX 580 / RADV: −0.87% median FPS (56.14 → 55.65), within the run-to-run spread. The tails improved (p99 36.72 → 24.92 ms, 1% low 27.24 → 40.12 FPS), but both sides still had pipeline or shader activity after warm-up (5/51/32 against 13/35/20 frames), so I don't read the tails as a gain.

The two A/Bs together don't confirm the +1.16% from my Windows run. They do show no slowdown on two more systems.

BeanBot's testing items:

  • L4 (net effect against the base): the farm's run is main against this head, with no regression above its limits on 4 PCs. It uses fixed 720p custom settings, not each device's normal preset, so L4 at player settings is still open.
  • L5 (AMD Windows): covered by the farm's RX 9070 XT Windows report (pass).
  • L6 (Linux, Steam Deck): RADV on Linux is covered (two farm reports and the AMD Lab), and so is NVIDIA on Linux (HumanBean's RTX 3090 A/B). The Steam Deck has not been tested.

No code change and nothing run from my side for this reply.

This was merged (head 7294104) before I answered. Here is a summary of the results posted since. The description can't be edited after the merge (our forge tooling refuses merged PRs), so they are recorded here. **Test farm (Beanstalk, main @ 56823e2 against 7294104): passed on all 4 reports, no crashes, pictures within main's own spread.** Frame time p99 (ms), main → PR, fixed 720p CPU-oriented settings: | Tester | Market | Hyrule Field | VRAM peak (MB) | |---|---:|---:|---:| | RTX 4090, Windows | 8.83 → 8.79 (−0.5%) | 5.91 → 6.04 (+2.2%) | 7,247 → 7,151 | | RX 9070 XT, Windows | 13.23 → 12.37 (−6.5%) | 9.14 → 8.87 (−2.9%) | 7,947 → 8,043 | | RX 9070 XT, RADV, Linux | 17.11 → 16.22 (−5.2%) | 13.02 → 11.60 (−10.9%) | 7,638 → 7,659 | | RX 7900 XTX, RADV, Linux | 62.28 → 61.94 (−0.5%) | 55.67 → 21.89 (−60.7%, an outlier) | — | The linux+nvidia, Intel and Steam Deck jobs were still queued when it merged and have no report. **@HumanBean's A/Bs, `RX_VK_TEX_BTREE_GET_FAST=0` against `=1` on the same build:** thanks. - Linux Market, RTX 3090: +1.67% median FPS (123.15 → 125.20). p99 went from 11.14 to 11.29 ms and the 1% low from 89.80 to 88.54 FPS, both within the spread. - AMD Lab Market, RX 580 / RADV: −0.87% median FPS (56.14 → 55.65), within the run-to-run spread. The tails improved (p99 36.72 → 24.92 ms, 1% low 27.24 → 40.12 FPS), but both sides still had pipeline or shader activity after warm-up (5/51/32 against 13/35/20 frames), so I don't read the tails as a gain. The two A/Bs together don't confirm the +1.16% from my Windows run. They do show no slowdown on two more systems. **BeanBot's testing items:** - **L4 (net effect against the base):** the farm's run is main against this head, with no regression above its limits on 4 PCs. It uses fixed 720p custom settings, not each device's normal preset, so L4 at player settings is still open. - **L5 (AMD Windows):** covered by the farm's RX 9070 XT Windows report (pass). - **L6 (Linux, Steam Deck):** RADV on Linux is covered (two farm reports and the AMD Lab), and so is NVIDIA on Linux (HumanBean's RTX 3090 A/B). The Steam Deck has not been tested. No code change and nothing run from my side for this reply.
Some checks are pending
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 5s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 1/1 pass
beanstalk/windows+amd 1/1 pass
beanstalk/linux+radv 2/1 pass
beanstalk/intel 0/1 pass, 0 running, 0 queued
beanstalk/steamdeck 0/1 pass, 0 running, 0 queued
beanstalk/linux+nvidia 0/1 pass, 0 running, 0 queued
Some workflows are waiting to be reviewed.
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!3001
No description provided.