fix(shader): plan several descriptors read by one load through a re-read nested V# #18107

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

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


What

This is stacked on #18106 (lane spills of a re-read nested V#'s words and keys), and through it on #15555, #9969, #9790, #9457, #8939 and #7395.

With #18106, Marvel's Spider-Man 2 (PPSA03016) gets past pc=0xa5b0 and pc=0xa6ac and stops at the first dispatch of the same compute shader, at the next refusal:

GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a88c(GetBufferResource(LoadAddressU32@pc=0x0000a488(GetAddressResource(Phi(...

The V# A at P+0x70 (pc 0xa488) is the one #18106 already handles. Here one s_buffer_load_dwordx8 through A reads two S#s, A+0x90 and A+0xa0, and spills every word:

%18506 = GetBufferResource %17936, %17937, %17938, %17939          A, uses=8
%18507..%18514 = ReadConstBuffer %18506 [pc=0xa88c off=0x90..0xac]   each with 2 uses:
%18516..%18523 = WriteLane %18514..%18507, 0x1d..0x16, ...            a lane spill
%18525 = GetSamplerResource %18511, %18512, %18513, %18514            S# at +0xa0
         GetSamplerResource %18507, %18508, %18509, %18510            S# at +0x90

#9790 plans several T#s or S#s from one V#, but only when each comes through its own buffer handle: TryMakeTableColumn still requires every read through the child's handle to be a word of the one descriptor it plans. With one wide load, each S# is refused because of the other's four words.

The change (ResourceTracker.cpp):

  1. Planning: that requirement is dropped for a V# the dispatch reads again (RereadableVsharp). The handle then goes through the check #9790 and #15555 already apply to a V#'s other handles: every read through it is a ReadConstBuffer whose value feeds a T# or S# (#9790), or a key word (#15555). Each descriptor is planned at its own offset, and both share the one parent column. A V# that is not read again keeps the old rule.
  2. Rewriting: reads through a planned parent handle that no planned column consumes were sent to an unrewritten copy of the handle only when they were in a column's reads. They are now taken from the handle's own uses, so a read through the shared handle that no column consumes (a key word, or a word that also feeds a lane spill) reads the guest's V# instead of the rewritten handle. For the handles accepted before, the two sets are the same, since all their reads were in the one column's reads.

docs/dev/debt/shader.md gets one entry for this, next to #18106's.

Overlap: no open PR changes this check. The heapHandle->Uses() line is the same on #7395, #8939, #9457, #9633, #9749, #9790, #9969, #14853, #14904, #16472, #16631, #16812, #16814 and #17863 (searched for the message, 0xa88c, s_buffer_load_dwordx8, two or several S#s, one handle, again on 2026-11-10). #16812 and #16814 touch the next lines of the same function, so they conflict with this PR as they do with #18106.

Tested

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

  • New tests (ImageTable.cpp), assembled with llvm-mc -triple=amdgcn -mcpu=gfx1030 -mattr=+wavefrontsize64:
    • agc_driver_pointer_vsharp_sampler_pair_table (--pointer-vsharp-sampler-pair): #9790's shared-V# shader with one s_buffer_load_dwordx8 at +0x20 of the V# behind the record pointer reading two S#s, each sampling the T# at +0x0 (one PointWrap, one PointClamp). Both samples are checked per lane through the taken records, swapped S#s, a moved record pointer and a moved V#, without a recompile.
    • agc_driver_pointer_vsharp_sampler_pair_spill_table (--pointer-vsharp-sampler-pair-spill): the same with each S#'s word 0 also written to lanes 0 and 1 of v6 (v_writelane_b32), the title's shape. The lanes are checked too: they hold the S# words of the last waterfall iteration's V#, including after the swap. On a device whose subgroup is narrower than 32 lanes, such as lavapipe's 8, the lanes aren't checked, and the texels still are. With no spanned wave there, each host subgroup runs its own pass of the wave64 waterfall, and v_writelane_b32 to lane 0 or 1 writes lanes 0 or 1 of every host subgroup (EmitWriteLane compares with SubgroupLocalInvocationId). main's agc_driver_write_lane skips below a wave32 for the same reason.
    • agc_driver_pointer_vsharp_sibling_key_wide_table (--pointer-vsharp-sibling-key-wide): #15555's sibling-key shader with the key word (+0x14) and the S# (+0x20) read by one s_buffer_load_dwordx8 at +0x10 instead of two loads. #15555's checks run unchanged.
  • Negative controls (only ResourceTracker.cpp changed, tests kept):
    • #18106's file, on #18106 merged with main 22e33e9031: all three new tests fail with GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000a4(GetBufferResource(LoadAddressU32@pc=0x00000090(... (the sibling-key one at pc=0x0000009c), the title's refusal.
    • On the earlier base (#18106 on #15555's caf94d99ce), without the rewriting hunk (2): the two S#-pair tests pass, and the sibling-key one faults ("keys 2 and 5 ... faulted"): its key word is read through the rewritten handle.
    • The "not read again" refusal has no red: none of these shapes has a V# that is not read again.
  • 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:
    • #18106: 50 tests, 49 pass and agc_driver_image_table_vouched_lookups skips (the device reports written imported pages);
    • this branch: 53 tests, 52 pass, the same skip; the three new ones pass.
    • Neither log has a VUID- line or "was not found but was requested".
  • tools/check_conventions.py with this title and description, against #18106 and against main: "All conventions checks passed." (exit 0).
  • The title's request, agc_shader_replay --prepare of the captured shader_11e2b64b00.prepare.req: #18106 refuses at pc=0xa88c. With this change it plans past it and refuses at pc=0x1149c, GetImageResource ... ReadConstBuffer@pc=0x0001149c(GetBufferResource(LoadAddressU32@pc=0x00011368(GetAddressResource(Phi(... ReadConstBuffer@pc=0x00010618 ...: a V# behind a pointer that a conditional chase replaces (#9633's shape). With #9633 f086739418 merged on top, the request prepares (2,240,230 SPIR-V words).
  • 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 + #18106 + a local port of mrfelek's lazy-table prototype (#10195):
    • without this change, 3 runs: all stop at the first dispatch of that shader, at 201, 211 and 193 s, on GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a88c(...;
    • with it, 3 runs: no refusal at pc=0xa88c. All three stop at the same dispatch (201, 145 and 143 s; the dispatch came earlier in the last two runs) on the next refusal, GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0001149c(GetBufferResource(LoadAddressU32@pc=0x00011368(..., #9633's shape;
    • both: process VRAM peaks at 4.09-4.15 GB, no amdgpu kernel message.
    • With #9633 merged on top as well (local, 3 runs), the shader is planned and compiled: the run logs no refusal, and the game stops presenting at that point while RADV builds the 1,590,109-word pipeline. Its memory then grows past 20 GB plus 4 GB of swap (killed at 261, 161 and 172 s). The pipeline, captured with APS5_DUMP_COMPUTE_PIPELINES and built alone, reaches a 12 GB limit in 10 s; it makes 2,719 record_bda_fault and 1,831 read_bda_span calls, the shape of #13538. That is outside this PR.

On current main. The head, 8733208620, merges #18106's new head 734a59bbf2 (#15555's 215d1820e3, #9969's 78bdc14492, main bfcd717ebc). Its lavapipe commit, ebca9fd5ad, checks the spilled lanes only where the host subgroup holds 32 lanes or more: on lavapipe (Mesa 26.2.7, subgroup 8), agc_driver_pointer_vsharp_sampler_pair_spill_table failed 3 of 3 before it and passes 3 of 3 with it, and on the RX 9070 XT it runs the full check. 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 62 tests: 61 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.*)$', 3 runs on each side.
    • main 3eb7a74e1c (the merge base): 4 tests, all pass.
    • This PR at 01dc143652: 25 tests, all pass, #15555's and #18106's included. No VUID- line, and the layer was found.
    • Negative controls, this PR's ImageTable.cpp and test CMake file, 2 runs each: on #18106's head 284a1fd4fb, the three new tests fail 2 of 2 with GetSamplerResource dword 0 is not a valid runtime value, and #18106's and #15555's sibling-key tests pass; on #15555's head 77b4696698, the same three fail, and so does #18106's agc_driver_pointer_vsharp_sibling_key_spill_table.
  • Windows, by JJenkx (comment): this PR at 01dc143652 merged onto main, Windows 11 Enterprise 22621, RX 6700 XT (AMD driver 26.10.1), MinGW-w64 GCC 15.2 UCRT, Release. The 77 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 01dc143652 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 22 new tests pass 3 of 3 alone. No validation layer there.
  • NVIDIA and lavapipe at the current head, by Doorriiaann (comment): ebca9fd5ad against its merge base main 6db6a3e927, RTX 3070 (NVIDIA 610.57.04, subgroup 32) and lavapipe (Mesa 25.0.7, subgroup 8), Debian 13, GCC 13.3.0, Release, validation layer 1.4.335. It builds with GCC. agc_driver_pointer_vsharp_sampler_pair_spill_table passes 50 of 50 on both: the RTX 3070 checks the spilled lanes, and lavapipe skips them. The validation selection passes 3 of 3 on the RTX 3070: 39 tests on main and 61 here, 22 of them new. No VUID- line, and the layer is inserted in every log.

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: #18106, #15555
  • Fixes: none
  • Unblocks: none yet (PPSA03016 #10195 also needs #9633 for pc=0x1149c)
  • 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); lavapipe (Mesa 26.2.7) for the spill test; lavapipe (Mesa 25.0.7, by Doorriiaann)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5241454417 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18107). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-11-10T12:42:47Z. --- ### What This is stacked on #18106 (lane spills of a re-read nested V#'s words and keys), and through it on #15555, #9969, #9790, #9457, #8939 and #7395. With #18106, Marvel's Spider-Man 2 (PPSA03016) gets past `pc=0xa5b0` and `pc=0xa6ac` and stops at the first dispatch of the same compute shader, at the next refusal: ``` GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a88c(GetBufferResource(LoadAddressU32@pc=0x0000a488(GetAddressResource(Phi(... ``` The V# A at P+0x70 (pc 0xa488) is the one #18106 already handles. Here one `s_buffer_load_dwordx8` through A reads **two** S#s, A+0x90 and A+0xa0, and spills every word: ``` %18506 = GetBufferResource %17936, %17937, %17938, %17939 A, uses=8 %18507..%18514 = ReadConstBuffer %18506 [pc=0xa88c off=0x90..0xac] each with 2 uses: %18516..%18523 = WriteLane %18514..%18507, 0x1d..0x16, ... a lane spill %18525 = GetSamplerResource %18511, %18512, %18513, %18514 S# at +0xa0 GetSamplerResource %18507, %18508, %18509, %18510 S# at +0x90 ``` #9790 plans several T#s or S#s from one V#, but only when each comes through its own buffer handle: `TryMakeTableColumn` still requires every read through the child's handle to be a word of the one descriptor it plans. With one wide load, each S# is refused because of the other's four words. **The change** (`ResourceTracker.cpp`): 1. **Planning:** that requirement is dropped for a V# the dispatch reads again (`RereadableVsharp`). The handle then goes through the check #9790 and #15555 already apply to a V#'s other handles: every read through it is a `ReadConstBuffer` whose value feeds a T# or S# (#9790), or a key word (#15555). Each descriptor is planned at its own offset, and both share the one parent column. A V# that is not read again keeps the old rule. 2. **Rewriting:** reads through a planned parent handle that no planned column consumes were sent to an unrewritten copy of the handle only when they were in a column's `reads`. They are now taken from the handle's own uses, so a read through the shared handle that no column consumes (a key word, or a word that also feeds a lane spill) reads the guest's V# instead of the rewritten handle. For the handles accepted before, the two sets are the same, since all their reads were in the one column's `reads`. `docs/dev/debt/shader.md` gets one entry for this, next to #18106's. **Overlap:** no open PR changes this check. The `heapHandle->Uses()` line is the same on #7395, #8939, #9457, #9633, #9749, #9790, #9969, #14853, #14904, #16472, #16631, #16812, #16814 and #17863 (searched for the message, `0xa88c`, `s_buffer_load_dwordx8`, two or several S#s, one handle, again on 2026-11-10). #16812 and #16814 touch the next lines of the same function, so they conflict with this PR as they do with #18106. ### Tested Linux 7.2.14, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests. - **New tests** (`ImageTable.cpp`), assembled with `llvm-mc -triple=amdgcn -mcpu=gfx1030 -mattr=+wavefrontsize64`: - `agc_driver_pointer_vsharp_sampler_pair_table` (`--pointer-vsharp-sampler-pair`): #9790's shared-V# shader with one `s_buffer_load_dwordx8` at +0x20 of the V# behind the record pointer reading two S#s, each sampling the T# at +0x0 (one PointWrap, one PointClamp). Both samples are checked per lane through the taken records, swapped S#s, a moved record pointer and a moved V#, without a recompile. - `agc_driver_pointer_vsharp_sampler_pair_spill_table` (`--pointer-vsharp-sampler-pair-spill`): the same with each S#'s word 0 also written to lanes 0 and 1 of `v6` (`v_writelane_b32`), the title's shape. The lanes are checked too: they hold the S# words of the last waterfall iteration's V#, including after the swap. On a device whose subgroup is narrower than 32 lanes, such as lavapipe's 8, the lanes aren't checked, and the texels still are. With no spanned wave there, each host subgroup runs its own pass of the wave64 waterfall, and `v_writelane_b32` to lane 0 or 1 writes lanes 0 or 1 of every host subgroup (`EmitWriteLane` compares with `SubgroupLocalInvocationId`). `main`'s `agc_driver_write_lane` skips below a wave32 for the same reason. - `agc_driver_pointer_vsharp_sibling_key_wide_table` (`--pointer-vsharp-sibling-key-wide`): #15555's sibling-key shader with the key word (+0x14) and the S# (+0x20) read by one `s_buffer_load_dwordx8` at +0x10 instead of two loads. #15555's checks run unchanged. - **Negative controls** (only `ResourceTracker.cpp` changed, tests kept): - #18106's file, on #18106 merged with `main` 22e33e9031: all three new tests fail with `GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000a4(GetBufferResource(LoadAddressU32@pc=0x00000090(...` (the sibling-key one at `pc=0x0000009c`), the title's refusal. - On the earlier base (#18106 on #15555's `caf94d99ce`), without the rewriting hunk (2): the two S#-pair tests pass, and the sibling-key one faults ("keys 2 and 5 ... faulted"): its key word is read through the rewritten handle. - The "not read again" refusal has no red: none of these shapes has a V# that is not read again. - **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: - #18106: 50 tests, 49 pass and `agc_driver_image_table_vouched_lookups` skips (the device reports written imported pages); - this branch: 53 tests, 52 pass, the same skip; the three new ones pass. - Neither log has a `VUID-` line or "was not found but was requested". - `tools/check_conventions.py` with this title and description, against #18106 and against `main`: "All conventions checks passed." (exit 0). - **The title's request,** `agc_shader_replay --prepare` of the captured `shader_11e2b64b00.prepare.req`: #18106 refuses at `pc=0xa88c`. With this change it plans past it and refuses at `pc=0x1149c`, `GetImageResource ... ReadConstBuffer@pc=0x0001149c(GetBufferResource(LoadAddressU32@pc=0x00011368(GetAddressResource(Phi(... ReadConstBuffer@pc=0x00010618 ...`: a V# behind a pointer that a conditional chase replaces (#9633's shape). With #9633 f086739418 merged on top, the request prepares (2,240,230 SPIR-V words). - **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 + #18106 + a local port of mrfelek's lazy-table prototype (#10195): - without this change, 3 runs: all stop at the first dispatch of that shader, at 201, 211 and 193 s, on `GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000a88c(...`; - with it, 3 runs: no refusal at `pc=0xa88c`. All three stop at the same dispatch (201, 145 and 143 s; the dispatch came earlier in the last two runs) on the next refusal, `GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0001149c(GetBufferResource(LoadAddressU32@pc=0x00011368(...`, #9633's shape; - both: process VRAM peaks at 4.09-4.15 GB, no amdgpu kernel message. - With #9633 merged on top as well (local, 3 runs), the shader is planned and compiled: the run logs no refusal, and the game stops presenting at that point while RADV builds the 1,590,109-word pipeline. Its memory then grows past 20 GB plus 4 GB of swap (killed at 261, 161 and 172 s). The pipeline, captured with `APS5_DUMP_COMPUTE_PIPELINES` and built alone, reaches a 12 GB limit in 10 s; it makes 2,719 `record_bda_fault` and 1,831 `read_bda_span` calls, the shape of #13538. That is outside this PR. **On current `main`.** The head, `8733208620`, merges #18106's new head `734a59bbf2` (#15555's `215d1820e3`, #9969's `78bdc14492`, `main` bfcd717ebc). Its lavapipe commit, `ebca9fd5ad`, checks the spilled lanes only where the host subgroup holds 32 lanes or more: on lavapipe (Mesa 26.2.7, subgroup 8), `agc_driver_pointer_vsharp_sampler_pair_spill_table` failed 3 of 3 before it and passes 3 of 3 with it, and on the RX 9070 XT it runs the full check. 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 62 tests: 61 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/18107#issuecomment-6768584977)): 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.*)$'`, 3 runs on each side. - `main` 3eb7a74e1c (the merge base): 4 tests, all pass. - This PR at `01dc143652`: 25 tests, all pass, #15555's and #18106's included. No `VUID-` line, and the layer was found. - Negative controls, this PR's `ImageTable.cpp` and test CMake file, 2 runs each: on #18106's head `284a1fd4fb`, the three new tests fail 2 of 2 with `GetSamplerResource dword 0 is not a valid runtime value`, and #18106's and #15555's sibling-key tests pass; on #15555's head `77b4696698`, the same three fail, and so does #18106's `agc_driver_pointer_vsharp_sibling_key_spill_table`. - **Windows, by JJenkx** ([comment](https://github.com/boykopovar/AnyPS5/pull/18107#issuecomment-6769025351)): this PR at `01dc143652` merged onto `main`, Windows 11 Enterprise 22621, RX 6700 XT (AMD driver 26.10.1), MinGW-w64 GCC 15.2 UCRT, Release. The 77 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/18107#issuecomment-6802667326)): this PR at `01dc143652` 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 22 new tests pass 3 of 3 alone. No validation layer there. - **NVIDIA and lavapipe at the current head, by Doorriiaann** ([comment](https://github.com/boykopovar/AnyPS5/pull/18107#issuecomment-7013707923)): `ebca9fd5ad` against its merge base `main` 6db6a3e927, RTX 3070 (NVIDIA 610.57.04, subgroup 32) and lavapipe (Mesa 25.0.7, subgroup 8), Debian 13, GCC 13.3.0, Release, validation layer 1.4.335. It builds with GCC. `agc_driver_pointer_vsharp_sampler_pair_spill_table` passes 50 of 50 on both: the RTX 3070 checks the spilled lanes, and lavapipe skips them. The validation selection passes 3 of 3 on the RTX 3070: 39 tests on `main` and 61 here, 22 of them new. No `VUID-` line, and the layer is inserted in every log. ### 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: #18106, #15555 - [x] Fixes: none - [x] Unblocks: none yet (PPSA03016 #10195 also needs #9633 for `pc=0x1149c`) - [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); lavapipe (Mesa 26.2.7) for the spill test; lavapipe (Mesa 25.0.7, by Doorriiaann) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-21 06:15:14 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the description and inspected code support the shared-handle re-read behavior, while this review did not run the reported tests.

What I ran

Reviewed head 7781fb42efb44a1933047bdf399f5d3d253e1d64 using repo_read.py to inspect the prepared description, commit list, manifest, diff, changed source, and targeted tests. No build or test commands were run.

Results

Check Result Note
Source review passed Tracker logic and targeted tests inspected
Build and tests not run Only author and CI results are reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

The oversized changed file core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was not read. Other changed files were not individually reviewed; in particular, runtime materialization, SPIR-V emission, disk-cache compatibility, and test execution are not verified. The reported test runs were not independently reproduced.

Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, core/shader/recompiler/Optimization/src/ResourceTracker.cpp, core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_tests.cmake, and core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp.

Files excluded by the bundle: core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp (too large). The manifest lists additional changed files that were not read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003429164 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18107#pullrequestreview-6003429164). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T06:15:14Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the description and inspected code support the shared-handle re-read behavior, while this review did not run the reported tests. ## What I ran Reviewed head `7781fb42efb44a1933047bdf399f5d3d253e1d64` using `repo_read.py` to inspect the prepared description, commit list, manifest, diff, changed source, and targeted tests. No build or test commands were run. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Tracker logic and targeted tests inspected | | Build and tests | not run | Only author and CI results are reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The oversized changed file `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was not read. Other changed files were not individually reviewed; in particular, runtime materialization, SPIR-V emission, disk-cache compatibility, and test execution are not verified. The reported test runs were not independently reproduced. Files read: `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/diff.patch`, `core/shader/recompiler/Optimization/src/ResourceTracker.cpp`, `core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp`, `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_tests.cmake`, and `core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp`. Files excluded by the bundle: `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` (too large). The manifest lists additional changed files that were not read. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-25 11:30:25 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change based on the code inspected; approval is not justified because the broad change is not fully reviewed.

What I ran

  • Head: 8733208620d2d41becf473f2ea87536712ada300.
  • Read the prepared description, commit list, manifest, and diff. No build or tests were run.
  • Read targeted portions of ResourceTracker.cpp, ResourceMaterializer.cpp, ImageTableAbi.hpp, SpirvBdaRead.cpp, and the excluded ShaderMemory.cpp through repo_read.py.

Results

Check Result Note
Prepared diff review passed Change claims checked against sampled code
Build and tests not run Results in the description are author supplied

Findings

Blocking

None in the code inspected.

Non-blocking

None.

Not verified

  • The changes are broad: pointer-keyed record and nested table analysis, descriptor rewriting, BDA reads, cache encoding, and snapshot resolution. I sampled these changes but did not read every changed hunk or every reviewed file, so the complete behavior is not verified.
  • core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded from files/ as too large; only its changed ranges and targeted context were read through repo_read.py.
  • No tests or build were run. The reported GPU runs, negative controls, and validation-layer results were not independently confirmed.

To get this to a good state

Nothing is required. Optional: run the reported validation selection and build against this exact head, then review the remaining changed code before making a formal approval decision.

Files read: description.md, commits.md, manifest.json, diff.patch, ShaderMemory.cpp (targeted ranges), ResourceTracker.cpp, ResourceMaterializer.cpp, ImageTableAbi.hpp, and SpirvBdaRead.cpp. The other changed files listed in manifest.json were not read in full; ShaderMemory.cpp was excluded from the prepared files/ folder.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6056811073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18107#pullrequestreview-6056811073). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T11:30:25Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change based on the code inspected; approval is not justified because the broad change is not fully reviewed. ## What I ran - Head: `8733208620d2d41becf473f2ea87536712ada300`. - Read the prepared description, commit list, manifest, and diff. No build or tests were run. - Read targeted portions of `ResourceTracker.cpp`, `ResourceMaterializer.cpp`, `ImageTableAbi.hpp`, `SpirvBdaRead.cpp`, and the excluded `ShaderMemory.cpp` through `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Prepared diff review | passed | Change claims checked against sampled code | | Build and tests | not run | Results in the description are author supplied | ## Findings ### Blocking None in the code inspected. ### Non-blocking None. ## Not verified - The changes are broad: pointer-keyed record and nested table analysis, descriptor rewriting, BDA reads, cache encoding, and snapshot resolution. I sampled these changes but did not read every changed hunk or every reviewed file, so the complete behavior is not verified. - `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was excluded from `files/` as too large; only its changed ranges and targeted context were read through `repo_read.py`. - No tests or build were run. The reported GPU runs, negative controls, and validation-layer results were not independently confirmed. ## To get this to a good state Nothing is required. Optional: run the reported validation selection and build against this exact head, then review the remaining changed code before making a formal approval decision. Files read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `ShaderMemory.cpp` (targeted ranges), `ResourceTracker.cpp`, `ResourceMaterializer.cpp`, `ImageTableAbi.hpp`, and `SpirvBdaRead.cpp`. The other changed files listed in `manifest.json` were not read in full; `ShaderMemory.cpp` was excluded from the prepared `files/` folder.
ligmaSec commented 2026-12-03 22:35:45 +00:00 (Migrated from github.com)

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

Review: COMMENTED


The trial merge onto c1601e56d5 conflicts in the image-table test source and registration and in ShaderDiskCache.hpp. I verified that this exact head contains #18106. Please retain the case where one vector load supplies distinct sampler descriptors, including distinct keys after the spill. A single-sampler fixture can pass while the new planning still conflates two read consumers. Reconcile the schema and move the direct shader debt edit into a fragment on the resolved head.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179818985 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18107#pullrequestreview-6179818985). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:35:45Z. **Review:** COMMENTED --- The trial merge onto `c1601e56d5` conflicts in the image-table test source and registration and in `ShaderDiskCache.hpp`. I verified that this exact head contains #18106. Please retain the case where one vector load supplies distinct sampler descriptors, including distinct keys after the spill. A single-sampler fixture can pass while the new planning still conflates two read consumers. Reconcile the schema and move the direct shader debt edit into a fragment on the resolved head. 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/18107:upstream-pr/18107'
git switch 'upstream-pr/18107'

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