perf(vk): render targets take a pooled image's memory by size, and the pool holds longer on integrated GPUs #1681

Merged
HumanBean merged 8 commits from zeldaootr/Longshot:vk-target-reuse-memory into main 2026-11-20 22:25:51 +00:00
Contributor

Summary

On a Steam Deck, turning the camera in Hyrule Field spends time asking the system for fresh memory for the game's shadow maps, which change size a little every frame, while a nearly identical one was just set aside. A render target of a size not seen before was always a new allocation (on the Deck, a kernel call that compacts memory and can swap), while the pool let go of a nearly matching image after 8 frames. This PR lets such a target take the memory of a pooled image it fits in (up to 1.5 times its size); on integrated GPUs the pool keeps its images 64 frames instead of 8 and makes these targets' memory a size class larger (at most a quarter more), so the next one fits; and a render target the pool's memory type cannot serve is made outside it. Discrete GPUs keep the 8-frame hold and get no size classes (only the take by size); the exact-match pool, its byte cap and its pressure rules, and standing fps do not change.

The result: on a Steam Deck OLED at Render 50% the turn runs about 1 fps faster with fewer long frames, as on a second Deck OLED (dukenheimer); at Render 100% six runs a side don't separate it from main, and on a Steam Deck LCD (omgitsgela) no fps win was shown in any cell. It helps where the host, not the GPU, sets the frame rate, and is neutral elsewhere.

Why: on a Steam Deck OLED in Hyrule Field with the camera panning, the replay thread spent about 3.2 ms a frame in VMA's block allocations (a kernel call that failed direct compaction about 29 times a second and pushed the game's memory to swap), and 92% of those were render targets made new after the pool's exact match missed. OoT sizes each nearby character's shadow map anew every frame, so its pool key never recurs, while an image of nearly the same size was just retired. The swap during turns was first reported in the Deck performance issue, #1477. Prior art: the pool's 8-present hold came from #1255, and the shadow maps' storage buckets from #1256. The tracker was searched for render targets, allocation, swap, compaction and turning stutter. Turning stutter in Hyrule Field on discrete NVIDIA cards (#1406, #1111) may share part of the cause, but there this PR only adds the take by size at the 8-frame hold, and it has not run on such a card: those issues are not claimed.

Read first:

  • vk (fix): create_image puts a render target in the targets' VMA pool only when the pool's memory type is among the image's memoryTypeBits (target_pool_takes, gpu/vk/vk_vma.cpp); VMA does not check this for a custom pool. The requirements come from vkGetDeviceImageMemoryRequirements (Vulkan 1.3, loaded with the optional device functions), asked once a texture (ImageNeed, gpu/vk/vk_internal.h).
  • vk: pool_take_memory (gpu/vk/vk_texture.cpp), tried in create only after pool_take misses: the fit rule is target_pool::verdict (gpu/vk/target_pool.h): a usable, device-local memory type, an aligned offset, at least the size and at most 1.5 times it, only allocations create_image tagged as the targets' blocks (VMA never makes dedicated memory there); the wait is takeable_by_size. The new image is bound with vmaCreateAliasingImage; the pooled image and its views are destroyed as pool_destroy does (the pool holds only images whose GPU work completed). The image starts UNDEFINED and is cleared as a new one is; it is counted at its allocation's size.
  • vk: the pool's hold, target_pool::idle_presents: 64 presents on an integrated GPU while the take is on, 8 otherwise; RX_VK_POOL_IDLE still sets it.
  • vk: counters: the status line's reused by size and missed after their image was taken by size, and a second line every 600 presents, render targets not reused by size:, with each miss's reason (target_pool::Miss) and what the pool let go of over its bound and idle.
  • vk (=2, the default on integrated GPUs): target_pool::class_bytes, create_image_in_class (gpu/vk/vk_vma.cpp), and the pool's index by memory type and class (by_class, pool_unindex).
  • tests: tests/test_target_reuse_memory.py (new: rules compiled from the header; pool_take_memory, pool_take, pool_put, pool_trim compiled from the source with stubs, the dead queue made unreadable to them); tests/test_target_image_pool.py (the memory-type check; create_image's new argument); tests/test_dead_targets_sweep.py (the hold's default); tests/test_target_image_reuse.py.
  • docs: the RX_VK_TARGET_REUSE_MEMORY row in the Memory table of docs/dev/reference/switches.md (main's revamp removed docs/development.md, where it was); the rows of RX_VK_TARGET_REUSE_MEMORY and RX_VK_POOL_IDLE in gpu/vk/switches.def.

See #1477

Testing

Tested: this PR's code at 540f552de on my Steam Deck OLED (the setup in Measurements): 30 runs at Render 50% and 100%, interleaved with main 38990574a, all exiting normally with no error, validation or device-lost line in the log; the status line printed the level each arm asked for (2 by default, 1 and 0 when set). Pictures by eye at this code: the Field after the turn (Render 50%, R1 against main's C1) and Kokiri Forest standing (Render 100%, R3): nothing missing or misdrawn; the after-turn views differ only by where the camera stopped. Earlier builds of this change ran 23 more runs on the same Deck with the same result.

Independently, on a second Steam Deck OLED, dukenheimer at 540f552d (#1681 (comment), #1681 (comment)): the turn faster, no R-only picture fault in 636 frames inspected at full resolution, 0 frames flagged by a per-present flash detector over every present, no crash, device loss or validation error (Measurements).

On a Steam Deck LCD, omgitsgela ran this PR with the switch off against the default in one binary, in three areas (#1477, their comments of 2026-11-19 21:05 and 21:07). Their reading, which I agree with: no demonstrated fps win in any cell, and not proof of no effect. The one pair per cell that passed their scene-match gate: Hyrule Field median 39.93 ms with the default against 40.04 off (p99 -11.0 ms, 22 fewer frames over 50 ms, inside their A/A floor); Castle Town 43.64 against 42.42 (the default slightly behind); Kokiri gave no admitted pair.

The renderer built for Windows at the earlier rebased head: RX_TARGET=windows RX_MARCH=x86-64-v3 RX_VK_ONLY=1 python3 -I nx2/build.py --standalone with llvm-mingw 20261104 (UCRT): 213 files compiled, 0 failed, longshot_vk.dll linked (PE32+ x86-64 DLL); on Linux the same renderer build with clang, 214 files, 0 failed, longshot_vk.so linked; tests/test_utf8_paths.py with LONGSHOT_MINGW set passes (the probe built for Windows). At this head, gpu/vk/vk_texture.cpp and gpu/vk/vk_vma.cpp with -fsyntax-only for Linux (clang) and Windows (llvm-mingw): no errors, as on main 068fb8ebe.

Game-free on Linux x86-64, in the PC's job queue, at this head (742b053ae on main 068fb8ebe): the 116 checks that read its files (run_all.py --changed forge/main): 100 passed, 16 failed, 1 skipped (Windows-only), the 16 failing on main too; and the whole python3 -I -B tests/run_all.py (not --strict) here and on main 068fb8ebe in the same environment: 73 fail on both (this PC's environment: missing tools and modules, timing). 12 more failed here in a run shared with two other full suites and each passed when run again alone (nx2/test_coop_spirv.py, nx2/test_default_point_size.py, nx2/test_draw_parameters.py, nx2/test_mesh_first_types.py, nx2/test_spirv_struct_identity.py, test_appimage_package_retry, test_fpx_sticky, test_mesh_fallback_layout, test_mesh_unreachable_outputs, test_pipeline_cache_file, test_pipeline_cache_save, test_pipeline_state_sources). The new checks fail at their test-only commits and pass here: tests/test_target_image_pool.py at 9ddf2389a (2 of 10 fail), tests/test_target_reuse_memory.py at 739fec485.

The 73 checks that fail both here (742b053ae) and on main 068fb8ebe

nx2/test_nup_codec.py, nx2/test_nup_read_name.py, nx2/test_nup_stand_in.py, nx2/test_nup_verify.py, test_appimage_player_build, test_bug_report_defaults, test_capture_read_once, test_capture_readback_visibility, test_crash_dialog, test_crt_options, test_damage_debug_menu, test_dav1d_av1, test_dev_ab, test_dev_packs, test_discover, test_display_startup_failure, test_dlss_feature_size, test_draw_stream_visibility, test_failed_compile_keeps_objects, test_frame_overlap, test_fsr3fi_hud_layer, test_fsr_image_retirement, test_fsr_uniform_ownership, test_guest_imported, test_high_fps_fixes, test_host_guest_writes, test_hud_layout_row, test_insn_fixed_convert, test_libc_hooks, test_lift_cache, test_lift_lookups, test_linux_preflight, test_linux_pressure, test_linux_tools, test_linux_update, test_log_open_failure, test_make_game_cache, test_make_game_ngx, test_mise_build, test_missing_nup, test_mods_list, test_mods_size_table, test_native_zstd, test_ngx_sdk, test_nonuniform_image_arrays, test_parallel_init_order, test_pending_guest_import, test_pipeline_play_cache, test_prepare_cache_save, test_prepare_stall, test_present_queue_default, test_present_source_crop, test_present_thread, test_profiling_mode, test_prompt_guide_lines, test_prompt_hand_guides, test_prompt_picture_tint, test_prompt_speed, test_psychov35_fsr3_fg, test_readback_timeout_source, test_recorder_sync, test_replay_write_order, test_slow_frames, test_song_note_cue, test_staging_burst, test_texel_buffer_ownership, test_thinlto_tls, test_upscaler_rows, test_vbytes, test_vcore_escape, test_vk_occlusion_queries, test_walk, test_walk_key

A driver whose depth or multisampled images exclude the targets' pool's memory type (none known on hand) can't be run by hand: the memory-type check is covered by tests/test_target_image_pool.py. Not run: Intel's Mesa defaults that main gained since the measurement (#1586) together with this change; this head in the game (its code is the measured code, see Measurements).

Still to test:

  • Windows, any GPU: start the game, walk into Hyrule Field and turn the camera a full circle several times, expecting no corruption in shadows or elsewhere, no device loss, and the log's render target images: line with reused by size above 0 (@Beanstalk windows, Hyrule Field camera turn)
  • A discrete NVIDIA card and a discrete AMD card (Linux or Windows): the same turn, expecting the same, the level printed as 1 and the pool's hold still 8 presents (@Beanstalk nvidia and @Beanstalk amd, Hyrule Field camera turn)
  • An integrated GPU other than the Steam Deck (an AMD APU, Intel): the same turn, expecting no picture fault and the turn's fps no worse than main's (by hand)

Measurements

Verdict: it helps the Hyrule Field camera turn at Render 50%, where the host, not the GPU, sets the frame rate: 33.64 fps against main's 32.60 (median of three runs a side, every run of this PR above every run of main), 1% low 15.7 against 13.1, 22 frames of 50 ms or more against 32, and compaction stalls 1.0-5.2 a second against 4.6-11.9; a second Steam Deck OLED saw the turn about 1 fps faster in the same binary with the switch off and on. At Render 100%, where the GPU's work is most of the frame, six runs a side do not separate this PR from main: the turn runs 29.37 fps against 29.34, the 1% low 13.63 against 14.57 and the 0.1% low 9.06 against 10.91, with every arm's range overlapping (this PR's 1% low is above main's in 13 of the 36 run pairings; an exact rank test gives p 0.48 for the 1% low and 0.39 for the 0.1% low); it has fewer frames of 50 ms or more (32.5 against 42) and swaps about half as much. Neither better nor measurably worse there. Standing after the turn, with the camera returned to its heading before the turn, shows no difference at Render 50% (34.40 fps against 33.27, the run-to-run spread as large as the arms' difference). Standing fps before the turn is unchanged. No errors in 30 runs. On a Steam Deck LCD (omgitsgela) no fps win was shown (Testing).

Setup: Steam Deck OLED, SteamOS 3.9.5 (build 20261023.100, kernel 7.2.7-valve2), RADV VANGOGH (Mesa 26.2.0-devel 5c65d4fc31), AMD Custom APU 0932, 16 GB shared; GPU clock manual 1600 MHz (Steam's performance menu), checked before and after every run. The repository's kokiri-start save: Kokiri Forest standing 120 s, teleport to Hyrule Field (the Lost Woods tunnel mouth, night), 20 s settle, standing 60 s, four full-stick camera pans (the turn, 49-60 s), standing until 210 s after arrival (300 s in the anchored block). Minimum preset (quality_preset=1), handheld_profile=0, Render 50% (resolution=4) and Render 100% (resolution=1), the game's own upscaler, output 1280x800, frame pacing on, uncapped, vsync off, frame generation off; headless (HOS_HEADLESS=1), a fresh options file each run, the same shared shader cache (47798 program keys kept, no preparation) in every run. fps and frame times from the game's present trace (HOS_PRESENT_TRACE) over each window (the turn: from the first pan's start to the last pan's end); 1% / 0.1% low = 1000 / the mean of the slowest 1% / 0.1% of frame times in the window; the render target counts and the pool's size from the status lines' change across the window; GPU time from the log; /proc/vmstat (compact_stall, pswpout), /proc/meminfo and PSI sampled at 5 Hz, heavy reads only outside scored windows. Render 50%: 10 runs, C1 R1 R2 C2 L1 R3 C3 L2 Z1 L3, 01:05-02:26Z 2026-11-19. Render 100%: 14 runs, C1 R1 L1 R2 C2 L2 R3 C3 and, in a second session, C4 R4 R5 C5 C6 R6 (17:14-17:57Z); C1 ran at 02:35Z, about 7.5 hours before the next seven (10:00-10:54Z), so the drift that interleaving spreads over the arms is not spread over it. The median of each arm; every run's value in brackets. To reproduce: the kokiri-start save and the options above; main's build against this PR's with no switch (level 2 on an integrated GPU), and the same PR build with RX_VK_TARGET_REUSE_MEMORY=1 (or =0) for the variants.

Measured at 540f552de on main 38990574a. Since then the head differs only by rebases (onto 868f6be87, a433db328 and now 068fb8ebe): git range-diff shows the eight code commits identical (=) through a433db328; on 068fb8ebe one comment drops a pull request number, as main's comments no longer carry them, and tests/test_target_reuse_memory.py reads the switch's row where main's docs now keep it. Main's commits since 38990574a touch none of the pool's code; main's other changes (host threading and waits, #1662, #1663, #1664; the render thread replaying jobs as they come, #1121) can move both sides' absolute fps; the comparison is main against this change on the same base. Not measured again on 068fb8ebe.

Before: main @ 38990574a After: this PR @ 540f552de After, RX_VK_TARGET_REUSE_MEMORY=1: this PR @ 540f552de
Render 50%, the turn: fps 32.60 (32.60 / 30.84 / 33.22) 33.64 (33.64 / 33.32 / 34.53) 33.07 (33.07 / 34.06 / 32.47)
1% low 13.12 (11.97 / 13.12 / 15.51) 15.73 (15.84 / 13.01 / 15.73) 15.37 (15.37 / 16.76 / 12.43)
0.1% low 10.27 (10.27 / 8.45 / 11.58) 10.15 (11.13 / 10.15 / 8.17) 10.15 (12.06 / 10.15 / 8.27)
p50 / p99 frame time, ms 29.3 / 59.2 (p99 64.0 / 59.2 / 54.1) 28.6 / 51.5 (p99 51.5 / 54.9 / 46.7) 29.3 / 55.8 (p99 55.8 / 47.9 / 63.1)
Frames of 50 ms or more 32 (32 / 43 / 25) 22 (22 / 23 / 13) 24 (24 / 13 / 37)
Compaction stalls a second 6.4 (6.4 / 11.9 / 4.6) 4.8 (5.2 / 4.8 / 1.0) 6.8 (6.8 / 4.7 / 7.1)
Pages swapped out a second 8,043 (8,043 / 12,398 / 5,848) 4,352 (4,352 / 5,293 / 2,388) 4,544 (5,623 / 1,910 / 4,544)
GPU ms a frame 12.85 12.9 12.95
Pool's peak in the turn, MB 40 / 176 / 150 478 / 484 / 455 125 / 391 / 474
Lowest MemAvailable in the turn, MiB 2,603 (2,603 / 1,553 / 2,773) 2,081 (2,081 / 1,903 / 2,171) 2,363 (2,860 / 1,764 / 2,363)
Standing fps: Kokiri / Field before the turn 17.75 / 36.06 17.85 / 35.91 17.89 / 35.93
Render 100%, the turn (six runs a side): fps 29.34 (29.28 / 27.91 / 29.46 / 27.76 / 30.08 / 29.39) 29.37 (29.26 / 29.45 / 29.17 / 29.28 / 30.20 / 29.82) 29.17 (29.26 / 29.08)
1% low 14.57 (16.82 / 12.96 / 14.87 / 12.47 / 17.09 / 14.28) 13.63 (14.49 / 13.51 / 10.17 / 13.46 / 16.62 / 13.75) 12.58 (11.86 / 13.30)
0.1% low 10.91 (11.72 / 7.81 / 12.28 / 10.11 / 13.56 / 8.02) 9.06 (11.39 / 8.66 / 4.85 / 9.46 / 13.02 / 7.36) 7.80 (7.91 / 7.69)
p50 / p99 frame time, ms 33.15 / 58.6 (p99 50.1 / 60.3 / 59.7 / 68.6 / 51.6 / 57.5) 33.0 / 55.85 (p99 57.1 / 54.6 / 58.3 / 62.9 / 52.4 / 51.9) 33.15 / 57.55 (p99 55.6 / 59.5)
Frames of 50 ms or more 42 (17 / 55 / 44 / 77 / 18 / 40) 32.5 (34 / 32 / 33 / 36 / 23 / 23) 32.5 (33 / 32)
Compaction stalls a second 3.95 (3.7 / 10.2 / 4.2 / 6.4 / 0.5 / 2.2) 2.5 (4.8 / 2.9 / 2.8 / 2.0 / 2.2 / 1.3) 2.2 (2.4 / 2.0)
Pages swapped out a second 7,402 (3,759 / 11,450 / 6,390 / 10,271 / 5,400 / 8,415) 3,596 (5,610 / 131 / 14 / 4,752 / 2,441 / 5,611) 2,600 (3,223 / 1,977)
GPU ms a frame 20.63 20.55 20.68
Pool's peak in the turn, MB 31 / 201 / 17 / 415 / 142 / 189 337 / 408 / 441 / 363 / 443 / 430 430 / 302
Lowest MemAvailable in the turn, MiB 1,938 (1,406 / 2,004 / 1,782 / 1,950 / 1,926 / 2,140) 1,778 (1,502 / 1,519 / 1,576 / 1,980 / 2,214 / 2,081) 2,634 (2,341 / 2,927)
Standing fps: Kokiri / Field before the turn 17.33 / 29.49 18.08 / 29.55 16.76 / 29.81

Main's runs are C1-C3 at Render 50% and C1-C6 at 100%, this PR's R1-R3 and R1-R6, the =1 variant's L1-L3 (two at 100%), in the order above. One run with RX_VK_TARGET_REUSE_MEMORY=0 on the PR's build at Render 50% (Z1) turned at 32.51 fps, 1% low 14.77, 28 frames of 50 ms or more, 11.6 compaction stalls a second: with main's, not with the PR's default. Level 1 against level 2 is not separated by these runs (Render 50%: 33.07 against 33.64, overlapping).

Standing after the turn, anchored (Render 50%, three runs a side; 6 runs, C1 R1 R2 C2 C3 R3, 18:05-19:58Z). The plain after-turn window starts wherever the turn leaves the camera, and swung 5-7 fps between runs of one arm. Here the camera is turned back to within 2 degrees of its heading before the turn first, its draws checked to be within 10% of the standing window before the turn, and 60 s are scored there. R2 failed that check (+12.2%) and is marked with an asterisk; it is kept in the medians.

Before: main @ 38990574a (C1 / C2 / C3) After: this PR @ 540f552de (R1 / R2* / R3)
fps, 60 s after the return 34.40 (36.25 / 31.06 / 34.40) 33.27 (35.51 / 33.19* / 33.27)
1% low 24.78 (29.07 / 21.58 / 24.78) 23.73 (20.43 / 23.73* / 25.62)
0.1% low 20.63 (27.25 / 13.51 / 20.63) 14.86 (13.77 / 14.86* / 20.60)
p50 / p99 frame time, ms 28.4 / 37.6 (p99 33.4 / 40.6 / 37.6) 29.5 / 37.2 (p99 39.6 / 37.2* / 36.9)
Frames of 50 ms or more 1 (0 / 3 / 1) 2 (7 / 2* / 0)
The same run's Field standing before the turn, fps 35.01 (36.99 / 33.25 / 35.01) 35.19 (36.78 / 33.23* / 35.19)
After-turn fps as a share of it 0.980 (0.980 / 0.934 / 0.983) 0.965 (0.965 / 0.999* / 0.945)
The return: degrees off; draws against before the turn 0.7 / 0.6 / 2.0; +5.8% / -2.0% / +0.0% 0.5 / 0.7 / 0.6; +1.2% / +12.2%* / -2.1%
Pool in the window, MB median / peak 0 / 0 in all three 0 / 55, 9 / 194*, 0 / 0
The turn in the same runs, fps 33.72 (33.72 / 34.55 / 33.37) 34.23 (34.23 / 34.00 / 34.70)
Standing fps: Kokiri 19.41 (19.41 / 20.94 / 19.05) 18.63 (18.64 / 18.63 / 18.26)

No difference is shown after the turn: the pre-turn standing window itself varies from 33.2 to 37.0 fps between runs, as much as the arms differ, and without the marked R2 this PR's median is 34.39 against main's 34.40. The pool is empty or nearly so in the window (as dukenheimer's samples found, below).

An independent test on a second Steam Deck OLED. dukenheimer ran this PR's code at 540f552d on base 38990574 on their own Deck OLED, on its built-in 1280x800 panel at Render 50%, frame generation off, on AC at 15 W, comparing the switch off (RX_VK_TARGET_REUSE_MEMORY=0) against the PR's default in the same binary, in four fixed pairs (#1681 (comment)). In the turn, in the two pairs admitted by their shader and queued-work checks, the default was about 1 fps faster (+0.33, +1.66) with lower p95 and p99 frame times (p95 -2.30 and -3.10 ms, p99 -2.40 and -10.30 ms); standing before the turn +0.21 fps; Kokiri standing about -0.09 fps, lower in all four pairs; standing after the turn -3.12 fps (-5.84 to +0.38), which they could not separate from the different views the turn leaves. No R-only picture fault in 636 frames inspected at full resolution, 0 frames flagged by a per-present flash detector, and no crash, device loss or validation error. Their follow-up (#1681 (comment)) read the pool from their logs: a cap of 487 MiB; sampled high-water marks in the admitted turns of 65 and 48 MiB with the switch off against 307 and 315 MiB at the default; between the turn and the window after it the pool fell (456→0, 78→6, 352→86, 303→0 MiB) and each round's last sample had no pooled images; system-wide memory PSI some in the turn 14.1→6.1% and 13.5→8.2%. Their delta (level 2 against 0 in one binary) and ours (this PR against main) are not directly comparable.

The fps, lows and frame times come from the present trace; the counts from the status lines. At the end of the turn, Render 50%, main (run C2) and this PR (run R3); running totals since the start, so the turn's figures are their change across it:

main 38990574a, tr5-50-C2:
[hos Presentation Thread] vk: 13680 presents, 32.8 fps; a frame: 745 draws (0 skipped), 121 dispatches, 142 passes, 130 barriers, 6 submits, 0.0 uploads (0.0 MB), 80 ub updates (56 overlays), GPU-bound wait 0.3 ms (recording slots only); 10203 pipelines (4977 ms), 0 programs (11 failed), 1262 textures (2389 MB)
[hos Presentation Thread] vk: render target images: 2260 reused from the pool, 3554 made new, 3404 destroyed from it; it holds 0 (0 MB)

this PR 540f552de, tr5-50-R3:
[hos Presentation Thread] vk: 15480 presents, 35.4 fps; a frame: 810 draws (0 skipped), 122 dispatches, 139 passes, 127 barriers, 6 submits, 0.8 uploads (0.5 MB), 80 ub updates (56 overlays), GPU-bound wait 0.3 ms (recording slots only); 10200 pipelines (4672 ms), 0 programs (11 failed), 1257 textures (2152 MB)
[hos Presentation Thread] vk: render target images: 3756 reused from the pool, 1142 made new, 1019 destroyed from it, 1158 reused by size (on a pooled one's memory, RX_VK_TARGET_REUSE_MEMORY=2), 163 missed after their image was taken by size; it holds 0 (0 MB)
[hos Presentation Thread] vk: render targets not reused by size: 180 with the pool empty (0 of them with targets still in the dead queue), 29 with none in it a present yet, 0 with none of a kind they can use, 212 with all smaller (the largest 49% short on average), 320 with all bigger (over 1.5 times), 387 with some of each, 14 over a block, 0 refused by the driver, 0 not bound; the pool let go of 176 over its bound and 843 idle

The switches: one switch is added and one switch's default changes on integrated GPUs; no menu row or ini key changes.

  • RX_VK_TARGET_REUSE_MEMORY (new): 0 off; 1 a target that misses the pool takes a pooled image's memory by size (and the 64-present hold on an integrated GPU); 2 also size classes. It ships at 2 on an integrated GPU, chosen by the Render 50% runs on the Steam Deck OLED above (level 1 there measured, not separated from 2; no separable change at Render 100%; on the Deck LCD no fps win shown), and at 1 elsewhere, which is not measured: discrete GPUs, Intel and Windows are in Still to test for the Test Farm.
  • RX_VK_POOL_IDLE: 8 presents before; 64 on an integrated GPU while the take is on, else 8. More images to reuse, more memory held (up to the pool's cap). Measured on the Deck OLED only together with the take (the hold alone, on main, measured worse in an earlier block: 29.3 fps against 29.8-30.3, the pool pinned at 428-468 MB); discrete keeps 8, untested there.

Risks

What could break: memory of one render target reused for another of a different shape: a wrong fit or a missed barrier would show as corruption in shadows or other targets, or a device loss (none seen in 30 runs here and dukenheimer's 636 inspected frames).

What it costs, as measured:

  • Memory: on integrated GPUs the pool holds its images longer. On the Deck it held up to 455-484 MB in the turn at Render 50% (main 40-176 MB) and 337-443 MB at Render 100% (main 17-415 MB); the peaks are under the pool's cap, which the log gives as 486-489 MB on the Deck (vk: render target pool: up to 486 MB; dukenheimer's logs 487 MiB), so at Render 50% the pool fills close to its cap in the turn. The lowest MemAvailable in the turn was 1.9-2.2 GB against main's 1.6-2.8 at Render 50% and 1.5-2.2 GB against 1.4-2.1 at Render 100% (no run ran out of memory: all 30 exited normally). After the turn the pool drains (dukenheimer's samples; 0-9 MB median in the anchored window here). The size classes cost up to a quarter more memory per render target of the pooled kind there (6-9% on average), counted in the texture budget.
  • Render 100%, the turn's lows: over six runs a side this PR's 1% and 0.1% lows sit below main's medians (13.63 / 9.06 against 14.57 / 10.91), inside main's own range (12.47-17.09 / 7.81-13.56; this PR 10.17-16.62 / 4.85-13.02), above main's in 13 of 36 pairings, rank-test p 0.48 / 0.39: not separable, while its frames of 50 ms or more are fewer (32.5 against 42).
  • Standing after the turn: dukenheimer measured -3.12 fps unanchored, which they could not separate from the view; anchored here at Render 50% the after-turn window is 33.27 fps against 34.40 (34.39 against 34.40 without the marked run), its 0.1% low 14.86 against 20.63 with both arms spread 13.5-27.3: no difference shown at three runs a side.
  • Kokiri standing: dukenheimer measured about -0.09 fps (lower in all four pairs); here the anchored block's Kokiri was lower on this PR in all three runs (18.63 against 19.41 median), while the first Render 50% block (17.85 against 17.75) and Render 100% over six a side (18.08 against 17.33) were higher on this PR: small, of mixed sign across blocks.

Turning it off: RX_VK_TARGET_REUSE_MEMORY=0 (the take, the hold and the classes off; the memory-type check stays); =1 for the take and the hold without the classes; RX_VK_POOL_IDLE=8 for the take without the hold.

After updating: nothing changes for a player's files: no save, ini, shader or pipeline cache change (the translator stamp is unchanged), no MKWVK_API_VERSION change.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. [a Steam Deck OLED at 540f552de, the same code; this head not run in the game]
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure. [against main 38990574a; Measurements says why the numbers still hold on 068fb8ebe]
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible. [every line of the diff is new code written for this PR; it calls VMA's existing public API (vmaCreateAliasingImage, vmaAllocateMemory, vmaGetAllocationInfo) and Vulkan 1.3's vkGetDeviceImageMemoryRequirements, copying neither]

When it applies

  • A fix: a game-free test that fails on main and passes here. [the memory-type check: tests/test_target_image_pool.py]
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def. [2 on an integrated GPU, from the Deck runs; 1 elsewhere is unmeasured and asked of the Test Farm in Still to test]
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. [the renderer built for both at an earlier rebased head; the two changed sources syntax-checked for both at this head]
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested. [Windows, discrete NVIDIA and AMD, other integrated GPUs not run]
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). [Steam Deck OLED and LCD only; NVIDIA RTX and AMD RX on Windows and Linux not run]
  • Approved in review, every comment answered. [no review yet]
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold. [the head is not pushed yet; why the numbers still hold is in Measurements]
## Summary On a Steam Deck, turning the camera in Hyrule Field spends time asking the system for fresh memory for the game's shadow maps, which change size a little every frame, while a nearly identical one was just set aside. A render target of a size not seen before was always a new allocation (on the Deck, a kernel call that compacts memory and can swap), while the pool let go of a nearly matching image after 8 frames. This PR lets such a target take the memory of a pooled image it fits in (up to 1.5 times its size); on integrated GPUs the pool keeps its images 64 frames instead of 8 and makes these targets' memory a size class larger (at most a quarter more), so the next one fits; and a render target the pool's memory type cannot serve is made outside it. Discrete GPUs keep the 8-frame hold and get no size classes (only the take by size); the exact-match pool, its byte cap and its pressure rules, and standing fps do not change. The result: on a Steam Deck OLED at Render 50% the turn runs about 1 fps faster with fewer long frames, as on a second Deck OLED (dukenheimer); at Render 100% six runs a side don't separate it from `main`, and on a Steam Deck LCD (omgitsgela) no fps win was shown in any cell. It helps where the host, not the GPU, sets the frame rate, and is neutral elsewhere. Why: on a Steam Deck OLED in Hyrule Field with the camera panning, the replay thread spent about 3.2 ms a frame in VMA's block allocations (a kernel call that failed direct compaction about 29 times a second and pushed the game's memory to swap), and 92% of those were render targets made new after the pool's exact match missed. OoT sizes each nearby character's shadow map anew every frame, so its pool key never recurs, while an image of nearly the same size was just retired. The swap during turns was first reported in the Deck performance issue, https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1477. Prior art: the pool's 8-present hold came from https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1255, and the shadow maps' storage buckets from https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1256. The tracker was searched for render targets, allocation, swap, compaction and turning stutter. Turning stutter in Hyrule Field on discrete NVIDIA cards (https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1406, https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1111) may share part of the cause, but there this PR only adds the take by size at the 8-frame hold, and it has not run on such a card: those issues are not claimed. Read first: - vk (fix): `create_image` puts a render target in the targets' VMA pool only when the pool's memory type is among the image's `memoryTypeBits` (`target_pool_takes`, `gpu/vk/vk_vma.cpp`); VMA does not check this for a custom pool. The requirements come from `vkGetDeviceImageMemoryRequirements` (Vulkan 1.3, loaded with the optional device functions), asked once a texture (`ImageNeed`, `gpu/vk/vk_internal.h`). - vk: `pool_take_memory` (`gpu/vk/vk_texture.cpp`), tried in `create` only after `pool_take` misses: the fit rule is `target_pool::verdict` (`gpu/vk/target_pool.h`): a usable, device-local memory type, an aligned offset, at least the size and at most 1.5 times it, only allocations `create_image` tagged as the targets' blocks (VMA never makes dedicated memory there); the wait is `takeable_by_size`. The new image is bound with `vmaCreateAliasingImage`; the pooled image and its views are destroyed as `pool_destroy` does (the pool holds only images whose GPU work completed). The image starts UNDEFINED and is cleared as a new one is; it is counted at its allocation's size. - vk: the pool's hold, `target_pool::idle_presents`: 64 presents on an integrated GPU while the take is on, 8 otherwise; `RX_VK_POOL_IDLE` still sets it. - vk: counters: the status line's `reused by size` and `missed after their image was taken by size`, and a second line every 600 presents, `render targets not reused by size:`, with each miss's reason (`target_pool::Miss`) and what the pool let go of over its bound and idle. - vk (`=2`, the default on integrated GPUs): `target_pool::class_bytes`, `create_image_in_class` (`gpu/vk/vk_vma.cpp`), and the pool's index by memory type and class (`by_class`, `pool_unindex`). - tests: `tests/test_target_reuse_memory.py` (new: rules compiled from the header; `pool_take_memory`, `pool_take`, `pool_put`, `pool_trim` compiled from the source with stubs, the dead queue made unreadable to them); `tests/test_target_image_pool.py` (the memory-type check; `create_image`'s new argument); `tests/test_dead_targets_sweep.py` (the hold's default); `tests/test_target_image_reuse.py`. - docs: the `RX_VK_TARGET_REUSE_MEMORY` row in the *Memory* table of `docs/dev/reference/switches.md` (main's revamp removed `docs/development.md`, where it was); the rows of `RX_VK_TARGET_REUSE_MEMORY` and `RX_VK_POOL_IDLE` in `gpu/vk/switches.def`. See https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1477 ## Testing **Tested:** this PR's code at 540f552de on my Steam Deck OLED (the setup in Measurements): 30 runs at Render 50% and 100%, interleaved with main 38990574a, all exiting normally with no error, validation or device-lost line in the log; the status line printed the level each arm asked for (2 by default, 1 and 0 when set). Pictures by eye at this code: the Field after the turn (Render 50%, R1 against main's C1) and Kokiri Forest standing (Render 100%, R3): nothing missing or misdrawn; the after-turn views differ only by where the camera stopped. Earlier builds of this change ran 23 more runs on the same Deck with the same result. Independently, on a second Steam Deck OLED, dukenheimer at 540f552d (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1681#issuecomment-54104, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1681#issuecomment-54299): the turn faster, no R-only picture fault in 636 frames inspected at full resolution, 0 frames flagged by a per-present flash detector over every present, no crash, device loss or validation error (Measurements). On a Steam Deck LCD, omgitsgela ran this PR with the switch off against the default in one binary, in three areas (https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1477, their comments of 2026-11-19 21:05 and 21:07). Their reading, which I agree with: no demonstrated fps win in any cell, and not proof of no effect. The one pair per cell that passed their scene-match gate: Hyrule Field median 39.93 ms with the default against 40.04 off (p99 -11.0 ms, 22 fewer frames over 50 ms, inside their A/A floor); Castle Town 43.64 against 42.42 (the default slightly behind); Kokiri gave no admitted pair. The renderer built for Windows at the earlier rebased head: `RX_TARGET=windows RX_MARCH=x86-64-v3 RX_VK_ONLY=1 python3 -I nx2/build.py --standalone` with llvm-mingw 20261104 (UCRT): 213 files compiled, 0 failed, `longshot_vk.dll` linked (PE32+ x86-64 DLL); on Linux the same renderer build with clang, 214 files, 0 failed, `longshot_vk.so` linked; `tests/test_utf8_paths.py` with `LONGSHOT_MINGW` set passes (the probe built for Windows). At this head, `gpu/vk/vk_texture.cpp` and `gpu/vk/vk_vma.cpp` with `-fsyntax-only` for Linux (clang) and Windows (llvm-mingw): no errors, as on main 068fb8ebe. Game-free on Linux x86-64, in the PC's job queue, at this head (742b053ae on main 068fb8ebe): the 116 checks that read its files (`run_all.py --changed forge/main`): 100 passed, 16 failed, 1 skipped (Windows-only), the 16 failing on main too; and the whole `python3 -I -B tests/run_all.py` (not `--strict`) here and on main 068fb8ebe in the same environment: 73 fail on both (this PC's environment: missing tools and modules, timing). 12 more failed here in a run shared with two other full suites and each passed when run again alone (`nx2/test_coop_spirv.py`, `nx2/test_default_point_size.py`, `nx2/test_draw_parameters.py`, `nx2/test_mesh_first_types.py`, `nx2/test_spirv_struct_identity.py`, `test_appimage_package_retry`, `test_fpx_sticky`, `test_mesh_fallback_layout`, `test_mesh_unreachable_outputs`, `test_pipeline_cache_file`, `test_pipeline_cache_save`, `test_pipeline_state_sources`). The new checks fail at their test-only commits and pass here: `tests/test_target_image_pool.py` at 9ddf2389a (2 of 10 fail), `tests/test_target_reuse_memory.py` at 739fec485. <details><summary>The 73 checks that fail both here (742b053ae) and on main 068fb8ebe</summary> `nx2/test_nup_codec.py`, `nx2/test_nup_read_name.py`, `nx2/test_nup_stand_in.py`, `nx2/test_nup_verify.py`, `test_appimage_player_build`, `test_bug_report_defaults`, `test_capture_read_once`, `test_capture_readback_visibility`, `test_crash_dialog`, `test_crt_options`, `test_damage_debug_menu`, `test_dav1d_av1`, `test_dev_ab`, `test_dev_packs`, `test_discover`, `test_display_startup_failure`, `test_dlss_feature_size`, `test_draw_stream_visibility`, `test_failed_compile_keeps_objects`, `test_frame_overlap`, `test_fsr3fi_hud_layer`, `test_fsr_image_retirement`, `test_fsr_uniform_ownership`, `test_guest_imported`, `test_high_fps_fixes`, `test_host_guest_writes`, `test_hud_layout_row`, `test_insn_fixed_convert`, `test_libc_hooks`, `test_lift_cache`, `test_lift_lookups`, `test_linux_preflight`, `test_linux_pressure`, `test_linux_tools`, `test_linux_update`, `test_log_open_failure`, `test_make_game_cache`, `test_make_game_ngx`, `test_mise_build`, `test_missing_nup`, `test_mods_list`, `test_mods_size_table`, `test_native_zstd`, `test_ngx_sdk`, `test_nonuniform_image_arrays`, `test_parallel_init_order`, `test_pending_guest_import`, `test_pipeline_play_cache`, `test_prepare_cache_save`, `test_prepare_stall`, `test_present_queue_default`, `test_present_source_crop`, `test_present_thread`, `test_profiling_mode`, `test_prompt_guide_lines`, `test_prompt_hand_guides`, `test_prompt_picture_tint`, `test_prompt_speed`, `test_psychov35_fsr3_fg`, `test_readback_timeout_source`, `test_recorder_sync`, `test_replay_write_order`, `test_slow_frames`, `test_song_note_cue`, `test_staging_burst`, `test_texel_buffer_ownership`, `test_thinlto_tls`, `test_upscaler_rows`, `test_vbytes`, `test_vcore_escape`, `test_vk_occlusion_queries`, `test_walk`, `test_walk_key` </details> A driver whose depth or multisampled images exclude the targets' pool's memory type (none known on hand) can't be run by hand: the memory-type check is covered by `tests/test_target_image_pool.py`. Not run: Intel's Mesa defaults that main gained since the measurement (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1586) together with this change; this head in the game (its code is the measured code, see Measurements). **Still to test:** - Windows, any GPU: start the game, walk into Hyrule Field and turn the camera a full circle several times, expecting no corruption in shadows or elsewhere, no device loss, and the log's `render target images:` line with `reused by size` above 0 (@Beanstalk windows, Hyrule Field camera turn) - A discrete NVIDIA card and a discrete AMD card (Linux or Windows): the same turn, expecting the same, the level printed as 1 and the pool's hold still 8 presents (@Beanstalk nvidia and @Beanstalk amd, Hyrule Field camera turn) - An integrated GPU other than the Steam Deck (an AMD APU, Intel): the same turn, expecting no picture fault and the turn's fps no worse than `main`'s (by hand) ## Measurements **Verdict:** it helps the Hyrule Field camera turn at Render 50%, where the host, not the GPU, sets the frame rate: 33.64 fps against main's 32.60 (median of three runs a side, every run of this PR above every run of main), 1% low 15.7 against 13.1, 22 frames of 50 ms or more against 32, and compaction stalls 1.0-5.2 a second against 4.6-11.9; a second Steam Deck OLED saw the turn about 1 fps faster in the same binary with the switch off and on. At Render 100%, where the GPU's work is most of the frame, six runs a side do not separate this PR from main: the turn runs 29.37 fps against 29.34, the 1% low 13.63 against 14.57 and the 0.1% low 9.06 against 10.91, with every arm's range overlapping (this PR's 1% low is above main's in 13 of the 36 run pairings; an exact rank test gives p 0.48 for the 1% low and 0.39 for the 0.1% low); it has fewer frames of 50 ms or more (32.5 against 42) and swaps about half as much. Neither better nor measurably worse there. Standing after the turn, with the camera returned to its heading before the turn, shows no difference at Render 50% (34.40 fps against 33.27, the run-to-run spread as large as the arms' difference). Standing fps before the turn is unchanged. No errors in 30 runs. On a Steam Deck LCD (omgitsgela) no fps win was shown (Testing). Setup: Steam Deck OLED, SteamOS 3.9.5 (build 20261023.100, kernel 7.2.7-valve2), RADV VANGOGH (Mesa 26.2.0-devel 5c65d4fc31), AMD Custom APU 0932, 16 GB shared; GPU clock manual 1600 MHz (Steam's performance menu), checked before and after every run. The repository's `kokiri-start` save: Kokiri Forest standing 120 s, teleport to Hyrule Field (the Lost Woods tunnel mouth, night), 20 s settle, standing 60 s, four full-stick camera pans (the turn, 49-60 s), standing until 210 s after arrival (300 s in the anchored block). Minimum preset (`quality_preset=1`), `handheld_profile=0`, Render 50% (`resolution=4`) and Render 100% (`resolution=1`), the game's own upscaler, output 1280x800, frame pacing on, uncapped, vsync off, frame generation off; headless (`HOS_HEADLESS=1`), a fresh options file each run, the same shared shader cache (`47798 program keys kept`, no preparation) in every run. fps and frame times from the game's present trace (`HOS_PRESENT_TRACE`) over each window (the turn: from the first pan's start to the last pan's end); 1% / 0.1% low = 1000 / the mean of the slowest 1% / 0.1% of frame times in the window; the render target counts and the pool's size from the status lines' change across the window; GPU time from the log; `/proc/vmstat` (`compact_stall`, `pswpout`), `/proc/meminfo` and PSI sampled at 5 Hz, heavy reads only outside scored windows. Render 50%: 10 runs, C1 R1 R2 C2 L1 R3 C3 L2 Z1 L3, 01:05-02:26Z 2026-11-19. Render 100%: 14 runs, C1 R1 L1 R2 C2 L2 R3 C3 and, in a second session, C4 R4 R5 C5 C6 R6 (17:14-17:57Z); C1 ran at 02:35Z, about 7.5 hours before the next seven (10:00-10:54Z), so the drift that interleaving spreads over the arms is not spread over it. The median of each arm; every run's value in brackets. To reproduce: the `kokiri-start` save and the options above; main's build against this PR's with no switch (level 2 on an integrated GPU), and the same PR build with `RX_VK_TARGET_REUSE_MEMORY=1` (or `=0`) for the variants. Measured at 540f552de on main 38990574a. Since then the head differs only by rebases (onto 868f6be87, a433db328 and now 068fb8ebe): `git range-diff` shows the eight code commits identical (`=`) through a433db328; on 068fb8ebe one comment drops a pull request number, as main's comments no longer carry them, and `tests/test_target_reuse_memory.py` reads the switch's row where main's docs now keep it. Main's commits since 38990574a touch none of the pool's code; main's other changes (host threading and waits, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1662, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1663, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1664; the render thread replaying jobs as they come, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1121) can move both sides' absolute fps; the comparison is main against this change on the same base. Not measured again on 068fb8ebe. | | Before: main @ 38990574a | After: this PR @ 540f552de | After, RX_VK_TARGET_REUSE_MEMORY=1: this PR @ 540f552de | |---|---|---|---| | **Render 50%, the turn:** fps | 32.60 (32.60 / 30.84 / 33.22) | **33.64** (33.64 / 33.32 / 34.53) | 33.07 (33.07 / 34.06 / 32.47) | | 1% low | 13.12 (11.97 / 13.12 / 15.51) | **15.73** (15.84 / 13.01 / 15.73) | 15.37 (15.37 / 16.76 / 12.43) | | 0.1% low | 10.27 (10.27 / 8.45 / 11.58) | 10.15 (11.13 / 10.15 / 8.17) | 10.15 (12.06 / 10.15 / 8.27) | | p50 / p99 frame time, ms | 29.3 / 59.2 (p99 64.0 / 59.2 / 54.1) | 28.6 / 51.5 (p99 51.5 / 54.9 / 46.7) | 29.3 / 55.8 (p99 55.8 / 47.9 / 63.1) | | Frames of 50 ms or more | 32 (32 / 43 / 25) | **22** (22 / 23 / 13) | 24 (24 / 13 / 37) | | Compaction stalls a second | 6.4 (6.4 / 11.9 / 4.6) | 4.8 (5.2 / 4.8 / 1.0) | 6.8 (6.8 / 4.7 / 7.1) | | Pages swapped out a second | 8,043 (8,043 / 12,398 / 5,848) | 4,352 (4,352 / 5,293 / 2,388) | 4,544 (5,623 / 1,910 / 4,544) | | GPU ms a frame | 12.85 | 12.9 | 12.95 | | Pool's peak in the turn, MB | 40 / 176 / 150 | 478 / 484 / 455 | 125 / 391 / 474 | | Lowest MemAvailable in the turn, MiB | 2,603 (2,603 / 1,553 / 2,773) | 2,081 (2,081 / 1,903 / 2,171) | 2,363 (2,860 / 1,764 / 2,363) | | Standing fps: Kokiri / Field before the turn | 17.75 / 36.06 | 17.85 / 35.91 | 17.89 / 35.93 | | **Render 100%, the turn (six runs a side):** fps | 29.34 (29.28 / 27.91 / 29.46 / 27.76 / 30.08 / 29.39) | 29.37 (29.26 / 29.45 / 29.17 / 29.28 / 30.20 / 29.82) | 29.17 (29.26 / 29.08) | | 1% low | 14.57 (16.82 / 12.96 / 14.87 / 12.47 / 17.09 / 14.28) | 13.63 (14.49 / 13.51 / 10.17 / 13.46 / 16.62 / 13.75) | 12.58 (11.86 / 13.30) | | 0.1% low | 10.91 (11.72 / 7.81 / 12.28 / 10.11 / 13.56 / 8.02) | 9.06 (11.39 / 8.66 / 4.85 / 9.46 / 13.02 / 7.36) | 7.80 (7.91 / 7.69) | | p50 / p99 frame time, ms | 33.15 / 58.6 (p99 50.1 / 60.3 / 59.7 / 68.6 / 51.6 / 57.5) | 33.0 / 55.85 (p99 57.1 / 54.6 / 58.3 / 62.9 / 52.4 / 51.9) | 33.15 / 57.55 (p99 55.6 / 59.5) | | Frames of 50 ms or more | 42 (17 / 55 / 44 / 77 / 18 / 40) | 32.5 (34 / 32 / 33 / 36 / 23 / 23) | 32.5 (33 / 32) | | Compaction stalls a second | 3.95 (3.7 / 10.2 / 4.2 / 6.4 / 0.5 / 2.2) | 2.5 (4.8 / 2.9 / 2.8 / 2.0 / 2.2 / 1.3) | 2.2 (2.4 / 2.0) | | Pages swapped out a second | 7,402 (3,759 / 11,450 / 6,390 / 10,271 / 5,400 / 8,415) | 3,596 (5,610 / 131 / 14 / 4,752 / 2,441 / 5,611) | 2,600 (3,223 / 1,977) | | GPU ms a frame | 20.63 | 20.55 | 20.68 | | Pool's peak in the turn, MB | 31 / 201 / 17 / 415 / 142 / 189 | 337 / 408 / 441 / 363 / 443 / 430 | 430 / 302 | | Lowest MemAvailable in the turn, MiB | 1,938 (1,406 / 2,004 / 1,782 / 1,950 / 1,926 / 2,140) | 1,778 (1,502 / 1,519 / 1,576 / 1,980 / 2,214 / 2,081) | 2,634 (2,341 / 2,927) | | Standing fps: Kokiri / Field before the turn | 17.33 / 29.49 | 18.08 / 29.55 | 16.76 / 29.81 | Main's runs are C1-C3 at Render 50% and C1-C6 at 100%, this PR's R1-R3 and R1-R6, the `=1` variant's L1-L3 (two at 100%), in the order above. One run with `RX_VK_TARGET_REUSE_MEMORY=0` on the PR's build at Render 50% (Z1) turned at 32.51 fps, 1% low 14.77, 28 frames of 50 ms or more, 11.6 compaction stalls a second: with main's, not with the PR's default. Level 1 against level 2 is not separated by these runs (Render 50%: 33.07 against 33.64, overlapping). **Standing after the turn, anchored (Render 50%, three runs a side; 6 runs, C1 R1 R2 C2 C3 R3, 18:05-19:58Z).** The plain after-turn window starts wherever the turn leaves the camera, and swung 5-7 fps between runs of one arm. Here the camera is turned back to within 2 degrees of its heading before the turn first, its draws checked to be within 10% of the standing window before the turn, and 60 s are scored there. R2 failed that check (+12.2%) and is marked with an asterisk; it is kept in the medians. | | Before: main @ 38990574a (C1 / C2 / C3) | After: this PR @ 540f552de (R1 / R2\* / R3) | |---|---|---| | fps, 60 s after the return | 34.40 (36.25 / 31.06 / 34.40) | 33.27 (35.51 / 33.19\* / 33.27) | | 1% low | 24.78 (29.07 / 21.58 / 24.78) | 23.73 (20.43 / 23.73\* / 25.62) | | 0.1% low | 20.63 (27.25 / 13.51 / 20.63) | 14.86 (13.77 / 14.86\* / 20.60) | | p50 / p99 frame time, ms | 28.4 / 37.6 (p99 33.4 / 40.6 / 37.6) | 29.5 / 37.2 (p99 39.6 / 37.2\* / 36.9) | | Frames of 50 ms or more | 1 (0 / 3 / 1) | 2 (7 / 2\* / 0) | | The same run's Field standing before the turn, fps | 35.01 (36.99 / 33.25 / 35.01) | 35.19 (36.78 / 33.23\* / 35.19) | | After-turn fps as a share of it | 0.980 (0.980 / 0.934 / 0.983) | 0.965 (0.965 / 0.999\* / 0.945) | | The return: degrees off; draws against before the turn | 0.7 / 0.6 / 2.0; +5.8% / -2.0% / +0.0% | 0.5 / 0.7 / 0.6; +1.2% / +12.2%\* / -2.1% | | Pool in the window, MB median / peak | 0 / 0 in all three | 0 / 55, 9 / 194\*, 0 / 0 | | The turn in the same runs, fps | 33.72 (33.72 / 34.55 / 33.37) | 34.23 (34.23 / 34.00 / 34.70) | | Standing fps: Kokiri | 19.41 (19.41 / 20.94 / 19.05) | 18.63 (18.64 / 18.63 / 18.26) | No difference is shown after the turn: the pre-turn standing window itself varies from 33.2 to 37.0 fps between runs, as much as the arms differ, and without the marked R2 this PR's median is 34.39 against main's 34.40. The pool is empty or nearly so in the window (as dukenheimer's samples found, below). **An independent test on a second Steam Deck OLED.** dukenheimer ran this PR's code at 540f552d on base 38990574 on their own Deck OLED, on its built-in 1280x800 panel at Render 50%, frame generation off, on AC at 15 W, comparing the switch off (`RX_VK_TARGET_REUSE_MEMORY=0`) against the PR's default in the same binary, in four fixed pairs (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1681#issuecomment-54104). In the turn, in the two pairs admitted by their shader and queued-work checks, the default was about 1 fps faster (+0.33, +1.66) with lower p95 and p99 frame times (p95 -2.30 and -3.10 ms, p99 -2.40 and -10.30 ms); standing before the turn +0.21 fps; Kokiri standing about -0.09 fps, lower in all four pairs; standing after the turn -3.12 fps (-5.84 to +0.38), which they could not separate from the different views the turn leaves. No R-only picture fault in 636 frames inspected at full resolution, 0 frames flagged by a per-present flash detector, and no crash, device loss or validation error. Their follow-up (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1681#issuecomment-54299) read the pool from their logs: a cap of 487 MiB; sampled high-water marks in the admitted turns of 65 and 48 MiB with the switch off against 307 and 315 MiB at the default; between the turn and the window after it the pool fell (456→0, 78→6, 352→86, 303→0 MiB) and each round's last sample had no pooled images; system-wide memory PSI `some` in the turn 14.1→6.1% and 13.5→8.2%. Their delta (level 2 against 0 in one binary) and ours (this PR against main) are not directly comparable. The fps, lows and frame times come from the present trace; the counts from the status lines. At the end of the turn, Render 50%, main (run C2) and this PR (run R3); running totals since the start, so the turn's figures are their change across it: ``` main 38990574a, tr5-50-C2: [hos Presentation Thread] vk: 13680 presents, 32.8 fps; a frame: 745 draws (0 skipped), 121 dispatches, 142 passes, 130 barriers, 6 submits, 0.0 uploads (0.0 MB), 80 ub updates (56 overlays), GPU-bound wait 0.3 ms (recording slots only); 10203 pipelines (4977 ms), 0 programs (11 failed), 1262 textures (2389 MB) [hos Presentation Thread] vk: render target images: 2260 reused from the pool, 3554 made new, 3404 destroyed from it; it holds 0 (0 MB) this PR 540f552de, tr5-50-R3: [hos Presentation Thread] vk: 15480 presents, 35.4 fps; a frame: 810 draws (0 skipped), 122 dispatches, 139 passes, 127 barriers, 6 submits, 0.8 uploads (0.5 MB), 80 ub updates (56 overlays), GPU-bound wait 0.3 ms (recording slots only); 10200 pipelines (4672 ms), 0 programs (11 failed), 1257 textures (2152 MB) [hos Presentation Thread] vk: render target images: 3756 reused from the pool, 1142 made new, 1019 destroyed from it, 1158 reused by size (on a pooled one's memory, RX_VK_TARGET_REUSE_MEMORY=2), 163 missed after their image was taken by size; it holds 0 (0 MB) [hos Presentation Thread] vk: render targets not reused by size: 180 with the pool empty (0 of them with targets still in the dead queue), 29 with none in it a present yet, 0 with none of a kind they can use, 212 with all smaller (the largest 49% short on average), 320 with all bigger (over 1.5 times), 387 with some of each, 14 over a block, 0 refused by the driver, 0 not bound; the pool let go of 176 over its bound and 843 idle ``` **The switches:** one switch is added and one switch's default changes on integrated GPUs; no menu row or ini key changes. - `RX_VK_TARGET_REUSE_MEMORY` (new): 0 off; 1 a target that misses the pool takes a pooled image's memory by size (and the 64-present hold on an integrated GPU); 2 also size classes. It ships at 2 on an integrated GPU, chosen by the Render 50% runs on the Steam Deck OLED above (level 1 there measured, not separated from 2; no separable change at Render 100%; on the Deck LCD no fps win shown), and at 1 elsewhere, which is not measured: discrete GPUs, Intel and Windows are in Still to test for the Test Farm. - `RX_VK_POOL_IDLE`: 8 presents before; 64 on an integrated GPU while the take is on, else 8. More images to reuse, more memory held (up to the pool's cap). Measured on the Deck OLED only together with the take (the hold alone, on main, measured worse in an earlier block: 29.3 fps against 29.8-30.3, the pool pinned at 428-468 MB); discrete keeps 8, untested there. ## Risks **What could break:** memory of one render target reused for another of a different shape: a wrong fit or a missed barrier would show as corruption in shadows or other targets, or a device loss (none seen in 30 runs here and dukenheimer's 636 inspected frames). **What it costs, as measured:** - Memory: on integrated GPUs the pool holds its images longer. On the Deck it held up to 455-484 MB in the turn at Render 50% (main 40-176 MB) and 337-443 MB at Render 100% (main 17-415 MB); the peaks are under the pool's cap, which the log gives as 486-489 MB on the Deck (`vk: render target pool: up to 486 MB`; dukenheimer's logs 487 MiB), so at Render 50% the pool fills close to its cap in the turn. The lowest MemAvailable in the turn was 1.9-2.2 GB against main's 1.6-2.8 at Render 50% and 1.5-2.2 GB against 1.4-2.1 at Render 100% (no run ran out of memory: all 30 exited normally). After the turn the pool drains (dukenheimer's samples; 0-9 MB median in the anchored window here). The size classes cost up to a quarter more memory per render target of the pooled kind there (6-9% on average), counted in the texture budget. - Render 100%, the turn's lows: over six runs a side this PR's 1% and 0.1% lows sit below main's medians (13.63 / 9.06 against 14.57 / 10.91), inside main's own range (12.47-17.09 / 7.81-13.56; this PR 10.17-16.62 / 4.85-13.02), above main's in 13 of 36 pairings, rank-test p 0.48 / 0.39: not separable, while its frames of 50 ms or more are fewer (32.5 against 42). - Standing after the turn: dukenheimer measured -3.12 fps unanchored, which they could not separate from the view; anchored here at Render 50% the after-turn window is 33.27 fps against 34.40 (34.39 against 34.40 without the marked run), its 0.1% low 14.86 against 20.63 with both arms spread 13.5-27.3: no difference shown at three runs a side. - Kokiri standing: dukenheimer measured about -0.09 fps (lower in all four pairs); here the anchored block's Kokiri was lower on this PR in all three runs (18.63 against 19.41 median), while the first Render 50% block (17.85 against 17.75) and Render 100% over six a side (18.08 against 17.33) were higher on this PR: small, of mixed sign across blocks. **Turning it off:** `RX_VK_TARGET_REUSE_MEMORY=0` (the take, the hold and the classes off; the memory-type check stays); `=1` for the take and the hold without the classes; `RX_VK_POOL_IDLE=8` for the take without the hold. **After updating:** nothing changes for a player's files: no save, ini, shader or pipeline cache change (the translator stamp is unchanged), no `MKWVK_API_VERSION` change. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. [a Steam Deck OLED at 540f552de, the same code; this head not run in the game] - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. [against main 38990574a; Measurements says why the numbers still hold on 068fb8ebe] - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. [every line of the diff is new code written for this PR; it calls VMA's existing public API (`vmaCreateAliasingImage`, `vmaAllocateMemory`, `vmaGetAllocationInfo`) and Vulkan 1.3's `vkGetDeviceImageMemoryRequirements`, copying neither] ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. [the memory-type check: `tests/test_target_image_pool.py`] - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. [2 on an integrated GPU, from the Deck runs; 1 elsewhere is unmeasured and asked of the Test Farm in Still to test] - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. [the renderer built for both at an earlier rebased head; the two changed sources syntax-checked for both at this head] - [x] Docs updated. - [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. [Windows, discrete NVIDIA and AMD, other integrated GPUs not run] - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). [Steam Deck OLED and LCD only; NVIDIA RTX and AMD RX on Windows and Linux not run] - [ ] Approved in review, every comment answered. [no review yet] - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. [the head is not pushed yet; why the numbers still hold is in Measurements]
The render targets' VMA pool is of one memory type, and VMA allocates in a custom pool's type without checking it against the
image's memoryTypeBits: a driver whose depth or multisampled images exclude that type would get an image bound to memory it cannot
use. This check wants create_image to send such an image elsewhere, from the image's requirements asked once a texture (create's
ImageNeed, Vulkan 1.3's vkGetDeviceImageMemoryRequirements). Fails on main.

Assisted-by: Claude
target_images_pool keeps the memory type VMA chose for its pool, and create_image's pool path puts a render target's image there
only when that type is among the image's memoryTypeBits (target_pool_takes); otherwise the image goes on to the allocations after
it, as one the pool refused does. The requirements come from vkGetDeviceImageMemoryRequirements (core in Vulkan 1.3, which the
renderer requires; loaded with the device's optional functions), without making an image, and create asks once a texture
(ImageNeed) and hands them to create_image. Where they cannot be asked, the image goes in the pool as before.

Assisted-by: Claude
On a Steam Deck OLED in Hyrule Field, the replay thread spent about 3.2 ms a frame in VMA's block allocations, a kernel call
that failed compaction and swapped, 92% of them render targets made new after the pool's exact take missed: OoT's per-character
shadow maps get a side of their own every frame, so their pool key never comes back while an image of nearly the same size waits.

These checks compile target_pool.h's rules (the fit: a memory type the image can use, an aligned offset, its size to 1.5 times
it, never memory of its own; a present's wait before an image may go to another shape; RX_VK_TARGET_REUSE_MEMORY; why a miss
was not answered) and vk_texture.cpp's pool_take_memory, pool_take, pool_put and pool_trim, cut out by their text, with stubs:
what is taken and left, what is destroyed, the counts, the record of keys taken by size, and that the memory comes from the pool
alone, never the dead queue (it does not compile). They read the rest from create, the VMA wrapper, the switch's row and the docs.
Fails before the change.

Assisted-by: Claude
When pool_take finds no image of a render target's create info, create now asks pool_take_memory for a pooled image whose
allocation holds the new one (target_pool::verdict: a memory type the image can use and in VRAM, an offset its alignment divides,
at least its size and at most 1.5 times it, only a share of the targets' blocks, never memory of its own, which VMA binds to the
one image it made it for), the smallest that fits among those that have waited in the pool a present or more (a shape the game
makes every frame takes its image back within the present it came in). The new image is bound to that allocation with
vmaCreateAliasingImage, then the pooled image and its views are destroyed as pool_destroy destroys them: the pool holds only
images the GPU is done with. The image is put into GENERAL from UNDEFINED and cleared as a new one is, and counted at its
allocation's size. The targets' blocks are told by a tag create_image gives their allocations (pUserData; VMA 3.0 has no
vmaGetAllocationInfo2), and a pooled image's allocation is read once, when it comes in.

The status line says how many were reused by size and how many exact misses followed a take of their image by size, and a second
line every 600 presents says why the rest were not answered (the pool empty, with targets still in the dead queue or not; none
there a present yet; none of a usable kind; all smaller, by how much; all bigger; some of each; over a block; refused; not bound)
and what the pool let go of over its bound and idle. RX_VK_TARGET_REUSE_MEMORY=0 makes such a target a new allocation of its size,
as before; 1 takes by size (unset, it is 1 on a discrete GPU and 2 on an integrated one, where the size classes the last commit of this series adds are measured).

tests/test_target_image_reuse.py, which compiles destroy_later and the dead list's loop, follows them: the count of render
targets' images on their way to the pool through the dead list (the empty-pool reason's split), checked to come back to 0.

Assisted-by: Claude
On a Steam Deck in a camera turn the pool's 8-present idle rule let 2,255-2,946 images go and 1,006-1,104 new targets found it
empty; with RX_VK_POOL_IDLE=64 and the take by size 22-29 did. These checks want target_pool::idle_presents: 64 presents on an
integrated GPU while the take by size is on, 8 on a discrete GPU and with the take off, RX_VK_POOL_IDLE as set either way, and
pool_trim reading it with the device's type. Fails before the change.

Assisted-by: Claude
#1255 cut the pool's idle time from 120 presents to 8 because OoT's
per-character shadow maps get a new side every frame: each was a pool key that never came again, memory held for nothing, and they
filled the pool to its 768 MB bound. With a pooled image's memory taken by size such an image is no longer held for nothing: it is
the next new shape's allocation, and letting it go after 8 presents is what left the pool empty. On a Steam Deck OLED in Hyrule
Field's camera turn, RX_VK_POOL_IDLE=64 with the take by size left 22-29 new targets finding the pool empty instead of
1,006-1,104, took 1,058-1,108 by size instead of 425-516, made 831-1,094 new instead of 2,444-3,021, and the turn ran at
31.3-32.7 fps against the same block's controls' 29.8-30.3. Holding without the take measured worse than the control (the pool
pinned near its cap, more compaction stalls), so with RX_VK_TARGET_REUSE_MEMORY=0 the hold stays 8.

Only on an integrated GPU, where each new allocation was the kernel call measured: on a discrete card the pool would fill to its
cap, up to 768 MB of VRAM, for a gain not measured there, so it keeps 8. What bounds the memory is the pool's byte cap (a twelfth
of the driver's allowance, 256-768 MB; 392 MB on the Deck, which then binds), halved over 90% of the allowance and given back over
97% or under Linux's memory hold. pool_trim still lets go of at most 16 images a present (64 pressed), oldest first. The record
of keys taken by size lives as long as the hold. RX_VK_POOL_IDLE still sets it outright (target_pool::idle_presents).

Assisted-by: Claude
These checks want target_pool::class_bytes (multiples of the 64 KiB alignment, at most a quarter over the requirement rounded to
64 KiB, each its own class, no fewer to a block where fewer than 8 fit, a shadow map a few texels larger in the same class), a
pooled class allocation fitting any need of its class, RX_VK_TARGET_REUSE_MEMORY=2 asking for them and unset meaning 2 on an
integrated GPU and 1 elsewhere, and, compiled from vk_texture.cpp, the pool's index of class allocations by memory type and
class: put, taken by size, trimmed, taken exactly, a front not a present old yet or of the wrong alignment left alone. Create
makes such a target in its class only at level 2 with the pool not pressed. Fails before the change.

Assisted-by: Claude
perf(vk): size classes for render targets of the pooled kind, the default on integrated GPUs (RX_VK_TARGET_REUSE_MEMORY=2)
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
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
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
540f552ded
OoT's shadow maps change side by a few texels a frame, mostly growing as a character nears, so last frame's allocation is often a
few percent too small for this frame's map. At RX_VK_TARGET_REUSE_MEMORY=2, while the pool is not pressed, a new target of the
pooled kind is made on an allocation of its requirement rounded up to a size class (target_pool::class_bytes: from 64 KiB in steps
of a quarter, each a multiple of the 64 KiB alignment the class allocations get, at most a block, and no fewer to a block than
without classes where fewer than 8 fit) with vmaAllocateMemory in the targets' blocks, tagged as theirs and with a render target's
priority, and the image bound with vmaCreateAliasingImage; refused, it is made as before. The pool indexes such allocations by
memory type and class, so pool_take_memory finds the oldest of a class in one look-up before its scan, and a pooled class
allocation fits any need of its class.

The cost, over the requirement rounded to 64 KiB: at most a quarter, 6% on average over sizes spread evenly from 64 KiB to 16 MB
and 8.7% over square D32 shadow maps of 384 to 1920 (16.5% over the exact requirement, the small ones' 64 KiB steps), all of it
counted in the budget (x.pad), the pool's bytes and the images' account.

Unset, the level is now 2 on an integrated GPU, the configuration measured there: on a Steam Deck OLED (Minimum preset, Render
50%, Hyrule Field's camera turn), seven runs of level 2 with the 64-present hold across three blocks ran at 31.3-34.4 fps, all
above every control of those blocks (28.3-31.3, six runs); level 1 with the hold has two runs (31.0 and 33.8), so it is less
measured, not shown worse. On a discrete GPU the level stays 1: the classes' memory is certain there and their gain unmeasured.

Assisted-by: Claude
Author
Contributor

Tested in game: Earlier builds of this change (the same code but for review fixes): Steam Deck OLED, SteamOS 3.9.5, RADV (Mesa 26.2.0-devel), Kokiri Forest and Hyrule Field at Minimum, Render 50% and 100%: no error or picture difference in 23 runs. This head has not run in the game yet.

Tested in game: Earlier builds of this change (the same code but for review fixes): Steam Deck OLED, SteamOS 3.9.5, RADV (Mesa 26.2.0-devel), Kokiri Forest and Hyrule Field at Minimum, Render 50% and 100%: no error or picture difference in 23 runs. This head has not run in the game yet.
Author
Contributor

Measured at this change's head 540f552de on a Steam Deck OLED against main 38990574a (18 interleaved runs), and rebased onto main 868f6be87: the eight code commits are unchanged (git range-diff: all =), plus one commit with the 18 runs' files under docs/tested/. The description's Measurements, Testing, Risks and checklist now describe this head instead of earlier builds. Headline: at Render 50%, where the host sets the frame rate, the Hyrule Field turn runs 33.64 fps against 32.60 (all three runs above all of main's), with a 1% low of 15.7 against 13.1 and fewer long frames. At Render 100%, where the GPU's work is most of the frame, fps does not change (about 29.2 on every arm); it swaps less and has fewer long frames, but its 1% and 0.1% lows are slightly below main's, which three runs a side do not separate, so the PR stays WIP on that and on the Windows build.

Measured at this change's head 540f552de on a Steam Deck OLED against main 38990574a (18 interleaved runs), and rebased onto main 868f6be87: the eight code commits are unchanged (`git range-diff`: all `=`), plus one commit with the 18 runs' files under `docs/tested/`. The description's Measurements, Testing, Risks and checklist now describe this head instead of earlier builds. Headline: at Render 50%, where the host sets the frame rate, the Hyrule Field turn runs 33.64 fps against 32.60 (all three runs above all of main's), with a 1% low of 15.7 against 13.1 and fewer long frames. At Render 100%, where the GPU's work is most of the frame, fps does not change (about 29.2 on every arm); it swaps less and has fewer long frames, but its 1% and 0.1% lows are slightly below main's, which three runs a side do not separate, so the PR stays WIP on that and on the Windows build.
zeldaootr force-pushed vk-target-reuse-memory from 540f552ded
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to d018c58232
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-19 12:05:50 +00:00
Compare
Contributor

Test of render-target memory reuse (RX_VK_TARGET_REUSE_MEMORY) on a second Steam Deck OLED, to see whether the switch changes frame rate, frame-time tails or CPU on our route, and whether reuse shows any picture fault.

What was tested. This PR's code at 540f552d on base 38990574. The timed runs used one binary on the Deck's built-in 1280×800 panel, Render 50%, frame generation off, on AC at 15 W with the same clock policy and restored save. O disables by-size memory reuse, not all render-target pooling; R also enables size-class allocations and longer pool retention. This compares that bundle. The separate visual runs used the matched coverage build. O = RX_VK_TARGET_REUSE_MEMORY=0, R = unset (the PR's default, level 2 on this integrated GPU). Route: Kokiri Forest standing 120 s (K), then a debug teleport to the Field: standing 60 s (FS1), the camera turning 60 s (F), standing again 60 s (FS2). One warm-up per arm, then four fixed pairs in the order R/O, O/R, R/O, O/R. A pair counts only if both windows pass the logged shader/pipeline and queued-work checks. One warm-up turn and two scored turns were excluded (2.O and 3.R), leaving rounds 1 and 4 for F.

Results. R minus O within each admitted pair. Values are paired medians unless both round 1 and round 4 differences are shown; ranges are given where listed. CPU is game-process CPU ms per renderer present.

Window Admitted pairs FPS, R − O p95 frame time, R − O p99, R − O Frames > 100 ms (R − O) CPU per present, R − O
Kokiri standing (K) 4 about −0.09 (arm medians: R 25.91, O 25.99 FPS), lower in all 4 +0.45 ms (−0.30 to +0.80) +0.85 ms (0 to +3.0) 0 (one >100 ms frame in one R window) +0.47 ms
Field standing before the turn (FS1) 4 +0.21 (−0.09 to +0.75) −0.50 ms −0.25 ms 0 −0.18 ms
Field turn (F) 2 (rounds 1 and 4) about +1.0 (+0.33, +1.66) −2.30, −3.10 ms −2.40, −10.30 ms −4, −1 −1.07, −3.98 ms
Field standing after the turn (FS2) 4 −3.12 (−5.84 to +0.38) +3.75 ms +2.50 ms 0 +3.93 ms

FS2 starts where the turn leaves the camera. We can report the observed −3.12 FPS, but cannot separate a switch effect from the different views. In K, median frame time was about 38 ms in both arms.

Pictures.

  • A safety pair with the per-present flash detector covering every present of every window: 0 flagged frames.
  • A dense visual pair at the renderer's 1280x720 capture size: the first 30 frames of every window plus the whole teleport transition, 636 frames in all (312 O, 324 R), each inspected at full resolution with no scaling. No R-only defect was seen in those frames. Both arms faded out, showed the loading indicator, and faded into the Field; no stale Kokiri content was seen during loading or after arrival.
  • No crash or device loss was observed; no validation error was logged.

Head. These are 540f552d's code on base 38990574, not today's rebase d018c582 onto 868f6be87. Per your comment (#1681 (comment)) the eight code commits are unchanged by the rebase, but we have not run d018c582. Your 33.64 vs 32.60 FPS at Render 50% compared 540f552d against main 38990574. Ours is level 2 vs 0 in the same 540f552d binary on our route, so the two deltas are not directly comparable.

Limits.

  • One Deck, one route, one order of pairs; four pairs (two for the turn).
  • Descriptive differences, not a significance test or a claim that the switch is faster.
  • The pictures are sampled windows and one transition, not the whole game.
  • Pool counters and memory pressure are not reported here; their analysis is pending.
Test of render-target memory reuse (`RX_VK_TARGET_REUSE_MEMORY`) on a second Steam Deck OLED, to see whether the switch changes frame rate, frame-time tails or CPU on our route, and whether reuse shows any picture fault. **What was tested.** This PR's code at 540f552d on base 38990574. The timed runs used one binary on the Deck's built-in 1280×800 panel, Render 50%, frame generation off, on AC at 15 W with the same clock policy and restored save. O disables by-size memory reuse, not all render-target pooling; R also enables size-class allocations and longer pool retention. This compares that bundle. The separate visual runs used the matched coverage build. O = `RX_VK_TARGET_REUSE_MEMORY=0`, R = unset (the PR's default, level 2 on this integrated GPU). Route: Kokiri Forest standing 120 s (K), then a debug teleport to the Field: standing 60 s (FS1), the camera turning 60 s (F), standing again 60 s (FS2). One warm-up per arm, then four fixed pairs in the order R/O, O/R, R/O, O/R. A pair counts only if both windows pass the logged shader/pipeline and queued-work checks. One warm-up turn and two scored turns were excluded (2.O and 3.R), leaving rounds 1 and 4 for F. **Results.** R minus O within each admitted pair. Values are paired medians unless both round 1 and round 4 differences are shown; ranges are given where listed. CPU is game-process CPU ms per renderer present. | Window | Admitted pairs | FPS, R − O | p95 frame time, R − O | p99, R − O | Frames > 100 ms (R − O) | CPU per present, R − O | |---|---|---|---|---|---|---| | Kokiri standing (K) | 4 | about −0.09 (arm medians: R 25.91, O 25.99 FPS), lower in all 4 | +0.45 ms (−0.30 to +0.80) | +0.85 ms (0 to +3.0) | 0 (one >100 ms frame in one R window) | +0.47 ms | | Field standing before the turn (FS1) | 4 | +0.21 (−0.09 to +0.75) | −0.50 ms | −0.25 ms | 0 | −0.18 ms | | Field turn (F) | 2 (rounds 1 and 4) | about +1.0 (+0.33, +1.66) | −2.30, −3.10 ms | −2.40, −10.30 ms | −4, −1 | −1.07, −3.98 ms | | Field standing after the turn (FS2) | 4 | −3.12 (−5.84 to +0.38) | +3.75 ms | +2.50 ms | 0 | +3.93 ms | FS2 starts where the turn leaves the camera. We can report the observed −3.12 FPS, but cannot separate a switch effect from the different views. In K, median frame time was about 38 ms in both arms. **Pictures.** - A safety pair with the per-present flash detector covering every present of every window: 0 flagged frames. - A dense visual pair at the renderer's 1280x720 capture size: the first 30 frames of every window plus the whole teleport transition, 636 frames in all (312 O, 324 R), each inspected at full resolution with no scaling. No R-only defect was seen in those frames. Both arms faded out, showed the loading indicator, and faded into the Field; no stale Kokiri content was seen during loading or after arrival. - No crash or device loss was observed; no validation error was logged. **Head.** These are 540f552d's code on base 38990574, not today's rebase d018c582 onto 868f6be87. Per your comment (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1681#issuecomment-54001) the eight code commits are unchanged by the rebase, but we have not run d018c582. Your 33.64 vs 32.60 FPS at Render 50% compared 540f552d against main 38990574. Ours is level 2 vs 0 in the same 540f552d binary on our route, so the two deltas are not directly comparable. **Limits.** - One Deck, one route, one order of pairs; four pairs (two for the turn). - Descriptive differences, not a significance test or a claim that the switch is faster. - The pictures are sampled windows and one transition, not the whole game. - Pool counters and memory pressure are not reported here; their analysis is pending.
Author
Contributor

@dukenheimer thank you: a same-binary pair on a second OLED and on the panel is the cell this PR lacked, and the picture check (636 frames, the flash detector over every present) is more than I had done.

How I read it next to ours: the turn moves the same way on both Decks (yours about +1 fps with lower p95 and p99 in the two admitted pairs; ours 33.6 against 32.6 against main), and standing before the turn is flat on both. Two things I take as open rather than explained:

  • Standing after the turn, -3.1 fps in your pairs. Ours does not report that window by arm, so I can't confirm or contradict it yet. One mechanism would make it real rather than a difference of view: with the 64-present hold the pool is still holding what the turn filled it with (in our runs it peaks at 455-484 MB at Render 50%, above the 392 MB its cap works out to, which the description lists as unexplained), and that is memory the next seconds don't have. I'll score that window by arm in our existing 18 runs and add more if they don't settle it.
  • Kokiri, -0.09 fps in all four pairs. Small, but the same sign every time; our Kokiri standing numbers are flat within noise (17.75 / 17.85 / 17.89). I'll look at whether the size classes cost anything there.

The PR stays WIP on those and on the Render 100% lows. If your pool counters and memory pressure analysis shows the pool's size across the turn and the seconds after it, that would speak to the first point directly.

@dukenheimer thank you: a same-binary pair on a second OLED and on the panel is the cell this PR lacked, and the picture check (636 frames, the flash detector over every present) is more than I had done. How I read it next to ours: the turn moves the same way on both Decks (yours about +1 fps with lower p95 and p99 in the two admitted pairs; ours 33.6 against 32.6 against main), and standing before the turn is flat on both. Two things I take as open rather than explained: - **Standing after the turn, -3.1 fps in your pairs.** Ours does not report that window by arm, so I can't confirm or contradict it yet. One mechanism would make it real rather than a difference of view: with the 64-present hold the pool is still holding what the turn filled it with (in our runs it peaks at 455-484 MB at Render 50%, above the 392 MB its cap works out to, which the description lists as unexplained), and that is memory the next seconds don't have. I'll score that window by arm in our existing 18 runs and add more if they don't settle it. - **Kokiri, -0.09 fps in all four pairs.** Small, but the same sign every time; our Kokiri standing numbers are flat within noise (17.75 / 17.85 / 17.89). I'll look at whether the size classes cost anything there. The PR stays WIP on those and on the Render 100% lows. If your pool counters and memory pressure analysis shows the pool's size across the turn and the seconds after it, that would speak to the first point directly.
Author
Contributor

The standing-after-the-turn window by arm, from the 18 runs already in this PR (fps over the 70-81 s after the last pan; C = main 38990574a, R = this PR at its default, L = RX_VK_TARGET_REUSE_MEMORY=1, Z = =0 on the PR's build):

C R L Z
Render 50% 33.72 / 36.83 / 37.73 39.48 / 38.69 / 32.28 39.49 / 38.35 / 37.35 40.29
Render 100% 31.24 / 27.54 / 29.25 28.94 / 29.00 / 32.70 28.67 / 29.05

Medians: Render 50% C 36.83, R 38.69, L 38.35; Render 100% C 29.25, R 29.00, L 28.86. So our runs do not show the deficit, but they would not show a 3 fps one reliably either: that window swings by 5-7 fps between runs of the same arm (R at 50%: 32.3 to 39.5; C: 33.7 to 37.7), more than any arm difference. As you said for yours, where the turn leaves the camera differs by run. The Kokiri standing medians are C 17.75, R 17.85, L 17.89 at 50% and C 17.33, R 18.01, L 16.76 at 100%: no sign of a cost there in ours.

I'll leave the after-turn point open in the description rather than call it noise: an anchored view after the turn (the camera returned to a fixed heading before the window) is what would settle it, and I'll add that to the next block.

The standing-after-the-turn window by arm, from the 18 runs already in this PR (fps over the 70-81 s after the last pan; C = main 38990574a, R = this PR at its default, L = `RX_VK_TARGET_REUSE_MEMORY=1`, Z = `=0` on the PR's build): | | C | R | L | Z | |---|---|---|---|---| | Render 50% | 33.72 / 36.83 / 37.73 | 39.48 / 38.69 / 32.28 | 39.49 / 38.35 / 37.35 | 40.29 | | Render 100% | 31.24 / 27.54 / 29.25 | 28.94 / 29.00 / 32.70 | 28.67 / 29.05 | | Medians: Render 50% C 36.83, R 38.69, L 38.35; Render 100% C 29.25, R 29.00, L 28.86. So our runs do not show the deficit, but they would not show a 3 fps one reliably either: that window swings by 5-7 fps between runs of the same arm (R at 50%: 32.3 to 39.5; C: 33.7 to 37.7), more than any arm difference. As you said for yours, where the turn leaves the camera differs by run. The Kokiri standing medians are C 17.75, R 17.85, L 17.89 at 50% and C 17.33, R 18.01, L 16.76 at 100%: no sign of a cost there in ours. I'll leave the after-turn point open in the description rather than call it noise: an anchored view after the turn (the camera returned to a fixed heading before the window) is what would settle it, and I'll add that to the next block.
Contributor

@zeldaootr on the pool across the turn and after it, from our raw logs at 540f552d:

At 540f552d the logged pool cap was 487 MiB in all four measured rounds. For the two jointly admitted turns (rounds 1/4), sampled high-water marks were O 65/48 versus R 307/315 MiB. R's two successive samples between the F and FS2 window boundaries were 456→0, 78→6, 352→86 and 303→0 MiB by round. In FS2 itself R's sampled maxima were 319/4/196/0 MiB; each round's last sample had zero pooled images. In round 1 it went from zero back up to 319 during FS2. These are point readings every 600 renderer presents, not continuous maxima or exact window-end values. They show intermittent occupancy rather than a pool observed full throughout FS2; they don't establish what caused the FPS difference or rule out an earlier pressure effect.

System-wide memory PSI some, O→R, was 14.1→6.1% and 13.5→8.2% in the two admitted turn pairs. That is the whole system, not game CPU, and not proof that pool size caused it.

@zeldaootr on the pool across the turn and after it, from our raw logs at 540f552d: At 540f552d the logged pool cap was 487 MiB in all four measured rounds. For the two jointly admitted turns (rounds 1/4), sampled high-water marks were O 65/48 versus R 307/315 MiB. R's two successive samples between the F and FS2 window boundaries were 456→0, 78→6, 352→86 and 303→0 MiB by round. In FS2 itself R's sampled maxima were 319/4/196/0 MiB; each round's last sample had zero pooled images. In round 1 it went from zero back up to 319 during FS2. These are point readings every 600 renderer presents, not continuous maxima or exact window-end values. They show intermittent occupancy rather than a pool observed full throughout FS2; they don't establish what caused the FPS difference or rule out an earlier pressure effect. System-wide memory PSI `some`, O→R, was 14.1→6.1% and 13.5→8.2% in the two admitted turn pairs. That is the whole system, not game CPU, and not proof that pool size caused it.
Author
Contributor

@dukenheimer thank you, and your cap line corrects an error of mine. I wrote (in the description's Risks and in my comment above) that the pool peaked "above the 392 MB its cap works out to" and that this was unexplained. That 392 was a figure I had worked out, not read. Our own logs say what yours do: vk: render target pool: up to 486 MB (RX_VK_TARGET_POOL_MB) (486 to 489 across runs). So the peaks of 455-484 MB at Render 50% are under the cap, nothing is unexplained there, and the plain reading is that in the turn the pool fills close to its cap. The description is corrected.

On your samples after the turn: 456→0, 78→6, 352→86 and 303→0 MiB between the two window boundaries, and zero pooled images at each round's last sample, say the pool drains within the 64-present hold once the turn stops, as designed, and is not sitting full through the standing window. That weakens my own suggestion that held memory explains your -3 fps there, without ruling out what the turn left behind in the system (your PSI line is the other side of that: 14.1→6.1 % and 13.5→8.2 % in the turn itself). The anchored after-turn window is still what I'll run to settle it.

@dukenheimer thank you, and your cap line corrects an error of mine. I wrote (in the description's Risks and in my comment above) that the pool peaked "above the 392 MB its cap works out to" and that this was unexplained. That 392 was a figure I had worked out, not read. Our own logs say what yours do: `vk: render target pool: up to 486 MB (RX_VK_TARGET_POOL_MB)` (486 to 489 across runs). So the peaks of 455-484 MB at Render 50% are under the cap, nothing is unexplained there, and the plain reading is that in the turn the pool fills close to its cap. The description is corrected. On your samples after the turn: 456→0, 78→6, 352→86 and 303→0 MiB between the two window boundaries, and zero pooled images at each round's last sample, say the pool drains within the 64-present hold once the turn stops, as designed, and is not sitting full through the standing window. That weakens my own suggestion that held memory explains your -3 fps there, without ruling out what the turn left behind in the system (your PSI line is the other side of that: 14.1→6.1 % and 13.5→8.2 % in the turn itself). The anchored after-turn window is still what I'll run to settle it.
zeldaootr force-pushed vk-target-reuse-memory from d018c58232
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 351ead0caa
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-19 21:13:03 +00:00
Compare
Author
Contributor

Rebased onto main a433db328 (the eight code commits unchanged, git range-diff all =), with 12 more Steam Deck OLED runs and their files under docs/tested/. At Render 100%, six runs a side don't separate this PR from main: the turn runs 29.37 fps against 29.34, and the 1% / 0.1% lows (13.63 / 9.06 against 14.57 / 10.91) sit inside main's own range, above main's in 13 of 36 pairings. Standing after the turn, with the camera turned back to its heading before the turn first, shows no difference at Render 50% (33.27 against 34.40 fps, 34.39 without R2, the one run whose draws missed the 10% check). Now that #1729 is merged, the renderer builds for Windows with llvm-mingw (213 files, longshot_vk.dll linked), so the description now ticks both remaining boxes and lists every cost measured under Risks. Thank you @dukenheimer for the independent run on a second Deck OLED: the same-binary pairs, the 636 inspected frames and the pool readings after the turn are what pointed me to the anchored window, and the description now cites both comments.

Rebased onto main a433db328 (the eight code commits unchanged, `git range-diff` all `=`), with 12 more Steam Deck OLED runs and their files under `docs/tested/`. At Render 100%, six runs a side don't separate this PR from main: the turn runs 29.37 fps against 29.34, and the 1% / 0.1% lows (13.63 / 9.06 against 14.57 / 10.91) sit inside main's own range, above main's in 13 of 36 pairings. Standing after the turn, with the camera turned back to its heading before the turn first, shows no difference at Render 50% (33.27 against 34.40 fps, 34.39 without R2, the one run whose draws missed the 10% check). Now that https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1729 is merged, the renderer builds for Windows with llvm-mingw (213 files, `longshot_vk.dll` linked), so the description now ticks both remaining boxes and lists every cost measured under Risks. Thank you @dukenheimer for the independent run on a second Deck OLED: the same-binary pairs, the 636 inspected frames and the pool readings after the turn are what pointed me to the anchored window, and the description now cites both comments.
zeldaootr changed title from WIP: perf(vk): render targets take a pooled image's memory by size, and the pool holds longer on integrated GPUs to perf(vk): render targets take a pooled image's memory by size, and the pool holds longer on integrated GPUs 2026-11-19 21:14:52 +00:00
Author
Contributor

For the record here: omgitsgela ran this PR on a Steam Deck LCD, the switch off against the default in one binary, in three areas (#1477, their comments of 2026-11-19 21:05 and 21:07). Their reading, which I agree with: no demonstrated fps win in any cell, and not proof of no effect. The one pair per cell that passed their scene-match gate: Hyrule Field median 39.93 ms with the default against 40.04 off (p99 -11.0 ms, 22 fewer frames over 50 ms, inside their A/A floor); Castle Town 43.64 against 42.42 (the default slightly behind); Kokiri gave no admitted pair.

That is the same picture as this PR's Render 100% rows on the OLED: where the frame is not waiting on the host's allocations, the frame rate does not move. The gain measured here is at Render 50% on the OLED (33.6 against 32.6 fps in the turn), and dukenheimer's same-binary pairs at Render 50% went the same way. So the claim stays as the description has it: it helps the turn where the host sets the frame rate, and is neutral elsewhere. Thank you @omgitsgela for the LCD cells.

For the record here: omgitsgela ran this PR on a Steam Deck LCD, the switch off against the default in one binary, in three areas (https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1477, their comments of 2026-11-19 21:05 and 21:07). Their reading, which I agree with: no demonstrated fps win in any cell, and not proof of no effect. The one pair per cell that passed their scene-match gate: Hyrule Field median 39.93 ms with the default against 40.04 off (p99 -11.0 ms, 22 fewer frames over 50 ms, inside their A/A floor); Castle Town 43.64 against 42.42 (the default slightly behind); Kokiri gave no admitted pair. That is the same picture as this PR's Render 100% rows on the OLED: where the frame is not waiting on the host's allocations, the frame rate does not move. The gain measured here is at Render 50% on the OLED (33.6 against 32.6 fps in the turn), and dukenheimer's same-binary pairs at Render 50% went the same way. So the claim stays as the description has it: it helps the turn where the host sets the frame rate, and is neutral elsewhere. Thank you @omgitsgela for the LCD cells.
zeldaootr force-pushed vk-target-reuse-memory from 351ead0caa
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 4s
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
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 742b053ae6
Some checks reported errors
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (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
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/windows+amd 1/1 fail
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 0/1 pass, 2 error
beanstalk/linux+nvidia 0/1 pass, 2 error
beanstalk/linux+amd 0/1 pass, 2 error
beanstalk/steamdeck 0/1 pass, 0 running, 0 queued
beanstalk/windows+intel 0/1 pass, 0 running, 0 queued
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/any 0/1 pass, 0 running, 0 queued
2026-11-20 03:40:09 +00:00
Compare
Author
Contributor

Rebased onto main 068fb8ebe, the docs and tools revamp (head 742b053ae, the eight code commits kept, the code unchanged except that one comment drops a pull request number, to match main's comment sweep). docs/development.md is gone, so this PR's text on RX_VK_TARGET_REUSE_MEMORY is now a row in the Memory table of docs/dev/reference/switches.md, which tests/test_target_reuse_memory.py reads. Main removed the tested-configurations catalogue, so the two commits with the 30 docs/tested/ run files are dropped; their numbers stay in the description's Measurements, which now follows the new template and also records omgitsgela's Deck LCD cells in Testing. The game-free checks fail nothing that main doesn't also fail on this PC; the measurements are from 540f552de and have not been run again.

Rebased onto main 068fb8ebe, the docs and tools revamp (head 742b053ae, the eight code commits kept, the code unchanged except that one comment drops a pull request number, to match main's comment sweep). `docs/development.md` is gone, so this PR's text on `RX_VK_TARGET_REUSE_MEMORY` is now a row in the *Memory* table of `docs/dev/reference/switches.md`, which `tests/test_target_reuse_memory.py` reads. Main removed the tested-configurations catalogue, so the two commits with the 30 `docs/tested/` run files are dropped; their numbers stay in the description's Measurements, which now follows the new template and also records omgitsgela's Deck LCD cells in Testing. The game-free checks fail nothing that main doesn't also fail on this PC; the measurements are from 540f552de and have not been run again.
Owner

@Beanstalk

@Beanstalk
Member
Beanstalk test farm · an earlier run: commit 742b053 (the newer results are in a comment below)

Commit 742b053 · approved by HumanBean (reviewed) · dashboard

Started at 18:55 UTC.

Estimate: done in about 1 h, from the queue and the testers online now.

Target Result Reports Frame time p99 (ms), main → PR VRAM peak (MB) Crashes
any ⏳ queued 0 of 1 — — —
What was tested

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

The plan compares main and the PR in Hyrule Field during repeated camera turns and a standing period afterward, where changing shadow-map sizes exercise render-target reuse. It takes about 12 minutes per tester and records whole-run hitches, standing frametimes, VRAM use, and a comparison image. Crashes, device loss, substantial performance or memory regressions, or a material image difference fail the test; a speedup is not required.

  • Where: any (any PC, 1-2 reports).
  • field-turns: from the repository's save kokiri-start, then teleport to Hyrule Field, 8 times: move the stick, measure standing for 20 s (after 5 s warm-up), take the picture field-after-turns to compare with main; 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, VRAM use, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 5%; or peak VRAM is more than 20% above main; or hitches over 50 ms in the whole run is more than 30% above main; or frame time (p99) is more than 20% above main; or forbidden log lines is above 0.
  • Time: about 11 min of game runs per tester (2 game starts), plus the two builds.
<!-- beanstalk:previous --> <details><summary>Beanstalk test farm · an earlier run: commit <code>742b053</code> (the newer results are in a comment below)</summary> Commit `742b053` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/1681) Started at 18:55 UTC. **Estimate:** done in about 1 h, from the queue and the testers online now. | Target | Result | Reports | Frame time p99 (ms), main → PR | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | --- | | `any` | ⏳ queued | 0 of 1 | — | — | — | <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares main and the PR in Hyrule Field during repeated camera turns and a standing period afterward, where changing shadow-map sizes exercise render-target reuse. It takes about 12 minutes per tester and records whole-run hitches, standing frametimes, VRAM use, and a comparison image. Crashes, device loss, substantial performance or memory regressions, or a material image difference fail the test; a speedup is not required. - **Where:** any (any PC, 1-2 reports). - **field-turns:** from the repository's save `kokiri-start`, then teleport to Hyrule Field, 8 times: move the stick, measure standing for 20 s (after 5 s warm-up), take the picture field-after-turns to compare with main; 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, VRAM use, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 5%; or peak VRAM is more than 20% above main; or hitches over 50 ms in the whole run is more than 30% above main; or frame time (p99) is more than 20% above main; or forbidden log lines is above 0. - **Time:** about 11 min of game runs per tester (2 game starts), plus the two builds. </details> </details>
Owner

@Beanstalk please test this, to decide the real default of RX_VK_TARGET_REUSE_MEMORY. Same build of this PR, the switch as a matrix axis: =0 (main's behavior), =1 and =2, interleaved. Targets: windows+nvidia, windows+amd, windows+intel, linux+nvidia, linux+amd, steamdeck (igpu targets are where =2 is the default today). Windowed, not headless, frame generation off: Hyrule Field with the camera turning full circle several times (Render 50% and 100% on the Deck and any iGPU), then standing. Report fps, 1% low, frames over 50 ms, p99, the pool's peak MB, lowest available memory and the log's render target images: line (reused by size), per level. We want to know if =1, =2, or off should be the default on each kind of PC (discrete, integrated, Deck), and whether any picture fault, device loss or memory pressure shows up.

@Beanstalk please test this, to decide the real default of `RX_VK_TARGET_REUSE_MEMORY`. Same build of this PR, the switch as a matrix axis: `=0` (main's behavior), `=1` and `=2`, interleaved. Targets: windows+nvidia, windows+amd, windows+intel, linux+nvidia, linux+amd, steamdeck (igpu targets are where `=2` is the default today). Windowed, not headless, frame generation off: Hyrule Field with the camera turning full circle several times (Render 50% and 100% on the Deck and any iGPU), then standing. Report fps, 1% low, frames over 50 ms, p99, the pool's peak MB, lowest available memory and the log's `render target images:` line (`reused by size`), per level. We want to know if `=1`, `=2`, or off should be the default on each kind of PC (discrete, integrated, Deck), and whether any picture fault, device loss or memory pressure shows up.
Member

Beanstalk test farm · 🔄 testing (8 of 6 reports so far, a failure already)

Commit 742b053 · approved by HumanBean (reviewed) · dashboard

Done (started 18:59 UTC, last report 22:19 UTC). Run 2: re-planned by HumanBean. Comment @Beanstalk to run it again.

Target Result Reports VRAM peak (MB) Crashes
windows+nvidia ⚠️ couldn't be judged (an outlier) 2 1 2 9,301 → 9,420 (+1%) none
windows+amd ❌ fail (an outlier) 2 1 2 5,868 → 6,120 (+4%) none
windows+intel ⏳ queued 0 of 1 — —
linux+nvidia ⚠️ couldn't be judged (an outlier) 2 1 2 — none
linux+amd ⚠️ couldn't be judged (an outlier) 2 1 2 — none
steamdeck ⏳ queued 0 of 1 — —

field-turn-and-stand · frame time p99 (ms)

Target main RX_VK_TARGET_REUSE_MEMORY=0 (reference) RX_VK_TARGET_REUSE_MEMORY=1 RX_VK_TARGET_REUSE_MEMORY=2
windows+nvidia 18.7 19.3 — —
windows+amd 19.3 19.1 19.0 (−1%) 20.0 (+5%)
windows+intel — — — —
linux+nvidia — — — —
linux+amd — — — —
steamdeck — — — —

Why it failed

  • windows+amd: field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) screenshot.max_diff: limit 0.1
  • windows+amd: field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) screenshot.max_diff: limit 0.1

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, report 1: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
  • windows+nvidia, report 2: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
  • windows+amd, report 1: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
  • linux+nvidia, report 1: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
  • linux+nvidia, report 2: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
  • linux+amd, report 1: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
  • linux+amd, report 2: no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)
What was tested

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

In Hyrule Field, the plan compares reuse levels 0, 1 and 2 on the PR build, with main also run because the memory-type safety check remains active at level 0. It turns the camera and then measures standing performance, captures pictures, and samples pool occupancy, reuse counts, VRAM and hitch metrics over roughly 35 minutes per tester. Crashes, device loss, large picture differences or a substantial standing p99 regression against level 0 fail the plan. Windows Intel waits for a matching tester; the farm cannot run windowed or measure lowest available system memory, and the turning input cannot overlap a timed measurement segment. No tester online now matches windows+intel: that target waits for one.

  • Where: windows+nvidia (1-2 reports), windows+amd (1-2 reports), windows+intel (1-2 reports), linux+nvidia (1-2 reports), linux+amd (1-2 reports), steamdeck (1-2 reports).
  • Matrix: 3 cells, each on main and the PR: RX_VK_TARGET_REUSE_MEMORY 0 or 1 or 2 (PR only).
  • field-turn-and-stand: from the repository's save kokiri-start (settings fullscreen=0, frame_generation=0), then teleport to Hyrule Field, take the picture field-before to compare with main, 4 times: move the stick, take the picture field-after-turn to compare with main, measure standing for 25 s (after 5 s warm-up), take the picture field-standing to compare with main; 1 run on each side for each of 3 cells (3 game starts a run).
  • Measured: crashes, frame times, stutters and hitches, draws and frame rate, VRAM use, the game's log, numbers from the game's log.
  • The PR fails if: it crashes; or the PR's frame time (p99) in standing with RX_VK_TARGET_REUSE_MEMORY=1 is more than 20% above RX_VK_TARGET_REUSE_MEMORY=0; or the PR's frame time (p99) in standing with RX_VK_TARGET_REUSE_MEMORY=2 is more than 20% above RX_VK_TARGET_REUSE_MEMORY=0; or a picture differs from main by more than 15%; or forbidden log lines is above 0.
  • Time: about 34 min of game runs per tester (6 game starts), plus the two builds.
Measurements on `windows+nvidia`, for the PR description

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

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3090, 621.1.0 AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM; 2: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5080, 621.24.0 AMD Ryzen 9 9900X3D 12-Core Processor, 64 GB RAM
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 068fb8e After: this PR @ 742b053
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · standing · frame time (p99) (ms) 18.7 19.3 (+3%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · standing · peak VRAM (MB) 9,301 9,420 (+1%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · standing · frame time (p99) (ms) 19.0 18.4 (−3%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · standing · peak VRAM (MB) 10,040 9,374 (−7%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TARGET_REUSE_MEMORY switch the PR adds (set on the PR side only) 0, 1, 2 not in main the PR's default field-turn-and-stand, main without it → the PR with 0: 18.7 → 19.3 (+3%) doesn't help

As Markdown for the PR description:

## Measurements

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

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 621.24.0` `AMD Ryzen 9 9900X3D 12-Core Processor, 64 GB RAM`  
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 068fb8e | After: this PR @ 742b053 |
|---|---|---|
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · frame time (p99) (ms) | 18.7 | 19.3 (+3%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · peak VRAM (MB) | 9,301 | 9,420 (+1%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · frame time (p99) (ms) | 19.0 | 18.4 (−3%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · peak VRAM (MB) | 10,040 | 9,374 (−7%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: 18.7 → 19.3 (+3%) | doesn't help |
Measurements on `windows+amd`, for the PR description

Verdict: fail on windows+amd (2 reports): field-turn-and-stand screenshot.max_diff failed.

Hardware: 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9060 XT, 2.0.416 AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM; 2: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 7700 8-Core Processor, 32 GB RAM
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 068fb8e After: this PR @ 742b053
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · standing · frame time (p99) (ms) 19.3 19.1 (−1%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · standing · peak VRAM (MB) 6,524 5,344 (−18%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · standing · frame time (p99) (ms) 19.0 19.0 (−0%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · standing · peak VRAM (MB) 6,144 5,706 (−7%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · standing · frame time (p99) (ms) 19.5 20.0 (+3%)
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · standing · peak VRAM (MB) 6,177 6,192 (+0%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TARGET_REUSE_MEMORY switch the PR adds (set on the PR side only) 0, 1, 2 not in main the PR's default field-turn-and-stand, main without it → the PR with 0: 19.3 → 19.1 (−1%) no clear effect

As Markdown for the PR description:

## Measurements

**Verdict:** fail on windows+amd (2 reports): `field-turn-and-stand screenshot.max_diff` failed.

Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 7700 8-Core Processor, 32 GB RAM`  
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 068fb8e | After: this PR @ 742b053 |
|---|---|---|
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · frame time (p99) (ms) | 19.3 | 19.1 (−1%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · peak VRAM (MB) | 6,524 | 5,344 (−18%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · frame time (p99) (ms) | 19.0 | 19.0 (−0%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · peak VRAM (MB) | 6,144 | 5,706 (−7%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · frame time (p99) (ms) | 19.5 | 20.0 (+3%) |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · peak VRAM (MB) | 6,177 | 6,192 (+0%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: 19.3 → 19.1 (−1%) | no clear effect |
Measurements on `linux+nvidia`, for the PR description

Verdict: could not be judged on linux+nvidia (2 reports).

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1070, 580.196.7 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5080, 620.73.4 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 068fb8e After: this PR @ 742b053
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · forbidden log lines 0.0 0.0

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TARGET_REUSE_MEMORY switch the PR adds (set on the PR side only) 0, 1, 2 not in main the PR's default field-turn-and-stand, main without it → the PR with 0: not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on linux+nvidia (2 reports).

Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 620.73.4` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM`  
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 068fb8e | After: this PR @ 742b053 |
|---|---|---|
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: not measured | untested |
Measurements on `linux+amd`, for the PR description

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

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 6600 (RADV NAVI23), 26.2.6 AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM; 2: linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 068fb8e After: this PR @ 742b053
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · forbidden log lines 0.0 0.0
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · standing · frame time (p99) (ms) 23.5 —
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only) · standing · peak VRAM (MB) 5,117 —
field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=2 (PR only) · forbidden log lines 0.0 0.0

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TARGET_REUSE_MEMORY switch the PR adds (set on the PR side only) 0, 1, 2 not in main the PR's default field-turn-and-stand, main without it → the PR with 0: not measured untested

As Markdown for the PR description:

## Measurements

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

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.2.6` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`  
Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 068fb8e | After: this PR @ 742b053 |
|---|---|---|
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · frame time (p99) (ms) | 23.5 | — |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · peak VRAM (MB) | 5,117 | — |
| field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: not measured | untested |
The testers' hardware
Target Report Ran on
windows+nvidia 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3090, 621.1.0 AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM
windows+nvidia 2 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5080, 621.24.0 AMD Ryzen 9 9900X3D 12-Core Processor, 64 GB RAM
windows+amd 1 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9060 XT, 2.0.416 AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM
windows+amd 2 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 7700 8-Core Processor, 32 GB RAM
linux+nvidia 1 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1070, 580.196.7 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM
linux+nvidia 2 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 5080, 620.73.4 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
linux+amd 1 linux+amd+radv+dgpu AMD Radeon RX 6600 (RADV NAVI23), 26.2.6 AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM
linux+amd 2 linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM
<!-- beanstalk:sticky --> ### Beanstalk test farm · 🔄 testing (8 of 6 reports so far, a failure already) Commit `742b053` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/1681) Done (started 18:59 UTC, last report 22:19 UTC). Run 2: re-planned by HumanBean. Comment `@Beanstalk` to run it again. | Target | Result | Reports | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | | `windows+nvidia` | ⚠️ couldn't be judged (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_6cee7735e34d343e) [2](https://beanstalk.magicbean.dev/reports/rp_5fbbb71cda943ece) | 9,301 → 9,420 (+1%) | none | | `windows+amd` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_96a0b2a0ff63df85) [2](https://beanstalk.magicbean.dev/reports/rp_f7636aec02a28f17) | 5,868 → 6,120 (+4%) | none | | `windows+intel` | ⏳ queued | 0 of 1 | — | — | | `linux+nvidia` | ⚠️ couldn't be judged (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_b501478316215d49) [2](https://beanstalk.magicbean.dev/reports/rp_bc0d17a3bdb9533a) | — | none | | `linux+amd` | ⚠️ couldn't be judged (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_9a4f0a6f8dd38bb0) [2](https://beanstalk.magicbean.dev/reports/rp_4318d582d0bc4d50) | — | none | | `steamdeck` | ⏳ queued | 0 of 1 | — | — | **`field-turn-and-stand`** · frame time p99 (ms) | Target | main | `RX_VK_TARGET_REUSE_MEMORY=0` (reference) | `RX_VK_TARGET_REUSE_MEMORY=1` | `RX_VK_TARGET_REUSE_MEMORY=2` | | --- | --- | --- | --- | --- | | `windows+nvidia` | 18.7 | 19.3 | — | — | | `windows+amd` | 19.3 | 19.1 | 19.0 (−1%) | 20.0 (+5%) | | `windows+intel` | — | — | — | — | | `linux+nvidia` | — | — | — | — | | `linux+amd` | — | — | — | — | | `steamdeck` | — | — | — | — | **Why it failed** - `windows+amd`: `field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` `screenshot.max_diff`: `limit 0.1` - `windows+amd`: `field-turn-and-stand · RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` `screenshot.max_diff`: `limit 0.1` **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`, [report 1](https://beanstalk.magicbean.dev/reports/rp_6cee7735e34d343e): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` - `windows+nvidia`, [report 2](https://beanstalk.magicbean.dev/reports/rp_5fbbb71cda943ece): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` - `windows+amd`, [report 1](https://beanstalk.magicbean.dev/reports/rp_96a0b2a0ff63df85): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` - `linux+nvidia`, [report 1](https://beanstalk.magicbean.dev/reports/rp_b501478316215d49): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` - `linux+nvidia`, [report 2](https://beanstalk.magicbean.dev/reports/rp_bc0d17a3bdb9533a): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` - `linux+amd`, [report 1](https://beanstalk.magicbean.dev/reports/rp_9a4f0a6f8dd38bb0): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` - `linux+amd`, [report 2](https://beanstalk.magicbean.dev/reports/rp_4318d582d0bc4d50): `no scenario could be judged: a step ran out of time at step 2 (wait map HyruleField_Child): timeout: not met in time (then the game was in play on KokiriForest_Child)` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) In Hyrule Field, the plan compares reuse levels 0, 1 and 2 on the PR build, with main also run because the memory-type safety check remains active at level 0. It turns the camera and then measures standing performance, captures pictures, and samples pool occupancy, reuse counts, VRAM and hitch metrics over roughly 35 minutes per tester. Crashes, device loss, large picture differences or a substantial standing p99 regression against level 0 fail the plan. Windows Intel waits for a matching tester; the farm cannot run windowed or measure lowest available system memory, and the turning input cannot overlap a timed measurement segment. No tester online now matches windows+intel: that target waits for one. - **Where:** windows+nvidia (1-2 reports), windows+amd (1-2 reports), windows+intel (1-2 reports), linux+nvidia (1-2 reports), linux+amd (1-2 reports), steamdeck (1-2 reports). - **Matrix:** 3 cells, each on main and the PR: RX_VK_TARGET_REUSE_MEMORY `0` or `1` or `2` (PR only). - **field-turn-and-stand:** from the repository's save `kokiri-start` (settings fullscreen=0, frame_generation=0), then teleport to Hyrule Field, take the picture field-before to compare with main, 4 times: move the stick, take the picture field-after-turn to compare with main, measure standing for 25 s (after 5 s warm-up), take the picture field-standing to compare with main; 1 run on each side for each of 3 cells (3 game starts a run). - **Measured:** crashes, frame times, stutters and hitches, draws and frame rate, VRAM use, the game's log, numbers from the game's log. - **The PR fails if:** it crashes; or the PR's frame time (p99) in standing with RX_VK_TARGET_REUSE_MEMORY=1 is more than 20% above RX_VK_TARGET_REUSE_MEMORY=0; or the PR's frame time (p99) in standing with RX_VK_TARGET_REUSE_MEMORY=2 is more than 20% above RX_VK_TARGET_REUSE_MEMORY=0; or a picture differs from main by more than 15%; or forbidden log lines is above 0. - **Time:** about 34 min of game runs per tester (6 game starts), plus the two builds. </details> <details><summary>Measurements on `windows+nvidia`, for the PR description</summary> **Verdict:** could not be judged on windows+nvidia (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 621.24.0` `AMD Ryzen 9 9900X3D 12-Core Processor, 64 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · frame time (p99) (ms) | 18.7 | 19.3 (+3%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · peak VRAM (MB) | 9,301 | 9,420 (+1%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · frame time (p99) (ms) | 19.0 | 18.4 (−3%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · peak VRAM (MB) | 10,040 | 9,374 (−7%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: 18.7 → 19.3 (+3%) | doesn't help | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on windows+nvidia (2 reports). Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM`; 2: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 621.24.0` `AMD Ryzen 9 9900X3D 12-Core Processor, 64 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · frame time (p99) (ms) | 18.7 | 19.3 (+3%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · peak VRAM (MB) | 9,301 | 9,420 (+1%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · frame time (p99) (ms) | 19.0 | 18.4 (−3%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · peak VRAM (MB) | 10,040 | 9,374 (−7%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: 18.7 → 19.3 (+3%) | doesn't help | ``` </details> <details><summary>Measurements on `windows+amd`, for the PR description</summary> **Verdict:** fail on windows+amd (2 reports): `field-turn-and-stand screenshot.max_diff` failed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 7700 8-Core Processor, 32 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · frame time (p99) (ms) | 19.3 | 19.1 (−1%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · peak VRAM (MB) | 6,524 | 5,344 (−18%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · frame time (p99) (ms) | 19.0 | 19.0 (−0%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · peak VRAM (MB) | 6,144 | 5,706 (−7%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · frame time (p99) (ms) | 19.5 | 20.0 (+3%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · peak VRAM (MB) | 6,177 | 6,192 (+0%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: 19.3 → 19.1 (−1%) | no clear effect | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on windows+amd (2 reports): `field-turn-and-stand screenshot.max_diff` failed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 7700 8-Core Processor, 32 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · frame time (p99) (ms) | 19.3 | 19.1 (−1%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · standing · peak VRAM (MB) | 6,524 | 5,344 (−18%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · frame time (p99) (ms) | 19.0 | 19.0 (−0%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · peak VRAM (MB) | 6,144 | 5,706 (−7%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · frame time (p99) (ms) | 19.5 | 20.0 (+3%) | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · standing · peak VRAM (MB) | 6,177 | 6,192 (+0%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: 19.3 → 19.1 (−1%) | no clear effect | ``` </details> <details><summary>Measurements on `linux+nvidia`, for the PR description</summary> **Verdict:** could not be judged on linux+nvidia (2 reports). Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 620.73.4` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+nvidia (2 reports). Hardware: 1: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 620.73.4` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: not measured | untested | ``` </details> <details><summary>Measurements on `linux+amd`, for the PR description</summary> **Verdict:** could not be judged on linux+amd (2 reports). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.2.6` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · frame time (p99) (ms) | 23.5 | — | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · peak VRAM (MB) | 5,117 | — | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on linux+amd (2 reports). Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.2.6` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` Scene: field-turn-and-stand, from the repository's save kokiri-start (fullscreen=0, frame_generation=0); each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); field-turn-and-stand: 1 game start a side, standing 25 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 068fb8e | After: this PR @ 742b053 | |---|---|---| | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=0 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · forbidden log lines | 0.0 | 0.0 | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · frame time (p99) (ms) | 23.5 | — | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=1 (PR only)` · standing · peak VRAM (MB) | 5,117 | — | | field-turn-and-stand · `RX_VK_TARGET_REUSE_MEMORY=2 (PR only)` · forbidden log lines | 0.0 | 0.0 | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TARGET_REUSE_MEMORY` | switch the PR adds (set on the PR side only) | `0`, `1`, `2` | not in main | the PR's default | field-turn-and-stand, main without it → the PR with 0: not measured | untested | ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `windows+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_6cee7735e34d343e) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3090, 621.1.0` `AMD Ryzen 9 5900X 12-Core Processor, 128 GB RAM` | | `windows+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_5fbbb71cda943ece) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 621.24.0` `AMD Ryzen 9 9900X3D 12-Core Processor, 64 GB RAM` | | `windows+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_96a0b2a0ff63df85) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9060 XT, 2.0.416` `AMD Ryzen 5 5600 6-Core Processor, 32 GB RAM` | | `windows+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_f7636aec02a28f17) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 7700 8-Core Processor, 32 GB RAM` | | `linux+nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_b501478316215d49) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1070, 580.196.7` `Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 32 GB RAM` | | `linux+nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_bc0d17a3bdb9533a) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 5080, 620.73.4` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` | | `linux+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_9a4f0a6f8dd38bb0) | linux+amd+radv+dgpu `AMD Radeon RX 6600 (RADV NAVI23), 26.2.6` `AMD Ryzen 5 5600X 6-Core Processor, 64 GB RAM` | | `linux+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_4318d582d0bc4d50) | linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` | </details>
HumanBean deleted branch vk-target-reuse-memory 2026-11-20 22:25:53 +00:00
Some checks reported errors
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (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
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
beanstalk/windows+amd 1/1 fail
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/windows+nvidia 0/1 pass, 2 error
beanstalk/linux+nvidia 0/1 pass, 2 error
beanstalk/linux+amd 0/1 pass, 2 error
beanstalk/steamdeck 0/1 pass, 0 running, 0 queued
beanstalk/windows+intel 0/1 pass, 0 running, 0 queued
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/any 0/1 pass, 0 running, 0 queued
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1681
No description provided.