fix(shader): plan a descriptor merged with unrebuildable values from its one SRT read and fault on a mismatch #22767

Open
frankea wants to merge 3 commits from upstream-pr/22767 into main
frankea commented 2026-11-18 07:58:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-11-18T07:58:21Z.


What

A T#, an S#, or the V# of a pointer-record image table column can reach its image instruction as a Phi web. When that web mixed one SRT read with values the resource tracker cannot rebuild, the shader failed to plan and threw GetImageResource dword 0 is not a valid runtime value. Examples of such values are a load in a linked table-call callee and a v_readlane restore of a VGPR lane spill. This PR plans such a descriptor from its one SRT read and checks, at run time, that the live words match. A lane whose live descriptor is not that read records an InvalidDescriptor fault. The fault reports the mismatch; it does not stop the access (see Limits).
GuardedSingleSource walks each dword's Phi web and puts each leaf in one of three classes. Immediates, lane-mask and EXEC values (HoldsFoldableValue), and values RebuildBlocker rejects are ignored. Every other leaf is a candidate. The descriptor is planned only when each dword has candidates that are all equivalent, and the planned dwords are consecutive words of one SRT read (same pointer, byte offsets first + 4·d). Two distinct SRT reads, no SRT read, or more than 512 leaves still throw as before.
The new path is used at two sites. In TryMakeIndirectColumn, the record V# of a pointer-record column is planned from the SRT read when MakeRuntimeSource fails on it. Each live V# word must dominate the image handle. In GetHandle, the same applies to a direct T# or S# that fails validation. A handle whose descriptor web split already failed (SplitFailure) keeps its throw. APS5_STRICT_DESCRIPTOR_WEBS, which already makes the descriptor web throw instead of selecting a descriptor and faulting, turns this path off too, so such a descriptor throws as on main (its ENVIRONMENT.md row says so).
After Collect, every image instruction fed by a guarded descriptor compares each live word with the planned word, using INotEqual32 combined with LogicalOr. It emits DescriptorFault under the instruction's own EXEC, the same mechanism the descriptor web uses for folded arms. The comparison covers all 4 or 8 words. A leaf that differs only in words the access does not use therefore also faults; this is stricter than the access needs. No backend or ABI change is needed (DescriptorFault and FaultReason::InvalidDescriptor exist). The shader cache key already hashes the recompiler sources.
Why compare values and not paths: the ISA defines no callee-saved registers. s_swappc_b64, s_setpc_b64 and s_call_b64 only swap or set the PC (RDNA2 ISA, Program Flow Control chapter and the SOP1/SOPK opcode tables). Whether a callee preserves s84–s87 or a lane-spill VGPR is therefore an ABI question that the shader cannot settle. s_load_dword*, s_buffer_load_dword* and v_readlane_b32/v_writelane_b32 write their destination regardless of EXEC (Scalar Memory Operations chapter; VOP3 opcodes 0x360/0x361). An image instruction's access is decided by the descriptor words it is given (Vector Memory Operations chapter, image instructions). If the live words equal the planned words, the planned access is the one the console makes, whatever path produced them. If they differ, the lane records the fault, so the mismatch is reported instead of passing silently.
Gran Turismo 7 (PPSA01317) compute shader 0x120aed7f00 is the motivating shape, described here without its code. A main-body loop makes one table call (s_swappc_b64, which the linker resolves to 33 callees). The record V# used by the pointer → pointer → T# chain (#6191) is a loop-carried Phi of the main body's SRT read and callee loads. A T# used by four image_stores is a Phi of an SRT read and a v_readlane restore from the lane-spill VGPR. Most callees overwrite that VGPR, which suggests they never run from this call site, but that is an inference. The guards make it a run-time check.
A debt entry records that this is not measured on hardware.

Limits

  • The store happens before the fault is seen. DescriptorFault only writes a fault record under the condition; the image instruction after it still runs with the planned words. On a mismatch, an image_store therefore writes through the planned T# and a sample reads through the planned V# in the same dispatch that records the fault. The host sees the fault only after the dispatch, when the wrong texels are already written. The descriptor web's folded arms on main behave the same way. The tests check that the fault is recorded on a mismatch; they do not check the texels of the mismatching case.
  • In GT7 on NVIDIA, how far this gets the title depends on the request of 0x120aed7f00. The photo-scene request links to 10,555,739 SPIR-V words, and the RTX 4090 driver does not finish creating its pipeline (see Tested). The garage request links to 1,942,712 words; in a contributor's RTX 2080 Ti run its pipeline was created in about 3 min and the title went on to a later stop. A later request of the same shader then has 307 call targets, more than the 64 linked callees that main allows. Together with #22359 (APS5_SPLIT_TABLE_CALLS=1), which runs this shader as continued dispatches instead of linking it, the shader's continued parts prepare and run (see Tested).

Tested

  • New execution test agc_driver_guarded_descriptor_source uses hand-encoded RDNA2 programs and runs each case in wave32 and wave64.
    • Column: a pointer-record table column whose record V# is Phi(SRT read, register-offset read).
      • SRT arm: reads the texels.
      • Other arm holding the same V#: reads the texels, no fault.
      • Other arm holding a different V#: InvalidDescriptor at the sample pc.
      • Different V# with EXEC 0: no fault, no store.
    • Lane spill: an image_store T# that is Phi(SRT read, v_readlane restore of a spill VGPR that a third path re-spills with another read).
      • Same four cases.
      • Two distinct SRT arms: still refused.
      • Immediates and a register-offset read: still refused.
    • main refuses the column and spill programs with GetImageResource dword 0 is not a valid runtime value in both wave sizes.
  • Replay of the GT7 request (agc_shader_replay --prepare, ANYPS5_NO_SHADER_CACHE=1).
    • main eb20410673: still refuses at the LoadAddressU32@0x19a0 <- LoadAddressU32@0x198c <- ReadConstBuffer@0xac8 chain.
    • This branch on the Mac: prepares, 10,555,739 SPIR-V words, with the existing [spanned-wave] two-lanes-per-invocation note. About 500 image instructions use the guarded record V# (most of them in linked callees), and the 4 image_stores use the guarded T#.
    • This branch on the RTX 4090 box (Windows build): prepares, the same 10,555,739 SPIR-V words. main refuses at the same chain.
  • Focused agc/shader tests, run on main and this branch on the same machine with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer and ctest -V. The set is agc_driver_guarded_descriptor_source, descriptor_web_faults, image_table, image_table_variants, image_table_packed, nested_image_table, compute_table_calls, compute_nested_table_call, compute_fs_table_calls, bindless_images, buffer_descriptor_runtime, guarded_null_pointer, guarded_direct_root, read_lane, write_lane, window_lane_spill, image_store_sint, agc_read_lane_elimination, agc_goto_junction_descriptor, agc_goto_junction_guards, agc_guarded_memory_loads, agc_shader_memory and agc_shader_bindless.
    • Apple M5 Max, MoltenVK 1.4.2, macOS 27.0.1 (x86_64 build under Rosetta): This branch: 20 passed and compute_fs_table_calls skipped. main (new test file copied in): the same, and the new test fails because the column program is refused. agc_driver_image_table and agc_driver_image_table_packed fail ctest's VUID- regex on both sides with the same counts (VUID-vkCreateDescriptorSetLayout-support-09582, layouts over MoltenVK's maxPerSetDescriptors). The new test logs the same pre-existing VUID twice. Per-test VUID counts are otherwise identical, and both logs show Insert instance layer "VK_LAYER_KHRONOS_validation".
    • After merging main (head 227933141a, which brings in #7395 and #22359), the same set on the M5 Max: 20 passed and compute_fs_table_calls skipped; agc_driver_image_table and agc_driver_image_table_packed again fail only on the same VUID-vkCreateDescriptorSetLayout-support-09582 lines, and each test's own pass line is printed. agc_driver_guarded_descriptor_source passes and logs its four expected InvalidDescriptor write-back faults.
    • NVIDIA GeForce RTX 4090, driver 621.14, Windows 11 (build 26200), three runs per side. This branch passes 23/23 three times. main, with the new test file copied in, passes 22/23 three times; the new test fails because the column program is refused. Each log shows Insert instance layer "VK_LAYER_KHRONOS_validation" 19 times, none shows was not found but was requested by env var VK_INSTANCE_LAYERS, and none has a VUID- line.
  • GT7 on the RTX 4090 (driver 621.14). The tree is main 604828bd44 with #7256 merged locally (the title needs it to reach its menu). #7256 conflicts with main only in DepthSurface.cpp, and the conflict was resolved keeping both sides. This commit applies cleanly on top. Every run uses the same scripted input: wait for the main menu, then press CROSS, which opens the World Map. After about two minutes idle there, the game shows a photo scene.
    • Without this commit (2 runs): the photo scene appears, then 0x120aed7f00 is refused 126–129 s after CROSS. The chain is LoadAddressU32@0x19a0 <- LoadAddressU32@0x198c <- ReadConstBuffer@0xac8.
    • With this commit (4 runs that reached the scene, each time limit 1,200–3,600 s): no refusal, no InvalidDescriptor fault and no device loss. The frame counter stops within 20 s of the photo scene appearing (116–126 s after CROSS) and does not move again before the time limit, 785–3,198 s later. A gdb snapshot of one frozen run shows one thread inside nvgpucomp64, called from vkCreateComputePipelines in CreateComputePipeline. In the run that prepared the shader without a cached copy, the last line logged before the freeze is the [spanned-wave] note for 0x120aed7f00. That points to this shader's pipeline but does not prove it.
    • So on NVIDIA this commit changes the stop: GT7 no longer stops with a refusal, and instead waits in the driver's compile of the linked shader. No dispatch of the shader ran, so the run-time guards were not exercised in the game.
    • With #22359 alone (head d8f0610d43, APS5_SPLIT_TABLE_CALLS=1, 3 runs): the shader takes the continuation path ("continues across dispatches from the loop at pc 0x740, replaying from pc 0xa48, 34 callees, 264 state slots"), then one part is refused 121–129 s after CROSS with GetImageResource dword 4 is not a valid runtime value; the dword is a Phi of SRT reads and a field masked out of the load at pc 0x7dc.
    • With #22359 and this commit together (f8a7017f5c, APS5_SPLIT_TABLE_CALLS=1, 3 runs): no refusal of 0x120aed7f00. The entry part (180,400 SPIR-V words), the resume part (244,657) and the one callee part the lanes selected (160,163) prepare and run, with no SplitState fault, no InvalidDescriptor fault and no device loss. The run then stops 120–141 s after CROSS on a different shader, 0x120aec1a00, which #22359 also splits: a thread-dimension dispatch has no ShaderData thread limit; DISPATCH_INDIRECT. That stop is outside this commit; without the split setting, 0x120aec1a00 logs no error.
  • GT7 garage path, run and reported by humanityBG on 2026-11-26 (comment); I did not run it. NVIDIA GeForce RTX 2080 Ti, driver 617.42, Windows 11, head 227933141a merged onto main c75a81520b with #24083 (layered depth, needed for the menu) and, from run B on, #16935. Path: menu, World Map, garage with an owned car. Every earlier build aborts there when the car model loads, with the same refusal of 0x120aed7f00 at a different chain, 0x19c4 <- 0x19a0 <- 0xac8.
    • Replay of that garage request: refused on main 33876d3742 + #9020 + #7256; prepared with this PR, 1,942,712 SPIR-V words, wave64, with the [spanned-wave] note.
    • Run A (this PR + #24083, linked): no refusal; the pipeline was created after about 3 min, and 13 further large compute pipelines took about 24 min on one frame. The run then stopped on the #16650 unnormalized-sample abort, which #16935 owns.
    • Run B (A + #16935, linked): the #16650 abort is gone. A later request of 0x120aed7f00 stops with its call table holds 307 distinct targets; at most 64 are linked, the limit of the table-call linker on main, outside this PR.
    • Run C (B with APS5_SPLIT_TABLE_CALLS=1): the shader is split (12 callees, 260 state slots, parts of 184,519 to 303,709 words), the garage is reached and the car and its interior are drawn; the run stayed up 85 min. The single-car scene ran at 0.6 to 1.6 FPS with a wrong picture, and 323 [gpu] loop guard lines name loop exits of 0x120aed7f00 (pcs 0x744 to 0x1360) that ran past 4096 evaluations. Runs A and B cannot log such lines: a linked build has no loop guard unless APS5_LOOP_GUARD is set, while a split part gets a 4096-exit guard by default (SplitLoopGuardLimit in SpirvEmitter.cpp, from #22359), and the guard makes an invocation leave its loops. This PR adds no loop and no guest branch; it adds the planned words, the word compare and a conditional fault write per guarded image instruction. The cause of the picture was not separated.
    • Over the three runs: no InvalidDescriptor and no SplitState line, no device loss. So the guards were dispatched in the title (linked in A and B, split in C) and did not fire. In run C this is weaker for the dispatches with a loop-guard line: a fault record keeps only the first fault written to it, so a loop-guard trip there could hide a later InvalidDescriptor.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (works on its own; on NVIDIA, GT7's photo-scene request of 0x120aed7f00 also needs #22359 to run)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Apple M5 Max, MoltenVK 1.4.2, macOS 27.0.1; NVIDIA GeForce RTX 4090, driver 621.14, Windows 11 (build 26200); GT7 run by a contributor on NVIDIA GeForce RTX 2080 Ti, driver 617.42, Windows 11
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5372148619 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22767). Originally posted by [frankea](https://github.com/frankea) on 2026-11-18T07:58:21Z. --- ### What A T#, an S#, or the V# of a pointer-record image table column can reach its image instruction as a Phi web. When that web mixed one SRT read with values the resource tracker cannot rebuild, the shader failed to plan and threw `GetImageResource dword 0 is not a valid runtime value`. Examples of such values are a load in a linked table-call callee and a `v_readlane` restore of a VGPR lane spill. This PR plans such a descriptor from its one SRT read and checks, at run time, that the live words match. A lane whose live descriptor is not that read records an `InvalidDescriptor` fault. The fault reports the mismatch; it does not stop the access (see Limits). `GuardedSingleSource` walks each dword's Phi web and puts each leaf in one of three classes. Immediates, lane-mask and EXEC values (`HoldsFoldableValue`), and values `RebuildBlocker` rejects are ignored. Every other leaf is a candidate. The descriptor is planned only when each dword has candidates that are all equivalent, and the planned dwords are consecutive words of one SRT read (same pointer, byte offsets first + 4·d). Two distinct SRT reads, no SRT read, or more than 512 leaves still throw as before. The new path is used at two sites. In `TryMakeIndirectColumn`, the record V# of a pointer-record column is planned from the SRT read when `MakeRuntimeSource` fails on it. Each live V# word must dominate the image handle. In `GetHandle`, the same applies to a direct T# or S# that fails validation. A handle whose descriptor web split already failed (`SplitFailure`) keeps its throw. `APS5_STRICT_DESCRIPTOR_WEBS`, which already makes the descriptor web throw instead of selecting a descriptor and faulting, turns this path off too, so such a descriptor throws as on `main` (its `ENVIRONMENT.md` row says so). After `Collect`, every image instruction fed by a guarded descriptor compares each live word with the planned word, using `INotEqual32` combined with `LogicalOr`. It emits `DescriptorFault` under the instruction's own EXEC, the same mechanism the descriptor web uses for folded arms. The comparison covers all 4 or 8 words. A leaf that differs only in words the access does not use therefore also faults; this is stricter than the access needs. No backend or ABI change is needed (`DescriptorFault` and `FaultReason::InvalidDescriptor` exist). The shader cache key already hashes the recompiler sources. Why compare values and not paths: the ISA defines no callee-saved registers. `s_swappc_b64`, `s_setpc_b64` and `s_call_b64` only swap or set the PC (RDNA2 ISA, Program Flow Control chapter and the SOP1/SOPK opcode tables). Whether a callee preserves s84–s87 or a lane-spill VGPR is therefore an ABI question that the shader cannot settle. `s_load_dword*`, `s_buffer_load_dword*` and `v_readlane_b32`/`v_writelane_b32` write their destination regardless of EXEC (Scalar Memory Operations chapter; VOP3 opcodes 0x360/0x361). An image instruction's access is decided by the descriptor words it is given (Vector Memory Operations chapter, image instructions). If the live words equal the planned words, the planned access is the one the console makes, whatever path produced them. If they differ, the lane records the fault, so the mismatch is reported instead of passing silently. Gran Turismo 7 (PPSA01317) compute shader 0x120aed7f00 is the motivating shape, described here without its code. A main-body loop makes one table call (`s_swappc_b64`, which the linker resolves to 33 callees). The record V# used by the pointer → pointer → T# chain (#6191) is a loop-carried Phi of the main body's SRT read and callee loads. A T# used by four `image_store`s is a Phi of an SRT read and a `v_readlane` restore from the lane-spill VGPR. Most callees overwrite that VGPR, which suggests they never run from this call site, but that is an inference. The guards make it a run-time check. A debt entry records that this is not measured on hardware. ### Limits - The store happens before the fault is seen. `DescriptorFault` only writes a fault record under the condition; the image instruction after it still runs with the planned words. On a mismatch, an `image_store` therefore writes through the planned T# and a sample reads through the planned V# in the same dispatch that records the fault. The host sees the fault only after the dispatch, when the wrong texels are already written. The descriptor web's folded arms on `main` behave the same way. The tests check that the fault is recorded on a mismatch; they do not check the texels of the mismatching case. - In GT7 on NVIDIA, how far this gets the title depends on the request of 0x120aed7f00. The photo-scene request links to 10,555,739 SPIR-V words, and the RTX 4090 driver does not finish creating its pipeline (see Tested). The garage request links to 1,942,712 words; in a contributor's RTX 2080 Ti run its pipeline was created in about 3 min and the title went on to a later stop. A later request of the same shader then has 307 call targets, more than the 64 linked callees that `main` allows. Together with #22359 (`APS5_SPLIT_TABLE_CALLS=1`), which runs this shader as continued dispatches instead of linking it, the shader's continued parts prepare and run (see Tested). ### Tested - New execution test `agc_driver_guarded_descriptor_source` uses hand-encoded RDNA2 programs and runs each case in wave32 and wave64. - Column: a pointer-record table column whose record V# is Phi(SRT read, register-offset read). - SRT arm: reads the texels. - Other arm holding the same V#: reads the texels, no fault. - Other arm holding a different V#: `InvalidDescriptor` at the sample pc. - Different V# with EXEC 0: no fault, no store. - Lane spill: an `image_store` T# that is Phi(SRT read, `v_readlane` restore of a spill VGPR that a third path re-spills with another read). - Same four cases. - Two distinct SRT arms: still refused. - Immediates and a register-offset read: still refused. - `main` refuses the column and spill programs with `GetImageResource dword 0 is not a valid runtime value` in both wave sizes. - Replay of the GT7 request (`agc_shader_replay --prepare`, `ANYPS5_NO_SHADER_CACHE=1`). - `main` eb204106737: still refuses at the `LoadAddressU32@0x19a0 <- LoadAddressU32@0x198c <- ReadConstBuffer@0xac8` chain. - This branch on the Mac: prepares, 10,555,739 SPIR-V words, with the existing `[spanned-wave]` two-lanes-per-invocation note. About 500 image instructions use the guarded record V# (most of them in linked callees), and the 4 `image_store`s use the guarded T#. - This branch on the RTX 4090 box (Windows build): prepares, the same 10,555,739 SPIR-V words. `main` refuses at the same chain. - Focused agc/shader tests, run on `main` and this branch on the same machine with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer` and `ctest -V`. The set is `agc_driver_guarded_descriptor_source`, `descriptor_web_faults`, `image_table`, `image_table_variants`, `image_table_packed`, `nested_image_table`, `compute_table_calls`, `compute_nested_table_call`, `compute_fs_table_calls`, `bindless_images`, `buffer_descriptor_runtime`, `guarded_null_pointer`, `guarded_direct_root`, `read_lane`, `write_lane`, `window_lane_spill`, `image_store_sint`, `agc_read_lane_elimination`, `agc_goto_junction_descriptor`, `agc_goto_junction_guards`, `agc_guarded_memory_loads`, `agc_shader_memory` and `agc_shader_bindless`. - Apple M5 Max, MoltenVK 1.4.2, macOS 27.0.1 (x86_64 build under Rosetta): This branch: 20 passed and `compute_fs_table_calls` skipped. `main` (new test file copied in): the same, and the new test fails because the column program is refused. `agc_driver_image_table` and `agc_driver_image_table_packed` fail ctest's `VUID-` regex on both sides with the same counts (`VUID-vkCreateDescriptorSetLayout-support-09582`, layouts over MoltenVK's `maxPerSetDescriptors`). The new test logs the same pre-existing VUID twice. Per-test VUID counts are otherwise identical, and both logs show `Insert instance layer "VK_LAYER_KHRONOS_validation"`. - After merging `main` (head 227933141a6, which brings in #7395 and #22359), the same set on the M5 Max: 20 passed and `compute_fs_table_calls` skipped; `agc_driver_image_table` and `agc_driver_image_table_packed` again fail only on the same `VUID-vkCreateDescriptorSetLayout-support-09582` lines, and each test's own pass line is printed. `agc_driver_guarded_descriptor_source` passes and logs its four expected `InvalidDescriptor` write-back faults. - NVIDIA GeForce RTX 4090, driver 621.14, Windows 11 (build 26200), three runs per side. This branch passes 23/23 three times. `main`, with the new test file copied in, passes 22/23 three times; the new test fails because the column program is refused. Each log shows `Insert instance layer "VK_LAYER_KHRONOS_validation"` 19 times, none shows `was not found but was requested by env var VK_INSTANCE_LAYERS`, and none has a `VUID-` line. - GT7 on the RTX 4090 (driver 621.14). The tree is `main` 604828bd446 with #7256 merged locally (the title needs it to reach its menu). #7256 conflicts with `main` only in `DepthSurface.cpp`, and the conflict was resolved keeping both sides. This commit applies cleanly on top. Every run uses the same scripted input: wait for the main menu, then press CROSS, which opens the World Map. After about two minutes idle there, the game shows a photo scene. - Without this commit (2 runs): the photo scene appears, then 0x120aed7f00 is refused 126–129 s after CROSS. The chain is `LoadAddressU32@0x19a0 <- LoadAddressU32@0x198c <- ReadConstBuffer@0xac8`. - With this commit (4 runs that reached the scene, each time limit 1,200–3,600 s): no refusal, no `InvalidDescriptor` fault and no device loss. The frame counter stops within 20 s of the photo scene appearing (116–126 s after CROSS) and does not move again before the time limit, 785–3,198 s later. A gdb snapshot of one frozen run shows one thread inside `nvgpucomp64`, called from `vkCreateComputePipelines` in `CreateComputePipeline`. In the run that prepared the shader without a cached copy, the last line logged before the freeze is the `[spanned-wave]` note for 0x120aed7f00. That points to this shader's pipeline but does not prove it. - So on NVIDIA this commit changes the stop: GT7 no longer stops with a refusal, and instead waits in the driver's compile of the linked shader. No dispatch of the shader ran, so the run-time guards were not exercised in the game. - With #22359 alone (head d8f0610d435, `APS5_SPLIT_TABLE_CALLS=1`, 3 runs): the shader takes the continuation path ("continues across dispatches from the loop at pc 0x740, replaying from pc 0xa48, 34 callees, 264 state slots"), then one part is refused 121–129 s after CROSS with `GetImageResource dword 4 is not a valid runtime value`; the dword is a Phi of SRT reads and a field masked out of the load at pc 0x7dc. - With #22359 and this commit together (f8a7017f5c, `APS5_SPLIT_TABLE_CALLS=1`, 3 runs): no refusal of 0x120aed7f00. The entry part (180,400 SPIR-V words), the resume part (244,657) and the one callee part the lanes selected (160,163) prepare and run, with no `SplitState` fault, no `InvalidDescriptor` fault and no device loss. The run then stops 120–141 s after CROSS on a different shader, 0x120aec1a00, which #22359 also splits: `a thread-dimension dispatch has no ShaderData thread limit; DISPATCH_INDIRECT`. That stop is outside this commit; without the split setting, 0x120aec1a00 logs no error. - GT7 garage path, run and reported by humanityBG on 2026-11-26 ([comment](https://github.com/boykopovar/AnyPS5/pull/22767#issuecomment-7184672198)); I did not run it. NVIDIA GeForce RTX 2080 Ti, driver 617.42, Windows 11, head 227933141a merged onto `main` c75a81520b with #24083 (layered depth, needed for the menu) and, from run B on, #16935. Path: menu, World Map, garage with an owned car. Every earlier build aborts there when the car model loads, with the same refusal of 0x120aed7f00 at a different chain, `0x19c4 <- 0x19a0 <- 0xac8`. - Replay of that garage request: refused on `main` 33876d3742 + #9020 + #7256; prepared with this PR, 1,942,712 SPIR-V words, wave64, with the `[spanned-wave]` note. - Run A (this PR + #24083, linked): no refusal; the pipeline was created after about 3 min, and 13 further large compute pipelines took about 24 min on one frame. The run then stopped on the #16650 unnormalized-sample abort, which #16935 owns. - Run B (A + #16935, linked): the #16650 abort is gone. A later request of 0x120aed7f00 stops with `its call table holds 307 distinct targets; at most 64 are linked`, the limit of the table-call linker on `main`, outside this PR. - Run C (B with `APS5_SPLIT_TABLE_CALLS=1`): the shader is split (12 callees, 260 state slots, parts of 184,519 to 303,709 words), the garage is reached and the car and its interior are drawn; the run stayed up 85 min. The single-car scene ran at 0.6 to 1.6 FPS with a wrong picture, and 323 `[gpu] loop guard` lines name loop exits of 0x120aed7f00 (pcs 0x744 to 0x1360) that ran past 4096 evaluations. Runs A and B cannot log such lines: a linked build has no loop guard unless `APS5_LOOP_GUARD` is set, while a split part gets a 4096-exit guard by default (`SplitLoopGuardLimit` in `SpirvEmitter.cpp`, from #22359), and the guard makes an invocation leave its loops. This PR adds no loop and no guest branch; it adds the planned words, the word compare and a conditional fault write per guarded image instruction. The cause of the picture was not separated. - Over the three runs: no `InvalidDescriptor` and no `SplitState` line, no device loss. So the guards were dispatched in the title (linked in A and B, split in C) and did not fire. In run C this is weaker for the dispatches with a loop-guard line: a fault record keeps only the first fault written to it, so a loop-guard trip there could hide a later `InvalidDescriptor`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (works on its own; on NVIDIA, GT7's photo-scene request of 0x120aed7f00 also needs #22359 to run) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: Apple M5 Max, MoltenVK 1.4.2, macOS 27.0.1; NVIDIA GeForce RTX 4090, driver 621.14, Windows 11 (build 26200); GT7 run by a contributor on NVIDIA GeForce RTX 2080 Ti, driver 617.42, Windows 11 - [x] AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-11-21 08:17:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T08:17:55Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change based on the source and diff reviewed; hardware and runtime checks were reported by the author and were not run here.

What I ran

Inspected head 68f043a1ac54063d345df370675797fd82dca75e using repo_read.py tools. No tests or build commands were run.

Results

Check Result Note
Source and diff review passed Four changed files read
Build and tests not run Results in the description are author reported
Physical console behavior not run No hardware access in this review

Findings

Blocking

None.

Non-blocking

None.

Not verified

Build/test execution, runtime execution, and physical-console behavior were not verified. The author reports focused Vulkan tests across MoltenVK and RTX 4090, and a GT7 replay; those are not tests run by this reviewer. All changed files listed in the manifest were read: GuardedDescriptorSource.cpp, ResourceTracker.cpp, ENVIRONMENT.md, and fix-table-record-pointer-image-chain.md. No changed files were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6004080272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22767#pullrequestreview-6004080272). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T08:17:55Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change based on the source and diff reviewed; hardware and runtime checks were reported by the author and were not run here. ## What I ran Inspected head `68f043a1ac54063d345df370675797fd82dca75e` using `repo_read.py` tools. No tests or build commands were run. ## Results | Check | Result | Note | |---|---|---| | Source and diff review | passed | Four changed files read | | Build and tests | not run | Results in the description are author reported | | Physical console behavior | not run | No hardware access in this review | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Build/test execution, runtime execution, and physical-console behavior were not verified. The author reports focused Vulkan tests across MoltenVK and RTX 4090, and a GT7 replay; those are not tests run by this reviewer. All changed files listed in the manifest were read: `GuardedDescriptorSource.cpp`, `ResourceTracker.cpp`, `ENVIRONMENT.md`, and `fix-table-record-pointer-image-chain.md`. No changed files were excluded. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/22767:upstream-pr/22767'
git switch 'upstream-pr/22767'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/22767'
git switch 'upstream-pr/22767'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/22767'
git switch 'upstream-pr/22767'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/22767'
git switch 'main'
git merge --squash 'upstream-pr/22767'
git switch 'main'
git merge --ff-only 'upstream-pr/22767'
git switch 'main'
git merge 'upstream-pr/22767'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!22767
No description provided.