fix(vk): AMD's Windows driver on GCN keeps the mesh fallback's warp in workgroup memory, off the 64-lane subgroup emulation #2158

Merged
HumanBean merged 3 commits from HumanBean/Longshot:fix/gcn-mesh-shared-warp into main 2026-11-27 01:25:00 +00:00
Owner

Summary

GCN cards (RX 400/500, Vega) have no mesh shaders, so the game's task and mesh programs run as compute shaders: the mesh
fallback. NVN wrote those programs for 32-lane warps. RDNA, NVIDIA and Intel hold a compute stage to 32 lanes, so the
fallback's warp is the hardware's. GCN can't: its subgroups are 64 lanes and nothing else. The reporters' logs show lanes 64 to 64 (32 on stages 0) and warp64=1. So on GCN every fallback stage with a ballot, vote or shuffle takes the translator's
64-lane emulation of the 32-lane warp.

On AMD's Windows driver that is slow to compile. An RX 580 2048SP (#1204) and a Radeon Pro 580 (#1836), both on driver
24.9.1, compiled each fallback stage in 53 to 310 s: 24 such lines in #1204's v3.0.0 log, and two stages the driver
faulted on. The draws of a stage still compiling are left out (fallback draw of ... left out: its compute pipelines are still compiling). Players see geometry loading slowly, grass vanishing for a moment, and freezes in Kokiri Forest. They also
report foliage, hair, Link and text drawn as specks (#1204, #717 on 26.1.1, #1836).

This PR gives AMD's Windows driver on those GPUs the shared warp Mesa's Intel driver already uses (mma_layout.h
mesh_fallback_shared_warp). A fallback stage the planner takes (32 invocations, no warp operation in a loop or after an
early return) runs its ballots, votes and shuffles through workgroup memory. Its SPIR-V then has no subgroup instruction, and
it gives the same answers at any lane count.

RADV is left as it is. On the lab's RX 580 (Mesa 26.2.6) main compiles the fallback in seconds and draws it right. The
shared warp gave the same answers and fps there, so it would only cost a GCN RADV player one retranslation of the fallback.

  • gpu/vk/device_policy.h: a new field, mesh_shared_warp. It is on for Mesa's Intel driver, as before. It is also on for
    AMD's proprietary driver on Windows on a GPU whose subgroup_max > 32 and whose sg32_stages lacks compute: GCN,
    Polaris and Vega. The policy block logs mesh_shared_warp_default; coopmat_init also logs the effective mesh_shared_warp after the switch is applied.
  • gpu/vk/vk_coopmat.cpp: coopmat_init takes the shared warp from the policy through shared_warp_wanted.
    RX_VK_MESH_SHARED_WARP still forces it on (1) or off (0) on any GPU; unset or empty means the default. The pages
    and global-attributes switches keep mesh_pages_wanted, Intel's Mesa driver only.
  • The translator's stamp already folds the shared warp (bit 8192). Only a GCN PC on AMD's Windows driver translates its
    fallback programs once after updating. Every other PC keeps its program cache.
  • Docs: the switch's default in switches.def; a paragraph in docs/dev/reference/architecture.md on the fallback's warp.

Since this branch began, main gained mesh_fallback_strict_fmul (RX_VK_MESH_STRICT_FMUL). It is on wherever nan_bits
is, so the reporters' Polaris cards on 24.9.1 get it too. It targets white flashes on grass in the fallback on AMD's older
Windows compiler. The specks may be that bug rather than this one. The Beanstalk run compares this PR against a main that
already has it.

Read first: device_policy.h (mesh_shared_warp, its rule beside warp64), vk_coopmat.cpp (shared_warp_wanted,
coopmat_init).

See #1204
See #1836
See #717

Testing

Tested: Linux, RTX 3090, NVIDIA 620.70.06, this PR @ d02b0fc7 as a pack, through the job queue: a memory tour from kokiri-start through Kokiri Forest, Hyrule Field and the Market, in play, no crash, mesh_shared_warp=0 in the policy block (no change on NVIDIA); and the same with RX_VK_FORCE_MESH_FALLBACK=1 RX_VK_MESH_SHARED_WARP=1 RX_VK_MESH_SHARED_WARP_CHECK=1: the shared warp's check: 1935858527 answers compared with the subgroup's so far, 0 different; 0 waits gave up.

Also Linux, RX 580 8 GB (Polaris10, RADV, Mesa 26.2.6), the AMD lab PC. Kokiri Forest, Hyrule Field and the Castle
Town Market each time, with screenshots.

  • main: no specks, no freezes, no slow fallback compiles. The reports don't reproduce on RADV.
  • main with RX_VK_MESH_SHARED_WARP=1 RX_VK_MESH_SHARED_WARP_CHECK=1: the shared warp's answers matched the 64-lane
    subgroup's every time (0 different over billions compared), and no wait for other lanes gave up. On RADV the 64-lane
    emulation gives right answers, and the forced shared-warp path is correct.
  • This PR before narrowing (shared warp on for GCN RADV too): it drew right, fps within noise of main. It also
    retranslated the fallback once, about 200 compiles of 1.1-2.7 s landing in play, for no gain shown. So the default now
    leaves RADV alone. On this head, RADV GCN gets main's path by default (mesh_shared_warp=0).

Checks: the new and changed checks were written but not run on this PC; CI runs them. device_policy.h passes g++ -std=c++20 -fsyntax-only -Wall -Wextra in a small translation unit.

  • tests/test_gcn_mesh_shared_warp.py (new, its own commit before the fix) cuts what coopmat_init sets
    mesh_fallback_shared_warp to, with the functions it calls, and runs it against the real device_policy() on 17 PCs and
    switch settings.
    • On: the two Polaris cards on AMD's Windows driver (facts from the #1204 and #1836 logs), a Vega 64 on AMD's Windows
      driver, and Iris Xe on Mesa.
    • Off: an RX 580 and a Vega 64 on RADV, an RX 580 on AMD's Linux driver, an RX 5700 and an RX 6700 XT on AMD's Windows
      driver, an RX 6800 XT on RADV, an RTX 3090 and llvmpipe.
    • Switch settings: RX_VK_MESH_SHARED_WARP=1 on RADV GCN, plus =0, =off and empty, all over the default.
    • It also checks that the policy block names mesh_shared_warp_default=.
    • On main it should fail on the Windows GCN cases: mesh_pages_wanted gives AMD the subgroup's warp, and the block has
      no such default field.
  • tests/test_device_policy.py: mesh_shared_warp in BOOLS, on only for the Iris Xe row. No row in its table is GCN on
    AMD's Windows driver.
  • tests/test_mesh_fallback_shared_warp.py: the switch check now cuts shared_warp_wanted, the policy's default with the
    switch over it.

Still to test:

  • This NVIDIA PC (Linux, RTX 3090): this PR's runtime through Kokiri Forest, Hyrule Field and the Market. Expect
    mesh_shared_warp=0 in the policy block, no warps in workgroup memory line, no retranslation at start, and fps within
    noise of main (by hand).
  • Windows, Polaris and Vega, AMD's driver: main against this PR. Look at the fallback compile times, the specks and the
    freezes (@Beanstalk, request below).

Measurements

Verdict: no change on RADV GCN by default; the PC it targets (Windows GCN) is not measured yet.

Setup: Linux, RX 580 8 GB (RADV, Mesa 26.2.6), Kokiri Forest, Hyrule Field and the Market. Screenshots in the lab's run
folders (not attached: game frames). Windows Polaris and Vega to come from Beanstalk.

Before: main After: this PR
RX 580 RADV: specks, freezes, slow compiles none none (the same path by default)
RX 580 RADV, shared warp forced, check 0 different, 0 waits gave up same
RX 580 RADV, shared warp forced: fps within noise of default n/a
RX 580 Windows 24.9.1: slowest fallback stage compile 53-310 s (#1204's log, v3.0.0) to come (Beanstalk)

Risks

What could break: GCN on AMD's Windows driver only (RX 400/500 and Vega). The shared warp's waits spin on workgroup
memory. They have run on Mesa's Intel compiler and on RADV (the lab, forced), not yet on AMD's Windows compiler. A wait that
gives up is counted and logged (the mesh fallback's shared warp: N waits for other lanes gave up), and the answer after it
may be wrong. The workgroup-memory form could also compile or run slower there. Beanstalk measures both.

Turning it off: RX_VK_MESH_SHARED_WARP=0 gives the subgroup's warp, as on main. Reverting the commit is enough.

After updating: on a GCN PC with AMD's Windows driver the fallback's programs are translated and compiled again once,
because the translator's stamp changes there. Every other PC keeps its caches. Nothing changes in saves or
longshot_options.ini.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (not run on this PC; CI runs it)
  • Measured against main, or Measurements says why there is nothing to measure. (RADV measured; Windows GCN waits
    on Beanstalk)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. (two commits, test first; not run either way here,
    CI runs it)
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
    (RADV was measured and left off; the Windows GCN default waits on Beanstalk)
  • A check under tests/ that reads changed source is updated, not weakened.
  • Screenshots of the same spot on main and here, for a change that shows on screen. (RADV taken, the same by
    default; Windows from Beanstalk)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • 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.

Beanstalk request (post as a comment on the PR once it is open):

@Beanstalk On Windows with AMD's own driver, on an AMD Polaris card (RX 470/480/570/580/590 or Radeon Pro 580) and, if the
farm has one, a Vega card (RX Vega 56/64 or a Ryzen APU with Vega graphics): compare main with this PR, with
RX_VK_COMPUTE_LOG_MS=1000 set in both. Clear the game's shader caches first, or start both from the same cold state.
Load a save in Kokiri Forest, then go to Hyrule Field and the Market. Spend 60 s or more in each, moving the camera through
grass and trees.

For each run, send:

  • the log, including every vk: compute pipeline of ... (mesh fallback): the driver compiled it in N s line and any waits for other lanes gave up line;
  • the policy block and the effective mesh_shared_warp log line, which should show mesh_shared_warp=1 on this PR;
  • screenshots of the same spot in each area showing grass, trees, Link's hair and on-screen text;
  • the fps;
  • whether grass, hair or text show coloured specks or flashing, and whether the game freezes or geometry pops in late.

🤖 Generated with Claude Code

## Summary GCN cards (RX 400/500, Vega) have no mesh shaders, so the game's task and mesh programs run as compute shaders: the mesh fallback. NVN wrote those programs for 32-lane warps. RDNA, NVIDIA and Intel hold a compute stage to 32 lanes, so the fallback's warp is the hardware's. GCN can't: its subgroups are 64 lanes and nothing else. The reporters' logs show `lanes 64 to 64 (32 on stages 0)` and `warp64=1`. So on GCN every fallback stage with a ballot, vote or shuffle takes the translator's 64-lane emulation of the 32-lane warp. On AMD's Windows driver that is slow to compile. An RX 580 2048SP (#1204) and a Radeon Pro 580 (#1836), both on driver 24.9.1, compiled each fallback stage in **53 to 310 s**: 24 such lines in #1204's v3.0.0 log, and two stages the driver faulted on. The draws of a stage still compiling are left out (`fallback draw of ... left out: its compute pipelines are still compiling`). Players see geometry loading slowly, grass vanishing for a moment, and freezes in Kokiri Forest. They also report foliage, hair, Link and text drawn as specks (#1204, #717 on 26.1.1, #1836). This PR gives AMD's Windows driver on those GPUs the shared warp Mesa's Intel driver already uses (`mma_layout.h` `mesh_fallback_shared_warp`). A fallback stage the planner takes (32 invocations, no warp operation in a loop or after an early return) runs its ballots, votes and shuffles through workgroup memory. Its SPIR-V then has no subgroup instruction, and it gives the same answers at any lane count. RADV is left as it is. On the lab's RX 580 (Mesa 26.2.6) `main` compiles the fallback in seconds and draws it right. The shared warp gave the same answers and fps there, so it would only cost a GCN RADV player one retranslation of the fallback. - `gpu/vk/device_policy.h`: a new field, `mesh_shared_warp`. It is on for Mesa's Intel driver, as before. It is also on for AMD's proprietary driver on Windows on a GPU whose `subgroup_max > 32` and whose `sg32_stages` lacks compute: GCN, Polaris and Vega. The policy block logs `mesh_shared_warp_default`; `coopmat_init` also logs the effective `mesh_shared_warp` after the switch is applied. - `gpu/vk/vk_coopmat.cpp`: `coopmat_init` takes the shared warp from the policy through `shared_warp_wanted`. `RX_VK_MESH_SHARED_WARP` still forces it on (`1`) or off (`0`) on any GPU; unset or empty means the default. The pages and global-attributes switches keep `mesh_pages_wanted`, Intel's Mesa driver only. - The translator's stamp already folds the shared warp (bit 8192). Only a GCN PC on AMD's Windows driver translates its fallback programs once after updating. Every other PC keeps its program cache. - Docs: the switch's default in `switches.def`; a paragraph in `docs/dev/reference/architecture.md` on the fallback's warp. Since this branch began, `main` gained `mesh_fallback_strict_fmul` (RX_VK_MESH_STRICT_FMUL). It is on wherever `nan_bits` is, so the reporters' Polaris cards on 24.9.1 get it too. It targets white flashes on grass in the fallback on AMD's older Windows compiler. The specks may be that bug rather than this one. The Beanstalk run compares this PR against a `main` that already has it. Read first: `device_policy.h` (`mesh_shared_warp`, its rule beside `warp64`), `vk_coopmat.cpp` (`shared_warp_wanted`, `coopmat_init`). See #1204 See #1836 See #717 ## Testing **Tested:** Linux, RTX 3090, NVIDIA 620.70.06, this PR @ d02b0fc7 as a pack, through the job queue: a memory tour from `kokiri-start` through Kokiri Forest, Hyrule Field and the Market, in play, no crash, `mesh_shared_warp=0` in the policy block (no change on NVIDIA); and the same with `RX_VK_FORCE_MESH_FALLBACK=1 RX_VK_MESH_SHARED_WARP=1 RX_VK_MESH_SHARED_WARP_CHECK=1`: `the shared warp's check: 1935858527 answers compared with the subgroup's so far, 0 different; 0 waits gave up`. Also Linux, RX 580 8 GB (Polaris10, RADV, Mesa 26.2.6), the AMD lab PC. Kokiri Forest, Hyrule Field and the Castle Town Market each time, with screenshots. - `main`: no specks, no freezes, no slow fallback compiles. The reports don't reproduce on RADV. - `main` with `RX_VK_MESH_SHARED_WARP=1 RX_VK_MESH_SHARED_WARP_CHECK=1`: the shared warp's answers matched the 64-lane subgroup's every time (0 different over billions compared), and no wait for other lanes gave up. On RADV the 64-lane emulation gives right answers, and the forced shared-warp path is correct. - This PR before narrowing (shared warp on for GCN RADV too): it drew right, fps within noise of `main`. It also retranslated the fallback once, about 200 compiles of 1.1-2.7 s landing in play, for no gain shown. So the default now leaves RADV alone. On this head, RADV GCN gets `main`'s path by default (`mesh_shared_warp=0`). Checks: the new and changed checks were written but not run on this PC; CI runs them. `device_policy.h` passes `g++ -std=c++20 -fsyntax-only -Wall -Wextra` in a small translation unit. - `tests/test_gcn_mesh_shared_warp.py` (new, its own commit before the fix) cuts what `coopmat_init` sets `mesh_fallback_shared_warp` to, with the functions it calls, and runs it against the real `device_policy()` on 17 PCs and switch settings. - On: the two Polaris cards on AMD's Windows driver (facts from the #1204 and #1836 logs), a Vega 64 on AMD's Windows driver, and Iris Xe on Mesa. - Off: an RX 580 and a Vega 64 on RADV, an RX 580 on AMD's Linux driver, an RX 5700 and an RX 6700 XT on AMD's Windows driver, an RX 6800 XT on RADV, an RTX 3090 and llvmpipe. - Switch settings: `RX_VK_MESH_SHARED_WARP=1` on RADV GCN, plus `=0`, `=off` and empty, all over the default. - It also checks that the policy block names `mesh_shared_warp_default=`. - On `main` it should fail on the Windows GCN cases: `mesh_pages_wanted` gives AMD the subgroup's warp, and the block has no such default field. - `tests/test_device_policy.py`: `mesh_shared_warp` in `BOOLS`, on only for the Iris Xe row. No row in its table is GCN on AMD's Windows driver. - `tests/test_mesh_fallback_shared_warp.py`: the switch check now cuts `shared_warp_wanted`, the policy's default with the switch over it. **Still to test:** - This NVIDIA PC (Linux, RTX 3090): this PR's runtime through Kokiri Forest, Hyrule Field and the Market. Expect `mesh_shared_warp=0` in the policy block, no `warps in workgroup memory` line, no retranslation at start, and fps within noise of `main` (by hand). - Windows, Polaris and Vega, AMD's driver: `main` against this PR. Look at the fallback compile times, the specks and the freezes (@Beanstalk, request below). ## Measurements **Verdict:** no change on RADV GCN by default; the PC it targets (Windows GCN) is not measured yet. Setup: Linux, RX 580 8 GB (RADV, Mesa 26.2.6), Kokiri Forest, Hyrule Field and the Market. Screenshots in the lab's run folders (not attached: game frames). Windows Polaris and Vega to come from Beanstalk. | | Before: main | After: this PR | |---|---|---| | RX 580 RADV: specks, freezes, slow compiles | none | none (the same path by default) | | RX 580 RADV, shared warp forced, check | 0 different, 0 waits gave up | same | | RX 580 RADV, shared warp forced: fps | within noise of default | n/a | | RX 580 Windows 24.9.1: slowest fallback stage compile | 53-310 s (#1204's log, v3.0.0) | to come (Beanstalk) | ## Risks **What could break:** GCN on AMD's Windows driver only (RX 400/500 and Vega). The shared warp's waits spin on workgroup memory. They have run on Mesa's Intel compiler and on RADV (the lab, forced), not yet on AMD's Windows compiler. A wait that gives up is counted and logged (`the mesh fallback's shared warp: N waits for other lanes gave up`), and the answer after it may be wrong. The workgroup-memory form could also compile or run slower there. Beanstalk measures both. **Turning it off:** `RX_VK_MESH_SHARED_WARP=0` gives the subgroup's warp, as on `main`. Reverting the commit is enough. **After updating:** on a GCN PC with AMD's Windows driver the fallback's programs are translated and compiled again once, because the translator's stamp changes there. Every other PC keeps its caches. Nothing changes in saves or `longshot_options.ini`. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). *(not run on this PC; CI runs it)* - [ ] Measured against `main`, or Measurements says why there is nothing to measure. *(RADV measured; Windows GCN waits on Beanstalk)* - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] A fix: a game-free test that fails on `main` and passes here. *(two commits, test first; not run either way here, CI runs it)* - [ ] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. *(RADV was measured and left off; the Windows GCN default waits on Beanstalk)* - [x] A check under `tests/` that reads changed source is updated, not weakened. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. *(RADV taken, the same by default; Windows from Beanstalk)* - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] 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. --- Beanstalk request (post as a comment on the PR once it is open): @Beanstalk On Windows with AMD's own driver, on an AMD Polaris card (RX 470/480/570/580/590 or Radeon Pro 580) and, if the farm has one, a Vega card (RX Vega 56/64 or a Ryzen APU with Vega graphics): compare `main` with this PR, with `RX_VK_COMPUTE_LOG_MS=1000` set in both. Clear the game's shader caches first, or start both from the same cold state. Load a save in Kokiri Forest, then go to Hyrule Field and the Market. Spend 60 s or more in each, moving the camera through grass and trees. For each run, send: - the log, including every `vk: compute pipeline of ... (mesh fallback): the driver compiled it in N s` line and any `waits for other lanes gave up` line; - the policy block and the effective `mesh_shared_warp` log line, which should show `mesh_shared_warp=1` on this PR; - screenshots of the same spot in each area showing grass, trees, Link's hair and on-screen text; - the fps; - whether grass, hair or text show coloured specks or flashing, and whether the game freezes or geometry pops in late. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fails on main: AMD's Windows driver on an RX 580 2048SP, a Radeon Pro 580 or a
Vega 64 keeps the fallback's warp on the 64-lane subgroup emulation, and the
policy block does not name the rule (#1204, #1836, #717). RADV on the same
cards keeps the subgroup's warp.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): AMD's Windows driver on GCN keeps the mesh fallback's warp in workgroup memory, off the 64-lane subgroup emulation
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 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 21s
CI / Website build and checks (pull_request) Failing after 22s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 29s
beanstalk/approval can't be tested as asked: see the farm's comment
d02b0fc772
GCN (RX 400/500, Vega) cannot hold a compute stage to 32 lanes: every mesh
fallback stage with a warp operation takes the 64-lane emulation of NVN's
32-lane warp. On AMD's Windows driver an RX 580 compiled each such stage in
53 to 310 s, its draws left out meanwhile (#1204, #1836, #717). The device
policy's new mesh_shared_warp gives AMD's Windows driver on those GPUs the
shared warp Mesa's Intel driver already has: the stages the planner takes
have no subgroup instruction. RADV is unchanged: on an RX 580 it compiles and
draws the fallback right on the subgroup, and the shared warp there gave the
same answers and fps. RX_VK_MESH_SHARED_WARP=0 or 1 chooses on any GPU.

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

Tested in game: Linux, RTX 3090, NVIDIA 620.70.06, through the job queue: memory tour Kokiri/Hyrule Field/Market, in play, no crash, mesh_shared_warp=0 (unchanged on NVIDIA); forced shared warp with its check: 1.9 billion answers compared, 0 different, 0 waits gave up. Lab RX 580 (RADV): default unchanged, forced path correct, fps within noise. AMD Windows GCN needs the Test Farm.

Tested in game: Linux, RTX 3090, NVIDIA 620.70.06, through the job queue: memory tour Kokiri/Hyrule Field/Market, in play, no crash, mesh_shared_warp=0 (unchanged on NVIDIA); forced shared warp with its check: 1.9 billion answers compared, 0 different, 0 waits gave up. Lab RX 580 (RADV): default unchanged, forced path correct, fps within noise. AMD Windows GCN needs the Test Farm.
Author
Owner

@Beanstalk On Windows with AMD's own driver, on an AMD Polaris card (RX 470/480/570/580/590 or Radeon Pro 580) and, if the
farm has one, a Vega card (RX Vega 56/64 or a Ryzen APU with Vega graphics): compare main with this PR, with
RX_VK_COMPUTE_LOG_MS=1000 set in both. Clear the game's shader caches first, or start both from the same cold state.
Load a save in Kokiri Forest, then go to Hyrule Field and the Market. Spend 60 s or more in each, moving the camera through
grass and trees.

@Beanstalk On Windows with AMD's own driver, on an AMD Polaris card (RX 470/480/570/580/590 or Radeon Pro 580) and, if the farm has one, a Vega card (RX Vega 56/64 or a Ryzen APU with Vega graphics): compare `main` with this PR, with `RX_VK_COMPUTE_LOG_MS=1000` set in both. Clear the game's shader caches first, or start both from the same cold state. Load a save in Kokiri Forest, then go to Hyrule Field and the Market. Spend 60 s or more in each, moving the camera through grass and trees.
Member

Beanstalk test farm

Commit c890df3 · approved by nobody yet · dashboard

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

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

Read of d02b0fc7 (base d76d202f; current main is a2dc5385, 32 commits ahead — WIP, no rebase). The gate and the plan read right to me, and the test is real. The one thing that can settle the PR is a Windows AMD GCN run with cleared caches, and that run is not available as asked — so I stop at the code findings and tick nothing.

1. The claim needs the hardware, and the farm declined it. The farm's sticky (23:26) says it can't test this as asked: its controlled cold-cache scenarios run on Linux only, so it cannot establish the "clear the game's shader caches first" condition on Windows, and there is no Vega card online. Its alternative compares main and the PR on a Windows Polaris but cannot control the caches — which is exactly the variable the 53-310 s compile claim depends on. Until a human with a Polaris or Vega on AMD's Windows driver runs the cleared-cache A/B (or the reporters in #1204/#1836 do), the compile-time, speck and freeze claim is unverified. From code I can confirm the gate and the planner, not the compiler.

2. The handshake is relaxed atomics only. Every cross-lane word is OpAtomicOr/OpAtomicExchange/OpAtomicLoad with Semantics = 0 (Relaxed), Scope Workgroup, and there is no OpControlBarrier between a lane's data and its arrival bit or around the wait (emit_spirv_warp.cpp:175-183, 209-219; the wait in spirv_emit_context.cpp:2510-2535). The reader sees the flag with a relaxed load, then reads the data word with another; formally nothing orders the data behind the flag, and the Vulkan memory model does not promise it. It has held on Intel Mesa and on RADV with the check on (billions of answers, 0 different), so it is the practical behaviour of workgroup atomics there — but AMD's Windows compiler is the first where it is unproven, and the whole PR is about that compiler. The check run (RX_VK_MESH_SHARED_WARP_CHECK=1, comparing against the subgroup's answer and counting given-up waits) is the right evidence; if any difference or give-up appears, the fix is a release on the flag OpAtomicOr and an acquire on the wait's OpAtomicLoad (or a workgroup barrier), not a switch.

3. The policy line reports the default, not what the PC got, when the switch overrides it. mesh_shared_warp is not in device_policy_env (no flag(Sw::mesh_shared_warp, "RX_VK_MESH_SHARED_WARP", …)), so p.mesh_shared_warp stays the driver/arch default and the vk: policy: can and measured: line prints that (device_policy.h:863-866), while shared_warp_wanted (vk_coopmat.cpp:673-675) applies the switch at the site. On a GCN Windows PC with RX_VK_MESH_SHARED_WARP=0 the policy block still says mesh_shared_warp=1, and the * "a switch set this" mark never appears; the body says the line "says what the PC got", which is only true with the switch unset. The new test checks the line only for the unset cases (tests/test_gcn_mesh_shared_warp.py), so this is untested. Cleanest: put the switch in device_policy_env so the field is the effective value and the * marks it; otherwise the row/report should say the policy line is the default and the vk: the mesh fallback's warps in workgroup memory line is the effective one.

4. The switch's empty value now means the default. On main mesh_pages_wanted read the env as set-or-not, so RX_VK_MESH_SHARED_WARP= (empty) was off; shared_warp_wanted treats empty as unset, so on Intel Mesa and GCN Windows an empty value now turns the shared warp on. That matches device_policy_env's own rule ("unset or empty: the default", device_policy.h:708-712) but not env_on_or's (longshot_env.h:57-60), and the row now says "unset or empty the default" (switches.def:525), so it is deliberate and documented — just worth a sentence in the PR that it differs from main's empty behaviour, since a launcher that writes an empty line to clear a switch will now get the new path on these PCs. The test's RX_VK_MESH_SHARED_WARP empty (the default) case codifies it.

5. The rest of the code review.

  • GCN/subgroup assumption: f.windows && AMD_PROPRIETARY && f.subgroup_max > 32 && !(f.sg32_stages & COMPUTE) is the right shape — GCN is 64-lane only with no 32-lane stage, RDNA holds compute at 32 (0x20/0xFF in the test's facts) and stays off, Intel Mesa keeps its old clause, NVIDIA/llvmpipe off. It is a policy value from driver facts; the test's Polaris facts come from the reporters' logs, which is the best possible without the card.
  • Windows-only and RADV/Linux: right, and evidence-based — RADV GCN is left on the subgroup (the lab measured it compiles in seconds, draws right, and the forced shared warp gave the same answers and fps, only one retranslation); f.windows also leaves AMD's proprietary Linux driver (AMDVLK) GCN on the subgroup, untested but the status quo, with no report either way. The row says "off elsewhere (RADV included)".
  • Shared-memory sizing and the plan: bounded and sound — one 32×1×1 workgroup only, no site in a loop, no early return inside an if, no quad/matrix/barrier/output-read (spirv_emit_context.cpp:2397-2486); warp_word_count is words + 2 × regions and WarpTake throws if the emitter ever asks for more, so no out-of-bounds word; the Workgroup array is a plain U32[n] (no ArrayStride), and the wait is bounded at 65536 reads with a give-up counted (emit_spirv.h:80-85).
  • The check switch and the requested run: with RX_VK_MESH_SHARED_WARP_CHECK on, the stage still emits the subgroup's answer to compare against ("the stage keeps its subgroup instructions", mma_layout.h), so on GCN Windows the slow 64-lane emulation is still compiled. The farm's compile-time/speck run must be without the check; the answers check is a second run.
  • Test: strong — the new test cuts the real coopmat_init right-hand side and device_policy() and covers 17 PCs and the switch both ways, failing on main; test_mesh_fallback_shared_warp.py keeps the SPIR-V/planner shape checks. test_device_policy.py adds the field but has no GCN-on-Windows row, so only the new test guards the new default. Neither, of course, can replace the card.
  • Default: on for every AMD Windows driver version on GCN, not only the known-bad 24.9.1; if a newer driver fixed the compile, the shared warp is still harmless per the RADV data but unmeasured on Windows. The stamp's bit 8192 already folds the shared warp, so a GCN Windows PC retranslates once, as the body says.

No approval, and no claim on it; the checklist's hardware boxes are the ones I cannot settle.

**Read of `d02b0fc7` (base `d76d202f`; current main is `a2dc5385`, 32 commits ahead — WIP, no rebase).** The gate and the plan read right to me, and the test is real. The one thing that can settle the PR is a Windows AMD GCN run with cleared caches, and that run is not available as asked — so I stop at the code findings and tick nothing. **1. The claim needs the hardware, and the farm declined it.** The farm's sticky (23:26) says it can't test this as asked: its controlled cold-cache scenarios run on Linux only, so it cannot establish the "clear the game's shader caches first" condition on Windows, and there is no Vega card online. Its alternative compares main and the PR on a Windows Polaris but cannot control the caches — which is exactly the variable the 53-310 s compile claim depends on. Until a human with a Polaris or Vega on AMD's Windows driver runs the cleared-cache A/B (or the reporters in #1204/#1836 do), the compile-time, speck and freeze claim is unverified. From code I can confirm the gate and the planner, not the compiler. **2. The handshake is relaxed atomics only.** Every cross-lane word is `OpAtomicOr`/`OpAtomicExchange`/`OpAtomicLoad` with `Semantics = 0` (Relaxed), Scope Workgroup, and there is no `OpControlBarrier` between a lane's data and its arrival bit or around the wait (`emit_spirv_warp.cpp:175-183, 209-219`; the wait in `spirv_emit_context.cpp:2510-2535`). The reader sees the flag with a relaxed load, then reads the data word with another; formally nothing orders the data behind the flag, and the Vulkan memory model does not promise it. It has held on Intel Mesa and on RADV with the check on (billions of answers, 0 different), so it is the practical behaviour of workgroup atomics there — but AMD's Windows compiler is the first where it is unproven, and the whole PR is about that compiler. The check run (`RX_VK_MESH_SHARED_WARP_CHECK=1`, comparing against the subgroup's answer and counting given-up waits) is the right evidence; if any difference or give-up appears, the fix is a release on the flag `OpAtomicOr` and an acquire on the wait's `OpAtomicLoad` (or a workgroup barrier), not a switch. **3. The policy line reports the default, not what the PC got, when the switch overrides it.** `mesh_shared_warp` is not in `device_policy_env` (no `flag(Sw::mesh_shared_warp, "RX_VK_MESH_SHARED_WARP", …)`), so `p.mesh_shared_warp` stays the driver/arch default and the `vk: policy: can and measured:` line prints that (`device_policy.h:863-866`), while `shared_warp_wanted` (`vk_coopmat.cpp:673-675`) applies the switch at the site. On a GCN Windows PC with `RX_VK_MESH_SHARED_WARP=0` the policy block still says `mesh_shared_warp=1`, and the `*` "a switch set this" mark never appears; the body says the line "says what the PC got", which is only true with the switch unset. The new test checks the line only for the unset cases (`tests/test_gcn_mesh_shared_warp.py`), so this is untested. Cleanest: put the switch in `device_policy_env` so the field is the effective value and the `*` marks it; otherwise the row/report should say the policy line is the default and the `vk: the mesh fallback's warps in workgroup memory` line is the effective one. **4. The switch's empty value now means the default.** On main `mesh_pages_wanted` read the env as set-or-not, so `RX_VK_MESH_SHARED_WARP=` (empty) was off; `shared_warp_wanted` treats empty as unset, so on Intel Mesa and GCN Windows an empty value now turns the shared warp on. That matches `device_policy_env`'s own rule ("unset or empty: the default", `device_policy.h:708-712`) but not `env_on_or`'s (`longshot_env.h:57-60`), and the row now says "unset or empty the default" (`switches.def:525`), so it is deliberate and documented — just worth a sentence in the PR that it differs from main's empty behaviour, since a launcher that writes an empty line to clear a switch will now get the new path on these PCs. The test's `RX_VK_MESH_SHARED_WARP empty (the default)` case codifies it. **5. The rest of the code review.** - **GCN/subgroup assumption:** `f.windows && AMD_PROPRIETARY && f.subgroup_max > 32 && !(f.sg32_stages & COMPUTE)` is the right shape — GCN is 64-lane only with no 32-lane stage, RDNA holds compute at 32 (`0x20`/`0xFF` in the test's facts) and stays off, Intel Mesa keeps its old clause, NVIDIA/llvmpipe off. It is a policy value from driver facts; the test's Polaris facts come from the reporters' logs, which is the best possible without the card. - **Windows-only and RADV/Linux:** right, and evidence-based — RADV GCN is left on the subgroup (the lab measured it compiles in seconds, draws right, and the forced shared warp gave the same answers and fps, only one retranslation); `f.windows` also leaves AMD's proprietary Linux driver (AMDVLK) GCN on the subgroup, untested but the status quo, with no report either way. The row says "off elsewhere (RADV included)". - **Shared-memory sizing and the plan:** bounded and sound — one 32×1×1 workgroup only, no site in a loop, no early return inside an if, no quad/matrix/barrier/output-read (`spirv_emit_context.cpp:2397-2486`); `warp_word_count` is `words + 2 × regions` and `WarpTake` throws if the emitter ever asks for more, so no out-of-bounds word; the Workgroup array is a plain `U32[n]` (no `ArrayStride`), and the wait is bounded at 65536 reads with a give-up counted (`emit_spirv.h:80-85`). - **The check switch and the requested run:** with `RX_VK_MESH_SHARED_WARP_CHECK` on, the stage still emits the subgroup's answer to compare against ("the stage keeps its subgroup instructions", `mma_layout.h`), so on GCN Windows the slow 64-lane emulation is still compiled. The farm's compile-time/speck run must be without the check; the answers check is a second run. - **Test:** strong — the new test cuts the real `coopmat_init` right-hand side and `device_policy()` and covers 17 PCs and the switch both ways, failing on main; `test_mesh_fallback_shared_warp.py` keeps the SPIR-V/planner shape checks. `test_device_policy.py` adds the field but has no GCN-on-Windows row, so only the new test guards the new default. Neither, of course, can replace the card. - **Default:** on for every AMD Windows driver version on GCN, not only the known-bad 24.9.1; if a newer driver fixed the compile, the shared warp is still harmless per the RADV data but unmeasured on Windows. The stamp's bit 8192 already folds the shared warp, so a GCN Windows PC retranslates once, as the body says. No approval, and no claim on it; the checklist's hardware boxes are the ones I cannot settle.
Author
Owner
@fix
BeanBot force-pushed fix/gcn-mesh-shared-warp from d02b0fc772
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 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 18s
Third-party parts / As their notes say (pull_request) Successful in 21s
CI / Website build and checks (pull_request) Failing after 22s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 29s
beanstalk/approval can't be tested as asked: see the farm's comment
to c890df3b72
Some checks failed
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, built by CI (pull_request_target) Has been skipped
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Failing after 12s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 1m39s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 2m6s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m57s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 2m0s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 5m24s
beanstalk/approval not approved yet
PR description / Title and description (pull_request_target) Failing after 22s
CI / Website build and checks (pull_request) Successful in 4m13s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Successful in 10m46s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Successful in 14m53s
2026-11-27 01:19:13 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The targeted Windows AMD GCN path has not been measured or exercised in game, so its compile-time benefit and correctness remain unproven. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is c890df3b72. I rebased it onto main (e8fce9956e).

Conflicts resolved

  • docs/dev/reference/architecture.md: Kept the shared-warp explanation and the base branch’s thread description.
  • gpu/vk/vk_coopmat.cpp: Kept both the table-load and shared-warp helpers.
  • tests/test_device_policy.py: Kept the shared-warp expectations alongside the base branch’s policy updates. I edited its description to match the change.

Changed

  • Shared-warp synchronization: Added workgroup acquire-release ordering to arrival updates and acquire ordering to waits in gpu/vk/eden/shader_recompiler/backend/spirv/emit_spirv_warp.cpp:175 and spirv_emit_context.cpp:2587. Added source checks for the emitted operations in tests/test_mesh_fallback_shared_warp.py:134. Tests were not run.
  • Shared-warp policy logging: Labeled the policy value as the default in gpu/vk/device_policy.h:863 and logged the effective value separately in gpu/vk/vk_coopmat.cpp:721; updated the associated checks.

Left for the author

  • Windows GCN default: The author must measure the change on targeted Windows AMD hardware and decide whether the results support the default. Turning it off would undo the PR's requested default change.

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

The change enables the existing workgroup-memory warp fallback by default on AMD Windows GPUs limited to wider-than-32-lane compute subgroups. It may reduce long shader compiles, at the cost of one cache retranslation and an unmeasured change in shader behavior on the target driver.

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

  • L3 gpu/vk/device_policy.h:638: The changed default has not been measured or exercised on the Windows AMD hardware it targets. When: On Polaris or Vega with AMD's Windows driver, the new workgroup-memory shaders may compile or run differently from the tested Mesa and NVIDIA paths; there is no comparison of compile time, output, waits or frame pacing against the base. Do: Run repeated cold-cache base and head comparisons on Windows Polaris, and Vega if available, through the named scenes. Record compile times, output, waits, frame times and shared-warp check results; also run without the check to observe the actual shared-warp output.

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

Also noticed (3; not asked for, not blocking)
  • The PR description still describes the policy line as reporting mesh_shared_warp rather than mesh_shared_warp_default and the separate effective-value line.
  • The new ordering also affects the existing Intel Mesa shared-warp path; a runtime check of the final head would provide additional confidence.
  • The description still lists the NVIDIA tour as untested despite recording that tour under Tested.
More: does it help, other systems, switches, what was read

Does it help: Unproven. Reported Windows compile times were 53–310 seconds per fallback stage on version 3.0.0; there is no comparable result for this change. On RADV RX 580, the forced shared path reportedly matched answers and had fps within noise, but that does not measure the target driver.

Other systems: RADV GCN, NVIDIA and Mesa Intel retain their existing defaults; the override can enable the shared path elsewhere. The synchronization edit affects shared-warp shaders wherever enabled. Linux NVIDIA and RADV runs reported no differing answers or abandoned waits, but AMD Windows remains untested.

Switches: RX_VK_MESH_SHARED_WARP defaults on for Mesa Intel and AMD Windows GPUs without 32-lane compute subgroups, and off elsewhere; 1 forces it on, 0 or an off word forces it off, and unset or empty uses the default. The new Windows default awaits measurement.

Reviewed: c890df3b72 against e8fce9956e: Read AGENTS.md, CONTRIBUTING.md and the pull request template; docs/review-checklist.md is absent. Read the fix diff and the shared-warp emission and wait code around it; inspected the policy and initialization changes. The full base-to-HEAD diff and all changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The policy log labels the policy value as the default, and initialization separately logs the effective value after the override.
  • The fix adds workgroup acquire-release semantics to arrival updates and acquire semantics to waits without disabling the shared-warp path.

Testing: No commands that build or run the project were executed. CI has not run on the fix head; the recorded Linux runs do not cover AMD's Windows compiler.

Overlaps and merge order: none found


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

**Recommendation: Approve.** The code is ready: only testing is left. The targeted Windows AMD GCN path has not been measured or exercised in game, so its compile-time benefit and correctness remain unproven. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is c890df3b7252. I rebased it onto `main` (e8fce9956e2a). **Conflicts resolved** - docs/dev/reference/architecture.md: Kept the shared-warp explanation and the base branch’s thread description. - gpu/vk/vk_coopmat.cpp: Kept both the table-load and shared-warp helpers. - tests/test_device_policy.py: Kept the shared-warp expectations alongside the base branch’s policy updates. I edited its description to match the change. **Changed** - **Shared-warp synchronization**: Added workgroup acquire-release ordering to arrival updates and acquire ordering to waits in gpu/vk/eden/shader_recompiler/backend/spirv/emit_spirv_warp.cpp:175 and spirv_emit_context.cpp:2587. Added source checks for the emitted operations in tests/test_mesh_fallback_shared_warp.py:134. Tests were not run. - **Shared-warp policy logging**: Labeled the policy value as the default in gpu/vk/device_policy.h:863 and logged the effective value separately in gpu/vk/vk_coopmat.cpp:721; updated the associated checks. **Left for the author** - **Windows GCN default**: The author must measure the change on targeted Windows AMD hardware and decide whether the results support the default. Turning it off would undo the PR's requested default change. Nothing was built or run: the checks run again on the new head. The change enables the existing workgroup-memory warp fallback by default on AMD Windows GPUs limited to wider-than-32-lane compute subgroups. It may reduce long shader compiles, at the cost of one cache retranslation and an unmeasured change in shader behavior on the target driver. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `gpu/vk/device_policy.h:638`: The changed default has not been measured or exercised on the Windows AMD hardware it targets. *When:* On Polaris or Vega with AMD's Windows driver, the new workgroup-memory shaders may compile or run differently from the tested Mesa and NVIDIA paths; there is no comparison of compile time, output, waits or frame pacing against the base. **Do:** Run repeated cold-cache base and head comparisons on Windows Polaris, and Vega if available, through the named scenes. Record compile times, output, waits, frame times and shared-warp check results; also run without the check to observe the actual shared-warp output. **Checks:** they run again on this head (`Guide screenshots / Guide images and local UI source review (pull_request)`, `CI / Website build and checks (pull_request)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - The PR description still describes the policy line as reporting mesh_shared_warp rather than mesh_shared_warp_default and the separate effective-value line. - The new ordering also affects the existing Intel Mesa shared-warp path; a runtime check of the final head would provide additional confidence. - The description still lists the NVIDIA tour as untested despite recording that tour under Tested. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. Reported Windows compile times were 53–310 seconds per fallback stage on version 3.0.0; there is no comparable result for this change. On RADV RX 580, the forced shared path reportedly matched answers and had fps within noise, but that does not measure the target driver. **Other systems:** RADV GCN, NVIDIA and Mesa Intel retain their existing defaults; the override can enable the shared path elsewhere. The synchronization edit affects shared-warp shaders wherever enabled. Linux NVIDIA and RADV runs reported no differing answers or abandoned waits, but AMD Windows remains untested. **Switches:** RX_VK_MESH_SHARED_WARP defaults on for Mesa Intel and AMD Windows GPUs without 32-lane compute subgroups, and off elsewhere; 1 forces it on, 0 or an off word forces it off, and unset or empty uses the default. The new Windows default awaits measurement. **Reviewed:** c890df3b7252 against e8fce9956e2a: Read AGENTS.md, CONTRIBUTING.md and the pull request template; docs/review-checklist.md is absent. Read the fix diff and the shared-warp emission and wait code around it; inspected the policy and initialization changes. The full base-to-HEAD diff and all changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The policy log labels the policy value as the default, and initialization separately logs the effective value after the override. - The fix adds workgroup acquire-release semantics to arrival updates and acquire semantics to waits without disabling the shared-warp path. **Testing:** No commands that build or run the project were executed. CI has not run on the fix head; the recorded Linux runs do not cover AMD's Windows compiler. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: fix(vk): AMD's Windows driver on GCN keeps the mesh fallback's warp in workgroup memory, off the 64-lane subgroup emulation to fix(vk): AMD's Windows driver on GCN keeps the mesh fallback's warp in workgroup memory, off the 64-lane subgroup emulation 2026-11-27 01:24:52 +00:00
HumanBean deleted branch fix/gcn-mesh-shared-warp 2026-11-27 01:25:00 +00:00
First-time contributor

Windows 10, RX 580, AMD's own driver: the merge fixes the compile times (454-1408 s -> 10-13 s), the specks on hair and foliage are still there

The Windows Polaris half of the Beanstalk request, from a real card instead of the farm. The answer splits in two:
the fallback compiles in seconds now, the specks did not go away.

Machine

  • Windows 10 Pro for Workstations 22H2, build 19045; 4 cores; 16342 MB RAM
  • Radeon RX 580 Series 8 GB (7936 MB), pci 1002:67df, arch amd_gcn, resizable BAR 0, 1920x1080
  • AMD proprietary driver, package 31.0.21925.1001, Vulkan 0x800117 ("26.5.2 (AMD proprietary shader compiler)")
  • Before: longshot v3.2.0 (source 1f0bf123). After: nightly-845-388c9d4b (source 1fdf05c7), played in game

The shared warp is the default here

vk: policy: can and measured: mirrors=1 import_chunk=4 MB ub_snapshot=0 split_ub_flush=1 native_float_add=0 warp64=1 mesh_shared_warp_default=1 batch_submits=0 mma_unroll_try=0 global_table_loop=0 occ_copy=0 intel_side_by_side_auto=0 fsr4_tune=1 gpu_clock_peak=0 readback_late_newest=0 acquire_ahead=1 pcache_small_pc=0 bc_small_runs=1
vk: mesh_shared_warp=1 (effective, RX_VK_MESH_SHARED_WARP over the policy default)
vk: the mesh fallback's warps in workgroup memory, its stages at any lane count (RX_VK_MESH_SHARED_WARP=0: the subgroup's)

Compile times

Before (v3.2.0, the emulation):

454.5 s  5c289971647c0b94
523.5 s  6dbfda5a1876272d
569.0 s  5c9454152ebde335
1408.4 s 93e3e999f2fb9fd8

After (nightly-845, every fallback line in that log):

10.6 s  c45c1784181679f1
11.2 s  1c9f9f391de22b17
11.2 s  785980dbd0dcb751
12.8 s  20dbc84a63b2bc6e
10.7 s  868923d0cb6f141d
190.4 s cf987f56b971bdb3

Same workgroup 1x1x1, shared memory 0 bytes shape. The worst stage went from 569-1408 s to 190.4 s, the rest are ten
seconds. No waits for other lanes gave up line anywhere in the after log.

The specks did not go

Hair and grass still draw as bright specks that flicker. I walked Kokiri Forest, Hyrule Field and the Market for 60 s+
each: to my eye it is the same as v3.2.0, I cannot honestly claim the merge reduced it. mesh_fallback_strict_fmul is
on for this PC (it is in driver fixes on driver version 0x800117), so that is already in place and does not cover
this on this card either.

What I can run next

  • RX_VK_MESH_STRICT_FMUL=0 against =1 on the same save, to see whether the specks change at all. Name the build and
    I'll take both runs.
  • The full log, on request.
**Windows 10, RX 580, AMD's own driver: the merge fixes the compile times (454-1408 s -> 10-13 s), the specks on hair and foliage are still there** The Windows Polaris half of the Beanstalk request, from a real card instead of the farm. The answer splits in two: the fallback compiles in seconds now, the specks did not go away. **Machine** - Windows 10 Pro for Workstations 22H2, build 19045; 4 cores; 16342 MB RAM - Radeon RX 580 Series 8 GB (7936 MB), pci 1002:67df, arch amd_gcn, resizable BAR 0, 1920x1080 - AMD proprietary driver, package 31.0.21925.1001, Vulkan 0x800117 ("26.5.2 (AMD proprietary shader compiler)") - Before: longshot v3.2.0 (source 1f0bf123). After: nightly-845-388c9d4b (source 1fdf05c7), played in game **The shared warp is the default here** vk: policy: can and measured: mirrors=1 import_chunk=4 MB ub_snapshot=0 split_ub_flush=1 native_float_add=0 warp64=1 mesh_shared_warp_default=1 batch_submits=0 mma_unroll_try=0 global_table_loop=0 occ_copy=0 intel_side_by_side_auto=0 fsr4_tune=1 gpu_clock_peak=0 readback_late_newest=0 acquire_ahead=1 pcache_small_pc=0 bc_small_runs=1 vk: mesh_shared_warp=1 (effective, RX_VK_MESH_SHARED_WARP over the policy default) vk: the mesh fallback's warps in workgroup memory, its stages at any lane count (RX_VK_MESH_SHARED_WARP=0: the subgroup's) **Compile times** Before (v3.2.0, the emulation): ``` 454.5 s 5c289971647c0b94 523.5 s 6dbfda5a1876272d 569.0 s 5c9454152ebde335 1408.4 s 93e3e999f2fb9fd8 ``` After (nightly-845, every fallback line in that log): ``` 10.6 s c45c1784181679f1 11.2 s 1c9f9f391de22b17 11.2 s 785980dbd0dcb751 12.8 s 20dbc84a63b2bc6e 10.7 s 868923d0cb6f141d 190.4 s cf987f56b971bdb3 ``` Same `workgroup 1x1x1, shared memory 0 bytes` shape. The worst stage went from 569-1408 s to 190.4 s, the rest are ten seconds. No `waits for other lanes gave up` line anywhere in the after log. **The specks did not go** Hair and grass still draw as bright specks that flicker. I walked Kokiri Forest, Hyrule Field and the Market for 60 s+ each: to my eye it is the same as v3.2.0, I cannot honestly claim the merge reduced it. `mesh_fallback_strict_fmul` is on for this PC (it is in `driver fixes on driver version 0x800117`), so that is already in place and does not cover this on this card either. **What I can run next** - `RX_VK_MESH_STRICT_FMUL=0` against `=1` on the same save, to see whether the specks change at all. Name the build and I'll take both runs. - The full log, on request.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2158
No description provided.