fix(shader): read zeros through a V# with DATA_FORMAT INVALID #21977

Merged
B-Howell merged 3 commits from upstream-pr/21977 into main 2026-11-20 09:58:02 +00:00
B-Howell commented 2026-11-17 00:26:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-17T00:26:13Z.


What

A formatted buffer access (buffer_load_format_*, buffer_store_format_*) through a V# whose data format is 0 made DescriptorBindingBuilder::Prepare throw buffer specialization has an unsupported format whenever the descriptor was known. On GCN that format is INVALID, and GcnBufferWord3 maps every GCN DATA_FORMAT 0 to format 0.

AMD's GCN3 ISA guide (rev 1.1) defines what such a V# does:

  • Section 8.1.4: "The resource's data format must not be INVALID; that format has special meaning (unbound resource)".
  • Table 8.9, note 1: "A resource set to all zeros acts as an unbound texture or buffer (return 0,0,0,0)."
  • Section 8.1.5 (out-of-range accesses): reads return zero and writes "do not write anything".

shadPS4 does the same at 143b58aa48 (LowerBufferFormatInst, src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp): when data_format == AmdGpu::DataFormat::FormatInvalid, a load is replaced with CompositeConstruct(0, 0, 0, 0) and a store is invalidated.

The emitted shader already handles format 0 this way. In formatSwitch (SpirvRuntimeBuffer.cpp), loads and GPU-descriptor stores test format == 0 directly and return zeros or write nothing; a store without a GPU descriptor reaches the switch's default label, which also writes nothing. Only the builder's extra known && format == 0 refusal stood in the way, so this PR removes it. Formats above Format32_32_32_32Float are still refused. Alignment for format 0 stays at the buffer's typed alignment, because nothing is read or written.

Two other paths still treat format 0 as an error, and the debt fragment records them: a V# the shader loads from memory at run time (it records an InvalidDescriptor fault), and a formatted access whose word 3 is a constant (it throws). Neither is reached by the title below.

The test GcnInvalidBufferFormat.cpp dispatches a GCN compute shader that runs buffer_load_format_xyzw and buffer_store_format_xyzw through a user-data V#. A control V# (DATA_FORMAT 14, NUM_FORMAT 4) must load the resident words and store the new ones. For DATA_FORMAT 0 with each NUM_FORMAT 0-7, the load must return zeros and the buffer must stay unchanged.

Tested

Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release, NVIDIA GeForce RTX 4080 SUPER (driver 621.14). Run with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, using LunarG layer 1.4.363.1 through VK_ADD_LAYER_PATH:
ctest -R '^agc_driver_(gcn_invalid_buffer_format|gcn_buffer_format_lookup|buffer_format|runtime_formatted_store.*|null_buffer_substitutes|buffer_descriptor_runtime|buffer_load_store.*)$' -V

  • main + the new test: 15/16 pass. agc_driver_gcn_invalid_buffer_format fails with ShaderRecompiler::Recompile: buffer specialization has an unsupported format, the same message the title stops on.

  • This change: 16/16 pass.

  • Validation layer: both logs contain 16 Insert instance layer "VK_LAYER_KHRONOS_validation" lines, no was not found but was requested by env var VK_INSTANCE_LAYERS, no failed to load and no VUID-.

  • Build tree: the tests ran in my Bloodborne tree. Its DescriptorBindingBuilder.cpp, SpirvRuntimeBuffer.cpp and Recompiler.cpp are identical to main's.

  • Title: Bloodborne CUSA00900 01.09 (my own copy), on main plus #17105, #17711, #20156, #21944 and #21969. Before this change, 3 of 3 runs stopped about 1.7 s in at compute shader 0x2d1f00900: buffer specialization has an unsupported format. Its sixth dispatch binds V# words 3983bd40 00040002 00000001 00001f2e: NUM_FORMAT 1, DATA_FORMAT 0.

    • After (1 run, stopped at 68 s): no unsupported format. The title kept dispatching 0x2d1f00900, presented about 18 frames a second for a minute, and reached the next stop at 63 s, which is unrelated to this change. The game's own Dantelion2 Panic reported PthreadMutex.cpp(130) Logical Error. Invalid mutex.(EINVAL) on a new Mv_AudioPlayThread.
  • Tested by @tablefrogpillow on d5cbab44: passes with 0 VUID- on RX Vega 56 (RADV gfx900, GCN5), the Ryzen 7000 iGPU (RADV gfx1036, RDNA2) and RX 7900 GRE (RADV gfx1100, RDNA3). It failed on lavapipe: the control V# load returned the stored words 0x11111111 0x22222222 0x33333333 0x44444444. The cause was the test, not the change: all 64 invocations loaded and stored the same four words, and lavapipe runs the workgroup's subgroups one after another, so later invocations read what earlier ones had stored.

  • 35a9c44c9ce (the test dispatches one invocation): same machine and layer, ctest -R '^agc_driver_gcn_invalid_buffer_format$' -V. Change: passes 5 of 5 (--repeat until-fail:5). Control (main's DescriptorBindingBuilder.cpp + this test): fails with buffer specialization has an unsupported format. Both logs: Insert instance layer "VK_LAYER_KHRONOS_validation" on every run, no was not found but was requested by env var VK_INSTANCE_LAYERS, no failed to load, no VUID-. Not rerun on lavapipe here.

  • Tested by @tablefrogpillow on 35a9c44c: passes on lavapipe with 0 VUID-, and still passes on the Ryzen 7000 iGPU (RADV gfx1036, RDNA2) and RX 7900 GRE (RADV gfx1100, RDNA3).

  • 3b0e22c1 (adds <optional> and <exception> to the test, from review): same Windows machine and environment, -R '^agc_driver_gcn_invalid_buffer_format$'. This change 3/3 pass; control (DescriptorBindingBuilder.cpp from the base 78880af3f70) fails with buffer specialization has an unsupported format. Every log has 1 Insert instance layer "VK_LAYER_KHRONOS_validation", no was not found, no failed to load and no VUID-.

  • Tested by @domx4q on 3b0e22c1 (merged onto main f0c01bc69d): Arch Linux, GCC 16.2.1, RTX 4090 (Ada), driver 620.70.06, Khronos layer 1.4.363.1, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, same ctest pattern: 16 of 16 pass (main 15 of 15; agc_driver_gcn_invalid_buffer_format is new). No was not found, 0 VUID- on both.

  • Tested by @Jitheswar on 3b0e22c1 (merged onto main 223cc23237): Arch Linux, GCC 16.2.1, Khronos layer 1.4.363, Intel UHD Raptor Lake-S (Mesa 26.2.5 ANV) and RTX 3050 Laptop (GA107, 615.78.08). On both: 16 of 16 pass (main 15 of 15; agc_driver_gcn_invalid_buffer_format is new), the layer loads in every run, no was not found, 0 VUID- (comment).

python3 tools/check_conventions.py --base origin/main passes. tools/debt_fold.py --check stops on a clash between two libSceLibreSsl3 fragments that is already on main, not on this fragment. tools/pr_overlap.py --branch reports #21199 (RDNA V# TYPE 2/3) as a textual conflict on the same line. It adds an RDNA-only condition in front of the same check, so the two compose. It could not compare 16 conflicting PRs that touch DescriptorBindingBuilder.cpp: #5371 #5609 #6280 #6412 #7642 #7689 #9852 #9897 #10193 #13928 #13929 #14032 #14944 #20030 #20130 #20248. I read their diffs. None changes this refusal. #14944 skips format 0 in its own read-extent helper, which is consistent with this change.

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: CUSA00900 Bloodborne #3094
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 621.14, Windows 11 Pro 10.0.26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5347854419 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21977). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-17T00:26:13Z. --- ### What A formatted buffer access (`buffer_load_format_*`, `buffer_store_format_*`) through a V# whose data format is 0 made `DescriptorBindingBuilder::Prepare` throw `buffer specialization has an unsupported format` whenever the descriptor was known. On GCN that format is `INVALID`, and `GcnBufferWord3` maps every GCN `DATA_FORMAT` 0 to format 0. AMD's GCN3 ISA guide (rev 1.1) defines what such a V# does: - Section 8.1.4: "The resource's data format must not be INVALID; that format has special meaning (unbound resource)". - Table 8.9, note 1: "A resource set to all zeros acts as an unbound texture or buffer (return 0,0,0,0)." - Section 8.1.5 (out-of-range accesses): reads return zero and writes "do not write anything". shadPS4 does the same at `143b58aa48` (`LowerBufferFormatInst`, `src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp`): when `data_format == AmdGpu::DataFormat::FormatInvalid`, a load is replaced with `CompositeConstruct(0, 0, 0, 0)` and a store is invalidated. The emitted shader already handles format 0 this way. In `formatSwitch` (`SpirvRuntimeBuffer.cpp`), loads and GPU-descriptor stores test `format == 0` directly and return zeros or write nothing; a store without a GPU descriptor reaches the switch's default label, which also writes nothing. Only the builder's extra `known && format == 0` refusal stood in the way, so this PR removes it. Formats above `Format32_32_32_32Float` are still refused. Alignment for format 0 stays at the buffer's typed alignment, because nothing is read or written. Two other paths still treat format 0 as an error, and the debt fragment records them: a V# the shader loads from memory at run time (it records an `InvalidDescriptor` fault), and a formatted access whose word 3 is a constant (it throws). Neither is reached by the title below. The test `GcnInvalidBufferFormat.cpp` dispatches a GCN compute shader that runs `buffer_load_format_xyzw` and `buffer_store_format_xyzw` through a user-data V#. A control V# (`DATA_FORMAT` 14, `NUM_FORMAT` 4) must load the resident words and store the new ones. For `DATA_FORMAT` 0 with each `NUM_FORMAT` 0-7, the load must return zeros and the buffer must stay unchanged. ### Tested Windows 11 Pro 10.0.26300, WinLibs GCC 15.2.0 r7, Release, NVIDIA GeForce RTX 4080 SUPER (driver 621.14). Run with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, using LunarG layer 1.4.363.1 through `VK_ADD_LAYER_PATH`: `ctest -R '^agc_driver_(gcn_invalid_buffer_format|gcn_buffer_format_lookup|buffer_format|runtime_formatted_store.*|null_buffer_substitutes|buffer_descriptor_runtime|buffer_load_store.*)$' -V` - **`main` + the new test:** 15/16 pass. `agc_driver_gcn_invalid_buffer_format` fails with `ShaderRecompiler::Recompile: buffer specialization has an unsupported format`, the same message the title stops on. - **This change:** 16/16 pass. - **Validation layer:** both logs contain 16 `Insert instance layer "VK_LAYER_KHRONOS_validation"` lines, no `was not found but was requested by env var VK_INSTANCE_LAYERS`, no `failed to load` and no `VUID-`. - **Build tree:** the tests ran in my Bloodborne tree. Its `DescriptorBindingBuilder.cpp`, `SpirvRuntimeBuffer.cpp` and `Recompiler.cpp` are identical to `main`'s. - **Title:** Bloodborne CUSA00900 01.09 (my own copy), on `main` plus #17105, #17711, #20156, #21944 and #21969. Before this change, 3 of 3 runs stopped about 1.7 s in at `compute shader 0x2d1f00900: buffer specialization has an unsupported format`. Its sixth dispatch binds V# words `3983bd40 00040002 00000001 00001f2e`: `NUM_FORMAT` 1, `DATA_FORMAT` 0. - After (1 run, stopped at 68 s): no `unsupported format`. The title kept dispatching `0x2d1f00900`, presented about 18 frames a second for a minute, and reached the next stop at 63 s, which is unrelated to this change. The game's own `Dantelion2 Panic` reported `PthreadMutex.cpp(130) Logical Error. Invalid mutex.(EINVAL)` on a new `Mv_AudioPlayThread`. - **Tested by @tablefrogpillow on `d5cbab44`:** passes with 0 `VUID-` on RX Vega 56 (RADV gfx900, GCN5), the Ryzen 7000 iGPU (RADV gfx1036, RDNA2) and RX 7900 GRE (RADV gfx1100, RDNA3). It failed on lavapipe: the control V# load returned the stored words `0x11111111 0x22222222 0x33333333 0x44444444`. The cause was the test, not the change: all 64 invocations loaded and stored the same four words, and lavapipe runs the workgroup's subgroups one after another, so later invocations read what earlier ones had stored. - **`35a9c44c9ce` (the test dispatches one invocation):** same machine and layer, `ctest -R '^agc_driver_gcn_invalid_buffer_format$' -V`. Change: passes 5 of 5 (`--repeat until-fail:5`). Control (`main`'s `DescriptorBindingBuilder.cpp` + this test): fails with `buffer specialization has an unsupported format`. Both logs: `Insert instance layer "VK_LAYER_KHRONOS_validation"` on every run, no `was not found but was requested by env var VK_INSTANCE_LAYERS`, no `failed to load`, no `VUID-`. Not rerun on lavapipe here. - **Tested by @tablefrogpillow on `35a9c44c`:** passes on lavapipe with 0 `VUID-`, and still passes on the Ryzen 7000 iGPU (RADV gfx1036, RDNA2) and RX 7900 GRE (RADV gfx1100, RDNA3). - **`3b0e22c1` (adds `<optional>` and `<exception>` to the test, from review):** same Windows machine and environment, `-R '^agc_driver_gcn_invalid_buffer_format$'`. This change 3/3 pass; control (`DescriptorBindingBuilder.cpp` from the base `78880af3f70`) fails with `buffer specialization has an unsupported format`. Every log has 1 `Insert instance layer "VK_LAYER_KHRONOS_validation"`, no `was not found`, no `failed to load` and no `VUID-`. - **Tested by @domx4q on `3b0e22c1`** (merged onto main `f0c01bc69d`): Arch Linux, GCC 16.2.1, RTX 4090 (Ada), driver 620.70.06, Khronos layer 1.4.363.1, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, same ctest pattern: 16 of 16 pass (main 15 of 15; `agc_driver_gcn_invalid_buffer_format` is new). No `was not found`, 0 `VUID-` on both. - **Tested by @Jitheswar on `3b0e22c1`** (merged onto main `223cc23237`): Arch Linux, GCC 16.2.1, Khronos layer 1.4.363, Intel UHD Raptor Lake-S (Mesa 26.2.5 ANV) and RTX 3050 Laptop (GA107, 615.78.08). On both: 16 of 16 pass (main 15 of 15; `agc_driver_gcn_invalid_buffer_format` is new), the layer loads in every run, no `was not found`, 0 `VUID-` ([comment](https://github.com/boykopovar/AnyPS5/pull/21977#issuecomment-7012872940)). `python3 tools/check_conventions.py --base origin/main` passes. `tools/debt_fold.py --check` stops on a clash between two libSceLibreSsl3 fragments that is already on `main`, not on this fragment. `tools/pr_overlap.py --branch` reports #21199 (RDNA V# `TYPE` 2/3) as a textual conflict on the same line. It adds an RDNA-only condition in front of the same check, so the two compose. It could not compare 16 conflicting PRs that touch `DescriptorBindingBuilder.cpp`: #5371 #5609 #6280 #6412 #7642 #7689 #9852 #9897 #10193 #13928 #13929 #14032 #14944 #20030 #20130 #20248. I read their diffs. None changes this refusal. #14944 skips format 0 in its own read-extent helper, which is consistent with this change. ### 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: CUSA00900 Bloodborne #3094 - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 621.14, Windows 11 Pro 10.0.26300 - [x] AI-assisted: yes
MarcZX10 commented 2026-11-17 04:07:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T04:07:49Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

  • Head: 35a9c44c9cefd7d213201071391d27f979cbe985, base main.
  • No build and no test run in this review. Read-only inspection of the diff and the head through repo_read.py.
  • Commands:
python3 repo_read.py cat core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp 440 520
python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp 776 830
python3 repo_read.py search formatSwitch
python3 repo_read.py search InvalidDescriptor
python3 repo_read.py search GcnBufferWord3
python3 repo_read.py search BufferSpecializationFields
python3 repo_read.py search SetGcnGuestShaders
python3 repo_read.py search "tests/execution"
python3 repo_read.py search agcExecutionTestName core/libs/prx/libSceAgcDriver/CMakeLists.txt
python3 repo_read.py search "unsupported format"
  • Files read: GcnInvalidBufferFormat.cpp (new file, whole text from the diff), fix-shader-invalid-buffer-data-format.md (whole text from the diff), DescriptorBindingBuilder.cpp (the changed line and lines 440–520 at head; the rest not read).
  • Files excluded by rule: none.
  • Files reviewed per files.json: 3 of 3 read.

Results

Check Result Note
Build and run the new test not run No build in this review
Author-reported test runs not applicable Not reproduced here
Format 0 handling in the backend passed Read at head, not run
Test registration passed Glob names the executable from the file name
Comments in changed code passed None added

Findings

Blocking

None.

Non-blocking

  • The PR description says formatSwitch "has no case for 0, so its default branch returns zeros and writes nothing". The outcome is right, but the mechanism is different: the load path tests format == 0 directly (core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp:784), and only the store path without a GPU descriptor reaches the switch's default label (SpirvRuntimeBuffer.cpp:823–830). Suggest rewording the description to match. The removed refusal is at core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:487.
  • core/libs/prx/libSceAgcDriver/tests/execution/GcnInvalidBufferFormat.cpp:91 uses std::nullopt and :127 uses std::exception, but the file does not include <optional> or <exception>. It compiles today through other headers; the includes would make it self-contained.

Sources

Not verified

  • The test itself: not built or run here. The author's runs (15/16 on main plus the new test, 16/16 with the change, 5/5 repeats, and the lavapipe, RADV gfx900, gfx1036 and gfx1100 reports from the description) are not reproduced.
  • The hex words in the test's shader Code array and the V# word layout in Descriptor() were not decoded.
  • The description's claim that a formatted access whose V# word 3 is a constant with format 0 still throws: no matching message found at head. Not verified.
  • The description's claims about the ISA guide (section 8.1.4, table 8.9), tools/debt_fold.py --check, and tools/pr_overlap.py: not checked.
  • The debt fragment's heading ## add Unknown function info: a search of docs/dev/debt/changes for level-2 headings found nothing, so the heading convention is not verified.
  • Behaviour on PS4, PS5 (gfx1013), Windows and lavapipe: not checked here.

To get this to a good state

Nothing is required.

Optional: reword the formatSwitch sentence in the description and add the two includes to the test.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5932658441 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21977#pullrequestreview-5932658441). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T04:07:49Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran - Head: `35a9c44c9cefd7d213201071391d27f979cbe985`, base `main`. - No build and no test run in this review. Read-only inspection of the diff and the head through `repo_read.py`. - Commands: ``` python3 repo_read.py cat core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp 440 520 python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp 776 830 python3 repo_read.py search formatSwitch python3 repo_read.py search InvalidDescriptor python3 repo_read.py search GcnBufferWord3 python3 repo_read.py search BufferSpecializationFields python3 repo_read.py search SetGcnGuestShaders python3 repo_read.py search "tests/execution" python3 repo_read.py search agcExecutionTestName core/libs/prx/libSceAgcDriver/CMakeLists.txt python3 repo_read.py search "unsupported format" ``` - Files read: `GcnInvalidBufferFormat.cpp` (new file, whole text from the diff), `fix-shader-invalid-buffer-data-format.md` (whole text from the diff), `DescriptorBindingBuilder.cpp` (the changed line and lines 440–520 at head; the rest not read). - Files excluded by rule: none. - Files reviewed per `files.json`: 3 of 3 read. ## Results | Check | Result | Note | |---|---|---| | Build and run the new test | not run | No build in this review | | Author-reported test runs | not applicable | Not reproduced here | | Format 0 handling in the backend | passed | Read at head, not run | | Test registration | passed | Glob names the executable from the file name | | Comments in changed code | passed | None added | ## Findings **Blocking** None. **Non-blocking** - The PR description says `formatSwitch` "has no case for 0, so its default branch returns zeros and writes nothing". The outcome is right, but the mechanism is different: the load path tests `format == 0` directly (`core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp:784`), and only the store path without a GPU descriptor reaches the switch's default label (`SpirvRuntimeBuffer.cpp:823`–`830`). Suggest rewording the description to match. The removed refusal is at `core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:487`. - `core/libs/prx/libSceAgcDriver/tests/execution/GcnInvalidBufferFormat.cpp:91` uses `std::nullopt` and `:127` uses `std::exception`, but the file does not include `<optional>` or `<exception>`. It compiles today through other headers; the includes would make it self-contained. ## Sources - Changed check: [DescriptorBindingBuilder.cpp L487](https://github.com/boykopovar/AnyPS5/blob/35a9c44c9cefd7d213201071391d27f979cbe985/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L487) - Load and store refusal for format 0: [SpirvRuntimeBuffer.cpp L776–L830](https://github.com/boykopovar/AnyPS5/blob/35a9c44c9cefd7d213201071391d27f979cbe985/core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp#L776-L830) - Test registration by glob: [CMakeLists.txt L693–L706](https://github.com/boykopovar/AnyPS5/blob/35a9c44c9cefd7d213201071391d27f979cbe985/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L693-L706) ## Not verified - The test itself: not built or run here. The author's runs (15/16 on `main` plus the new test, 16/16 with the change, 5/5 repeats, and the lavapipe, RADV gfx900, gfx1036 and gfx1100 reports from the description) are not reproduced. - The hex words in the test's shader `Code` array and the V# word layout in `Descriptor()` were not decoded. - The description's claim that a formatted access whose V# word 3 is a constant with format 0 still throws: no matching message found at head. Not verified. - The description's claims about the ISA guide (section 8.1.4, table 8.9), `tools/debt_fold.py --check`, and `tools/pr_overlap.py`: not checked. - The debt fragment's heading `## add Unknown function info`: a search of `docs/dev/debt/changes` for level-2 headings found nothing, so the heading convention is not verified. - Behaviour on PS4, PS5 (gfx1013), Windows and lavapipe: not checked here. ## To get this to a good state Nothing is required. Optional: reword the `formatSwitch` sentence in the description and add the two includes to the test.
MarcZX10 commented 2026-11-17 06:05:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T06:05:58Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Head 3b0e22c112a028a63411a8bb937c91e30e6aa64b, base main. No build and no test run in this pass. Repository reads went through repo_read.py:

python3 repo_read.py search "formatSwitch" core/shader/recompiler
python3 repo_read.py search "known" core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp
python3 repo_read.py search "tests/execution" core/libs/prx/libSceAgcDriver
python3 repo_read.py search "SetGcnGuestShaders" core
python3 repo_read.py search "unsupported format" core/shader
python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp 776 830
python3 repo_read.py cat core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp 420 500

Files read: 3 of 3 in files.json under reviewed. The new test file and the debt note were read through the diff, since both are new and the diff shows them whole. DescriptorBindingBuilder.cpp was read at head lines 420–500 (of 855) and through the diff. Excluded by rule: none.

Results

Check Result Note
Diff and changed files passed 3 of 3 read
Format 0 in the emitter passed Handled in formatSwitch
Test discovery passed CMake globs tests/execution/*.cpp
Test run in this pass not run No build here
Hosted CI for this head not run Not visible in this pass
Repository precheck not run Not run in this pass

Findings

Blocking

None.

Non-blocking

  • core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:487: the removed check also refused a format 0 buffer whose word 3 is a constant (fields.known). The debt note at docs/dev/debt/changes/fix-shader-invalid-buffer-data-format.md:5 says that case "still throws". I found no other buffer refusal of format 0 in core/shader, so either that case now takes the zero path without a test, or the throw uses wording I did not search for. The new test only covers user-data V#s.

Sources

Not verified

  • Approval withheld. The required hosted checks for 3b0e22c1 were not visible in this pass, so the approval rules do not allow APPROVE. Approval can follow once they have passed.
  • Whether the PR author is MarcZX10 (the independent-reviewer rule). The author is not in the inputs.
  • The test results in the description (Windows, RTX 4080, lavapipe, RADV). These are author-reported. I did not run them.
  • The shadPS4 commit 143b58aa48 and the GCN3 ISA sections cited in the description. These are outside the repository.
  • The constant word 3 case: the debt note's claim that it "still throws" (see the non-blocking finding).
  • The overlap with the 16 open PRs that touch DescriptorBindingBuilder.cpp. The description reports it, and I did not repeat it.

To get this to a good state

Nothing is required. The optional point is the non-blocking finding above: add a constant word 3 format 0 case to the test, or correct the note at line 5 of the debt file.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933791301 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/21977#pullrequestreview-5933791301). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T06:05:58Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Head `3b0e22c112a028a63411a8bb937c91e30e6aa64b`, base `main`. No build and no test run in this pass. Repository reads went through `repo_read.py`: ``` python3 repo_read.py search "formatSwitch" core/shader/recompiler python3 repo_read.py search "known" core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp python3 repo_read.py search "tests/execution" core/libs/prx/libSceAgcDriver python3 repo_read.py search "SetGcnGuestShaders" core python3 repo_read.py search "unsupported format" core/shader python3 repo_read.py cat core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp 776 830 python3 repo_read.py cat core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp 420 500 ``` Files read: 3 of 3 in `files.json` under `reviewed`. The new test file and the debt note were read through the diff, since both are new and the diff shows them whole. `DescriptorBindingBuilder.cpp` was read at head lines 420–500 (of 855) and through the diff. Excluded by rule: none. ## Results | Check | Result | Note | | --- | --- | --- | | Diff and changed files | passed | 3 of 3 read | | Format 0 in the emitter | passed | Handled in `formatSwitch` | | Test discovery | passed | CMake globs `tests/execution/*.cpp` | | Test run in this pass | not run | No build here | | Hosted CI for this head | not run | Not visible in this pass | | Repository precheck | not run | Not run in this pass | ## Findings ### Blocking None. ### Non-blocking - `core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp:487`: the removed check also refused a format 0 buffer whose word 3 is a constant (`fields.known`). The debt note at `docs/dev/debt/changes/fix-shader-invalid-buffer-data-format.md:5` says that case "still throws". I found no other buffer refusal of format 0 in `core/shader`, so either that case now takes the zero path without a test, or the throw uses wording I did not search for. The new test only covers user-data V#s. ## Sources - [`formatSwitch`](https://github.com/boykopovar/AnyPS5/blob/3b0e22c112a028a63411a8bb937c91e30e6aa64b/core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp#L776-L830) - [`Prepare`, changed line](https://github.com/boykopovar/AnyPS5/blob/3b0e22c112a028a63411a8bb937c91e30e6aa64b/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L487) - [Execution test glob](https://github.com/boykopovar/AnyPS5/blob/3b0e22c112a028a63411a8bb937c91e30e6aa64b/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L695) ## Not verified - **Approval withheld.** The required hosted checks for `3b0e22c1` were not visible in this pass, so the approval rules do not allow APPROVE. Approval can follow once they have passed. - Whether the PR author is MarcZX10 (the independent-reviewer rule). The author is not in the inputs. - The test results in the description (Windows, RTX 4080, lavapipe, RADV). These are author-reported. I did not run them. - The shadPS4 commit `143b58aa48` and the GCN3 ISA sections cited in the description. These are outside the repository. - The constant word 3 case: the debt note's claim that it "still throws" (see the non-blocking finding). - The overlap with the 16 open PRs that touch `DescriptorBindingBuilder.cpp`. The description reports it, and I did not repeat it. ## To get this to a good state Nothing is required. The optional point is the non-blocking finding above: add a constant word 3 format 0 case to the test, or correct the note at line 5 of the debt file.
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!21977
No description provided.