fix(agc): poison only the pointer-table records a dispatch writes #22690

Open
milescoviello wants to merge 10 commits from upstream-pr/22690 into main
milescoviello commented 2026-11-18 02:40:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-11-18T02:40:51Z.


What

A dispatch that writes a buffer or storage image overlapping one of its image tables' read range sets that table's TableFault, so selecting any entry faults (table written by its dispatch), even an entry whose record the write misses. The debt entry already says so.

In Crimson Desert (PPSA25286) this hits pointer tables (a column read through a 64-bit address):

  • Their snapshot reads 2 MiB of 32-byte records past the pointer.
  • That range covers seven storage images (256-512 KiB each) that the same dispatches write.
  • The selected descriptor, for example 0x2151d4b5a0 (the first record), lies 84 KiB before the first image.
  • A local diag build showed 4 to 116 of these deferred write-back failed: ... table written by its dispatch lines per run, from up to a dozen shaders.

The change:

  • Materializer. For a pointer table whose record k lies at start + k * stride, ResourceMaterializer records that layout (start, stride, record bytes) with the table snapshot. That covers a column with no indirection, pointer hops or carried offsets, a 4-byte-aligned stride and addend, and no 32-bit offset wrap over the captured keys. ShaderInvocation carries the layouts as imageTableRecords.
  • Driver. ShaderResources::finishImageTables writes the HeapWritten poison into the map codes of just the records a written range overlaps, instead of the table's TableFault. Any other entry still reads its snapshot descriptor. Tables without such a layout (buffer, nested and indirect tables) keep the whole-table fault.
  • Ranges at the top of the address space. The overlapped keys come from ImageTableRecordLayout::KeysOverlapping, which compares inclusive ends (a store's first and last byte against each record's last byte) instead of adding past them, so a store range that reaches the end of the 64-bit address space, or a record that starts at the last address, still poisons the records it overlaps (MarcZX10's reviews of #22703).
  • Why it's sound. The shader takes a pointer table's map code only for a record below the key count (LookupTableWord: inMap = aligned && record < keys; otherwise OutsideSnapshot). So the records outside the write are the descriptors they held when the dispatch started.
  • Disk cache. The invocation is serialized in the shader disk cache, so its encoder and decoder carry the new list, the size asserts move, and FormatVersion moves to 104 (main was at 97 then and is at 98 as of 11-27; every number from 96 to 103, and 108 and 110, is used by an open pull request).

Tested

Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release, -DBUILD_TESTING=ON, RTX 4070 Ti on NVIDIA 615.71:

  • 11-28: Crimson Desert with #22703's head (which contains this change) merged onto main 859a238b8, one run: 0 deferred write-back failed: ... is written by its own dispatch lines in 206 s with 118 frames presented. On main that day, runs that presented 45 frames or more logged 52 to 133 such lines, and runs stuck at 0 to 4 frames logged 2 to 8 (including round 108 on the same main); details in #22703's Tested. The run was killed at the 20 GiB memory cap, so no title progress is claimed.
  • 12-03: merged main 3ff0401064 as ee03b3fa16. One conflict, FormatVersion: main moved to 99; this change keeps 104, which no other open pull request uses. Of the 36 agc_driver_image_table*, agc_shader_memory and agc_shader_disk_cache* tests, 35 pass in each of 3 runs. The agc_shader_disk_cache_large_file test fails in my batch environment, where the temporary directory is a RAM-backed /tmp (tmpfs, 5.96 GB free) inside a 12 GB memory scope and the 2 GiB write does not complete; with TMPDIR on a disk it passes (run on the #22703 head, which contains this change).
  • 11-27 (2nd): merged main 4c7578e0a4 as 0aaaa698c4. One conflict, FormatVersion: main moved to 98; this change keeps 104. The 34 agc_driver_image_table*, agc_shader_memory and agc_shader_disk_cache* tests pass in each of 3 runs.
  • 11-27: merged main 80781a0e94 as 19f7d4a0ab. One conflict, the RecompileResult size check in ShaderDiskCache.cpp: #27273 grew it from 560 to 568 bytes with drawKeyMemo, which is not serialized, and this change adds 24, so the check is now 592, which the build confirms. FormatVersion stays 104. The 34 agc_driver_image_table*, agc_shader_memory and agc_shader_disk_cache* tests pass in each of 3 runs.
  • 11-26: merged main c64b9d323f into the branch as 8920a768b4. One conflict, in FormatVersion: main moved to 97 (#26800) and the branch kept 100. Since #22602 and #9749 now also use 100, 06fae1ad18 moves it to 104, which no open pull request uses. The 34 agc_driver_image_table*, agc_shader_memory and agc_shader_disk_cache* tests pass in each of 3 runs at 8920a768b4, and agc_driver_image_table and agc_shader_disk_cache* pass in each of 3 runs at 06fae1ad18.
  • 11-21 (2nd): rebased onto main ef7dc4452d as 660f02cdd7. One text conflict, in the include list of tests/execution/ImageTable.cpp (main added <mutex>, this branch <limits>), kept both; FormatVersion stays 100 (main is at 96 and no open pull request uses 100). The 33 agc_driver_image_table*, agc_shader_memory and agc_shader_disk_cache* tests pass in each of 3 runs (main 33/33 once). Windows 11 VM (GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release): the same set, 35 tests there, passes in each of 3 runs.
  • 11-21: rebased onto main 70602fcc03 as 74213a85f6. Two text conflicts with main's pointer-keyed record tables (pointerKeyed in ImageTableColumnSnapshot and in ResourceMaterializer) are resolved by keeping both; a pointer-keyed column is always indirect, so it never takes this PR's linear record path. main had reached format 96, this branch's value, so the last commit moves it to 100. The 33 agc_driver_image_table*, agc_shader_memory and agc_shader_disk_cache* tests pass in each of 3 runs (main 33/33 once). Windows 11 VM (GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release): the same set, 35 tests there, passes in each of 3 runs.
  • 11-20, head 8021995a83 (the fix above for the wrapping range): agc_driver_image_table also checks KeysOverlapping directly: a store over records 5 to 7 of 48-byte records gives keys 5 to 7, a store running past the top of the 64-bit address space gives the last record, and a store ending at the top gives all four. Linux (Ubuntu 26.04.1, GCC 15.2, Ninja, Release, RTX 4070 Ti on NVIDIA 615.71, ANYPS5_REQUIRE_VULKAN=1): the 33 tests of ^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$ pass 3 runs. Negative control: with the old formula in KeysOverlapping, agc_driver_image_table fails with image table records: a store running past the top of the address space did not select the last record.
  • 11-20, head 2e182729d0 (test only, MarcZX10's suggestion on #22703): the same checks also cover records of zero bytes and a store past the last of 64 records, which both select no keys. The 33 tests pass 3 runs.
  • 11-20, head db70e3dceb (MarcZX10's second review of #22703): 2e182729d0 saturated the first record's exclusive end at the top of the address space, so a record starting at the last address looked empty. The range now uses inclusive ends, and the checks add a record at the last address with a one-byte store there and a store ending there (both select key 0). The 33 tests pass 3 runs. Negative control: with 2e182729d0's KeysOverlapping, agc_driver_image_table fails with image table records: a one-byte store at the last address did not select the record that starts there.
  • agc_driver_image_table gains two pointer-table cases next to the existing palette run (keys 0-2 select records 0-2):
    • A dispatch whose output buffer lies over palette records 128-223 doesn't fault, and its three groups sample what the plain palette run samples.
    • One whose output starts at record 2 still faults with is written by its own dispatch.
    • The existing buffer-table case, a dispatch storing over its whole table, still faults.
  • ^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$ (33 tests) passes, 3 runs. agc_shader_disk_cache now also compares the record layouts after its invocation round trip, and it passes too.
  • Negative control: with main's ShaderResources.cpp and the new test, agc_driver_image_table fails with pointer image table: a store into entries no key of the dispatch selects faulted.

Windows 11 (VM, GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release, ANYPS5_REQUIRE_VULKAN=1): agc_driver_image_table and agc_shader_disk_cache pass 3 runs on this head 746802dc77.

Crimson Desert (PPSA25286), Linux, RTX 4070 Ti: offline (APS5_NET_DISCONNECTED=1), 22G cap. One cold run (420 s) and one warm run (480 s) per arm, with a fresh shader cache per arm.

  • Base: bdd462ac3e (main 604828bd44 plus #22534 and #22609).
  • PR: 5586c9c8d3 (the same plus this change).
run table written by its dispatch failures end
base cold 4 ran 426 s
base warm 24 killed at the cap at 464 s
PR cold 0 ran 421 s
PR warm 0 ran 487 s

The screen is still the black loading screen with its spinner in every run. Present counts vary too much between Crimson Desert runs of the same build (2 to 19 in earlier warm runs) to read anything into them here, so I'm only claiming the faults are gone.

  • domx4q's run with the Khronos validation layer (Arch Linux, GCC 16.2.1, RTX 4090, NVIDIA 620.70.06, layer 1.4.363.1), this head merged onto main 1ccc399b17: the 33 image table, shader memory and disk cache tests pass on both main and this PR with no VUID- errors, and the negative control with main's ShaderResources.cpp fails agc_driver_image_table in 2 of 2 runs.
  • git merge-tree against main is clean. tools/check_conventions.py passes on the branch and this body, and tools/debt_fold.py --check reports nothing new for this fragment.
  • Rebased 11-18 onto main d89f26516c as 8b933712e6 (it conflicted with main; FormatVersion is now 91 against main's 90). On Linux (Ubuntu 26.04.1, GCC 15.2, Release, RTX 4070 Ti), the 33 tests of ^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$ pass, 3 runs. On the Windows 11 VM (GT 1030, WinLibs GCC 16.2.0, Release), the 35 tests the same pattern selects on Windows pass, 3 runs, on 8b933712e6.
  • Rebased 11-20 onto main 0a025bd3c6 as 742d417e29. It conflicted in the disk cache: main had moved FormatVersion to 95 and grown CompiledShaderArtifact (288 to 296 bytes) and RecompileResult (552 to 560). This head sets FormatVersion 96 and the RecompileResult assert to 584 (main's 560 plus this change's 24), which the build checks. On Linux (Ubuntu 26.04.1, GCC 15.2, Ninja, Release, RTX 4070 Ti on NVIDIA 615.71, ANYPS5_REQUIRE_VULKAN=1), the 33 tests of ^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$ pass 3 runs.
  • Colewiz7's RADV run of 8b933712e6 merged onto main d89f26516c as de9fbd7b86 (Linux 7.3.4, GCC 16.2.1, Mesa 26.2.6, RX 7900 XT and the 7800X3D iGPU, Khronos validation layer 1.4.363.1): no new failures against main in the full suite (6171 tests) or in ^agc with the layer, and no VUID- or SYNC-HAZARD lines.
  • rafaconvaitis's Windows + AMD run of 8b933712e6 merged onto main 3c07e1d05e (Radeon 760M, AMD Software 26.11.2, WinLibs GCC 15.2.0, Khronos validation layer 1.4.363): agc_driver_image_table and the three agc_driver_nested_image_table* tests pass 3/3 on both sides with no VUID- lines, and with this PR's tests on main's sources agc_driver_image_table fails. On this device (subgroup size 64) its per-wave key cases are skipped.
  • Windows, run by @B-Howell (comment): Windows 11 Pro 26300, RTX 4080 SUPER (621.14), WinLibs GCC 15.2.0 r7, Release, ee03b3fa16 merged onto main de4730493a: agc_driver_image_table_tests, agc_shader_disk_cache_tests, the five other agc_driver_image_table_* targets and agc_driver_graphics_tests with its neighbours (176 tests, including agc_driver_image_table_reuse_records and _narrow) pass in 3 of 3 runs. Control, this tree with only the per-record branch in finishImageTables disabled: agc_driver_image_table fails with "pointer image table: a store into entries no key of the dispatch selects faulted". With Khronos validation, ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, no VUID- on main or this change.
  • Run by @ycbuzi (comment): Windows Server 2022 and 2025 (GitHub-hosted runners), WinLibs GCC 15.2.0, ee03b3fa16 merged into main, the whole ctest suite twice per runner: no failures on Server 2025; on Server 2022, 2 and then 3 failures out of 7534, 2 of which also fail on main (the report does not name the third). 5 GPU tests (AGC, shader recompiler) pass twice on Mesa lavapipe 25.2.8 with Khronos validation and the shader cache off, with no validation message that main c1593e4e1d does not also produce.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 4070 Ti (Linux), NVIDIA GeForce GT 1030 (Windows), AMD RX 7900 XT and the Ryzen 7 7800X3D iGPU (gfx1036) (Linux, RADV, Colewiz7), AMD Radeon 760M (Windows, AMD driver, rafaconvaitis)
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes
    • Image-table reads now remain available for entries unaffected by overlapping writes when the table layout supports precise tracking. Entries touched by a write still fault, while tables without a supported layout continue to fault as a whole.
  • Reliability
    • Improved handling of image-table record boundaries, including overlapping writes, empty records, and address-range edge cases. Image-table record information is preserved when shader results are saved and loaded, keeping behavior consistent across cached results.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5368877254 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-11-18T02:40:51Z. --- ### What A dispatch that writes a buffer or storage image overlapping one of its image tables' read range sets that table's `TableFault`, so selecting any entry faults (`table written by its dispatch`), even an entry whose record the write misses. The debt entry already says so. In Crimson Desert (PPSA25286) this hits pointer tables (a column read through a 64-bit address): - Their snapshot reads 2 MiB of 32-byte records past the pointer. - That range covers seven storage images (256-512 KiB each) that the same dispatches write. - The selected descriptor, for example `0x2151d4b5a0` (the first record), lies 84 KiB before the first image. - A local diag build showed 4 to 116 of these `deferred write-back failed: ... table written by its dispatch` lines per run, from up to a dozen shaders. The change: - **Materializer.** For a pointer table whose record k lies at `start + k * stride`, `ResourceMaterializer` records that layout (start, stride, record bytes) with the table snapshot. That covers a column with no indirection, pointer hops or carried offsets, a 4-byte-aligned stride and addend, and no 32-bit offset wrap over the captured keys. `ShaderInvocation` carries the layouts as `imageTableRecords`. - **Driver.** `ShaderResources::finishImageTables` writes the `HeapWritten` poison into the map codes of just the records a written range overlaps, instead of the table's `TableFault`. Any other entry still reads its snapshot descriptor. Tables without such a layout (buffer, nested and indirect tables) keep the whole-table fault. - **Ranges at the top of the address space.** The overlapped keys come from `ImageTableRecordLayout::KeysOverlapping`, which compares inclusive ends (a store's first and last byte against each record's last byte) instead of adding past them, so a store range that reaches the end of the 64-bit address space, or a record that starts at the last address, still poisons the records it overlaps (MarcZX10's reviews of #22703). - **Why it's sound.** The shader takes a pointer table's map code only for a record below the key count (`LookupTableWord`: `inMap = aligned && record < keys`; otherwise `OutsideSnapshot`). So the records outside the write are the descriptors they held when the dispatch started. - **Disk cache.** The invocation is serialized in the shader disk cache, so its encoder and decoder carry the new list, the size asserts move, and `FormatVersion` moves to 104 (`main` was at 97 then and is at 98 as of 11-27; every number from 96 to 103, and 108 and 110, is used by an open pull request). ### Tested Linux (Ubuntu 26.04.1, kernel 7.0), GCC 15.2, Ninja, Release, `-DBUILD_TESTING=ON`, RTX 4070 Ti on NVIDIA 615.71: - 11-28: Crimson Desert with #22703's head (which contains this change) merged onto `main` `859a238b8`, one run: 0 `deferred write-back failed: ... is written by its own dispatch` lines in 206 s with 118 frames presented. On `main` that day, runs that presented 45 frames or more logged 52 to 133 such lines, and runs stuck at 0 to 4 frames logged 2 to 8 (including round 108 on the same `main`); details in #22703's Tested. The run was killed at the 20 GiB memory cap, so no title progress is claimed. - 12-03: merged `main` `3ff0401064` as `ee03b3fa16`. One conflict, `FormatVersion`: `main` moved to 99; this change keeps 104, which no other open pull request uses. Of the 36 `agc_driver_image_table*`, `agc_shader_memory` and `agc_shader_disk_cache*` tests, 35 pass in each of 3 runs. The `agc_shader_disk_cache_large_file` test fails in my batch environment, where the temporary directory is a RAM-backed `/tmp` (tmpfs, 5.96 GB free) inside a 12 GB memory scope and the 2 GiB write does not complete; with `TMPDIR` on a disk it passes (run on the #22703 head, which contains this change). - 11-27 (2nd): merged `main` `4c7578e0a4` as `0aaaa698c4`. One conflict, `FormatVersion`: `main` moved to 98; this change keeps 104. The 34 `agc_driver_image_table*`, `agc_shader_memory` and `agc_shader_disk_cache*` tests pass in each of 3 runs. - 11-27: merged `main` `80781a0e94` as `19f7d4a0ab`. One conflict, the `RecompileResult` size check in `ShaderDiskCache.cpp`: #27273 grew it from 560 to 568 bytes with `drawKeyMemo`, which is not serialized, and this change adds 24, so the check is now 592, which the build confirms. `FormatVersion` stays 104. The 34 `agc_driver_image_table*`, `agc_shader_memory` and `agc_shader_disk_cache*` tests pass in each of 3 runs. - 11-26: merged `main` `c64b9d323f` into the branch as `8920a768b4`. One conflict, in `FormatVersion`: `main` moved to 97 (#26800) and the branch kept 100. Since #22602 and #9749 now also use 100, `06fae1ad18` moves it to 104, which no open pull request uses. The 34 `agc_driver_image_table*`, `agc_shader_memory` and `agc_shader_disk_cache*` tests pass in each of 3 runs at `8920a768b4`, and `agc_driver_image_table` and `agc_shader_disk_cache*` pass in each of 3 runs at `06fae1ad18`. - 11-21 (2nd): rebased onto `main` `ef7dc4452d` as `660f02cdd7`. One text conflict, in the include list of `tests/execution/ImageTable.cpp` (`main` added `<mutex>`, this branch `<limits>`), kept both; `FormatVersion` stays 100 (`main` is at 96 and no open pull request uses 100). The 33 `agc_driver_image_table*`, `agc_shader_memory` and `agc_shader_disk_cache*` tests pass in each of 3 runs (`main` 33/33 once). Windows 11 VM (GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release): the same set, 35 tests there, passes in each of 3 runs. - 11-21: rebased onto `main` `70602fcc03` as `74213a85f6`. Two text conflicts with `main`'s pointer-keyed record tables (`pointerKeyed` in `ImageTableColumnSnapshot` and in `ResourceMaterializer`) are resolved by keeping both; a pointer-keyed column is always indirect, so it never takes this PR's linear record path. `main` had reached format 96, this branch's value, so the last commit moves it to 100. The 33 `agc_driver_image_table*`, `agc_shader_memory` and `agc_shader_disk_cache*` tests pass in each of 3 runs (`main` 33/33 once). Windows 11 VM (GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release): the same set, 35 tests there, passes in each of 3 runs. - 11-20, head `8021995a83` (the fix above for the wrapping range): `agc_driver_image_table` also checks `KeysOverlapping` directly: a store over records 5 to 7 of 48-byte records gives keys 5 to 7, a store running past the top of the 64-bit address space gives the last record, and a store ending at the top gives all four. Linux (Ubuntu 26.04.1, GCC 15.2, Ninja, Release, RTX 4070 Ti on NVIDIA 615.71, `ANYPS5_REQUIRE_VULKAN=1`): the 33 tests of `^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$` pass 3 runs. Negative control: with the old formula in `KeysOverlapping`, `agc_driver_image_table` fails with `image table records: a store running past the top of the address space did not select the last record`. - 11-20, head `2e182729d0` (test only, MarcZX10's suggestion on #22703): the same checks also cover records of zero bytes and a store past the last of 64 records, which both select no keys. The 33 tests pass 3 runs. - 11-20, head `db70e3dceb` (MarcZX10's second review of #22703): `2e182729d0` saturated the first record's exclusive end at the top of the address space, so a record starting at the last address looked empty. The range now uses inclusive ends, and the checks add a record at the last address with a one-byte store there and a store ending there (both select key 0). The 33 tests pass 3 runs. Negative control: with `2e182729d0`'s `KeysOverlapping`, `agc_driver_image_table` fails with `image table records: a one-byte store at the last address did not select the record that starts there`. - `agc_driver_image_table` gains two pointer-table cases next to the existing palette run (keys 0-2 select records 0-2): - A dispatch whose output buffer lies over palette records 128-223 doesn't fault, and its three groups sample what the plain palette run samples. - One whose output starts at record 2 still faults with `is written by its own dispatch`. - The existing buffer-table case, a dispatch storing over its whole table, still faults. - `^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$` (33 tests) passes, 3 runs. `agc_shader_disk_cache` now also compares the record layouts after its invocation round trip, and it passes too. - Negative control: with `main`'s `ShaderResources.cpp` and the new test, `agc_driver_image_table` fails with `pointer image table: a store into entries no key of the dispatch selects faulted`. Windows 11 (VM, GeForce GT 1030, WinLibs GCC 16.2, Ninja, Release, `ANYPS5_REQUIRE_VULKAN=1`): `agc_driver_image_table` and `agc_shader_disk_cache` pass 3 runs on this head `746802dc77`. **Crimson Desert (PPSA25286), Linux, RTX 4070 Ti:** offline (`APS5_NET_DISCONNECTED=1`), 22G cap. One cold run (420 s) and one warm run (480 s) per arm, with a fresh shader cache per arm. - Base: `bdd462ac3e` (`main` `604828bd44` plus #22534 and #22609). - PR: `5586c9c8d3` (the same plus this change). | run | `table written by its dispatch` failures | end | |---|---|---| | base cold | 4 | ran 426 s | | base warm | 24 | killed at the cap at 464 s | | PR cold | 0 | ran 421 s | | PR warm | 0 | ran 487 s | The screen is still the black loading screen with its spinner in every run. Present counts vary too much between Crimson Desert runs of the same build (2 to 19 in earlier warm runs) to read anything into them here, so I'm only claiming the faults are gone. - domx4q's [run](https://github.com/boykopovar/AnyPS5/pull/22690#issuecomment-6974879495) with the Khronos validation layer (Arch Linux, GCC 16.2.1, RTX 4090, NVIDIA 620.70.06, layer 1.4.363.1), this head merged onto `main` `1ccc399b17`: the 33 image table, shader memory and disk cache tests pass on both `main` and this PR with no `VUID-` errors, and the negative control with `main`'s `ShaderResources.cpp` fails `agc_driver_image_table` in 2 of 2 runs. - `git merge-tree` against `main` is clean. `tools/check_conventions.py` passes on the branch and this body, and `tools/debt_fold.py --check` reports nothing new for this fragment. - Rebased 11-18 onto `main` `d89f26516c` as `8b933712e6` (it conflicted with `main`; `FormatVersion` is now 91 against `main`'s 90). On Linux (Ubuntu 26.04.1, GCC 15.2, Release, RTX 4070 Ti), the 33 tests of `^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$` pass, 3 runs. On the Windows 11 VM (GT 1030, WinLibs GCC 16.2.0, Release), the 35 tests the same pattern selects on Windows pass, 3 runs, on `8b933712e6`. - Rebased 11-20 onto `main` `0a025bd3c6` as `742d417e29`. It conflicted in the disk cache: `main` had moved `FormatVersion` to 95 and grown `CompiledShaderArtifact` (288 to 296 bytes) and `RecompileResult` (552 to 560). This head sets `FormatVersion` 96 and the `RecompileResult` assert to 584 (`main`'s 560 plus this change's 24), which the build checks. On Linux (Ubuntu 26.04.1, GCC 15.2, Ninja, Release, RTX 4070 Ti on NVIDIA 615.71, `ANYPS5_REQUIRE_VULKAN=1`), the 33 tests of `^(agc_driver_image_table.*|agc_shader_memory|agc_shader_disk_cache.*)$` pass 3 runs. - Colewiz7's [RADV run](https://github.com/boykopovar/AnyPS5/pull/22690#issuecomment-6996838165) of `8b933712e6` merged onto `main` `d89f26516c` as `de9fbd7b86` (Linux 7.3.4, GCC 16.2.1, Mesa 26.2.6, RX 7900 XT and the 7800X3D iGPU, Khronos validation layer 1.4.363.1): no new failures against `main` in the full suite (6171 tests) or in `^agc` with the layer, and no `VUID-` or `SYNC-HAZARD` lines. - rafaconvaitis's [Windows + AMD run](https://github.com/boykopovar/AnyPS5/pull/22690#issuecomment-6997921014) of `8b933712e6` merged onto `main` `3c07e1d05e` (Radeon 760M, AMD Software 26.11.2, WinLibs GCC 15.2.0, Khronos validation layer 1.4.363): `agc_driver_image_table` and the three `agc_driver_nested_image_table*` tests pass 3/3 on both sides with no `VUID-` lines, and with this PR's tests on `main`'s sources `agc_driver_image_table` fails. On this device (subgroup size 64) its per-wave key cases are skipped. - Windows, run by @B-Howell ([comment](https://github.com/boykopovar/AnyPS5/pull/22690#issuecomment-7388714640)): Windows 11 Pro 26300, RTX 4080 SUPER (621.14), WinLibs GCC 15.2.0 r7, Release, `ee03b3fa16` merged onto `main` `de4730493a`: `agc_driver_image_table_tests`, `agc_shader_disk_cache_tests`, the five other `agc_driver_image_table_*` targets and `agc_driver_graphics_tests` with its neighbours (176 tests, including `agc_driver_image_table_reuse_records` and `_narrow`) pass in 3 of 3 runs. Control, this tree with only the per-record branch in `finishImageTables` disabled: `agc_driver_image_table` fails with "pointer image table: a store into entries no key of the dispatch selects faulted". With Khronos validation, `ANYPS5_REQUIRE_VULKAN=1` and `ANYPS5_NO_SHADER_CACHE=1`, no `VUID-` on `main` or this change. - Run by @ycbuzi ([comment](https://github.com/boykopovar/AnyPS5/pull/22690#issuecomment-7391851305)): Windows Server 2022 and 2025 (GitHub-hosted runners), WinLibs GCC 15.2.0, `ee03b3fa16` merged into `main`, the whole ctest suite twice per runner: no failures on Server 2025; on Server 2022, 2 and then 3 failures out of 7534, 2 of which also fail on `main` (the report does not name the third). 5 GPU tests (AGC, shader recompiler) pass twice on Mesa lavapipe 25.2.8 with Khronos validation and the shader cache off, with no validation message that `main` `c1593e4e1d` does not also produce. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 4070 Ti (Linux), NVIDIA GeForce GT 1030 (Windows), AMD RX 7900 XT and the Ryzen 7 7800X3D iGPU (gfx1036) (Linux, RADV, Colewiz7), AMD Radeon 760M (Windows, AMD driver, rafaconvaitis) - [x] AI-assisted: yes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Image-table reads now remain available for entries unaffected by overlapping writes when the table layout supports precise tracking. Entries touched by a write still fault, while tables without a supported layout continue to fault as a whole. * **Reliability** * Improved handling of image-table record boundaries, including overlapping writes, empty records, and address-range edge cases. Image-table record information is preserved when shader results are saved and loaded, keeping behavior consistent across cached results. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-11-18 02:54:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T02:54:15Z.

Review: APPROVED


Reviewed — looks good

The inspected changes implement per-record poisoning for eligible pointer tables and add focused tests; I found no verified blocking defect.

What I ran

Reviewed head 746802dc775456e2612ece8fc99bbbab4f8c425f using the prepared diff and repo_read.py for targeted source reads. No tests or build commands were run; test results in the PR description are author-reported.

Results

Check Result Note
Diff and changed code passed Targeted source review completed
Build and tests not run PR reports passing tests
Negative control not run PR reports a failing negative control

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

Full text read for 9 of 10 changed files; ShaderResources.cpp was excluded from the prepared folder because of its size, so I read the relevant implementation range through repo_read.py. In total, all 10 changed files were read at least around their changed hunks; unrelated portions of large files were not read. Build, test, hardware, and console behavior were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5950143148 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-5950143148). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-18T02:54:15Z. **Review:** APPROVED --- # Reviewed — looks good The inspected changes implement per-record poisoning for eligible pointer tables and add focused tests; I found no verified blocking defect. ## What I ran Reviewed head `746802dc775456e2612ece8fc99bbbab4f8c425f` using the prepared diff and `repo_read.py` for targeted source reads. No tests or build commands were run; test results in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code | passed | Targeted source review completed | | Build and tests | not run | PR reports passing tests | | Negative control | not run | PR reports a failing negative control | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified Full text read for 9 of 10 changed files; `ShaderResources.cpp` was excluded from the prepared folder because of its size, so I read the relevant implementation range through `repo_read.py`. In total, all 10 changed files were read at least around their changed hunks; unrelated portions of large files were not read. Build, test, hardware, and console behavior were not independently verified. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-19 00:41:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T00:41:36Z.

Review: COMMENTED


Reviewed — no blocking findings

The diff and targeted source context at head 8b933712e66722046de813aa5c5697885c498640 support the per-record poisoning change; this review environment did not provide a way to run checks.

What I ran

Read the prepared description, commits, manifest, diff, and changed-file source ranges using the pinned reader. No tests or build commands were run.

Results

Check Result Note
Diff and source review passed Changed behavior and cache wiring inspected
Build and tests not run No execution performed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The changed ShaderResources.cpp implementation and all other changed files listed as reviewed in the manifest were read at relevant ranges. The full contents of files marked included were not read; the code paths relevant to the diff were inspected. No build, automated tests, hardware behavior, or author-reported runs were independently verified. files.json was not available as a review document; the manifest and review-folder listing were used to identify exclusions. ShaderResources.cpp was excluded from the prepared full-text files because it was too large, and was read through the pinned reader around the changed function.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5967534476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-5967534476). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T00:41:36Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The diff and targeted source context at head `8b933712e66722046de813aa5c5697885c498640` support the per-record poisoning change; this review environment did not provide a way to run checks. ## What I ran Read the prepared description, commits, manifest, diff, and changed-file source ranges using the pinned reader. No tests or build commands were run. ## Results | Check | Result | Note | |---|---|---| | Diff and source review | passed | Changed behavior and cache wiring inspected | | Build and tests | not run | No execution performed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The changed `ShaderResources.cpp` implementation and all other changed files listed as reviewed in the manifest were read at relevant ranges. The full contents of files marked included were not read; the code paths relevant to the diff were inspected. No build, automated tests, hardware behavior, or author-reported runs were independently verified. `files.json` was not available as a review document; the manifest and review-folder listing were used to identify exclusions. `ShaderResources.cpp` was excluded from the prepared full-text files because it was too large, and was read through the pinned reader around the changed function. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-20 15:04:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T15:04:20Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing in the code I read shows a verified blocking defect; I could not complete a full review because the repository reader command was unavailable.

What I ran

  • Target head: 742d417e294bb1b22a80984671f85585e16934dd.
  • Read the prepared description, commits, manifest and diff, plus targeted source ranges through the review reader.
  • No tests or builds were run. The reader command was not available in this interface, so I could not run repo_read.py as requested.

Results

Check Result Note
Prepared bundle review passed Diff and metadata read
Targeted source review not run Only selected ranges were accessible
Tests and build not run No commands ran

Findings

Blocking

None verified in the code read.

Non-blocking

None.

Not verified

  • ShaderResources.cpp’s changed range, materializer logic, cache serialization, and relevant test ranges were read. The full changed-file set was not reviewed.
  • files.json was unavailable through the provided reader; the manifest identifies one excluded changed file: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp (full text too large for the review folder). I read only lines 6810–6875 at the pinned head.
  • No tests, build, conventions check, merged-preview check, negative control, or hardware run was performed in this review. Reported runs in the description are author-supplied and were not independently verified.

To get this to a good state

Nothing is required. The implementation’s selective map poisoning appears consistent with the stated linear record layout for the inspected ranges; review the remaining changed code and run the relevant checks before treating this as a complete approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5994788093 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-5994788093). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T15:04:20Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing in the code I read shows a verified blocking defect; I could not complete a full review because the repository reader command was unavailable. ## What I ran - Target head: `742d417e294bb1b22a80984671f85585e16934dd`. - Read the prepared description, commits, manifest and diff, plus targeted source ranges through the review reader. - No tests or builds were run. The reader command was not available in this interface, so I could not run `repo_read.py` as requested. ## Results | Check | Result | Note | |---|---|---| | Prepared bundle review | passed | Diff and metadata read | | Targeted source review | not run | Only selected ranges were accessible | | Tests and build | not run | No commands ran | ## Findings ### Blocking None verified in the code read. ### Non-blocking None. ## Not verified - `ShaderResources.cpp`’s changed range, materializer logic, cache serialization, and relevant test ranges were read. The full changed-file set was not reviewed. - `files.json` was unavailable through the provided reader; the manifest identifies one excluded changed file: `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` (full text too large for the review folder). I read only lines 6810–6875 at the pinned head. - No tests, build, conventions check, merged-preview check, negative control, or hardware run was performed in this review. Reported runs in the description are author-supplied and were not independently verified. ## To get this to a good state Nothing is required. The implementation’s selective map poisoning appears consistent with the stated linear record layout for the inspected ranges; review the remaining changed code and run the relevant checks before treating this as a complete approval.
MarcZX10 commented 2026-11-20 15:56:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T15:56:53Z.

Review: APPROVED


Reviewed — looks good

The reviewed changes appear sound at head 2e182729d04d674d982e42a4ee2eada1547ba721; no checks were run in this review, and author-reported test results were not independently verified.

What I ran

No commands or tests were run. I read the prepared diff and changed source through the pinned reader at the stated head.

Results

Check Result Note
Source review passed Reviewed all changed lines and relevant source context.
Tests not run Test results in the description are author-reported.

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • I did not run builds, tests, negative controls, or console and GPU checks.
  • Changed files read: ShaderResources.cpp, ShaderDiskCache.cpp (driver test), ImageTable.cpp, ResourcePlan.hpp, ResourceMaterializer.cpp, Recompiler.cpp, Recompiler.hpp, ShaderDiskCache.cpp (recompiler), ShaderDiskCache.hpp, and fix-agc-image-table-written-keys.md.
  • Excluded changed files: none. ShaderResources.cpp was not present in the review folder but was read through repo_read.py. The remaining changed files were read from the review folder; their changed lines were reviewed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5995517091 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-5995517091). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T15:56:53Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed changes appear sound at head `2e182729d04d674d982e42a4ee2eada1547ba721`; no checks were run in this review, and author-reported test results were not independently verified. ## What I ran No commands or tests were run. I read the prepared diff and changed source through the pinned reader at the stated head. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Reviewed all changed lines and relevant source context. | | Tests | not run | Test results in the description are author-reported. | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - I did not run builds, tests, negative controls, or console and GPU checks. - Changed files read: `ShaderResources.cpp`, `ShaderDiskCache.cpp` (driver test), `ImageTable.cpp`, `ResourcePlan.hpp`, `ResourceMaterializer.cpp`, `Recompiler.cpp`, `Recompiler.hpp`, `ShaderDiskCache.cpp` (recompiler), `ShaderDiskCache.hpp`, and `fix-agc-image-table-written-keys.md`. - Excluded changed files: none. `ShaderResources.cpp` was not present in the review folder but was read through `repo_read.py`. The remaining changed files were read from the review folder; their changed lines were reviewed. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-20 16:31:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T16:31:07Z.

Review: APPROVED


Reviewed — looks good

The changed source and test hunks support the stated behavior, and I found no verified blocking defect; validation runs are author-reported and were not run here.

What I ran

The pinned head is db70e3dcebc2a757a2ad924e2a1bbbfd2bc76535. I inspected the prepared diff and traced the changed implementation and serialization at that head. I did not run commands or tests; the build and test results in the description are author-reported.

Results

Check Result Note
Diff and implementation review passed Changed logic inspected
Tests in this review not run Results supplied by author

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full text of core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp was excluded because it is too large for the review folder; I read the changed hunk through repo_read.py. The other eight changed files marked included in manifest.json were not accessible under the review/files/ paths, so I read their changed hunks and targeted context through repo_read.py instead of their full text. No runtime tests, builds, or supplied author/CI claims were independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5996002773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-5996002773). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T16:31:07Z. **Review:** APPROVED --- # Reviewed — looks good The changed source and test hunks support the stated behavior, and I found no verified blocking defect; validation runs are author-reported and were not run here. ## What I ran The pinned head is `db70e3dcebc2a757a2ad924e2a1bbbfd2bc76535`. I inspected the prepared diff and traced the changed implementation and serialization at that head. I did not run commands or tests; the build and test results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and implementation review | passed | Changed logic inspected | | Tests in this review | not run | Results supplied by author | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The full text of `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` was excluded because it is too large for the review folder; I read the changed hunk through `repo_read.py`. The other eight changed files marked included in `manifest.json` were not accessible under the `review/files/` paths, so I read their changed hunks and targeted context through `repo_read.py` instead of their full text. No runtime tests, builds, or supplied author/CI claims were independently verified. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-21 11:50:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T11:50:45Z.

Review: APPROVED


Reviewed — looks good

Nothing in the inspected changes blocks merging; the selected-record poisoning logic and its boundary cases are covered by the included tests.

What I ran

Read the prepared diff and targeted source ranges at head 74213a85f679410eca815aad5cc278c0a433f260 using repo_read.py. No tests or build commands were run in this review.

Results

Check Result Note
Diff and targeted source review passed Core logic and serialization inspected
Tests and build not run Results in the description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests were run. ShaderResources.cpp was excluded from the prepared full-text bundle because it exceeded the bundle limit; its changed function was read at the pinned head through repo_read.py. All changed files listed in the manifest were reviewed through the diff or targeted source reads; full-file text was not read for every file. I did not independently verify the author-reported test runs or hardware behavior.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6005021596 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6005021596). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T11:50:45Z. **Review:** APPROVED --- # Reviewed — looks good Nothing in the inspected changes blocks merging; the selected-record poisoning logic and its boundary cases are covered by the included tests. ## What I ran Read the prepared diff and targeted source ranges at head `74213a85f679410eca815aad5cc278c0a433f260` using `repo_read.py`. No tests or build commands were run in this review. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Core logic and serialization inspected | | Tests and build | not run | Results in the description are author-reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No tests were run. `ShaderResources.cpp` was excluded from the prepared full-text bundle because it exceeded the bundle limit; its changed function was read at the pinned head through `repo_read.py`. All changed files listed in the manifest were reviewed through the diff or targeted source reads; full-file text was not read for every file. I did not independently verify the author-reported test runs or hardware behavior. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 15:02:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T15:02:07Z.

Review: APPROVED


Reviewed — looks good

The reviewed head is 660f02cdd7ec94da9562885bbaef666a31ec6327; the available code supports the targeted record poisoning behavior, and I found no verified blocking defect.

What I ran

I read the prepared diff and targeted changed code with repo_read.py; no tests or builds were run. Author-reported test results are not treated as runs performed in this review.

Results

Check Result Note
Diff and targeted source review passed Changed logic inspected
Tests and build not run Author reports are unverified

Findings

Blocking

None.

Non-blocking

None.

Not verified

I read all files marked included in manifest.json except core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp, core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp, and docs/dev/debt/changes/fix-agc-image-table-written-keys.md; their full texts were available but not needed for the targeted logic review. I also did not read the full text of core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, which was excluded for size; its changed hunk was included in the prepared diff and was reviewed. No checks were run, and console behavior, CI results, and author-reported tests were not independently confirmed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6012919121 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6012919121). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T15:02:07Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed head is `660f02cdd7ec94da9562885bbaef666a31ec6327`; the available code supports the targeted record poisoning behavior, and I found no verified blocking defect. ## What I ran I read the prepared diff and targeted changed code with `repo_read.py`; no tests or builds were run. Author-reported test results are not treated as runs performed in this review. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Changed logic inspected | | Tests and build | not run | Author reports are unverified | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I read all files marked included in `manifest.json` except `core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp`, `core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp`, and `docs/dev/debt/changes/fix-agc-image-table-written-keys.md`; their full texts were available but not needed for the targeted logic review. I also did not read the full text of `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`, which was excluded for size; its changed hunk was included in the prepared diff and was reviewed. No checks were run, and console behavior, CI results, and author-reported tests were not independently confirmed. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-27 05:15:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T05:15:10Z.

Review: COMMENTED


Reviewed — no blocking findings

The inspected changes consistently track and poison only overlapping image table records when a supported linear layout is available; execution checks were not run.

What I ran

Reviewed head 06fae1ad18d1b9cf72d3ae3ec5528b6e50add019 using the prepared review bundle and repo_read.py for repository context. No commands or tests were run.

Results

Check Result Note
Changed code review passed Inspected added lines and relevant function context.
Automated checks not run No local test execution.
Author-reported checks not run Results in the description were not independently confirmed.

Negative control

Not run in this review.

Findings

Blocking

None identified in the inspected code.

Non-blocking

None.

Sources

Reviewed the prepared diff and pinned-head source for the record-overlap logic, layout materialization, serialization, and associated tests.

Not verified

The author-reported Linux, Windows, GPU, and game runs were not independently verified. The full text of ShaderResources.cpp was excluded from the review folder; its changed function range was read through repo_read.py. Read the changed-line ranges for all nine included changed files, plus the changed function range in that excluded file. Also read description.md, commits.md, manifest.json, diff.patch, and README.md. No changed files were left unread at their changed lines.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6083779346 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6083779346). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-27T05:15:10Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The inspected changes consistently track and poison only overlapping image table records when a supported linear layout is available; execution checks were not run. ## What I ran Reviewed head `06fae1ad18d1b9cf72d3ae3ec5528b6e50add019` using the prepared review bundle and `repo_read.py` for repository context. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Inspected added lines and relevant function context. | | Automated checks | not run | No local test execution. | | Author-reported checks | not run | Results in the description were not independently confirmed. | ## Negative control Not run in this review. ## Findings ### Blocking None identified in the inspected code. ### Non-blocking None. ## Sources Reviewed the prepared diff and pinned-head source for the record-overlap logic, layout materialization, serialization, and associated tests. ## Not verified The author-reported Linux, Windows, GPU, and game runs were not independently verified. The full text of `ShaderResources.cpp` was excluded from the review folder; its changed function range was read through `repo_read.py`. Read the changed-line ranges for all nine included changed files, plus the changed function range in that excluded file. Also read `description.md`, `commits.md`, `manifest.json`, `diff.patch`, and `README.md`. No changed files were left unread at their changed lines. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-27 10:36:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T10:36:46Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the inspected code supports per-record poisoning for eligible pointer tables and preserves whole-table faults for unsupported layouts.

What I ran

Reviewed head 19f7d4a0ab5839eb72a80a7246cf28dc76dff84a using the prepared diff and pinned reader. No build or tests were run; reported test results below are author-supplied.

Results

Check Result Note
Code review passed Core changed paths inspected
Automated tests not run No commands run
Author-reported tests passed Targeted tests and negative controls reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

No files were excluded by rule. Read changed files: ShaderResources.cpp (changed hunk), ShaderDiskCache.cpp, ShaderDiskCache.hpp, ImageTable.cpp (changed hunks), ResourcePlan.hpp (changed hunk), ResourceMaterializer.cpp (changed hunk), Recompiler.cpp (changed hunk), Recompiler.hpp (changed hunk), ShaderDiskCache.cpp test (changed hunks), and fix-agc-image-table-written-keys.md. Other unchanged context and runtime behavior were not verified. The tests described in the PR body were not run by this review.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6086835160 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6086835160). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-27T10:36:46Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the inspected code supports per-record poisoning for eligible pointer tables and preserves whole-table faults for unsupported layouts. ## What I ran Reviewed head `19f7d4a0ab5839eb72a80a7246cf28dc76dff84a` using the prepared diff and pinned reader. No build or tests were run; reported test results below are author-supplied. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | Core changed paths inspected | | Automated tests | not run | No commands run | | Author-reported tests | passed | Targeted tests and negative controls reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No files were excluded by rule. Read changed files: `ShaderResources.cpp` (changed hunk), `ShaderDiskCache.cpp`, `ShaderDiskCache.hpp`, `ImageTable.cpp` (changed hunks), `ResourcePlan.hpp` (changed hunk), `ResourceMaterializer.cpp` (changed hunk), `Recompiler.cpp` (changed hunk), `Recompiler.hpp` (changed hunk), `ShaderDiskCache.cpp` test (changed hunks), and `fix-agc-image-table-written-keys.md`. Other unchanged context and runtime behavior were not verified. The tests described in the PR body were not run by this review. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-28 13:16:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T13:16:00Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks approval; the reviewed changes correctly limit poisoning to overlapping pointer-table records where a supported linear layout is available.

What I ran

Reviewed head 0aaaa698c4a5d42a863c285f671aaad9bf391923. Read the prepared description, commit list, manifest, diff, and relevant changed code through repo_read.py; no build or tests were run in this review.

Results

Check Result Note
Diff and changed-code review passed Targeted code paths inspected
Automated checks not run No commands or tests run

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests were run here; author-reported tests and runtime results were not independently verified. Read: description.md, commits.md, manifest.json, diff.patch; changed code in ShaderResources.cpp, ImageTable.cpp, ResourceMaterializer.cpp, ImageTableAbi.hpp, Recompiler.cpp, Recompiler.hpp, ShaderDiskCache.cpp, and ShaderDiskCache.hpp. The full text of ShaderResources.cpp was excluded from the prepared review folder, so only the relevant range was read via repo_read.py. All changed files marked included in the manifest were not read in full.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6097977080 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6097977080). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-28T13:16:00Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks approval; the reviewed changes correctly limit poisoning to overlapping pointer-table records where a supported linear layout is available. ## What I ran Reviewed head `0aaaa698c4a5d42a863c285f671aaad9bf391923`. Read the prepared description, commit list, manifest, diff, and relevant changed code through `repo_read.py`; no build or tests were run in this review. ## Results | Check | Result | Note | |---|---|---| | Diff and changed-code review | passed | Targeted code paths inspected | | Automated checks | not run | No commands or tests run | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No tests were run here; author-reported tests and runtime results were not independently verified. Read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`; changed code in `ShaderResources.cpp`, `ImageTable.cpp`, `ResourceMaterializer.cpp`, `ImageTableAbi.hpp`, `Recompiler.cpp`, `Recompiler.hpp`, `ShaderDiskCache.cpp`, and `ShaderDiskCache.hpp`. The full text of `ShaderResources.cpp` was excluded from the prepared review folder, so only the relevant range was read via `repo_read.py`. All changed files marked included in the manifest were not read in full. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-12-03 14:30:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T14:30:59Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this; the points below are optional.

What I ran

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

python3 repo_read.py cat <changed-path> <start> <end>
python3 repo_read.py search "imageTableRecords" core

Results

Check Result Note
Changed source inspection passed All 10 reviewed files were read
Tests and build not run No local execution
Prepared review inputs passed No files excluded

Negative control

Not run locally. The description reports prior negative-control runs; I did not independently verify them.

Findings

Blocking

None.

Non-blocking

None.

Sources

The changed code derives a linear record layout only for supported pointer-table columns, carries it through the invocation and disk cache, and poisons only overlapping keys when that layout is available. The overlap helper handles inclusive address-space ends. Implementation at the reviewed head · Record range helper and tests

Files read: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp, core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp, core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ResourcePlan.hpp, core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp, core/shader/recompiler/Recompiler.cpp, core/shader/recompiler/Recompiler.hpp, core/shader/recompiler/ShaderDiskCache.cpp, core/shader/recompiler/ShaderDiskCache.hpp, and docs/dev/debt/changes/fix-agc-image-table-written-keys.md. Excluded files: none.

Not verified

I did not run tests, builds, or hardware checks. Reported test and game runs in the PR description were not independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6171775295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6171775295). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-03T14:30:59Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this; the points below are optional. ## What I ran Reviewed head `ee03b3fa16b922170513b846d22cfdd44cb69f07` using the pinned `repo_read.py` reader and the prepared diff. No tests or builds were run. ```text python3 repo_read.py cat <changed-path> <start> <end> python3 repo_read.py search "imageTableRecords" core ``` ## Results | Check | Result | Note | |---|---|---| | Changed source inspection | passed | All 10 reviewed files were read | | Tests and build | not run | No local execution | | Prepared review inputs | passed | No files excluded | ## Negative control Not run locally. The description reports prior negative-control runs; I did not independently verify them. ## Findings ### Blocking None. ### Non-blocking None. ## Sources The changed code derives a linear record layout only for supported pointer-table columns, carries it through the invocation and disk cache, and poisons only overlapping keys when that layout is available. The overlap helper handles inclusive address-space ends. [Implementation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/ee03b3fa16b922170513b846d22cfdd44cb69f07/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L7519-L7548) · [Record range helper and tests](https://github.com/boykopovar/AnyPS5/blob/ee03b3fa16b922170513b846d22cfdd44cb69f07/core/shader/recompiler/Recompiler.hpp#L967-L985) Files read: `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`, `core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp`, `core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp`, `core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ResourcePlan.hpp`, `core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp`, `core/shader/recompiler/Recompiler.cpp`, `core/shader/recompiler/Recompiler.hpp`, `core/shader/recompiler/ShaderDiskCache.cpp`, `core/shader/recompiler/ShaderDiskCache.hpp`, and `docs/dev/debt/changes/fix-agc-image-table-written-keys.md`. Excluded files: none. ## Not verified I did not run tests, builds, or hardware checks. Reported test and game runs in the PR description were not independently verified. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 15:57:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:57:13Z.

Review: COMMENTED


Both image-table record-reuse CTests passed on main and aborted on the patched tree, including the narrow case. The scalar-buffer and shader-disk-cache controls passed on both trees. I used the same Linux lavapipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Both logs show layer insertion and contain no missing-layer diagnostic or VUID- entry. The two aborts appeared without an assertion message in the CTest log.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6173365553 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22690#pullrequestreview-6173365553). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T15:57:13Z. **Review:** COMMENTED --- Both image-table record-reuse CTests passed on main and aborted on the patched tree, including the narrow case. The scalar-buffer and shader-disk-cache controls passed on both trees. I used the same Linux lavapipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Both logs show layer insertion and contain no missing-layer diagnostic or `VUID-` entry. The two aborts appeared without an assertion message in the CTest log. 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/22690:upstream-pr/22690'
git switch 'upstream-pr/22690'

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