fix(shader): decode GFX10 scratch offsets as one dword #2965

Closed
Prophet069 wants to merge 1 commit from upstream-pr/2965 into main
Prophet069 commented 2026-10-10 18:56:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Prophet069 on 2026-10-10T18:56:34Z.


What

GFX10 scratch SV addresses contain one32-bit VGPR offset, not the VGPR pair used for ordinary FLAT addressing. VGPR255 was therefore incorrectly rejected. Decode SV/SS/ST address components independently and make the scratch IR consume the offset components; retain the FLAT/global VGPR-pair and unsupported-scalar checks. Source: LLVM FLATInstructions.td for the operand widths and SV/SS/ST pseudos, and GFX10 encoding for null/EXEC_HI sentinels. #1190 changes flat-aperture SPIR-V routing and does not modify these decoder/IR units.

Tested

Windows: freshly compiled the two affected production units and regression against unchanged prebuilt decoder/IR support objects;14 valid/invalid decoder+IR cases passed in0.08s. The captured instruction dc304000027d00ff also decoded successfully in an earlier DS2 PPSA02015 run. That is decoder validation, not measured PS5 GPU execution or address results. Hardware validation remains outstanding and is recorded in TechnicalDebt. Full Linux/Windows/GPU CI has not been run. Test timeout is30s.

Base: 3cb317fcfd877f93b0b65adbe7b737ba1ba5123f; candidate: d6573b31d68536076a248f5e6366c4ff0a439adc. python tools/check_conventions.py --base origin/main passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths fail; no silent success stub added
  • No investigation files, game data, dumps, logs or images in the branch
  • No new third-party dependency
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. Prepared and tested with Codex.

Tests were run on1476f769 and retained across the conflict-free rebase to3cb317fc. That upstream interval does not change the tested libc/decoder/IR sources. No game was started for this submission.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4813660470 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2965). Originally posted by [Prophet069](https://github.com/Prophet069) on 2026-10-10T18:56:34Z. --- ### What GFX10 scratch SV addresses contain one32-bit VGPR offset, not the VGPR pair used for ordinary FLAT addressing. VGPR255 was therefore incorrectly rejected. Decode SV/SS/ST address components independently and make the scratch IR consume the offset components; retain the FLAT/global VGPR-pair and unsupported-scalar checks. Source: [LLVM FLATInstructions.td](https://raw.githubusercontent.com/llvm/llvm-project/3eb867f9b63ae2881bbe3c25d3c12842f2bdc55e/llvm/lib/Target/AMDGPU/FLATInstructions.td#L557-L630) for the operand widths and SV/SS/ST pseudos, and [GFX10 encoding](https://raw.githubusercontent.com/llvm/llvm-project/3eb867f9b63ae2881bbe3c25d3c12842f2bdc55e/llvm/lib/Target/AMDGPU/FLATInstructions.td#L2973-L3038) for null/EXEC_HI sentinels. #1190 changes flat-aperture SPIR-V routing and does not modify these decoder/IR units. ### Tested Windows: freshly compiled the two affected production units and regression against unchanged prebuilt decoder/IR support objects;14 valid/invalid decoder+IR cases passed in0.08s. The captured instruction dc304000027d00ff also decoded successfully in an earlier DS2 PPSA02015 run. That is decoder validation, not measured PS5 GPU execution or address results. Hardware validation remains outstanding and is recorded in TechnicalDebt. Full Linux/Windows/GPU CI has not been run. Test timeout is30s. Base: `3cb317fcfd877f93b0b65adbe7b737ba1ba5123f`; candidate: `d6573b31d68536076a248f5e6366c4ff0a439adc`. `python tools/check_conventions.py --base origin/main` passed. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths fail; no silent success stub added - [x] No investigation files, game data, dumps, logs or images in the branch - [x] No new third-party dependency - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes. Prepared and tested with Codex. Tests were run on1476f769 and retained across the conflict-free rebase to3cb317fc. That upstream interval does not change the tested libc/decoder/IR sources. No game was started for this submission.
github-actions[bot] commented 2026-10-10 19:05:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:05:09Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101121393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2965#issuecomment-6101121393). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T19:05:09Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
github-actions[bot] commented 2026-10-10 19:05:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T19:05:22Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#2876 docs/dev/TechnicalDebt.md L380
#2880 docs/dev/TechnicalDebt.md L394
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6101123414 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2965#issuecomment-6101123414). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T19:05:22Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #2876 | `docs/dev/TechnicalDebt.md` [L380](https://github.com/boykopovar/AnyPS5/blob/4a747c4872814908702fe81db6a20405a53a07d7/docs/dev/TechnicalDebt.md#L380) | | | | #2880 | `docs/dev/TechnicalDebt.md` [L394](https://github.com/boykopovar/AnyPS5/blob/4a747c4872814908702fe81db6a20405a53a07d7/docs/dev/TechnicalDebt.md#L394) | | |

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2965
No description provided.