fix(shader): drop vector stores through TYPE 2/3 and FORMAT 0 buffer V#s as measured #10827

Closed
cgrd wants to merge 1 commit from upstream-pr/10827 into main
cgrd commented 2026-10-25 03:14:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by cgrd on 2026-10-25T03:14:10Z.


What

A buffer V# with TYPE (word 3 bits 30-31) not 0 throws buffer descriptor uses an unsupported type for any access. Puyo Puyo Tetris 2's fill kernel stores through an image T# left in its buffer slot (02100b00 c3c00000 010dc1df 91b00fac, TYPE 2, FORMAT 0), so it stops right after the window opens (#3709).

Measured on a PS5 (CFI-1115B, fw 12.20) with a native test app, one TYPE 0 control per launch:

  • TYPE 2/3, FORMAT 0 or valid: buffer_store_dword and buffer_store_format_x write nothing and don't fault, also with that exact V# and its unmapped base.
  • TYPE 2/3 loads and GLC atomics write nothing but leave the destination VGPR unchanged.
  • TYPE 0, FORMAT 0: loads return 0, stores write nothing.
  • TYPE 1: GPU page fault for every load, store and atomic.

Now a buffer a PS5 shader only stores to through TYPE 2/3, and vector accesses through TYPE 0 FORMAT 0, bind as a null V#. TYPE 1, TYPE 2/3 loads and atomics, tbuffer_*, scalar loads, FORMAT above 77, GCN shaders and run-time-loaded V#s still throw (debt entry in shader.md). For #6412/#7689: those loads don't fault on the console.

Tested

Linux, RX 9070 XT. main 52a8bed576 vs this PR 052f7aa4cb.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R 'agc_driver_buffer_descriptor_runtime|agc_driver_draw_unsupported_buffer_type' -V

The existing 4 tests pass on main and here, with the layer loaded in both (7 insertions each) and 0 VUIDs. The new DisabledDescriptors case passes here and fails on main with buffer specialization has an unsupported format.

Puyo Puyo Tetris 2 (PPSA01937): main stops at the V# above; this PR gets past it to sceRemoteplayInitialize: invalid argument (null heap, separate PR). With that fix too it boots, reaches the title at 10 s and plays a Solo Versus match at 59.9 FPS.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes #3709
  • Unblocks: PPSA01937 #6421 (with the sceRemoteplayInitialize null heap fix)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.5, Linux 7.3 (CachyOS)
  • AI-assisted: yes

🤖 Generated with Claude Code

https://claude.ai/code/session_01XhaLK5vSDdSUHwgXZHWpcR

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5001404207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10827). Originally posted by [cgrd](https://github.com/cgrd) on 2026-10-25T03:14:10Z. --- ### What A buffer V# with TYPE (word 3 bits 30-31) not 0 throws `buffer descriptor uses an unsupported type` for any access. Puyo Puyo Tetris 2's fill kernel stores through an image T# left in its buffer slot (`02100b00 c3c00000 010dc1df 91b00fac`, TYPE 2, FORMAT 0), so it stops right after the window opens (#3709). Measured on a PS5 (CFI-1115B, fw 12.20) with a native test app, one TYPE 0 control per launch: * TYPE 2/3, FORMAT 0 or valid: `buffer_store_dword` and `buffer_store_format_x` write nothing and don't fault, also with that exact V# and its unmapped base. * TYPE 2/3 loads and GLC atomics write nothing but leave the destination VGPR unchanged. * TYPE 0, FORMAT 0: loads return 0, stores write nothing. * TYPE 1: GPU page fault for every load, store and atomic. Now a buffer a PS5 shader only stores to through TYPE 2/3, and vector accesses through TYPE 0 FORMAT 0, bind as a null V#. TYPE 1, TYPE 2/3 loads and atomics, `tbuffer_*`, scalar loads, FORMAT above 77, GCN shaders and run-time-loaded V#s still throw (debt entry in `shader.md`). For #6412/#7689: those loads don't fault on the console. ### 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. --> Linux, RX 9070 XT. `main` 52a8bed576 vs this PR 052f7aa4cb. ``` ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \ ctest --test-dir build -R 'agc_driver_buffer_descriptor_runtime|agc_driver_draw_unsupported_buffer_type' -V ``` The existing 4 tests pass on `main` and here, with the layer loaded in both (7 insertions each) and 0 VUIDs. The new `DisabledDescriptors` case passes here and fails on `main` with `buffer specialization has an unsupported format`. Puyo Puyo Tetris 2 (PPSA01937): `main` stops at the V# above; this PR gets past it to `sceRemoteplayInitialize: invalid argument` (null heap, separate PR). With that fix too it boots, reaches the title at 10 s and plays a Solo Versus match at 59.9 FPS. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: Fixes #3709 - [x] Unblocks: PPSA01937 #6421 (with the `sceRemoteplayInitialize` null heap fix) - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.5, Linux 7.3 (CachyOS) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XhaLK5vSDdSUHwgXZHWpcR
MarcZX10 commented 2026-10-25 03:16:40 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


I reviewed exact head 89ec4ebcac6df61492d2b1058d7b5c96761ca199 and the descriptor regression. The PS5 evidence for raw buffer_store_dword and buffer_store_format_x is useful, but the new predicate applies more broadly than those measured operations.

disabledBufferDescriptor() accepts every TYPE 2/3 descriptor with !buffer.read and any format up through Format32_32_32_32Float. disabledBufferAccesses() rules out typed, scalar, atomic and aliased accesses, but it does not constrain the remaining store width or format. As written, an otherwise-untyped vector store through an unmeasured multi-component format is also converted to a null descriptor. The PR's debt entry says multi-dword stores are assumed to behave like the one-dword cases, so those paths are explicitly not measured.

Please either restrict nulling to the exact access forms covered by the console measurements and keep the unmeasured vector forms throwing, or add console-derived evidence and regression cases for the broader formats/widths this predicate disables. The current Linux/Vulkan validation and red/green title test support the reported case, but do not cover those other store forms.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641316293 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10827#pullrequestreview-5641316293). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T03:16:40Z. **Review:** CHANGES_REQUESTED --- I reviewed exact head `89ec4ebcac6df61492d2b1058d7b5c96761ca199` and the descriptor regression. The PS5 evidence for raw `buffer_store_dword` and `buffer_store_format_x` is useful, but the new predicate applies more broadly than those measured operations. `disabledBufferDescriptor()` accepts every TYPE 2/3 descriptor with `!buffer.read` and any format up through `Format32_32_32_32Float`. `disabledBufferAccesses()` rules out typed, scalar, atomic and aliased accesses, but it does not constrain the remaining store width or format. As written, an otherwise-untyped vector store through an unmeasured multi-component format is also converted to a null descriptor. The PR's debt entry says multi-dword stores are assumed to behave like the one-dword cases, so those paths are explicitly not measured. Please either restrict nulling to the exact access forms covered by the console measurements and keep the unmeasured vector forms throwing, or add console-derived evidence and regression cases for the broader formats/widths this predicate disables. The current Linux/Vulkan validation and red/green title test support the reported case, but do not cover those other store forms.

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