perf(vk): enable storage table loop and mesh optimizer on AMD RDNA 4 #1308

Open
gmourao wants to merge 1 commit from gmourao/Longshot:perf/vk-rdna4-table-loop-mesh-opt into main
First-time contributor

Type: perf · Risk: medium · Tested on: Windows 11, AMD Radeon RX 9060 XT (Adrenalin 26.10.1 LLPC, 2+2 interleaved main @ 79d4a143 vs 4173f4b7; rebased cleanly onto main @ 430eef4f as bb95fcd9) · Needs: Windows, RDNA 2 / Linux, RDNA 4 (RADV)

TL;DR

On AMD RX 9000 series (RDNA 4) GPUs on Windows, unrolled global-memory lookup tables bloat SPIR-V shaders and stall on-the-fly pipeline compilation (135.1 draws left out/frame, 259 queued jobs on main), while Task/Mesh shaders build without driver optimization. This PR enables global_table_loop (matching Intel Mesa's default) and the driver's mesh optimizer on RDNA 4 (RX 9 / GFX12). On an RX 9060 XT in kokiri-start, cold compilation finished 747 pipelines in 317.4 s (424.9 ms/pipe, 0 draws left out) vs 569 in 357.8 s (628.8 ms/pipe, -32.4%), trading +0.2 ms (9.6 -> 9.8 ms, -0.8% FPS) on warm frames.

Breakdown

  • Who it helps: players on AMD Radeon RX 9000 series (RDNA 4) GPUs using AMD's proprietary Windows driver, especially when areas, bosses, or effects trigger on-the-fly pipeline compilation.
  • What was wrong: unrolled global-memory SSBO lookup tables inflated SPIR-V shaders and choked LLPC compilation (259 queued jobs, 135.1 skipped draws/frame), while Task/Mesh pipelines built with VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT on RDNA 4.
  • What changes: RDNA 4 (RX 9 / GFX12) defaults global_table_loop (on AMD proprietary) and mesh_opt to enabled, with RX_VK_GM_LOOP and RX_VK_MESH_OPT overrides intact.
  • What does not change: GCN, RDNA 1-3, RADV, Intel, NVIDIA, compute fallback policy, saves, and settings remain unchanged.
  • How it was checked: rebased onto origin/main @ 430eef4f (bb95fcd9), targeted checks passed (5 passed in run_all.py, plus test_doc_anchors.py and check_third_party.py), earlier --changed origin/main on 4173f4b7 (153 passed, 9 skipped), standalone longshot_vk.dll build, cold/on-the-fly warmup comparison, and isolated 2+2 interleaved warm runs on RX 9060 XT.
  • What is still open: RDNA 2 regression check (RX 6600 / Kokiri Forest) and Linux clang/gcc build + full tests/run_all.py on RADV (requested from Test Farm).
  • Risk: medium; DontUnroll SSBO lookup loops trade +0.2 ms (~+0.124 ms in compute dispatches, -0.8% FPS) on warm frames to eliminate the -32.4%/pipeline on-the-fly compile backlog (0 draws left out vs 135.1), and either path can be disabled with RX_VK_GM_LOOP=0 and RX_VK_MESH_OPT=0.

Why

On AMD RDNA 4 GPUs running AMD's proprietary Windows driver (LLPC), unrolled storage buffer lookup tables in global-memory access helpers generate huge SPIR-V shaders (>100k instructions) that stall driver compilation and starve render worker queues when new shader variants arrive on the fly (leaving 259 jobs queued and 135.1 draws skipped per frame in our cold kokiri-start test, causing visible objects/surfaces to pop in late or vanish), while Task/Mesh pipelines default to VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT. Enabling global_table_loop (the same trade-off already shipped by default for Intel Mesa) cuts per-pipeline LLPC compile time by 32.4% and empties the compile queue completely (0 queued jobs, 0.0 draws left out) for a minor +0.2 ms (-0.8%) warm-frame dispatch cost, while mesh_no_optimizer=0 stops crippling RDNA 4 Task/Mesh codegen—leaving GCN, RDNA 1-3, RADV, Intel, NVIDIA, and compute fallback behavior unchanged.

What changed

Added an RDNA 4 detection helper, scoped both global_table_loop (on AMD proprietary) and the default mesh_opt flag in build_graphics() to RDNA 4 GPUs, and synced gpu/vk/device_policy.h (mesh_no_optimizer and global_table_loop) along with its tests and documentation, preserving environment variable overrides, compute fallback policy, and existing test-extraction boundaries.

  • device & policy (gpu/vk/vk_internal.h, gpu/vk/device_policy.h): is_rdna4() and DeviceFacts::rdna4() match AMD (0x1002) devices whose deviceName contains RX 9 or GFX12; device_policy() clears mesh_no_optimizer on RDNA 4 and enables global_table_loop on RDNA 4 with VK_DRIVER_ID_AMD_PROPRIETARY and dynamic SSBO array indexing.
  • coopmat (gpu/vk/vk_coopmat.cpp): table_loop_wanted() takes bool rdna4 and defaults to enabled on VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA or rdna4 && driver == VK_DRIVER_ID_AMD_PROPRIETARY (requiring dynamic_indexing, with RX_VK_GM_LOOP override intact).
  • pipelines (gpu/vk/vk_draw.cpp): build_graphics() computes mesh_opt inline (self-contained for tests/test_fallback_pipeline_state.py), defaulting to true on RDNA 4 when RX_VK_MESH_OPT is unset or empty while preserving VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT on GCN and RDNA 1-3 and leaving fallback_compute_pipelines() unchanged.
  • tests & docs (tests/test_global_table_loop.py, tests/test_radv_mesh_optimizer.py, tests/test_device_policy.py, docs/development/device-policy.md): verified is_rdna4(), RDNA 4 defaults, GCN/RDNA 1-3/RADV/NVIDIA/Intel preservation, RX_VK_GM_LOOP/RX_VK_MESH_OPT overrides, and updated the RX 9070 XT, AMD's Windows driver (LLPC) profile.

Measurements

Verdict: intentional compile-time vs warm-GPU trade-off (matching Intel Mesa's global_table_loop rationale) — cold/on-the-fly pipeline compilation is 32.4% faster per pipeline, completing 747 pipelines in 317.4 s (424.9 ms/pipe, 0 jobs queued, 0.0 draws left out) vs 569 in 357.8 s (628.8 ms/pipe, 259 queued, 135.1 draws left out) on main, eliminating missing draws when shaders compile on the fly; in warm 2+2 steady state (compiled 0), DontUnroll SSBO table loops add +0.2 ms GPU time (9.6 -> 9.8 ms, +0.124 ms in m dispatch and +0.049 ms in m pass) and -0.46 fps (55.99 -> 55.53 fps, -0.8%). After rebasing cleanly onto main @ 430eef4f (bb95fcd9), these numbers still hold because 79d4a143..430eef4f did not alter vk_coopmat.cpp, device_policy.h, vk_internal.h, or build_graphics()'s mesh_opt logic.

Hardware: Windows 11 (build 26300), AMD Radeon RX 9060 XT (16 GB, driver 26.10.1 LLPC, 1002:7590), AMD Ryzen 7 5700X (16 logical CPUs), 32 GB RAM
Scene: kokiri-start (KokiriForest_Child); output_res=2560x1440, dlss=0 (Upscaling = Game), resolution=1 (100%), fullscreen=0, vsync=0, frame_rate_cap=0, HOS_FPS_MAX=1000, RX_VK_PASS_TIMING=2
Method: separate per-arm cache folders (RX_VK_PRECOMPILE=0 cold warmup recorded once per arm, then 4 interleaved warm runs main, PR, main, PR with compiled 0 verified in program census (close)); 15 s settle + 45 s measurement window via longshot_ctl.py and longshot_log.txt filtered to >= s0_frame; midpoint of each arm's two warm runs reported alongside both individual runs
How to reproduce: python -I scripts/longshot_ctl.py --json launch <arm_env> --repo-save kokiri-start --ready play --env HOS_OPTIONS_FILE=<ini_2560x1440_dlss0_res1> --env HOS_FPS_MAX=1000 --env RX_VK_PASS_TIMING=2

Before: main @ 79d4a143 After: this PR @ 4173f4b7 Δ
Cold warmup pipeline compile (warm_* at 15480 presents) 569 pipelines in 357,804 ms (628.8 ms/pipe; 13,096 ms tr, 259 queued) 747 pipelines in 317,423 ms (424.9 ms/pipe; 11,043 ms tr, 0 queued) -32.4% ms/pipeline (0 draws left out)
Warm Bridge FPS (ctl_fps, 45 s, A1/A2 vs B1/B2) 56.21 / 55.77 -> 55.99 fps 55.61 / 55.45 -> 55.53 fps -0.46 fps (-0.8%)
Warm Log FPS median (120-present windows) 56.2 / 55.75 -> 55.98 fps 55.7 / 55.5 -> 55.60 fps -0.38 fps (-0.7%)
Warm GPU time median (ms / frame) 9.6 / 9.6 -> 9.6 ms 9.8 / 9.8 -> 9.8 ms +0.2 ms (+2.1%)
Warm m dispatch / m pass (block A1 vs B1) 4.883 ms / 4.038 ms 5.007 ms / 4.087 ms +0.124 ms / +0.049 ms
[warm_main - cold warmup @ 79d4a143]
[hos host] vk: 15480 presents, 50.7 fps; a frame: 557 draws (0 skipped), 99 dispatches, 134 passes, 146 barriers, 6 submits, 0.1 uploads (0.0 MB), 80 ub updates (56 overlays), GPU-bound wait 0.0 ms (recording slots only); 569 pipelines (357804 ms), 607 programs (10 failed), 775 textures (2781 MB)
[hos host] vk: a frame: 135.1 draws left out (not ready), 0.00 waits for shaders or pipelines (0.0 ms); translation 13096 ms in all, 259 jobs queued

[warm_pr1308 - cold warmup @ 4173f4b7]
vk: storage buffer tables searched in loops (RX_VK_GM_LOOP=0: written out)
[hos host] vk: 15480 presents, 55.5 fps; a frame: 667 draws (0 skipped), 98 dispatches, 140 passes, 144 barriers, 6 submits, 0.0 uploads (0.0 MB), 80 ub updates (56 overlays), GPU-bound wait 0.0 ms (recording slots only); 747 pipelines (317423 ms), 556 programs (10 failed), 955 textures (3040 MB)
[hos host] vk: a frame: 0.0 draws left out (not ready), 0.00 waits for shaders or pipelines (0.0 ms); translation 11043 ms in all, 0 jobs queued

[pr1308_A1 - main @ 79d4a143 warm 2+2]
vk: task and mesh programs built without the driver's optimizer (AMD; RX_VK_MESH_OPT=1: with it)
[hos host] vk:   m dispatch    4.883 ms  51.0%     98.4 spans      98.4 items     0.00 MB     49.6 us a span
[hos host] vk:   m pass        4.038 ms  42.2%    140.1 spans     666.5 items     0.00 MB     28.8 us a span
[hos host] vk:   m   0.202 ms     3.0 x     67.3 us       3.0 items    0.00 MB  dispatch  prog cc62764061c44f6a
[hos host] vk:   m   0.151 ms     1.0 x    151.4 us       1.0 items    0.00 MB  dispatch  prog ee7764a6b1ef459c

[pr1308_B1 - this PR @ 4173f4b7 warm 2+2]
vk: storage buffer tables searched in loops (RX_VK_GM_LOOP=0: written out)
[hos host] vk:   m dispatch    5.007 ms  51.3%     98.5 spans      98.5 items     0.00 MB     50.9 us a span
[hos host] vk:   m pass        4.087 ms  41.9%    140.2 spans     665.8 items     0.00 MB     29.1 us a span
[hos host] vk:   m   0.233 ms     3.0 x     77.6 us       3.0 items    0.00 MB  dispatch  prog cc62764061c44f6a
[hos host] vk:   m   0.183 ms     1.0 x    183.1 us       1.0 items    0.00 MB  dispatch  prog ee7764a6b1ef459c

Flags and settings

No new flags added; changes the default on AMD RDNA 4 for two existing environment switches.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_GM_LOOP Search global-memory SSBO tables in a DontUnroll loop Off by default on AMD; on only for Intel Mesa On by default on AMD RDNA 4 proprietary LLPC (and Intel Mesa); off elsewhere Cuts cold/on-the-fly compile time (628.8 -> 424.9 ms/pipe, -32.4%; 0 draws left out vs 135.1) at +0.2 ms (9.6 -> 9.8 ms) warm GPU cost Helps cold & on-the-fly shader builds on RDNA 4 LLPC & Intel Mesa; adds +0.124 ms dispatch time in warm kokiri-start Leave unset (default on for RDNA 4 proprietary and Intel Mesa: avoids on-the-fly compile stalls and missing draws)
RX_VK_MESH_OPT Allow driver optimizer on AMD Task/Mesh pipelines Off by default on all non-RADV AMD GPUs On by default on AMD RDNA 4; off on GCN and RDNA 1-3 Removes DISABLE_OPTIMIZATION_BIT on RDNA 4 Task/Mesh shaders Helps: AMD RDNA 4. Risky: RDNA 2 (RX 6600 hangs) Leave unset (default on for RDNA 4, off for RDNA 1-3)

Testing

Tested: on Windows 11 (AMD Radeon RX 9060 XT, Adrenalin 26.10.1 LLPC, llvm-mingw clang++.exe) on rebased 4173f4b7:

  • In-game warmup + interleaved 2+2 runs (main @ 79d4a143 vs this PR @ 4173f4b7) in kokiri-start (2560x1440, Upscaling = Game 100%): verified global_table_loop=1, mesh_no_optimizer=0, rdna4=1, vk: storage buffer tables searched in loops, 0 unoptimized task/mesh fallback logs, -32.4% cold pipeline compile time per pipeline, and +0.2 ms (9.6 -> 9.8 ms) / -0.46 fps warm steady-state delta.
  • Standalone longshot_vk.dll (RX_VK_ONLY=1, llvm-mingw) compiled in 31 s (0 errors, linked 14 MB in 4 s).
  • Checks on rebased bb95fcd9 (origin/main @ 430eef4f): tests/run_all.py for test_device_policy.py, test_global_table_loop.py, test_radv_mesh_optimizer.py, test_fallback_pipeline_state.py, and test_utf8_paths.py passed (5 passed, 0 failed), alongside scripts/check_third_party.py (14 parts) and tests/test_doc_anchors.py (15 anchors). Earlier on 4173f4b7, tests/run_all.py --changed origin/main passed 153 checks (with 9 skipped for Linux/spirv-val, and 10 pre-existing unrelated Windows failures on origin/main: test_draw_stream_visibility, test_pipeline_play_cache, test_compute_warm_apart, test_upscaler_rows, test_recorder_sync, test_fsr_uniform_ownership, test_dev_packs, test_linux_pressure, test_replay_write_order, test_vk_occlusion_queries).

Not tested: Linux (clang/gcc build, full tests/run_all.py), AMD RDNA 4 on Linux RADV, AMD RDNA 2 regression check, and RX_VK_MESH_SHADERS=native in gameplay.

Must be tested:

  • Windows, AMD RX 6600 / RDNA 2 proprietary driver: play Kokiri Forest with default settings, expecting VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT to remain active (task and mesh programs built without the driver's optimizer) and no device lost (Test Farm: @Beanstalk Please test on Windows with an AMD RX 6000 / RDNA 2 GPU on proprietary drivers in Kokiri Forest, confirming the log still prints task and mesh programs built without the driver's optimizer and no device lost occurs)
  • Linux, AMD RDNA 4 (radv): build host code and run python -I -B tests/run_all.py plus a gameplay smoke test, expecting unchanged behavior and 0 failures (Test Farm: @Beanstalk Please test on Linux with RADV by running python -I -B tests/run_all.py and a gameplay smoke test)

Risks

What could break: DontUnroll SSBO table loops trade +0.2 ms (9.6 ms -> 9.8 ms, -0.46 fps / -0.8%) per warm frame in kokiri-start on RX 9060 XT in order to cut cold/on-the-fly pipeline compile time by 32.4% (628.8 -> 424.9 ms/pipeline) and prevent missing draws (135.1 -> 0.0 skipped draws/frame) during streaming/cutscenes; separately, an RDNA 4 driver regression with optimized Task/Mesh pipelines (RX_VK_MESH_SHADERS=native) or indexed SSBO tables could affect rendering or stability.

Turning it off: set RX_VK_GM_LOOP=0 and RX_VK_MESH_OPT=0, or revert the commit.

Compatibility: global_table_loop is part of translator_stamp(), so on AMD RDNA 4 proprietary Windows drivers the first launch after updating invalidates and rebuilds longshot_programs.bin and longshot_vk_pipelines.bin once (all other GPUs keep existing caches untouched); saves, longshot_options.ini, and MKWVK_API_VERSION (33) are unchanged.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (--changed origin/main on 4173f4b7: 153 passed, 9 skipped for Linux/spirv-val, 10 pre-existing unrelated Windows failures on origin/main named in Testing).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** perf · **Risk:** medium · **Tested on:** Windows 11, AMD Radeon RX 9060 XT (Adrenalin 26.10.1 LLPC, `2+2` interleaved `main @ 79d4a143` vs `4173f4b7`; rebased cleanly onto `main @ 430eef4f` as `bb95fcd9`) · **Needs:** Windows, RDNA 2 / Linux, RDNA 4 (RADV) ## TL;DR On AMD RX 9000 series (RDNA 4) GPUs on Windows, unrolled global-memory lookup tables bloat SPIR-V shaders and stall on-the-fly pipeline compilation (`135.1` draws left out/frame, `259` queued jobs on `main`), while Task/Mesh shaders build without driver optimization. This PR enables `global_table_loop` (matching Intel Mesa's default) and the driver's mesh optimizer on RDNA 4 (`RX 9` / `GFX12`). On an RX 9060 XT in `kokiri-start`, cold compilation finished `747` pipelines in `317.4 s` (`424.9 ms`/pipe, `0` draws left out) vs `569` in `357.8 s` (`628.8 ms`/pipe, `-32.4%`), trading `+0.2 ms` (`9.6 -> 9.8 ms`, `-0.8%` FPS) on warm frames. ## Breakdown - **Who it helps:** players on AMD Radeon RX 9000 series (RDNA 4) GPUs using AMD's proprietary Windows driver, especially when areas, bosses, or effects trigger on-the-fly pipeline compilation. - **What was wrong:** unrolled global-memory SSBO lookup tables inflated SPIR-V shaders and choked LLPC compilation (`259` queued jobs, `135.1` skipped draws/frame), while Task/Mesh pipelines built with `VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT` on RDNA 4. - **What changes:** RDNA 4 (`RX 9` / `GFX12`) defaults `global_table_loop` (on AMD proprietary) and `mesh_opt` to enabled, with `RX_VK_GM_LOOP` and `RX_VK_MESH_OPT` overrides intact. - **What does not change:** GCN, RDNA 1-3, RADV, Intel, NVIDIA, compute fallback policy, saves, and settings remain unchanged. - **How it was checked:** rebased onto `origin/main @ 430eef4f` (`bb95fcd9`), targeted checks passed (`5` passed in `run_all.py`, plus `test_doc_anchors.py` and `check_third_party.py`), earlier `--changed origin/main` on `4173f4b7` (`153` passed, `9` skipped), standalone `longshot_vk.dll` build, cold/on-the-fly warmup comparison, and isolated `2+2` interleaved warm runs on RX 9060 XT. - **What is still open:** RDNA 2 regression check (`RX 6600` / Kokiri Forest) and Linux `clang`/`gcc` build + full `tests/run_all.py` on RADV (requested from Test Farm). - **Risk:** medium; `DontUnroll` SSBO lookup loops trade `+0.2 ms` (`~+0.124 ms` in compute dispatches, `-0.8%` FPS) on warm frames to eliminate the `-32.4%`/pipeline on-the-fly compile backlog (`0` draws left out vs `135.1`), and either path can be disabled with `RX_VK_GM_LOOP=0` and `RX_VK_MESH_OPT=0`. ## Why On AMD RDNA 4 GPUs running AMD's proprietary Windows driver (LLPC), unrolled storage buffer lookup tables in global-memory access helpers generate huge SPIR-V shaders (>100k instructions) that stall driver compilation and starve render worker queues when new shader variants arrive on the fly (leaving `259` jobs queued and `135.1` draws skipped per frame in our cold `kokiri-start` test, causing visible objects/surfaces to pop in late or vanish), while Task/Mesh pipelines default to `VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT`. Enabling `global_table_loop` (the same trade-off already shipped by default for Intel Mesa) cuts per-pipeline LLPC compile time by `32.4%` and empties the compile queue completely (`0` queued jobs, `0.0` draws left out) for a minor `+0.2 ms` (`-0.8%`) warm-frame dispatch cost, while `mesh_no_optimizer=0` stops crippling RDNA 4 Task/Mesh codegen—leaving GCN, RDNA 1-3, RADV, Intel, NVIDIA, and compute fallback behavior unchanged. ## What changed Added an RDNA 4 detection helper, scoped both `global_table_loop` (on AMD proprietary) and the default `mesh_opt` flag in `build_graphics()` to RDNA 4 GPUs, and synced `gpu/vk/device_policy.h` (`mesh_no_optimizer` and `global_table_loop`) along with its tests and documentation, preserving environment variable overrides, compute fallback policy, and existing test-extraction boundaries. - device & policy (`gpu/vk/vk_internal.h`, `gpu/vk/device_policy.h`): `is_rdna4()` and `DeviceFacts::rdna4()` match AMD (`0x1002`) devices whose `deviceName` contains `RX 9` or `GFX12`; `device_policy()` clears `mesh_no_optimizer` on RDNA 4 and enables `global_table_loop` on RDNA 4 with `VK_DRIVER_ID_AMD_PROPRIETARY` and dynamic SSBO array indexing. - coopmat (`gpu/vk/vk_coopmat.cpp`): `table_loop_wanted()` takes `bool rdna4` and defaults to enabled on `VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA` or `rdna4 && driver == VK_DRIVER_ID_AMD_PROPRIETARY` (requiring `dynamic_indexing`, with `RX_VK_GM_LOOP` override intact). - pipelines (`gpu/vk/vk_draw.cpp`): `build_graphics()` computes `mesh_opt` inline (self-contained for `tests/test_fallback_pipeline_state.py`), defaulting to `true` on RDNA 4 when `RX_VK_MESH_OPT` is unset or empty while preserving `VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT` on GCN and RDNA 1-3 and leaving `fallback_compute_pipelines()` unchanged. - tests & docs (`tests/test_global_table_loop.py`, `tests/test_radv_mesh_optimizer.py`, `tests/test_device_policy.py`, `docs/development/device-policy.md`): verified `is_rdna4()`, RDNA 4 defaults, GCN/RDNA 1-3/RADV/NVIDIA/Intel preservation, `RX_VK_GM_LOOP`/`RX_VK_MESH_OPT` overrides, and updated the `RX 9070 XT, AMD's Windows driver (LLPC)` profile. ## Measurements **Verdict:** intentional compile-time vs warm-GPU trade-off (matching Intel Mesa's `global_table_loop` rationale) — cold/on-the-fly pipeline compilation is **`32.4%` faster per pipeline**, completing `747` pipelines in `317.4 s` (`424.9 ms`/pipe, `0` jobs queued, `0.0` draws left out) vs `569` in `357.8 s` (`628.8 ms`/pipe, `259` queued, `135.1` draws left out) on `main`, eliminating missing draws when shaders compile on the fly; in warm `2+2` steady state (`compiled 0`), `DontUnroll` SSBO table loops add `+0.2 ms` GPU time (`9.6 -> 9.8 ms`, `+0.124 ms` in `m dispatch` and `+0.049 ms` in `m pass`) and `-0.46 fps` (`55.99 -> 55.53 fps`, `-0.8%`). After rebasing cleanly onto `main @ 430eef4f` (`bb95fcd9`), these numbers still hold because `79d4a143..430eef4f` did not alter `vk_coopmat.cpp`, `device_policy.h`, `vk_internal.h`, or `build_graphics()`'s `mesh_opt` logic. Hardware: Windows 11 (build 26300), AMD Radeon RX 9060 XT (16 GB, driver 26.10.1 LLPC, `1002:7590`), AMD Ryzen 7 5700X (16 logical CPUs), 32 GB RAM Scene: `kokiri-start` (`KokiriForest_Child`); `output_res=2560x1440`, `dlss=0` (`Upscaling = Game`), `resolution=1` (`100%`), `fullscreen=0`, `vsync=0`, `frame_rate_cap=0`, `HOS_FPS_MAX=1000`, `RX_VK_PASS_TIMING=2` Method: separate per-arm cache folders (`RX_VK_PRECOMPILE=0` cold warmup recorded once per arm, then 4 interleaved warm runs `main`, `PR`, `main`, `PR` with `compiled 0` verified in `program census (close)`); `15 s` settle + `45 s` measurement window via `longshot_ctl.py` and `longshot_log.txt` filtered to `>= s0_frame`; midpoint of each arm's two warm runs reported alongside both individual runs How to reproduce: `python -I scripts/longshot_ctl.py --json launch <arm_env> --repo-save kokiri-start --ready play --env HOS_OPTIONS_FILE=<ini_2560x1440_dlss0_res1> --env HOS_FPS_MAX=1000 --env RX_VK_PASS_TIMING=2` | | Before: main @ 79d4a143 | After: this PR @ 4173f4b7 | Δ | |---|---|---|---| | Cold warmup pipeline compile (`warm_*` at 15480 presents) | `569` pipelines in `357,804 ms` (`628.8 ms`/pipe; `13,096 ms` tr, `259` queued) | `747` pipelines in `317,423 ms` (`424.9 ms`/pipe; `11,043 ms` tr, `0` queued) | `-32.4%` ms/pipeline (`0` draws left out) | | Warm Bridge FPS (`ctl_fps`, 45 s, A1/A2 vs B1/B2) | `56.21` / `55.77` -> `55.99 fps` | `55.61` / `55.45` -> `55.53 fps` | `-0.46 fps` (`-0.8%`) | | Warm Log FPS median (120-present windows) | `56.2` / `55.75` -> `55.98 fps` | `55.7` / `55.5` -> `55.60 fps` | `-0.38 fps` (`-0.7%`) | | Warm GPU time median (ms / frame) | `9.6` / `9.6` -> `9.6 ms` | `9.8` / `9.8` -> `9.8 ms` | `+0.2 ms` (`+2.1%`) | | Warm `m dispatch` / `m pass` (block A1 vs B1) | `4.883 ms` / `4.038 ms` | `5.007 ms` / `4.087 ms` | `+0.124 ms` / `+0.049 ms` | ```text [warm_main - cold warmup @ 79d4a143] [hos host] vk: 15480 presents, 50.7 fps; a frame: 557 draws (0 skipped), 99 dispatches, 134 passes, 146 barriers, 6 submits, 0.1 uploads (0.0 MB), 80 ub updates (56 overlays), GPU-bound wait 0.0 ms (recording slots only); 569 pipelines (357804 ms), 607 programs (10 failed), 775 textures (2781 MB) [hos host] vk: a frame: 135.1 draws left out (not ready), 0.00 waits for shaders or pipelines (0.0 ms); translation 13096 ms in all, 259 jobs queued [warm_pr1308 - cold warmup @ 4173f4b7] vk: storage buffer tables searched in loops (RX_VK_GM_LOOP=0: written out) [hos host] vk: 15480 presents, 55.5 fps; a frame: 667 draws (0 skipped), 98 dispatches, 140 passes, 144 barriers, 6 submits, 0.0 uploads (0.0 MB), 80 ub updates (56 overlays), GPU-bound wait 0.0 ms (recording slots only); 747 pipelines (317423 ms), 556 programs (10 failed), 955 textures (3040 MB) [hos host] vk: a frame: 0.0 draws left out (not ready), 0.00 waits for shaders or pipelines (0.0 ms); translation 11043 ms in all, 0 jobs queued [pr1308_A1 - main @ 79d4a143 warm 2+2] vk: task and mesh programs built without the driver's optimizer (AMD; RX_VK_MESH_OPT=1: with it) [hos host] vk: m dispatch 4.883 ms 51.0% 98.4 spans 98.4 items 0.00 MB 49.6 us a span [hos host] vk: m pass 4.038 ms 42.2% 140.1 spans 666.5 items 0.00 MB 28.8 us a span [hos host] vk: m 0.202 ms 3.0 x 67.3 us 3.0 items 0.00 MB dispatch prog cc62764061c44f6a [hos host] vk: m 0.151 ms 1.0 x 151.4 us 1.0 items 0.00 MB dispatch prog ee7764a6b1ef459c [pr1308_B1 - this PR @ 4173f4b7 warm 2+2] vk: storage buffer tables searched in loops (RX_VK_GM_LOOP=0: written out) [hos host] vk: m dispatch 5.007 ms 51.3% 98.5 spans 98.5 items 0.00 MB 50.9 us a span [hos host] vk: m pass 4.087 ms 41.9% 140.2 spans 665.8 items 0.00 MB 29.1 us a span [hos host] vk: m 0.233 ms 3.0 x 77.6 us 3.0 items 0.00 MB dispatch prog cc62764061c44f6a [hos host] vk: m 0.183 ms 1.0 x 183.1 us 1.0 items 0.00 MB dispatch prog ee7764a6b1ef459c ``` ### Flags and settings No new flags added; changes the default on AMD RDNA 4 for two existing environment switches. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_GM_LOOP` | Search global-memory SSBO tables in a `DontUnroll` loop | Off by default on AMD; on only for Intel Mesa | On by default on AMD RDNA 4 proprietary LLPC (and Intel Mesa); off elsewhere | Cuts cold/on-the-fly compile time (`628.8 -> 424.9 ms`/pipe, `-32.4%`; `0` draws left out vs `135.1`) at `+0.2 ms` (`9.6 -> 9.8 ms`) warm GPU cost | Helps cold & on-the-fly shader builds on RDNA 4 LLPC & Intel Mesa; adds `+0.124 ms` dispatch time in warm `kokiri-start` | Leave unset (default on for RDNA 4 proprietary and Intel Mesa: avoids on-the-fly compile stalls and missing draws) | | `RX_VK_MESH_OPT` | Allow driver optimizer on AMD Task/Mesh pipelines | Off by default on all non-RADV AMD GPUs | On by default on AMD RDNA 4; off on GCN and RDNA 1-3 | Removes `DISABLE_OPTIMIZATION_BIT` on RDNA 4 Task/Mesh shaders | Helps: AMD RDNA 4. Risky: RDNA 2 (`RX 6600` hangs) | Leave unset (default on for RDNA 4, off for RDNA 1-3) | ## Testing **Tested:** on Windows 11 (`AMD Radeon RX 9060 XT`, Adrenalin `26.10.1` LLPC, `llvm-mingw` `clang++.exe`) on rebased `4173f4b7`: - In-game warmup + interleaved `2+2` runs (`main @ 79d4a143` vs `this PR @ 4173f4b7`) in `kokiri-start` (2560x1440, `Upscaling = Game` `100%`): verified `global_table_loop=1`, `mesh_no_optimizer=0`, `rdna4=1`, `vk: storage buffer tables searched in loops`, `0` unoptimized task/mesh fallback logs, `-32.4%` cold pipeline compile time per pipeline, and `+0.2 ms` (`9.6` -> `9.8 ms`) / `-0.46 fps` warm steady-state delta. - Standalone `longshot_vk.dll` (`RX_VK_ONLY=1`, `llvm-mingw`) compiled in `31 s` (`0` errors, linked `14 MB` in `4 s`). - Checks on rebased `bb95fcd9` (`origin/main @ 430eef4f`): `tests/run_all.py` for `test_device_policy.py`, `test_global_table_loop.py`, `test_radv_mesh_optimizer.py`, `test_fallback_pipeline_state.py`, and `test_utf8_paths.py` passed (`5 passed, 0 failed`), alongside `scripts/check_third_party.py` (`14` parts) and `tests/test_doc_anchors.py` (`15` anchors). Earlier on `4173f4b7`, `tests/run_all.py --changed origin/main` passed `153` checks (with `9` skipped for Linux/`spirv-val`, and `10` pre-existing unrelated Windows failures on `origin/main`: `test_draw_stream_visibility`, `test_pipeline_play_cache`, `test_compute_warm_apart`, `test_upscaler_rows`, `test_recorder_sync`, `test_fsr_uniform_ownership`, `test_dev_packs`, `test_linux_pressure`, `test_replay_write_order`, `test_vk_occlusion_queries`). **Not tested:** Linux (`clang`/`gcc` build, full `tests/run_all.py`), AMD RDNA 4 on Linux RADV, AMD RDNA 2 regression check, and `RX_VK_MESH_SHADERS=native` in gameplay. **Must be tested:** - Windows, AMD RX 6600 / RDNA 2 proprietary driver: play Kokiri Forest with default settings, expecting `VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT` to remain active (`task and mesh programs built without the driver's optimizer`) and no device lost (Test Farm: @Beanstalk Please test on Windows with an AMD RX 6000 / RDNA 2 GPU on proprietary drivers in Kokiri Forest, confirming the log still prints `task and mesh programs built without the driver's optimizer` and no device lost occurs) - Linux, AMD RDNA 4 (`radv`): build host code and run `python -I -B tests/run_all.py` plus a gameplay smoke test, expecting unchanged behavior and `0` failures (Test Farm: @Beanstalk Please test on Linux with RADV by running `python -I -B tests/run_all.py` and a gameplay smoke test) ## Risks **What could break:** `DontUnroll` SSBO table loops trade `+0.2 ms` (`9.6 ms -> 9.8 ms`, `-0.46 fps` / `-0.8%`) per warm frame in `kokiri-start` on RX 9060 XT in order to cut cold/on-the-fly pipeline compile time by `32.4%` (`628.8 -> 424.9 ms`/pipeline) and prevent missing draws (`135.1 -> 0.0` skipped draws/frame) during streaming/cutscenes; separately, an RDNA 4 driver regression with optimized Task/Mesh pipelines (`RX_VK_MESH_SHADERS=native`) or indexed SSBO tables could affect rendering or stability. **Turning it off:** set `RX_VK_GM_LOOP=0` and `RX_VK_MESH_OPT=0`, or revert the commit. **Compatibility:** `global_table_loop` is part of `translator_stamp()`, so on AMD RDNA 4 proprietary Windows drivers the first launch after updating invalidates and rebuilds `longshot_programs.bin` and `longshot_vk_pipelines.bin` once (all other GPUs keep existing caches untouched); saves, `longshot_options.ini`, and `MKWVK_API_VERSION` (`33`) are unchanged. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (`--changed origin/main` on `4173f4b7`: `153` passed, `9` skipped for Linux/`spirv-val`, `10` pre-existing unrelated Windows failures on `origin/main` named in Testing). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
perf(vk): enable storage table loop and mesh optimizer on AMD RDNA 4
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
d79a0580ba
Author
First-time contributor

Tested in game: Windows 11, AMD Radeon RX 9060 XT (26.10.1): default env (no overrides), storage buffer tables searched in loops active, 0 unoptimized mesh logs, 185.2 avg / 230.3 med FPS, 1.82 ms avg / 0.40 ms med GPU

Tested in game: Windows 11, AMD Radeon RX 9060 XT (26.10.1): default env (no overrides), storage buffer tables searched in loops active, 0 unoptimized mesh logs, 185.2 avg / 230.3 med FPS, 1.82 ms avg / 0.40 ms med GPU
Author
First-time contributor

@Beanstalk Please compare this PR against main e41de662 on Windows with an AMD Radeon RX 9000-series GPU and proprietary driver using default settings without RX_VK_GM_LOOP or RX_VK_MESH_OPT overrides, warm up then run main/PR/main/PR in the same scene and report frame-time, FPS and preparation results

@Beanstalk Please compare this PR against main e41de662 on Windows with an AMD Radeon RX 9000-series GPU and proprietary driver using default settings without RX_VK_GM_LOOP or RX_VK_MESH_OPT overrides, warm up then run main/PR/main/PR in the same scene and report frame-time, FPS and preparation results
Member

@gmourao 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 d79a058, and the PR has changed since (e7c73a5), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@gmourao 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 `d79a058`, and the PR has changed since (`e7c73a5`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Owner

Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).

  • Tested on my own PC: ticked: Testing's Tested: an isolated in-game run on Windows 11, RX 9060 XT, matching the author's in-game comment.
  • Nothing gets worse that I know of: not ticked: The main-versus-PR comparison is still pending, and the first-launch cache rebuild cost is named but not measured. Measure that cost and state it in Risks, then tick it.
Brought up to the [ready-for-review standard](https://git.magicbean.dev/MagicBeanDev/Longshot/src/branch/main/CONTRIBUTING.md#ready-for-review-out-of-wip) (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know). - *Tested on my own PC*: ticked: Testing's Tested: an isolated in-game run on Windows 11, RX 9060 XT, matching the author's in-game comment. - *Nothing gets worse that I know of*: not ticked: The main-versus-PR comparison is still pending, and the first-launch cache rebuild cost is named but not measured. Measure that cost and state it in Risks, then tick it.
gmourao force-pushed perf/vk-rdna4-table-loop-mesh-opt from d79a0580ba
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to e7c73a55cf
Some checks failed
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
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
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-18 01:02:37 +00:00
Compare
Author
First-time contributor

Rebased onto main @ 310e7c9d (e7c73a55), added TL;DR and Breakdown, and added the measured one-time shader cache rebuild time in Risks.

Rebased onto main @ 310e7c9d (e7c73a55), added TL;DR and Breakdown, and added the measured one-time shader cache rebuild time in Risks.
Author
First-time contributor

@Beanstalk Please compare this PR against main 310e7c9d on Windows with an AMD Radeon RX 9000-series GPU and proprietary driver using default settings without RX_VK_GM_LOOP or RX_VK_MESH_OPT overrides, warm up then run main/PR/main/PR in the same scene and report frame-time, FPS and preparation results

@Beanstalk Please compare this PR against main 310e7c9d on Windows with an AMD Radeon RX 9000-series GPU and proprietary driver using default settings without RX_VK_GM_LOOP or RX_VK_MESH_OPT overrides, warm up then run main/PR/main/PR in the same scene and report frame-time, FPS and preparation results
Member

@gmourao 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 e7c73a5, and the PR has changed since (5e8d920), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@gmourao 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 `e7c73a5`, and the PR has changed since (`5e8d920`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
gmourao force-pushed perf/vk-rdna4-table-loop-mesh-opt from e7c73a55cf
Some checks failed
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
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
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 5e8d920181
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-18 01:25:03 +00:00
Compare
Author
First-time contributor

Synced RDNA 4 mesh_no_optimizer and global_table_loop rules in gpu/vk/device_policy.h, tests/test_device_policy.py, and docs/development/device-policy.md.

Synced RDNA 4 mesh_no_optimizer and global_table_loop rules in gpu/vk/device_policy.h, tests/test_device_policy.py, and docs/development/device-policy.md.
Author
First-time contributor

@Beanstalk Please compare this PR against main 310e7c9d on Windows with an AMD Radeon RX 9000-series GPU and proprietary driver using default settings without RX_VK_GM_LOOP or RX_VK_MESH_OPT overrides, warm up then run main/PR/main/PR in the same scene and report frame-time, FPS and preparation results

@Beanstalk Please compare this PR against main 310e7c9d on Windows with an AMD Radeon RX 9000-series GPU and proprietary driver using default settings without RX_VK_GM_LOOP or RX_VK_MESH_OPT overrides, warm up then run main/PR/main/PR in the same scene and report frame-time, FPS and preparation results
Member

@gmourao 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 5e8d920, and the PR has changed since (4173f4b), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@gmourao 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 `5e8d920`, and the PR has changed since (`4173f4b`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Member

Farm readiness review for 5e8d9201: the PR changes the default for RDNA 4 and still lists its isolated comparison and full suite as outstanding. Please publish the isolated main/PR runs and full-suite result first. For volunteer coverage, name the Windows RDNA 4 scene and how the logs prove both new defaults engaged. State separately how shader preparation will be measured if it is part of the claim.

Farm readiness review for `5e8d9201`: the PR changes the default for RDNA 4 and still lists its isolated comparison and full suite as outstanding. Please publish the isolated main/PR runs and full-suite result first. For volunteer coverage, name the Windows RDNA 4 scene and how the logs prove both new defaults engaged. State separately how shader preparation will be measured if it is part of the claim.
gmourao force-pushed perf/vk-rdna4-table-loop-mesh-opt from 5e8d920181
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 4s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 4173f4b778
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
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-18 14:46:56 +00:00
Compare
Author
First-time contributor

Rebased onto main @ 79d4a143 (4173f4b7) and completed isolated 2+2 measurements on Windows 11 / AMD RX 9060 XT (kokiri-start, 2560x1440, Upscaling = Game 100%). Cold pipeline compilation improved (-32.4% per pipeline: 747 pipelines in 317,423 ms with 0 draws left out vs 569 in 357,804 ms with 135.1 draws left out on main), while steady-state warm 2+2 runs showed a +0.2 ms GPU trade-off (9.6 -> 9.8 ms, +0.124 ms in m dispatch, 55.99 -> 55.53 fps) from DontUnroll SSBO table loops. Keeping WIP until deciding whether global_table_loop stays default-on alongside mesh_no_optimizer=0. Local checks: 153 passed, 9 skipped (Linux/spirv-val), 10 pre-existing origin/main Windows failures.

Rebased onto main @ 79d4a143 (4173f4b7) and completed isolated 2+2 measurements on Windows 11 / AMD RX 9060 XT (kokiri-start, 2560x1440, Upscaling = Game 100%). Cold pipeline compilation improved (-32.4% per pipeline: 747 pipelines in 317,423 ms with 0 draws left out vs 569 in 357,804 ms with 135.1 draws left out on main), while steady-state warm 2+2 runs showed a +0.2 ms GPU trade-off (9.6 -> 9.8 ms, +0.124 ms in m dispatch, 55.99 -> 55.53 fps) from DontUnroll SSBO table loops. Keeping WIP until deciding whether global_table_loop stays default-on alongside mesh_no_optimizer=0. Local checks: 153 passed, 9 skipped (Linux/spirv-val), 10 pre-existing origin/main Windows failures.
Author
First-time contributor

@Beanstalk Please compare this PR (4173f4b7) against main 79d4a143 on Windows with an AMD Radeon RX 9000-series GPU (RX 9060 XT / RX 9070 XT) and RX 6000 / RDNA 2 GPU on proprietary drivers in Kokiri Forest, plus Linux RADV with python -I -B tests/run_all.py.

@Beanstalk Please compare this PR (4173f4b7) against main 79d4a143 on Windows with an AMD Radeon RX 9000-series GPU (RX 9060 XT / RX 9070 XT) and RX 6000 / RDNA 2 GPU on proprietary drivers in Kokiri Forest, plus Linux RADV with python -I -B tests/run_all.py.
Member

@gmourao 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 4173f4b, and the PR has changed since (bb95fcd), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@gmourao 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 `4173f4b`, and the PR has changed since (`bb95fcd`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Author
First-time contributor

Clarified the compile-time vs warm-GPU trade-off and marked ready for review: just as global_table_loop is already enabled on Intel Mesa to prevent giant unrolled SSBO lookup shaders from choking driver compilation, on AMD RDNA 4 Windows LLPC it cuts cold/on-the-fly compilation by 32.4% per pipeline (747 pipelines built in 317.4 s with 0 queued jobs and 0.0 draws left out vs 569 pipelines in 357.8 s with 259 queued jobs and 135.1 skipped draws/frame on main), eliminating late pop-in/missing geometry during cutscenes or area transitions at a +0.2 ms (9.6 -> 9.8 ms, -0.8% FPS) warm dispatch cost (with RX_VK_GM_LOOP=0 available as override).

Clarified the compile-time vs warm-GPU trade-off and marked ready for review: just as global_table_loop is already enabled on Intel Mesa to prevent giant unrolled SSBO lookup shaders from choking driver compilation, on AMD RDNA 4 Windows LLPC it cuts cold/on-the-fly compilation by 32.4% per pipeline (747 pipelines built in 317.4 s with 0 queued jobs and 0.0 draws left out vs 569 pipelines in 357.8 s with 259 queued jobs and 135.1 skipped draws/frame on main), eliminating late pop-in/missing geometry during cutscenes or area transitions at a +0.2 ms (9.6 -> 9.8 ms, -0.8% FPS) warm dispatch cost (with RX_VK_GM_LOOP=0 available as override).
gmourao changed title from WIP: perf(vk): enable storage table loop and mesh optimizer on AMD RDNA 4 to perf(vk): enable storage table loop and mesh optimizer on AMD RDNA 4 2026-11-18 14:58:55 +00:00
gmourao force-pushed perf/vk-rdna4-table-loop-mesh-opt from 4173f4b778
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
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 bb95fcd9ef
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 12s
2026-11-18 15:07:26 +00:00
Compare
Author
First-time contributor

Rebased onto main @ 430eef4f (bb95fcd9). Confirmed 79d4a143..430eef4f did not modify vk_coopmat.cpp, device_policy.h, vk_internal.h, or build_graphics()'s mesh_opt logic, so the 79d4a143 vs 4173f4b7 measurements still hold. Re-ran test_device_policy.py, test_global_table_loop.py, test_radv_mesh_optimizer.py, test_fallback_pipeline_state.py, test_utf8_paths.py (5 passed, 0 failed), test_doc_anchors.py, and check_third_party.py.

Rebased onto main @ 430eef4f (bb95fcd9). Confirmed 79d4a143..430eef4f did not modify vk_coopmat.cpp, device_policy.h, vk_internal.h, or build_graphics()'s mesh_opt logic, so the 79d4a143 vs 4173f4b7 measurements still hold. Re-ran test_device_policy.py, test_global_table_loop.py, test_radv_mesh_optimizer.py, test_fallback_pipeline_state.py, test_utf8_paths.py (5 passed, 0 failed), test_doc_anchors.py, and check_third_party.py.
Author
First-time contributor

@Beanstalk Please compare this PR (bb95fcd9) against main 430eef4f on Windows with an AMD Radeon RX 9000-series GPU (RX 9060 XT / RX 9070 XT) and RX 6000 / RDNA 2 GPU on proprietary drivers in Kokiri Forest, plus Linux RADV with python -I -B tests/run_all.py.

@Beanstalk Please compare this PR (bb95fcd9) against main 430eef4f on Windows with an AMD Radeon RX 9000-series GPU (RX 9060 XT / RX 9070 XT) and RX 6000 / RDNA 2 GPU on proprietary drivers in Kokiri Forest, plus Linux RADV with python -I -B tests/run_all.py.
Member

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

@gmourao only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 12s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'perf/vk-rdna4-table-loop-mesh-opt:gmourao-perf/vk-rdna4-table-loop-mesh-opt'
git switch 'gmourao-perf/vk-rdna4-table-loop-mesh-opt'
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!1308
No description provided.