WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reach #1877

Closed
Jiro113 wants to merge 5 commits from Jiro113/Longshot:fix/grass-lists into main
Contributor

Summary

Builds on #1382 (Grass distance, by winterelfeas): its two commits are here under their name, ported onto current main
(9dd41326; the one conflict was the row's place in docs/user/graphics-and-controls.md), then commits of mine.
Stays WIP until #1382 merges (this then rebases onto main and is only the last commit), and until the larger lists' safety and rendering issues are fixed.

The bug, with #1382: Grass distance 3x and up, in Hyrule Field, standing still: whole patches of short grass come and
go from one frame to the next. Where the grass is thickest 2x (the former row's default) overflows too: standing where a field
save loads, 2x asks for about 196000 to 200000 blades (below), and patches are missing there as well.

Why: the game's grass programs hold a fixed number of records: the blade list of d5a9475f2790532e holds 143360
blades (8-byte records), each of 3de6d86ec7e6720e's two pools 138240 records of 48 bytes. Past 2x the grass asks
for more than that (about 406000 to 415000 blades at 4x, below), so which patches get a place is decided by the order the
GPU's threads reach the counter, and it changes every frame.

The change: an IR pass (ir_opt/grass_pool_pass.h) is intended to move those records to larger storage buffers of the renderer's own (524288 blades, 393216 records in pool 2, about 4 MB and 18 MB each) and raise the caps in the producers and mesh programs that read them. The 64-byte headers stay in the game's buffers. The pass is disabled on all renderers while producer and reader matching, private buffer lifetime, allocation failure and the compute fallback's rendering are addressed. Grass distance is held at the game's reach; RX_VK_GRASS_DISTANCE and RX_VK_GRASS_POOLS cannot enable larger distances or lists.

Read first: gpu/vk/eden/shader_recompiler/ir_opt/grass_pool_pass.h (the pass), vk_draw.cpp grass_private_binding
(the buffers, found by the guest address the game's descriptor names), vk_shader.cpp grass_pools (where it runs).

Testing

Tested: Windows 11, RTX 4090, NVIDIA 621.24, this branch's pack (dev.py pack/rt): the head defe0217 on main @
9dd41326, and before the rebase bb0845b6 on main @ 89c3d21e (Measurements, and the full check run below).

In the game, on defe0217: Hyrule Field, child, standing where a field save loads (facing the castle), the same pack
every run, window behind and muted, 5 frames of RX_VK_DRAW_STATS each. The columns are 3de6d86ec7e6720e's (it reads
the blade list d5a9475f2790532e makes, one thread a blade: the threads it ran, and the count d5a9's counter asked
for), and the shots' near-white pixels (6 shots 0.5 s apart, the ground left of the map):

threads run blades asked grass programs near-white pixels
4x, RX_VK_GRASS_POOLS=0 (#1382 as it is) 143360 every frame 415799 to 416023 none made larger 0.07 to 0.10 %
4x, this PR 406912 to 407168 406909 to 407112 from the pack's prepared cache 0.00 to 0.14 %
4x, compute fallback, RX_VK_GRASS_POOLS=0 143360 every frame 415799 to 416084 none made larger 0.01 to 0.09 %
4x, compute fallback, this PR 406976 to 415680 406947 to 415646 30 made larger, 0 left as they are 4.95 to 7.88 %
2x, compute fallback, RX_VK_GRASS_POOLS=0 143360 every frame 196246 to 200415 none made larger 0.02 to 0.06 %
2x, compute fallback, this PR 196160 to 196352 196128 to 196294 31 made larger, 0 left as they are 0.04 to 0.12 %

The compute fallback is forced with RX_VK_FORCE_MESH_FALLBACK=1: the path the Steam Deck and every RADV GPU take by
default (#1946), and Windows RDNA 2's task + mesh draws.

RX_VK_GRASS_POOLS=0, 4x: comp 3de6d86ec7e6720e 1 | cs threads 143360 | (indirect) #811 [@118750a000 gpu 2240 1 1 415799 | mem 0 1 1 0]
this PR, 4x:             comp 3de6d86ec7e6720e 1 | cs threads 406976 | (indirect) #930 [@118750a000 gpu 6359 1 1 406947 | mem 0 1 1 0]
this PR, 4x:             vk: grass: frame 14858: blade lists 7190 found, 2 made, 0 retaken, 2 absent, 0 lost; pools 14394 found, 2 made, 0 retaken, 10797 absent, 0 lost

With it off, two thirds of the blades asked for at 4x are dropped (more than a quarter at 2x here), and which ones changes
from frame to frame: that is the flicker; on the shots whole parts of the slopes are bare. In that run with it on every blade asked for was processed, none was lost (0 lost), and the slopes were full. Pool 2 holds about 334000 to 341000 records at 4x
(the game's 138240, now 393216; measured at bb0845b6).

Not right yet: the compute fallback at 4x. With this PR the grass is full there too, but some blades are drawn white
(the last column: 5 to 8 % of the ground). Not at 2x, not with RX_VK_GRASS_POOLS=0, not with mesh shaders. The cause
is not found yet; this stays WIP until it is fixed.

Checks: tests/test_grass_pools.py exercises the pass on synthetic programs shaped as the game's (tests/grass_pools_ir.cpp): the three kinds made larger, pool 2's records written at the same place in the new buffer, and variants that differ a little left as they are. It also checks that vk_shader.cpp's production gate leaves programs unchanged with the switch unset, 0 or 1. It can't fail
on main for the bug's reason (the bug is in the game's own programs, the pass is new code), so the test lands with the
fix; the bug on main is shown in the game below. At defe0217, undoing each key part of the pass (8 of them: the pool cap, the IAdd64 #8 form, the blade reads, the blade guards, the table check, the guard order, the switch, the private flags) made it fail. That run used clang++ only: g++ on this PC is clang; no GCC run.

On defe0217, the 244 checks that read the changed files (python -I -B tests/run_all.py --changed, then the same names
with --exact on an exported copy of main @ 9dd41326): here 217 passed, 27 failed; on main 210 passed, 32 failed
(the two grass checks are not there). Every check that fails here fails on main too: test_recording_admission.py
passed once in main's batch, and fails on both when run alone (5 runs of 5 each). The checks that read the changed
files pass: test_grass_pools.py, test_grass_distance.py, test_handle_table_arrays.py,
nx2/test_cbuf_table_extent.py, test_menu_ini_keys.py.

Linux: defe0217's renderer (RX_VK_ONLY=1 nx2/build.py --standalone, tools.lock's clang) built in WSL 2, Ubuntu 22.04:
0 failed. No Linux run in the game (no GPU there).

The whole run, at bb0845b6 on main @ 89c3d21e: python -I -B tests/run_all.py on this branch: 750 passed, 71 failed, 62 skipped; on main @ 89c3d21e (an exported
copy) on the same PC: 747 passed, 72 failed, 62 skipped. Every check that fails here fails on main too (tools,
compilers and stand-ins this PC lacks); main also fails byte_compile_tracked.py, which needs a git checkout the
export isn't. Failing on both: test_vbytes.py (a 600 s timeout), test_appimage_player_build.py,
test_auto_handheld.py, test_bug_report.py, test_bug_report_defaults.py, test_build_long_paths.py,
test_capture_read_once.py, test_capture_readback_visibility.py, test_crash_dialog.py, test_crt_options.py,
test_damage_debug_menu.py, test_dev_ab.py, test_dev_build.py, test_dev_migrate.py, test_dev_packs.py,
test_discover.py, test_display_startup_failure.py, test_dlss_feature_size.py, test_draw_binds.py,
test_draw_stream_visibility.py, test_early_split_before_draw.py, test_failed_compile_keeps_objects.py,
test_frame_overlap.py, test_fsr_image_retirement.py, test_fsr_uniform_ownership.py,
test_game_menu_mouse_buttons.py, test_guest_imported.py, test_high_fps_fixes.py, test_hold_gpu.py,
test_host_guest_writes.py, test_hud_layout_row.py, test_job_queue.py, test_libc_hooks.py, test_lift_cache.py,
test_lift_lookups.py, test_linux_preflight.py, test_linux_pressure.py, test_low_vram_texture_mips.py,
test_make_game_cache.py, test_make_game_ngx.py, test_mise_build.py, test_missing_nup.py, test_mods_list.py,
test_ngx_sdk.py, test_pads_after_menu.py, test_pass_barrier.py, test_pending_guest_import.py,
test_pipeline_play_cache.py, test_prepare_cache_save.py, test_present_queue_default.py,
test_present_source_crop.py, test_profiling_mode.py, test_psychov35_fsr3_fg.py, test_readback_early.py,
test_readback_late.py, test_readback_timeout_source.py, test_recording_admission.py,
test_replay_write_order.py, test_sampler_admission.py, test_sdiv_overflow.py, test_slow_frames.py,
test_song_note_cue.py, test_split_before_draw.py, test_staging_burst.py, test_texel_buffer_ownership.py,
test_ub_update_batch.py, test_upscaler_rows.py, test_vcore_escape.py, test_vk_occlusion_queries.py,
test_walk.py, test_walk_key.py. The checks that read the changed files pass: test_grass_pools.py,
test_handle_table_arrays.py, nx2/test_cbuf_table_extent.py, test_menu_ini_keys.py.

Still to test:

  • Linux, AMD (RADV) and the Steam Deck, once the compute fallback's white blades are fixed: Hyrule Field, Grass distance
    2x and 4x, standing still, expecting the grass steady and green, and vk: grass: program ...: ... made larger lines
    with no left as it is (@Beanstalk once #1382 is in).
  • Intel: the same (@Beanstalk).

Measurements

Measured at bb0845b6 on main @ 89c3d21e, before the rebase; to be measured again on the final rebase.

Verdict: at 4x, -8.9 % fps (89.3 against 98.0, +1.07 ms a frame), every run below every run of #1382 as it is:
the cost of drawing every blade 4x asks for (about 2.9 times as many as the game's list kept). At 2x (the default), within the runs' spread (-1.9 % fps, +0.20 ms), though each
pair's run of this PR was the slower one.

Setup: Windows 11, RTX 4090, NVIDIA 621.24; Hyrule Field, child, standing where a field save of mine loads (facing
the castle; dev.py ab --scene kokiri-house --save <that save>, so its text below says "Link's house": the scene is the
save's, no teleport. The hyrule-field scene lands in the tunnel from Kokiri Forest, about 5500 blades, below the
game's caps); window 2560x720, output 5120x1440, every menu row at its default (resolution Auto, DLSS Game's own,
frame generation and V-Sync off), uncapped (HOS_FPS_MAX=1000); RX_VK_GRASS_DISTANCE set for both sides (over the
row's 2x); 60 s each after the warm-up, 3 interleaved pairs, the median; dev.py ab --env RX_VK_GRASS_POOLS=0.

Baseline: one build both ways, this branch (main @ 89c3d21e + #1382's two commits + this one): "Before" is
RX_VK_GRASS_POOLS=0, #1382 as it is; main has no Grass distance, so no 4x to compare with.

What holds the frame there (one profiled run, 4x, this PR, 75 s in the field): 11.7 ms a frame, GPU 8.5 ms,
the render thread's jobs 9.1 ms (draw translation 5.5 ms); the blade list's producer d5a9475f2790532e 0.08 ms of
GPU, the pools' producer under 0.08 ms. The frame is GPU- and replay-bound, so more blades drawn is more time.

Grass distance 4x (RX_VK_GRASS_DISTANCE=4):

Before, RX_VK_GRASS_POOLS=0 (#1382 as it is): this PR @ bb0845b69 After: this PR @ bb0845b69 Δ
fps (each run) 98.0 / 97.9 / 98.7 (median 98.0) 90.6 / 88.3 / 89.3 (median 89.3) -8.9 %
1% low fps (1000 / p99) 87.7 81.1 -7.5 %
median frame time 10.10 ms 11.17 ms +1.07 ms
p99 frame time 11.40 ms 12.33 ms +0.93 ms
blades processed a frame 143360 (the cap) about 405000 to 416000 (all asked)
A1 (this PR): 5438 frames in 60 s, 90.6 fps, median 11.01 ms, p99 12.03 ms, 1% low 83.2 fps, 0 cold frames
B1 (POOLS=0): 5878 frames in 60 s, 98.0 fps, median 10.10 ms, p99 11.62 ms, 1% low 86.1 fps, 0 cold frames
A2 (this PR): 5296 frames in 60 s, 88.3 fps, median 11.27 ms, p99 12.63 ms, 1% low 79.2 fps, 0 cold frames
B2 (POOLS=0): 5876 frames in 60 s, 97.9 fps, median 10.17 ms, p99 11.40 ms, 1% low 87.7 fps, 0 cold frames
A3 (this PR): 5356 frames in 60 s, 89.3 fps, median 11.17 ms, p99 12.33 ms, 1% low 81.1 fps, 0 cold frames
B3 (POOLS=0): 5922 frames in 60 s, 98.7 fps, median 10.10 ms, p99 11.32 ms, 1% low 88.4 fps, 0 cold frames
vk: switches set (11): ... HOS_FPS_MAX=1000 (player), ... RX_VK_GRASS_DISTANCE=4 (player), RX_VK_GRASS_POOLS=0 (kill)

Grass distance 2x (the former row's default), the same setup:

Before, RX_VK_GRASS_POOLS=0 (#1382 as it is): this PR @ bb0845b69 After: this PR @ bb0845b69 Δ
fps (each run) 98.6 / 100.4 / 95.2 (median 98.6) 96.7 / 99.0 / 92.8 (median 96.7) -1.9 %
1% low fps (1000 / p99) 88.2 87.2 -1.1 %
median frame time 10.11 ms 10.31 ms +0.20 ms
p99 frame time 11.34 ms 11.47 ms +0.13 ms
A1 (this PR): 5800 frames in 60 s, 96.7 fps, median 10.31 ms, p99 11.47 ms, 1% low 87.2 fps, 0 cold frames
B1 (POOLS=0): 5914 frames in 60 s, 98.6 fps, median 10.11 ms, p99 11.34 ms, 1% low 88.2 fps, 0 cold frames
A2 (this PR): 5938 frames in 60 s, 99.0 fps, median 10.08 ms, p99 11.04 ms, 1% low 90.6 fps, 0 cold frames
B2 (POOLS=0): 6022 frames in 60 s, 100.4 fps, median 9.93 ms, p99 11.04 ms, 1% low 90.6 fps, 0 cold frames
A3 (this PR): 5565 frames in 60 s, 92.8 fps, median 10.73 ms, p99 12.52 ms, 1% low 79.9 fps, 0 cold frames
B3 (POOLS=0): 5711 frames in 60 s, 95.2 fps, median 10.48 ms, p99 11.72 ms, 1% low 85.3 fps, 0 cold frames

Within the runs' spread, but each pair's run of this PR is the slower one (by 1.4 to 2.5 %): treat it as up to about
0.2 ms a frame at 2x, not as nothing. The blade counts at 2x were not logged in these runs; on defe0217 (Testing) the
same spot at 2x asks for about 196000 to 200000 blades, so #1382 as it is keeps 143360 of them and this PR draws them
all: part of that 0.2 ms is the grass that was missing.

dev.py ab wrote no measurements.md itself: it compares every switch the runs set, and HOS_CONTROL (the control
bridge's pipe, a new name each run) differs in every run driven through the bridge. The table above is its own
write-up (ab.measurements) from the saved runs with that one name left out; nothing else differed.

Risks

  • Memory, if the pass is enabled: about 4 MB per blade list and 18 MB per pool the renderer makes (two of each in Hyrule Field, six at most of each: about 132 MB at worst), only when the grass programs run.
  • The compute fallback at 4x (the Steam Deck, every RADV GPU, Windows RDNA 2's task + mesh draws): some blades are
    drawn white (Testing), seen with RX_VK_FORCE_MESH_FALLBACK=1 on the RTX 4090; not at 2x. Cause not found yet; to fix
    before this leaves WIP.
  • 8x, if larger distances and lists are enabled, asks for more than the new sizes too (the lists filled up in the counters): it can still flicker there.
  • Disabled: the game uses its own lists regardless of RX_VK_GRASS_POOLS. The translator's stamp distinguishes the disabled path.
  • After updating: the grass programs are translated again once (the stamp changed); nothing in saves or
    longshot_options.ini.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (on main @ 9dd41326, but #1382's two commits are
    here until it merges)
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (earlier heads tested; final head pending)
  • mise run test passes (any failure that also fails on main is named). (final head pending)
  • 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.
    (the program keys and sizes were read from the game's shader IR on this PC; nothing of it is committed)

When it applies

  • A fix: a game-free test that fails on main and passes here. (to settle: it can't fail on main for the bug's reason; the
    bug on main is shown in the game, Testing says why)
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def. (larger lists and distances are disabled)
  • 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. (final head pending)
    (defe0217's tree: the pack on Windows with llvm-mingw, the renderer on Linux in WSL 2 with tools.lock's clang; the
    change handles no path)
  • Docs updated.
    (#1382's commits: Grass distance in docs/user/graphics-and-controls.md; RX_VK_GRASS_POOLS is a kill switch, its row
    in gpu/vk/switches.def)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary Builds on #1382 (Grass distance, by winterelfeas): its two commits are here under their name, ported onto current `main` (9dd41326; the one conflict was the row's place in `docs/user/graphics-and-controls.md`), then commits of mine. Stays WIP until #1382 merges (this then rebases onto `main` and is only the last commit), and until the larger lists' safety and rendering issues are fixed. **The bug, with #1382:** Grass distance 3x and up, in Hyrule Field, standing still: whole patches of short grass come and go from one frame to the next. Where the grass is thickest 2x (the former row's default) overflows too: standing where a field save loads, 2x asks for about 196000 to 200000 blades (below), and patches are missing there as well. **Why:** the game's grass programs hold a fixed number of records: the blade list of `d5a9475f2790532e` holds 143360 blades (8-byte records), each of `3de6d86ec7e6720e`'s two pools 138240 records of 48 bytes. Past 2x the grass asks for more than that (about 406000 to 415000 blades at 4x, below), so which patches get a place is decided by the order the GPU's threads reach the counter, and it changes every frame. **The change:** an IR pass (`ir_opt/grass_pool_pass.h`) is intended to move those records to larger storage buffers of the renderer's own (524288 blades, 393216 records in pool 2, about 4 MB and 18 MB each) and raise the caps in the producers and mesh programs that read them. The 64-byte headers stay in the game's buffers. The pass is disabled on all renderers while producer and reader matching, private buffer lifetime, allocation failure and the compute fallback's rendering are addressed. Grass distance is held at the game's reach; `RX_VK_GRASS_DISTANCE` and `RX_VK_GRASS_POOLS` cannot enable larger distances or lists. Read first: `gpu/vk/eden/shader_recompiler/ir_opt/grass_pool_pass.h` (the pass), `vk_draw.cpp` `grass_private_binding` (the buffers, found by the guest address the game's descriptor names), `vk_shader.cpp` `grass_pools` (where it runs). ## Testing **Tested:** Windows 11, RTX 4090, NVIDIA 621.24, this branch's pack (`dev.py pack`/`rt`): the head defe0217 on main @ 9dd41326, and before the rebase bb0845b6 on main @ 89c3d21e (Measurements, and the full check run below). **In the game, on defe0217:** Hyrule Field, child, standing where a field save loads (facing the castle), the same pack every run, window behind and muted, 5 frames of `RX_VK_DRAW_STATS` each. The columns are `3de6d86ec7e6720e`'s (it reads the blade list `d5a9475f2790532e` makes, one thread a blade: the threads it ran, and the count `d5a9`'s counter asked for), and the shots' near-white pixels (6 shots 0.5 s apart, the ground left of the map): | | threads run | blades asked | grass programs | near-white pixels | |---|---|---|---|---| | 4x, `RX_VK_GRASS_POOLS=0` (#1382 as it is) | 143360 every frame | 415799 to 416023 | none made larger | 0.07 to 0.10 % | | 4x, this PR | 406912 to 407168 | 406909 to 407112 | from the pack's prepared cache | 0.00 to 0.14 % | | 4x, compute fallback, `RX_VK_GRASS_POOLS=0` | 143360 every frame | 415799 to 416084 | none made larger | 0.01 to 0.09 % | | 4x, compute fallback, this PR | 406976 to 415680 | 406947 to 415646 | 30 made larger, 0 left as they are | **4.95 to 7.88 %** | | 2x, compute fallback, `RX_VK_GRASS_POOLS=0` | 143360 every frame | 196246 to 200415 | none made larger | 0.02 to 0.06 % | | 2x, compute fallback, this PR | 196160 to 196352 | 196128 to 196294 | 31 made larger, 0 left as they are | 0.04 to 0.12 % | The compute fallback is forced with `RX_VK_FORCE_MESH_FALLBACK=1`: the path the Steam Deck and every RADV GPU take by default (#1946), and Windows RDNA 2's task + mesh draws. ``` RX_VK_GRASS_POOLS=0, 4x: comp 3de6d86ec7e6720e 1 | cs threads 143360 | (indirect) #811 [@118750a000 gpu 2240 1 1 415799 | mem 0 1 1 0] this PR, 4x: comp 3de6d86ec7e6720e 1 | cs threads 406976 | (indirect) #930 [@118750a000 gpu 6359 1 1 406947 | mem 0 1 1 0] this PR, 4x: vk: grass: frame 14858: blade lists 7190 found, 2 made, 0 retaken, 2 absent, 0 lost; pools 14394 found, 2 made, 0 retaken, 10797 absent, 0 lost ``` With it off, two thirds of the blades asked for at 4x are dropped (more than a quarter at 2x here), and which ones changes from frame to frame: that is the flicker; on the shots whole parts of the slopes are bare. In that run with it on every blade asked for was processed, none was lost (`0 lost`), and the slopes were full. Pool 2 holds about 334000 to 341000 records at 4x (the game's 138240, now 393216; measured at bb0845b6). **Not right yet: the compute fallback at 4x.** With this PR the grass is full there too, but some blades are drawn white (the last column: 5 to 8 % of the ground). Not at 2x, not with `RX_VK_GRASS_POOLS=0`, not with mesh shaders. The cause is not found yet; this stays WIP until it is fixed. **Checks:** `tests/test_grass_pools.py` exercises the pass on synthetic programs shaped as the game's (`tests/grass_pools_ir.cpp`): the three kinds made larger, pool 2's records written at the same place in the new buffer, and variants that differ a little left as they are. It also checks that `vk_shader.cpp`'s production gate leaves programs unchanged with the switch unset, 0 or 1. It can't fail on `main` for the bug's reason (the bug is in the game's own programs, the pass is new code), so the test lands with the fix; the bug on `main` is shown in the game below. At defe0217, undoing each key part of the pass (8 of them: the pool cap, the `IAdd64 #8` form, the blade reads, the blade guards, the table check, the guard order, the switch, the private flags) made it fail. That run used clang++ only: `g++` on this PC is clang; no GCC run. On defe0217, the 244 checks that read the changed files (`python -I -B tests/run_all.py --changed`, then the same names with `--exact` on an exported copy of `main` @ 9dd41326): here 217 passed, 27 failed; on `main` 210 passed, 32 failed (the two grass checks are not there). Every check that fails here fails on `main` too: `test_recording_admission.py` passed once in `main`'s batch, and fails on both when run alone (5 runs of 5 each). The checks that read the changed files pass: `test_grass_pools.py`, `test_grass_distance.py`, `test_handle_table_arrays.py`, `nx2/test_cbuf_table_extent.py`, `test_menu_ini_keys.py`. Linux: defe0217's renderer (`RX_VK_ONLY=1 nx2/build.py --standalone`, tools.lock's clang) built in WSL 2, Ubuntu 22.04: 0 failed. No Linux run in the game (no GPU there). The whole run, at bb0845b6 on main @ 89c3d21e: `python -I -B tests/run_all.py` on this branch: 750 passed, 71 failed, 62 skipped; on `main` @ 89c3d21e (an exported copy) on the same PC: 747 passed, 72 failed, 62 skipped. Every check that fails here fails on `main` too (tools, compilers and stand-ins this PC lacks); `main` also fails `byte_compile_tracked.py`, which needs a git checkout the export isn't. Failing on both: `test_vbytes.py` (a 600 s timeout), `test_appimage_player_build.py`, `test_auto_handheld.py`, `test_bug_report.py`, `test_bug_report_defaults.py`, `test_build_long_paths.py`, `test_capture_read_once.py`, `test_capture_readback_visibility.py`, `test_crash_dialog.py`, `test_crt_options.py`, `test_damage_debug_menu.py`, `test_dev_ab.py`, `test_dev_build.py`, `test_dev_migrate.py`, `test_dev_packs.py`, `test_discover.py`, `test_display_startup_failure.py`, `test_dlss_feature_size.py`, `test_draw_binds.py`, `test_draw_stream_visibility.py`, `test_early_split_before_draw.py`, `test_failed_compile_keeps_objects.py`, `test_frame_overlap.py`, `test_fsr_image_retirement.py`, `test_fsr_uniform_ownership.py`, `test_game_menu_mouse_buttons.py`, `test_guest_imported.py`, `test_high_fps_fixes.py`, `test_hold_gpu.py`, `test_host_guest_writes.py`, `test_hud_layout_row.py`, `test_job_queue.py`, `test_libc_hooks.py`, `test_lift_cache.py`, `test_lift_lookups.py`, `test_linux_preflight.py`, `test_linux_pressure.py`, `test_low_vram_texture_mips.py`, `test_make_game_cache.py`, `test_make_game_ngx.py`, `test_mise_build.py`, `test_missing_nup.py`, `test_mods_list.py`, `test_ngx_sdk.py`, `test_pads_after_menu.py`, `test_pass_barrier.py`, `test_pending_guest_import.py`, `test_pipeline_play_cache.py`, `test_prepare_cache_save.py`, `test_present_queue_default.py`, `test_present_source_crop.py`, `test_profiling_mode.py`, `test_psychov35_fsr3_fg.py`, `test_readback_early.py`, `test_readback_late.py`, `test_readback_timeout_source.py`, `test_recording_admission.py`, `test_replay_write_order.py`, `test_sampler_admission.py`, `test_sdiv_overflow.py`, `test_slow_frames.py`, `test_song_note_cue.py`, `test_split_before_draw.py`, `test_staging_burst.py`, `test_texel_buffer_ownership.py`, `test_ub_update_batch.py`, `test_upscaler_rows.py`, `test_vcore_escape.py`, `test_vk_occlusion_queries.py`, `test_walk.py`, `test_walk_key.py`. The checks that read the changed files pass: `test_grass_pools.py`, `test_handle_table_arrays.py`, `nx2/test_cbuf_table_extent.py`, `test_menu_ini_keys.py`. **Still to test:** - Linux, AMD (RADV) and the Steam Deck, once the compute fallback's white blades are fixed: Hyrule Field, Grass distance 2x and 4x, standing still, expecting the grass steady and green, and `vk: grass: program ...: ... made larger` lines with no `left as it is` (`@Beanstalk` once #1382 is in). - Intel: the same (`@Beanstalk`). ## Measurements Measured at bb0845b6 on main @ 89c3d21e, before the rebase; to be measured again on the final rebase. **Verdict:** at 4x, -8.9 % fps (89.3 against 98.0, +1.07 ms a frame), every run below every run of #1382 as it is: the cost of drawing every blade 4x asks for (about 2.9 times as many as the game's list kept). At 2x (the default), within the runs' spread (-1.9 % fps, +0.20 ms), though each pair's run of this PR was the slower one. **Setup:** Windows 11, RTX 4090, NVIDIA 621.24; Hyrule Field, child, standing where a field save of mine loads (facing the castle; `dev.py ab --scene kokiri-house --save <that save>`, so its text below says "Link's house": the scene is the save's, no teleport. The `hyrule-field` scene lands in the tunnel from Kokiri Forest, about 5500 blades, below the game's caps); window 2560x720, output 5120x1440, every menu row at its default (resolution Auto, DLSS Game's own, frame generation and V-Sync off), uncapped (`HOS_FPS_MAX=1000`); `RX_VK_GRASS_DISTANCE` set for both sides (over the row's 2x); 60 s each after the warm-up, 3 interleaved pairs, the median; `dev.py ab --env RX_VK_GRASS_POOLS=0`. **Baseline:** one build both ways, this branch (main @ 89c3d21e + #1382's two commits + this one): "Before" is `RX_VK_GRASS_POOLS=0`, #1382 as it is; `main` has no Grass distance, so no 4x to compare with. **What holds the frame there** (one profiled run, 4x, this PR, 75 s in the field): 11.7 ms a frame, GPU 8.5 ms, the render thread's jobs 9.1 ms (draw translation 5.5 ms); the blade list's producer `d5a9475f2790532e` 0.08 ms of GPU, the pools' producer under 0.08 ms. The frame is GPU- and replay-bound, so more blades drawn is more time. Grass distance 4x (`RX_VK_GRASS_DISTANCE=4`): | | Before, RX_VK_GRASS_POOLS=0 (#1382 as it is): this PR @ bb0845b69 | After: this PR @ bb0845b69 | Δ | |---|---|---|---| | fps (each run) | 98.0 / 97.9 / 98.7 (median 98.0) | 90.6 / 88.3 / 89.3 (median 89.3) | -8.9 % | | 1% low fps (1000 / p99) | 87.7 | 81.1 | -7.5 % | | median frame time | 10.10 ms | 11.17 ms | +1.07 ms | | p99 frame time | 11.40 ms | 12.33 ms | +0.93 ms | | blades processed a frame | 143360 (the cap) | about 405000 to 416000 (all asked) | | ``` A1 (this PR): 5438 frames in 60 s, 90.6 fps, median 11.01 ms, p99 12.03 ms, 1% low 83.2 fps, 0 cold frames B1 (POOLS=0): 5878 frames in 60 s, 98.0 fps, median 10.10 ms, p99 11.62 ms, 1% low 86.1 fps, 0 cold frames A2 (this PR): 5296 frames in 60 s, 88.3 fps, median 11.27 ms, p99 12.63 ms, 1% low 79.2 fps, 0 cold frames B2 (POOLS=0): 5876 frames in 60 s, 97.9 fps, median 10.17 ms, p99 11.40 ms, 1% low 87.7 fps, 0 cold frames A3 (this PR): 5356 frames in 60 s, 89.3 fps, median 11.17 ms, p99 12.33 ms, 1% low 81.1 fps, 0 cold frames B3 (POOLS=0): 5922 frames in 60 s, 98.7 fps, median 10.10 ms, p99 11.32 ms, 1% low 88.4 fps, 0 cold frames vk: switches set (11): ... HOS_FPS_MAX=1000 (player), ... RX_VK_GRASS_DISTANCE=4 (player), RX_VK_GRASS_POOLS=0 (kill) ``` Grass distance 2x (the former row's default), the same setup: | | Before, RX_VK_GRASS_POOLS=0 (#1382 as it is): this PR @ bb0845b69 | After: this PR @ bb0845b69 | Δ | |---|---|---|---| | fps (each run) | 98.6 / 100.4 / 95.2 (median 98.6) | 96.7 / 99.0 / 92.8 (median 96.7) | -1.9 % | | 1% low fps (1000 / p99) | 88.2 | 87.2 | -1.1 % | | median frame time | 10.11 ms | 10.31 ms | +0.20 ms | | p99 frame time | 11.34 ms | 11.47 ms | +0.13 ms | ``` A1 (this PR): 5800 frames in 60 s, 96.7 fps, median 10.31 ms, p99 11.47 ms, 1% low 87.2 fps, 0 cold frames B1 (POOLS=0): 5914 frames in 60 s, 98.6 fps, median 10.11 ms, p99 11.34 ms, 1% low 88.2 fps, 0 cold frames A2 (this PR): 5938 frames in 60 s, 99.0 fps, median 10.08 ms, p99 11.04 ms, 1% low 90.6 fps, 0 cold frames B2 (POOLS=0): 6022 frames in 60 s, 100.4 fps, median 9.93 ms, p99 11.04 ms, 1% low 90.6 fps, 0 cold frames A3 (this PR): 5565 frames in 60 s, 92.8 fps, median 10.73 ms, p99 12.52 ms, 1% low 79.9 fps, 0 cold frames B3 (POOLS=0): 5711 frames in 60 s, 95.2 fps, median 10.48 ms, p99 11.72 ms, 1% low 85.3 fps, 0 cold frames ``` Within the runs' spread, but each pair's run of this PR is the slower one (by 1.4 to 2.5 %): treat it as up to about 0.2 ms a frame at 2x, not as nothing. The blade counts at 2x were not logged in these runs; on defe0217 (Testing) the same spot at 2x asks for about 196000 to 200000 blades, so #1382 as it is keeps 143360 of them and this PR draws them all: part of that 0.2 ms is the grass that was missing. `dev.py ab` wrote no `measurements.md` itself: it compares every switch the runs set, and `HOS_CONTROL` (the control bridge's pipe, a new name each run) differs in every run driven through the bridge. The table above is its own write-up (`ab.measurements`) from the saved runs with that one name left out; nothing else differed. ## Risks - **Memory, if the pass is enabled:** about 4 MB per blade list and 18 MB per pool the renderer makes (two of each in Hyrule Field, six at most of each: about 132 MB at worst), only when the grass programs run. - **The compute fallback at 4x** (the Steam Deck, every RADV GPU, Windows RDNA 2's task + mesh draws): some blades are drawn white (Testing), seen with `RX_VK_FORCE_MESH_FALLBACK=1` on the RTX 4090; not at 2x. Cause not found yet; to fix before this leaves WIP. - **8x**, if larger distances and lists are enabled, asks for more than the new sizes too (the lists filled up in the counters): it can still flicker there. - **Disabled:** the game uses its own lists regardless of `RX_VK_GRASS_POOLS`. The translator's stamp distinguishes the disabled path. - After updating: the grass programs are translated again once (the stamp changed); nothing in saves or `longshot_options.ini`. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. (on main @ 9dd41326, but #1382's two commits are here until it merges) - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (earlier heads tested; final head pending) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (final head pending) - [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. (the program keys and sizes were read from the game's shader IR on this PC; nothing of it is committed) ### When it applies - [ ] A fix: a game-free test that fails on `main` and passes here. (to settle: it can't fail on `main` for the bug's reason; the bug on `main` is shown in the game, Testing says why) - [ ] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. (larger lists and distances are disabled) - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (final head pending) (defe0217's tree: the pack on Windows with llvm-mingw, the renderer on Linux in WSL 2 with tools.lock's clang; the change handles no path) - [x] Docs updated. (#1382's commits: Grass distance in `docs/user/graphics-and-controls.md`; `RX_VK_GRASS_POOLS` is a kill switch, its row in `gpu/vk/switches.def`) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Kokiri Forest's short tufts and the moss on its stones stop about 20 m from the camera, so from the stepping stones the ground before the forest's exit is bare until Link walks up to it. They come from patches a compute program picks within 22 m of Link (383a566958350efe, its scene buffer's word 75), and each blade goes through a random cut by its distance in the task stage of both programs that draw it, 43ec86f35fd937b9 and 8a8304edb7bdf4bf (words 46 and 47: a fade from 12 m to about 20 m). Lifting the cut in only one of the two passes changes nothing on screen.

The new Graphics row, Grass distance (Game's, 2x, 3x, 4x; 2x by default), makes the radius and both fades that many times as far, in the copy of the scene buffer the GPU reads (uniform_range, grass_reach, grass_words); only positive values are changed, as the slot holds other numbers in other stages. RX_VK_GRASS_DISTANCE=<n> sets it for one run. tests/test_grass_distance.py keeps the row, its labels and the reach table together.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ed84459dbf)

Ported onto main 89c3d21e from #1382 (ed84459d) by Lucas Lebbrecht for the grass lists' fix: the row in
gpu/vk/menu/grass.cpp after Anisotropic filtering (the menu is modules since #1633), its key in FROZEN,
test_grass_distance reading the module, the row in docs/user/graphics-and-controls.md (README's option table and
docs/development.md have moved there).
The main grass (Hyrule Field's) gets its blade count per ground tile from compute d5a9475f2790532e: the density times 1 - (1 + w97 - w96 / d^2), so full to sqrt(w96) (8 m), then falling as 1 / d^2 to none at sqrt(w96 / w97) (65 m). The game's own foliage setting for it (the foliage object's +0x7c) moves both words together; the row now multiplies both by n^2, so the full count reaches n times as far and the end stays at 65 m. The compute runs when the game makes a tile, so a change of the row reaches the main grass as Link moves on or the area loads again.

grass_words gives each word the power of the reach it is multiplied by; each changed word is logged once ("vk: Grass distance ..."). Measured in Hyrule Field by the Kakariko gate: the blades in the middle distance 30 to 48 % more at 3x, as the game's own +0x7c = 24 gives; GPU +0.35 ms a frame at 4x on an RTX 5090 at 1440p, 2x within the noise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 095a64343b)

Ported onto main 89c3d21e from #1382 (095a6434) by Lucas Lebbrecht: the row's new help in
gpu/vk/menu/grass.cpp.
fix(vk): the grass's lists made larger, so Grass distance 3x and up stops flickering
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 9s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
bb0845b698
Above 2x the short grass asks for more blades than the game's lists hold (143360 blades in d5a9475f2790532e, 138240
48-byte records in each of 3de6d86ec7e6720e's two pools): which patches get in changes from frame to frame, and whole
patches of grass come and go in Hyrule Field, even standing still. An IR pass (ir_opt/grass_pool_pass.h) moves the
records to storage buffers of the renderer's own (524288 blades, 393216 records in pool 2) and raises the caps in the
producers and the mesh readers; the 64-byte headers stay in the game's buffers. 3de6's pool-2 writes are taken in both
forms the program has (the record's address, and that address + 8). Every edit is checked first; a program that does
not look as expected is left as it is and logged ("vk: grass: program ...: ... left as it is: <why>").
RX_VK_GRASS_POOLS=0 leaves the programs as they were.

The renderer's buffers are found by the guest address the game's descriptor names (vk_draw.cpp grass_private_binding).
A line every 600 frames, when it changed, counts the lookups over the run ("vk: grass: frame N: ..."), and the binding
log stops at 64 lines.

tests/test_grass_pools.py runs the pass on synthetic programs shaped as the game's (tests/grass_pools_ir.cpp): the three
made larger, pool 2's records at the same place in the new buffer, eleven that differ a little left as they are, and
vk_shader.cpp's grass_pools both ways (unset, and RX_VK_GRASS_POOLS=0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 11, RTX 4090, NVIDIA 621.24, Hyrule Field from a field save, standing still at Grass distance 4x: with RX_VK_GRASS_POOLS=0 the blade list holds 143360 blades every frame of ~415800 asked and patches of grass come and go; with this PR all of them are processed (405350-415646 asked, the same drawn), 32 grass programs made larger, 0 left as they are, no flicker in 6 shots 0.5 s apart. dev.py ab at 4x and 2x, 3 pairs each (Measurements).

Tested in game: Windows 11, RTX 4090, NVIDIA 621.24, Hyrule Field from a field save, standing still at Grass distance 4x: with RX_VK_GRASS_POOLS=0 the blade list holds 143360 blades every frame of ~415800 asked and patches of grass come and go; with this PR all of them are processed (405350-415646 asked, the same drawn), 32 grass programs made larger, 0 left as they are, no flicker in 6 shots 0.5 s apart. dev.py ab at 4x and 2x, 3 pairs each (Measurements).
Jiro113 force-pushed fix/grass-lists from bb0845b698
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 9s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to defe021701
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-21 14:28:21 +00:00
Compare
Author
Contributor

Rebased onto main @ 9dd41326 (head defe0217): #1382's two commits ported again under winterelfeas's name, the one conflict the Grass distance row's place in docs/user/graphics-and-controls.md. Built again: the pack on Windows, the renderer on Linux (WSL 2, Ubuntu 22.04), so the Linux box is ticked. The checks that read the changed files fail nothing main does not.

Checked again in the game on the rebased head (Testing has the table), which turned up two things:

  • The compute fallback at 4x draws some blades white with this PR (RX_VK_FORCE_MESH_FALLBACK=1 on the RTX 4090: 5 to 8 % of the ground near-white, against 0.1 % at most with RX_VK_GRASS_POOLS=0, with mesh shaders, or at 2x). That is the Steam Deck's and every RADV GPU's path, so this stays WIP until it is fixed (Risks).
  • 2x overflows the game's list too where the grass is thickest: about 196000 to 200000 blades asked for 143360, patches missing on the shots. So the 2x measurement compares two amounts of grass (Measurements says so now).

Also corrected in Testing: the 143360 threads are 3de6d86ec7e6720e's (it reads the blade list d5a9475f2790532e makes), not d5a9's. The measurements are still those of bb0845b6 on main @ 89c3d21e; they will be taken again on the final rebase.

Rebased onto main @ 9dd41326 (head defe0217): #1382's two commits ported again under winterelfeas's name, the one conflict the Grass distance row's place in `docs/user/graphics-and-controls.md`. Built again: the pack on Windows, the renderer on Linux (WSL 2, Ubuntu 22.04), so the Linux box is ticked. The checks that read the changed files fail nothing `main` does not. Checked again in the game on the rebased head (Testing has the table), which turned up two things: - **The compute fallback at 4x draws some blades white** with this PR (`RX_VK_FORCE_MESH_FALLBACK=1` on the RTX 4090: 5 to 8 % of the ground near-white, against 0.1 % at most with `RX_VK_GRASS_POOLS=0`, with mesh shaders, or at 2x). That is the Steam Deck's and every RADV GPU's path, so this stays WIP until it is fixed (Risks). - **2x overflows the game's list too** where the grass is thickest: about 196000 to 200000 blades asked for 143360, patches missing on the shots. So the 2x measurement compares two amounts of grass (Measurements says so now). Also corrected in Testing: the 143360 threads are `3de6d86ec7e6720e`'s (it reads the blade list `d5a9475f2790532e` makes), not `d5a9`'s. The measurements are still those of bb0845b6 on main @ 89c3d21e; they will be taken again on the final rebase.
Contributor

Dependent follow-up proposal: #2093 keeps this PR's 78c072ce foundation with Lucas's authorship, then adds measured adaptive sizing and the per-area/global six-row settings page. It is intended as a follow-up, not a competing buffer fix. #2093 remains WIP and will drop/rebase duplicate prerequisite work if this PR lands first.

Dependent follow-up proposal: #2093 keeps this PR's `78c072ce` foundation with Lucas's authorship, then adds measured adaptive sizing and the per-area/global six-row settings page. It is intended as a follow-up, not a competing buffer fix. #2093 remains WIP and will drop/rebase duplicate prerequisite work if this PR lands first.
Owner
@rebase
Member

I didn't rebase this pull request: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The files were left unchanged. Nothing was pushed.


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

I didn't rebase this pull request: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The files were left unchanged. Nothing was pushed. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
BeanBot changed title from WIP: fix(vk): the grass's lists made larger, so Grass distance 3x and up stops flickering to WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reach 2026-11-21 19:27:49 +00:00
fix(grass): disable unsafe pool enlargement
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 16s
PR description / Description follows the template (pull_request_target) Successful in 20s
CI / Workflow lint (actionlint) (pull_request) Successful in 20s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 19s
Third-party parts / As their notes say (pull_request) Successful in 17s
CI / Website build and checks (pull_request) Successful in 8m42s
f3196b9963
As the review on #1877 asked.
BeanBot requested changes 2026-11-21 19:28:04 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The enlarged lists remain disabled, so the overflow and flicker fix does not run. The compute fallback defect and the base-branch conflict also remain unresolved.

What @fix changed
I changed this pull request: the new head is f3196b9963. I couldn't bring it up to date with main: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list; the pull request increases that density. The author must decide whether and how to enable the change despite that risk. Files were left as they were. I edited its description and retitled it “WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reach” to match the change.

Changed

  • Allocation failure: The gate in gpu/vk/vk_shader.cpp:1337 prevents enlarged shaders from executing against the game's smaller buffers.
  • Private buffer lifetime: The gate in gpu/vk/vk_shader.cpp:1337 prevents production shaders from using or reassigning private grass buffers.
  • Partial shader matches: Disabled the pass for the entire pipeline in gpu/vk/vk_shader.cpp:1337. tests/grass_pools_ir.cpp:299 covers a producer that matches while its consumer does not, and checks that production leaves both unchanged.
  • Compiler selection: tests/test_grass_pools.py:96 honors CC when --cxx is absent and links the C++ runtime when using the C compiler driver. Tests were not run.

Changed in part (the rest is for the author)

  • Grass distance default: Set the default to the game's distance in gpu/vk/vk_menu.h:54 and updated the documentation and check. The author must measure the final head at the default and game's distance on affected tier-1 hardware, including frame times and VRAM, before deciding a broader default.

Not done

  • Compute fallback white blades, gpu/vk/vk_shader.cpp:1337: The cause and correction remain unknown. The existing gate keeps enlarged pools disabled; the author still needs to diagnose the fallback and verify the corrected output in game.
  • Restore coordinated grass pool enlargement at gpu/vk/vk_shader.cpp:1336: The enlargement path still needs coordinated producer and reader validation, safe private-buffer allocation and lifetime handling, and a fix for the compute fallback rendering defect. Enabling the existing pass would allow mismatched programs or an undersized fallback buffer to be used.

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

The current code holds grass at the game's reach and disables the unsafe enlargement path. That avoids exposing the known defects, but players do not get the advertised larger-distance fix, and the dormant implementation adds complexity.

Before merging, for the author (4) (a run, a measurement or a decision; it doesn't hold the recommendation)

  • L1 gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. (@fix couldn't: gpu/vk/vk_shader.cpp:1337 still disables the pass globally; the fallback's incorrect data or synchronization has not been diagnosed or corrected, and corrected output has not been verified in game.)
  • L6 (minor) gpu/vk/vk_menu.h: The default now uses the game’s distance. Measure the final head at the default and game’s distance on affected tier-1 hardware, including frame times and VRAM, before settling a broader default.
  • L7: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list; the pull request increases that density. The author must decide whether and how to enable the change despite that risk. Files were left as they were.
  • L8 gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. (more on the line) (@fix couldn't: gpu/vk/vk_shader.cpp:1337 still returns false for every renderer. A coordinated, safe enlargement path has not been restored.)

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

Also noticed (5; not asked for, not blocking)
  • The pull request description still says the lists are enlarged and the flicker is fixed, although the production gate disables that behavior.
  • The retained private-buffer implementation still needs its allocation, lifetime and partial-match hazards addressed before the gate can be reopened.
  • The current head has no reported in-game run or CI results.
  • The pull request description still describes enlarged pools and selectable distances as active, although the current code disables both.
  • The description retains earlier measurements and game runs for an enabled path that the current code disables.
More: does it help, other systems, switches, what was read

Does it help: Unproven for the current head. Earlier Windows RTX 4090 runs showed all requested blades processed with the pass enabled, but also showed white blades on the compute fallback; those runs do not demonstrate the disabled path fixing flicker.

Other systems: The enlargement gate applies to all renderers, including RADV, Steam Deck and Intel. The reported Linux build and Windows game runs were on an earlier head; final-head game and hardware coverage is pending.

Switches: RX_VK_GRASS_DISTANCE is ignored and reach is fixed at the game's distance. RX_VK_GRASS_POOLS is disabled regardless of its value. These defaults avoid the known unsafe path but do not provide the intended feature.

Reviewed: f3196b9963 against 9dd41326e7: Read the repository rules and pull request template, the relevant diff and current grass menu, gate and test code; inspected references to private storage and the recorded runs. The full large renderer and shader pass files, generated files and translations were not read in full.; nothing run (a code review).

Checked and fine:

  • The production shader gate leaves the pool pass disabled regardless of the switch.
  • The menu and reach override hold grass distance at the game's reach.

Testing: No commands from the project or tests were run. CI has not yet run on this head; the supplied game, build and check results are from earlier heads.

Overlaps and merge order: #1382 is a prerequisite; #2093 is described as a dependent follow-up that should drop or rebase its duplicated foundation after this pull request lands.


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

**Recommendation: Request changes.** The enlarged lists remain disabled, so the overflow and flicker fix does not run. The compute fallback defect and the base-branch conflict also remain unresolved. **What `@fix` changed** I changed this pull request: the new head is f3196b9963c3. I couldn't bring it up to date with `main`: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list; the pull request increases that density. The author must decide whether and how to enable the change despite that risk. Files were left as they were. I edited its description and retitled it “WIP: fix(vk): disable larger grass lists and hold grass distance at the game's reach” to match the change. **Changed** - **Allocation failure**: The gate in gpu/vk/vk_shader.cpp:1337 prevents enlarged shaders from executing against the game's smaller buffers. - **Private buffer lifetime**: The gate in gpu/vk/vk_shader.cpp:1337 prevents production shaders from using or reassigning private grass buffers. - **Partial shader matches**: Disabled the pass for the entire pipeline in gpu/vk/vk_shader.cpp:1337. tests/grass_pools_ir.cpp:299 covers a producer that matches while its consumer does not, and checks that production leaves both unchanged. - **Compiler selection**: tests/test_grass_pools.py:96 honors CC when --cxx is absent and links the C++ runtime when using the C compiler driver. Tests were not run. **Changed in part (the rest is for the author)** - **Grass distance default**: Set the default to the game's distance in gpu/vk/vk_menu.h:54 and updated the documentation and check. The author must measure the final head at the default and game's distance on affected tier-1 hardware, including frame times and VRAM, before deciding a broader default. **Not done** - **Compute fallback white blades, gpu/vk/vk_shader.cpp:1337**: The cause and correction remain unknown. The existing gate keeps enlarged pools disabled; the author still needs to diagnose the fallback and verify the corrected output in game. - **Restore coordinated grass pool enlargement at gpu/vk/vk_shader.cpp:1336**: The enlargement path still needs coordinated producer and reader validation, safe private-buffer allocation and lifetime handling, and a fix for the compute fallback rendering defect. Enabling the existing pass would allow mismatched programs or an undersized fallback buffer to be used. Nothing was built or run: the checks run again on the new head. The current code holds grass at the game's reach and disables the unsafe enlargement path. That avoids exposing the known defects, but players do not get the advertised larger-distance fix, and the dormant implementation adds complexity. **Before merging, for the author (4)** (a run, a measurement or a decision; it doesn't hold the recommendation) - **L1** `gpu/vk/vk_shader.cpp:1779`: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. (`@fix` couldn't: gpu/vk/vk_shader.cpp:1337 still disables the pass globally; the fallback's incorrect data or synchronization has not been diagnosed or corrected, and corrected output has not been verified in game.) - **L6** (minor) `gpu/vk/vk_menu.h`: The default now uses the game’s distance. Measure the final head at the default and game’s distance on affected tier-1 hardware, including frame times and VRAM, before settling a broader default. - **L7**: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list; the pull request increases that density. The author must decide whether and how to enable the change despite that risk. Files were left as they were. - **L8** `gpu/vk/vk_shader.cpp:1337`: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. (more on the line) (`@fix` couldn't: gpu/vk/vk_shader.cpp:1337 still returns false for every renderer. A coordinated, safe enlargement path has not been restored.) **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (5; not asked for, not blocking)</summary> - The pull request description still says the lists are enlarged and the flicker is fixed, although the production gate disables that behavior. - The retained private-buffer implementation still needs its allocation, lifetime and partial-match hazards addressed before the gate can be reopened. - The current head has no reported in-game run or CI results. - The pull request description still describes enlarged pools and selectable distances as active, although the current code disables both. - The description retains earlier measurements and game runs for an enabled path that the current code disables. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the current head. Earlier Windows RTX 4090 runs showed all requested blades processed with the pass enabled, but also showed white blades on the compute fallback; those runs do not demonstrate the disabled path fixing flicker. **Other systems:** The enlargement gate applies to all renderers, including RADV, Steam Deck and Intel. The reported Linux build and Windows game runs were on an earlier head; final-head game and hardware coverage is pending. **Switches:** RX_VK_GRASS_DISTANCE is ignored and reach is fixed at the game's distance. RX_VK_GRASS_POOLS is disabled regardless of its value. These defaults avoid the known unsafe path but do not provide the intended feature. **Reviewed:** f3196b9963c3 against 9dd41326e710: Read the repository rules and pull request template, the relevant diff and current grass menu, gate and test code; inspected references to private storage and the recorded runs. The full large renderer and shader pass files, generated files and translations were not read in full.; nothing run (a code review). **Checked and fine:** - The production shader gate leaves the pool pass disabled regardless of the switch. - The menu and reach override hold grass distance at the game's reach. **Testing:** No commands from the project or tests were run. CI has not yet run on this head; the supplied game, build and check results are from earlier heads. **Overlaps and merge order:** #1382 is a prerequisite; #2093 is described as a dependent follow-up that should drop or rebase its duplicated foundation after this pull request lands. </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>
@ -1333,0 +1334,4 @@
// Keep the whole pipeline on the game's lists until producer/reader matching, private buffer lifetime and allocation
// failure can be coordinated, and the compute fallback's rendering is corrected. A partial pass is unsafe.
bool grass_pools_on() {
return false;
Member

L8: Returning false for every renderer disables the entire advertised flicker fix. At 4x in Hyrule Field the game still caps the list at 143,360 blades while requesting roughly 416,000, leaving patches missing and flickering. Restore a coordinated, safe enlargement path that fixes the overflow before offering the affected distances.

**L8**: Returning false for every renderer disables the entire advertised flicker fix. At 4x in Hyrule Field the game still caps the list at 143,360 blades while requesting roughly 416,000, leaving patches missing and flickering. Restore a coordinated, safe enlargement path that fixes the overflow before offering the affected distances.
Owner
@fix
Member

Nothing needed changing: the review's items are already done. I couldn't bring it up to date with main: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list, and its test checks that behavior. The pull request changes that same grass. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were.

Not done

  • Guide screenshot source review: The eight changed inputs need a visual review of the Graphics guide image; the new Grass distance row changes the menu, and the recorded review revision is unavailable in this checkout. A refreshed image may be needed, but binary edits and running the capture are prohibited here. The review hashes were left unchanged.

For the author (no edit does these)

  • L1 gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game.
  • L6 (minor) gpu/vk/vk_menu.h: The default now uses the game’s distance. Measure the final head at the default and game’s distance on affected tier-1 hardware, including frame times and VRAM, before settling a broader default.
  • L7: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list, and its test checks that behavior. The pull request changes that same grass. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were.
  • L8 gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances.

Nothing was pushed.


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

Nothing needed changing: the review's items are already done. I couldn't bring it up to date with `main`: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list, and its test checks that behavior. The pull request changes that same grass. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were. **Not done** - **Guide screenshot source review**: The eight changed inputs need a visual review of the Graphics guide image; the new Grass distance row changes the menu, and the recorded review revision is unavailable in this checkout. A refreshed image may be needed, but binary edits and running the capture are prohibited here. The review hashes were left unchanged. **For the author** (no edit does these) - **L1** `gpu/vk/vk_shader.cpp:1779`: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. - **L6** (minor) `gpu/vk/vk_menu.h`: The default now uses the game’s distance. Measure the final head at the default and game’s distance on affected tier-1 hardware, including frame times and VRAM, before settling a broader default. - **L7**: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass unchanged because increasing its density can overflow the fixed blade list, and its test checks that behavior. The pull request changes that same grass. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were. - **L8** `gpu/vk/vk_shader.cpp:1337`: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances. Nothing was pushed. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
fix(docs): review graphics guide image sources
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 16s
CI / Website build and checks (pull_request) Successful in 2m58s
431b93612f
As the review on #1877 asked.
BeanBot left a comment

Recommendation: Request changes. The enlarged-list pass remains disabled, so the proposed overflow and flicker fix does not run. The compute fallback’s white-blade defect also remains unfixed.

What @fix changed
I changed this pull request: the new head is 431b93612f. I couldn't bring it up to date with main: resolving the conflict in gpu/vk/vk_draw.cpp, tests/test_grass_distance.py needs the author: The base branch deliberately keeps Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; this pull request restores that increase. The author must decide whether to accept that risk or revise the feature. The files were left unchanged. I edited its description to match the change.

Changed

  • Guide screenshot source review: Reviewed the existing image and guide, updated the source fingerprints in docs/user/images/guide/manifest.json:955, and documented the retention decision in docs/user/images/guide/source-review-grass-lists.md:1. No tests were run.

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

The change holds grass at the game’s reach and disables enlarged lists, avoiding the known unsafe path. It adds the groundwork for larger lists but does not yet deliver the advertised flicker fix.

Before merging, for the author (3) (a run, a measurement or a decision; it doesn't hold the recommendation)

  • L1 gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. (@fix couldn't: grass_pools_on() in gpu/vk/vk_shader.cpp still returns false globally; the fallback’s incorrect data or synchronization has not been found or fixed.)
  • L7: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, tests/test_grass_distance.py needs the author: The base branch deliberately keeps Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; this pull request restores that increase. The author must decide whether to accept that risk or revise the feature. The files were left unchanged.
  • L8 gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances. (@fix couldn't: gpu/vk/vk_shader.cpp still disables the pass for every renderer; a coordinated, safe enlargement path has not been restored.)

Checks: they run again on this head (Guide screenshots / Guide images and local UI source review (pull_request) failed on the last one); a failure shows on the pull request.

Also noticed (9; not asked for, not blocking)
  • The pull request description still says the lists are enlarged and the flicker is fixed, although the production gate disables that behavior.
  • The retained private-buffer implementation still needs its allocation, lifetime and partial-match hazards addressed before the gate can be reopened.
  • The current head has no reported in-game run or CI results.
  • The pull request description still describes enlarged pools and selectable distances as active, although the current code disables both.
  • The description retains earlier measurements and game runs for an enabled path that the current code disables.
  • Final-head frame-time and VRAM measurements on affected tier-1 hardware remain useful before choosing a broader grass-distance default.
  • Corrected compute-fallback output still needs an in-game verification after the rendering defect is fixed.
  • The guide review notes that a fresh capture may have different scrollbar proportions.
  • The screenshot source-review note records that the added row may change scrollbar proportions in a fresh capture.
More: does it help, other systems, switches, what was read

Does it help: Unproven for the current code: the recorded game runs exercised an earlier head with enlarged lists enabled. At 4x, those runs showed full grass but also white blades on the compute fallback; the current pass is disabled.

Other systems: The disabled pass applies to all renderers, including RADV, Steam Deck and the compute fallback. Linux, AMD and Intel game runs remain outstanding for an enabled fix.

Switches: RX_VK_GRASS_DISTANCE is ignored and reach is fixed at 1x. RX_VK_GRASS_POOLS cannot enable the pass. These defaults avoid the known unsafe path but do not provide larger distances.

Reviewed: 431b93612f against 9dd41326e7: Read AGENTS.md, CONTRIBUTING.md, grass.cpp, test_grass_distance.py and the new source-review note in full; inspected the relevant shader and draw paths, the fix commit, the manifest changes and the recorded results. The remaining changed code and generated manifest were skimmed, not read in full.; nothing run (a code review).

Checked and fine:

  • The grass-distance environment override no longer changes the game’s reach.
  • The menu exposes only the game’s reach while enlarged lists are disabled.

Testing: No commands from the project or tests were run. The supplied CI status says checks have not yet run on this head; the reported game and build results are from earlier heads.

Overlaps and merge order: #1382 is a prerequisite; merge it first and rebase. #2093 is a dependent follow-up intended to drop duplicate prerequisite work after this PR lands.


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

**Recommendation: Request changes.** The enlarged-list pass remains disabled, so the proposed overflow and flicker fix does not run. The compute fallback’s white-blade defect also remains unfixed. **What `@fix` changed** I changed this pull request: the new head is 431b93612feb. I couldn't bring it up to date with `main`: resolving the conflict in gpu/vk/vk_draw.cpp, tests/test_grass_distance.py needs the author: The base branch deliberately keeps Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; this pull request restores that increase. The author must decide whether to accept that risk or revise the feature. The files were left unchanged. I edited its description to match the change. **Changed** - **Guide screenshot source review**: Reviewed the existing image and guide, updated the source fingerprints in docs/user/images/guide/manifest.json:955, and documented the retention decision in docs/user/images/guide/source-review-grass-lists.md:1. No tests were run. Nothing was built or run: the checks run again on the new head. The change holds grass at the game’s reach and disables enlarged lists, avoiding the known unsafe path. It adds the groundwork for larger lists but does not yet deliver the advertised flicker fix. **Before merging, for the author (3)** (a run, a measurement or a decision; it doesn't hold the recommendation) - **L1** `gpu/vk/vk_shader.cpp:1779`: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. (`@fix` couldn't: grass_pools_on() in gpu/vk/vk_shader.cpp still returns false globally; the fallback’s incorrect data or synchronization has not been found or fixed.) - **L7**: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, tests/test_grass_distance.py needs the author: The base branch deliberately keeps Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; this pull request restores that increase. The author must decide whether to accept that risk or revise the feature. The files were left unchanged. - **L8** `gpu/vk/vk_shader.cpp:1337`: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances. (`@fix` couldn't: gpu/vk/vk_shader.cpp still disables the pass for every renderer; a coordinated, safe enlargement path has not been restored.) **Checks:** they run again on this head (`Guide screenshots / Guide images and local UI source review (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (9; not asked for, not blocking)</summary> - The pull request description still says the lists are enlarged and the flicker is fixed, although the production gate disables that behavior. - The retained private-buffer implementation still needs its allocation, lifetime and partial-match hazards addressed before the gate can be reopened. - The current head has no reported in-game run or CI results. - The pull request description still describes enlarged pools and selectable distances as active, although the current code disables both. - The description retains earlier measurements and game runs for an enabled path that the current code disables. - Final-head frame-time and VRAM measurements on affected tier-1 hardware remain useful before choosing a broader grass-distance default. - Corrected compute-fallback output still needs an in-game verification after the rendering defect is fixed. - The guide review notes that a fresh capture may have different scrollbar proportions. - The screenshot source-review note records that the added row may change scrollbar proportions in a fresh capture. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the current code: the recorded game runs exercised an earlier head with enlarged lists enabled. At 4x, those runs showed full grass but also white blades on the compute fallback; the current pass is disabled. **Other systems:** The disabled pass applies to all renderers, including RADV, Steam Deck and the compute fallback. Linux, AMD and Intel game runs remain outstanding for an enabled fix. **Switches:** RX_VK_GRASS_DISTANCE is ignored and reach is fixed at 1x. RX_VK_GRASS_POOLS cannot enable the pass. These defaults avoid the known unsafe path but do not provide larger distances. **Reviewed:** 431b93612feb against 9dd41326e710: Read AGENTS.md, CONTRIBUTING.md, grass.cpp, test_grass_distance.py and the new source-review note in full; inspected the relevant shader and draw paths, the fix commit, the manifest changes and the recorded results. The remaining changed code and generated manifest were skimmed, not read in full.; nothing run (a code review). **Checked and fine:** - The grass-distance environment override no longer changes the game’s reach. - The menu exposes only the game’s reach while enlarged lists are disabled. **Testing:** No commands from the project or tests were run. The supplied CI status says checks have not yet run on this head; the reported game and build results are from earlier heads. **Overlaps and merge order:** #1382 is a prerequisite; merge it first and rebase. #2093 is a dependent follow-up intended to drop duplicate prerequisite work after this PR lands. </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>
Owner
@fix
Member

There is nothing for an edit to fix on this pull request. I couldn't bring it up to date with main: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; the pull request increases that density. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were.

For the author (no edit does these)

  • L1 gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game.
  • L7: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; the pull request increases that density. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were.
  • L8 gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances.

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

There is nothing for an edit to fix on this pull request. I couldn't bring it up to date with `main`: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; the pull request increases that density. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were. **For the author** (no edit does these) - **L1** `gpu/vk/vk_shader.cpp:1779`: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. - **L7**: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately leaves Hyrule Field grass at the game's density because increasing it can overflow the fixed blade list; the pull request increases that density. The author must decide whether to enable the change despite that risk or retain the base behavior. The files were left as they were. - **L8** `gpu/vk/vk_shader.cpp:1337`: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
Member

There is nothing for an edit to fix on this pull request. I couldn't bring it up to date with main: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The pull request also describes extending Hyrule Field grass, while the base branch retains its density to avoid overflowing its fixed blade list; the author must decide the intended behavior.

For the author (no edit does these)

  • L1 gpu/vk/vk_shader.cpp:1779: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game.
  • L7: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The pull request also describes extending Hyrule Field grass, while the base branch retains its density to avoid overflowing its fixed blade list; the author must decide the intended behavior.
  • L8 gpu/vk/vk_shader.cpp:1337: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances.

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

There is nothing for an edit to fix on this pull request. I couldn't bring it up to date with `main`: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The pull request also describes extending Hyrule Field grass, while the base branch retains its density to avoid overflowing its fixed blade list; the author must decide the intended behavior. **For the author** (no edit does these) - **L1** `gpu/vk/vk_shader.cpp:1779`: The enlarged pool path produces white blades on the compute fallback at 4x: the recorded forced-fallback run reports 4.95–7.88% near-white ground versus at most 0.09% with the pools off. This path is used by Steam Deck and RADV. Find and fix the fallback's incorrect data or synchronization before enabling the pass there, and verify the corrected output in game. - **L7**: It conflicts with its base branch, and I couldn't resolve it: resolving the conflict in docs/user/graphics-and-controls.md, gpu/vk/vk_draw.cpp, gpu/vk/vk_menu.h, tests/test_grass_distance.py needs the author: The base branch deliberately defaults Grass distance to Game's, while the pull request defaults it to 2x. The author must decide which default to use. The pull request also describes extending Hyrule Field grass, while the base branch retains its density to avoid overflowing its fixed blade list; the author must decide the intended behavior. - **L8** `gpu/vk/vk_shader.cpp:1337`: Larger distances are now withheld, but the pass is still disabled for every renderer, so the advertised overflow and flicker fix does not run. Restore a coordinated, safe enlargement path before offering the affected distances. --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
Contributor

Closing: superseded by #2093, merged as 1885234b2. #2093 carried this PR's commit (the grass's lists made larger, 4519904e3 there) and added what the reviews here asked for:

  • every cap in the edited programs comes from the bound buffer's length (StorageBufferLength), so a buffer that could not be made leaves the programs on the game's buffers at the game's caps;
  • a producer's records are copied back into the game's buffer, up to the game's size, for programs the pass does not edit;
  • replaced buffers are destroyed only once the GPU is past them.

The compute fallback's white blades at 4x (L1) came from the fallback's records area and were fixed by #2121 (8fa2313a4).

Hyrule Field's grass reach is now set on the Simulated turf page. On main, gpu/vk/grass_distance.h leaves it to that page on purpose, so bringing it back under Grass distance here would give the same grass two controls.

This branch has nothing that main lacks: BeanBot's gate (f3196b996) and its guide note (431b93612) were for this pass, which is now on main in #2093's form.

Closing: superseded by #2093, merged as 1885234b2. #2093 carried this PR's commit (the grass's lists made larger, 4519904e3 there) and added what the reviews here asked for: - every cap in the edited programs comes from the bound buffer's length (`StorageBufferLength`), so a buffer that could not be made leaves the programs on the game's buffers at the game's caps; - a producer's records are copied back into the game's buffer, up to the game's size, for programs the pass does not edit; - replaced buffers are destroyed only once the GPU is past them. The compute fallback's white blades at 4x (L1) came from the fallback's records area and were fixed by #2121 (8fa2313a4). Hyrule Field's grass reach is now set on the Simulated turf page. On `main`, `gpu/vk/grass_distance.h` leaves it to that page on purpose, so bringing it back under Grass distance here would give the same grass two controls. This branch has nothing that `main` lacks: BeanBot's gate (f3196b996) and its guide note (431b93612) were for this pass, which is now on `main` in #2093's form.
Jiro113 closed this pull request 2026-11-21 22:57:41 +00:00
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 10s
PR description / Description follows the template (pull_request_target) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Successful in 15s
Guide screenshots / Guide images and local UI source review (pull_request) Successful in 16s
Third-party parts / As their notes say (pull_request) Successful in 16s
CI / Website build and checks (pull_request) Successful in 2m58s

Pull request closed

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!1877
No description provided.