Recompiler: a T# reached through two loads after a dynamically indexed read (pointer → pointer → T#, pointer → V# → buffer → T#) stops Ratchet & Clank (PPSA01474) and Guardians of the Galaxy (PPSA01748) #6191

Open
opened 2026-10-15 01:32:31 +00:00 by Tamalero · 22 comments
Tamalero commented 2026-10-15 01:32:31 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-15T01:32:31Z.


With #4706, #5089, #757, #758 and #4475 merged, both titles get further on plain main than before. Each now stops on a descriptor one load deeper than those PRs plan. In both, a read at a readfirstlane index gives a pointer. In Guardians that pointer leads to a second pointer, which leads to the T#. In Ratchet it leads to a V#, and the T# is read from that buffer at a second readfirstlane index. The error is the same, GetImageResource dword 0 is not a valid runtime value, and both stop while loading their first 3D scene.

Titles: Ratchet & Clank: Rift Apart (PPSA01474 v01.005.003) and Marvel's Guardians of the Galaxy (PPSA01748 v01.006.000).
Where they stop:

  • Ratchet: plain main 8cd937e29, no local changes. About 8 minutes in, during the black load after the Insomniac logo. On a PC reference recording, the 3D profile-select screen comes right after this load.
  • Guardians: main 411e5e6d9 plus one NpManager stub for startup. It passes the menus and the intro video, then stops loading the first level.
  • Linux, RTX 4090. 1 of 1 runs for Ratchet on this head, 3 of 3 for Guardians across today's heads.

Ratchet: record pointer → V# → buffer → T#

compute shader 0x116bb67b00 stage 0: GetImageResource dword 0 is not a valid runtime value; chain:
ReadConstBuffer@pc=0x6b80(
  GetBufferResource(LoadAddressU32@pc=0x6b6c(GetAddressResource(Phi(Phi(
      ReadConstBuffer@pc=0x1aa8(GetBufferResource(V# from the SRT),
        ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi), Phi(LogicalAnd, LogicalAnd)), Immediate)), …)))),
    … the same LoadAddressU32@0x6b6c for dwords 1–3 …),
  ShiftLeftLogical32(ReadFirstLane(Phi(SelectU32(LogicalAnd(…), IEqual32(ReadFirstLane(SelectU32, Phi), …)), …)), …))
  • 0x1aa8 reads a pointer from the SRT's V# at a waterfall index (readfirstlane inside the loop). This is the same record table as the stop on #4706 (pc 0x6340, shader 0x116bb65f00). That stop now compiles.
  • 0x6b6c loads four dwords through that pointer, which form a V#.
  • 0x6b80 reads the T# from that buffer at a second readfirstlane index.
  • #4475 covers a record that holds a pointer to the T#. Here the record's pointer leads to a V#, so it's one load deeper.

Guardians: constant buffer → pointer → pointer → T#

shader 0x3b940f800 stage 5 (pixel): GetImageResource dword 0 is not a valid runtime value; chain:
LoadAddressU32@pc=0xf8(GetAddressResource(LoadAddressU32@pc=0xd0(GetAddressResource(
  ReadConstBuffer@pc=0x84(GetBufferResource(GetUserData ×4),
    ShiftLeftLogical32(ReadFirstLane(BitFieldUExtract(GetInterpolationParameter, Immediate, Immediate), Immediate), Immediate)), …)), …))
  • The key is a flat per-primitive attribute (readfirstlane of a bit field of an interpolated value). It indexes a constant buffer that holds a pointer. That pointer leads to a second pointer, and the second pointer leads to the T#.
  • The same chain appears at other pcs in 0x3b944ac00 (0x94 → 0x118 → 0x144) and 0x3b94d9200 (0x270 → 0x2dc → 0x328), and in 0x3b94a7500 / 0x3b9421600 on earlier heads. I reported these on #757 before it merged.
  • Separately, 0x3b91c3e00 (key from an ImageRead, pc 0x4380) still can't be planned on main. It is deferred and isn't the stop.

What I can offer

I'm not attaching the shader requests, since they contain the titles' shader code. I can run a branch on both titles the same day and post the result, and paste more of AnyPS5's planner output for either shader.

Details
  • Ratchet: relinked --to-intel against 8cd937e29, 36 GiB cap. RSS was 15.3 GiB at the stop. 98 shaders with a computed s_swappc_b64 target were deferred at registration and linked at use (#4706). Neither the #3274 shader (0x116bb65100) nor the #4706 follow-up shader (0x116bb65f00) failed. No PlayGo error, although the dump has no PlayGo files (see #5494).
  • Guardians: #6033 lets the language picker offer English, and #6183 is a separate slowdown on old kernels. Neither changes this stop.
  • Linux (CachyOS), RTX 4090 (driver 615.78.08), i9-14900K.
  • Related: #2715 (an older T#-from-buffer shape, Ghost of Yōtei), #4706, #5089, #757, #758, #4475.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5858496116 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-15T01:32:31Z. --- With #4706, #5089, #757, #758 and #4475 merged, both titles get further on plain `main` than before. Each now stops on a descriptor one load deeper than those PRs plan. In both, a read at a `readfirstlane` index gives a pointer. In Guardians that pointer leads to a second pointer, which leads to the T#. In Ratchet it leads to a V#, and the T# is read from that buffer at a second `readfirstlane` index. The error is the same, `GetImageResource dword 0 is not a valid runtime value`, and both stop while loading their first 3D scene. **Titles:** Ratchet & Clank: Rift Apart (PPSA01474 v01.005.003) and Marvel's Guardians of the Galaxy (PPSA01748 v01.006.000). **Where they stop:** - Ratchet: plain `main` `8cd937e29`, no local changes. About 8 minutes in, during the black load after the Insomniac logo. On a PC reference recording, the 3D profile-select screen comes right after this load. - Guardians: `main` `411e5e6d9` plus one NpManager stub for startup. It passes the menus and the intro video, then stops loading the first level. - Linux, RTX 4090. 1 of 1 runs for Ratchet on this head, 3 of 3 for Guardians across today's heads. ### Ratchet: record pointer → V# → buffer → T# ``` compute shader 0x116bb67b00 stage 0: GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x6b80( GetBufferResource(LoadAddressU32@pc=0x6b6c(GetAddressResource(Phi(Phi( ReadConstBuffer@pc=0x1aa8(GetBufferResource(V# from the SRT), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi), Phi(LogicalAnd, LogicalAnd)), Immediate)), …)))), … the same LoadAddressU32@0x6b6c for dwords 1–3 …), ShiftLeftLogical32(ReadFirstLane(Phi(SelectU32(LogicalAnd(…), IEqual32(ReadFirstLane(SelectU32, Phi), …)), …)), …)) ``` - `0x1aa8` reads a pointer from the SRT's V# at a waterfall index (`readfirstlane` inside the loop). This is the same record table as the stop on #4706 (pc `0x6340`, shader `0x116bb65f00`). That stop now compiles. - `0x6b6c` loads four dwords through that pointer, which form a V#. - `0x6b80` reads the T# from that buffer at a second `readfirstlane` index. - #4475 covers a record that holds a pointer to the T#. Here the record's pointer leads to a V#, so it's one load deeper. ### Guardians: constant buffer → pointer → pointer → T# ``` shader 0x3b940f800 stage 5 (pixel): GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0xf8(GetAddressResource(LoadAddressU32@pc=0xd0(GetAddressResource( ReadConstBuffer@pc=0x84(GetBufferResource(GetUserData ×4), ShiftLeftLogical32(ReadFirstLane(BitFieldUExtract(GetInterpolationParameter, Immediate, Immediate), Immediate), Immediate)), …)), …)) ``` - The key is a flat per-primitive attribute (`readfirstlane` of a bit field of an interpolated value). It indexes a constant buffer that holds a pointer. That pointer leads to a second pointer, and the second pointer leads to the T#. - The same chain appears at other pcs in `0x3b944ac00` (`0x94` → `0x118` → `0x144`) and `0x3b94d9200` (`0x270` → `0x2dc` → `0x328`), and in `0x3b94a7500` / `0x3b9421600` on earlier heads. I reported these on #757 before it merged. - Separately, `0x3b91c3e00` (key from an `ImageRead`, pc `0x4380`) still can't be planned on `main`. It is deferred and isn't the stop. ### What I can offer I'm not attaching the shader requests, since they contain the titles' shader code. I can run a branch on both titles the same day and post the result, and paste more of AnyPS5's planner output for either shader. <details><summary>Details</summary> - Ratchet: relinked `--to-intel` against `8cd937e29`, 36 GiB cap. RSS was 15.3 GiB at the stop. 98 shaders with a computed `s_swappc_b64` target were deferred at registration and linked at use (#4706). Neither the #3274 shader (`0x116bb65100`) nor the #4706 follow-up shader (`0x116bb65f00`) failed. No PlayGo error, although the dump has no PlayGo files (see #5494). - Guardians: #6033 lets the language picker offer English, and #6183 is a separate slowdown on old kernels. Neither changes this stop. - Linux (CachyOS), RTX 4090 (driver 615.78.08), i9-14900K. - Related: #2715 (an older T#-from-buffer shape, Ghost of Yōtei), #4706, #5089, #757, #758, #4475. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
Tamalero commented 2026-10-15 01:58:54 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-15T01:58:54Z.


Same stop on AMD, which rules out NVIDIA and Intel. Ratchet & Clank (PPSA01474) on a Radeon Pro V620 (RADV, Mesa 25.2.8) with an EPYC 7452, relinked without --to-intel, on plain main 8cd937e29 (plus #6183's page-table change, which only affects a kernel-6.8 slowdown). About 7 minutes in it aborts with the identical chain: ReadConstBuffer@pc=0x6b80 ← LoadAddressU32@pc=0x6b6c ← ReadConstBuffer@pc=0x1aa8 at the readfirstlane index. This time it's in shader 0x116bb5d300, a sibling of 0x116bb67b00 with the same pcs.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182647895 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6182647895). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-15T01:58:54Z. --- Same stop on AMD, which rules out NVIDIA and Intel. Ratchet & Clank (PPSA01474) on a Radeon Pro V620 (RADV, Mesa 25.2.8) with an EPYC 7452, relinked without `--to-intel`, on plain `main` `8cd937e29` (plus #6183's page-table change, which only affects a kernel-6.8 slowdown). About 7 minutes in it aborts with the identical chain: `ReadConstBuffer@pc=0x6b80` ← `LoadAddressU32@pc=0x6b6c` ← `ReadConstBuffer@pc=0x1aa8` at the `readfirstlane` index. This time it's in shader `0x116bb5d300`, a sibling of `0x116bb67b00` with the same pcs. *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-15 10:02:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T10:02:50Z.


I checked the active #6232 patch: it covers following pointer hops from an indexed record to a T#, while the Ratchet trace appears to require treating the first indexed V# as a buffer descriptor and then planning the second dynamically indexed read. Could you share the sanitized planner output or the relevant memory metadata for the V# dwords at 0x6b6c and the descriptor read at 0x6b80 (and, if available, the sibling shader trace)? That should help identify a focused regression shape without including shader binaries.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6189501494 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6189501494). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T10:02:50Z. --- I checked the active #6232 patch: it covers following pointer hops from an indexed record to a T#, while the Ratchet trace appears to require treating the first indexed V# as a buffer descriptor and then planning the second dynamically indexed read. Could you share the sanitized planner output or the relevant memory metadata for the V# dwords at `0x6b6c` and the descriptor read at `0x6b80` (and, if available, the sibling shader trace)? That should help identify a focused regression shape without including shader binaries.
Tamalero commented 2026-10-15 20:24:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-15T20:24:16Z.


@MarcZX100 here is the Ratchet & Clank (PPSA01474) chain from the planner's point of view. It's on main 03c4cb5e7, with the program's IR printed at the GetImageResource refusal by a local print that isn't in any PR. The stop moves between sibling compute shaders from run to run (0x116bb67b00, 0x116bb5d300, 0x116bb5b700, 0x116bb65f00, 0x116bb66d00), always at the same pcs, so it's one routine they share. This is the 0x116bb66d00 program. I've written it out as a shape with the offsets the IR shows, not the dump itself.

CB V#   = SRT dwords 0x67..0x6a                                  (ReadConst, block pc 0x1a88..0x1ac8)
key1    = ReadFirstLane(SelectU32/Phi …)                          waterfall loop, blocks 0x1a5c..0x1ac8
lo, hi  = ReadConstBuffer(CB V#, key1 << 4)                       16-byte records, two dwords of one record (pc 0x1aa8)
lo'     = Phi(lo, Phi(lo, 0xea))                                  merged at pc 0x59bc / 0x64b0, hi passes through unchanged
ptr     = GetAddressResource(lo', hi)
V#      = 4 × LoadAddressU32(ptr)                                 one s_load_dwordx4 (pc 0x6b6c)
key2    = ReadFirstLane(Phi …)                                    second waterfall loop, blocks 0x6af0..0x6b9c
T#      = 8 × ReadConstBuffer(V#, key2 << 5)                      32-byte T# array (pc 0x6b80)

So relative to #6232's pointer → pointer → T#, Ratchet has:

  • a buffer hop in the middle (the loaded V# is then indexed), not a second pointer;
  • two independent waterfall keys, one for the record and one for the T# array;
  • a pointer low dword that, on one path into the loop, is the constant 0xea rather than the record's dword. That's probably just register reuse on a path that never reaches pc 0x6b6c, but the planner sees both values through the Phi.

The printer doesn't show each load's own dword offset, only the immediates above, so I can't give the record-relative offset of lo/hi. The V# and T# are each read as one contiguous block (x4 and x8).

I don't have the runtime values of the V# words at 0x6b6c, because the chain is refused before anything is materialized. If they'd help, I can add a local print at the dispatch that dumps, for a few keys: the record pointer, the 4 V# words (base, stride, num_records), and the first T# behind them, then post them with the addresses masked. The same goes for testing a branch on the title; Ratchet reaches this stop about 8 minutes in, with no input.

Details
  • Linux (CachyOS), RTX 4090, i9-14900K. main 03c4cb5e7 (plus #6184, which only touches guest-memory page caching), relinked with --to-intel. Shader cache off for the dump run.
  • 4 runs today, every one stops at the same refusal, GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00006b80(GetBufferResource(LoadAddressU32@pc=0x00006b6c(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00001aa8(…, exit 134.
  • APS5_DUMP_IR=<address> printed nothing for these shaders. They are deferred at registration (s_swappc_b64 computed target) and prepared at use as linked programs, so the dump key doesn't match the guest address. That's why I printed at the refusal instead.
  • The program is large: about 230,000 IR lines once the s_swappc callees are linked in.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6201540374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6201540374). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-15T20:24:16Z. --- @MarcZX100 here is the Ratchet & Clank (PPSA01474) chain from the planner's point of view. It's on `main` `03c4cb5e7`, with the program's IR printed at the `GetImageResource` refusal by a local print that isn't in any PR. The stop moves between sibling compute shaders from run to run (`0x116bb67b00`, `0x116bb5d300`, `0x116bb5b700`, `0x116bb65f00`, `0x116bb66d00`), always at the same pcs, so it's one routine they share. This is the `0x116bb66d00` program. I've written it out as a shape with the offsets the IR shows, not the dump itself. ``` CB V# = SRT dwords 0x67..0x6a (ReadConst, block pc 0x1a88..0x1ac8) key1 = ReadFirstLane(SelectU32/Phi …) waterfall loop, blocks 0x1a5c..0x1ac8 lo, hi = ReadConstBuffer(CB V#, key1 << 4) 16-byte records, two dwords of one record (pc 0x1aa8) lo' = Phi(lo, Phi(lo, 0xea)) merged at pc 0x59bc / 0x64b0, hi passes through unchanged ptr = GetAddressResource(lo', hi) V# = 4 × LoadAddressU32(ptr) one s_load_dwordx4 (pc 0x6b6c) key2 = ReadFirstLane(Phi …) second waterfall loop, blocks 0x6af0..0x6b9c T# = 8 × ReadConstBuffer(V#, key2 << 5) 32-byte T# array (pc 0x6b80) ``` So relative to #6232's pointer → pointer → T#, Ratchet has: - a **buffer** hop in the middle (the loaded V# is then indexed), not a second pointer; - **two independent waterfall keys**, one for the record and one for the T# array; - a pointer low dword that, on one path into the loop, is the constant `0xea` rather than the record's dword. That's probably just register reuse on a path that never reaches pc `0x6b6c`, but the planner sees both values through the `Phi`. The printer doesn't show each load's own dword offset, only the immediates above, so I can't give the record-relative offset of `lo`/`hi`. The V# and T# are each read as one contiguous block (`x4` and `x8`). I don't have the runtime values of the V# words at `0x6b6c`, because the chain is refused before anything is materialized. If they'd help, I can add a local print at the dispatch that dumps, for a few keys: the record pointer, the 4 V# words (base, stride, num_records), and the first T# behind them, then post them with the addresses masked. The same goes for testing a branch on the title; Ratchet reaches this stop about 8 minutes in, with no input. <details><summary>Details</summary> - Linux (CachyOS), RTX 4090, i9-14900K. `main` `03c4cb5e7` (plus #6184, which only touches guest-memory page caching), relinked with `--to-intel`. Shader cache off for the dump run. - 4 runs today, every one stops at the same refusal, `GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00006b80(GetBufferResource(LoadAddressU32@pc=0x00006b6c(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00001aa8(…`, exit 134. - `APS5_DUMP_IR=<address>` printed nothing for these shaders. They are deferred at registration (`s_swappc_b64` computed target) and prepared at use as linked programs, so the dump key doesn't match the guest address. That's why I printed at the refusal instead. - The program is large: about 230,000 IR lines once the `s_swappc` callees are linked in. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-15 21:41:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:41:44Z.


Thanks, this narrows the Ratchet case beyond #6232: it has two independently selected keys and a V# between the first record and the T# array. The existing #6232 branch covers pointer hops from one image-table record to a T#, and explicitly leaves the second key out of scope.

A small planner/runtime fixture would help isolate the new case without the 230k-line linked shader. Could you post the four V# dwords for one valid key (base, stride, record count and any remaining descriptor word), plus the first T#'s eight dwords and the selected key1/key2 values? Masking addresses is fine if the same masked base is used consistently and the relative offsets/alignment stay intact. If the 0xea phi arm is relevant to the chain, please note whether that path reaches the load at 0x6b6c.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202874562 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6202874562). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:41:44Z. --- Thanks, this narrows the Ratchet case beyond #6232: it has two independently selected keys and a V# between the first record and the T# array. The existing #6232 branch covers pointer hops from one image-table record to a T#, and explicitly leaves the second key out of scope. A small planner/runtime fixture would help isolate the new case without the 230k-line linked shader. Could you post the four V# dwords for one valid key (base, stride, record count and any remaining descriptor word), plus the first T#'s eight dwords and the selected `key1`/`key2` values? Masking addresses is fine if the same masked base is used consistently and the relative offsets/alignment stay intact. If the `0xea` phi arm is relevant to the chain, please note whether that path reaches the load at `0x6b6c`.
MarcZX10 commented 2026-10-15 21:50:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:50:45Z.


The planner trace narrows the required case, but I still cannot make a reliable regression fixture without the values behind the V# and T# loads. Could you post the four V# dwords for one valid key, the first T# eight dwords, and the selected key1/key2 values (addresses can be consistently masked)? Please also say whether the 0xea phi path reaches the V# load. These values let me test the second independent waterfall rather than infer descriptor semantics from the 230k-line trace.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203018075 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6203018075). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:50:45Z. --- The planner trace narrows the required case, but I still cannot make a reliable regression fixture without the values behind the V# and T# loads. Could you post the four V# dwords for one valid key, the first T# eight dwords, and the selected `key1`/`key2` values (addresses can be consistently masked)? Please also say whether the `0xea` phi path reaches the V# load. These values let me test the second independent waterfall rather than infer descriptor semantics from the 230k-line trace.
Tamalero commented 2026-10-16 01:47:20 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-16T01:47:20Z.


@MarcZX100 runtime values for the Ratchet & Clank (PPSA01474) chain. I added a local print, not in any PR, at the GetImageResource refusal. It evaluates the refused chain against the dispatch's user data and live guest memory. Three runs on main 5d9dcc42d all stopped here, each on a different sibling shader: 0x116bb66300, 0x116bb5fd00, 0x116bb67b00. The layout and the V# loaded through the pointer are the same in all three.

Addresses are masked with one consistent base each, A, B and C. The low bits and every offset are real. In each V#, <…> marks the masked base bits; the stride, record count and dword 3 are as read.

user data s[12:13]  = pointer P (SRT block)
CB V#   (pc 0x1a9c) = 4 dwords at P + 0x270:          <A lo> 0010<A hi>  00054ffc  00005204   -> base A, stride 16, 0x54ffc records
record  (pc 0x1aa8) = CB base A + key1*16; lo at +0x8, hi at +0xc        -> 64-bit pointer B (B & 0xff == 0)
V#      (pc 0x6b6c) = 4 dwords at B + 0xa0 (one s_load_dwordx4):  <C lo> 0040<C hi>  00010000  00005204   -> base C, stride 64, 0x10000 records
T#      (pc 0x6b80) = 8 dwords at C + key2*32 + 0x0 .. 0x1c (one s_buffer_load_dwordx8)

So the CB index uses a 16-byte record, while the buffer the T# comes from has a stride of 64 and is indexed in 32-byte steps (key2 << 5), half a record.

What I can't give you is a T# read with the title's own keys. key1 and key2 each come from a readfirstlane inside a waterfall over lane data, and the CPU-side walk can't see those lanes. What I tried:

  • key1 = 0 gives a readable pointer B. For key1 1–3 the pointer lands on unmapped memory, so record 0 may be a different kind of entry.
  • With key1 = 0, none of the 32-byte entries at key2 0–15 decodes as a T#. They hold floats (3f800000, 7f7fffff) and small counters in dword 7.
  • A scan of the whole 4 MiB behind C in 32-byte steps found no image descriptor either: the entries that pass a type-nibble check have a constant c0000000 in dword 1 and look like offset/size records.

So the textures this routine samples are behind other records, selected by lane values. For a fixture, synthetic descriptors with this layout (record stride 16, pointer at +8, V# at pointer + 0xa0, T# stride 32 inside a stride-64 buffer) should reproduce the planner case. If it helps, I can run any branch against the title the same day.

On the 0xea arm: yes, it reaches the V# load in the control-flow graph. The Phi at pc 0x64b0 takes 0xea from the block at 0x63f0..0x64b0. That value flows through the merge at 0x59bc, entered from 0x1ac8, just after the record read at 0x1aa8, to the GetAddressResource of the load at 0x6b6c, without passing the record read again. It looks like a loop back-edge on which the register holding the pointer's low dword was reused. I can't tell from here whether the title takes that edge at run time; my print evaluated the record arm.

Details
  • Linux (CachyOS), RTX 4090, i9-14900K. main 5d9dcc42d, relinked with --to-intel. Shader cache off for these runs. Every run ends at the same refusal (exit 134) about 7–8 min in.
  • Memory was read with process_vm_readv on the running process, so unmapped addresses report as unreadable instead of faulting.
  • Across the three runs, the 16 user-data words match except for the SRT pointer P in s[12:13]. The CB base A and the record pointer B also move, but B is always 256-byte aligned. The V# read at B + 0xa0 is identical in all three: same masked base C, stride 64, 0x10000 records, dword 3 00005204.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6206166195 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6206166195). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-16T01:47:20Z. --- @MarcZX100 runtime values for the Ratchet & Clank (PPSA01474) chain. I added a local print, not in any PR, at the `GetImageResource` refusal. It evaluates the refused chain against the dispatch's user data and live guest memory. Three runs on `main` `5d9dcc42d` all stopped here, each on a different sibling shader: `0x116bb66300`, `0x116bb5fd00`, `0x116bb67b00`. The layout and the V# loaded through the pointer are the same in all three. Addresses are masked with one consistent base each, `A`, `B` and `C`. The low bits and every offset are real. In each V#, `<…>` marks the masked base bits; the stride, record count and dword 3 are as read. ``` user data s[12:13] = pointer P (SRT block) CB V# (pc 0x1a9c) = 4 dwords at P + 0x270: <A lo> 0010<A hi> 00054ffc 00005204 -> base A, stride 16, 0x54ffc records record (pc 0x1aa8) = CB base A + key1*16; lo at +0x8, hi at +0xc -> 64-bit pointer B (B & 0xff == 0) V# (pc 0x6b6c) = 4 dwords at B + 0xa0 (one s_load_dwordx4): <C lo> 0040<C hi> 00010000 00005204 -> base C, stride 64, 0x10000 records T# (pc 0x6b80) = 8 dwords at C + key2*32 + 0x0 .. 0x1c (one s_buffer_load_dwordx8) ``` So the CB index uses a 16-byte record, while the buffer the T# comes from has a stride of 64 and is indexed in 32-byte steps (`key2 << 5`), half a record. What I can't give you is a T# read with the title's own keys. `key1` and `key2` each come from a `readfirstlane` inside a waterfall over lane data, and the CPU-side walk can't see those lanes. What I tried: - `key1 = 0` gives a readable pointer B. For `key1` 1–3 the pointer lands on unmapped memory, so record 0 may be a different kind of entry. - With `key1 = 0`, none of the 32-byte entries at `key2` 0–15 decodes as a T#. They hold floats (`3f800000`, `7f7fffff`) and small counters in dword 7. - A scan of the whole 4 MiB behind C in 32-byte steps found no image descriptor either: the entries that pass a type-nibble check have a constant `c0000000` in dword 1 and look like offset/size records. So the textures this routine samples are behind other records, selected by lane values. For a fixture, synthetic descriptors with this layout (record stride 16, pointer at +8, V# at pointer + 0xa0, T# stride 32 inside a stride-64 buffer) should reproduce the planner case. If it helps, I can run any branch against the title the same day. On the `0xea` arm: yes, it reaches the V# load in the control-flow graph. The `Phi` at pc `0x64b0` takes `0xea` from the block at `0x63f0..0x64b0`. That value flows through the merge at `0x59bc`, entered from `0x1ac8`, just after the record read at `0x1aa8`, to the `GetAddressResource` of the load at `0x6b6c`, without passing the record read again. It looks like a loop back-edge on which the register holding the pointer's low dword was reused. I can't tell from here whether the title takes that edge at run time; my print evaluated the record arm. <details><summary>Details</summary> - Linux (CachyOS), RTX 4090, i9-14900K. `main` `5d9dcc42d`, relinked with `--to-intel`. Shader cache off for these runs. Every run ends at the same refusal (exit 134) about 7–8 min in. - Memory was read with `process_vm_readv` on the running process, so unmapped addresses report as unreadable instead of faulting. - Across the three runs, the 16 user-data words match except for the SRT pointer P in s[12:13]. The CB base A and the record pointer B also move, but B is always 256-byte aligned. The V# read at B + 0xa0 is identical in all three: same masked base C, stride 64, 0x10000 records, dword 3 `00005204`. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
Tamalero commented 2026-10-17 06:37:27 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-17T06:37:27Z.


Checked whether #6417 (planning image tables through invariant descriptor Phis) covers the Ratchet & Clank: Rift Apart (PPSA01474) half of this issue, since its chain goes through a Phi before the V# load (ReadConstBuffer@pc=0x6b80(GetBufferResource(LoadAddressU32@pc=0x6b6c(GetAddressResource(Phi(…). It doesn't: main f26eb67c8 (+ #6814) with and without #6417 both stop on this chain in sibling compute shaders of the same family (0x116bb64a00 without, 0x116bb65100 with), 5–7 minutes in, one run each. That fits the analysis above: the two keys here are selected independently, not an invariant Phi. No regression with #6417 either.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6230759543 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6230759543). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-17T06:37:27Z. --- Checked whether #6417 (planning image tables through invariant descriptor `Phi`s) covers the Ratchet & Clank: Rift Apart (PPSA01474) half of this issue, since its chain goes through a `Phi` before the V# load (`ReadConstBuffer@pc=0x6b80(GetBufferResource(LoadAddressU32@pc=0x6b6c(GetAddressResource(Phi(…`). It doesn't: `main` `f26eb67c8` (+ #6814) with and without #6417 both stop on this chain in sibling compute shaders of the same family (`0x116bb64a00` without, `0x116bb65100` with), 5–7 minutes in, one run each. That fits the analysis above: the two keys here are selected independently, not an invariant `Phi`. No regression with #6417 either. *Tested and written by Claude (AI assistant) on a contributor's machine.*
Tamalero commented 2026-10-17 06:49:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-17T06:49:42Z.


The same check on the Guardians of the Galaxy (PPSA01748) key noted above (compute shader 0x3b91c3e00, LoadAddressU32@pc=0x4380): main 5d9dcc42d + #6232 + #6606 stops there 2 of 2 runs without #6417 and 3 of 3 with it, about 2–3 minutes in. So #6417 doesn't cover that one either.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6230871702 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6230871702). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-17T06:49:42Z. --- The same check on the Guardians of the Galaxy (PPSA01748) key noted above (compute shader `0x3b91c3e00`, `LoadAddressU32@pc=0x4380`): `main` `5d9dcc42d` + #6232 + #6606 stops there 2 of 2 runs without #6417 and 3 of 3 with it, about 2–3 minutes in. So #6417 doesn't cover that one either. *Tested and written by Claude (AI assistant) on a contributor's machine.*
ps54all commented 2026-10-17 21:58:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-17T21:58:09Z.


Ratchet & Clank: Rift Apart (PPSA01474, 01.005.003) data with #7223 on top: the GetImageResource stop goes away, and the title then stops on the sampler of what looks like the same record.

Setup: Windows 11, RTX 3080 10 GB (NVIDIA 610.74), i9-10850K, WinLibs GCC 15.2, Release. Our test branch: main 82f0c9aec + #6946 + #6958 + a few other open picks, then #7238 and #7223 (and in the second run also #6277 and #6417). psd1 settings APS5_HOST_IMPORT_MIB=20480, APS5_READLANE_WRAP=1, APS5_ADDRESS_COPY_MAX_MIB=4096. One run per configuration.

Stack Stop
without #7223 ~375 s, GetImageResource dword 0 is not a valid runtime value (ReadConstBuffer chain)
+ #7223 ~223 s, compute 0x116bb61400 stage 0
+ #7223 + #6277 + #6417 ~219 s, compute 0x116bb65300 stage 0

Both new stops are the same refusal:

ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00006b74(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediat...
  • GetImageResource lines: 0 in both runs with #7223. GetSamplerResource: only this fatal.
  • The sampler load is at pc 0x6b74, next to the LoadAddressU32@pc=0x6b6c / ReadConstBuffer@pc=0x6b80 loads in the image chain @Tamalero posted above, so the sampler probably comes from the same record/V# as the T# that #7223 now resolves.
  • #6417 makes no difference here, which matches the check above.
  • The first run with #7223 started on a cold shader cache, so the stop times can't be compared between rows.

LLM assistance used (Claude); runs on our machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241848739 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6241848739). Originally posted by [ps54all](https://github.com/ps54all) on 2026-10-17T21:58:09Z. --- Ratchet & Clank: Rift Apart (PPSA01474, 01.005.003) data with #7223 on top: the `GetImageResource` stop goes away, and the title then stops on the sampler of what looks like the same record. **Setup:** Windows 11, RTX 3080 10 GB (NVIDIA 610.74), i9-10850K, WinLibs GCC 15.2, Release. Our test branch: main `82f0c9aec` + #6946 + #6958 + a few other open picks, then #7238 and #7223 (and in the second run also #6277 and #6417). psd1 settings `APS5_HOST_IMPORT_MIB=20480`, `APS5_READLANE_WRAP=1`, `APS5_ADDRESS_COPY_MAX_MIB=4096`. One run per configuration. | Stack | Stop | |---|---| | without #7223 | ~375 s, `GetImageResource dword 0 is not a valid runtime value` (ReadConstBuffer chain) | | + #7223 | ~223 s, compute `0x116bb61400` stage 0 | | + #7223 + #6277 + #6417 | ~219 s, compute `0x116bb65300` stage 0 | Both new stops are the same refusal: ``` ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00006b74(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediat... ``` - `GetImageResource` lines: 0 in both runs with #7223. `GetSamplerResource`: only this fatal. - The sampler load is at pc `0x6b74`, next to the `LoadAddressU32@pc=0x6b6c` / `ReadConstBuffer@pc=0x6b80` loads in the image chain @Tamalero posted above, so the sampler probably comes from the same record/V# as the T# that #7223 now resolves. - #6417 makes no difference here, which matches the check above. - The first run with #7223 started on a cold shader cache, so the stop times can't be compared between rows. LLM assistance used (Claude); runs on our machine.
Capmare commented 2026-10-17 23:04:17 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Capmare on 2026-10-17T23:04:17Z.


Marvel's Wolverine (PPSA03671) stops on the same chain shape as Ratchet & Clank in this issue. This confirms that the shape is not specific to one title.

The failing shader is compute shader 0x11d049aa00. It fails for both images and samplers:

GetImageResource dword 0 is not a valid runtime value; chain:
ReadConstBuffer@pc=0x0000bee0(GetBufferResource(LoadAddressU32@pc=0x0000beb4(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00002454(GetBufferResource(ReadConst x4), ShiftLeftLogical32(ReadFirstLane, Immediate)), ...

GetSamplerResource dword 0 is not a valid runtime value; chain:
ReadConstBuffer@pc=0x0000bb28(GetBufferResource(LoadAddressU32@pc=0x0000bb18(GetAddressResource(ReadConstBuffer@pc=0x00002454(GetBufferResource(ReadConst(GetSrtResource, Immediate) x4), ShiftLeftLogical32(ReadFirstLane(SelectU32(...), Phi), Immediate)), ...

Shape, in the same terms as the Ratchet comments above:

CB V#  = 4 x ReadConst(GetSrtResource)                       SRT dwords
key    = ReadFirstLane(SelectU32 / Phi)                      waterfall key
record = ReadConstBuffer(CB V#, key << n)  @pc=0x2454        pointer record, shared by image and sampler chains
V#     = LoadAddressU32(GetAddressResource(record)) @pc=0xbeb4 (image) / 0xbb18 (sampler)
T#/S#  = ReadConstBuffer(GetBufferResource(V#), ...) @pc=0xbee0 (image) / 0xbb28 (sampler)

Points that match Ratchet:

  • The middle hop is a buffer (a loaded V#), not a second pointer. PR #6232 does not cover it.
  • The pointer low dword goes through nested Phis that merge the record read at 0x2454 with a second loaded value (LoadAddressU32@pc=0xbbc8).
  • Draft PR #7223 handles record -> pointer -> V# -> T#, and it removes the first refusal. The nested Phi shape above is still refused.

Effect on the title: the shader writes the draw records for GPU-driven indirect draws. I replaced the refused images with a null texture and the refused samplers with a repeating bilinear sampler, only as a local diagnostic. The game then runs the intro and the loading screens. It later aborts with INDEX_BUFFER_SIZE has not been set (Pm4.cpp, an indirect indexed draw whose INDEX_ATTRIBUTES_INDIRECT record has size 0). So the substitute output is wrong, and the title needs the real chain.

I can run any branch against this title and report the result. I can also dump runtime values for the record, the V# and the T# if that helps.

Details
  • Linux, RTX 4070 SUPER, main 66702f1cf plus local patches and #7223. The local patches are not part of this issue.
  • A separate local fix for a different bug is not included here: the recompiler passed wave size 0 to the call analysis, which gave a false "scalar call link register escapes" error.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6242805290 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6242805290). Originally posted by [Capmare](https://github.com/Capmare) on 2026-10-17T23:04:17Z. --- Marvel's Wolverine (PPSA03671) stops on the same chain shape as Ratchet & Clank in this issue. This confirms that the shape is not specific to one title. The failing shader is compute shader `0x11d049aa00`. It fails for both images and samplers: ``` GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000bee0(GetBufferResource(LoadAddressU32@pc=0x0000beb4(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00002454(GetBufferResource(ReadConst x4), ShiftLeftLogical32(ReadFirstLane, Immediate)), ... GetSamplerResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x0000bb28(GetBufferResource(LoadAddressU32@pc=0x0000bb18(GetAddressResource(ReadConstBuffer@pc=0x00002454(GetBufferResource(ReadConst(GetSrtResource, Immediate) x4), ShiftLeftLogical32(ReadFirstLane(SelectU32(...), Phi), Immediate)), ... ``` Shape, in the same terms as the Ratchet comments above: ``` CB V# = 4 x ReadConst(GetSrtResource) SRT dwords key = ReadFirstLane(SelectU32 / Phi) waterfall key record = ReadConstBuffer(CB V#, key << n) @pc=0x2454 pointer record, shared by image and sampler chains V# = LoadAddressU32(GetAddressResource(record)) @pc=0xbeb4 (image) / 0xbb18 (sampler) T#/S# = ReadConstBuffer(GetBufferResource(V#), ...) @pc=0xbee0 (image) / 0xbb28 (sampler) ``` Points that match Ratchet: - The middle hop is a buffer (a loaded V#), not a second pointer. PR #6232 does not cover it. - The pointer low dword goes through nested `Phi`s that merge the record read at `0x2454` with a second loaded value (`LoadAddressU32@pc=0xbbc8`). - Draft PR #7223 handles record -> pointer -> V# -> T#, and it removes the first refusal. The nested `Phi` shape above is still refused. Effect on the title: the shader writes the draw records for GPU-driven indirect draws. I replaced the refused images with a null texture and the refused samplers with a repeating bilinear sampler, only as a local diagnostic. The game then runs the intro and the loading screens. It later aborts with `INDEX_BUFFER_SIZE has not been set` (Pm4.cpp, an indirect indexed draw whose `INDEX_ATTRIBUTES_INDIRECT` record has size 0). So the substitute output is wrong, and the title needs the real chain. I can run any branch against this title and report the result. I can also dump runtime values for the record, the V# and the T# if that helps. <details><summary>Details</summary> - Linux, RTX 4070 SUPER, `main` `66702f1cf` plus local patches and #7223. The local patches are not part of this issue. - A separate local fix for a different bug is not included here: the recompiler passed wave size 0 to the call analysis, which gave a false "scalar call link register escapes" error. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
EagleBearerYS commented 2026-10-18 02:23:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T02:23:36Z.


@Capmare, @ps54all: the sampler half of this chain is ready to try on top of #7223. Branch feat/shader-nested-sampler-tables is #7223's head f4549448f7 plus three commits:

  • an S# through record → pointer → V# → S#: the Marvel's Wolverine (PPSA03671) chain Capmare posted;
  • an S# or T# read through a record pointer whose low word goes through a Phi: the Ratchet & Clank: Rift Apart (PPSA01474) chain ps54all posted;
  • a refusal for a nested entry whose descriptor words another instruction also reads.

Its tests pass on lavapipe. It hasn't run on either title or on real hardware yet. If you can run it, the things to look for are whether GetSamplerResource dword 0 is not a valid runtime value goes away, and what the next stop is. The disk-cache format moves to 38, so the first run rebuilds the shader cache.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244689252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6244689252). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T02:23:36Z. --- @Capmare, @ps54all: the sampler half of this chain is ready to try on top of #7223. Branch [`feat/shader-nested-sampler-tables`](https://github.com/EagleBearerYS/AnyPS5/commits/feat/shader-nested-sampler-tables) is #7223's head f4549448f7 plus three commits: - an S# through record → pointer → V# → S#: the Marvel's Wolverine (PPSA03671) chain Capmare posted; - an S# or T# read through a record pointer whose low word goes through a Phi: the Ratchet & Clank: Rift Apart (PPSA01474) chain ps54all posted; - a refusal for a nested entry whose descriptor words another instruction also reads. Its tests pass on lavapipe. It hasn't run on either title or on real hardware yet. If you can run it, the things to look for are whether `GetSamplerResource dword 0 is not a valid runtime value` goes away, and what the next stop is. The disk-cache format moves to 38, so the first run rebuilds the shader cache.
ps54all commented 2026-10-18 05:34:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-18T05:34:52Z.


@EagleBearerYS: ran feat/shader-nested-sampler-tables (head 4a4db4bf9, the same commits as #7395) on Ratchet & Clank: Rift Apart (PPSA01474, 01.005.003). The GetSamplerResource stop is gone (0 hits). The title now stops 236 s in on an image read through a deeper version of the same chain, on another compute shader:

[gpu] driver failure: compute shader 0x116bb65a00: shader 0x116bb65a00 stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00008fd4(GetAddressResource(Phi(Phi(Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), ...

The record read is always ReadConstBuffer@pc=0x1aa8 (CB V# from 4 x ReadConst(GetSrtResource), key ReadFirstLane(SelectU32(...)) << n), but the pointer low word goes through six levels of Phi before LoadAddressU32@pc=0x8fd4, and one arm also merges CompositeExtractU32x4(Ballot(LogicalAnd(Phi, INotEqual32)), Immediate), so it looks like the waterfall loop's own key merge rather than a second source. Full line (2519 characters):

chain
[gpu] driver failure: compute shader 0x116bb65a00: shader 0x116bb65a00 stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00008fd4(GetAddressResource(Phi(Phi(Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Immediate))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Phi(ReadConstBuffer@pc=0x00001aa8, Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)))), Phi(Phi(Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Phi)), Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32))), CompositeExtractU32x4(Ballot(LogicalAnd(Phi, INotEqual32)), Immediate))), Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Phi(ReadConstBuffer@pc=0x00001aa8, Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate))), Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Immediate))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)), Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32, Phi), Immediate))))), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd(INotEqual32(BitwiseAnd32, Immediate), INotEqual32(Immediate, Phi)), IAdd32(Phi(Phi, SelectU32), Phi(Phi, SelectU32)), Phi(Phi(Phi, Phi), Phi(Phi, Phi))), Phi(LogicalAnd(INotEqual32(BitwiseAnd32, Immediate), INotEqual32(Immediate, Phi)), LogicalAnd(Phi(LogicalAnd, LogicalAnd), INotEqual32(Immediate, SelectU32)))), Immediate))), Immediate, Immediate, Immediate)
  • Setup: Windows 11, RTX 3080 10 GB (NVIDIA 610.74), i9-10850K, WinLibs GCC 15.2, Release. Our test branch (main 82f0c9aec + #6946 + #6958 + #7238 + #7223 + #6277 + #6417 + #6160 + #7300) plus the branch's three commits (disk-cache format bumped past ours, cold cache).
  • Run: one run, 236 s, black window, 12.6 FPS peak, abort right after the line above. No INDEX_BUFFER_SIZE stop. One run only.

Tested and written with Claude Code (AI assistant) on a contributor's machine.


Generated by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246149739 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6246149739). Originally posted by [ps54all](https://github.com/ps54all) on 2026-10-18T05:34:52Z. --- @EagleBearerYS: ran `feat/shader-nested-sampler-tables` (head `4a4db4bf9`, the same commits as #7395) on Ratchet & Clank: Rift Apart (PPSA01474, 01.005.003). The `GetSamplerResource` stop is gone (0 hits). The title now stops 236 s in on an image read through a deeper version of the same chain, on another compute shader: ``` [gpu] driver failure: compute shader 0x116bb65a00: shader 0x116bb65a00 stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00008fd4(GetAddressResource(Phi(Phi(Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), ... ``` The record read is always `ReadConstBuffer@pc=0x1aa8` (CB V# from 4 x `ReadConst(GetSrtResource)`, key `ReadFirstLane(SelectU32(...)) << n`), but the pointer low word goes through six levels of `Phi` before `LoadAddressU32@pc=0x8fd4`, and one arm also merges `CompositeExtractU32x4(Ballot(LogicalAnd(Phi, INotEqual32)), Immediate)`, so it looks like the waterfall loop's own key merge rather than a second source. Full line (2519 characters): <details><summary>chain</summary> ``` [gpu] driver failure: compute shader 0x116bb65a00: shader 0x116bb65a00 stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00008fd4(GetAddressResource(Phi(Phi(Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Immediate))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Phi(ReadConstBuffer@pc=0x00001aa8, Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)))), Phi(Phi(Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Phi)), Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32))), CompositeExtractU32x4(Ballot(LogicalAnd(Phi, INotEqual32)), Immediate))), Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Phi(ReadConstBuffer@pc=0x00001aa8, Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate))), Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Immediate))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)), Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32, Phi), Immediate))))), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd(INotEqual32(BitwiseAnd32, Immediate), INotEqual32(Immediate, Phi)), IAdd32(Phi(Phi, SelectU32), Phi(Phi, SelectU32)), Phi(Phi(Phi, Phi), Phi(Phi, Phi))), Phi(LogicalAnd(INotEqual32(BitwiseAnd32, Immediate), INotEqual32(Immediate, Phi)), LogicalAnd(Phi(LogicalAnd, LogicalAnd), INotEqual32(Immediate, SelectU32)))), Immediate))), Immediate, Immediate, Immediate) ``` </details> - **Setup:** Windows 11, RTX 3080 10 GB (NVIDIA 610.74), i9-10850K, WinLibs GCC 15.2, Release. Our test branch (main `82f0c9aec` + #6946 + #6958 + #7238 + #7223 + #6277 + #6417 + #6160 + #7300) plus the branch's three commits (disk-cache format bumped past ours, cold cache). - **Run:** one run, 236 s, black window, 12.6 FPS peak, abort right after the line above. No `INDEX_BUFFER_SIZE` stop. One run only. *Tested and written with Claude Code (AI assistant) on a contributor's machine.* --- _Generated by [Claude Code](https://claude.ai/code)_
EagleBearerYS commented 2026-10-18 05:44:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T05:44:56Z.


@ps54all, thanks for running it. The GetSamplerResource stop going away on Ratchet & Clank: Rift Apart (PPSA01474) is the result #7395 needed, and it's now in #7395's Tested section.

The new stop is on #7395's own path, not #7223's.

  • The load: the T# is loaded through the record's 64-bit pointer: LoadAddressU32@pc=0x8fd4 on GetAddressResource(Phi(...), ReadConstBuffer@pc=0x1aa8). #7395's last commit (4a4db4bf94) turns that into a lookup by the pointer's value.
  • The walk before it: it first follows the pointer's low word through its Phis (PointerRecordOrigin), and accepts only the record read and constants as arms.
  • What your chain shows: those arms six levels deep, which the walk follows, plus one arm that is a word of a Ballot (the waterfall loop's lane mask, as you read it). The walk refuses that arm, so the column is refused.
  • Why it can be accepted: a lane-mask word can't be a record pointer, and the lookup already faults as outside the snapshot on a pointer it doesn't know. So that arm can be accepted the way the constants are.

I'm adding that to #7395 as a new commit, with a test of this shape, and will post here when it's ready to rerun.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246223469 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6246223469). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T05:44:56Z. --- @ps54all, thanks for running it. The `GetSamplerResource` stop going away on Ratchet & Clank: Rift Apart (PPSA01474) is the result #7395 needed, and it's now in #7395's Tested section. The new stop is on #7395's own path, not #7223's. - **The load:** the T# is loaded through the record's 64-bit pointer: `LoadAddressU32@pc=0x8fd4` on `GetAddressResource(Phi(...), ReadConstBuffer@pc=0x1aa8)`. #7395's last commit (4a4db4bf94) turns that into a lookup by the pointer's value. - **The walk before it:** it first follows the pointer's low word through its Phis ([`PointerRecordOrigin`](https://github.com/EagleBearerYS/AnyPS5/blob/4a4db4bf94/core/shader/recompiler/Optimization/src/ResourceTracker.cpp#L695-L713)), and accepts only the record read and constants as arms. - **What your chain shows:** those arms six levels deep, which the walk follows, plus one arm that is a word of a `Ballot` (the waterfall loop's lane mask, as you read it). The walk refuses that arm, so the column is refused. - **Why it can be accepted:** a lane-mask word can't be a record pointer, and the lookup already faults as outside the snapshot on a pointer it doesn't know. So that arm can be accepted the way the constants are. I'm adding that to #7395 as a new commit, with a test of this shape, and will post here when it's ready to rerun.
EagleBearerYS commented 2026-10-18 06:32:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T06:32:05Z.


@ps54all, the fix for that stop is now on #7395. Branch feat/shader-nested-sampler-tables is at b91f0508d5, fix(shader): accept a lane-mask word in a pointer-keyed record pointer.

  • What changed: the pointer lookup now accepts the Ballot lane-mask arm from your chain, as it does constants. It also accepts copies of the record word read under another key.
  • What it's been tested on: its tests pass on lavapipe, including two shaped like your chain. It hasn't run on Ratchet & Clank: Rift Apart (PPSA01474) or on real hardware yet.
  • If you can rerun it on the same tree, look for whether the GetImageResource dword 0 is not a valid runtime value stop on compute shader 0x116bb65a00 goes away, and what the next stop is.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6246593904 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6246593904). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T06:32:05Z. --- @ps54all, the fix for that stop is now on #7395. Branch [`feat/shader-nested-sampler-tables`](https://github.com/EagleBearerYS/AnyPS5/commits/feat/shader-nested-sampler-tables) is at [b91f0508d5](https://github.com/EagleBearerYS/AnyPS5/commit/b91f0508d5), `fix(shader): accept a lane-mask word in a pointer-keyed record pointer`. - **What changed:** the pointer lookup now accepts the `Ballot` lane-mask arm from your chain, as it does constants. It also accepts copies of the record word read under another key. - **What it's been tested on:** its tests pass on lavapipe, including two shaped like your chain. It hasn't run on Ratchet & Clank: Rift Apart (PPSA01474) or on real hardware yet. - **If you can rerun it on the same tree,** look for whether the `GetImageResource dword 0 is not a valid runtime value` stop on compute shader 0x116bb65a00 goes away, and what the next stop is.
Tamalero commented 2026-10-18 07:40:15 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-18T07:40:15Z.


@EagleBearerYS I ran feat/shader-nested-sampler-tables on Ratchet & Clank: Rift Apart (PPSA01474), with #7223's head as the control. The sampler stop is gone, the T# behind the Phi'd record pointer passes too, and the title stops one site further on.

Build (both on 66702f1cf) Stop
#7223 head f4549448f ~480 s, compute 0x116bb65100: GetSamplerResource dword 0 at pc=0x6b74 (3 refusals)
your head b91f0508d ~470 s, compute 0x116bb61900: GetImageResource dword 0 at pc=0x99ec (3 refusals); 0 sampler refusals
  • The two stops from my earlier comments on #7223 are both resolved: the S# at pc=0x6b74 (block +0xb0) and the T# at pc=0x7cbc (block +0x0 behind nested Phis). Neither pc appears in the run on your head.
  • The new stop is again a T# read through a record pointer from the pc=0x1aa8 record table, but its pointer words go through a much deeper Phi nest. One arm of that nest is BitwiseAnd32(…, CompositeExtractU32x4(Ballot(…), Immediate)), a lane-mask word that can reach the pointer. That looks close to what b91f0508d accepts, in a shape it doesn't cover yet.
  • One run per build. The control stops at the same point in the boot, so the difference is your branch.
Details and logs

CachyOS (Linux 7.2), RTX 4090 (NVIDIA 615.78.08), GCC, Release. PPSA01474 v01.005.003. Game data and a fresh shader cache on NVMe (your branch moves the disk cache to format 38). No local patches in either build.

Full refusal at the new stop (from the log, not truncated):

compute shader 0x116bb61900: shader 0x116bb61900 stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x000099ec(GetAddressResource(Phi(Phi(Phi(Phi(Phi(Phi(Phi, Phi), Phi(Phi, ReadConstBuffer@pc=0x00001aa8)), Phi(Phi(Phi, Phi), CompositeExtractU32x4(Ballot, Immediate))), Phi(Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Phi)), Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)))), BitwiseAnd32(Phi(Phi(Phi(Phi, Phi), BitwiseAnd32(Phi, CompositeExtractU32x4)), Phi(Phi(Phi, BitwiseAnd32), Phi(Phi, Phi))), CompositeExtractU32x4(Ballot(Immediate), Immediate))), Phi(Phi(Phi(Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Phi)), Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32))), Phi(Phi(Phi(Phi, Phi), Phi(Phi, ReadConstBuffer@pc=0x00001aa8)), CompositeExtractU32x4(Ballot(LogicalAnd), Immediate))), Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Immediate))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Phi(ReadConstBuffer@pc=0x00001aa8, Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)))))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi), Phi(LogicalAnd, LogicalAnd)), Immediate)), Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32, Phi), Immediate)), ReadConstBuffer@pc=0x00009048(GetBufferResource(LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate), LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate), LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate), LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate)), Immediate))), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd(INotEqual32, INotEqual32), IAdd32(Phi, Phi), Phi(Phi, Phi)), Phi(LogicalAnd(INotEqual32, INotEqual32), LogicalAnd(Phi, INotEqual32))), Immediate)))), Immediate, Immediate, Immediate)

I haven't evaluated this chain against guest memory yet. If the record and block layout helps, I can run the same local diagnostic as for the #7223 data (offsets and alignment, addresses masked).

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6247236255 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6247236255). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-18T07:40:15Z. --- @EagleBearerYS I ran `feat/shader-nested-sampler-tables` on Ratchet & Clank: Rift Apart (PPSA01474), with #7223's head as the control. The sampler stop is gone, the T# behind the Phi'd record pointer passes too, and the title stops one site further on. | Build (both on `66702f1cf`) | Stop | |---|---| | #7223 head `f4549448f` | ~480 s, compute `0x116bb65100`: `GetSamplerResource dword 0` at `pc=0x6b74` (3 refusals) | | your head `b91f0508d` | ~470 s, compute `0x116bb61900`: `GetImageResource dword 0` at `pc=0x99ec` (3 refusals); 0 sampler refusals | - The two stops from my earlier comments on #7223 are both resolved: the S# at `pc=0x6b74` (block `+0xb0`) and the T# at `pc=0x7cbc` (block `+0x0` behind nested Phis). Neither pc appears in the run on your head. - The new stop is again a T# read through a record pointer from the `pc=0x1aa8` record table, but its pointer words go through a much deeper Phi nest. One arm of that nest is `BitwiseAnd32(…, CompositeExtractU32x4(Ballot(…), Immediate))`, a lane-mask word that can reach the pointer. That looks close to what `b91f0508d` accepts, in a shape it doesn't cover yet. - One run per build. The control stops at the same point in the boot, so the difference is your branch. <details><summary>Details and logs</summary> CachyOS (Linux 7.2), RTX 4090 (NVIDIA 615.78.08), GCC, Release. PPSA01474 v01.005.003. Game data and a fresh shader cache on NVMe (your branch moves the disk cache to format 38). No local patches in either build. Full refusal at the new stop (from the log, not truncated): ``` compute shader 0x116bb61900: shader 0x116bb61900 stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x000099ec(GetAddressResource(Phi(Phi(Phi(Phi(Phi(Phi(Phi, Phi), Phi(Phi, ReadConstBuffer@pc=0x00001aa8)), Phi(Phi(Phi, Phi), CompositeExtractU32x4(Ballot, Immediate))), Phi(Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Phi)), Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)))), BitwiseAnd32(Phi(Phi(Phi(Phi, Phi), BitwiseAnd32(Phi, CompositeExtractU32x4)), Phi(Phi(Phi, BitwiseAnd32), Phi(Phi, Phi))), CompositeExtractU32x4(Ballot(Immediate), Immediate))), Phi(Phi(Phi(Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Phi)), Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32))), Phi(Phi(Phi(Phi, Phi), Phi(Phi, ReadConstBuffer@pc=0x00001aa8)), CompositeExtractU32x4(Ballot(LogicalAnd), Immediate))), Phi(Phi(Phi(Phi(ReadConstBuffer@pc=0x00001aa8, Phi), ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32)), Phi(Phi(Phi, ReadConstBuffer@pc=0x00001aa8), Phi(Phi, Immediate))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource, ShiftLeftLogical32), Phi(ReadConstBuffer@pc=0x00001aa8, Immediate)), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)))))), Phi(Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi), Phi(LogicalAnd, LogicalAnd)), Immediate)), Phi(ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32, Phi), Immediate)), ReadConstBuffer@pc=0x00009048(GetBufferResource(LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate), LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate), LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate), LoadAddressU32@pc=0x00008fc8(GetAddressResource, Immediate, Immediate, Immediate)), Immediate))), ReadConstBuffer@pc=0x00001aa8(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd(INotEqual32, INotEqual32), IAdd32(Phi, Phi), Phi(Phi, Phi)), Phi(LogicalAnd(INotEqual32, INotEqual32), LogicalAnd(Phi, INotEqual32))), Immediate)))), Immediate, Immediate, Immediate) ``` I haven't evaluated this chain against guest memory yet. If the record and block layout helps, I can run the same local diagnostic as for the #7223 data (offsets and alignment, addresses masked). </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
EagleBearerYS commented 2026-10-18 07:55:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T07:55:18Z.


@Tamalero thanks, that's a clear result. On #7395's head b91f0508d both earlier stops are gone (the S# at pc=0x6b74 and the T# at pc=0x7cbc), with no sampler refusals, and Ratchet & Clank: Rift Apart (PPSA01474) now stops at pc=0x99ec in compute 0x116bb61900. Your run is now in #7395's Tested section.

Two things in the new chain stop it, not one:

  • The low word: besides the bare CompositeExtractU32x4(Ballot, Immediate) arms that b91f0508d skips, it has a BitwiseAnd32(Phi(…), CompositeExtractU32x4(Ballot(Immediate), Immediate)) arm. That one can be taken the same way, as long as the AND's other operand is still checked.
  • The high word: it's a Phi of three reads of the record table at pc=0x1aa8 and one ReadConstBuffer@pc=0x9048, a dword at a fixed offset in a buffer whose descriptor is itself loaded through a pointer at pc=0x8fc8. #7395 takes the high word only as one read of the same record as the low word. The Phi of record reads can be walked like the low word, but the pc=0x9048 read is a second table, which #7395's pointer-keyed column can't take as it stands.

Your diagnostic would help with the second one. If you can run it on this dispatch, the useful part is the dword the pc=0x9048 read returns, next to the high dwords of the records the pc=0x1aa8 reads return, with addresses masked as before. Whether those are always equal decides how the column should take the high word.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6247357875 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6247357875). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T07:55:18Z. --- @Tamalero thanks, that's a clear result. On #7395's head b91f0508d both earlier stops are gone (the S# at pc=0x6b74 and the T# at pc=0x7cbc), with no sampler refusals, and Ratchet & Clank: Rift Apart (PPSA01474) now stops at pc=0x99ec in compute 0x116bb61900. Your run is now in #7395's Tested section. Two things in the new chain stop it, not one: - **The low word:** besides the bare `CompositeExtractU32x4(Ballot, Immediate)` arms that b91f0508d skips, it has a `BitwiseAnd32(Phi(…), CompositeExtractU32x4(Ballot(Immediate), Immediate))` arm. That one can be taken the same way, as long as the AND's other operand is still checked. - **The high word:** it's a Phi of three reads of the record table at pc=0x1aa8 and one `ReadConstBuffer@pc=0x9048`, a dword at a fixed offset in a buffer whose descriptor is itself loaded through a pointer at pc=0x8fc8. #7395 takes the high word only as one read of the same record as the low word. The Phi of record reads can be walked like the low word, but the pc=0x9048 read is a second table, which #7395's pointer-keyed column can't take as it stands. Your diagnostic would help with the second one. If you can run it on this dispatch, the useful part is the dword the pc=0x9048 read returns, next to the high dwords of the records the pc=0x1aa8 reads return, with addresses masked as before. Whether those are always equal decides how the column should take the high word.
Tamalero commented 2026-10-18 21:47:26 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-18T21:47:26Z.


@EagleBearerYS here's the data for the high word, from #7395's head ed4f148a3 on Ratchet & Clank: Rift Apart (PPSA01474). Both runs stopped on siblings of your 0x99ec shader: compute 0x116bb67100 and 0x116bb5a000, both at LoadAddressU32@pc=0x9a30, so the second table's read is at pc=0x908c and its V# load at pc=0x900c. Addresses are masked; offsets, sizes and counts are real.

Short answer: the record table's high word is the same in every populated record. The pc=0x908c read doesn't return it for the one block where I could follow the chain, so I can't confirm "always equal".

The record table (ReadConstBuffer@pc=0x1aa8, V# from the SRT at +0x270: stride 16, 0x54ffc = 348,156 records), read in full from guest memory:

  • 27,396 records are populated and 320,760 are all zero.
  • In every populated record, +0xc (the pointer's high word) is 0x00000012 and +0x4 is 0x00000011. That's one value each across the whole table. The low words vary: 765 distinct at +0x8, 35 at +0x0.

The pc=0x908c read, followed for record 0 (key 0): the record's pointer P → pc=0x900c loads 4 dwords at P + 0xe0 → a V# with stride 32 and 0x2000 records → pc=0x908c reads at +0x64 plus a dynamic offset (0 for key 0) → 0x00000000.

  • That buffer is a table of 32-byte T#s: 102 slots populated, the rest zero. Dword 1 of a slot (+0x4, where +0x64 lands if the dynamic offset is a multiple of the 32-byte stride) is 0 or a T#'s dword 1 (caa20000 ×98, cb620000 ×3, c3800000 ×1). No dword anywhere in the 256 KiB buffer equals 0x00000012.
  • Across all 764 distinct record pointers, the 16 bytes at P + 0xe0 are a buffer V# only for some blocks: 365 distinct values, several of them clearly not V#s (for example 00000000 00fff000 0a500000 00000000, or what looks like part of a T#). The blocks are heterogeneous, like the S# at +0xb0 earlier. So I can't tell from memory which records reach the pc=0x908c arm, and treating every +0xe0 as a V# only gives noise.

I can't evaluate the per-lane key, so this doesn't show which arm a given lane takes at run time. If it helps, I can dump the pc=0x900c V# and the pc=0x908c dword for other keys than 0, or for a specific record.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255548496 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6255548496). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-18T21:47:26Z. --- @EagleBearerYS here's the data for the high word, from #7395's head `ed4f148a3` on Ratchet & Clank: Rift Apart (PPSA01474). Both runs stopped on siblings of your `0x99ec` shader: compute `0x116bb67100` and `0x116bb5a000`, both at `LoadAddressU32@pc=0x9a30`, so the second table's read is at `pc=0x908c` and its V# load at `pc=0x900c`. Addresses are masked; offsets, sizes and counts are real. **Short answer:** the record table's high word is the same in every populated record. The `pc=0x908c` read doesn't return it for the one block where I could follow the chain, so I can't confirm "always equal". **The record table** (`ReadConstBuffer@pc=0x1aa8`, V# from the SRT at `+0x270`: stride 16, `0x54ffc` = 348,156 records), read in full from guest memory: - 27,396 records are populated and 320,760 are all zero. - In every populated record, `+0xc` (the pointer's high word) is `0x00000012` and `+0x4` is `0x00000011`. That's one value each across the whole table. The low words vary: 765 distinct at `+0x8`, 35 at `+0x0`. **The `pc=0x908c` read**, followed for record 0 (key 0): the record's pointer `P` → `pc=0x900c` loads 4 dwords at `P + 0xe0` → a V# with stride 32 and 0x2000 records → `pc=0x908c` reads at `+0x64` plus a dynamic offset (0 for key 0) → `0x00000000`. - That buffer is a table of 32-byte T#s: 102 slots populated, the rest zero. Dword 1 of a slot (`+0x4`, where `+0x64` lands if the dynamic offset is a multiple of the 32-byte stride) is `0` or a T#'s dword 1 (`caa20000` ×98, `cb620000` ×3, `c3800000` ×1). No dword anywhere in the 256 KiB buffer equals `0x00000012`. - Across all 764 distinct record pointers, the 16 bytes at `P + 0xe0` are a buffer V# only for some blocks: 365 distinct values, several of them clearly not V#s (for example `00000000 00fff000 0a500000 00000000`, or what looks like part of a T#). The blocks are heterogeneous, like the S# at `+0xb0` earlier. So I can't tell from memory which records reach the `pc=0x908c` arm, and treating every `+0xe0` as a V# only gives noise. I can't evaluate the per-lane key, so this doesn't show which arm a given lane takes at run time. If it helps, I can dump the `pc=0x900c` V# and the `pc=0x908c` dword for other keys than 0, or for a specific record. *Tested and written by Claude (AI assistant) on a contributor's machine.*
EagleBearerYS commented 2026-10-18 21:52:09 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-18T21:52:09Z.


@Tamalero thanks, this answers the question. In Ratchet & Clank: Rift Apart (PPSA01474), the record table's high word is one value, 0x00000012, in all 27,396 populated records. The second table's read returns 0 for the one block you could follow, and its buffer holds no 0x00000012 at all. So the two can't be assumed equal, and #7395's column can't fold the second read into the record's high word. It has to take that read as its own source.

No more dumps are needed for now. The work on this stop (the lane-mask AND and this high word) is paused on our side for a while, and we'll pick it up from your data.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255593903 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6255593903). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-18T21:52:09Z. --- @Tamalero thanks, this answers the question. In Ratchet & Clank: Rift Apart (PPSA01474), the record table's high word is one value, `0x00000012`, in all 27,396 populated records. The second table's read returns `0` for the one block you could follow, and its buffer holds no `0x00000012` at all. So the two can't be assumed equal, and #7395's column can't fold the second read into the record's high word. It has to take that read as its own source. No more dumps are needed for now. The work on this stop (the lane-mask AND and this high word) is paused on our side for a while, and we'll pick it up from your data.
spiff637 commented 2026-10-18 22:12:18 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by spiff637 on 2026-10-18T22:12:18Z.


Another title stops on this chain: Marvel's Spider-Man 2 (PPSA08338, 01.005.001). It fails in compute shader 0x11e2b6e100, about 155 s in.

GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00008560(GetBufferResource(LoadAddressU32@pc=0x0000854c(GetAddressResource(ReadConstBuffer@pc=0x00001fc4(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi), Phi(LogicalAnd, LogicalAnd)), Immediate)), ReadConstBuffer@pc=0x00001fc4(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, …

The shape:

  • A record read at pc=0x1fc4, keyed by a readfirstlane index.
  • A pointer loaded from it at pc=0x854c.
  • A V# built from that pointer.
  • The T# read through that V# at pc=0x8560.

This is the record → pointer → V# → T# shape described above for Ratchet & Clank.

  • Setup: Windows 11, RTX 3080, driver 617.42. Build: main 218aa8f00 with #7505, #6606 and #7679 merged in; the last fixes the index-limit stop that came before this one.
  • #7223 / #7395: I couldn't test them here. Both conflict with current main in ResourceTracker.cpp, ResourceMaterializer.cpp, ShaderDiskCache.cpp, ControlFlowInfo.hpp and tests/execution/ImageTable.cpp. I'm happy to run a rebased head on this title.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255788378 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6255788378). Originally posted by [spiff637](https://github.com/spiff637) on 2026-10-18T22:12:18Z. --- Another title stops on this chain: Marvel's Spider-Man 2 (**PPSA08338**, 01.005.001). It fails in compute shader `0x11e2b6e100`, about 155 s in. ``` GetImageResource dword 0 is not a valid runtime value; chain: ReadConstBuffer@pc=0x00008560(GetBufferResource(LoadAddressU32@pc=0x0000854c(GetAddressResource(ReadConstBuffer@pc=0x00001fc4(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, Immediate)), ShiftLeftLogical32(ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi), Phi(LogicalAnd, LogicalAnd)), Immediate)), ReadConstBuffer@pc=0x00001fc4(GetBufferResource(ReadConst(GetSrtResource, Immediate), ReadConst(GetSrtResource, … ``` The shape: - A record read at `pc=0x1fc4`, keyed by a `readfirstlane` index. - A pointer loaded from it at `pc=0x854c`. - A V# built from that pointer. - The T# read through that V# at `pc=0x8560`. This is the record → pointer → V# → T# shape described above for Ratchet & Clank. - **Setup:** Windows 11, RTX 3080, driver 617.42. Build: `main` 218aa8f00 with #7505, #6606 and #7679 merged in; the last fixes the index-limit stop that came before this one. - **#7223 / #7395:** I couldn't test them here. Both conflict with current `main` in `ResourceTracker.cpp`, `ResourceMaterializer.cpp`, `ShaderDiskCache.cpp`, `ControlFlowInfo.hpp` and `tests/execution/ImageTable.cpp`. I'm happy to run a rebased head on this title.
SandstromPL commented 2026-10-19 07:29:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-19T07:29:10Z.


@Capmare about the separate local fix in your details block (wave size 0 passed to the call analysis): current main still has it. Recompiler.cpp L164 builds the frontend's SwappcInfo with 0u, while the driver's LinkUserDataCallees passes request.context.waveSize (ShaderRegistry.cpp L691). With 0, a VOPC or VOP3 mask write counts as one SGPR and a v_cndmask mask read as two. So in wave64 a v_cmp_e64 that reuses a link pair after the return, followed by a v_cndmask_b32_e64 reading it, is refused, which matches what you describe.

Are you planning to open a PR for it? If not, I'm happy to. Either way, the exact refusal line from your Wolverine run would help, with the shader address, the two program counters and the header's wave size, since reviewers ask for a title log line.

One thing to watch: the frontend cache (Matches, L143) doesn't key on wave size, and the frontend-reuse test in ShaderMemory.cpp expects a variant that differs only in wave size to reuse the cached frontend. So the fix probably has to either keep the check out of what gets cached or add the wave size to the key.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6262034241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6262034241). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-19T07:29:10Z. --- @Capmare about the separate local fix in your details block (wave size 0 passed to the call analysis): current `main` still has it. [`Recompiler.cpp` L164](https://github.com/boykopovar/AnyPS5/blob/6b8228b2b/core/shader/recompiler/Recompiler.cpp#L164) builds the frontend's `SwappcInfo` with `0u`, while the driver's `LinkUserDataCallees` passes `request.context.waveSize` ([`ShaderRegistry.cpp` L691](https://github.com/boykopovar/AnyPS5/blob/6b8228b2b/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp#L691)). With 0, a VOPC or VOP3 mask write counts as one SGPR and a `v_cndmask` mask read as two. So in wave64 a `v_cmp_e64` that reuses a link pair after the return, followed by a `v_cndmask_b32_e64` reading it, is refused, which matches what you describe. Are you planning to open a PR for it? If not, I'm happy to. Either way, the exact refusal line from your Wolverine run would help, with the shader address, the two program counters and the header's wave size, since reviewers ask for a title log line. One thing to watch: the frontend cache (`Matches`, L143) doesn't key on wave size, and the frontend-reuse test in `ShaderMemory.cpp` expects a variant that differs only in wave size to reuse the cached frontend. So the fix probably has to either keep the check out of what gets cached or add the wave size to the key. AI-assisted: yes (Claude Code)
Capmare commented 2026-10-19 08:45:33 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Capmare on 2026-10-19T08:45:33Z.


@SandstromPL thank you, your analysis matches what I see. I opened it as #7816.

The change passes request.context.waveSize to the frontend's SwappcInfo and adds the wave size to PreparedControlFlow::Matches, as you suggested. The frontend-pair test treated the wave size as translation-only state, so two of its checks now expect a different wave size to miss.

The refusal line from the Wolverine run and the request header (wave64, 816 code words, 16 user data) are in the PR description, with the new test that gives the same refusal without the change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263301974 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6263301974). Originally posted by [Capmare](https://github.com/Capmare) on 2026-10-19T08:45:33Z. --- @SandstromPL thank you, your analysis matches what I see. I opened it as #7816. The change passes `request.context.waveSize` to the frontend's `SwappcInfo` and adds the wave size to `PreparedControlFlow::Matches`, as you suggested. The frontend-pair test treated the wave size as translation-only state, so two of its checks now expect a different wave size to miss. The refusal line from the Wolverine run and the request header (wave64, 816 code words, 16 user data) are in the PR description, with the new test that gives the same refusal without the change.
frankea commented 2026-10-21 17:41:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-21T17:41:22Z.


Gran Turismo 7 (PPSA01317, 01.710.000) loads its World Map through 29 compute shaders that stop on this refusal. They are variants of one material template that calls its material functions through a table. 28 have a record → pointer → pointer → T# chain where the pointer from the record is merged with Ballot words. One has a different shape: the record table's V# is carried around the loop, and the called functions overwrite it.

Setup: Windows 11, RTX 4090 (NVIDIA 616.92), WinLibs GCC 15.2, Release. Local integration branch on main f894ba69d with #9020, #7978, #7243, #7256 and #7550 merged, plus #9068 (without it, 0x120aed7f00's callees don't fit s_call_b64 range). I logged and skipped each refused dispatch with a local switch, so one run lists all 29. Replayed offline with agc_shader_replay, 0x120aec1a00 and 0x120aed7f00 fail the same way.

The common shape (28 shaders, e.g. compute 0x120aec1a00)

GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00002404(GetAddressResource(LoadAddressU32@pc=0x000020ec(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00000160(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)), CompositeExtractU32x4(Ballot(LogicalAnd), Immediate)), ReadConstBuffer@pc=0x00000160(GetBufferResource(ReadConst(GetSrtResource, Immediate), …), ShiftLeftLogical32(ReadFirstLane(SelectU32, Phi), Immediate))), …
key     = v_readfirstlane of a per-lane material id, waterfall loop at pc 0x14c .. 0x18c
record  = s_buffer_load_dwordx4 s[16:19], SRT V# s[96:99], key << 4     pc 0x160
call    = record dwords 0-1 -> s[14:15], s_swappc_b64 s[14:15], s[14:15]; dwords 2-3 -> s[16:17], the callee's argument
pointer = s_load_dwordx2 s[20:21], s[16:17] + 0x0                       callee pc 0x20ec (linked copy)
T#      = s_load_dwordx8 s[56:63], pointer + 0x340                      callee pc 0x2404, the pointer kept through v30 lanes
  • 21 of the 28 stop at exactly these pcs (0x160 → 0x20ec → 0x2404). The other 7 are the same chain shifted by up to 0x60.
  • The callee pcs are in the linked program, since the table's 34 functions are linked into the caller at dispatch.
  • The record's V# comes from the SRT. Its pointer words are a Phi of the record read under the first key, the record read under the waterfall's later keys, and a Ballot lane-mask word.
  • Then come two loads: a pointer through the record's pointer, and the T# at +0x340 through that.
  • By their descriptions, #6232 (merged) follows pointer hops from a record, and #8939 takes lane-mask arms in a record pointer. This chain needs both on the same pointer. The request still refuses with the same chain on the GT7 branch + #8939's head, which carries #7395 and #7223.

The odd one (compute 0x120aed7f00)

GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x000019a0(GetAddressResource(LoadAddressU32@pc=0x0000198c(GetAddressResource(ReadConstBuffer@pc=0x00000ac8(GetBufferResource(Phi(Phi(Phi, Phi), Phi(Phi, Phi)), …), ShiftLeftLogical32(IAdd32(ReadLane(WriteLane, Immediate), IMul32(ReadLane, IAdd32)), Immediate)), …
table V#  = s_load_dwordx4 s[84:87], user data s[0:1] + 0x140          pc 0x6c8, once, before the loop
loop      = pc 0x994 .. 0xb4c (back edge at 0xb4c), exit when s93 < 0 (pc 0xb30)
record    = s_buffer_load_dwordx4 s[4:7], s[84:87], key << 4          pc 0xac8, key from SGPRs spilled to v27 lanes
call      = s_swappc_b64 to record dwords 0-1; dwords 2-3 -> s[16:17], the callee's argument   pc 0xae4
pointer   = s_load_dwordx4 s[68:71], s[16:17] + 0x8                    callee 0x126bc72800 + 0x50
T#s       = s_load_dwordx16 s[36:51], s[68:69] + 0x80                  callee + 0x64
  • At 0xac8, s[84:87] is a Phi at the loop header. One arm is the 0x6c8 load. The others are whatever s[84:87] holds after a callee returns.
  • 21 of its 34 callees write some of s84–s87: exec copies, s_movk_i32/s_bfm_b32 constants, counters, and loads such as s_load_dwordx8 s[84:91] from the record the argument points to.
  • 11 write s92/s93, which the exit test reads, and 31 write v27, which the caller reads back after the call.
  • So unlike every chain above, there is no fixed SRT V# for the record table.
  • The code alone doesn't tell me whether the console runs a second pass after a callee has overwritten s[84:87], or whether the title restores them in a way the linked copies don't show.
  • One way to take it would be to plan the table from the Phi's entry arm and fault, as #8077's DescriptorFault does, when a later pass reads through another V#.

I'm not attaching the requests, since they contain the title's shader code. A replay takes under a minute, so I can run any branch against all 29 and post which ones clear. I can also evaluate a chain against the dispatch's user data and guest memory if a fixture needs runtime values.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6322547617 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/6191#issuecomment-6322547617). Originally posted by [frankea](https://github.com/frankea) on 2026-10-21T17:41:22Z. --- Gran Turismo 7 (PPSA01317, 01.710.000) loads its World Map through 29 compute shaders that stop on this refusal. They are variants of one material template that calls its material functions through a table. 28 have a record → pointer → pointer → T# chain where the pointer from the record is merged with `Ballot` words. One has a different shape: the record table's V# is carried around the loop, and the called functions overwrite it. **Setup:** Windows 11, RTX 4090 (NVIDIA 616.92), WinLibs GCC 15.2, Release. Local integration branch on `main` f894ba69d with #9020, #7978, #7243, #7256 and #7550 merged, plus #9068 (without it, `0x120aed7f00`'s callees don't fit `s_call_b64` range). I logged and skipped each refused dispatch with a local switch, so one run lists all 29. Replayed offline with `agc_shader_replay`, `0x120aec1a00` and `0x120aed7f00` fail the same way. ### The common shape (28 shaders, e.g. compute `0x120aec1a00`) ``` GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00002404(GetAddressResource(LoadAddressU32@pc=0x000020ec(GetAddressResource(Phi(Phi(ReadConstBuffer@pc=0x00000160(GetBufferResource(ReadConst, ReadConst, ReadConst, ReadConst), ShiftLeftLogical32(ReadFirstLane, Immediate)), CompositeExtractU32x4(Ballot(LogicalAnd), Immediate)), ReadConstBuffer@pc=0x00000160(GetBufferResource(ReadConst(GetSrtResource, Immediate), …), ShiftLeftLogical32(ReadFirstLane(SelectU32, Phi), Immediate))), … ``` ``` key = v_readfirstlane of a per-lane material id, waterfall loop at pc 0x14c .. 0x18c record = s_buffer_load_dwordx4 s[16:19], SRT V# s[96:99], key << 4 pc 0x160 call = record dwords 0-1 -> s[14:15], s_swappc_b64 s[14:15], s[14:15]; dwords 2-3 -> s[16:17], the callee's argument pointer = s_load_dwordx2 s[20:21], s[16:17] + 0x0 callee pc 0x20ec (linked copy) T# = s_load_dwordx8 s[56:63], pointer + 0x340 callee pc 0x2404, the pointer kept through v30 lanes ``` - 21 of the 28 stop at exactly these pcs (0x160 → 0x20ec → 0x2404). The other 7 are the same chain shifted by up to 0x60. - The callee pcs are in the linked program, since the table's 34 functions are linked into the caller at dispatch. - The record's V# comes from the SRT. Its pointer words are a Phi of the record read under the first key, the record read under the waterfall's later keys, and a `Ballot` lane-mask word. - Then come two loads: a pointer through the record's pointer, and the T# at +0x340 through that. - By their descriptions, #6232 (merged) follows pointer hops from a record, and #8939 takes lane-mask arms in a record pointer. This chain needs both on the same pointer. The request still refuses with the same chain on the GT7 branch + #8939's head, which carries #7395 and #7223. ### The odd one (compute `0x120aed7f00`) ``` GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x000019a0(GetAddressResource(LoadAddressU32@pc=0x0000198c(GetAddressResource(ReadConstBuffer@pc=0x00000ac8(GetBufferResource(Phi(Phi(Phi, Phi), Phi(Phi, Phi)), …), ShiftLeftLogical32(IAdd32(ReadLane(WriteLane, Immediate), IMul32(ReadLane, IAdd32)), Immediate)), … ``` ``` table V# = s_load_dwordx4 s[84:87], user data s[0:1] + 0x140 pc 0x6c8, once, before the loop loop = pc 0x994 .. 0xb4c (back edge at 0xb4c), exit when s93 < 0 (pc 0xb30) record = s_buffer_load_dwordx4 s[4:7], s[84:87], key << 4 pc 0xac8, key from SGPRs spilled to v27 lanes call = s_swappc_b64 to record dwords 0-1; dwords 2-3 -> s[16:17], the callee's argument pc 0xae4 pointer = s_load_dwordx4 s[68:71], s[16:17] + 0x8 callee 0x126bc72800 + 0x50 T#s = s_load_dwordx16 s[36:51], s[68:69] + 0x80 callee + 0x64 ``` - At 0xac8, s[84:87] is a Phi at the loop header. One arm is the 0x6c8 load. The others are whatever s[84:87] holds after a callee returns. - 21 of its 34 callees write some of s84–s87: exec copies, `s_movk_i32`/`s_bfm_b32` constants, counters, and loads such as `s_load_dwordx8 s[84:91]` from the record the argument points to. - 11 write s92/s93, which the exit test reads, and 31 write v27, which the caller reads back after the call. - So unlike every chain above, there is no fixed SRT V# for the record table. - The code alone doesn't tell me whether the console runs a second pass after a callee has overwritten s[84:87], or whether the title restores them in a way the linked copies don't show. - One way to take it would be to plan the table from the Phi's entry arm and fault, as #8077's `DescriptorFault` does, when a later pass reads through another V#. I'm not attaching the requests, since they contain the title's shader code. A replay takes under a minute, so I can run any branch against all 29 and post which ones clear. I can also evaluate a chain against the dispatch's user data and guest memory if a fixture needs runtime values. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
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#6191
No description provided.