shader: decode trap temporaries as extended scalar registers #1687

Closed
github-bot wants to merge 6 commits from gh-pr/1687/head into gh-pr/1687/base
Owner

@⁠theantipopau on GitHub · 2026-10-19 03:13 UTC · original
theantipopau:shader/ttmp-scalar-regs → main · +178 −11 · 6 files · 6 commits · closed without merging

Fixes the Yumia abort in #1627 (follow-up after #1683/#1684): the game reads TTMP3 (scalar source operand 0x73), which hit EXIT in DecodeScalarSource.\n\nTrap temporaries (TTMP0-11, operand codes 112-123) are wavefront-persistent scratch like SGPRs, so they decode into the scalar slots right past the SGPR file (NumScalarRegs 106 -> 118). All range checks keyed off NumScalarRegs grow automatically; the s105+1 VCC crossover for plain SGPRs is preserved, and ReadScalarCode maps hardware codes 112-123 explicitly. Disassembly prints them as ttmpN.\n\nAdds TestNewShaderRecompilerTrapTemporaries (decode + SPIR-V validation). Local syntax-check of both source TUs with g++ is clean; full build/tests rely on CI (local cmake configure cannot fetch FFmpeg in this environment).

**@⁠theantipopau** on GitHub · 2026-10-19 03:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687) `theantipopau:shader/ttmp-scalar-regs` → `main` · +178 −11 · 6 files · 6 commits · closed without merging Fixes the Yumia abort in #1627 (follow-up after #1683/#1684): the game reads TTMP3 (scalar source operand 0x73), which hit EXIT in DecodeScalarSource.\n\nTrap temporaries (TTMP0-11, operand codes 112-123) are wavefront-persistent scratch like SGPRs, so they decode into the scalar slots right past the SGPR file (NumScalarRegs 106 -> 118). All range checks keyed off NumScalarRegs grow automatically; the s105+1 VCC crossover for plain SGPRs is preserved, and ReadScalarCode maps hardware codes 112-123 explicitly. Disassembly prints them as ttmpN.\n\nAdds TestNewShaderRecompilerTrapTemporaries (decode + SPIR-V validation). Local syntax-check of both source TUs with g++ is clean; full build/tests rely on CI (local cmake configure cannot fetch FFmpeg in this environment).
TTMP0-11 (scalar operand codes 112-123) behave as wavefront-persistent
scratch like SGPRs, so decode them into the scalar slots past the SGPR
file instead of aborting. Atelier Yumia reads TTMP3 (0x73) and aborted
in DecodeScalarSource. The s105+1 VCC crossover for plain SGPRs is
preserved. Adds TestNewShaderRecompilerTrapTemporaries.
The 0x6f abort reported on #1627 is TTMP3 under the RDNA2 encoding,
where TTMP0-15 live at scalar codes 108-123. The initial fix only
covered the pre-RDNA 112-123 subset, so 108-111 still aborted.

Extend the trap window to 108-123 (16 slots past the SGPR file) in
the decoder, translator, and register file. Rework the regression
test around code 111 and assert the translated add reads scalar slot
s109 so a wrong-register mapping cannot pass silently.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
The trap-temporary regression test checked the TTMP read side at IR
level but only checked the destination as decoded text. A mistranslated
dest slot would still pass. Also assert the first add writes s109.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
Trap slots 106-107 overlap VCC_LO/HI when compared as raw indices,
so scalar definition search and embedded-fetch tracking could confuse
TTMP0/1 with VCC. Report hardware codes 108-123 for decoded trap
registers, map IR trap slots back to those codes in call-target
resolution, and size the embedded-fetch scalar file for the full
0-127 operand namespace.

Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
Cover TTMP0/TTMP15 decode plus lowering through slots s106/s121, so
the VCC_LO code collision guard and the full 108-123 window are pinned.
Also cover a 64-bit S_MOV_B64 pair through TTMP0_1 lowering through s106.

Generated with Codebuff
Co-Authored-By: Codebuff <[email protected]>
TTMP0 shares its scalar index with the VCC_LO hardware code (106).
Write/read VCC_LO between the TTMP0 write and read so the scalar
tracking cannot conflate slot s106 with the VCC path: TTMP traffic
must lower through s106 while VCC traffic lowers through vcc_lo.

Requested in PR #1687 review.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:03:19 +00:00
github-bot closed this pull request 2026-11-26 10:03:19 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-19 03:19 UTC · original · edited 2026-10-20 11:59 UTC

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

The shader recompiler now defines 106 SGPRs and 16 trap-temporary registers. The decoder maps operand codes 108–123 to trap-temporary scalar sources and destinations and formats them as TTMP registers. The translator, control-flow analysis, and scalar-state tracking preserve distinct trap-temporary and VCC mappings. Regression tests cover TTMP mappings, liveness, 64-bit transfers, and SPIR-V validation.

Suggested reviewers: nmzik

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 01239

No demonstrated behavior defect blocks merging. Adding the VCC interleave would strengthen regression coverage.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 5 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: decoding trap temporaries as extended scalar registers.
Description check Passed The description directly explains the Yumia abort fix, trap-temporary decoding, register mapping, disassembly behavior, tests, and build status.
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: Docstring Coverage

Explanation

Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 5 files. (1 skipped: 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-19 03:19 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#issuecomment-6258912765) · edited 2026-10-20 11:59 UTC <!-- 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/1687?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-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- This is an auto-generated comment: review paused by coderabbit.ai --> > [!NOTE] > ## Reviews paused > > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the `reviews.auto_review.auto_pause_after_reviewed_commits` setting. > > - Last reviewed commit: 0123990fbe65f716e3dc45f0752124edebe2af9d > - Latest commit, not reviewed: 7025cb2ff3489b99388e4dce1e4494928c14949a > > Use the following commands to manage reviews: > - `@coderabbitai resume` to resume automatic reviews. > - `@coderabbitai review` to trigger a single review. > > Use the checkboxes below for quick actions: > - [ ] <!-- {"checkboxId":"7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> ▶️ Resume reviews > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: review paused by coderabbit.ai --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The shader recompiler now defines 106 SGPRs and 16 trap-temporary registers. The decoder maps operand codes 108–123 to trap-temporary scalar sources and destinations and formats them as TTMP registers. The translator, control-flow analysis, and scalar-state tracking preserve distinct trap-temporary and VCC mappings. Regression tests cover TTMP mappings, liveness, 64-bit transfers, and SPIR-V validation. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"0123990fbe65f716e3dc45f0752124edebe2af9d" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>01239</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `01239` --> <!-- final_review_risk_coverage:{"sourceCommitId":"0123990fbe65f716e3dc45f0752124edebe2af9d","coveredCommitId":"0123990fbe65f716e3dc45f0752124edebe2af9d","kind":"reviewed"} --> No demonstrated behavior defect blocks merging. Adding the VCC interleave would strengthen regression coverage. <!-- 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 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-inconclusive-14-v2.svg" width="14" height="14" align="middle" alt="Inconclusive" title="Inconclusive"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 inconclusive</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :--------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Inconclusive](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-inconclusive.svg) | Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 5 files. (1 skipped: … | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><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> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly and concisely identifies the main change: decoding trap temporaries as extended scalar registers. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the Yumia abort fix, trap-temporary decoding, register mapping, disassembly behavior, tests, and build status. | | 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. | </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 5 files. (1 skipped: 1 too large.) **Resolution** Write docstrings for the functions missing them to satisfy the coverage threshold. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1687)! 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> - [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> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

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

🧹 Nitpick comments: 1
tests/shaderCfgTests.cpp: 1

2349-2349: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the TTMP result live in the regression test.

If translation reads TTMP3 from the wrong register, both decoded-text checks can still pass. The test does not consume s2, so SPIR-V validation does not check the TTMP value path. Use s2 in an observable operation and check its translated value or output.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a90efc8a-476b-4b8a-8922-661c0eb619f1
📥 Commits

Reviewing files that changed from the base of the PR and between 099de8dea6 and 0f756cf06cc7d09ad81b335780e24ac7a19062ea.

📒 Files selected for processing: 4
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.cpp
  • src/graphics/shader/recompiler/frontend/translate/Translate.cpp
  • src/graphics/shader/recompiler/ir/Reg.h
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-19 03:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#pullrequestreview-5566581060) · **reviewed** <details> <summary>🧹 Nitpick comments: 1</summary><blockquote> <details> <summary>tests/shaderCfgTests.cpp: 1</summary><blockquote> `2349-2349`: **📐 Maintainability & Code Quality** | **🔵 Trivial** | **⚡ Quick win** **Keep the TTMP result live in the regression test.** If translation reads TTMP3 from the wrong register, both decoded-text checks can still pass. The test does not consume `s2`, so SPIR-V validation does not check the TTMP value path. Use `s2` in an observable operation and check its translated value or output. <!-- cr-comment:v1:25f29b908ba09e6fd9caa6d5 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `a90efc8a-476b-4b8a-8922-661c0eb619f1` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 099de8dea62cbf17c8e06a6c24e72b38475d1566 and 0f756cf06cc7d09ad81b335780e24ac7a19062ea. </details> <details> <summary>📒 Files selected for processing: 4</summary> * `src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.cpp` * `src/graphics/shader/recompiler/frontend/translate/Translate.cpp` * `src/graphics/shader/recompiler/ir/Reg.h` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=690ae70e-263e-40ee-a5c0-a7fe7701e7e6 attempt=9b91d7c7-88bb-4c60-a2ff-6d6c4e29fc06 batch=1/1 -->
Author
Owner

@⁠theantipopau on GitHub · 2026-10-20 00:43 UTC · original

Note on the current CI failure: it is not from this PR. Upstream main went red at 742fe171 when #1726 merged — controller.cpp calls PadVrPortHand/PadVrPort/PadVrClose, which controller_settings_tests doesn't link (undefined references, Linux + macOS). Main-branch run for 742fe171 fails the same way. Fix is in #1741 (stub the VR ports in the test, matching its existing fake convention); once that merges, this PR's checks should go green on a re-run.

**@⁠theantipopau** on GitHub · 2026-10-20 00:43 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#issuecomment-6280615322) Note on the current CI failure: it is not from this PR. Upstream main went red at 742fe171 when #1726 merged — controller.cpp calls PadVrPortHand/PadVrPort/PadVrClose, which controller_settings_tests doesn't link (undefined references, Linux + macOS). Main-branch run for 742fe171 fails the same way. Fix is in #1741 (stub the VR ports in the test, matching its existing fake convention); once that merges, this PR's checks should go green on a re-run.
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-20 03:14 UTC · original · reviewed

🧹 Nitpick comments: 1
tests/shaderCfgTests.cpp: 1

2381-2381: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise the TTMP0/VCC state collision.

The bounds fixture writes and reads ttmp0, but it never writes or reads VCC. Its assertions therefore do not distinguish TTMP0 state from VCC state. Add a VCC write/read between the TTMP0 write and read, and assert both results separately.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 28af1de9-8ddc-4f84-8dd2-34da572a5977
📥 Commits

Reviewing files that changed from the base of the PR and between 55fa638e61 and 0123990fbe.

📒 Files selected for processing: 3
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-20 03:14 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#pullrequestreview-5580349005) · **reviewed** <details> <summary>🧹 Nitpick comments: 1</summary><blockquote> <details> <summary>tests/shaderCfgTests.cpp: 1</summary><blockquote> `2381-2381`: **🎯 Functional Correctness** | **🔵 Trivial** | **⚡ Quick win** **Exercise the TTMP0/VCC state collision.** The `bounds` fixture writes and reads `ttmp0`, but it never writes or reads `VCC`. Its assertions therefore do not distinguish TTMP0 state from VCC state. Add a VCC write/read between the TTMP0 write and read, and assert both results separately. <!-- cr-comment:v1:a608ee449978eb5dea0e0bd1 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `28af1de9-8ddc-4f84-8dd2-34da572a5977` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 55fa638e61da896275e05ed7048c118a7b2b28f5 and 0123990fbe65f716e3dc45f0752124edebe2af9d. </details> <details> <summary>📒 Files selected for processing: 3</summary> * `src/graphics/shader/recompiler/ShaderRecompiler.cpp` * `src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=50c3e8fb-06cb-438f-9196-64f2f09a3eb4 attempt=43b9018b-c97b-4024-a034-080b5d60b779 batch=1/1 -->
Author
Owner

@⁠theantipopau on GitHub · 2026-10-20 08:34 UTC · original

Response to the two CodeRabbit nitpicks on the TTMP tests:

  1. Keep the TTMP result live (review 2026-10-19): already addressed by later commits. The fixtures now chain the TTMP-fed values into observable adds (s3, s2, s1 / s4, s2, s3) with IR checks on the chained op plus SPIR-V validation, so a wrong-register translation cannot pass. No further change needed.

  2. Exercise the TTMP0/VCC collision (review 2026-10-20): valid and still open — the bounds fixture writes/reads ttmp0 but never touches VCC, so it proves TTMP0 lowers through s106 but does not prove VCC state stays distinct. The production fix (track by hardware scalar code, ScalarSlotToCode/ScalarOperandCode) is covered indirectly, but an interleaved VCC write/read with separate assertions would make the regression explicit. Happy to add that as a follow-up here if you want it in this PR.

**@⁠theantipopau** on GitHub · 2026-10-20 08:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#issuecomment-6286905850) Response to the two CodeRabbit nitpicks on the TTMP tests: 1. **Keep the TTMP result live** (review 2026-10-19): already addressed by later commits. The fixtures now chain the TTMP-fed values into observable adds (`s3, s2, s1` / `s4, s2, s3`) with IR checks on the chained op plus SPIR-V validation, so a wrong-register translation cannot pass. No further change needed. 2. **Exercise the TTMP0/VCC collision** (review 2026-10-20): valid and still open — the `bounds` fixture writes/reads `ttmp0` but never touches `VCC`, so it proves TTMP0 lowers through `s106` but does not prove VCC state stays distinct. The production fix (track by hardware scalar code, `ScalarSlotToCode`/`ScalarOperandCode`) is covered indirectly, but an interleaved VCC write/read with separate assertions would make the regression explicit. Happy to add that as a follow-up here if you want it in this PR.
Author
Owner

@⁠theantipopau on GitHub · 2026-10-20 11:59 UTC · original

Follow-up: the interleaved VCC regression test is now on this branch (7025cb2f).

Added a vcc_collision fixture to TestNewShaderRecompilerTrapTemporaries in tests/shaderCfgTests.cpp: s_add_u32 vcc_lo write/read interleaved between the TTMP0 write and read. It asserts TTMP traffic lowers through scalar slot s106 while VCC traffic lowers through vcc_lo (ScalarAddCarryU32 vcc_lo, s0, s1 / ScalarAddCarryU32 s3, vcc_lo, s1), plus decoded-text checks and SPIR-V validation.

Verification notes: I could not execute shader_cfg_tests locally — that target is EXCLUDE_FROM_ALL and not built by any CI job, and this machine's only toolchain (MinGW GCC 16.1) fails on pre-existing issues unrelated to this change (Vulkan-Hpp vk::Extent3D braced-init ambiguity, OpenXR -Werror=undef; MSVC is rejected by the build as unsupported and no clang is installed). What I did verify: the MinGW compile of the test TU reports no errors in the added line range; every assertion string mirrors a form already proven by neighboring passing asserts (TTMP bounds fixture for s106, RDNA2 scalar-opcode test for post-SSA vcc_lo dst/src positions); and the VCC Get/Set ops are consumed by SsaRewrite before the SPIR-V emitter (whose Get/Set handlers are unreachable), matching the existing VCC tests that validate SPIR-V. Worth a run on a working toolchain before merge.

**@⁠theantipopau** on GitHub · 2026-10-20 11:59 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#issuecomment-6290338470) Follow-up: the interleaved VCC regression test is now on this branch (7025cb2f). Added a `vcc_collision` fixture to `TestNewShaderRecompilerTrapTemporaries` in tests/shaderCfgTests.cpp: `s_add_u32 vcc_lo` write/read interleaved between the TTMP0 write and read. It asserts TTMP traffic lowers through scalar slot `s106` while VCC traffic lowers through `vcc_lo` (`ScalarAddCarryU32 vcc_lo, s0, s1` / `ScalarAddCarryU32 s3, vcc_lo, s1`), plus decoded-text checks and SPIR-V validation. Verification notes: I could not execute `shader_cfg_tests` locally — that target is EXCLUDE_FROM_ALL and not built by any CI job, and this machine's only toolchain (MinGW GCC 16.1) fails on pre-existing issues unrelated to this change (Vulkan-Hpp `vk::Extent3D` braced-init ambiguity, OpenXR `-Werror=undef`; MSVC is rejected by the build as unsupported and no clang is installed). What I did verify: the MinGW compile of the test TU reports no errors in the added line range; every assertion string mirrors a form already proven by neighboring passing asserts (TTMP bounds fixture for `s106`, RDNA2 scalar-opcode test for post-SSA `vcc_lo` dst/src positions); and the VCC Get/Set ops are consumed by SsaRewrite before the SPIR-V emitter (whose Get/Set handlers are unreachable), matching the existing VCC tests that validate SPIR-V. Worth a run on a working toolchain before merge.
Author
Owner

@⁠Nmzik on GitHub · 2026-10-20 13:46 UTC · original

Not confirmed bug

**@⁠Nmzik** on GitHub · 2026-10-20 13:46 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1687#issuecomment-6292359680) Not confirmed bug

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.