fix(agc): capture every descriptor set a split table call part declares #28388

Open
Remi-Bon wants to merge 2 commits from upstream-pr/28388 into main
Remi-Bon commented 2026-11-30 11:00:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Remi-Bon on 2026-11-30T11:00:12Z.


Requested by Chef · project thread

What

APS5_DUMP_COMPUTE_PIPELINES wrote a compute pipeline's extra descriptor sets only for workgroup memory and the scratch pool. A split table call part also declares the split state at set 3, binding 0 (SplitStateAbi::DescriptorSet), and its pipeline layout gives sets 1 and 2 the same storage buffer layout. The capture left those sets out, so agc_compute_pipeline_replay could not build any split part: vkCreateComputePipelines returned VK_ERROR_INITIALIZATION_FAILED, and the validation layer reported VUID-VkComputePipelineCreateInfo-layout-07988 for split_state.

The capture now writes every set after the resource set as the pipeline layout declares it: a storage buffer at binding 0 where the layout has one, an empty set where it passes VK_NULL_HANDLE.

Tested

  • Windows 11, MinGW Release build with -DANYPS5_ENABLE_SPIRV_TOOLS=ON, AMD Radeon RX 9070.
  • agc_driver_split_table_call_driver_gpu_rounds run with APS5_DUMP_COMPUTE_PIPELINES writes 5 captures. Each was replayed with agc_compute_pipeline_replay and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:
    • main: 5 of 5 fail with VUID-VkComputePipelineCreateInfo-layout-07988 and Vulkan result -3;
    • this PR: 5 of 5 build (65 to 81 ms), no VUID-.
  • New CTest agc_compute_pipeline_capture_split_run (needs SPIRV-Tools, like agc_compute_pipeline_capture_run, which now takes the expected pass line as PASSED): runs the split table call driver test with capture on, then replays every capture. With the fix reverted it fails (Captured pipeline replay failed: 1); with it, both capture run tests pass. Run with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer: the layer is inserted in the fixture and in each replay, no VUID-.
  • Gran Turismo 7 (PPSA01317): the 22 split parts captured over 150,000 SPIR-V words also failed with 07988 on main. With split_state added, one of them (221,802 words) replays in 27.3 s of pipeline_create.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9070, AMD driver 2.0.416 (Vulkan 1.4.359), Windows 11
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes
    • Compute pipeline capture now records descriptor-set layouts consistently, including empty layouts. This improves handling of pipelines with varying descriptor-set configurations.
  • Tests
    • Added coverage for split-table-call compute pipeline capture runs, with checks for expected output and a timeout. Tests are skipped when a usable Vulkan device is unavailable.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5563917642 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28388). Originally posted by [Remi-Bon](https://github.com/Remi-Bon) on 2026-11-30T11:00:12Z. --- <!-- claude-projects-attribution --> _Requested by **Chef** · [project thread](https://claude.ai/code/project/chan_017sQSTsHGgF2wSkWdFfYD5V?thread=cmsg_017sQSTsHGgF2wSkWdFfYD5VVhNrDoNgAoF28SaNCDhuN4)_ ### What `APS5_DUMP_COMPUTE_PIPELINES` wrote a compute pipeline's extra descriptor sets only for workgroup memory and the scratch pool. A split table call part also declares the split state at set 3, binding 0 (`SplitStateAbi::DescriptorSet`), and its pipeline layout gives sets 1 and 2 the same storage buffer layout. The capture left those sets out, so `agc_compute_pipeline_replay` could not build any split part: `vkCreateComputePipelines` returned `VK_ERROR_INITIALIZATION_FAILED`, and the validation layer reported `VUID-VkComputePipelineCreateInfo-layout-07988` for `split_state`. The capture now writes every set after the resource set as the pipeline layout declares it: a storage buffer at binding 0 where the layout has one, an empty set where it passes `VK_NULL_HANDLE`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Windows 11, MinGW Release build with `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, AMD Radeon RX 9070. - `agc_driver_split_table_call_driver_gpu_rounds` run with `APS5_DUMP_COMPUTE_PIPELINES` writes 5 captures. Each was replayed with `agc_compute_pipeline_replay` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: - `main`: 5 of 5 fail with `VUID-VkComputePipelineCreateInfo-layout-07988` and `Vulkan result -3`; - this PR: 5 of 5 build (65 to 81 ms), no `VUID-`. - New CTest `agc_compute_pipeline_capture_split_run` (needs SPIRV-Tools, like `agc_compute_pipeline_capture_run`, which now takes the expected pass line as `PASSED`): runs the split table call driver test with capture on, then replays every capture. With the fix reverted it fails (`Captured pipeline replay failed: 1`); with it, both capture run tests pass. Run with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`: the layer is inserted in the fixture and in each replay, no `VUID-`. - Gran Turismo 7 (PPSA01317): the 22 split parts captured over 150,000 SPIR-V words also failed with 07988 on `main`. With `split_state` added, one of them (221,802 words) replays in 27.3 s of `pipeline_create`. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9070, AMD driver 2.0.416 (Vulkan 1.4.359), Windows 11 - [x] AI-assisted: yes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Compute pipeline capture now records descriptor-set layouts consistently, including empty layouts. This improves handling of pipelines with varying descriptor-set configurations. * **Tests** * Added coverage for split-table-call compute pipeline capture runs, with checks for expected output and a timeout. Tests are skipped when a usable Vulkan device is unavailable. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-11-30 11:03:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T11:03:15Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the reviewed code and supplied validation evidence support the fix.

What I ran

Reviewed head b08a5d2605ce7c509197258727a44c6857aac93d. No commands or tests were run in this review session; repo_read.py was used to inspect the prepared diff and targeted source ranges.

Results

Check Result Note
Diff and targeted source review passed Capture layout mirrors declared pipeline set layouts
Automated checks in this review not run Author-reported test results were not rerun

Findings

Blocking

None.

Non-blocking

None.

Not verified

The description reports successful Windows 11/RX 9070 build and Vulkan replay checks, but these were not run here. Reviewed files: core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp, core/libs/prx/libSceAgcDriver/tests/ComputePipelineCaptureRun.cmake, and core/libs/prx/libSceAgcDriver/tests/cmake/agc_compute_pipeline_capture_tests.cmake. All three files listed as reviewed in the manifest were read. The changed files excluded from the review folder due to size were read through the repository reader; no changed file was left unread. Excluded-by-rule files: none listed in the prepared file inventory.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6110980983 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28388#pullrequestreview-6110980983). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-30T11:03:15Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the reviewed code and supplied validation evidence support the fix. ## What I ran Reviewed head `b08a5d2605ce7c509197258727a44c6857aac93d`. No commands or tests were run in this review session; `repo_read.py` was used to inspect the prepared diff and targeted source ranges. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Capture layout mirrors declared pipeline set layouts | | Automated checks in this review | not run | Author-reported test results were not rerun | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The description reports successful Windows 11/RX 9070 build and Vulkan replay checks, but these were not run here. Reviewed files: `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp`, `core/libs/prx/libSceAgcDriver/tests/ComputePipelineCaptureRun.cmake`, and `core/libs/prx/libSceAgcDriver/tests/cmake/agc_compute_pipeline_capture_tests.cmake`. All three files listed as reviewed in the manifest were read. The changed files excluded from the review folder due to size were read through the repository reader; no changed file was left unread. Excluded-by-rule files: none listed in the prepared file inventory. ## To get this to a good state Nothing is required.
Plyxen commented 2026-12-03 10:42:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T10:42:38Z.

Review: APPROVED


I read the diff at b08a5d2605. Windows 11, GCC 15.2, merged into main at b97867d3ce6 together with other open PRs (so not an isolated build), built with ANYPS5_ENABLE_SPIRV_TOOLS=ON, with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).

  • agc_compute_pipeline_capture_run and _split_run: pass on both GPUs without a VUID- line.
  • Control (the VulkanDevice.cpp change taken out): on the Radeon _split_run fails with "Captured pipeline replay failed: 1" and VUID-VkComputePipelineCreateInfo-layout-07988. On the RTX 5080 it still passes.

Not checked: a capture from a title.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6168182962 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28388#pullrequestreview-6168182962). Originally posted by [Plyxen](https://github.com/Plyxen) on 2026-12-03T10:42:38Z. **Review:** APPROVED --- I read the diff at `b08a5d2605`. Windows 11, GCC 15.2, merged into `main` at `b97867d3ce6` together with other open PRs (so not an isolated build), built with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1` and `VK_LAYER_KHRONOS_validation` on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2). - `agc_compute_pipeline_capture_run` and `_split_run`: pass on both GPUs without a `VUID-` line. - Control (the `VulkanDevice.cpp` change taken out): on the Radeon `_split_run` fails with "Captured pipeline replay failed: 1" and `VUID-VkComputePipelineCreateInfo-layout-07988`. On the RTX 5080 it still passes. Not checked: a capture from a title. AI-assisted: yes (Claude Code)
ligmaSec commented 2026-12-03 15:25:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:25:48Z.

Review: COMMENTED


The capture codec, split-table driver and GPU-rounds cases, and GCN scalar-buffer control all passed on main and the patched tree. I used the same Linux lavapipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Both control logs show layer insertion with no missing-layer diagnostic or VUID- entry.

I also enabled SPIRV-Tools and ran the capture-and-replay fixtures. The common case replayed two captures on each tree. The added split case replayed five captures on the patched tree. The CMake fixture captures its subprocess logs internally, so the validation log comparison above comes from the direct controls.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6172822984 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28388#pullrequestreview-6172822984). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T15:25:48Z. **Review:** COMMENTED --- The capture codec, split-table driver and GPU-rounds cases, and GCN scalar-buffer control all passed on main and the patched tree. I used the same Linux lavapipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Both control logs show layer insertion with no missing-layer diagnostic or `VUID-` entry. I also enabled SPIRV-Tools and ran the capture-and-replay fixtures. The common case replayed two captures on each tree. The added split case replayed five captures on the patched tree. The CMake fixture captures its subprocess logs internally, so the validation log comparison above comes from the direct controls. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/28388:upstream-pr/28388'
git switch 'upstream-pr/28388'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/28388'
git switch 'upstream-pr/28388'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/28388'
git switch 'upstream-pr/28388'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/28388'
git switch 'main'
git merge --squash 'upstream-pr/28388'
git switch 'main'
git merge --ff-only 'upstream-pr/28388'
git switch 'main'
git merge 'upstream-pr/28388'
git push origin 'main'
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!28388
No description provided.