fix(agc): stop pixel invocations on BDA faults when supported #5804

Merged
MarcZX10 merged 9 commits from upstream-pr/5804 into main 2026-10-16 11:35:19 +00:00
MarcZX10 commented 2026-10-14 11:46:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T11:46:07Z.


What

Carry the pixel-shader BDA fault fix for #2009: stop shader invocations with OpTerminateInvocation when the Vulkan feature is enabled, and retain the existing fallback when it is unavailable. Validate both the extension and opcode against the enabled feature and fragment stage. The carried feature-enable commit preserves abnergtz’s original authorship; subsequent rebase fixes are authored by MarcZX100.

Tested

The carried branch reports agc_driver_pixel_interlock passing on AMD RDNA 2 devices using driver 32.0.21045, where main reproduces an atomic write after the fallback. Added regression coverage for both stop paths, interlock exit ordering, non-pixel stages, SPIR-V specialization, enabled/disabled feature validation, and shaderDrawParameters profile validation.

On this Linux host, no configured build tree for this branch was available. The prior review reported agc_driver_graphics failures on Windows: on the PR head, an earlier unchanged DepthStencilTests expectation fails; on main plus the PR, the test shader requires shaderClipDistance. Those failures remain unresolved and need follow-up. git diff --check and tools/check_conventions.py --base upstream/main pass after rebasing on current main.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR
  • No comments in code
  • Generic behavior
  • Depends on: none
  • Unblocks: none
  • GPUs tested: AMD RDNA 2 devices on Windows, driver 32.0.21045; local Linux host has no configured build for this branch
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4857362986 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T11:46:07Z. --- ### What Carry the pixel-shader BDA fault fix for #2009: stop shader invocations with `OpTerminateInvocation` when the Vulkan feature is enabled, and retain the existing fallback when it is unavailable. Validate both the extension and opcode against the enabled feature and fragment stage. The carried feature-enable commit preserves abnergtz’s original authorship; subsequent rebase fixes are authored by MarcZX100. ### Tested The carried branch reports `agc_driver_pixel_interlock` passing on AMD RDNA 2 devices using driver 32.0.21045, where `main` reproduces an atomic write after the fallback. Added regression coverage for both stop paths, interlock exit ordering, non-pixel stages, SPIR-V specialization, enabled/disabled feature validation, and `shaderDrawParameters` profile validation. On this Linux host, no configured build tree for this branch was available. The prior review reported `agc_driver_graphics` failures on Windows: on the PR head, an earlier unchanged `DepthStencilTests` expectation fails; on main plus the PR, the test shader requires `shaderClipDistance`. Those failures remain unresolved and need follow-up. `git diff --check` and `tools/check_conventions.py --base upstream/main` pass after rebasing on current `main`. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR - [x] No comments in code - [x] Generic behavior - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: AMD RDNA 2 devices on Windows, driver 32.0.21045; local Linux host has no configured build for this branch - [x] AI-assisted: yes
MarcZX10 commented 2026-10-14 11:59:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T11:59:04Z.


GitHub’s overlap check correctly flags shared Context, ValidateShaders, and draw-validation interfaces with #4072. The feature checks are separate, but both append to the same APIs, so I updated this PR to depend on #4072 and will rebase it onto that head after #4072 lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6167818787 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6167818787). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T11:59:04Z. --- GitHub’s overlap check correctly flags shared `Context`, `ValidateShaders`, and draw-validation interfaces with #4072. The feature checks are separate, but both append to the same APIs, so I updated this PR to depend on #4072 and will rebase it onto that head after #4072 lands.
simonbronk commented 2026-10-14 14:20:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T14:20:00Z.


Tested on the AMD RDNA 2 iGPU where main fails, and the port as it stands does not fix it: it leaves out abnergtz's 81f711d8a ("enable VK_KHR_shader_terminate_invocation on the device"). Nothing sets Context::shaderTerminateInvocation and nothing adds SPV_KHR_terminate_invocation to the device's SPIR-V extensions, so the recompiler always takes the OpKill fallback.

Setup: Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics, Ryzen iGPU gfx1036, driver 32.0.21036.18 (a driver branch not in #2009's list yet). NVIDIA GeForce RTX 5070, driver 617.42. shaderTerminateInvocation is true on both. The PR merged into main 5a6ad0ed3 without conflicts.

agc_driver_pixel_interlock, 5 runs each:

Build AMD iGPU RTX 5070
main 5a6ad0ed3 fails 5/5: pixel interlock wave64 BDA fault: pixel 0 counted 1 of 0 overlapping read-modify-writes passes 5/5
main + this PR fails 5/5, same message passes 5/5
main + this PR + 81f711d8a passes 5/5 passes 5/5

The PR's own tests also don't build or pass on current main:

  • tests/ShaderDeviceProfile.cpp: ProfileInput::extensions is a std::array<std::string_view, 2>, so extensions.push_back(...) doesn't compile. With that fixed, agc_shader_device_profile fails because it expects a rejection that only 81f711d8a adds to ShaderDeviceProfile.cpp.
  • tests/Graphics.cpp: vertexWords returns Recompile(request).spirv.Words(), a span into a destroyed result, and the two spans are then compared with ==, which doesn't compile. After that, the vertex recompile throws clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device, a requirement main added after this branch's base. The target needs CapabilityClipDistance.

All four fixes are on simonbronk:fix/5804-device-enable (485c18d06), on top of this PR's head 5d9c037a0. abnergtz's commit keeps its authorship there. The technical debt commit f23c94ca9 is also missing from the port; it targets the old docs/dev/TechnicalDebt.md layout and would go to docs/dev/debt/ now.

With all four on main 5a6ad0ed3:

  • full ctest -j 8 on the RTX 5070: all pass except check_main_sync, which fails on a Windows code page and is unrelated;
  • ctest -R "agc|shader|video_out" on the AMD iGPU: all pass except agc_driver_lds_mixed_width_atomics and agc_driver_layered_volume_vertex_no_gpl, the other two from #5271. On main, agc_driver_pixel_interlock fails there as well.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170538668 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6170538668). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T14:20:00Z. --- Tested on the AMD RDNA 2 iGPU where `main` fails, and the port as it stands does not fix it: it leaves out abnergtz's `81f711d8a` ("enable VK_KHR_shader_terminate_invocation on the device"). Nothing sets `Context::shaderTerminateInvocation` and nothing adds `SPV_KHR_terminate_invocation` to the device's SPIR-V extensions, so the recompiler always takes the `OpKill` fallback. Setup: Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release. AMD Radeon(TM) Graphics, Ryzen iGPU gfx1036, driver 32.0.21036.18 (a driver branch not in #2009's list yet). NVIDIA GeForce RTX 5070, driver 617.42. `shaderTerminateInvocation` is true on both. The PR merged into `main` 5a6ad0ed3 without conflicts. `agc_driver_pixel_interlock`, 5 runs each: | Build | AMD iGPU | RTX 5070 | |---|---|---| | `main` 5a6ad0ed3 | fails 5/5: `pixel interlock wave64 BDA fault: pixel 0 counted 1 of 0 overlapping read-modify-writes` | passes 5/5 | | `main` + this PR | fails 5/5, same message | passes 5/5 | | `main` + this PR + `81f711d8a` | **passes 5/5** | passes 5/5 | The PR's own tests also don't build or pass on current `main`: - `tests/ShaderDeviceProfile.cpp`: `ProfileInput::extensions` is a `std::array<std::string_view, 2>`, so `extensions.push_back(...)` doesn't compile. With that fixed, `agc_shader_device_profile` fails because it expects a rejection that only `81f711d8a` adds to `ShaderDeviceProfile.cpp`. - `tests/Graphics.cpp`: `vertexWords` returns `Recompile(request).spirv.Words()`, a span into a destroyed result, and the two spans are then compared with `==`, which doesn't compile. After that, the vertex recompile throws `clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device`, a requirement `main` added after this branch's base. The target needs `CapabilityClipDistance`. All four fixes are on [simonbronk:fix/5804-device-enable](https://github.com/simonbronk/AnyPS5/tree/fix/5804-device-enable) (485c18d06), on top of this PR's head 5d9c037a0. abnergtz's commit keeps its authorship there. The technical debt commit `f23c94ca9` is also missing from the port; it targets the old `docs/dev/TechnicalDebt.md` layout and would go to `docs/dev/debt/` now. With all four on `main` 5a6ad0ed3: - full `ctest -j 8` on the RTX 5070: all pass except `check_main_sync`, which fails on a Windows code page and is unrelated; - `ctest -R "agc|shader|video_out"` on the AMD iGPU: all pass except `agc_driver_lds_mixed_width_atomics` and `agc_driver_layered_volume_vertex_no_gpl`, the other two from #5271. On `main`, `agc_driver_pixel_interlock` fails there as well. AI-assisted (Claude Code).
github-actions[bot] commented 2026-10-15 12:09:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:09:50Z.


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 6523 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp L144
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp L705
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp L619

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 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 1896 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 4650 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5480 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5499 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5500 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5867 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6054 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 6077 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Execution/src/ShaderDeviceProfile.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderDeviceProfile.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6215 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6222 core/libs/prx/libSceAgcDriver/Execution/src/ShaderDeviceProfile.cpp
core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6235 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6259 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6279 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6312 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6320 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6503 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
PR 6529 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6612 core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
PR 6631 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191708200 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6191708200). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:09:50Z. --- <!-- 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 6523](https://www.github.com/boykopovar/AnyPS5/pull/6523) | `core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp` [L144](https://github.com/boykopovar/AnyPS5/blob/aff725bf6d8d61ed33e80507421fd131aeae1305/core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp#L144)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` [L705](https://github.com/boykopovar/AnyPS5/blob/aff725bf6d8d61ed33e80507421fd131aeae1305/core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp#L705)<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp` [L619](https://github.com/boykopovar/AnyPS5/blob/aff725bf6d8d61ed33e80507421fd131aeae1305/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp#L619) | | | 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 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 1896](https://www.github.com/boykopovar/AnyPS5/pull/1896) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4072](https://www.github.com/boykopovar/AnyPS5/pull/4072) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp` | | [PR 4472](https://www.github.com/boykopovar/AnyPS5/pull/4472) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5441](https://www.github.com/boykopovar/AnyPS5/pull/5441) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5480](https://www.github.com/boykopovar/AnyPS5/pull/5480) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5500](https://www.github.com/boykopovar/AnyPS5/pull/5500) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5867](https://www.github.com/boykopovar/AnyPS5/pull/5867) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6054](https://www.github.com/boykopovar/AnyPS5/pull/6054) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp` | | [PR 6077](https://www.github.com/boykopovar/AnyPS5/pull/6077) | `core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Execution/src/ShaderDeviceProfile.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/ShaderDeviceProfile.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6215](https://www.github.com/boykopovar/AnyPS5/pull/6215) | `core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6222](https://www.github.com/boykopovar/AnyPS5/pull/6222) | `core/libs/prx/libSceAgcDriver/Execution/src/ShaderDeviceProfile.cpp`<br>`core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6235](https://www.github.com/boykopovar/AnyPS5/pull/6235) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6259](https://www.github.com/boykopovar/AnyPS5/pull/6259) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6279](https://www.github.com/boykopovar/AnyPS5/pull/6279) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6312](https://www.github.com/boykopovar/AnyPS5/pull/6312) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6436](https://www.github.com/boykopovar/AnyPS5/pull/6436) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6503](https://www.github.com/boykopovar/AnyPS5/pull/6503) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp` | | [PR 6529](https://www.github.com/boykopovar/AnyPS5/pull/6529) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6612](https://www.github.com/boykopovar/AnyPS5/pull/6612) | `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderValidation.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` | | [PR 6631](https://www.github.com/boykopovar/AnyPS5/pull/6631) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` |
adriadam10 commented 2026-10-15 13:10:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T13:10:59Z.

Review: CHANGES_REQUESTED


Checked the current head (build + agc_driver*/agc_shader* ctest; the recompiler change and the device enablement look right, and simonbronk's Windows runs cover the AMD behaviour):

  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:5827: validateTerminate passes nine false followed by enabled, so enabled lands in runtimeDescriptorArray, not shaderTerminateInvocation. agc_driver_graphics fails on this head with SPV_KHR_terminate_invocation requires enabled shaderTerminateInvocation in a fragment shader. It needs one more false before enabled.
  • The PR conflicts with main in ShaderDeviceProfile.cpp, Pipeline.hpp, Draw.cpp and ShaderValidation.cpp (the ValidateShaders/Inspect signatures changed). Please rebase, and re-run agc_driver_graphics, agc_driver_pixel_interlock and agc_shader_device_profile afterwards.
  • The checklist says this depends on #4072 for the same interfaces; if it is still needed, say what is taken from it, otherwise drop the line.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5533620268 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#pullrequestreview-5533620268). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T13:10:59Z. **Review:** CHANGES_REQUESTED --- Checked the current head (build + `agc_driver*`/`agc_shader*` ctest; the recompiler change and the device enablement look right, and simonbronk's Windows runs cover the AMD behaviour): - `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp:5827`: `validateTerminate` passes nine `false` followed by `enabled`, so `enabled` lands in `runtimeDescriptorArray`, not `shaderTerminateInvocation`. `agc_driver_graphics` fails on this head with `SPV_KHR_terminate_invocation requires enabled shaderTerminateInvocation in a fragment shader`. It needs one more `false` before `enabled`. - The PR conflicts with `main` in `ShaderDeviceProfile.cpp`, `Pipeline.hpp`, `Draw.cpp` and `ShaderValidation.cpp` (the `ValidateShaders`/`Inspect` signatures changed). Please rebase, and re-run `agc_driver_graphics`, `agc_driver_pixel_interlock` and `agc_shader_device_profile` afterwards. - The checklist says this depends on #4072 for the same interfaces; if it is still needed, say what is taken from it, otherwise drop the line.
MarcZX10 commented 2026-10-15 14:51:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T14:51:31Z.


Addressed the review: rebased onto current main, restored the Vulkan feature query/enable path and shader-device-profile guard, fixed the validateTerminate argument so enabled reaches shaderTerminateInvocation, and updated the span comparison for the current API. agc_shader_device_profile passes locally. Both agc_driver_graphics and agc_driver_pixel_interlock abort before test cases on this Xeon E5-1620 v2 because it lacks LZCNT, BMI1/2, MOVBE, AVX2, and FMA; they cannot run on this host. The focused Ninja build, conventions check, and git diff --check pass. #4072 remains open and this PR retains the shared feature/interface dependency.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6194989049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6194989049). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T14:51:31Z. --- Addressed the review: rebased onto current main, restored the Vulkan feature query/enable path and shader-device-profile guard, fixed the `validateTerminate` argument so `enabled` reaches `shaderTerminateInvocation`, and updated the span comparison for the current API. `agc_shader_device_profile` passes locally. Both `agc_driver_graphics` and `agc_driver_pixel_interlock` abort before test cases on this Xeon E5-1620 v2 because it lacks LZCNT, BMI1/2, MOVBE, AVX2, and FMA; they cannot run on this host. The focused Ninja build, conventions check, and `git diff --check` pass. #4072 remains open and this PR retains the shared feature/interface dependency.
tezzgod74 commented 2026-10-16 02:29:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-16T02:29:38Z.


Windows run of the three tests from the review, on an RDNA 2 device where main fails. Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, ANYPS5_GPU set to each device:

  • iGPU: Ryzen 9 7950X (RDNA 2, 0x164e), driver 32.0.21045.5002
  • RX 9060 XT (RDNA 4, 0x7590), driver 32.0.31041.1004
Build agc_driver_pixel_interlock iGPU RX 9060 XT agc_shader_device_profile (both) agc_driver_graphics (both)
base 940eba9a2 fails 0/5 (counted 1 of 0) 5/5 pass pass
this PR, 9aa8cc7b 5/5 5/5 pass fails (1)
main 5d9dcc42d not run not run not run pass
main 5d9dcc42d + this PR, local merge 5/5 5/5 pass fails (2)

The fix works on the iGPU. agc_driver_graphics fails on both devices with the PR applied, and passes without it on both bases. Each failure reproduced on every run:

  1. On 9aa8cc7b: expected graphics rejection: writable stencil plane (DepthStencilTests, tests/Graphics.cpp:1857/1896).
  2. Merged into main: ShaderRecompiler::Recompile: SPIR-V module emission failed: clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device.

On 9aa8cc7b, swapping the test file:

Library tests/Graphics.cpp agc_driver_graphics
this PR base 940eba9a2 pass
base 940eba9a2 this PR fails, as expected (6 OpKill and 0 OpTerminateInvocation)

So the library change passes the existing tests, and failure (1) comes with this PR's test file. I haven't found the mechanism: no hunk touches DepthStencilTests, main() runs it before orderedPixelShaderTests and validationTests, the file adds no namespace-scope statics, and the new Context field is appended at the end. Commits 2 to 5 of the branch (2080dcc9..37692a21) don't build on their own, so I couldn't bisect inside it.

One review point: ShaderDeviceProfile.cpp loses the shaderDrawParameters guard. Both the drawParameters lookup and checkFeature(spv::CapabilityDrawParameters, ..., "shaderDrawParameters") exist on the base and on main but not at 9aa8cc7b; the terminate check takes their place instead of being added next to them. No test covers that guard, so it isn't caught.

The merged build was built for the three test targets only: on current main, GpuIndirectArgumentsMisalignedWriterAhead.cpp doesn't compile with MinGW (requested alignment '65536' exceeds object file maximum 8192, see #6452).

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206694711 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6206694711). Originally posted by [tezzgod74](https://github.com/tezzgod74) on 2026-10-16T02:29:38Z. --- Windows run of the three tests from the review, on an RDNA 2 device where `main` fails. Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, `ANYPS5_GPU` set to each device: - iGPU: Ryzen 9 7950X (RDNA 2, 0x164e), driver 32.0.21045.5002 - RX 9060 XT (RDNA 4, 0x7590), driver 32.0.31041.1004 | Build | `agc_driver_pixel_interlock` iGPU | RX 9060 XT | `agc_shader_device_profile` (both) | `agc_driver_graphics` (both) | |---|---|---|---|---| | base 940eba9a2 | fails 0/5 (`counted 1 of 0`) | 5/5 | pass | pass | | this PR, 9aa8cc7b | **5/5** | 5/5 | pass | **fails** (1) | | `main` 5d9dcc42d | not run | not run | not run | pass | | `main` 5d9dcc42d + this PR, local merge | **5/5** | 5/5 | pass | **fails** (2) | The fix works on the iGPU. `agc_driver_graphics` fails on both devices with the PR applied, and passes without it on both bases. Each failure reproduced on every run: 1. On 9aa8cc7b: `expected graphics rejection: writable stencil plane` (`DepthStencilTests`, `tests/Graphics.cpp:1857`/`1896`). 2. Merged into `main`: `ShaderRecompiler::Recompile: SPIR-V module emission failed: clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device`. On 9aa8cc7b, swapping the test file: | Library | `tests/Graphics.cpp` | `agc_driver_graphics` | |---|---|---| | this PR | base 940eba9a2 | pass | | base 940eba9a2 | this PR | fails, as expected (`6 OpKill and 0 OpTerminateInvocation`) | So the library change passes the existing tests, and failure (1) comes with this PR's test file. I haven't found the mechanism: no hunk touches `DepthStencilTests`, `main()` runs it before `orderedPixelShaderTests` and `validationTests`, the file adds no namespace-scope statics, and the new `Context` field is appended at the end. Commits 2 to 5 of the branch (`2080dcc9`..`37692a21`) don't build on their own, so I couldn't bisect inside it. One review point: `ShaderDeviceProfile.cpp` loses the `shaderDrawParameters` guard. Both the `drawParameters` lookup and `checkFeature(spv::CapabilityDrawParameters, ..., "shaderDrawParameters")` exist on the base and on `main` but not at 9aa8cc7b; the terminate check takes their place instead of being added next to them. No test covers that guard, so it isn't caught. The merged build was built for the three test targets only: on current `main`, `GpuIndirectArgumentsMisalignedWriterAhead.cpp` doesn't compile with MinGW (`requested alignment '65536' exceeds object file maximum 8192`, see #6452). AI-assisted: yes
MarcZX10 commented 2026-10-16 05:40:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T05:40:31Z.


Rebased onto current main (5d9dcc42d) and fixed two issues from review: validateTerminate now passes shaderTerminateInvocation to the correct argument, and the profile once again validates CapabilityDrawParameters against the enabled Vulkan feature, with enabled/disabled regression coverage. I also removed the stale #4072 dependency; this branch changes independent shader-validation interfaces and does not depend on that FMA PR. Local git diff --check and conventions pass. I could not run the suites here because there is no configured build tree for this branch. The previously reported Windows agc_driver_graphics failures (DepthStencil expectation on the PR head; shaderClipDistance on main plus PR) remain unresolved, so this needs another focused run/review.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208922767 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6208922767). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T05:40:31Z. --- Rebased onto current main (`5d9dcc42d`) and fixed two issues from review: `validateTerminate` now passes `shaderTerminateInvocation` to the correct argument, and the profile once again validates `CapabilityDrawParameters` against the enabled Vulkan feature, with enabled/disabled regression coverage. I also removed the stale #4072 dependency; this branch changes independent shader-validation interfaces and does not depend on that FMA PR. Local `git diff --check` and conventions pass. I could not run the suites here because there is no configured build tree for this branch. The previously reported Windows `agc_driver_graphics` failures (DepthStencil expectation on the PR head; `shaderClipDistance` on main plus PR) remain unresolved, so this needs another focused run/review.
tezzgod74 commented 2026-10-16 10:02:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-16T10:02:12Z.


Focused run of d6cff408 (on main 5d9dcc42d). Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, Ryzen 9 7950X iGPU (RDNA 2, 0x164e, 32.0.21045.5002) and RX 9060 XT (RDNA 4, 32.0.31041.1004):

Test iGPU RX 9060 XT
agc_driver_pixel_interlock 5/5 5/5
agc_shader_device_profile pass pass
agc_driver_graphics, 2 runs each fails 2/2 fails 2/2

Both agc_driver_graphics failures are:

ShaderRecompiler::Recompile: SPIR-V module emission failed: clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device

That comes from the new vertex check in orderedPixelShaderTests (vertexWords, tests/Graphics.cpp:5728). It recompiles a position-exporting vertex shader (vertexBdaCode ends with exp pos0) against bdaCapabilities (Shader, Int64, PhysicalStorageBufferAddresses, StorageBuffer8BitAccess). Since 9db923e90 ("clip primitives with an all-zero clip position"), the emitter requires CapabilityClipDistance for that. Giving that request spv::CapabilityClipDistance as well removes this error on both devices.

With that change applied locally, the test gets further but isn't stable. In 8 runs (4 per device): 1 pass, 2 failures on

AGC graphics: a vertex shader with BDA reads changed its fault exit when SPV_KHR_terminate_invocation was advertised

4 crashes (unhandled exception 0xc0000005, or the crash report's thread dump), and 1 failure whose message I didn't capture. The same binary passing once and failing in different ways points to something nondeterministic in that check or the code under it; I haven't found what.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6213043241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6213043241). Originally posted by [tezzgod74](https://github.com/tezzgod74) on 2026-10-16T10:02:12Z. --- Focused run of d6cff408 (on `main` 5d9dcc42d). Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, Ryzen 9 7950X iGPU (RDNA 2, 0x164e, 32.0.21045.5002) and RX 9060 XT (RDNA 4, 32.0.31041.1004): | Test | iGPU | RX 9060 XT | |---|---|---| | `agc_driver_pixel_interlock` | 5/5 | 5/5 | | `agc_shader_device_profile` | pass | pass | | `agc_driver_graphics`, 2 runs each | fails 2/2 | fails 2/2 | Both `agc_driver_graphics` failures are: ``` ShaderRecompiler::Recompile: SPIR-V module emission failed: clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device ``` That comes from the new vertex check in `orderedPixelShaderTests` (`vertexWords`, `tests/Graphics.cpp:5728`). It recompiles a position-exporting vertex shader (`vertexBdaCode` ends with `exp pos0`) against `bdaCapabilities` (`Shader`, `Int64`, `PhysicalStorageBufferAddresses`, `StorageBuffer8BitAccess`). Since 9db923e90 ("clip primitives with an all-zero clip position"), the emitter requires `CapabilityClipDistance` for that. Giving that request `spv::CapabilityClipDistance` as well removes this error on both devices. With that change applied locally, the test gets further but isn't stable. In 8 runs (4 per device): 1 pass, 2 failures on ``` AGC graphics: a vertex shader with BDA reads changed its fault exit when SPV_KHR_terminate_invocation was advertised ``` 4 crashes (`unhandled exception 0xc0000005`, or the crash report's thread dump), and 1 failure whose message I didn't capture. The same binary passing once and failing in different ways points to something nondeterministic in that check or the code under it; I haven't found what. AI-assisted: yes
screamm commented 2026-10-16 10:05:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-16T10:05:19Z.


Rerun after the rebase, as asked (agc_driver_graphics, agc_driver_pixel_interlock, agc_shader_device_profile). Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), WinLibs MinGW-w64 GCC 15.2 r7, Release. PR head d6cff408f on main 5d9dcc42d (fast-forward, no conflicts).

  • agc_shader_device_profile and agc_driver_pixel_interlock, --repeat until-fail:3: 3 of 3 each.
  • agc_driver_graphics fails on this head every time (8 of 8 runs; it passes on main): ShaderRecompiler::Recompile: SPIR-V module emission failed: clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device. It comes from the new vertexWords lambda in orderedPixelShaderTests, which reuses bdaCapabilities (no spv::CapabilityClipDistance). This is the failure tezzgod74 reported on main + PR.
  • Fixing that is not enough: the test is then flaky (2 of 6 runs pass), which matches @tezzgod74's 1 pass, 2 failures and 4 crashes above; a crash or a changed fault exit is what a dangling span gives. vertexWords returns Recompile(request).spirv.Words(), and const auto terminated (line 5703) keeps the same; Words() is a span into the RecompileResult temporary, which is destroyed. With a 3-line test change (add spv::CapabilityClipDistance to a separate capability array for the vertex request, and use .spirv.Copy() in those two places) agc_driver_graphics passes 8 of 8, and the three tests pass until-fail:3 3 of 3 each.
  • Negative control (with that test change): SpirvBdaFault.cpp reverted to main, agc_driver_graphics fails 3 of 3 (... 6 OpKill and 0 OpTerminateInvocation, not the valid-mask kill and 5 BDA fault terminations); restored and rebuilt, it passes. agc_driver_pixel_interlock passes with main's recompiler on this GPU, so only the graphics test shows the change here.
  • 46 related GPU tests (agc_driver_bda*, pixel*, vertex_clip*, sample_mask*, alpha_to_coverage*, agc_shader_*, agc_spirv*, serial): 46 of 46 pass. Non-GPU suite (837 tests): 830 pass; the 7 timeouts under load (6 conventions_function_bodies*, hardware_oracle_compare at 19 s of its 20 s) pass serially. tools/check_conventions.py --base origin/main and git diff origin/main --check pass. The full build fails only on the known 64 KiB alignas test (#6452/#6478).
  • Not checked: AMD (the PR's target, so agc_driver_pixel_interlock on the RDNA 2 iGPU is not re-run here), Intel, Linux, and any title run.

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6213097867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#issuecomment-6213097867). Originally posted by [screamm](https://github.com/screamm) on 2026-10-16T10:05:19Z. --- Rerun after the rebase, as asked (`agc_driver_graphics`, `agc_driver_pixel_interlock`, `agc_shader_device_profile`). Windows 11 Pro 26220, NVIDIA RTX 4070 (596.21), WinLibs MinGW-w64 GCC 15.2 r7, Release. PR head `d6cff408f` on main `5d9dcc42d` (fast-forward, no conflicts). - `agc_shader_device_profile` and `agc_driver_pixel_interlock`, `--repeat until-fail:3`: 3 of 3 each. - `agc_driver_graphics` fails on this head every time (8 of 8 runs; it passes on main): `ShaderRecompiler::Recompile: SPIR-V module emission failed: clipping a primitive with an all-zero clip position needs shaderClipDistance on the target device`. It comes from the new `vertexWords` lambda in `orderedPixelShaderTests`, which reuses `bdaCapabilities` (no `spv::CapabilityClipDistance`). This is the failure tezzgod74 reported on main + PR. - Fixing that is not enough: the test is then flaky (2 of 6 runs pass), which matches @tezzgod74's 1 pass, 2 failures and 4 crashes above; a crash or a changed fault exit is what a dangling span gives. `vertexWords` returns `Recompile(request).spirv.Words()`, and `const auto terminated` (line 5703) keeps the same; `Words()` is a span into the `RecompileResult` temporary, which is destroyed. With a 3-line test change (add `spv::CapabilityClipDistance` to a separate capability array for the vertex request, and use `.spirv.Copy()` in those two places) `agc_driver_graphics` passes 8 of 8, and the three tests pass `until-fail:3` 3 of 3 each. - Negative control (with that test change): `SpirvBdaFault.cpp` reverted to main, `agc_driver_graphics` fails 3 of 3 (`... 6 OpKill and 0 OpTerminateInvocation, not the valid-mask kill and 5 BDA fault terminations`); restored and rebuilt, it passes. `agc_driver_pixel_interlock` passes with main's recompiler on this GPU, so only the graphics test shows the change here. - 46 related GPU tests (`agc_driver_bda*`, `pixel*`, `vertex_clip*`, `sample_mask*`, `alpha_to_coverage*`, `agc_shader_*`, `agc_spirv*`, serial): 46 of 46 pass. Non-GPU suite (837 tests): 830 pass; the 7 timeouts under load (6 `conventions_function_bodies*`, `hardware_oracle_compare` at 19 s of its 20 s) pass serially. `tools/check_conventions.py --base origin/main` and `git diff origin/main --check` pass. The full build fails only on the known 64 KiB `alignas` test (#6452/#6478). - Not checked: AMD (the PR's target, so `agc_driver_pixel_interlock` on the RDNA 2 iGPU is not re-run here), Intel, Linux, and any title run. Written with Claude Code assistance (validation by a subagent, reviewed in this session).
adriadam10 commented 2026-10-16 11:17:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-16T11:17:12Z.

Review: APPROVED


Re-checked on current main (rebased, build + agc_driver*/agc_shader* ctest). The recompiler change and the device enablement look right, and tezzgod74's and Lerrylore's Windows runs cover the AMD behaviour.

agc_driver_graphics still fails on this head (tezzgod74's and screamm's runs: "needs shaderClipDistance"), caused by the PR's own new test code. I pushed two commits to your branch:

  • test(agc): give the vertex terminate test the ClipDistance capability: the vertex recompile in Graphics.cpp (vertexWords) was missing CapabilityClipDistance.
  • test(agc): keep the recompiled words alive in the terminate tests: terminated and vertexWords held a span into the temporary RecompileResult; they now use spirv.Copy().

agc_driver_graphics, agc_driver_pixel_interlock and agc_shader_device_profile pass after that. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5547053399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5804#pullrequestreview-5547053399). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-16T11:17:12Z. **Review:** APPROVED --- Re-checked on current main (rebased, build + `agc_driver*`/`agc_shader*` ctest). The recompiler change and the device enablement look right, and tezzgod74's and Lerrylore's Windows runs cover the AMD behaviour. `agc_driver_graphics` still fails on this head (tezzgod74's and screamm's runs: "needs shaderClipDistance"), caused by the PR's own new test code. I pushed two commits to your branch: - `test(agc): give the vertex terminate test the ClipDistance capability`: the vertex recompile in `Graphics.cpp` (`vertexWords`) was missing `CapabilityClipDistance`. - `test(agc): keep the recompiled words alive in the terminate tests`: `terminated` and `vertexWords` held a span into the temporary `RecompileResult`; they now use `spirv.Copy()`. `agc_driver_graphics`, `agc_driver_pixel_interlock` and `agc_shader_device_profile` pass after that. Merging once CI is green.
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!5804
No description provided.