fix(shader): ballot 32-lane host subgroups with a subgroup OR #6654

Closed
mariuszkreft wants to merge 1 commit from upstream-pr/6654 into main
mariuszkreft commented 2026-10-16 01:59:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mariuszkreft on 2026-10-16T01:59:04Z.


What

Found by driving GTA V (PPSA04264) on Linux/RTX 3090 (NVIDIA 580.159.03): creating the compute pipeline for shader 14bedf15407b7f11 segfaults inside NVIDIA's SPIR-V compiler (SIGSEGV in libnvidia-gpucomp.so+0xe3facc, exit 139, no AnyPS5 message). The module is valid under spirv-val.

Removing repeated ballots is not enough. The captured pipeline still crashed at the same offset when its ballots were rewritten one group at a time down to two, and those two are the low and high halves of one wave64 loop-exit test, with different predicates. Splitting blocks did not help either. Rewriting every OpGroupNonUniformBallot as OpGroupNonUniformBitwiseOr Reduce of predicate ? 1 << SubgroupLocalInvocationId : 0 does help: agc_compute_pipeline_replay builds all three GTA V captures that crashed (14bedf15407b7f11, fe506552cec99bfc, c02e5e3f35010fa5), and the 78 other GTA V captures that contain ballots still build. What in the shader triggers the crash is not known.

On a subgroup of at most 32 invocations the OR gives the same mask as a ballot, inactive invocations included:

  • EmitSubgroupBallot (SpirvSubgroup.cpp) emits the OR form, in the first word of the ballot vector, when the host subgroup is 32 lanes wide and the device supports GroupNonUniformArithmetic (HostSubgroupBallotsByReduction). Other hosts keep OpGroupNonUniformBallot.
  • The high half of a wave64 ballot (SpirvValueEmitContext::Ballot) goes through EmitSubgroupBallot too, instead of emitting its own OpGroupNonUniformBallot.
  • SpirvEmitter::Emit declares SubgroupLocalInvocationId whenever it will ballot this way.
  • The OR form applies to every 32-lane host with subgroup arithmetic, not only NVIDIA, and is longer than a ballot there. NVIDIA pipeline compiles take longer (274 to 378 ms and 296 to 783 ms for the two smaller crashers; about 5.1 s for 14bedf15407b7f11). This is recorded as a technical-debt entry in docs/dev/debt/shader.md, with the unknown trigger and the fact that only NVIDIA 580 was tested.

Tests: wave32_wide_subgroup gains CheckTwoLaneBallot, which links two half contexts, interprets the emitted SPIR-V (its interpreter now understands OpGroupNonUniformBitwiseOr and OpCapability) and checks the ballot words {lowMask, highMask, 0, 0} and the form used, with and without a 32-lane arithmetic host. agc_shader_memory counted every OR reduction and so counted the new ballots; it now skips ORs of lane bits, and the quad-mask check accepts either ballot form.

Possibly related: #6294 (Borderlands 4, NVIDIA 595.99, segfault in the same compiler on a module with OpGroupNonUniformBallot). Its reduced module does not crash on 580.159.03 with either form, so this was not verified against it.

Tested

Linux, on the host, in the slice worktree. The loop ran this gate itself; the tail of it is
at the bottom of this pull request. No title and no GPU were involved.

cmake -S . -B build-full -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build-full --parallel 12
ctest --test-dir build-full --output-on-failure -j 12
python3 tools/check_conventions.py --base origin/main

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; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA04264 Game bring-up #1203 — reported against this title, not verified on it
  • GPUs tested: n/a (host-side change; no GPU execution)
  • AI-assisted: yes
Verification log tail
=== slice gta5-shader-ballot-subgroup-or: fix/shader-ballot-subgroup-or @ 1c0c66c98 on origin/main 5d9dcc42d ===
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --parallel 20   -> rc=0

=== affected tests ===
1/4 Test #265: agc_shader_quad_mask_no_demote ...   Passed
2/4 Test #272: agc_shader_memory ................   Passed
3/4 Test #274: agc_spirv_module .................   Passed
4/4 Test #750: wave32_wide_subgroup .............   Passed
100% tests passed, 0 tests failed out of 4

=== fails before (SpirvSubgroup.cpp/.hpp and SpirvEmitter.cpp reverted to origin/main) ===
3/3 Test #750: wave32_wide_subgroup .............***Failed
a wave64 ballot half took the wrong form for the host subgroup

=== ctest (full, -j 16) ===
99% tests passed, 3 tests failed out of 1269
The following tests FAILED:
	393 - agc_driver_flip_stores_small_results (Failed)
	608 - agc_driver_store_idle_results (Failed)
	609 - agc_driver_store_over_untracked (Failed)
rerun alone: agc_driver_flip_stores_small_results, agc_driver_store_idle_results passed
agc_driver_store_over_untracked: pre-existing on origin/main 5d9dcc42d (recorded in slices gta5-shader-wave64-shared-ballot-once and gta5-shader-ballot-once-per-block on the same base)

=== conventions ===
All conventions checks passed.

=== RESULT ===
PASS
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4882327811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654). Originally posted by [mariuszkreft](https://github.com/mariuszkreft) on 2026-10-16T01:59:04Z. --- ### What > > Found by driving GTA V (PPSA04264) on Linux/RTX 3090 (NVIDIA 580.159.03): creating the compute pipeline for shader `14bedf15407b7f11` segfaults inside NVIDIA's SPIR-V compiler (`SIGSEGV in libnvidia-gpucomp.so+0xe3facc`, exit 139, no AnyPS5 message). The module is valid under `spirv-val`. > > Removing repeated ballots is not enough. The captured pipeline still crashed at the same offset when its ballots were rewritten one group at a time down to two, and those two are the low and high halves of one wave64 loop-exit test, with different predicates. Splitting blocks did not help either. Rewriting every `OpGroupNonUniformBallot` as `OpGroupNonUniformBitwiseOr Reduce` of `predicate ? 1 << SubgroupLocalInvocationId : 0` does help: `agc_compute_pipeline_replay` builds all three GTA V captures that crashed (`14bedf15407b7f11`, `fe506552cec99bfc`, `c02e5e3f35010fa5`), and the 78 other GTA V captures that contain ballots still build. What in the shader triggers the crash is not known. > > On a subgroup of at most 32 invocations the OR gives the same mask as a ballot, inactive invocations included: > > - `EmitSubgroupBallot` (`SpirvSubgroup.cpp`) emits the OR form, in the first word of the ballot vector, when the host subgroup is 32 lanes wide and the device supports `GroupNonUniformArithmetic` (`HostSubgroupBallotsByReduction`). Other hosts keep `OpGroupNonUniformBallot`. > - The high half of a wave64 ballot (`SpirvValueEmitContext::Ballot`) goes through `EmitSubgroupBallot` too, instead of emitting its own `OpGroupNonUniformBallot`. > - `SpirvEmitter::Emit` declares `SubgroupLocalInvocationId` whenever it will ballot this way. > - The OR form applies to every 32-lane host with subgroup arithmetic, not only NVIDIA, and is longer than a ballot there. NVIDIA pipeline compiles take longer (274 to 378 ms and 296 to 783 ms for the two smaller crashers; about 5.1 s for `14bedf15407b7f11`). This is recorded as a technical-debt entry in `docs/dev/debt/shader.md`, with the unknown trigger and the fact that only NVIDIA 580 was tested. > > Tests: `wave32_wide_subgroup` gains `CheckTwoLaneBallot`, which links two half contexts, interprets the emitted SPIR-V (its interpreter now understands `OpGroupNonUniformBitwiseOr` and `OpCapability`) and checks the ballot words `{lowMask, highMask, 0, 0}` and the form used, with and without a 32-lane arithmetic host. `agc_shader_memory` counted every OR reduction and so counted the new ballots; it now skips ORs of lane bits, and the quad-mask check accepts either ballot form. > > Possibly related: #6294 (Borderlands 4, NVIDIA 595.99, segfault in the same compiler on a module with `OpGroupNonUniformBallot`). Its reduced module does not crash on 580.159.03 with either form, so this was not verified against it. > ### Tested Linux, on the host, in the slice worktree. The loop ran this gate itself; the tail of it is at the bottom of this pull request. No title and no GPU were involved. ```sh cmake -S . -B build-full -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON cmake --build build-full --parallel 12 ctest --test-dir build-full --output-on-failure -j 12 python3 tools/check_conventions.py --base origin/main ``` ### Checklist - [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; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA04264 [Game bring-up #1203](https://github.com/boykopovar/AnyPS5/discussions/1203) — reported against this title, not verified on it - [x] GPUs tested: n/a (host-side change; no GPU execution) - [x] AI-assisted: yes <details><summary>Verification log tail</summary> ``` === slice gta5-shader-ballot-subgroup-or: fix/shader-ballot-subgroup-or @ 1c0c66c98 on origin/main 5d9dcc42d === cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON cmake --build build --parallel 20 -> rc=0 === affected tests === 1/4 Test #265: agc_shader_quad_mask_no_demote ... Passed 2/4 Test #272: agc_shader_memory ................ Passed 3/4 Test #274: agc_spirv_module ................. Passed 4/4 Test #750: wave32_wide_subgroup ............. Passed 100% tests passed, 0 tests failed out of 4 === fails before (SpirvSubgroup.cpp/.hpp and SpirvEmitter.cpp reverted to origin/main) === 3/3 Test #750: wave32_wide_subgroup .............***Failed a wave64 ballot half took the wrong form for the host subgroup === ctest (full, -j 16) === 99% tests passed, 3 tests failed out of 1269 The following tests FAILED: 393 - agc_driver_flip_stores_small_results (Failed) 608 - agc_driver_store_idle_results (Failed) 609 - agc_driver_store_over_untracked (Failed) rerun alone: agc_driver_flip_stores_small_results, agc_driver_store_idle_results passed agc_driver_store_over_untracked: pre-existing on origin/main 5d9dcc42d (recorded in slices gta5-shader-wave64-shared-ballot-once and gta5-shader-ballot-once-per-block on the same base) === conventions === All conventions checks passed. === RESULT === PASS ``` </details>
github-actions[bot] commented 2026-10-16 02:38:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T02:38:37Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6010 docs/dev/debt/shader.md L104
PR 7193 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L35

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 4339 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp
PR 4650 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 5021 core/libs/tests/Wave32WideSubgroup.cpp
core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvMemory/SpirvSubgroup.hpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp
docs/dev/debt/shader.md
PR 5371 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 5426 docs/dev/debt/shader.md
PR 5500 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 5941 docs/dev/debt/shader.md
PR 5958 docs/dev/debt/shader.md
PR 6009 docs/dev/debt/shader.md
PR 6044 core/libs/tests/Wave32WideSubgroup.cpp
PR 6177 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 6222 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
docs/dev/debt/shader.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 6412 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
docs/dev/debt/shader.md
PR 6416 core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp
PR 6645 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206798774 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654#issuecomment-6206798774). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T02:38:37Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6010](https://www.github.com/boykopovar/AnyPS5/pull/6010) | `docs/dev/debt/shader.md` [L104](https://github.com/boykopovar/AnyPS5/blob/e0d1f1b2f884f871d3881fe455469a2e20ad9362/docs/dev/debt/shader.md#L104) | | | | [PR 7193](https://www.github.com/boykopovar/AnyPS5/pull/7193) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` [L35](https://github.com/boykopovar/AnyPS5/blob/e0d1f1b2f884f871d3881fe455469a2e20ad9362/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp#L35) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` | | [PR 4339](https://www.github.com/boykopovar/AnyPS5/pull/4339) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp`<br>`core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/tests/Wave32WideSubgroup.cpp`<br>`core/shader/recompiler/SpirvBackend/include/SpirvBackend/SpirvMemory/SpirvSubgroup.hpp`<br>`core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp`<br>`core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvSubgroup.cpp`<br>`docs/dev/debt/shader.md` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`docs/dev/debt/shader.md` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `docs/dev/debt/shader.md` | | [PR 5500](https://www.github.com/boykopovar/AnyPS5/pull/5500) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`docs/dev/debt/shader.md` | | [PR 5941](https://www.github.com/boykopovar/AnyPS5/pull/5941) | `docs/dev/debt/shader.md` | | [PR 5958](https://www.github.com/boykopovar/AnyPS5/pull/5958) | `docs/dev/debt/shader.md` | | [PR 6009](https://www.github.com/boykopovar/AnyPS5/pull/6009) | `docs/dev/debt/shader.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/Wave32WideSubgroup.cpp` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp`<br>`docs/dev/debt/shader.md` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`docs/dev/debt/shader.md` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`<br>`docs/dev/debt/shader.md` | | [PR 6416](https://www.github.com/boykopovar/AnyPS5/pull/6416) | `core/shader/recompiler/SpirvBackend/src/SpirvEmitter.cpp` | | [PR 6645](https://www.github.com/boykopovar/AnyPS5/pull/6645) | `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` |
jotitadev commented 2026-10-16 02:58:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T02:58:32Z.

Review: COMMENTED


Another NVIDIA driver branch, plus lavapipe: no regressions.

Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329 (32-lane subgroups with arithmetic, so the OR form is used), plus lavapipe (Mesa 26.0.3, LLVM 21.1.8, subgroup size 8, so it keeps OpGroupNonUniformBallot) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Head 1c0c66c98 merged into main 5d9dcc42d (clean merge), -j1 --timeout 30.

  • Tests only (the three SpirvBackend sources restored from main): wave32_wide_subgroup fails with a wave64 ballot half took the wrong form for the host subgroup, so the new check catches the old emission.
  • With the fix: wave32_wide_subgroup, agc_shader_memory, agc_subgroup_clock, agc_driver_wave32_exec_lane_bits and agc_driver_wave32_subgroup pass 3/3 on both devices (wave32_subgroup skips on lavapipe, as on main).
  • ctest -R "^agc" (flip, display and lds_atomics64 excluded): RTX 3070 591/593, the same as main here (stencil_ref_export skipped, store_over_untracked failing, #6347). lavapipe: 593/593 with the same 40 skips as main.

I don't have the GTA V captures, so the crash itself isn't reproduced here. This only shows the OR form doesn't regress the AGC suite on the 595 branch.

GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5542490551 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654#pullrequestreview-5542490551). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-16T02:58:32Z. **Review:** COMMENTED --- Another NVIDIA driver branch, plus lavapipe: no regressions. **Machine:** NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329 (32-lane subgroups with arithmetic, so the OR form is used), plus lavapipe (Mesa 26.0.3, LLVM 21.1.8, subgroup size 8, so it keeps `OpGroupNonUniformBallot`) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`. Head `1c0c66c98` merged into `main` `5d9dcc42d` (clean merge), `-j1 --timeout 30`. - Tests only (the three `SpirvBackend` sources restored from `main`): `wave32_wide_subgroup` fails with `a wave64 ballot half took the wrong form for the host subgroup`, so the new check catches the old emission. - With the fix: `wave32_wide_subgroup`, `agc_shader_memory`, `agc_subgroup_clock`, `agc_driver_wave32_exec_lane_bits` and `agc_driver_wave32_subgroup` pass 3/3 on both devices (`wave32_subgroup` skips on lavapipe, as on `main`). - `ctest -R "^agc"` (flip, display and `lds_atomics64` excluded): RTX 3070 591/593, the same as `main` here (`stencil_ref_export` skipped, `store_over_untracked` failing, #6347). lavapipe: 593/593 with the same 40 skips as `main`. I don't have the GTA V captures, so the crash itself isn't reproduced here. This only shows the OR form doesn't regress the AGC suite on the 595 branch. GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
milescoviello commented 2026-10-16 03:12:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T03:12:11Z.


A data point for the "possibly related" #6294. On NVIDIA 595.99 this rewrite doesn't avoid the Borderlands 4 crash, so the two look like different triggers. That doesn't say anything about GTA V on 580.

  • I applied the same rewrite to the captured Borderlands 4 compute module (compute-edb626b757e75707) by hand. That's all 154 OpGroupNonUniformBallot, each turned into OpGroupNonUniformBitwiseOr Reduce of predicate ? 1 << SubgroupLocalInvocationId : 0 in the first word, with GroupNonUniformArithmetic added. It passes spirv-val, and agc_compute_pipeline_replay still segfaults in libnvidia-gpucomp 3 of 3, like the original.
  • My 47-instruction reduction of it also still crashes 3 of 3 with all three of its ballots in the OR form.
  • A 900 s title run with this PR on main 5d9dcc42d didn't settle it either way. Its shader cache was cold, because the ballot shaders change. At 496 s it ended in the game's own GameThread timed out waiting for RenderThread after 120.00 secs. On main it segfaulted at about 430 s, after a warm start.

Linux (Ubuntu 24.04), RTX 4070 Ti, NVIDIA 595.99.02.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6207204611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654#issuecomment-6207204611). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-16T03:12:11Z. --- A data point for the "possibly related" #6294. On NVIDIA 595.99 this rewrite doesn't avoid the Borderlands 4 crash, so the two look like different triggers. That doesn't say anything about GTA V on 580. - I applied the same rewrite to the captured Borderlands 4 compute module (`compute-edb626b757e75707`) by hand. That's all 154 `OpGroupNonUniformBallot`, each turned into `OpGroupNonUniformBitwiseOr Reduce` of `predicate ? 1 << SubgroupLocalInvocationId : 0` in the first word, with `GroupNonUniformArithmetic` added. It passes `spirv-val`, and `agc_compute_pipeline_replay` still segfaults in `libnvidia-gpucomp` 3 of 3, like the original. - My 47-instruction reduction of it also still crashes 3 of 3 with all three of its ballots in the OR form. - A 900 s title run with this PR on `main` 5d9dcc42d didn't settle it either way. Its shader cache was cold, because the ballot shaders change. At 496 s it ended in the game's own `GameThread timed out waiting for RenderThread after 120.00 secs`. On `main` it segfaulted at about 430 s, after a warm start. Linux (Ubuntu 24.04), RTX 4070 Ti, NVIDIA 595.99.02. AI-assisted: yes
savvaniss commented 2026-10-17 14:43:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T14:43:16Z.


GPU execution data for this change: the first run on GPUs, as far as I can see. It covers a 32-wide host (Intel) and a 64-wide host (AMD).

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest, main 47a266cf9. Intel UHD Graphics 770 (8086:a780, 32-wide subgroups), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550, 64-wide subgroups), driver 32.0.31041.1004, with VkCache emptied first.

UHD 770 RX 9070 XT
This head 1c0c66c98 merged into main: wave32_wide_subgroup and the 10 agc_shader_memory tests, ×3 pass pass
This PR's test files on main without the fix, ×3 agc_shader_entry_lane_proof_budget, agc_shader_memory and wave32_wide_subgroup fail same
Full CTest with this PR alone 1392 of 1398, same failures as main 1396 of 1398, same failures as main

main alone: UHD 770 1392 of 1398, RX 9070 XT 1396 of 1398. The failures are image tables (#6647) and sample_multisample_target (#6971) on Intel, and quad_pixel_mask (#6255) and layered_volume_vertex_no_gpl (#4768) on AMD.

This PR conflicts with #6638 in core/libs/tests/Wave32WideSubgroup.cpp and SpirvEmitter.cpp.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6235238364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654#issuecomment-6235238364). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-17T14:43:16Z. --- GPU execution data for this change: the first run on GPUs, as far as I can see. It covers a 32-wide host (Intel) and a 64-wide host (AMD). Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest, `main` `47a266cf9`. Intel UHD Graphics 770 (`8086:a780`, 32-wide subgroups), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`, 64-wide subgroups), driver 32.0.31041.1004, with `VkCache` emptied first. | | UHD 770 | RX 9070 XT | |---|---|---| | This head `1c0c66c98` merged into `main`: `wave32_wide_subgroup` and the 10 `agc_shader_memory` tests, ×3 | pass | pass | | This PR's test files on `main` without the fix, ×3 | `agc_shader_entry_lane_proof_budget`, `agc_shader_memory` and `wave32_wide_subgroup` fail | same | | Full CTest with this PR alone | 1392 of 1398, same failures as `main` | 1396 of 1398, same failures as `main` | `main` alone: UHD 770 1392 of 1398, RX 9070 XT 1396 of 1398. The failures are image tables (#6647) and `sample_multisample_target` (#6971) on Intel, and `quad_pixel_mask` (#6255) and `layered_volume_vertex_no_gpl` (#4768) on AMD. This PR conflicts with #6638 in `core/libs/tests/Wave32WideSubgroup.cpp` and `SpirvEmitter.cpp`. AI-assisted: yes (Claude Code)
mariuszkreft commented 2026-10-17 19:25:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mariuszkreft on 2026-10-17T19:25:31Z.


Closed by the contribution loop's guard: this pull request has no checklist and was not opened by the loop's reviewed path. The work will be reopened as a pull request after the local gate and the review pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6239514538 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654#issuecomment-6239514538). Originally posted by [mariuszkreft](https://github.com/mariuszkreft) on 2026-10-17T19:25:31Z. --- Closed by the contribution loop's guard: this pull request has no checklist and was not opened by the loop's reviewed path. The work will be reopened as a pull request after the local gate and the review pass.
CPritch commented 2026-10-18 15:00:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-18T15:00:33Z.


Tested in game: GTA V PPSA04263 on Linux, RTX 4060, NVIDIA 580.126.20. main
385ed71f2 crashes in libnvidia-gpucomp during the Story load; with this PR merged
it gets past the load and into gameplay. Details in #1203.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251400467 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6654#issuecomment-6251400467). Originally posted by [CPritch](https://github.com/CPritch) on 2026-10-18T15:00:33Z. --- Tested in game: GTA V PPSA04263 on Linux, RTX 4060, NVIDIA 580.126.20. main 385ed71f2 crashes in libnvidia-gpucomp during the Story load; with this PR merged it gets past the load and into gameplay. Details in [#1203](https://github.com/boykopovar/AnyPS5/discussions/1203).

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