perf(vk): the small pools' capture ranges rebuilt in one x86-64 assembly pass #2135

Open
siantm wants to merge 4 commits from siantm/Longshot:perf/asm-pool-ranges into main
Contributor

Summary

Before each capture the renderer rebuilds the list of the host's small pools to capture
(refresh_pool_ranges_locked in gpu/vk/vk_memory.cpp): it copied the pools, sorted them with std::sort and merged
the ones that overlap or touch.

This adds gpu/vk/asm/memory.S on the asm kit: lsasm_pool_ranges keeps the pools of 1 to RX_VK_CAPTURE_POOL_MB
bytes below 1 TB, rounds them to whole pages and merges those that overlap or touch, in one branch-free pass over the
list in address order (hos_gpu_pools gives its mappings that way); it answers -1 when a pool starts below the open
range or an end wraps. refresh_pool_ranges_locked takes that pass (pool_ranges: the kernel on x86-64, the same loop
in C elsewhere) without RX_VK_CAPTURE_EAGER, in place of the copy, sort and merge; with it, or for a list the pass
refuses, the path below runs as before. The version moves only when the ranges did, as before. Main's own part: #1553
already keeps no map of the pools' ages without RX_VK_CAPTURE_EAGER. The result expected: the same ranges, the
refresh faster.

No switch: the same ranges either way.

From 12168bb8 on exp/x86-asm-sync (only its pass; the retired pools' list there is another change). Depends on #1947
(the asm kit, which now carries the GPU-visible ranges' sort, lsasm_sort_ranges): its commits show in this diff until
#1947 merges.

Read first: gpu/vk/asm/memory.S, then pool_ranges and refresh_pool_ranges_locked in gpu/vk/vk_memory.cpp.

Testing

Tested: Windows 11, i7-9700, RTX 4060, the builder's llvm-mingw clang 23 (CC/CXX, RX_CPM set); head 8df7cd73
on #1947's head cffa2f46 (the asm kit, on main 9dd41326). Through the PC's job queue, each run in a hidden console,
tests/run_all.py --strict --exact --jobs 2 --timeout 1200: the change's own checks (light job pr-tb-AsmCut5-light,
log t-AsmCut5-asm-pool-ranges): test_asm_memory.py, test_capture_pool_refresh.py pass (2 of 2). --changed cffa2f46 (build job pr-tb-AsmCut5-build, log t-AsmCut5-chg-asm-pool-ranges): 78 checks, 70 pass, 8 fail, each of
which fails on #1947's head @ cffa2f46 too (a worktree at cffa2f46 in the queue's jobs, logs
t-AsmCut5-base-kit-changed and t-AsmCut5-base-kit-more): test_capture_read_once.py, test_frame_overlap.py,
test_guest_imported.py, test_linux_pressure.py, test_pending_guest_import.py, test_replay_write_order.py,
test_sparse_mirror.py, test_texel_buffer_ownership.py.

It has run in the game on this PC once: the in-play A/B in Measurements (held job fb-g2135, the Market, 19 runs), with
no FATAL, device lost or Vulkan error in any run.

Still to test:

  • Windows 11, i7-9700, RTX 4060 (this PC): Kokiri Forest, turning the camera and walking into Link's house and out,
    uncapped (HOS_FPS_MAX=240), on #1947's head and on this PR, each warmed a minute, then at least three interleaved
    three-minute runs of each (AB AB AB), and one run of each with HOS_PROFILE=1 (python -I scripts/perf.py report
    on its folder: the share of refresh_pool_ranges_locked on its threads), expecting the same picture, no FATAL, that
    share lower and fps and frame times of this PR at least the base's; a difference beyond the runs' spread is a gain
    or a loss, one within it is no difference measured (by hand)
  • Linux NVIDIA and AMD, Windows AMD and Intel, Steam Deck: Kokiri Forest, play three minutes on #1947's head and on
    this PR, warmed and interleaved, expecting the same picture and frame times within the runs' spread or better on
    this PR (@Beanstalk linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: Kokiri Forest three minutes,
    #1947's head against this PR, warmed and interleaved, frame times and a screenshot)
  • Linux: python3 -I -B tests/test_asm_memory.py --cxx g++ and --cxx clang++, expecting PASS (by hand)

Measurements

Verdict: a gain: a rebuild of the ranges takes 3.2-3.3× less time over 1,465 pools listed by address, 4.3-4.5×
when eight lists alternate with other work between refreshes, 4.7× over 200 pools and 7.0-7.1× over 6,000. Slower,
0.81-0.84×, when the list is not by address: the pass refuses it and the sort runs after it (hos_gpu_pools lists its
mappings by address). The pass in C (other CPUs) is 2.1-5.6× faster than the sort, and behind the kernel where the
lists alternate and over 6,000 pools. A micro-benchmark on authored input.

In play (the Market, this head against its parent, the asm kit cffa2f46, below): the rebuild's own stage is faster in
the loads, -26 % (p = 0.002 in a test that swaps runs between the sides). In steady play it is not shown; the saving
there is about 4 µs a frame. Nothing is shown in frame time.

Baseline: the C this PR replaces, as #1947's head cffa2f46 has it (the asm kit on main 9dd41326, which this PR depends on), not main itself.

The micro-benchmark: refresh_pool_ranges_locked as cffa2f46 has it (copy, sort, merge) against this PR's (the pass, lsasm_pool_ranges), with this PR's C pass beside them, each cut from gpu/vk/vk_memory.cpp with the host's list and generation stubbed; every refresh timed is a rebuild; RX_VK_CAPTURE_EAGER unset, a 64 MB cap; authored lists by address (~70% pools of 1-256 pages, ~25% of 1-64 MB, the rest larger). A script on this PC, not in this PR (asm_pool_ranges_bench.py, PrTrials' trials/tools/bench), run alone in the PC's job queue on 2026-11-22: 3 rounds of 201 repetitions per case and arm, i7-9700, llvm-mingw clang 23.1.5 -O2 -ffp-contract=off, arms SSE2 (-march=x86-64) and AVX2 (-march=x86-64-v3, what the release builds the back end for). The arms take turns at going first; their outputs were compared at every repetition and were equal. Each cell: the median of the three rounds' medians, [lowest–highest round median], in µs per refresh. Change: before ÷ after (above 1: this PR faster).

Host list, arm Before: copy, sort, merge @ cffa2f46 After: this PR @ 8df7cd73 Change After, C pass (other CPUs): this PR @ 8df7cd73
1,465 pools, the same list each time, SSE2 12.9 [12.9–12.9] 4.10 [4.10–4.20] 3.15× 4.40 [4.40–4.40]
1,465 pools, the same list each time, AVX2 13.1 [13.1–13.1] 4.00 [4.00–4.00] 3.27× 3.50 [3.50–3.60]
1,465 pools, 8 lists in turn, branchy work between refreshes, SSE2 16.4 [16.4–17.3] 3.80 [3.80–4.20] 4.32× 7.70 [7.70–8.10]
1,465 pools, 8 lists in turn, branchy work between refreshes, AVX2 16.7 [16.5–16.7] 3.70 [3.60–3.70] 4.51× 6.50 [6.40–6.50]
200 pools, SSE2 2.80 [2.80–3.20] 0.600 [0.600–0.700] 4.67× 0.600 [0.600–0.700]
200 pools, AVX2 2.80 [2.80–2.80] 0.600 [0.600–0.600] 4.67× 0.500 [0.500–0.500]
6,000 pools, SSE2 128 [128–130] 18.2 [17.9–18.2] 7.03× 30.9 [30.8–31.3]
6,000 pools, AVX2 128 [128–130] 17.9 [17.7–17.9] 7.13× 25.1 [25.1–25.5]
1,465 pools, two swapped (not by address: the pass refuses it), SSE2 13.4 [13.4–13.5] 16.0 [15.9–16.2] 0.84× 14.8 [14.8–14.9]
1,465 pools, two swapped (not by address: the pass refuses it), AVX2 13.2 [13.2–13.6] 16.2 [16.2–16.6] 0.81× 17.0 [16.6–17.1]

In play (held job fb-g2135, 06:22 to 07:15 UTC on 2026-11-23): the Market, 60 s a run. The two builds are this
head 8df7cd73 (rt-apr-8df7cd73) and its parent, the asm kit cffa2f46 (rt-kit-cffa2f46): a warm-up each, then kit
and head interleaved (kit head head kit, four times), every run loading at create. The output was pinned at 2560x1440,
on a desktop at 800x600 at 30 Hz (the PC's only screen then), so the swapchain and refresh are not those of a
2560x1440 desktop; the runs are alike among themselves. One head run (head6) is held: in it the game's first uses
waited 2,081 ms in all for shader loads (the longest wait 239 ms), so it wrote the load marker. Its draw figures are the
lowest of the 16 runs, and it has 2 bursts. The marker was moved out before the next run, and every later run logged
loading at create. That leaves 8 kit runs against 7 head runs.

Reach, from a diagnostic build of this head that is local and never pushed (one uncounted Market run, a counter added in
the capture's 600-submit line): in its last 24,000 submits (about 4,000 frames) pool_ranges rebuilt the ranges 640
times over about 3,700 pools each, about once every 6 frames. 627 of the rebuilds changed the ranges, and none fell back
to the sort, so the host's list always came by address: the micro-benchmark's 3.2× case, never its 0.82× one. The
rebuild runs at the start of each capture, before its lock is taken. The capture's 600-submit line times that part as
"lock" (ms a submit, printed to two decimals, so its averages are coarse). That part is the figure for this change's
stage.

a side: median (range) Before: the kit @ cffa2f46 (C sort and merge), 8 runs After: this PR @ 8df7cd73, 7 runs change of the means p (swap test)
the capture's rebuild and lock, ms a submit, in the loads (the lines before the measured stretch) 0.0051 (0.0039 to 0.0054) 0.0038 (0.0035 to 0.0043) -26 % 0.002
the same, measured stretch 0.0010 (0.0008 to 0.0045) 0.0008 (0.0005 to 0.0018) - 0.16
the whole capture, ms a submit, measured stretch 0.169 (0.163 to 0.207) 0.167 (0.157 to 0.173) -6.6 % 0.11
the whole capture, ms a submit, in the loads 0.157 (0.153 to 0.160) 0.162 (0.154 to 0.185) +5.3 % 0.041
its scan / its copying, in the loads 0.0756 / 0.0769 0.0785 / 0.0799 +5.1 % / +7.0 % 0.022 / 0.017
pages copied a submit, in the loads 141 (137 to 144) 144 (138 to 155) +3.3 % 0.032
calm-stretch game_ms 12.57 (12.39 to 13.16) 12.48 (12.38 to 12.99) -0.7 % 0.53
main_blocked_ms 10.45 (9.80 to 11.07) 10.21 (9.80 to 10.71) -1.7 % 0.39
frames a second 69.4 (61.0 to 74.0) 71.1 (67.6 to 73.1) +4.1 % 0.15
p99 frame time, ms 41.3 (22.8 to 48.2) 23.7 (22.2 to 47.4) -21 % 0.18
memory sync, ms a frame 0.65 (0.61 to 0.71) 0.64 (0.59 to 0.65) -3.6 % 0.18
a frame's replay time (ms): submit 7.76 (6.47 to 8.59) 7.56 (6.66 to 8.22) -2.0 % 0.63

So the kernel's stage is faster where the rebuilds cluster, in the loads. In steady play, at about 23 µs saved a
rebuild and one rebuild every 6 frames, the saving is about 4 µs a frame, too small for any frame figure to show. In the
same loads the capture's other parts were slower with this head, at the edge (scan +5.1 %, copying +7.0 %, the whole
capture +5.3 %). They are code this pull request does not touch, and the head's loads copied 3.3 % more pages a
submit. That is not claimed either way. This is this head against its parent: two builds, not one build's switch (this
PR has none). The play profile the back end is built with was recorded before this change, so functions this change
edits can build without their profile in the head's build (a compile with clang's profile warnings on showed that for
#1994's file; not checked for this PR's).

Risks

What could break: a range left out of the list would leave that pool's writes uncaptured (stale data on the GPU); the
test runs pool_ranges and refresh_pool_ranges_locked cut from the source against main's refresh and its sort and
merge over lists with gaps, overlaps, touching and repeated starts, empty and too large pools, starts at and past 1 TB,
lists out of order and ends that wrap, between pages that fault, with and without RX_VK_CAPTURE_EAGER. A revert is
enough. Renderer files: the runtime is rebuilt; nothing changes for players' saves, options or caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Stacked on #1947 b71bdb57 on main @ 01d6878b.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). Targeted checks pass on #1947 (b71bdb57, main @ 01d6878b): test_asm_memory.py (SSE2/AVX2, native/sysv, 4 ELF/COFF clang assemblies), test_capture_pool_refresh.py (asm + C), gpu/vk/vk_memory.cpp syntax check; full CI suite awaits CI approval.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Before each capture the renderer rebuilds the list of the host's small pools to capture (`refresh_pool_ranges_locked` in `gpu/vk/vk_memory.cpp`): it copied the pools, sorted them with `std::sort` and merged the ones that overlap or touch. This adds `gpu/vk/asm/memory.S` on the asm kit: `lsasm_pool_ranges` keeps the pools of 1 to `RX_VK_CAPTURE_POOL_MB` bytes below 1 TB, rounds them to whole pages and merges those that overlap or touch, in one branch-free pass over the list in address order (`hos_gpu_pools` gives its mappings that way); it answers -1 when a pool starts below the open range or an end wraps. `refresh_pool_ranges_locked` takes that pass (`pool_ranges`: the kernel on x86-64, the same loop in C elsewhere) without `RX_VK_CAPTURE_EAGER`, in place of the copy, sort and merge; with it, or for a list the pass refuses, the path below runs as before. The version moves only when the ranges did, as before. Main's own part: #1553 already keeps no map of the pools' ages without `RX_VK_CAPTURE_EAGER`. The result expected: the same ranges, the refresh faster. No switch: the same ranges either way. From 12168bb8 on `exp/x86-asm-sync` (only its pass; the retired pools' list there is another change). Depends on #1947 (the asm kit, which now carries the GPU-visible ranges' sort, `lsasm_sort_ranges`): its commits show in this diff until #1947 merges. Read first: `gpu/vk/asm/memory.S`, then `pool_ranges` and `refresh_pool_ranges_locked` in `gpu/vk/vk_memory.cpp`. ## Testing **Tested:** Windows 11, i7-9700, RTX 4060, the builder's llvm-mingw clang 23 (`CC`/`CXX`, `RX_CPM` set); head 8df7cd73 on #1947's head cffa2f46 (the asm kit, on main 9dd41326). Through the PC's job queue, each run in a hidden console, `tests/run_all.py --strict --exact --jobs 2 --timeout 1200`: the change's own checks (light job `pr-tb-AsmCut5-light`, log `t-AsmCut5-asm-pool-ranges`): `test_asm_memory.py`, `test_capture_pool_refresh.py` pass (2 of 2). `--changed cffa2f46` (build job `pr-tb-AsmCut5-build`, log `t-AsmCut5-chg-asm-pool-ranges`): 78 checks, 70 pass, 8 fail, each of which fails on #1947's head @ cffa2f46 too (a worktree at cffa2f46 in the queue's jobs, logs `t-AsmCut5-base-kit-changed` and `t-AsmCut5-base-kit-more`): `test_capture_read_once.py`, `test_frame_overlap.py`, `test_guest_imported.py`, `test_linux_pressure.py`, `test_pending_guest_import.py`, `test_replay_write_order.py`, `test_sparse_mirror.py`, `test_texel_buffer_ownership.py`. It has run in the game on this PC once: the in-play A/B in Measurements (held job `fb-g2135`, the Market, 19 runs), with no FATAL, device lost or Vulkan error in any run. **Still to test:** - Windows 11, i7-9700, RTX 4060 (this PC): Kokiri Forest, turning the camera and walking into Link's house and out, uncapped (`HOS_FPS_MAX=240`), on #1947's head and on this PR, each warmed a minute, then at least three interleaved three-minute runs of each (AB AB AB), and one run of each with `HOS_PROFILE=1` (`python -I scripts/perf.py report` on its folder: the share of `refresh_pool_ranges_locked` on its threads), expecting the same picture, no FATAL, that share lower and fps and frame times of this PR at least the base's; a difference beyond the runs' spread is a gain or a loss, one within it is no difference measured (by hand) - Linux NVIDIA and AMD, Windows AMD and Intel, Steam Deck: Kokiri Forest, play three minutes on #1947's head and on this PR, warmed and interleaved, expecting the same picture and frame times within the runs' spread or better on this PR (@Beanstalk linux+nvidia, linux+amd, windows+amd, windows+intel, steamdeck: Kokiri Forest three minutes, #1947's head against this PR, warmed and interleaved, frame times and a screenshot) - Linux: `python3 -I -B tests/test_asm_memory.py --cxx g++` and `--cxx clang++`, expecting PASS (by hand) ## Measurements **Verdict:** a gain: a rebuild of the ranges takes 3.2-3.3× less time over 1,465 pools listed by address, 4.3-4.5× when eight lists alternate with other work between refreshes, 4.7× over 200 pools and 7.0-7.1× over 6,000. Slower, 0.81-0.84×, when the list is not by address: the pass refuses it and the sort runs after it (hos_gpu_pools lists its mappings by address). The pass in C (other CPUs) is 2.1-5.6× faster than the sort, and behind the kernel where the lists alternate and over 6,000 pools. A micro-benchmark on authored input. In play (the Market, this head against its parent, the asm kit cffa2f46, below): the rebuild's own stage is faster in the loads, -26 % (p = 0.002 in a test that swaps runs between the sides). In steady play it is not shown; the saving there is about 4 µs a frame. Nothing is shown in frame time. **Baseline:** the C this PR replaces, as #1947's head cffa2f46 has it (the asm kit on main 9dd41326, which this PR depends on), not main itself. The micro-benchmark: `refresh_pool_ranges_locked` as cffa2f46 has it (copy, sort, merge) against this PR's (the pass, `lsasm_pool_ranges`), with this PR's C pass beside them, each cut from `gpu/vk/vk_memory.cpp` with the host's list and generation stubbed; every refresh timed is a rebuild; `RX_VK_CAPTURE_EAGER` unset, a 64 MB cap; authored lists by address (~70% pools of 1-256 pages, ~25% of 1-64 MB, the rest larger). A script on this PC, not in this PR (`asm_pool_ranges_bench.py`, PrTrials' `trials/tools/bench`), run alone in the PC's job queue on 2026-11-22: 3 rounds of 201 repetitions per case and arm, i7-9700, llvm-mingw clang 23.1.5 `-O2 -ffp-contract=off`, arms SSE2 (`-march=x86-64`) and AVX2 (`-march=x86-64-v3`, what the release builds the back end for). The arms take turns at going first; their outputs were compared at every repetition and were equal. Each cell: the median of the three rounds' medians, [lowest–highest round median], in µs per refresh. Change: before ÷ after (above 1: this PR faster). | Host list, arm | Before: copy, sort, merge @ cffa2f46 | After: this PR @ 8df7cd73 | Change | After, C pass (other CPUs): this PR @ 8df7cd73 | |---|---|---|---|---| | 1,465 pools, the same list each time, SSE2 | 12.9 [12.9–12.9] | 4.10 [4.10–4.20] | 3.15× | 4.40 [4.40–4.40] | | 1,465 pools, the same list each time, AVX2 | 13.1 [13.1–13.1] | 4.00 [4.00–4.00] | 3.27× | 3.50 [3.50–3.60] | | 1,465 pools, 8 lists in turn, branchy work between refreshes, SSE2 | 16.4 [16.4–17.3] | 3.80 [3.80–4.20] | 4.32× | 7.70 [7.70–8.10] | | 1,465 pools, 8 lists in turn, branchy work between refreshes, AVX2 | 16.7 [16.5–16.7] | 3.70 [3.60–3.70] | 4.51× | 6.50 [6.40–6.50] | | 200 pools, SSE2 | 2.80 [2.80–3.20] | 0.600 [0.600–0.700] | 4.67× | 0.600 [0.600–0.700] | | 200 pools, AVX2 | 2.80 [2.80–2.80] | 0.600 [0.600–0.600] | 4.67× | 0.500 [0.500–0.500] | | 6,000 pools, SSE2 | 128 [128–130] | 18.2 [17.9–18.2] | 7.03× | 30.9 [30.8–31.3] | | 6,000 pools, AVX2 | 128 [128–130] | 17.9 [17.7–17.9] | 7.13× | 25.1 [25.1–25.5] | | 1,465 pools, two swapped (not by address: the pass refuses it), SSE2 | 13.4 [13.4–13.5] | 16.0 [15.9–16.2] | 0.84× | 14.8 [14.8–14.9] | | 1,465 pools, two swapped (not by address: the pass refuses it), AVX2 | 13.2 [13.2–13.6] | 16.2 [16.2–16.6] | 0.81× | 17.0 [16.6–17.1] | **In play** (held job `fb-g2135`, 06:22 to 07:15 UTC on 2026-11-23): the Market, 60 s a run. The two builds are this head 8df7cd73 (`rt-apr-8df7cd73`) and its parent, the asm kit cffa2f46 (`rt-kit-cffa2f46`): a warm-up each, then kit and head interleaved (kit head head kit, four times), every run loading at create. The output was pinned at 2560x1440, on a desktop at 800x600 at 30 Hz (the PC's only screen then), so the swapchain and refresh are not those of a 2560x1440 desktop; the runs are alike among themselves. One head run (head6) is held: in it the game's first uses waited 2,081 ms in all for shader loads (the longest wait 239 ms), so it wrote the load marker. Its draw figures are the lowest of the 16 runs, and it has 2 bursts. The marker was moved out before the next run, and every later run logged loading at create. That leaves 8 kit runs against 7 head runs. Reach, from a diagnostic build of this head that is local and never pushed (one uncounted Market run, a counter added in the capture's 600-submit line): in its last 24,000 submits (about 4,000 frames) `pool_ranges` rebuilt the ranges 640 times over about 3,700 pools each, about once every 6 frames. 627 of the rebuilds changed the ranges, and none fell back to the sort, so the host's list always came by address: the micro-benchmark's 3.2× case, never its 0.82× one. The rebuild runs at the start of each capture, before its lock is taken. The capture's 600-submit line times that part as "lock" (ms a submit, printed to two decimals, so its averages are coarse). That part is the figure for this change's stage. | a side: median (range) | Before: the kit @ cffa2f46 (C sort and merge), 8 runs | After: this PR @ 8df7cd73, 7 runs | change of the means | p (swap test) | |---|---|---|---|---| | the capture's rebuild and lock, ms a submit, in the loads (the lines before the measured stretch) | 0.0051 (0.0039 to 0.0054) | 0.0038 (0.0035 to 0.0043) | -26 % | 0.002 | | the same, measured stretch | 0.0010 (0.0008 to 0.0045) | 0.0008 (0.0005 to 0.0018) | - | 0.16 | | the whole capture, ms a submit, measured stretch | 0.169 (0.163 to 0.207) | 0.167 (0.157 to 0.173) | -6.6 % | 0.11 | | the whole capture, ms a submit, in the loads | 0.157 (0.153 to 0.160) | 0.162 (0.154 to 0.185) | +5.3 % | 0.041 | | its scan / its copying, in the loads | 0.0756 / 0.0769 | 0.0785 / 0.0799 | +5.1 % / +7.0 % | 0.022 / 0.017 | | pages copied a submit, in the loads | 141 (137 to 144) | 144 (138 to 155) | +3.3 % | 0.032 | | calm-stretch game_ms | 12.57 (12.39 to 13.16) | 12.48 (12.38 to 12.99) | -0.7 % | 0.53 | | main_blocked_ms | 10.45 (9.80 to 11.07) | 10.21 (9.80 to 10.71) | -1.7 % | 0.39 | | frames a second | 69.4 (61.0 to 74.0) | 71.1 (67.6 to 73.1) | +4.1 % | 0.15 | | p99 frame time, ms | 41.3 (22.8 to 48.2) | 23.7 (22.2 to 47.4) | -21 % | 0.18 | | memory sync, ms a frame | 0.65 (0.61 to 0.71) | 0.64 (0.59 to 0.65) | -3.6 % | 0.18 | | `a frame's replay time (ms)`: submit | 7.76 (6.47 to 8.59) | 7.56 (6.66 to 8.22) | -2.0 % | 0.63 | So the kernel's stage is faster where the rebuilds cluster, in the loads. In steady play, at about 23 µs saved a rebuild and one rebuild every 6 frames, the saving is about 4 µs a frame, too small for any frame figure to show. In the same loads the capture's other parts were slower with this head, at the edge (scan +5.1 %, copying +7.0 %, the whole capture +5.3 %). They are code this pull request does not touch, and the head's loads copied 3.3 % more pages a submit. That is not claimed either way. This is this head against its parent: two builds, not one build's switch (this PR has none). The play profile the back end is built with was recorded before this change, so functions this change edits can build without their profile in the head's build (a compile with clang's profile warnings on showed that for #1994's file; not checked for this PR's). ## Risks What could break: a range left out of the list would leave that pool's writes uncaptured (stale data on the GPU); the test runs `pool_ranges` and `refresh_pool_ranges_locked` cut from the source against main's refresh and its sort and merge over lists with gaps, overlaps, touching and repeated starts, empty and too large pools, starts at and past 1 TB, lists out of order and ends that wrap, between pages that fault, with and without `RX_VK_CAPTURE_EAGER`. A revert is enough. Renderer files: the runtime is rebuilt; nothing changes for players' saves, options or caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. (Stacked on #1947 `b71bdb57` on `main @ 01d6878b`.) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). Targeted checks pass on `#1947` (`b71bdb57`, `main @ 01d6878b`): `test_asm_memory.py` (SSE2/AVX2, native/sysv, 4 ELF/COFF clang assemblies), `test_capture_pool_refresh.py` (asm + C), `gpu/vk/vk_memory.cpp` syntax check; full CI suite awaits CI approval. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
The ground the hand-written kernels stand on, without any kernel yet:

- gpu/asm/lsasm.h: a kernel is written once, in Intel syntax against the System V registers; the macros make the
  Win64 convention with its SEH unwind data on Windows (an epilogue laid out as Windows' unwinder recognises one:
  the vzeroupper and the frees before the pops) and the DWARF CFI on Linux, and LSASM_ABI for the declarations.
- tests/asm_kit.py: a kernel's check builds its fixture with the kernels at SSE2 and AVX2 (where the CPU has it),
  on Windows also the System V body through sysv_abi, and assembles every kernel with clang for ELF and COFF.
- tests/test_asm_abi.py with tests/asm_abi_probe.S: probes that use every part of the frame: six arguments arrive,
  every callee-saved register comes back, a fault inside one unwinds to the caller (Windows), and every single step
  of each probe is unwound by Windows' own unwinder to its caller.
- nx2/build.py asm_jobs: every .S of host/asm goes into the game, of gpu/vk/asm into the renderer, of gpu/asm into
  both, preprocessed with the build's CPU flags and keyed by the headers beside them and lsasm.h. No folder, no job.
- scripts/devtools/packs.py takes a .S as a source (it shows in its module's objects) and nx2/version.py counts it in
  the sources' fingerprint.
- tests/test_asm_build.py, tests/test_dev_packs.py: the jobs, their keys, the fingerprint and the packs' rules.

Assisted-by: Claude Code
tests/asm_abi_probe.S has three more probes that return rsp modulo 16 in their body: scratch alone, one push and
scratch, two pushes and the xmm saves, an even and an odd count of pushes in both conventions (Win64's LSASM_ARGS
pushes two). Win64 asks a function with a frame to keep rsp 16-byte aligned in its body, and LSASM_ALLOC's scratch
at [rsp] is aligned only so. On Windows each is stepped and unwound as the others are. tests/test_asm_abi.py also
assembles a kernel with LSASM_ALLOC 3072 (it must assemble) and 4096 (a page and a push: it must stop the assembly,
as the macros probe no stack page and its first store could skip Windows' guard page).

Both fail on this commit: lsasm.h leaves rsp at 8 modulo 16 with an even count of pushes, and takes any scratch size.

Assisted-by: Claude Code
Win64 asks a function with a frame to keep rsp 16-byte aligned in its body, and the macros did not: with an even
count of pushes (LSASM_ARGS's two included) the body ran at 8 modulo 16, so an aligned store to LSASM_ALLOC's
scratch could fault. The macros now count the pushes and take 8 bytes more below them where the count leaves rsp
misaligned, before the first xmm save or scratch (or at the prologue's end), in the SEH codes and the CFI alike; the
epilogue gives them back with its one add (Windows) or at the first pop (Linux). A push after the xmm saves or the
scratch stops the assembly, as the padding could not count it.

The macros probe no stack page, so a frame of more than a page could skip Windows' guard page with its first store:
LSASM_END_PROLOGUE stops the assembly of a frame (pushes, padding, xmm saves and scratch) over 4096 bytes.

The header also says what LSASM_ARGS maps: six integer or pointer arguments; a float argument is in another register
in each convention. The fifth and sixth stay loaded on every call: their slots lie inside the caller's own frame.

Assisted-by: Claude Code
tests/test_asm_build.py checks the kernels' object keys as compile_one names them: a header renamed with its contents or
removed changes the key (a clean compile of the kernel would fail), a .inc edit changes it, and a kernel whose depfile
exists is keyed by the headers it names (an edit to another header keeps it). A gpu/asm kernel's second job publishing
the same key after the first must leave the first job's object (the cache entry is a hard link to it) as it was. A
renderer file whose depfile names a gpu/asm declaration is keyed by it, through main()'s own vdeps_roots statement.

They fail on this commit: the key joins the folders' .h contents alone, cache_put copies over an entry that
os.link found there, and the renderer's roots leave gpu/asm out.

Assisted-by: Claude Code
asm_jobs keyed a kernel's object by the .h contents of its folder and gpu/asm joined: a header renamed with its
contents kept an object a clean compile no longer makes, and a .inc edit was not seen. A kernel is now compiled with
-MD and keyed as the host's and the back end's own files are (renderer_deps, DEPFILE_JOBS, rekey_depfiles): by the
names and contents of the headers its last compile read under its folder and gpu/asm, or by every header of the two
folders (tree_headers) before it has a depfile.

A gpu/asm kernel is compiled for each module with one key, and on a cold build both jobs could publish it: the second's
os.link failed on the first's entry, and its copyfile then wrote into that entry, a hard link to the first job's object.
cache_put leaves an entry it finds (FileExistsError), and a copy across volumes goes in whole by a rename.

The back end's own objects are keyed by gpu/asm's headers too (vdeps_roots), so a Vulkan caller of a shared kernel
compiles again when the kernel's declaration changes.

Assisted-by: Claude Code
tests/test_appimage_source_headers.py runs the AppImage script's copy block and checks that every file of gpu/asm
(lsasm.h, which every kernel includes) is carried and that every kernel's includes are, for host/asm, gpu/asm and
gpu/vk/asm (gpu/vk itself is copied whole after the block). tests/test_dev_packs.py routes the three kernel folders: a
host/asm kernel is the game's alone, so its pack builds the game without the renderer (renderer_untouched), a gpu/vk/asm
kernel builds the renderer alone, a gpu/asm kernel both.

They fail on this commit: the AppImage copies host/ and gpu/vk but not gpu/asm (a player's build with a host/asm kernel
stops listing it), and renderer_untouched takes only a host/ .c for the game's alone.

Assisted-by: Claude Code
scripts/linux/appimage.sh copied host/ and gpu/vk whole but not gpu/asm: a player's build with a host/asm kernel
stopped at asm_jobs listing the missing folder, and a gpu/asm kernel was left out of both modules. The source-copy
block now carries gpu/asm whole; tests/test_appimage_headers.py takes it for a host include of a kernel's declaration.

scripts/devtools/packs.py renderer_untouched took a host/ .c alone for the game's: a pack whose change was a host/asm
kernel, which only the game links, built and linked the renderer again. A host/asm .S is the game's alone now; a
header beside it, a gpu/asm kernel and a gpu/vk/asm kernel still build the renderer.

Assisted-by: Claude Code
tests/test_asm_kit.py records the commands tests/asm_kit.py would run, with no compiler: its CPU probe must read the
whole x86-64-v3 level (leaf 7, the extended leaf's LZCNT, the OS's ymm state through xgetbv) and a probe that crashed
must fail the check rather than read as a CPU without AVX2; two kernels of one name in two folders must be two
objects, natively and in the cross assembly, each linked once; a run with no clang found must fail instead of skipping
the cross assembly, an explicit clang must be the one used, and tests/test_asm_abi.py must take CXX without --cxx.

They fail on this commit: the probe reads AVX2, BMI2 and FMA alone and counts any exit but 0 as no AVX2, the objects
are named by the source's stem, a run without clang skips the cross assembly, and --cxx defaults to g++.

Assisted-by: Claude Code
tests/asm_kit.py ran the x86-64-v3 fixture where the CPU had AVX2, BMI2 and FMA, but a VM can mask MOVBE or LZCNT,
which the compiler emits at that level, and any exit of the probe but 0 read as no AVX2, a crash too. Its probe, built
for the baseline, now reads the whole level from CPUID (leaf 1, leaf 7, the extended leaf) and the OS's ymm state
(xgetbv), and an exit other than 0 or 1 fails the check.

The objects were named by the source's stem, so gpu/asm/hash.S and gpu/vk/asm/hash.S wrote one object and linked it
twice: each source's index is in its name now, natively and in the cross assembly.

Without clang on PATH the cross assembly (clang's assembler, the build's, for ELF and COFF) was skipped without a word,
and a CPU without AVX2 was then told its AVX2 bodies had been assembled. The clang is now the one given (--clang in
tests/test_asm_abi.py), else the one beside the compiler, else the one on PATH, and without one the check fails; its
PASS line names it. tests/test_asm_abi.py takes CXX when --cxx is not given. The unused os import is gone (Ruff F401).

Assisted-by: Claude Code
tests/test_asm_abi.py left the DWARF CFI unconsumed: removing the CFA adjustment after LSASM_ALLOC kept Linux green. A
Linux probe now stops in its body, with its scratch and padding in place, and calls the fixture, which unwinds from
there with the system's unwinder (_Unwind_Backtrace): the probe's frame must return to the harness's call, with rbx,
rbp and r12-r15 as the harness set them. A probe reads a table in LSASM_RODATA RIP-relative, so that macro is
assembled (ELF and COFF) and run.

On Windows each single step's unwind is now compared with the whole nonvolatile state of the entry: rsi, rdi and
xmm6-xmm15 as well in Win64, not the six other GPRs alone. A fault in a kernel is also taken by Windows' own dispatch
to a caller's __except, built with the game's -fms-extensions as guarded_copy is (clang; a gcc build says it skipped
this), besides the vectored handler that unwinds the one frame by hand.

Assisted-by: Claude Code
tests/asm_abi_probe.S calls a kernel of one argument on a stack that ends at its 32-byte home area, all a one-argument
Win64 call owes its callee, with the page above it left unreadable (tests/test_asm_abi.py, before any handler is set):
lsasm_probe_clobber and lsasm_probe_table must return their results there.

It fails on this commit: LSASM_ARGS reads the fifth and sixth slots on every call, so the first read lands in the
unreadable page.

Assisted-by: Claude Code
On Win64 LSASM_ARGS loaded the fifth and sixth arguments from the caller's stack on every call. A call of fewer owes
its callee the 32-byte home area alone, so the slots above it can lie past the stack's top. LSASM_ARGS now takes the
kernel's count of arguments (0 to 6; another count stops the assembly) and moves or loads only those: a one-argument
kernel reads no stack slot. The header says the mapping is for integer and pointer arguments; the probes give their
counts (6 for lsasm_probe_args, 1 for the others).

Assisted-by: Claude Code
tests/test_asm_build.py looked for asm_jobs' calls in main()'s text: it passed if a guard kept a call from running or
its jobs from a link list. main() now plans through plan_modules (nx2/build.py): the game's other jobs and the
renderer's in, the kernels joined (host/asm's and gpu/asm's to the game when it compiles the runtime, gpu/vk/asm's and
gpu/asm's to the renderer when it is built), RX_VK_ONLY's renderer-only jobs, and out the jobs and the two link lists
objs.rsp and vk_objs.rsp are written from. The build is the same as before; the kernels' jobs come after the game's
other jobs instead of after the runtime's files.

The test runs it on synthetic sources (two kernels in host/asm, one in gpu/asm, one of the same name in gpu/vk/asm)
and checks the compiled jobs and both modules' link inputs in full for a full build, a game-only build (no renderer
folder, as main() passes for RX_GAME_ONLY) and a renderer-only build (RX_VK_ONLY), and that main() plans and links
through it. tests/test_link_skip.py, test_renderer_depfiles.py and test_third_party_objects.py anchor on the planner's
line now, the lines they named being gone. docs/dev/reference/build.md names it.

Assisted-by: Claude Code
Importing nx2/build.py took the machine's build settings: RX_MARCH=native, or a CPU with x86-64-v3 and no RX_MARCH,
has clang say what -march=native is while the module loads, and RX_MARCH=native with no working clang stopped the
import before unittest started, in a check that says it runs no compiler. The test now imports it with the build's own
variables (RX_*, LONGSHOT_*, OOT_*) cleared and RX_MARCH=x86-64-v3, and with subprocess.Popen and os.system failing
while it loads: a process started by the import fails it instead of running. A test checks the CPU flags are the
fixed level's.

Assisted-by: Claude Code
hos_gpu_guest_ranges (host/nvdrv.c) sorts every GPU mapping's and native NVN pool's guest range by start before it
merges them, each time the mappings change: qsort with a comparison function call per compare. On x86-64 it now sorts
with host/asm/ranges.S's lsasm_sort_ranges, a hand-written merge sort on gpu/asm/lsasm.h: runs of 16 pairs by
insertion, then merges of runs twice as long a pass between the list and a second one (kept beside merged, grown with
it); two runs already in order (the mappings come mostly in address order) are copied, not merged, and the merge picks
its side with cmov, no branch. One body for both CPU levels: the pairs move in xmm registers. Other CPUs keep qsort
with cmp_range, under #if defined(__x86_64__). Both lists grow through hos_xrealloc (an allocation refused for 5 s
ends the run with the out-of-memory notice), where realloc's NULL was used as the list before.

It is stable where qsort is not: ranges that start together come out of qsort in any order, and the merge after the
sort makes the same ranges from any such order (one starts the merged range, the others only reach to their ends), so
the result is the same. No switch: the ranges merged are the same.

From 971f8074 on exp/x86-asm-sync, where the sort was collect.S's second kernel; here it is its own file. A
micro-benchmark there (i7-9700) found the kernel faster than qsort, more so in near order; not measured on this commit,
nor in play.

Test: tests/test_asm_ranges.py, through tests/asm_kit.py at SSE2 and AVX2, both conventions, clang ELF/COFF assembly:
the kernel against qsort with cmp_range (cut from the source) for 22 sizes around its runs and merges up to 10000 pairs
and 8 key patterns, between faulting pages: same order, stable, and hos_gpu_guest_ranges' merge makes the same ranges
from either order. The whole hos_gpu_guest_ranges, cut from the source, is compiled with its x86-64 test taken both
ways: the two give the same ranges for every case, one sorting with the kernel and the other with qsort, once a call.
scripts/profiling/cpu_functions.json describes lsasm_sort_ranges, and cmp_range as the other CPUs' comparison.

Assisted-by: Claude Code
The review asked for one shared kernel and one private kernel per module through a cold build, a cached rebuild after
an included file's rename, developer packs and the Linux AppImage's staging. tests/test_asm_end_to_end.py authors them
in a tree of its own (gpu/asm/e2e.S, host/asm/game.S, gpu/vk/asm/vk.S, each with an include, on the real lsasm.h) and
runs the build's own code on them with clang: plan_modules, plan_jobs with the hash record a build loads and saves,
compile_one on four threads (the shared kernel's two jobs at once), rekey_depfiles and main()'s own statements that
write the link lists. Each module's link list is linked with a caller and run, where this CPU runs x86-64-v3.

- a cold build compiles every kernel; a second build compiles nothing, nor does a new work folder made from its
  object cache (packs.link_objects), whose modules are the first's (module_changed);
- an include renamed while its kernel still names it compiles that kernel again and fails, as a clean build would; with
  the kernel naming the new file it compiles again, alone of the kernels;
- an include's edit compiles the kernels that read it, and its revert compiles nothing and links the cold build's
  objects, unchanged;
- packs one after another on one base (route, link_inputs_changed, renderer_untouched, link_objects, module_changed as
  cmd_pack runs them): a game kernel builds the game alone, a renderer kernel the renderer alone, a shared one both;
  each compiles the kernels that changed, and the base's objects and cache stay as they were;
- the AppImage's source-copy block, run with bash on the tree, carries the kernels and their includes, and a cold
  build of the staged tree compiles and links them.

nx2/build.py is imported as tests/test_asm_build.py imports it. The compiler is --cxx (CXX, else g++), clang beside it
(tests/asm_kit.py find_clang). The staging check needs bash: Git for Windows' on Windows, else it is skipped.

Assisted-by: Claude Code
compile_one hard-links each object into the object cache (cache_put), and links an object from the cache the same way;
a pack's work folder links the base's cache too (scripts/devtools/packs.py link_objects). clang's assembler, which
compiles the hand-written kernels (asm_jobs), writes its output in place (cc1as opens the -o path itself; clang's C and
C++ compiles write a temporary file and rename it over the object). A kernel compiled again therefore wrote through the
link: the cache's entry under the old key became the new object, and in a pack's work folder the base's cache entry and
its object did too. A build back at the old key (an edit reverted, a pack on that base) linked the edited kernel without
a word. compile_one now removes the object before it starts the compiler, so the compiler writes a new file and the
entries linked to the old one keep it. Every compile goes through it; for the C and C++ ones nothing changes, as their
compiler replaced the file anyway.

Test: tests/test_asm_end_to_end.py, which failed at the test commit: an include's edit and its revert linked the edited
kernel (the cache's entry under the cold build's key was the edited object), and a shared kernel's pack on a base wrote
into the base's objects and cache.

Assisted-by: Claude Code
The review: compile_one removes the old object but leaves its stamp (<object>.sha1) while clang's assembler writes the
new object in place. A build whose process tree is terminated during that write leaves part of an object under the old
stamp; once the edit is reverted the stamp matches the key again, and the first check (the object and its stamp) takes
the partial object before the object cache's valid entry is looked at.

tests/test_asm_end_to_end.py builds the kernels cold, edits the game kernel's include, and runs the next build with a
stand-in assembler for that kernel: a process that writes the first 64 bytes of the object at its own path and is
killed, and the build stops there (as its process tree terminated). The include is then reverted: the next build must
compile nothing and link the cold build's objects, unchanged, and the game's caller must give the cold build's values.

Assisted-by: Claude Code
The review: compile_one removed the object before it started the compiler but left its stamp (<object>.sha1). clang's
assembler, which compiles the hand-written kernels, writes its object in place, so a build whose process tree ended
during that write left part of an object under the old stamp. Once the edit was reverted the stamp matched the key
again, and the first check (the object and a stamp of its key) took the partial object before it looked in the object
cache, where the valid one is.

compile_one now removes the stamp as soon as it does not match: the object is replaced after that (linked from the
cache, or compiled), and only a finished one is stamped again. Without a stamp the next build links the cache's entry
or compiles again. The same holds for a link from the cache that stops before its stamp is written.

Test: tests/test_asm_end_to_end.py, test_a_stopped_replacement_and_its_revert, which failed at the test commit (the
revert linked the 64 bytes the stopped assembler had written).

Assisted-by: Claude Code
The review: main() sorts each compile's seconds into "renderer" or "host and game" by vk_job_objects, built from the
renderer's jobs before plan_modules joined the kernels to them (a new list), so a gpu/vk/asm or gpu/asm kernel of the
renderer was counted as host and game time.

tests/test_asm_build.py runs main()'s own statement (found in its syntax tree) on a plan of synthetic kernels: every
object the renderer links, its kernels included, is renderer time.

Assisted-by: Claude Code
vk_job_objects, by which main() counts each compile's seconds as renderer or host and game time, is now the set of the
renderer's link inputs plan_modules gives (vk_objs), its kernels included. It was built from the renderer's jobs before
the plan joined the kernels to them, so a renderer kernel was counted as host and game time.

Test: tests/test_asm_build.py, test_the_compile_time_breakdown_counts_the_renderer_kernels, which failed at the test
commit (vk_vk_draw.o alone was renderer time).

Assisted-by: Claude Code
The review: hos_gpu_guest_ranges grows the kernel's scratch list (one pair per range) through hos_xrealloc while it
holds the mapping lock. At the commit limit hos_xrealloc tries again for up to 5 s before the out-of-memory stop, and
every mapping change and lookup waits on the lock for as long.

tests/test_asm_ranges.py's fixture now holds a flag for the lock (LOCK, UNLOCK) and can refuse the scratch list: its
hos_xrealloc fails the check when asked for the sort's list while it is refused (the 5 s of tries), and the plain
realloc returns NULL. A call whose ranges outgrow every list the other cases grew, with the scratch refused, must sort
with qsort in place, not with the kernel, and leave the lock; the next call, with the scratch allowed, sorts with the
kernel, and both give the same ranges.

Assisted-by: Claude Code
fix(asm): a refused scratch list for the ranges' sort is not waited for with the mapping lock held
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
cffa2f46ba
hos_gpu_guest_ranges grew lsasm_sort_ranges' scratch list (one pair per range) through hos_xrealloc with the mapping
lock held: refused at the commit limit, hos_xrealloc tries again for up to 5 s before the out-of-memory stop, and every
mapping change and lookup waited on the lock as long. The list is only the sort's; the ranges can be sorted without it.

It now grows through plain realloc, with a capacity of its own. When it is refused the call sorts with qsort and
cmp_range in place (as other CPUs do), and the next change of the mappings asks for it again. The merged list still
grows through hos_xrealloc: the call cannot go on without it (on main its realloc's NULL was used as the list).

Test: tests/test_asm_ranges.py, which failed at the test commit (the refused scratch went through hos_xrealloc's tries
with the lock held).

Assisted-by: Claude Code
perf(vk): the small pools' capture ranges rebuilt in one x86-64 assembly pass
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
8df7cd73b1
- gpu/vk/asm/memory.S (memory.h): lsasm_pool_ranges keeps the host's pools of 1 to RX_VK_CAPTURE_POOL_MB bytes below
  1 TB, rounds them to whole pages and merges those that overlap or touch, in one branch-free pass over the list in
  address order (hos_gpu_pools gives its mappings that way); -1 when a pool starts below the open range or an end wraps.
- vk_memory.cpp: refresh_pool_ranges_locked takes that pass (pool_ranges: the kernel on x86-64, the same loop in C
  elsewhere) without RX_VK_CAPTURE_EAGER, in place of the copy, std::sort and merge; with it, or for a list the pass
  refuses, the path below runs as before. The version moves only when the ranges did, as before.
- Main's own part: #1553 (7daafa7a) already keeps no map of the pools' ages without RX_VK_CAPTURE_EAGER, which the
  branch's change also dropped; this is the pass that replaces the sort and merge.
- Not measured on this port: tests/test_asm_memory.py --bench (a micro-benchmark) timed the branch's code only, against
  its map, sort and merge; not against main's map-free refresh, nor in play.
- tests/test_asm_memory.py: pool_ranges (both branches) and refresh_pool_ranges_locked cut from the source against
  main's refresh and its sort and merge: lists by address with gaps, overlaps, touching and repeated starts, empty and
  too large pools, starts at and past 1 TB, lists out of order and ends that wrap, every list between pages that fault;
  120 runs of 200 refreshes with and without RX_VK_CAPTURE_EAGER. tests/test_capture_pool_refresh.py cuts pool_ranges
  with the refresh and runs it with the kernel and with the C loop.
- No switch. Only the pass of 12168bb8 (the retired pools' list is another change). Needs the hand-written kernels' kit
  (build(asm)) first.

Assisted-by: Claude Code
Author
Contributor

@Beanstalk This rebuilds the capture's ranges of small pools, when the pools change, with a hand-written x86-64 kernel (gpu/vk), mostly while loading. It sits on #1947 (cffa2f46, the asm kit), so its diff against its merge base includes that PR's commits; the farm cannot take it as the comparison, so please compare with main. No switch: a revert gives back main's code. Please start from the kokiri-start save and take the picture right after it loads and settles, before any input, with a main-against-itself picture on the same PC at that point; then, for frame times only, play Kokiri Forest for two minutes and go into Hyrule Field (one scene load) and play it for two minutes; at least two starts a side, interleaved, the PR against main on the same PC, on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; frame time p99 equal to main's or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line.

@Beanstalk This rebuilds the capture's ranges of small pools, when the pools change, with a hand-written x86-64 kernel (gpu/vk), mostly while loading. It sits on #1947 (cffa2f46, the asm kit), so its diff against its merge base includes that PR's commits; the farm cannot take it as the comparison, so please compare with main. No switch: a revert gives back main's code. Please start from the kokiri-start save and take the picture right after it loads and settles, before any input, with a main-against-itself picture on the same PC at that point; then, for frame times only, play Kokiri Forest for two minutes and go into Hyrule Field (one scene load) and play it for two minutes; at least two starts a side, interleaved, the PR against main on the same PC, on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; frame time p99 equal to main's or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line.
Member

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

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

Measurements: the micro-benchmark (trials script, run alone on this PC 2026-11-22, 3 rounds, SSE2 and AVX2): figures and Verdict

Measurements: the micro-benchmark (trials script, run alone on this PC 2026-11-22, 3 rounds, SSE2 and AVX2): figures and Verdict
Author
Contributor

@Beanstalk One correction to my request 69767 above, for its picture point: please take each picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between, and take the main-against-itself picture from the same point. A picture taken during the load's fade-in from black is not comparable: run 70269 on #2156 caught the fade in 3 of 4 starts.

@Beanstalk One correction to my request 69767 above, for its picture point: please take each picture 5 s (300 frames at 60 fps) after the first frame whose picture is not a single uniform colour, with no input in between, and take the main-against-itself picture from the same point. A picture taken during the load's fade-in from black is not comparable: run 70269 on #2156 caught the fade in 3 of 4 starts.
Member

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

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

@Beanstalk This replaces my request 69767 on this head and the corrections under it, in a form the farm can run: it cannot time a picture from the first frame that is not a uniform colour (its answer on #2131), so each picture here follows a fixed wait after the map event. This rebuilds the capture's ranges of small pools, when the pools change, with a hand-written x86-64 kernel (gpu/vk), mostly while loading. It sits on #1947 (cffa2f46, the asm kit), so its diff against its merge base includes that PR's commits; the farm cannot take it as the comparison, so please compare with main. No switch: a revert gives back main's code. Please start from the kokiri-start save and take the picture 10 s (600 frames at 60 fps) after the map event that ends the load, a fixed wait with no input in between (the farm cannot time it from the first frame that is not a uniform colour), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest for two minutes and go into Hyrule Field (one scene load) and play it for two minutes; at least two starts a side, interleaved, the PR against main on the same PC, on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; frame time p99 equal to main's or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line.

@Beanstalk This replaces my request 69767 on this head and the corrections under it, in a form the farm can run: it cannot time a picture from the first frame that is not a uniform colour (its answer on #2131), so each picture here follows a fixed wait after the map event. This rebuilds the capture's ranges of small pools, when the pools change, with a hand-written x86-64 kernel (gpu/vk), mostly while loading. It sits on #1947 (cffa2f46, the asm kit), so its diff against its merge base includes that PR's commits; the farm cannot take it as the comparison, so please compare with main. No switch: a revert gives back main's code. Please start from the kokiri-start save and take the picture 10 s (600 frames at 60 fps) after the map event that ends the load, a fixed wait with no input in between (the farm cannot time it from the first frame that is not a uniform colour), with a main-against-itself picture on the same PC from the same point; then, for frame times only, play Kokiri Forest for two minutes and go into Hyrule Field (one scene load) and play it for two minutes; at least two starts a side, interleaved, the PR against main on the same PC, on Windows with an RTX 4070, Windows with an Arc B580, Linux with an RX 6600 (RADV) and the Steam Deck. The same picture as main within main's own difference from itself; frame time p99 equal to main's or better, within the run-to-run spread. The log must have no FATAL, device lost or validation error line.
Member

@siantm only members of BigBeans can start the farm.

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

@siantm only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `8df7cd7`, and the PR has changed since (`4f97859`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
siantm force-pushed perf/asm-pool-ranges from 8df7cd73b1
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 4f9785931a
Some checks reported errors
PR description / Title and description (pull_request_target) Successful in 14s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia+gpu-rtx-4070 0/1 pass, 0 running, 1 queued
beanstalk/windows+intel+gpu-arc-b580 0/1 pass, 0 running, 1 queued
beanstalk/linux+radv+gpu-rx-6600 1/1 fail
beanstalk/steamdeck 1/1 fail
beanstalk/linux+nvidia 2/1 fail
beanstalk/linux+amd 2/1 pass
beanstalk/windows+amd 0/1 pass, 2 error
beanstalk/windows+intel 0/1 pass, 2 error
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-29 10:24:23 +00:00
Compare
siantm changed title from WIP: perf(vk): the small pools' capture ranges rebuilt in one x86-64 assembly pass to perf(vk): the small pools' capture ranges rebuilt in one x86-64 assembly pass 2026-11-29 10:37:26 +00:00
Author
Contributor

Rebased cleanly onto Rust-builder #1947 (b71bdb57, on main @ 01d6878b) -> 4f978593 and taking out of WIP.

Post-rebase verification on Windows 11 (llvm-mingw clang 23): tests/test_asm_memory.py passes (all 4 SSE2/AVX2 × native/sysv variants, 4,003 lists + 120×200 refreshes, 4 ELF/COFF clang assemblies), tests/test_capture_pool_refresh.py passes (asm + C), and gpu/vk/vk_memory.cpp syntax-checks cleanly. Positive in-play gain (-26% in loads, p = 0.002) and 3.2–7.1× micro-benchmark gain are in Measurements.

Rebased cleanly onto Rust-builder `#1947` (`b71bdb57`, on `main @ 01d6878b`) -> `4f978593` and taking out of WIP. Post-rebase verification on Windows 11 (`llvm-mingw clang 23`): `tests/test_asm_memory.py` passes (all 4 SSE2/AVX2 × native/sysv variants, 4,003 lists + 120×200 refreshes, 4 ELF/COFF clang assemblies), `tests/test_capture_pool_refresh.py` passes (asm + C), and `gpu/vk/vk_memory.cpp` syntax-checks cleanly. Positive in-play gain (`-26%` in loads, `p = 0.002`) and 3.2–7.1× micro-benchmark gain are in Measurements.
Owner

@review
@beanstalk

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

Commit 4f97859 · approved by HumanBean (reviewed) · dashboard

⚠️ Note: The farm compares with main, not the asm-kit parent, and cannot isolate the refresh routine's microbenchmark speedup, profiling share, or exact range correctness.
⚠️ Note: The requested compiler-specific unit tests and continuous two-minute gameplay routes cannot be run by this plan; the measured intervals follow brief scripted movement and are mostly stationary.
⚠️ Note: GPU model availability is inferred from online inventory; exact OS and driver combinations may still wait for matching testers.

Started at 2026-11-29 17:02 UTC.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
windows+nvidia+gpu-rtx-4070 (GPU "rtx 4070") ⏳ queued 1 1 — — none
windows+intel+gpu-arc-b580 (GPU "arc b580") ⏳ queued 1 1 — — none
linux+radv+gpu-rx-6600 (GPU "rx 6600") ❌ fail 1 1 25.6 → 25.6 (−0%) — none
steamdeck ❌ fail 2 1 2 34.3 → 31.7 (−7%) — none
linux+nvidia ❌ fail (an outlier) 2 1 2 18.0 → 20.8 (+15%) — none
linux+amd ✅ pass 2 1 2 27.3 → 29.8 (+9%) — none
windows+amd ⚠️ couldn't be judged 2 1 2 — — none
windows+intel ⚠️ couldn't be judged 2 1 2 — — none

Why it failed

  • linux+radv+gpu-rx-6600: build times (lift) build_s.max_delta_pct: 340.9 → 469.4 (+37.7%); limit 20.0
  • linux+radv+gpu-rx-6600: build times (lift) build_compile_s.max_delta_pct: 297.8 → 438.4 (+47.2%); limit 20.0
  • steamdeck: forest-and-field screenshot.max_diff: 0.7 → 0.7; limit 0.2
  • steamdeck: forest-and-field load_time_max_s.max_delta_pct: 1.2 → 6.4 (+455.2%); limit 30.0
  • linux+nvidia: forest-and-field field.frametime_p99_ms.max_delta_pct: 17.7 → 23.1 (+30.3%); limit 15.0
  • linux+nvidia: forest-and-field field.frametime_1pct_low_ms.max_delta_pct: 17.9 → 24.3 (+35.9%); limit 15.0
  • linux+nvidia: forest-and-field screenshot.max_diff: 0.7 → 0.7; limit 0.2

Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.

  • windows+nvidia+gpu-rtx-4070, report 1: every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)
  • windows+intel+gpu-arc-b580, report 1: every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)
  • steamdeck, report 2: main's longshot-builder failed (exit 1): Traceback (most recent call last):
  • windows+amd, report 1: every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)
  • windows+amd, report 2: every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)
  • windows+intel, report 1: every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)
  • windows+intel, report 2: every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)
What was tested

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

The plan compares the PR with main in Kokiri Forest and Hyrule Field across the requested GPUs, Steam Deck, and additional named OS and GPU combinations; the RTX 4070, Arc B580, and RX 6600 targets may wait for matching testers. Three interleaved starts per side include a settled Forest screenshot and two-minute frame-time measurements in each area, for about 56 minutes of game runs per tester. Timed lift builds also check for build regressions. A crash, fatal or Vulkan error, excessive screenshot difference, or a frame-time or build-time regression beyond the configured limits fails the PR. No tester online now matches windows+intel+gpu-arc-b580, linux+radv+gpu-rx-6600, linux+nvidia: those targets wait for one.

  • Where: windows+nvidia+gpu-rtx-4070 (GPU "rtx 4070", 1-2 reports), windows+intel+gpu-arc-b580 (GPU "arc b580", 1-2 reports), linux+radv+gpu-rx-6600 (GPU "rx 6600", 1-2 reports), steamdeck (1-2 reports), linux+nvidia (1-2 reports), linux+amd (1-2 reports), windows+amd (1-2 reports), windows+intel (1-2 reports).
  • forest-and-field: from the repository's save kokiri-start, then teleport to Kokiri Forest, take the picture forest-settled to compare with main, move the stick, measure forest for 2 min (after 10 s warm-up), teleport to Hyrule Field, take the picture field-settled to compare with main, measure field for 2 min (after 10 s warm-up); 3 runs on each side.
  • Build times: main and the PR each built 2 times, alternating, each whole in a fresh folder: the lift again (no kept lift, main's compiled objects kept); every stage timed (shader preparation is not), and the lifted code compared.
  • Measured: crashes, frame times, stutters and hitches, load times, the game's log.
  • The PR fails if: it crashes; or the whole build's time is more than 20% above main; or a picture differs from main by more than 20%; or the compile's time is more than 20% above main; or longest load is more than 30% above main; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or frame time (worst 1%) is more than 15% above main.
  • Time: about 58 min of game runs per tester (6 game starts), plus the two builds and 4 timed builds (about 80 min).
Measurements on `windows+nvidia+gpu-rtx-4070`, for the PR description

Verdict: queued on windows+nvidia+gpu-rtx-4070 (1 report).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 621.24.0 AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 78.9 —
lift · read (s) 1.4 —
lift · lift (s) 5.6 —
lift · compile (s) 68.9 —
lift · finish (s) 3.1 —
lift · lifted code main's not compared

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** queued on windows+nvidia+gpu-rtx-4070 (1 report).

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 78.9 | — |
| lift · read (s) | 1.4 | — |
| lift · lift (s) | 5.6 | — |
| lift · compile (s) | 68.9 | — |
| lift · finish (s) | 3.1 | — |
| lift · lifted code | main's | not compared |

**Flags and settings**

None: the plan varied no setting, switch or build option.
Measurements on `windows+intel+gpu-arc-b580`, for the PR description

Verdict: queued on windows+intel+gpu-arc-b580 (1 report).

Hardware: 1: windows+intel+intel-proprietary+dgpu+window Intel(R) Arc(TM) B580 Graphics, 0.406.983 12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 92.2 —
lift · read (s) 1.2 —
lift · lift (s) 6.1 —
lift · compile (s) 81.8 —
lift · finish (s) 3.1 —
lift · lifted code main's not compared

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** queued on windows+intel+gpu-arc-b580 (1 report).

Hardware: 1: windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 92.2 | — |
| lift · read (s) | 1.2 | — |
| lift · lift (s) | 6.1 | — |
| lift · compile (s) | 81.8 | — |
| lift · finish (s) | 3.1 | — |
| lift · lifted code | main's | not compared |

**Flags and settings**

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

Verdict: fail on linux+radv+gpu-rx-6600 (1 report): build times (lift) build_s.max_delta_pct (+37.7%); build times (lift) build_compile_s.max_delta_pct (+47.2%) failed.

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 6600 (RADV NAVI23), 26.3.1 AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 01d6878 After: this PR @ 4f97859
forest-and-field · longest load (s) 1.0 1.0 (+0%)
forest-and-field · field · frame time (p99) (ms) 25.6 25.6 (−0%)
forest-and-field · forest · frame time (p99) (ms) 28.2 28.3 (+0%)
forest-and-field · forbidden log lines 0.0 0.0
forest-and-field · field · frame time (worst 1%) (ms) 29.1 31.4 (+8%)
forest-and-field · forest · frame time (worst 1%) (ms) 31.7 32.4 (+2%)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 340.9 469.4 (+38%)
lift · read (s) 4.4 5.3 (+20%)
lift · lift (s) 18.8 7.3 (−61%)
lift · compile (s) 297.8 438.4 (+47%)
lift · finish (s) 19.9 18.4 (−8%)
lift · lifted code main's differs

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** fail on linux+radv+gpu-rx-6600 (1 report): `build times (lift) build_s.max_delta_pct (+37.7%)`; `build times (lift) build_compile_s.max_delta_pct (+47.2%)` failed.

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.3.1` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| forest-and-field · longest load (s) | 1.0 | 1.0 (+0%) |
| forest-and-field · field · frame time (p99) (ms) | 25.6 | 25.6 (−0%) |
| forest-and-field · forest · frame time (p99) (ms) | 28.2 | 28.3 (+0%) |
| forest-and-field · forbidden log lines | 0.0 | 0.0 |
| forest-and-field · field · frame time (worst 1%) (ms) | 29.1 | 31.4 (+8%) |
| forest-and-field · forest · frame time (worst 1%) (ms) | 31.7 | 32.4 (+2%) |

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 340.9 | 469.4 (+38%) |
| lift · read (s) | 4.4 | 5.3 (+20%) |
| lift · lift (s) | 18.8 | 7.3 (−61%) |
| lift · compile (s) | 297.8 | 438.4 (+47%) |
| lift · finish (s) | 19.9 | 18.4 (−8%) |
| lift · lifted code | main's | differs |

**Flags and settings**

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

Verdict: fail on steamdeck (2 reports): forest-and-field screenshot.max_diff; forest-and-field load_time_max_s.max_delta_pct (+455.2%) failed.

Hardware: 1: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM; 2: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 After: this PR @ 4f97859
forest-and-field · longest load (s) 1.2 6.4 (+455%)
forest-and-field · field · frame time (p99) (ms) 34.3 31.7 (−7%)
forest-and-field · forest · frame time (p99) (ms) 35.2 30.1 (−15%)
forest-and-field · forbidden log lines 0.0 0.0
forest-and-field · field · frame time (worst 1%) (ms) 35.5 34.9 (−2%)
forest-and-field · forest · frame time (worst 1%) (ms) 42.2 32.4 (−23%)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 200.7 213.6 (+6%)
lift · read (s) 2.2 2.3 (+5%)
lift · lift (s) 16.4 15.8 (−4%)
lift · compile (s) 179.1 193.0 (+8%)
lift · finish (s) 3.0 2.4 (−20%)
lift · lifted code main's differs

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** fail on steamdeck (2 reports): `forest-and-field screenshot.max_diff`; `forest-and-field load_time_max_s.max_delta_pct (+455.2%)` failed.

Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| forest-and-field · longest load (s) | 1.2 | 6.4 (+455%) |
| forest-and-field · field · frame time (p99) (ms) | 34.3 | 31.7 (−7%) |
| forest-and-field · forest · frame time (p99) (ms) | 35.2 | 30.1 (−15%) |
| forest-and-field · forbidden log lines | 0.0 | 0.0 |
| forest-and-field · field · frame time (worst 1%) (ms) | 35.5 | 34.9 (−2%) |
| forest-and-field · forest · frame time (worst 1%) (ms) | 42.2 | 32.4 (−23%) |

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 200.7 | 213.6 (+6%) |
| lift · read (s) | 2.2 | 2.3 (+5%) |
| lift · lift (s) | 16.4 | 15.8 (−4%) |
| lift · compile (s) | 179.1 | 193.0 (+8%) |
| lift · finish (s) | 3.0 | 2.4 (−20%) |
| lift · lifted code | main's | differs |

**Flags and settings**

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

Verdict: fail on linux+nvidia (2 reports): forest-and-field field.frametime_p99_ms.max_delta_pct (+30.3%); forest-and-field field.frametime_1pct_low_ms.max_delta_pct (+35.9%); forest-and-field screenshot.max_diff failed.

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.73.4 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1660 Ti, 620.73.4 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 After: this PR @ 4f97859
forest-and-field · longest load (s) 6.1 6.2 (+3%)
forest-and-field · field · frame time (p99) (ms) 18.0 20.8 (+15%)
forest-and-field · forest · frame time (p99) (ms) 18.7 18.5 (−1%)
forest-and-field · forbidden log lines 0.0 0.0
forest-and-field · field · frame time (worst 1%) (ms) 18.5 21.6 (+17%)
forest-and-field · forest · frame time (worst 1%) (ms) 19.3 19.3 (+0%)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 106.0 113.4 (+7%)
lift · read (s) 1.6 1.8 (+6%)
lift · lift (s) 9.1 9.1 (+1%)
lift · compile (s) 91.2 98.7 (+8%)
lift · finish (s) 4.0 3.9 (−4%)
lift · lifted code main's differs

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** fail on linux+nvidia (2 reports): `forest-and-field field.frametime_p99_ms.max_delta_pct (+30.3%)`; `forest-and-field field.frametime_1pct_low_ms.max_delta_pct (+35.9%)`; `forest-and-field screenshot.max_diff` failed.

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| forest-and-field · longest load (s) | 6.1 | 6.2 (+3%) |
| forest-and-field · field · frame time (p99) (ms) | 18.0 | 20.8 (+15%) |
| forest-and-field · forest · frame time (p99) (ms) | 18.7 | 18.5 (−1%) |
| forest-and-field · forbidden log lines | 0.0 | 0.0 |
| forest-and-field · field · frame time (worst 1%) (ms) | 18.5 | 21.6 (+17%) |
| forest-and-field · forest · frame time (worst 1%) (ms) | 19.3 | 19.3 (+0%) |

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 106.0 | 113.4 (+7%) |
| lift · read (s) | 1.6 | 1.8 (+6%) |
| lift · lift (s) | 9.1 | 9.1 (+1%) |
| lift · compile (s) | 91.2 | 98.7 (+8%) |
| lift · finish (s) | 4.0 | 3.9 (−4%) |
| lift · lifted code | main's | differs |

**Flags and settings**

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

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

Hardware: 1: linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 After: this PR @ 4f97859
forest-and-field · longest load (s) 1.1 1.1 (+1%)
forest-and-field · field · frame time (p99) (ms) 27.3 29.8 (+9%)
forest-and-field · forest · frame time (p99) (ms) 27.6 27.8 (+1%)
forest-and-field · forbidden log lines 0.0 0.0
forest-and-field · field · frame time (worst 1%) (ms) 28.6 31.2 (+9%)
forest-and-field · forest · frame time (worst 1%) (ms) 29.0 29.5 (+2%)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 47.8 49.8 (+4%)
lift · read (s) 1.2 1.2 (−4%)
lift · lift (s) 6.8 6.9 (+3%)
lift · compile (s) 38.5 40.3 (+5%)
lift · finish (s) 1.4 1.4 (+0%)
lift · lifted code main's differs

Flags and settings

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

As Markdown for the PR description:

## Measurements

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

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| forest-and-field · longest load (s) | 1.1 | 1.1 (+1%) |
| forest-and-field · field · frame time (p99) (ms) | 27.3 | 29.8 (+9%) |
| forest-and-field · forest · frame time (p99) (ms) | 27.6 | 27.8 (+1%) |
| forest-and-field · forbidden log lines | 0.0 | 0.0 |
| forest-and-field · field · frame time (worst 1%) (ms) | 28.6 | 31.2 (+9%) |
| forest-and-field · forest · frame time (worst 1%) (ms) | 29.0 | 29.5 (+2%) |

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 47.8 | 49.8 (+4%) |
| lift · read (s) | 1.2 | 1.2 (−4%) |
| lift · lift (s) | 6.8 | 6.9 (+3%) |
| lift · compile (s) | 38.5 | 40.3 (+5%) |
| lift · finish (s) | 1.4 | 1.4 (+0%) |
| lift · lifted code | main's | differs |

**Flags and settings**

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

Verdict: could not be judged on windows+amd (2 reports).

Hardware: 1: windows+amd+amd-proprietary+igpu+xess AMD Radeon(TM) Graphics, 2.0.279 AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM; 2: windows+amd+amd-proprietary+dgpu+xess AMD Radeon RX 6700 XT, 2.0.353 AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 236.2 —
lift · read (s) 1.9 —
lift · lift (s) 10.6 —
lift · compile (s) 219.4 —
lift · finish (s) 4.4 —
lift · lifted code main's not compared

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on windows+amd (2 reports).

Hardware: 1: windows+amd+amd-proprietary+igpu+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM`; 2: windows+amd+amd-proprietary+dgpu+xess `AMD Radeon RX 6700 XT, 2.0.353` `AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 236.2 | — |
| lift · read (s) | 1.9 | — |
| lift · lift (s) | 10.6 | — |
| lift · compile (s) | 219.4 | — |
| lift · finish (s) | 4.4 | — |
| lift · lifted code | main's | not compared |

**Flags and settings**

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

Verdict: could not be judged on windows+intel (2 reports).

Hardware: 1: windows+intel+intel-proprietary+igpu Intel(R) UHD Graphics 630, 0.404.2115 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM; 2: windows+intel+intel-proprietary+dgpu+window Intel(R) Arc(TM) B580 Graphics, 0.406.983 12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

Before: main @ 01d6878 After: this PR @ 4f97859
lift · whole build (s) 241.1 —
lift · read (s) 2.6 —
lift · lift (s) 10.6 —
lift · compile (s) 219.3 —
lift · finish (s) 8.6 —
lift · lifted code main's not compared

Flags and settings

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

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on windows+intel (2 reports).

Hardware: 1: windows+intel+intel-proprietary+igpu `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`; 2: windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM`  
Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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)

Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept))

| | Before: main @ 01d6878 | After: this PR @ 4f97859 |
|---|---|---|
| lift · whole build (s) | 241.1 | — |
| lift · read (s) | 2.6 | — |
| lift · lift (s) | 10.6 | — |
| lift · compile (s) | 219.3 | — |
| lift · finish (s) | 8.6 | — |
| lift · lifted code | main's | not compared |

**Flags and settings**

None: the plan varied no setting, switch or build option.
The testers' hardware
Target Report Ran on
windows+nvidia+gpu-rtx-4070 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 4070, 621.24.0 AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM
windows+intel+gpu-arc-b580 1 windows+intel+intel-proprietary+dgpu+window Intel(R) Arc(TM) B580 Graphics, 0.406.983 12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM
linux+radv+gpu-rx-6600 1 linux+amd+radv+dgpu AMD Radeon RX 6600 (RADV NAVI23), 26.3.1 AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM
steamdeck 1 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
steamdeck 2 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 16 GB RAM
linux+nvidia 1 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5070, 620.73.4 AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM
linux+nvidia 2 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1660 Ti, 620.73.4 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM
linux+amd 1 linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM
linux+amd 2 linux+amd+radv+dgpu AMD Radeon RX 9070 (RADV GFX1201), 26.0.8 AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM
windows+amd 1 windows+amd+amd-proprietary+igpu+xess AMD Radeon(TM) Graphics, 2.0.279 AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM
windows+amd 2 windows+amd+amd-proprietary+dgpu+xess AMD Radeon RX 6700 XT, 2.0.353 AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAM
windows+intel 1 windows+intel+intel-proprietary+igpu Intel(R) UHD Graphics 630, 0.404.2115 Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM
windows+intel 2 windows+intel+intel-proprietary+dgpu+window Intel(R) Arc(TM) B580 Graphics, 0.406.983 12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>4f97859</code> (the newer results are in a comment below)</summary> Commit `4f97859` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2135) ⚠️ **Note:** The farm compares with main, not the asm-kit parent, and cannot isolate the refresh routine's microbenchmark speedup, profiling share, or exact range correctness. ⚠️ **Note:** The requested compiler-specific unit tests and continuous two-minute gameplay routes cannot be run by this plan; the measured intervals follow brief scripted movement and are mostly stationary. ⚠️ **Note:** GPU model availability is inferred from online inventory; exact OS and driver combinations may still wait for matching testers. Started at 2026-11-29 17:02 UTC. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `windows+nvidia+gpu-rtx-4070` (GPU "rtx 4070") | ⏳ queued | 1 [1](https://beanstalk.magicbean.dev/reports/rp_7165d923feed8ce7) | — | — | none | | `windows+intel+gpu-arc-b580` (GPU "arc b580") | ⏳ queued | 1 [1](https://beanstalk.magicbean.dev/reports/rp_e39e8b9abb375d4a) | — | — | none | | `linux+radv+gpu-rx-6600` (GPU "rx 6600") | ❌ fail | 1 [1](https://beanstalk.magicbean.dev/reports/rp_72ef170925198bd8) | 25.6 → 25.6 (−0%) | — | none | | `steamdeck` | ❌ fail | 2 [1](https://beanstalk.magicbean.dev/reports/rp_c529c30654265d43) [2](https://beanstalk.magicbean.dev/reports/rp_2e7194e45176fead) | 34.3 → 31.7 (−7%) | — | none | | `linux+nvidia` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_830bc382391ac713) [2](https://beanstalk.magicbean.dev/reports/rp_0c68507847c7a9d2) | 18.0 → 20.8 (+15%) | — | none | | `linux+amd` | ✅ pass | 2 [1](https://beanstalk.magicbean.dev/reports/rp_e2be8d76a3f7bc8e) [2](https://beanstalk.magicbean.dev/reports/rp_881087f58c85f11c) | 27.3 → 29.8 (+9%) | — | none | | `windows+amd` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_916068f4f714517a) [2](https://beanstalk.magicbean.dev/reports/rp_9139b2ae916c7254) | — | — | none | | `windows+intel` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_9d3e19a0166e19cc) [2](https://beanstalk.magicbean.dev/reports/rp_7697057cb2212545) | — | — | none | **Why it failed** - `linux+radv+gpu-rx-6600`: `build times (lift)` `build_s.max_delta_pct`: `340.9 → 469.4 (+37.7%); limit 20.0` - `linux+radv+gpu-rx-6600`: `build times (lift)` `build_compile_s.max_delta_pct`: `297.8 → 438.4 (+47.2%); limit 20.0` - `steamdeck`: `forest-and-field` `screenshot.max_diff`: `0.7 → 0.7; limit 0.2` - `steamdeck`: `forest-and-field` `load_time_max_s.max_delta_pct`: `1.2 → 6.4 (+455.2%); limit 30.0` - `linux+nvidia`: `forest-and-field` `field.frametime_p99_ms.max_delta_pct`: `17.7 → 23.1 (+30.3%); limit 15.0` - `linux+nvidia`: `forest-and-field` `field.frametime_1pct_low_ms.max_delta_pct`: `17.9 → 24.3 (+35.9%); limit 15.0` - `linux+nvidia`: `forest-and-field` `screenshot.max_diff`: `0.7 → 0.7; limit 0.2` **Couldn't be judged**: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own. - `windows+nvidia+gpu-rtx-4070`, [report 1](https://beanstalk.magicbean.dev/reports/rp_7165d923feed8ce7): `every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)` - `windows+intel+gpu-arc-b580`, [report 1](https://beanstalk.magicbean.dev/reports/rp_e39e8b9abb375d4a): `every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)` - `steamdeck`, [report 2](https://beanstalk.magicbean.dev/reports/rp_2e7194e45176fead): `main's longshot-builder failed (exit 1): Traceback (most recent call last):` - `windows+amd`, [report 1](https://beanstalk.magicbean.dev/reports/rp_916068f4f714517a): `every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)` - `windows+amd`, [report 2](https://beanstalk.magicbean.dev/reports/rp_9139b2ae916c7254): `every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)` - `windows+intel`, [report 1](https://beanstalk.magicbean.dev/reports/rp_9d3e19a0166e19cc): `every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)` - `windows+intel`, [report 2](https://beanstalk.magicbean.dev/reports/rp_7697057cb2212545): `every timed build of the pull request (lift) failed: timed build 2 of the pull request (lift) failed (exit 1): 2 file(s) did not compile: ranges.S, memory.S (compile_failed)` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares the PR with main in Kokiri Forest and Hyrule Field across the requested GPUs, Steam Deck, and additional named OS and GPU combinations; the RTX 4070, Arc B580, and RX 6600 targets may wait for matching testers. Three interleaved starts per side include a settled Forest screenshot and two-minute frame-time measurements in each area, for about 56 minutes of game runs per tester. Timed lift builds also check for build regressions. A crash, fatal or Vulkan error, excessive screenshot difference, or a frame-time or build-time regression beyond the configured limits fails the PR. No tester online now matches windows+intel+gpu-arc-b580, linux+radv+gpu-rx-6600, linux+nvidia: those targets wait for one. - **Where:** windows+nvidia+gpu-rtx-4070 (GPU "rtx 4070", 1-2 reports), windows+intel+gpu-arc-b580 (GPU "arc b580", 1-2 reports), linux+radv+gpu-rx-6600 (GPU "rx 6600", 1-2 reports), steamdeck (1-2 reports), linux+nvidia (1-2 reports), linux+amd (1-2 reports), windows+amd (1-2 reports), windows+intel (1-2 reports). - **forest-and-field:** from the repository's save `kokiri-start`, then teleport to Kokiri Forest, take the picture forest-settled to compare with main, move the stick, measure forest for 2 min (after 10 s warm-up), teleport to Hyrule Field, take the picture field-settled to compare with main, measure field for 2 min (after 10 s warm-up); 3 runs on each side. - **Build times:** main and the PR each built 2 times, alternating, each whole in a fresh folder: the lift again (no kept lift, main's compiled objects kept); every stage timed (shader preparation is not), and the lifted code compared. - **Measured:** crashes, frame times, stutters and hitches, load times, the game's log. - **The PR fails if:** it crashes; or the whole build's time is more than 20% above main; or a picture differs from main by more than 20%; or the compile's time is more than 20% above main; or longest load is more than 30% above main; or frame time (p99) is more than 15% above main; or forbidden log lines is above 0; or frame time (worst 1%) is more than 15% above main. - **Time:** about 58 min of game runs per tester (6 game starts), plus the two builds and 4 timed builds (about 80 min). </details> <details><summary>Measurements on `windows+nvidia+gpu-rtx-4070`, for the PR description</summary> **Verdict:** queued on windows+nvidia+gpu-rtx-4070 (1 report). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 78.9 | — | | lift · read (s) | 1.4 | — | | lift · lift (s) | 5.6 | — | | lift · compile (s) | 68.9 | — | | lift · finish (s) | 3.1 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** queued on windows+nvidia+gpu-rtx-4070 (1 report). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 78.9 | — | | lift · read (s) | 1.4 | — | | lift · lift (s) | 5.6 | — | | lift · compile (s) | 68.9 | — | | lift · finish (s) | 3.1 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `windows+intel+gpu-arc-b580`, for the PR description</summary> **Verdict:** queued on windows+intel+gpu-arc-b580 (1 report). Hardware: 1: windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 92.2 | — | | lift · read (s) | 1.2 | — | | lift · lift (s) | 6.1 | — | | lift · compile (s) | 81.8 | — | | lift · finish (s) | 3.1 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** queued on windows+intel+gpu-arc-b580 (1 report). Hardware: 1: windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 92.2 | — | | lift · read (s) | 1.2 | — | | lift · lift (s) | 6.1 | — | | lift · compile (s) | 81.8 | — | | lift · finish (s) | 3.1 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `linux+radv+gpu-rx-6600`, for the PR description</summary> **Verdict:** fail on linux+radv+gpu-rx-6600 (1 report): `build times (lift) build_s.max_delta_pct (+37.7%)`; `build times (lift) build_compile_s.max_delta_pct (+47.2%)` failed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.3.1` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 1.0 | 1.0 (+0%) | | forest-and-field · field · frame time (p99) (ms) | 25.6 | 25.6 (−0%) | | forest-and-field · forest · frame time (p99) (ms) | 28.2 | 28.3 (+0%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 29.1 | 31.4 (+8%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 31.7 | 32.4 (+2%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 340.9 | 469.4 (+38%) | | lift · read (s) | 4.4 | 5.3 (+20%) | | lift · lift (s) | 18.8 | 7.3 (−61%) | | lift · compile (s) | 297.8 | 438.4 (+47%) | | lift · finish (s) | 19.9 | 18.4 (−8%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on linux+radv+gpu-rx-6600 (1 report): `build times (lift) build_s.max_delta_pct (+37.7%)`; `build times (lift) build_compile_s.max_delta_pct (+47.2%)` failed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.3.1` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 1.0 | 1.0 (+0%) | | forest-and-field · field · frame time (p99) (ms) | 25.6 | 25.6 (−0%) | | forest-and-field · forest · frame time (p99) (ms) | 28.2 | 28.3 (+0%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 29.1 | 31.4 (+8%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 31.7 | 32.4 (+2%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 340.9 | 469.4 (+38%) | | lift · read (s) | 4.4 | 5.3 (+20%) | | lift · lift (s) | 18.8 | 7.3 (−61%) | | lift · compile (s) | 297.8 | 438.4 (+47%) | | lift · finish (s) | 19.9 | 18.4 (−8%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `steamdeck`, for the PR description</summary> **Verdict:** fail on steamdeck (2 reports): `forest-and-field screenshot.max_diff`; `forest-and-field load_time_max_s.max_delta_pct (+455.2%)` failed. Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 1.2 | 6.4 (+455%) | | forest-and-field · field · frame time (p99) (ms) | 34.3 | 31.7 (−7%) | | forest-and-field · forest · frame time (p99) (ms) | 35.2 | 30.1 (−15%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 35.5 | 34.9 (−2%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 42.2 | 32.4 (−23%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 200.7 | 213.6 (+6%) | | lift · read (s) | 2.2 | 2.3 (+5%) | | lift · lift (s) | 16.4 | 15.8 (−4%) | | lift · compile (s) | 179.1 | 193.0 (+8%) | | lift · finish (s) | 3.0 | 2.4 (−20%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on steamdeck (2 reports): `forest-and-field screenshot.max_diff`; `forest-and-field load_time_max_s.max_delta_pct (+455.2%)` failed. Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 1.2 | 6.4 (+455%) | | forest-and-field · field · frame time (p99) (ms) | 34.3 | 31.7 (−7%) | | forest-and-field · forest · frame time (p99) (ms) | 35.2 | 30.1 (−15%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 35.5 | 34.9 (−2%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 42.2 | 32.4 (−23%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 200.7 | 213.6 (+6%) | | lift · read (s) | 2.2 | 2.3 (+5%) | | lift · lift (s) | 16.4 | 15.8 (−4%) | | lift · compile (s) | 179.1 | 193.0 (+8%) | | lift · finish (s) | 3.0 | 2.4 (−20%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `linux+nvidia`, for the PR description</summary> **Verdict:** fail on linux+nvidia (2 reports): `forest-and-field field.frametime_p99_ms.max_delta_pct (+30.3%)`; `forest-and-field field.frametime_1pct_low_ms.max_delta_pct (+35.9%)`; `forest-and-field screenshot.max_diff` failed. Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 6.1 | 6.2 (+3%) | | forest-and-field · field · frame time (p99) (ms) | 18.0 | 20.8 (+15%) | | forest-and-field · forest · frame time (p99) (ms) | 18.7 | 18.5 (−1%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 18.5 | 21.6 (+17%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 19.3 | 19.3 (+0%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 106.0 | 113.4 (+7%) | | lift · read (s) | 1.6 | 1.8 (+6%) | | lift · lift (s) | 9.1 | 9.1 (+1%) | | lift · compile (s) | 91.2 | 98.7 (+8%) | | lift · finish (s) | 4.0 | 3.9 (−4%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on linux+nvidia (2 reports): `forest-and-field field.frametime_p99_ms.max_delta_pct (+30.3%)`; `forest-and-field field.frametime_1pct_low_ms.max_delta_pct (+35.9%)`; `forest-and-field screenshot.max_diff` failed. Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 6.1 | 6.2 (+3%) | | forest-and-field · field · frame time (p99) (ms) | 18.0 | 20.8 (+15%) | | forest-and-field · forest · frame time (p99) (ms) | 18.7 | 18.5 (−1%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 18.5 | 21.6 (+17%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 19.3 | 19.3 (+0%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 106.0 | 113.4 (+7%) | | lift · read (s) | 1.6 | 1.8 (+6%) | | lift · lift (s) | 9.1 | 9.1 (+1%) | | lift · compile (s) | 91.2 | 98.7 (+8%) | | lift · finish (s) | 4.0 | 3.9 (−4%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `linux+amd`, for the PR description</summary> **Verdict:** pass on linux+amd (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 1.1 | 1.1 (+1%) | | forest-and-field · field · frame time (p99) (ms) | 27.3 | 29.8 (+9%) | | forest-and-field · forest · frame time (p99) (ms) | 27.6 | 27.8 (+1%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 28.6 | 31.2 (+9%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 29.0 | 29.5 (+2%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 47.8 | 49.8 (+4%) | | lift · read (s) | 1.2 | 1.2 (−4%) | | lift · lift (s) | 6.8 | 6.9 (+3%) | | lift · compile (s) | 38.5 | 40.3 (+5%) | | lift · finish (s) | 1.4 | 1.4 (+0%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on linux+amd (2 reports): no rule failed and no PR run crashed. Hardware: 1: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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 @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | forest-and-field · longest load (s) | 1.1 | 1.1 (+1%) | | forest-and-field · field · frame time (p99) (ms) | 27.3 | 29.8 (+9%) | | forest-and-field · forest · frame time (p99) (ms) | 27.6 | 27.8 (+1%) | | forest-and-field · forbidden log lines | 0.0 | 0.0 | | forest-and-field · field · frame time (worst 1%) (ms) | 28.6 | 31.2 (+9%) | | forest-and-field · forest · frame time (worst 1%) (ms) | 29.0 | 29.5 (+2%) | Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 47.8 | 49.8 (+4%) | | lift · read (s) | 1.2 | 1.2 (−4%) | | lift · lift (s) | 6.8 | 6.9 (+3%) | | lift · compile (s) | 38.5 | 40.3 (+5%) | | lift · finish (s) | 1.4 | 1.4 (+0%) | | lift · lifted code | main's | differs | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `windows+amd`, for the PR description</summary> **Verdict:** could not be judged on windows+amd (2 reports). Hardware: 1: windows+amd+amd-proprietary+igpu+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM`; 2: windows+amd+amd-proprietary+dgpu+xess `AMD Radeon RX 6700 XT, 2.0.353` `AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 236.2 | — | | lift · read (s) | 1.9 | — | | lift · lift (s) | 10.6 | — | | lift · compile (s) | 219.4 | — | | lift · finish (s) | 4.4 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on windows+amd (2 reports). Hardware: 1: windows+amd+amd-proprietary+igpu+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM`; 2: windows+amd+amd-proprietary+dgpu+xess `AMD Radeon RX 6700 XT, 2.0.353` `AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 236.2 | — | | lift · read (s) | 1.9 | — | | lift · lift (s) | 10.6 | — | | lift · compile (s) | 219.4 | — | | lift · finish (s) | 4.4 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>Measurements on `windows+intel`, for the PR description</summary> **Verdict:** could not be judged on windows+intel (2 reports). Hardware: 1: windows+intel+intel-proprietary+igpu `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`; 2: windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 241.1 | — | | lift · read (s) | 2.6 | — | | lift · lift (s) | 10.6 | — | | lift · compile (s) | 219.3 | — | | lift · finish (s) | 8.6 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on windows+intel (2 reports). Hardware: 1: windows+intel+intel-proprietary+igpu `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM`; 2: windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM` Scene: forest-and-field, 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); forest-and-field: 3 game starts a side, forest 120 s after 10 s warm-up, field 120 s after 10 s warm-up; timed builds: main and this PR each built 2 times a cache, alternating, each a whole build in a fresh folder (lift; shader preparation not timed); 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) Build times (each a median of the timed builds; caches: lift = the lift again (no kept lift, main's compiled objects kept)) | | Before: main @ 01d6878 | After: this PR @ 4f97859 | |---|---|---| | lift · whole build (s) | 241.1 | — | | lift · read (s) | 2.6 | — | | lift · lift (s) | 10.6 | — | | lift · compile (s) | 219.3 | — | | lift · finish (s) | 8.6 | — | | lift · lifted code | main's | not compared | **Flags and settings** None: the plan varied no setting, switch or build option. ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows+nvidia+gpu-rtx-4070` | [1](https://beanstalk.magicbean.dev/reports/rp_7165d923feed8ce7) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 4070, 621.24.0` `AMD Ryzen 9 7900X 12-Core Processor, 64 GB RAM` | | `windows+intel+gpu-arc-b580` | [1](https://beanstalk.magicbean.dev/reports/rp_e39e8b9abb375d4a) | windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM` | | `linux+radv+gpu-rx-6600` | [1](https://beanstalk.magicbean.dev/reports/rp_72ef170925198bd8) | linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.3.1` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM` | | `steamdeck` | [1](https://beanstalk.magicbean.dev/reports/rp_c529c30654265d43) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` | | `steamdeck` | [2](https://beanstalk.magicbean.dev/reports/rp_2e7194e45176fead) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 16 GB RAM` | | `linux+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_830bc382391ac713) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5070, 620.73.4` `AMD Ryzen 5 9600X 6-Core Processor, 32 GB RAM` | | `linux+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_0c68507847c7a9d2) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM` | | `linux+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_e2be8d76a3f7bc8e) | linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` | | `linux+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_881087f58c85f11c) | linux+amd+radv+dgpu `AMD Radeon RX 9070 (RADV GFX1201), 26.0.8` `AMD Ryzen 7 5800X 8-Core Processor, 32 GB RAM` | | `windows+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_916068f4f714517a) | windows+amd+amd-proprietary+igpu+xess `AMD Radeon(TM) Graphics, 2.0.279` `AMD Ryzen 5 5600G with Radeon Graphics, 28 GB RAM` | | `windows+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_9139b2ae916c7254) | windows+amd+amd-proprietary+dgpu+xess `AMD Radeon RX 6700 XT, 2.0.353` `AMD Ryzen 7 2700X Eight-Core Processor, 16 GB RAM` | | `windows+intel` | [1](https://beanstalk.magicbean.dev/reports/rp_9d3e19a0166e19cc) | windows+intel+intel-proprietary+igpu `Intel(R) UHD Graphics 630, 0.404.2115` `Intel(R) Core(TM) i3-8100 CPU @ 3.60GHz, 8 GB RAM` | | `windows+intel` | [2](https://beanstalk.magicbean.dev/reports/rp_7697057cb2212545) | windows+intel+intel-proprietary+dgpu+window `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `12th Gen Intel(R) Core(TM) i9-12900K, 32 GB RAM` | </details> </details>
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The range rebuild is faster in the reported Windows loading runs, but a player-visible gain has not been established and the current head has not completed the required hardware runs. The stacked host sort also needs its own measurement against main. Recommend approval; not approved on the forge.

The change replaces two range sorts with x86-64 assembly kernels and adds build and test support for them. The capture rebuild is faster on authored inputs and in the measured loading stage, at the cost of assembly maintenance and extra persistent scratch memory.

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

  • L1 gpu/vk/vk_memory.cpp:1679: The measured loading-stage saving has not yet shown a gain at player settings on the current head. (more on the line) Do: Run the proposed warmed, interleaved current-head comparison against the merged assembly-kit baseline at the display's native resolution, recording rebuild time, load time and frame-time distribution.
  • L2 host/nvdrv.c:216: The stacked host range sort has no separate in-game gain or cost measurement against main in this PR. (more on the line) Do: Measure the host range rebuild and player frame times against main on the stacked head, including memory use and clean and incremental build time.
  • L3 gpu/vk/asm/memory.S:16: The changed capture and host tracking paths still need their requested cross-platform game runs. (more on the line) Do: Complete the requested warmed, interleaved game runs and picture comparisons on those systems, checking frame times and logs against the appropriate baseline.

Checks: Still running: 10 checks.

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

Does it help: Unproven for players. On the author's Windows PC, the reported capture rebuild and lock stage fell 26% during loads across eight base and seven head runs; steady-play and frame-time improvements were within the runs' spread. Those builds predate the rebase, and the host sort is not separately measured against main in this PR.

Other systems: Both kernels affect CPU-side range tracking across GPU vendors and operating systems. Windows NVIDIA had one in-game comparison; Linux NVIDIA and AMD, Windows AMD and Intel, and Steam Deck runs are outstanding. The build also gains assembly compilation units; its clean and incremental build costs are not reported.

Switches: None added, changed or removed. RX_VK_CAPTURE_EAGER retains its existing default of off and selects the original capture refresh path when enabled.

Reviewed: 4f9785931a against 01d6878b3f: Read the repository rules, PR template, commits, assembly kernels and headers, changed refresh and host range code with surrounding callers, build integration diff, shared assembly test kit and capture tests. Skimmed the remaining ABI and sort fixtures, profiling metadata and build documentation; the full surrounding builder, host and renderer files were not read. docs/review-checklist.md was absent.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance; the diff adds no game-derived files or third-party changes.
  • The capture pass falls back to the original sort when it detects an unsuitable list, and the host enumerates mappings under its lock.
  • The assembly tests probe CPU and OS support before running the x86-64-v3 fixture.

Testing: No commands from the project were run, as required for this review. The author reports targeted Windows checks and one in-game comparison; CI is still running.

Overlaps and merge order: Depends on #1947; merge that assembly-kit PR first and compare this change against its merged head.


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

**Recommendation: Approve.** The code is ready: only testing is left. The range rebuild is faster in the reported Windows loading runs, but a player-visible gain has not been established and the current head has not completed the required hardware runs. The stacked host sort also needs its own measurement against main. Recommend approval; not approved on the forge. The change replaces two range sorts with x86-64 assembly kernels and adds build and test support for them. The capture rebuild is faster on authored inputs and in the measured loading stage, at the cost of assembly maintenance and extra persistent scratch memory. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `gpu/vk/vk_memory.cpp:1679`: The measured loading-stage saving has not yet shown a gain at player settings on the current head. (more on the line) **Do:** Run the proposed warmed, interleaved current-head comparison against the merged assembly-kit baseline at the display's native resolution, recording rebuild time, load time and frame-time distribution. - **L2** `host/nvdrv.c:216`: The stacked host range sort has no separate in-game gain or cost measurement against main in this PR. (more on the line) **Do:** Measure the host range rebuild and player frame times against main on the stacked head, including memory use and clean and incremental build time. - **L3** `gpu/vk/asm/memory.S:16`: The changed capture and host tracking paths still need their requested cross-platform game runs. (more on the line) **Do:** Complete the requested warmed, interleaved game runs and picture comparisons on those systems, checking frame times and logs against the appropriate baseline. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for players. On the author's Windows PC, the reported capture rebuild and lock stage fell 26% during loads across eight base and seven head runs; steady-play and frame-time improvements were within the runs' spread. Those builds predate the rebase, and the host sort is not separately measured against main in this PR. **Other systems:** Both kernels affect CPU-side range tracking across GPU vendors and operating systems. Windows NVIDIA had one in-game comparison; Linux NVIDIA and AMD, Windows AMD and Intel, and Steam Deck runs are outstanding. The build also gains assembly compilation units; its clean and incremental build costs are not reported. **Switches:** None added, changed or removed. RX_VK_CAPTURE_EAGER retains its existing default of off and selects the original capture refresh path when enabled. **Reviewed:** 4f9785931a17 against 01d6878b3f14: Read the repository rules, PR template, commits, assembly kernels and headers, changed refresh and host range code with surrounding callers, build integration diff, shared assembly test kit and capture tests. Skimmed the remaining ABI and sort fixtures, profiling metadata and build documentation; the full surrounding builder, host and renderer files were not read. docs/review-checklist.md was absent.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance; the diff adds no game-derived files or third-party changes. - The capture pass falls back to the original sort when it detects an unsuitable list, and the host enumerates mappings under its lock. - The assembly tests probe CPU and OS support before running the x86-64-v3 fixture. **Testing:** No commands from the project were run, as required for this review. The author reports targeted Windows checks and one in-game comparison; CI is still running. **Overlaps and merge order:** Depends on #1947; merge that assembly-kit PR first and compare this change against its merged head. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -0,0 +13,4 @@
The open range r8, r9, stored at [rax] every pool; r14 counts the pools out of order (a start below the open range's)
and the ends that wrapped */
LSASM_FUNC lsasm_pool_ranges
LSASM_ARGS 4
Member

L3 (should fix): The changed capture and host tracking paths still need their requested cross-platform game runs.

When: Only Windows NVIDIA has a reported in-game run; Linux NVIDIA and AMD, Windows AMD and Intel, and Steam Deck have no reported result for these paths.

Do: Complete the requested warmed, interleaved game runs and picture comparisons on those systems, checking frame times and logs against the appropriate baseline.

**L3** (should fix): The changed capture and host tracking paths still need their requested cross-platform game runs. *When:* Only Windows NVIDIA has a reported in-game run; Linux NVIDIA and AMD, Windows AMD and Intel, and Steam Deck have no reported result for these paths. **Do:** Complete the requested warmed, interleaved game runs and picture comparisons on those systems, checking frame times and logs against the appropriate baseline.
@ -1651,0 +1676,4 @@
if (!expiry && n >= 0) {
static std::vector<std::pair<uint64_t, uint64_t>> fresh;
fresh.resize((size_t)n);
const int64_t k = pool_ranges(list.data(), n, capture_pool_max(), fresh.data());
Member

L1 (should fix): The measured loading-stage saving has not yet shown a gain at player settings on the current head.

When: The reported Market comparison used the pre-rebase builds and a 30 Hz desktop; steady-play frame figures were within the spread, while capture time during loads increased 5.3%.

Do: Run the proposed warmed, interleaved current-head comparison against the merged assembly-kit baseline at the display's native resolution, recording rebuild time, load time and frame-time distribution.

**L1** (should fix): The measured loading-stage saving has not yet shown a gain at player settings on the current head. *When:* The reported Market comparison used the pre-rebase builds and a 30 Hz desktop; steady-play frame figures were within the spread, while capture time during loads increased 5.3%. **Do:** Run the proposed warmed, interleaved current-head comparison against the merged assembly-kit baseline at the display's native resolution, recording rebuild time, load time and frame-time distribution.
host/nvdrv.c Outdated
@ -197,0 +213,4 @@
uint64_t (*grown)[2] = (uint64_t (*)[2])realloc(sorting, (size_t)capmerged * sizeof *sorting);
if (grown) sorting = grown, capsorting = capmerged;
}
if (capsorting >= nall) lsasm_sort_ranges(merged, sorting, (size_t)nall);
Member

L2 (should fix): The stacked host range sort has no separate in-game gain or cost measurement against main in this PR.

When: Every changed mapping can trigger this sort under the host mapping lock, and the new scratch allocation persists; the capture-only comparison uses a baseline that already contains this change.

Do: Measure the host range rebuild and player frame times against main on the stacked head, including memory use and clean and incremental build time.

**L2** (should fix): The stacked host range sort has no separate in-game gain or cost measurement against main in this PR. *When:* Every changed mapping can trigger this sort under the host mapping lock, and the new scratch allocation persists; the capture-only comparison uses a baseline that already contains this change. **Do:** Measure the host range rebuild and player frame times against main on the stacked head, including memory use and clean and incremental build time.
Owner

Looks good!

Looks good!
Owner

Local test of 4f978593 (this PR, with #1947 under it) on Linux, RTX 3090 (driver 620.70.06). CPU-bound: output 1920x1080, Render resolution 100%, the game's own upscaler (none), frame generation and V-Sync off, uncapped. dev.py ab --scene market, 2 interleaved pairs, 45 s measured each, after a warm-up. Base main @ 01d6878b.

Tests

  • test_capture_pool_refresh.py passes (asm and C pool_ranges).
  • test_asm_memory.py does not compile on Linux with g++: asm_memory.cpp:219: no matching function for call to 'max(uint64_t&, long long unsigned int)' (uint64_t is unsigned long here). It is in the test's own C++ harness, not the kernel, but the check can't run on Linux until that line is fixed.

A/B (Market, child, crowded)

Run main (A) this PR (B) Δ
Pair 1 111.0 fps, 1% low 78.4, p99 12.76 ms 111.2 fps, 1% low 79.6, p99 12.56 ms +0.2%
Pair 2 109.0 fps, 1% low 74.1, p99 13.49 ms 111.8 fps, 1% low 76.9, p99 13.01 ms +2.6%
Median of the two runs 110.0 fps 111.5 fps +1.4%

B is ahead in both pairs, on fps, 1% low and p99, but the gap (+0.2% and +2.6%) is as large as the run-to-run spread, so this is no difference shown, leaning slightly positive. The change targets a small part of the capture refresh, so a gain this size is plausible and a larger one would be a surprise. No crash or cold frames. This is a main-against-branch comparison, so #1947's commits are in B too.

dev.py ab printed no write-up (it flagged four sim_turf_* options as differing between runs, "Load an area" in one; the same options file started every run, so a snapshot-timing quirk of the tool). The numbers are its per-run lines.

Not tested: Windows, AMD, Intel, the full mise run test.

Local test of `4f978593` (this PR, with #1947 under it) on Linux, RTX 3090 (driver 620.70.06). CPU-bound: output 1920x1080, Render resolution 100%, the game's own upscaler (none), frame generation and V-Sync off, uncapped. `dev.py ab --scene market`, 2 interleaved pairs, 45 s measured each, after a warm-up. Base `main` @ `01d6878b`. **Tests** - `test_capture_pool_refresh.py` passes (asm and C `pool_ranges`). - `test_asm_memory.py` does not compile on Linux with g++: `asm_memory.cpp:219: no matching function for call to 'max(uint64_t&, long long unsigned int)'` (`uint64_t` is `unsigned long` here). It is in the test's own C++ harness, not the kernel, but the check can't run on Linux until that line is fixed. **A/B (Market, child, crowded)** | Run | main (A) | this PR (B) | Δ | |---|---|---|---| | Pair 1 | 111.0 fps, 1% low 78.4, p99 12.76 ms | 111.2 fps, 1% low 79.6, p99 12.56 ms | +0.2% | | Pair 2 | 109.0 fps, 1% low 74.1, p99 13.49 ms | 111.8 fps, 1% low 76.9, p99 13.01 ms | +2.6% | | Median of the two runs | 110.0 fps | 111.5 fps | **+1.4%** | B is ahead in both pairs, on fps, 1% low and p99, but the gap (+0.2% and +2.6%) is as large as the run-to-run spread, so this is **no difference shown, leaning slightly positive**. The change targets a small part of the capture refresh, so a gain this size is plausible and a larger one would be a surprise. No crash or cold frames. This is a main-against-branch comparison, so #1947's commits are in B too. `dev.py ab` printed no write-up (it flagged four `sim_turf_*` options as differing between runs, "Load an area" in one; the same options file started every run, so a snapshot-timing quirk of the tool). The numbers are its per-run lines. **Not tested:** Windows, AMD, Intel, the full `mise run test`.
Owner

Retest with 8 interleaved pairs. 4f978593 (with #1947 under it) against main @ 01d6878b, Linux, RTX 3090 (driver 620.70.06). CPU-bound: output 1920x1080, Render resolution 100%, the game's own upscaler (none), uncapped, Market, 45 s measured a run.

Pair main (A) this PR (B) Δ
1 114.0 fps 112.9 -1.0%
2 113.6 113.7 +0.1%
3 114.5 114.5 0.0%
4 113.6 112.2 -1.2%
5 113.8 113.2 -0.5%
6 114.4 114.4 0.0%
7 107.7 111.8 +3.8%
8 104.9 112.5 +7.2%

Pairs 1 to 6 (the quiet part of the batch): no difference, the sides within 1.2% either way, medians 113.9 and 113.5 fps, 1% low and p99 mixed. Pairs 7 and 8 are where A dropped (107.7 and 104.9, with 2 cold frames in A8) while B stayed at 112; I read that as machine noise late in the batch (another job shares the queue), since B was 111.8 and 112.5, in the same range as every quiet run. Over all 8 pairs: medians A 113.7, B 113.1 (-0.6%); mean of the pair deltas +1.0%, but that is carried by the two noisy pairs.

So no fps gain shown, which is what the description expects: it puts the saving at about 4 us a frame in steady play (0.05% of this 8.7 ms frame) and the measurable gain in the loads (-26% in the rebuild's stage). I did not time the loads here, so I can't confirm or contradict that. A gain in frame time should not be expected from this PR in steady play. Not tested: the loads, Windows, AMD, Intel.

**Retest with 8 interleaved pairs.** `4f978593` (with #1947 under it) against `main` @ `01d6878b`, Linux, RTX 3090 (driver 620.70.06). CPU-bound: output 1920x1080, Render resolution 100%, the game's own upscaler (none), uncapped, Market, 45 s measured a run. | Pair | main (A) | this PR (B) | Δ | |---|---|---|---| | 1 | 114.0 fps | 112.9 | -1.0% | | 2 | 113.6 | 113.7 | +0.1% | | 3 | 114.5 | 114.5 | 0.0% | | 4 | 113.6 | 112.2 | -1.2% | | 5 | 113.8 | 113.2 | -0.5% | | 6 | 114.4 | 114.4 | 0.0% | | 7 | 107.7 | 111.8 | +3.8% | | 8 | 104.9 | 112.5 | +7.2% | **Pairs 1 to 6 (the quiet part of the batch): no difference**, the sides within 1.2% either way, medians 113.9 and 113.5 fps, 1% low and p99 mixed. **Pairs 7 and 8 are where A dropped** (107.7 and 104.9, with 2 cold frames in A8) while B stayed at 112; I read that as machine noise late in the batch (another job shares the queue), since B was 111.8 and 112.5, in the same range as every quiet run. Over all 8 pairs: medians A 113.7, B 113.1 (-0.6%); mean of the pair deltas +1.0%, but that is carried by the two noisy pairs. So **no fps gain shown**, which is what the description expects: it puts the saving at about 4 us a frame in steady play (0.05% of this 8.7 ms frame) and the measurable gain in the loads (-26% in the rebuild's stage). I did not time the loads here, so I can't confirm or contradict that. A gain in frame time should not be expected from this PR in steady play. Not tested: the loads, Windows, AMD, Intel.
siantm force-pushed perf/asm-pool-ranges from 4f9785931a
Some checks reported errors
PR description / Title and description (pull_request_target) Successful in 14s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia+gpu-rtx-4070 0/1 pass, 0 running, 1 queued
beanstalk/windows+intel+gpu-arc-b580 0/1 pass, 0 running, 1 queued
beanstalk/linux+radv+gpu-rx-6600 1/1 fail
beanstalk/steamdeck 1/1 fail
beanstalk/linux+nvidia 2/1 fail
beanstalk/linux+amd 2/1 pass
beanstalk/windows+amd 0/1 pass, 2 error
beanstalk/windows+intel 0/1 pass, 2 error
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 7701d41e73
Some checks are pending
beanstalk/approval changed since the request: ask again
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 4s
2026-12-03 18:35:13 +00:00
Compare
Member

Beanstalk test farm

Commit 7701d41 · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `7701d41` · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/2135) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Author
Contributor

Rebased onto main @ b4d56f52, on #1947's new head 057dfb77, and pushed as 7701d41e. Since the farm run on 4f978593 and HumanBean's tests:

Every Windows tester failed to compile the .S files: found, and fixed in #1947 (057dfb77). Every Windows report says 2 file(s) did not compile: ranges.S, memory.S (compile_failed), with no compiler line. Linux built the same commit. The cause is in Beanstalk's Windows sandbox:

  • The farm runs clang through a work drive (Z:\builder\tools\tools\llvm-mingw).
  • A .S compile is two jobs, preprocessing and then assembling (clang -### here shows clang-23.exe -cc1 -E … and clang-23.exe -cc1as …). Clang runs a compile of more than one job as child processes, started from its canonical, real folder.
  • Beanstalk's #166 found that the sandbox can't start a program from that real folder, because LLVM's start can't look up C:\Users. Beanstalk fixed this for ld.lld only, through llvm-mingw's config files.
  • A .c or .cpp is one job, which clang runs inside its own process. That is why only the .S files failed, and why the compiler printed nothing.

#1947's fix gives the .S units -no-canonical-prefixes, so the children start from the folder clang was started from. Beanstalk's docs/windows-clang.md notes that this argument passes in its sandbox.

What I checked here (Windows 11, i7-9700, llvm-mingw clang 23.1.5): host/asm/ranges.S and gpu/vk/asm/memory.S compile with the builder's flags plus -no-canonical-prefixes, for both x86_64-w64-mingw32 and x86_64-pc-windows-msvc: all 4 compiles exit 0. I can't run Beanstalk's sandbox here, so a farm run on this head is what confirms the Windows build. Until then, the Windows rows of the run on 4f978593 say nothing about this PR's code.

HumanBean's Linux g++ error in test_asm_memory.py (asm_memory.cpp:219, std::max(uint64_t&, unsigned long long)): fixed in 7701d41e (std::max<uint64_t>). I couldn't compile it with g++ on Linux here, so python3 -I -B tests/test_asm_memory.py --cxx g++ on Linux still needs a run.

The farm's other failures on 4f978593, from the reports:

  • linux+radv+gpu-rx-6600, build time +38 % / compile +47 %: the median of two builds a side, and the second pair was slow on both sides. main took 118.6 s and then 563.3 s, and the PR 129.6 s and then 809.2 s. The first pair is +9 %, with two more .S units in the PR. The second pair is that PC's load.
  • linux+nvidia, field p99 +30 %: one report (rp_830bc382). The farm flags it as disagreeing with its peer, which has +0.8 %.
  • Pictures (steamdeck, linux+nvidia, 0.7 → 0.7 in the sticky): on these testers main against itself already reaches 0.73 (Deck, forest shot) and 0.72 (second linux+nvidia report, forest shot). The PR's worst shots, 0.69 and 0.67 on the field shot, are inside that range. Its forest shots are 0.03 and 0.07.
  • steamdeck, load_time_max_s +455 %: per run, main took 4.36, 1.12 and 1.14 s, and the PR 1.18, 4.00 and 4.04 s. Both sides have loads of about 4 s, the PR two of its three and main one, so three runs a side can't tell the difference from the spread. The range rebuild does run during loads, so this one is worth a rerun with more starts: main against this head, load times per start.

Checks on this head (through the PC's job queue): python -I -B tests/run_all.py --changed origin/main reaches the whole suite, because #1947 changes the builder: 821 passed, 13 failed, 53 skipped (Linux-only checks, or spirv-val). Of the 13:

  • 3 are test_helpers_extract.py, test_i18n_complete.py and test_longshot_builder.py (they fail on main on this PC too).
  • 9 timed out with 8 checks at once beside another build. Run again with --exact … --jobs 2 on this head, all 9 pass, and so do the ones that timed out in #1947's own run.
  • The last is test_parity_gates.py's test_the_session_is_stopped, which fails the same way on main @ b4d56f52 run from the same drive ("path is on mount 'E:', start on mount 'C:'": the checkout is on E:, the temp folder on C:).
  • On #1947's head: dev.py cargo -- test --locked -p build-compile passes (exit 0) and cargo fmt --check -p build-compile is clean.

Still open (Testing before merging):

  • L1: the warmed, interleaved current-head comparison against #1947 at native resolution: rebuild time, load time, frame times.
  • L2: the host sort against main (host range rebuild, frame times, memory, build time).
  • L3: the cross-platform game runs and pictures.

I haven't run any of them: no game runs on this PC this round. HumanBean's 8 pairs on Linux / RTX 3090 show no fps difference in the Market, as the description expects, and didn't time the loads. A farm rerun on this head would give the Windows rows (L3) and more load-time starts. L1 and L2 need a person with a free GPU.

Rebased onto `main` @ b4d56f52, on #1947's new head 057dfb77, and pushed as 7701d41e. Since the farm run on 4f978593 and HumanBean's tests: **Every Windows tester failed to compile the `.S` files: found, and fixed in #1947 (057dfb77).** Every Windows report says `2 file(s) did not compile: ranges.S, memory.S (compile_failed)`, with no compiler line. Linux built the same commit. The cause is in Beanstalk's Windows sandbox: - The farm runs clang through a work drive (`Z:\builder\tools\tools\llvm-mingw`). - A `.S` compile is two jobs, preprocessing and then assembling (`clang -###` here shows `clang-23.exe -cc1 -E …` and `clang-23.exe -cc1as …`). Clang runs a compile of more than one job as child processes, started from its canonical, real folder. - Beanstalk's #166 found that the sandbox can't start a program from that real folder, because LLVM's start can't look up `C:\Users`. Beanstalk fixed this for `ld.lld` only, through llvm-mingw's config files. - A `.c` or `.cpp` is one job, which clang runs inside its own process. That is why only the `.S` files failed, and why the compiler printed nothing. #1947's fix gives the `.S` units `-no-canonical-prefixes`, so the children start from the folder clang was started from. Beanstalk's `docs/windows-clang.md` notes that this argument passes in its sandbox. What I checked here (Windows 11, i7-9700, llvm-mingw clang 23.1.5): `host/asm/ranges.S` and `gpu/vk/asm/memory.S` compile with the builder's flags plus `-no-canonical-prefixes`, for both `x86_64-w64-mingw32` and `x86_64-pc-windows-msvc`: all 4 compiles exit 0. I can't run Beanstalk's sandbox here, so a farm run on this head is what confirms the Windows build. Until then, the Windows rows of the run on 4f978593 say nothing about this PR's code. **HumanBean's Linux g++ error in `test_asm_memory.py`** (`asm_memory.cpp:219`, `std::max(uint64_t&, unsigned long long)`): fixed in 7701d41e (`std::max<uint64_t>`). I couldn't compile it with g++ on Linux here, so `python3 -I -B tests/test_asm_memory.py --cxx g++` on Linux still needs a run. **The farm's other failures on 4f978593**, from the reports: - `linux+radv+gpu-rx-6600`, build time +38 % / compile +47 %: the median of two builds a side, and the second pair was slow on both sides. `main` took 118.6 s and then 563.3 s, and the PR 129.6 s and then 809.2 s. The first pair is +9 %, with two more `.S` units in the PR. The second pair is that PC's load. - `linux+nvidia`, field p99 +30 %: one report (rp_830bc382). The farm flags it as disagreeing with its peer, which has +0.8 %. - Pictures (`steamdeck`, `linux+nvidia`, `0.7 → 0.7` in the sticky): on these testers `main` against itself already reaches 0.73 (Deck, forest shot) and 0.72 (second `linux+nvidia` report, forest shot). The PR's worst shots, 0.69 and 0.67 on the field shot, are inside that range. Its forest shots are 0.03 and 0.07. - `steamdeck`, `load_time_max_s` +455 %: per run, `main` took 4.36, 1.12 and 1.14 s, and the PR 1.18, 4.00 and 4.04 s. Both sides have loads of about 4 s, the PR two of its three and `main` one, so three runs a side can't tell the difference from the spread. The range rebuild does run during loads, so this one is worth a rerun with more starts: `main` against this head, load times per start. **Checks on this head** (through the PC's job queue): `python -I -B tests/run_all.py --changed origin/main` reaches the whole suite, because #1947 changes the builder: 821 passed, 13 failed, 53 skipped (Linux-only checks, or spirv-val). Of the 13: - 3 are `test_helpers_extract.py`, `test_i18n_complete.py` and `test_longshot_builder.py` (they fail on `main` on this PC too). - 9 timed out with 8 checks at once beside another build. Run again with `--exact … --jobs 2` on this head, all 9 pass, and so do the ones that timed out in #1947's own run. - The last is `test_parity_gates.py`'s `test_the_session_is_stopped`, which fails the same way on `main` @ b4d56f52 run from the same drive ("path is on mount 'E:', start on mount 'C:'": the checkout is on E:, the temp folder on C:). - On #1947's head: `dev.py cargo -- test --locked -p build-compile` passes (exit 0) and `cargo fmt --check -p build-compile` is clean. **Still open (Testing before merging):** - L1: the warmed, interleaved current-head comparison against #1947 at native resolution: rebuild time, load time, frame times. - L2: the host sort against `main` (host range rebuild, frame times, memory, build time). - L3: the cross-platform game runs and pictures. I haven't run any of them: no game runs on this PC this round. HumanBean's 8 pairs on Linux / RTX 3090 show no fps difference in the Market, as the description expects, and didn't time the loads. A farm rerun on this head would give the Windows rows (L3) and more load-time starts. L1 and L2 need a person with a free GPU.
dyst left a comment

Recommendation: Request changes. The one-pass rebuild is correct and faster than the sort, but the C loop already in this PR gets most of that gain without assembly. On top of that loop, the x86-64 kernel saves a few µs per rebuild, about 1 µs a frame at the rate counted in play. For that it adds a hand-written unit, in two ABIs, to every player's build, plus a dependency on #1947's .S build jobs, and the last farm run couldn't build those jobs on any Windows tester. Ship the C pass on every CPU and drop the kernel.

For a player: nothing visible. The renderer rebuilds its list of small-pool capture ranges a little faster, mostly while loading. The code gets better with the one-pass merge (no copy, std::sort and second merge for a list the host already gives by address). It doesn't get better with a second, assembly copy of that loop.

Does it help: Yes for the rebuild itself. Unproven, and not expected, for players. Micro-benchmark (author, i7-9700): 12.9–16.7 µs down to 3.7–4.1 µs at 1,465 pools for the kernel, and 3.5–7.7 µs for this PR's own C pass. In play (author, Market, 8 against 7 runs at 8df7cd73 over the kit): the rebuild+lock stage fell 26 % in the loads (p = 0.002). That is about 1.3 µs per submit. Frame figures sat within the spread. HumanBean's 8 interleaved pairs at 4f978593 (Linux, RTX 3090, Market) show no fps difference. The kernel's own share against the C pass is 0–4 µs per rebuild at 1,465 pools (the C pass is faster in two AVX2 rows) and ~12 µs at 6,000. At the one rebuild every 6 frames the diagnostic run counted, that is ≲ 2 µs a frame.

Other systems: the change runs on every CPU and GPU (CPU side, under cap_ranges_mu, in capture_make and capture_ranges_merged). Its riskiest effect is on the build, which runs on players' PCs. At 4f97859 every Windows farm tester failed to compile memory.S (and #1947's ranges.S). The fix (-no-canonical-prefixes) is in #1947's 057dfb77, and no farm run has confirmed it yet. Build time at 4f97859: linux+radv +38 % whole and +47 % compile (one report; the author reads the second pair as that PC's load, and the first pair as +9 %). It is unmeasured on this head.

Switches: none. RX_VK_CAPTURE_EAGER keeps the original path, as before.

Reviewed: 7701d41e7 against main b4d56f526. Read in full: this PR's two commits (gpu/vk/asm/memory.S, gpu/vk/asm/memory.h, pool_ranges and refresh_pool_ranges_locked in gpu/vk/vk_memory.cpp with both callers, tests/test_asm_memory.py, the tests/test_capture_pool_refresh.py diff); gpu/asm/lsasm.h (the macros this kernel uses); hos_gpu_pools and map_add in host/nvdrv.c; asm_units in builder/crates/build-compile/src/plan.rs. Not reviewed here, because they belong to #1947's review: #1947's own commits in this diff (host/asm/ranges.S, the host/nvdrv.c sort, the rest of plan.rs, the kit's tests). Nothing run.

Fixed in this review: nothing.

Checked and fine:

  • lsasm_pool_ranges matches the C loop and main's sort-and-merge:
    • size - 1 >= max, compared unsigned, drops both size 0 and size > max; start >> 40 drops starts past 1 TB.
    • Both round outward to pages the same way, and touching ranges merge.
    • The flag test is correct: sbb r14, -1 after cmp lo, hi counts a wrapped or empty range, and adc r14, 0 after cmp lo, r8 counts a start below the open range's start.
  • The -1 check is enough for correctness, not only a hint. Any list the pass accepts gives the canonical union, which is what sort-and-merge produces, so an out-of-order list it lets through still comes out right. check_pass asserts this.
  • Writes stay in bounds: rax moves at most 16 bytes per pool after the first one kept, so the room of n entries is never exceeded. An empty list, or one with nothing kept, returns 0 and writes nothing.
  • ABI:
    • LSASM_ARGS 4 moves rcx/rdx/r8/r9 into rdi/rsi/rdx/rcx in a safe order.
    • The pushes (7 on Win64, 5 on System V) leave rsp aligned without padding.
    • The kernel is a leaf with one epilogue, and its early exit jumps to it.
    • Every register it uses beyond the scratch ones is pushed.
  • hos_gpu_pools walks maps (kept sorted by va) and returns identity maps only, at most max. The list is therefore by address, and the fallback shouldn't run in play (0 of 640 rebuilds in the author's diagnostic run).
  • refresh_pool_ranges_locked:
    • The fast path is taken only without RX_VK_CAPTURE_EAGER.
    • When n < 0, the old path runs as before.
    • The version moves only when the ranges change.
    • Both callers hold cap_ranges_mu, which guards the static fresh.
  • The builder compiles gpu/vk/asm/*.S into the renderer (asm_units). There is no other build path left.
  • The tests compare both branches with main's original: 4,000 lists between faulting pages, and 120×200 refreshes with and without eager captures. test_capture_pool_refresh.py runs the refresh with both the kernel and the C loop. A divergence in the kernel would fail them.
  • No game data, third_party/ untouched, AI trailers present.

Blocking

  1. gpu/vk/vk_memory.cpp:1654 (pool_ranges) and gpu/vk/asm/memory.S: the kernel's gain over the C loop right below it is ≲ 2 µs a frame (figures above). That doesn't pay for a 100-line hand-written unit that must stay correct in two ABIs, or for putting one more .S compile into every player's build: the build that failed on every Windows farm tester last time. Fix: drop the #if x86-64 branch, memory.S/memory.h and the asm half of the tests, and keep the C pass for every CPU. The PR then no longer depends on #1947 and can merge on main by itself. To keep the kernel, show a gain over the C pass that a player could notice, together with a farm run that builds this head on Windows.
  2. Testing on the head: the in-game runs are at 8df7cd73 and 4f978593, not 7701d41e7. The only farm run (4f97859) built nothing on Windows. Tested still names 8df7cd73. After the change above, at least one in-game run on the new head plus a farm run, Tested updated to that head, and the build-time row re-read on it.

Suggestions

  • gpu/vk/vk_memory.cpp:1684: fresh.resize(n) zero-fills n - k_old entries on every rebuild (~1,400 at the counts above). The in-repo --bench times pool_ranges against a preallocated room, so it doesn't see that cost. A static room of list.size() entries, like list, avoids it: compare with std::equal(room, room + k, pool_cap_ranges.begin(), pool_cap_ranges.end()), then pool_cap_ranges.assign(room, room + k) and cap_ranges_ver++ only when the ranges differ.

Testing:

  • Author (Windows 11, i7-9700, RTX 4060): the two checks, and the run_all on this head (failures named and explained); the in-play A/B at 8df7cd73.
  • HumanBean (Linux, RTX 3090): an A/B at 4f978593, with no fps difference.
  • Farm at 4f97859: the Windows builds failed, and the Linux and Deck failures are read as noise.
  • Missing: any run on this head; the Windows build on the farm; test_asm_memory.py with g++ on Linux after 7701d41e7; the load-time rerun the author asks for.

Overlaps and merge order:

  • As it stands, this PR stacks on #1947 (its commits 4627366f1 and 057dfb77f are in this diff), so #1947 merges first. Without the kernel, this PR needs nothing first.
  • The siblings #2128, #2129 (capture copies), #2133 (FNV-1a), #2134 (mirror walk) and #2136 (swizzle) are separate kernels. None touches pool_ranges or refresh_pool_ranges_locked, so none is a duplicate.
  • #2128, #2129 and #2134 each add an #if x86-64 #include "asm/…" block at the same place in vk_memory.cpp's includes (line 56). Whichever merges second gets a simple textual conflict, resolved by keeping both.
**Recommendation: Request changes.** The one-pass rebuild is correct and faster than the sort, but the C loop already in this PR gets most of that gain without assembly. On top of that loop, the x86-64 kernel saves a few µs per rebuild, about 1 µs a frame at the rate counted in play. For that it adds a hand-written unit, in two ABIs, to every player's build, plus a dependency on #1947's `.S` build jobs, and the last farm run couldn't build those jobs on any Windows tester. Ship the C pass on every CPU and drop the kernel. For a player: nothing visible. The renderer rebuilds its list of small-pool capture ranges a little faster, mostly while loading. The code gets better with the one-pass merge (no copy, `std::sort` and second merge for a list the host already gives by address). It doesn't get better with a second, assembly copy of that loop. **Does it help:** Yes for the rebuild itself. Unproven, and not expected, for players. Micro-benchmark (author, i7-9700): 12.9–16.7 µs down to 3.7–4.1 µs at 1,465 pools for the kernel, and 3.5–7.7 µs for this PR's own C pass. In play (author, Market, 8 against 7 runs at 8df7cd73 over the kit): the rebuild+lock stage fell 26 % in the loads (p = 0.002). That is about 1.3 µs per submit. Frame figures sat within the spread. HumanBean's 8 interleaved pairs at 4f978593 (Linux, RTX 3090, Market) show no fps difference. The kernel's own share against the C pass is 0–4 µs per rebuild at 1,465 pools (the C pass is faster in two AVX2 rows) and ~12 µs at 6,000. At the one rebuild every 6 frames the diagnostic run counted, that is ≲ 2 µs a frame. **Other systems:** the change runs on every CPU and GPU (CPU side, under `cap_ranges_mu`, in `capture_make` and `capture_ranges_merged`). Its riskiest effect is on the build, which runs on players' PCs. At 4f97859 every Windows farm tester failed to compile `memory.S` (and #1947's `ranges.S`). The fix (`-no-canonical-prefixes`) is in #1947's 057dfb77, and no farm run has confirmed it yet. Build time at 4f97859: linux+radv +38 % whole and +47 % compile (one report; the author reads the second pair as that PC's load, and the first pair as +9 %). It is unmeasured on this head. **Switches:** none. `RX_VK_CAPTURE_EAGER` keeps the original path, as before. **Reviewed:** 7701d41e7 against main b4d56f526. Read in full: this PR's two commits (`gpu/vk/asm/memory.S`, `gpu/vk/asm/memory.h`, `pool_ranges` and `refresh_pool_ranges_locked` in `gpu/vk/vk_memory.cpp` with both callers, `tests/test_asm_memory.py`, the `tests/test_capture_pool_refresh.py` diff); `gpu/asm/lsasm.h` (the macros this kernel uses); `hos_gpu_pools` and `map_add` in `host/nvdrv.c`; `asm_units` in `builder/crates/build-compile/src/plan.rs`. Not reviewed here, because they belong to #1947's review: #1947's own commits in this diff (`host/asm/ranges.S`, the `host/nvdrv.c` sort, the rest of `plan.rs`, the kit's tests). Nothing run. **Fixed in this review:** nothing. **Checked and fine:** - `lsasm_pool_ranges` matches the C loop and main's sort-and-merge: - `size - 1 >= max`, compared unsigned, drops both size 0 and size > max; `start >> 40` drops starts past 1 TB. - Both round outward to pages the same way, and touching ranges merge. - The flag test is correct: `sbb r14, -1` after `cmp lo, hi` counts a wrapped or empty range, and `adc r14, 0` after `cmp lo, r8` counts a start below the open range's start. - The -1 check is enough for correctness, not only a hint. Any list the pass accepts gives the canonical union, which is what sort-and-merge produces, so an out-of-order list it lets through still comes out right. `check_pass` asserts this. - Writes stay in bounds: `rax` moves at most 16 bytes per pool after the first one kept, so the room of `n` entries is never exceeded. An empty list, or one with nothing kept, returns 0 and writes nothing. - ABI: - `LSASM_ARGS 4` moves rcx/rdx/r8/r9 into rdi/rsi/rdx/rcx in a safe order. - The pushes (7 on Win64, 5 on System V) leave rsp aligned without padding. - The kernel is a leaf with one epilogue, and its early exit jumps to it. - Every register it uses beyond the scratch ones is pushed. - `hos_gpu_pools` walks `maps` (kept sorted by va) and returns identity maps only, at most `max`. The list is therefore by address, and the fallback shouldn't run in play (0 of 640 rebuilds in the author's diagnostic run). - `refresh_pool_ranges_locked`: - The fast path is taken only without `RX_VK_CAPTURE_EAGER`. - When `n < 0`, the old path runs as before. - The version moves only when the ranges change. - Both callers hold `cap_ranges_mu`, which guards the static `fresh`. - The builder compiles `gpu/vk/asm/*.S` into the renderer (`asm_units`). There is no other build path left. - The tests compare both branches with main's original: 4,000 lists between faulting pages, and 120×200 refreshes with and without eager captures. `test_capture_pool_refresh.py` runs the refresh with both the kernel and the C loop. A divergence in the kernel would fail them. - No game data, `third_party/` untouched, AI trailers present. **Blocking** 1. `gpu/vk/vk_memory.cpp:1654` (`pool_ranges`) and `gpu/vk/asm/memory.S`: the kernel's gain over the C loop right below it is ≲ 2 µs a frame (figures above). That doesn't pay for a 100-line hand-written unit that must stay correct in two ABIs, or for putting one more `.S` compile into every player's build: the build that failed on every Windows farm tester last time. Fix: drop the `#if` x86-64 branch, `memory.S`/`memory.h` and the asm half of the tests, and keep the C pass for every CPU. The PR then no longer depends on #1947 and can merge on main by itself. To keep the kernel, show a gain over the C pass that a player could notice, together with a farm run that builds this head on Windows. 2. Testing on the head: the in-game runs are at 8df7cd73 and 4f978593, not 7701d41e7. The only farm run (4f97859) built nothing on Windows. *Tested* still names 8df7cd73. After the change above, at least one in-game run on the new head plus a farm run, *Tested* updated to that head, and the build-time row re-read on it. **Suggestions** - `gpu/vk/vk_memory.cpp:1684`: `fresh.resize(n)` zero-fills `n - k_old` entries on every rebuild (~1,400 at the counts above). The in-repo `--bench` times `pool_ranges` against a preallocated room, so it doesn't see that cost. A static room of `list.size()` entries, like `list`, avoids it: compare with `std::equal(room, room + k, pool_cap_ranges.begin(), pool_cap_ranges.end())`, then `pool_cap_ranges.assign(room, room + k)` and `cap_ranges_ver++` only when the ranges differ. **Testing:** - Author (Windows 11, i7-9700, RTX 4060): the two checks, and the run_all on this head (failures named and explained); the in-play A/B at 8df7cd73. - HumanBean (Linux, RTX 3090): an A/B at 4f978593, with no fps difference. - Farm at 4f97859: the Windows builds failed, and the Linux and Deck failures are read as noise. - Missing: any run on this head; the Windows build on the farm; `test_asm_memory.py` with g++ on Linux after 7701d41e7; the load-time rerun the author asks for. **Overlaps and merge order:** - As it stands, this PR stacks on #1947 (its commits 4627366f1 and 057dfb77f are in this diff), so #1947 merges first. Without the kernel, this PR needs nothing first. - The siblings #2128, #2129 (capture copies), #2133 (FNV-1a), #2134 (mirror walk) and #2136 (swizzle) are separate kernels. None touches `pool_ranges` or `refresh_pool_ranges_locked`, so none is a duplicate. - #2128, #2129 and #2134 each add an `#if x86-64 #include "asm/…"` block at the same place in `vk_memory.cpp`'s includes (line 56). Whichever merges second gets a simple textual conflict, resolved by keeping both.
Some checks are pending
beanstalk/approval changed since the request: ask again
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 4s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/asm-pool-ranges:siantm-perf/asm-pool-ranges'
git switch 'siantm-perf/asm-pool-ranges'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2135
No description provided.