shader: bound waterfall image keys by their clamp on the selected lanes #2278

Open
github-bot wants to merge 4 commits from github-bot/gh-2278 into main AGit
Owner

@⁠Nawid3333 on GitHub · 2026-11-14 17:27 UTC · original
Nawid3333:shader/query-only-waterfall-image → main · +110 −22 · 6 files · 4 commits · open

For #774 (Warhammer Age of Sigmar Realms of Ruin, PPSA06927).

Cause

The reporter's last two runs stop in resource tracking with GetImageResource dword 0 is not a valid runtime value, in pixel shaders 0x8b06bb2656189c82 (pc 0x1b4) and 0x4b7ac860a15d013a (pc 0x72c). Both read 8-dword image descriptors from an address table in user data (s[0:1] + key * 32) inside waterfall loops:

c     = INotEqual32(0, y)
local = SelectU32(c, UMin32(0x3fff, x), x)
mask  = Phi[c & ..., mask & !match]
key   = ReadFirstLane(local, mask)
match = mask & IEqual32(key, local)

The table has no record count, so the tracker needs a bound for key. SelectedSelectorDomain takes the domain of a ReadFirstLane key from a finite set of literals, or else from PossibleU32Bits(local). The second ignores the lane mask, so it sees the unclamped arm x and finds no bound, although the selected lane satisfies mask and mask implies c.

The first shader's failing loop only queries the image size (IMAGE_GET_RESINFO). ImageQueryDimensions and ImageQueryLod had no EXEC operand, while AccessPredicate, SetExactTableMaximum and the pointer-table path read the last operand of every image access as its EXEC. For the queries, that operand was the image address.

Change

  • SelectedSelectorDomain: when no literal domain exists, the maximum is min(PossibleU32Bits(local), SelectorMaximum(local, {}, depth + 1, mask)). This is the ReadFirstLane counterpart of the ReadLane case, which already bounds the local value under the guard that proves it equal to the key. The existing check before it (Implies(guard, mask) or HasActiveLane(mask)) is what makes the selected lane one where mask holds. SelectorMaximum passes its depth through.
  • ImageQueryDimensions and ImageQueryLod take a trailing U1 EXEC operand, and IMAGE_GET_RESINFO / IMAGE_GET_LOD pass ir.GetExec() like IMAGE_LOAD does. The SPIR-V emitter does not read it.

Tests

  • resource_tracking_tests, TestQueryOnlyImageWaterfall: the shape above in a pixel shader, as straight-line code and as a loop with the Phi mask; query only, and query followed by a sampling loop on the same key. Each table gets key_count 16384 and no selector. A query whose EXEC is true still stops. With main's src/ (3e226bff9), the query-only case stops with the reporter's message (stage=pixel pc=0x000001b4 GetImageResource dword 0 is not a valid runtime value).
  • TestUniformizedMaterialImageKeys: the seven packed variants whose material-selector proof fails used to stop. Their key is the same UMin32(16383, ...) clamp, so they now keep the clamp's 16384-row table domain. They still get no selector, and the test now checks exactly that (!selector, key_count == 16384).
  • Query constructions in ResourceTrackingTests, shaderCfgTests and ShaderRecompilerComputeTests take the new operand. The compute test's query keeps the predicate of the access it replaces.

resource_tracking_tests, resource_materialization_tests, scalar_provenance_tests, shader_vertex_metadata_tests and shader_cfg_tests pass. The full shader_recompiler_compute_tests run on an RX 9070 XT (Windows 11, clang-cl, with the local harness changes of #2038) has the same result with and without the change: 192 ok, the same two failed checks, and the same stop at image.cpp:714 (a multisampled format this GPU does not support for that use). Fork CI on this commit passed on Windows, Linux and macOS (run 43616718620).

Offline, the 172 Ghost of Yōtei programs I have captures of were recompiled with main and with the change: the SPIR-V is byte-identical for all 172.

Costs

A shader of this shape reads up to 16384 table rows (32 bytes each) when its descriptors are specialized, as an SMin32-clamped key already does through ClampedTableMaximum. Shaders that translate today are unchanged in the corpus above.

In a game

Not yet tested in the game. The reporter has a test build of this commit (#774); I will add the result here. Every waterfall loop in the two failing shaders has the shape above (dumps of both in the reporter's logs).

Written with Claude Code (AI): Claude Code traced both shaders, wrote the change and the tests and ran them; Claude (Opus) reviewed the diff.

**@⁠Nawid3333** on GitHub · 2026-11-14 17:27 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278) `Nawid3333:shader/query-only-waterfall-image` → `main` · +110 −22 · 6 files · 4 commits · open For #774 (Warhammer Age of Sigmar Realms of Ruin, PPSA06927). ## Cause The reporter's last two runs stop in resource tracking with `GetImageResource dword 0 is not a valid runtime value`, in pixel shaders `0x8b06bb2656189c82` (pc 0x1b4) and `0x4b7ac860a15d013a` (pc 0x72c). Both read 8-dword image descriptors from an address table in user data (`s[0:1] + key * 32`) inside waterfall loops: ``` c = INotEqual32(0, y) local = SelectU32(c, UMin32(0x3fff, x), x) mask = Phi[c & ..., mask & !match] key = ReadFirstLane(local, mask) match = mask & IEqual32(key, local) ``` The table has no record count, so the tracker needs a bound for `key`. `SelectedSelectorDomain` takes the domain of a `ReadFirstLane` key from a finite set of literals, or else from `PossibleU32Bits(local)`. The second ignores the lane mask, so it sees the unclamped arm `x` and finds no bound, although the selected lane satisfies `mask` and `mask` implies `c`. The first shader's failing loop only queries the image size (`IMAGE_GET_RESINFO`). `ImageQueryDimensions` and `ImageQueryLod` had no EXEC operand, while `AccessPredicate`, `SetExactTableMaximum` and the pointer-table path read the last operand of every image access as its EXEC. For the queries, that operand was the image address. ## Change - `SelectedSelectorDomain`: when no literal domain exists, the maximum is `min(PossibleU32Bits(local), SelectorMaximum(local, {}, depth + 1, mask))`. This is the `ReadFirstLane` counterpart of the `ReadLane` case, which already bounds the local value under the guard that proves it equal to the key. The existing check before it (`Implies(guard, mask)` or `HasActiveLane(mask)`) is what makes the selected lane one where `mask` holds. `SelectorMaximum` passes its depth through. - `ImageQueryDimensions` and `ImageQueryLod` take a trailing U1 EXEC operand, and `IMAGE_GET_RESINFO` / `IMAGE_GET_LOD` pass `ir.GetExec()` like `IMAGE_LOAD` does. The SPIR-V emitter does not read it. ## Tests - `resource_tracking_tests`, `TestQueryOnlyImageWaterfall`: the shape above in a pixel shader, as straight-line code and as a loop with the Phi mask; query only, and query followed by a sampling loop on the same key. Each table gets `key_count` 16384 and no selector. A query whose EXEC is `true` still stops. With main's `src/` (3e226bff9), the query-only case stops with the reporter's message (`stage=pixel pc=0x000001b4 GetImageResource dword 0 is not a valid runtime value`). - `TestUniformizedMaterialImageKeys`: the seven packed variants whose material-selector proof fails used to stop. Their key is the same `UMin32(16383, ...)` clamp, so they now keep the clamp's 16384-row table domain. They still get no selector, and the test now checks exactly that (`!selector`, `key_count == 16384`). - Query constructions in `ResourceTrackingTests`, `shaderCfgTests` and `ShaderRecompilerComputeTests` take the new operand. The compute test's query keeps the predicate of the access it replaces. `resource_tracking_tests`, `resource_materialization_tests`, `scalar_provenance_tests`, `shader_vertex_metadata_tests` and `shader_cfg_tests` pass. The full `shader_recompiler_compute_tests` run on an RX 9070 XT (Windows 11, clang-cl, with the local harness changes of #2038) has the same result with and without the change: 192 ok, the same two failed checks, and the same stop at `image.cpp:714` (a multisampled format this GPU does not support for that use). Fork CI on this commit passed on Windows, Linux and macOS ([run 43616718620](https://github.com/Nawid3333/KytyPS5/actions/runs/43616718620)). Offline, the 172 Ghost of Yōtei programs I have captures of were recompiled with main and with the change: the SPIR-V is byte-identical for all 172. ## Costs A shader of this shape reads up to 16384 table rows (32 bytes each) when its descriptors are specialized, as an `SMin32`-clamped key already does through `ClampedTableMaximum`. Shaders that translate today are unchanged in the corpus above. ## In a game Not yet tested in the game. The reporter has a test build of this commit (https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/774); I will add the result here. Every waterfall loop in the two failing shaders has the shape above (dumps of both in the reporter's logs). Written with Claude Code (AI): Claude Code traced both shaders, wrote the change and the tests and ran them; Claude (Opus) reviewed the diff.
A ReadFirstLane key takes its domain from a finite literal set or from the
context-free bits of the local value. A key clamped by UMin32 behind a select
whose condition the lane mask implies, as in SelectU32(c, UMin32(0x3fff, x), x)
read under a mask that implies c, therefore had no bound, and an address table
read with it failed with "GetImageResource dword 0 is not a valid runtime value"
(Warhammer Age of Sigmar Realms of Ruin, #774, pixel shader 0x8b06bb2656189c82).
The selected lane satisfies the mask, so the local value's maximum under that
mask bounds the key, as the ReadLane case already does for its equal local key.

IMAGE_GET_RESINFO and IMAGE_GET_LOD now carry their EXEC predicate like every
other image access. The tracker reads the last operand of an image access as
its EXEC; for the queries that operand was the image address, so a query-only
waterfall loop had no predicate to bound its key.

Packed material keys whose selector proof fails now keep their clamped table
domain instead of failing tracking; they still get no selector.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since 911f0052f ("shader: select sampled static-domain address table slots
from an image heap") a handle whose every use is a sample keeps its static
key range as table_maximum with table_scalar set and key_count empty. The
unproved packed material keys and the sampled waterfall of QueryThenSample
are such handles, so their 16384-key domain is now table_maximum 16383; the
query waterfall keeps key_count 16384.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:17:53 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-14 17:36 UTC · original · edited 2026-11-26 23:35 UTC

Explain Change →

Walkthrough

Image-query IR operations now receive the active execution mask. Resource tracking uses guard-aware selector bounds when finite-domain analysis has no known maximum. Tests update image-query operands and cover packed selectors and query-only or query-then-sample waterfalls.

Suggested reviewers: nmzik, claxten10, senaxx

Change: Bug fix

Merge Risk: Low · up to 80e34

This change fixes image-query resource tracking for clamped waterfall selectors. The remaining concerns are an older gap in sampler planning for LOD queries and a possible traversal-cost issue on unusual shader shapes. Neither is likely to block typical shaders, but both are still open and the change has not yet been tried in a game.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: bounding waterfall image keys by their clamp on the selected lanes. The raw summary shows SelectedSelectorDomain now limits the selected lane maximum using the guarded…
Description check Passed The description covers the cause, the change, tests, costs, and in-game status. It describes the SelectedSelectorDomain fix, the new EXEC operand on ImageQueryDimensions and ImageQueryLod, and the tes…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: bounding waterfall image keys by their clamp on the selected lanes. The raw summary shows SelectedSelectorDomain now limits the selected lane maximum using the guarded SelectorMaximum, which matches the title. The title is specific and uses the same terms as the code changes and the objectives.

Full details: Description check

Explanation

The description covers the cause, the change, tests, costs, and in-game status. It describes the SelectedSelectorDomain fix, the new EXEC operand on ImageQueryDimensions and ImageQueryLod, and the test updates, all of which match the changeset.

Warning

Some tools did not complete. Review the errors below.

Cppcheck (2.22.0)

Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete.

tests/ResourceTrackingTests.cpp

Cppcheck interrupted; analysis of this file is incomplete

tests/shaderCfgTests.cpp

Cppcheck interrupted; analysis of this file is incomplete

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

**@⁠coderabbitai[bot]** on GitHub · 2026-11-14 17:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#issuecomment-6881554280) · edited 2026-11-26 23:35 UTC <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/2278?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> Image-query IR operations now receive the active execution mask. Resource tracking uses guard-aware selector bounds when finite-domain analysis has no known maximum. Tests update image-query operands and cover packed selectors and query-only or query-then-sample waterfalls. **Suggested reviewers:** `nmzik`, `claxten10`, `senaxx` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"80e34cab11aac02079dd94af9b6c3fb2a4a3ed2f" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-low-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Low</strong> · up to <code>80e34</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🔵 Low** · up to `80e34` --> <!-- final_review_risk_coverage:{"sourceCommitId":"80e34cab11aac02079dd94af9b6c3fb2a4a3ed2f","coveredCommitId":"80e34cab11aac02079dd94af9b6c3fb2a4a3ed2f","kind":"reviewed"} --> This change fixes image-query resource tracking for clamped waterfall selectors. The remaining concerns are an older gap in sampler planning for LOD queries and a possible traversal-cost issue on unusual shader shapes. Neither is likely to block typical shaders, but both are still open and the change has not yet been tried in a game. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main change: bounding waterfall image keys by their clamp on the selected lanes. The raw summary shows SelectedSelectorDomain now limits the selected lane maximum using the guarded… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description covers the cause, the change, tests, costs, and in-game status. It describes the SelectedSelectorDomain fix, the new EXEC operand on ImageQueryDimensions and ImageQueryLod, and the tes… | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: bounding waterfall image keys by their clamp on the selected lanes. The raw summary shows SelectedSelectorDomain now limits the selected lane maximum using the guarded SelectorMaximum, which matches the title. The title is specific and uses the same terms as the code changes and the objectives. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description covers the cause, the change, tests, costs, and in-game status. It describes the SelectedSelectorDomain fix, the new EXEC operand on ImageQueryDimensions and ImageQueryLod, and the test updates, all of which match the changeset. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- operational_warnings_start --> <!-- This is an auto-generated comment: all tool run failures by coderabbit.ai --> > [!WARNING] > Some tools did not complete. Review the errors below. > > <details> > <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/wrench-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/wrench.svg" width="16" height="16" align="absmiddle" alt=""></picture> Cppcheck (2.22.0)</strong></summary> > <dl> > <dd> > <br> > > Cppcheck (2.22.0) exceeded its 180-second time budget. Findings from completed work are retained; remaining checks are incomplete. > > <details> > <summary><strong>tests/ResourceTrackingTests.cpp</strong></summary> > <dl> > <dd> > <br> > > Cppcheck interrupted; analysis of this file is incomplete > > </dd> > </dl> > </details> > > <details> > <summary><strong>tests/shaderCfgTests.cpp</strong></summary> > <dl> > <dd> > <br> > > Cppcheck interrupted; analysis of this file is incomplete > > </dd> > </dl> > </details> > > </dd> > </dl> > </details> <!-- end of auto-generated comment: all tool run failures by coderabbit.ai --> <!-- operational_warnings_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2278)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>Share</strong></summary> <dl> <dd> <br> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-14 17:36 UTC · original · reviewed

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Major · Plan the query sampler when ImageQueryLod selects it through… · ResourceTracking.cpp:4029-4032

src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp:4029-4032
Major · Stability & Availability · Quick win

Plan the query sampler when ImageQueryLod selects it through a waterfall.

ImageQueryLod takes its sampler at Arg(1), and the sampler planner skips it. Only ImageSampleRaw reaches the sampler plan_handle call. The image resource still gets planned, so a bounded image resource does not prevent the failure.

When the query's sampler descriptor fails ValidateSource, no plan exists for it. Collect then calls GetHandle for that sampler, and GetHandle calls Fail with "is not a valid runtime value." This can end shader tracking even after the image waterfall is bounded.

Extend the sampler planning gate to ImageQueryLod. Keep the ImageSampleFlagAdjust exclusion, because the planner always passes sample_adjust = false.

Suggested fix

-				if (inst.GetOpcode() == ValueOpcode::ImageSampleRaw &&
+				if ((inst.GetOpcode() == ValueOpcode::ImageSampleRaw ||
+				     inst.GetOpcode() == ValueOpcode::ImageQueryLod) &&
 				    (memory.image_sample_flags & Decoder::ImageSampleFlagAdjust) == 0u) {
 					plan_handle(inst.Arg(1), 4u, memory.sampler * 4u, true);
 				}
Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 3e226bff9d and 050f7f48e5.

Files selected for processing: 6

  • src/graphics/shader/recompiler/frontend/translate/Memory.cpp
  • src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-14 17:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#pullrequestreview-5906114040) · **reviewed** <!-- coderabbit-ai-generated:v1 --> > [!CAUTION] > Some comments are outside the diff and can’t be posted inline due to GitHub limitations. > > **⚠️ Outside diff range comments (1)** > > <details> > <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major</strong> · Plan the query sampler when <code>ImageQueryLod</code> selects it through… · <code>ResourceTracking.cpp:4029-4032</code></summary><blockquote> > <dl> > <dd> > <br> > > `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp:4029-4032` > **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Stability & Availability** · **Quick win** > > **Plan the query sampler when `ImageQueryLod` selects it through a waterfall.** > > `ImageQueryLod` takes its sampler at `Arg(1)`, and the sampler planner skips it. Only `ImageSampleRaw` reaches the sampler `plan_handle` call. The image resource still gets planned, so a bounded image resource does not prevent the failure. > > When the query's sampler descriptor fails `ValidateSource`, no plan exists for it. `Collect` then calls `GetHandle` for that sampler, and `GetHandle` calls `Fail` with "is not a valid runtime value." This can end shader tracking even after the image waterfall is bounded. > > Extend the sampler planning gate to `ImageQueryLod`. Keep the `ImageSampleFlagAdjust` exclusion, because the planner always passes `sample_adjust = false`. > > <details> > <summary>Suggested fix</summary> > <dl> > <dd> > <br> > > ```diff > - if (inst.GetOpcode() == ValueOpcode::ImageSampleRaw && > + if ((inst.GetOpcode() == ValueOpcode::ImageSampleRaw || > + inst.GetOpcode() == ValueOpcode::ImageQueryLod) && > (memory.image_sample_flags & Decoder::ImageSampleFlagAdjust) == 0u) { > plan_handle(inst.Arg(1), 4u, memory.sampler * 4u, true); > } > ``` > > </dd> > </dl> > </details> > > <!-- cr-comment:v1:0a4af80804e44289b38374ea --> > > </dd> > </dl> > </blockquote></details> <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/3e226bff9d757cf973672979050d82d77e5a30ef/.coderabbit.yaml>) - **Commit**: [3e226bf](<https://github.com/KytyPS5/KytyPS5/commit/3e226bff9d757cf973672979050d82d77e5a30ef>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `c977c7ef-2d50-429f-a154-42a0cda20638` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 3e226bff9d757cf973672979050d82d77e5a30ef and 050f7f48e5279343c2533e09a5eefc2206230547. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 6</summary> <dl> <dd> <br> * `src/graphics/shader/recompiler/frontend/translate/Memory.cpp` * `src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `tests/ResourceTrackingTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=c9f1019c-81a7-4c67-a5ce-9a1adfad3e92 attempt=8807e613-7e50-4944-a538-96d23f5b86fd batch=1/1 -->
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-15 15:07 UTC · original

@⁠coderabbitai The gap is real, but it is older than this PR: on main the sampler planner only runs for ImageSampleRaw, so ImageGatherRaw and ImageQueryLod with a table- or waterfall-selected sampler stop the same way with or without this change. Neither #774 shader has an IMAGE_GET_LOD. I will look at gather and LOD-query samplers together, separately and with a test, rather than widen this one.

**@⁠Nawid3333** on GitHub · 2026-11-15 15:07 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#issuecomment-6896594570) @⁠coderabbitai The gap is real, but it is older than this PR: on main the sampler planner only runs for `ImageSampleRaw`, so `ImageGatherRaw` and `ImageQueryLod` with a table- or waterfall-selected sampler stop the same way with or without this change. Neither #774 shader has an `IMAGE_GET_LOD`. I will look at gather and LOD-query samplers together, separately and with a test, rather than widen this one.
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-15 15:08 UTC · original

Tip

For best results, initiate chat on the files or code changes.

Analysis chain

Script executed:

#!/bin/bash
set -u
file="src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp"
echo '--- Current source outline ---'
ast-grep outline "$file" --items all --match 'Sampler|Resource|Track' 2>/dev/null | head -150
echo '--- Current sampler planning and opcode references ---'
rg -n -C 5 'ImageSampleRaw|ImageGatherRaw|ImageQueryLod|[Pp]lan.{0,30}[Ss]ampler|[Ss]ampler.{0,30}[Pp]lan' "$file" | head -350
echo '--- Available base references ---'
git branch -a | head -60
echo '--- Base source references, if available ---'
for ref in origin/main main; do
  if git cat-file -e "$ref:$file" 2>/dev/null; then
    echo "BASE=$ref"
    git show "$ref:$file" | rg -n -C 5 'ImageSampleRaw|ImageGatherRaw|ImageQueryLod|[Pp]lan.{0,30}[Ss]ampler|[Ss]ampler.{0,30}[Pp]lan' | head -350
    break
  fi
done

Length of output: 15182


@Nawid3333 I checked the planner dispatch on main and this PR. Both invoke sampler planning only for ImageSampleRaw without ImageSampleFlagAdjust.

Handling ImageGatherRaw and ImageQueryLod samplers separately makes sense. Would you like me to open a GitHub issue for that follow-up?


📝 Learnings were not changed: only organization members or users with write access to this repository can add or remove learnings.

You are interacting with an AI system.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-15 15:08 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#issuecomment-6896604659) <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated reply by CodeRabbit --> > [!TIP] > For best results, initiate chat on the files or code changes. <details> <summary>Analysis chain</summary> <dl> <dd> <br> Script executed: ```shell #!/bin/bash set -u file="src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp" echo '--- Current source outline ---' ast-grep outline "$file" --items all --match 'Sampler|Resource|Track' 2>/dev/null | head -150 echo '--- Current sampler planning and opcode references ---' rg -n -C 5 'ImageSampleRaw|ImageGatherRaw|ImageQueryLod|[Pp]lan.{0,30}[Ss]ampler|[Ss]ampler.{0,30}[Pp]lan' "$file" | head -350 echo '--- Available base references ---' git branch -a | head -60 echo '--- Base source references, if available ---' for ref in origin/main main; do if git cat-file -e "$ref:$file" 2>/dev/null; then echo "BASE=$ref" git show "$ref:$file" | rg -n -C 5 'ImageSampleRaw|ImageGatherRaw|ImageQueryLod|[Pp]lan.{0,30}[Ss]ampler|[Ss]ampler.{0,30}[Pp]lan' | head -350 break fi done ``` Length of output: 15182 --- </dd> </dl> </details> `@Nawid3333` I checked the planner dispatch on `main` and this PR. Both invoke sampler planning only for `ImageSampleRaw` without `ImageSampleFlagAdjust`. Handling `ImageGatherRaw` and `ImageQueryLod` samplers separately makes sense. Would you like me to open a GitHub issue for that follow-up? --- > 📝 Learnings were not changed: only organization members or users with write access to this repository can add or remove learnings. <sub><i>You are interacting with an AI system.</i></sub>
@ -3710,1 +3710,3 @@
if (result.maximum == UINT32_MAX) result.maximum = PossibleU32Bits(lane.Arg(0));
if (result.maximum == UINT32_MAX)
result.maximum = std::min(PossibleU32Bits(lane.Arg(0)),
SelectorMaximum(lane.Arg(0), {}, depth + 1u, lane.Arg(1)));
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-24 12:10 UTC · original · edited 2026-11-24 12:33 UTC

Major · Performance & Scalability · Heavy lift

Bound the recursive SelectorMaximum traversal on shared UMin32 graphs.

The new SelectedSelectorDomain fallback calls SelectorMaximum on the lane value. SelectorMaximum evaluates both operands of UMin32 and BitwiseAnd32, and it does not memoize results. A shared node used as both operands is visited once per path to it. Within the depth limit of 32, the traversal cost can grow exponentially with the number of shared levels.

The inspected passes before resource tracking do not remove this shape. Constant propagation folds UMin32 only for constant operands. Dead code elimination removes unused values but does not rewrite shared expressions. Memoize SelectorMaximum results for each value, guard, and bounds combination, or reject the fallback when the operand graph is large.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#discussion_r4679772211) · edited 2026-11-24 12:33 UTC <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Performance & Scalability** · **Heavy lift** **Bound the recursive `SelectorMaximum` traversal on shared `UMin32` graphs.** The new `SelectedSelectorDomain` fallback calls `SelectorMaximum` on the lane value. `SelectorMaximum` evaluates both operands of `UMin32` and `BitwiseAnd32`, and it does not memoize results. A shared node used as both operands is visited once per path to it. Within the depth limit of 32, the traversal cost can grow exponentially with the number of shared levels. The inspected passes before resource tracking do not remove this shape. Constant propagation folds `UMin32` only for constant operands. Dead code elimination removes unused values but does not rewrite shared expressions. Memoize `SelectorMaximum` results for each value, guard, and bounds combination, or reject the fallback when the operand graph is large. <!-- fingerprinting:phantom:triton:okapi --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:848fec09c62d17aaf042d54e --> <!-- This is an auto-generated reply by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-24 12:10 UTC · original · reviewed

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 050f7f48e5 and af8ef59478.

Files selected for processing: 5

  • src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-24 12:10 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#pullrequestreview-6038938416) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 1** <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/4e90654506c8078649e2c1d22c763164406497da/.coderabbit.yaml>) - **Commit**: [4e90654](<https://github.com/KytyPS5/KytyPS5/commit/4e90654506c8078649e2c1d22c763164406497da>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `e3c52ff8-4cf4-4303-8b37-246f898ffba3` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 050f7f48e5279343c2533e09a5eefc2206230547 and af8ef59478f6ff09ef537acc95e0928a319fd307. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 5</summary> <dl> <dd> <br> * `src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `tests/ResourceTrackingTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=b6fefcd5-f394-4e20-96d5-4fdc61b0f181 attempt=41bbd42c-7b3d-4223-8c7d-80268169a607 batch=1/1 -->
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-24 12:29 UTC · original

Merged main (4e90654) into this branch. Since 911f0052f a bounded handle whose every use is a sample keeps its key range as table_maximum with an empty key_count, so two checks in tests/ResourceTrackingTests.cpp still expected the old form: the unproved packed variants of TestUniformizedMaterialImageKeys and the sampled waterfall of TestQueryOnlyImageWaterfall (QueryThenSample). af8ef59 updates them to table_maximum 16383; the query keeps key_count 16384. resource_tracking_tests: the merge alone fails, with af8ef59 it passes. af8ef59 changes no src file; the merge takes main's src as it is.

**@⁠Nawid3333** on GitHub · 2026-11-24 12:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#issuecomment-7131525124) Merged main (4e90654) into this branch. Since 911f0052f a bounded handle whose every use is a sample keeps its key range as `table_maximum` with an empty `key_count`, so two checks in `tests/ResourceTrackingTests.cpp` still expected the old form: the unproved packed variants of `TestUniformizedMaterialImageKeys` and the sampled waterfall of `TestQueryOnlyImageWaterfall` (QueryThenSample). af8ef59 updates them to `table_maximum` 16383; the query keeps `key_count` 16384. resource_tracking_tests: the merge alone fails, with af8ef59 it passes. af8ef59 changes no src file; the merge takes main's src as it is.
@ -3710,1 +3710,3 @@
if (result.maximum == UINT32_MAX) result.maximum = PossibleU32Bits(lane.Arg(0));
if (result.maximum == UINT32_MAX)
result.maximum = std::min(PossibleU32Bits(lane.Arg(0)),
SelectorMaximum(lane.Arg(0), {}, depth + 1u, lane.Arg(1)));
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-24 12:33 UTC · original

The walk over both UMin32/BitwiseAnd32 operands without memoization is in SelectorMaximum on main already (4e90654), and main calls it directly on keys (SelectorMaximum(key) at lines 3100, 3356 and 3570). This PR adds one more entry into that walk: the lane value of a ReadFirstLane, which main bounds by FiniteSelectorDomain and, when that finds no bound, only by PossibleU32Bits. It passes the caller's depth into it (depth + 1u here, and SelectedSelectorDomain(*inst, guard, depth) from the ReadFirstLane case), so it stays within the same 32-level limit, and the cost per value is that of main's walk. Memoizing SelectorMaximum would change it for all of its callers, so I'd keep that out of this PR.

**@⁠Nawid3333** on GitHub · 2026-11-24 12:33 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#discussion_r4680034172) The walk over both `UMin32`/`BitwiseAnd32` operands without memoization is in `SelectorMaximum` on main already (4e90654), and main calls it directly on keys (`SelectorMaximum(key)` at lines 3100, 3356 and 3570). This PR adds one more entry into that walk: the lane value of a `ReadFirstLane`, which main bounds by `FiniteSelectorDomain` and, when that finds no bound, only by `PossibleU32Bits`. It passes the caller's `depth` into it (`depth + 1u` here, and `SelectedSelectorDomain(*inst, guard, depth)` from the `ReadFirstLane` case), so it stays within the same 32-level limit, and the cost per value is that of main's walk. Memoizing `SelectorMaximum` would change it for all of its callers, so I'd keep that out of this PR.
@ -3710,1 +3710,3 @@
if (result.maximum == UINT32_MAX) result.maximum = PossibleU32Bits(lane.Arg(0));
if (result.maximum == UINT32_MAX)
result.maximum = std::min(PossibleU32Bits(lane.Arg(0)),
SelectorMaximum(lane.Arg(0), {}, depth + 1u, lane.Arg(1)));
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-24 12:35 UTC · original

Analysis chain

Script executed:

#!/bin/bash
set -u
file="src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp"
echo "=== PR source outline ==="
ast-grep outline "$file" --items all --match 'SelectedSelectorDomain|SelectorMaximum' 2>/dev/null || true
echo "=== PR source call sites ==="
rg -n -C 2 'SelectedSelectorDomain\(|SelectorMaximum\(key\)|case ValueOpcode::UMin32:|depth > 32u' "$file" | tail -100
echo "=== Base revision ==="
if git cat-file -e "4e90654:$file" 2>/dev/null; then
  git show "4e90654:$file" | awk '
    /SelectorDomain SelectedSelectorDomain\(/ {p=1; n=0}
    /uint32_t SelectorMaximum\(Value value/ {p=1; n=0}
    p {print NR ":" $0; n++}
    p && n > 0 && /^	}/ {p=0}
  '
  echo "=== Base call sites ==="
  git show "4e90654:$file" | grep -n -C 1 'SelectorMaximum(key)' || true
else
  echo "Base revision 4e90654 not available locally"
fi

Length of output: 9021


@Nawid3333 You’re right: SelectorMaximum already traverses both operands without memoization on main. This PR adds a path into that traversal for ReadFirstLane values when finite-domain analysis finds no maximum.

The shared depth limit prevents deeper recursion, but it does not prevent repeated visits to shared nodes. I accept your decision to defer memoization. I’m not marking the finding as addressed.


📝 Learnings were not changed: only organization members or users with write access to this repository can add or remove learnings.

You are interacting with an AI system.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-24 12:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#discussion_r4680047612) <!-- coderabbit-ai-generated:v1 --> <details> <summary>Analysis chain</summary> <dl> <dd> <br> Script executed: ```shell #!/bin/bash set -u file="src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp" echo "=== PR source outline ===" ast-grep outline "$file" --items all --match 'SelectedSelectorDomain|SelectorMaximum' 2>/dev/null || true echo "=== PR source call sites ===" rg -n -C 2 'SelectedSelectorDomain\(|SelectorMaximum\(key\)|case ValueOpcode::UMin32:|depth > 32u' "$file" | tail -100 echo "=== Base revision ===" if git cat-file -e "4e90654:$file" 2>/dev/null; then git show "4e90654:$file" | awk ' /SelectorDomain SelectedSelectorDomain\(/ {p=1; n=0} /uint32_t SelectorMaximum\(Value value/ {p=1; n=0} p {print NR ":" $0; n++} p && n > 0 && /^ }/ {p=0} ' echo "=== Base call sites ===" git show "4e90654:$file" | grep -n -C 1 'SelectorMaximum(key)' || true else echo "Base revision 4e90654 not available locally" fi ``` Length of output: 9021 --- </dd> </dl> </details> `@Nawid3333` You’re right: `SelectorMaximum` already traverses both operands without memoization on `main`. This PR adds a path into that traversal for `ReadFirstLane` values when finite-domain analysis finds no maximum. The shared depth limit prevents deeper recursion, but it does not prevent repeated visits to shared nodes. I accept your decision to defer memoization. I’m not marking the finding as addressed. --- > 📝 Learnings were not changed: only organization members or users with write access to this repository can add or remove learnings. <sub><i>You are interacting with an AI system.</i></sub> <!-- This is an auto-generated reply by CodeRabbit -->
@ -8165,0 +8241,4 @@
? table->table_maximum == 0x3fffu && table->table_scalar && table->key_count.IsEmpty()
: table->key_count == Value(0x4000u));
}) && std::ranges::count_if(plan.info.images, [](const auto &image) { return image.sample_access_only; }) ==
(variant == Variant::QueryThenSample ? 1 : 0),
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-26 23:35 UTC · original

Minor · Functional Correctness · Quick win

Require the query resource in QueryThenSample.

If tracking drops the query resource and retains only the sample-only resource, this assertion still passes. !images.empty() and all_of also accept that incorrect plan.

Assert that a non-sample-only query resource remains, in addition to the existing sample-only count. This makes the test detect a lost query without rejecting the intended query-plus-sample plan.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-26 23:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#discussion_r4714188664) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor** · **Functional Correctness** · **Quick win** **Require the query resource in `QueryThenSample`.** If tracking drops the query resource and retains only the sample-only resource, this assertion still passes. `!images.empty()` and `all_of` also accept that incorrect plan. Assert that a non-sample-only query resource remains, in addition to the existing sample-only count. This makes the test detect a lost query without rejecting the intended query-plus-sample plan. <!-- fingerprinting:phantom:poseidon:wombat61 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:df6e83795c89c2d896931738 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-26 23:35 UTC · original · reviewed

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between af8ef59478 and 80e34cab11.

Files selected for processing: 4

  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-26 23:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2278#pullrequestreview-6081518138) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 1** <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/61db2f8874d4a94fd2908a87cefa973ddc48ef6e/.coderabbit.yaml>) - **Commit**: [61db2f8](<https://github.com/KytyPS5/KytyPS5/commit/61db2f8874d4a94fd2908a87cefa973ddc48ef6e>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `a3416e97-89f2-40e2-b428-4791b968552f` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between af8ef59478f6ff09ef537acc95e0928a319fd307 and 80e34cab11aac02079dd94af9b6c3fb2a4a3ed2f. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 4</summary> <dl> <dd> <br> * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `tests/ResourceTrackingTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=f7f1162a-8972-475c-b506-a0a50971e6ff attempt=b6ade660-0443-425a-8c88-711016c82b60 batch=1/1 -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2278/head:github-bot/gh-2278'
git switch 'github-bot/gh-2278'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2278'
git switch 'github-bot/gh-2278'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2278'
git switch 'github-bot/gh-2278'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2278'
git switch 'main'
git merge --squash 'github-bot/gh-2278'
git switch 'main'
git merge --ff-only 'github-bot/gh-2278'
git switch 'main'
git merge 'github-bot/gh-2278'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.