perf(vk): a freed sparse mirror's buffer is kept for the next mirror of its size, not destroyed (RX_VK_SPARSE_SPARE_MB) #1359

Open
GummiNaomi wants to merge 2 commits from GummiNaomi/Longshot:perf/sparse-mirror-buffers into main
Member

Type: perf · Risk: medium · Tested on: Windows 11, RTX 4070 SUPER (NVIDIA 617.42); the Test Farm: Windows, RX 9070 XT; Linux, RTX 4070 and RTX 3080 Ti · Needs: a person's eyes on a long session; an Intel card; RADV; a Steam Deck; a card of 8 GB or less

Why

Walking from Castle Town into Hyrule Field and back stutters, and part of it is in no column of the frame trace: three frames of 65 to 70 ms in one run had "nothing over 1 ms" in their row.

A profile of that walk (HOS_PROFILE=1) shows where they are. In each of them the render thread sits in the driver under memory_begin_submission, at the call sparse_reap makes to destroy_sparse_buffer: vkDestroyBuffer of a sparse VRAM mirror's buffer. With timing lines around the two calls (not in this PR), one run of that walk (95 s, two area changes):

  • 351-421 sparse buffers created, 455-504 ms in the driver, about 0.06 ms a MB of the buffer's size, single ones up to 29 ms;
  • 293-350 destroyed, 390-427 ms, about 0.07 ms a MB;
  • the destructions come 41 to 56 at a time, at the start of one submission, when the GPU is past a batch of freed mirrors: 52 to 64 ms each time.

Such a buffer holds address space and no memory (its blocks are bound one by one), and the sizes come again: 174 of 405 were of 4 MB, 61 of 8 MB. The game lets go of its pools and makes them again at an area change, and each time the mirror's buffer was destroyed and a new one of the same size created.

Related: #792 (the images' destruction on a thread of its own: the same driver cost for images; this is the mirrors' buffers, which that PR does not reach).

What changed

A freed sparse mirror's buffer is kept for the next mirror of its size instead of being destroyed.

  • vk: gpu/vk/sparse_spare.h (new) is the list of spare buffers: a mirror takes the spare created with exactly its size, the one kept last; over the cap the oldest go.
  • vk (gpu/vk/vk_memory.cpp):
    • sparse_reap: a freed mirror's buffer, once the GPU is past it and its binds (the same wait as before), has what is bound to it unbound, every such buffer's blocks in one vkQueueBindSparse, and goes to the spares. Its blocks' memory is freed once that unbind is done on the GPU, as a released block's already is. If the bind fails, the buffers are destroyed and their memory freed, as before.
    • mirror_free notes what is bound to the buffer (its blocks, and released blocks still bound) before it empties the lists.
    • mirror_make takes a spare before it creates a buffer (sparse_buffer_for), and a buffer it gives up without binding anything goes back to the spares (sparse_buffer_unused).
    • A spare that has to go (over the cap, or a failed fill) is destroyed only once the binds' timeline has reached its unbinding (spare_doomed), never at once.
    • The cap is 4096 MB of address space, and never more than a quarter of the device's sparseAddressSpaceSize. A spare holds no memory.
  • switch: RX_VK_SPARSE_SPARE_MB=<MB>; 0 keeps none and destroys every buffer at once, as before. The log says vk: sparse mirrors' buffers are kept for the next mirror of their size at the first one, and every 1200 submissions vk: sparse mirrors' buffers: N taken from the spares, N made new; N kept as spares, N destroyed.
  • tests: tests/test_sparse_spare.py (new) compiles and runs the list (what a size takes, the cap, which spares go for a new one, what is never kept) and reads vk_memory.cpp for the rules above (no buffer destroyed before its unbinding is done, the memory freed only after it, mirror_make never past the spares). tests/test_sparse_mirror.py follows one moved line.
  • docs: the switch's row in docs/development.md and in gpu/vk/switches.def; six files under docs/tested/.

Measurements

Verdict: on the walk out of Castle Town and back, the time spent in frames of 50 ms or more falls from 2.0 s to 1.55 s a run (1,868, 2,111 and 2,005 ms against 1,551, 1,479 and 1,696 ms: no overlap), and the frames of 100 ms or more from 4-7 to 3-5. The driver's time in these buffers falls from about 910 ms to 245 ms a run, and the 52-64 ms batches of destructions are gone. The binds cost about 50 ms more a run.

Hardware: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D (16 cores, SMT off), 32 GB
Scene: save set "First Step into Hyrule Town": out through the south gate into Hyrule Field and in again, two area changes (a scripted route on the wall clock, 95 s), 2560x1440, DLAA, frame generation off, uncapped
Method: headless runs, one build, the two sides in turn, three runs each; the frame trace (RX_VK_FRAME_TRACE=1, both sides) from 3 s after the save's load-in on (the load-in is the first frame of 300 ms or more; it came between 28.8 and 31.5 s of frame time in these runs); the binds from the log's vk: sparse mirrors: line
Baseline: main's behaviour is this PR with RX_VK_SPARSE_SPARE_MB=0 (every buffer destroyed at once in sparse_reap, as main does); both sides are one build, main 8e9cfc3a with this change. The branch was then moved onto main 6d72ca93 (the switch table's row added), built and run once more there, one pair: 2,022 ms against 1,449 ms in frames of 50 ms or more, 7 against 4 frames of 100 ms or more. It was moved once more onto main 544229a2 and committed (3f72adcc), built (with the link fix for the MSVC target in the working tree, a pull request of its own) and run once more, one pair: 1,759 ms against 1,707 ms, 7 against 4 frames of 100 ms or more, 266 buffers taken from the spares and 116 made new, none destroyed
How to reproduce: RX_VK_SPARSE_SPARE_MB=0 against no switch, on the route above; HOS_PROFILE=1 and scripts/profile_report.py for the stutters' stacks

Before, RX_VK_SPARSE_SPARE_MB=0: this PR @ 3f72adcc (three runs) After: this PR @ 3f72adcc (three runs)
Time in frames of 50 ms or more 1,868, 2,111, 2,005 ms 1,551, 1,479, 1,696 ms
median 2,005 ms 1,551 ms
Frames of 100 ms or more 4, 6, 7 4, 5, 3
Frames of 50 ms or more 22, 23, 24 19, 18, 21
Frames of 25 ms or more 52, 50, 53 49, 61, 50
The worst frame 204, 199, 156 ms 198, 160, 184 ms
The load-in's own long frames (the 3 s before the rows above begin) 1,954, 1,866, 1,852 ms 1,884, 1,813, 1,885 ms
The sparse mirrors' binds 706 (129 ms), 691 (120 ms), 764 (126 ms) 836 (178 ms), 771 (164 ms), 755 (185 ms)
Buffers taken from the spares / made new none / all 275 / 129, 225 / 113, 234 / 130
Buffers destroyed all 0, 0, 0
Spares at the end of the run none 61 (1,060 MB), 46 (1,296 MB), 68 (1,668 MB of address space)

The worst frame of a run is the load into the field, which has much else in it (uploads, programs, the game's own loading); it does not move, and neither does the save's load-in.

Corrected on 17 Nov. The first version of these numbers counted from a fixed 32 s of frame time, as "past the load-in". The load-in does not come at a fixed time: in the first "before" run it came at 31.1 s, and 615 ms of its long frames were counted (2,483 ms then, 1,868 ms now, and 6 frames of 100 ms or more then, 4 now); the same in the "before" runs of the two single pairs on the later bases (3,244 and 2,363 ms then, 2,022 and 1,759 ms now). The other runs are as they were. The gain is about 0.45 s a run, not the 0.56 s first given; docs/tested/ has the corrected rows (the second commit). Over all nine pairs of this change measured so far (these three, the three with timing lines below, three single ones): 1,759 to 2,215 ms before, 1,264 to 1,707 ms after.

A longer session through several areas, one tour a side: the repository's kokiri-start save, then the control bridge's debug teleport round the Market, Hyrule Field, Kakariko, Kokiri Forest, the Lost Woods and Zora's River, 20 s in each, 72 teleports in 20 minutes (scripts/longshot_ctl.py, its test profile: 1920x1080, headless, uncapped). Counted from 600 frames after the save's arrival to the end. One pair, so a direction: about a tenth less time in long frames; most of an area change's long frames are its textures (115,000 uploads a tour), which this does not touch.

Before, RX_VK_SPARSE_SPARE_MB=0: this PR @ 3f72adcc (one tour) After: this PR @ 3f72adcc (one tour)
Long frames (50 ms or more) in the tour 395, 36.4 s 355, 32.8 s
Very long frames (100 ms or more) in the tour 121, 17.4 s 111, 15.6 s
The tour's worst frame 329 ms 320 ms
Mirror buffers taken from the spares / made new / destroyed none / all / all 2,512 / 190 / 63
The most spares held at once none 129, at the cap of 4,096 MB of address space
The tour's sparse binds 17,664 (2.39 s) 18,473 (2.91 s)
Errors, device loss none none

The driver's time in the two calls, from three earlier pairs of the same change with timing lines around vkCreateBuffer and vkDestroyBuffer (the lines are not in this PR; both sides had them):

Before, RX_VK_SPARSE_SPARE_MB=0: this PR @ 3f72adcc with timing lines (three runs) After: this PR @ 3f72adcc with timing lines (three runs)
Sparse buffers created 351 (455 ms), 421 (487 ms), 373 (504 ms) 119 (243 ms), 128 (248 ms), 124 (245 ms)
Sparse buffers destroyed 293 (390 ms), 350 (427 ms), 303 (411 ms) 0, 0, 0
The largest batch of destructions in one submission 64, 64, 62 ms none
Time in frames of 50 ms or more 1,821, 2,215, 1,944 ms 1,534, 1,493, 1,587 ms

Picture checks, both sides:

Before, RX_VK_SPARSE_SPARE_MB=0: this PR @ 3f72adcc with timing lines After: this PR @ 3f72adcc with timing lines
Frames with 1 % or more of a 320x180 shot flipping for one frame, through the gate at night and back and forth on the drawbridge (13,000-15,800 frames a run, a shot every present) 25 and 14; the worst 1.6 and 2.4 % of the picture 20 and 36; the worst 2.9 and 1.7 %
The last shot of each run of the route above, by eye the town from the gate, as it should be the same

The flip count varies this much by itself on this route (13 to 72 a run on either side of earlier changes); no frame flashed.

vk: sparse mirrors' buffers are kept for the next mirror of their size, up to 4096 MB of address space (RX_VK_SPARSE_SPARE_MB=0: destroyed at once, as before)
vk: sparse mirrors' buffers: 275 taken from the spares, 129 made new; 336 kept as spares, 0 destroyed; 61 spares now, 1060 MB of address space (RX_VK_SPARSE_SPARE_MB=4096)

Flags and settings

One new switch, on by default.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_SPARSE_SPARE_MB the address space the spare sparse mirror buffers may hold together, in MB (none: every freed buffer destroyed at once) 4096; 0: none kept, as before at an area change, about 0.65 s less of the render thread in the driver and no 52-64 ms batch of destructions helps on the RTX 4070 SUPER on Windows; untested on AMD, Intel, Linux, the Deck (where sparse mirrors are on) 4096

Testing

Tested: Windows 11, RTX 4070 SUPER, NVIDIA 617.42: the runs above (four pairs of the route with the timing lines, three without, one more on each of the two later bases, two rounds of the gate's flicker test), no error or device loss in any log. tests/test_sparse_spare.py and tests/test_sparse_mirror.py pass at 3f72adcc. The full run below was not repeated after the last move (main 6d72ca93 to 544229a2, one pull request that touches gpu/vk/vk_main.cpp and its test). python -I -B tests/run_all.py with clang on this PC, on main 6d72ca93 with this change: 393 passed, 107 failed, 221 skipped; main 6d72ca93 here: 393 passed, 106 failed, 221 skipped (this PC's toolchain: no gcc, Windows line endings, fixtures needing tools not installed). The one more is tests/test_longshot_ctl.py, which failed under the full run's load and passes alone, twice, with this change and on main; the other 106 are main's. One of those is tests/test_switch_table.py, over another switch (RX_VK_PGO_FILE has a row and nothing reads it); with this PR's row taken out it names RX_VK_SPARSE_SPARE_MB too, so the row is read.

A 20-minute tour of six areas a side (72 teleports each, the table above): no error or device loss on either side, every teleport arrived (three of the 144 were still loading 20 s after they were sent, in Kakariko, and went on), and with the default the spares' list stayed at its cap or under it, its oldest buffers destroyed as the cap asks (63 in the tour). Headless: nobody looked at the picture of the tour.

The Test Farm, this PR @ 3f72adc against main @ 544229a, a teleport from the Market to Hyrule Field and back from a new save, with the default and with RX_VK_SPARSE_SPARE_MB=0 (four reports; the table and the links are in the comment of 17 Nov below):

  • Windows, RX 9070 XT (2.0.416), Ryzen 7 5800X3D: sparse mirrors on; the pictures against main differ by 0 in both configurations; no crash; with the default the field's worst frame 267 ms on main, 54 ms here, one game start a side.
  • Windows, RX 9070 XT (2.0.416), Ryzen 9 5900X: main and this PR both crashed in both scenarios (0xC0000005 on main), so that PC shows nothing about this change; the farm's "fail" for windows+amd is this.
  • Linux, RTX 4070 (615.71.9): no crash of this PR (main crashed once); pictures differ by 0 with =0.
  • Linux, RTX 3080 Ti (620.70.6): no crash, pictures differ by 0 in both configurations; the field's hitches 2 on main, 0 here.

Not tested: an Intel card, RADV, the Steam Deck; a card of 8 GB or less; a session of hours; a person watching a long session (the tour above is headless); frame generation on; the gate walk itself on any card but the RTX 4070 SUPER (the farm teleports, and has no sum of the long frames' time); whether other drivers have this cost at all (the reuse is harmless where they don't, but it is not measured there).

Must be tested:

  • A played session with a person watching, half an hour or more through several areas, by hand: expecting no flashing after an area change, and the log's vk: sparse mirrors' buffers: line with "destroyed" a small part of "kept as spares"
  • Linux with RADV, or a Steam Deck, with sparse mirrors on (the log's vk: sparse VRAM mirrors (RX_VK_MIRROR_SPARSE): on): Castle Town out into Hyrule Field and back, expecting no crash and no flashing or wrong lighting after the area change (Test Farm: @Beanstalk linux amd, the area change both ways)

Risks

What could break: a buffer is now used again by another pool's mirror where it used to be destroyed. If a spare were taken while the GPU still read the old mirror through it, the old frame's work would read the new pool's data: wrong lighting or geometry for a frame. The wait before a buffer leaves the dead list is the one that guarded its destruction, and the flicker test found no difference, but that is one driver. A driver that handles unbinding a range differently from destroying the buffer could behave differently (a failed bind falls back to destroying). The spares hold up to 4 GB of sparse address space, no memory.

Turning it off: RX_VK_SPARSE_SPARE_MB=0.

Compatibility: Nothing changes.

Issues

None found for this (searched sparse buffer, destroy_sparse_buffer, sparse_reap, sparse mirror). #792 is the nearest.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (No host code changes; the Test Farm's four PCs built this PR on Windows and on Linux, and it was built here for the MSVC target.)

🤖 Generated with Claude Code

**Type:** perf · **Risk:** medium · **Tested on:** Windows 11, RTX 4070 SUPER (NVIDIA 617.42); the Test Farm: Windows, RX 9070 XT; Linux, RTX 4070 and RTX 3080 Ti · **Needs:** a person's eyes on a long session; an Intel card; RADV; a Steam Deck; a card of 8 GB or less ## Why Walking from Castle Town into Hyrule Field and back stutters, and part of it is in no column of the frame trace: three frames of 65 to 70 ms in one run had "nothing over 1 ms" in their row. A profile of that walk (`HOS_PROFILE=1`) shows where they are. In each of them the render thread sits in the driver under `memory_begin_submission`, at the call `sparse_reap` makes to `destroy_sparse_buffer`: `vkDestroyBuffer` of a sparse VRAM mirror's buffer. With timing lines around the two calls (not in this PR), one run of that walk (95 s, two area changes): - 351-421 sparse buffers created, 455-504 ms in the driver, about 0.06 ms a MB of the buffer's size, single ones up to 29 ms; - 293-350 destroyed, 390-427 ms, about 0.07 ms a MB; - the destructions come 41 to 56 at a time, at the start of one submission, when the GPU is past a batch of freed mirrors: 52 to 64 ms each time. Such a buffer holds address space and no memory (its blocks are bound one by one), and the sizes come again: 174 of 405 were of 4 MB, 61 of 8 MB. The game lets go of its pools and makes them again at an area change, and each time the mirror's buffer was destroyed and a new one of the same size created. Related: #792 (the images' destruction on a thread of its own: the same driver cost for images; this is the mirrors' buffers, which that PR does not reach). ## What changed A freed sparse mirror's buffer is kept for the next mirror of its size instead of being destroyed. - vk: `gpu/vk/sparse_spare.h` (new) is the list of spare buffers: a mirror takes the spare created with exactly its size, the one kept last; over the cap the oldest go. - vk (`gpu/vk/vk_memory.cpp`): - `sparse_reap`: a freed mirror's buffer, once the GPU is past it and its binds (the same wait as before), has what is bound to it unbound, every such buffer's blocks in one `vkQueueBindSparse`, and goes to the spares. Its blocks' memory is freed once that unbind is done on the GPU, as a released block's already is. If the bind fails, the buffers are destroyed and their memory freed, as before. - `mirror_free` notes what is bound to the buffer (its blocks, and released blocks still bound) before it empties the lists. - `mirror_make` takes a spare before it creates a buffer (`sparse_buffer_for`), and a buffer it gives up without binding anything goes back to the spares (`sparse_buffer_unused`). - A spare that has to go (over the cap, or a failed fill) is destroyed only once the binds' timeline has reached its unbinding (`spare_doomed`), never at once. - The cap is 4096 MB of address space, and never more than a quarter of the device's `sparseAddressSpaceSize`. A spare holds no memory. - switch: `RX_VK_SPARSE_SPARE_MB=<MB>`; `0` keeps none and destroys every buffer at once, as before. The log says `vk: sparse mirrors' buffers are kept for the next mirror of their size` at the first one, and every 1200 submissions `vk: sparse mirrors' buffers: N taken from the spares, N made new; N kept as spares, N destroyed`. - tests: `tests/test_sparse_spare.py` (new) compiles and runs the list (what a size takes, the cap, which spares go for a new one, what is never kept) and reads `vk_memory.cpp` for the rules above (no buffer destroyed before its unbinding is done, the memory freed only after it, `mirror_make` never past the spares). `tests/test_sparse_mirror.py` follows one moved line. - docs: the switch's row in `docs/development.md` and in `gpu/vk/switches.def`; six files under `docs/tested/`. ## Measurements **Verdict:** on the walk out of Castle Town and back, the time spent in frames of 50 ms or more falls from 2.0 s to 1.55 s a run (1,868, 2,111 and 2,005 ms against 1,551, 1,479 and 1,696 ms: no overlap), and the frames of 100 ms or more from 4-7 to 3-5. The driver's time in these buffers falls from about 910 ms to 245 ms a run, and the 52-64 ms batches of destructions are gone. The binds cost about 50 ms more a run. Hardware: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D (16 cores, SMT off), 32 GB Scene: save set "First Step into Hyrule Town": out through the south gate into Hyrule Field and in again, two area changes (a scripted route on the wall clock, 95 s), 2560x1440, DLAA, frame generation off, uncapped Method: headless runs, one build, the two sides in turn, three runs each; the frame trace (`RX_VK_FRAME_TRACE=1`, both sides) from 3 s after the save's load-in on (the load-in is the first frame of 300 ms or more; it came between 28.8 and 31.5 s of frame time in these runs); the binds from the log's `vk: sparse mirrors:` line Baseline: main's behaviour is this PR with `RX_VK_SPARSE_SPARE_MB=0` (every buffer destroyed at once in `sparse_reap`, as main does); both sides are one build, main 8e9cfc3a with this change. The branch was then moved onto main 6d72ca93 (the switch table's row added), built and run once more there, one pair: 2,022 ms against 1,449 ms in frames of 50 ms or more, 7 against 4 frames of 100 ms or more. It was moved once more onto main 544229a2 and committed (3f72adcc), built (with the link fix for the MSVC target in the working tree, a pull request of its own) and run once more, one pair: 1,759 ms against 1,707 ms, 7 against 4 frames of 100 ms or more, 266 buffers taken from the spares and 116 made new, none destroyed How to reproduce: `RX_VK_SPARSE_SPARE_MB=0` against no switch, on the route above; `HOS_PROFILE=1` and `scripts/profile_report.py` for the stutters' stacks | | Before, `RX_VK_SPARSE_SPARE_MB=0`: this PR @ 3f72adcc (three runs) | After: this PR @ 3f72adcc (three runs) | |---|---|---| | Time in frames of 50 ms or more | 1,868, 2,111, 2,005 ms | 1,551, 1,479, 1,696 ms | | median | 2,005 ms | 1,551 ms | | Frames of 100 ms or more | 4, 6, 7 | 4, 5, 3 | | Frames of 50 ms or more | 22, 23, 24 | 19, 18, 21 | | Frames of 25 ms or more | 52, 50, 53 | 49, 61, 50 | | The worst frame | 204, 199, 156 ms | 198, 160, 184 ms | | The load-in's own long frames (the 3 s before the rows above begin) | 1,954, 1,866, 1,852 ms | 1,884, 1,813, 1,885 ms | | The sparse mirrors' binds | 706 (129 ms), 691 (120 ms), 764 (126 ms) | 836 (178 ms), 771 (164 ms), 755 (185 ms) | | Buffers taken from the spares / made new | none / all | 275 / 129, 225 / 113, 234 / 130 | | Buffers destroyed | all | 0, 0, 0 | | Spares at the end of the run | none | 61 (1,060 MB), 46 (1,296 MB), 68 (1,668 MB of address space) | The worst frame of a run is the load into the field, which has much else in it (uploads, programs, the game's own loading); it does not move, and neither does the save's load-in. **Corrected on 17 Nov.** The first version of these numbers counted from a fixed 32 s of frame time, as "past the load-in". The load-in does not come at a fixed time: in the first "before" run it came at 31.1 s, and 615 ms of its long frames were counted (2,483 ms then, 1,868 ms now, and 6 frames of 100 ms or more then, 4 now); the same in the "before" runs of the two single pairs on the later bases (3,244 and 2,363 ms then, 2,022 and 1,759 ms now). The other runs are as they were. The gain is about 0.45 s a run, not the 0.56 s first given; `docs/tested/` has the corrected rows (the second commit). Over all nine pairs of this change measured so far (these three, the three with timing lines below, three single ones): 1,759 to 2,215 ms before, 1,264 to 1,707 ms after. A longer session through several areas, one tour a side: the repository's `kokiri-start` save, then the control bridge's debug teleport round the Market, Hyrule Field, Kakariko, Kokiri Forest, the Lost Woods and Zora's River, 20 s in each, 72 teleports in 20 minutes (`scripts/longshot_ctl.py`, its test profile: 1920x1080, headless, uncapped). Counted from 600 frames after the save's arrival to the end. One pair, so a direction: about a tenth less time in long frames; most of an area change's long frames are its textures (115,000 uploads a tour), which this does not touch. | | Before, `RX_VK_SPARSE_SPARE_MB=0`: this PR @ 3f72adcc (one tour) | After: this PR @ 3f72adcc (one tour) | |---|---|---| | Long frames (50 ms or more) in the tour | 395, 36.4 s | 355, 32.8 s | | Very long frames (100 ms or more) in the tour | 121, 17.4 s | 111, 15.6 s | | The tour's worst frame | 329 ms | 320 ms | | Mirror buffers taken from the spares / made new / destroyed | none / all / all | 2,512 / 190 / 63 | | The most spares held at once | none | 129, at the cap of 4,096 MB of address space | | The tour's sparse binds | 17,664 (2.39 s) | 18,473 (2.91 s) | | Errors, device loss | none | none | The driver's time in the two calls, from three earlier pairs of the same change with timing lines around `vkCreateBuffer` and `vkDestroyBuffer` (the lines are not in this PR; both sides had them): | | Before, `RX_VK_SPARSE_SPARE_MB=0`: this PR @ 3f72adcc with timing lines (three runs) | After: this PR @ 3f72adcc with timing lines (three runs) | |---|---|---| | Sparse buffers created | 351 (455 ms), 421 (487 ms), 373 (504 ms) | 119 (243 ms), 128 (248 ms), 124 (245 ms) | | Sparse buffers destroyed | 293 (390 ms), 350 (427 ms), 303 (411 ms) | 0, 0, 0 | | The largest batch of destructions in one submission | 64, 64, 62 ms | none | | Time in frames of 50 ms or more | 1,821, 2,215, 1,944 ms | 1,534, 1,493, 1,587 ms | Picture checks, both sides: | | Before, `RX_VK_SPARSE_SPARE_MB=0`: this PR @ 3f72adcc with timing lines | After: this PR @ 3f72adcc with timing lines | |---|---|---| | Frames with 1 % or more of a 320x180 shot flipping for one frame, through the gate at night and back and forth on the drawbridge (13,000-15,800 frames a run, a shot every present) | 25 and 14; the worst 1.6 and 2.4 % of the picture | 20 and 36; the worst 2.9 and 1.7 % | | The last shot of each run of the route above, by eye | the town from the gate, as it should be | the same | The flip count varies this much by itself on this route (13 to 72 a run on either side of earlier changes); no frame flashed. ``` vk: sparse mirrors' buffers are kept for the next mirror of their size, up to 4096 MB of address space (RX_VK_SPARSE_SPARE_MB=0: destroyed at once, as before) vk: sparse mirrors' buffers: 275 taken from the spares, 129 made new; 336 kept as spares, 0 destroyed; 61 spares now, 1060 MB of address space (RX_VK_SPARSE_SPARE_MB=4096) ``` ### Flags and settings One new switch, on by default. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | the address space the spare sparse mirror buffers may hold together, in MB | (none: every freed buffer destroyed at once) | 4096; `0`: none kept, as before | at an area change, about 0.65 s less of the render thread in the driver and no 52-64 ms batch of destructions | helps on the RTX 4070 SUPER on Windows; untested on AMD, Intel, Linux, the Deck (where sparse mirrors are on) | 4096 | ## Testing **Tested:** Windows 11, RTX 4070 SUPER, NVIDIA 617.42: the runs above (four pairs of the route with the timing lines, three without, one more on each of the two later bases, two rounds of the gate's flicker test), no error or device loss in any log. `tests/test_sparse_spare.py` and `tests/test_sparse_mirror.py` pass at 3f72adcc. The full run below was not repeated after the last move (main 6d72ca93 to 544229a2, one pull request that touches `gpu/vk/vk_main.cpp` and its test). `python -I -B tests/run_all.py` with clang on this PC, on main 6d72ca93 with this change: 393 passed, 107 failed, 221 skipped; main 6d72ca93 here: 393 passed, 106 failed, 221 skipped (this PC's toolchain: no gcc, Windows line endings, fixtures needing tools not installed). The one more is `tests/test_longshot_ctl.py`, which failed under the full run's load and passes alone, twice, with this change and on main; the other 106 are main's. One of those is `tests/test_switch_table.py`, over another switch (`RX_VK_PGO_FILE has a row and nothing reads it`); with this PR's row taken out it names `RX_VK_SPARSE_SPARE_MB` too, so the row is read. A 20-minute tour of six areas a side (72 teleports each, the table above): no error or device loss on either side, every teleport arrived (three of the 144 were still loading 20 s after they were sent, in Kakariko, and went on), and with the default the spares' list stayed at its cap or under it, its oldest buffers destroyed as the cap asks (63 in the tour). Headless: nobody looked at the picture of the tour. The Test Farm, this PR @ 3f72adc against main @ 544229a, a teleport from the Market to Hyrule Field and back from a new save, with the default and with `RX_VK_SPARSE_SPARE_MB=0` (four reports; the table and the links are in the comment of 17 Nov below): - Windows, RX 9070 XT (2.0.416), Ryzen 7 5800X3D: sparse mirrors on; the pictures against main differ by 0 in both configurations; no crash; with the default the field's worst frame 267 ms on main, 54 ms here, one game start a side. - Windows, RX 9070 XT (2.0.416), Ryzen 9 5900X: main and this PR both crashed in both scenarios (0xC0000005 on main), so that PC shows nothing about this change; the farm's "fail" for windows+amd is this. - Linux, RTX 4070 (615.71.9): no crash of this PR (main crashed once); pictures differ by 0 with `=0`. - Linux, RTX 3080 Ti (620.70.6): no crash, pictures differ by 0 in both configurations; the field's hitches 2 on main, 0 here. **Not tested:** an Intel card, RADV, the Steam Deck; a card of 8 GB or less; a session of hours; a person watching a long session (the tour above is headless); frame generation on; the gate walk itself on any card but the RTX 4070 SUPER (the farm teleports, and has no sum of the long frames' time); whether other drivers have this cost at all (the reuse is harmless where they don't, but it is not measured there). **Must be tested:** - A played session with a person watching, half an hour or more through several areas, by hand: expecting no flashing after an area change, and the log's `vk: sparse mirrors' buffers:` line with "destroyed" a small part of "kept as spares" - Linux with RADV, or a Steam Deck, with sparse mirrors on (the log's `vk: sparse VRAM mirrors (RX_VK_MIRROR_SPARSE): on`): Castle Town out into Hyrule Field and back, expecting no crash and no flashing or wrong lighting after the area change (Test Farm: @Beanstalk linux amd, the area change both ways) ## Risks **What could break:** a buffer is now used again by another pool's mirror where it used to be destroyed. If a spare were taken while the GPU still read the old mirror through it, the old frame's work would read the new pool's data: wrong lighting or geometry for a frame. The wait before a buffer leaves the dead list is the one that guarded its destruction, and the flicker test found no difference, but that is one driver. A driver that handles unbinding a range differently from destroying the buffer could behave differently (a failed bind falls back to destroying). The spares hold up to 4 GB of sparse address space, no memory. **Turning it off:** `RX_VK_SPARSE_SPARE_MB=0`. **Compatibility:** Nothing changes. ## Issues None found for this (searched `sparse buffer`, `destroy_sparse_buffer`, `sparse_reap`, `sparse mirror`). #792 is the nearest. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (No host code changes; the Test Farm's four PCs built this PR on Windows and on Linux, and it was built here for the MSVC target.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
perf(vk): a freed sparse mirror's buffer is kept for the next mirror of its size, not destroyed (RX_VK_SPARSE_SPARE_MB)
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 6s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Website / Website on Cloudflare (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 14s
beanstalk/approval approved by GummiNaomi (reviewed)
beanstalk/windows+amd 1/1 fail
beanstalk/linux 2/1 pass
PR description / Description follows the template (pull_request_target) Successful in 3s
3f72adcc48
A sparse VRAM mirror's buffer holds address space and no memory, yet
NVIDIA's Windows driver takes about 0.06 ms a MB to create one and
0.07 ms a MB to destroy one, and an area change frees hundreds of
mirrors and makes hundreds again. Castle Town to Hyrule Field and back
(95 s, RTX 4070 SUPER): 351-421 buffers created (455-504 ms) and 293-350
destroyed (390-427 ms), the destructions 41 to 56 at a time at the start
of one submission: stalls of 52 to 64 ms that the frame trace has no
column for (found with HOS_PROFILE=1: the render thread in
vkDestroyBuffer under sparse_reap).

A freed mirror's buffer, once the GPU is past it and its binds, now has
what is bound to it unbound (every such buffer's blocks in one bind,
their memory freed once that is done on the GPU, as a released block's
is) and is kept in sparse_spares; mirror_make takes the spare created
with exactly its size before it makes a new buffer. A spare holds no
memory. Over the cap (4096 MB of address space, never more than a
quarter of the device's sparse address space) the oldest go, destroyed
once their unbinding is done. gpu/vk/sparse_spare.h holds the list.

Same route, three runs a side: 2,483, 2,111 and 2,005 ms in frames of
50 ms or more against 1,551, 1,479 and 1,696 ms; frames of 100 ms or
more 6, 6, 7 against 4, 5, 3. With timing lines around the two calls
(not in this commit): the buffers' driver time about 910 -> 245 ms a
run and no destruction left; the binds 126 -> 178 ms. The gate's flicker
test: 25 and 14 frames flagged without, 20 and 36 with, as it varies by
itself.
RX_VK_SPARSE_SPARE_MB=0: every buffer destroyed at once, as before.

Assisted-by: Claude Mythos 5.2
Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Collaborator

Possibly related, for context:

  • issue #585 Idea: sparse mirrors cost 1-4 ms of GPU a frame on an RX 5600 XT; whole mirrors are faster until their budget fills (runs wanted on other 6 GB cards) — Sparse-mirror performance context on AMD; this PR targets sparse buffer destruction costs.
Possibly related, for context: - issue #585 Idea: sparse mirrors cost 1-4 ms of GPU a frame on an RX 5600 XT; whole mirrors are faster until their budget fills (runs wanted on other 6 GB cards) — Sparse-mirror performance context on AMD; this PR targets sparse buffer destruction costs.
Author
Member

@Beanstalk windows amd and linux: an area change both ways, from Castle Town out into Hyrule Field and back into the town (two area changes or more in one run), once with this PR's default and once with RX_VK_SPARSE_SPARE_MB=0 (the behaviour before it). Expecting: no crash or device loss; the same picture on both after each area change (no flashing, no wrong lighting or geometry); hitches at the area changes no longer than on main (here, on NVIDIA on Windows: about 0.6 s less time in frames of 50 ms or more over the two changes, and no 52-64 ms stall when the old area's buffers are let go). The change only does something where the log says vk: sparse VRAM mirrors (RX_VK_MIRROR_SPARSE): on; if a tester's log does not have that line, please say so, as that run then shows nothing either way. With the default the log should also have vk: sparse mirrors' buffers: N taken from the spares, ... with "0 destroyed" or a small number.

🤖 Generated with Claude Code

@Beanstalk windows amd and linux: an area change both ways, from Castle Town out into Hyrule Field and back into the town (two area changes or more in one run), once with this PR's default and once with `RX_VK_SPARSE_SPARE_MB=0` (the behaviour before it). Expecting: no crash or device loss; the same picture on both after each area change (no flashing, no wrong lighting or geometry); hitches at the area changes no longer than on main (here, on NVIDIA on Windows: about 0.6 s less time in frames of 50 ms or more over the two changes, and no 52-64 ms stall when the old area's buffers are let go). The change only does something where the log says `vk: sparse VRAM mirrors (RX_VK_MIRROR_SPARSE): on`; if a tester's log does not have that line, please say so, as that run then shows nothing either way. With the default the log should also have `vk: sparse mirrors' buffers: N taken from the spares, ...` with "0 destroyed" or a small number. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member
Beanstalk test farm · an earlier run: commit 3f72adc (the newer results are in a comment below)

Commit 3f72adc · tier reviewed · approved by GummiNaomi · dashboard

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

On Windows AMD and Linux, the plan teleports from Market to Hyrule Field and back on main and the PR, using both the default spare-buffer behavior and a zero cap on the PR. The two configurations take about 25 minutes per machine and compare post-load pictures and load times while recording frame hitches and sparse-mirror activation. Crashes, device loss, missing sparse-mirror activation, substantial picture differences, or slower loads fail the run; without the activation line, the run is inconclusive for this change. Teleports do not reproduce the original gate walk, and the farm cannot isolate buffer-destruction stalls or total time in frames over 50 ms.

  • Where: windows+amd (1-2 reports), linux (1-2 reports).
  • Matrix: 1 cell, each on main and the PR: RX_VK_SPARSE_SPARE_MB 0 (PR only).
  • default-spares: from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side.
  • zero-spares: from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, load times, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 5%; or longest load is more than 15% above main; or forbidden log lines is above 0; or expected log lines missing is above 0.
  • Time: about 28 min of game runs per tester (4 game starts), plus the two builds.

Done (started 06:13 UTC, last report 07:24 UTC). Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
windows+amd · 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416; 2: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 2/1 1 2 2 PR runs 25.9 vs 28.1 (−8%) — fail ⚠ outlier
linux · 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 615.71.9; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 620.70.6 2/1 1 2 none 29.6 vs 30.1 (−2%) — pass ⚠ outlier

Measurements · windows+amd

Verdict: fail on windows+amd (2/1 report): default-spares crash; default-spares load_time_max_s.max_delta_pct (+23.0%); zero-spares crash failed.

Hardware: 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM; 2: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM
Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 544229a After: this PR @ 3f72adc
default-spares · longest load (s) 12.5 9.0 (−28%)
default-spares · forbidden log lines 0.0 0.0
default-spares · expected log lines missing 0.0 0.0
default-spares · field · frame time (p99) (ms) 28.1 25.9 (−8%)
default-spares · market · frame time (p99) (ms) 31.5 33.0 (+5%)
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · longest load (s) 8.0 8.0 (−0%)
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · forbidden log lines 0.0 0.0
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · expected log lines missing 0.0 0.0
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · field · frame time (p99) (ms) 27.3 27.1 (−1%)
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · market · frame time (p99) (ms) 34.9 31.5 (−10%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_SPARSE_SPARE_MB switch the PR adds (set on the PR side only) 0 not in main the PR's default zero-spares, main without it → the PR with 0: 27.3 → 27.1 (−1%) no clear effect
Markdown for the PR description
## Measurements

**Verdict:** fail on windows+amd (2/1 report): `default-spares crash`; `default-spares load_time_max_s.max_delta_pct (+23.0%)`; `zero-spares crash` failed.

Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM`  
Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 544229a | After: this PR @ 3f72adc |
|---|---|---|
| default-spares · longest load (s) | 12.5 | 9.0 (−28%) |
| default-spares · forbidden log lines | 0.0 | 0.0 |
| default-spares · expected log lines missing | 0.0 | 0.0 |
| default-spares · field · frame time (p99) (ms) | 28.1 | 25.9 (−8%) |
| default-spares · market · frame time (p99) (ms) | 31.5 | 33.0 (+5%) |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · longest load (s) | 8.0 | 8.0 (−0%) |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · expected log lines missing | 0.0 | 0.0 |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · field · frame time (p99) (ms) | 27.3 | 27.1 (−1%) |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · market · frame time (p99) (ms) | 34.9 | 31.5 (−10%) |

### Flags and settings

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | zero-spares, main without it → the PR with 0: 27.3 → 27.1 (−1%) | no clear effect |

Measurements · linux

Verdict: pass on linux (2/1 report): no rule failed and no PR run crashed.

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 615.71.9 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 620.70.6 AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM
Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 544229a After: this PR @ 3f72adc
default-spares · longest load (s) 46.9 40.3 (−14%)
default-spares · forbidden log lines 0.0 0.0
default-spares · expected log lines missing 0.0 0.0
default-spares · field · frame time (p99) (ms) 33.7 32.4 (−4%)
default-spares · market · frame time (p99) (ms) 36.4 32.7 (−10%)
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · longest load (s) 8.1 8.3 (+2%)
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · forbidden log lines 0.0 0.0
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · expected log lines missing 0.0 0.0
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · field · frame time (p99) (ms) 27.8 26.8 (−4%)
zero-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · market · frame time (p99) (ms) 33.3 32.6 (−2%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_SPARSE_SPARE_MB switch the PR adds (set on the PR side only) 0 not in main the PR's default zero-spares, main without it → the PR with 0: 27.8 → 26.8 (−4%) helps
Markdown for the PR description
## Measurements

**Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed.

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` `AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM`  
Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 544229a | After: this PR @ 3f72adc |
|---|---|---|
| default-spares · longest load (s) | 46.9 | 40.3 (−14%) |
| default-spares · forbidden log lines | 0.0 | 0.0 |
| default-spares · expected log lines missing | 0.0 | 0.0 |
| default-spares · field · frame time (p99) (ms) | 33.7 | 32.4 (−4%) |
| default-spares · market · frame time (p99) (ms) | 36.4 | 32.7 (−10%) |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · longest load (s) | 8.1 | 8.3 (+2%) |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · expected log lines missing | 0.0 | 0.0 |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · field · frame time (p99) (ms) | 27.8 | 26.8 (−4%) |
| zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · market · frame time (p99) (ms) | 33.3 | 32.6 (−2%) |

### Flags and settings

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | zero-spares, main without it → the PR with 0: 27.8 → 26.8 (−4%) | helps |
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>3f72adc</code> (the newer results are in a comment below)</summary> Commit `3f72adc` · tier **reviewed** · approved by GummiNaomi · [dashboard](https://beanstalk.magicbean.dev/prs/1359) **What will be tested** · AI plan (`gpt-6.1-terra`) On Windows AMD and Linux, the plan teleports from Market to Hyrule Field and back on main and the PR, using both the default spare-buffer behavior and a zero cap on the PR. The two configurations take about 25 minutes per machine and compare post-load pictures and load times while recording frame hitches and sparse-mirror activation. Crashes, device loss, missing sparse-mirror activation, substantial picture differences, or slower loads fail the run; without the activation line, the run is inconclusive for this change. Teleports do not reproduce the original gate walk, and the farm cannot isolate buffer-destruction stalls or total time in frames over 50 ms. - **Where:** windows+amd (1-2 reports), linux (1-2 reports). - **Matrix:** 1 cell, each on main and the PR: RX_VK_SPARSE_SPARE_MB `0` (PR only). - **default-spares:** from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side. - **zero-spares:** from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, load times, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 5%; or longest load is more than 15% above main; or forbidden log lines is above 0; or expected log lines missing is above 0. - **Time:** about 28 min of game runs per tester (4 game starts), plus the two builds. Done (started 06:13 UTC, last report 07:24 UTC). Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | windows+amd · 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_4baf688d11b52864) [2](https://beanstalk.magicbean.dev/reports/rp_b43a314d9db4f01a) | 2 PR runs | 25.9 vs 28.1 (−8%) | — | fail ⚠ outlier | | linux · 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_ff60ed39bf17474e) [2](https://beanstalk.magicbean.dev/reports/rp_7b710fe891ba837a) | none | 29.6 vs 30.1 (−2%) | — | pass ⚠ outlier | #### Measurements · windows+amd **Verdict:** fail on windows+amd (2/1 report): `default-spares crash`; `default-spares load_time_max_s.max_delta_pct (+23.0%)`; `zero-spares crash` failed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM` Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 3f72adc | |---|---|---| | default-spares · longest load (s) | 12.5 | 9.0 (−28%) | | default-spares · forbidden log lines | 0.0 | 0.0 | | default-spares · expected log lines missing | 0.0 | 0.0 | | default-spares · field · frame time (p99) (ms) | 28.1 | 25.9 (−8%) | | default-spares · market · frame time (p99) (ms) | 31.5 | 33.0 (+5%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · longest load (s) | 8.0 | 8.0 (−0%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · expected log lines missing | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · field · frame time (p99) (ms) | 27.3 | 27.1 (−1%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · market · frame time (p99) (ms) | 34.9 | 31.5 (−10%) | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | zero-spares, main without it → the PR with 0: 27.3 → 27.1 (−1%) | no clear effect | <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** fail on windows+amd (2/1 report): `default-spares crash`; `default-spares load_time_max_s.max_delta_pct (+23.0%)`; `zero-spares crash` failed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 9 5900X 12-Core Processor, 32 GB RAM` Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 3f72adc | |---|---|---| | default-spares · longest load (s) | 12.5 | 9.0 (−28%) | | default-spares · forbidden log lines | 0.0 | 0.0 | | default-spares · expected log lines missing | 0.0 | 0.0 | | default-spares · field · frame time (p99) (ms) | 28.1 | 25.9 (−8%) | | default-spares · market · frame time (p99) (ms) | 31.5 | 33.0 (+5%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · longest load (s) | 8.0 | 8.0 (−0%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · expected log lines missing | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · field · frame time (p99) (ms) | 27.3 | 27.1 (−1%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · market · frame time (p99) (ms) | 34.9 | 31.5 (−10%) | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | zero-spares, main without it → the PR with 0: 27.3 → 27.1 (−1%) | no clear effect | ``` </details> #### Measurements · linux **Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed. Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` `AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM` Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 3f72adc | |---|---|---| | default-spares · longest load (s) | 46.9 | 40.3 (−14%) | | default-spares · forbidden log lines | 0.0 | 0.0 | | default-spares · expected log lines missing | 0.0 | 0.0 | | default-spares · field · frame time (p99) (ms) | 33.7 | 32.4 (−4%) | | default-spares · market · frame time (p99) (ms) | 36.4 | 32.7 (−10%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · longest load (s) | 8.1 | 8.3 (+2%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · expected log lines missing | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · field · frame time (p99) (ms) | 27.8 | 26.8 (−4%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · market · frame time (p99) (ms) | 33.3 | 32.6 (−2%) | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | zero-spares, main without it → the PR with 0: 27.8 → 26.8 (−4%) | helps | <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** pass on linux (2/1 report): no rule failed and no PR run crashed. Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 615.71.9` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 620.70.6` `AMD Ryzen 9 3900X 12-Core Processor, 48 GB RAM` Scene: default-spares, from a new save; zero-spares, from a new save; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; zero-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 3f72adc | |---|---|---| | default-spares · longest load (s) | 46.9 | 40.3 (−14%) | | default-spares · forbidden log lines | 0.0 | 0.0 | | default-spares · expected log lines missing | 0.0 | 0.0 | | default-spares · field · frame time (p99) (ms) | 33.7 | 32.4 (−4%) | | default-spares · market · frame time (p99) (ms) | 36.4 | 32.7 (−10%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · longest load (s) | 8.1 | 8.3 (+2%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · expected log lines missing | 0.0 | 0.0 | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · field · frame time (p99) (ms) | 27.8 | 26.8 (−4%) | | zero-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · market · frame time (p99) (ms) | 33.3 | 32.6 (−2%) | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | zero-spares, main without it → the PR with 0: 27.8 → 26.8 (−4%) | helps | ``` </details> </details>
Author
Member

The Test Farm's four reports, read one by one (its summary line says "fail" for windows+amd; the reports say why, and it is not this change):

Report PC Result What it shows
rp_4baf688d11b52864 Windows, RX 9070 XT (2.0.416), Ryzen 7 5800X3D pass Sparse mirrors on (81 mirrors). Pictures against main: diff 0, field and market, with the default and with RX_VK_SPARSE_SPARE_MB=0. No crash.
rp_b43a314d9db4f01a Windows, RX 9070 XT (2.0.416), Ryzen 9 5900X fail main and this PR both crashed, in both scenarios: exit code 0xC0000005 on main twice and on the PR once, 0xC00000FD on the PR's =0 run. The rule fails because a PR run crashed. With main crashing the same way there, I read it as that PC's or main's, not this change's; it also means this PC shows nothing about the change.
rp_ff60ed39bf17474e Linux, RTX 4070 (615.71.9), Ryzen 7 5800X3D pass In the default scenario main crashed and the PR did not. With =0: pictures diff 0, no crash.
rp_7b710fe891ba837a Linux, RTX 3080 Ti (620.70.6), Ryzen 9 3900X pass Pictures diff 0 in both configurations, no crash.

Hitches, one game start a side, so a direction and no more (the =0 pairs, where the PR does what main does, differ by as much in places):

Before: main @ 544229a After: this PR @ 3f72adc
RX 9070 XT, 5800X3D: the field's worst frame 267 ms 54 ms
RX 9070 XT, 5800X3D: the field's hitches 3 1
RX 9070 XT, 5800X3D: the market's worst frame 166 ms 68 ms
RX 9070 XT, 5800X3D: the same PC with RX_VK_SPARSE_SPARE_MB=0 on the PR, the field's worst frame 222 ms 151 ms
RTX 3080 Ti, Linux: the field's hitches 2 0
RTX 3080 Ti, Linux: the market's hitches 2 1
RTX 3080 Ti, Linux: the market's 1 % low frame time 47.1 ms 38.4 ms

So far: no crash that main does not also have, the same picture on an AMD card on Windows and on NVIDIA on Linux, and the mirrors are sparse on the AMD card, so the change was in use there. The farm teleports between the Market and Hyrule Field from a new save; it does not walk through the gate, and it cannot count the time in frames of 50 ms or more.

Two things in those reports are main's and may want an issue from someone who can see the crash logs: main @ 544229a crashing on the RX 9070 XT with the 5900X in both scenarios, and once on the RTX 4070 on Linux.

Still open for this PR: a long played session (in hand), an Intel card, RADV, the Steam Deck, a card of 8 GB or less.

🤖 Generated with Claude Code

The Test Farm's four reports, read one by one (its summary line says "fail" for windows+amd; the reports say why, and it is not this change): | Report | PC | Result | What it shows | |---|---|---|---| | [rp_4baf688d11b52864](https://beanstalk.magicbean.dev/reports/rp_4baf688d11b52864) | Windows, RX 9070 XT (2.0.416), Ryzen 7 5800X3D | pass | Sparse mirrors on (81 mirrors). Pictures against main: diff 0, field and market, with the default and with `RX_VK_SPARSE_SPARE_MB=0`. No crash. | | [rp_b43a314d9db4f01a](https://beanstalk.magicbean.dev/reports/rp_b43a314d9db4f01a) | Windows, RX 9070 XT (2.0.416), Ryzen 9 5900X | fail | **main and this PR both crashed, in both scenarios**: exit code 0xC0000005 on main twice and on the PR once, 0xC00000FD on the PR's `=0` run. The rule fails because a PR run crashed. With main crashing the same way there, I read it as that PC's or main's, not this change's; it also means this PC shows nothing about the change. | | [rp_ff60ed39bf17474e](https://beanstalk.magicbean.dev/reports/rp_ff60ed39bf17474e) | Linux, RTX 4070 (615.71.9), Ryzen 7 5800X3D | pass | In the default scenario main crashed and the PR did not. With `=0`: pictures diff 0, no crash. | | [rp_7b710fe891ba837a](https://beanstalk.magicbean.dev/reports/rp_7b710fe891ba837a) | Linux, RTX 3080 Ti (620.70.6), Ryzen 9 3900X | pass | Pictures diff 0 in both configurations, no crash. | Hitches, one game start a side, so a direction and no more (the `=0` pairs, where the PR does what main does, differ by as much in places): | | Before: main @ 544229a | After: this PR @ 3f72adc | |---|---|---| | RX 9070 XT, 5800X3D: the field's worst frame | 267 ms | 54 ms | | RX 9070 XT, 5800X3D: the field's hitches | 3 | 1 | | RX 9070 XT, 5800X3D: the market's worst frame | 166 ms | 68 ms | | RX 9070 XT, 5800X3D: the same PC with `RX_VK_SPARSE_SPARE_MB=0` on the PR, the field's worst frame | 222 ms | 151 ms | | RTX 3080 Ti, Linux: the field's hitches | 2 | 0 | | RTX 3080 Ti, Linux: the market's hitches | 2 | 1 | | RTX 3080 Ti, Linux: the market's 1 % low frame time | 47.1 ms | 38.4 ms | So far: no crash that main does not also have, the same picture on an AMD card on Windows and on NVIDIA on Linux, and the mirrors are sparse on the AMD card, so the change was in use there. The farm teleports between the Market and Hyrule Field from a new save; it does not walk through the gate, and it cannot count the time in frames of 50 ms or more. Two things in those reports are main's and may want an issue from someone who can see the crash logs: main @ 544229a crashing on the RX 9070 XT with the 5900X in both scenarios, and once on the RTX 4070 on Linux. Still open for this PR: a long played session (in hand), an Intel card, RADV, the Steam Deck, a card of 8 GB or less. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

A correction to this PR's numbers, mine to make: the first version overstated the gain.

The runs were counted "from 32 s of frame time on", as past the save's load-in. The load-in does not come at a fixed time. In these runs it came between 28.8 and 31.5 s, and where it came late, part of its long frames fell after 32 s and were counted as the area change's:

As first given Counted from 3 s after the load-in
Before, RX_VK_SPARSE_SPARE_MB=0, three runs: time in frames of 50 ms or more 2,483, 2,111, 2,005 ms 1,868, 2,111, 2,005 ms
After, three runs 1,551, 1,479, 1,696 ms 1,551, 1,479, 1,696 ms
Before: frames of 100 ms or more 6, 6, 7 4, 6, 7
The single pair on main 6d72ca93 3,244 against 1,449 ms 2,022 against 1,449 ms
The single pair at 3f72adcc 2,363 against 1,707 ms 1,759 against 1,707 ms

So the change takes about 0.45 s a run off the long frames of this walk (2.0 s to 1.55 s), not 0.56 s, and "about 0.6 s" in my request to the Test Farm above was too much. What stands: over all nine pairs measured so far no "before" run is as low as any "after" run (1,759 to 2,215 ms against 1,264 to 1,707 ms), the 52-64 ms batches of destructions are gone, and the driver's time in these buffers falls from about 910 to 245 ms a run (the timing-line runs, which this does not touch). The last single pair is close (1,759 against 1,707 ms).

The description's Measurements section and the six docs/tested/ rows are corrected (761fab7b, rows only; the code is 3f72adcc as measured). The first commit's message still has the old figures; I have not rewritten it, since that takes a force push. The load-in itself is the same on both sides (1,852 to 1,954 ms of long frames before, 1,813 to 1,885 after).

How it was found: a profile of the same walk for the next piece of work listed every long frame with its time, and one run's load-in sat on the wrong side of the line.

🤖 Generated with Claude Code

A correction to this PR's numbers, mine to make: the first version overstated the gain. The runs were counted "from 32 s of frame time on", as past the save's load-in. The load-in does not come at a fixed time. In these runs it came between 28.8 and 31.5 s, and where it came late, part of its long frames fell after 32 s and were counted as the area change's: | | As first given | Counted from 3 s after the load-in | |---|---|---| | Before, `RX_VK_SPARSE_SPARE_MB=0`, three runs: time in frames of 50 ms or more | 2,483, 2,111, 2,005 ms | 1,868, 2,111, 2,005 ms | | After, three runs | 1,551, 1,479, 1,696 ms | 1,551, 1,479, 1,696 ms | | Before: frames of 100 ms or more | 6, 6, 7 | 4, 6, 7 | | The single pair on main 6d72ca93 | 3,244 against 1,449 ms | 2,022 against 1,449 ms | | The single pair at 3f72adcc | 2,363 against 1,707 ms | 1,759 against 1,707 ms | So the change takes about 0.45 s a run off the long frames of this walk (2.0 s to 1.55 s), not 0.56 s, and "about 0.6 s" in my request to the Test Farm above was too much. What stands: over all nine pairs measured so far no "before" run is as low as any "after" run (1,759 to 2,215 ms against 1,264 to 1,707 ms), the 52-64 ms batches of destructions are gone, and the driver's time in these buffers falls from about 910 to 245 ms a run (the timing-line runs, which this does not touch). The last single pair is close (1,759 against 1,707 ms). The description's Measurements section and the six `docs/tested/` rows are corrected (761fab7b, rows only; the code is 3f72adcc as measured). The first commit's message still has the old figures; I have not rewritten it, since that takes a force push. The load-in itself is the same on both sides (1,852 to 1,954 ms of long frames before, 1,813 to 1,885 after). How it was found: a profile of the same walk for the next piece of work listed every long frame with its time, and one run's load-in sat on the wrong side of the line. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(docs): the spare sparse buffers' tested rows count from the save's load-in, not from 32 s
Some checks reported errors
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 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by GummiNaomi (reviewed)
beanstalk/linux+radv 0/1 pass, 2 error
761fab7b1a
The six rows gave each run's long frames "from 32 s of frame time on
(past the load-in)". The load-in does not come at a fixed time: it came
between 28.8 and 31.1 s in these runs, and in ga-sp3-off-1, at 31.1 s,
615 ms of its long frames were past 32 s and counted: 2,483 ms in frames
of 50 ms or more where the area change's own were 1,868 ms, and 6 frames
of 100 ms or more where they were 4.

The rows now count from 3 s after the load-in's first frame (the first
frame of 300 ms or more). That run's numbers change; the other five keep
theirs but for the count of frames in the window. Before 1,868, 2,111
and 2,005 ms, after 1,551, 1,479 and 1,696 ms: about 0.45 s a run less,
not the 0.56 s the first commit's message says.

Assisted-by: Claude Mythos 5.2
Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Member
Beanstalk test farm · an earlier run: commit 761fab7 (the newer results are in a comment below)

Commit 761fab7 · tier reviewed · approved by GummiNaomi · dashboard

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

On Linux RADV, the plan teleports from the Market to Hyrule Field and back on main and the PR, once with the PR default and once with spare buffers disabled. It takes about 20 minutes per tester, comparing pictures after each change and checking for crashes and device loss. The log records whether sparse mirrors are on; if they are not, the run cannot exercise the changed behavior. The screenshots sample the scenes but cannot rule out transient flashing, and the longer watched session remains separate.

  • Where: linux+radv (1-2 reports).
  • Matrix: 1 cell, each on main and the PR: RX_VK_SPARSE_SPARE_MB 0 (PR only).
  • default-round-trip: from the repository's save kokiri-start, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, take the picture market to compare with main; 1 run on each side.
  • no-spares-round-trip: from the repository's save kokiri-start, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, take the picture market to compare with main; 1 run on each side.
  • Measured: crashes, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 1%; or forbidden log lines is above 0.
  • Time: about 21 min of game runs per tester (4 game starts), plus the two builds.

Done (started 10:40 UTC, last report 10:54 UTC). Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
linux+radv · 1: linux+amd+radv+dgpu AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7 2/1 1 2 none — — error

Measurements · linux+radv

Verdict: could not be judged on linux+radv (2/1 report).

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6 AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM
Scene: default-round-trip, from the repository's save kokiri-start; no-spares-round-trip, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-round-trip: 1 game start a side; no-spares-round-trip: 1 game start a side; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 544229a After: this PR @ 761fab7
default-round-trip · forbidden log lines 0.0 0.0
no-spares-round-trip · RX_VK_SPARSE_SPARE_MB=0 (PR only) · forbidden log lines 0.0 0.0

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_SPARSE_SPARE_MB switch the PR adds (set on the PR side only) 0 not in main the PR's default no-spares-round-trip, main without it → the PR with 0: not measured untested
Markdown for the PR description
## Measurements

**Verdict:** could not be judged on linux+radv (2/1 report).

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`  
Scene: default-round-trip, from the repository's save kokiri-start; no-spares-round-trip, from the repository's save kokiri-start; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-round-trip: 1 game start a side; no-spares-round-trip: 1 game start a side; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 544229a | After: this PR @ 761fab7 |
|---|---|---|
| default-round-trip · forbidden log lines | 0.0 | 0.0 |
| no-spares-round-trip · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |

### Flags and settings

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | no-spares-round-trip, main without it → the PR with 0: not measured | untested |
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>761fab7</code> (the newer results are in a comment below)</summary> Commit `761fab7` · tier **reviewed** · approved by GummiNaomi · [dashboard](https://beanstalk.magicbean.dev/prs/1359) **What will be tested** · AI plan (`gpt-6.1-terra`) On Linux RADV, the plan teleports from the Market to Hyrule Field and back on main and the PR, once with the PR default and once with spare buffers disabled. It takes about 20 minutes per tester, comparing pictures after each change and checking for crashes and device loss. The log records whether sparse mirrors are on; if they are not, the run cannot exercise the changed behavior. The screenshots sample the scenes but cannot rule out transient flashing, and the longer watched session remains separate. - **Where:** linux+radv (1-2 reports). - **Matrix:** 1 cell, each on main and the PR: RX_VK_SPARSE_SPARE_MB `0` (PR only). - **default-round-trip:** from the repository's save `kokiri-start`, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, take the picture market to compare with main; 1 run on each side. - **no-spares-round-trip:** from the repository's save `kokiri-start`, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, take the picture market to compare with main; 1 run on each side. - **Measured:** crashes, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 1%; or forbidden log lines is above 0. - **Time:** about 21 min of game runs per tester (4 game starts), plus the two builds. Done (started 10:40 UTC, last report 10:54 UTC). Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | linux+radv · 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_916defd98d889788) [2](https://beanstalk.magicbean.dev/reports/rp_736485a70ee11a86) | none | — | — | error | #### Measurements · linux+radv **Verdict:** could not be judged on linux+radv (2/1 report). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` Scene: default-round-trip, from the repository's save kokiri-start; no-spares-round-trip, from the repository's save kokiri-start; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-round-trip: 1 game start a side; no-spares-round-trip: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 761fab7 | |---|---|---| | default-round-trip · forbidden log lines | 0.0 | 0.0 | | no-spares-round-trip · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | no-spares-round-trip, main without it → the PR with 0: not measured | untested | <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** could not be judged on linux+radv (2/1 report). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM` Scene: default-round-trip, from the repository's save kokiri-start; no-spares-round-trip, from the repository's save kokiri-start; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-round-trip: 1 game start a side; no-spares-round-trip: 1 game start a side; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 761fab7 | |---|---|---| | default-round-trip · forbidden log lines | 0.0 | 0.0 | | no-spares-round-trip · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | no-spares-round-trip, main without it → the PR with 0: not measured | untested | ``` </details> </details>
GummiNaomi changed title from WIP: perf(vk): a freed sparse mirror's buffer is kept for the next mirror of its size, not destroyed (RX_VK_SPARSE_SPARE_MB) to perf(vk): a freed sparse mirror's buffer is kept for the next mirror of its size, not destroyed (RX_VK_SPARSE_SPARE_MB) 2026-11-17 09:27:29 +00:00
TrashPanda left a comment

A freed sparse mirror's buffer is kept for the next mirror of the same size, and it is not destroyed until its unbind has finished. I read head 761fab7b. It applies onto current main. The RADV or Deck run, and a watched session, are still open, so this is not an approval.

The reap waits for the same completed value as before, unbinds every kept buffer's blocks in one bind, and only then puts the buffer on the spare list. Its memory is freed once that unbind's timeline value is reached. A spare is destroyed only after that value, including one dropped because the list is over its cap. The cap is 4096 MB of address space, and never more than a quarter of the device's sparse address space. RX_VK_SPARSE_SPARE_MB=0 destroys every buffer at once, as before. The list is only touched while the pool lock is held. The played code is 3f72adcc; the tip corrects the measured rows. On that build the walk out of Castle Town spends about 0.45 s less in frames of 50 ms or more, and the batches of destructions are gone. The Test Farm's Linux NVIDIA runs and one Windows AMD card showed the same picture and no crash this change adds. Must be tested still asks for a person watching a session of half an hour or more, and for Linux with RADV or a Steam Deck.

A freed sparse mirror's buffer is kept for the next mirror of the same size, and it is not destroyed until its unbind has finished. I read head `761fab7b`. It applies onto current main. The RADV or Deck run, and a watched session, are still open, so this is not an approval. The reap waits for the same completed value as before, unbinds every kept buffer's blocks in one bind, and only then puts the buffer on the spare list. Its memory is freed once that unbind's timeline value is reached. A spare is destroyed only after that value, including one dropped because the list is over its cap. The cap is 4096 MB of address space, and never more than a quarter of the device's sparse address space. `RX_VK_SPARSE_SPARE_MB=0` destroys every buffer at once, as before. The list is only touched while the pool lock is held. The played code is `3f72adcc`; the tip corrects the measured rows. On that build the walk out of Castle Town spends about 0.45 s less in frames of 50 ms or more, and the batches of destructions are gone. The Test Farm's Linux NVIDIA runs and one Windows AMD card showed the same picture and no crash this change adds. Must be tested still asks for a person watching a session of half an hour or more, and for Linux with RADV or a Steam Deck.
Author
Member

For the open item the review names:

@Beanstalk linux radv: an area change both ways between the Market and Hyrule Field (two area changes or more in one run), once with this PR's default and once with RX_VK_SPARSE_SPARE_MB=0. Expecting: no crash or device loss, and the same picture on both after each area change (no flashing, no wrong lighting or geometry). The change only does something where the log says vk: sparse VRAM mirrors (RX_VK_MIRROR_SPARSE): on: if a RADV tester's log does not have that line, that is the answer for that card (nothing to keep, nothing changed), and worth saying.

The watched session of half an hour or more is still to come, by hand.

🤖 Generated with Claude Code

For the open item the review names: @Beanstalk linux radv: an area change both ways between the Market and Hyrule Field (two area changes or more in one run), once with this PR's default and once with `RX_VK_SPARSE_SPARE_MB=0`. Expecting: no crash or device loss, and the same picture on both after each area change (no flashing, no wrong lighting or geometry). The change only does something where the log says `vk: sparse VRAM mirrors (RX_VK_MIRROR_SPARSE): on`: if a RADV tester's log does not have that line, that is the answer for that card (nothing to keep, nothing changed), and worth saying. The watched session of half an hour or more is still to come, by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Member

The two RADV reports (rp_916defd98d889788, rp_736485a70ee11a86: RX 7900 XT and RX 7900 XTX) judged nothing: a step of the plan ran out of time in both scenarios, the one with RX_VK_SPARSE_SPARE_MB=0 too, which is main's own behaviour. What they do show: no crash on either card, and sparse mirrors on with RADV (vk: sparse mirrors: 49, 846 MB with memory of 1016 MB), so the change is in use there. Once more, with the steps of the first plan, which ran through:

@Beanstalk linux radv: from a new save, teleport to the Market, then teleport to Hyrule Field, take a picture there and measure for 20 s, then teleport to the Market, take a picture and measure for 20 s; once with this PR's default and once with RX_VK_SPARSE_SPARE_MB=0. Expecting: no crash or device loss, and the same pictures as main after each teleport.

🤖 Generated with Claude Code

The two RADV reports ([rp_916defd98d889788](https://beanstalk.magicbean.dev/reports/rp_916defd98d889788), [rp_736485a70ee11a86](https://beanstalk.magicbean.dev/reports/rp_736485a70ee11a86): RX 7900 XT and RX 7900 XTX) judged nothing: a step of the plan ran out of time in both scenarios, the one with `RX_VK_SPARSE_SPARE_MB=0` too, which is main's own behaviour. What they do show: no crash on either card, and sparse mirrors on with RADV (`vk: sparse mirrors: 49, 846 MB with memory of 1016 MB`), so the change is in use there. Once more, with the steps of the first plan, which ran through: @Beanstalk linux radv: from a new save, teleport to the Market, then teleport to Hyrule Field, take a picture there and measure for 20 s, then teleport to the Market, take a picture and measure for 20 s; once with this PR's default and once with `RX_VK_SPARSE_SPARE_MB=0`. Expecting: no crash or device loss, and the same pictures as main after each teleport. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member

Beanstalk test farm

Commit 761fab7 · tier reviewed · approved by GummiNaomi · dashboard

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

On Linux with RADV, a new save teleports through the Market to Hyrule Field and back, using the PR default and the zero-spare setting. Each visit to the field and final Market is pictured and measured for 20 seconds against main; the two configurations require separate starts and take about 26 minutes in total. A crash, device loss, or picture differing from main fails the plan.

  • Where: linux+radv (1-2 reports).
  • Matrix: 1 cell, each on main and the PR: RX_VK_SPARSE_SPARE_MB 0 (PR only).
  • default-spares: from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side.
  • no-spares: from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 0%; or forbidden log lines is above 0.
  • Time: about 27 min of game runs per tester (4 game starts), plus the two builds.

Done (started 12:23 UTC, last report 12:39 UTC). Run 2: re-planned by GummiNaomi. Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
linux+radv · 1: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6 2/1 1 2 none — — error

Measurements · linux+radv

Verdict: could not be judged on linux+radv (2/1 report).

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7 AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6 AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM
Scene: default-spares, from a new save; no-spares, from a new save; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; no-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 544229a After: this PR @ 761fab7
default-spares · forbidden log lines 0.0 0.0
no-spares · RX_VK_SPARSE_SPARE_MB=0 (PR only) · forbidden log lines 0.0 0.0

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_SPARSE_SPARE_MB switch the PR adds (set on the PR side only) 0 not in main the PR's default no-spares, main without it → the PR with 0: not measured untested
Markdown for the PR description
## Measurements

**Verdict:** could not be judged on linux+radv (2/1 report).

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM`  
Scene: default-spares, from a new save; no-spares, from a new save; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; no-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 544229a | After: this PR @ 761fab7 |
|---|---|---|
| default-spares · forbidden log lines | 0.0 | 0.0 |
| no-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |

### Flags and settings

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | no-spares, main without it → the PR with 0: not measured | untested |
<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `761fab7` · tier **reviewed** · approved by GummiNaomi · [dashboard](https://beanstalk.magicbean.dev/prs/1359) **What will be tested** · AI plan (`gpt-6.1-terra`) On Linux with RADV, a new save teleports through the Market to Hyrule Field and back, using the PR default and the zero-spare setting. Each visit to the field and final Market is pictured and measured for 20 seconds against main; the two configurations require separate starts and take about 26 minutes in total. A crash, device loss, or picture differing from main fails the plan. - **Where:** linux+radv (1-2 reports). - **Matrix:** 1 cell, each on main and the PR: RX_VK_SPARSE_SPARE_MB `0` (PR only). - **default-spares:** from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side. - **no-spares:** from a new save, then teleport to Market, teleport to Hyrule Field, take the picture field to compare with main, measure field for 20 s (after 0 s warm-up), take the picture market to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 0%; or forbidden log lines is above 0. - **Time:** about 27 min of game runs per tester (4 game starts), plus the two builds. Done (started 12:23 UTC, last report 12:39 UTC). Run 2: re-planned by GummiNaomi. Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | linux+radv · 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` | 2/1 [1](https://beanstalk.magicbean.dev/reports/rp_0056c98990e2a371) [2](https://beanstalk.magicbean.dev/reports/rp_13166063cd7cbc8c) | none | — | — | error | #### Measurements · linux+radv **Verdict:** could not be judged on linux+radv (2/1 report). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM` Scene: default-spares, from a new save; no-spares, from a new save; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; no-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 761fab7 | |---|---|---| | default-spares · forbidden log lines | 0.0 | 0.0 | | no-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | no-spares, main without it → the PR with 0: not measured | untested | <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** could not be judged on linux+radv (2/1 report). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.2.7` `AMD Ryzen 7 5800X3D 8-Core Processor, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XT (RADV NAVI31), 26.2.6` `AMD Ryzen 7 5700X3D 8-Core Processor, 32 GB RAM` Scene: default-spares, from a new save; no-spares, from a new save; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); default-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; no-spares: 1 game start a side, field 20 s after 0 s warm-up, market 20 s after 0 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 544229a | After: this PR @ 761fab7 | |---|---|---| | default-spares · forbidden log lines | 0.0 | 0.0 | | no-spares · `RX_VK_SPARSE_SPARE_MB=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_SPARSE_SPARE_MB` | switch the PR adds (set on the PR side only) | `0` | not in main | the PR's default | no-spares, main without it → the PR with 0: not measured | untested | ``` </details>
Some checks reported errors
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 7s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 11s
Third-party parts / As their notes say (pull_request) Successful in 14s
PR description / Description follows the template (pull_request_target) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by GummiNaomi (reviewed)
beanstalk/linux+radv 0/1 pass, 2 error
This pull request has changes conflicting with the target branch.
  • docs/development.md
  • gpu/vk/switches.def
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/sparse-mirror-buffers:GummiNaomi-perf/sparse-mirror-buffers'
git switch 'GummiNaomi-perf/sparse-mirror-buffers'
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!1359
No description provided.