fix(shader): let a re-read nested V#'s words and keys be spilled to VGPR lanes #18106

Open
hugodearaujo wants to merge 171 commits from upstream-pr/18106 into main
hugodearaujo commented 2026-11-10 12:42:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-11-10T12:42:31Z.


What

This is stacked on #15555 at 77b4696698 (and through it on #9969, #9790, #9457, #8939 and #7395).

Marvel's Spider-Man 2 (PPSA03016) gets past its VRAM stop with mrfelek's lazy-table prototype (#10195). It then stops at 185-229 s in a compute shader:

GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a5b0(GetBufferResource(LoadAddressU32@pc=0x0000a4b4(GetAddressResource(Phi(Phi(Phi(Phi(Phi, Phi), Phi(Phi, ReadConstBuffer@pc=0x00001fc4)), ...

It's #15555's shape: a record pointer P, a V# A at P+0x70 (pc 0xa488) whose buffer holds keys, and a V# B at P+0x10 (pc 0xa4b4) whose T# array the key (A[0x18] >> 16) << 5 indexes (pc 0xa5b0). What's new is register pressure. The shader spills the words of both V#s, and some key words, into VGPR lanes with v_writelane_b32:

%17936..%17939 = LoadAddressU32 P  [pc=0xa488 off=0x70..0x7c]     V# A
%17944..%17947 = LoadAddressU32 P  [pc=0xa4b4 off=0x10..0x1c]     V# B
%17941 = WriteLane %17939, 0x19, %15553                            A's word 3 to lane 25
%18043 = WriteLane %17944, 0x02, %18035                            B's word 0 to lane 2
%17983 = ReadConstBuffer A, 0x0  [pc=0xa4f4 off=0x0]                a key word
%17997 = WriteLane %17983, 0x01, %17994                            ... spilled too

ReadLaneEliminator already forwards the restores (v_readlane) to the original values. The WriteLanes stay, held by the loop's Phis. So:

  • TryMakeTableColumn refuses B's T# column, because a word of B, its parent, has a user that isn't a GetBufferResource (pc 0xa5b0, above);
  • ChildKeyWord refuses a key read through A that is spilled, so DescriptorWordReads refuses A's handle and the S# column through A (pc 0xa6ac, the next refusal once the first is fixed).

The change. When the V# is read again at dispatch (RereadableVsharp), its words and the key words read through it are the guest's own values, so a lane write of one of them copies a real value. LaneSpill matches a WriteLane whose written value (argument 0) is the word:

  • the parent-word check in TryMakeTableColumn accepts it for a re-read V#;
  • ChildKeyWord skips it while it follows a key, when the caller passes the V# as re-read. #15555's siblings parameter becomes rereadable, since both the sibling and the spill rule rely on the V# being read again; DescriptorWordReads passes it as before, and MatchChildKey keeps the default.

A V# that is not read again keeps the earlier rule. A word used as the lane index, or as the vector written into, stays refused.

docs/dev/debt/shader.md gets one entry for this, next to #15555's sibling-key entry.

Overlap. mrfelek's #16812 (on #9969) makes DescriptorWordReads accept every read through a re-read V#, which would also cover the spilled key words; it drops the ChildKeyWord branch there. It doesn't cover the parent-word check, and neither does #16814, which adds GetAddressResource users of those words. #16812 and #15555 already conflict on the DescriptorWordReads line, so this PR conflicts with #16812 there too (and in the test list and the debt file); whichever lands second resolves it. No open PR handles WriteLane users of descriptor words (searched for the message, WriteLane, writelane, spill, ReadConstBuffer, the pcs, again on 2026-11-10).

Tested

Linux 7.2.14, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests.

  • New agc_driver_pointer_vsharp_sibling_key_spill_table (--pointer-vsharp-sibling-key-spill): #15555's PointerSiblingKeyCode with three v_writelane_b32 added to the loop body after the sample: B's word 0 (s68), A's word 0 (s52) and the key word (s64) go to lanes 0-2 of v6, which the shader stores. Assembled with llvm-mc -triple=amdgcn -mcpu=gfx1030; the loop branch moves from -31 to -37 dwords. It runs #15555's checks unchanged: keys 2 and 5, the largest key inside B, swapped S#s, a moved record pointer and keys past B, without a recompile.
  • Negative controls (only ResourceTracker.cpp changed, test kept):
    • #15555's file, on #15555's head 77b4696698 merged with main 22e33e9031: the new test fails with GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000b8(GetBufferResource(LoadAddressU32@pc=0x000000a4(..., the title's refusal; #15555's own sibling test passes.
    • On the earlier #15555 head caf94d99ce: without the parent-word hunk, the same failure; without the ChildKeyWord hunk, GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000c0(GetBufferResource(LoadAddressU32@pc=0x00000090(..., the shape of the title's second refusal (pc 0xa6ac).
  • Validation layer, paired (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R '^(agc_driver_(image_table|nested|pointer)|agc_shader_(disk_cache|memory|nested_sampler)|spanned_uniformity|shader_memory_decoder_tolerance)'), each merged with main 22e33e9031:
    • #15555 77b4696698: 49 tests, all pass (agc_driver_image_table_vouched_lookups skips, as on any device that reports written imported pages);
    • this branch: 50 tests, all pass, the same skip; the new test is the 50th.
    • Neither log has a VUID- line or "was not found but was requested".
  • tools/check_conventions.py against #15555's head, and against main for the stack: "All conventions checks passed."
  • The title's request, agc_shader_replay --prepare of the captured shader_11e2b64b00.prepare.req: #15555 (with main e7c3bfd130, #15710 and the lazy-table port) refuses at pc=0xa5b0. With this change it plans past pc=0xa5b0 and pc=0xa6ac and refuses at pc=0xa88c, a different shape (see below).
  • The title (Marvel's Spider-Man 2, PPSA03016 01.004.003), 300 s per run, interleaved, a fresh shader cache each run, Cross every 30 s from 60 s, APS5_LAZY_TABLES=1 APS5_DIAG_TABLE_USAGE=1, on main e7c3bfd130 + #15555 + #15710 + a local port of mrfelek's lazy-table prototype:
    • without this change, 3 runs: all stop at the first dispatch of that shader, at 209, 215 and 220 s, on GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a5b0(... (a fourth run, with APS5_DUMP_SHADERS=1 for the capture, at 229 s);
    • with it, 3 runs: no refusal at pc=0xa5b0 or pc=0xa6ac. All three stop at the same point, at 214, 216 and 213 s, on the next refusal in the same shader: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a88c(GetBufferResource(LoadAddressU32@pc=0x0000a488(...;
    • both: process VRAM peaks at 4.13-4.15 GB and GTT at 10.0-10.1 GB, 1,742-1,831 presents per run, no memory-guard stop and no amdgpu kernel message.

On current main. The head, 734a59bbf2, merges #15555's new head 215d1820e3 (with #9969's 78bdc14492 and main bfcd717ebc). With the validation layer and ctest -V -R '^(agc_driver_(image_table|nested|pointer)|agc_shader_(disk_cache|memory|nested_sampler|sampler_limits)|spanned_uniformity|shader_memory_decoder_tolerance)' on the RX 9070 XT, it gives 59 tests: 58 pass and agc_driver_image_table_vouched_lookups skips. On main bfcd717ebc the same command gives 45 tests: 44 pass and the same skip. No log has a VUID- line or "was not found but was requested".

Runs by others.

  • NVIDIA, by Doorriiaann (comment): RTX 3070, driver 610.57.04, Debian 13 (kernel 6.12.115), GCC 13.3.0, Release, validation layer 1.4.335, ctest -R '^(agc_driver_nested_.*|agc_driver_pointer_.*|agc_shader_memory.*)$', 2 runs on each side.
    • main 3eb7a74e1c (the merge base): 4 tests, all pass.
    • This PR at 284a1fd4fb: 22 tests, all pass, #15555's and agc_driver_pointer_vsharp_sibling_key_spill_table included. No VUID- line, and the layer was found.
    • Negative control, this PR's ImageTable.cpp and test CMake file on #15555's head 77b4696698: the new test fails 2 of 2 with GetImageResource dword 0 is not a valid runtime value, and #15555's agc_driver_pointer_vsharp_sibling_key_table passes.
  • Windows, by JJenkx (comment): this PR at 284a1fd4fb merged onto main, Windows 11 Enterprise 22621, RX 6700 XT (AMD driver 26.10.1), MinGW-w64 GCC 15.2 UCRT, Release. The 74 tests of agc_shader_disk_cache_tests, agc_shader_memory_tests, agc_driver_bda_anchor_reads_tests and agc_driver_image_table_tests pass 3 of 3 on the GPU, none skipped.
  • NVIDIA and Intel, by Lucke0051 (comment): this PR at 284a1fd4fb merged onto main b8194198cf, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, compared with main on the same machine, ctest -R '^(agc|video_out|shader)'. On an RTX 3070 Ti (NVIDIA 615.78.08) and an Intel UHD Graphics 630 (Mesa 26.2.6, ANV): no difference from main, and the 19 new tests pass. No validation layer there.
  • NVIDIA on Linux at the current head, by domx4q (comment): 2c75702742 merged onto main e1ab104e0a, Arch Linux, RTX 4090 (NVIDIA 620.70.06), GCC 16.2.1, Release, validation layer 1.4.363.1, the command above. main 40 of 40, this PR 59 of 59, agc_driver_pointer_vsharp_sibling_key_spill_table included; no skip, no VUID- line, and the layer is inserted.

Not in this PR (#18107): the title's next refusal, at pc=0xa88c, is two S#s (A+0x90 and A+0xa0) read by one s_buffer_load_dwordx8 through A's handle. TryMakeTableColumn requires every read of the parent handle to be a word of the one descriptor it plans, so each S# is refused for the other's reads. Accepting reads whose users are only descriptors or lane spills takes the replay past pc=0xa88c to pc=0x1149c, a record pointer whose Phi has an arm read at P+0x1b0 through a V# loaded at P'+0x20 (#9633's conditional chase).

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: #15555
  • Fixes: none
  • Unblocks: none yet (PPSA03016 #10195 needs the pc=0xa88c and pc=0x1149c steps too)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Linux 7.2.14; NVIDIA RTX 3070, driver 610.57.04, Debian 13 (by Doorriiaann); AMD Radeon RX 6700 XT, Windows 11 (by JJenkx); NVIDIA RTX 3070 Ti and Intel UHD Graphics 630 (ANV), Linux (by Lucke0051); NVIDIA RTX 4090, Linux (by domx4q)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5241450526 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18106). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-11-10T12:42:31Z. --- ### What This is stacked on #15555 at `77b4696698` (and through it on #9969, #9790, #9457, #8939 and #7395). Marvel's Spider-Man 2 (PPSA03016) gets past its VRAM stop with mrfelek's lazy-table prototype (#10195). It then stops at 185-229 s in a compute shader: ``` GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a5b0(GetBufferResource(LoadAddressU32@pc=0x0000a4b4(GetAddressResource(Phi(Phi(Phi(Phi(Phi, Phi), Phi(Phi, ReadConstBuffer@pc=0x00001fc4)), ... ``` It's #15555's shape: a record pointer P, a V# A at P+0x70 (pc 0xa488) whose buffer holds keys, and a V# B at P+0x10 (pc 0xa4b4) whose T# array the key `(A[0x18] >> 16) << 5` indexes (pc 0xa5b0). What's new is register pressure. The shader spills the words of both V#s, and some key words, into VGPR lanes with `v_writelane_b32`: ``` %17936..%17939 = LoadAddressU32 P [pc=0xa488 off=0x70..0x7c] V# A %17944..%17947 = LoadAddressU32 P [pc=0xa4b4 off=0x10..0x1c] V# B %17941 = WriteLane %17939, 0x19, %15553 A's word 3 to lane 25 %18043 = WriteLane %17944, 0x02, %18035 B's word 0 to lane 2 %17983 = ReadConstBuffer A, 0x0 [pc=0xa4f4 off=0x0] a key word %17997 = WriteLane %17983, 0x01, %17994 ... spilled too ``` `ReadLaneEliminator` already forwards the restores (`v_readlane`) to the original values. The `WriteLane`s stay, held by the loop's Phis. So: - `TryMakeTableColumn` refuses B's T# column, because a word of B, its parent, has a user that isn't a `GetBufferResource` (pc 0xa5b0, above); - `ChildKeyWord` refuses a key read through A that is spilled, so `DescriptorWordReads` refuses A's handle and the S# column through A (pc 0xa6ac, the next refusal once the first is fixed). **The change.** When the V# is read again at dispatch (`RereadableVsharp`), its words and the key words read through it are the guest's own values, so a lane write of one of them copies a real value. `LaneSpill` matches a `WriteLane` whose written value (argument 0) is the word: - the parent-word check in `TryMakeTableColumn` accepts it for a re-read V#; - `ChildKeyWord` skips it while it follows a key, when the caller passes the V# as re-read. #15555's `siblings` parameter becomes `rereadable`, since both the sibling and the spill rule rely on the V# being read again; `DescriptorWordReads` passes it as before, and `MatchChildKey` keeps the default. A V# that is not read again keeps the earlier rule. A word used as the lane index, or as the vector written into, stays refused. `docs/dev/debt/shader.md` gets one entry for this, next to #15555's sibling-key entry. **Overlap.** mrfelek's #16812 (on #9969) makes `DescriptorWordReads` accept every read through a re-read V#, which would also cover the spilled key words; it drops the `ChildKeyWord` branch there. It doesn't cover the parent-word check, and neither does #16814, which adds `GetAddressResource` users of those words. #16812 and #15555 already conflict on the `DescriptorWordReads` line, so this PR conflicts with #16812 there too (and in the test list and the debt file); whichever lands second resolves it. No open PR handles `WriteLane` users of descriptor words (searched for the message, `WriteLane`, `writelane`, spill, `ReadConstBuffer`, the pcs, again on 2026-11-10). ### Tested Linux 7.2.14, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests. - **New `agc_driver_pointer_vsharp_sibling_key_spill_table`** (`--pointer-vsharp-sibling-key-spill`): #15555's `PointerSiblingKeyCode` with three `v_writelane_b32` added to the loop body after the sample: B's word 0 (`s68`), A's word 0 (`s52`) and the key word (`s64`) go to lanes 0-2 of `v6`, which the shader stores. Assembled with `llvm-mc -triple=amdgcn -mcpu=gfx1030`; the loop branch moves from -31 to -37 dwords. It runs #15555's checks unchanged: keys 2 and 5, the largest key inside B, swapped S#s, a moved record pointer and keys past B, without a recompile. - **Negative controls** (only `ResourceTracker.cpp` changed, test kept): - #15555's file, on #15555's head `77b4696698` merged with `main` 22e33e9031: the new test fails with `GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000b8(GetBufferResource(LoadAddressU32@pc=0x000000a4(...`, the title's refusal; #15555's own sibling test passes. - On the earlier #15555 head `caf94d99ce`: without the parent-word hunk, the same failure; without the `ChildKeyWord` hunk, `GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000c0(GetBufferResource(LoadAddressU32@pc=0x00000090(...`, the shape of the title's second refusal (pc 0xa6ac). - **Validation layer, paired** (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V -R '^(agc_driver_(image_table|nested|pointer)|agc_shader_(disk_cache|memory|nested_sampler)|spanned_uniformity|shader_memory_decoder_tolerance)'`), each merged with `main` 22e33e9031: - #15555 `77b4696698`: 49 tests, all pass (`agc_driver_image_table_vouched_lookups` skips, as on any device that reports written imported pages); - this branch: 50 tests, all pass, the same skip; the new test is the 50th. - Neither log has a `VUID-` line or "was not found but was requested". - `tools/check_conventions.py` against #15555's head, and against `main` for the stack: "All conventions checks passed." - **The title's request,** `agc_shader_replay --prepare` of the captured `shader_11e2b64b00.prepare.req`: #15555 (with `main` e7c3bfd130, #15710 and the lazy-table port) refuses at `pc=0xa5b0`. With this change it plans past `pc=0xa5b0` and `pc=0xa6ac` and refuses at `pc=0xa88c`, a different shape (see below). - **The title** (Marvel's Spider-Man 2, PPSA03016 01.004.003), 300 s per run, interleaved, a fresh shader cache each run, Cross every 30 s from 60 s, `APS5_LAZY_TABLES=1 APS5_DIAG_TABLE_USAGE=1`, on `main` e7c3bfd130 + #15555 + #15710 + a local port of mrfelek's lazy-table prototype: - without this change, 3 runs: all stop at the first dispatch of that shader, at 209, 215 and 220 s, on `GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a5b0(...` (a fourth run, with `APS5_DUMP_SHADERS=1` for the capture, at 229 s); - with it, 3 runs: no refusal at `pc=0xa5b0` or `pc=0xa6ac`. All three stop at the same point, at 214, 216 and 213 s, on the next refusal in the same shader: `GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a88c(GetBufferResource(LoadAddressU32@pc=0x0000a488(...`; - both: process VRAM peaks at 4.13-4.15 GB and GTT at 10.0-10.1 GB, 1,742-1,831 presents per run, no memory-guard stop and no amdgpu kernel message. **On current `main`.** The head, `734a59bbf2`, merges #15555's new head `215d1820e3` (with #9969's `78bdc14492` and `main` bfcd717ebc). With the validation layer and `ctest -V -R '^(agc_driver_(image_table|nested|pointer)|agc_shader_(disk_cache|memory|nested_sampler|sampler_limits)|spanned_uniformity|shader_memory_decoder_tolerance)'` on the RX 9070 XT, it gives 59 tests: 58 pass and `agc_driver_image_table_vouched_lookups` skips. On `main` bfcd717ebc the same command gives 45 tests: 44 pass and the same skip. No log has a `VUID-` line or "was not found but was requested". **Runs by others.** - **NVIDIA, by Doorriiaann** ([comment](https://github.com/boykopovar/AnyPS5/pull/18106#issuecomment-6768563599)): RTX 3070, driver 610.57.04, Debian 13 (kernel 6.12.115), GCC 13.3.0, Release, validation layer 1.4.335, `ctest -R '^(agc_driver_nested_.*|agc_driver_pointer_.*|agc_shader_memory.*)$'`, 2 runs on each side. - `main` 3eb7a74e1c (the merge base): 4 tests, all pass. - This PR at `284a1fd4fb`: 22 tests, all pass, #15555's and `agc_driver_pointer_vsharp_sibling_key_spill_table` included. No `VUID-` line, and the layer was found. - Negative control, this PR's `ImageTable.cpp` and test CMake file on #15555's head `77b4696698`: the new test fails 2 of 2 with `GetImageResource dword 0 is not a valid runtime value`, and #15555's `agc_driver_pointer_vsharp_sibling_key_table` passes. - **Windows, by JJenkx** ([comment](https://github.com/boykopovar/AnyPS5/pull/18106#issuecomment-6768658859)): this PR at `284a1fd4fb` merged onto `main`, Windows 11 Enterprise 22621, RX 6700 XT (AMD driver 26.10.1), MinGW-w64 GCC 15.2 UCRT, Release. The 74 tests of `agc_shader_disk_cache_tests`, `agc_shader_memory_tests`, `agc_driver_bda_anchor_reads_tests` and `agc_driver_image_table_tests` pass 3 of 3 on the GPU, none skipped. - **NVIDIA and Intel, by Lucke0051** ([comment](https://github.com/boykopovar/AnyPS5/pull/18106#issuecomment-6802666835)): this PR at `284a1fd4fb` merged onto `main` b8194198cf, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, compared with `main` on the same machine, `ctest -R '^(agc|video_out|shader)'`. On an RTX 3070 Ti (NVIDIA 615.78.08) and an Intel UHD Graphics 630 (Mesa 26.2.6, ANV): no difference from `main`, and the 19 new tests pass. No validation layer there. - **NVIDIA on Linux at the current head, by domx4q** ([comment](https://github.com/boykopovar/AnyPS5/pull/18106#issuecomment-7015688140)): `2c75702742` merged onto `main` `e1ab104e0a`, Arch Linux, RTX 4090 (NVIDIA 620.70.06), GCC 16.2.1, Release, validation layer 1.4.363.1, the command above. `main` 40 of 40, this PR 59 of 59, `agc_driver_pointer_vsharp_sibling_key_spill_table` included; no skip, no `VUID-` line, and the layer is inserted. **Not in this PR** (#18107): the title's next refusal, at `pc=0xa88c`, is two S#s (A+0x90 and A+0xa0) read by one `s_buffer_load_dwordx8` through A's handle. `TryMakeTableColumn` requires every read of the parent handle to be a word of the one descriptor it plans, so each S# is refused for the other's reads. Accepting reads whose users are only descriptors or lane spills takes the replay past `pc=0xa88c` to `pc=0x1149c`, a record pointer whose Phi has an arm read at P+0x1b0 through a V# loaded at P'+0x20 (#9633's conditional chase). ### 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: #15555 - [x] Fixes: none - [x] Unblocks: none yet (PPSA03016 #10195 needs the `pc=0xa88c` and `pc=0x1149c` steps too) - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Linux 7.2.14; NVIDIA RTX 3070, driver 610.57.04, Debian 13 (by Doorriiaann); AMD Radeon RX 6700 XT, Windows 11 (by JJenkx); NVIDIA RTX 3070 Ti and Intel UHD Graphics 630 (ANV), Linux (by Lucke0051); NVIDIA RTX 4090, Linux (by domx4q) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-21 06:15:55 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — comments

The prepared description reports broad GPU and validation testing, but I could not verify the full change or those runs from the available reader output.

What I ran

No test or build commands were run. I read the PR description, commits list, the first 400 lines of the manifest, and portions of the diff at head ef0cd48fbba606d9c6645de9b89383463e8437c1.

Results

Check Result Note
Source review not run Full changed-file review incomplete
Tests not run Only author-reported results available

Findings

Blocking

None verified.

Non-blocking

The review is incomplete; the source and test changes need inspection before a formal approval decision.

Not verified

The manifest is 2,175 lines and was only read through line 400. The diff is 2,779 lines and was only read through line 500 and lines 2,000–2,779; intervening changes were not inspected. ShaderMemory.cpp is excluded from the prepared files because it is too large, and its relevant source was not read. The reader invocation was unavailable, so I could not run the requested targeted repository searches or tests. I did not independently verify the author-reported GPU, validation-layer, or negative-control runs.

To get this to a good state

Nothing is required. Optional: complete targeted inspection of the remaining changed code and verify the reported checks before approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003435260 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18106#pullrequestreview-6003435260). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T06:15:55Z. **Review:** COMMENTED --- # Reviewed — comments The prepared description reports broad GPU and validation testing, but I could not verify the full change or those runs from the available reader output. ## What I ran No test or build commands were run. I read the PR description, commits list, the first 400 lines of the manifest, and portions of the diff at head `ef0cd48fbba606d9c6645de9b89383463e8437c1`. ## Results | Check | Result | Note | |---|---|---| | Source review | not run | Full changed-file review incomplete | | Tests | not run | Only author-reported results available | ## Findings ### Blocking None verified. ### Non-blocking The review is incomplete; the source and test changes need inspection before a formal approval decision. ## Not verified The manifest is 2,175 lines and was only read through line 400. The diff is 2,779 lines and was only read through line 500 and lines 2,000–2,779; intervening changes were not inspected. `ShaderMemory.cpp` is excluded from the prepared files because it is too large, and its relevant source was not read. The reader invocation was unavailable, so I could not run the requested targeted repository searches or tests. I did not independently verify the author-reported GPU, validation-layer, or negative-control runs. ## To get this to a good state Nothing is required. Optional: complete targeted inspection of the remaining changed code and verify the reported checks before approval.
MarcZX10 commented 2026-11-25 11:31:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T11:31:58Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the inspected implementation and reported validation support merging, with one changed test file excluded from the review bundle.

What I ran

Reviewed head 734a59bbf2477404fbe717c364eae4cfad400ab6. No commands or tests were run in this read-only review; the description’s test results are author-reported.

Results

Check Result Note
Source review passed Core logic and included tests inspected
Tests in this review not run GPU and platform checks are author-reported

Findings

Blocking

None in the inspected code.

Non-blocking

None.

Sources

Not verified

core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded from the review bundle because it was too large; only the targeted changed ranges were read through repo_read.py. Other changed files and hunks outside the targeted ranges were not read. Runtime behavior, builds, and reported test runs were not independently verified. The other changed files reviewed were ShaderDiskCache.cpp, agc_driver_image_table_tests.cmake, BdaAnchorReads.cpp, ImageTable.cpp, ImageTableAbi.hpp, ControlFlowInfo.hpp, ResourceMaterializer.cpp, ResourceTracker.cpp, ShaderDiskCache.hpp, SpirvEmitterState.hpp, SpirvBdaRead.cpp, SpirvMemoryInstructions.cpp, and docs/dev/debt/shader.md.

To get this to a good state

Nothing is required. Optional: include the excluded ShaderMemory.cpp changes in a reviewable bundle.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6056830463 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18106#pullrequestreview-6056830463). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T11:31:58Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the inspected implementation and reported validation support merging, with one changed test file excluded from the review bundle. ## What I ran Reviewed head `734a59bbf2477404fbe717c364eae4cfad400ab6`. No commands or tests were run in this read-only review; the description’s test results are author-reported. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Core logic and included tests inspected | | Tests in this review | not run | GPU and platform checks are author-reported | ## Findings ### Blocking None in the inspected code. ### Non-blocking None. ## Sources - [ResourceTracker.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/734a59bbf2477404fbe717c364eae4cfad400ab6/core/shader/recompiler/Optimization/src/ResourceTracker.cpp) - [ResourceMaterializer.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/734a59bbf2477404fbe717c364eae4cfad400ab6/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp) - [SpirvBdaRead.cpp at reviewed head](https://github.com/boykopovar/AnyPS5/blob/734a59bbf2477404fbe717c364eae4cfad400ab6/core/shader/recompiler/SpirvBackend/src/SpirvBdaRead.cpp) ## Not verified `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was excluded from the review bundle because it was too large; only the targeted changed ranges were read through `repo_read.py`. Other changed files and hunks outside the targeted ranges were not read. Runtime behavior, builds, and reported test runs were not independently verified. The other changed files reviewed were `ShaderDiskCache.cpp`, `agc_driver_image_table_tests.cmake`, `BdaAnchorReads.cpp`, `ImageTable.cpp`, `ImageTableAbi.hpp`, `ControlFlowInfo.hpp`, `ResourceMaterializer.cpp`, `ResourceTracker.cpp`, `ShaderDiskCache.hpp`, `SpirvEmitterState.hpp`, `SpirvBdaRead.cpp`, `SpirvMemoryInstructions.cpp`, and `docs/dev/debt/shader.md`. ## To get this to a good state Nothing is required. Optional: include the excluded `ShaderMemory.cpp` changes in a reviewable bundle.
ligmaSec commented 2026-12-03 22:35:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:35:47Z.

Review: COMMENTED


The trial merge onto c1601e56d5 conflicts in the image-table test source and registration and in ShaderDiskCache.hpp. Please keep both lane-spilled descriptor words and lane-spilled keys in the focused check. Reusing the right descriptor with the wrong key can still select the wrong image. Reconcile cache format changes before running the composed shader-memory and BDA-anchor controls. Move the direct shader debt edit into a fragment.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179819377 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18106#pullrequestreview-6179819377). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:35:47Z. **Review:** COMMENTED --- The trial merge onto `c1601e56d5` conflicts in the image-table test source and registration and in `ShaderDiskCache.hpp`. Please keep both lane-spilled descriptor words and lane-spilled keys in the focused check. Reusing the right descriptor with the wrong key can still select the wrong image. Reconcile cache format changes before running the composed shader-memory and BDA-anchor controls. Move the direct shader debt edit into a fragment. 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/18106:upstream-pr/18106'
git switch 'upstream-pr/18106'

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