fix(shader): accept a nested S# whose V# gives the key of a sibling V#'s T# array #15555

Open
hugodearaujo wants to merge 165 commits from upstream-pr/15555 into main
hugodearaujo commented 2026-11-03 18:44:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-11-03T18:44:41Z.


What

Marvel's Spider-Man 2 (PPSA03016 01.004.003), with #9969 applied, stops on a compute shader whose S# the recompiler refuses:

ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00008ec0(GetBufferResource(LoadAddressU32@pc=0x00008e44(...

The same block also appears 0xbb8 higher, at pc 0x9a78 / 0x99fc. The shape, from the IR posted on #9790 on 2026-11-02:

V# A = 4 words at P+0x50, P = a record pointer
key  = A's word at +0x0 >> 16
V# B = 4 words at P+0x10, same pointer P
T#   = B's buffer at (key >> 16) << 5      (s_buffer_load_dwordx8)
S#   = A's buffer at +0xa0..0xac

#9969 handles a key word whose T# reads go through the same V#. Here the key read through A indexes B. ChildKeyWord required the T# reads to use the key's own handle, so DescriptorWordReads refused A's key read, and with it the S# column read through A.

ChildKeyWord now also accepts T# reads through a sibling V# when DescriptorWordReads asks on behalf of a V# that is read again at dispatch. A sibling is a GetBufferResource whose four words are LoadAddressU32s from the same, or an equivalent, GetAddressResource as the key's V#. Nothing else changes:

  • The key stays the guest's value. The key's V# is read again at dispatch, as for #9969's child keys.
  • B's T# column is not narrowed. MatchChildKey still requires the same handle, so the column falls back to MatchKeyDomain: B's table binds every key the key's known bits allow, up to B's num_records. Narrowing it would need the materializer to read the key from the other V#'s buffer.
  • Other uses stay refused. That includes a key that feeds anything other than the offset arithmetic, and a sibling loaded through another pointer.

The debt entry for nested image tables records this form and its limits.

Tested

Arch Linux (kernel 7.2.14), AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.6), Release. The branch is #9969's head 5f70ec884e plus the three commits of this PR, joined by a merge (77b4696698).

New test agc_driver_pointer_vsharp_sibling_key_table (agc_driver_image_table_tests --pointer-vsharp-sibling-key). It uses #9969's child-key shader with the T# array in a second V# loaded through the same record pointer. A's buffer holds the key and the S#. B's buffer holds the T# array, plus a decoy key and the opposite S# at the same offsets, so reading A's words from B would show up. It checks:

  • keys 2 and 5;
  • the largest key inside B;
  • swapped S#s;
  • a moved record pointer;
  • keys past B, which read a null T# as the hardware's scalar load does.

None of these recompile the shader.

Paired validation of the 21 agc_driver_(nested_image_table.*|nested_sampler_table|pointer_.*_table|image_table) tests, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=layer:

tree result VUID- lines "was not found but was requested"
this branch, ResourceTracker.cpp from 5f70ec884e 20 of 21; the new test fails with the title's refusal (below) 0 0
this branch 21 of 21 0 0

On the base, the new test fails the way the title does:

ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000c0(GetBufferResource(LoadAddressU32@pc=0x00000090(GetAddressResource(Phi(...

The validation layer was inserted in every test of both runs. The 63 ^shader|^agc_shader tests pass on this branch. These results are from the merge of 5f70ec884e (2026-11-10), built with main eaec74e322 merged on top locally; the same pair on the earlier bases 0ef70b4bcb, ce65f496e6, 5a8c3cc229, c147aa8647 and 9e7ac69470 gave the same counts.

Title: Spider-Man 2, relinked with --module-dir . --registry, fresh shader cache, Cross every 30 s, until the first stop. Base: main 4f41f4c375 + #9969 9e7ac69470 + #8939 58ebe4b440 + #13646 17770dd69f + #15399 7a9ecdc365. #13646 keeps the bindless table's textures inside VRAM, and #15399 stops an intermittent runtime resource snapshot did not stabilize.

  • Without this change (one run): stops at 65 s on the refusal above, at pc 0x8ec0. Two runs on #9969's earlier head stopped on the same refusal, at 0x9a78 after 187 s and at 0x8ec0 after 148 s.
  • With it (two runs): no recompile refusal.
    • One run reached its 600 s limit, with the title's internal RenderFrameIndex at 5683. The refusing runs stopped at frame 1460 (this base) and at frames 4856 and 5015 (the earlier head).
    • The other reached frame 5425, the last one it logged. Then VRAM filled (sampled textures at 7.6 GB, device-local heap 1 uses 16314 of its 16304 MiB budget), and my memory guard stopped it at 161 s. That fill comes from the bindless table (#10195), not from this change.

Not verified: the picture. On this machine the bench's screenshots of this title are black after about 60 s in every run, with or without this change, so I can't judge the rendering. The new test checks the selected T# and S# against the guest's own.

On current main. The head, 215d1820e3, merges #9969's current head 78bdc14492 and then main bfcd717ebc into this branch. The disk cache format is #9969's, 102, above main's 96; this branch changes no encoded structure itself. The windows job's GCC error in possibleU32BitsDepth from the 11-14 merge of main stays fixed: the ShiftRightLogical32 case calls possibleU32BitsDepth, as on #9969. 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 58 tests: 57 pass and agc_driver_image_table_vouched_lookups skips (the device reports written imported pages). 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.

  • Linux, by Lucke0051 (comment): this PR at 77b4696698 merged onto main 07ae6afcee, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, ctest -R '^(agc|video_out|shader)' without the validation layer, compared with main on the same machine. On an NVIDIA RTX 3070 Ti (615.78.08) and an Intel UHD Graphics 630 (Mesa 26.2.6) there is no difference from main, and the 18 new tests pass on both.
  • Linux and Windows, by milescoviello (comment, re-run on this head): 77b4696698 and its merge base 3eb7a74e1c, agc_shader_disk_cache_tests, agc_shader_memory_tests and agc_driver_image_table_tests, 3 runs each, Release. Ubuntu 26.04.1 with an RTX 4070 Ti (NVIDIA 615.71.09, GCC 15.2), and a Windows 11 VM with a GeForce GT 1030 (NVIDIA 582.78, WinLibs GCC 15.2 UCRT). The 18 new tests pass 3 of 3 on both machines, and no other test differs between the base and the head. On the Windows VM, 16 agc_driver_image_table_* tests fail 3 of 3 on both sides.
  • Windows, AMD driver, by angrysandhill (comment): this PR at 77b4696698 merged onto main c5488026ab, Windows 10 22H2, AMD Radeon RX 6750 XT (Adrenalin 26.10.1), WinLibs GCC 15.2 UCRT, Release, no validation layer. The 22 ^(agc_driver_(nested|pointer)_.*|agc_shader_nested_.*)$ tests, the 18 new ones included, pass 3 of 3. In three full ^(agc_|windows_write_watch$) runs (1,601 tests), compared per test with main on the same card: one run had a start-up crash in agc_driver_draw_cache_reuse_entry_verify (replace guest placeholder with private memory, in code this PR doesn't change; #15564 records it on main), and one, slowed by other work on the machine, had three GPU waits time out. Neither came back in the other runs or when run alone.
  • Spider-Man 2 on Linux, NVIDIA, by Tamalero (comment): main 56c80b0917 + mrfelek's lazy image tables (9db1fcd707) + this PR at 77b4696698, and the same build without this PR, one run each, RTX 4090 (NVIDIA 620.70.06), GCC 16.2.1, Release, fresh shader cache, Cross on the black screen about every 30 s. Both builds carry a local switch that drops a refused compute dispatch instead of stopping. Without this PR, the one dropped program refuses at pc 0x84bc (LoadAddressU32@0x84a8 ← the record at 0x1fc4), and bindless table 0 is never resolved. With it, the dropped program refuses at pc 0xa5b0 instead, the next stop in my runs too (#18106), and table 0 is resolved after the presses.
  • Windows, AMD driver, by Ethan-Hainline (comment): this PR at 77b4696698 merged onto main 510d0bf986, Windows 11 Pro, Radeon Vega iGPU (GCN, Ryzen 5 7530U), AMD driver 23.19.24.04, WinLibs GCC 16.2.0, Release, with the validation layer. The new agc_driver_pointer_vsharp_sibling_key_table passes 3 of 3, with no VUID- line.
  • NVIDIA on Linux with the validation layer, by domx4q (comment): d38090f95b merged onto main 40206fe50d, Arch Linux, RTX 4090 (NVIDIA 620.70.06), GCC 16.2.1, Release, layer 1.4.363.1, the command above. main 40 of 40, this PR 58 of 58, none skipped; no VUID- line, and the layer is inserted.

Checklist

  • Based on current main; no other open PR implements the same functions (#9969 and #9790 handle a key read through the T#'s own V#; this is the sibling-V# form neither covers)
  • 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: #9969 (this branch is its head plus three commits; until it merges, the diff against main also shows #9969's chain)
  • Fixes: none
  • Unblocks: PPSA03016 #10195 (the recompile refusal at pc 0x8ec0 / 0x9a78)
  • GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Arch Linux; NVIDIA RTX 3070 Ti and Intel UHD Graphics 630, Linux (by Lucke0051); NVIDIA RTX 4070 Ti (Linux) and GeForce GT 1030 (Windows 11 VM), by milescoviello; AMD Radeon RX 6750 XT, AMD driver 26.10.1, Windows 10, by angrysandhill; NVIDIA RTX 4090, Linux, in the title only, by Tamalero; AMD Radeon Vega iGPU (GCN), AMD driver 23.19.24.04, Windows 11, one test, by Ethan-Hainline
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5142691928 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15555). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-11-03T18:44:41Z. --- ### What Marvel's Spider-Man 2 (PPSA03016 01.004.003), with #9969 applied, stops on a compute shader whose S# the recompiler refuses: ``` ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00008ec0(GetBufferResource(LoadAddressU32@pc=0x00008e44(... ``` The same block also appears 0xbb8 higher, at pc 0x9a78 / 0x99fc. The shape, from the IR posted on #9790 on 2026-11-02: ``` V# A = 4 words at P+0x50, P = a record pointer key = A's word at +0x0 >> 16 V# B = 4 words at P+0x10, same pointer P T# = B's buffer at (key >> 16) << 5 (s_buffer_load_dwordx8) S# = A's buffer at +0xa0..0xac ``` #9969 handles a key word whose T# reads go through the same V#. Here the key read through A indexes B. `ChildKeyWord` required the T# reads to use the key's own handle, so `DescriptorWordReads` refused A's key read, and with it the S# column read through A. `ChildKeyWord` now also accepts T# reads through a **sibling V#** when `DescriptorWordReads` asks on behalf of a V# that is read again at dispatch. A sibling is a `GetBufferResource` whose four words are `LoadAddressU32`s from the same, or an equivalent, `GetAddressResource` as the key's V#. Nothing else changes: - **The key stays the guest's value.** The key's V# is read again at dispatch, as for #9969's child keys. - **B's T# column is not narrowed.** `MatchChildKey` still requires the same handle, so the column falls back to `MatchKeyDomain`: B's table binds every key the key's known bits allow, up to B's num_records. Narrowing it would need the materializer to read the key from the other V#'s buffer. - **Other uses stay refused.** That includes a key that feeds anything other than the offset arithmetic, and a sibling loaded through another pointer. The debt entry for nested image tables records this form and its limits. ### Tested Arch Linux (kernel 7.2.14), AMD Radeon RX 9070 XT (RADV GFX1201, Mesa 26.2.6), Release. The branch is #9969's head `5f70ec884e` plus the three commits of this PR, joined by a merge (`77b4696698`). **New test `agc_driver_pointer_vsharp_sibling_key_table`** (`agc_driver_image_table_tests --pointer-vsharp-sibling-key`). It uses #9969's child-key shader with the T# array in a second V# loaded through the same record pointer. A's buffer holds the key and the S#. B's buffer holds the T# array, plus a decoy key and the opposite S# at the same offsets, so reading A's words from B would show up. It checks: - keys 2 and 5; - the largest key inside B; - swapped S#s; - a moved record pointer; - keys past B, which read a null T# as the hardware's scalar load does. None of these recompile the shader. **Paired validation** of the 21 `agc_driver_(nested_image_table.*|nested_sampler_table|pointer_.*_table|image_table)` tests, with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=layer`: | tree | result | `VUID-` lines | "was not found but was requested" | |---|---|---|---| | this branch, `ResourceTracker.cpp` from `5f70ec884e` | 20 of 21; the new test fails with the title's refusal (below) | 0 | 0 | | this branch | 21 of 21 | 0 | 0 | On the base, the new test fails the way the title does: ``` ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000c0(GetBufferResource(LoadAddressU32@pc=0x00000090(GetAddressResource(Phi(... ``` The validation layer was inserted in every test of both runs. The 63 `^shader|^agc_shader` tests pass on this branch. These results are from the merge of `5f70ec884e` (2026-11-10), built with `main` eaec74e322 merged on top locally; the same pair on the earlier bases `0ef70b4bcb`, `ce65f496e6`, `5a8c3cc229`, `c147aa8647` and `9e7ac69470` gave the same counts. **Title:** Spider-Man 2, relinked with `--module-dir . --registry`, fresh shader cache, Cross every 30 s, until the first stop. Base: `main` 4f41f4c375 + #9969 `9e7ac69470` + #8939 `58ebe4b440` + #13646 `17770dd69f` + #15399 `7a9ecdc365`. #13646 keeps the bindless table's textures inside VRAM, and #15399 stops an intermittent `runtime resource snapshot did not stabilize`. - **Without this change (one run):** stops at 65 s on the refusal above, at pc 0x8ec0. Two runs on #9969's earlier head stopped on the same refusal, at 0x9a78 after 187 s and at 0x8ec0 after 148 s. - **With it (two runs):** no recompile refusal. - One run reached its 600 s limit, with the title's internal `RenderFrameIndex` at 5683. The refusing runs stopped at frame 1460 (this base) and at frames 4856 and 5015 (the earlier head). - The other reached frame 5425, the last one it logged. Then VRAM filled (sampled textures at 7.6 GB, `device-local heap 1 uses 16314 of its 16304 MiB budget`), and my memory guard stopped it at 161 s. That fill comes from the bindless table (#10195), not from this change. Not verified: the picture. On this machine the bench's screenshots of this title are black after about 60 s in every run, with or without this change, so I can't judge the rendering. The new test checks the selected T# and S# against the guest's own. **On current `main`.** The head, `215d1820e3`, merges #9969's current head `78bdc14492` and then `main` bfcd717ebc into this branch. The disk cache format is #9969's, 102, above `main`'s 96; this branch changes no encoded structure itself. The `windows` job's GCC error in `possibleU32BitsDepth` from the 11-14 merge of `main` stays fixed: the `ShiftRightLogical32` case calls `possibleU32BitsDepth`, as on #9969. 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 58 tests: 57 pass and `agc_driver_image_table_vouched_lookups` skips (the device reports written imported pages). 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.** - **Linux, by Lucke0051** ([comment](https://github.com/boykopovar/AnyPS5/pull/15555#issuecomment-6763647902)): this PR at `77b4696698` merged onto `main` 07ae6afcee, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, `ctest -R '^(agc|video_out|shader)'` without the validation layer, compared with `main` on the same machine. On an NVIDIA RTX 3070 Ti (615.78.08) and an Intel UHD Graphics 630 (Mesa 26.2.6) there is no difference from `main`, and the 18 new tests pass on both. - **Linux and Windows, by milescoviello** ([comment](https://github.com/boykopovar/AnyPS5/pull/15555#issuecomment-6731152948), re-run on this head): `77b4696698` and its merge base `3eb7a74e1c`, `agc_shader_disk_cache_tests`, `agc_shader_memory_tests` and `agc_driver_image_table_tests`, 3 runs each, Release. Ubuntu 26.04.1 with an RTX 4070 Ti (NVIDIA 615.71.09, GCC 15.2), and a Windows 11 VM with a GeForce GT 1030 (NVIDIA 582.78, WinLibs GCC 15.2 UCRT). The 18 new tests pass 3 of 3 on both machines, and no other test differs between the base and the head. On the Windows VM, 16 `agc_driver_image_table_*` tests fail 3 of 3 on both sides. - **Windows, AMD driver, by angrysandhill** ([comment](https://github.com/boykopovar/AnyPS5/pull/15555#issuecomment-6779008258)): this PR at `77b4696698` merged onto `main` `c5488026ab`, Windows 10 22H2, AMD Radeon RX 6750 XT (Adrenalin 26.10.1), WinLibs GCC 15.2 UCRT, Release, no validation layer. The 22 `^(agc_driver_(nested|pointer)_.*|agc_shader_nested_.*)$` tests, the 18 new ones included, pass 3 of 3. In three full `^(agc_|windows_write_watch$)` runs (1,601 tests), compared per test with `main` on the same card: one run had a start-up crash in `agc_driver_draw_cache_reuse_entry_verify` (`replace guest placeholder with private memory`, in code this PR doesn't change; #15564 records it on `main`), and one, slowed by other work on the machine, had three GPU waits time out. Neither came back in the other runs or when run alone. - **Spider-Man 2 on Linux, NVIDIA, by Tamalero** ([comment](https://github.com/boykopovar/AnyPS5/discussions/10195#discussioncomment-19533012)): `main` `56c80b0917` + mrfelek's lazy image tables (`9db1fcd707`) + this PR at `77b4696698`, and the same build without this PR, one run each, RTX 4090 (NVIDIA 620.70.06), GCC 16.2.1, Release, fresh shader cache, Cross on the black screen about every 30 s. Both builds carry a local switch that drops a refused compute dispatch instead of stopping. Without this PR, the one dropped program refuses at pc 0x84bc (`LoadAddressU32@0x84a8` ← the record at `0x1fc4`), and bindless table 0 is never resolved. With it, the dropped program refuses at pc 0xa5b0 instead, the next stop in my runs too (#18106), and table 0 is resolved after the presses. - **Windows, AMD driver, by Ethan-Hainline** ([comment](https://github.com/boykopovar/AnyPS5/pull/15555#issuecomment-6785619553)): this PR at `77b4696698` merged onto `main` `510d0bf986`, Windows 11 Pro, Radeon Vega iGPU (GCN, Ryzen 5 7530U), AMD driver 23.19.24.04, WinLibs GCC 16.2.0, Release, with the validation layer. The new `agc_driver_pointer_vsharp_sibling_key_table` passes 3 of 3, with no `VUID-` line. - **NVIDIA on Linux with the validation layer, by domx4q** ([comment](https://github.com/boykopovar/AnyPS5/pull/15555#issuecomment-7020624046)): `d38090f95b` merged onto `main` `40206fe50d`, Arch Linux, RTX 4090 (NVIDIA 620.70.06), GCC 16.2.1, Release, layer 1.4.363.1, the command above. `main` 40 of 40, this PR 58 of 58, none skipped; no `VUID-` line, and the layer is inserted. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (#9969 and #9790 handle a key read through the T#'s own V#; this is the sibling-V# form neither covers) - [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: #9969 (this branch is its head plus three commits; until it merges, the diff against `main` also shows #9969's chain) - [x] Fixes: none - [x] Unblocks: PPSA03016 #10195 (the recompile refusal at pc 0x8ec0 / 0x9a78) - [x] GPUs tested: AMD Radeon RX 9070 XT, RADV Mesa 26.2.6, Arch Linux; NVIDIA RTX 3070 Ti and Intel UHD Graphics 630, Linux (by Lucke0051); NVIDIA RTX 4070 Ti (Linux) and GeForce GT 1030 (Windows 11 VM), by milescoviello; AMD Radeon RX 6750 XT, AMD driver 26.10.1, Windows 10, by angrysandhill; NVIDIA RTX 4090, Linux, in the title only, by Tamalero; AMD Radeon Vega iGPU (GCN), AMD driver 23.19.24.04, Windows 11, one test, by Ethan-Hainline - [x] AI-assisted: yes
XairRrR commented 2026-11-03 20:20:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T20:20:45Z.

Review: APPROVED


Reviewed — approved

The PR's own change, three commits on top of #9969's head 9e7ac69470, lets ChildKeyWord accept a key whose T# reads go through a sibling V# loaded through the same record pointer. It is narrowly scoped, it is covered by a test that fails without it, and its gaps are recorded in the debt file.

What I ran

Head e358b7af22d8023d10fa14f34710bcda0a30e89e, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged tree 814f9af6ef17ae7e33d8ac275e0069ffa2cc4d51. Machine: Debian 13 VM (32 vCPU Xeon Gold 6136), GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...e358b7af22d8023d10fa14f34710bcda0a30e89e
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
git diff 9e7ac694706c e358b7af22d8   # the PR's own three commits
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_(nested_image_table.*|nested_sampler_table|pointer_.*_table|image_table)$"
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "agc_driver_pointer_vsharp_(sibling|child)_key_table$"
# negative control (see below)
git diff 9e7ac694706c e358b7af22d8 -- core/shader/recompiler/Optimization/src/ResourceTracker.cpp | git apply -R
ninja -C build -j32 -l32 agc_driver_image_table_tests
ctest --test-dir build --output-on-failure -R "agc_driver_pointer_vsharp_(sibling|child)_key_table$"
# VUID origin check: every production file of the PR restored from main
ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -R "^agc_driver_image_gather_volume$"
# files restored from 814f9af6ef17, rebuilt, git status --porcelain empty

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) passed
Script's selected test run (2261 tests) 0 new failures, 0 timeouts; 7 known failures also fail on main
21 focused image-table tests with the validation layer 21/21 passed, 0 VUID- lines, 0 "was not found but was requested"
agc_driver_pointer_vsharp_sibling_key_table passed in 0.66 s with the layer loaded
Validation comparison (script) one test with VUIDs not in the baseline: agc_driver_image_gather_volume (VUID-VkSamplerCreateInfo-addressModeU-01079 and -parameter). The test was not run on the baseline. It reports the same VUID with every production file of the PR restored from main, so it comes from main, not this PR. The diff doesn't touch sampler creation.
New test output (merged tree)
1852: pointer V# table with a T# array in one V# indexed by a word read from a sibling V# of the same record pointer: T#s read from the sibling V# at the key read through the first one, with the first one's S#, checked for several keys, the largest inside the sibling V#, keys past it and a moved record pointer
100% tests passed, 0 tests failed out of 2

Negative control

I reverse-applied only the PR's own ResourceTracker.cpp change, the diff from 9e7ac694706c to the head, to the merged tree and rebuilt agc_driver_image_table_tests. The new test then fails with the refusal the description quotes, and #9969's agc_driver_pointer_vsharp_child_key_table still passes:

Output without the change
1/2 Test #1850: agc_driver_pointer_vsharp_child_key_table .....   Passed    0.71 sec
2/2 Test #1852: agc_driver_pointer_vsharp_sibling_key_table ...***Failed    0.12 sec
ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000c0(GetBufferResource(LoadAddressU32@pc=0x00000090(GetAddressResource(Phi(ReadConstBuffer@pc=0x00000074(...

After I restored the merged file and rebuilt, the test passes again and git status --porcelain is empty.

Findings

Blocking

None.

Non-blocking

  • Unblocks: line has no Game bring-up discussion. The line names PPSA03016 but not its Game bring-up discussion. CONTRIBUTING.md asks for both (Unblocks: PPSA01325 #3232). Suggested fix: add the PPSA03016 discussion number.

Notes on the code, which need no change:

  • SiblingVsharp (ResourceTracker.cpp#L2408-L2422) needs all eight words of the two V#s to be LoadAddressU32 from one, or an equivalent, GetAddressResource.
  • Only DescriptorWordReads passes siblings = true (line 864), and only on its rereadable path. So the key stays the guest's value at dispatch, as the description says.
  • The sibling's T# column is still planned on its own through MatchKeyDomain, because MatchChildKey still requires the same handle. If the sibling can't be planned, the shader is still refused.
  • The debt entry in docs/dev/debt/shader.md states the gap first: the column is not narrowed, and the other forms stay refused.
  • The test's decoy key and swapped S# in the sibling's buffer would catch A's words being read from B.

Not verified

  • Hardware GPUs: I ran only on lavapipe. The author reports RADV RX 9070 XT, and the NVIDIA and AMD CI comments on this head report 0 new failures and no new validation IDs.
  • The title (PPSA03016): I did not launch it.
  • The rest of #9969's chain, which this diff also shows against main. I reviewed only this PR's three commits on top of 9e7ac69470. The chain's tests ran in the script's selection and in the 21 focused tests above.
  • The memory cost of an unnarrowed sibling column. It can bind up to 65,536 entries per distinct child V# within the existing inner key-slot budget. No test covers a large sibling num_records.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5758929197 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15555#pullrequestreview-5758929197). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T20:20:45Z. **Review:** APPROVED --- # Reviewed — approved The PR's own change, three commits on top of #9969's head `9e7ac69470`, lets `ChildKeyWord` accept a key whose T# reads go through a sibling V# loaded through the same record pointer. It is narrowly scoped, it is covered by a test that fails without it, and its gaps are recorded in the debt file. ## What I ran Head `e358b7af22d8023d10fa14f34710bcda0a30e89e`, `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, merged tree `814f9af6ef17ae7e33d8ac275e0069ffa2cc4d51`. Machine: Debian 13 VM (32 vCPU Xeon Gold 6136), GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19). ``` git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...e358b7af22d8023d10fa14f34710bcda0a30e89e python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 git diff 9e7ac694706c e358b7af22d8 # the PR's own three commits env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "agc_driver_(nested_image_table.*|nested_sampler_table|pointer_.*_table|image_table)$" env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "agc_driver_pointer_vsharp_(sibling|child)_key_table$" # negative control (see below) git diff 9e7ac694706c e358b7af22d8 -- core/shader/recompiler/Optimization/src/ResourceTracker.cpp | git apply -R ninja -C build -j32 -l32 agc_driver_image_table_tests ctest --test-dir build --output-on-failure -R "agc_driver_pointer_vsharp_(sibling|child)_key_table$" # VUID origin check: every production file of the PR restored from main ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -R "^agc_driver_image_gather_volume$" # files restored from 814f9af6ef17, rebuilt, git status --porcelain empty ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / libs (script) | passed | | Script's selected test run (2261 tests) | 0 new failures, 0 timeouts; 7 known failures also fail on `main` | | 21 focused image-table tests with the validation layer | 21/21 passed, 0 `VUID-` lines, 0 "was not found but was requested" | | `agc_driver_pointer_vsharp_sibling_key_table` | passed in 0.66 s with the layer loaded | | Validation comparison (script) | one test with VUIDs not in the baseline: `agc_driver_image_gather_volume` (`VUID-VkSamplerCreateInfo-addressModeU-01079` and `-parameter`). The test was not run on the baseline. It reports the same VUID with every production file of the PR restored from `main`, so it comes from `main`, not this PR. The diff doesn't touch sampler creation. | <details><summary>New test output (merged tree)</summary> ``` 1852: pointer V# table with a T# array in one V# indexed by a word read from a sibling V# of the same record pointer: T#s read from the sibling V# at the key read through the first one, with the first one's S#, checked for several keys, the largest inside the sibling V#, keys past it and a moved record pointer 100% tests passed, 0 tests failed out of 2 ``` </details> ## Negative control I reverse-applied only the PR's own `ResourceTracker.cpp` change, the diff from `9e7ac694706c` to the head, to the merged tree and rebuilt `agc_driver_image_table_tests`. The new test then fails with the refusal the description quotes, and #9969's `agc_driver_pointer_vsharp_child_key_table` still passes: <details><summary>Output without the change</summary> ``` 1/2 Test #1850: agc_driver_pointer_vsharp_child_key_table ..... Passed 0.71 sec 2/2 Test #1852: agc_driver_pointer_vsharp_sibling_key_table ...***Failed 0.12 sec ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x000000c0(GetBufferResource(LoadAddressU32@pc=0x00000090(GetAddressResource(Phi(ReadConstBuffer@pc=0x00000074(... ``` </details> After I restored the merged file and rebuilt, the test passes again and `git status --porcelain` is empty. ## Findings ### Blocking None. ### Non-blocking - **`Unblocks:` line has no Game bring-up discussion.** The line names PPSA03016 but not its Game bring-up discussion. CONTRIBUTING.md asks for both (`Unblocks: PPSA01325 #3232`). Suggested fix: add the PPSA03016 discussion number. Notes on the code, which need no change: - `SiblingVsharp` ([ResourceTracker.cpp#L2408-L2422](https://github.com/boykopovar/AnyPS5/blob/e358b7af22d8023d10fa14f34710bcda0a30e89e/core/shader/recompiler/Optimization/src/ResourceTracker.cpp#L2408-L2422)) needs all eight words of the two V#s to be `LoadAddressU32` from one, or an equivalent, `GetAddressResource`. - Only `DescriptorWordReads` passes `siblings = true` (line 864), and only on its `rereadable` path. So the key stays the guest's value at dispatch, as the description says. - The sibling's T# column is still planned on its own through `MatchKeyDomain`, because `MatchChildKey` still requires the same handle. If the sibling can't be planned, the shader is still refused. - The debt entry in `docs/dev/debt/shader.md` states the gap first: the column is not narrowed, and the other forms stay refused. - The test's decoy key and swapped S# in the sibling's buffer would catch A's words being read from B. ## Not verified - Hardware GPUs: I ran only on lavapipe. The author reports RADV RX 9070 XT, and the NVIDIA and AMD CI comments on this head report 0 new failures and no new validation IDs. - The title (PPSA03016): I did not launch it. - The rest of #9969's chain, which this diff also shows against `main`. I reviewed only this PR's three commits on top of `9e7ac69470`. The chain's tests ran in the script's selection and in the 21 focused tests above. - The memory cost of an unnarrowed sibling column. It can bind up to 65,536 entries per distinct child V# within the existing inner key-slot budget. No test covers a large sibling `num_records`. <!-- anyps5-bots job=3537 head=e358b7af22d8023d10fa14f34710bcda0a30e89e -->
MarcZX10 commented 2026-11-21 07:00:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T07:00:03Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change based on the implementation and tests inspected; I could not complete a full review because one changed file was excluded from the review bundle.

What I ran

Inspected the prepared diff and relevant code at head fd3c021c15930639fdc8aafbcd316e3f5365f767. No test commands were run; reported test results below are author supplied.

Results

Check Result Note
Targeted code review passed Core paths and selected tests inspected
Reported validation not run Author reports GPU and CI runs
Full changed-file review not run One file was excluded for size

Findings

Blocking

None identified in the code inspected.

Non-blocking

None.

Not verified

core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded from files/; only its changed diff hunks and targeted head ranges were available. I did not read all changed lines across every reviewed file or run the reported commands. The reported rendering output for Spider-Man 2 was not verified.

Files read: description.md, commits.md, manifest.json, diff.patch; targeted ranges of ResourceTracker.cpp, ResourceMaterializer.cpp, ImageTable.cpp, and ShaderMemory.cpp; plus changed hunks in ShaderDiskCache.cpp, BdaAnchorReads.cpp, ImageTableAbi.hpp, resource metadata, cache serialization, SPIR-V emitters, CMake test registration, and docs/dev/debt/shader.md. ShaderMemory.cpp's full changed file was excluded by size.

To get this to a good state

Nothing is required. The focused implementation review found no concrete defect; the full test file and reported test commands remain unverified.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003678590 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15555#pullrequestreview-6003678590). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T07:00:03Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change based on the implementation and tests inspected; I could not complete a full review because one changed file was excluded from the review bundle. ## What I ran Inspected the prepared diff and relevant code at head `fd3c021c15930639fdc8aafbcd316e3f5365f767`. No test commands were run; reported test results below are author supplied. ## Results | Check | Result | Note | |---|---|---| | Targeted code review | passed | Core paths and selected tests inspected | | Reported validation | not run | Author reports GPU and CI runs | | Full changed-file review | not run | One file was excluded for size | ## Findings ### Blocking None identified in the code inspected. ### Non-blocking None. ## Not verified `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` was excluded from `files/`; only its changed diff hunks and targeted head ranges were available. I did not read all changed lines across every reviewed file or run the reported commands. The reported rendering output for Spider-Man 2 was not verified. Files read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`; targeted ranges of `ResourceTracker.cpp`, `ResourceMaterializer.cpp`, `ImageTable.cpp`, and `ShaderMemory.cpp`; plus changed hunks in `ShaderDiskCache.cpp`, `BdaAnchorReads.cpp`, `ImageTableAbi.hpp`, resource metadata, cache serialization, SPIR-V emitters, CMake test registration, and `docs/dev/debt/shader.md`. `ShaderMemory.cpp`'s full changed file was excluded by size. ## To get this to a good state Nothing is required. The focused implementation review found no concrete defect; the full test file and reported test commands remain unverified.
MarcZX10 commented 2026-11-25 12:41:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T12:41:00Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this review; the points below are optional.

What I ran

Reviewed head 215d1820e3ef6ccf1b14437e146573acff74064f using the prepared diff and the pinned repo_read.py reader. No tests or builds were run.

Results

Check Result Note
Diff and targeted source review passed Recompiler, materializer, and BDA paths inspected
Automated checks not run No commands or tests executed

Findings

Blocking

None identified in the inspected code.

Non-blocking

None.

Not verified

ShaderMemory.cpp is excluded from the review bundle because it is too large; its changed lines were not read. The remaining changed files listed in manifest.json were read through the diff and/or targeted head source ranges; no full-file audit was performed. Runtime behavior and the author-reported test results were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6057773083 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15555#pullrequestreview-6057773083). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T12:41:00Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this review; the points below are optional. ## What I ran Reviewed head `215d1820e3ef6ccf1b14437e146573acff74064f` using the prepared diff and the pinned `repo_read.py` reader. No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Recompiler, materializer, and BDA paths inspected | | Automated checks | not run | No commands or tests executed | ## Findings ### Blocking None identified in the inspected code. ### Non-blocking None. ## Not verified `ShaderMemory.cpp` is excluded from the review bundle because it is too large; its changed lines were not read. The remaining changed files listed in `manifest.json` were read through the diff and/or targeted head source ranges; no full-file audit was performed. Runtime behavior and the author-reported test results were not independently verified. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 22:40:58 +00:00 (Migrated from github.com)

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

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 is an ancestor of #18106. Preserve the fixture where a nested sampler’s buffer provides the key for a sibling image descriptor and also supplies the sampler data. Testing either use alone could miss the shared provenance change. Reconcile this cache schema before running the stack’s shader-memory and execution fixtures.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179885016 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15555#pullrequestreview-6179885016). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:40:58Z. **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 is an ancestor of #18106. Preserve the fixture where a nested sampler’s buffer provides the key for a sibling image descriptor and also supplies the sampler data. Testing either use alone could miss the shared provenance change. Reconcile this cache schema before running the stack’s shader-memory and execution fixtures. 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/15555:upstream-pr/15555'
git switch 'upstream-pr/15555'

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