fix(agc): accept bindless image tables with entries wider than 32 bytes #5620

Closed
xXPBSXx wants to merge 3 commits from upstream-pr/5620 into main
xXPBSXx commented 2026-10-14 01:25:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T01:25:45Z.


What

The bindless image-table planner only recognised a T# table whose entries are exactly 32 bytes apart (key << 5 or key * 32). Resident Evil 4 (PPSA07411) loads its T# from a table with 48-byte entries, the T# in the last 32 bytes (key * 48, load offset 16). The descriptor therefore stayed a ReadConstBuffer and the recompiler stopped with GetImageResource dword 0 is not a valid runtime value.

  • DescriptorSource::IndirectImage now carries entryStride (default 32).
  • MatchTableOffset accepts a multiplier that is a multiple of 4 and at least 32; the planner requires the eight T# dwords to lie inside one entry; ResourceMaterializer uses the stride for the entry count, the partial-descriptor check and the entry address.
  • The shader disk cache plan encoder (ShaderDiskCache.cpp) writes and reads entryStride; without it a stored plan would reset the stride to 32, and main does not build with the new field until the encoder is updated (static_assert ... IndirectImage changed: update the plan encoder).
  • Records wider than 32 bytes whose T# the runtime walk can already evaluate at each capture (record index from uniform user data, the uniform table image case in tests/ShaderMemory.cpp) stay direct images; only records it cannot evaluate become a table.
  • 32-byte tables behave as before.

New test cases: agc_shader_bindless (in agc_shader_memory_tests) gets a 48-byte table; the round-trip case of agc_shader_disk_cache now uses a table with stride 48.

Tested

Windows 10 (19045), MinGW-w64 GCC 15.2, Release, ninja -j 4 of the seven agc_shader_* test targets, ctest called directly in PowerShell. Head ee950660358c6d199a23131ad00de6f96db50fba (three commits) on main 63fb0cd92e83eaba3b3d1ac88fc532c7dd32ae58; git merge-tree against main 5a6ad0ed36893e86022929b808ac547672445cd9 (later) reports no conflict:

  • With the change: ninja exit 0; ctest -R agc_shader_bindless exits 0 (1 of 1); ctest -R agc_shader_ exits 8, 14 of 15 passed. The one failure is agc_shader_disk_cache with cannot remove the shader cache test directory: Zugriff verweigert after all of its round-trip checks printed; the same test fails with the same message on main 23be5a02b075bd05c7c27d8b18a3d47ead6fd0e5 without this change (run alone; not re-run on 63fb0cd92), so it is not caused by this PR. agc_shader_memory passes (ctest -V -R ^agc_shader_memory$ exits 0; ctest prints only the test name, the uniform table image case is in its source, tests/ShaderMemory.cpp).
  • Without the change (ResourceMaterializer.cpp and ResourceTracker.cpp taken back to main; tests, header field and disk cache encoder unchanged): ctest -R agc_shader_bindless exits 8, 0 of 1, with GetImageResource dword 0 is not a valid runtime value.
  • python tools/check_conventions.py --base upstream/main passes.
  • Title evidence without the change: a 90 s run of PPSA07411 on main d1670009f (log PPSA07411_rB/run_022642.err) ends with ShaderRegistry.cpp:782 ... Shader 0x2060e9c100 could not be prepared after registration: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value.
  • Title run PPSA07411: one run of 75 s without the error, on an earlier main and without the disk cache change; no picture was checked, so nothing is claimed about the rendered image. Not re-run on the rebased head.
  • Not tested: Linux, console, other ctest tests (apart from the agc_shader_* tests above), AMD.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA07411 #2776 (open issue for this title; no Game bring-up discussion for it exists, the only Resident Evil discussion found is #5169 for PPSA01556, a different title)
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 610.74 (Windows 32.0.16.1074), Windows 10 19045; the tests above select no GPU, the GPU is the one of the title run; AMD not tested
  • AI-assisted: yes

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4851635189 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T01:25:45Z. --- ### What The bindless image-table planner only recognised a T# table whose entries are exactly 32 bytes apart (`key << 5` or `key * 32`). Resident Evil 4 (PPSA07411) loads its T# from a table with 48-byte entries, the T# in the last 32 bytes (`key * 48`, load offset 16). The descriptor therefore stayed a `ReadConstBuffer` and the recompiler stopped with `GetImageResource dword 0 is not a valid runtime value`. - `DescriptorSource::IndirectImage` now carries `entryStride` (default 32). - `MatchTableOffset` accepts a multiplier that is a multiple of 4 and at least 32; the planner requires the eight T# dwords to lie inside one entry; `ResourceMaterializer` uses the stride for the entry count, the partial-descriptor check and the entry address. - The shader disk cache plan encoder (`ShaderDiskCache.cpp`) writes and reads `entryStride`; without it a stored plan would reset the stride to 32, and `main` does not build with the new field until the encoder is updated (`static_assert ... IndirectImage changed: update the plan encoder`). - Records wider than 32 bytes whose T# the runtime walk can already evaluate at each capture (record index from uniform user data, the `uniform table image` case in `tests/ShaderMemory.cpp`) stay direct images; only records it cannot evaluate become a table. - 32-byte tables behave as before. New test cases: `agc_shader_bindless` (in `agc_shader_memory_tests`) gets a 48-byte table; the round-trip case of `agc_shader_disk_cache` now uses a table with stride 48. ### Tested Windows 10 (19045), MinGW-w64 GCC 15.2, Release, `ninja -j 4` of the seven `agc_shader_*` test targets, ctest called directly in PowerShell. Head `ee950660358c6d199a23131ad00de6f96db50fba` (three commits) on `main` `63fb0cd92e83eaba3b3d1ac88fc532c7dd32ae58`; `git merge-tree` against `main` `5a6ad0ed36893e86022929b808ac547672445cd9` (later) reports no conflict: - With the change: `ninja` exit 0; `ctest -R agc_shader_bindless` exits 0 (1 of 1); `ctest -R agc_shader_` exits 8, 14 of 15 passed. The one failure is `agc_shader_disk_cache` with `cannot remove the shader cache test directory: Zugriff verweigert` after all of its round-trip checks printed; the same test fails with the same message on `main` `23be5a02b075bd05c7c27d8b18a3d47ead6fd0e5` without this change (run alone; not re-run on `63fb0cd92`), so it is not caused by this PR. `agc_shader_memory` passes (`ctest -V -R ^agc_shader_memory$` exits 0; ctest prints only the test name, the `uniform table image` case is in its source, `tests/ShaderMemory.cpp`). - Without the change (`ResourceMaterializer.cpp` and `ResourceTracker.cpp` taken back to `main`; tests, header field and disk cache encoder unchanged): `ctest -R agc_shader_bindless` exits 8, 0 of 1, with `GetImageResource dword 0 is not a valid runtime value`. - `python tools/check_conventions.py --base upstream/main` passes. - Title evidence without the change: a 90 s run of PPSA07411 on `main` `d1670009f` (log `PPSA07411_rB/run_022642.err`) ends with `ShaderRegistry.cpp:782 ... Shader 0x2060e9c100 could not be prepared after registration: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value`. - Title run PPSA07411: one run of 75 s without the error, on an earlier `main` and without the disk cache change; no picture was checked, so nothing is claimed about the rendered image. Not re-run on the rebased head. - Not tested: Linux, console, other ctest tests (apart from the `agc_shader_*` tests above), AMD. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA07411 #2776 (open issue for this title; no Game bring-up discussion for it exists, the only Resident Evil discussion found is #5169 for PPSA01556, a different title) - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 610.74 (Windows 32.0.16.1074), Windows 10 19045; the tests above select no GPU, the GPU is the one of the title run; AMD not tested - [x] AI-assisted: yes AI-assisted (Claude Code).
CnRJay commented 2026-10-14 02:10:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T02:10:04Z.

Review: COMMENTED


Carrying the stride through the plan and the disk-cache encoder is the right shape, and requiring the eight dwords to sit inside one entry keeps the matcher safe. The new partial-descriptor check in resolveTableImage is too strict for strides other than 32, though:

if (heapSize != 0u && (heapSize < table.entryOffset + TableEntryBytes || (heapSize - table.entryOffset - TableEntryBytes) % table.entryStride != 0u)) throw ...

This requires the heap to end exactly at the end of the last T#. That holds for RE4 only because its T# is the last 32 bytes of the entry (16 + 32 == 48). Take a table with 64-byte entries and the T# first (offset 0), with a V# that covers whole entries (heapSize = 64 * n, the natural size): (64n - 32) % 64 == 32, so it throws "bindless heap contains a partial descriptor" although every descriptor is complete. The same happens for any layout where data follows the T# in the entry.

A descriptor is only partial when the heap ends inside a T#. With tail = (heapSize - entryOffset) % entryStride, that is tail != 0 && tail < TableEntryBytes. The entry count stays (heapSize - entryOffset - TableEntryBytes) / entryStride + 1, as written. For stride 32 this reduces to the old check, so 32-byte tables still behave as on main. A 64-byte/offset-0 case in agc_shader_bindless, next to the 48-byte one, would cover it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5512257762 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#pullrequestreview-5512257762). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T02:10:04Z. **Review:** COMMENTED --- Carrying the stride through the plan and the disk-cache encoder is the right shape, and requiring the eight dwords to sit inside one entry keeps the matcher safe. The new partial-descriptor check in `resolveTableImage` is too strict for strides other than 32, though: ```cpp if (heapSize != 0u && (heapSize < table.entryOffset + TableEntryBytes || (heapSize - table.entryOffset - TableEntryBytes) % table.entryStride != 0u)) throw ... ``` This requires the heap to end exactly at the end of the last T#. That holds for RE4 only because its T# is the last 32 bytes of the entry (`16 + 32 == 48`). Take a table with 64-byte entries and the T# first (offset 0), with a V# that covers whole entries (`heapSize = 64 * n`, the natural size): `(64n - 32) % 64 == 32`, so it throws "bindless heap contains a partial descriptor" although every descriptor is complete. The same happens for any layout where data follows the T# in the entry. A descriptor is only partial when the heap ends inside a T#. With `tail = (heapSize - entryOffset) % entryStride`, that is `tail != 0 && tail < TableEntryBytes`. The entry count stays `(heapSize - entryOffset - TableEntryBytes) / entryStride + 1`, as written. For stride 32 this reduces to the old check, so 32-byte tables still behave as on `main`. A 64-byte/offset-0 case in `agc_shader_bindless`, next to the 48-byte one, would cover it.
xXPBSXx commented 2026-10-14 03:34:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T03:34:08Z.


Thanks, you are right: with heapSize = 64 * n, a 64-byte entry and the T# at offset 0, the check (heapSize - entryOffset - 32) % entryStride != 0 throws although every descriptor is complete. Fixed in 98afd6bf2 (an additional commit, no rebase): the heap is partial only when it ends inside a T#, i.e. (heapSize - entryOffset) % entryStride is non-zero and below 32. The entry count is unchanged, and 32-byte tables keep the old behaviour. agc_shader_bindless now has a 64-byte/offset-0 case next to the 48-byte one.

Windows 10 (19045), MinGW-w64 GCC 15.2, Release, ninja -j 4, ctest called directly, head 98afd6bf2d24a32b01d11be5a303ca6d33f71230 (base d55f7e25a): ctest -R agc_shader_bindless exits 0; ctest -R agc_shader_ exits 0, 12 of 12. With ResourceMaterializer.cpp taken back to d55f7e25a (new test kept) ctest -R agc_shader_bindless exits 8 with bindless heap contains a partial descriptor. Logs: stride_r7_fix.log and stride_r7_nofix.log. Not tested: Linux, console, a title run of the new commit.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6160286279 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6160286279). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T03:34:08Z. --- Thanks, you are right: with `heapSize = 64 * n`, a 64-byte entry and the T# at offset 0, the check `(heapSize - entryOffset - 32) % entryStride != 0` throws although every descriptor is complete. Fixed in `98afd6bf2` (an additional commit, no rebase): the heap is partial only when it ends inside a T#, i.e. `(heapSize - entryOffset) % entryStride` is non-zero and below 32. The entry count is unchanged, and 32-byte tables keep the old behaviour. `agc_shader_bindless` now has a 64-byte/offset-0 case next to the 48-byte one. Windows 10 (19045), MinGW-w64 GCC 15.2, Release, `ninja -j 4`, ctest called directly, head `98afd6bf2d24a32b01d11be5a303ca6d33f71230` (base `d55f7e25a`): `ctest -R agc_shader_bindless` exits 0; `ctest -R agc_shader_` exits 0, 12 of 12. With `ResourceMaterializer.cpp` taken back to `d55f7e25a` (new test kept) `ctest -R agc_shader_bindless` exits 8 with `bindless heap contains a partial descriptor`. Logs: stride_r7_fix.log and stride_r7_nofix.log. Not tested: Linux, console, a title run of the new commit. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-14 07:30:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T07:30:09Z.


Title evidence for this pull request: PRAGMATA (PPSA02530), Windows 10 (19045), RTX 4080 SUPER, one 90 s run per state, no picture checked.

  • Without this pull request (local merge tree 7cf13d706 = main + #5457 1243f067b + #5550 cd1757e03): 32 lines GetImageResource dword 0 is not a valid runtime value (first one at line 114), then the abort what(): shader 0x211145e100 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00000568(... (line 207) and FATAL, PPSA02530_rR/run_092439.err.
  • With this head (98afd6bf2) added (local merge tree a57296147 = main + #5457 + this pull request + #5550): 0 such lines, no what() and no FATAL in the 90 s run, PPSA02530_rR/run_091659.err.
  • A debug print on a separate run with this pull request and #5457 but without #5550 showed 37 table T#s matched with stride 48 and immediate offset 16, and 8 handles that print return false at line 548 (I attribute these to the shared-T# case that #5550 addresses; the log line itself does not say so); earlier runs of that state (PPSA02530_rP/run_073233.err, run_090831.err) show 2 lines GetImageResource dword 0 each, not fatal in 90 s. So the title needs this change (stride 48) and #5550 (shared T#).

Test conditions: the merge trees are local and not pushed (the base main commit was not recorded by me; the #5550 merge needed a local conflict resolution in tests/ShaderMemory.cpp, which does not touch the libraries). ninja -j 8 libs exit 0, 128 .prx (libSceAgcDriver.prx rebuilt for each run, oldest .prx 2026-10-13 09:50 not rebuilt), nid_patcher 2026-10-14 08:00:09; libSceConvertKeycode.prx replaced by a local stub (without it main stops in sceConvertKeycodeGetCharacter); title executable app.exe of 2026-10-14 07:36:44 relinked by another session (relinker version and relink command not recorded by me); run with run_title.ps1, one game at a time.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6163246725 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6163246725). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T07:30:09Z. --- Title evidence for this pull request: PRAGMATA (PPSA02530), Windows 10 (19045), RTX 4080 SUPER, one 90 s run per state, no picture checked. - Without this pull request (local merge tree `7cf13d706` = `main` + #5457 `1243f067b` + #5550 `cd1757e03`): 32 lines `GetImageResource dword 0 is not a valid runtime value` (first one at line 114), then the abort `what(): shader 0x211145e100 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00000568(...` (line 207) and FATAL, `PPSA02530_rR/run_092439.err`. - With this head (`98afd6bf2`) added (local merge tree `a57296147` = `main` + #5457 + this pull request + #5550): 0 such lines, no `what()` and no FATAL in the 90 s run, `PPSA02530_rR/run_091659.err`. - A debug print on a separate run with this pull request and #5457 but without #5550 showed 37 table T#s matched with stride 48 and immediate offset 16, and 8 handles that print `return false at line 548` (I attribute these to the shared-T# case that #5550 addresses; the log line itself does not say so); earlier runs of that state (`PPSA02530_rP/run_073233.err`, `run_090831.err`) show 2 lines `GetImageResource dword 0` each, not fatal in 90 s. So the title needs this change (stride 48) and #5550 (shared T#). Test conditions: the merge trees are local and not pushed (the base `main` commit was not recorded by me; the #5550 merge needed a local conflict resolution in `tests/ShaderMemory.cpp`, which does not touch the libraries). `ninja -j 8 libs` exit 0, 128 `.prx` (`libSceAgcDriver.prx` rebuilt for each run, oldest `.prx` 2026-10-13 09:50 not rebuilt), `nid_patcher` 2026-10-14 08:00:09; `libSceConvertKeycode.prx` replaced by a local stub (without it `main` stops in `sceConvertKeycodeGetCharacter`); title executable `app.exe` of 2026-10-14 07:36:44 relinked by another session (relinker version and relink command not recorded by me); run with `run_title.ps1`, one game at a time. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 08:59:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T08:59:31Z.


AMD and NVIDIA runs for this PR at head 98afd6bf2. Windows 11 Pro 26200, WinLibs GCC 15.2.0 (MinGW-w64), Release, one machine with two GPUs, each picked with ANYPS5_GPU:

  • NVIDIA GeForce RTX 5070, driver 617.42 (32.0.16.1742)
  • AMD Radeon(TM) Graphics, Ryzen integrated, gfx1036 (1002:13c0, RDNA 2), driver 32.0.21036.18

ctest -R "agc|shader|video_out" -j 8 (506 tests, including the ones this PR adds or changes):

  • RTX 5070: all 506 pass.
  • AMD gfx1036: all pass except agc_driver_lds_mixed_width_atomics, agc_driver_pixel_interlock and agc_driver_layered_volume_vertex_no_gpl. These three fail the same way on current main (872f52320) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR.

No title run. AI-assisted: yes (Claude Code ran the builds and tests).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6164727320 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6164727320). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T08:59:31Z. --- AMD and NVIDIA runs for this PR at head `98afd6bf2`. Windows 11 Pro 26200, WinLibs GCC 15.2.0 (MinGW-w64), Release, one machine with two GPUs, each picked with `ANYPS5_GPU`: - NVIDIA GeForce RTX 5070, driver 617.42 (32.0.16.1742) - AMD Radeon(TM) Graphics, Ryzen integrated, gfx1036 (`1002:13c0`, RDNA 2), driver 32.0.21036.18 `ctest -R "agc|shader|video_out" -j 8` (506 tests, including the ones this PR adds or changes): - RTX 5070: all 506 pass. - AMD gfx1036: all pass except `agc_driver_lds_mixed_width_atomics`, `agc_driver_pixel_interlock` and `agc_driver_layered_volume_vertex_no_gpl`. These three fail the same way on current `main` (`872f52320`) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR. No title run. AI-assisted: yes (Claude Code ran the builds and tests).
mrfelek commented 2026-10-14 10:00:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T10:00:42Z.


Data point from another title. Marvel's Wolverine (PPSA03671, 01.001.005), Linux, RTX 3080 Ti (NVIDIA 615.71.09): merged on top of main 43349d433 together with #5188, #5550 and #5473 it builds and runs. Compute shaders that used to fail earlier now reach the table: the remaining drops are static bindless image capacity exceeded (4 shaders) and bindless image table has 6948 entries (0 materials), limit 16 (the game's bindless table has about 7000 entries). FYI: #5089 and this PR conflict in ResourceMaterializer.cpp (both change how the table entry stride is computed), so they cannot be tested together without a manual merge. More in https://github.com/boykopovar/AnyPS5/discussions/5516.

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6165794593 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6165794593). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-14T10:00:42Z. --- Data point from another title. Marvel's Wolverine (PPSA03671, 01.001.005), Linux, RTX 3080 Ti (NVIDIA 615.71.09): merged on top of `main` 43349d433 together with #5188, #5550 and #5473 it builds and runs. Compute shaders that used to fail earlier now reach the table: the remaining drops are `static bindless image capacity exceeded` (4 shaders) and `bindless image table has 6948 entries (0 materials), limit 16` (the game's bindless table has about 7000 entries). FYI: #5089 and this PR conflict in `ResourceMaterializer.cpp` (both change how the table entry stride is computed), so they cannot be tested together without a manual merge. More in https://github.com/boykopovar/AnyPS5/discussions/5516. AI-assisted; the runs are from my machine.
simonbronk commented 2026-10-14 10:26:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T10:26:27Z.


Title evidence: Onimusha: Way of the Sword (PPSA27836 01.000.001, RE Engine), Windows 11 Pro 26200, RTX 5070. On main 0b97f8b9f plus the start-up fixes listed in #5769, it stops preparing pixel programs that read their T# from 48-byte records at +16 (s_buffer_load_dwordx8 at key * 0x30), the key loaded through a readfirstlane inside a bit-mask loop:

GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000391c(..., IMul32(ReadConstBuffer@pc=0x00002f88(..., IMul32(ReadFirstLane(...), Immediate)), Immediate))

A later program reads the same table T# for two image operations. With #5620 and #5550 both merged, both pass and the title stops next at static bindless image capacity exceeded (#5720). Not run with only one of the two.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166250192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6166250192). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T10:26:27Z. --- Title evidence: Onimusha: Way of the Sword (PPSA27836 01.000.001, RE Engine), Windows 11 Pro 26200, RTX 5070. On `main` 0b97f8b9f plus the start-up fixes listed in #5769, it stops preparing pixel programs that read their T# from 48-byte records at +16 (`s_buffer_load_dwordx8` at `key * 0x30`), the key loaded through a `readfirstlane` inside a bit-mask loop: ``` GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000391c(..., IMul32(ReadConstBuffer@pc=0x00002f88(..., IMul32(ReadFirstLane(...), Immediate)), Immediate)) ``` A later program reads the same table T# for two image operations. With #5620 and #5550 both merged, both pass and the title stops next at `static bindless image capacity exceeded` (#5720). Not run with only one of the two. AI-assisted: yes (Claude Code).
xXPBSXx commented 2026-10-14 12:30:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T12:30:47Z.


Title run on the rebased head: Resident Evil 4 (PPSA07411), Windows 10 (19045), RTX 4080 SUPER, one run of 120 s requested, no picture checked.

On head d7e6318af8ead231863fa2e8b4c1dcb6553f80c8 (merge tree = branch head, main base 97eab6e63): PPSA07411_rY/run_142109.err has 93 lines (counted with Python), 0 lines with GetImageResource dword 0 is not a valid runtime value, and no what(), FATAL, terminate or Vulkan result. Lines 6 to 81 are 76 notes ShaderRegistry.cpp:692 ... could not be prepared at registration (its s_swappc_b64 at program counter 0x74 calls a computed target); preparing it when it is used, which are not a stop; the log then continues with shader-disk-cache lines to its end.

Before this change the same title stopped at that GetImageResource message (PPSA07411_rT1/run_110620.err line 93 on an earlier main).

Test conditions: all 128 .prx rebuilt (ninja exit 0, 14:19:03 to 14:20:57 local time); title executable PPSA07411_rY/app.exe, a hardlink of the PPSA07411_rH one dated 2026-10-14 07:38:51 (relinked by another session; relinker commit and relink command not recorded by me); run through run_title.ps1, one game at a time; script start 14:21:07, end 14:27:45 (includes the wait for the game lock). One run only.
Not tested: Linux, other GPUs, a longer run, a second run.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6168387697 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6168387697). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T12:30:47Z. --- Title run on the rebased head: Resident Evil 4 (PPSA07411), Windows 10 (19045), RTX 4080 SUPER, one run of 120 s requested, no picture checked. On head `d7e6318af8ead231863fa2e8b4c1dcb6553f80c8` (merge tree = branch head, `main` base `97eab6e63`): `PPSA07411_rY/run_142109.err` has 93 lines (counted with Python), 0 lines with `GetImageResource dword 0 is not a valid runtime value`, and no `what()`, `FATAL`, `terminate` or `Vulkan result`. Lines 6 to 81 are 76 notes `ShaderRegistry.cpp:692 ... could not be prepared at registration (its s_swappc_b64 at program counter 0x74 calls a computed target); preparing it when it is used`, which are not a stop; the log then continues with shader-disk-cache lines to its end. Before this change the same title stopped at that `GetImageResource` message (`PPSA07411_rT1/run_110620.err` line 93 on an earlier `main`). Test conditions: all 128 `.prx` rebuilt (`ninja` exit 0, 14:19:03 to 14:20:57 local time); title executable `PPSA07411_rY/app.exe`, a hardlink of the `PPSA07411_rH` one dated 2026-10-14 07:38:51 (relinked by another session; relinker commit and relink command not recorded by me); run through `run_title.ps1`, one game at a time; script start 14:21:07, end 14:27:45 (includes the wait for the game lock). One run only. Not tested: Linux, other GPUs, a longer run, a second run. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 12:46:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T12:46:16Z.


Heads-up: rebased onto current main (9a3e2ac4d), this PR breaks agc_shader_memory, which gained #5188's verifyUniformTableImage in the meantime:

uniform table image: the T# read from a constant buffer was not planned as one image

That test reads its T# with s_buffer_load_dwordx8 at s2 * 48 + 16, a key from user data that the SRT walk evaluates per capture. With 48-byte records accepted, TryMakeTableImage now plans it as a bindless table first. On main it was safe only because the stride was 48. One way out would be to keep the table path for keys the walk cannot evaluate (a ReadFirstLane, a material read) and leave evaluable keys to GetHandle, but that is your call.

Reproduced on Windows 11 with only this PR's two commits rebased onto main (conflicts with #5089 in ResourceMaterializer.cpp and ShaderDiskCache.cpp resolved by keeping both). #5820 carries these commits and hits the same failure.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6168665716 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6168665716). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T12:46:16Z. --- Heads-up: rebased onto current `main` (9a3e2ac4d), this PR breaks `agc_shader_memory`, which gained #5188's `verifyUniformTableImage` in the meantime: ``` uniform table image: the T# read from a constant buffer was not planned as one image ``` That test reads its T# with `s_buffer_load_dwordx8` at `s2 * 48 + 16`, a key from user data that the SRT walk evaluates per capture. With 48-byte records accepted, `TryMakeTableImage` now plans it as a bindless table first. On `main` it was safe only because the stride was 48. One way out would be to keep the table path for keys the walk cannot evaluate (a `ReadFirstLane`, a material read) and leave evaluable keys to `GetHandle`, but that is your call. Reproduced on Windows 11 with only this PR's two commits rebased onto `main` (conflicts with #5089 in `ResourceMaterializer.cpp` and `ShaderDiskCache.cpp` resolved by keeping both). #5820 carries these commits and hits the same failure. AI-assisted: yes (Claude Code).
xXPBSXx commented 2026-10-14 13:01:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T13:01:52Z.


Thanks for the check. The head d7e6318af8ead231863fa2e8b4c1dcb6553f80c8 (pushed after your comment) already takes that way out: a record wider than 32 bytes whose T# the runtime walk can evaluate at each capture (the uniform table image case) stays a direct image, and only records it cannot evaluate become a table.

On that head, ctest -R agc_shader_ on Windows 10 (19045) ran 15 tests: the only failure was agc_shader_disk_cache (cannot remove ... Zugriff verweigert, the same on main without this change), so agc_shader_memory passed (stride_r8_fix.log, 14 to 16 local time on 14 October; without the change agc_shader_bindless fails with GetImageResource dword 0 is not a valid runtime value). I have not run the new verifyUniformTableImage of #5188 on a rebase onto the latest main yet; main has moved again and this PR needs another rebase, which I will do and report.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6168959682 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6168959682). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T13:01:52Z. --- Thanks for the check. The head `d7e6318af8ead231863fa2e8b4c1dcb6553f80c8` (pushed after your comment) already takes that way out: a record wider than 32 bytes whose T# the runtime walk can evaluate at each capture (the `uniform table image` case) stays a direct image, and only records it cannot evaluate become a table. On that head, `ctest -R agc_shader_` on Windows 10 (19045) ran 15 tests: the only failure was `agc_shader_disk_cache` (`cannot remove ... Zugriff verweigert`, the same on `main` without this change), so `agc_shader_memory` passed (`stride_r8_fix.log`, 14 to 16 local time on 14 October; without the change `agc_shader_bindless` fails with `GetImageResource dword 0 is not a valid runtime value`). I have not run the new `verifyUniformTableImage` of #5188 on a rebase onto the latest `main` yet; `main` has moved again and this PR needs another rebase, which I will do and report. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 13:24:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T13:24:25Z.


Title evidence for the evaluable-key case above. Onimusha (PPSA27836) has a draw whose T# is read from the same 48-byte table, at a key the SRT walk can evaluate (ReadConst(GetSrtResource, 0x82) * 0x30). With this PR it is planned as a whole bindless table and the first presentation stops:

[videoout] presentation failed: bindless image table has 32768 entries (0 materials), limit 16

Locally, TryMakeTableImage returning false when SrtWalker{}.ValidateRuntimeValue(m_program.Resources(), key) holds, right after MatchTableOffset, sends that T# to GetHandle again. With it, verifyUniformTableImage (#5188) passes, the title gets past this draw, and its material tables (keys through readfirstlane) are still planned as bindless tables (mode M, 1 keys in APS5_TRACE_BINDLESS). I have not proposed it separately since it belongs to this change; feel free to take it.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169404263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6169404263). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T13:24:25Z. --- Title evidence for the evaluable-key case above. Onimusha (PPSA27836) has a draw whose T# is read from the same 48-byte table, at a key the SRT walk can evaluate (`ReadConst(GetSrtResource, 0x82) * 0x30`). With this PR it is planned as a whole bindless table and the first presentation stops: ``` [videoout] presentation failed: bindless image table has 32768 entries (0 materials), limit 16 ``` Locally, `TryMakeTableImage` returning `false` when `SrtWalker{}.ValidateRuntimeValue(m_program.Resources(), key)` holds, right after `MatchTableOffset`, sends that T# to `GetHandle` again. With it, `verifyUniformTableImage` (#5188) passes, the title gets past this draw, and its material tables (keys through `readfirstlane`) are still planned as bindless tables (`mode M, 1 keys` in `APS5_TRACE_BINDLESS`). I have not proposed it separately since it belongs to this change; feel free to take it. AI-assisted: yes (Claude Code).
xXPBSXx commented 2026-10-14 13:36:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T13:36:19Z.


Follow-up to my earlier reply: the head is now ee950660358c6d199a23131ad00de6f96db50fba (three commits on main 63fb0cd92; #5089 was reverted in #5824, so the indexed field is no longer part of this change).

I checked your uniform table image finding on this head with ctest on Windows 10 (19045): with the third commit (a record wider than 32 bytes whose T# the runtime walk can evaluate stays a direct image) ctest -R ^agc_shader_memory$ exits 0; with ResourceTracker.cpp taken back to the second commit, agc_shader_memory fails with uniform table image: the T# read from a constant buffer was not planned as one image (red3.log). The first of the two runs was not repeated, one run each. agc_shader_bindless exits 0 with the change and 8 without it (GetImageResource dword 0 is not a valid runtime value). ctest prints only the test name, not the single case, so the case itself is not shown in the pass log.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169636778 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6169636778). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T13:36:19Z. --- Follow-up to my earlier reply: the head is now `ee950660358c6d199a23131ad00de6f96db50fba` (three commits on `main` `63fb0cd92`; #5089 was reverted in #5824, so the `indexed` field is no longer part of this change). I checked your `uniform table image` finding on this head with `ctest` on Windows 10 (19045): with the third commit (a record wider than 32 bytes whose T# the runtime walk can evaluate stays a direct image) `ctest -R ^agc_shader_memory$` exits 0; with `ResourceTracker.cpp` taken back to the second commit, `agc_shader_memory` fails with `uniform table image: the T# read from a constant buffer was not planned as one image` (`red3.log`). The first of the two runs was not repeated, one run each. `agc_shader_bindless` exits 0 with the change and 8 without it (`GetImageResource dword 0 is not a valid runtime value`). `ctest` prints only the test name, not the single case, so the case itself is not shown in the pass log. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-14 13:41:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T13:41:49Z.


Baseline for the title run above, on a recent main without this pull request: Resident Evil 4 (PPSA07411), Windows 10 (19045), RTX 4080 SUPER, one run of 120 s requested.

main e736e5bdb18e72ed717014c02c62c616701a7cf8 (clean worktree, no local patches according to the session that ran it; it contains #5550, #5189, #5555 and #5188): PPSA07411_rL/run_153844.err (574 lines, counted with Python) ends in line 93 with what(): shader 0x206d076700 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00001b24(GetBufferResource(ReadConst(GetSrtResource, Immediate), ..., followed by FATAL: abort() (SIGABRT) in line 96. The earlier baseline on an older main (PPSA07411_rT1/run_110620.err line 93) is the same stop with a different shader.

With this pull request (head ee950660358c6d199a23131ad00de6f96db50fba; first run on an earlier head, see above) the same title ran without that stop. Different main bases, one run each; libraries rebuilt for each run (ninja libs exit 0 for both); executables are relinked ones from another session (relinker commit and command not recorded by me); no picture checked.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6169756688 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6169756688). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T13:41:49Z. --- Baseline for the title run above, on a recent `main` without this pull request: Resident Evil 4 (PPSA07411), Windows 10 (19045), RTX 4080 SUPER, one run of 120 s requested. `main` `e736e5bdb18e72ed717014c02c62c616701a7cf8` (clean worktree, no local patches according to the session that ran it; it contains #5550, #5189, #5555 and #5188): `PPSA07411_rL/run_153844.err` (574 lines, counted with Python) ends in line 93 with `what(): shader 0x206d076700 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00001b24(GetBufferResource(ReadConst(GetSrtResource, Immediate), ...`, followed by `FATAL: abort() (SIGABRT)` in line 96. The earlier baseline on an older `main` (`PPSA07411_rT1/run_110620.err` line 93) is the same stop with a different shader. With this pull request (head `ee950660358c6d199a23131ad00de6f96db50fba`; first run on an earlier head, see above) the same title ran without that stop. Different `main` bases, one run each; libraries rebuilt for each run (`ninja libs` exit 0 for both); executables are relinked ones from another session (relinker commit and command not recorded by me); no picture checked. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-14 13:56:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T13:56:00Z.


Thanks for the Onimusha (PPSA27836) report. I compared your local fix (return false from TryMakeTableImage right after MatchTableOffset when SrtWalker{}.ValidateRuntimeValue(m_program.Resources(), key) holds) with the third commit of this PR (head ee950660358c6d199a23131ad00de6f96db50fba).

What the third commit does (core/shader/recompiler/Optimization/src/ResourceTracker.cpp, in TryMakeTableImage, if (entryStride != 32u) at line 551, after the entry-offset check): for a stride other than 32 it builds the direct DescriptorSource of the handle (MakeSource(handle, 8u, false, false, direct)) and returns false when ValidateSource(direct, badDword) holds. ValidateSource (ResourceTracker.cpp:229-240) runs SrtWalker::ValidateRuntimeValue on each of the eight T# dwords. A T# dword that is a ReadConstBuffer validates its arguments recursively (SrtRuntimeValidator.cpp:111-143, ValidateArguments), so the heap offset key * 0x30 + immediate is validated, which includes the key; for your key ReadConst(GetSrtResource, 0x82) the ReadConst case (SrtRuntimeValidator.cpp:43) accepts a GetSrtResource read with an immediate slot.

Difference to your fix:

  • Mine validates the whole T# (key plus raw-read shape: IsRawRead and a GetBufferResource handle), yours validates only the key. For a key that is a plain SRT read the two should agree; I have not found a case in the code where yours returns false and mine does not, but I did not prove equivalence.
  • Mine only applies to strides other than 32. Tables with a 32-byte stride and a uniform key keep being planned as bindless tables as before (the description of commit 61890ae7a states that this is the existing behaviour). Your fix would move those to GetHandle too.

Does the head cover your case? By the code, yes: a 48-byte stride (* 0x30) with a key from ReadConst(GetSrtResource, 0x82) takes the new return false path and the T# goes to GetHandle. Tests: verifyUniformTableImage in tests/ShaderMemory.cpp covers a 48-byte record with the T# at +16 and a key read from user data (it fails with uniform table image: the T# read from a constant buffer was not planned as one image without the third commit and passes with it; red3.log, ctest -R agc_shader_memory). There is no test with a key that is an SRT read (GetSrtResource slot 0x82), and I did not run Onimusha, so that exact shape is not covered by a test. If you can share the shader or a test case with that key shape, I will add it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170045880 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6170045880). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T13:56:00Z. --- Thanks for the Onimusha (PPSA27836) report. I compared your local fix (return `false` from `TryMakeTableImage` right after `MatchTableOffset` when `SrtWalker{}.ValidateRuntimeValue(m_program.Resources(), key)` holds) with the third commit of this PR (head `ee950660358c6d199a23131ad00de6f96db50fba`). **What the third commit does** (`core/shader/recompiler/Optimization/src/ResourceTracker.cpp`, in `TryMakeTableImage`, `if (entryStride != 32u)` at line 551, after the entry-offset check): for a stride other than 32 it builds the direct `DescriptorSource` of the handle (`MakeSource(handle, 8u, false, false, direct)`) and returns `false` when `ValidateSource(direct, badDword)` holds. `ValidateSource` (`ResourceTracker.cpp:229-240`) runs `SrtWalker::ValidateRuntimeValue` on each of the eight T# dwords. A T# dword that is a `ReadConstBuffer` validates its arguments recursively (`SrtRuntimeValidator.cpp:111-143`, `ValidateArguments`), so the heap offset `key * 0x30 + immediate` is validated, which includes the key; for your key `ReadConst(GetSrtResource, 0x82)` the `ReadConst` case (`SrtRuntimeValidator.cpp:43`) accepts a `GetSrtResource` read with an immediate slot. **Difference to your fix:** - Mine validates the whole T# (key plus raw-read shape: `IsRawRead` and a `GetBufferResource` handle), yours validates only the key. For a key that is a plain SRT read the two should agree; I have not found a case in the code where yours returns `false` and mine does not, but I did not prove equivalence. - Mine only applies to strides other than 32. Tables with a 32-byte stride and a uniform key keep being planned as bindless tables as before (the description of commit `61890ae7a` states that this is the existing behaviour). Your fix would move those to `GetHandle` too. **Does the head cover your case?** By the code, yes: a 48-byte stride (`* 0x30`) with a key from `ReadConst(GetSrtResource, 0x82)` takes the new `return false` path and the T# goes to `GetHandle`. Tests: `verifyUniformTableImage` in `tests/ShaderMemory.cpp` covers a 48-byte record with the T# at +16 and a key read from user data (it fails with `uniform table image: the T# read from a constant buffer was not planned as one image` without the third commit and passes with it; `red3.log`, `ctest -R agc_shader_memory`). There is no test with a key that is an SRT read (`GetSrtResource` slot 0x82), and I did not run Onimusha, so that exact shape is not covered by a test. If you can share the shader or a test case with that key shape, I will add it. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 14:52:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T14:52:43Z.


@xXPBSXx thanks for the comparison. Your head covers the Onimusha (PPSA27836) case in practice. On my local branch I replaced my fix with ee9506603 (reverted my commit, cherry-picked yours, nothing else changed). On Windows with the RTX 5070, the title prepares the same programs and stops at the same later point as with my fix: the first presentation, which now fails with "a color target's sample count differs from the rasterizer's" (checkerboard rendering, after #5861). No bindless table error. So I'm dropping my local fix in favour of your commit.

I'd rather not post the title's shader binary. The shape is a 48-byte stride (* 0x30) whose key is ReadConst(GetSrtResource, 0x82): a dword the program s_loads through the SRT pointer at slot 0x82, not user data directly. A test like verifyUniformTableImage with the key loaded through an SRT pointer would cover it; I can write that if it helps.

#5820 is now rebuilt on your head ee9506603, and agc_shader_memory passes there, verifyUniformTableImage included.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6171211973 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6171211973). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T14:52:43Z. --- @xXPBSXx thanks for the comparison. Your head covers the Onimusha (PPSA27836) case in practice. On my local branch I replaced my fix with ee9506603 (reverted my commit, cherry-picked yours, nothing else changed). On Windows with the RTX 5070, the title prepares the same programs and stops at the same later point as with my fix: the first presentation, which now fails with "a color target's sample count differs from the rasterizer's" (checkerboard rendering, after #5861). No bindless table error. So I'm dropping my local fix in favour of your commit. I'd rather not post the title's shader binary. The shape is a 48-byte stride (`* 0x30`) whose key is `ReadConst(GetSrtResource, 0x82)`: a dword the program `s_load`s through the SRT pointer at slot 0x82, not user data directly. A test like `verifyUniformTableImage` with the key loaded through an SRT pointer would cover it; I can write that if it helps. #5820 is now rebuilt on your head ee9506603, and `agc_shader_memory` passes there, `verifyUniformTableImage` included. AI-assisted (Claude Code).
xXPBSXx commented 2026-10-14 15:43:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T15:43:39Z.


Windows measurement for PRAGMATA (PPSA02530), with and without this PR. One 200 s run each, RTX 4080 SUPER, Windows 10, same app.exe relinked once against the libs of each build; no picture was checked.

  • Without #5620, with #5776 only (upstream/main 84b01f9cd + #5776 head 378ac6178, the six files of this PR reverted to 84b01f9cd): PPSA02530_rU1/run_173936.err (753 lines). First shader error at line 111 and the stop at line 269: what(): shader 0x2234462c00 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00000568(...), then line 272 FATAL: abort() (SIGABRT). 52 lines contain GetImageResource.
  • With #5620 and #5776 (merge commit 70383a292, parents: ade05983b = 84b01f9cd + this PR's head ee9506603, and 378ac6178): PPSA02530_rU1/run_173119.err (311 lines). 0 lines contain GetImageResource. The stop is now line 124 what(): shader 0x2111d34600 stage 5: ShaderRecompiler::Recompile: static bindless image capacity exceeded and line 127 FATAL: abort() (SIGABRT), which is the capacity limit tracked in #5720.

So in these two runs this PR removes the GetImageResource dword 0 stop for PRAGMATA and the title reaches the next stop. Not tested: Linux, other GPUs, a second run per side, a picture, and PRAGMATA without #5776 (on plain main it stops earlier at sceConvertKeycodeGetCharacter, #5726).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172242757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6172242757). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T15:43:39Z. --- Windows measurement for PRAGMATA (PPSA02530), with and without this PR. One 200 s run each, RTX 4080 SUPER, Windows 10, same `app.exe` relinked once against the libs of each build; no picture was checked. - Without #5620, with #5776 only (`upstream/main` `84b01f9cd` + #5776 head `378ac6178`, the six files of this PR reverted to `84b01f9cd`): `PPSA02530_rU1/run_173936.err` (753 lines). First shader error at line 111 and the stop at line 269: `what(): shader 0x2234462c00 stage 5: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00000568(...)`, then line 272 `FATAL: abort() (SIGABRT)`. 52 lines contain `GetImageResource`. - With #5620 and #5776 (merge commit `70383a292`, parents: `ade05983b` = `84b01f9cd` + this PR's head `ee9506603`, and `378ac6178`): `PPSA02530_rU1/run_173119.err` (311 lines). 0 lines contain `GetImageResource`. The stop is now line 124 `what(): shader 0x2111d34600 stage 5: ShaderRecompiler::Recompile: static bindless image capacity exceeded` and line 127 `FATAL: abort() (SIGABRT)`, which is the capacity limit tracked in #5720. So in these two runs this PR removes the `GetImageResource dword 0` stop for PRAGMATA and the title reaches the next stop. Not tested: Linux, other GPUs, a second run per side, a picture, and PRAGMATA without #5776 (on plain `main` it stops earlier at `sceConvertKeycodeGetCharacter`, #5726). AI-assisted (Claude Code).
xXPBSXx commented 2026-10-14 16:19:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T16:19:46Z.


Closing as superseded by d9e47d1e9 (feat(agc): implement image and sampler tables indexed at runtime offsets) and 34525fdf7 (feat(agc): implement image tables loaded through 64-bit pointers), which are now on main. They replace DescriptorSource::IndirectImage by TableColumn with a stride and an addend (ControlFlowInfo.hpp), and MatchAffineOffset in ResourceTracker.cpp accepts any multiplier that is at least 4 and a multiple of 4, so the 48-byte entries this PR was written for (Resident Evil 4, PPSA07411: key * 48, load offset 16) are planned without it. The PR no longer applies (conflicts in ResourceMaterializer.cpp, ResourceTracker.cpp, ControlFlowInfo.hpp, ShaderDiskCache.cpp and its test).

Title evidence on main without this PR: PPSA07411, Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER. main e34c479210c78d7b160d7054f3e72de422b23d7a (no other PR merged in), ninja -j 8 libs exit 0 (script times 18:02:44 to 18:08:30), run_title.ps1, 120 s requested, script times 18:08:46 to 18:10:57, one run: PPSA07411_rY/run_180850.err (line count by Python) has no GetImageResource dword 0 is not a valid runtime value, no what() and no FATAL; the log ends with shader disk cache lines. Before: main d1670009f, PPSA07411_rB/run_022642.err ended with that error (quoted in the PR description). Title executable PPSA07411_rY/app.exe (hardlink of PPSA07411_rH, dated 2026-10-14 07:38:51); relinker commit and command for it are not recorded in my notes. No picture was checked. Not tested: Linux, a second run, other GPUs.

Second title (PRAGMATA, PPSA02530, whose GetImageResource dword 0 chain here is a ReadConstBuffer read, not a 48-byte stride): main e34c479210c78d7b160d7054f3e72de422b23d7a + #5776 (378ac61788f1ee2065909a3360e43f12cd9a0cda) merged (merge tree b072851e208728569ada2bd9516810972b7fa3df), without this PR; ninja -j 8 libs exit 0 (script times 18:14:11 to 18:15:02); 200 s requested, script times 18:15:19 to 18:17:41, one run; PPSA02530_rV2/run_181522.err: no GetImageResource line. The title now stops later, at line 124: what(): shader 0x2107e05900 stage 5: ShaderRecompiler::Recompile: SPIR-V emission failed: hash=0x141866064128 stage=2 opcode=ReadLane reason=v_readlane_b32 of lane 63 is outside the 32-lane host subgroup that runs this wave64 program at one lane per invocation. Title executable PPSA02530_rV2/app.exe (hardlink of PPSA02530_rH, dated 2026-10-14 07:32:23); relinker commit and command not recorded in my notes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172966500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6172966500). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T16:19:46Z. --- Closing as superseded by `d9e47d1e9` (feat(agc): implement image and sampler tables indexed at runtime offsets) and `34525fdf7` (feat(agc): implement image tables loaded through 64-bit pointers), which are now on `main`. They replace `DescriptorSource::IndirectImage` by `TableColumn` with a `stride` and an `addend` (`ControlFlowInfo.hpp`), and `MatchAffineOffset` in `ResourceTracker.cpp` accepts any multiplier that is at least 4 and a multiple of 4, so the 48-byte entries this PR was written for (Resident Evil 4, PPSA07411: `key * 48`, load offset 16) are planned without it. The PR no longer applies (conflicts in `ResourceMaterializer.cpp`, `ResourceTracker.cpp`, `ControlFlowInfo.hpp`, `ShaderDiskCache.cpp` and its test). Title evidence on `main` without this PR: PPSA07411, Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER. `main` `e34c479210c78d7b160d7054f3e72de422b23d7a` (no other PR merged in), `ninja -j 8 libs` exit 0 (script times 18:02:44 to 18:08:30), `run_title.ps1`, 120 s requested, script times 18:08:46 to 18:10:57, one run: `PPSA07411_rY/run_180850.err` (line count by Python) has no `GetImageResource dword 0 is not a valid runtime value`, no `what()` and no FATAL; the log ends with shader disk cache lines. Before: `main` `d1670009f`, `PPSA07411_rB/run_022642.err` ended with that error (quoted in the PR description). Title executable `PPSA07411_rY/app.exe` (hardlink of `PPSA07411_rH`, dated 2026-10-14 07:38:51); relinker commit and command for it are not recorded in my notes. No picture was checked. Not tested: Linux, a second run, other GPUs. Second title (PRAGMATA, PPSA02530, whose `GetImageResource dword 0` chain here is a `ReadConstBuffer` read, not a 48-byte stride): `main` `e34c479210c78d7b160d7054f3e72de422b23d7a` + #5776 (`378ac61788f1ee2065909a3360e43f12cd9a0cda`) merged (merge tree `b072851e208728569ada2bd9516810972b7fa3df`), without this PR; `ninja -j 8 libs` exit 0 (script times 18:14:11 to 18:15:02); 200 s requested, script times 18:15:19 to 18:17:41, one run; `PPSA02530_rV2/run_181522.err`: no `GetImageResource` line. The title now stops later, at line 124: `what(): shader 0x2107e05900 stage 5: ShaderRecompiler::Recompile: SPIR-V emission failed: hash=0x141866064128 stage=2 opcode=ReadLane reason=v_readlane_b32 of lane 63 is outside the 32-lane host subgroup that runs this wave64 program at one lane per invocation`. Title executable `PPSA02530_rV2/app.exe` (hardlink of `PPSA02530_rH`, dated 2026-10-14 07:32:23); relinker commit and command not recorded in my notes. AI-assisted (Claude Code).

Pull request closed

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!5620
No description provided.