feat: run PS4 games on the AGC driver — Limbo (CUSA01664) in game (integration branch) #6977

Open
Get-fix wants to merge 39 commits from upstream-pr/6977 into main
Get-fix commented 2026-10-17 00:29:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-17T00:29:45Z.


What

Draft integration branch: PS4 titles on the AGC driver, with Limbo (CUSA01664) in game. This branch is main with the pull requests below merged, so they can be tested together. It isn't meant to merge itself: the members merge one by one, each with its own review, and the branch is rebased down as they land. Details, how to run and the bring-up story are in #6978.

Part Member What Depends on
A #9429 relinker: TLS relocations against the module's own section symbol merged
B #9430 shader: PS4 (GCN) shaders re-encoded to RDNA none
C #9431 AGC: PS4 targets, tiling and pattern fills #9430
D #9432 libSceGnmDriver and VideoOut #9431
E #9433 PS4 NpTrophy, save data v1, NpWebApi and Limbo's other imports merged
member #9225 (@YossiYad) sceNpSetContentRestriction, which Limbo calls at start merged

With A, E and #9225 in main, the branch is now main 7e2ba73e4 plus #9430 to #9432, taken in with a merge commit so the pull requests other contributors opened against it (Get-fix/AnyPS5#1 to #21) keep their base. Those join the table once each is open upstream with its own review; @ntamas94's #9671 to #9676 already are, on top of #9430 to #9432.

Tested

On main 7e2ba73e4 with #9430 to #9432, Windows 11, WinLibs GCC 15.2, NVIDIA GeForce RTX 5060 Ti (driver 610.88):

  • The full suite of 1,893 tests: 1,886 pass and 4 skip, the same 4 that skip on main. The 3 that fail also fail on main 7e2ba73e4 on this machine: agc_driver_sample_order and its --grid-reference and --recipe-depth-locations cases.
  • Validation layer, main against the branch with the same focused tests: the same 50 VUID- errors in the same 8 existing PS5 tests, none added (details in #9432).
  • Limbo (CUSA01664), converted with this build's relinker and its two bundled modules: a 60 s scripted run from start into gameplay with no errors and no not-implemented calls, on 22 Oct with the GPU otherwise idle.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR (an integration branch for the members above; it is not meant to be merged itself)
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #9430, #9431, #9432
  • Fixes: none
  • Unblocks: Limbo (CUSA01664) #6978
  • GPUs tested: NVIDIA GeForce RTX 5060 Ti, driver 610.88, Windows 11
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4895844434 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-17T00:29:45Z. --- ### What **Draft integration branch: PS4 titles on the AGC driver, with Limbo (CUSA01664) in game.** This branch is `main` with the pull requests below merged, so they can be tested together. It isn't meant to merge itself: the members merge one by one, each with its own review, and the branch is rebased down as they land. Details, how to run and the bring-up story are in #6978. | Part | Member | What | Depends on | |---|---|---|---| | A | #9429 | relinker: TLS relocations against the module's own section symbol | merged | | B | #9430 | shader: PS4 (GCN) shaders re-encoded to RDNA | none | | C | #9431 | AGC: PS4 targets, tiling and pattern fills | #9430 | | D | #9432 | `libSceGnmDriver` and VideoOut | #9431 | | E | #9433 | PS4 NpTrophy, save data v1, NpWebApi and Limbo's other imports | merged | | member | #9225 (@YossiYad) | `sceNpSetContentRestriction`, which Limbo calls at start | merged | With A, E and #9225 in `main`, the branch is now `main` 7e2ba73e4 plus #9430 to #9432, taken in with a merge commit so the pull requests other contributors opened against it (Get-fix/AnyPS5#1 to #21) keep their base. Those join the table once each is open upstream with its own review; @ntamas94's #9671 to #9676 already are, on top of #9430 to #9432. ### Tested On `main` 7e2ba73e4 with #9430 to #9432, Windows 11, WinLibs GCC 15.2, NVIDIA GeForce RTX 5060 Ti (driver 610.88): - The full suite of 1,893 tests: 1,886 pass and 4 skip, the same 4 that skip on `main`. The 3 that fail also fail on `main` 7e2ba73e4 on this machine: `agc_driver_sample_order` and its `--grid-reference` and `--recipe-depth-locations` cases. - Validation layer, `main` against the branch with the same focused tests: the same 50 `VUID-` errors in the same 8 existing PS5 tests, none added (details in #9432). - Limbo (CUSA01664), converted with this build's relinker and its two bundled modules: a 60 s scripted run from start into gameplay with no errors and no not-implemented calls, on 22 Oct with the GPU otherwise idle. ### 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 (an integration branch for the members above; it is not meant to be merged itself) - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #9430, #9431, #9432 - [x] Fixes: none - [x] Unblocks: Limbo (CUSA01664) #6978 - [x] GPUs tested: NVIDIA GeForce RTX 5060 Ti, driver 610.88, Windows 11 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-17 00:30:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T00:30:18Z.


Progress report (4777cac → 4562537)

📈 System libraries: 43.31% (+0.08%, +28 implemented, +18 declared functions)

✅ 28 implemented
Library Name
libSceGnmDriver sceGnmAreSubmitsAllowed
libSceGnmDriver sceGnmDeleteEqEvent
libSceGnmDriver sceGnmDispatchInitDefaultHardwareState
libSceGnmDriver sceGnmDrawInitDefaultHardwareState175
libSceGnmDriver sceGnmDriverCaptureInProgress
libSceGnmDriver sceGnmDriverTriggerCapture
libSceGnmDriver sceGnmFlushGarlic
libSceGnmDriver sceGnmGetEqEventType
libSceGnmDriver sceGnmInsertPopMarker
libSceGnmDriver sceGnmInsertPushColorMarker
libSceGnmDriver sceGnmInsertPushMarker
libSceGnmDriver sceGnmInsertSetMarker
libSceGnmDriver sceGnmInsertWaitFlipDone
libSceGnmDriver sceGnmIsUserPaEnabled
libSceGnmDriver sceGnmSetCsShader
libSceGnmDriver sceGnmSetEsShader
libSceGnmDriver sceGnmSetGsShader
libSceGnmDriver sceGnmSetHsShader
libSceGnmDriver sceGnmSetLsShader
libSceGnmDriver sceGnmSetPsShader
libSceGnmDriver sceGnmSetVsShader
libSceGnmDriver sceGnmSubmitDone
libSceGnmDriver sceGnmValidateCommandBuffers
libSceGnmDriver sceRazorCaptureCommandBuffersOnlyImmediate
libSceGnmDriver sceRazorCaptureCommandBuffersOnlySinceLastFlip
libSceGnmDriver sceRazorCaptureImmediate
libSceGnmDriver sceRazorCaptureSinceLastFlip
libSceGnmDriver sceRazorIsLoaded
⚪ 10 behaviourally empty (constant return or throw)
Library Name
libSceGnmDriver sceGnmAreSubmitsAllowed
libSceGnmDriver sceGnmDriverCaptureInProgress
libSceGnmDriver sceGnmDriverTriggerCapture
libSceGnmDriver sceGnmIsUserPaEnabled
libSceGnmDriver sceGnmValidateCommandBuffers
libSceGnmDriver sceRazorCaptureCommandBuffersOnlyImmediate
libSceGnmDriver sceRazorCaptureCommandBuffersOnlySinceLastFlip
libSceGnmDriver sceRazorCaptureImmediate
libSceGnmDriver sceRazorCaptureSinceLastFlip
libSceGnmDriver sceRazorIsLoaded
🆕 18 declared as stubs
Library Name
libSceGnmDriver sceGnmAddEqEvent
libSceGnmDriver sceGnmDebugHardwareStatus
libSceGnmDriver sceGnmDingDong
libSceGnmDriver sceGnmDisableMipStatsReport
libSceGnmDriver sceGnmGetEqTimeStamp
libSceGnmDriver sceGnmGetTheTessellationFactorRingBufferBaseAddress
libSceGnmDriver sceGnmInsertSetColorMarker
libSceGnmDriver sceGnmLogicalCuIndexToPhysicalCuIndex
libSceGnmDriver sceGnmLogicalCuMaskToPhysicalCuMask
libSceGnmDriver sceGnmMapComputeQueue
libSceGnmDriver sceGnmRequestFlipAndSubmitDone
libSceGnmDriver sceGnmRequestMipStatsReportAndReset
libSceGnmDriver sceGnmSetGsRingSizes
libSceGnmDriver sceGnmSetupMipStatsReport
libSceGnmDriver sceGnmSubmitAndFlipCommandBuffers
libSceGnmDriver sceGnmSubmitCommandBuffers
libSceGnmDriver sceGnmUnmapComputeQueue
libSceVideoOut sceVideoOutCursorSetHotSpot
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227356277 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6227356277). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T00:30:18Z. --- <!-- progress-report --> ### Progress report (4777cac → 4562537) 📈 **System libraries**: 43.31% (+0.08%, +28 implemented, +18 declared functions) <details> <summary>✅ 28 implemented</summary> | Library | Name | | - | - | | libSceGnmDriver | `sceGnmAreSubmitsAllowed` | | libSceGnmDriver | `sceGnmDeleteEqEvent` | | libSceGnmDriver | `sceGnmDispatchInitDefaultHardwareState` | | libSceGnmDriver | `sceGnmDrawInitDefaultHardwareState175` | | libSceGnmDriver | `sceGnmDriverCaptureInProgress` | | libSceGnmDriver | `sceGnmDriverTriggerCapture` | | libSceGnmDriver | `sceGnmFlushGarlic` | | libSceGnmDriver | `sceGnmGetEqEventType` | | libSceGnmDriver | `sceGnmInsertPopMarker` | | libSceGnmDriver | `sceGnmInsertPushColorMarker` | | libSceGnmDriver | `sceGnmInsertPushMarker` | | libSceGnmDriver | `sceGnmInsertSetMarker` | | libSceGnmDriver | `sceGnmInsertWaitFlipDone` | | libSceGnmDriver | `sceGnmIsUserPaEnabled` | | libSceGnmDriver | `sceGnmSetCsShader` | | libSceGnmDriver | `sceGnmSetEsShader` | | libSceGnmDriver | `sceGnmSetGsShader` | | libSceGnmDriver | `sceGnmSetHsShader` | | libSceGnmDriver | `sceGnmSetLsShader` | | libSceGnmDriver | `sceGnmSetPsShader` | | libSceGnmDriver | `sceGnmSetVsShader` | | libSceGnmDriver | `sceGnmSubmitDone` | | libSceGnmDriver | `sceGnmValidateCommandBuffers` | | libSceGnmDriver | `sceRazorCaptureCommandBuffersOnlyImmediate` | | libSceGnmDriver | `sceRazorCaptureCommandBuffersOnlySinceLastFlip` | | libSceGnmDriver | `sceRazorCaptureImmediate` | | libSceGnmDriver | `sceRazorCaptureSinceLastFlip` | | libSceGnmDriver | `sceRazorIsLoaded` | </details> <details> <summary>⚪ 10 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceGnmDriver | `sceGnmAreSubmitsAllowed` | | libSceGnmDriver | `sceGnmDriverCaptureInProgress` | | libSceGnmDriver | `sceGnmDriverTriggerCapture` | | libSceGnmDriver | `sceGnmIsUserPaEnabled` | | libSceGnmDriver | `sceGnmValidateCommandBuffers` | | libSceGnmDriver | `sceRazorCaptureCommandBuffersOnlyImmediate` | | libSceGnmDriver | `sceRazorCaptureCommandBuffersOnlySinceLastFlip` | | libSceGnmDriver | `sceRazorCaptureImmediate` | | libSceGnmDriver | `sceRazorCaptureSinceLastFlip` | | libSceGnmDriver | `sceRazorIsLoaded` | </details> <details> <summary>🆕 18 declared as stubs</summary> | Library | Name | | - | - | | libSceGnmDriver | `sceGnmAddEqEvent` | | libSceGnmDriver | `sceGnmDebugHardwareStatus` | | libSceGnmDriver | `sceGnmDingDong` | | libSceGnmDriver | `sceGnmDisableMipStatsReport` | | libSceGnmDriver | `sceGnmGetEqTimeStamp` | | libSceGnmDriver | `sceGnmGetTheTessellationFactorRingBufferBaseAddress` | | libSceGnmDriver | `sceGnmInsertSetColorMarker` | | libSceGnmDriver | `sceGnmLogicalCuIndexToPhysicalCuIndex` | | libSceGnmDriver | `sceGnmLogicalCuMaskToPhysicalCuMask` | | libSceGnmDriver | `sceGnmMapComputeQueue` | | libSceGnmDriver | `sceGnmRequestFlipAndSubmitDone` | | libSceGnmDriver | `sceGnmRequestMipStatsReportAndReset` | | libSceGnmDriver | `sceGnmSetGsRingSizes` | | libSceGnmDriver | `sceGnmSetupMipStatsReport` | | libSceGnmDriver | `sceGnmSubmitAndFlipCommandBuffers` | | libSceGnmDriver | `sceGnmSubmitCommandBuffers` | | libSceGnmDriver | `sceGnmUnmapComputeQueue` | | libSceVideoOut | `sceVideoOutCursorSetHotSpot` | </details>
MarcZX10 commented 2026-10-17 00:52:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T00:52:38Z.


The current conventions run for head d604ae745 fails on four exports that the description says are among the remaining imports that throw: sceGnmAreSubmitsAllowed, sceGnmIsUserPaEnabled, sceGnmDriverCaptureInProgress, and sceRazorIsLoaded. Please make each call NotImplemented_nid_no_patch(__func__) or list the intentionally silent stub in docs/dev/debt/libSceGnmDriver.md as the convention requires.

The same run flags the unchecked “One topic per PR” item. This PR currently combines relinker TLS relocation handling, GCN shader support, AGC target/tiling/fill behavior, GNM submission, and several library exports. CONTRIBUTING.md asks for one topic per branch and follow-up work in separate PRs; your proposed relinker → shader → AGC → GNM → libs order looks reviewable as a stack with explicit Depends on links. Could you decide the intended scope and update the PR/checklist accordingly? The current merge state is also DIRTY against main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227607926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6227607926). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T00:52:38Z. --- The current conventions run for head `d604ae745` fails on four exports that the description says are among the remaining imports that throw: `sceGnmAreSubmitsAllowed`, `sceGnmIsUserPaEnabled`, `sceGnmDriverCaptureInProgress`, and `sceRazorIsLoaded`. Please make each call `NotImplemented_nid_no_patch(__func__)` or list the intentionally silent stub in `docs/dev/debt/libSceGnmDriver.md` as the convention requires. The same run flags the unchecked “One topic per PR” item. This PR currently combines relinker TLS relocation handling, GCN shader support, AGC target/tiling/fill behavior, GNM submission, and several library exports. `CONTRIBUTING.md` asks for one topic per branch and follow-up work in separate PRs; your proposed relinker → shader → AGC → GNM → libs order looks reviewable as a stack with explicit `Depends on` links. Could you decide the intended scope and update the PR/checklist accordingly? The current merge state is also DIRTY against main.
MarcZX10 commented 2026-10-17 02:09:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:09:30Z.


I have a small offline-profile follow-up for issue #1794 that adds sceNpGetAccountIdA and aligns sceUserServiceGetNpAccountId to a fixed local account ID. tools/pr_overlap.py reports a merge conflict in docs/dev/debt/libSceNpManager.md (and a source-file merge conflict), although the changed functions appear distinct from the offline-profile change. Do you have a preferred merge order? I can declare a dependency and rebase after yours lands.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228332737 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6228332737). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T02:09:30Z. --- I have a small offline-profile follow-up for issue #1794 that adds `sceNpGetAccountIdA` and aligns `sceUserServiceGetNpAccountId` to a fixed local account ID. `tools/pr_overlap.py` reports a merge conflict in `docs/dev/debt/libSceNpManager.md` (and a source-file merge conflict), although the changed functions appear distinct from the offline-profile change. Do you have a preferred merge order? I can declare a dependency and rebase after yours lands.
MarcZX10 commented 2026-10-17 02:15:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:15:18Z.


I moved the offline-profile note to the user-service debt entry and changed the include placement; the latest pr_overlap.py run no longer reports a conflict with #6977. No dependency or merge order is needed for the current diff.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6228384157 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6228384157). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T02:15:18Z. --- I moved the offline-profile note to the user-service debt entry and changed the include placement; the latest `pr_overlap.py` run no longer reports a conflict with #6977. No dependency or merge order is needed for the current diff.
oneandonlydean commented 2026-10-17 03:40:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T03:40:25Z.


Limbo at 60 fps is a nice result. This branch bundles four open PRs by other authors (#6354, #6357, #6381, #6684) plus several of your own, so merging it would land all of them without their own review. Could you mark it as a draft and keep it as the integration branch, with its member PRs listed in the body? The members can then merge one by one, and this can be rebased down as they land.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6229156257 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6229156257). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T03:40:25Z. --- Limbo at 60 fps is a nice result. This branch bundles four open PRs by other authors (#6354, #6357, #6381, #6684) plus several of your own, so merging it would land all of them without their own review. Could you mark it as a draft and keep it as the integration branch, with its member PRs listed in the body? The members can then merge one by one, and this can be rebased down as they land.
MarcZX10 commented 2026-10-17 04:03:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T04:03:10Z.


I agree this should be treated as an integration branch. The open member PRs are #5138, #6354, #6357, #6381, #6684, #6527, #6702, #5992, #5993, #5994, #6519, #6618 and #6619; #5991 has merged. I could not update the PR body or convert it to draft: GitHub returned 404 for the REST PR update and denied ConvertPullRequestToDraft for this token. If a collaborator can mark it draft, that matches the requested workflow. I will keep its members under their own review and rebase this integration branch as they land.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6229403594 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6229403594). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T04:03:10Z. --- I agree this should be treated as an integration branch. The open member PRs are #5138, #6354, #6357, #6381, #6684, #6527, #6702, #5992, #5993, #5994, #6519, #6618 and #6619; #5991 has merged. I could not update the PR body or convert it to draft: GitHub returned 404 for the REST PR update and denied `ConvertPullRequestToDraft` for this token. If a collaborator can mark it draft, that matches the requested workflow. I will keep its members under their own review and rebase this integration branch as they land.
blawesom commented 2026-10-17 10:35:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T10:35:30Z.


Rebase handoff — rebased onto current main (the full 35-commit series, authorship unchanged). The notable resolutions:

  • GuestImageReader.cpp: main now accepts RELATIVE relocations against valueless section symbols while this PR accepts defined symbols whose value matches the addend — the merged check accepts either (section symbols keep the common encoding; matching-defined symbols take your normalized output), and guest_relative_section_symbols passes with both behaviours
  • PipelineJournal.cpp: the recipe-codec asserts are pinned to the merged struct sizes (State 760, ShaderStages 116) — main added legacyVertex and two DrawKeyRegisters entries since your branch point, so please confirm the recipe codec actually covers those fields; the asserts are there to force exactly that check
  • several debt-entry docs unions across the series

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 1339/1340 — the only failure is the known main regression (agc_driver_tessellation segfault, #4727), not this PR

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/6977
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 4d7929e3a.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232879059 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6232879059). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-17T10:35:30Z. --- **Rebase handoff** — rebased onto current `main` (the full 35-commit series, authorship unchanged). The notable resolutions: - **`GuestImageReader.cpp`**: `main` now accepts RELATIVE relocations against valueless section symbols while this PR accepts defined symbols whose value matches the addend — the merged check accepts **either** (section symbols keep the common encoding; matching-defined symbols take your normalized output), and `guest_relative_section_symbols` passes with both behaviours - **`PipelineJournal.cpp`**: the recipe-codec asserts are pinned to the merged struct sizes (**State 760, ShaderStages 116**) — `main` added `legacyVertex` and two `DrawKeyRegisters` entries since your branch point, so please confirm the recipe codec actually covers those fields; the asserts are there to force exactly that check - several debt-entry docs unions across the series Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): - builds; `tools/check_conventions.py --base origin/main` passes - **full suite: 1339/1340** — the only failure is the known `main` regression (`agc_driver_tessellation` segfault, #4727), not this PR **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/6977 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `4d7929e3a`.
SandstromPL commented 2026-10-17 12:21:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SandstromPL on 2026-10-17T12:21:12Z.


@oneandonlydean on merging #6977's members one by one, here's where mine stand. All four merge cleanly into current main, and none has had a full Build yet. Get-fix's Limbo bring-up (#6978) lists #6354, #6381 and #6684 for converting the bundled libc.prx and libSceFios2.prx.

  • #6381 (PS4 needed-module tag): no dependencies. Get-fix checked it on Windows and jotitadev on macOS.
  • #6354 (PLT before code): no dependencies. It and Get-fix's #5994 rewrite the same line in docs/dev/debt/relinker.md. #5994 already has adriadam10's "merging once green", so landing #5994 first is probably simpler, and I'll rebase that line straight away.
  • #6527 (libSceDiscMap): new files only, no dependencies.
  • #6684 (DT_INIT of 0): please leave this one until #6112 has merged; it's in adriadam10's queue. ayam04 and I agreed that I'll update #6684 after that, and I'll comment on #6684 when it's ready.

Could you dispatch full Builds for #6381 and #6527, and for #6354 once its order with #5994 is settled, when you have a slot?

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233815780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6233815780). Originally posted by [SandstromPL](https://github.com/SandstromPL) on 2026-10-17T12:21:12Z. --- @oneandonlydean on merging #6977's members one by one, here's where mine stand. All four merge cleanly into current `main`, and none has had a full Build yet. Get-fix's Limbo bring-up (#6978) lists #6354, #6381 and #6684 for converting the bundled `libc.prx` and `libSceFios2.prx`. - #6381 (PS4 needed-module tag): no dependencies. Get-fix checked it on Windows and jotitadev on macOS. - #6354 (PLT before code): no dependencies. It and Get-fix's #5994 rewrite the same line in `docs/dev/debt/relinker.md`. #5994 already has adriadam10's "merging once green", so landing #5994 first is probably simpler, and I'll rebase that line straight away. - #6527 (libSceDiscMap): new files only, no dependencies. - #6684 (DT_INIT of 0): please leave this one until #6112 has merged; it's in adriadam10's queue. ayam04 and I [agreed](https://github.com/boykopovar/AnyPS5/pull/6112#issuecomment-6228636840) that I'll update #6684 after that, and I'll comment on #6684 when it's ready. Could you dispatch full Builds for #6381 and #6527, and for #6354 once its order with #5994 is settled, when you have a slot? AI-assisted: yes (Claude Code)
savvaniss commented 2026-10-17 15:50:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T15:50:40Z.


Data from a second PS4 title on this branch: Hasbro Family Fun Pack (CUSA03312, 01.00, SDK 2.57, my own dump). It reaches startup on Windows, and 44 of its 72 unresolved imports go away with a libSceGnmDriver_padebug module. Bring-up thread: #7198.

Built from this head 93eeee014, on Windows 11 Pro 26300 with WinLibs GCC 15.2.0 r7 and an AMD Radeon RX 9070 XT (32.0.31041.1004). On top are the two local changes for bytes between unwind functions from my #3093 comment; without them the eboot stops in the instruction scan and in the Windows TLS rewrite. The relinker and the libs/ it ran against come from the same tree.

The title imports its GPU driver as libSceGnmDriver_padebug, not libSceGnmDriver. Of the 72 imports unresolved at startup, 44 are exported by this branch's libSceGnmDriver:

  • 39 sceGnm*, including sceGnmSubmitCommandBuffers, sceGnmSubmitAndFlipCommandBuffers, the sceGnmSet*Shader calls and sceGnmAddEqEvent;
  • the 5 sceRazorCapture* and sceRazorIsLoaded calls.

In a local test, a copy of the built libSceGnmDriver.prx named libSceGnmDriver_padebug.prx in libs/ resolved all 44. Titles built against the PA debug driver would resolve the same way if the library were also provided under that name.

The 28 still unresolved:

  • Not in this branch (20): sceGnmDrawInitDefaultHardwareState200, sceGnmMapComputeQueueWithPriority, sceGnmUpdateGsShader, sceGnmUpdateHsShader, sceGnmUpdatePsShader, sceGnmUpdateVsShader, sceNpCheckPlus, sceNpGetAccountCountry, sceNpGetAccountDateOfBirth, sceNpGetAccountLanguage, sceNpGetParentalControlInfo, sceNpMatching2AbortContextStart, sceNpMatching2SignalingGetConnectionStatus, sceNpProfileDialogTerminate, sceNpProfileDialogUpdateStatus, sceNpTrophyAbortHandle, sceSslGetNotAfter, sceSslGetNotBefore, sceInvitationDialogClose, sceKernelPrintBacktraceWithModuleInfo.
  • In this branch's libSceSaveData.native / libSceSaveDataDialog.native but unresolved (8): sceSaveDataInitialize, sceSaveDataMount, sceSaveDataUmount, sceSaveDataDelete, sceSaveDataDirNameSearch, sceSaveDataSetParam, sceSaveDataSaveIcon, sceSaveDataDialogUpdateStatus. I haven't checked which module name the title imports them from.

The names are from tools/nid_names.py. If any of these fit into this PR or its follow-ups, I can test them on this title.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6236089151 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6236089151). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-17T15:50:40Z. --- Data from a second PS4 title on this branch: Hasbro Family Fun Pack (CUSA03312, 01.00, SDK 2.57, my own dump). It reaches startup on Windows, and 44 of its 72 unresolved imports go away with a `libSceGnmDriver_padebug` module. Bring-up thread: #7198. Built from this head `93eeee014`, on Windows 11 Pro 26300 with WinLibs GCC 15.2.0 r7 and an AMD Radeon RX 9070 XT (32.0.31041.1004). On top are the two local changes for bytes between unwind functions from [my #3093 comment](https://github.com/boykopovar/AnyPS5/issues/3093#issuecomment-6235820957); without them the eboot stops in the instruction scan and in the Windows TLS rewrite. The relinker and the `libs/` it ran against come from the same tree. The title imports its GPU driver as `libSceGnmDriver_padebug`, not `libSceGnmDriver`. Of the 72 imports unresolved at startup, 44 are exported by this branch's `libSceGnmDriver`: - 39 `sceGnm*`, including `sceGnmSubmitCommandBuffers`, `sceGnmSubmitAndFlipCommandBuffers`, the `sceGnmSet*Shader` calls and `sceGnmAddEqEvent`; - the 5 `sceRazorCapture*` and `sceRazorIsLoaded` calls. In a local test, a copy of the built `libSceGnmDriver.prx` named `libSceGnmDriver_padebug.prx` in `libs/` resolved all 44. Titles built against the PA debug driver would resolve the same way if the library were also provided under that name. The 28 still unresolved: - **Not in this branch (20):** `sceGnmDrawInitDefaultHardwareState200`, `sceGnmMapComputeQueueWithPriority`, `sceGnmUpdateGsShader`, `sceGnmUpdateHsShader`, `sceGnmUpdatePsShader`, `sceGnmUpdateVsShader`, `sceNpCheckPlus`, `sceNpGetAccountCountry`, `sceNpGetAccountDateOfBirth`, `sceNpGetAccountLanguage`, `sceNpGetParentalControlInfo`, `sceNpMatching2AbortContextStart`, `sceNpMatching2SignalingGetConnectionStatus`, `sceNpProfileDialogTerminate`, `sceNpProfileDialogUpdateStatus`, `sceNpTrophyAbortHandle`, `sceSslGetNotAfter`, `sceSslGetNotBefore`, `sceInvitationDialogClose`, `sceKernelPrintBacktraceWithModuleInfo`. - **In this branch's `libSceSaveData.native` / `libSceSaveDataDialog.native` but unresolved (8):** `sceSaveDataInitialize`, `sceSaveDataMount`, `sceSaveDataUmount`, `sceSaveDataDelete`, `sceSaveDataDirNameSearch`, `sceSaveDataSetParam`, `sceSaveDataSaveIcon`, `sceSaveDataDialogUpdateStatus`. I haven't checked which module name the title imports them from. The names are from `tools/nid_names.py`. If any of these fit into this PR or its follow-ups, I can test them on this title. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-17 20:51:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T20:51:52Z.


Coordination note from reviewing the overlap report: this branch includes matching-defined-symbol R_X86_64_RELATIVE handling in both GuestImageReader.cpp and CodeInstructionCollector.cpp, which is also the focused behavior in open PR #6357. The branch’s current test list does not include #6357’s guest_none_relocations fixture. Please coordinate with that PR or carry its focused regression cases so the behavior remains covered whichever change lands first.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6240858441 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6240858441). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T20:51:52Z. --- Coordination note from reviewing the overlap report: this branch includes matching-defined-symbol `R_X86_64_RELATIVE` handling in both `GuestImageReader.cpp` and `CodeInstructionCollector.cpp`, which is also the focused behavior in open PR #6357. The branch’s current test list does not include #6357’s `guest_none_relocations` fixture. Please coordinate with that PR or carry its focused regression cases so the behavior remains covered whichever change lands first.
Amoenus commented 2026-10-17 21:16:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T21:16:22Z.


The focused PS5 thick SW_4KB_S_X layout addition needed by Sonic PPSA99902 (#7260) is now PR #7294, head ca9ec74020 on main 8690d92f07. It adds AMD GFX10 3D addressing for 1/2/4/8/16-byte elements.

git merge-tree against your published 93eeee0141 confirms one content conflict in TextureDetiler::pipeline: your GCN branch wraps the existing thick branch next to this mode-map addition. The two capabilities are independent.

Following the independent isolation check above, I submitted the small change for focused review with this overlap disclosed. Proposed order is #7294 first, then preserving its map entry inside #6977's thick branch. If you need #6977 first, I can rebase promptly. This is a proposed merge order, not a claim of your approval; no change to your PS4 implementation is requested.

Full Windows/Linux relinker+library builds and CPU/load/draw/writeback groups pass on the exact published head, with RTX5080, AMD Radeon Graphics and lavapipe coverage. The separate volume-mip fix is preserved on the fork; a combined title replay remains next.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241229155 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6241229155). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-17T21:16:22Z. --- <!-- codex-thick-s4x-coordination-v1 --> The focused PS5 thick `SW_4KB_S_X` layout addition needed by Sonic PPSA99902 (#7260) is now [PR #7294](https://github.com/boykopovar/AnyPS5/pull/7294), head `ca9ec74020` on main `8690d92f07`. It adds AMD GFX10 3D addressing for 1/2/4/8/16-byte elements. `git merge-tree` against your published `93eeee0141` confirms one content conflict in `TextureDetiler::pipeline`: your GCN branch wraps the existing thick branch next to this mode-map addition. The two capabilities are independent. Following the independent isolation check above, I submitted the small change for focused review with this overlap disclosed. Proposed order is #7294 first, then preserving its map entry inside #6977's thick branch. If you need #6977 first, I can rebase promptly. This is a proposed merge order, not a claim of your approval; no change to your PS4 implementation is requested. Full Windows/Linux relinker+library builds and CPU/load/draw/writeback groups pass on the exact published head, with RTX5080, AMD Radeon Graphics and lavapipe coverage. The separate [volume-mip fix](https://github.com/Amoenus/AnyPS5/commit/38dcc17967ade5f569122bfc504389d3a350626e) is preserved on the fork; a combined title replay remains next.
MarcZX10 commented 2026-10-17 21:19:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T21:19:50Z.


I checked the proposed thick SW_4KB_S_X commit f89f23a3f against current main (cf217c51c): it merges cleanly there. The overlap check identifies #6977’s TextureDetiler::pipeline dispatcher as the only code overlap; the two changes have no runtime dependency. I also inspected the shared TextureTiling.cpp/test files with #7258: that PR narrows sampled array views, while this change adds thick 3D address geometry, so they are distinct.

From a review-isolation standpoint, the simplest order looks like submitting the small S4X layout change on current main first, then rebasing #6977 across the dispatcher hunk. If you prefer #6977 first, the layout change can be applied afterward. I’m leaving the submission with the contributors coordinating the branches.,

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241265699 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6241265699). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-17T21:19:50Z. --- I checked the proposed thick `SW_4KB_S_X` commit `f89f23a3f` against current `main` (`cf217c51c`): it merges cleanly there. The overlap check identifies #6977’s `TextureDetiler::pipeline` dispatcher as the only code overlap; the two changes have no runtime dependency. I also inspected the shared `TextureTiling.cpp`/test files with #7258: that PR narrows sampled array views, while this change adds thick 3D address geometry, so they are distinct. From a review-isolation standpoint, the simplest order looks like submitting the small S4X layout change on current `main` first, then rebasing #6977 across the dispatcher hunk. If you prefer #6977 first, the layout change can be applied afterward. I’m leaving the submission with the contributors coordinating the branches.,
DealPotato commented 2026-10-18 17:21:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DealPotato on 2026-10-18T17:21:32Z.


Tested #6977 (head 93eeee014) with inFAMOUS Second Son (CUSA00004, my own dump). Windows 11 Pro, MinGW-w64 GCC 15.2.0 (WinLibs r7), NVIDIA GeForce RTX 4070 (driver 610.88). It does not reach the first frame yet; the stops below are in conversion and loading, before any GPU work.

1. tools/unwrap_self.py refuses the bundled modules

FAIL: sce_module/libc.prx: segment 1 vaddr 0xd8000 is in no PT_LOAD
FAIL: sce_module/libSceFios2.prx: segment 1 vaddr 0x5c000 is in no PT_LOAD

I used ELFs I had unwrapped earlier for the rest of the test.

2. Conversion stops on a jump table placed after the function's unwind range

FAIL: Unsupported Windows guest TLS instruction (bytes: 65 ff ff) (offset 0x6510cc)

The function at 0x64c870 has an FDE ending at 0x64d0c3. It ends in a call to a noreturn function (call 0x984360) and nop. Its switch reads a table at 0x64d0c4 (lea rcx, [rip+0x6dd] at 0x64c9e0, then movslq (%rcx,%rax,4),%rax). The table lies right after the FDE, so FindInlineJumpTables (#6618) does not see it. addAddressTakenRoot then adds 0x64d0c4 as a code root, and the CFG decodes the table entries (65 ff ff ff) as instructions.

With a local change, the relinker converts the eboot and both modules. The change takes an RIP-relative lea target as data, not as a root, when it is followed by a movsxd r64, [table + index*4] load from the same register. For SCE images, it also does so when the target is not an unwind function. The CFG never enters such a target, including by fall-through after a noreturn call. I can send it as a follow-up PR on top of #6618 if that suits you.

3. tools/import_audit.py --modules refuses the unwrapped PS4 modules

FAIL: sce_module/libc.prx: incomplete dynamic string or symbol table

4. Imports this branch does not export

The audit was run without --modules, so libSceFios2 imports and the bundled libc's own imports are left out. The loader currently stops at libSceVideodec.prx. The other imports the libraries do not export:

  • libSceGnmDriver (47):
    • Draws: sceGnmDrawIndex, sceGnmDrawIndexAuto, sceGnmDrawIndexOffset, sceGnmDrawIndexMultiInstanced, sceGnmDrawOpaqueAuto.
    • Indirect draws: sceGnmDrawIndirect, sceGnmDrawIndexIndirect, sceGnmDrawIndirectMulti, sceGnmDrawIndexIndirectMulti, sceGnmDrawIndirectCountMulti, sceGnmDrawIndexIndirectCountMulti.
    • Dispatches: sceGnmDispatchDirect, sceGnmDispatchIndirect, sceGnmDispatchIndirectOnMec.
    • Shaders: sceGnmSetEmbeddedVsShader, sceGnmSetEmbeddedPsShader, sceGnmSetPsShader350, sceGnmSetCsShaderWithModifier, sceGnmUpdateVsShader, sceGnmUpdatePsShader350, sceGnmUpdateHsShader, sceGnmUpdateGsShader.
    • State: sceGnmSetVgtControl, sceGnmResetVgtControl, sceGnmSetWaveLimitMultipliers, sceGnmDrawInitToDefaultContextState400, sceGnmDrawInitDefaultHardwareState350.
    • Workloads: sceGnmCreateWorkloadStream, sceGnmDestroyWorkloadStream, sceGnmBeginWorkload, sceGnmEndWorkload, sceGnmSubmitCommandBuffersForWorkload, sceGnmSubmitAndFlipCommandBuffersForWorkload, sceGnmRequestFlipAndSubmitDoneForWorkload, sceGnmDingDongForWorkload.
    • Queries and markers: sceGnmMapComputeQueueWithPriority, sceGnmGetOffChipTessellationBufferSize, sceGnmGetNumTcaUnits, sceGnmGetShaderStatus, sceGnmGetShaderProgramBaseAddress, sceGnmGetGpuBlockStatus, sceGnmGetGpuInfoStatus, sceGnmGetProtectionFaultTimeStamp, sceGnmGetLastWaitedAddress, sceGnmDriverTraceInProgress, sceGnmInsertDingDongMarker, sceGnmInsertThreadTraceMarker.
  • libSceVideodec (whole library): sceVideodecCreateDecoder, sceVideodecDeleteDecoder, sceVideodecDecode, sceVideodecFlush, sceVideodecReset, sceVideodecQueryResourceInfo.
  • libSceVideoOut: sceVideoOutGetDeviceCapabilityInfo_, sceVideoOutModeSetAny_, sceVideoOutConfigureOutputMode_.
  • libSceNpManager: sceNpCheckNpAvailabilityA, sceNpRegisterGamePresenceCallbackA, sceNpGetGamePresenceStatusA.
  • libkernel: sceKernelIsNeoMode, sceKernelPrintBacktraceWithModuleInfo.
  • Others:
    • libSceSaveData: sceSaveDataMount2.
    • libScePlayGo: scePlayGoSetLanguageMask.
    • libSceDiscMap: fJgP+wqifno, imported by libSceFios2.

Context

On a separate local branch, based on an older main, Second Son loads my PS4 saves into its open world. That branch has a GnmDriver of its own over the AGC driver and covers all of the imports above, but it runs at only about 1-2 fps in the open world. It overlaps your shader, tiling and Gnm work, so I'd rather not open competing PRs. Once #6977 lands, or in whatever split you prefer, I can port the missing pieces onto it as small follow-ups:

  • the jump-table fix;
  • the Gnm draw, dispatch, shader and workload calls;
  • libSceVideodec;
  • the PS4 VideoOut mode queries;
  • the smaller system calls.

Each would be tested with Second Son on your branch. Let me know which of these you'd take or already have locally.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252843490 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6252843490). Originally posted by [DealPotato](https://github.com/DealPotato) on 2026-10-18T17:21:32Z. --- Tested #6977 (head `93eeee014`) with inFAMOUS Second Son (CUSA00004, my own dump). Windows 11 Pro, MinGW-w64 GCC 15.2.0 (WinLibs r7), NVIDIA GeForce RTX 4070 (driver 610.88). It does not reach the first frame yet; the stops below are in conversion and loading, before any GPU work. **1. `tools/unwrap_self.py` refuses the bundled modules** ``` FAIL: sce_module/libc.prx: segment 1 vaddr 0xd8000 is in no PT_LOAD FAIL: sce_module/libSceFios2.prx: segment 1 vaddr 0x5c000 is in no PT_LOAD ``` I used ELFs I had unwrapped earlier for the rest of the test. **2. Conversion stops on a jump table placed after the function's unwind range** ``` FAIL: Unsupported Windows guest TLS instruction (bytes: 65 ff ff) (offset 0x6510cc) ``` The function at `0x64c870` has an FDE ending at `0x64d0c3`. It ends in a call to a noreturn function (`call 0x984360`) and `nop`. Its switch reads a table at `0x64d0c4` (`lea rcx, [rip+0x6dd]` at `0x64c9e0`, then `movslq (%rcx,%rax,4),%rax`). The table lies right after the FDE, so `FindInlineJumpTables` (#6618) does not see it. `addAddressTakenRoot` then adds `0x64d0c4` as a code root, and the CFG decodes the table entries (`65 ff ff ff`) as instructions. With a local change, the relinker converts the eboot and both modules. The change takes an RIP-relative `lea` target as data, not as a root, when it is followed by a `movsxd r64, [table + index*4]` load from the same register. For SCE images, it also does so when the target is not an unwind function. The CFG never enters such a target, including by fall-through after a noreturn call. I can send it as a follow-up PR on top of #6618 if that suits you. **3. `tools/import_audit.py --modules` refuses the unwrapped PS4 modules** ``` FAIL: sce_module/libc.prx: incomplete dynamic string or symbol table ``` **4. Imports this branch does not export** The audit was run without `--modules`, so libSceFios2 imports and the bundled libc's own imports are left out. The loader currently stops at `libSceVideodec.prx`. The other imports the libraries do not export: - **libSceGnmDriver (47):** - Draws: `sceGnmDrawIndex`, `sceGnmDrawIndexAuto`, `sceGnmDrawIndexOffset`, `sceGnmDrawIndexMultiInstanced`, `sceGnmDrawOpaqueAuto`. - Indirect draws: `sceGnmDrawIndirect`, `sceGnmDrawIndexIndirect`, `sceGnmDrawIndirectMulti`, `sceGnmDrawIndexIndirectMulti`, `sceGnmDrawIndirectCountMulti`, `sceGnmDrawIndexIndirectCountMulti`. - Dispatches: `sceGnmDispatchDirect`, `sceGnmDispatchIndirect`, `sceGnmDispatchIndirectOnMec`. - Shaders: `sceGnmSetEmbeddedVsShader`, `sceGnmSetEmbeddedPsShader`, `sceGnmSetPsShader350`, `sceGnmSetCsShaderWithModifier`, `sceGnmUpdateVsShader`, `sceGnmUpdatePsShader350`, `sceGnmUpdateHsShader`, `sceGnmUpdateGsShader`. - State: `sceGnmSetVgtControl`, `sceGnmResetVgtControl`, `sceGnmSetWaveLimitMultipliers`, `sceGnmDrawInitToDefaultContextState400`, `sceGnmDrawInitDefaultHardwareState350`. - Workloads: `sceGnmCreateWorkloadStream`, `sceGnmDestroyWorkloadStream`, `sceGnmBeginWorkload`, `sceGnmEndWorkload`, `sceGnmSubmitCommandBuffersForWorkload`, `sceGnmSubmitAndFlipCommandBuffersForWorkload`, `sceGnmRequestFlipAndSubmitDoneForWorkload`, `sceGnmDingDongForWorkload`. - Queries and markers: `sceGnmMapComputeQueueWithPriority`, `sceGnmGetOffChipTessellationBufferSize`, `sceGnmGetNumTcaUnits`, `sceGnmGetShaderStatus`, `sceGnmGetShaderProgramBaseAddress`, `sceGnmGetGpuBlockStatus`, `sceGnmGetGpuInfoStatus`, `sceGnmGetProtectionFaultTimeStamp`, `sceGnmGetLastWaitedAddress`, `sceGnmDriverTraceInProgress`, `sceGnmInsertDingDongMarker`, `sceGnmInsertThreadTraceMarker`. - **libSceVideodec (whole library):** `sceVideodecCreateDecoder`, `sceVideodecDeleteDecoder`, `sceVideodecDecode`, `sceVideodecFlush`, `sceVideodecReset`, `sceVideodecQueryResourceInfo`. - **libSceVideoOut:** `sceVideoOutGetDeviceCapabilityInfo_`, `sceVideoOutModeSetAny_`, `sceVideoOutConfigureOutputMode_`. - **libSceNpManager:** `sceNpCheckNpAvailabilityA`, `sceNpRegisterGamePresenceCallbackA`, `sceNpGetGamePresenceStatusA`. - **libkernel:** `sceKernelIsNeoMode`, `sceKernelPrintBacktraceWithModuleInfo`. - **Others:** - libSceSaveData: `sceSaveDataMount2`. - libScePlayGo: `scePlayGoSetLanguageMask`. - libSceDiscMap: `fJgP+wqifno`, imported by libSceFios2. **Context** On a separate local branch, based on an older `main`, Second Son loads my PS4 saves into its open world. That branch has a GnmDriver of its own over the AGC driver and covers all of the imports above, but it runs at only about 1-2 fps in the open world. It overlaps your shader, tiling and Gnm work, so I'd rather not open competing PRs. Once #6977 lands, or in whatever split you prefer, I can port the missing pieces onto it as small follow-ups: - the jump-table fix; - the Gnm draw, dispatch, shader and workload calls; - libSceVideodec; - the PS4 VideoOut mode queries; - the smaller system calls. Each would be tested with Second Son on your branch. Let me know which of these you'd take or already have locally. AI-assisted: yes (Claude Code).
DealPotato commented 2026-10-18 18:01:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DealPotato on 2026-10-18T18:01:52Z.


Follow-up on Second Son (CUSA00004) on #6977. Same machine as before, with the trailing-jump-table fix (#7620) and the local changes below. With these, the title converts, loads, opens its display buffers and submits graphics and compute work. It stops at the first GCN image instruction on a 1D texture. Nothing below is pushed yet; I can share any of it as a diff or a follow-up PR, as you prefer.

Loading

  • PS4 save data module names: libSceSaveData.prx and libSceSaveDataDialog.prx are the legacy modules. The PS4 entry points live in the .native ones, so sceSaveDataDelete, DirNameSearch, SaveIcon, SetParam, Umount and sceSaveDataDialogUpdateStatus were unresolved on Windows. Copying the .native modules over the plain names worked.
  • sceSaveDataMount2: added, taking the PS4 SceSaveDataMount2 as Mount3 without the system blocks and resource fields.
  • Small additions:
    • libSceVideodec: the PS4 entry points over libSceVideodec2's decoder.
    • VideoOut: sceVideoOutGetDeviceCapabilityInfo_, ModeSetAny_, ConfigureOutputMode_.
    • NpManager: sceNpCheckNpAvailabilityA, RegisterGamePresenceCallbackA, GetGamePresenceStatusA.
    • PlayGo: scePlayGoSetLanguageMask, and plgo chunk files accepted.
    • DiscMap: fJgP+wqifno, which returns "no bitmap information".
    • libkernel: sceKernelIsNeoMode returns 0; sceKernelPrintBacktraceWithModuleInfo is a NotImplemented stub.
    • The 47 missing Gnm imports: real writers for the draw and dispatch packets, the 350/400 init variants and the shader variants, which share the register layouts of the existing ones; NotImplemented stubs for the rest.
  • sceNetCtlGetInfo code 12 (DHCP hostname): answered with an empty name.
  • sceVideoOutRegisterBuffers: Second Son sets attribute option = 8 (strict colorimetry in shadPS4's naming), which the PS4 path rejects with INVALID_OPTION. Accepting it and otherwise ignoring it gets past this.

Compute queues

Second Son submits compute work through sceGnmMapComputeQueue and sceGnmDingDong, which are NotImplemented on the branch. I mapped the rings and, on each DingDong:

  • read the words between the read offset and the new offset;
  • inline the contents of INDIRECT_BUFFER packets;
  • run each packet through Lower;
  • clear the shader-type bit;
  • submit to AGC queue 0x20 + n through a small AgcDriverSubmitQueue_nid_postfix(commands, dwords, queue) beside AgcDriverSubmitGraphics_nid_postfix.

Without the inlining, the executor got raw PS4 packets from the indirect buffers and rejected the 0x6875xxxx marker NOPs and the compute flag on RELEASE_MEM.

Lowering gaps hit in Second Son's command buffers

  • PS4 RELEASE_MEM is 7 dwords; the executor wants the 8-dword GFX10 form. Widened as the EOP lowering does.
  • RELEASE_MEM data select 4 (GPU core clock counter) is rejected: the executor accepts selects 0-3. I mapped it to 3, the 64-bit clock.
  • ACQUIRE_MEM with CP_COHER_CNTL 0x00c58000 fails with "unsupported ACQUIRE_MEM control flags": only bit 16 is outside the legacy mask. Masking the 7-dword form with 0xfeecfffb, and the lowered SURFACE_SYNC likewise, gets past it.

Shaders

  • GCN MTBUF: the branch throws on every GCN MTBUF. Second Son's first shader has TBUFFER_LOAD_FORMAT_XYZW. The fix re-encodes it with the format field taken from GcnBufferFormats()[(dfmt << 3) | nfmt]; GFX10 ops 0-7 match GCN's. Shaders then get further.
  • Current stop:
shader 0x2edab2f00 stage 5: GCN image instruction on a descriptor of type 8 needs a different address count than its inferred dimension; not implemented

A 1D texture (T# type 8) is sampled with one address, while the GCN MIMG re-encoding infers 2D. I stopped here because this is your design call. Would you treat a 1D T# as a 2D image of height 1, or carry the T# type into the dimension inference?

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253259006 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6253259006). Originally posted by [DealPotato](https://github.com/DealPotato) on 2026-10-18T18:01:52Z. --- Follow-up on Second Son (CUSA00004) on #6977. Same machine as before, with the trailing-jump-table fix (#7620) and the local changes below. With these, the title converts, loads, opens its display buffers and submits graphics and compute work. It stops at the first GCN image instruction on a 1D texture. Nothing below is pushed yet; I can share any of it as a diff or a follow-up PR, as you prefer. **Loading** - **PS4 save data module names:** `libSceSaveData.prx` and `libSceSaveDataDialog.prx` are the legacy modules. The PS4 entry points live in the `.native` ones, so `sceSaveDataDelete`, `DirNameSearch`, `SaveIcon`, `SetParam`, `Umount` and `sceSaveDataDialogUpdateStatus` were unresolved on Windows. Copying the `.native` modules over the plain names worked. - **`sceSaveDataMount2`:** added, taking the PS4 `SceSaveDataMount2` as `Mount3` without the system blocks and resource fields. - **Small additions:** - libSceVideodec: the PS4 entry points over libSceVideodec2's decoder. - VideoOut: `sceVideoOutGetDeviceCapabilityInfo_`, `ModeSetAny_`, `ConfigureOutputMode_`. - NpManager: `sceNpCheckNpAvailabilityA`, `RegisterGamePresenceCallbackA`, `GetGamePresenceStatusA`. - PlayGo: `scePlayGoSetLanguageMask`, and `plgo` chunk files accepted. - DiscMap: `fJgP+wqifno`, which returns "no bitmap information". - libkernel: `sceKernelIsNeoMode` returns 0; `sceKernelPrintBacktraceWithModuleInfo` is a NotImplemented stub. - The 47 missing Gnm imports: real writers for the draw and dispatch packets, the 350/400 init variants and the shader variants, which share the register layouts of the existing ones; NotImplemented stubs for the rest. - **`sceNetCtlGetInfo` code 12 (DHCP hostname):** answered with an empty name. - **`sceVideoOutRegisterBuffers`:** Second Son sets attribute `option = 8` (strict colorimetry in shadPS4's naming), which the PS4 path rejects with `INVALID_OPTION`. Accepting it and otherwise ignoring it gets past this. **Compute queues** Second Son submits compute work through `sceGnmMapComputeQueue` and `sceGnmDingDong`, which are NotImplemented on the branch. I mapped the rings and, on each DingDong: - read the words between the read offset and the new offset; - inline the contents of `INDIRECT_BUFFER` packets; - run each packet through `Lower`; - clear the shader-type bit; - submit to AGC queue `0x20 + n` through a small `AgcDriverSubmitQueue_nid_postfix(commands, dwords, queue)` beside `AgcDriverSubmitGraphics_nid_postfix`. Without the inlining, the executor got raw PS4 packets from the indirect buffers and rejected the `0x6875xxxx` marker NOPs and the compute flag on `RELEASE_MEM`. **Lowering gaps hit in Second Son's command buffers** - **PS4 `RELEASE_MEM`** is 7 dwords; the executor wants the 8-dword GFX10 form. Widened as the EOP lowering does. - **`RELEASE_MEM` data select 4** (GPU core clock counter) is rejected: the executor accepts selects 0-3. I mapped it to 3, the 64-bit clock. - **`ACQUIRE_MEM` with `CP_COHER_CNTL` `0x00c58000`** fails with "unsupported ACQUIRE_MEM control flags": only bit 16 is outside the legacy mask. Masking the 7-dword form with `0xfeecfffb`, and the lowered `SURFACE_SYNC` likewise, gets past it. **Shaders** - **GCN `MTBUF`:** the branch throws on every GCN `MTBUF`. Second Son's first shader has `TBUFFER_LOAD_FORMAT_XYZW`. The fix re-encodes it with the format field taken from `GcnBufferFormats()[(dfmt << 3) | nfmt]`; GFX10 ops 0-7 match GCN's. Shaders then get further. - **Current stop:** ``` shader 0x2edab2f00 stage 5: GCN image instruction on a descriptor of type 8 needs a different address count than its inferred dimension; not implemented ``` A 1D texture (T# type 8) is sampled with one address, while the GCN `MIMG` re-encoding infers 2D. I stopped here because this is your design call. Would you treat a 1D T# as a 2D image of height 1, or carry the T# type into the dimension inference? AI-assisted: yes (Claude Code).
savvaniss commented 2026-10-18 20:59:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T20:59:52Z.


Leave-one-out data for this integration branch's members, from a second retail title: Hasbro Family Fun Pack (CUSA03312, base 01.00, my own dump).

Relinker-only Release build, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7. Starting from main f3059421f, I merged, in this order: #7660, #6619 (a9fa0e8b0), #5138 (5f5641732), #6381 (6f8d9a09d), 3b158c1e4 from #6977, #6354 (81561867f), #6357 (32fe3aa8b), #6684 (ab9d21afc) and #6618 (bf06a8e5c). With that stack, the Linux and --windows conversions of the eboot and its 9 bundled modules complete. I then rebuilt the relinker once per member with only that member left out.

Left out Linux --windows
#6619 eboot: Strict filter: inconsistent FDE function range (offset 0xd42390) same
#5138 (and 3b158c1e4, which applies only on top of it) libSceFace.prx: Unsupported symbol attributes: same
#6381 Cyclic guest initialization dependency: libc.prx same
3b158c1e4 (no separate PR) libSceFios2.prx: Invalid guest TLS relocation same
#6354 libSceFace.prx: PLT not found after the last unwind function (offset 0x27e21) same
#6357 libc.prx: RELATIVE relocation has a symbol same
#6684 libc.prx: Guest PREINIT_ARRAY has no module initializer same
#6618 converts libSceFios2.prx: Unsupported Windows guest TLS instruction (bytes: 64 fe ff) (offset 0x12a7c)
#7660 (gap bytes, from #3093) eboot: Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x783c70) same

So for this title every member is needed, #6618 only for Windows, and the TLS commit 3b158c1e4 is needed for libSceFios2.prx but has no PR of its own yet. The Windows GS stop (stop 9 in my #3093 comment) no longer appears on this main, because #6102 traps GS accesses. Conflicts I resolved locally: #5138 against #6357 in GuestImageReader.cpp (I accepted either form), #6618 against #7660 in RelinkerPipeline.cpp (I kept both), and #6684 in MacOsGuestModuleWriter.cpp (I kept both lines); the rest were in docs/dev/debt.

I've posted the same result on each member PR.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255080272 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6255080272). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-18T20:59:52Z. --- Leave-one-out data for this integration branch's members, from a second retail title: Hasbro Family Fun Pack (CUSA03312, base 01.00, my own dump). Relinker-only Release build, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7. Starting from `main` `f3059421f`, I merged, in this order: #7660, #6619 (`a9fa0e8b0`), #5138 (`5f5641732`), #6381 (`6f8d9a09d`), 3b158c1e4 from #6977, #6354 (`81561867f`), #6357 (`32fe3aa8b`), #6684 (`ab9d21afc`) and #6618 (`bf06a8e5c`). With that stack, the Linux and `--windows` conversions of the eboot and its 9 bundled modules complete. I then rebuilt the relinker once per member with only that member left out. | Left out | Linux | `--windows` | |---|---|---| | #6619 | eboot: `Strict filter: inconsistent FDE function range (offset 0xd42390)` | same | | #5138 (and 3b158c1e4, which applies only on top of it) | `libSceFace.prx`: `Unsupported symbol attributes:` | same | | #6381 | `Cyclic guest initialization dependency: libc.prx` | same | | 3b158c1e4 (no separate PR) | `libSceFios2.prx`: `Invalid guest TLS relocation` | same | | #6354 | `libSceFace.prx`: `PLT not found after the last unwind function (offset 0x27e21)` | same | | #6357 | `libc.prx`: `RELATIVE relocation has a symbol` | same | | #6684 | `libc.prx`: `Guest PREINIT_ARRAY has no module initializer` | same | | #6618 | converts | `libSceFios2.prx`: `Unsupported Windows guest TLS instruction (bytes: 64 fe ff) (offset 0x12a7c)` | | #7660 (gap bytes, from #3093) | eboot: `Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x783c70)` | same | So for this title every member is needed, #6618 only for Windows, and the TLS commit 3b158c1e4 is needed for `libSceFios2.prx` but has no PR of its own yet. The Windows GS stop (stop 9 in my #3093 comment) no longer appears on this `main`, because #6102 traps GS accesses. Conflicts I resolved locally: #5138 against #6357 in `GuestImageReader.cpp` (I accepted either form), #6618 against #7660 in `RelinkerPipeline.cpp` (I kept both), and #6684 in `MacOsGuestModuleWriter.cpp` (I kept both lines); the rest were in `docs/dev/debt`. I've posted the same result on each member PR. AI-assisted: yes (Claude Code)
savvaniss commented 2026-10-18 21:07:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T21:07:31Z.


Follow-up on the 8 save-data imports CUSA03312 left unresolved at startup in my earlier comment: sceSaveDataInitialize, sceSaveDataMount, sceSaveDataUmount, sceSaveDataDelete, sceSaveDataDirNameSearch, sceSaveDataSetParam, sceSaveDataSaveIcon and sceSaveDataDialogUpdateStatus.

The title's DT_NEEDED names libSceSaveData.prx and libSceSaveDataDialog.prx, and the Windows entry stub searches only those files, plus libc.prx, for each import (WindowsEntryStubBuilder.cpp). On this branch the plain libSceSaveData exports 9 functions, all PS5-era (sceSaveDataInitialize3, sceSaveDataTransferringMount, …), and libSceSaveDataDialog exports 8. All 8 missing functions are in the .native libraries, which this branch's PS4 wrappers (sceSaveDataInitialize, sceSaveDataMount, sceSaveDataUmount) also went into. The .native exports are a superset of the plain ones: 36 against 9, and 10 against 8.

Test: built from this head 93eeee014 with the setup from the earlier comment. I replaced libs\libSceSaveData.prx and libs\libSceSaveDataDialog.prx with copies of the .native files. The startup import check then went from 28 to 20 unresolved imports. Exactly these 8 resolved, and no new import appeared. The remaining 20 are the not-implemented ones listed earlier.

The comment at the top of libSceSaveData/Export.cpp says imports bind "via the relinker alias table, by name" to the plain library, but I found no such table in core/relinker or core/libs/nid. A general fix could build the plain libraries from the .native sources, as libSceNgs2 does with add_sce_ngs2_library and as this branch now does for libSceAjm with AjmLibrary.cmake. That would also remove the second save-data implementation in SaveDataCore.hpp. I can try it as a follow-up if that direction is right.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255158001 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6255158001). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-18T21:07:31Z. --- Follow-up on the 8 save-data imports CUSA03312 left unresolved at startup in [my earlier comment](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6236089151): `sceSaveDataInitialize`, `sceSaveDataMount`, `sceSaveDataUmount`, `sceSaveDataDelete`, `sceSaveDataDirNameSearch`, `sceSaveDataSetParam`, `sceSaveDataSaveIcon` and `sceSaveDataDialogUpdateStatus`. The title's DT_NEEDED names `libSceSaveData.prx` and `libSceSaveDataDialog.prx`, and the Windows entry stub searches only those files, plus `libc.prx`, for each import (`WindowsEntryStubBuilder.cpp`). On this branch the plain `libSceSaveData` exports 9 functions, all PS5-era (`sceSaveDataInitialize3`, `sceSaveDataTransferringMount`, …), and `libSceSaveDataDialog` exports 8. All 8 missing functions are in the `.native` libraries, which this branch's PS4 wrappers (`sceSaveDataInitialize`, `sceSaveDataMount`, `sceSaveDataUmount`) also went into. The `.native` exports are a superset of the plain ones: 36 against 9, and 10 against 8. Test: built from this head `93eeee014` with the setup from the earlier comment. I replaced `libs\libSceSaveData.prx` and `libs\libSceSaveDataDialog.prx` with copies of the `.native` files. The startup import check then went from 28 to 20 unresolved imports. Exactly these 8 resolved, and no new import appeared. The remaining 20 are the not-implemented ones listed earlier. The comment at the top of `libSceSaveData/Export.cpp` says imports bind "via the relinker alias table, by name" to the plain library, but I found no such table in `core/relinker` or `core/libs/nid`. A general fix could build the plain libraries from the `.native` sources, as `libSceNgs2` does with `add_sce_ngs2_library` and as this branch now does for `libSceAjm` with `AjmLibrary.cmake`. That would also remove the second save-data implementation in `SaveDataCore.hpp`. I can try it as a follow-up if that direction is right. AI-assisted: yes (Claude Code)
DealPotato commented 2026-10-18 21:29:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by DealPotato on 2026-10-18T21:29:23Z.


@savvaniss This matches what I saw with Second Son (CUSA00004). The same save-data imports resolved once I copied the .native modules over the plain names. Building the plain libraries from the .native sources looks like the right fix to me.

Of your 20 remaining imports, 5 are in follow-up branches I have locally on top of this one. They aren't pushed yet:

  • sceGnmMapComputeQueueWithPriority: maps the queue like sceGnmMapComputeQueue and ignores the priority.
  • sceGnmUpdateVsShader: writes the same registers as sceGnmSetVsShader.
  • sceGnmUpdateHsShader, sceGnmUpdateGsShader and sceKernelPrintBacktraceWithModuleInfo: NotImplemented stubs. They resolve at load and throw only if called.

I'll push them once Get-fix says which of them fit here. A run on CUSA03312 would be a useful second check.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6255372900 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6255372900). Originally posted by [DealPotato](https://github.com/DealPotato) on 2026-10-18T21:29:23Z. --- @savvaniss This matches what I saw with Second Son (CUSA00004). The same save-data imports resolved once I copied the `.native` modules over the plain names. Building the plain libraries from the `.native` sources looks like the right fix to me. Of your 20 remaining imports, 5 are in follow-up branches I have locally on top of this one. They aren't pushed yet: - `sceGnmMapComputeQueueWithPriority`: maps the queue like `sceGnmMapComputeQueue` and ignores the priority. - `sceGnmUpdateVsShader`: writes the same registers as `sceGnmSetVsShader`. - `sceGnmUpdateHsShader`, `sceGnmUpdateGsShader` and `sceKernelPrintBacktraceWithModuleInfo`: `NotImplemented` stubs. They resolve at load and throw only if called. I'll push them once Get-fix says which of them fit here. A run on CUSA03312 would be a useful second check. AI-assisted: yes (Claude Code)
savvaniss commented 2026-10-19 07:11:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T07:11:16Z.


The save-data follow-up from my last comment is now draft #7780. It builds libSceSaveData and libSceSaveDataDialog from the .native sources, the way libSceNgs2 is built. Applied on this head 93eeee014 with only those two libraries rebuilt, CUSA03312 goes from 28 unresolved imports at startup to 20, with all 8 save-data imports resolved. Your PS4 wrappers (sceSaveDataInitialize, sceSaveDataMount, sceSaveDataUmount) in libSceSaveData.native then reach PS4 titles under the plain module name. It's a draft because of one open question: the old plain implementation's save-data memory location isn't migrated (see the PR).

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261754845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6261754845). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T07:11:16Z. --- The save-data follow-up from [my last comment](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6255158001) is now draft #7780. It builds `libSceSaveData` and `libSceSaveDataDialog` from the `.native` sources, the way `libSceNgs2` is built. Applied on this head `93eeee014` with only those two libraries rebuilt, CUSA03312 goes from 28 unresolved imports at startup to 20, with all 8 save-data imports resolved. Your PS4 wrappers (`sceSaveDataInitialize`, `sceSaveDataMount`, `sceSaveDataUmount`) in `libSceSaveData.native` then reach PS4 titles under the plain module name. It's a draft because of one open question: the old plain implementation's save-data memory location isn't migrated (see the PR). AI-assisted: yes (Claude Code)
savvaniss commented 2026-10-19 12:33:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T12:33:03Z.


@Get-fix CUSA03312 on this PR's PS4 path now plays its intro video and stops while loading its start menu (Windows 11, Intel UHD 770; details in #7198). It needed these in the PS4 path, as local stand-ins rather than proposals:

  • sceGnmDrawInitDefaultHardwareState200 is the first placeholder the title calls. The stand-in emits the 1.75 sequence this PR has; the 2.00 sequence itself is not known to me.
  • sceGnmUpdatePsShader, sceGnmUpdateVsShader, sceGnmUpdateGsShader and sceGnmUpdateHsShader come next. The stand-in writes the packets of the matching sceGnmSet*Shader.
  • DecodeGcnColorBuffer refuses CB_COLOR_INFO.FAST_CLEAR ("PS4 color target fast clear (CMASK) is not implemented"). The stand-in draws such targets without their CMASK, which keeps the menu loading. The GCN CMASK layout differs from the GFX10 one main handles.
  • The current stop is a vertex program's V# 24abe8ae 02500000 00ffc1ff 90c00fac (ADD_TID_ENABLE, word 3 bits 31:30 = 2): "buffer descriptor uses an unsupported type". Another vertex program stopped at "buffer ADD_TID is only valid for compute shaders". These look like ring or scratch V#s of a GCN vertex program, which the GFX10 descriptor decode does not accept.

Outside this PR: the first frame needed point polygon mode (#7869), and a RELEASE_MEM with DATA_SEL = 4.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6267296838 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6267296838). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T12:33:03Z. --- @Get-fix CUSA03312 on this PR's PS4 path now plays its intro video and stops while loading its start menu (Windows 11, Intel UHD 770; details in #7198). It needed these in the PS4 path, as local stand-ins rather than proposals: - `sceGnmDrawInitDefaultHardwareState200` is the first placeholder the title calls. The stand-in emits the 1.75 sequence this PR has; the 2.00 sequence itself is not known to me. - `sceGnmUpdatePsShader`, `sceGnmUpdateVsShader`, `sceGnmUpdateGsShader` and `sceGnmUpdateHsShader` come next. The stand-in writes the packets of the matching `sceGnmSet*Shader`. - `DecodeGcnColorBuffer` refuses `CB_COLOR_INFO.FAST_CLEAR` ("PS4 color target fast clear (CMASK) is not implemented"). The stand-in draws such targets without their CMASK, which keeps the menu loading. The GCN CMASK layout differs from the GFX10 one `main` handles. - The current stop is a vertex program's V# `24abe8ae 02500000 00ffc1ff 90c00fac` (`ADD_TID_ENABLE`, word 3 bits 31:30 = 2): "buffer descriptor uses an unsupported type". Another vertex program stopped at "buffer ADD_TID is only valid for compute shaders". These look like ring or scratch V#s of a GCN vertex program, which the GFX10 descriptor decode does not accept. Outside this PR: the first frame needed point polygon mode (#7869), and a `RELEASE_MEM` with `DATA_SEL = 4`. AI-assisted: yes (Claude Code)
javierUDP commented 2026-10-19 14:36:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-19T14:36:03Z.

Code review location: core/shader/recompiler/RdnaDecoder/src/GcnInstructionDecoder.cpp; line 22

@@ -0,0 +1,347 @@
+#include "RdnaDecoder/RdnaInstructionDecoder.hpp"
+#include "GcnOpcodeTables.hpp"
+#include <algorithm>
+#include <array>
+#include <atomic>
+#include <cstdint>
+#include <optional>
+#include <span>
+#include <stdexcept>
+#include <string>
+
+namespace ShaderRecompiler {
+
+namespace {
+
+std::atomic<bool> g_gcnGuestShaders{false};
+
+constexpr std::uint32_t LiteralSource = 0xffu;
+constexpr std::uint32_t VccSdst = 106u;
+constexpr std::uint32_t NullSoffset = 0x7du;
+constexpr std::uint32_t LinkedCallSopk = 0x16u;
+constexpr std::uint32_t CodeEndSopp = 0x1fu;

The SOPK branch needs the opcode by name, next to the other scalar constants.

constexpr std::uint32_t CodeEndSopp = 0x1fu;
constexpr std::uint32_t SetRegImmSopk = 0x15u;
<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4315104375 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#discussion_r4315104375). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-19T14:36:03Z. **Code review location:** `core/shader/recompiler/RdnaDecoder/src/GcnInstructionDecoder.cpp`; line 22 ~~~~diff @@ -0,0 +1,347 @@ +#include "RdnaDecoder/RdnaInstructionDecoder.hpp" +#include "GcnOpcodeTables.hpp" +#include <algorithm> +#include <array> +#include <atomic> +#include <cstdint> +#include <optional> +#include <span> +#include <stdexcept> +#include <string> + +namespace ShaderRecompiler { + +namespace { + +std::atomic<bool> g_gcnGuestShaders{false}; + +constexpr std::uint32_t LiteralSource = 0xffu; +constexpr std::uint32_t VccSdst = 106u; +constexpr std::uint32_t NullSoffset = 0x7du; +constexpr std::uint32_t LinkedCallSopk = 0x16u; +constexpr std::uint32_t CodeEndSopp = 0x1fu; ~~~~ --- The SOPK branch needs the opcode by name, next to the other scalar constants. ```suggestion constexpr std::uint32_t CodeEndSopp = 0x1fu; constexpr std::uint32_t SetRegImmSopk = 0x15u; ```
javierUDP commented 2026-10-19 14:36:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-19T14:36:03Z.

Review: COMMENTED


Static review on macOS, head 93eeee014, limited to the six commits you asked for. Apple M5, macOS 26.4, AppleClang 21.0.0. I compiled core/shader/recompiler/RdnaDecoder/src/*.cpp from this branch standalone and drove DecodeGcnInstruction directly; I did not build the full tree and have no PS4 title, so nothing here comes from running Limbo.

s_setreg_imm32_b32 loses its literal and aborts the shader.

GcnTables::Sopk maps SOPK 0x15, but the SOPK branch of encodeScalar never sets literal, so the instruction is re-encoded as one word. It is eight bytes: llvm-mc -triple=amdgcn -mcpu=bonaire assembles s_setreg_imm32_b32 hwreg(HW_REG_MODE), 0x12345678 as [0x01,0xf8,0x80,0xba,0x78,0x56,0x34,0x12], the last four bytes being the literal.

Decoding {0xba80f801, 0x12345678, 0xbf810000} with this branch's decoder:

THREW: literal operand word is out of the code span bounds

DecodeRdnaSopk marks source0 as a literal for SSetregImm32B32, and ReadRdnaLiteralOperands then looks for a word the one-word span does not have. The message points at the span rather than at the missing literal copy. Had the span check passed, gcnWords = 1 would still leave the next decode starting on the literal word, desynchronising the rest of the program.

Setting literal for that opcode in the SOPK branch is enough; with that one line the same stream decodes as wordCount=2.

Smaller point: LinkedCallSopk and CodeEndSopp accept encodings GCN does not have.

SOPK 0x16 and SOPP 0x1f bypass the tables and pass through unchanged, but llvm-mc -mcpu=gfx802 reports invalid instruction encoding for both and refuses s_call_b64 with instruction not supported on this GPU; only gfx1010 decodes them. A program that desynchronises earlier — through the literal above, for instance — can land on SOPK 0x16 and get an s_call_b64 instead of the GCN SOPK opcode 22 is not implemented that would name the real problem.

What I checked and found correct, in case it saves someone repeating it:

  • All thirteen opcode tables are sorted ascending with no duplicate keys, which mapOpcode's std::lower_bound requires.
  • The six Sopk entries are identity mappings and llvm-mc gives the same opcode field on bonaire and gfx1010 for each of s_movk_i32, s_cmovk_i32, s_mulk_i32, s_getreg_b32, s_setreg_b32 and s_setreg_imm32_b32.
  • The MIMG dimension assumption is already recorded in the shader debt entry, with the materializer rejecting a T# that needs another address count, so I left it alone.

I did not review the AGC driver, libSceGnmDriver or the save data and trophy commits.

Written with AI assistance. I ran every check above on my own machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5573180480 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#pullrequestreview-5573180480). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-19T14:36:03Z. **Review:** COMMENTED --- Static review on macOS, head `93eeee014`, limited to the six commits you asked for. Apple M5, macOS 26.4, AppleClang 21.0.0. I compiled `core/shader/recompiler/RdnaDecoder/src/*.cpp` from this branch standalone and drove `DecodeGcnInstruction` directly; I did not build the full tree and have no PS4 title, so nothing here comes from running Limbo. **`s_setreg_imm32_b32` loses its literal and aborts the shader.** `GcnTables::Sopk` maps SOPK `0x15`, but the SOPK branch of `encodeScalar` never sets `literal`, so the instruction is re-encoded as one word. It is eight bytes: `llvm-mc -triple=amdgcn -mcpu=bonaire` assembles `s_setreg_imm32_b32 hwreg(HW_REG_MODE), 0x12345678` as `[0x01,0xf8,0x80,0xba,0x78,0x56,0x34,0x12]`, the last four bytes being the literal. Decoding `{0xba80f801, 0x12345678, 0xbf810000}` with this branch's decoder: ``` THREW: literal operand word is out of the code span bounds ``` `DecodeRdnaSopk` marks `source0` as a literal for `SSetregImm32B32`, and `ReadRdnaLiteralOperands` then looks for a word the one-word span does not have. The message points at the span rather than at the missing literal copy. Had the span check passed, `gcnWords = 1` would still leave the next decode starting on the literal word, desynchronising the rest of the program. Setting `literal` for that opcode in the SOPK branch is enough; with that one line the same stream decodes as `wordCount=2`. **Smaller point: `LinkedCallSopk` and `CodeEndSopp` accept encodings GCN does not have.** SOPK `0x16` and SOPP `0x1f` bypass the tables and pass through unchanged, but `llvm-mc -mcpu=gfx802` reports `invalid instruction encoding` for both and refuses `s_call_b64` with `instruction not supported on this GPU`; only gfx1010 decodes them. A program that desynchronises earlier — through the literal above, for instance — can land on SOPK `0x16` and get an `s_call_b64` instead of the `GCN SOPK opcode 22 is not implemented` that would name the real problem. **What I checked and found correct**, in case it saves someone repeating it: - All thirteen opcode tables are sorted ascending with no duplicate keys, which `mapOpcode`'s `std::lower_bound` requires. - The six `Sopk` entries are identity mappings and `llvm-mc` gives the same opcode field on bonaire and gfx1010 for each of `s_movk_i32`, `s_cmovk_i32`, `s_mulk_i32`, `s_getreg_b32`, `s_setreg_b32` and `s_setreg_imm32_b32`. - The MIMG dimension assumption is already recorded in the shader debt entry, with the materializer rejecting a T# that needs another address count, so I left it alone. I did not review the AGC driver, libSceGnmDriver or the save data and trophy commits. Written with AI assistance. I ran every check above on my own machine.
javierUDP commented 2026-10-19 14:36:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-19T14:36:54Z.

Code review location: core/shader/recompiler/RdnaDecoder/src/GcnInstructionDecoder.cpp; line 84

@@ -0,0 +1,347 @@
+#include "RdnaDecoder/RdnaInstructionDecoder.hpp"
+#include "GcnOpcodeTables.hpp"
+#include <algorithm>
+#include <array>
+#include <atomic>
+#include <cstdint>
+#include <optional>
+#include <span>
+#include <stdexcept>
+#include <string>
+
+namespace ShaderRecompiler {
+
+namespace {
+
+std::atomic<bool> g_gcnGuestShaders{false};
+
+constexpr std::uint32_t LiteralSource = 0xffu;
+constexpr std::uint32_t VccSdst = 106u;
+constexpr std::uint32_t NullSoffset = 0x7du;
+constexpr std::uint32_t LinkedCallSopk = 0x16u;
+constexpr std::uint32_t CodeEndSopp = 0x1fu;
+
+template <std::size_t N>
+std::optional<std::uint32_t> mapOpcode(const std::array<std::pair<std::uint16_t, std::uint16_t>, N>& table, std::uint32_t opcode) {
+    const auto found = std::lower_bound(table.begin(), table.end(), opcode, [](const auto& entry, std::uint32_t value) { return entry.first < value; });
+    if (found == table.end() || found->first != opcode) return std::nullopt;
+    return found->second;
+}
+
+[[noreturn]] void unsupported(const char* family, std::uint32_t opcode, std::uint32_t programCounter) {
+    throw UnsupportedInstructionError(std::string("GCN ") + family + " opcode " + std::to_string(opcode) + " at program counter " + std::to_string(programCounter) + " is not implemented");
+}
+
+std::uint32_t replaceBits(std::uint32_t word, std::uint32_t shift, std::uint32_t width, std::uint32_t value) {
+    const std::uint32_t mask = ((1u << width) - 1u) << shift;
+    return (word & ~mask) | ((value << shift) & mask);
+}
+
+bool hasLiteral(std::uint32_t source) {
+    return source == LiteralSource;
+}
+
+struct Encoded {
+    std::array<std::uint32_t, 4> words{};
+    std::uint32_t rdnaWords = 0;
+    std::uint32_t gcnWords = 0;
+};
+
+std::uint32_t literalAt(std::span<const std::uint32_t> code, std::uint32_t index, std::uint32_t programCounter) {
+    if (index >= code.size()) throw std::out_of_range("GCN literal constant at program counter " + std::to_string(programCounter) + " is past the end of the code");
+    return code[index];
+}
+
+Encoded encodeScalar(std::span<const std::uint32_t> code, std::uint32_t index, std::uint32_t programCounter) {
+    const auto word = code[index];
+    Encoded out;
+    out.gcnWords = 1;
+    std::uint32_t opcode = 0;
+    std::optional<std::uint32_t> mapped;
+    bool literal = false;
+    const auto prefix9 = word >> 23u;
+    if (prefix9 == 0x17du) {
+        opcode = (word >> 8u) & 0xffu;
+        mapped = mapOpcode(GcnTables::Sop1, opcode);
+        if (!mapped) unsupported("SOP1", opcode, programCounter);
+        out.words[0] = replaceBits(word, 8, 8, *mapped);
+        literal = hasLiteral(word & 0xffu);
+    } else if (prefix9 == 0x17eu) {
+        opcode = (word >> 16u) & 0x7fu;
+        mapped = mapOpcode(GcnTables::Sopc, opcode);
+        if (!mapped) unsupported("SOPC", opcode, programCounter);
+        out.words[0] = replaceBits(word, 16, 7, *mapped);
+        literal = hasLiteral(word & 0xffu) || hasLiteral((word >> 8u) & 0xffu);
+    } else if (prefix9 == 0x17fu) {
+        opcode = (word >> 16u) & 0x7fu;
+        mapped = opcode == CodeEndSopp ? std::optional<std::uint32_t>(CodeEndSopp) : mapOpcode(GcnTables::Sopp, opcode);
+        if (!mapped) unsupported("SOPP", opcode, programCounter);
+        out.words[0] = replaceBits(word, 16, 7, *mapped);
+    } else if ((word >> 28u) == 0xbu) {
+        opcode = (word >> 23u) & 0x1fu;
+        mapped = opcode == LinkedCallSopk ? std::optional<std::uint32_t>(LinkedCallSopk) : mapOpcode(GcnTables::Sopk, opcode);
+        if (!mapped) unsupported("SOPK", opcode, programCounter);
+        out.words[0] = replaceBits(word, 23, 5, *mapped);

With this line {0xba80f801, 0x12345678, 0xbf810000} decodes as wordCount=2 instead of throwing, and the literal reaches SSetregImm32B32. (Reposting: my first attempt anchored one line higher and would have dropped the if (!mapped) guard.)

        out.words[0] = replaceBits(word, 23, 5, *mapped);
        literal = opcode == SetRegImmSopk;
<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4315113281 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#discussion_r4315113281). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-19T14:36:54Z. **Code review location:** `core/shader/recompiler/RdnaDecoder/src/GcnInstructionDecoder.cpp`; line 84 ~~~~diff @@ -0,0 +1,347 @@ +#include "RdnaDecoder/RdnaInstructionDecoder.hpp" +#include "GcnOpcodeTables.hpp" +#include <algorithm> +#include <array> +#include <atomic> +#include <cstdint> +#include <optional> +#include <span> +#include <stdexcept> +#include <string> + +namespace ShaderRecompiler { + +namespace { + +std::atomic<bool> g_gcnGuestShaders{false}; + +constexpr std::uint32_t LiteralSource = 0xffu; +constexpr std::uint32_t VccSdst = 106u; +constexpr std::uint32_t NullSoffset = 0x7du; +constexpr std::uint32_t LinkedCallSopk = 0x16u; +constexpr std::uint32_t CodeEndSopp = 0x1fu; + +template <std::size_t N> +std::optional<std::uint32_t> mapOpcode(const std::array<std::pair<std::uint16_t, std::uint16_t>, N>& table, std::uint32_t opcode) { + const auto found = std::lower_bound(table.begin(), table.end(), opcode, [](const auto& entry, std::uint32_t value) { return entry.first < value; }); + if (found == table.end() || found->first != opcode) return std::nullopt; + return found->second; +} + +[[noreturn]] void unsupported(const char* family, std::uint32_t opcode, std::uint32_t programCounter) { + throw UnsupportedInstructionError(std::string("GCN ") + family + " opcode " + std::to_string(opcode) + " at program counter " + std::to_string(programCounter) + " is not implemented"); +} + +std::uint32_t replaceBits(std::uint32_t word, std::uint32_t shift, std::uint32_t width, std::uint32_t value) { + const std::uint32_t mask = ((1u << width) - 1u) << shift; + return (word & ~mask) | ((value << shift) & mask); +} + +bool hasLiteral(std::uint32_t source) { + return source == LiteralSource; +} + +struct Encoded { + std::array<std::uint32_t, 4> words{}; + std::uint32_t rdnaWords = 0; + std::uint32_t gcnWords = 0; +}; + +std::uint32_t literalAt(std::span<const std::uint32_t> code, std::uint32_t index, std::uint32_t programCounter) { + if (index >= code.size()) throw std::out_of_range("GCN literal constant at program counter " + std::to_string(programCounter) + " is past the end of the code"); + return code[index]; +} + +Encoded encodeScalar(std::span<const std::uint32_t> code, std::uint32_t index, std::uint32_t programCounter) { + const auto word = code[index]; + Encoded out; + out.gcnWords = 1; + std::uint32_t opcode = 0; + std::optional<std::uint32_t> mapped; + bool literal = false; + const auto prefix9 = word >> 23u; + if (prefix9 == 0x17du) { + opcode = (word >> 8u) & 0xffu; + mapped = mapOpcode(GcnTables::Sop1, opcode); + if (!mapped) unsupported("SOP1", opcode, programCounter); + out.words[0] = replaceBits(word, 8, 8, *mapped); + literal = hasLiteral(word & 0xffu); + } else if (prefix9 == 0x17eu) { + opcode = (word >> 16u) & 0x7fu; + mapped = mapOpcode(GcnTables::Sopc, opcode); + if (!mapped) unsupported("SOPC", opcode, programCounter); + out.words[0] = replaceBits(word, 16, 7, *mapped); + literal = hasLiteral(word & 0xffu) || hasLiteral((word >> 8u) & 0xffu); + } else if (prefix9 == 0x17fu) { + opcode = (word >> 16u) & 0x7fu; + mapped = opcode == CodeEndSopp ? std::optional<std::uint32_t>(CodeEndSopp) : mapOpcode(GcnTables::Sopp, opcode); + if (!mapped) unsupported("SOPP", opcode, programCounter); + out.words[0] = replaceBits(word, 16, 7, *mapped); + } else if ((word >> 28u) == 0xbu) { + opcode = (word >> 23u) & 0x1fu; + mapped = opcode == LinkedCallSopk ? std::optional<std::uint32_t>(LinkedCallSopk) : mapOpcode(GcnTables::Sopk, opcode); + if (!mapped) unsupported("SOPK", opcode, programCounter); + out.words[0] = replaceBits(word, 23, 5, *mapped); ~~~~ --- With this line `{0xba80f801, 0x12345678, 0xbf810000}` decodes as `wordCount=2` instead of throwing, and the literal reaches `SSetregImm32B32`. (Reposting: my first attempt anchored one line higher and would have dropped the `if (!mapped)` guard.) ```suggestion out.words[0] = replaceBits(word, 23, 5, *mapped); literal = opcode == SetRegImmSopk; ```
MarcZX10 commented 2026-10-19 15:33:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T15:33:04Z.


I independently reproduced the reported decoder failure on this head with a standalone Linux build of RdnaDecoder/src/*.cpp. Calling DecodeGcnInstruction(0, {0xba80f801, 0x12345678, 0xbf810000}, 0) throws literal operand word is out of the code span bounds, matching the review report. This was a local repro only; I did not modify the PR files.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6271001173 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6271001173). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T15:33:04Z. --- I independently reproduced the reported decoder failure on this head with a standalone Linux build of `RdnaDecoder/src/*.cpp`. Calling `DecodeGcnInstruction(0, {0xba80f801, 0x12345678, 0xbf810000}, 0)` throws `literal operand word is out of the code span bounds`, matching the review report. This was a local repro only; I did not modify the PR files.
javierUDP commented 2026-10-19 16:16:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-19T16:16:35Z.


@MarcZX10 thanks for the independent repro, and on Linux: that takes my host and macOS out of the picture, which is what this one needed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6271797011 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6271797011). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-19T16:16:35Z. --- @MarcZX10 thanks for the independent repro, and on Linux: that takes my host and macOS out of the picture, which is what this one needed.
javierUDP commented 2026-10-19 17:40:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-19T17:40:27Z.


Heads-up on the red conventions check, in case it is off your radar: it is only the unchecked One topic per PR box. check_conventions.py reports every - [ ] line as unchecked: <text> and does not read what follows, so the note about a PS4 frame needing all five parts never gets through to it. Ticking the box and keeping the sentence after it turns the check green without changing anything about the PR itself.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273412224 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6273412224). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-19T17:40:27Z. --- Heads-up on the red `conventions` check, in case it is off your radar: it is only the unchecked `One topic per PR` box. `check_conventions.py` reports every `- [ ]` line as `unchecked: <text>` and does not read what follows, so the note about a PS4 frame needing all five parts never gets through to it. Ticking the box and keeping the sentence after it turns the check green without changing anything about the PR itself.
savvaniss commented 2026-10-19 20:52:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T20:52:06Z.


@Get-fix I opened Get-fix/AnyPS5#1 against this PR's branch. It has six fixes to the PS4 path that Risk from CUSA03312 needed, each in its own commit so you can take any of them:

  • display buffers that are flipped before they are drawn;
  • the 38-bit T# base (word 1 bits 6-7 are MTYPE_L2);
  • GCN MTBUF;
  • linear-aligned color targets;
  • V_RSQ_CLAMP_F32;
  • SOPK compares and s_addk_i32.

It also adds an agc_gcn_decode test. The related tests pass on an RX 9070 XT and a UHD 770, with no new validation errors. With them, Risk renders its Ubisoft logo.

There is one question I would rather ask than decide: GCN image dimension. On GCN the T# type decides how many address VGPRs a MIMG instruction reads, but this PR fixes the dimension at translation (2D, or 2D array when DA is set). Risk binds a cube T# under a 2D-inferred sample, and a 2D T# under a DA sample, so the materializer refuses both. Supporting them faithfully seems to need the address layout resolved from the T# when the resources are materialized. How would you like that handled?

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6277061500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6277061500). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T20:52:06Z. --- @Get-fix I opened [Get-fix/AnyPS5#1](https://github.com/Get-fix/AnyPS5/pull/1) against this PR's branch. It has six fixes to the PS4 path that Risk from CUSA03312 needed, each in its own commit so you can take any of them: - display buffers that are flipped before they are drawn; - the 38-bit T# base (word 1 bits 6-7 are `MTYPE_L2`); - GCN MTBUF; - linear-aligned color targets; - `V_RSQ_CLAMP_F32`; - SOPK compares and `s_addk_i32`. It also adds an `agc_gcn_decode` test. The related tests pass on an RX 9070 XT and a UHD 770, with no new validation errors. With them, Risk renders its Ubisoft logo. There is one question I would rather ask than decide: GCN image dimension. On GCN the T# type decides how many address VGPRs a MIMG instruction reads, but this PR fixes the dimension at translation (2D, or 2D array when DA is set). Risk binds a cube T# under a 2D-inferred sample, and a 2D T# under a DA sample, so the materializer refuses both. Supporting them faithfully seems to need the address layout resolved from the T# when the resources are materialized. How would you like that handled? AI-assisted: yes (Claude Code)
savvaniss commented 2026-10-19 22:35:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T22:35:54Z.


@Get-fix Update: on this branch, Risk from CUSA03312 now plays a local match against the AI, and Monopoly Plus reaches its loading screen. Both run on an RX 9070 XT with APS5_SYNC_DRAWS=1 and APS5_SYNC_FLIP=1; details are in #7198.

Against this branch:

  • Get-fix/AnyPS5#1 now has nine fixes, each with its own test, plus a validation-layer comparison with your head on both GPUs. The new ones are the GCN image dimension taken from the T# (the question I asked above), SMRD literal offsets, and thin-tiled 3D textures.
  • Get-fix/AnyPS5#2 implements or declares the imports these titles need from the libraries only this branch adds: NpMatching2, NpSignaling, NpCommon, NpUtility, NpTrophy, InvitationDialog and GnmDriver.

On main:

Still local, and not proposed:

  • the GNM 2.00 default state and the sceGnmUpdate*Shader stand-ins;
  • drawing CMASK fast-clear targets without the CMASK;
  • the RELEASE_MEM DATA_SEL = 4 counter (#7911 only names it);
  • sceNpTrophyGetGameInfo;
  • the two sync switches, which work around a vertex-table read that seems to happen before the table is final.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278877128 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6278877128). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T22:35:54Z. --- @Get-fix Update: on this branch, Risk from CUSA03312 now plays a local match against the AI, and Monopoly Plus reaches its loading screen. Both run on an RX 9070 XT with `APS5_SYNC_DRAWS=1` and `APS5_SYNC_FLIP=1`; details are in #7198. Against this branch: - Get-fix/AnyPS5#1 now has nine fixes, each with its own test, plus a validation-layer comparison with your head on both GPUs. The new ones are the GCN image dimension taken from the T# (the question I asked above), SMRD literal offsets, and thin-tiled 3D textures. - Get-fix/AnyPS5#2 implements or declares the imports these titles need from the libraries only this branch adds: NpMatching2, NpSignaling, NpCommon, NpUtility, NpTrophy, InvitationDialog and GnmDriver. On `main`: - Open: #8078, #8079, #7869, #7780, #7660, #7890, #8110, #8111, #8112 and #8114. - Already merged, and needed after a rebase: quad lists (#6529, which Risk draws once a match starts), the SSL validity queries (#5969) and the LoadExec fix (5b072bc2c). The branch now conflicts with `main`. Still local, and not proposed: - the GNM 2.00 default state and the `sceGnmUpdate*Shader` stand-ins; - drawing CMASK fast-clear targets without the CMASK; - the `RELEASE_MEM` `DATA_SEL = 4` counter (#7911 only names it); - `sceNpTrophyGetGameInfo`; - the two sync switches, which work around a vertex-table read that seems to happen before the table is final. AI-assisted: yes (Claude Code)
javierUDP commented 2026-10-20 04:52:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-20T04:52:50Z.


@savvaniss your Get-fix/AnyPS5#1 grows GcnTables::Sopk from 6 to 19 entries. That does not collide with the s_setreg_imm32_b32 literal reported above, but it does keep it live: {0x15, 0x15} stays in the table and the SOPK branch of encodeScalar still never sets literal, so that opcode is still re-encoded as one word.

I checked the thirteen opcodes you add, in case any of them needed the same treatment: llvm-mc -triple=amdgcn -mcpu=bonaire assembles the compares, s_addk_i32 and s_mulk_i32 as 4 bytes each, so none of them carries a literal word. s_setreg_imm32_b32 stays the only two-word SOPK encoding, at 8 bytes.

So the two suggestions on this pull request still apply unchanged, whichever of the two branches lands first.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6283676234 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6283676234). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-20T04:52:50Z. --- @savvaniss your [Get-fix/AnyPS5#1](https://github.com/Get-fix/AnyPS5/pull/1) grows `GcnTables::Sopk` from 6 to 19 entries. That does not collide with the `s_setreg_imm32_b32` literal reported above, but it does keep it live: `{0x15, 0x15}` stays in the table and the SOPK branch of `encodeScalar` still never sets `literal`, so that opcode is still re-encoded as one word. I checked the thirteen opcodes you add, in case any of them needed the same treatment: `llvm-mc -triple=amdgcn -mcpu=bonaire` assembles the compares, `s_addk_i32` and `s_mulk_i32` as 4 bytes each, so none of them carries a literal word. `s_setreg_imm32_b32` stays the only two-word SOPK encoding, at 8 bytes. So the two suggestions on this pull request still apply unchanged, whichever of the two branches lands first.
savvaniss commented 2026-10-20 05:19:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-20T05:19:03Z.


Two speed findings from Monopoly Plus (CUSA03312) on this branch, RX 9070 XT, Windows. It runs at about 1.2 fps on its intro.

  1. Linear render target. Monopoly draws its scene into a 1920x1080 RGBA8 color target with GCN tile mode 8 (linear-aligned, ColorTileMode::GcnLinear in Get-fix/AnyPS5#1). Linear targets are never resident here, so every draw reads the 8 MB target from guest memory, creates a RenderTarget, waits for the GPU and writes 8 MB back. A profile of the draw recorder put about half its time there. main has resident linear targets since 88ee391839 (16 Oct), which this branch predates. Its check is color.tileMode == ColorTileMode::Linear, so after a rebase GcnLinear also needs to qualify (SurfaceForTarget already maps it to a linear texture). Letting linear targets be resident locally took Monopoly from 1.26 to 3.0 fps, and the intro renders as before.
  2. 40 MB vertex ring per draw (corrected later on 20 Oct; this point first said constants). Each draw is a quad whose four 24-byte vertices sit in a 40 MB ring. Its V#s have a 24-byte stride and 1,747,626 records, so they start at the draw's vertices and run to the ring's end. The vertex shader reads them with formatted, indexed loads, and they are not lifted into vertex attributes. So the driver binds them as whole guest buffers. When the draw cache reuses a draw at a moved base, PrepareDrawBindings snapshots such a buffer whole (0x27ffff0 bytes), whatever APS5_DRAW_SNAPSHOT_MAX_MIB says. This path is the same on main. Binding only constant-offset reads (#8243) does not apply: ported onto this branch, it leaves the same snapshots. The fix is to bound these fetches by the draw's vertex range, as lifted vertex attributes already are.

The frame is now about 157 ms: the worker uses about 84 ms of it and the GPU about 92 ms.

Correction on the numbers: the intro alternates between a lighter phase (about 91 ms frames) and a heavier one (about 327 ms). Three 15-second traces of this branch's driver with only resident linear targets gave 6.6, 5.4 and 3.0 fps. So the 3.0 and 6.5 fps above come from different phases, and the copy cap's share of the gain is not established.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6283992250 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6283992250). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-20T05:19:03Z. --- Two speed findings from Monopoly Plus (CUSA03312) on this branch, RX 9070 XT, Windows. It runs at about 1.2 fps on its intro. 1. **Linear render target.** Monopoly draws its scene into a 1920x1080 RGBA8 color target with GCN tile mode 8 (linear-aligned, `ColorTileMode::GcnLinear` in Get-fix/AnyPS5#1). Linear targets are never resident here, so every draw reads the 8 MB target from guest memory, creates a `RenderTarget`, waits for the GPU and writes 8 MB back. A profile of the draw recorder put about half its time there. `main` has resident linear targets since 88ee391839 (16 Oct), which this branch predates. Its check is `color.tileMode == ColorTileMode::Linear`, so after a rebase `GcnLinear` also needs to qualify (`SurfaceForTarget` already maps it to a linear texture). Letting linear targets be resident locally took Monopoly from 1.26 to 3.0 fps, and the intro renders as before. 2. **40 MB vertex ring per draw** (corrected later on 20 Oct; this point first said constants). Each draw is a quad whose four 24-byte vertices sit in a 40 MB ring. Its V#s have a 24-byte stride and 1,747,626 records, so they start at the draw's vertices and run to the ring's end. The vertex shader reads them with formatted, indexed loads, and they are not lifted into vertex attributes. So the driver binds them as whole guest buffers. When the draw cache reuses a draw at a moved base, `PrepareDrawBindings` snapshots such a buffer whole (0x27ffff0 bytes), whatever `APS5_DRAW_SNAPSHOT_MAX_MIB` says. This path is the same on `main`. Binding only constant-offset reads (#8243) does not apply: ported onto this branch, it leaves the same snapshots. The fix is to bound these fetches by the draw's vertex range, as lifted vertex attributes already are. The frame is now about 157 ms: the worker uses about 84 ms of it and the GPU about 92 ms. **Correction on the numbers:** the intro alternates between a lighter phase (about 91 ms frames) and a heavier one (about 327 ms). Three 15-second traces of this branch's driver with only resident linear targets gave 6.6, 5.4 and 3.0 fps. So the 3.0 and 6.5 fps above come from different phases, and the copy cap's share of the gain is not established.
savvaniss commented 2026-10-20 06:24:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-20T06:24:57Z.


@javierUDP thanks for checking the thirteen opcodes as well. I took your two suggestions into Get-fix/AnyPS5#1 as a commit of their own, 0dd1e4b384, with you as co-author. It adds an agc_gcn_decode case that decodes {0xba80f801, 0x12345678, 0xbf810000}:

  • On Get-fix/AnyPS5#1's previous head f9b38d16d7, the case fails with "literal operand word is out of the code span bounds".
  • With the commit, it decodes as SSetregImm32B32, two words, with 0x12345678 in source0.

If @Get-fix applies the suggestions here first, I'll drop that commit from Get-fix/AnyPS5#1.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6284826667 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6284826667). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-20T06:24:57Z. --- @javierUDP thanks for checking the thirteen opcodes as well. I took your two suggestions into [Get-fix/AnyPS5#1](https://github.com/Get-fix/AnyPS5/pull/1) as a commit of their own, `0dd1e4b384`, with you as co-author. It adds an `agc_gcn_decode` case that decodes `{0xba80f801, 0x12345678, 0xbf810000}`: - On Get-fix/AnyPS5#1's previous head `f9b38d16d7`, the case fails with "literal operand word is out of the code span bounds". - With the commit, it decodes as `SSetregImm32B32`, two words, with `0x12345678` in `source0`. If @Get-fix applies the suggestions here first, I'll drop that commit from Get-fix/AnyPS5#1. AI-assisted: yes (Claude Code)
savvaniss commented 2026-10-20 09:10:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-20T09:10:30Z.


Result for the 40 MB vertex ring in my Monopoly comment above: Get-fix/AnyPS5#8 bounds vertex-indexed guest buffers by the draw's vertex range, so Monopoly Plus's 0x27ffff0-byte draw snapshots are gone and its language screen runs at 6.1 instead of 2.9 fps (RX 9070 XT, resident linear targets on); the rest of that frame is per-draw capture_resources.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6287540151 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6287540151). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-20T09:10:30Z. --- Result for the 40 MB vertex ring in my Monopoly comment above: Get-fix/AnyPS5#8 bounds vertex-indexed guest buffers by the draw's vertex range, so Monopoly Plus's 0x27ffff0-byte draw snapshots are gone and its language screen runs at 6.1 instead of 2.9 fps (RX 9070 XT, resident linear targets on); the rest of that frame is per-draw `capture_resources`.
javierUDP commented 2026-10-20 13:06:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-20T13:06:43Z.


@savvaniss thanks for taking the suggestions, and more for writing the decode case around them: the report came with a reproducer but no test, and now the behaviour is pinned from both ends.

Checking 0dd1e4b384 against what was reported: it keeps {0x15, 0x15} in Sopk and sets the literal for that opcode only, which is the narrow fix, and the case decodes {0xba80f801, 0x12345678, 0xbf810000} as two words with 0x12345678 in source0. That is the stream from the review, so nothing is left implicit.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6291553166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6291553166). Originally posted by [javierUDP](https://github.com/javierUDP) on 2026-10-20T13:06:43Z. --- @savvaniss thanks for taking the suggestions, and more for writing the decode case around them: the report came with a reproducer but no test, and now the behaviour is pinned from both ends. Checking `0dd1e4b384` against what was reported: it keeps `{0x15, 0x15}` in `Sopk` and sets the literal for that opcode only, which is the narrow fix, and the case decodes `{0xba80f801, 0x12345678, 0xbf810000}` as two words with `0x12345678` in `source0`. That is the stream from the review, so nothing is left implicit.
oneandonlydean commented 2026-10-20 17:08:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T17:08:09Z.


Thanks for the work on the PS4 path. Before we can review it, it needs a rebase: it conflicts with current main in 12 files (AGC event/texture/detiler code, libSceNpTus, the relinker's CMakeLists, CodeInstructionCollector, GuestImageReader and RelinkerPipeline, the shader InstructionTranslator, and two debt files).

Two of the commits it carries have since landed on their own. The DT_INIT 0 change merged as #6684 today, and the relinker changes around it moved too (#8166, #8168). So after the rebase those parts should drop out and the PR gets smaller.

To make the rest reviewable, could you split out what isn't PS4-specific into its own PRs? In particular:

  • the relinker TLS commit (3b158c1e4e, TLS relocations against the module's own section symbol, with guest_own_tls_relocations). It reads correct to us. One small nit for that PR: it doesn't check that the section is a TLS one.
  • the relinker jump-table commit (bf06a8e26), if anything of it is still needed after #8168.

Then the AGC and shader parts can go to the AGC reviewers, with a PS5 no-regression run as the bar, since the PS4-only behaviour is meant to stay behind GcnGuestShaders().

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6296590708 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6296590708). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T17:08:09Z. --- Thanks for the work on the PS4 path. Before we can review it, it needs a rebase: it conflicts with current `main` in 12 files (AGC event/texture/detiler code, `libSceNpTus`, the relinker's CMakeLists, CodeInstructionCollector, GuestImageReader and RelinkerPipeline, the shader InstructionTranslator, and two debt files). Two of the commits it carries have since landed on their own. The DT_INIT 0 change merged as #6684 today, and the relinker changes around it moved too (#8166, #8168). So after the rebase those parts should drop out and the PR gets smaller. To make the rest reviewable, could you split out what isn't PS4-specific into its own PRs? In particular: - the relinker TLS commit (3b158c1e4e, TLS relocations against the module's own section symbol, with `guest_own_tls_relocations`). It reads correct to us. One small nit for that PR: it doesn't check that the section is a TLS one. - the relinker jump-table commit (bf06a8e26), if anything of it is still needed after #8168. Then the AGC and shader parts can go to the AGC reviewers, with a PS5 no-regression run as the bar, since the PS4-only behaviour is meant to stay behind `GcnGuestShaders()`.
Get-fix commented 2026-10-21 21:51:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-21T21:51:15Z.


@oneandonlydean @MarcZX10 done as you asked: this pull request is now a draft integration branch, and its own work is split into five pull requests on main cecb540a6. Each one passes check_conventions.py; A, B, C and E add tests of their own, and D is covered by the stack's suite and by Limbo itself.

Part Pull request What Depends on
A #9429 relinker: TLS relocations against the module's own section symbol (was 3b158c1e4) none
B #9430 shader: PS4 (GCN) shaders re-encoded to RDNA, with javierUDP's s_setreg_imm32_b32 fix none
C #9431 AGC: PS4 targets, tiling and pattern fills #9430
D #9432 libSceGnmDriver and the VideoOut changes #9431
E #9433 PS4 NpTrophy, save data v1, NpWebApi and Limbo's other imports none

The integration branch also merges #9225 (@YossiYad), which implements sceNpSetContentRestriction: Limbo calls it at start, and #9433 now leaves it to #9225 instead of implementing it a second time.

What changed since the last review:

  • Bundled members. Every pull request this branch carried has merged (#5138, #5991 to #5994, #6354, #6357, #6381, #6519, #6527, #6595, #6619, #6684, #6702), so they dropped out with the rebase.
  • Jump tables. main's #6595 covers what #6618 did: #6618's own fixtures pass with main's relinker, and Limbo and Bloodborne convert without it. I closed #6618.
  • The TLS nit. PS4 modules have no section headers (e_shnum 0), so nothing shows which section a symbol names. #9429 accepts only a local section symbol with section index 0 and value 0, in a module with PT_TLS. A section symbol that names a section is still refused, and the test covers that case with an absolute-section symbol.
  • @MarcZX10's points. The four GNM answers are listed under Silent stubs in docs/dev/debt/libSceGnmDriver.md (#9432), each part is one topic with every box ticked, and #6357's RELATIVE handling is main's now; #9429 no longer touches it.
  • @Amoenus's #7294. It has merged, and #9431 keeps its kS4KBX entry in the thick branch of the detiler.
  • @javierUDP's review. Both suggestions are in #9430, as their own commit with javierUDP and savvaniss as co-authors, and the new agc_gcn_decode test decodes the reported stream. Thank you, and thanks @MarcZX10 for the repro.
  • pr_overlap.py. Besides #9225 above, #9433 moved its one NpCommon stub into main's PendingExports.cpp, so it no longer creates the Export.cpp that #9037 and #9063 add. The other entries are line conflicts with unrelated open pull requests, and the exports this branch shared are only with itself.
  • @blawesom's rebase. Thanks for it. I split the branch instead, so I didn't take it. On the recipe asserts: legacyVertex and the two extra DrawKeyRegisters ranges come from this branch (#9431), not from main. The recipe codec doesn't need legacyVertex. It only chooses which program registers DrawDecode snapshots (SH 0x048 instead of 0x0c8), and the recipe records the resulting modules by identity, as it does for minTessellationLevel and maxTessellationLevel. The two ranges, 0x2a8-0x2a9 for the instance step rates and SH 0x048-0x05b for the legacy VS, are draw-key registers, not recipe fields. State stays 784 bytes and ShaderStages 112.

A correction on speed. The title said 60 fps. That 60 came from running Limbo's two-dword pattern clears as fills, and that is what made its gameplay advance about half as far per frame (found on 17 Oct with the same input and save, every frame dumped). With those clears running the real kernel, Limbo plays at the right speed at 573-578 presents per 10 s, with about 12 ms of GPU work per frame. I've changed the title accordingly.

Tested on the whole stack (A to E and #9225 merged on main cecb540a6), Windows 11, WinLibs GCC 15.2, RTX 5060 Ti (610.88): the full suite of 1,865 tests: 1,843 pass and 17 skip (device features, and the VideoOut flip tests, which find no Vulkan display under SDL's offscreen driver here). The 5 that fail also fail without this work on this machine: agc_driver_sample_order and its --grid-reference and --recipe-depth-locations cases (also on main d34da5d69), prx_thread_local_destructors (also with #9430 alone, which touches neither libc nor libkernel), and agc_driver_image_array_window_past_layer_limit, which main doesn't compile with MinGW (alignas(65536) in the test). Limbo (CUSA01664), converted with the stack's relinker and its two bundled modules, plays in game with sound; frames dumped every 4 s show the forest. With the final #9433 and #9225 it plays the same way, with no errors and no not-implemented calls in a 50 s scripted run.

To everyone who sent work against this branch (@savvaniss, @ntamas94, @DealPotato, @Lberonio): thank you. Risk playing a match, Monopoly reaching its language screen and Second Son submitting work are far more than I expected this branch to do. There are 19 pull requests against ps4/limbo-gpu (Get-fix/AnyPS5#1 to #19). The maintainers asked that this branch not land anything without its own review, so I won't merge them here directly. Could each go upstream as its own pull request on top of the part it builds on, with Depends on? The decoder changes would go on #9430, AGC on #9431, GnmDriver on #9432 and the libraries on #9433. The ones that aren't PS4-only, such as the capture and label changes in #10 to #15, can go straight to main. As each one opens, I'll merge it into ps4/limbo-gpu, list it as a member and run Limbo with it. I haven't reviewed them yet, and I'll do that as they come up. On the image-dimension question: taking the address count from the T# when resources are materialized looks right to me, on top of #9430.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6327344731 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6327344731). Originally posted by [Get-fix](https://github.com/Get-fix) on 2026-10-21T21:51:15Z. --- @oneandonlydean @MarcZX10 done as you asked: this pull request is now a draft integration branch, and its own work is split into five pull requests on `main` cecb540a6. Each one passes `check_conventions.py`; A, B, C and E add tests of their own, and D is covered by the stack's suite and by Limbo itself. | Part | Pull request | What | Depends on | |---|---|---|---| | A | #9429 | relinker: TLS relocations against the module's own section symbol (was 3b158c1e4) | none | | B | #9430 | shader: PS4 (GCN) shaders re-encoded to RDNA, with javierUDP's `s_setreg_imm32_b32` fix | none | | C | #9431 | AGC: PS4 targets, tiling and pattern fills | #9430 | | D | #9432 | `libSceGnmDriver` and the VideoOut changes | #9431 | | E | #9433 | PS4 NpTrophy, save data v1, NpWebApi and Limbo's other imports | none | The integration branch also merges #9225 (@YossiYad), which implements `sceNpSetContentRestriction`: Limbo calls it at start, and #9433 now leaves it to #9225 instead of implementing it a second time. What changed since the last review: - **Bundled members.** Every pull request this branch carried has merged (#5138, #5991 to #5994, #6354, #6357, #6381, #6519, #6527, #6595, #6619, #6684, #6702), so they dropped out with the rebase. - **Jump tables.** `main`'s #6595 covers what #6618 did: #6618's own fixtures pass with `main`'s relinker, and Limbo and Bloodborne convert without it. I closed #6618. - **The TLS nit.** PS4 modules have no section headers (`e_shnum` 0), so nothing shows which section a symbol names. #9429 accepts only a local section symbol with section index 0 and value 0, in a module with `PT_TLS`. A section symbol that names a section is still refused, and the test covers that case with an absolute-section symbol. - **@MarcZX10's points.** The four GNM answers are listed under Silent stubs in `docs/dev/debt/libSceGnmDriver.md` (#9432), each part is one topic with every box ticked, and #6357's RELATIVE handling is `main`'s now; #9429 no longer touches it. - **@Amoenus's #7294.** It has merged, and #9431 keeps its `kS4KBX` entry in the thick branch of the detiler. - **@javierUDP's review.** Both suggestions are in #9430, as their own commit with javierUDP and savvaniss as co-authors, and the new `agc_gcn_decode` test decodes the reported stream. Thank you, and thanks @MarcZX10 for the repro. - **`pr_overlap.py`.** Besides #9225 above, #9433 moved its one NpCommon stub into `main`'s `PendingExports.cpp`, so it no longer creates the `Export.cpp` that #9037 and #9063 add. The other entries are line conflicts with unrelated open pull requests, and the exports this branch shared are only with itself. - **@blawesom's rebase.** Thanks for it. I split the branch instead, so I didn't take it. On the recipe asserts: `legacyVertex` and the two extra `DrawKeyRegisters` ranges come from this branch (#9431), not from `main`. The recipe codec doesn't need `legacyVertex`. It only chooses which program registers DrawDecode snapshots (SH 0x048 instead of 0x0c8), and the recipe records the resulting modules by identity, as it does for `minTessellationLevel` and `maxTessellationLevel`. The two ranges, 0x2a8-0x2a9 for the instance step rates and SH 0x048-0x05b for the legacy VS, are draw-key registers, not recipe fields. `State` stays 784 bytes and `ShaderStages` 112. **A correction on speed.** The title said 60 fps. That 60 came from running Limbo's two-dword pattern clears as fills, and that is what made its gameplay advance about half as far per frame (found on 17 Oct with the same input and save, every frame dumped). With those clears running the real kernel, Limbo plays at the right speed at 573-578 presents per 10 s, with about 12 ms of GPU work per frame. I've changed the title accordingly. **Tested** on the whole stack (A to E and #9225 merged on `main` cecb540a6), Windows 11, WinLibs GCC 15.2, RTX 5060 Ti (610.88): the full suite of 1,865 tests: 1,843 pass and 17 skip (device features, and the VideoOut flip tests, which find no Vulkan display under SDL's offscreen driver here). The 5 that fail also fail without this work on this machine: `agc_driver_sample_order` and its `--grid-reference` and `--recipe-depth-locations` cases (also on `main` d34da5d69), `prx_thread_local_destructors` (also with #9430 alone, which touches neither libc nor libkernel), and `agc_driver_image_array_window_past_layer_limit`, which `main` doesn't compile with MinGW (`alignas(65536)` in the test). Limbo (CUSA01664), converted with the stack's relinker and its two bundled modules, plays in game with sound; frames dumped every 4 s show the forest. With the final #9433 and #9225 it plays the same way, with no errors and no not-implemented calls in a 50 s scripted run. **To everyone who sent work against this branch** (@savvaniss, @ntamas94, @DealPotato, @Lberonio): thank you. Risk playing a match, Monopoly reaching its language screen and Second Son submitting work are far more than I expected this branch to do. There are 19 pull requests against `ps4/limbo-gpu` (Get-fix/AnyPS5#1 to #19). The maintainers asked that this branch not land anything without its own review, so I won't merge them here directly. Could each go upstream as its own pull request on top of the part it builds on, with **Depends on**? The decoder changes would go on #9430, AGC on #9431, GnmDriver on #9432 and the libraries on #9433. The ones that aren't PS4-only, such as the capture and label changes in #10 to #15, can go straight to `main`. As each one opens, I'll merge it into `ps4/limbo-gpu`, list it as a member and run Limbo with it. I haven't reviewed them yet, and I'll do that as they come up. On the image-dimension question: taking the address count from the T# when resources are materialized looks right to me, on top of #9430. AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
savvaniss commented 2026-10-22 10:48:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-22T10:48:23Z.


@oneandonlydean @MarcZX10 Get-fix asked me to move my pull requests against ps4/limbo-gpu (Get-fix/AnyPS5#1 to Get-fix/AnyPS5#21) upstream, on top of the split parts. I have 7 open on main, so one per commit would pass the 20-per-author limit. Could you confirm this grouping before I open them? Each one would carry Depends on and Unblocks: CUSA03312 #7198.

On Change From
#9430 GCN MTBUF, V_RSQ_CLAMP_F32, SOPK compares, SMRD literal offsets, image dimension taken from the T# Get-fix/AnyPS5#1
#9430 GCN buffer formats translated without a private table Get-fix/AnyPS5#12
#9431 38-bit T# base, linear-aligned target pitch, thin-tiled 3D textures, non-resident display buffers Get-fix/AnyPS5#1
#9431 multisampled color targets Get-fix/AnyPS5#6
#9431 FORCE_DEGAMMA only on formats with an sRGB form Get-fix/AnyPS5#7
#9431 RELEASE_MEM DATA_SEL 4 Get-fix/AnyPS5#19
#9431 depth planes kept coherent with buffer reads Get-fix/AnyPS5#20
#9432 six GNM imports declared, every call throws Get-fix/AnyPS5#2
main NP, trophy and invitation imports Get-fix/AnyPS5#2
main vertex-indexed buffers bounded by the draw's vertex range Get-fix/AnyPS5#8
main stores without drains: recorded store bytes in captures, queued DUMP_CONST_RAM, labels in unregistered host memory Get-fix/AnyPS5#10, Get-fix/AnyPS5#21, Get-fix/AnyPS5#11
main per-draw shader preparation: callee link memo, result memo bypass, raw shader range check Get-fix/AnyPS5#13, Get-fix/AnyPS5#14, Get-fix/AnyPS5#15

Get-fix/AnyPS5#5 is #7137, which main has, so I'll close it. The s_setreg_imm32_b32 fix of Get-fix/AnyPS5#1 is already in #9430.

  1. Is this grouping fine, or would you rather have Get-fix/AnyPS5#8 and Get-fix/AnyPS5#10 to Get-fix/AnyPS5#15 one per commit, opened as slots free up?
  2. CUSA03312 runs only with #9430 to #9432, so the repro and the speed A/B would come from ps4/limbo-gpu with and without each change, not from main. Does that qualify for the intake exception @MarcZX10 mentioned on #9385?
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6338903048 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6338903048). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-22T10:48:23Z. --- @oneandonlydean @MarcZX10 Get-fix asked me to move my pull requests against `ps4/limbo-gpu` (Get-fix/AnyPS5#1 to Get-fix/AnyPS5#21) upstream, on top of the split parts. I have 7 open on `main`, so one per commit would pass the 20-per-author limit. Could you confirm this grouping before I open them? Each one would carry `Depends on` and `Unblocks: CUSA03312 #7198`. | On | Change | From | |---|---|---| | #9430 | GCN MTBUF, `V_RSQ_CLAMP_F32`, SOPK compares, SMRD literal offsets, image dimension taken from the T# | Get-fix/AnyPS5#1 | | #9430 | GCN buffer formats translated without a private table | Get-fix/AnyPS5#12 | | #9431 | 38-bit T# base, linear-aligned target pitch, thin-tiled 3D textures, non-resident display buffers | Get-fix/AnyPS5#1 | | #9431 | multisampled color targets | Get-fix/AnyPS5#6 | | #9431 | `FORCE_DEGAMMA` only on formats with an sRGB form | Get-fix/AnyPS5#7 | | #9431 | `RELEASE_MEM` `DATA_SEL` 4 | Get-fix/AnyPS5#19 | | #9431 | depth planes kept coherent with buffer reads | Get-fix/AnyPS5#20 | | #9432 | six GNM imports declared, every call throws | Get-fix/AnyPS5#2 | | `main` | NP, trophy and invitation imports | Get-fix/AnyPS5#2 | | `main` | vertex-indexed buffers bounded by the draw's vertex range | Get-fix/AnyPS5#8 | | `main` | stores without drains: recorded store bytes in captures, queued `DUMP_CONST_RAM`, labels in unregistered host memory | Get-fix/AnyPS5#10, Get-fix/AnyPS5#21, Get-fix/AnyPS5#11 | | `main` | per-draw shader preparation: callee link memo, result memo bypass, raw shader range check | Get-fix/AnyPS5#13, Get-fix/AnyPS5#14, Get-fix/AnyPS5#15 | Get-fix/AnyPS5#5 is #7137, which `main` has, so I'll close it. The `s_setreg_imm32_b32` fix of Get-fix/AnyPS5#1 is already in #9430. 1. Is this grouping fine, or would you rather have Get-fix/AnyPS5#8 and Get-fix/AnyPS5#10 to Get-fix/AnyPS5#15 one per commit, opened as slots free up? 2. CUSA03312 runs only with #9430 to #9432, so the repro and the speed A/B would come from `ps4/limbo-gpu` with and without each change, not from `main`. Does that qualify for the intake exception @MarcZX10 mentioned on #9385?
MarcZX10 commented 2026-11-14 11:17:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T11:17:04Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete because one changed source file was excluded from the review bundle, so a formal approval or change request is not justified.

What I ran

  • Reviewed head 45625370e478b2afc4732ea77b72f9feadb8f9ed using the prepared diff and repo_read.py for targeted source context.
  • No tests or builds were run.

Results

Check Result Note
Diff review passed Prepared patch inspected
Tests and build not run No commands run

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

  • core/libs/prx/libSceGnmDriver/Export.cpp is marked included in the manifest, but its files/ copy was not read; only selected portions via the repository reader were inspected. Its command-buffer helper implementations and remaining behavior are not fully verified.
  • docs/dev/debt/libSceAgcDriver.md and docs/dev/debt/shader.md were excluded by the review bundle as too large. Their changed lines appear in the patch, but their full files were not read.
  • No tests, build, or physical console behavior were verified.
  • Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, and selected ranges of core/libs/prx/libSceGnmDriver/Export.cpp.
  • Files reviewed according to the manifest: not established; the bundle lists the changed files in review/manifest.json, but this review did not read every listed file.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5904036759 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6977#pullrequestreview-5904036759). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T11:17:04Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete because one changed source file was excluded from the review bundle, so a formal approval or change request is not justified. ## What I ran - Reviewed head `45625370e478b2afc4732ea77b72f9feadb8f9ed` using the prepared diff and `repo_read.py` for targeted source context. - No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Diff review | passed | Prepared patch inspected | | Tests and build | not run | No commands run | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified - `core/libs/prx/libSceGnmDriver/Export.cpp` is marked included in the manifest, but its `files/` copy was not read; only selected portions via the repository reader were inspected. Its command-buffer helper implementations and remaining behavior are not fully verified. - `docs/dev/debt/libSceAgcDriver.md` and `docs/dev/debt/shader.md` were excluded by the review bundle as too large. Their changed lines appear in the patch, but their full files were not read. - No tests, build, or physical console behavior were verified. - Files read: `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/diff.patch`, and selected ranges of `core/libs/prx/libSceGnmDriver/Export.cpp`. - Files reviewed according to the manifest: not established; the bundle lists the changed files in `review/manifest.json`, but this review did not read every listed file. ## To get this to a good state Nothing is required.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/6977:upstream-pr/6977'
git switch 'upstream-pr/6977'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/6977'
git switch 'upstream-pr/6977'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/6977'
git switch 'upstream-pr/6977'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/6977'
git switch 'main'
git merge --squash 'upstream-pr/6977'
git switch 'main'
git merge --ff-only 'upstream-pr/6977'
git switch 'main'
git merge 'upstream-pr/6977'
git push origin 'main'
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!6977
No description provided.