perf(vk): arrivals' captures: retired capture buffers destroyed on a thread of their own, and a late page's pool given its stamps at once #1848

Merged
HumanBean merged 2 commits from GummiNaomi/Longshot:perf/arrival-capture into main 2026-11-20 07:57:26 +00:00
Member

Summary

Arriving in an area, two parts of the capture of guest memory held up the render thread. On 16 cores the replay's take of a capture destroyed the capture buffers past the spares with the pools' lock held: takes of 25 to 49 ms were that loop alone. On 4 cores each late page in a 64 KB block that had no stamps yet made its capture wait for the GPU, again and again in the same few new pools: up to 211 ms of waiting an arrival. This destroys those buffers on a thread of their own (RX_VK_CAP_FREE_ASYNC) and gives a late page's pool its stamp blocks at once (RX_VK_LATE_STAMPS_AHEAD). In two teleport tours a side on my PC: on 16 cores the biggest memory-sync frame of an arrival 42.3 -> 13.9 ms at most and takes of 10 ms or more 70 -> 2; on 4 cores the late-page wait 32.9 -> 10.3 ms an arrival (211 -> 41 at most). Both on by default; =0 puts either back as it was.

Why: at each submit the game's thread copies the guest memory the GPU will read into a capture buffer, and the replay takes it (take_capture, gpu/vk/vk_memory.cpp). A buffer it lets go past the spares is destroyed there (cap_buf_free), with pools_mu held: freeing a 64 to 256 MB host-cached memory object is the driver unmapping and releasing every page of it. An arrival retires dozens (6,013 destroyed in a 4-minute tour). Separately, a capture page the GPU still writes back ("late") is fixed on the GPU by the late pages' fix (late_fix_build), which needs the 64 KB stamp block of the page; a page whose block isn't there yet makes the block and waits for the GPU, as before the fix (its log's "no stamps or shadow yet", the only reason in every 4-core arrival). Arriving, the game writes 100 to 190 pages a capture of a new 4 to 8 MB pool the GPU also writes, each capture's late pages in other blocks, so the waits came one block at a time (6 to 20 an arrival, 20 to 250 ms each). On 16 cores with the frame overlap on, the takes' late pages are left to their first use, so these waits don't show there.

What changes: RX_VK_CAP_FREE_ASYNC: cap_buf_free hands a buffer past the spares to destroy_buffer_later, a queue and one thread that destroys them; only buffers the GPU is done with get there, a spare is never destroyed, and at the process's exit (cap_shutting_down) what is queued is left. RX_VK_LATE_STAMPS_AHEAD: where late_fix_build makes a late page's missing block, stamp_blocks_around also makes the blocks of the rest of its pool (all of a pool of 16 MB or less, else the 2 MB around the page), through stamp_block_make, so within the 64 MB stamp budget as any block; that capture still waits, the next ones' late pages there are fixed. Unchanged: the spares, which pages are late, the fix's rules, the frame overlap's.

Read first: destroy_buffer_later and stamp_blocks_around in gpu/vk/vk_memory.cpp, then tests/test_cap_free_async.py and tests/test_late_stamps_ahead.py.

Testing

Tested: Windows 11, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off: two teleport tours from the kokiri-start save a side, both switches off against on, on 16 cores and on 4 cores (14 arrivals a tour: Castle Town's market, Hyrule Field, Kakariko, Kokiri Forest, the Lost Woods, Zora's River, round again), and one 16-core tour with HOS_NVN_FRAME_OVERLAP=2 (the overlap's guard) and both on, on a build of main @ f505340b with #1810-#1813's changes and this one; the arrivals' pictures alike both ways (no white frames); the late pages' fix counted the same both ways (about 21,000 fixed, 0 CPU reads waited); the guard: 0 reads changed.
Checks: tests/test_cap_free_async.py (every buffer destroyed once, in order, on one other thread; none at the exit) and tests/test_late_stamps_ahead.py (the blocks a pool gets: small, big, unaligned, smaller than a block) pass on this head on Windows (clang) and Linux (g++ 13.3, WSL Ubuntu 24.04, -Wall -Wextra -Werror); tests/test_capture_spare_reuse.py passes with its two new stand-ins.
Suite: tests/run_all.py with every check on main @ 068fb8eb in WSL Ubuntu 24.04 (740 pass, 61 fail, 69 skipped: no clang or spirv-val there), then this head's --changed checks in WSL (85 pass, 11 fail, 1 skipped) and on Windows (92 run, 16 fail). Every failure also fails on main @ 068fb8eb on the same OS: in WSL and on Windows test_capture_read_once, test_crash_dialog, test_dev_ab, test_frame_overlap, test_guest_imported, test_linux_pressure, test_pending_guest_import, test_present_queue_default, test_replay_write_order, test_texel_buffer_ownership, test_vk_occlusion_queries; on Windows only test_driver_env_choose, test_mesh_fallback_layout, test_tracy_funcs, test_udmabuf_limit_unreadable, test_vertex_bind. (On Windows the changed checks ran on the head before its last two fixes: stamp_blocks_around written in uint64_t alone, which g++ needs on Linux, and tests/test_late_fix_build.py run with RX_VK_LATE_STAMPS_AHEAD=0; the five checks that read that code were run again on this head and passed, as in WSL.) (On Windows most of them are compile errors with this PC's compiler wrapper, on main as here.) These ran on the head as it was on main @ 068fb8eb. It has since been rebased onto main @ 1780fbe0; there its own checks pass on Windows and in WSL, and every one of its --changed failures in WSL (79 pass, 15 fail) also fails on that main.

Still to test:

  • This PC, Windows, RTX 4070 SUPER: a third and fourth tour a side on 4 and 16 cores, interleaved with the first two, expecting the late-page wait an arrival under 15 ms on 4 cores and no take of 10 ms or more on 16 (by hand)
  • A Steam Deck, or a PC of 4 to 6 cores: the same tour twice a side, expecting fewer "no stamps or shadow yet" in the log's late pages' fix lines unset than with RX_VK_LATE_STAMPS_AHEAD=0, and its stamps for lines under 65536 KB (by hand)
  • A card of 6 GB or less, where the spares are capped at 32 MB and more buffers are destroyed: a tour a side, expecting no take of 10 ms or more unset and some with RX_VK_CAP_FREE_ASYNC=0 (by hand)

Measurements

Verdict: smoother arrivals in the capture's own columns on both core counts; whole arrival time within the spread. 16 cores: memory sync 167 -> 141 ms an arrival, its biggest frame 42.3 -> 13.9 ms at most, takes of 10 ms or more 70 -> 2, the retire's time 2,267 -> 98 ms a tour. 4 cores: the late-page wait 32.9 -> 10.3 ms an arrival on average and 211 -> 41 ms at most, memory sync 214 -> 186 ms an arrival, the worst arrival frame's median 113 -> 97 ms. No change in RAM; the stamp blocks reached 36 MB of VRAM (of 64).

Setup: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off, 32 GB; teleport tours from kokiri-start, each arrival's first 3 s, teleports only; 2560x1440, no window (HOS_HEADLESS=1), uncapped; 16 cores, and 4 cores (affinity 0xF00); RX_VK_LATE_FIX=1 RX_VK_TEX_MOVE=1 RX_VK_TEX_AHEAD=2 (and HOS_NVN_FRAME_OVERLAP=1 on 16 cores) and a temporary diagnostic log of the captures, the same in both arms; RX_VK_FRAME_TRACE=1 for memory sync, the late wait and the arrival frames.

Baseline: one build of main @ f505340b (before the tooling revamp 068fb8eb, which changes none of this code) with #1810-#1813's changes and this one, the two switches off (main's behaviour; that build's default) against =1 (this PR's default); one tour with them off per core count was the same build less this change. "Excess" is an arrival's time above the steady frame time; on 16 cores without the frames of 900 ms or more, which came in both arms (run to run, not the capture).

Before: both off (as main) @ f505340b After: both on (this PR) @ f505340b
16 cores (30 / 28 arrivals): memory sync an arrival 167 ms 141 ms
16 cores: biggest memory-sync frame of an arrival, median / max 8.2 / 42.3 ms 4.8 / 13.9 ms
16 cores: takes of 10 ms or more (longest) 70 (49 ms) 2 (12 ms)
16 cores: capture buffers destroyed in the take, time a tour 2,267 ms 98 ms
16 cores: excess an arrival, median / worst frame median 394 / 113 ms 349 / 115 ms
4 cores (30 / 27 arrivals): late-page waits (time, longest) 104 (1,029 ms, 197 ms) 45 (413 ms, 33 ms)
4 cores: late-page wait an arrival, mean / max 32.9 / 211 ms 10.3 / 41 ms
4 cores: memory sync an arrival 214 ms 186 ms
4 cores: biggest memory-sync frame, max 197.8 ms 35.5 ms
4 cores: takes of 10 ms or more 45 21
4 cores: excess an arrival, median / worst frame median 380 / 113 ms 331 / 97 ms
peak working set (16 / 4 cores) 13.4-15.8 / 13.0-15.5 GB 14.5-15.5 / 15.1 GB

RX_VK_CAP_FREE_ASYNC and RX_VK_LATE_STAMPS_AHEAD (new, kill switches) ship on, chosen by the table above: better in every capture row on both core counts, and the whole arrivals within the spread, not worse; =0 puts each back as on main.

Risks

What could break: the stamp blocks made ahead count toward the 64 MB stamp budget (kStampMax); once it is full, a late page in a pool with no block yet gets none, and its captures wait for the GPU every time, as before the fix. The tours reached 36 MB; an area with more GPU-written pools could fill it sooner (RX_VK_LATE_STAMPS_AHEAD=0 then makes only the late pages' own blocks, as before). A buffer destroyed on its own thread frees its memory a moment later than before. The 16-core frames of about 1 s came in both arms, so they are not this change. Turning it off: RX_VK_CAP_FREE_ASYNC=0, RX_VK_LATE_STAMPS_AHEAD=0. After updating, a player sees shorter hitches as an area loads in; nothing changes for saves, longshot_options.ini or the caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure. (Two tours a side, on a build of main @ f505340b with four open PRs' changes, as Baseline says; more tours are Still to test's first item.)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (gpu/vk/vk_memory.cpp was built on Windows for the measured build, not yet on this head or on Linux; the tests compile the new code with clang on Windows and g++ 13.3 on WSL Ubuntu 24.04. On this head the changed files pass a syntax-only compile with the builder's own Windows flags.)
  • 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.

🤖 Generated with Claude Code

## Summary Arriving in an area, two parts of the capture of guest memory held up the render thread. On 16 cores the replay's take of a capture destroyed the capture buffers past the spares with the pools' lock held: takes of 25 to 49 ms were that loop alone. On 4 cores each late page in a 64 KB block that had no stamps yet made its capture wait for the GPU, again and again in the same few new pools: up to 211 ms of waiting an arrival. This destroys those buffers on a thread of their own (`RX_VK_CAP_FREE_ASYNC`) and gives a late page's pool its stamp blocks at once (`RX_VK_LATE_STAMPS_AHEAD`). In two teleport tours a side on my PC: on 16 cores the biggest memory-sync frame of an arrival 42.3 -> 13.9 ms at most and takes of 10 ms or more 70 -> 2; on 4 cores the late-page wait 32.9 -> 10.3 ms an arrival (211 -> 41 at most). Both on by default; `=0` puts either back as it was. Why: at each submit the game's thread copies the guest memory the GPU will read into a capture buffer, and the replay takes it (`take_capture`, `gpu/vk/vk_memory.cpp`). A buffer it lets go past the spares is destroyed there (`cap_buf_free`), with `pools_mu` held: freeing a 64 to 256 MB host-cached memory object is the driver unmapping and releasing every page of it. An arrival retires dozens (6,013 destroyed in a 4-minute tour). Separately, a capture page the GPU still writes back ("late") is fixed on the GPU by the late pages' fix (`late_fix_build`), which needs the 64 KB stamp block of the page; a page whose block isn't there yet makes the block and waits for the GPU, as before the fix (its log's "no stamps or shadow yet", the only reason in every 4-core arrival). Arriving, the game writes 100 to 190 pages a capture of a new 4 to 8 MB pool the GPU also writes, each capture's late pages in other blocks, so the waits came one block at a time (6 to 20 an arrival, 20 to 250 ms each). On 16 cores with the frame overlap on, the takes' late pages are left to their first use, so these waits don't show there. What changes: `RX_VK_CAP_FREE_ASYNC`: `cap_buf_free` hands a buffer past the spares to `destroy_buffer_later`, a queue and one thread that destroys them; only buffers the GPU is done with get there, a spare is never destroyed, and at the process's exit (`cap_shutting_down`) what is queued is left. `RX_VK_LATE_STAMPS_AHEAD`: where `late_fix_build` makes a late page's missing block, `stamp_blocks_around` also makes the blocks of the rest of its pool (all of a pool of 16 MB or less, else the 2 MB around the page), through `stamp_block_make`, so within the 64 MB stamp budget as any block; that capture still waits, the next ones' late pages there are fixed. Unchanged: the spares, which pages are late, the fix's rules, the frame overlap's. Read first: `destroy_buffer_later` and `stamp_blocks_around` in `gpu/vk/vk_memory.cpp`, then `tests/test_cap_free_async.py` and `tests/test_late_stamps_ahead.py`. ## Testing **Tested:** Windows 11, RTX 4070 SUPER (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off: two teleport tours from the `kokiri-start` save a side, both switches off against on, on 16 cores and on 4 cores (14 arrivals a tour: Castle Town's market, Hyrule Field, Kakariko, Kokiri Forest, the Lost Woods, Zora's River, round again), and one 16-core tour with `HOS_NVN_FRAME_OVERLAP=2` (the overlap's guard) and both on, on a build of main @ f505340b with #1810-#1813's changes and this one; the arrivals' pictures alike both ways (no white frames); the late pages' fix counted the same both ways (about 21,000 fixed, 0 CPU reads waited); the guard: 0 reads changed. Checks: `tests/test_cap_free_async.py` (every buffer destroyed once, in order, on one other thread; none at the exit) and `tests/test_late_stamps_ahead.py` (the blocks a pool gets: small, big, unaligned, smaller than a block) pass on this head on Windows (clang) and Linux (g++ 13.3, WSL Ubuntu 24.04, `-Wall -Wextra -Werror`); `tests/test_capture_spare_reuse.py` passes with its two new stand-ins. Suite: `tests/run_all.py` with every check on main @ 068fb8eb in WSL Ubuntu 24.04 (740 pass, 61 fail, 69 skipped: no clang or spirv-val there), then this head's `--changed` checks in WSL (85 pass, 11 fail, 1 skipped) and on Windows (92 run, 16 fail). Every failure also fails on main @ 068fb8eb on the same OS: in WSL and on Windows `test_capture_read_once`, `test_crash_dialog`, `test_dev_ab`, `test_frame_overlap`, `test_guest_imported`, `test_linux_pressure`, `test_pending_guest_import`, `test_present_queue_default`, `test_replay_write_order`, `test_texel_buffer_ownership`, `test_vk_occlusion_queries`; on Windows only `test_driver_env_choose`, `test_mesh_fallback_layout`, `test_tracy_funcs`, `test_udmabuf_limit_unreadable`, `test_vertex_bind`. (On Windows the changed checks ran on the head before its last two fixes: `stamp_blocks_around` written in `uint64_t` alone, which g++ needs on Linux, and `tests/test_late_fix_build.py` run with `RX_VK_LATE_STAMPS_AHEAD=0`; the five checks that read that code were run again on this head and passed, as in WSL.) (On Windows most of them are compile errors with this PC's compiler wrapper, on main as here.) These ran on the head as it was on main @ 068fb8eb. It has since been rebased onto main @ 1780fbe0; there its own checks pass on Windows and in WSL, and every one of its `--changed` failures in WSL (79 pass, 15 fail) also fails on that main. **Still to test:** - This PC, Windows, RTX 4070 SUPER: a third and fourth tour a side on 4 and 16 cores, interleaved with the first two, expecting the late-page wait an arrival under 15 ms on 4 cores and no take of 10 ms or more on 16 (by hand) - A Steam Deck, or a PC of 4 to 6 cores: the same tour twice a side, expecting fewer "no stamps or shadow yet" in the log's late pages' fix lines unset than with `RX_VK_LATE_STAMPS_AHEAD=0`, and its `stamps for` lines under 65536 KB (by hand) - A card of 6 GB or less, where the spares are capped at 32 MB and more buffers are destroyed: a tour a side, expecting no take of 10 ms or more unset and some with `RX_VK_CAP_FREE_ASYNC=0` (by hand) ## Measurements **Verdict:** smoother arrivals in the capture's own columns on both core counts; whole arrival time within the spread. 16 cores: memory sync 167 -> 141 ms an arrival, its biggest frame 42.3 -> 13.9 ms at most, takes of 10 ms or more 70 -> 2, the retire's time 2,267 -> 98 ms a tour. 4 cores: the late-page wait 32.9 -> 10.3 ms an arrival on average and 211 -> 41 ms at most, memory sync 214 -> 186 ms an arrival, the worst arrival frame's median 113 -> 97 ms. No change in RAM; the stamp blocks reached 36 MB of VRAM (of 64). Setup: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D with SMT off, 32 GB; teleport tours from `kokiri-start`, each arrival's first 3 s, teleports only; 2560x1440, no window (`HOS_HEADLESS=1`), uncapped; 16 cores, and 4 cores (affinity 0xF00); `RX_VK_LATE_FIX=1 RX_VK_TEX_MOVE=1 RX_VK_TEX_AHEAD=2` (and `HOS_NVN_FRAME_OVERLAP=1` on 16 cores) and a temporary diagnostic log of the captures, the same in both arms; `RX_VK_FRAME_TRACE=1` for memory sync, the late wait and the arrival frames. Baseline: one build of main @ f505340b (before the tooling revamp 068fb8eb, which changes none of this code) with #1810-#1813's changes and this one, the two switches off (main's behaviour; that build's default) against `=1` (this PR's default); one tour with them off per core count was the same build less this change. "Excess" is an arrival's time above the steady frame time; on 16 cores without the frames of 900 ms or more, which came in both arms (run to run, not the capture). | | Before: both off (as main) @ f505340b | After: both on (this PR) @ f505340b | |---|---|---| | 16 cores (30 / 28 arrivals): memory sync an arrival | 167 ms | 141 ms | | 16 cores: biggest memory-sync frame of an arrival, median / max | 8.2 / 42.3 ms | 4.8 / 13.9 ms | | 16 cores: takes of 10 ms or more (longest) | 70 (49 ms) | 2 (12 ms) | | 16 cores: capture buffers destroyed in the take, time a tour | 2,267 ms | 98 ms | | 16 cores: excess an arrival, median / worst frame median | 394 / 113 ms | 349 / 115 ms | | 4 cores (30 / 27 arrivals): late-page waits (time, longest) | 104 (1,029 ms, 197 ms) | 45 (413 ms, 33 ms) | | 4 cores: late-page wait an arrival, mean / max | 32.9 / 211 ms | 10.3 / 41 ms | | 4 cores: memory sync an arrival | 214 ms | 186 ms | | 4 cores: biggest memory-sync frame, max | 197.8 ms | 35.5 ms | | 4 cores: takes of 10 ms or more | 45 | 21 | | 4 cores: excess an arrival, median / worst frame median | 380 / 113 ms | 331 / 97 ms | | peak working set (16 / 4 cores) | 13.4-15.8 / 13.0-15.5 GB | 14.5-15.5 / 15.1 GB | `RX_VK_CAP_FREE_ASYNC` and `RX_VK_LATE_STAMPS_AHEAD` (new, kill switches) ship on, chosen by the table above: better in every capture row on both core counts, and the whole arrivals within the spread, not worse; `=0` puts each back as on main. ## Risks What could break: the stamp blocks made ahead count toward the 64 MB stamp budget (`kStampMax`); once it is full, a late page in a pool with no block yet gets none, and its captures wait for the GPU every time, as before the fix. The tours reached 36 MB; an area with more GPU-written pools could fill it sooner (`RX_VK_LATE_STAMPS_AHEAD=0` then makes only the late pages' own blocks, as before). A buffer destroyed on its own thread frees its memory a moment later than before. The 16-core frames of about 1 s came in both arms, so they are not this change. Turning it off: `RX_VK_CAP_FREE_ASYNC=0`, `RX_VK_LATE_STAMPS_AHEAD=0`. After updating, a player sees shorter hitches as an area loads in; nothing changes for saves, `longshot_options.ini` or the caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `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. (Two tours a side, on a build of main @ f505340b with four open PRs' changes, as Baseline says; more tours are Still to test's first item.) - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (`gpu/vk/vk_memory.cpp` was built on Windows for the measured build, not yet on this head or on Linux; the tests compile the new code with clang on Windows and g++ 13.3 on WSL Ubuntu 24.04. On this head the changed files pass a syntax-only compile with the builder's own Windows flags.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
perf(vk): arrivals' captures: retired capture buffers destroyed on a thread of their own, and a late page's pool given its stamps at once
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 21s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 23s
Third-party parts / As their notes say (pull_request) Successful in 19s
CI / Website build and checks (pull_request) Has been cancelled
50e2098f0f
At an area change the replay's take of a capture holds pools_mu while it destroys the capture buffers past the spares
(on 16 cores, takes of 25-49 ms were that loop alone), and on 4 cores each late page in a 64 KB block with no stamps yet
made its capture wait for the GPU: 6-20 waits an arrival in the same few new pools, up to 211 ms.

- RX_VK_CAP_FREE_ASYNC (on; =0 as before): cap_buf_free hands a buffer past the spares to a thread of its own
  (destroy_buffer_later) instead of destroying it on the replay's thread; at the process's exit what is still queued is
  left.
- RX_VK_LATE_STAMPS_AHEAD (on; =0 as before): where late_fix_build makes a late page's missing stamp block, it also makes
  the blocks of the rest of its pool (all of a pool of 16 MB or less, else the 2 MB around the page), within the 64 MB
  stamp budget; that capture still waits, the next ones' late pages there are fixed.

Both ship on, as two teleport tours a side on 16 and 4 cores chose them. tests/test_cap_free_async.py and
tests/test_late_stamps_ahead.py run the new code as it is in the source; tests/test_capture_spare_reuse.py's fixture gets
the two names cap_buf_free now calls, and tests/test_late_fix_build.py runs its cases with RX_VK_LATE_STAMPS_AHEAD=0
(they count a late page's own stamp block).

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #1599 WIP: perf(vk): retain and refill capture buffers by size class — Open capture-buffer retention/refill changes share the spare-buffer lifecycle and may overlap.
  • PR #1667 WIP: perf(vk): RX_VK_CAPTURE_SLOW_MS= logs a slow capture's parts (probe, off by default) — Open capture-path diagnostics cover the same capture buffering and late-page wait behavior.
Possibly related, for context: - PR #1599 WIP: perf(vk): retain and refill capture buffers by size class — Open capture-buffer retention/refill changes share the spare-buffer lifecycle and may overlap. - PR #1667 WIP: perf(vk): RX_VK_CAPTURE_SLOW_MS=<ms> logs a slow capture's parts (probe, off by default) — Open capture-path diagnostics cover the same capture buffering and late-page wait behavior.
HumanBean added this to the WIP project 2026-11-20 06:42:08 +00:00
GummiNaomi force-pushed perf/arrival-capture from 50e2098f0f
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 17s
PR description / Description follows the template (pull_request_target) Successful in 21s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 23s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 23s
Third-party parts / As their notes say (pull_request) Successful in 19s
CI / Website build and checks (pull_request) Has been cancelled
to bb1a1b1384
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 8s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 22s
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Website build and checks (pull_request) Has been cancelled
2026-11-20 07:46:18 +00:00
Compare
Merge branch 'main' into perf/arrival-capture
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Failing after 14s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 17s
Third-party parts / As their notes say (pull_request) Successful in 21s
CI / Website build and checks (pull_request) Failing after 2m18s
000cce37e7
HumanBean changed title from WIP: perf(vk): arrivals' captures: retired capture buffers destroyed on a thread of their own, and a late page's pool given its stamps at once to perf(vk): arrivals' captures: retired capture buffers destroyed on a thread of their own, and a late page's pool given its stamps at once 2026-11-20 07:57:13 +00:00
HumanBean deleted branch perf/arrival-capture 2026-11-20 07:57:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!1848
No description provided.