fix(vk): admit newly needed capture buffer sizes into a full spare pool #2281

Open
tevan wants to merge 2 commits from tevan/Longshot:fix/capture-spare-admission into main
First-time contributor

Summary

After an area's buffer sizes change, the capture-spare pool can keep allocating a newly needed size on every submission. Twelve small spares cannot serve a large request, but cap_buf_free rejects the completed large buffer because those twelve slots remain occupied. A pool full by bytes can reject newly needed sizes even below twelve entries.

Let a completed real capture displace oldest-returned spares until its entry and bytes fit the existing limits. Pending prewarm workers keep their byte/slot reservations, and speculative workers cannot evict returned spares. Displaced objects are released after unlocking, through the existing asynchronous path or its synchronous kill switch. The eviction list is a fixed array, so admission itself needs no new heap allocation.

Read cap_buf_free in gpu/vk/vk_memory.cpp and tests/test_capture_spare_admission.py first. See #2220. This proposes a fix for the demonstrated admission bug; mitigation of the reported Lost Woods/Dodongo long-session slowdowns remains unproven. Related merged #1553/#1848/#1933 do not replace unsuitable spares; open #2244 changes when copies run, rather than spare admission, and is not a dependency.

The branch is now rebased onto main 0e32bc100dbe9e6c35602c33afa120ed4a88bab5, head ac5177783ac9c9791048ab93a15771a3c67b78cb. Review L1 isolates the regression executable from inherited RX_VK_CAP_MIN_MB; the renderer implementation is unchanged. The branch still reads test first, then fix. The replacement farm request compares the farm-selected main and PR, without historical revision constraints. The older commit IDs in the measurement table identify prior local evidence, not requested farm revisions.

Testing

Tested: RX 6800 XT 16 GB, RADV Mesa 26.2.5-arch1.1, Ryzen 5 7600X, 32 GB RAM, Linux 7.2.11-arch1-1.

  • The test commit alone fails on current main 0e32bc10 for the allocation count, not compilation (also reproduced on the earlier a2dc5385 base). The fix passes with GCC and Clang: sixteen requests use one driver allocation instead of sixteen. Coverage includes entry and byte exhaustion, 24 in-flight captures with mixed sizes, worker reservations, speculative prewarming, pressure limits, and exactly-once release outside the mutex.
  • Mutations disabling admission, allowing workers to evict, or moving destruction under the lock each compile and fail an assertion. Existing capture-spare-reuse and async-free tests pass. The existing test's only edit supplies the new <array> include for its production-function cut.
  • Complete Linux renderer build, final one-file rebuild and export checks pass. Pre-commit checks pass, including Ruff and secret detection. Required independent cold review found no remaining blocking ownership/locking/test issue.
  • Current head 6caf914c ran against current main 0e32bc10 in Hyrule Field at 3440x1440 / 75% render, frame generation off, uncapped, in queued A/B/A/B runs with isolated saves/options, 30 measured seconds each. Neither side had a frame of 50 ms or more; the short healthy scene did not reproduce the reported long-session problem.
  • A game-free real-RADV experiment extracts production cap_buf_get, cap_buf_size, cap_buf_free and create_buffer_cached; it observes real host-cached GPU mappings, not a stand-in allocator. Details and limitations are below.

Renderer-identical prior-head validation: Full strict suite on 6caf914c: 936 passed, four failures, 18 explicit platform/GPU skips. All four failures reproduce on unchanged main 0e32bc10: tests/test_dev_packs.py, tests/test_mise_build.py, tests/test_pipeline_state_computes.py, tests/test_saveload_warm_cache.py. Skips are not counted as passes. Additionally, all 82 strict changed-source checks pass; focused GCC/Clang, spare-reuse and async-free checks pass; pre-commit checks pass. Complete Linux renderer and Windows renderer cross-build/link/export checks pass. Windows compilation used the project-pinned llvm-mingw 20261104 via the supported CI cross-build path, with no game/dump needed. Actionlint's unchanged SC2016 is the same pre-existing workflow finding described earlier.

Historical mechanism evidence carried across the rebase: This fix was already run in-game on this PC at head 5499ba8a against main a2dc5385. The entire capture-memory module (including the admission callers, structures and locks) has no upstream changes between that base and current main; the cached Vulkan allocation/destruction functions are also unchanged. The authored fix remains byte-for-byte identical. The historical native fixture therefore measures the same allocation mechanism, and the earlier game run remains an integration smoke test of this change. Upstream changes elsewhere can affect whole-game performance: the old FPS results are not claimed to be current-head measurements or proof of frame-pacing neutrality. The fresh current-head comparison below independently checks the current integration; old numbers are not relabeled.

The guide permits other-hardware and rare-path testing during review. The remaining runtime/long-session checks below are still open; none is represented as completed.

Review L1 validation: The original fixture fails with caller RX_VK_CAP_MIN_MB=256; the corrected fixture removes only that override from the child environment. It passes with both GCC and Clang for caller values 2, 16 and 256. The corrected test still compiles and fails on main for 16 allocations versus the required 1, with both compilers. All 82 strict changed-source checks and pre-commit pass. No renderer source changed from game-tested 6caf914c; the game/build evidence below keeps its actual revision labels and applies to identical renderer code.

Still to test:

  • Linux RX 6800 XT: longer mixed-area loading/standing workload covering the reported Lost Woods/Dodongo episodes; compare allocation/fault rates, frame pacing, peak RAM/VRAM and transition costs (local tester, by hand).
  • Windows AMD/NVIDIA and Steam Deck: farm-selected main versus PR build/render/area-tour checks, identical settings and save copies per device, frame/load-time and peak-memory comparison, plus synchronous-release configuration smoke (Test Farm, maintainer approval required). The allocator/reservation invariants remain unit-test claims, and the long-session issue is not a farm-tour claim.

Measurements

Verdict: the admission bug is reproduced on current main and gone with this PR. Current production-function tests make 16 allocations on main and 1 here for the same sixteen requests, under GCC and Clang. That is the demonstrated fix measurement under the project's fix rule; no whole-game FPS gain or resolution of the original long-session episodes is claimed.

Setup: current main 0e32bc10 versus head ac517778, Linux x86-64, GCC and Clang, C++17 production-function extraction with a counting allocator; twelve unsuitable 2 MiB spares, sixteen requests for the 128 MiB class, return after each request. Baseline compiles and fails the reuse assertion for the allocation count; this PR passes.

Before: main @ 0e32bc100d After: this PR @ ac5177783a
Allocations for 16 identical requests, GCC 16 1
Allocations for 16 identical requests, Clang 16 1

Latest game comparison (renderer identical to current head):

Verdict: no difference shown: -0.8% fps (median 115.7 against 116.6), within the runs' spread (A 115.7 to 117.5, B 114.6 to 116.8).

Setup: Linux 7.2.11-arch1-1, RX 6800 XT, RADV Mesa 26.2.5-arch1.1; Hyrule Field, child (open, far view) (window 3440x1440); quality preset Custom, resolution 75% (2580x1080), output res 3440x1440 (native), frame generation Off, vsync Off; uncapped (HOS_FPS_MAX=1000); the frame trace, 30 s each after a warm-up until no frame waited for a pipeline, 2 interleaved pairs, the median; dev.py ab

Before: main @ 0e32bc10 After: this PR @ 6caf914c Δ
fps (each run) 115.7 / 117.5 (median 116.6) 116.8 / 114.6 (median 115.7) -0.8%
1% low fps (1000 / p99) 100.0 96.9 -3.1%
median frame time 8.57 ms 8.57 ms +0.00 ms
p99 frame time 10.00 ms 10.34 ms +0.34 ms
frames of 50 ms or more (median) 0 0 +0

Spread: observed fps ranges: A 115.7 to 117.5; B 114.6 to 116.8. These ranges do not predict what another run will show.

A1: 3471 frames in 30 s, 115.7 fps, median 8.63 ms, p99 10.07 ms, 1% low 99.3 fps, 0 cold frames
B1: 3504 frames in 30 s, 116.8 fps, median 8.56 ms, p99 9.86 ms, 1% low 101.4 fps, 0 cold frames
A2: 3525 frames in 30 s, 117.5 fps, median 8.51 ms, p99 9.93 ms, 1% low 100.7 fps, 0 cold frames
B2: 3439 frames in 30 s, 114.6 fps, median 8.58 ms, p99 10.82 ms, 1% low 92.4 fps, 0 cold frames
[hos host] vk: switches set (9): LONGSHOT_BUILD_NAME=A: main @ 0e32bc10 · hyrule-field (diag), HOS_FPS_MAX=1000 (player), RX_VK_FRAME_TRACE=1 (diag), HOS_AUDIO_MUTE=1 (diag), HOS_DISCORD=0 (kill), HOS_WINDOW_NOACTIVATE=1 (diag), HOS_OPTIONS_FILE=<a path> (diag), HOS_ENV_FILE=<a path> (diag), HOS_CONTROL=<a path> (diag)
[hos host] vk: switches set (9): LONGSHOT_BUILD_NAME=B: this PR @ 6caf914c · hyrule-field (diag), HOS_FPS_MAX=1000 (player), RX_VK_FRAME_TRACE=1 (diag), HOS_AUDIO_MUTE=1 (diag), HOS_DISCORD=0 (kill), HOS_WINDOW_NOACTIVATE=1 (diag), HOS_OPTIONS_FILE=<a path> (diag), HOS_ENV_FILE=<a path> (diag), HOS_CONTROL=<a path> (diag)

Historical local measurements (before rebase):

Verdict: fixes the production-function admission regression and reduces real-RADV allocation/mapping work in the reproducer. No gameplay FPS improvement is demonstrated: the short game comparison is within spread. The original long-session mitigation is still to test.

Game setup: same PC above, Hyrule Field (child), windowed 3440x1440, Custom preset, 75% render (2580x1080), frame generation/V-Sync off, HOS_FPS_MAX=1000, frame trace; at least 10 seconds warm-up until no frame waited for a pipeline, then 30 seconds measured, A/B/A/B. All game runs/builds used the project queue and shared base/pack runtimes.

Native experiment setup: same real RX 6800 XT/RADV; twelve initial 2 MiB spares, sixteen requests for 96 MiB (128 MiB allocation class), four CPU-copy workers, A/B/A/B, medians. Both sides use production cached Vulkan allocation via VMA and host-cached mappings. No GPU commands are submitted. It models immediate get/return with synchronous freeing, rather than gameplay's normal asynchronous release and full retirement pipeline; its timings are not gameplay frame-time predictions. Source initialization/instance/device setup are outside the measured loop.

Before: main @ a2dc538590 After: this PR @ 5499ba8adb
Production-function test: allocations for 16 requests 16 1
Real RADV reproducer: allocations 16 1
Real RADV reproducer: major faults, median 14,985 872.5 (-94.2%)
Real RADV reproducer: CPU copy time, median 102.802 ms 90.133 ms
Real RADV reproducer: allocation/copy/free loop, median 152.854 ms 92.417 ms (-39.5%)
Hyrule Field FPS, each run 115.6 / 116.4 116.2 / 116.1
Hyrule Field FPS, median 116.0 116.2 (+0.1%, within spread)
Hyrule Field 1% low FPS 100.1 99.9
Hyrule Field median / p99 frame time 8.62 / 9.99 ms 8.60 / 10.01 ms
Hyrule Field frames of at least 50 ms 0 0

Native run spread: main major faults 14,869 / 15,101, loop 154.977 / 150.731 ms; branch major faults 854 / 891, loop 92.969 / 91.864 ms. Game FPS ranges overlap; a gain there is not claimed. Peak RAM/VRAM and longer area-load behavior are not yet measured.

Risks

FIFO replacement may release a cold large/prewarmed spare earlier, changing a later area's allocation cost. Mixed-size loading, peak memory and longer play therefore remain explicit validation gaps. Entry/byte ceilings and worker reservations stay unchanged; only completed spares are displaced. RX_VK_CAP_FREE_ASYNC=0 still permits synchronous destruction, outside the pool mutex; no switch is added or changed. A revert restores the old policy. No API, settings, save or cache-format change.

No game files, saves, options, binaries, caches, raw profiles or local paths are attached; measurements here are aggregate text.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. Rebased onto 0e32bc10.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. Latest main/PR A/B/A/B results and the test-only follow-up rationale are documented above.
  • mise run test passes (any failure that also fails on main is named). Strict results, the test-only follow-up and four unchanged-main failures are named above; explicit platform/GPU skips are not counted as passes.
  • Measured against main, or Measurements says why there is nothing to measure. The current-main production-function regression is demonstrated; renderer-identical game comparison and labeled historical mechanism evidence are included, and unconfirmed long-session work remains in Still to test.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test fails on main and passes here; test commit precedes fix commit.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Docs updated.
  • AI assistance recorded with Assisted-by/Co-Authored-By trailers.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Full Linux renderer and Windows cross-build/link/export checks pass; Windows runtime coverage remains in Still to test.

Ready to merge

  • Everything in Still to test has run, results in Tested.
  • Affected Tier 1 hardware tested.
  • Approved in review, every comment answered.
  • CI passes on current head/main and measurements still hold.
## Summary After an area's buffer sizes change, the capture-spare pool can keep allocating a newly needed size on every submission. Twelve small spares cannot serve a large request, but `cap_buf_free` rejects the completed large buffer because those twelve slots remain occupied. A pool full by bytes can reject newly needed sizes even below twelve entries. Let a completed real capture displace oldest-returned spares until its entry and bytes fit the existing limits. Pending prewarm workers keep their byte/slot reservations, and speculative workers cannot evict returned spares. Displaced objects are released after unlocking, through the existing asynchronous path or its synchronous kill switch. The eviction list is a fixed array, so admission itself needs no new heap allocation. Read `cap_buf_free` in `gpu/vk/vk_memory.cpp` and `tests/test_capture_spare_admission.py` first. See #2220. This proposes a fix for the demonstrated admission bug; mitigation of the reported Lost Woods/Dodongo long-session slowdowns remains unproven. Related merged #1553/#1848/#1933 do not replace unsuitable spares; open #2244 changes when copies run, rather than spare admission, and is not a dependency. The branch is now rebased onto main `0e32bc100dbe9e6c35602c33afa120ed4a88bab5`, head `ac5177783ac9c9791048ab93a15771a3c67b78cb`. Review L1 isolates the regression executable from inherited `RX_VK_CAP_MIN_MB`; the renderer implementation is unchanged. The branch still reads test first, then fix. The replacement farm request compares the farm-selected **main and PR**, without historical revision constraints. The older commit IDs in the measurement table identify prior local evidence, not requested farm revisions. ## Testing **Tested:** RX 6800 XT 16 GB, RADV Mesa 26.2.5-arch1.1, Ryzen 5 7600X, 32 GB RAM, Linux 7.2.11-arch1-1. - The test commit alone fails on current main `0e32bc10` for the allocation count, not compilation (also reproduced on the earlier `a2dc5385` base). The fix passes with GCC and Clang: sixteen requests use one driver allocation instead of sixteen. Coverage includes entry and byte exhaustion, 24 in-flight captures with mixed sizes, worker reservations, speculative prewarming, pressure limits, and exactly-once release outside the mutex. - Mutations disabling admission, allowing workers to evict, or moving destruction under the lock each compile and fail an assertion. Existing capture-spare-reuse and async-free tests pass. The existing test's only edit supplies the new `<array>` include for its production-function cut. - Complete Linux renderer build, final one-file rebuild and export checks pass. Pre-commit checks pass, including Ruff and secret detection. Required independent cold review found no remaining blocking ownership/locking/test issue. - Current head `6caf914c` ran against current main `0e32bc10` in Hyrule Field at 3440x1440 / 75% render, frame generation off, uncapped, in queued A/B/A/B runs with isolated saves/options, 30 measured seconds each. Neither side had a frame of 50 ms or more; the short healthy scene did not reproduce the reported long-session problem. - A game-free real-RADV experiment extracts production `cap_buf_get`, `cap_buf_size`, `cap_buf_free` and `create_buffer_cached`; it observes real host-cached GPU mappings, not a stand-in allocator. Details and limitations are below. **Renderer-identical prior-head validation:** Full strict suite on `6caf914c`: 936 passed, four failures, 18 explicit platform/GPU skips. All four failures reproduce on unchanged main `0e32bc10`: `tests/test_dev_packs.py`, `tests/test_mise_build.py`, `tests/test_pipeline_state_computes.py`, `tests/test_saveload_warm_cache.py`. Skips are not counted as passes. Additionally, all 82 strict changed-source checks pass; focused GCC/Clang, spare-reuse and async-free checks pass; pre-commit checks pass. Complete Linux renderer and Windows renderer cross-build/link/export checks pass. Windows compilation used the project-pinned llvm-mingw 20261104 via the supported CI cross-build path, with no game/dump needed. Actionlint's unchanged SC2016 is the same pre-existing workflow finding described earlier. **Historical mechanism evidence carried across the rebase:** This fix was already run in-game on this PC at head `5499ba8a` against main `a2dc5385`. The entire capture-memory module (including the admission callers, structures and locks) has no upstream changes between that base and current main; the cached Vulkan allocation/destruction functions are also unchanged. The authored fix remains byte-for-byte identical. The historical native fixture therefore measures the same allocation mechanism, and the earlier game run remains an integration smoke test of this change. Upstream changes elsewhere can affect whole-game performance: the old FPS results are not claimed to be current-head measurements or proof of frame-pacing neutrality. The fresh current-head comparison below independently checks the current integration; old numbers are not relabeled. The guide permits other-hardware and rare-path testing during review. The remaining runtime/long-session checks below are still open; none is represented as completed. **Review L1 validation:** The original fixture fails with caller `RX_VK_CAP_MIN_MB=256`; the corrected fixture removes only that override from the child environment. It passes with both GCC and Clang for caller values 2, 16 and 256. The corrected test still compiles and fails on main for 16 allocations versus the required 1, with both compilers. All 82 strict changed-source checks and pre-commit pass. No renderer source changed from game-tested `6caf914c`; the game/build evidence below keeps its actual revision labels and applies to identical renderer code. **Still to test:** - Linux RX 6800 XT: longer mixed-area loading/standing workload covering the reported Lost Woods/Dodongo episodes; compare allocation/fault rates, frame pacing, peak RAM/VRAM and transition costs (local tester, by hand). - Windows AMD/NVIDIA and Steam Deck: farm-selected main versus PR build/render/area-tour checks, identical settings and save copies per device, frame/load-time and peak-memory comparison, plus synchronous-release configuration smoke (Test Farm, maintainer approval required). The allocator/reservation invariants remain unit-test claims, and the long-session issue is not a farm-tour claim. ## Measurements **Verdict:** the admission bug is reproduced on current main and gone with this PR. Current production-function tests make 16 allocations on main and 1 here for the same sixteen requests, under GCC and Clang. That is the demonstrated fix measurement under the project's `fix` rule; no whole-game FPS gain or resolution of the original long-session episodes is claimed. **Setup:** current main `0e32bc10` versus head `ac517778`, Linux x86-64, GCC and Clang, C++17 production-function extraction with a counting allocator; twelve unsuitable 2 MiB spares, sixteen requests for the 128 MiB class, return after each request. Baseline compiles and fails the reuse assertion for the allocation count; this PR passes. | | Before: main @ 0e32bc100dbe | After: this PR @ ac5177783ac9 | |---|---|---| | Allocations for 16 identical requests, GCC | 16 | 1 | | Allocations for 16 identical requests, Clang | 16 | 1 | **Latest game comparison (renderer identical to current head):** **Verdict:** no difference shown: -0.8% fps (median 115.7 against 116.6), within the runs' spread (A 115.7 to 117.5, B 114.6 to 116.8). **Setup:** Linux 7.2.11-arch1-1, RX 6800 XT, RADV Mesa 26.2.5-arch1.1; Hyrule Field, child (open, far view) (window 3440x1440); quality preset Custom, resolution 75% (2580x1080), output res 3440x1440 (native), frame generation Off, vsync Off; uncapped (HOS_FPS_MAX=1000); the frame trace, 30 s each after a warm-up until no frame waited for a pipeline, 2 interleaved pairs, the median; `dev.py ab` | | Before: main @ 0e32bc10 | After: this PR @ 6caf914c | Δ | |---|---|---|---| | fps (each run) | 115.7 / 117.5 (median 116.6) | 116.8 / 114.6 (median 115.7) | -0.8% | | 1% low fps (1000 / p99) | 100.0 | 96.9 | -3.1% | | median frame time | 8.57 ms | 8.57 ms | +0.00 ms | | p99 frame time | 10.00 ms | 10.34 ms | +0.34 ms | | frames of 50 ms or more (median) | 0 | 0 | +0 | **Spread:** observed fps ranges: A 115.7 to 117.5; B 114.6 to 116.8. These ranges do not predict what another run will show. ``` A1: 3471 frames in 30 s, 115.7 fps, median 8.63 ms, p99 10.07 ms, 1% low 99.3 fps, 0 cold frames B1: 3504 frames in 30 s, 116.8 fps, median 8.56 ms, p99 9.86 ms, 1% low 101.4 fps, 0 cold frames A2: 3525 frames in 30 s, 117.5 fps, median 8.51 ms, p99 9.93 ms, 1% low 100.7 fps, 0 cold frames B2: 3439 frames in 30 s, 114.6 fps, median 8.58 ms, p99 10.82 ms, 1% low 92.4 fps, 0 cold frames [hos host] vk: switches set (9): LONGSHOT_BUILD_NAME=A: main @ 0e32bc10 · hyrule-field (diag), HOS_FPS_MAX=1000 (player), RX_VK_FRAME_TRACE=1 (diag), HOS_AUDIO_MUTE=1 (diag), HOS_DISCORD=0 (kill), HOS_WINDOW_NOACTIVATE=1 (diag), HOS_OPTIONS_FILE=<a path> (diag), HOS_ENV_FILE=<a path> (diag), HOS_CONTROL=<a path> (diag) [hos host] vk: switches set (9): LONGSHOT_BUILD_NAME=B: this PR @ 6caf914c · hyrule-field (diag), HOS_FPS_MAX=1000 (player), RX_VK_FRAME_TRACE=1 (diag), HOS_AUDIO_MUTE=1 (diag), HOS_DISCORD=0 (kill), HOS_WINDOW_NOACTIVATE=1 (diag), HOS_OPTIONS_FILE=<a path> (diag), HOS_ENV_FILE=<a path> (diag), HOS_CONTROL=<a path> (diag) ``` **Historical local measurements (before rebase):** **Verdict:** fixes the production-function admission regression and reduces real-RADV allocation/mapping work in the reproducer. No gameplay FPS improvement is demonstrated: the short game comparison is within spread. The original long-session mitigation is still to test. Game setup: same PC above, Hyrule Field (child), windowed 3440x1440, Custom preset, 75% render (2580x1080), frame generation/V-Sync off, `HOS_FPS_MAX=1000`, frame trace; at least 10 seconds warm-up until no frame waited for a pipeline, then 30 seconds measured, A/B/A/B. All game runs/builds used the project queue and shared base/pack runtimes. Native experiment setup: same real RX 6800 XT/RADV; twelve initial 2 MiB spares, sixteen requests for 96 MiB (128 MiB allocation class), four CPU-copy workers, A/B/A/B, medians. Both sides use production cached Vulkan allocation via VMA and host-cached mappings. No GPU commands are submitted. It models immediate get/return with synchronous freeing, rather than gameplay's normal asynchronous release and full retirement pipeline; its timings are not gameplay frame-time predictions. Source initialization/instance/device setup are outside the measured loop. | | Before: main @ a2dc53859018 | After: this PR @ 5499ba8adbeb | |---|---|---| | Production-function test: allocations for 16 requests | 16 | 1 | | Real RADV reproducer: allocations | 16 | 1 | | Real RADV reproducer: major faults, median | 14,985 | 872.5 (-94.2%) | | Real RADV reproducer: CPU copy time, median | 102.802 ms | 90.133 ms | | Real RADV reproducer: allocation/copy/free loop, median | 152.854 ms | 92.417 ms (-39.5%) | | Hyrule Field FPS, each run | 115.6 / 116.4 | 116.2 / 116.1 | | Hyrule Field FPS, median | 116.0 | 116.2 (+0.1%, within spread) | | Hyrule Field 1% low FPS | 100.1 | 99.9 | | Hyrule Field median / p99 frame time | 8.62 / 9.99 ms | 8.60 / 10.01 ms | | Hyrule Field frames of at least 50 ms | 0 | 0 | Native run spread: main major faults 14,869 / 15,101, loop 154.977 / 150.731 ms; branch major faults 854 / 891, loop 92.969 / 91.864 ms. Game FPS ranges overlap; a gain there is not claimed. Peak RAM/VRAM and longer area-load behavior are not yet measured. ## Risks FIFO replacement may release a cold large/prewarmed spare earlier, changing a later area's allocation cost. Mixed-size loading, peak memory and longer play therefore remain explicit validation gaps. Entry/byte ceilings and worker reservations stay unchanged; only completed spares are displaced. `RX_VK_CAP_FREE_ASYNC=0` still permits synchronous destruction, outside the pool mutex; no switch is added or changed. A revert restores the old policy. No API, settings, save or cache-format change. No game files, saves, options, binaries, caches, raw profiles or local paths are attached; measurements here are aggregate text. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. Rebased onto `0e32bc10`. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. Latest main/PR A/B/A/B results and the test-only follow-up rationale are documented above. - [x] `mise run test` passes (any failure that also fails on `main` is named). Strict results, the test-only follow-up and four unchanged-main failures are named above; explicit platform/GPU skips are not counted as passes. - [x] Measured against `main`, or Measurements says why there is nothing to measure. The current-main production-function regression is demonstrated; renderer-identical game comparison and labeled historical mechanism evidence are included, and unconfirmed long-session work remains in Still to test. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test fails on main and passes here; test commit precedes fix commit. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Docs updated. - [x] AI assistance recorded with Assisted-by/Co-Authored-By trailers. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Full Linux renderer and Windows cross-build/link/export checks pass; Windows runtime coverage remains in Still to test. ### Ready to merge - [ ] Everything in Still to test has run, results in Tested. - [ ] Affected Tier 1 hardware tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on current head/main and measurements still hold.
Exercise production get/free paths with full slot and byte budgets.
The first reuse assertion fails on main because newly needed buffers
are discarded while unsuitable spares remain cached.

Assisted-by: OpenAI Codex
Co-Authored-By: OpenAI Codex <[email protected]>
fix(vk): make room for returned capture buffer classes
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 26s
beanstalk/approval can't be tested as asked: see the farm's comment
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
5499ba8adb
A full spare pool could reject every return of a newly needed size,
allocating it again on every submission. Make room by displacing the
oldest returned buffers, within the existing byte and slot budgets.
Protect workers reservations and leave speculative completions unable
to displace returned spares. Release displaced buffers outside the
pool mutex through the existing asynchronous destruction path.

Assisted-by: OpenAI Codex
Co-Authored-By: OpenAI Codex <[email protected]>
Author
First-time contributor

Tested in game: RX 6800 XT 16 GB, RADV Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1: queued isolated Hyrule Field A/B/A/B, 3440x1440 output / 75% render, frame generation and V-Sync off, uncapped, 30 measured seconds per run after warm-up; main a2dc5385 median 116.0 FPS versus head 5499ba8a 116.2 FPS, within spread, no frames >=50 ms on either side. Candidate rendered normally. The reported long-session Lost Woods/Dodongo slowdown was not reproduced and is not claimed fixed. Source regression and real-RADV-buffer experiments independently demonstrate admission churn and reduced mapping faults.

Tested in game: RX 6800 XT 16 GB, RADV Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1: queued isolated Hyrule Field A/B/A/B, 3440x1440 output / 75% render, frame generation and V-Sync off, uncapped, 30 measured seconds per run after warm-up; main a2dc5385 median 116.0 FPS versus head 5499ba8a 116.2 FPS, within spread, no frames >=50 ms on either side. Candidate rendered normally. The reported long-session Lost Woods/Dodongo slowdown was not reproduced and is not claimed fixed. Source regression and real-RADV-buffer experiments independently demonstrate admission churn and reduced mapping faults.
Author
First-time contributor

@Beanstalk please validate the Windows renderer build and run this PR on Windows AMD, Windows NVIDIA, and Steam Deck, with a maintainer's approval.

Use main a2dc5385901812d183c4b7f0f9d48b295f17a510 (the tested base) against PR head 5499ba8adbeb4cf8a5ec5284b72facbc49f76c1f, identical scene/settings/save copies, two interleaved area-change tours per side through Kokiri Forest, Hyrule Field, Market and Kakariko. Record crashes, rendering errors, peak RAM/VRAM, frame pacing/frames >=50 ms and the renderer's capture-spare/budget lines. Expect the existing entry/byte limits and worker reservations to hold, and no new rendering/load regression. Include a short smoke with RX_VK_CAP_FREE_ASYNC=0 to exercise synchronous release outside the pool lock, alongside the normal default.

The PR stays WIP: a rebase and measurements against latest main are separate outstanding author work. Do not attribute a comparison against a different/unmatched base to this admission change. The short Linux game A/B showed no FPS difference beyond spread; the real-RADV allocation/mapping reproducer is the demonstrated gain. These requests do not assert that the reported long-session episodes are fixed.

@Beanstalk please validate the Windows renderer build and run this PR on Windows AMD, Windows NVIDIA, and Steam Deck, with a maintainer's approval. Use main `a2dc5385901812d183c4b7f0f9d48b295f17a510` (the tested base) against PR head `5499ba8adbeb4cf8a5ec5284b72facbc49f76c1f`, identical scene/settings/save copies, two interleaved area-change tours per side through Kokiri Forest, Hyrule Field, Market and Kakariko. Record crashes, rendering errors, peak RAM/VRAM, frame pacing/frames >=50 ms and the renderer's capture-spare/budget lines. Expect the existing entry/byte limits and worker reservations to hold, and no new rendering/load regression. Include a short smoke with RX_VK_CAP_FREE_ASYNC=0 to exercise synchronous release outside the pool lock, alongside the normal default. The PR stays WIP: a rebase and measurements against latest main are separate outstanding author work. Do not attribute a comparison against a different/unmatched base to this admission change. The short Linux game A/B showed no FPS difference beyond spread; the real-RADV allocation/mapping reproducer is the demonstrated gain. These requests do not assert that the reported long-session episodes are fixed.
Member

@tevan only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@tevan only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Member

Beanstalk test farm

Commit ac51777 · 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 `ac51777` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2281) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
First-time contributor

Rebased onto current main 753fb5af; new head a8369e79. The authored four-file diff and admission functions are unchanged. Focused GCC/Clang checks, full Linux renderer rebuild/export checks and pre-commit checks pass; the current strict suite has 936 passes and four failures reproduced on unchanged current main, all named in the description. Historical game/native measurements remain labeled with the revisions actually tested. The rejected farm request will be replaced with the supported farm-selected main-versus-PR build/area-tour plan, without commit constraints or custom allocator/log assertions. The PR remains WIP for fresh game/memory/long-session and Windows coverage.

Rebased onto current main 753fb5af; new head a8369e79. The authored four-file diff and admission functions are unchanged. Focused GCC/Clang checks, full Linux renderer rebuild/export checks and pre-commit checks pass; the current strict suite has 936 passes and four failures reproduced on unchanged current main, all named in the description. Historical game/native measurements remain labeled with the revisions actually tested. The rejected farm request will be replaced with the supported farm-selected main-versus-PR build/area-tour plan, without commit constraints or custom allocator/log assertions. The PR remains WIP for fresh game/memory/long-session and Windows coverage.
Author
First-time contributor

@Beanstalk please replace the earlier request with this supported main-versus-PR compatibility plan.

Compare the farm's current main and this PR on Windows AMD, Windows NVIDIA and Steam Deck. Use the revisions selected by the farm and record their commit IDs in the results. Build both sides, then run two interleaved area-change tours per side through Kokiri Forest, Hyrule Field, Market and Kakariko Village, with identical settings and save copies per device.

Compare still-scene pictures using the farm's normal image tolerance, crashes, median/p99 frame times, and load times. Flag a frame-time or load-time regression above 10%. Record peak RAM and VRAM for comparison. Add a short startup/area-change smoke with RX_VK_CAP_FREE_ASYNC=0 to check the synchronous-release configuration.

These are build, rendering and area-tour checks. The production-function regression, allocator/fault experiment and reservation/retention invariants are separate local/unit validations; the original long-session slowdown remains a separate validation gap. This request does not select historical commits, parse custom capture-budget log lines, require a particular cache-eviction event, or claim to prove the original hitches fixed.

A BigBeans maintainer may need to approve this replacement request for the rebased head with 👍. Please generate a fresh plan rather than override the earlier rejected plan.

@Beanstalk please replace the earlier request with this supported main-versus-PR compatibility plan. Compare the farm's current main and this PR on Windows AMD, Windows NVIDIA and Steam Deck. Use the revisions selected by the farm and record their commit IDs in the results. Build both sides, then run two interleaved area-change tours per side through Kokiri Forest, Hyrule Field, Market and Kakariko Village, with identical settings and save copies per device. Compare still-scene pictures using the farm's normal image tolerance, crashes, median/p99 frame times, and load times. Flag a frame-time or load-time regression above 10%. Record peak RAM and VRAM for comparison. Add a short startup/area-change smoke with RX_VK_CAP_FREE_ASYNC=0 to check the synchronous-release configuration. These are build, rendering and area-tour checks. The production-function regression, allocator/fault experiment and reservation/retention invariants are separate local/unit validations; the original long-session slowdown remains a separate validation gap. This request does not select historical commits, parse custom capture-budget log lines, require a particular cache-eviction event, or claim to prove the original hitches fixed. A BigBeans maintainer may need to approve this replacement request for the rebased head with 👍. Please generate a fresh plan rather than override the earlier rejected plan.
Member

@tevan only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it or to this comment. This request was for a8369e7, and the PR has changed since (6caf914), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@tevan only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `a8369e7`, and the PR has changed since (`6caf914`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
tevan force-pushed fix/capture-spare-admission from 5499ba8adb
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 26s
beanstalk/approval can't be tested as asked: see the farm's comment
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to a8369e79a6
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-22 19:21:24 +00:00
Compare
tevan force-pushed fix/capture-spare-admission from a8369e79a6
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 6caf914c51
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-23 03:42:07 +00:00
Compare
Author
First-time contributor

Rebased again onto current main 0e32bc10, head 6caf914c, preserving the unchanged authored admission fix. Full Linux renderer and full Windows renderer cross-build/link/export checks pass; 82 changed-source checks pass; full strict suite has 936 passes and the same four failures reproduced on unchanged current main. The author owns marking this PR ready under the project guide; it will not remain WIP merely for Test Farm/other-hardware runtime coverage. The approved fresh on-PC A/B/A/B is in progress now, after which I will assess ready status. The supported main-versus-PR farm request remains unchanged; historical measurements stay under their original commit labels.

Rebased again onto current main 0e32bc10, head 6caf914c, preserving the unchanged authored admission fix. Full Linux renderer and full Windows renderer cross-build/link/export checks pass; 82 changed-source checks pass; full strict suite has 936 passes and the same four failures reproduced on unchanged current main. The author owns marking this PR ready under the project guide; it will not remain WIP merely for Test Farm/other-hardware runtime coverage. The approved fresh on-PC A/B/A/B is in progress now, after which I will assess ready status. The supported main-versus-PR farm request remains unchanged; historical measurements stay under their original commit labels.
Author
First-time contributor

Fresh approved current-head Hyrule Field A/B/A/B is complete: main 0e32bc10 versus PR 6caf914c, identical copied settings/private saves, 30 measured seconds per run after warmup. Median 116.6 versus 115.7 FPS (-0.8%, within observed spread), median frame time 8.57 ms both, p99 10.00 versus 10.34 ms, no measured frames of at least 50 ms. No FPS gain or long-session mitigation is claimed. Current production-function regression remains 16 versus 1 allocations under GCC and Clang. Full strict suite: 936 passed, four named failures reproduced on unchanged main, 18 explicit skips; all 82 changed-source checks, Linux and Windows renderer builds/exports and pre-commit pass. Description/checklists updated; remaining farm, mixed-area and long-session coverage stays explicit for review. Marking ready under the author-owned workflow; no merge requested.

Fresh approved current-head Hyrule Field A/B/A/B is complete: main 0e32bc10 versus PR 6caf914c, identical copied settings/private saves, 30 measured seconds per run after warmup. Median 116.6 versus 115.7 FPS (-0.8%, within observed spread), median frame time 8.57 ms both, p99 10.00 versus 10.34 ms, no measured frames of at least 50 ms. No FPS gain or long-session mitigation is claimed. Current production-function regression remains 16 versus 1 allocations under GCC and Clang. Full strict suite: 936 passed, four named failures reproduced on unchanged main, 18 explicit skips; all 82 changed-source checks, Linux and Windows renderer builds/exports and pre-commit pass. Description/checklists updated; remaining farm, mixed-area and long-session coverage stays explicit for review. Marking ready under the author-owned workflow; no merge requested.
tevan changed title from WIP: fix(vk): admit newly needed capture buffer sizes into a full spare pool to fix(vk): admit newly needed capture buffer sizes into a full spare pool 2026-11-23 03:50:14 +00:00
Member
@review
BeanBot left a comment

Recommendation: Approve. The test demonstrates that returned buffers can now enter a full spare pool, but the replacement policy’s effects during area changes and on other supported systems remain unmeasured. CI is also still running. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

Returned capture buffers can displace older spares, avoiding repeated allocations when the needed size mix changes. This may release a prewarmed buffer that a later area needs, trading the fixed allocation churn for a possible later allocation and memory cost.

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

  • L1 tests/test_capture_spare_admission.py:168: The fixture inherits RX_VK_CAP_MIN_MB from the caller, so its allocation-class assertions depend on the developer’s environment. (more on the line) Do: Run the fixture with RX_VK_CAP_MIN_MB removed from its environment, or explicitly set a controlled value.

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

  • L2 gpu/vk/vk_memory.cpp:1426: Measure replacement during mixed-area and long-session play, including its allocation and memory costs. (more on the line) Do: Compare current main and this head over repeated mixed-area and reported long-session workloads, recording allocation rates, load and frame times, and peak RAM and VRAM.
  • L3 gpu/vk/vk_memory.cpp:1426: Complete the requested Windows AMD, Windows NVIDIA and Steam Deck runtime comparisons. (more on the line) Do: Run the requested main-versus-PR area tours and synchronous-release smoke, comparing rendering, load and frame times and peak memory.

@fix can do L1.

Checks: Still running: 10 checks.

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

Does it help: Yes for the demonstrated admission bug: the production-function fixture reports 16 allocations on main and 1 on this branch for 16 requests. The current-head game comparison shows no FPS gain outside run-to-run spread; mitigation of the reported long-session slowdown remains unproven.

Other systems: The pool is shared by capture paths on Windows and Linux across GPU vendors. Replacement can change later allocation, release and memory behavior; current game evidence covers a short Linux RADV scene, while mixed-area, Windows and Steam Deck runs remain outstanding.

Switches: None added, changed or removed. Existing RX_VK_CAP_FREE_ASYNC defaults on; displaced buffers use its existing asynchronous or synchronous release path.

Reviewed: 6caf914c51 against 0e32bc100d: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both changed tests, the complete diff and commit messages. Read the changed function and surrounding capture allocation, reservation and release code in vk_memory.cpp; the rest of that large code file and architecture.md were skimmed. docs/review-checklist.md and the sibling Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The eviction array is bounded by the twelve-entry spare-pool limit, and displaced buffers are released after unlocking.
  • Worker byte and slot reservations are retained and speculative worker completions do not evict spares.
  • Both commits record AI assistance; no generated files, game-derived files or API changes appear in the diff.
  • The regression fixture exercises production get/free functions and is reported to fail on main for the allocation count.

Testing: No commands that build or run project code were executed. Author-reported Linux and Windows builds and test results were considered; the listed CI checks are still running.

Overlaps and merge order: The description identifies open #2244 as changing copy scheduling rather than spare admission; no dependency is claimed. Other open pull requests were not available for inspection.


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

**Recommendation: Approve.** The test demonstrates that returned buffers can now enter a full spare pool, but the replacement policy’s effects during area changes and on other supported systems remain unmeasured. CI is also still running. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. Returned capture buffers can displace older spares, avoiding repeated allocations when the needed size mix changes. This may release a prewarmed buffer that a later area needs, trading the fixed allocation churn for a possible later allocation and memory cost. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `tests/test_capture_spare_admission.py:168`: The fixture inherits RX_VK_CAP_MIN_MB from the caller, so its allocation-class assertions depend on the developer’s environment. (more on the line) **Do:** Run the fixture with RX_VK_CAP_MIN_MB removed from its environment, or explicitly set a controlled value. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L2** `gpu/vk/vk_memory.cpp:1426`: Measure replacement during mixed-area and long-session play, including its allocation and memory costs. (more on the line) **Do:** Compare current main and this head over repeated mixed-area and reported long-session workloads, recording allocation rates, load and frame times, and peak RAM and VRAM. - **L3** `gpu/vk/vk_memory.cpp:1426`: Complete the requested Windows AMD, Windows NVIDIA and Steam Deck runtime comparisons. (more on the line) **Do:** Run the requested main-versus-PR area tours and synchronous-release smoke, comparing rendering, load and frame times and peak memory. `@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:** Yes for the demonstrated admission bug: the production-function fixture reports 16 allocations on main and 1 on this branch for 16 requests. The current-head game comparison shows no FPS gain outside run-to-run spread; mitigation of the reported long-session slowdown remains unproven. **Other systems:** The pool is shared by capture paths on Windows and Linux across GPU vendors. Replacement can change later allocation, release and memory behavior; current game evidence covers a short Linux RADV scene, while mixed-area, Windows and Steam Deck runs remain outstanding. **Switches:** None added, changed or removed. Existing RX_VK_CAP_FREE_ASYNC defaults on; displaced buffers use its existing asynchronous or synchronous release path. **Reviewed:** 6caf914c5146 against 0e32bc100dbe: Read AGENTS.md, CONTRIBUTING.md, the pull request template, standards, both changed tests, the complete diff and commit messages. Read the changed function and surrounding capture allocation, reservation and release code in vk_memory.cpp; the rest of that large code file and architecture.md were skimmed. docs/review-checklist.md and the sibling Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The eviction array is bounded by the twelve-entry spare-pool limit, and displaced buffers are released after unlocking. - Worker byte and slot reservations are retained and speculative worker completions do not evict spares. - Both commits record AI assistance; no generated files, game-derived files or API changes appear in the diff. - The regression fixture exercises production get/free functions and is reported to fail on main for the allocation count. **Testing:** No commands that build or run project code were executed. Author-reported Linux and Windows builds and test results were considered; the listed CI checks are still running. **Overlaps and merge order:** The description identifies open #2244 as changing copy scheduling rather than spare admission; no dependency is claimed. Other open pull requests were not available for inspection. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -1416,0 +1423,4 @@
// speculative prewarming never displaces a buffer a real submission returned.
if (!from_worker && size <= (256ull << 20) && workers < 12 &&
pending <= limit && size <= limit - pending) {
while (!cap_free.empty() && (cap_free.size() + workers >= 12 ||
Member

L2 (should fix): Measure replacement during mixed-area and long-session play, including its allocation and memory costs.

When: A returned small capture can evict an older large prewarmed spare; a later load that needs that class must allocate it again. The short Hyrule Field comparison does not exercise the reported area transitions or measure peak memory.

Do: Compare current main and this head over repeated mixed-area and reported long-session workloads, recording allocation rates, load and frame times, and peak RAM and VRAM.

**L2** (should fix): Measure replacement during mixed-area and long-session play, including its allocation and memory costs. *When:* A returned small capture can evict an older large prewarmed spare; a later load that needs that class must allocate it again. The short Hyrule Field comparison does not exercise the reported area transitions or measure peak memory. **Do:** Compare current main and this head over repeated mixed-area and reported long-session workloads, recording allocation rates, load and frame times, and peak RAM and VRAM.
Member

L3 (should fix): Complete the requested Windows AMD, Windows NVIDIA and Steam Deck runtime comparisons.

When: The same replacement and release path runs on these systems, where allocation and destruction costs can differ from the tested Linux RADV device; no runtime results are yet recorded for them.

Do: Run the requested main-versus-PR area tours and synchronous-release smoke, comparing rendering, load and frame times and peak memory.

**L3** (should fix): Complete the requested Windows AMD, Windows NVIDIA and Steam Deck runtime comparisons. *When:* The same replacement and release path runs on these systems, where allocation and destruction costs can differ from the tested Linux RADV device; no runtime results are yet recorded for them. **Do:** Run the requested main-versus-PR area tours and synchronous-release smoke, comparing rendering, load and frame times and peak memory.
@ -0,0 +165,4 @@
"""
with tempfile.TemporaryDirectory() as folder:
path = Path(folder)
(path / "test.cpp").write_text(fixture)
Member

L1 (should fix): The fixture inherits RX_VK_CAP_MIN_MB from the caller, so its allocation-class assertions depend on the developer’s environment.

When: With RX_VK_CAP_MIN_MB=256, cap_buf_size chooses a 256 MiB minimum; the cold-large-buffer scenario can reuse its existing 256 MiB spare and fails the assertion that one new allocation occurred.

Do: Run the fixture with RX_VK_CAP_MIN_MB removed from its environment, or explicitly set a controlled value.

**L1** (should fix): The fixture inherits RX_VK_CAP_MIN_MB from the caller, so its allocation-class assertions depend on the developer’s environment. *When:* With RX_VK_CAP_MIN_MB=256, cap_buf_size chooses a 256 MiB minimum; the cold-large-buffer scenario can reuse its existing 256 MiB spare and fails the assertion that one new allocation occurred. **Do:** Run the fixture with RX_VK_CAP_MIN_MB removed from its environment, or explicitly set a controlled value.
Author
First-time contributor

L1 addressed in head ac517778 (test-first commit de6cc4c0): remove inherited RX_VK_CAP_MIN_MB only from the fixture executable environment, preserving other environment settings. Reproduced the original assertion failure at caller value 256; updated fixture passes GCC and Clang at caller values 2, 16 and 256, and still fails on main for 16 allocations rather than 1 with both compilers. All 82 strict changed-source checks and pre-commit pass. The test-only change is folded into the test commit to preserve test-then-fix history. Renderer/docs are byte-identical to reviewed and game-tested 6caf914c, so prior build/game results retain their actual revision labels and no extra game run was needed. L2 remains open: longer mixed-area/Lost Woods/Dodongo comparisons with allocation, load/frame and peak-memory measurements have not run; the short static scene cannot establish those results. L3 remains open for Windows AMD/NVIDIA and Steam Deck runtime coverage; refreshing the stale supported farm request for this head next. CI still requires repository approval. No merge-readiness boxes are ticked.

L1 addressed in head ac517778 (test-first commit de6cc4c0): remove inherited RX_VK_CAP_MIN_MB only from the fixture executable environment, preserving other environment settings. Reproduced the original assertion failure at caller value 256; updated fixture passes GCC and Clang at caller values 2, 16 and 256, and still fails on main for 16 allocations rather than 1 with both compilers. All 82 strict changed-source checks and pre-commit pass. The test-only change is folded into the test commit to preserve test-then-fix history. Renderer/docs are byte-identical to reviewed and game-tested 6caf914c, so prior build/game results retain their actual revision labels and no extra game run was needed. L2 remains open: longer mixed-area/Lost Woods/Dodongo comparisons with allocation, load/frame and peak-memory measurements have not run; the short static scene cannot establish those results. L3 remains open for Windows AMD/NVIDIA and Steam Deck runtime coverage; refreshing the stale supported farm request for this head next. CI still requires repository approval. No merge-readiness boxes are ticked.
tevan force-pushed fix/capture-spare-admission from 6caf914c51
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to ac5177783a
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Has been cancelled
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
2026-11-23 04:45:58 +00:00
Compare
Author
First-time contributor

@Beanstalk please renew the supported main-versus-PR compatibility request for current head ac517778. The prior approval request is stale after the test-only L1 correction; renderer code is unchanged from 6caf914c. This covers review L3; L2 long-session testing remains separate.

Compare the farm's current main and this PR on Windows AMD, Windows NVIDIA and Steam Deck. Use the revisions selected by the farm and record their commit IDs in the results. Build both sides, then run two interleaved area-change tours per side through Kokiri Forest, Hyrule Field, Market and Kakariko Village, with identical settings and save copies per device.

Compare still-scene pictures using the farm's normal image tolerance, crashes, median/p99 frame times, and load times. Flag a frame-time or load-time regression above 10%. Record peak RAM and VRAM for comparison. Add a short startup/area-change smoke with RX_VK_CAP_FREE_ASYNC=0 to check the synchronous-release configuration.

These are build, rendering and area-tour checks. The production-function regression, allocator/fault experiment and reservation/retention invariants are separate local/unit validations; the original long-session slowdown remains a separate validation gap. This request does not select historical commits, parse custom capture-budget log lines, require a particular cache-eviction event, or claim to prove the original hitches fixed.

A BigBeans maintainer may need to approve this replacement request for this head with 👍. Please generate a fresh plan rather than override the earlier rejected plan.

@Beanstalk please renew the supported main-versus-PR compatibility request for current head ac517778. The prior approval request is stale after the test-only L1 correction; renderer code is unchanged from 6caf914c. This covers review L3; L2 long-session testing remains separate. Compare the farm's current main and this PR on Windows AMD, Windows NVIDIA and Steam Deck. Use the revisions selected by the farm and record their commit IDs in the results. Build both sides, then run two interleaved area-change tours per side through Kokiri Forest, Hyrule Field, Market and Kakariko Village, with identical settings and save copies per device. Compare still-scene pictures using the farm's normal image tolerance, crashes, median/p99 frame times, and load times. Flag a frame-time or load-time regression above 10%. Record peak RAM and VRAM for comparison. Add a short startup/area-change smoke with RX_VK_CAP_FREE_ASYNC=0 to check the synchronous-release configuration. These are build, rendering and area-tour checks. The production-function regression, allocator/fault experiment and reservation/retention invariants are separate local/unit validations; the original long-session slowdown remains a separate validation gap. This request does not select historical commits, parse custom capture-budget log lines, require a particular cache-eviction event, or claim to prove the original hitches fixed. A BigBeans maintainer may need to approve this replacement request for this head with 👍. Please generate a fresh plan rather than override the earlier rejected plan.
Member

@tevan only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@tevan only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Author
First-time contributor

L2: I can run the mixed-area/long-session comparison locally on Linux/RADV. L3: I do not have Windows AMD/NVIDIA or Steam Deck systems available for runtime testing, so those comparisons need the Test Farm or another tester; the farm request is posted and awaiting maintainer approval.

L2: I can run the mixed-area/long-session comparison locally on Linux/RADV. L3: I do not have Windows AMD/NVIDIA or Steam Deck systems available for runtime testing, so those comparisons need the Test Farm or another tester; the farm request is posted and awaiting maintainer approval.
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Has been cancelled
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/capture-spare-admission:tevan-fix/capture-spare-admission'
git switch 'tevan-fix/capture-spare-admission'
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!2281
No description provided.