test(agc): skip the csub and coherent atomic load runs on subgroups narrower than 32 lanes #19332

Closed
peacocksir wants to merge 1 commit from upstream-pr/19332 into main
peacocksir commented 2026-11-13 04:00:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by peacocksir on 2026-11-13T04:00:29Z.


What

Two execution tests merged today fail on lavapipe, whose subgroups are 8 lanes wide (subgroupSize, minSubgroupSize and maxSubgroupSize are all 8):

  • agc_driver_global_atomic_csub (the runs without glc from #18667) fails with global atomic csub without glc: wave64 byte 644 is 146, expected 0. Lanes 33, 35, ..., 63 aren't written under EXEC_LO = 0x55555555, although EXEC_HI is still all ones.
  • agc_driver_coherent_atomic_loads_enabled (#18600) times out after 60 s in its waiting dispatch.

Both tests depend on gaps that docs/dev/debt/shader.md already records for host subgroups narrower than 32 lanes:

  • On such a host, threadBit reads an EXEC written as a value at the bit for the host subgroup invocation id. So each lane at or above the host subgroup size reads a lower lane's EXEC_LO bit.
  • v_readlane_b32 can't read a lane outside the host subgroup.

How each test hits them:

  • csub: the no-glc program sets EXEC_LO with s_mov_b32.
  • Coherent waiting program: it starts with s_mov_b64 exec, 1, takes a ticket with buffer_atomic_add ... glc, and shares it with v_readlane_b32 s4, v1, 0. With 8-lane subgroups, every subgroup takes its own ticket and reads its own lane 0, so the chain never completes.

The recompiler didn't change. The failures come from the new assertions in #18667 and the new test in #18600. Both tests now return VulkanTestSkipped when Target().subgroupSize is below 32, as agc_driver_relative_dpp does for its partial-EXEC runs:

  • csub prints skipped, subgroup size %u cannot hold a wave32.
  • The coherent test prints skipped, subgroup size %u cannot hold a wave64 in two lanes.

They skip only after the checks that don't depend on lane layout:

  • csub still runs its glc runs and the accept and refuse checks.
  • The coherent test still runs its SPIR-V load check.

Why the threshold is 32 and the wave32 run without glc also skips:

  • At 32 lanes, a wave64 runs two lanes per invocation or spans two subgroups, and both tests pass on the two 32-lane GPUs below.
  • The wave32 run passes on lavapipe today only because 0x55555555 repeats every two bits, so lanes 8–31 read the right bit by chance. Under the same gap, any other mask would fail.

Pull requests don't run the self-hosted linux job. That job has Mesa's Vulkan drivers installed and runs the tests tools/select_tests.py selects, and it runs only on pushes to main and on manual dispatch. It now fails on main with both tests: run 43647851509 at 995a10cdbb reports agc_driver_global_atomic_csub (Failed) and agc_driver_coherent_atomic_loads_enabled (Timeout), plus agc_driver_stencil_copy_draw, which #20289 handles.

Tested

Head f5b8fdcdc4 on main e4caa07950, rebased after #21093 merged (no conflict; python3 tools/rebase_verify.py 35c6b6e7ff f5b8fdcdc4 --onto origin/main reports that all added and deleted lines are kept). #21093 added a /dev/udmabuf skip to both test files, and it comes before this PR's subgroup checks.

The lavapipe table is from the rebased head. The Windows runs compared main a6606d5bab with this commit on that base (d04031e5f7) and were not repeated after the rebase.

All runs used the same environment on both sides:

  • Environment: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer.
  • Command: ctest --test-dir build -R '^agc_driver_(global_atomic_csub|coherent_atomic_loads|coherent_atomic_loads_enabled|buffer_atomic_csub)$' -V, 3 times per side and GPU. The lavapipe run at the rebased head left out agc_driver_buffer_atomic_csub and selected five more tests in the same command (the stencil copy and draw input tests of #20289 and #20831).
  • Validation: every log shows the loader inserting VK_LAYER_KHRONOS_validation. The tests of this PR print no VUID- line. In the lavapipe logs at the rebased head, the only one is VUID-VkImageCreateInfo-samples-02258 from agc_driver_stencil_copy_draw, once per run on main and on this branch alike.

Ubuntu 24.04, GCC 13.3.0, Release, lavapipe (Mesa 25.2.8, LLVM 20.1.2, subgroup size 8), Khronos validation layer 1.4.335 built from source. /dev/udmabuf opens on this machine: every log has dma-buf imports keep write protection: yes and no Permission denied line, so #21093's skip does not apply. An earlier version of this section reported runs made without that access; see the correction in the comments.

Test main e4caa07950 this PR f5b8fdcdc4
agc_driver_global_atomic_csub fails 3/3: wave64 byte 644 is 146, expected 0 skips 3/3: skipped, subgroup size 8 cannot hold a wave32
agc_driver_coherent_atomic_loads_enabled times out 3/3 at 60 s skips 3/3: skipped, subgroup size 8 cannot hold a wave64 in two lanes
agc_driver_coherent_atomic_loads passes 3/3 passes 3/3

agc_driver_buffer_atomic_csub passed 3/3 on both sides at the previous head and was not rerun. Before the rebase, on main, I printed every mismatching word of the csub run without glc with a temporary local change. In wave64, lanes 33, 35, ..., 63 are not written; wave32 and lanes 0–32 match.

Windows 10 22H2 (19045), WinLibs GCC 15.2.0 r7 UCRT, Release, Vulkan SDK 1.4.363.1 validation layer, implicit layers disabled (VK_LOADER_LAYERS_DISABLE=~implicit~). One PC with both GPUs, each selected with ANYPS5_GPU. Both report subgroup size 32, so these runs check that nothing changes there:

GPU main this PR
Intel UHD Graphics 770 (8086:4680), driver 101.7088 all 4 pass, 3/3 all 4 pass, 3/3, same output
NVIDIA GeForce RTX 4060 (10de:2882), driver 610.74 all 4 pass, 3/3 all 4 pass, 3/3, same output

Other checks:

  • Full ctest --test-dir build --output-on-failure -j6 on lavapipe at d04031e5f7 (an earlier base, without /dev/udmabuf access): 5193 of 5194 pass. I did not repeat the full run after the rebase. The one failure, output_fifo_macos, is not caused by this PR: the relinker sources here are the same as on main a6606d5bab, and this PR doesn't touch the relinker. I didn't run it on a main build. It fails because its control and regular outputs differ in the ad-hoc code signature's identifier, which since #18450 is the output file name.
  • main's own CI since 2026-11-17: the self-hosted linux runners can now open /dev/udmabuf (EagleBearerYS's comment below). I checked two of the jobs it cites, 133920014313 (main 7ca28abfd5, LLVM 21.1.8) and 133926919815 (main 3dceb9c2dd, LLVM 20.1.2). Both run llvmpipe with subgroup=8, and in both agc_driver_global_atomic_csub fails with wave64 byte 644 is 146, expected 0 and agc_driver_coherent_atomic_loads_enabled times out at 60 s. These are the two failures this PR skips. This PR's own linux CI job was skipped at its current head (2026-11-16), so CI hasn't run this PR's tests on the new runners.
  • python3 tools/check_conventions.py --base origin/main passes.
  • tools/pr_overlap.py --branch at the rebased head could not compare #14217, which conflicts with main. Its change to CoherentAtomicLoads.cpp makes atomic also true on the coherent-buffer-atomics target and rewords two messages, in the lines next to this PR's. The two changes are independent, and whichever merges second has a small textual conflict in main().
  • tools/check_skips.py accepts both skip messages as device limitations.

Not tested:

  • The Windows GPUs at the rebased head.
  • macOS / MoltenVK, by anyone. Others ran it on other GPUs in comments below:
    • JJenkx, Windows, RX 6700 XT (subgroup size 64): all three tests passed 3 of 3.
    • tablefrogpillow, Linux, RADV (Mesa 26.2.6), on Vega, RDNA2 and RDNA3: agc_driver_coherent_atomic_loads and agc_driver_global_atomic_csub ran and passed 3 of 3 on each, with 0 VUID-.
    • domx4q, Arch Linux, NVIDIA GeForce RTX 4090 (subgroup size 32), proprietary driver 620.70.06, validation layer 1.4.363.1: head f5b8fdcdc4 merged onto main f0c01bc69d against a main f0c01bc69d build. All four tests passed on both sides, the layer was inserted, and there were no VUID- lines. The new checks did not skip.
  • A host with 16-lane subgroups.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #14217
  • Fixes: none
  • Unblocks: none
  • GPUs tested: lavapipe (Mesa 25.2.8), Ubuntu 24.04; Intel UHD Graphics 770, driver 101.7088, Windows 10 22H2; NVIDIA GeForce RTX 4060, driver 610.74, Windows 10 22H2
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5289731702 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19332). Originally posted by [peacocksir](https://github.com/peacocksir) on 2026-11-13T04:00:29Z. --- ### What Two execution tests merged today fail on lavapipe, whose subgroups are 8 lanes wide (`subgroupSize`, `minSubgroupSize` and `maxSubgroupSize` are all 8): - **`agc_driver_global_atomic_csub`** (the runs without `glc` from #18667) fails with `global atomic csub without glc: wave64 byte 644 is 146, expected 0`. Lanes 33, 35, ..., 63 aren't written under `EXEC_LO = 0x55555555`, although `EXEC_HI` is still all ones. - **`agc_driver_coherent_atomic_loads_enabled`** (#18600) times out after 60 s in its waiting dispatch. Both tests depend on gaps that `docs/dev/debt/shader.md` already records for host subgroups narrower than 32 lanes: - On such a host, `threadBit` reads an EXEC written as a value at the bit for the host subgroup invocation id. So each lane at or above the host subgroup size reads a lower lane's EXEC_LO bit. - `v_readlane_b32` can't read a lane outside the host subgroup. How each test hits them: - **csub:** the no-`glc` program sets `EXEC_LO` with `s_mov_b32`. - **Coherent waiting program:** it starts with `s_mov_b64 exec, 1`, takes a ticket with `buffer_atomic_add ... glc`, and shares it with `v_readlane_b32 s4, v1, 0`. With 8-lane subgroups, every subgroup takes its own ticket and reads its own lane 0, so the chain never completes. The recompiler didn't change. The failures come from the new assertions in #18667 and the new test in #18600. Both tests now return `VulkanTestSkipped` when `Target().subgroupSize` is below 32, as `agc_driver_relative_dpp` does for its partial-EXEC runs: - csub prints `skipped, subgroup size %u cannot hold a wave32`. - The coherent test prints `skipped, subgroup size %u cannot hold a wave64 in two lanes`. They skip only after the checks that don't depend on lane layout: - csub still runs its `glc` runs and the accept and refuse checks. - The coherent test still runs its SPIR-V load check. Why the threshold is 32 and the wave32 run without `glc` also skips: - At 32 lanes, a wave64 runs two lanes per invocation or spans two subgroups, and both tests pass on the two 32-lane GPUs below. - The wave32 run passes on lavapipe today only because `0x55555555` repeats every two bits, so lanes 8–31 read the right bit by chance. Under the same gap, any other mask would fail. Pull requests don't run the self-hosted `linux` job. That job has Mesa's Vulkan drivers installed and runs the tests `tools/select_tests.py` selects, and it runs only on pushes to `main` and on manual dispatch. It now fails on `main` with both tests: run 43647851509 at 995a10cdbb reports `agc_driver_global_atomic_csub (Failed)` and `agc_driver_coherent_atomic_loads_enabled (Timeout)`, plus `agc_driver_stencil_copy_draw`, which #20289 handles. ### Tested Head f5b8fdcdc4 on `main` e4caa07950, rebased after #21093 merged (no conflict; `python3 tools/rebase_verify.py 35c6b6e7ff f5b8fdcdc4 --onto origin/main` reports that all added and deleted lines are kept). #21093 added a `/dev/udmabuf` skip to both test files, and it comes before this PR's subgroup checks. The lavapipe table is from the rebased head. The Windows runs compared `main` a6606d5bab with this commit on that base (d04031e5f7) and were not repeated after the rebase. All runs used the same environment on both sides: - **Environment:** `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`. - **Command:** `ctest --test-dir build -R '^agc_driver_(global_atomic_csub|coherent_atomic_loads|coherent_atomic_loads_enabled|buffer_atomic_csub)$' -V`, 3 times per side and GPU. The lavapipe run at the rebased head left out `agc_driver_buffer_atomic_csub` and selected five more tests in the same command (the stencil copy and draw input tests of #20289 and #20831). - **Validation:** every log shows the loader inserting `VK_LAYER_KHRONOS_validation`. The tests of this PR print no `VUID-` line. In the lavapipe logs at the rebased head, the only one is `VUID-VkImageCreateInfo-samples-02258` from `agc_driver_stencil_copy_draw`, once per run on `main` and on this branch alike. **Ubuntu 24.04, GCC 13.3.0, Release, lavapipe (Mesa 25.2.8, LLVM 20.1.2, subgroup size 8), Khronos validation layer 1.4.335 built from source.** `/dev/udmabuf` opens on this machine: every log has `dma-buf imports keep write protection: yes` and no `Permission denied` line, so #21093's skip does not apply. An earlier version of this section reported runs made without that access; see the correction in the comments. | Test | `main` e4caa07950 | this PR f5b8fdcdc4 | |---|---|---| | `agc_driver_global_atomic_csub` | fails 3/3: `wave64 byte 644 is 146, expected 0` | skips 3/3: `skipped, subgroup size 8 cannot hold a wave32` | | `agc_driver_coherent_atomic_loads_enabled` | times out 3/3 at 60 s | skips 3/3: `skipped, subgroup size 8 cannot hold a wave64 in two lanes` | | `agc_driver_coherent_atomic_loads` | passes 3/3 | passes 3/3 | `agc_driver_buffer_atomic_csub` passed 3/3 on both sides at the previous head and was not rerun. Before the rebase, on `main`, I printed every mismatching word of the csub run without `glc` with a temporary local change. In wave64, lanes 33, 35, ..., 63 are not written; wave32 and lanes 0–32 match. **Windows 10 22H2 (19045), WinLibs GCC 15.2.0 r7 UCRT, Release, Vulkan SDK 1.4.363.1 validation layer, implicit layers disabled (`VK_LOADER_LAYERS_DISABLE=~implicit~`).** One PC with both GPUs, each selected with `ANYPS5_GPU`. Both report subgroup size 32, so these runs check that nothing changes there: | GPU | `main` | this PR | |---|---|---| | Intel UHD Graphics 770 (8086:4680), driver 101.7088 | all 4 pass, 3/3 | all 4 pass, 3/3, same output | | NVIDIA GeForce RTX 4060 (10de:2882), driver 610.74 | all 4 pass, 3/3 | all 4 pass, 3/3, same output | Other checks: - Full `ctest --test-dir build --output-on-failure -j6` on lavapipe at d04031e5f7 (an earlier base, without `/dev/udmabuf` access): 5193 of 5194 pass. I did not repeat the full run after the rebase. The one failure, `output_fifo_macos`, is not caused by this PR: the relinker sources here are the same as on `main` a6606d5bab, and this PR doesn't touch the relinker. I didn't run it on a `main` build. It fails because its control and `regular` outputs differ in the ad-hoc code signature's identifier, which since #18450 is the output file name. - `main`'s own CI since 2026-11-17: the self-hosted `linux` runners can now open `/dev/udmabuf` (EagleBearerYS's comment below). I checked two of the jobs it cites, [133920014313](https://github.com/boykopovar/AnyPS5/actions/runs/44046471857/job/133920014313) (`main` 7ca28abfd5, LLVM 21.1.8) and [133926919815](https://github.com/boykopovar/AnyPS5/actions/runs/44049424792/job/133926919815) (`main` 3dceb9c2dd, LLVM 20.1.2). Both run llvmpipe with `subgroup=8`, and in both `agc_driver_global_atomic_csub` fails with `wave64 byte 644 is 146, expected 0` and `agc_driver_coherent_atomic_loads_enabled` times out at 60 s. These are the two failures this PR skips. This PR's own `linux` CI job was skipped at its current head (2026-11-16), so CI hasn't run this PR's tests on the new runners. - `python3 tools/check_conventions.py --base origin/main` passes. - `tools/pr_overlap.py --branch` at the rebased head could not compare #14217, which conflicts with `main`. Its change to `CoherentAtomicLoads.cpp` makes `atomic` also true on the coherent-buffer-atomics target and rewords two messages, in the lines next to this PR's. The two changes are independent, and whichever merges second has a small textual conflict in `main()`. - `tools/check_skips.py` accepts both skip messages as device limitations. Not tested: - The Windows GPUs at the rebased head. - macOS / MoltenVK, by anyone. Others ran it on other GPUs in comments below: - JJenkx, Windows, RX 6700 XT (subgroup size 64): all three tests passed 3 of 3. - tablefrogpillow, Linux, RADV (Mesa 26.2.6), on Vega, RDNA2 and RDNA3: `agc_driver_coherent_atomic_loads` and `agc_driver_global_atomic_csub` ran and passed 3 of 3 on each, with 0 `VUID-`. - domx4q, Arch Linux, NVIDIA GeForce RTX 4090 (subgroup size 32), proprietary driver 620.70.06, validation layer 1.4.363.1: head f5b8fdcdc4 merged onto `main` f0c01bc69d against a `main` f0c01bc69d build. All four tests passed on both sides, the layer was inserted, and there were no `VUID-` lines. The new checks did not skip. - A host with 16-lane subgroups. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #14217 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: lavapipe (Mesa 25.2.8), Ubuntu 24.04; Intel UHD Graphics 770, driver 101.7088, Windows 10 22H2; NVIDIA GeForce RTX 4060, driver 610.74, Windows 10 22H2 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!19332
No description provided.