shader: see through SSA aliases when dropping a retained ancillary word #2543

Open
github-bot wants to merge 1 commit from github-bot/gh-2543 into main AGit
Owner

@⁠Nawid3333 on GitHub · 2026-11-24 11:20 UTC · original
Nawid3333:fix/ancillary-alias-retained → main · +37 −9 · 2 files · 1 commits · open

Assassin's Creed Valhalla (#2308) stops with packed pixel ancillary input has an unsupported live use in PS 0x3b1b866a5fbafbbe (Crispy81's log, #2307 comment). The shader reads the sample index from the ancillary VGPR after three nested loops and then overwrites the register under a lane mask:

0x40c4: V_BFE_U32 v8, v5, 8, 4
0x40ec: V_MUL_F32 v5, s0, v3

The field read is lowered to SampleId. What is left of the packed word is the old value of the masked write (SelectU32 operand 2), a use the sweep in ConstantPropagationPass accepts, but only when it is a direct user of the word. SsaRewrite keeps each trivial phi it removes as an Identity alias, and after the loops the word is reached through such an alias, so the sweep found an Identity with users and kept the word. The next run of the pass no longer tracks it, and shader info collection stopped.

AncillaryRetainedOnly now follows Identity users to the users behind them.

Test

shader_cfg_tests, TestPixelAncillaryLayerInput: two nested scalar loops, the sample-index read, a lane-dependent EXEC (v_cmp on FragCoord.x, s_and_saveexec), the overwrite and an export. Current main stops with the game's message (exit 65); with this change the test passes. A variant that exports the raw word through the alias still stops (checked where the test can catch a stop, not on Windows).

Game

Crispy81 ran fork build f614890, which is the build that stopped here (734dd0b) plus only this commit: Valhalla no longer stops at this shader, and with Continue it goes in game (#2307 comment). New Game now stops later, at failed to create image: extent=2576x1456x1 format=97, a different problem. 734dd0b also carried #2539, which edits the same check; f614890 has both changes together.

Refs #2308

Written with Claude Code (AI): Claude Code found the cause in the tester's IR log and wrote the change and the test.

🤖 Generated with Claude Code

**@⁠Nawid3333** on GitHub · 2026-11-24 11:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2543) `Nawid3333:fix/ancillary-alias-retained` → `main` · +37 −9 · 2 files · 1 commits · open Assassin's Creed Valhalla (#2308) stops with `packed pixel ancillary input has an unsupported live use` in PS `0x3b1b866a5fbafbbe` (Crispy81's log, [#2307 comment](https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/2307)). The shader reads the sample index from the ancillary VGPR after three nested loops and then overwrites the register under a lane mask: ``` 0x40c4: V_BFE_U32 v8, v5, 8, 4 0x40ec: V_MUL_F32 v5, s0, v3 ``` The field read is lowered to `SampleId`. What is left of the packed word is the old value of the masked write (`SelectU32` operand 2), a use the sweep in `ConstantPropagationPass` accepts, but only when it is a direct user of the word. `SsaRewrite` keeps each trivial phi it removes as an `Identity` alias, and after the loops the word is reached through such an alias, so the sweep found an `Identity` with users and kept the word. The next run of the pass no longer tracks it, and shader info collection stopped. `AncillaryRetainedOnly` now follows `Identity` users to the users behind them. ## Test `shader_cfg_tests`, `TestPixelAncillaryLayerInput`: two nested scalar loops, the sample-index read, a lane-dependent EXEC (`v_cmp` on FragCoord.x, `s_and_saveexec`), the overwrite and an export. Current main stops with the game's message (exit 65); with this change the test passes. A variant that exports the raw word through the alias still stops (checked where the test can catch a stop, not on Windows). ## Game Crispy81 ran fork build f614890, which is the build that stopped here (734dd0b) plus only this commit: Valhalla no longer stops at this shader, and with Continue it goes in game ([#2307 comment](https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/2307)). New Game now stops later, at `failed to create image: extent=2576x1456x1 format=97`, a different problem. 734dd0b also carried #2539, which edits the same check; f614890 has both changes together. Refs #2308 Written with Claude Code (AI): Claude Code found the cause in the tester's IR log and wrote the change and the test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The ancillary sweep checked only the direct users of the packed word.
SsaRewrite keeps each trivial loop phi it removes as an Identity alias,
and a register read after nested loops still goes through that alias.
The sweep then kept the word, the next pass no longer tracked it, and
shader info collection stopped with "packed pixel ancillary input has an
unsupported live use". Follow Identity users to the users behind them.

Refs #2308

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

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

Explain Change →

Walkthrough

The ancillary normalization pass now accepts qualifying Identity chains in addition to the previously accepted uses. Nested-loop shader tests check reflected inputs, SPIR-V validity, and a fatal compilation case.

Suggested reviewers: nmzik, senaxx

Change: Bug fix

Merge Risk: Moderate · up to bfbe5

The change lets shader info collection get past a Valhalla shader that previously stopped it. However, a masked write followed by an export under a wider EXEC could now silently export zero for the packed ancillary word, where it used to fail loudly. This is a narrow edge case that is not covered by the new tests, so it should be addressed or explicitly accepted before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the specific change: the sweep now follows SSA Identity aliases when deciding whether to drop a retained ancillary word. The raw summary and objectives both describe this change to Con…
Description check Passed The description explains the problem (a packed pixel ancillary input error in Assassin's Creed Valhalla shader 0x3b1b866a5fbafbbe), the root cause (the sweep accepted only direct users of the packed w…
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 specific change: the sweep now follows SSA Identity aliases when deciding whether to drop a retained ancillary word. The raw summary and objectives both describe this change to ConstantPropagation.cpp and the new AncillaryRetainedOnly helper. The title is concise and specific enough for a teammate to understand the primary change.

Full details: Description check

Explanation

The description explains the problem (a packed pixel ancillary input error in Assassin's Creed Valhalla shader 0x3b1b866a5fbafbbe), the root cause (the sweep accepted only direct users of the packed word, while SsaRewrite leaves Identity aliases), and the fix (AncillaryRetainedOnly follows Identity users). It also describes the regression test TestPixelAncillaryLayerInput and game-testing results, which match the test and ConstantPropagation changes in the summary.

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/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-24 11:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2543#issuecomment-7130142425) <!-- 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/2543?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> The ancillary normalization pass now accepts qualifying `Identity` chains in addition to the previously accepted uses. Nested-loop shader tests check reflected inputs, SPIR-V validity, and a fatal compilation case. **Suggested reviewers:** `nmzik`, `senaxx` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"bfbe59593364360261df8534f7467b5d5ebd9b28" --> <!-- 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-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Moderate</strong> · up to <code>bfbe5</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `bfbe5` --> <!-- final_review_risk_coverage:{"sourceCommitId":"bfbe59593364360261df8534f7467b5d5ebd9b28","coveredCommitId":"bfbe59593364360261df8534f7467b5d5ebd9b28","kind":"reviewed"} --> The change lets shader info collection get past a Valhalla shader that previously stopped it. However, a masked write followed by an export under a wider EXEC could now silently export zero for the packed ancillary word, where it used to fail loudly. This is a narrow edge case that is not covered by the new tests, so it should be addressed or explicitly accepted before merge. <!-- 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 specific change: the sweep now follows SSA Identity aliases when deciding whether to drop a retained ancillary word. The raw summary and objectives both describe this change to Con… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the problem (a packed pixel ancillary input error in Assassin's Creed Valhalla shader 0x3b1b866a5fbafbbe), the root cause (the sweep accepted only direct users of the packed w… | | 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 specific change: the sweep now follows SSA Identity aliases when deciding whether to drop a retained ancillary word. The raw summary and objectives both describe this change to ConstantPropagation.cpp and the new AncillaryRetainedOnly helper. The title is concise and specific enough for a teammate to understand the primary change. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the problem (a packed pixel ancillary input error in Assassin's Creed Valhalla shader 0x3b1b866a5fbafbbe), the root cause (the sweep accepted only direct users of the packed word, while SsaRewrite leaves Identity aliases), and the fix (AncillaryRetainedOnly follows Identity users). It also describes the regression test TestPixelAncillaryLayerInput and game-testing results, which match the test and ConstantPropagation changes in the summary. </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/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=2543)! 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-24 11:28 UTC · original · reviewed

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4e90654506 and bfbe595933.

Files selected for processing: 2

  • src/graphics/shader/recompiler/ir/passes/ConstantPropagation.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-24 11:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2543#pullrequestreview-6038388573) · **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**: `6f4b7f94-1e3a-4bad-86b6-70c25ab8bba4` </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 4e90654506c8078649e2c1d22c763164406497da and bfbe59593364360261df8534f7467b5d5ebd9b28. </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: 2</summary> <dl> <dd> <br> * `src/graphics/shader/recompiler/ir/passes/ConstantPropagation.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=7dbf3872-8919-425e-a739-a375c6b6ce55 attempt=c187d50e-1009-4196-a013-d4e47080f006 batch=1/1 -->
@ -25,0 +30,4 @@
}
return user.GetOpcode() == ValueOpcode::Phi ||
(user.GetOpcode() == ValueOpcode::SelectU32 && use.operand == 2u) ||
(user.GetOpcode() == ValueOpcode::Identity && AncillaryRetainedOnly(user));
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-24 11:28 UTC · original · edited 2026-11-24 11:42 UTC

Major · Functional Correctness · Heavy lift

Ancillary aliases can carry the packed word into exports, and normalization then replaces it with zero.

The new Identity branch in AncillaryRetainedOnly accepts a packed ancillary value when an alias reaches SelectU32 operand 2. The helper does not check whether that select's result is observed. A masked write keeps the old value on lanes outside its write predicate. If a later export runs under a wider EXEC, such as after the saved EXEC is restored, those lanes export the packed word. Normalization then replaces the source with 0, so the export writes zero silently instead of failing with packed pixel ancillary input has an unsupported live use.

The same gap already exists for direct SelectU32 and Phi users. This change extends it to aliased uses.

The correction must establish that the carried value is not observed on lanes outside the write predicate. Checking only the select's downstream users rejects the existing nested_loops case, because that export reads the select result. Choose how to prove the export predicate matches the write predicate, or keep the source live when that cannot be proven. Add a regression case in which the export EXEC includes a lane that the overwrite excludes.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-24 11:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2543#discussion_r4679320291) · edited 2026-11-24 11:42 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** · **Functional Correctness** · **Heavy lift** **Ancillary aliases can carry the packed word into exports, and normalization then replaces it with zero.** The new `Identity` branch in `AncillaryRetainedOnly` accepts a packed ancillary value when an alias reaches `SelectU32` operand 2. The helper does not check whether that select's result is observed. A masked write keeps the old value on lanes outside its write predicate. If a later export runs under a wider EXEC, such as after the saved EXEC is restored, those lanes export the packed word. Normalization then replaces the source with `0`, so the export writes zero silently instead of failing with `packed pixel ancillary input has an unsupported live use`. The same gap already exists for direct `SelectU32` and `Phi` users. This change extends it to aliased uses. The correction must establish that the carried value is not observed on lanes outside the write predicate. Checking only the select's downstream users rejects the existing `nested_loops` case, because that export reads the select result. Choose how to prove the export predicate matches the write predicate, or keep the source live when that cannot be proven. Add a regression case in which the export EXEC includes a lane that the overwrite excludes. <!-- fingerprinting:phantom:poseidon:wombat61 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:23c69af53842e5e703e8d263 --> <!-- This is an auto-generated reply by CodeRabbit -->
@ -25,0 +30,4 @@
}
return user.GetOpcode() == ValueOpcode::Phi ||
(user.GetOpcode() == ValueOpcode::SelectU32 && use.operand == 2u) ||
(user.GetOpcode() == ValueOpcode::Identity && AncillaryRetainedOnly(user));
Author
Owner

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

The Identity is the same value as the word: SsaRewrite leaves it when it removes a trivial phi, and RemoveIdentities drops it later. This change only makes the existing rule give the same answer with or without that alias; it adds no new kind of accepted use.

The rule itself, that the word may be replaced when each of its users is a Phi, a masked write that keeps it as the old value, or an unused instruction without side effects, is main's (ConstantPropagation.cpp:976-991 at 4e9065450), as you note. In Valhalla's shader the select result is not observed: v5's only read is V_BFE_U32 v8, v5, 8, 4 at 0x40c4, before the masked write at 0x40ec.

Proving that the export predicate matches the write predicate would change the direct Phi and SelectU32 cases too, so it belongs in its own change.

**@⁠Nawid3333** on GitHub · 2026-11-24 11:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2543#discussion_r4679465470) The `Identity` is the same value as the word: `SsaRewrite` leaves it when it removes a trivial phi, and `RemoveIdentities` drops it later. This change only makes the existing rule give the same answer with or without that alias; it adds no new kind of accepted use. The rule itself, that the word may be replaced when each of its users is a `Phi`, a masked write that keeps it as the old value, or an unused instruction without side effects, is main's (ConstantPropagation.cpp:976-991 at 4e9065450), as you note. In Valhalla's shader the select result is not observed: v5's only read is `V_BFE_U32 v8, v5, 8, 4` at 0x40c4, before the masked write at 0x40ec. Proving that the export predicate matches the write predicate would change the direct `Phi` and `SelectU32` cases too, so it belongs in its own change.
@ -25,0 +30,4 @@
}
return user.GetOpcode() == ValueOpcode::Phi ||
(user.GetOpcode() == ValueOpcode::SelectU32 && use.operand == 2u) ||
(user.GetOpcode() == ValueOpcode::Identity && AncillaryRetainedOnly(user));
Author
Owner

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

Analysis chain

Script executed:

#!/bin/bash
set -u
printf '%s\n' '--- repository and applicable guidance ---'
git status --short
for f in AGENTS.md src/AGENTS.md src/graphics/AGENTS.md src/graphics/shader/AGENTS.md src/graphics/shader/recompiler/AGENTS.md src/graphics/shader/recompiler/ir/AGENTS.md src/graphics/shader/recompiler/ir/passes/AGENTS.md; do if [ -f "$f" ]; then printf '\n--- %s ---\n' "$f"; cat "$f"; fi; done
printf '\n%s\n' '--- prior rule at cited revision ---'
git show 4e9065450:src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp 2>/dev/null | nl -ba | sed -n '955,1010p' || true
printf '\n%s\n' '--- fixture outline and references ---'
ast-grep outline tests/shaderCfgTests.cpp --match 'TestPixelAncillaryLayerInput' --view expanded 2>/dev/null || true
rg -n -C 8 'TestPixelAncillaryLayerInput|nested_loops|RemoveIdentities|SsaRewrite' tests/shaderCfgTests.cpp src/graphics/shader/recompiler/ir
printf '\n%s\n' '--- Identity replacement definitions ---'
rg -n -C 4 'ReplaceUsesWith\s*\(|RemoveIdentities\s*\(|Value::Resolve\s*\(' src/graphics/shader/recompiler/ir

Length of output: 42405


@Nawid3333 You’re right: the direct Phi and SelectU32 rules predate this PR, and Identity preserves the value. I accept your decision to address predicate proof separately.

The new traversal can apply the existing rule where an alias previously prevented normalization. I have not verified the wider-EXEC case, so I am 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 11:43 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2543#discussion_r4679480397) <!-- coderabbit-ai-generated:v1 --> <details> <summary>Analysis chain</summary> <dl> <dd> <br> Script executed: ```shell #!/bin/bash set -u printf '%s\n' '--- repository and applicable guidance ---' git status --short for f in AGENTS.md src/AGENTS.md src/graphics/AGENTS.md src/graphics/shader/AGENTS.md src/graphics/shader/recompiler/AGENTS.md src/graphics/shader/recompiler/ir/AGENTS.md src/graphics/shader/recompiler/ir/passes/AGENTS.md; do if [ -f "$f" ]; then printf '\n--- %s ---\n' "$f"; cat "$f"; fi; done printf '\n%s\n' '--- prior rule at cited revision ---' git show 4e9065450:src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp 2>/dev/null | nl -ba | sed -n '955,1010p' || true printf '\n%s\n' '--- fixture outline and references ---' ast-grep outline tests/shaderCfgTests.cpp --match 'TestPixelAncillaryLayerInput' --view expanded 2>/dev/null || true rg -n -C 8 'TestPixelAncillaryLayerInput|nested_loops|RemoveIdentities|SsaRewrite' tests/shaderCfgTests.cpp src/graphics/shader/recompiler/ir printf '\n%s\n' '--- Identity replacement definitions ---' rg -n -C 4 'ReplaceUsesWith\s*\(|RemoveIdentities\s*\(|Value::Resolve\s*\(' src/graphics/shader/recompiler/ir ``` Length of output: 42405 --- </dd> </dl> </details> `@Nawid3333` You’re right: the direct `Phi` and `SelectU32` rules predate this PR, and `Identity` preserves the value. I accept your decision to address predicate proof separately. The new traversal can apply the existing rule where an alias previously prevented normalization. I have not verified the wider-EXEC case, so I am 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 -->
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/2543/head:github-bot/gh-2543'
git switch 'github-bot/gh-2543'

Merge

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