feat: run PS4 games on the AGC driver — Limbo (CUSA01664) in game (integration branch) #6977
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6977"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
mainwith 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.libSceGnmDriverand VideoOutsceNpSetContentRestriction, which Limbo calls at startWith A, E and #9225 in
main, the branch is nowmain7e2ba73e4plus #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
main7e2ba73e4with #9430 to #9432, Windows 11, WinLibs GCC 15.2, NVIDIA GeForce RTX 5060 Ti (driver 610.88):main. The 3 that fail also fail onmain7e2ba73e4on this machine:agc_driver_sample_orderand its--grid-referenceand--recipe-depth-locationscases.mainagainst the branch with the same focused tests: the same 50VUID-errors in the same 8 existing PS5 tests, none added (details in #9432).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
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
sceGnmAreSubmitsAllowedsceGnmDeleteEqEventsceGnmDispatchInitDefaultHardwareStatesceGnmDrawInitDefaultHardwareState175sceGnmDriverCaptureInProgresssceGnmDriverTriggerCapturesceGnmFlushGarlicsceGnmGetEqEventTypesceGnmInsertPopMarkersceGnmInsertPushColorMarkersceGnmInsertPushMarkersceGnmInsertSetMarkersceGnmInsertWaitFlipDonesceGnmIsUserPaEnabledsceGnmSetCsShadersceGnmSetEsShadersceGnmSetGsShadersceGnmSetHsShadersceGnmSetLsShadersceGnmSetPsShadersceGnmSetVsShadersceGnmSubmitDonesceGnmValidateCommandBufferssceRazorCaptureCommandBuffersOnlyImmediatesceRazorCaptureCommandBuffersOnlySinceLastFlipsceRazorCaptureImmediatesceRazorCaptureSinceLastFlipsceRazorIsLoaded⚪ 10 behaviourally empty (constant return or throw)
sceGnmAreSubmitsAllowedsceGnmDriverCaptureInProgresssceGnmDriverTriggerCapturesceGnmIsUserPaEnabledsceGnmValidateCommandBufferssceRazorCaptureCommandBuffersOnlyImmediatesceRazorCaptureCommandBuffersOnlySinceLastFlipsceRazorCaptureImmediatesceRazorCaptureSinceLastFlipsceRazorIsLoaded🆕 18 declared as stubs
sceGnmAddEqEventsceGnmDebugHardwareStatussceGnmDingDongsceGnmDisableMipStatsReportsceGnmGetEqTimeStampsceGnmGetTheTessellationFactorRingBufferBaseAddresssceGnmInsertSetColorMarkersceGnmLogicalCuIndexToPhysicalCuIndexsceGnmLogicalCuMaskToPhysicalCuMasksceGnmMapComputeQueuesceGnmRequestFlipAndSubmitDonesceGnmRequestMipStatsReportAndResetsceGnmSetGsRingSizessceGnmSetupMipStatsReportsceGnmSubmitAndFlipCommandBufferssceGnmSubmitCommandBufferssceGnmUnmapComputeQueuesceVideoOutCursorSetHotSpotImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T00:52:38Z.
The current conventions run for head
d604ae745fails on four exports that the description says are among the remaining imports that throw:sceGnmAreSubmitsAllowed,sceGnmIsUserPaEnabled,sceGnmDriverCaptureInProgress, andsceRazorIsLoaded. Please make each callNotImplemented_nid_no_patch(__func__)or list the intentionally silent stub indocs/dev/debt/libSceGnmDriver.mdas 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.mdasks 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 explicitDepends onlinks. Could you decide the intended scope and update the PR/checklist accordingly? The current merge state is also DIRTY against main.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
sceNpGetAccountIdAand alignssceUserServiceGetNpAccountIdto a fixed local account ID.tools/pr_overlap.pyreports a merge conflict indocs/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.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.pyrun no longer reports a conflict with #6977. No dependency or merge order is needed for the current diff.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.
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
ConvertPullRequestToDraftfor 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.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:mainnow 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), andguest_relative_section_symbolspasses with both behavioursPipelineJournal.cpp: the recipe-codec asserts are pinned to the merged struct sizes (State 760, ShaderStages 116) —mainaddedlegacyVertexand twoDrawKeyRegistersentries since your branch point, so please confirm the recipe codec actually covers those fields; the asserts are there to force exactly that checkVerified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
4d7929e3a.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 bundledlibc.prxandlibSceFios2.prx.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.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)
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_padebugmodule. 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 thelibs/it ran against come from the same tree.The title imports its GPU driver as
libSceGnmDriver_padebug, notlibSceGnmDriver. Of the 72 imports unresolved at startup, 44 are exported by this branch'slibSceGnmDriver:sceGnm*, includingsceGnmSubmitCommandBuffers,sceGnmSubmitAndFlipCommandBuffers, thesceGnmSet*Shadercalls andsceGnmAddEqEvent;sceRazorCapture*andsceRazorIsLoadedcalls.In a local test, a copy of the built
libSceGnmDriver.prxnamedlibSceGnmDriver_padebug.prxinlibs/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:
sceGnmDrawInitDefaultHardwareState200,sceGnmMapComputeQueueWithPriority,sceGnmUpdateGsShader,sceGnmUpdateHsShader,sceGnmUpdatePsShader,sceGnmUpdateVsShader,sceNpCheckPlus,sceNpGetAccountCountry,sceNpGetAccountDateOfBirth,sceNpGetAccountLanguage,sceNpGetParentalControlInfo,sceNpMatching2AbortContextStart,sceNpMatching2SignalingGetConnectionStatus,sceNpProfileDialogTerminate,sceNpProfileDialogUpdateStatus,sceNpTrophyAbortHandle,sceSslGetNotAfter,sceSslGetNotBefore,sceInvitationDialogClose,sceKernelPrintBacktraceWithModuleInfo.libSceSaveData.native/libSceSaveDataDialog.nativebut 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)
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_RELATIVEhandling in bothGuestImageReader.cppandCodeInstructionCollector.cpp, which is also the focused behavior in open PR #6357. The branch’s current test list does not include #6357’sguest_none_relocationsfixture. Please coordinate with that PR or carry its focused regression cases so the behavior remains covered whichever change lands first.Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-17T21:16:22Z.
The focused PS5 thick
SW_4KB_S_Xlayout addition needed by Sonic PPSA99902 (#7260) is now PR #7294, headca9ec74020on main8690d92f07. It adds AMD GFX10 3D addressing for 1/2/4/8/16-byte elements.git merge-treeagainst your published93eeee0141confirms one content conflict inTextureDetiler::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.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T21:19:50Z.
I checked the proposed thick
SW_4KB_S_Xcommitf89f23a3fagainst currentmain(cf217c51c): it merges cleanly there. The overlap check identifies #6977’sTextureDetiler::pipelinedispatcher as the only code overlap; the two changes have no runtime dependency. I also inspected the sharedTextureTiling.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
mainfirst, 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.,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.pyrefuses the bundled modulesI 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
The function at
0x64c870has an FDE ending at0x64d0c3. It ends in a call to a noreturn function (call 0x984360) andnop. Its switch reads a table at0x64d0c4(lea rcx, [rip+0x6dd]at0x64c9e0, thenmovslq (%rcx,%rax,4),%rax). The table lies right after the FDE, soFindInlineJumpTables(#6618) does not see it.addAddressTakenRootthen adds0x64d0c4as 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
leatarget as data, not as a root, when it is followed by amovsxd 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 --modulesrefuses the unwrapped PS4 modules4. 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 atlibSceVideodec.prx. The other imports the libraries do not export:sceGnmDrawIndex,sceGnmDrawIndexAuto,sceGnmDrawIndexOffset,sceGnmDrawIndexMultiInstanced,sceGnmDrawOpaqueAuto.sceGnmDrawIndirect,sceGnmDrawIndexIndirect,sceGnmDrawIndirectMulti,sceGnmDrawIndexIndirectMulti,sceGnmDrawIndirectCountMulti,sceGnmDrawIndexIndirectCountMulti.sceGnmDispatchDirect,sceGnmDispatchIndirect,sceGnmDispatchIndirectOnMec.sceGnmSetEmbeddedVsShader,sceGnmSetEmbeddedPsShader,sceGnmSetPsShader350,sceGnmSetCsShaderWithModifier,sceGnmUpdateVsShader,sceGnmUpdatePsShader350,sceGnmUpdateHsShader,sceGnmUpdateGsShader.sceGnmSetVgtControl,sceGnmResetVgtControl,sceGnmSetWaveLimitMultipliers,sceGnmDrawInitToDefaultContextState400,sceGnmDrawInitDefaultHardwareState350.sceGnmCreateWorkloadStream,sceGnmDestroyWorkloadStream,sceGnmBeginWorkload,sceGnmEndWorkload,sceGnmSubmitCommandBuffersForWorkload,sceGnmSubmitAndFlipCommandBuffersForWorkload,sceGnmRequestFlipAndSubmitDoneForWorkload,sceGnmDingDongForWorkload.sceGnmMapComputeQueueWithPriority,sceGnmGetOffChipTessellationBufferSize,sceGnmGetNumTcaUnits,sceGnmGetShaderStatus,sceGnmGetShaderProgramBaseAddress,sceGnmGetGpuBlockStatus,sceGnmGetGpuInfoStatus,sceGnmGetProtectionFaultTimeStamp,sceGnmGetLastWaitedAddress,sceGnmDriverTraceInProgress,sceGnmInsertDingDongMarker,sceGnmInsertThreadTraceMarker.sceVideodecCreateDecoder,sceVideodecDeleteDecoder,sceVideodecDecode,sceVideodecFlush,sceVideodecReset,sceVideodecQueryResourceInfo.sceVideoOutGetDeviceCapabilityInfo_,sceVideoOutModeSetAny_,sceVideoOutConfigureOutputMode_.sceNpCheckNpAvailabilityA,sceNpRegisterGamePresenceCallbackA,sceNpGetGamePresenceStatusA.sceKernelIsNeoMode,sceKernelPrintBacktraceWithModuleInfo.sceSaveDataMount2.scePlayGoSetLanguageMask.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: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).
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
libSceSaveData.prxandlibSceSaveDataDialog.prxare the legacy modules. The PS4 entry points live in the.nativeones, sosceSaveDataDelete,DirNameSearch,SaveIcon,SetParam,UmountandsceSaveDataDialogUpdateStatuswere unresolved on Windows. Copying the.nativemodules over the plain names worked.sceSaveDataMount2: added, taking the PS4SceSaveDataMount2asMount3without the system blocks and resource fields.sceVideoOutGetDeviceCapabilityInfo_,ModeSetAny_,ConfigureOutputMode_.sceNpCheckNpAvailabilityA,RegisterGamePresenceCallbackA,GetGamePresenceStatusA.scePlayGoSetLanguageMask, andplgochunk files accepted.fJgP+wqifno, which returns "no bitmap information".sceKernelIsNeoModereturns 0;sceKernelPrintBacktraceWithModuleInfois a NotImplemented stub.sceNetCtlGetInfocode 12 (DHCP hostname): answered with an empty name.sceVideoOutRegisterBuffers: Second Son sets attributeoption = 8(strict colorimetry in shadPS4's naming), which the PS4 path rejects withINVALID_OPTION. Accepting it and otherwise ignoring it gets past this.Compute queues
Second Son submits compute work through
sceGnmMapComputeQueueandsceGnmDingDong, which are NotImplemented on the branch. I mapped the rings and, on each DingDong:INDIRECT_BUFFERpackets;Lower;0x20 + nthrough a smallAgcDriverSubmitQueue_nid_postfix(commands, dwords, queue)besideAgcDriverSubmitGraphics_nid_postfix.Without the inlining, the executor got raw PS4 packets from the indirect buffers and rejected the
0x6875xxxxmarker NOPs and the compute flag onRELEASE_MEM.Lowering gaps hit in Second Son's command buffers
RELEASE_MEMis 7 dwords; the executor wants the 8-dword GFX10 form. Widened as the EOP lowering does.RELEASE_MEMdata select 4 (GPU core clock counter) is rejected: the executor accepts selects 0-3. I mapped it to 3, the 64-bit clock.ACQUIRE_MEMwithCP_COHER_CNTL0x00c58000fails with "unsupported ACQUIRE_MEM control flags": only bit 16 is outside the legacy mask. Masking the 7-dword form with0xfeecfffb, and the loweredSURFACE_SYNClikewise, gets past it.Shaders
MTBUF: the branch throws on every GCNMTBUF. Second Son's first shader hasTBUFFER_LOAD_FORMAT_XYZW. The fix re-encodes it with the format field taken fromGcnBufferFormats()[(dfmt << 3) | nfmt]; GFX10 ops 0-7 match GCN's. Shaders then get further.A 1D texture (T# type 8) is sampled with one address, while the GCN
MIMGre-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).
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
mainf3059421f, I merged, in this order: #7660, #6619 (a9fa0e8b0), #5138 (5f5641732), #6381 (6f8d9a09d),3b158c1e4from #6977, #6354 (81561867f), #6357 (32fe3aa8b), #6684 (ab9d21afc) and #6618 (bf06a8e5c). With that stack, the Linux and--windowsconversions of the eboot and its 9 bundled modules complete. I then rebuilt the relinker once per member with only that member left out.--windowsStrict filter: inconsistent FDE function range (offset 0xd42390)3b158c1e4, which applies only on top of it)libSceFace.prx:Unsupported symbol attributes:Cyclic guest initialization dependency: libc.prx3b158c1e4(no separate PR)libSceFios2.prx:Invalid guest TLS relocationlibSceFace.prx:PLT not found after the last unwind function (offset 0x27e21)libc.prx:RELATIVE relocation has a symbollibc.prx:Guest PREINIT_ARRAY has no module initializerlibSceFios2.prx:Unsupported Windows guest TLS instruction (bytes: 64 fe ff) (offset 0x12a7c)Cannot decode instruction: Instruction exceeds 15 bytes (offset 0x783c70)So for this title every member is needed, #6618 only for Windows, and the TLS commit
3b158c1e4is needed forlibSceFios2.prxbut has no PR of its own yet. The Windows GS stop (stop 9 in my #3093 comment) no longer appears on thismain, because #6102 traps GS accesses. Conflicts I resolved locally: #5138 against #6357 inGuestImageReader.cpp(I accepted either form), #6618 against #7660 inRelinkerPipeline.cpp(I kept both), and #6684 inMacOsGuestModuleWriter.cpp(I kept both lines); the rest were indocs/dev/debt.I've posted the same result on each member PR.
AI-assisted: yes (Claude Code)
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,sceSaveDataSaveIconandsceSaveDataDialogUpdateStatus.The title's DT_NEEDED names
libSceSaveData.prxandlibSceSaveDataDialog.prx, and the Windows entry stub searches only those files, pluslibc.prx, for each import (WindowsEntryStubBuilder.cpp). On this branch the plainlibSceSaveDataexports 9 functions, all PS5-era (sceSaveDataInitialize3,sceSaveDataTransferringMount, …), andlibSceSaveDataDialogexports 8. All 8 missing functions are in the.nativelibraries, which this branch's PS4 wrappers (sceSaveDataInitialize,sceSaveDataMount,sceSaveDataUmount) also went into. The.nativeexports are a superset of the plain ones: 36 against 9, and 10 against 8.Test: built from this head
93eeee014with the setup from the earlier comment. I replacedlibs\libSceSaveData.prxandlibs\libSceSaveDataDialog.prxwith copies of the.nativefiles. 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.cppsays imports bind "via the relinker alias table, by name" to the plain library, but I found no such table incore/relinkerorcore/libs/nid. A general fix could build the plain libraries from the.nativesources, aslibSceNgs2does withadd_sce_ngs2_libraryand as this branch now does forlibSceAjmwithAjmLibrary.cmake. That would also remove the second save-data implementation inSaveDataCore.hpp. I can try it as a follow-up if that direction is right.AI-assisted: yes (Claude Code)
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
.nativemodules over the plain names. Building the plain libraries from the.nativesources 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 likesceGnmMapComputeQueueand ignores the priority.sceGnmUpdateVsShader: writes the same registers assceGnmSetVsShader.sceGnmUpdateHsShader,sceGnmUpdateGsShaderandsceKernelPrintBacktraceWithModuleInfo:NotImplementedstubs. 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)
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
libSceSaveDataandlibSceSaveDataDialogfrom the.nativesources, the waylibSceNgs2is built. Applied on this head93eeee014with 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) inlibSceSaveData.nativethen 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)
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:
sceGnmDrawInitDefaultHardwareState200is 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,sceGnmUpdateGsShaderandsceGnmUpdateHsShadercome next. The stand-in writes the packets of the matchingsceGnmSet*Shader.DecodeGcnColorBufferrefusesCB_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 onemainhandles.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_MEMwithDATA_SEL = 4.AI-assisted: yes (Claude Code)
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 22The SOPK branch needs the opcode by name, next to the other scalar constants.
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 compiledcore/shader/recompiler/RdnaDecoder/src/*.cppfrom this branch standalone and droveDecodeGcnInstructiondirectly; I did not build the full tree and have no PS4 title, so nothing here comes from running Limbo.s_setreg_imm32_b32loses its literal and aborts the shader.GcnTables::Sopkmaps SOPK0x15, but the SOPK branch ofencodeScalarnever setsliteral, so the instruction is re-encoded as one word. It is eight bytes:llvm-mc -triple=amdgcn -mcpu=bonaireassembless_setreg_imm32_b32 hwreg(HW_REG_MODE), 0x12345678as[0x01,0xf8,0x80,0xba,0x78,0x56,0x34,0x12], the last four bytes being the literal.Decoding
{0xba80f801, 0x12345678, 0xbf810000}with this branch's decoder:DecodeRdnaSopkmarkssource0as a literal forSSetregImm32B32, andReadRdnaLiteralOperandsthen 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 = 1would still leave the next decode starting on the literal word, desynchronising the rest of the program.Setting
literalfor that opcode in the SOPK branch is enough; with that one line the same stream decodes aswordCount=2.Smaller point:
LinkedCallSopkandCodeEndSoppaccept encodings GCN does not have.SOPK
0x16and SOPP0x1fbypass the tables and pass through unchanged, butllvm-mc -mcpu=gfx802reportsinvalid instruction encodingfor both and refusess_call_b64withinstruction not supported on this GPU; only gfx1010 decodes them. A program that desynchronises earlier — through the literal above, for instance — can land on SOPK0x16and get ans_call_b64instead of theGCN SOPK opcode 22 is not implementedthat would name the real problem.What I checked and found correct, in case it saves someone repeating it:
mapOpcode'sstd::lower_boundrequires.Sopkentries are identity mappings andllvm-mcgives the same opcode field on bonaire and gfx1010 for each ofs_movk_i32,s_cmovk_i32,s_mulk_i32,s_getreg_b32,s_setreg_b32ands_setreg_imm32_b32.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.
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 84With this line
{0xba80f801, 0x12345678, 0xbf810000}decodes aswordCount=2instead of throwing, and the literal reachesSSetregImm32B32. (Reposting: my first attempt anchored one line higher and would have dropped theif (!mapped)guard.)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. CallingDecodeGcnInstruction(0, {0xba80f801, 0x12345678, 0xbf810000}, 0)throwsliteral 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.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.
Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-19T17:40:27Z.
Heads-up on the red
conventionscheck, in case it is off your radar: it is only the uncheckedOne topic per PRbox.check_conventions.pyreports every- [ ]line asunchecked: <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.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:
MTYPE_L2);V_RSQ_CLAMP_F32;s_addk_i32.It also adds an
agc_gcn_decodetest. 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)
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=1andAPS5_SYNC_FLIP=1; details are in #7198.Against this branch:
On
main:5b072bc2c). The branch now conflicts withmain.Still local, and not proposed:
sceGnmUpdate*Shaderstand-ins;RELEASE_MEMDATA_SEL = 4counter (#7911 only names it);sceNpTrophyGetGameInfo;AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by javierUDP on 2026-10-20T04:52:50Z.
@savvaniss your Get-fix/AnyPS5#1 grows
GcnTables::Sopkfrom 6 to 19 entries. That does not collide with thes_setreg_imm32_b32literal reported above, but it does keep it live:{0x15, 0x15}stays in the table and the SOPK branch ofencodeScalarstill never setsliteral, 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=bonaireassembles the compares,s_addk_i32ands_mulk_i32as 4 bytes each, so none of them carries a literal word.s_setreg_imm32_b32stays 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.
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.
ColorTileMode::GcnLinearin Get-fix/AnyPS5#1). Linear targets are never resident here, so every draw reads the 8 MB target from guest memory, creates aRenderTarget, waits for the GPU and writes 8 MB back. A profile of the draw recorder put about half its time there.mainhas resident linear targets since88ee391839(16 Oct), which this branch predates. Its check iscolor.tileMode == ColorTileMode::Linear, so after a rebaseGcnLinearalso needs to qualify (SurfaceForTargetalready 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.PrepareDrawBindingssnapshots such a buffer whole (0x27ffff0 bytes), whateverAPS5_DRAW_SNAPSHOT_MAX_MIBsays. This path is the same onmain. 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.
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 anagc_gcn_decodecase that decodes{0xba80f801, 0x12345678, 0xbf810000}:f9b38d16d7, the case fails with "literal operand word is out of the code span bounds".SSetregImm32B32, two words, with0x12345678insource0.If @Get-fix applies the suggestions here first, I'll drop that commit from Get-fix/AnyPS5#1.
AI-assisted: yes (Claude Code)
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.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
0dd1e4b384against what was reported: it keeps{0x15, 0x15}inSopkand sets the literal for that opcode only, which is the narrow fix, and the case decodes{0xba80f801, 0x12345678, 0xbf810000}as two words with0x12345678insource0. That is the stream from the review, so nothing is left implicit.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
mainin 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:
3b158c1e4e, TLS relocations against the module's own section symbol, withguest_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.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().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
maincecb540a6. Each one passescheck_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.3b158c1e4)s_setreg_imm32_b32fixlibSceGnmDriverand the VideoOut changesThe 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:
main's #6595 covers what #6618 did: #6618's own fixtures pass withmain's relinker, and Limbo and Bloodborne convert without it. I closed #6618.e_shnum0), 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 withPT_TLS. A section symbol that names a section is still refused, and the test covers that case with an absolute-section symbol.docs/dev/debt/libSceGnmDriver.md(#9432), each part is one topic with every box ticked, and #6357's RELATIVE handling ismain's now; #9429 no longer touches it.kS4KBXentry in the thick branch of the detiler.agc_gcn_decodetest decodes the reported stream. Thank you, and thanks @MarcZX10 for the repro.pr_overlap.py. Besides #9225 above, #9433 moved its one NpCommon stub intomain'sPendingExports.cpp, so it no longer creates theExport.cppthat #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.legacyVertexand the two extraDrawKeyRegistersranges come from this branch (#9431), not frommain. The recipe codec doesn't needlegacyVertex. 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 forminTessellationLevelandmaxTessellationLevel. 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.Statestays 784 bytes andShaderStages112.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
maincecb540a6), 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_orderand its--grid-referenceand--recipe-depth-locationscases (also onmaind34da5d69),prx_thread_local_destructors(also with #9430 alone, which touches neither libc nor libkernel), andagc_driver_image_array_window_past_layer_limit, whichmaindoesn'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 tomain. As each one opens, I'll merge it intops4/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
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 onmain, so one per commit would pass the 20-per-author limit. Could you confirm this grouping before I open them? Each one would carryDepends onandUnblocks: CUSA03312 #7198.V_RSQ_CLAMP_F32, SOPK compares, SMRD literal offsets, image dimension taken from the T#FORCE_DEGAMMAonly on formats with an sRGB formRELEASE_MEMDATA_SEL4mainmainmainDUMP_CONST_RAM, labels in unregistered host memorymainGet-fix/AnyPS5#5 is #7137, which
mainhas, so I'll close it. Thes_setreg_imm32_b32fix of Get-fix/AnyPS5#1 is already in #9430.ps4/limbo-gpuwith and without each change, not frommain. Does that qualify for the intake exception @MarcZX10 mentioned on #9385?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
45625370e478b2afc4732ea77b72f9feadb8f9edusing the prepared diff andrepo_read.pyfor targeted source context.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
core/libs/prx/libSceGnmDriver/Export.cppis marked included in the manifest, but itsfiles/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.mdanddocs/dev/debt/shader.mdwere excluded by the review bundle as too large. Their changed lines appear in the patch, but their full files were not read.review/description.md,review/commits.md,review/manifest.json,review/diff.patch, and selected ranges ofcore/libs/prx/libSceGnmDriver/Export.cpp.review/manifest.json, but this review did not read every listed file.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.