fix(shader): read s_buffer_load through the 44-bit GCN V# base #22060

Merged
B-Howell merged 3 commits from upstream-pr/22060 into main 2026-11-19 22:19:43 +00:00
B-Howell commented 2026-11-17 03:44:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-17T03:44:37Z.


What

On PS4 (GCN) shaders, the descriptor walker read an s_buffer_load at the V#'s full 48-bit base. The emitted shader uses a 44-bit base instead: SpirvRuntimeBuffer.cpp and ResourceMaterializer.cpp clear word 1 bits [15:12] with GcnBufferWord1Mask, as the debt entry "GCN buffer and image descriptors" describes (shadPS4's AmdGpu::Buffer; Limbo leaves 0x7 there). So a V# with any of those bits set made the draw capture read memory the shader never reads. When the walker needed the value, for example as a branch condition, the draw stopped with guest memory is not readable at an address above 2^44.

SrtEvaluator::EvaluateRawRead and SrtTape::compute now take a constant buffer's base through ConstBufferBase in SrtAddressArithmetic.hpp. In GCN mode it applies GcnBufferWord1Mask to word 1, and in PS5 mode it keeps the 48-bit base, so the PS5 path is unchanged. s_load through a 64-bit scalar pointer is not a V#, so its address does not change.

The test GcnScalarBufferBase.cpp captures and dispatches a GCN compute shader through ShaderMemory, as GuardedNullPointer.cpp does. The shader runs s_buffer_load_dword through a user-data V# in a guest-arena block below 2^44, branches on the loaded value, and stores it. It runs four times, with word 1 bits [15:12] set to 0x0, 0x1, 0x8 and 0xf, and each run must store the resident dword.

The debt fragment adds the walker to the existing entry. It also records a gap that this PR leaves: ResourceMaterializer's descriptor-table reads (key scans and table heaps, Base48() at about lines 912, 1115 and 1493) still use the 48-bit base for a GCN V#. None of the stops in my Bloodborne runs came from them. Changing them needs its own table test, so it is a follow-up. d41eb1a84aa adds only that debt sentence.

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 VK_LOADER_DEBUG=layer, using the LunarG layer 1.4.363.1 through VK_ADD_LAYER_PATH:
ctest -R '^(agc_driver_gcn_.*|agc_driver_guarded_null_pointer|agc_driver_guarded_direct_root)$' -E '_trigger$' -V

  • main's walker + the new test: 14/15 pass. agc_driver_gcn_scalar_buffer_base fails with AGC driver: guest memory is not readable at 0x100200000104 (range 0x100200000104+0x4), the 0x1 case, which is the title's message below.

  • This change: 15/15 pass. The new test passes 3 of 3 runs (--repeat until-fail:3).

  • Validation layer: both logs have 15 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 SrtWalker files, SrtAddressArithmetic.hpp and RdnaDescriptorFormat.hpp match main's.

  • Title: Bloodborne CUSA00900 01.09 (my own copy), on main f2a25e5b42a plus #17105, #17711, #20156, #21944, #21969, #21977, #22033 and #18177.

    • Before: 2 of 2 runs stop about 146 s in, when character creation opens, with shader 0x2d409d100 stage 1: AGC driver: guest memory is not readable at 0x800243ae1560. The vertex shader runs s_buffer_load_dword s0, s[12:15], 0x80, then s_cmp_eq_i32 s0, 0 and s_cbranch_scc1. Its V# is user data words 12-15, 43aa14e0 00108002 00000009 00077fac: word 1 bits [15:12] are 0x8, and the 44-bit base is 0x243aa14e0.
    • After: 1 run gets past that draw. The next stop is in another vertex shader (scalar call link register s[0] ... escapes the constant-offset call/return model). That is a separate issue, fixed in #22076.
  • Tested by @tablefrogpillow on abdf092d: agc_driver_gcn_scalar_buffer_base passes on RX Vega 56 (RADV gfx900, GCN5), the Ryzen 7000 iGPU (RADV gfx1036, RDNA2), RX 7900 GRE (RADV gfx1100, RDNA3) and lavapipe, with the Khronos layer 1.4.363 and 0 VUID- (comment).

  • Tested by @kurexw on d41eb1a84aa: Apple M4, MoltenVK 1.4.2, Khronos layer 1.4.363.1, x86-64 build under Rosetta, 3 runs each on main a72186d3cf (plus #22056 and #22074 for the macOS build) and on this PR: agc_driver_gcn_scalar_buffer_base passes 3/3 with the layer inserted and 0 VUID-; every other selected test has the same status on both, with no new VUID- (review).

  • Review follow-up d05009fe4f0 (test only, from MarcZX10's review): the test now fails instead of skipping when the arena block is above 2^44, except in the ASan build, whose guest offset puts the arena there by design. It also includes <exception> and <optional> directly. Same machine and layer, ctest -R gcn_scalar_buffer_base --repeat until-fail:3 -V: PR head d41eb1a84aa and this commit each pass 3 of 3, never skip, and each log has 3 Insert instance layer lines, no was not found, no failed to load and no VUID-.

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 could not compare two conflicting PRs, so I read their diffs:

  • #5609 changes SrtEvaluator.cpp around the same read, but not the base line.

  • #9508 moves AddSignedAddress inline into SrtAddressArithmetic.hpp and deletes the .cpp. That is why ConstBufferBase is an inline function in the header, not in the .cpp. A merge with #9508 keeps both functions in the header.

  • domx4q on head d05009fe4f merged onto main fbaae8a79d: Arch Linux, GCC 16.2.1, RTX 4090 (Ada), NVIDIA 620.70.06, Khronos layer 1.4.363.1. 12 of 12 pass (main 11 of 11; agc_driver_gcn_scalar_buffer_base is new), the layer loads in every run, and no log has a was not found or VUID- line. With main's SrtEvaluator.cpp and SrtTape.cpp the new test fails with guest memory is not readable at 0x100200000104.

  • Tested by @Jitheswar on d05009fe4f (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: 13 of 13 pass (main 12 of 12; agc_driver_gcn_scalar_buffer_base is new), the layer loads in every run, no was not found, 0 VUID- (comment).

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:5350183259 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22060). Originally posted by [B-Howell](https://github.com/B-Howell) on 2026-11-17T03:44:37Z. --- ### What On PS4 (GCN) shaders, the descriptor walker read an `s_buffer_load` at the V#'s full 48-bit base. The emitted shader uses a 44-bit base instead: `SpirvRuntimeBuffer.cpp` and `ResourceMaterializer.cpp` clear word 1 bits [15:12] with `GcnBufferWord1Mask`, as the debt entry "GCN buffer and image descriptors" describes (shadPS4's `AmdGpu::Buffer`; Limbo leaves 0x7 there). So a V# with any of those bits set made the draw capture read memory the shader never reads. When the walker needed the value, for example as a branch condition, the draw stopped with `guest memory is not readable` at an address above 2^44. `SrtEvaluator::EvaluateRawRead` and `SrtTape::compute` now take a constant buffer's base through `ConstBufferBase` in `SrtAddressArithmetic.hpp`. In GCN mode it applies `GcnBufferWord1Mask` to word 1, and in PS5 mode it keeps the 48-bit base, so the PS5 path is unchanged. `s_load` through a 64-bit scalar pointer is not a V#, so its address does not change. The test `GcnScalarBufferBase.cpp` captures and dispatches a GCN compute shader through `ShaderMemory`, as `GuardedNullPointer.cpp` does. The shader runs `s_buffer_load_dword` through a user-data V# in a guest-arena block below 2^44, branches on the loaded value, and stores it. It runs four times, with word 1 bits [15:12] set to 0x0, 0x1, 0x8 and 0xf, and each run must store the resident dword. The debt fragment adds the walker to the existing entry. It also records a gap that this PR leaves: `ResourceMaterializer`'s descriptor-table reads (key scans and table heaps, `Base48()` at about lines 912, 1115 and 1493) still use the 48-bit base for a GCN V#. None of the stops in my Bloodborne runs came from them. Changing them needs its own table test, so it is a follow-up. `d41eb1a84aa` adds only that debt sentence. ### 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 VK_LOADER_DEBUG=layer`, using the LunarG layer 1.4.363.1 through `VK_ADD_LAYER_PATH`: `ctest -R '^(agc_driver_gcn_.*|agc_driver_guarded_null_pointer|agc_driver_guarded_direct_root)$' -E '_trigger$' -V` - **`main`'s walker + the new test:** 14/15 pass. `agc_driver_gcn_scalar_buffer_base` fails with `AGC driver: guest memory is not readable at 0x100200000104 (range 0x100200000104+0x4)`, the 0x1 case, which is the title's message below. - **This change:** 15/15 pass. The new test passes 3 of 3 runs (`--repeat until-fail:3`). - **Validation layer:** both logs have 15 `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 `SrtWalker` files, `SrtAddressArithmetic.hpp` and `RdnaDescriptorFormat.hpp` match `main`'s. - **Title:** Bloodborne CUSA00900 01.09 (my own copy), on `main` `f2a25e5b42a` plus #17105, #17711, #20156, #21944, #21969, #21977, #22033 and #18177. - Before: 2 of 2 runs stop about 146 s in, when character creation opens, with `shader 0x2d409d100 stage 1: AGC driver: guest memory is not readable at 0x800243ae1560`. The vertex shader runs `s_buffer_load_dword s0, s[12:15], 0x80`, then `s_cmp_eq_i32 s0, 0` and `s_cbranch_scc1`. Its V# is user data words 12-15, `43aa14e0 00108002 00000009 00077fac`: word 1 bits [15:12] are 0x8, and the 44-bit base is `0x243aa14e0`. - After: 1 run gets past that draw. The next stop is in another vertex shader (`scalar call link register s[0] ... escapes the constant-offset call/return model`). That is a separate issue, fixed in #22076. - **Tested by @tablefrogpillow on `abdf092d`:** `agc_driver_gcn_scalar_buffer_base` passes on RX Vega 56 (RADV gfx900, GCN5), the Ryzen 7000 iGPU (RADV gfx1036, RDNA2), RX 7900 GRE (RADV gfx1100, RDNA3) and lavapipe, with the Khronos layer 1.4.363 and 0 `VUID-` ([comment](https://github.com/boykopovar/AnyPS5/pull/22060#issuecomment-6937819226)). - **Tested by @kurexw on `d41eb1a84aa`:** Apple M4, MoltenVK 1.4.2, Khronos layer 1.4.363.1, x86-64 build under Rosetta, 3 runs each on `main` `a72186d3cf` (plus #22056 and #22074 for the macOS build) and on this PR: `agc_driver_gcn_scalar_buffer_base` passes 3/3 with the layer inserted and 0 `VUID-`; every other selected test has the same status on both, with no new `VUID-` ([review](https://github.com/boykopovar/AnyPS5/pull/22060#pullrequestreview-5934697530)). - **Review follow-up `d05009fe4f0` (test only, from MarcZX10's review):** the test now fails instead of skipping when the arena block is above 2^44, except in the ASan build, whose guest offset puts the arena there by design. It also includes `<exception>` and `<optional>` directly. Same machine and layer, `ctest -R gcn_scalar_buffer_base --repeat until-fail:3 -V`: PR head `d41eb1a84aa` and this commit each pass 3 of 3, never skip, and each log has 3 `Insert instance layer` lines, no `was not found`, no `failed to load` and no `VUID-`. `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` could not compare two conflicting PRs, so I read their diffs: - #5609 changes `SrtEvaluator.cpp` around the same read, but not the base line. - #9508 moves `AddSignedAddress` inline into `SrtAddressArithmetic.hpp` and deletes the `.cpp`. That is why `ConstBufferBase` is an inline function in the header, not in the `.cpp`. A merge with #9508 keeps both functions in the header. - [domx4q](https://github.com/boykopovar/AnyPS5/pull/22060#issuecomment-7010843807) on head `d05009fe4f` merged onto main `fbaae8a79d`: Arch Linux, GCC 16.2.1, RTX 4090 (Ada), NVIDIA 620.70.06, Khronos layer 1.4.363.1. 12 of 12 pass (main 11 of 11; `agc_driver_gcn_scalar_buffer_base` is new), the layer loads in every run, and no log has a `was not found` or `VUID-` line. With main's `SrtEvaluator.cpp` and `SrtTape.cpp` the new test fails with `guest memory is not readable at 0x100200000104`. - **Tested by @Jitheswar on `d05009fe4f`** (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: 13 of 13 pass (main 12 of 12; `agc_driver_gcn_scalar_buffer_base` is new), the layer loads in every run, no `was not found`, 0 `VUID-` ([comment](https://github.com/boykopovar/AnyPS5/pull/22060#issuecomment-7012942853)). ### 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 06:13:21 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

Head d41eb1a84aac15a3bb43758236caceafa902236c, base main. The walker now reads a GCN constant buffer's base through the same 44-bit mask the emitted shader uses, and the PS5 path keeps its 48-bit base.

What I ran

  • Read the description, commit list, manifest and diff for this head. Read the changed hunks of SrtEvaluator.cpp and SrtTape.cpp, the new helper, and the mask definition, all from the head through the reader.
  • Searched the head for the callers of the helper, the remaining 48-bit walker bases, the Base48() calls named in the debt note, and the build rule that picks up the new test.
  • Read: all five files in files.json under reviewed, at the changed hunks. Excluded by rule: none.
  • No build and no test ran in this review. The test results in the description are the author's, from their own machine.
  • Not approved: SrtEvaluator.cpp and SrtTape.cpp were read only at the changed hunks, not in full, and nothing was built, so there is no passing check to approve on.
repo_read.py search GcnBufferWord1Mask
repo_read.py search GcnGuestShaders
repo_read.py cat core/shader/recompiler/Optimization/src/SrtWalker/SrtEvaluator.cpp 205 240
repo_read.py cat core/shader/recompiler/Optimization/src/SrtWalker/SrtTape.cpp 405 435
repo_read.py search ConstBufferBase core/shader
repo_read.py search AddressMask core/shader/recompiler/Optimization
repo_read.py search Base48 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
repo_read.py search execution core/libs/prx/libSceAgcDriver

Results

Check Result Note
Changed hunks and helper passed Argument order and masks match
Other 48-bit walker bases passed No other constant-buffer base is left
Test registration passed Built by the CMake glob
Debt note line numbers passed Base48() at 912, 1115 and 1493
Build and tests here not run Author-reported only
Full read of the two long files not run Hunks read only

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/tests/execution/GcnScalarBufferBase.cpp:107: the test returns as skipped when the guest arena block lies above 2^44. On a host where the arena lands high, the test passes without dispatching the shader, so it does not guard the bug there. A failure or an explicit assertion on the block's address would keep the guard.
  • core/libs/prx/libSceAgcDriver/tests/execution/GcnScalarBufferBase.cpp:79 and :114: std::nullopt and std::exception are used without <optional> or <exception> in the includes (lines 1–20). It builds on the author's setup, probably through transitive includes, so this is include hygiene only.

Sources

Not verified

  • Nothing was built or run here. The 14/15 and 15/15 results, the three repeat runs and the validation-layer counts are the author's, on Windows with an RTX 4080 SUPER. The run on abdf092d across several GPUs is a third-party report that I did not reproduce.
  • The shader bytes in Code (new lines 25–32 of GcnScalarBufferBase.cpp) were not decoded, so the expected value of the test is not checked by me.
  • The PS5 path is unchanged: that rests on reading the expression, not on a run.
  • SrtEvaluator.cpp (981 lines) and SrtTape.cpp (705 lines) were not read in full. I read the changed hunks and searched the names the change touches.
  • ResourceMaterializer.cpp lines 912, 1115 and 1493 are confirmed as Base48() calls. I did not read them in context, and the claim that none of the author's stops came from them is the author's.
  • The results of tools/check_conventions.py and tools/debt_fold.py are author-reported. I did not run them.

To get this to a good state

Nothing is required. The two non-blocking points above are optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5933855771 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22060#pullrequestreview-5933855771). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T06:13:21Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. Head `d41eb1a84aac15a3bb43758236caceafa902236c`, base `main`. The walker now reads a GCN constant buffer's base through the same 44-bit mask the emitted shader uses, and the PS5 path keeps its 48-bit base. ## What I ran - Read the description, commit list, manifest and diff for this head. Read the changed hunks of `SrtEvaluator.cpp` and `SrtTape.cpp`, the new helper, and the mask definition, all from the head through the reader. - Searched the head for the callers of the helper, the remaining 48-bit walker bases, the `Base48()` calls named in the debt note, and the build rule that picks up the new test. - Read: all five files in `files.json` under `reviewed`, at the changed hunks. Excluded by rule: none. - No build and no test ran in this review. The test results in the description are the author's, from their own machine. - Not approved: `SrtEvaluator.cpp` and `SrtTape.cpp` were read only at the changed hunks, not in full, and nothing was built, so there is no passing check to approve on. ``` repo_read.py search GcnBufferWord1Mask repo_read.py search GcnGuestShaders repo_read.py cat core/shader/recompiler/Optimization/src/SrtWalker/SrtEvaluator.cpp 205 240 repo_read.py cat core/shader/recompiler/Optimization/src/SrtWalker/SrtTape.cpp 405 435 repo_read.py search ConstBufferBase core/shader repo_read.py search AddressMask core/shader/recompiler/Optimization repo_read.py search Base48 core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp repo_read.py search execution core/libs/prx/libSceAgcDriver ``` ## Results | Check | Result | Note | | --- | --- | --- | | Changed hunks and helper | passed | Argument order and masks match | | Other 48-bit walker bases | passed | No other constant-buffer base is left | | Test registration | passed | Built by the CMake glob | | Debt note line numbers | passed | `Base48()` at 912, 1115 and 1493 | | Build and tests here | not run | Author-reported only | | Full read of the two long files | not run | Hunks read only | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceAgcDriver/tests/execution/GcnScalarBufferBase.cpp:107`: the test returns as skipped when the guest arena block lies above 2^44. On a host where the arena lands high, the test passes without dispatching the shader, so it does not guard the bug there. A failure or an explicit assertion on the block's address would keep the guard. - `core/libs/prx/libSceAgcDriver/tests/execution/GcnScalarBufferBase.cpp:79` and `:114`: `std::nullopt` and `std::exception` are used without `<optional>` or `<exception>` in the includes (lines 1–20). It builds on the author's setup, probably through transitive includes, so this is include hygiene only. ## Sources - [Helper `ConstBufferBase`](https://github.com/boykopovar/AnyPS5/blob/d41eb1a84aac15a3bb43758236caceafa902236c/core/shader/recompiler/Optimization/include/Optimization/SrtWalker/SrtAddressArithmetic.hpp#L14-L17) - [Mask `GcnBufferWord1Mask = 0xffff0fff`](https://github.com/boykopovar/AnyPS5/blob/d41eb1a84aac15a3bb43758236caceafa902236c/core/shader/recompiler/RdnaDecoder/include/RdnaDecoder/RdnaDescriptorFormat.hpp#L53) - [Emit path clears the same bits](https://github.com/boykopovar/AnyPS5/blob/d41eb1a84aac15a3bb43758236caceafa902236c/core/shader/recompiler/SpirvBackend/src/SpirvRuntimeBuffer.cpp#L163) - [Test sources are globbed](https://github.com/boykopovar/AnyPS5/blob/d41eb1a84aac15a3bb43758236caceafa902236c/core/libs/prx/libSceAgcDriver/CMakeLists.txt#L695) ## Not verified - Nothing was built or run here. The 14/15 and 15/15 results, the three repeat runs and the validation-layer counts are the author's, on Windows with an RTX 4080 SUPER. The run on `abdf092d` across several GPUs is a third-party report that I did not reproduce. - The shader bytes in `Code` (new lines 25–32 of `GcnScalarBufferBase.cpp`) were not decoded, so the expected value of the test is not checked by me. - The PS5 path is unchanged: that rests on reading the expression, not on a run. - `SrtEvaluator.cpp` (981 lines) and `SrtTape.cpp` (705 lines) were not read in full. I read the changed hunks and searched the names the change touches. - `ResourceMaterializer.cpp` lines 912, 1115 and 1493 are confirmed as `Base48()` calls. I did not read them in context, and the claim that none of the author's stops came from them is the author's. - The results of `tools/check_conventions.py` and `tools/debt_fold.py` are author-reported. I did not run them. ## To get this to a good state Nothing is required. The two non-blocking points above are optional.
MarcZX10 commented 2026-11-17 07:15:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T07:15:31Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional. The reviewed head is d05009fe4f.

What I ran

  • Read the description, commit list, manifest and diff for the head. Read the changed hunks and their callers in the repository at the same head, with the reader's search and cat.
  • No build and no test run. The house rules say to skip builds in this pass.
  • Commands: repo_read.py search for GcnBufferWord1Mask, GcnGuestShaders, ConstBufferBase, GuestAddressOffset, Base48 and the debt-doc link pattern; repo_read.py cat for SrtEvaluator.cpp lines 214–232.

Results

Check Result Note
Changed hunks read passed all five files in the diff
Mask arithmetic in ConstBufferBase passed clears word 1 bits [15:12]; PS5 path unchanged
Debt doc relative links failed one ../ level too few
Build and ctest not run no build in this pass
Author's Windows and GPU runs not run author-reported only

Findings

Blocking

None.

Non-blocking

  • docs/dev/debt/changes/fix-shader-gcn-scalar-buffer-base.md:5: the link ../../../core/shader/… is written from docs/dev/debt/changes/, so three levels reach docs/, not the repository root. It resolves to docs/core/…. Four ../ levels reach core/. No other file in the repository uses that link depth, so I have no local convention to compare against.
  • SrtAddressArithmetic.hpp now includes RdnaInstructionDecoder.hpp and RdnaDescriptorFormat.hpp. Every file that includes the walker header now pulls in the decoder. This may be fine; it is worth a look if the header is included widely.

Sources

  • GcnBufferWord1Mask is defined at RdnaDescriptorFormat.hpp:53 as 0xffff0fffu.
  • ConstBufferBase is at SrtAddressArithmetic.hpp:14 and is used at SrtEvaluator.cpp:226 and SrtTape.cpp:420.
  • The Base48() reads the debt fragment names are at ResourceMaterializer.cpp lines 912, 1115 and 1493 at the same head. The author's line numbers are correct.
  • The test skips only when GuestArena::GuestAddressOffset is non-zero, which is the ASan case, and otherwise fails. This matches the review follow-up.

Not verified

  • The full text of SrtEvaluator.cpp (981 lines) and SrtTape.cpp (705 lines). I read the changed hunks and the context around them, not the whole files.
  • files.json. I did not read it, so I have not confirmed which files it lists as reviewed or excluded.
  • Whether the new test is registered with CMake under the name agc_driver_gcn_scalar_buffer_base, and whether the GCN bytes in Code decode to the instructions the test comments describe.
  • Namespaces of GcnBufferWord1Mask and GcnGuestShaders as seen from the new header, and whether the header compiles.
  • The author's test results: 15/15 on Windows with the RTX 4080 SUPER, the three-run repeat, the negative control on main, and the tablefrogpillow runs on other GPUs. I did not run any of these.
  • check_conventions.py and the debt_fold.py clash: author-reported, not run.

To get this to a good state

Nothing is required.

Optional:

  • Change the debt doc link to four ../ levels so it reaches core/.
  • Check whether the walker header needs the decoder include, or whether a forward declaration is enough.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5934408740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22060#pullrequestreview-5934408740). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T07:15:31Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. The reviewed head is d05009fe4f03b9a6d4ba2ffb454f446fa466bc66. **What I ran** - Read the description, commit list, manifest and diff for the head. Read the changed hunks and their callers in the repository at the same head, with the reader's `search` and `cat`. - No build and no test run. The house rules say to skip builds in this pass. - Commands: `repo_read.py search` for `GcnBufferWord1Mask`, `GcnGuestShaders`, `ConstBufferBase`, `GuestAddressOffset`, `Base48` and the debt-doc link pattern; `repo_read.py cat` for `SrtEvaluator.cpp` lines 214–232. **Results** | Check | Result | Note | |---|---|---| | Changed hunks read | passed | all five files in the diff | | Mask arithmetic in `ConstBufferBase` | passed | clears word 1 bits [15:12]; PS5 path unchanged | | Debt doc relative links | failed | one `../` level too few | | Build and `ctest` | not run | no build in this pass | | Author's Windows and GPU runs | not run | author-reported only | **Findings** **Blocking** None. **Non-blocking** - `docs/dev/debt/changes/fix-shader-gcn-scalar-buffer-base.md:5`: the link `../../../core/shader/…` is written from `docs/dev/debt/changes/`, so three levels reach `docs/`, not the repository root. It resolves to `docs/core/…`. Four `../` levels reach `core/`. No other file in the repository uses that link depth, so I have no local convention to compare against. - `SrtAddressArithmetic.hpp` now includes `RdnaInstructionDecoder.hpp` and `RdnaDescriptorFormat.hpp`. Every file that includes the walker header now pulls in the decoder. This may be fine; it is worth a look if the header is included widely. **Sources** - `GcnBufferWord1Mask` is defined at [RdnaDescriptorFormat.hpp:53](https://github.com/boykopovar/AnyPS5/blob/d05009fe4f03b9a6d4ba2ffb454f446fa466bc66/core/shader/recompiler/RdnaDecoder/include/RdnaDecoder/RdnaDescriptorFormat.hpp#L53) as `0xffff0fffu`. - `ConstBufferBase` is at [SrtAddressArithmetic.hpp:14](https://github.com/boykopovar/AnyPS5/blob/d05009fe4f03b9a6d4ba2ffb454f446fa466bc66/core/shader/recompiler/Optimization/include/Optimization/SrtWalker/SrtAddressArithmetic.hpp#L14) and is used at [SrtEvaluator.cpp:226](https://github.com/boykopovar/AnyPS5/blob/d05009fe4f03b9a6d4ba2ffb454f446fa466bc66/core/shader/recompiler/Optimization/src/SrtWalker/SrtEvaluator.cpp#L226) and [SrtTape.cpp:420](https://github.com/boykopovar/AnyPS5/blob/d05009fe4f03b9a6d4ba2ffb454f446fa466bc66/core/shader/recompiler/Optimization/src/SrtWalker/SrtTape.cpp#L420). - The `Base48()` reads the debt fragment names are at `ResourceMaterializer.cpp` lines 912, 1115 and 1493 at the same head. The author's line numbers are correct. - The test skips only when `GuestArena::GuestAddressOffset` is non-zero, which is the ASan case, and otherwise fails. This matches the review follow-up. **Not verified** - The full text of `SrtEvaluator.cpp` (981 lines) and `SrtTape.cpp` (705 lines). I read the changed hunks and the context around them, not the whole files. - `files.json`. I did not read it, so I have not confirmed which files it lists as reviewed or excluded. - Whether the new test is registered with CMake under the name `agc_driver_gcn_scalar_buffer_base`, and whether the GCN bytes in `Code` decode to the instructions the test comments describe. - Namespaces of `GcnBufferWord1Mask` and `GcnGuestShaders` as seen from the new header, and whether the header compiles. - The author's test results: 15/15 on Windows with the RTX 4080 SUPER, the three-run repeat, the negative control on `main`, and the `tablefrogpillow` runs on other GPUs. I did not run any of these. - `check_conventions.py` and the `debt_fold.py` clash: author-reported, not run. **To get this to a good state** Nothing is required. Optional: - Change the debt doc link to four `../` levels so it reaches `core/`. - Check whether the walker header needs the decoder include, or whether a forward declaration is enough.
kurexw commented 2026-11-17 07:44:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kurexw on 2026-11-17T07:44:41Z.

Review: COMMENTED


macOS GPU test (Apple M4, MoltenVK 1.4.2, validation layer 1.4.363.1, x86-64 build under Rosetta)

Base: upstream/main a72186d3cf + #22056 + #22074 (both needed for the macOS build); PR head d41eb1a84a merged on top. Built clean (only the known libcurl link failure, #17425).
Env per AGENTS.md: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R 'recorder|constant_phi|masked_select|sample_bit_descriptor|pixel_ancillary|scalar_buffer|shader_mode_registers|agc_driver_f64|command_batch|awaited_slot|agc_driver_idle|detiler' -V, 3 runs each on base and PR.

  • Every test has the same status on base and PR in all 3 runs; no new VUID- errors.
  • Every test that creates a Vulkan instance logs Insert instance layer "VK_LAYER_KHRONOS_validation"; none logs was not found but was requested. The tests without layer lines (agc_constant_phi, agc_masked_select, agc_command_batch_*, pixel_ancillary, ...) never touch the loader.
  • Same on base and PR: 11 agc_driver_f64_* tests skip (the M4 has no shaderFloat64); agc_driver_recorder fails with a kept vertex window was not mirrored (#20831); the recorder tests each log one VUID-VkDeviceCreateInfo-sType-unique for a duplicated VkPhysicalDevicePortabilitySubsetFeaturesKHR in the test's own device (#21965).
  • New agc_driver_gcn_scalar_buffer_base: passes 3/3 with the layer inserted and 0 VUID-. agc_driver_scalar_buffer_runtime_word3 passes 3/3 on both.
  • Tested head was d41eb1a84a; the later test-only commit d05009fe4f (fail when the block is unexpectedly high) was pushed after my run and I have not rerun it.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5934697530 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22060#pullrequestreview-5934697530). Originally posted by [kurexw](https://github.com/kurexw) on 2026-11-17T07:44:41Z. **Review:** COMMENTED --- **macOS GPU test (Apple M4, MoltenVK 1.4.2, validation layer 1.4.363.1, x86-64 build under Rosetta)** Base: `upstream/main` a72186d3cf + #22056 + #22074 (both needed for the macOS build); PR head `d41eb1a84a` merged on top. Built clean (only the known libcurl link failure, #17425). Env per AGENTS.md: `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`, `ctest -R 'recorder|constant_phi|masked_select|sample_bit_descriptor|pixel_ancillary|scalar_buffer|shader_mode_registers|agc_driver_f64|command_batch|awaited_slot|agc_driver_idle|detiler' -V`, 3 runs each on base and PR. - Every test has the same status on base and PR in all 3 runs; no new `VUID-` errors. - Every test that creates a Vulkan instance logs `Insert instance layer "VK_LAYER_KHRONOS_validation"`; none logs `was not found but was requested`. The tests without layer lines (`agc_constant_phi`, `agc_masked_select`, `agc_command_batch_*`, `pixel_ancillary`, ...) never touch the loader. - Same on base and PR: 11 `agc_driver_f64_*` tests skip (the M4 has no `shaderFloat64`); `agc_driver_recorder` fails with `a kept vertex window was not mirrored` (#20831); the recorder tests each log one `VUID-VkDeviceCreateInfo-sType-unique` for a duplicated `VkPhysicalDevicePortabilitySubsetFeaturesKHR` in the test's own device (#21965). - New `agc_driver_gcn_scalar_buffer_base`: passes 3/3 with the layer inserted and 0 `VUID-`. `agc_driver_scalar_buffer_runtime_word3` passes 3/3 on both. - Tested head was `d41eb1a84a`; the later test-only commit `d05009fe4f` (fail when the block is unexpectedly high) was pushed after my run and I have not rerun it. AI-assisted: yes
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!22060
No description provided.