shader: split merged LS+HS programs into their tessellation stages (Ghost of Yotei) #2479

Open
github-bot wants to merge 2 commits from github-bot/gh-2479 into main AGit
Owner

@⁠Nawid3333 on GitHub · 2026-11-21 00:26 UTC · original
Nawid3333:fix/merged-hull-program → main · +167 −8 · 4 files · 2 commits · open

With tessellation on, Ghost of Yotei (#2350) stops at its first tessellated draw:

ShaderGetInputInfoHS(): shader=0x0000000000000000 is missing from ShaderMap
 in D:\a\KytyPS5\KytyPS5\src\graphics\shader\shader.cpp:101

(official build a21fd80, @⁠whofixx). A diagnostic build that prints the stage programs of that draw shows why (#2350 comment, @⁠Ben-Dash):

tessellation draw without a stage program: ls=0x8000306d00 hs=0x0 es=0x8000356c00 gs=0x0 types=3/-1/2/-1 stages=0x0200210d hs_user_data=0x0 hs_user_sgpr=8 gs_user_sgpr=30 ls_hs_config=0x0001043f tf_param=0x0004006a

The program at the LS address has the Agc binary type kHs (3): one merged LS+HS program, with nothing at the HS address. PrepareTessellationPrograms only handles the two halves kHsFront (LS address) and kHsBack (HS address), so it looks up address 0 and stops.

Change

  • SplitMergedHullProgram (Tessellation.cpp) splits the merged program where its HS part starts. The join is the target of the program's first direct branch, which has to be a forward s_cbranch_execz; the instruction at the join has to be s_mov_b64 exec, -1. The LS half is everything before the join plus s_setpc_b64 s[6:7], the hand-off that fused front halves end with. The HS half is the prologue before the branch, followed by everything from the join on. A program that branches across the join, ends before it, or uses s_getpc_b64 / s_setpc_b64 / s_swappc_b64 stops with an error instead of being split.
  • PrepareTessellationPrograms takes the merged path when the LS program is kHs, whatever the HS address holds, and translates the two halves like a fused pair. The split is cached per program hash, and each half gets the hash of its own words. Fused kHsFront / kHsBack pairs take the same path as before.

Erlou93's fork (Erlou93/KytyPS5-Erlou, SplitMergedHullProgram in shader.cpp) splits these programs too; it has no upstream PR. This PR is a separate implementation that differs in two places: its HS half keeps the whole prologue (the fork keeps only the two v_mbcnt instructions), so values the prologue computes for both parts stay defined, and it does not need the HS address to be 0.

Test

ShaderRecompilerComputeTests: TessellationMergedHull (triangles) and TessellationMergedHullQuads build a merged program from the existing fused LS and HS fixtures (prologue, s_cbranch_execz, LS part, s_mov_b64 exec, -1, HS part), map it as kHs, and run PrepareTessellationPrograms. The quads case also maps a stale kHsBack program at the HS address. Both halves have to start with the prologue, and every check of the fused cases then runs on the two halves. Without the change the first of them stops the suite with ShaderGetInputInfoHS(): shader=0x0000000000000000 is missing from ShaderMap (measured on main a1fc5ae; this code is the same on a21fd80c8).

Full ShaderRecompilerComputeTests run against main a21fd80c8: 196 passed with the change, 194 on main (the 2 new cases); the same 4 failed at lines on both (GpuSelectedFormattedRgba16Store and IndirectImageQueryDimensions, each twice), and both runs stop at the same later check (image format does not support required usage: format=129 ... samples=2 in image.cpp). shader_cfg_tests output identical. Windows 11, RX 9070 XT, clang-cl; the compute test cases need the robust-buffer harness change of #2038 on this GPU.

Game

@⁠Ben-Dash ran a fork build with this change (ac02674 = main a1fc5ae + this change, run 44810316777) with tessellation on (#2350 comment): "Everything booted correctly and I was able to get in game". His shader counter ends at VS 417 | PS 794 | CS 564 | GS 0 | LS 5 | HS 6 | TES 7 with no error. With the diagnostic build, the same setup had stopped at the first tessellated draw at LS 0 | HS 0 | TES 0.

Written with Claude Code (AI): Claude Code found the cause from the testers' logs, wrote the change and the tests, and ran them.

**@⁠Nawid3333** on GitHub · 2026-11-21 00:26 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2479) `Nawid3333:fix/merged-hull-program` → `main` · +167 −8 · 4 files · 2 commits · open With tessellation on, Ghost of Yotei (#2350) stops at its first tessellated draw: ``` ShaderGetInputInfoHS(): shader=0x0000000000000000 is missing from ShaderMap in D:\a\KytyPS5\KytyPS5\src\graphics\shader\shader.cpp:101 ``` (official build a21fd80, @⁠whofixx). A diagnostic build that prints the stage programs of that draw shows why ([#2350 comment](https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/2350), @⁠Ben-Dash): ``` tessellation draw without a stage program: ls=0x8000306d00 hs=0x0 es=0x8000356c00 gs=0x0 types=3/-1/2/-1 stages=0x0200210d hs_user_data=0x0 hs_user_sgpr=8 gs_user_sgpr=30 ls_hs_config=0x0001043f tf_param=0x0004006a ``` The program at the LS address has the Agc binary type `kHs` (3): one merged LS+HS program, with nothing at the HS address. `PrepareTessellationPrograms` only handles the two halves `kHsFront` (LS address) and `kHsBack` (HS address), so it looks up address 0 and stops. ## Change - `SplitMergedHullProgram` (`Tessellation.cpp`) splits the merged program where its HS part starts. The join is the target of the program's first direct branch, which has to be a forward `s_cbranch_execz`; the instruction at the join has to be `s_mov_b64 exec, -1`. The LS half is everything before the join plus `s_setpc_b64 s[6:7]`, the hand-off that fused front halves end with. The HS half is the prologue before the branch, followed by everything from the join on. A program that branches across the join, ends before it, or uses `s_getpc_b64` / `s_setpc_b64` / `s_swappc_b64` stops with an error instead of being split. - `PrepareTessellationPrograms` takes the merged path when the LS program is `kHs`, whatever the HS address holds, and translates the two halves like a fused pair. The split is cached per program hash, and each half gets the hash of its own words. Fused `kHsFront` / `kHsBack` pairs take the same path as before. Erlou93's fork ([Erlou93/KytyPS5-Erlou](https://github.com/Erlou93/KytyPS5-Erlou), `SplitMergedHullProgram` in `shader.cpp`) splits these programs too; it has no upstream PR. This PR is a separate implementation that differs in two places: its HS half keeps the whole prologue (the fork keeps only the two `v_mbcnt` instructions), so values the prologue computes for both parts stay defined, and it does not need the HS address to be 0. ## Test `ShaderRecompilerComputeTests`: `TessellationMergedHull` (triangles) and `TessellationMergedHullQuads` build a merged program from the existing fused LS and HS fixtures (prologue, `s_cbranch_execz`, LS part, `s_mov_b64 exec, -1`, HS part), map it as `kHs`, and run `PrepareTessellationPrograms`. The quads case also maps a stale `kHsBack` program at the HS address. Both halves have to start with the prologue, and every check of the fused cases then runs on the two halves. Without the change the first of them stops the suite with `ShaderGetInputInfoHS(): shader=0x0000000000000000 is missing from ShaderMap` (measured on main a1fc5ae; this code is the same on a21fd80c8). Full `ShaderRecompilerComputeTests` run against main a21fd80c8: 196 passed with the change, 194 on main (the 2 new cases); the same 4 `failed at` lines on both (`GpuSelectedFormattedRgba16Store` and `IndirectImageQueryDimensions`, each twice), and both runs stop at the same later check (`image format does not support required usage: format=129 ... samples=2` in `image.cpp`). `shader_cfg_tests` output identical. Windows 11, RX 9070 XT, clang-cl; the compute test cases need the robust-buffer harness change of #2038 on this GPU. ## Game @⁠Ben-Dash ran a fork build with this change (ac02674 = main a1fc5ae + this change, [run 44810316777](https://github.com/Nawid3333/KytyPS5/actions/runs/44810316777)) with tessellation on ([#2350 comment](https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/2350)): "Everything booted correctly and I was able to get in game". His shader counter ends at `VS 417 | PS 794 | CS 564 | GS 0 | LS 5 | HS 6 | TES 7` with no error. With the diagnostic build, the same setup had stopped at the first tessellated draw at `LS 0 | HS 0 | TES 0`. Written with Claude Code (AI): Claude Code found the cause from the testers' logs, wrote the change and the tests, and ran them.
Ghost of Yotei binds one merged LS+HS program (Agc type kHs) at the LS
address and leaves the HS address unset, so its tessellated draws stopped at
"ShaderGetInputInfoHS(): shader=0x0 is missing from ShaderMap" (#2350).
The program runs its LS part behind the prologue's S_CBRANCH_EXECZ and its
HS part from that branch's target. It is split there: the LS half ends in
the merged-stage handoff a fused LS half ends in, and the HS half keeps the
prologue, so values both parts read stay defined.

Erlou93's KytyPS5-Yotei fork found this program shape in Ghost of Yotei.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The HS half keeps the prologue's EXEC = LS lanes, so the HS part has to
set every lane again itself. The tests also bind a stale fused HS half
at the HS address: the LS binary type alone selects the merged path.

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

@⁠coderabbitai[bot] on GitHub · 2026-11-21 00:34 UTC · original

Explain Change →

Walkthrough

The change adds a function that splits merged hull shader code into local and control halves. Tessellation program preparation now supports merged kHs input and caches the split halves and their hashes. Tests exercise merged hull programs for triangle and quad domains.

Suggested reviewers: nmzik, mrbigbritches, defektu

Change: Bug fix

Merge Risk: Moderate · up to ee688

Merged hull programs are now split into separate local and control programs. If the control part relies on a register set in the local part, tessellation could silently produce wrong output. This should be resolved or explicitly accepted before merge. The rest of the change looks bounded to merged kHs draws.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: splitting merged LS+HS shader programs into tessellation stages, which the changeset implements in SplitMergedHullProgram and PrepareTessellationPrograms. It also name…
Description check Passed The description explains the reported failure, the diagnostic output, and the approach. It covers the split logic in Tessellation.cpp, the PrepareTessellationPrograms path change, and the new tests. I…
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: splitting merged LS+HS shader programs into tessellation stages, which the changeset implements in SplitMergedHullProgram and PrepareTessellationPrograms. It also names the affected game, which is accurate context. Scope is specific and the wording is clear.

Full details: Description check

Explanation

The description explains the reported failure, the diagnostic output, and the approach. It covers the split logic in Tessellation.cpp, the PrepareTessellationPrograms path change, and the new tests. It is directly related to the changeset.

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-21 00:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2479#issuecomment-7054236859) <!-- 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/2479?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 change adds a function that splits merged hull shader code into local and control halves. Tessellation program preparation now supports merged `kHs` input and caches the split halves and their hashes. Tests exercise merged hull programs for triangle and quad domains. **Suggested reviewers:** `nmzik`, `mrbigbritches`, `defektu` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"ee688c8f4194ec1e6c8159acf4eb3596d8ec773b" --> <!-- change_assessment_priority:{"version":1,"urgency":"p1","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>ee688</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `ee688` --> <!-- final_review_risk_coverage:{"sourceCommitId":"ee688c8f4194ec1e6c8159acf4eb3596d8ec773b","coveredCommitId":"ee688c8f4194ec1e6c8159acf4eb3596d8ec773b","kind":"reviewed"} --> Merged hull programs are now split into separate local and control programs. If the control part relies on a register set in the local part, tessellation could silently produce wrong output. This should be resolved or explicitly accepted before merge. The rest of the change looks bounded to merged kHs draws. <!-- 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: splitting merged LS+HS shader programs into tessellation stages, which the changeset implements in SplitMergedHullProgram and PrepareTessellationPrograms. It also name… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description explains the reported failure, the diagnostic output, and the approach. It covers the split logic in Tessellation.cpp, the PrepareTessellationPrograms path change, and the new tests. I… | | 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: splitting merged LS+HS shader programs into tessellation stages, which the changeset implements in SplitMergedHullProgram and PrepareTessellationPrograms. It also names the affected game, which is accurate context. Scope is specific and the wording is clear. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description explains the reported failure, the diagnostic output, and the approach. It covers the split logic in Tessellation.cpp, the PrepareTessellationPrograms path change, and the new tests. It is directly related to the changeset. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2479)! 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 -->
@ -278,0 +316,4 @@
halves.local.assign(local_part.begin(), local_part.end());
halves.local.push_back(MergedStageHandoff);
halves.control.assign(prologue.begin(), prologue.end());
halves.control.insert(halves.control.end(), control_part.begin(), control_part.end());
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-21 00:34 UTC · original · edited 2026-11-21 02:15 UTC

Major · Functional Correctness · Heavy lift

Keep LS-written registers visible to the HS part, or reject programs that depend on them.

SplitMergedHullProgram builds the control half from the prologue and the code from the join onward. Register writes made in the LS part before the join exist only in the local half. If the HS part reads such a register after the join, it receives the prologue value instead. For example, an SGPR set to 1 in the prologue and set to 2 in the LS part is read by HS as 1.

The guard, join, and crossing checks do not reject this shape. The fused-stage path preserves register lifetime across the handoff. The merged path does not. Either preserve the LS register state for the HS part, or reject merged programs in which the HS part reads a register that the LS part writes.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-21 00:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2479#discussion_r4649322192) · edited 2026-11-21 02:15 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** **Keep LS-written registers visible to the HS part, or reject programs that depend on them.** `SplitMergedHullProgram` builds the control half from the prologue and the code from the join onward. Register writes made in the LS part before the join exist only in the local half. If the HS part reads such a register after the join, it receives the prologue value instead. For example, an SGPR set to `1` in the prologue and set to `2` in the LS part is read by HS as `1`. The guard, join, and crossing checks do not reject this shape. The fused-stage path preserves register lifetime across the handoff. The merged path does not. Either preserve the LS register state for the HS part, or reject merged programs in which the HS part reads a register that the LS part writes. <!-- fingerprinting:phantom:medusa:wombat61 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:a3b347d6e5e57d1e3af5139e --> <!-- This is an auto-generated reply by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-21 00:34 UTC · original · reviewed

Actionable comments posted: 1

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a21fd80c8e and ee688c8f41.

Files selected for processing: 4

  • src/graphics/shader/recompiler/Tessellation.cpp
  • src/graphics/shader/recompiler/Tessellation.h
  • src/graphics/shader/shader.cpp
  • tests/ShaderRecompilerComputeTests.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-21 00:34 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2479#pullrequestreview-6001315111) · **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/a21fd80c8e570ebcde9248deec9c711c252ebc77/.coderabbit.yaml>) - **Commit**: [a21fd80](<https://github.com/KytyPS5/KytyPS5/commit/a21fd80c8e570ebcde9248deec9c711c252ebc77>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `b49bde70-4897-4241-b483-0398bc1406d3` </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 a21fd80c8e570ebcde9248deec9c711c252ebc77 and ee688c8f4194ec1e6c8159acf4eb3596d8ec773b. </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/Tessellation.cpp` * `src/graphics/shader/recompiler/Tessellation.h` * `src/graphics/shader/shader.cpp` * `tests/ShaderRecompilerComputeTests.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=08e985bc-56a7-44fc-b11d-76e1072c2384 attempt=5b164e66-dda3-44ec-8c8d-74cfb509ce4e batch=1/1 -->
@ -278,0 +316,4 @@
halves.local.assign(local_part.begin(), local_part.end());
halves.local.push_back(MergedStageHandoff);
halves.control.assign(prologue.begin(), prologue.end());
halves.control.insert(halves.control.end(), control_part.begin(), control_part.end());
Author
Owner

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

Right: in the merged program both parts run in one wave, so a register that the LS part writes and the HS part reads after the join would reach the HS part on hardware, and the split drops it. The HS half is compiled like a fused HS back half (its own user-data address in s0:s1) and gets the prologue before the EXEC guard plus its own code from the join, which must start with s_mov_b64 exec, -1. The PR does not check for such a register yet.

Whether Ghost of Yotei's program has such a read is not known yet: no dump of it exists here. A test build that prints the program's words is with the tester (#2350 comment). If its HS part reads a register that its LS part writes, I will add a check that rejects that shape instead of translating it.

**@⁠Nawid3333** on GitHub · 2026-11-21 02:15 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2479#discussion_r4649936432) Right: in the merged program both parts run in one wave, so a register that the LS part writes and the HS part reads after the join would reach the HS part on hardware, and the split drops it. The HS half is compiled like a fused HS back half (its own user-data address in s0:s1) and gets the prologue before the EXEC guard plus its own code from the join, which must start with `s_mov_b64 exec, -1`. The PR does not check for such a register yet. Whether Ghost of Yotei's program has such a read is not known yet: no dump of it exists here. A test build that prints the program's words is with the tester ([#2350 comment](https://git.gtahub.st/github/KytyPS5--KytyPS5/issues/2350)). If its HS part reads a register that its LS part writes, I will add a check that rejects that shape instead of translating it.
@ -278,0 +316,4 @@
halves.local.assign(local_part.begin(), local_part.end());
halves.local.push_back(MergedStageHandoff);
halves.control.assign(prologue.begin(), prologue.end());
halves.control.insert(halves.control.end(), control_part.begin(), control_part.end());
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-21 02:16 UTC · original

@⁠Nawid3333 Thanks for the clarification. The Ghost of Yotei shader’s dependency remains unverified. The dump should help establish whether its HS part reads a value written by its LS part.

A clean dump would not rule out that dependency in other merged programs. For general support, I recommend preserving those values or rejecting programs that depend on them. I’m not marking the finding as addressed yet.


📝 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-21 02:16 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2479#discussion_r4649938199) <!-- coderabbit-ai-generated:v1 --> @⁠Nawid3333 Thanks for the clarification. The Ghost of Yotei shader’s dependency remains unverified. The dump should help establish whether its HS part reads a value written by its LS part. A clean dump would not rule out that dependency in other merged programs. For general support, I recommend preserving those values or rejecting programs that depend on them. I’m not marking the finding as addressed yet. --- > 📝 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/2479/head:github-bot/gh-2479'
git switch 'github-bot/gh-2479'

Merge

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