Skip to content

fix(shader): take lane-mask arms and a merged high word in a pointer-keyed record pointer - #8939

Open
EagleBearerYS wants to merge 40 commits into
boykopovar:mainfrom
EagleBearerYS:fix/shader-pointer-key-lane-masks
Open

EagleBearerYS wants to merge 40 commits into
boykopovar:mainfrom
EagleBearerYS:fix/shader-pointer-key-lane-masks

Conversation

@EagleBearerYS

@EagleBearerYS EagleBearerYS commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Depends on: #7395. #7223, which #7395 was stacked on, has merged. Until #7395 merges, this PR's diff shows its commits too.

#7395 lets a T# or S# be read through a pointer that a scalar-buffer record holds, with the pointer's low word merged by Phis with constants, lone Ballot words and copies of the record word. Two titles' chains refused on the pointer's words:

  • Little Nightmares Enhanced Edition (PPSA10737), run by klosixgaming-arch (comment). Windows 11, RTX 5090, version 01.004.000, on feat(shader): read samplers through nested and pointer-keyed descriptor tables #7395's head of 2026-10-19 plus fix(shader): link a table call whose descriptor load sits before its loop #7413; it stops 2 min 46 s in:
    [dispatch] failed: compute shader 0x2010fa0000, stage 0: ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value (value=LoadAddressU32[…] … GetAddressResource@pc=0x3384(arg0=Phi(arg0=Phi(arg0=Phi(arg0=BitwiseAnd32@pc=0x1600(arg0=CompositeExtractU32x4@pc=0x15d4(arg0=Ballot@pc=0x15d4(…)), arg1=imm=0x0), arg1=BitwiseNot32@pc=0x15fc(…)) …
    
    One arm of the low word is the waterfall loop's Ballot mask ANDed with the NOT of the loop's lane bit, the s_andn2 that clears the current lane.
  • Ratchet & Clank: Rift Apart (PPSA01474), run by ps54all (comment), on main 82f0c9a plus open PRs and feat(shader): read samplers through nested and pointer-keyed descriptor tables #7395's earlier commits:
    compute shader 0x116bb67000: … GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x00009a30(GetAddressResource(Phi(… BitwiseAnd32(…, CompositeExtractU32x4(Ballot(Immediate), Immediate))) …
    
    A Ballot word is ANDed into the low word, and the high word is merged through a Phi. One arm of that Phi reads a second buffer, and on that edge the low word is a lane mask: the waterfall loop reusing the SGPR pair, as oneandonlydean read it from the IR (comment).

Ratchet & Clank: Rift Apart (PPSA01474), 11-13: this PR got the title past its 0x9a30 stop on retail in Tamalero's run (see Tested); the next stop, 0x10b84, was #9633's. On current main the title doesn't stop there. #14636 removed the title's pc=0x62d4 GetSamplerResource refusal: with #14636's merge reverted, main f57c971 aborts on it again (dantdmdarealguy's run). Tamalero's run of main 4e2acc2 with #18522, on RADV with APS5_MAX_COMPUTE_SPIRV_WORDS=2000000 and APS5_SKIP_REFUSED_DISPATCHES=1 (which skips and logs any compute shader whose recompile fails, code), reaches the first gameplay; the only shaders it skipped were two dropped for size (comment). main still refuses this PR's shapes: on main 7201da4, which has #14636, four of this PR's five tests fail 3 of 3 with #7395 merged and this PR's code left out, and pass 3 of 3 with this PR merged (llvmpipe, a cloud Linux machine). The fifth, agc_driver_pointer_vsharp_select_table, passes either way, as before (see Tested).

The change, in ResourceTracker.cpp, for pointer-keyed columns only:

  1. fix(shader): take lane-mask ANDs and a high-word Phi in a pointer-keyed record pointer.
    • Lane-mask ANDs. An AND with a lane-mask operand is taken. A lane-mask operand is a Ballot word, or an AND or Phi made only of those and immediates. The other operand is walked on, so a record read in it must still match the column. An AND with no lane-mask operand still refuses.
    • A merged high word. The high word now goes through the same walk as the low word. Its record reads must be reads of the same column at the low word's offset + 4. When it has no single dominating read, the table comes from the first record read whose V# words dominate the descriptor load. If none does, the column is refused.
    • A high-word arm read from a second buffer (a V# loaded through a pointer, then read at offset 0) stays refused, since it isn't a read of the record. Ratchet & Clank's chain has such an arm too (Tamalero's data on #6191). The fourth commit takes it where its edge's low word is a lane mask.
  2. fix(shader): skip lane-mask arms built from a waterfall's lane bit in a pointer-keyed record pointer.
    • A lane-mask operand also takes the loop's lane bit, ShiftLeftLogical32(1, index), and ORs and NOTs of lane-mask operands.
      • The index can come from FindILsb32, FindUMsb32 or ReadFirstLane, through BitwiseAnd32, IAdd32, ISub32, immediates and the arms of SelectU32.
      • That covers s_ff1_i32_b32, s_ff1_i32_b64, s_bitset0_b32 and the shift's own AND 31.
    • An arm made only of lane-mask operands is skipped. Little Nightmares' arm is one.
  3. docs(shader): the image-table debt entry lists the new arms and the merged high word, and says that a high word read from a second buffer stays refused.
  4. fix(shader): pair a pointer-keyed record pointer's two words by Phi edge, from oneandonlydean's reading of Ratchet & Clank: Rift Apart's IR (comment).
    • The low and high words are walked together. Where both are Phis of one block, each low-word edge takes the high word that arrives from the same predecessor.
    • An edge whose low word is an immediate or a lane mask is skipped with its high word. Rift Apart's second-buffer high word reaches the load only on such an edge, as oneandonlydean read it, so the walk no longer refuses that edge.
    • A record low word still needs every high word it can meet to be an immediate, a lane mask or the same column at offset + 4. A second-buffer high word paired with the record's low word still refuses.
    • One shape that planned before now refuses: both Phis in one block, with the record's low word on one edge (its high word an immediate) and the record's high word on another (its low word a lane mask). No edge carries a whole record pointer, so its old plan could only fault at run time.
  5. docs(shader): the debt entry says the two words are walked edge by edge, and that a second-buffer high word stays refused on an edge whose low word is the record word.
  6. fix(shader): refuse a pointer-keyed record arm whose two words are both immediates (9e50a74). Where the pointer's two words are Phis of one block, an edge on which both are immediates is a constant pointer that no record holds, such as a null pointer, so the walk refuses the column there instead of planning it.

At run time, a pointer built from a lane mask faults as outside the snapshot, as #7395's lane-mask arms do.

Disk cache: no plan field changes. This PR still takes its own number on the stack's format ladder, 94 (see Tested). main is at 88 since Pipodi's #18455. Ours take one number each: #7642 62 (a draft, held; it takes a free number at its refresh), #7395 93, #8939 94, #9457 95, #9633 96, #9749 97, #9790 98 and #9969 99. The other open PRs changing it hold 89 (#14871, #19852, #21199 and #21240), 90 (#6416, and #16812 and #16814, both stacked on #9969), 91 (#10351) and 92 (#14853), and the rest hold numbers at or below main's, from a check of every open PR's head on 11-16. Whichever lands second on a number takes the next free one.

  • A shader that planned before plans the same column, apart from the fourth commit's one newly refused shape and the sixth commit's constant-pointer edge.
  • Shapes that refused before now plan. A refusal is never cached.

Overlap:

Marvel's Spider-Man 2 (PPSA08338), run by spiff637 (comment), stops on a record → pointer → V# → T# chain keyed by ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi)). The second commit's agc_driver_pointer_vsharp_select_table builds a record → pointer → V# → T# chain with the T# read under a second key, and it passes without this PR's tracker changes. The title doesn't take it yet: hugodearaujo's run of the US release, Marvel's Spider-Man 2 (PPSA03016), still stops on the #6191 chain with this PR and #7679 (comment). There the T# is read at a fixed offset of the pointer-loaded V#, with no second key, and the same shader then reads its next block through a linked pointer. The test stays as coverage of the keyed form. ycbuzi's Windows run (RTX 4070 SUPER) stops on the same chain, at pc=0x84bc, with this PR's earlier head 95c2a47 and without it (comment).

Tested

Checklist

…ed record pointer

A T# loaded through a record pointer was still refused with "GetImageResource
dword 0 is not a valid runtime value" when the pointer's low word passed
ANDs with lane masks, as a waterfall loop that copies EXEC into the
pointer's SGPR builds them, or when its high word was a Phi of the
record's high word read under several keys.

For a pointer-keyed column, the walk of the low word now takes an AND
with a lane-mask operand (a Ballot word, or an AND or Phi of only Ballot
words and immediates) and keeps walking its other operand, so its
record reads must still match the column and anything else still
refuses. The high word is walked the same way: its record reads must
be the record word at the low word's offset plus 4. A high word that is
one read still gives the column its table and record offset, as before.
Otherwise the table comes from a record read whose V# words are defined
before the descriptor load, and the record offset from the high word,
which the GPU does not read for a pointer-keyed column.

A high-word arm read from another buffer, such as one whose V# is
loaded through a pointer, stays refused. A shader that planned before
plans the same way, so the disk-cache format does not change.
… a pointer-keyed record pointer

A T# loaded through a record pointer was still refused with "GetImageResource
dword 0 is not a valid runtime value" when a Phi of the pointer's low word
merged the record read, a zero, and the waterfall's lane mask with the
handled lane's bit cleared, BitwiseAnd32(CompositeExtractU32x4(Ballot(...), 0),
BitwiseNot32(ShiftLeftLogical32(1, index))), as s_ff1, s_lshl and s_not with
s_and, or s_andn2, build it in the SGPR the pointer reuses. The walk took only
Ballot words and ANDs of them as lane masks, so it walked into the NOT and
refused.

A lane-mask operand is now a Ballot word or the loop's lane bit, a shift of 1
by an index from FindILsb32, FindUMsb32 or ReadFirstLane (through the AND,
add, subtract and select that s_ff1_i32_b64, s_bitset0 and the shift's own
mask put around it), or an AND, OR, NOT or Phi of only those and immediates.
An arm of the pointer that is entirely such an operand is skipped. An AND
with a record read in it still has the read matched against the column, and
anything else still refuses.

agc_driver_pointer_phi_lane_not_table builds that shape in a wave64
waterfall: the low word's Phis merge the record read at +0, a zero and the
lane mask without the handled lane's bit, cleared by s_not and s_and and by
s_andn2, and the high word is one read at +4. Each lane samples the T# of its
record, and every masked word faults outside the snapshot.
agc_driver_pointer_vsharp_select_table reads a record keyed by
ReadFirstLane(SelectU32(LogicalAnd, IAdd32, Phi)), a pointer from it, a V#
through the pointer and the T# through the V#; it passes without this change
and keeps that chain checked, including a record pointer moved to the other
V# without a recompile.

Shaders that planned before plan the same way, and a refusal is never cached,
so the disk-cache format does not change.
…keyed records

A pointer-keyed record pointer now also takes lane-mask ANDs, the
waterfall loop's lane bit and its OR and NOT forms, and a high word
merged from the record's next word. A high word read from a second buffer
stays refused.
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 10351 core/shader/recompiler/ShaderDiskCache.hpp L16
PR 19564 core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_tests.cmake L11, L13
core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp L379, L2412
PR 22602 core/shader/recompiler/ShaderDiskCache.hpp L16
PR 22628 core/shader/recompiler/ShaderDiskCache.hpp L16
PR 22690 core/shader/recompiler/ShaderDiskCache.hpp L16
PR 22692 core/shader/recompiler/ShaderDiskCache.hpp L16
PR 22703 core/shader/recompiler/ShaderDiskCache.hpp L16
PR 23244 core/shader/recompiler/ShaderDiskCache.hpp L16

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5371 docs/dev/debt/shader.md
PR 5925 core/shader/recompiler/ShaderDiskCache.hpp
PR 6235 docs/dev/debt/shader.md
PR 6280 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 6412 core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 6481 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 6488 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 6924 core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 7085 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 7392 docs/dev/debt/shader.md
PR 7684 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 9356 core/shader/recompiler/ShaderDiskCache.hpp
PR 9387 core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 9508 core/shader/recompiler/ShaderDiskCache.hpp
PR 9852 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 9897 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 10193 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 10652 docs/dev/debt/shader.md
PR 11483 docs/dev/debt/shader.md
PR 11551 core/shader/recompiler/ShaderDiskCache.hpp
PR 12944 core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 13928 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 13929 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 14032 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 14871 core/shader/recompiler/ShaderDiskCache.hpp
docs/dev/debt/shader.md
PR 14944 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 16260 core/shader/recompiler/ShaderDiskCache.hpp
PR 16571 docs/dev/debt/shader.md
PR 17056 core/shader/recompiler/ShaderDiskCache.hpp
PR 18185 core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp
PR 20248 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
PR 23242 core/shader/recompiler/Optimization/src/ResourceTracker.cpp
core/shader/recompiler/ShaderDiskCache.hpp
PR 25010 core/shader/recompiler/ShaderDiskCache.hpp

@github-actions github-actions Bot added build shader core/shader docs agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 21, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@EagleBearerYS thanks for #8939. We ran PPSA01474 on main plus #7395 and #8939 (f877d5e; the pointer walk is the same at e9d4626) and dumped the IR of the shader that stops. It still stops at LoadAddressU32@pc=0x9a30 with GetImageResource dword 0 is not a valid runtime value. Its address changes from run to run (0x116bb5d300, 0x116bb66700, 0x116bb5c500 and 0x116bb5c900 are the same program).

The IR shows which check refuses it, and why that arm isn't a pointer:

  • The descriptor at 0x9a30 is loaded through GetAddressResource(low, high), and both words are Phis that merge at pc 0x5a48.
  • Low word: immediates, lane masks, and the record column read at pc 0x1aa8. Your lane-mask handling accepts all of these.
  • High word: the same record column's high word, plus one arm from the second buffer (ReadConstBuffer at offset 0 of a buffer whose V# is loaded through the record pointer, pc 0x900c/0x908c). PointerRecordReads refuses that arm on the high-word walk, because it isn't the same record column.
  • Pairing the Phi edges: the second-buffer high word reaches the load on exactly one incoming edge. On that edge the low word is BitwiseAnd32(Phi(lane masks), CompositeExtractU32x4(Ballot(true), 0)), a pure lane mask. Every edge that carries a record-column low word carries the record-column high word.

So on the one path where the high word comes from the second buffer, the "pointer" is (a lane mask, a T#-table dword). That's the SGPR pair being reused by the waterfall loop, not an address. Tamalero's dump on #6191 (issuecomment-6255548496) agrees: the record's high word is 0x00000012 in all 27,396 populated records, and no dword of that T# table equals 0x12.

Could the walk pair the two words by incoming edge? Concretely:

  1. Walk the low- and high-word Phis together, edge by edge.
  2. On an edge where the low word is lane-mask-only (or an immediate), skip both words, as the low-word walk already skips lane-mask arms on its own.
  3. Refuse as now on any edge that pairs a record-column low word with a high word from anywhere other than the same column at offset + 4.
  4. agc_driver_pointer_phi_high_second_table keeps refusing when the second-buffer high word is paired with a record-column low word. A new case pairs it with a lane-mask low word, which should plan, and its record lanes should sample the T# their record selects.

This decides it at plan time from the IR alone, with no run-time fault path and no new plan field. If you'd rather keep the walks separate, a run-time fault for pointers built from that arm (as lane-mask pointers already do) would also work for us. We can share the IR excerpt around 0x9a30, and we're happy to run the title on the result.

The low and high words of a pointer-keyed record pointer were walked
separately, so a high-word arm on a path whose low word is a lane mask
refused the plan even though that pair is no pointer. Ratchet & Clank:
Rift Apart (PPSA01474) stops this way at LoadAddressU32@pc=0x9a30: one
high-word arm reads a second buffer, and on that edge the low word is a
lane mask, the waterfall loop reusing the SGPR pair.

Walk the two words together. Where both are Phis of one block, each
low-word edge takes the high word of the same predecessor. An edge whose
low word is a constant or a lane mask is skipped with its high word. A
record low word still needs every high word it can meet to be a constant,
a lane mask or the same record column at offset + 4, so a second-buffer
high word paired with the record word stays refused.

agc_driver_pointer_phi_high_second_lane_table adds the lane-mask low word
to the second-buffer arm: it plans, each group samples the T# its record
selects, and that arm faults outside the snapshot.
…nter

The two words of the pointer are now walked edge by edge, and an edge
whose low word is a constant or a lane mask is skipped with its high
word. A high word read from a second buffer stays refused on an edge
whose low word is the record word.
@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@oneandonlydean, thank you for reading the IR this closely. The edge-by-edge pairing is the better fix, so I've written it as you describe, with both cases: agc_driver_pointer_phi_high_second_table keeps refusing the second-buffer high word paired with the record-column low word, and a new case pairs it with a lane-mask low word and checks that it plans and that each record lane samples the T# its record selects. It's on GitHub's runners now. I'll post here once it's pushed to this branch, so you can run Ratchet & Clank: Rift Apart (PPSA01474) on it.

EagleBearerYS added a commit to EagleBearerYS/AnyPS5 that referenced this pull request Oct 21, 2026
@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@oneandonlydean, thank you for the IR dump and the steps. a7d1e62 on this branch pairs the two words as you describe:

  1. PointerRecordPairs walks the low- and high-word Phis together. Where both are Phis of one block, each low-word edge takes the high word that arrives from the same predecessor. A word that is no Phi there stays the same on every edge.
  2. An edge whose low word is an immediate or a lane mask is skipped with its high word.
  3. A record-column low word still needs every high word it can meet to be an immediate, a lane mask, or the same record column at offset + 4. Anything else refuses, as before.
  4. agc_driver_pointer_phi_high_second_table still refuses its second-buffer high word, which it pairs with a record-column low word. The new agc_driver_pointer_phi_high_second_lane_table is the same shader with s_mov_b32 s44, exec_lo added to the second-buffer arm. That read is BitwiseAnd32(exec_lo, CompositeExtractU32x4(Ballot(true), 0)) in the IR, the form you list. It plans, each group's lanes sample the T# their record selects, and that arm faults outside the snapshot when a group takes it.

There's no new plan field and no new run-time path.

Tested on GitHub's runners, on main b6fe513 (run 39613056959):

  • Linux (lavapipe): the 12 image-table cases, including both pointer_phi_high_second cases, plus agc_shader_disk_cache_large_file, 5 runs each, all pass.
  • Windows: builds; the Vulkan cases skip on the runner.
  • Linux ^agc (run 39613110357): 873 of 874 pass, 60 skip. The one failure is agc_driver_sgpr_pattern_fill_keys, a timing test, which passed in the full run of the same head below.
  • Linux with CI's flags on a separate machine:
    • the 11 image-table cases, 20 of 20 each;
    • red: with only ResourceTracker.cpp from e9d4626, the new case fails with "GetImageResource dword 0 is not a valid runtime value", and agc_driver_pointer_phi_high_second_table still refuses as before;
    • the full ctest: 1807 of 1813. The six failures are network tests that depend on that machine (no IPv6, and its socket buffers); the five beyond its known IPv6 failure fail the same way on e9d4626.

One shape that planned before is now refused. Both Phis are in one block, one edge carries the record's low word with an immediate high word, and the other carries a lane mask with the record's high word. No edge carries a whole record pointer, so the old plan could only fault at run time there. If you'd rather keep it planned, falling back to the old separate high-word walk when the paired walk finds no high read keeps it as before.

Could you run Ratchet & Clank: Rift Apart (PPSA01474) on a7d1e62? If it stops again, the IR excerpt around the new stop would help.

@Tamalero

Copy link
Copy Markdown
Contributor

Retail check of a7d1e62 on Ratchet & Clank: Rift Apart (PPSA01474, 01.005.003), Linux, RTX 4090 (NVIDIA 615.78.08), cold shader cache, one unattended run per build:

Build Result
#7395 head 6c1371b (contains #7223 8716815 and main b6fe513) 275 s, stops on compute 0x116bb67500: GetImageResource dword 0, LoadAddressU32@pc=0x9a30, the stop you dumped
this PR, a7d1e62 270 s, gets past 0x9a30 and stops on a different shader, compute 0x116bb5ad00: GetImageResource dword 0, LoadAddressU32@pc=0x10b84

The new chain has the same overall shape one level deeper. The low word is a Phi of the record read at pc=0xfd94 and a Ballot lane-mask word (CompositeExtractU32x4). The high word arm is ReadConstBuffer@pc=0x10350 through a V# whose four dwords are loaded at pc=0x10338 from another pointer:

LoadAddressU32@pc=0x00010b84(GetAddressResource(Phi(...ReadConstBuffer@pc=0x0000fd94(GetBufferResource, Immediate)..., CompositeExtractU32x4...),
  Phi(...ReadConstBuffer@pc=0x0000fd94..., ReadConstBuffer@pc=0x00010350(GetBufferResource(LoadAddressU32@pc=0x00010338(GetAddressResource, Immediate, Immediate, Immediate) x4), Immediate))), ...)

So a7d1e62 fixes the 0x9a30 stop on the retail title. No regression up to the new stop. I can dump this shader's IR or the runtime values of the pc=0x10338/0x10350 reads if that helps.

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

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Tamalero, thank you for the retail run. It's now in the description: this PR gets Ratchet & Clank: Rift Apart (PPSA01474) past the 0x9a30 stop.

We'd like to look at the 0x10b84 stop next. If you have time, the IR dump would help most:

  • Run with APS5_DUMP_IR=116bb5ad00: the shader's code address, in lowercase hex without 0x.
  • It prints ==== IR 0x116bb5ad00 after <pass> blocks to stderr. Only the last block before the stop is needed.
  • The address can change from run to run (dean saw this PR's first stop at several, comment). If the stop names another address, use that one.
  • That run skips the shader disk cache's plans, which is expected.

If it's easy, the runtime values would help too: on the dispatch that stops, the dword the pc=0x10350 read returns, and the record's high word, the dword after the pc=0xfd94 read.

We'll read the dump before saying what the fix is.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
…ane-masks

Brings boykopovar#7395's merge of main bd4d801, with boykopovar#8991. It merged without conflicts.
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@hugodearaujo

Copy link
Copy Markdown
Contributor

Marvel's Spider-Man 2 (PPSA03016 01.004.003, the US release of spiff637's PPSA08338) still stops on the #6191 chain with this PR, so #7395 with #7223 doesn't take this title's shape yet.

Build Stop
main 0c6a5bd 151 s, INDEX_BUFFER_SIZE has not been set (the stop #7679 fixes)
main + #7679 142 s and 146 s (two runs), compute 0x11e2b44c00 / 0x11e2b34400: GetImageResource dword 0 is not a valid runtime value, ReadConstBuffer@pc=0x8560(GetBufferResource(LoadAddressU32@pc=0x854c(GetAddressResource(ReadConstBuffer@pc=0x1fc4, …
this PR a7d1e62 + #7679 137 s in both runs, compute 0x11e2b37100 / 0x11e2b39b00, the same chain

Linux 7.2.11, RX 9070 XT, RADV Mesa 26.2.5, Release. One run on main.

The shape. agc_shader_replay on the .prepare.req that APS5_DUMP_SHADERS=1 wrote reproduces the refusal offline. The _failed.req doesn't, since it lacks the linked callee.

  • pc 0x1fc4: a waterfall loop reads a 16-byte record from an SRT V#, keyed by ReadFirstLane(…) << 4. Dwords 0–1 are a callee address (the linked s_swappc_b64 targets). Dwords 2–3 are an argument pointer.
  • pc 0x854c, in the callee: a V# is loaded at the argument pointer + an immediate.
  • pc 0x8560: the T# is read at a fixed offset of that buffer, ReadConstBuffer(V#, 0x0). There is no second key.
  • TryMakeTableColumn refuses before it reaches the nested path, because MatchAffineOffset fails on the immediate offset. agc_driver_pointer_vsharp_select_table reads its T# under a second key, which is why that fixture passes.

A local change for that part. A fixed offset under a pointer-loaded V# becomes a one-key child: key 0, stride the descriptor size, addend the immediate. It applies only on the nested path; a fixed offset under a runtime V# still refuses as before.

  • The replay gets past 0x8560.
  • agc_driver_image_table and the 13 nested and pointer image-table tests pass on the RX 9070 XT.
  • The diff is below.
diff on a7d1e62
@@ -660,7 +660,13 @@
         if (address && immediateU32(offset, descriptorOffset)) {
             return TryMakeIndirectColumn(handle, *heapHandle, sampler, words, descriptorOffset, first, plan);
         }
-        if (!MatchAffineOffset(offset, key, stride, addend)) {
+        std::uint32_t fixedOffset = 0;
+        const bool fixed = !address && !buffer && immediateU32(offset, fixedOffset);
+        if (fixed) {
+            key = &m_builder.Constant(0u);
+            stride = width * static_cast<std::uint32_t>(sizeof(std::uint32_t));
+            addend = fixedOffset;
+        } else if (!MatchAffineOffset(offset, key, stride, addend)) {
             if (!MatchMaskedOffset(offset, key, stride)) {
                 return false;
             }
@@ -668,7 +674,9 @@
         }
         DescriptorSource heapSource;
         std::uint32_t heapIndex = 0;
-        if (!MakeRuntimeSource(*heapHandle, address ? IrOpcode::GetAddressResource : IrOpcode::GetBufferResource, address ? 2u : 4u, heapIndex, heapSource)) {
+        if (MakeRuntimeSource(*heapHandle, address ? IrOpcode::GetAddressResource : IrOpcode::GetBufferResource, address ? 2u : 4u, heapIndex, heapSource)) {
+            if (fixed) return false;
+        } else {

The next refusal, in the same shader (pc 0x8f54 and 0x8fa0):

  • The low word of the V#'s pointer is a Phi of two kinds of arm. Some arms are record reads under different keys (the loop's iterations). One arm is a dword the callee reads from the material buffer itself, ReadConstBuffer@pc=0x9000 at +0x4c0: a link to the next block.
  • The high word is a Phi of record reads too.
  • So PointerRecordReads refuses, because the arms aren't equivalent reads.
  • The V# also has a consumer besides the T# read: the link read. feat(shader): resolve nested image tables through runtime pointers #7223's shared-consumer check refuses that.

I haven't tried to take this second shape; how a linked pointer should be planned is your call. I can share the request file and the IR around 0x8f54.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@hugodearaujo, thank you for the runs and for tracing both refusals. Your fixed-offset change is right: a T# at a fixed offset of a V# loaded through the record pointer has one record (key 0, the descriptor size as stride, the immediate as addend), which the nested path already serves, and a fixed offset under a runtime V# still refuses as before.

We'd like to carry it as your own commit, with you as its author, in a new PR stacked on this one, together with tests of ours for that shape. If you'd rather open it yourself, say so and we'll leave it to you.

For the linked-pointer shape at 0x8f54 and 0x8fa0, the IR text around those reads would help. We don't need the request file, since it holds the title's shader code.

@Tamalero

Copy link
Copy Markdown
Contributor

@EagleBearerYS here's the IR reading for the 0x10b84 stop. The address changes per run (0x116bb5ad00, 0x116bb61300 and 0x116bb5c500 in three runs on a7d1e62), so I captured the failing request with APS5_DUMP_SHADERS=1 and dumped the IR offline with APS5_DUMP_IR through agc_shader_replay. That reproduces the refusal exactly. I traced the walk with temporary prints in a scratch copy of ResourceTracker.cpp.

Short version: the edge pairing works here. Every (low, high) pair the walk pops is consistent, and the case your PR still refuses (a record low word under a second-buffer high word) doesn't occur. The stop has a different cause: the pointer has three sources, and only the first is the record column.

  • R: the record pair ReadConstBuffer@0x1aa8, dwords 2/3 of the 16-byte record (offsets 8/0xc), stride 16 from ReadFirstLane(...) << 4. Accepted first; it fixes lowReads.
  • H1: ReadConstBuffer@0xfd94, offsets 0/4, where both words come from one read. Its V# is loaded at @0xfd88 from offsets 0x60..0x6c of a pointer that is itself a Phi of R.
  • H2: ReadConstBuffer@0x10350, offsets 0/4, again both words from one read. Its V# is loaded at @0x10338 from pointer+0x60, where the pointer is the Phi of R and H1.
  • Skipped as intended: the lane-mask (Ballot / BitwiseAnd32) and immediate low words (0xea, 0x3f400000, 0x40c00000), with their high words. There's one join where the low and high Phis sit in different blocks; the walk falls back to unpaired there.

H1 and H2 both fail PointerRecordRead (ResourceTracker.cpp:845, called from :871): offset 0 against the record's 8, and a different buffer, so SameRecordColumn fails. The walk then returns false and TryMakeIndirectColumn refuses.

So the shader chases the pointer conditionally, up to twice (P → V# at P+0x60 → dwords 0/1 → next P), and loads the T# at the final P+0. The final pointer is one of R, H(R) or H(H(R)). Since the column is pointer-keyed and the runtime looks the T# up by pointer value (LookupTablePointer), one way forward could be:

  • treat this chase as a hop source (V# at +0x60, read at +0), not a record column;
  • have the materializer add the closure pointers H(R) and H(H(R)) of every record pointer, each with its T# at P+0, bounded at depth 2 here.

The existing pointerHops don't fit as they are: they're unconditional, and a merged pointer refuses them. Forcing the two failures to continue (wrong, only to look further) plans with the R pointers alone and then stops on sampler resource limit exceeded, which may be the next wall after this one.

I haven't checked whether the H(R)/H(H(R)) targets fall inside the captured regions. I can run a values pass on this shader if that helps.

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

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Tamalero thanks, this is the reading we needed, and the replay through agc_shader_replay is a reproduction we can check a candidate against.

It's new work rather than something #9457 covers. #9457's hops follow unconditional chains of plain address loads, while here the descriptor pointer is a Phi of R, H(R) and H(H(R)), and each hop reads the next pointer through a V# at P+0x60. A chase-hop closure along the lines you describe is planned as a separate PR stacked on #9457, built and tested with a synthetic chase shader. The sampler resource limit exceeded you hit with the arms forced to continue stays out of scope unless it shows up with the real closure.

If you can run the values pass, three things would help:

  1. whether H(R) and H(H(R)) fall inside the captured regions, at each depth;
  2. how often each depth is taken at run time, i.e. whether the chase ever goes past R;
  3. at the sampler wall, how many sampler sources the plan had, and whether the S# handles come from the same pointer.

No need to send the capture itself. Once there's a candidate, a replay on your side is what we'd ask for.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — comments

Changes are not ready for a formal approval because I did not run the checks reported by the author, and one changed test file was excluded from the review bundle.

What I ran

Reviewed head b4a5b1a618ed89404bd05fc910337720844641b1 against the prepared diff. No commands or tests were run.

Results

Check Result Note
Diff and targeted source review passed Shader tracking and materialization paths inspected
Tests not run Test results in the PR description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

The full contents of core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp were excluded from the review bundle; its changed hunk was inspected through the reader. The complete changed test files were not read in full. Tests, builds, and physical-console behavior were not independently verified. Other changed files were reviewed through the diff and targeted source ranges.

To get this to a good state

Nothing is required.

@frankea

frankea commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

On an RTX 4090 (NVIDIA 621.14, Windows 11, MinGW build), this PR's head b4a5b1a fails two of its tests 3 of 3 times: agc_driver_pointer_phi_lane_and_table and agc_driver_pointer_phi_lane_not_table. Both report selected the descriptor at 0x0: unmapped where the tests expect the "outside the snapshot" fault. An earlier sub-case in agc_driver_pointer_phi_lane_and_table does fault as "outside the snapshot"; the failing check is the unmapped one at 0x0.
The same two fail the same way on #9457 (d896ff4), #9790 (aadbb73) and #9969 (20b045a), which carry this PR. main 328cbf6 passes the rest of the set (41 of 41). The rest of the pointer, image-table, nested, disk-cache and shader-memory tests pass, and a run under VK_LAYER_KHRONOS_validation shows no VUID- line.
AI-assisted: yes (Claude Code)

…pointer tables

agc_driver_pointer_phi_lane_and_table and
agc_driver_pointer_phi_lane_not_table pair arms whose low word can be 0
with the record pointer's high word: lane_not_table's zero arm, and
lane_and_table's lane-mask arm in the waterfall pass over lanes 32-63.
When the records sit below 4 GiB, the selected pointer is then 0x0,
which faults as unmapped, as a null pointer does in
agc_driver_pointer_phi_sampler_table.

The records are on the test's stack. Since boykopovar#18253, Windows test
executables link without high-entropy addresses, which keeps their
stacks near the bottom of the address space, and on a Windows RTX 4090
run both tests failed with "selected the descriptor at 0x0: unmapped".
Accept that fault only when the records' high word is 0; elsewhere
these arms still have to fault outside the snapshot.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 5eb49d189318c048e10d2848f769d58f2c215ccb. No commands or tests were run. Read the prepared description, commits, manifest, full diff, and targeted head context in ResourceTracker.cpp, ResourceMaterializer.cpp, and ShaderMemory.cpp through repo_read.py.

Results

Check Result Note
Changed logic review passed Pointer planning and snapshot paths inspected
Tests not run Reported test runs were not independently rerun
Changed file coverage not run One changed file was excluded from the review folder

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was available through the reader and the changed snapshot retry helper was inspected. Other changed lines in that large file were not examined; no issue is established from that limited review.

Not verified

  • The full text of ShaderMemory.cpp was excluded from the prepared review folder because it was too large. Only lines 3980–4050 were read through repo_read.py; other changed lines there were not reviewed.
  • No tests, builds, GPU runs, or console behavior were independently verified. The test and title-run results in the PR description are author-reported.
  • Full text was available and reviewed for the other changed files listed in the manifest; targeted ranges were read for the large ResourceTracker.cpp, ResourceMaterializer.cpp, and ShaderMemory.cpp files rather than their entire contents.

To get this to a good state

Nothing is required. Optional: run the focused tests on the current head and inspect the remaining changed lines in ShaderMemory.cpp.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@frankea thanks for the Windows RTX 4090 run, and for checking #9457, #9790 and #9969 too. Both failures were in the tests, not in the driver change: agc_driver_pointer_phi_lane_and_table and agc_driver_pointer_phi_lane_not_table keep their records on the stack and pair arms whose low word can be 0 (lane_not_table's zero arm, and lane_and_table's lane-mask arm in the waterfall pass over lanes 32-63) with the record pointer's high word. #18253 links Windows test executables without high-entropy addresses, which keeps their stacks near the bottom of the address space. On your machine the selected pointer was 0x0, so the records sat below 4 GiB and their high word was 0, and 0x0 faults as unmapped, as a null pointer does in agc_driver_pointer_phi_sampler_table.

5eb49d1 lets those checks accept that fault only when the records' high word is 0; elsewhere they still have to fault outside the snapshot. On GitHub's Linux runner, with the records mapped at 1 GiB by a verify-only commit, the old checks fail 3 of 3 in exactly those two tests on the same 0x0 line (job), and the fix passes ×10 (job); at the normal layout it passes ×10 too (job). It's merged into #9457, #9633, #9749, #9790 and #9969. GitHub's Windows runner has no Vulkan device, so the GPU case itself wasn't re-run there.

@xXPBSXx

xXPBSXx commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Title data point for this PR (data only, no picture judged).

Title: PPSA03685, four runs, each with a limit of 300 s, through a run queue, no input sent, Windows 10 Pro, WinLibs GCC, Release; relinker and all libraries built from each tree. GPU: NVIDIA GeForce RTX 4080 SUPER (Selected GPU line in each run's stdout log, ANYPS5_GPU=4080). Both arms share the base main dcf3d15978c. Arm B is that base plus a local merge of this PR (30b21cec147, parents dcf3d15978c and 5eb49d18931, not pushed); arm A is the base alone. No Display driver reset (event 4101, System log) in any of the four runs.

Order and start times (UTC, 18 Nov 2026): B 13:57:54, B 14:02:38, A 14:07:45, A 14:11:59.

Run Arm Stop
1 B, base + this PR line 486: compute shader 0x200c520000: ... ShaderRecompiler::Recompile: sampler resource limit exceeded
2 B, base + this PR line 462: the same message
3 A, base only line 462: compute shader 0x200c520000: ... ShaderRecompiler::Recompile: GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32@pc=0x000518c4(...)
4 A, base only line 462: the same message

With this PR the GetImageResource refusal does not occur in 2 of 2 title runs (0 matches), and the title stops at the next recompile refusal of the same shader, sampler resource limit exceeded.

Not run: AMD, Linux, other titles, the PR's tests. The two arms were built at different times (arm B libraries and relinker from 18 Nov morning, arm A from 16 Nov), each from its own tree.

AI-assisted (Claude Code).

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@xXPBSXx thanks for the Ghostrunner (PPSA03685) runs on main dcf3d15. They're in the description under Tested, and the RTX 4080 SUPER is in the GPUs tested line. The new stop, sampler resource limit exceeded, is the shader needing more than MaxSamplers samplers, which #10000 raised to 64.

@frankea

frankea commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Ghostrunner (PPSA03685) data point on current main: this PR gets compute shader 0x200c520000 past the #7459 refusal. One request dumped on main 3858655, replayed offline (agc_shader_replay --prepare, ANYPS5_NO_SHADER_CACHE=1, macOS x86_64 Release): main and main + #21745 refuse at GetImageResource dword 0; main + this PR (head 5eb49d1, clean merge) gets past it and stops on sampler resource limit exceeded; with #23409 (128 samplers per shader) as well it prepares, 12,420,660 SPIR-V words. The chain's pointer low word is a Phi web of one record read plus 8 waterfall lane-mask words, which is exactly the lane-mask edge case this PR skips. Details in #7459. The two failing pointer_phi_lane_* tests I reported above on the 4090 are unrelated to this result.
AI-assisted: yes (Claude Code)

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing I inspected shows a verified defect; I did not run checks, and one changed file was excluded from review.

What I ran

  • Reviewed head 606212c86eb33d30a8de2abf6a86edfbc0a9b289 using the prepared diff and repo_read.py for targeted source ranges.
  • No commands or tests were run.

Results

Check Result Note
Diff and source review passed Core pointer walk and materialization reviewed
Tests not run Author-reported runs are not independent runs

Findings

Blocking

None verified in the inspected code.

Non-blocking

None.

Not verified

  • core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp was excluded from the review bundle because it was too large; its changed ranges were read through repo_read.py.
  • Other changed files whose full text was included but whose code was outside the relevant reviewed paths were not read in full. The author reports broad CI, GPU, and title testing in the PR description; these runs were not independently verified.

To get this to a good state

Nothing is required.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

Thanks @frankea for the Ghostrunner (PPSA03685) replay on current main. I added it to Tested: 5eb49d1 gets compute shader 0x200c520000 past the GetImageResource dword 0 refusal to sampler resource limit exceeded, and with your #23409 as well it prepares.

@ShootanoJumper

Copy link
Copy Markdown
Contributor

Windows 11 23H2 (22631), Ryzen 7 5700X, NVIDIA RTX 4060 (driver 616.56), WinLibs GCC 15.2.0 r7, Release, merged into main ed1def4dd4 with git merge --no-ff.

New tests agc_driver_nested_sampler_table, agc_driver_pointer_phi_ballot_table, agc_driver_pointer_phi_copies_table, agc_driver_pointer_phi_high_second_lane_table, agc_driver_pointer_phi_high_table, agc_driver_pointer_phi_lane_and_table and 4 more: pass.
Of the 1296 tests the change reaches, the only failures are ones main also fails on this GPU (#23232, #23711, #23942).
No validation layer is installed here, so this says nothing about VUID- errors.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

Changes are required before merge: ensure the pointer’s low and high words come from the same record key.

What I ran

  • Reviewed head 2eecdd6fc81103facf10c6939d67778700e36c0a using the prepared review diff and repo_read.py.
  • No tests or build commands were run.

Results

Check Result Note
Diff and targeted code review failed Found a pointer pairing defect
Tests not run No local test run

Findings

Blocking

  • core/shader/recompiler/Optimization/src/ResourceTracker.cpp:983 — SameRecordColumn compares the buffers, strides, and addends, but never compares the affine keys. The paired walk can therefore accept a low-word read indexed by one key and a high-word read indexed by another. Materialization then combines the two dwords from the same record index, which may not represent either source pointer. Require equivalent affine keys before treating the reads as the same record column.

Non-blocking

  • None.

Not verified

  • Read the full text of the changed files ShaderDiskCache.cpp, both changed CMake test files, ImageTable.cpp, ResourceMaterializer.cpp, and ResourceTracker.cpp, plus targeted portions of the diff and repository context.
  • ShaderMemory.cpp was excluded from the review folder as too large; its changed hunks were visible in the prepared diff, but its full text was not read. The remaining changed files listed in manifest.json were not read in full. Tests and builds were not run; author and CI results in the PR description were not independently verified.

To get this to a good state

  • Compare the affine keys in SameRecordColumn, and add coverage showing that low and high reads with different keys are rejected. Re-run the focused pointer-table tests on the updated head.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@MarcZX10 thanks for the review. On SameRecordColumn (review): in this pointer-keyed path the record key never selects the descriptor, so a low and a high read with different keys can't pick up another pointer's descriptor.

  • What SameRecordColumn decides: only that both reads come from one table column (same buffer, stride and addend), so the column can be snapshotted. The column is built with pointerKeyed set, maxKey 0xffffffff and no key domain (ResourceTracker.cpp).
  • The snapshot: for each record it reads the low and the high dword from that same record and stores the pair as that record's pointer (ResourceMaterializer.cpp). The map is then keyed by those pointer values, not by record index (ResourceMaterializer.cpp).
  • The lookup: the shader binary-searches that map for the exact 64-bit pointer it composed at run time, low and high word both. A miss returns the outside-snapshot poison, or the table's outside code for a null pointer (LookupTablePointer).

So if a shader takes its low word from one key and its high word from another, the lookup uses the pointer it actually built. It finds a descriptor only when some record holds exactly that pointer, which is then the descriptor at the address the shader reads through, and otherwise it misses, as any pointer outside the snapshot does. Requiring equal keys would only refuse that table instead.

I'd rather leave SameRecordColumn as it is. If you see a shape where the composed pointer still reaches a descriptor from a different address, I'll add it as a test.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@MarcZX10 I checked the key concern on 3a24890. You are right that SameRecordColumn does not compare the two keys, but I do not think that can return a wrong descriptor. A pointer-keyed column is looked up by the shader's own 64-bit pointer value: SpirvImageEmitter.cpp:2414 accepts an entry only when both the low and the high word match a snapshotted pointer, and each entry maps that pointer to the descriptor at that address (ResourceMaterializer.cpp:1184). A mixed pair that matches no record ends in OutsideSnapshotPoison and a recorded fault, not another descriptor. The High and HighSecond tests read the high word from a neighbouring record on purpose, so requiring equal keys would reject the case this PR adds. Could you take another look?

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

Nothing in the reviewed changes blocks merging; the focused code inspection supports the new pointer-word handling, though this review did not run checks.

What I ran

  • Read the prepared diff and changed-file contents at head 3a248901892f2454fe86b7dfc97640d739253823 using repo_read.py.
  • No commands or tests were run.

Results

Check Result Note
Changed-code inspection passed Tracker logic and test changes read
Build and tests not run No local execution

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • Runtime behavior, build, and tests were not independently verified; reported CI and title runs in the description were not run for this review.
  • Read: core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_tests.cmake, core/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cpp, core/shader/recompiler/Optimization/src/ResourceTracker.cpp, core/shader/recompiler/ShaderDiskCache.hpp, and docs/dev/debt/shader.md (changed sections only). No changed files were excluded by the manifest.

To get this to a good state

Nothing is required.

@xXPBSXx

xXPBSXx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

I replayed one recompile request offline against this change and wanted to leave the result here. It is a single request, so it is a data point, not a claim that the title works.

What I ran: the offline shader replay tool (CPU only, no GPU) on one recompile request of a compute shader from a PS5 title that currently stops at GetImageResource dword 0 is not a valid runtime value; chain: LoadAddressU32(GetAddressResource(Phi(Phi(ReadConstBuffer ... (a LoadAddressU32 whose address pair is a Phi web of ReadConstBuffer reads). The request is 104136 code words, wave32, 32x1x1 threads. One run per arm, same machine, same request. Both runs, and the third one below, include the same local diagnostic patch on top of the base that only prints diagnostics.

What it does not do: ten other requests from a different title that fail with Phi incoming definition does not dominate its edge fail identically with and without this change (the change does not touch EdgeSelector, WebPhi or LaneSelector in ResourceTracker.cpp). So this is no evidence for that class.

For comparison, the same request with #21763 (head 7ca6f54ec969, which contains #21745; merge-tree clean) merged onto the same main instead of this change fails unchanged with the original GetImageResource dword 0 error (one run, 32.6 s, 847 MB), so the difference above comes from this change, not from the base.

The shader is not fully prepared with this change (next error above), so I would not read this as "fixed", only as: the table-walk rejection for this form is lifted in the one request I tried.

AI-assisted (Claude Code).

@mrfelek

mrfelek commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

On the failing windows check: it looks like the known flaky test, not this change.

I checked it on Windows: Windows 11 Pro 26200, Intel i7-11850H, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, only guest_libressl_tls_engine_tests built. I ran guest_libressl_tls_engine_tests transport 200 times on each tree, 4 at once (as ctest --parallel 4 does in CI), with a 30 s limit:

Tree Passed Hung past 30 s Case running when it hung
this PR merged into main 214d3c72d1 200 0 —
the same with d57830a7ed reverted 198 2 ConsultsNativeOwnerTransfer (both)

So the only difference is the test fix from main, and the hang appears only without it, in the case #25620 changed. A new CI run on current main should clear the check. Pushing a merge of main, or an empty commit, would start one.

AI-assisted.

@mrfelek

mrfelek commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

@EagleBearerYS the windows failure here is #25592 (details in my comment above): the run tested this PR on a main from before its fix, #25620. Could you push a merge of current main, or an empty commit, so CI runs again on a tree that has the fix? I can't restart the run from my side. This PR is the base of both stacks (#9457 → #9633/#9749 and #9790/#9969), so a green check here unblocks the rest.

AI-assisted.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs shader core/shader unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.