perf(vk): cut Market 1536x864 GPU time 2.9% (-80 MB VRAM, +1.0% FPS) across GPUs by keeping stock simulated turf on game buffers #2328

Merged
HumanBean merged 3 commits from Jer9/Longshot:perf/vk-sim-turf-stock-passthrough into mod-api 2026-11-28 01:24:10 +00:00
Contributor

Summary

Longshot's simulated-turf system keeps a private GPU copy of the game's grass buffers so it can grow them when dense grass overflows the Switch 2's stock buffer size (#2174). Previously, it allocated those private buffers (~28 MB) immediately at stock size and copied ~14.4 MB of grass data back into the game's buffers every single frame with a full-GPU barrier — even in areas with almost no grass (like cobblestone Market, 0–197 blades) or normal Hyrule Field (~17,000 blades, well under the 143,360-blade stock limit).

This PR lets simulated turf write directly into the game's own buffers whenever demand fits within stock capacity, eliminating the per-frame ~14.4 MB mirror copy, the full-GPU barrier, and the duplicate VRAM allocation game-wide (Hyrule Field, Market, Kokiri Forest, dungeons — every scene that uses simulated turf within stock capacity). If dense grass ever approaches the stock limit (>= 7/8 * stock), it seamlessly promotes to a larger private buffer just as before and retires it back to the game's buffer after 600 quiet frames.

Where this helps vs. where it doesn't:

  • What a player notices: Not directly visible by eye (+0.3% to +1.0% FPS is too small to feel without an FPS counter). Its real value is quiet, zero-downside efficiency — stopping ~14.4 MB/frame of wasted GPU memory bandwidth and freeing 48–80 MB of VRAM everywhere in the game, which gives extra headroom on tight 6–8 GB GPUs and iGPU laptops/handhelds (Steam Deck, 780M/860M/890M) sitting near a frame-rate or VRAM edge.
  • Helps: All GPUs (AMD RDNA 3.5 tested; NVIDIA/Intel/RADV pending) in GPU-bound scenes game-wide at normal/stock turf density (including normal Hyrule Field with ~54,000 blades and Market at 100% render scale). Eliminates the 0.422 ms turf mirror-copy span (< 0.093 ms, total m dispatch -10.1%), cuts GPU frame time -0.47 ms (-2.9%) at Market 100% render scale (1536x864) and -0.50 ms (-2.5%) at Hyrule Field 100% render scale (1382x864), saves -80 MB steady VRAM in Market 100% render scale (from avoiding the ~28 MB private buffers plus VMA 64/32 MB block granularity), and lifts Median FPS +1.0% in Market 100% render scale and +0.3% in Hyrule Field 100% render scale (all 3 rounds non-overlapping in both zones).
  • No measurable impact: CPU-bound scenes (such as Market 67% render scale, 1024x576, on this 8-CU iGPU, where GPU time sits around 12.4–12.8 ms inside an ~18.4 ms frame, so FPS/VRAM deltas fall within run-to-run variance) and extreme dense-turf settings that exceed 7/8 * stock (which intentionally promote to a private buffer like main).

Technical details:

  • Keep simulated-turf lists on the game's own buffer while policy.target() <= stock in adaptive mode (gpu/vk/vk_draw.cpp: sim_turf_private_binding() and sim_turf_bound_result()), leaving sim_turf_bound() empty so mirrors is empty (0 MB/frame copied).
  • Narrow sim_turf_sample_demand()'s post-copy barrier from ALL_COMMANDS_BIT | MEMORY_READ_BIT to HOST_BIT | COMPUTE_SHADER_BIT with HOST_READ_BIT access when mirrors.empty() (only the 4-byte demand readback copies ran), preserving the copy-to-compute execution dependency.
  • Keep RX_VK_SIM_TURF_ADAPTIVE=0 as a runtime A/B and kill switch (want_private = !sim_turf_adaptive() || g.policy.target() > stock; gpu/vk/switches.def updated) and guard the stock-passthrough descriptor fallback against RX_VK_SSBO_STRETCH=1 and RX_VK_SSBO_WIDE (&& !Shader::IsSimTurfStorage(d)).

Read first: sim_turf_private_binding() and sim_turf_sample_demand() in gpu/vk/vk_draw.cpp.

See #2174, #2093.

Testing

How to test:

  1. Game-free tests: Run python -I -B tests/test_sim_turf_stock_passthrough.py (fails on main, passes here) plus tests/test_sim_turf_floor.py, tests/test_sim_turf_capacity_policy.py, tests/test_sim_turf_pools.py, and tests/test_switch_table.py.
  2. Confirm passthrough is active: Run the game into Market or Hyrule Field and check longshot_log.txt for vk: simulated turf: prog 3de6d86ec7e6720e — it should log : the game's own instead of : the private one.
  3. Verify the GPU span drop: Run with RX_VK_PASS_TIMING=2 in Market; dispatch indirect prog 3de6d86ec7e6720e should drop from ~0.42 ms out of the top-25 spans (< 0.093 ms) and m dispatch should drop by ~0.45 ms.
  4. Measure FPS / GPU time / VRAM: Use a GPU-bound scene (e.g., Market or Hyrule Field at 100% render scale — avoid CPU-bound 67% render scale (1024x576) where GPU savings are hidden by CPU frame time). Compare main vs. this PR (or toggle RX_VK_SIM_TURF_ADAPTIVE=0 vs. =1 on this build) across >= 3 interleaved rounds with >= 12.5 s post-load settle.
  5. Visual & promotion check: Walk Market -> Hyrule Field -> Kokiri Forest and confirm grass renders cleanly with 0 VK_ERROR_DEVICE_LOST. Optionally raise turf density past 7/8 * stock in Hyrule Field to verify promotion to a private buffer and clean retirement after 600 quiet frames back in Market.

Tested: Windows 11 (build 26200), AMD Ryzen AI 7 350 + AMD Radeon 860M (8 CUs, RDNA 3.5 iGPU, Adrenalin 26.10.1), 1600x1000, handheld_profile=1, sharpness=80, vsync=0, amd_anti-lag_2=1, RX_VK_PRECOMPILE=1, >= 12.5 s post-load settle:

  • Market_Child fountain-first route (67% render scale 1024x576 3 interleaved rounds, 100% render scale 1536x864 3 interleaved rounds) + RX_VK_PASS_TIMING=2 (67% render scale, 1024x576): vk: simulated turf: prog 3de6d86ec7e6720e logged : the game's own; span dropped from 0.422 ms to < 0.093 ms (absent from top 25 spans; total m dispatch 4.515 -> 4.060 ms, -10.1%).
  • HyruleField_Child in-bounds grassy-field orbit (castle-gate, 100% render scale, 1382x864 at 16:10, 3 interleaved rounds): all simulated turf bindings logged : the game's own (peak ~54,000 / 143,360 blades), 0 VK_ERROR_DEVICE_LOST, 0 exit/transition frames (min >= 17.67 ms), and GPU time + Median FPS beat main across all 3 rounds.
  • 3-zone tour (Market -> Hyrule Field -> Kokiri Forest, 67% render scale, 1024x576): 0 VK_ERROR_DEVICE_LOST, 0 write-back timeouts, turf rendered cleanly in Hyrule Field.
  • Stationary RX_VK_SHOT_FX=1 (sharpness=80) visual inspection: scene lighting, geometry, and textures match main cleanly with zero artifacts.
  • Game-free tests (on current main @ 0e32bc10 with dev.py env llvm-mingw + RX_CPM):
    • tests/test_sim_turf_stock_passthrough.py (new; tests RX_VK_SIM_TURF_ADAPTIVE=1 and =0, promotion/retirement, and RX_VK_SSBO_STRETCH/RX_VK_SSBO_WIDE guards): FAIL on main (753fb5af), PASS on this branch (3641cc34).
    • Targeted --strict suite (test_sim_turf*, test_switch_table, test_vk_braces, test_utf8_paths, test_doc_anchors): 9 passed, 0 failed, 0 skipped.
    • python -I -B tests/run_all.py --changed forge/main: 181 passed, 7 failed, 6 skipped — all 7 failures are pre-existing Windows-only main failures documented in #2304 (test_sampler_admission, test_pipeline_state_computes, test_crash_dialog, test_dev_packs, test_saveload_warm_cache, test_dev_ab, test_input_movie).

Still to test:

  • Dense simulated-turf settings in Hyrule Field (Turf density high enough to exceed 7/8 * stock): confirm seamless promotion to private buffer, zero flicker, and retirement back to game buffer after 600 quiet frames in Market (by hand).
  • NVIDIA and Intel GPUs: Market -> Hyrule Field -> Market walk, expecting no regressions and identical GPU bandwidth savings (@Beanstalk Windows NVIDIA, Linux RADV).

Measurements

Rebase note: Rebased onto forge/mod-api @ cc65101d (head ff44be69). Measurements below were captured on main prior to the mod-api rebase.

Verdict: Clear, repeatable win across GPU-bound zones and pass timing: eliminates the 0.422 ms turf mirror-copy span (m dispatch -10.1%); at GPU-bound Market 100% render scale (1536x864) cuts GPU time -0.47 ms (-2.9%), steady VRAM -80 MB, and lifts Median/Mean FPS +1.0%; and at GPU-bound Hyrule Field 100% render scale (1382x864 at 16:10) cuts GPU time -0.50 ms (-2.5%) and lifts Median FPS +0.3% (+0.13 FPS) with non-overlapping 3-round ranges in both zones. Near-CPU-bound Market 67% render scale (1024x576) and overlapping secondary metrics show no measurable difference (within run-to-run variance).

Setup: Windows 11, AMD Ryzen AI 7 350 + Radeon 860M (Adrenalin 26.10.1), 1600x1000, handheld_profile=1, sharpness=80, vsync=0, amd_anti-lag_2=1, RX_VK_PRECOMPILE=1, symmetric pre-warmed shader/pipeline caches (>= 12.5 s settle): fountain-first Market_Child route (1536x864 at 100% render scale, 1024x576 at 67% render scale) and in-bounds HyruleField_Child grassy-field orbit (1382x864 at 100% render scale 16:10). Measured standalone directly against main @ 753fb5af; rebased cleanly onto main @ 0e32bc10 (3641cc34 — none of the 8 intervening commits touch vk_draw.cpp or simulated turf, and #2232's 4-core Auto threshold does not change behavior on this 8-core CPU, so the numbers hold unchanged). Multi-round values are median [min, max] across 3 interleaved rounds.

Where it makes a difference (GPU-bound Market & Hyrule Field at 100% render scale, and pass timing):

Metric Before: main @ 753fb5af After: this PR @ 3641cc34 Change
3de6d86ec7e6720e span (Market 67% render scale, 1024x576, PASS_TIMING=2) 0.422 ms < 0.093 ms (out of top 25) >= -0.329 ms (>= -78%)
Total m dispatch (Market 67% render scale, 1024x576, PASS_TIMING=2) 4.515 ms 4.060 ms -0.455 ms (-10.1%)
Market 100% render scale (1536x864) GPU time (3 rounds) 16.49 [16.48, 16.67] ms 16.02 [15.95, 16.35] ms -0.47 ms (-2.9%) — all 3 rounds faster
Market 100% render scale (1536x864) steady VRAM (3 rounds) 3245 [3213, 3277] MB 3165 [3133, 3197] MB -80 MB (~28 MB buffers + VMA block rounding) — all 3 rounds lower
Market 100% render scale (1536x864) Median FPS (3 rounds) 45.11 [44.92, 45.29] 45.56 [45.55, 46.02] +0.45 FPS (+1.0%) — all 3 rounds faster
Market 100% render scale (1536x864) Mean FPS (3 rounds) 44.79 [44.25, 44.98] 45.25 [45.13, 45.61] +0.46 FPS (+1.0%) — all 3 rounds faster
Hyrule Field 100% render scale (1382x864) GPU time (3 rounds) 19.88 [19.59, 21.24] ms 19.38 [19.31, 19.56] ms -0.50 ms (-2.5%) — all 3 rounds faster
Hyrule Field 100% render scale (1382x864) Median FPS (3 rounds) 38.70 [37.59, 38.70] 38.83 [38.73, 38.93] +0.13 FPS (+0.3%) — all 3 rounds faster
Hyrule Field 100% render scale (1382x864) Median frame ms (3 rounds) 25.84 [25.84, 26.61] ms 25.75 [25.69, 25.82] ms -0.09 ms (-0.3%) — all 3 rounds faster

Where it does NOT make a difference (within run-to-run variance):

Metric Before: main @ 753fb5af After: this PR @ 3641cc34 Change
Market 100% render scale (1536x864) 1% Low FPS (3 rounds) 32.89 [31.36, 33.52] 33.36 [33.22, 34.04] No measurable difference (within run-to-run variance)
Market 100% render scale (1536x864) >= 33.3 ms frames (3 rounds) 7 [3, 10] 4 [4, 6] No measurable difference (within run-to-run variance)
Market 67% render scale (1024x576) Median FPS (3 rounds, CPU-bound) 54.38 [53.59, 54.50] 54.87 [53.11, 55.01] No measurable difference (within run-to-run variance)
Market 67% render scale (1024x576) Mean FPS (3 rounds, CPU-bound) 53.68 [52.66, 54.00] 54.21 [52.06, 54.28] No measurable difference (within run-to-run variance)
Market 67% render scale (1024x576) 1% Low FPS (3 rounds, CPU-bound) 38.95 [36.86, 39.10] 38.55 [34.00, 39.41] No measurable difference (within run-to-run variance)
Market 67% render scale (1024x576) GPU time (3 rounds, CPU-bound) 12.82 [12.73, 12.99] ms 12.41 [12.39, 13.02] ms No measurable difference (within run-to-run variance)
Market 67% render scale (1024x576) steady VRAM (3 rounds) 3085 [3053, 3149] MB 3037 [2973, 3133] MB No measurable difference (within run-to-run variance)
Hyrule Field 100% render scale (1382x864) Mean FPS (3 rounds) 38.56 [37.02, 38.66] 38.64 [38.58, 38.80] No measurable difference (within run-to-run variance)
Hyrule Field 100% render scale (1382x864) 1% Low FPS (3 rounds) 29.03 [23.29, 29.37] 29.56 [28.11, 30.01] No measurable difference (within run-to-run variance)
Hyrule Field 100% render scale (1382x864) >= 33.3 ms frames (3 rounds) 16 [16, 45] 15 [12, 30] No measurable difference (within run-to-run variance)
Hyrule Field 100% render scale (1382x864) gpu_wait_ms (3 rounds) 4.04 [3.66, 5.71] ms 4.64 [3.91, 4.64] ms No measurable difference (within run-to-run variance)
Hyrule Field 100% render scale (1382x864) steady VRAM (3 rounds) 2858 [2858, 2986] MB 2810 [2810, 3098] MB No measurable difference (within run-to-run variance)
# Before (PASS_TIMING=2, Market 67% render scale, 1024x576):
[hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e4f0000: the private one
[hos Presentation Thread] vk:     m dispatch    4.515 ms  35.1%    120.7 spans     120.7 items     0.00 MB     37.4 us a span
[hos Presentation Thread] vk:   m   0.422 ms     1.0 x    421.7 us       1.0 items    0.00 MB  dispatch indirect prog 3de6d86ec7e6720e

# After (PASS_TIMING=2, Market 67% render scale, 1024x576 — 3de6d86ec7e6720e absent from top 25, lowest logged span is 0.093 ms):
[hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e4f0000: the game's own
[hos Presentation Thread] vk:     m dispatch    4.060 ms  32.6%    119.2 spans     119.2 items     0.00 MB     34.1 us a span

# Before (Market 100% render scale, 1536x864, round 2):
[hos Presentation Thread] vk: GPU time 16.5 ms a frame (the longest submission 6.3 ms); 3.6 textures made a frame: colour targets 1.9 (4.3 MB), depth 1.6 (3.5 MB), ASTC or BC 0.0 (0.0 MB), other 0.0 (0.0 MB)
[hos Presentation Thread] vk: VRAM: 3277 MB used of 12212 MB allowed (259 MB of it free in the blocks); textures 2584 MB (budget 4096 MB), 2297 textures

# After (Market 100% render scale, 1536x864, round 2):
[hos Presentation Thread] vk: GPU time 16.3 ms a frame (the longest submission 7.4 ms); 3.8 textures made a frame: colour targets 2.1 (3.8 MB), depth 1.4 (3.2 MB), ASTC or BC 0.4 (0.2 MB), other 0.0 (0.0 MB)
[hos Presentation Thread] vk: VRAM: 3133 MB used of 12212 MB allowed (235 MB of it free in the blocks); textures 2632 MB (budget 4096 MB), 2256 textures

# Before (Hyrule Field 100% render scale, 1382x864, round 1):
[hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e070000: the private one
[hos host] vk: simulated turf: frame 3611: blade lists 3598 found, 2 made, 0 retaken, 0 absent, 0 lost; pools 14382 found, 4 made, 0 retaken, 0 absent, 0 lost; peak demand blade 54018/143360, pool 42519/138240 records
[hos Presentation Thread] vk: GPU time 20.0 ms a frame (the longest submission 9.7 ms); 1.1 textures made a frame: colour targets 0.8 (1.3 MB), depth 0.3 (0.7 MB), ASTC or BC 0.0 (0.0 MB), other 0.0 (0.0 MB)

# After (Hyrule Field 100% render scale, 1382x864, round 1):
[hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e070000: the game's own
[hos host] vk: simulated turf: frame 3523: blade lists 3598 found, 2 made, 0 retaken, 0 absent, 0 lost; pools 14380 found, 4 made, 0 retaken, 0 absent, 0 lost; peak demand blade 53988/143360, pool 42402/138240 records
[hos Presentation Thread] vk: GPU time 18.0 ms a frame (the longest submission 8.8 ms); 0.7 textures made a frame: colour targets 0.5 (0.6 MB), depth 0.2 (0.4 MB), ASTC or BC 0.0 (0.0 MB), other 0.0 (0.0 MB)

Risks

  • Promotion/demotion transitions: Under dense turf settings where demand crosses 7/8 * stock, the list promotes from the game's buffer to a newly allocated private buffer on the next creator dispatch; after 600 quiet frames, it retires the private buffer (reaped after the GPU timeline passes it) and returns to the game's buffer. tests/test_sim_turf_stock_passthrough.py verifies the full lifecycle including retirement and destruction.
  • No #2174 regression: Because the producer writes directly into the game's own buffer on every frame at stock capacity, the game's buffer remains continuously marked written (never introducing a sudden first write-back when entering Hyrule Field).
  • Turn off / rollback: RX_VK_SIM_TURF_ADAPTIVE=0 immediately restores stock-sized private buffers for A/B comparison; a revert is also clean. No save/options/cache format changes. Players notice nothing in their files.

Checklist

Ready for review

  • One topic, on current mod-api (cc65101d); the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (tests/run_all.py --changed forge/main on Windows: 181 passed, 7 pre-existing Windows-only main failures named in #2304: test_sampler_admission, test_pipeline_state_computes, test_crash_dialog, test_dev_packs, test_saveload_warm_cache, test_dev_ab, test_input_movie; targeted --strict suite 9/9 passed).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened (test_sim_turf_floor.py, test_sim_turf_capacity_policy.py, test_sim_turf_pools.py, and test_switch_table.py all pass).
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary Longshot's simulated-turf system keeps a private GPU copy of the game's grass buffers so it can grow them when dense grass overflows the Switch 2's stock buffer size (`#2174`). Previously, it allocated those private buffers (~28 MB) immediately at stock size and copied **`~14.4 MB` of grass data back into the game's buffers every single frame** with a full-GPU barrier — even in areas with almost no grass (like cobblestone Market, `0–197` blades) or normal Hyrule Field (`~17,000` blades, well under the `143,360`-blade stock limit). This PR lets simulated turf write directly into the game's own buffers whenever demand fits within stock capacity, eliminating the per-frame `~14.4 MB` mirror copy, the full-GPU barrier, and the duplicate VRAM allocation **game-wide** (Hyrule Field, Market, Kokiri Forest, dungeons — every scene that uses simulated turf within stock capacity). If dense grass ever approaches the stock limit (`>= 7/8 * stock`), it seamlessly promotes to a larger private buffer just as before and retires it back to the game's buffer after 600 quiet frames. **Where this helps vs. where it doesn't:** - **What a player notices:** Not directly visible by eye (`+0.3%` to `+1.0%` FPS is too small to feel without an FPS counter). Its real value is quiet, zero-downside efficiency — stopping `~14.4 MB/frame` of wasted GPU memory bandwidth and freeing **`48–80 MB` of VRAM** everywhere in the game, which gives extra headroom on tight 6–8 GB GPUs and iGPU laptops/handhelds (Steam Deck, 780M/860M/890M) sitting near a frame-rate or VRAM edge. - **Helps:** **All GPUs** (AMD RDNA 3.5 tested; NVIDIA/Intel/RADV pending) in **GPU-bound scenes game-wide** at normal/stock turf density (including normal Hyrule Field with `~54,000` blades and Market at `100% render scale`). Eliminates the `0.422 ms` turf mirror-copy span (`< 0.093 ms`, total `m dispatch` `-10.1%`), cuts GPU frame time **`-0.47 ms` (`-2.9%`)** at Market `100% render scale` (`1536x864`) and **`-0.50 ms` (`-2.5%`)** at Hyrule Field `100% render scale` (`1382x864`), saves **`-80 MB` steady VRAM** in Market `100% render scale` (from avoiding the `~28 MB` private buffers plus VMA `64/32 MB` block granularity), and lifts Median FPS **`+1.0%`** in Market `100% render scale` and **`+0.3%`** in Hyrule Field `100% render scale` (all 3 rounds non-overlapping in both zones). - **No measurable impact:** **CPU-bound scenes** (such as Market `67% render scale`, `1024x576`, on this 8-CU iGPU, where GPU time sits around `12.4–12.8 ms` inside an `~18.4 ms` frame, so FPS/VRAM deltas fall within run-to-run variance) and **extreme dense-turf settings** that exceed `7/8 * stock` (which intentionally promote to a private buffer like `main`). **Technical details:** - Keep simulated-turf lists on the game's own buffer while `policy.target() <= stock` in adaptive mode (`gpu/vk/vk_draw.cpp`: `sim_turf_private_binding()` and `sim_turf_bound_result()`), leaving `sim_turf_bound()` empty so `mirrors` is empty (`0 MB/frame` copied). - Narrow `sim_turf_sample_demand()`'s post-copy barrier from `ALL_COMMANDS_BIT | MEMORY_READ_BIT` to `HOST_BIT | COMPUTE_SHADER_BIT` with `HOST_READ_BIT` access when `mirrors.empty()` (only the 4-byte demand readback copies ran), preserving the copy-to-compute execution dependency. - Keep `RX_VK_SIM_TURF_ADAPTIVE=0` as a runtime A/B and kill switch (`want_private = !sim_turf_adaptive() || g.policy.target() > stock`; `gpu/vk/switches.def` updated) and guard the stock-passthrough descriptor fallback against `RX_VK_SSBO_STRETCH=1` and `RX_VK_SSBO_WIDE` (`&& !Shader::IsSimTurfStorage(d)`). Read first: `sim_turf_private_binding()` and `sim_turf_sample_demand()` in `gpu/vk/vk_draw.cpp`. See #2174, #2093. ## Testing **How to test:** 1. **Game-free tests:** Run `python -I -B tests/test_sim_turf_stock_passthrough.py` (fails on `main`, passes here) plus `tests/test_sim_turf_floor.py`, `tests/test_sim_turf_capacity_policy.py`, `tests/test_sim_turf_pools.py`, and `tests/test_switch_table.py`. 2. **Confirm passthrough is active:** Run the game into Market or Hyrule Field and check `longshot_log.txt` for `vk: simulated turf: prog 3de6d86ec7e6720e` — it should log `: the game's own` instead of `: the private one`. 3. **Verify the GPU span drop:** Run with `RX_VK_PASS_TIMING=2` in Market; `dispatch indirect prog 3de6d86ec7e6720e` should drop from `~0.42 ms` out of the top-25 spans (`< 0.093 ms`) and `m dispatch` should drop by `~0.45 ms`. 4. **Measure FPS / GPU time / VRAM:** Use a **GPU-bound** scene (e.g., Market or Hyrule Field at `100% render scale` — avoid CPU-bound `67% render scale` (`1024x576`) where GPU savings are hidden by CPU frame time). Compare `main` vs. this PR (or toggle `RX_VK_SIM_TURF_ADAPTIVE=0` vs. `=1` on this build) across `>= 3` interleaved rounds with `>= 12.5 s` post-load settle. 5. **Visual & promotion check:** Walk `Market -> Hyrule Field -> Kokiri Forest` and confirm grass renders cleanly with `0` `VK_ERROR_DEVICE_LOST`. Optionally raise turf density past `7/8 * stock` in Hyrule Field to verify promotion to a private buffer and clean retirement after 600 quiet frames back in Market. **Tested:** Windows 11 (build 26200), AMD Ryzen AI 7 350 + AMD Radeon 860M (8 CUs, RDNA 3.5 iGPU, Adrenalin 26.10.1), `1600x1000`, `handheld_profile=1`, `sharpness=80`, `vsync=0`, `amd_anti-lag_2=1`, `RX_VK_PRECOMPILE=1`, `>= 12.5 s` post-load settle: - `Market_Child` fountain-first route (`67% render scale` `1024x576` 3 interleaved rounds, `100% render scale` `1536x864` 3 interleaved rounds) + `RX_VK_PASS_TIMING=2` (`67% render scale`, `1024x576`): `vk: simulated turf: prog 3de6d86ec7e6720e` logged `: the game's own`; span dropped from `0.422 ms` to `< 0.093 ms` (absent from top 25 spans; total `m dispatch` `4.515 -> 4.060 ms`, `-10.1%`). - `HyruleField_Child` in-bounds grassy-field orbit (`castle-gate`, `100% render scale`, `1382x864` at `16:10`, 3 interleaved rounds): all simulated turf bindings logged `: the game's own` (peak `~54,000 / 143,360` blades), `0` `VK_ERROR_DEVICE_LOST`, `0` exit/transition frames (`min >= 17.67 ms`), and GPU time + Median FPS beat `main` across all 3 rounds. - 3-zone tour (`Market -> Hyrule Field -> Kokiri Forest`, `67% render scale`, `1024x576`): `0` `VK_ERROR_DEVICE_LOST`, `0` write-back timeouts, turf rendered cleanly in Hyrule Field. - Stationary `RX_VK_SHOT_FX=1` (`sharpness=80`) visual inspection: scene lighting, geometry, and textures match `main` cleanly with zero artifacts. - Game-free tests (on current `main @ 0e32bc10` with `dev.py env` `llvm-mingw` + `RX_CPM`): - `tests/test_sim_turf_stock_passthrough.py` (new; tests `RX_VK_SIM_TURF_ADAPTIVE=1` and `=0`, promotion/retirement, and `RX_VK_SSBO_STRETCH`/`RX_VK_SSBO_WIDE` guards): **FAIL** on `main` (`753fb5af`), **PASS** on this branch (`3641cc34`). - Targeted `--strict` suite (`test_sim_turf*`, `test_switch_table`, `test_vk_braces`, `test_utf8_paths`, `test_doc_anchors`): **9 passed, 0 failed, 0 skipped**. - `python -I -B tests/run_all.py --changed forge/main`: **181 passed, 7 failed, 6 skipped** — all 7 failures are pre-existing Windows-only `main` failures documented in `#2304` (`test_sampler_admission`, `test_pipeline_state_computes`, `test_crash_dialog`, `test_dev_packs`, `test_saveload_warm_cache`, `test_dev_ab`, `test_input_movie`). **Still to test:** - Dense simulated-turf settings in Hyrule Field (`Turf density` high enough to exceed `7/8 * stock`): confirm seamless promotion to private buffer, zero flicker, and retirement back to game buffer after 600 quiet frames in Market (by hand). - NVIDIA and Intel GPUs: Market -> Hyrule Field -> Market walk, expecting no regressions and identical GPU bandwidth savings (@Beanstalk Windows NVIDIA, Linux RADV). ## Measurements > **Rebase note:** Rebased onto `forge/mod-api @ cc65101d` (head `ff44be69`). Measurements below were captured on `main` prior to the `mod-api` rebase. **Verdict:** Clear, repeatable win across GPU-bound zones and pass timing: eliminates the `0.422 ms` turf mirror-copy span (`m dispatch` **`-10.1%`**); at GPU-bound Market `100% render scale` (`1536x864`) cuts GPU time **`-0.47 ms` (`-2.9%`)**, steady VRAM **`-80 MB`**, and lifts Median/Mean FPS **`+1.0%`**; and at GPU-bound Hyrule Field `100% render scale` (`1382x864` at `16:10`) cuts GPU time **`-0.50 ms` (`-2.5%`)** and lifts Median FPS **`+0.3%`** (`+0.13 FPS`) with non-overlapping 3-round ranges in both zones. Near-CPU-bound Market `67% render scale` (`1024x576`) and overlapping secondary metrics show **no measurable difference (within run-to-run variance)**. Setup: Windows 11, AMD Ryzen AI 7 350 + Radeon 860M (Adrenalin 26.10.1), `1600x1000`, `handheld_profile=1`, `sharpness=80`, `vsync=0`, `amd_anti-lag_2=1`, `RX_VK_PRECOMPILE=1`, symmetric pre-warmed shader/pipeline caches (`>= 12.5 s` settle): fountain-first `Market_Child` route (`1536x864` at `100% render scale`, `1024x576` at `67% render scale`) and in-bounds `HyruleField_Child` grassy-field orbit (`1382x864` at `100% render scale` `16:10`). Measured standalone directly against `main @ 753fb5af`; rebased cleanly onto `main @ 0e32bc10` (`3641cc34` — none of the 8 intervening commits touch `vk_draw.cpp` or simulated turf, and `#2232`'s 4-core Auto threshold does not change behavior on this 8-core CPU, so the numbers hold unchanged). Multi-round values are `median [min, max]` across 3 interleaved rounds. **Where it makes a difference (GPU-bound Market & Hyrule Field at `100% render scale`, and pass timing):** | Metric | Before: `main @ 753fb5af` | After: this PR @ `3641cc34` | Change | |---|---|---|---| | **`3de6d86ec7e6720e` span (Market `67% render scale`, `1024x576`, `PASS_TIMING=2`)** | `0.422 ms` | **`< 0.093 ms` (out of top 25)** | **`>= -0.329 ms` (`>= -78%`)** | | **Total `m dispatch` (Market `67% render scale`, `1024x576`, `PASS_TIMING=2`)** | `4.515 ms` | **`4.060 ms`** | **`-0.455 ms` (`-10.1%`)** | | **Market `100% render scale` (`1536x864`) GPU time (3 rounds)** | `16.49 [16.48, 16.67] ms` | **`16.02 [15.95, 16.35] ms`** | **`-0.47 ms` (`-2.9%`) — all 3 rounds faster** | | **Market `100% render scale` (`1536x864`) steady VRAM (3 rounds)** | `3245 [3213, 3277] MB` | **`3165 [3133, 3197] MB`** | **`-80 MB` (~28 MB buffers + VMA block rounding) — all 3 rounds lower** | | **Market `100% render scale` (`1536x864`) Median FPS (3 rounds)** | `45.11 [44.92, 45.29]` | **`45.56 [45.55, 46.02]`** | **`+0.45 FPS` (`+1.0%`) — all 3 rounds faster** | | **Market `100% render scale` (`1536x864`) Mean FPS (3 rounds)** | `44.79 [44.25, 44.98]` | **`45.25 [45.13, 45.61]`** | **`+0.46 FPS` (`+1.0%`) — all 3 rounds faster** | | **Hyrule Field `100% render scale` (`1382x864`) GPU time (3 rounds)** | `19.88 [19.59, 21.24] ms` | **`19.38 [19.31, 19.56] ms`** | **`-0.50 ms` (`-2.5%`) — all 3 rounds faster** | | **Hyrule Field `100% render scale` (`1382x864`) Median FPS (3 rounds)** | `38.70 [37.59, 38.70]` | **`38.83 [38.73, 38.93]`** | **`+0.13 FPS` (`+0.3%`) — all 3 rounds faster** | | **Hyrule Field `100% render scale` (`1382x864`) Median frame ms (3 rounds)** | `25.84 [25.84, 26.61] ms` | **`25.75 [25.69, 25.82] ms`** | **`-0.09 ms` (`-0.3%`) — all 3 rounds faster** | **Where it does NOT make a difference (within run-to-run variance):** | Metric | Before: `main @ 753fb5af` | After: this PR @ `3641cc34` | Change | |---|---|---|---| | Market `100% render scale` (`1536x864`) 1% Low FPS (3 rounds) | `32.89 [31.36, 33.52]` | `33.36 [33.22, 34.04]` | No measurable difference (within run-to-run variance) | | Market `100% render scale` (`1536x864`) `>= 33.3 ms` frames (3 rounds) | `7 [3, 10]` | `4 [4, 6]` | No measurable difference (within run-to-run variance) | | Market `67% render scale` (`1024x576`) Median FPS (3 rounds, CPU-bound) | `54.38 [53.59, 54.50]` | `54.87 [53.11, 55.01]` | No measurable difference (within run-to-run variance) | | Market `67% render scale` (`1024x576`) Mean FPS (3 rounds, CPU-bound) | `53.68 [52.66, 54.00]` | `54.21 [52.06, 54.28]` | No measurable difference (within run-to-run variance) | | Market `67% render scale` (`1024x576`) 1% Low FPS (3 rounds, CPU-bound) | `38.95 [36.86, 39.10]` | `38.55 [34.00, 39.41]` | No measurable difference (within run-to-run variance) | | Market `67% render scale` (`1024x576`) GPU time (3 rounds, CPU-bound) | `12.82 [12.73, 12.99] ms` | `12.41 [12.39, 13.02] ms` | No measurable difference (within run-to-run variance) | | Market `67% render scale` (`1024x576`) steady VRAM (3 rounds) | `3085 [3053, 3149] MB` | `3037 [2973, 3133] MB` | No measurable difference (within run-to-run variance) | | Hyrule Field `100% render scale` (`1382x864`) Mean FPS (3 rounds) | `38.56 [37.02, 38.66]` | `38.64 [38.58, 38.80]` | No measurable difference (within run-to-run variance) | | Hyrule Field `100% render scale` (`1382x864`) 1% Low FPS (3 rounds) | `29.03 [23.29, 29.37]` | `29.56 [28.11, 30.01]` | No measurable difference (within run-to-run variance) | | Hyrule Field `100% render scale` (`1382x864`) `>= 33.3 ms` frames (3 rounds) | `16 [16, 45]` | `15 [12, 30]` | No measurable difference (within run-to-run variance) | | Hyrule Field `100% render scale` (`1382x864`) `gpu_wait_ms` (3 rounds) | `4.04 [3.66, 5.71] ms` | `4.64 [3.91, 4.64] ms` | No measurable difference (within run-to-run variance) | | Hyrule Field `100% render scale` (`1382x864`) steady VRAM (3 rounds) | `2858 [2858, 2986] MB` | `2810 [2810, 3098] MB` | No measurable difference (within run-to-run variance) | ```text # Before (PASS_TIMING=2, Market 67% render scale, 1024x576): [hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e4f0000: the private one [hos Presentation Thread] vk: m dispatch 4.515 ms 35.1% 120.7 spans 120.7 items 0.00 MB 37.4 us a span [hos Presentation Thread] vk: m 0.422 ms 1.0 x 421.7 us 1.0 items 0.00 MB dispatch indirect prog 3de6d86ec7e6720e # After (PASS_TIMING=2, Market 67% render scale, 1024x576 — 3de6d86ec7e6720e absent from top 25, lowest logged span is 0.093 ms): [hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e4f0000: the game's own [hos Presentation Thread] vk: m dispatch 4.060 ms 32.6% 119.2 spans 119.2 items 0.00 MB 34.1 us a span # Before (Market 100% render scale, 1536x864, round 2): [hos Presentation Thread] vk: GPU time 16.5 ms a frame (the longest submission 6.3 ms); 3.6 textures made a frame: colour targets 1.9 (4.3 MB), depth 1.6 (3.5 MB), ASTC or BC 0.0 (0.0 MB), other 0.0 (0.0 MB) [hos Presentation Thread] vk: VRAM: 3277 MB used of 12212 MB allowed (259 MB of it free in the blocks); textures 2584 MB (budget 4096 MB), 2297 textures # After (Market 100% render scale, 1536x864, round 2): [hos Presentation Thread] vk: GPU time 16.3 ms a frame (the longest submission 7.4 ms); 3.8 textures made a frame: colour targets 2.1 (3.8 MB), depth 1.4 (3.2 MB), ASTC or BC 0.4 (0.2 MB), other 0.0 (0.0 MB) [hos Presentation Thread] vk: VRAM: 3133 MB used of 12212 MB allowed (235 MB of it free in the blocks); textures 2632 MB (budget 4096 MB), 2256 textures # Before (Hyrule Field 100% render scale, 1382x864, round 1): [hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e070000: the private one [hos host] vk: simulated turf: frame 3611: blade lists 3598 found, 2 made, 0 retaken, 0 absent, 0 lost; pools 14382 found, 4 made, 0 retaken, 0 absent, 0 lost; peak demand blade 54018/143360, pool 42519/138240 records [hos Presentation Thread] vk: GPU time 20.0 ms a frame (the longest submission 9.7 ms); 1.1 textures made a frame: colour targets 0.8 (1.3 MB), depth 0.3 (0.7 MB), ASTC or BC 0.0 (0.0 MB), other 0.0 (0.0 MB) # After (Hyrule Field 100% render scale, 1382x864, round 1): [hos Presentation Thread] vk: simulated turf: prog 3de6d86ec7e6720e stage 5 c0+0x50 (blade list) at 0x117e070000: the game's own [hos host] vk: simulated turf: frame 3523: blade lists 3598 found, 2 made, 0 retaken, 0 absent, 0 lost; pools 14380 found, 4 made, 0 retaken, 0 absent, 0 lost; peak demand blade 53988/143360, pool 42402/138240 records [hos Presentation Thread] vk: GPU time 18.0 ms a frame (the longest submission 8.8 ms); 0.7 textures made a frame: colour targets 0.5 (0.6 MB), depth 0.2 (0.4 MB), ASTC or BC 0.0 (0.0 MB), other 0.0 (0.0 MB) ``` ## Risks - **Promotion/demotion transitions:** Under dense turf settings where demand crosses `7/8 * stock`, the list promotes from the game's buffer to a newly allocated private buffer on the next creator dispatch; after 600 quiet frames, it retires the private buffer (reaped after the GPU timeline passes it) and returns to the game's buffer. `tests/test_sim_turf_stock_passthrough.py` verifies the full lifecycle including retirement and destruction. - **No `#2174` regression:** Because the producer writes directly into the game's own buffer on every frame at stock capacity, the game's buffer remains continuously marked written (never introducing a sudden first write-back when entering Hyrule Field). - **Turn off / rollback:** `RX_VK_SIM_TURF_ADAPTIVE=0` immediately restores stock-sized private buffers for A/B comparison; a revert is also clean. No save/options/cache format changes. Players notice nothing in their files. ## Checklist ### Ready for review - [x] One topic, on current `mod-api` (`cc65101d`); the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (`tests/run_all.py --changed forge/main` on Windows: 181 passed, 7 pre-existing Windows-only `main` failures named in `#2304`: `test_sampler_admission`, `test_pipeline_state_computes`, `test_crash_dialog`, `test_dev_packs`, `test_saveload_warm_cache`, `test_dev_ab`, `test_input_movie`; targeted `--strict` suite 9/9 passed). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened (`test_sim_turf_floor.py`, `test_sim_turf_capacity_policy.py`, `test_sim_turf_pools.py`, and `test_switch_table.py` all pass). - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
perf(vk): cut Market 1536x864 GPU time 2.9% (-80 MB VRAM, +1.0% FPS) across GPUs by keeping stock simulated turf on game buffers
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
2e8721320e
When a simulated-turf list is at stock capacity (143,360 blades / 138,240 pools), avoid allocating a duplicate private VkBuffer (~28 MB VRAM across all lists) and let both producers and readers bind the game's own buffer directly.  This eliminates the ~14.4 MB/frame GPU-to-GPU mirror copy inside sim_turf_sample_demand() and narrows its post-copy barrier from ALL_COMMANDS_BIT | MEMORY_READ_BIT to HOST_BIT | HOST_READ_BIT when only the 4-byte demand readback runs. High-demand areas (>= 7/8 stock) still promote to a private buffer and retire back to stock passthrough after 600 quiet frames.  Assisted-by: Antigravity
Author
Contributor

Tested in game: Windows 11, AMD Radeon 860M (Adrenalin 26.10.1): Market (1536x864 and 1024x576), Hyrule Field (1382x864), and 3-zone tour (Market -> Hyrule Field -> Kokiri Forest). Confirmed 3de6d86ec7e6720e uses the game buffer, span dropped from 0.422 ms to <0.093 ms, GPU time -0.47 ms (-2.9%) in Market and -0.50 ms (-2.5%) in Hyrule Field, -80 MB VRAM, 0 device_lost, clean visual parity.

Tested in game: Windows 11, AMD Radeon 860M (Adrenalin 26.10.1): Market (1536x864 and 1024x576), Hyrule Field (1382x864), and 3-zone tour (Market -> Hyrule Field -> Kokiri Forest). Confirmed 3de6d86ec7e6720e uses the game buffer, span dropped from 0.422 ms to <0.093 ms, GPU time -0.47 ms (-2.9%) in Market and -0.50 ms (-2.5%) in Hyrule Field, -80 MB VRAM, 0 device_lost, clean visual parity.
Member

Possibly related, for context:

  • PR #2288 WIP: fix(vk): simulated-turf lists stay within the device's workgroups for one draw or dispatch — Open simulated-turf Vulkan buffer-capacity work overlaps renderer code
Possibly related, for context: - PR #2288 WIP: fix(vk): simulated-turf lists stay within the device's workgroups for one draw or dispatch — Open simulated-turf Vulkan buffer-capacity work overlaps renderer code
Jer9 changed title from WIP: perf(vk): cut Market 1536x864 GPU time 2.9% (-80 MB VRAM, +1.0% FPS) across GPUs by keeping stock simulated turf on game buffers to perf(vk): cut Market 1536x864 GPU time 2.9% (-80 MB VRAM, +1.0% FPS) across GPUs by keeping stock simulated turf on game buffers 2026-11-23 04:23:51 +00:00
Member

@Jer9 only members of BigBeans can start the farm.

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

@Jer9 only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `2e87213`, and the PR has changed since (`3641cc3`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Jer9 force-pushed perf/vk-sim-turf-stock-passthrough from 2e8721320e
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 3s
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to 3641cc3488
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-23 04:35:12 +00:00
Compare
Member

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

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

@Beanstalk Please test on Windows NVIDIA and Linux RADV (head 3641cc34): walk Market -> Hyrule Field (normal/stock turf density) at 100% render scale. Confirm vk: simulated turf: prog 3de6d86ec7e6720e logs : the game's own in longshot_log.txt, and compare GPU time, VRAM, and FPS vs main.

@Beanstalk Please test on Windows NVIDIA and Linux RADV (head `3641cc34`): walk Market -> Hyrule Field (normal/stock turf density) at 100% render scale. Confirm `vk: simulated turf: prog 3de6d86ec7e6720e` logs `: the game's own` in `longshot_log.txt`, and compare GPU time, VRAM, and FPS vs `main`.
Member

@Jer9 only members of BigBeans can start the farm.

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

@Jer9 only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `3641cc3`, and the PR has changed since (`85a84c7`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
@ -571,2 +577,3 @@
const uint32_t before = g.policy.capacity(), target = g.policy.target();
if (sim_turf_resize(g, pool, salign))
if (!want_private) {
sim_turf_retire(g);
Contributor

i saw the test mocks high turf demand and then 600 quiet frames. did you also try max turf in hyrule field and go back to market in game? im curious if it flickers or hitches when it switches back.

i saw the test mocks high turf demand and then 600 quiet frames. did you also try max turf in hyrule field and go back to market in game? im curious if it flickers or hitches when it switches back.
Author
Contributor

Haven't tried max turf in-game yet — all my live runs so far were at default turf density (peaking around ~54,000 / 143,360 blades in Hyrule Field), so I listed dense turf promotion/demotion under Still to test and only exercised the grow -> 600-quiet-frame shrink path in tests/test_sim_turf_stock_passthrough.py.

On paper it shouldn't flicker or hitch when switching back:

  • Flicker: sim_turf_retire(g) only runs on the creator dispatch right before the producer shader writes that frame's grass list, so the creator and every subsequent reader in that frame bind the game's buffer together (and while the private buffer was active, sim_turf_sample_demand() was already mirroring the stock window back into the game's buffer each frame). Meanwhile, the old private buffer stays alive in sim_turf_retired until vk_timeline_completed() passes vk_retirement_value(), so any earlier frame still in flight on the GPU finishes cleanly.
  • Hitching: Switching back to stock doesn't allocate anything (unlike promoting up, which does a single create_device_buffer like main), and destroy_buffer() happens asynchronously on a later reap once the GPU is done with it.

If you do try max turf in Hyrule Field and head back to Market, let me know if you spot any flicker or hitching on the switch!

Haven't tried max turf in-game yet — all my live runs so far were at default turf density (peaking around `~54,000 / 143,360` blades in Hyrule Field), so I listed dense turf promotion/demotion under **Still to test** and only exercised the grow -> 600-quiet-frame shrink path in `tests/test_sim_turf_stock_passthrough.py`. On paper it shouldn't flicker or hitch when switching back: - **Flicker:** `sim_turf_retire(g)` only runs on the **creator** dispatch right before the producer shader writes that frame's grass list, so the creator and every subsequent reader in that frame bind the game's buffer together (and while the private buffer was active, `sim_turf_sample_demand()` was already mirroring the stock window back into the game's buffer each frame). Meanwhile, the old private buffer stays alive in `sim_turf_retired` until `vk_timeline_completed()` passes `vk_retirement_value()`, so any earlier frame still in flight on the GPU finishes cleanly. - **Hitching:** Switching back to stock doesn't allocate anything (unlike promoting up, which does a single `create_device_buffer` like `main`), and `destroy_buffer()` happens asynchronously on a later reap once the GPU is done with it. If you do try max turf in Hyrule Field and head back to Market, let me know if you spot any flicker or hitching on the switch!
Jer9 force-pushed perf/vk-sim-turf-stock-passthrough from 3641cc3488
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 9s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 85a84c783b
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 51s
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (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
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 6s
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
2026-11-26 14:19:00 +00:00
Compare
Jer9 changed target branch from main to mod-api 2026-11-26 16:50:38 +00:00
Jer9 force-pushed perf/vk-sim-turf-stock-passthrough from 85a84c783b
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
CI / Game-free checks (run_all.py, part 1/4) (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 51s
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 3/4) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / longshot-builder end to end (synthetic game) (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 4/4) (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
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 6s
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
to ff44be695b
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 12s
2026-11-26 23:28:13 +00:00
Compare
Owner
@review
BeanBot left a comment

Recommendation: Approve. The tested AMD system shows a repeatable reduction in GPU time at stock turf density, but the promoted-buffer transition and affected Tier 1 systems still need game runs. The measurements also predate the mod-api rebase. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

At stock density, simulated turf writes to the game's buffers instead of allocating and mirroring private copies. This reduces GPU work and memory use on the tested iGPU, while retaining private buffers for dense turf; the transition and other drivers remain unverified.

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

  • L3 tests/test_sim_turf_stock_passthrough.py:237: The documented standalone test hard-codes clang++ instead of honoring the configured C++ compiler or finding an available one. (more on the line) Do: Choose the default from CXX and fall back to an available supported C++ compiler, while retaining --cxx as an override.

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

  • L1 gpu/vk/vk_draw.cpp:584: The new handoff between the game buffer and private buffers has not been exercised in the game. (more on the line) Do: Run dense Hyrule Field through promotion and return to Market through retirement on the current head, checking visuals, frame times and device errors.
  • L2 gpu/vk/vk_draw.cpp:7163: The changed buffer and synchronization path has not been tested on the affected Tier 1 hardware or on this rebased head. (more on the line) Do: Run the stock-density visual and performance comparison on the current head against its base, and complete the Tier 1 Windows, Linux and Steam Deck coverage required by the project.

@fix can do L3.

Checks: Still running: Guide screenshots / Guide images and local UI source review (pull_request), Third-party parts / As their notes say (pull_request), Third-party parts / The same as upstream (pull_request).

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

Does it help: Unproven on this head. On the pre-rebase branch, three interleaved Windows Radeon 860M runs reported median GPU time of 16.49 to 16.02 ms in Market and 19.88 to 19.38 ms in Hyrule Field; 1% lows overlapped. The reported Market VRAM median fell 80 MB.

Other systems: The binding and barrier changes affect Vulkan rendering on Windows and Linux, including NVIDIA, RADV, Steam Deck and mesh-fallback paths. Only Windows Radeon 860M stock-density play is reported; dense promotion and retirement, Tier 1 hardware and the rebased head need runs.

Switches: RX_VK_SIM_TURF_ADAPTIVE remains on by default but now uses game buffers at stock capacity; =0 retains stock-sized private buffers and disables sampling. Its table row is updated. The default's cross-platform behavior remains to be tested. RX_VK_SSBO_STRETCH and RX_VK_SSBO_WIDE no longer widen simulated-turf descriptors.

Reviewed: ff44be695b against cc65101d4f: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the full new test, sim_turf_capacity.h, the diff and commits; inspected the changed vk_draw.cpp sections and their callers and shader-pass dependencies. Skimmed the remainder of vk_draw.cpp and switches.def. docs/review-checklist.md and ../Tooling/AGENTS.md were absent; no generated files or translations changed.; nothing run (a code review).

Checked and fine:

  • Both commits record AI assistance.
  • No game-derived output, generated files, API version changes or third-party changes appear in the diff.
  • The new harness exercises stock bindings, promotion, retirement and the adaptive-off allocation path for both list types.

Testing: Read-only review; no project code, builds or tests were run. The author reports the targeted checks passing and stock-density game runs on Windows Radeon 860M.

Overlaps and merge order: Not checked; the network is closed.


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

**Recommendation: Approve.** The tested AMD system shows a repeatable reduction in GPU time at stock turf density, but the promoted-buffer transition and affected Tier 1 systems still need game runs. The measurements also predate the mod-api rebase. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. At stock density, simulated turf writes to the game's buffers instead of allocating and mirroring private copies. This reduces GPU work and memory use on the tested iGPU, while retaining private buffers for dense turf; the transition and other drivers remain unverified. **Should fix (1)**: not blocking, but worth doing before merging. - **L3** `tests/test_sim_turf_stock_passthrough.py:237`: The documented standalone test hard-codes clang++ instead of honoring the configured C++ compiler or finding an available one. (more on the line) **Do:** Choose the default from CXX and fall back to an available supported C++ compiler, while retaining --cxx as an override. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `gpu/vk/vk_draw.cpp:584`: The new handoff between the game buffer and private buffers has not been exercised in the game. (more on the line) **Do:** Run dense Hyrule Field through promotion and return to Market through retirement on the current head, checking visuals, frame times and device errors. - **L2** `gpu/vk/vk_draw.cpp:7163`: The changed buffer and synchronization path has not been tested on the affected Tier 1 hardware or on this rebased head. (more on the line) **Do:** Run the stock-density visual and performance comparison on the current head against its base, and complete the Tier 1 Windows, Linux and Steam Deck coverage required by the project. `@fix` can do L3. **Checks:** Still running: `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / As their notes say (pull_request)`, `Third-party parts / The same as upstream (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on this head. On the pre-rebase branch, three interleaved Windows Radeon 860M runs reported median GPU time of 16.49 to 16.02 ms in Market and 19.88 to 19.38 ms in Hyrule Field; 1% lows overlapped. The reported Market VRAM median fell 80 MB. **Other systems:** The binding and barrier changes affect Vulkan rendering on Windows and Linux, including NVIDIA, RADV, Steam Deck and mesh-fallback paths. Only Windows Radeon 860M stock-density play is reported; dense promotion and retirement, Tier 1 hardware and the rebased head need runs. **Switches:** RX_VK_SIM_TURF_ADAPTIVE remains on by default but now uses game buffers at stock capacity; =0 retains stock-sized private buffers and disables sampling. Its table row is updated. The default's cross-platform behavior remains to be tested. RX_VK_SSBO_STRETCH and RX_VK_SSBO_WIDE no longer widen simulated-turf descriptors. **Reviewed:** ff44be695bc3 against cc65101d4f72: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the full new test, sim_turf_capacity.h, the diff and commits; inspected the changed vk_draw.cpp sections and their callers and shader-pass dependencies. Skimmed the remainder of vk_draw.cpp and switches.def. docs/review-checklist.md and ../Tooling/AGENTS.md were absent; no generated files or translations changed.; nothing run (a code review). **Checked and fine:** - Both commits record AI assistance. - No game-derived output, generated files, API version changes or third-party changes appear in the diff. - The new harness exercises stock bindings, promotion, retirement and the adaptive-off allocation path for both list types. **Testing:** Read-only review; no project code, builds or tests were run. The author reports the targeted checks passing and stock-density game runs on Windows Radeon 860M. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -579,0 +581,4 @@
// VRAM and ~14.4 MB/frame of GPU mirror copies + ALL_COMMANDS barriers in areas where demand fits stock.
// RX_VK_SIM_TURF_ADAPTIVE=0 keeps a stock-sized private buffer as before, for A/B comparison.
const bool want_private = !sim_turf_adaptive() || g.policy.target() > stock;
if (creator && (g.policy.target() != g.policy.capacity() || (want_private && !g.buf) || (!want_private && g.buf))) {
Member

L1 (should fix): The new handoff between the game buffer and private buffers has not been exercised in the game.

When: Dense turf crosses the promotion threshold and later returns to a quiet area; the harness checks policy and handles but cannot show whether the rendered grass flickers or the transition hitches.

Do: Run dense Hyrule Field through promotion and return to Market through retirement on the current head, checking visuals, frame times and device errors.

**L1** (should fix): The new handoff between the game buffer and private buffers has not been exercised in the game. *When:* Dense turf crosses the promotion threshold and later returns to a quiet area; the harness checks policy and handles but cannot show whether the rendered grass flickers or the transition hitches. **Do:** Run dense Hyrule Field through promotion and return to Market through retirement on the current head, checking visuals, frame times and device errors.
@ -7146,3 +7162,2 @@
barrier.srcAccessMask = VK_ACCESS_2_TRANSFER_WRITE_BIT;
barrier.dstStageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT | VK_PIPELINE_STAGE_2_HOST_BIT;
barrier.dstAccessMask = VK_ACCESS_2_MEMORY_READ_BIT | VK_ACCESS_2_HOST_READ_BIT;
if (mirrors.empty()) {
Member

L2 (should fix): The changed buffer and synchronization path has not been tested on the affected Tier 1 hardware or on this rebased head.

When: NVIDIA, RADV and Steam Deck drivers execute the narrower barrier and direct game-buffer writes, while the reported game runs and measurements cover only a pre-rebase Windows 860M build.

Do: Run the stock-density visual and performance comparison on the current head against its base, and complete the Tier 1 Windows, Linux and Steam Deck coverage required by the project.

**L2** (should fix): The changed buffer and synchronization path has not been tested on the affected Tier 1 hardware or on this rebased head. *When:* NVIDIA, RADV and Steam Deck drivers execute the narrower barrier and direct game-buffer writes, while the reported game runs and measurements cover only a pre-rebase Windows 860M build. **Do:** Run the stock-density visual and performance comparison on the current head against its base, and complete the Tier 1 Windows, Linux and Steam Deck coverage required by the project.
@ -0,0 +234,4 @@
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--cxx", default="clang++")
Member

L3 (should fix): The documented standalone test hard-codes clang++ instead of honoring the configured C++ compiler or finding an available one.

When: On a supported Linux development setup with g++ but no clang++, the documented test command fails before exercising the change even when CXX names g++.

Do: Choose the default from CXX and fall back to an available supported C++ compiler, while retaining --cxx as an override.

**L3** (should fix): The documented standalone test hard-codes clang++ instead of honoring the configured C++ compiler or finding an available one. *When:* On a supported Linux development setup with g++ but no clang++, the documented test command fails before exercising the change even when CXX names g++. **Do:** Choose the default from CXX and fall back to an available supported C++ compiler, while retaining --cxx as an override.
Owner
@fix
BeanBot force-pushed perf/vk-sim-turf-stock-passthrough from ff44be695b
Some checks are pending
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
beanstalk/approval changed since the request: ask again
PR description / Description follows the template (pull_request_target) Successful in 12s
to afa9890862
Some checks are pending
PR description / Description follows the template (pull_request_target) Successful in 29s
beanstalk/approval changed since the request: ask again
2026-11-28 01:14:01 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The stock-buffer path shows a GPU-time and VRAM gain on the tested AMD system, but the dense-turf handoff and affected Tier 1 hardware still need in-game runs on the rebased code. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is afa9890862. I rebased it onto mod-api (0cc7332c79). I edited its description to match the change.

Changed

  • Standalone test compiler selection: Updated tests/test_sim_turf_stock_passthrough.py:238 to honor CXX, fall back to an available Clang or GCC compiler, and retain the --cxx override. Tests were not run as requested.

Nothing was built or run: the checks run again on the new head.

Simulated turf uses the game's buffers at stock capacity, avoiding private allocations and mirror copies; dense turf can still promote to private buffers. This reduces work in normal scenes while adding buffer-handoff and synchronization paths that need wider validation.

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

  • L1 gpu/vk/vk_draw.cpp:584: The new handoff between the game buffer and private buffers has not been exercised in the game. When: Dense turf crosses the promotion threshold and later returns to a quiet area; the harness checks policy and handles but cannot show whether the rendered grass flickers or the transition hitches. Do: Run dense Hyrule Field through promotion and return to Market through retirement on the current head, checking visuals, frame times and device errors.
  • L2 gpu/vk/vk_draw.cpp:7163: The changed buffer and synchronization path has not been tested on the affected Tier 1 hardware or on this rebased head. When: NVIDIA, RADV and Steam Deck drivers execute the narrower barrier and direct game-buffer writes, while the reported game runs and measurements cover only a pre-rebase Windows 860M build. Do: Run the stock-density visual and performance comparison on the current head against its base, and complete the Tier 1 Windows, Linux and Steam Deck coverage required by the project.

Checks: they run again on this head; a failure shows on the pull request.

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

Does it help: Yes on the tested Radeon 860M before the rebase: three interleaved rounds reported Market GPU time 16.49 to 16.02 ms and steady VRAM 3245 to 3165 MB. The reported FPS changes are small, and results on the rebased code and other drivers remain outstanding.

Other systems: The Vulkan buffer and synchronization path affects Windows and Linux GPU drivers, including NVIDIA, Intel, RADV and Steam Deck. The reported in-game runs cover Windows on an AMD 860M; dense-turf transitions and other affected Tier 1 systems remain untested.

Switches: RX_VK_SIM_TURF_ADAPTIVE remains on by default and now selects stock-buffer passthrough until promotion is needed; 0 retains stock-sized private buffers. The measured default is promising on the tested AMD GPU, but wider driver validation remains outstanding.

Reviewed: afa9890862 against 0cc7332c79: Read AGENTS.md, CONTRIBUTING.md and tests/test_sim_turf_stock_passthrough.py in full; read the turf binding and demand-sampling sections of gpu/vk/vk_draw.cpp and the switch definition. Inspected the fix diff and skimmed the supplied runs and reviews. The full base diff and the rest of vk_draw.cpp were not read in full.; nothing run (a code review).

Checked and fine:

  • The test's --cxx argument overrides its default; the default honors CXX and otherwise searches for Clang or GCC.
  • The compiler-selection fix changes only the standalone test and does not remove the turf optimization.

Testing: No commands from the project were run. The supplied report records a Windows AMD in-game tour and targeted game-free checks before the rebase; CI has not run on this head.

Overlaps and merge order: Not checked; the network is closed.


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

**Recommendation: Approve.** The code is ready: only testing is left. The stock-buffer path shows a GPU-time and VRAM gain on the tested AMD system, but the dense-turf handoff and affected Tier 1 hardware still need in-game runs on the rebased code. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is afa98908622f. I rebased it onto `mod-api` (0cc7332c799b). I edited its description to match the change. **Changed** - **Standalone test compiler selection**: Updated tests/test_sim_turf_stock_passthrough.py:238 to honor CXX, fall back to an available Clang or GCC compiler, and retain the --cxx override. Tests were not run as requested. Nothing was built or run: the checks run again on the new head. Simulated turf uses the game's buffers at stock capacity, avoiding private allocations and mirror copies; dense turf can still promote to private buffers. This reduces work in normal scenes while adding buffer-handoff and synchronization paths that need wider validation. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L1** `gpu/vk/vk_draw.cpp:584`: The new handoff between the game buffer and private buffers has not been exercised in the game. *When:* Dense turf crosses the promotion threshold and later returns to a quiet area; the harness checks policy and handles but cannot show whether the rendered grass flickers or the transition hitches. **Do:** Run dense Hyrule Field through promotion and return to Market through retirement on the current head, checking visuals, frame times and device errors. - **L2** `gpu/vk/vk_draw.cpp:7163`: The changed buffer and synchronization path has not been tested on the affected Tier 1 hardware or on this rebased head. *When:* NVIDIA, RADV and Steam Deck drivers execute the narrower barrier and direct game-buffer writes, while the reported game runs and measurements cover only a pre-rebase Windows 860M build. **Do:** Run the stock-density visual and performance comparison on the current head against its base, and complete the Tier 1 Windows, Linux and Steam Deck coverage required by the project. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes on the tested Radeon 860M before the rebase: three interleaved rounds reported Market GPU time 16.49 to 16.02 ms and steady VRAM 3245 to 3165 MB. The reported FPS changes are small, and results on the rebased code and other drivers remain outstanding. **Other systems:** The Vulkan buffer and synchronization path affects Windows and Linux GPU drivers, including NVIDIA, Intel, RADV and Steam Deck. The reported in-game runs cover Windows on an AMD 860M; dense-turf transitions and other affected Tier 1 systems remain untested. **Switches:** RX_VK_SIM_TURF_ADAPTIVE remains on by default and now selects stock-buffer passthrough until promotion is needed; 0 retains stock-sized private buffers. The measured default is promising on the tested AMD GPU, but wider driver validation remains outstanding. **Reviewed:** afa98908622f against 0cc7332c799b: Read AGENTS.md, CONTRIBUTING.md and tests/test_sim_turf_stock_passthrough.py in full; read the turf binding and demand-sampling sections of gpu/vk/vk_draw.cpp and the switch definition. Inspected the fix diff and skimmed the supplied runs and reviews. The full base diff and the rest of vk_draw.cpp were not read in full.; nothing run (a code review). **Checked and fine:** - The test's --cxx argument overrides its default; the default honors CXX and otherwise searches for Clang or GCC. - The compiler-selection fix changes only the standalone test and does not remove the turf optimization. **Testing:** No commands from the project were run. The supplied report records a Windows AMD in-game tour and targeted game-free checks before the rebase; CI has not run on this head. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean merged commit 61c772bce5 into mod-api 2026-11-28 01:24:10 +00:00
HumanBean deleted branch perf/vk-sim-turf-stock-passthrough 2026-11-28 01:24:12 +00:00
Some checks are pending
PR description / Description follows the template (pull_request_target) Successful in 29s
beanstalk/approval changed since the request: ask again
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2328
No description provided.