feat(shader): serialize the split state of a recompile request #25576

Merged
Remi-Bon merged 1 commit from upstream-pr/25576 into main 2026-11-27 17:38:21 +00:00
Remi-Bon commented 2026-11-22 09:37:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Remi-Bon on 2026-11-22T09:37:39Z.


What

Requests for split table call parts carry a split state plan (RecompileRequest::context.splitState). RequestSerializer refused them, so the failure report of a refused part had no RecompileRequest to replay, and a dumped part request could not be loaded by agc_shader_replay. Serialization version 64 writes the plan after the subgroup flag (before the optional emulated-barycentrics flag), and failure reports now always carry the request. Older versions read an empty plan.

Note: #23244 and #23811 also move the format to version 64; whichever lands second renumbers.

Tested

Windows 11 Pro 26300, RX 9070.

  • request_serializer: plan round trip, truncation of the plan, version 63 bytes read an empty plan, legacy conversions go through version 63.
  • agc_shader_memory: legacy fixtures strip the empty plan.
  • 77 tests matching the serializer, shader memory, prepared shaders, disk cache, replay, BDA contracts, control flow, graphics and split table call suites pass.
  • GPU gate, ctest --test-dir build -R "request_serializer|split_table|shader_memory" -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, validation layer 1.4.363: main 0e31514b2d and this branch both pass 9/9, the loader inserts the layer, no was not found, no VUID- in either log.
  • PPSA01317, with the same serializer change on a local tree: a refused split part of 0x120aed7f00 was dumped and replayed offline with agc_shader_replay --prepare.

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, driver 32.0.32029.2010, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5437734228 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25576). Originally posted by [Remi-Bon](https://github.com/Remi-Bon) on 2026-11-22T09:37:39Z. --- ### What Requests for split table call parts carry a split state plan (`RecompileRequest::context.splitState`). `RequestSerializer` refused them, so the failure report of a refused part had no `RecompileRequest` to replay, and a dumped part request could not be loaded by `agc_shader_replay`. Serialization version 64 writes the plan after the subgroup flag (before the optional emulated-barycentrics flag), and failure reports now always carry the request. Older versions read an empty plan. Note: #23244 and #23811 also move the format to version 64; whichever lands second renumbers. ### Tested Windows 11 Pro 26300, RX 9070. - `request_serializer`: plan round trip, truncation of the plan, version 63 bytes read an empty plan, legacy conversions go through version 63. - `agc_shader_memory`: legacy fixtures strip the empty plan. - 77 tests matching the serializer, shader memory, prepared shaders, disk cache, replay, BDA contracts, control flow, graphics and split table call suites pass. - GPU gate, `ctest --test-dir build -R "request_serializer|split_table|shader_memory" -V` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`, validation layer 1.4.363: `main` 0e31514b2d and this branch both pass 9/9, the loader inserts the layer, no `was not found`, no `VUID-` in either log. - PPSA01317, with the same serializer change on a local tree: a refused split part of `0x120aed7f00` was dumped and replayed offline with `agc_shader_replay --prepare`. ### 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, driver 32.0.32029.2010, Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-22 10:03:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T10:03:04Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the review evidence supports merging.

What I ran

Reviewed head c67183079b398ea18f9329d07a1ad9bd3a9e88f1 using the prepared diff and the pinned repo_read.py reader. No build or tests were run.

Results

Check Result Note
Serializer and replay logic passed Versioned split state round trip is consistent
Tests not run Author-reported results were not independently verified

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full text of core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded because it was too large; its changed hunks were reviewed in diff.patch. Build and test results, GPU behavior, and replay behavior described in the PR are author-reported and were not run here. No claims are made about uninspected code outside the targeted serializer, replay, and split-state references.

Files read: core/shader/recompiler/ControlFlow/include/ControlFlow/RequestSerializer.hpp, core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp, and core/shader/recompiler/Recompiler.cpp, plus the prepared review description, commits, manifest, and diff. Files reviewed per manifest: 5; full text read: 3. core/shader/recompiler/tests/RequestSerializerTests.cpp and core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp full texts were not read; only the latter was excluded from review/files/.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6011611734 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/25576#pullrequestreview-6011611734). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T10:03:04Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the review evidence supports merging. ## What I ran Reviewed head `c67183079b398ea18f9329d07a1ad9bd3a9e88f1` using the prepared diff and the pinned `repo_read.py` reader. No build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Serializer and replay logic | passed | Versioned split state round trip is consistent | | Tests | not run | Author-reported results were not independently verified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The full text of `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was excluded because it was too large; its changed hunks were reviewed in `diff.patch`. Build and test results, GPU behavior, and replay behavior described in the PR are author-reported and were not run here. No claims are made about uninspected code outside the targeted serializer, replay, and split-state references. Files read: `core/shader/recompiler/ControlFlow/include/ControlFlow/RequestSerializer.hpp`, `core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp`, and `core/shader/recompiler/Recompiler.cpp`, plus the prepared review description, commits, manifest, and diff. Files reviewed per manifest: 5; full text read: 3. `core/shader/recompiler/tests/RequestSerializerTests.cpp` and `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` full texts were not read; only the latter was excluded from `review/files/`. ## To get this to a good state Nothing is required.
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!25576
No description provided.