libSceGnmDriver: inFAMOUS Second Son (CUSA00223) stops at load on 47 imports that only libSceGnmDriverForNeoMode exports #17581

Closed
opened 2026-11-08 23:44:03 +00:00 by adam25136 · 0 comments
adam25136 commented 2026-11-08 23:44:03 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by adam25136 on 2026-11-08T23:44:03Z.


What happens

A PS4 title stops at load with FAIL: unresolved ELF import for 47 of its libSceGnmDriver imports (GetLastError: 127, exit 0xC0000139), which AnyPS5 exports only from libSceGnmDriverForNeoMode.prx (30 implemented there, 17 throwing stubs), a library the title does not load.

Title, test or build step

inFAMOUS Second Son, CUSA00223 01.07 (the US 01.00 dump with the 01.07 update merged in): eboot.bin plus the bundled sce_module/libc.prx and sce_module/libSceFios2.prx. Bring-up thread: #8214.

AnyPS5 commit

main 22ae9a397d + #17564 (which changes only tools/import_audit.py, its test and docs/user/USAGE.md). Up to main b5a9a4781c, nothing since has changed the GNM libraries, the relinker, libkernel_sys/Export.Discovery.cpp or tools/unwrap_self.py.

System

Windows 10 Pro 22H2 (19045), i9-12900KF, NVIDIA GeForce RTX 5080, driver 621.14, WinLibs GCC 15.2.0 r7, Release

Steps to reproduce

tools/unwrap_self.py stops on this eboot with segment 5 does not fit the file (segment 5 is PT_INTERP, at file offset 0x4000, the start of PT_LOAD 0). All three files were unwrapped with the change at the end of this issue, which places a non-LOAD header that no SELF record covers inside the placed header whose file range holds it. That is a separate problem, not part of this issue.

python tools/unwrap_self.py <dump>/eboot.bin source/eboot.elf
python tools/unwrap_self.py <dump>/sce_module/libc.prx source/sce_module/libc.prx
python tools/unwrap_self.py <dump>/sce_module/libSceFios2.prx source/sce_module/libSceFios2.prx
relinker --registry --windows source/eboot.elf run/app.exe

The relinker reports 908 references and 2 converted modules (run/app0/sce_module/libc.prx.guest.prx and libSceFios2.prx.guest.prx). Put build/core/libs/libs/*.prx and the three MinGW DLLs in run/libs/; no other game files are needed to reach the stop. Start run/app.exe with no APS5_* or ANYPS5_* variable set: it stops after 0.2 s.

Log

stderr of the run (83 lines; paths shortened to the run folder)
[time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine)
FAIL: unresolved ELF import 0BzLGljcwBo
FAIL: unresolved ELF import Z43vKp5k7r0
FAIL: unresolved ELF import HlTPoZ-oY7Y
FAIL: unresolved ELF import GGsn7jMTxw4
FAIL: unresolved ELF import ED9-Fjr8Ta4
FAIL: unresolved ELF import thbPcG7E7qk
FAIL: unresolved ELF import 5q95ravnueg
FAIL: unresolved ELF import jHdPvIzlpKc
FAIL: unresolved ELF import oYM+YzfCm2Y
FAIL: unresolved ELF import 4v+otIIdjqg
FAIL: unresolved ELF import cUCo8OvArrw
FAIL: unresolved ELF import f5QQLp9rzGk
FAIL: unresolved ELF import yb2cRhagD1I
FAIL: unresolved ELF import im2ZuItabu4
FAIL: unresolved ELF import stDSYW2SBVM
FAIL: unresolved ELF import URDgJcXhQOs
FAIL: unresolved ELF import MYRtYhojKdA
FAIL: unresolved ELF import Kx-h-nWQJ8A
FAIL: unresolved ELF import X9Omw9dwv5M
FAIL: unresolved ELF import +AFvOEXrKJk
FAIL: unresolved ELF import 5uFKckiJYRM
FAIL: unresolved ELF import cFCp0NX8wf0
FAIL: unresolved ELF import nLM2i2+65hA
FAIL: unresolved ELF import GNlx+y7xPdE
FAIL: unresolved ELF import mLVL7N7BVBg
FAIL: unresolved ELF import V31V01UiScY
FAIL: unresolved ELF import ihxrbsoSKWc
FAIL: unresolved ELF import 5udAm+6boVg
FAIL: unresolved ELF import UtObDRQiGbs
FAIL: unresolved ELF import byXlqupd8cE
FAIL: unresolved ELF import R6z1xM3pW-w
FAIL: unresolved ELF import Fa3x75OOLRA
FAIL: unresolved ELF import oL4hGI1PMpw
FAIL: unresolved ELF import tZCSL5ulnB4
FAIL: unresolved ELF import iFirFzgYsvw
FAIL: unresolved ELF import KnldROUkWJY
FAIL: unresolved ELF import FFVZcCu3zWU
FAIL: unresolved ELF import fzJdEihTFV4
FAIL: unresolved ELF import nEyFbYUloIM
FAIL: unresolved ELF import k7iGTvDQPLQ
FAIL: unresolved ELF import A+uGq+3KFtQ
FAIL: unresolved ELF import 6YRHhh5mHCs
FAIL: unresolved ELF import XiyzNZ9J4nQ
FAIL: unresolved ELF import Ga6r7H6Y0RI
FAIL: unresolved ELF import jRcI8VcgTz4
FAIL: unresolved ELF import wED4ZXCFJT0
FAIL: unresolved ELF import NfvOrNzy6sk
Searched libraries:
  .\app0\sce_module\libSceFios2.prx.guest.prx
  .\app0\sce_module\libc.prx.guest.prx
  .\libs\libSceSysmodule.prx
  .\libs\libSceVideodec.prx
  .\libs\libSceAjm.prx
  .\libs\libSceHttp.prx
  .\libs\libSceSsl.prx
  .\libs\libSceSaveData.prx
  .\libs\libSceSaveDataDialog.prx
  .\libs\libSceMsgDialog.prx
  .\libs\libSceCommonDialog.prx
  .\libs\libSceErrorDialog.prx
  .\libs\libSceNet.prx
  .\libs\libSceNetCtl.prx
  .\libs\libSceGnmDriver.prx
  .\libs\libSceAudioOut.prx
  .\libs\libSceVideoOut.prx
  .\libs\libSceUserService.prx
  .\libs\libScePad.prx
  .\libs\libSceMouse.prx
  .\libs\libkernel.prx
  .\libs\libSceGameLiveStreaming.prx
  .\libs\libSceSystemService.prx
  .\libs\libSceNpCommon.prx
  .\libs\libSceNpManager.prx
  .\libs\libSceNpTrophy.prx
  .\libs\libSceAppContent.prx
  .\libs\libScePlayGo.prx
  .\libs\libSceDiscMap.prx
  .\libs\libSceLibcInternal.prx
  .\libs\libc.prx
  .\libs\libkernel_sys.prx
  .\libs\libkernel_web.prx
GetLastError: 127 - The specified procedure could not be found.

What was checked

  • Which library has them. AnyPS5's libSceGnmDriver/Export.cpp defines 45 functions and libSceGnmDriverForNeoMode/Export.cpp 139 (111 implemented, 28 throwing stubs); none is in both. The PS5 3.20 export table that docs/dev/debt/libSceGnmDriverForNeoMode.md cites lists the same 163 names for libSceGnmDriver and libSceGnmDriverForNeoMode. AnyPS5's libSceGnmDriver has 45 of them and its libSceGnmDriverForNeoMode the other 118. That debt file notes that the normal provider also exports 20 unnamed NIDs of libSceGnmDriverForNeoMode, and that future implementations there "require loader analysis".
  • What the title asks for. All 85 GNM imports of the eboot name library and module libSceGnmDriver in its SCE tables, and none names libSceGnmDriverForNeoMode. 38 resolve in libSceGnmDriver (14 of them throwing stubs, sceGnmMapComputeQueue and sceGnmDingDong among them); the other 47 only in libSceGnmDriverForNeoMode. The converted program lists libSceGnmDriver.prx but not libSceGnmDriverForNeoMode.prx, and the entry stub searches only the libraries it lists (Searched libraries in the log). The same 47 NIDs are in Andretuta's bring-up thread #8214 and in DealPotato's list on #6977, both from before libSceGnmDriverForNeoMode had them. Earlier runs here on main 676fb61acc, and on 105c9e4d91 with #17140, stopped on the same 47.
  • Normal and Pro mode. libSceGnmDriverForNeoMode always writes the Pro (Neo) form: its debt note says its command writers follow shadPS4's Neo-mode path (draw initiators keep flag bits 29 to 31; sceGnmSetVgtControl and sceGnmResetVgtControl write IA_MULTI_VGT_PARAM through SET_UCONFIG_REG), and that its 350 and 400 default states are shadPS4's Neo sequences. In shadPS4 a808e76, 13 of the 47 choose their packets with sceKernelIsNeoMode(): the 9 draws, the two VGT calls, sceGnmDrawInitDefaultHardwareState350 and sceGnmDrawInitToDefaultContextState400. So does sceGnmDispatchInitDefaultHardwareState, which this title takes from AnyPS5's libSceGnmDriver, where it always writes the normal form. Since #12427, sceKernelIsNeoMode answers from param.sfo; this title's ATTRIBUTE is 0x20800002, so it would answer 1 (read from the code; not called in this run).
  • Prior work. DealPotato's next comment on #6977 describes local changes on that branch, among them "real writers for the draw and dispatch packets, the 350/400 init variants and the shader variants" for part of the 47 (NotImplemented stubs for the rest), from before libSceGnmDriverForNeoMode had them. With these and other local fixes, their copy of the title (CUSA00004) loaded, submitted graphics and compute work, and stopped at a GCN image instruction.
  • Open pull requests on these libraries. #16238 and #16360 change libSceGnmDriverForNeoMode, #17393, #17395 and #17396 add tests for it, #16882 changes libSceGnmDriver, and the #6977 integration draft also carries libSceGnmDriver. None moves functions between them. #16238 makes "the submits and the queue map" return refusal codes, because "nothing on main consumes a GNM command buffer"; the workload submits and sceGnmMapComputeQueueWithPriority are among the 47, while libSceGnmDriver's submits have gone to the AGC driver since #9432.

Question for the maintainers: which of these would you take, if any?

  1. libSceGnmDriver exports the 47 too: calls whose packets don't depend on the mode call libSceGnmDriverForNeoMode's code, and the 13 pick the normal or Neo form with sceKernelIsNeoMode(), as shadPS4 does.
  2. The loader also searches libSceGnmDriverForNeoMode.prx when a title needs libSceGnmDriver.prx, as ReadLibraries adds libc.prx for libSceLibcInternal.prx. ReadLibraries is Windows-only, so Linux and macOS would need the same rule, and the title would then get the normal form from sceGnmDispatchInitDefaultHardwareState and the Neo form from the 13 of the 47 that depend on the mode.
  3. Writers that both libraries build, picking the mode with sceKernelIsNeoMode(). This moves code that #16238 and #16360 change and that #17393, #17395 and #17396 test.

And for a title for which sceKernelIsNeoMode answers 1, should libSceGnmDriver's own sceGnmDispatchInitDefaultHardwareState write the Neo form too?

None of the three was tried, and the title was not run past the load stop. Not checked on Linux.

The 47 imports
NID Name In libSceGnmDriverForNeoMode
ihxrbsoSKWc sceGnmBeginWorkload implemented
5udAm+6boVg sceGnmCreateWorkloadStream implemented
0BzLGljcwBo sceGnmDispatchDirect implemented
Z43vKp5k7r0 sceGnmDispatchIndirect implemented
wED4ZXCFJT0 sceGnmDispatchIndirectOnMec implemented
HlTPoZ-oY7Y sceGnmDrawIndex implemented
GGsn7jMTxw4 sceGnmDrawIndexAuto implemented
ED9-Fjr8Ta4 sceGnmDrawIndexIndirect implemented
thbPcG7E7qk sceGnmDrawIndexIndirectCountMulti implemented
5q95ravnueg sceGnmDrawIndexIndirectMulti implemented
oYM+YzfCm2Y sceGnmDrawIndexOffset implemented
4v+otIIdjqg sceGnmDrawIndirect implemented
cUCo8OvArrw sceGnmDrawIndirectCountMulti implemented
f5QQLp9rzGk sceGnmDrawIndirectMulti implemented
yb2cRhagD1I sceGnmDrawInitDefaultHardwareState350 implemented
im2ZuItabu4 sceGnmDrawInitToDefaultContextState400 implemented
R6z1xM3pW-w sceGnmDriverTraceInProgress implemented
Fa3x75OOLRA sceGnmEndWorkload implemented
FFVZcCu3zWU sceGnmGetOffChipTessellationBufferSize implemented
NfvOrNzy6sk sceGnmInsertDingDongMarker implemented
MYRtYhojKdA sceGnmResetVgtControl implemented
Kx-h-nWQJ8A sceGnmSetCsShaderWithModifier implemented
X9Omw9dwv5M sceGnmSetEmbeddedPsShader implemented
+AFvOEXrKJk sceGnmSetEmbeddedVsShader implemented
5uFKckiJYRM sceGnmSetPsShader350 implemented
cFCp0NX8wf0 sceGnmSetVgtControl implemented
nLM2i2+65hA sceGnmUpdateGsShader implemented
GNlx+y7xPdE sceGnmUpdateHsShader implemented
mLVL7N7BVBg sceGnmUpdatePsShader350 implemented
V31V01UiScY sceGnmUpdateVsShader implemented
UtObDRQiGbs sceGnmDestroyWorkloadStream throwing stub
byXlqupd8cE sceGnmDingDongForWorkload throwing stub
jHdPvIzlpKc sceGnmDrawIndexMultiInstanced throwing stub
stDSYW2SBVM sceGnmDrawOpaqueAuto throwing stub
oL4hGI1PMpw sceGnmGetGpuBlockStatus throwing stub
tZCSL5ulnB4 sceGnmGetGpuInfoStatus throwing stub
iFirFzgYsvw sceGnmGetLastWaitedAddress throwing stub
KnldROUkWJY sceGnmGetNumTcaUnits throwing stub
fzJdEihTFV4 sceGnmGetProtectionFaultTimeStamp throwing stub
nEyFbYUloIM sceGnmGetShaderProgramBaseAddress throwing stub
k7iGTvDQPLQ sceGnmGetShaderStatus throwing stub
URDgJcXhQOs sceGnmInsertThreadTraceMarker throwing stub
A+uGq+3KFtQ sceGnmMapComputeQueueWithPriority throwing stub
6YRHhh5mHCs sceGnmRequestFlipAndSubmitDoneForWorkload throwing stub
XiyzNZ9J4nQ sceGnmSetWaveLimitMultipliers throwing stub
Ga6r7H6Y0RI sceGnmSubmitAndFlipCommandBuffersForWorkload throwing stub
jRcI8VcgTz4 sceGnmSubmitCommandBuffersForWorkload throwing stub
The local change to tools/unwrap_self.py used for the unwrap
diff --git a/tools/unwrap_self.py b/tools/unwrap_self.py
index e439420275d..8b60b4b6c35 100644
--- a/tools/unwrap_self.py
+++ b/tools/unwrap_self.py
@@ -172,6 +172,16 @@ def place_segments(data, headers, records):
             headers[target]["source"] = segment
             placed.add(target)
             used.add(index)
+    for header in headers:
+        if header["index"] in placed or header["type"] in (PT_LOAD, PT_NULL) or not header["size"]:
+            continue
+        containers = [other for other in headers if other["index"] in placed and other["size"]
+                      and other["offset"] <= header["offset"]
+                      and header["offset"] + header["size"] <= other["offset"] + other["size"]]
+        if containers:
+            container = min(containers, key=lambda other: other["size"])
+            header["source"] = container["source"] + (header["offset"] - container["offset"])
+            placed.add(header["index"])
     recorded = [header for header in headers if header["index"] in placed and header["vaddr"] == 0 and header["type"] != PT_LOAD]
     if recorded:
         last = max(recorded, key=lambda header: header["offset"])

AI-assisted: yes. Claude Code unwrapped and converted the title, ran it and the import audits, read the code and drafted this issue; separate review agents checked it, and another argued against it.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6277124569 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/17581). Originally posted by [adam25136](https://github.com/adam25136) on 2026-11-08T23:44:03Z. --- ### What happens A PS4 title stops at load with `FAIL: unresolved ELF import` for 47 of its `libSceGnmDriver` imports (`GetLastError: 127`, exit `0xC0000139`), which AnyPS5 exports only from `libSceGnmDriverForNeoMode.prx` (30 implemented there, 17 throwing stubs), a library the title does not load. ### Title, test or build step inFAMOUS Second Son, CUSA00223 01.07 (the US 01.00 dump with the 01.07 update merged in): `eboot.bin` plus the bundled `sce_module/libc.prx` and `sce_module/libSceFios2.prx`. Bring-up thread: #8214. ### AnyPS5 commit `main` `22ae9a397d` + #17564 (which changes only `tools/import_audit.py`, its test and `docs/user/USAGE.md`). Up to `main` `b5a9a4781c`, nothing since has changed the GNM libraries, the relinker, `libkernel_sys/Export.Discovery.cpp` or `tools/unwrap_self.py`. ### System Windows 10 Pro 22H2 (19045), i9-12900KF, NVIDIA GeForce RTX 5080, driver 621.14, WinLibs GCC 15.2.0 r7, Release ### Steps to reproduce `tools/unwrap_self.py` stops on this eboot with `segment 5 does not fit the file` (segment 5 is `PT_INTERP`, at file offset `0x4000`, the start of `PT_LOAD` 0). All three files were unwrapped with the change at the end of this issue, which places a non-LOAD header that no SELF record covers inside the placed header whose file range holds it. That is a separate problem, not part of this issue. ``` python tools/unwrap_self.py <dump>/eboot.bin source/eboot.elf python tools/unwrap_self.py <dump>/sce_module/libc.prx source/sce_module/libc.prx python tools/unwrap_self.py <dump>/sce_module/libSceFios2.prx source/sce_module/libSceFios2.prx relinker --registry --windows source/eboot.elf run/app.exe ``` The relinker reports 908 references and 2 converted modules (`run/app0/sce_module/libc.prx.guest.prx` and `libSceFios2.prx.guest.prx`). Put `build/core/libs/libs/*.prx` and the three MinGW DLLs in `run/libs/`; no other game files are needed to reach the stop. Start `run/app.exe` with no `APS5_*` or `ANYPS5_*` variable set: it stops after 0.2 s. ### Log <details><summary>stderr of the run (83 lines; paths shortened to the run folder)</summary> ``` [time] scheduler tick raised to 0.5 ms (was 0.50 ms, now 0.50 ms, timed waits fine) FAIL: unresolved ELF import 0BzLGljcwBo FAIL: unresolved ELF import Z43vKp5k7r0 FAIL: unresolved ELF import HlTPoZ-oY7Y FAIL: unresolved ELF import GGsn7jMTxw4 FAIL: unresolved ELF import ED9-Fjr8Ta4 FAIL: unresolved ELF import thbPcG7E7qk FAIL: unresolved ELF import 5q95ravnueg FAIL: unresolved ELF import jHdPvIzlpKc FAIL: unresolved ELF import oYM+YzfCm2Y FAIL: unresolved ELF import 4v+otIIdjqg FAIL: unresolved ELF import cUCo8OvArrw FAIL: unresolved ELF import f5QQLp9rzGk FAIL: unresolved ELF import yb2cRhagD1I FAIL: unresolved ELF import im2ZuItabu4 FAIL: unresolved ELF import stDSYW2SBVM FAIL: unresolved ELF import URDgJcXhQOs FAIL: unresolved ELF import MYRtYhojKdA FAIL: unresolved ELF import Kx-h-nWQJ8A FAIL: unresolved ELF import X9Omw9dwv5M FAIL: unresolved ELF import +AFvOEXrKJk FAIL: unresolved ELF import 5uFKckiJYRM FAIL: unresolved ELF import cFCp0NX8wf0 FAIL: unresolved ELF import nLM2i2+65hA FAIL: unresolved ELF import GNlx+y7xPdE FAIL: unresolved ELF import mLVL7N7BVBg FAIL: unresolved ELF import V31V01UiScY FAIL: unresolved ELF import ihxrbsoSKWc FAIL: unresolved ELF import 5udAm+6boVg FAIL: unresolved ELF import UtObDRQiGbs FAIL: unresolved ELF import byXlqupd8cE FAIL: unresolved ELF import R6z1xM3pW-w FAIL: unresolved ELF import Fa3x75OOLRA FAIL: unresolved ELF import oL4hGI1PMpw FAIL: unresolved ELF import tZCSL5ulnB4 FAIL: unresolved ELF import iFirFzgYsvw FAIL: unresolved ELF import KnldROUkWJY FAIL: unresolved ELF import FFVZcCu3zWU FAIL: unresolved ELF import fzJdEihTFV4 FAIL: unresolved ELF import nEyFbYUloIM FAIL: unresolved ELF import k7iGTvDQPLQ FAIL: unresolved ELF import A+uGq+3KFtQ FAIL: unresolved ELF import 6YRHhh5mHCs FAIL: unresolved ELF import XiyzNZ9J4nQ FAIL: unresolved ELF import Ga6r7H6Y0RI FAIL: unresolved ELF import jRcI8VcgTz4 FAIL: unresolved ELF import wED4ZXCFJT0 FAIL: unresolved ELF import NfvOrNzy6sk Searched libraries: .\app0\sce_module\libSceFios2.prx.guest.prx .\app0\sce_module\libc.prx.guest.prx .\libs\libSceSysmodule.prx .\libs\libSceVideodec.prx .\libs\libSceAjm.prx .\libs\libSceHttp.prx .\libs\libSceSsl.prx .\libs\libSceSaveData.prx .\libs\libSceSaveDataDialog.prx .\libs\libSceMsgDialog.prx .\libs\libSceCommonDialog.prx .\libs\libSceErrorDialog.prx .\libs\libSceNet.prx .\libs\libSceNetCtl.prx .\libs\libSceGnmDriver.prx .\libs\libSceAudioOut.prx .\libs\libSceVideoOut.prx .\libs\libSceUserService.prx .\libs\libScePad.prx .\libs\libSceMouse.prx .\libs\libkernel.prx .\libs\libSceGameLiveStreaming.prx .\libs\libSceSystemService.prx .\libs\libSceNpCommon.prx .\libs\libSceNpManager.prx .\libs\libSceNpTrophy.prx .\libs\libSceAppContent.prx .\libs\libScePlayGo.prx .\libs\libSceDiscMap.prx .\libs\libSceLibcInternal.prx .\libs\libc.prx .\libs\libkernel_sys.prx .\libs\libkernel_web.prx GetLastError: 127 - The specified procedure could not be found. ``` </details> ### What was checked - **Which library has them.** AnyPS5's `libSceGnmDriver/Export.cpp` defines 45 functions and `libSceGnmDriverForNeoMode/Export.cpp` 139 (111 implemented, 28 throwing stubs); none is in both. The PS5 3.20 export table that `docs/dev/debt/libSceGnmDriverForNeoMode.md` cites lists the same 163 names for [`libSceGnmDriver`](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceGnmDriver.c) and [`libSceGnmDriverForNeoMode`](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceGnmDriverForNeoMode.c). AnyPS5's `libSceGnmDriver` has 45 of them and its `libSceGnmDriverForNeoMode` the other 118. That debt file notes that the normal provider also exports 20 unnamed NIDs of `libSceGnmDriverForNeoMode`, and that future implementations there "require loader analysis". - **What the title asks for.** All 85 GNM imports of the eboot name library and module `libSceGnmDriver` in its SCE tables, and none names `libSceGnmDriverForNeoMode`. 38 resolve in `libSceGnmDriver` (14 of them throwing stubs, `sceGnmMapComputeQueue` and `sceGnmDingDong` among them); the other 47 only in `libSceGnmDriverForNeoMode`. The converted program lists `libSceGnmDriver.prx` but not `libSceGnmDriverForNeoMode.prx`, and the entry stub searches only the libraries it lists (`Searched libraries` in the log). The same 47 NIDs are in Andretuta's bring-up thread #8214 and in [DealPotato's list on #6977](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6252843490), both from before `libSceGnmDriverForNeoMode` had them. Earlier runs here on `main` `676fb61acc`, and on `105c9e4d91` with #17140, stopped on the same 47. - **Normal and Pro mode.** `libSceGnmDriverForNeoMode` always writes the Pro (Neo) form: its debt note says its command writers follow shadPS4's Neo-mode path (draw initiators keep flag bits 29 to 31; `sceGnmSetVgtControl` and `sceGnmResetVgtControl` write `IA_MULTI_VGT_PARAM` through `SET_UCONFIG_REG`), and that its 350 and 400 default states are shadPS4's Neo sequences. In [shadPS4 `a808e76`](https://github.com/shadps4-emu/shadPS4/blob/a808e76/src/core/libraries/gnmdriver/gnmdriver.cpp), 13 of the 47 choose their packets with `sceKernelIsNeoMode()`: the 9 draws, the two VGT calls, `sceGnmDrawInitDefaultHardwareState350` and `sceGnmDrawInitToDefaultContextState400`. So does `sceGnmDispatchInitDefaultHardwareState`, which this title takes from AnyPS5's `libSceGnmDriver`, where it always writes the normal form. Since #12427, `sceKernelIsNeoMode` answers from `param.sfo`; this title's `ATTRIBUTE` is `0x20800002`, so it would answer 1 (read from the code; not called in this run). - **Prior work.** [DealPotato's next comment on #6977](https://github.com/boykopovar/AnyPS5/pull/6977#issuecomment-6253259006) describes local changes on that branch, among them "real writers for the draw and dispatch packets, the 350/400 init variants and the shader variants" for part of the 47 (NotImplemented stubs for the rest), from before `libSceGnmDriverForNeoMode` had them. With these and other local fixes, their copy of the title (CUSA00004) loaded, submitted graphics and compute work, and stopped at a GCN image instruction. - **Open pull requests on these libraries.** #16238 and #16360 change `libSceGnmDriverForNeoMode`, #17393, #17395 and #17396 add tests for it, #16882 changes `libSceGnmDriver`, and the #6977 integration draft also carries `libSceGnmDriver`. None moves functions between them. #16238 makes "the submits and the queue map" return refusal codes, because "nothing on `main` consumes a GNM command buffer"; the workload submits and `sceGnmMapComputeQueueWithPriority` are among the 47, while `libSceGnmDriver`'s submits have gone to the AGC driver since #9432. **Question for the maintainers:** which of these would you take, if any? 1. `libSceGnmDriver` exports the 47 too: calls whose packets don't depend on the mode call `libSceGnmDriverForNeoMode`'s code, and the 13 pick the normal or Neo form with `sceKernelIsNeoMode()`, as shadPS4 does. 2. The loader also searches `libSceGnmDriverForNeoMode.prx` when a title needs `libSceGnmDriver.prx`, as `ReadLibraries` adds `libc.prx` for `libSceLibcInternal.prx`. `ReadLibraries` is Windows-only, so Linux and macOS would need the same rule, and the title would then get the normal form from `sceGnmDispatchInitDefaultHardwareState` and the Neo form from the 13 of the 47 that depend on the mode. 3. Writers that both libraries build, picking the mode with `sceKernelIsNeoMode()`. This moves code that #16238 and #16360 change and that #17393, #17395 and #17396 test. And for a title for which `sceKernelIsNeoMode` answers 1, should `libSceGnmDriver`'s own `sceGnmDispatchInitDefaultHardwareState` write the Neo form too? None of the three was tried, and the title was not run past the load stop. Not checked on Linux. <details><summary>The 47 imports</summary> | NID | Name | In `libSceGnmDriverForNeoMode` | |---|---|---| | `ihxrbsoSKWc` | `sceGnmBeginWorkload` | implemented | | `5udAm+6boVg` | `sceGnmCreateWorkloadStream` | implemented | | `0BzLGljcwBo` | `sceGnmDispatchDirect` | implemented | | `Z43vKp5k7r0` | `sceGnmDispatchIndirect` | implemented | | `wED4ZXCFJT0` | `sceGnmDispatchIndirectOnMec` | implemented | | `HlTPoZ-oY7Y` | `sceGnmDrawIndex` | implemented | | `GGsn7jMTxw4` | `sceGnmDrawIndexAuto` | implemented | | `ED9-Fjr8Ta4` | `sceGnmDrawIndexIndirect` | implemented | | `thbPcG7E7qk` | `sceGnmDrawIndexIndirectCountMulti` | implemented | | `5q95ravnueg` | `sceGnmDrawIndexIndirectMulti` | implemented | | `oYM+YzfCm2Y` | `sceGnmDrawIndexOffset` | implemented | | `4v+otIIdjqg` | `sceGnmDrawIndirect` | implemented | | `cUCo8OvArrw` | `sceGnmDrawIndirectCountMulti` | implemented | | `f5QQLp9rzGk` | `sceGnmDrawIndirectMulti` | implemented | | `yb2cRhagD1I` | `sceGnmDrawInitDefaultHardwareState350` | implemented | | `im2ZuItabu4` | `sceGnmDrawInitToDefaultContextState400` | implemented | | `R6z1xM3pW-w` | `sceGnmDriverTraceInProgress` | implemented | | `Fa3x75OOLRA` | `sceGnmEndWorkload` | implemented | | `FFVZcCu3zWU` | `sceGnmGetOffChipTessellationBufferSize` | implemented | | `NfvOrNzy6sk` | `sceGnmInsertDingDongMarker` | implemented | | `MYRtYhojKdA` | `sceGnmResetVgtControl` | implemented | | `Kx-h-nWQJ8A` | `sceGnmSetCsShaderWithModifier` | implemented | | `X9Omw9dwv5M` | `sceGnmSetEmbeddedPsShader` | implemented | | `+AFvOEXrKJk` | `sceGnmSetEmbeddedVsShader` | implemented | | `5uFKckiJYRM` | `sceGnmSetPsShader350` | implemented | | `cFCp0NX8wf0` | `sceGnmSetVgtControl` | implemented | | `nLM2i2+65hA` | `sceGnmUpdateGsShader` | implemented | | `GNlx+y7xPdE` | `sceGnmUpdateHsShader` | implemented | | `mLVL7N7BVBg` | `sceGnmUpdatePsShader350` | implemented | | `V31V01UiScY` | `sceGnmUpdateVsShader` | implemented | | `UtObDRQiGbs` | `sceGnmDestroyWorkloadStream` | throwing stub | | `byXlqupd8cE` | `sceGnmDingDongForWorkload` | throwing stub | | `jHdPvIzlpKc` | `sceGnmDrawIndexMultiInstanced` | throwing stub | | `stDSYW2SBVM` | `sceGnmDrawOpaqueAuto` | throwing stub | | `oL4hGI1PMpw` | `sceGnmGetGpuBlockStatus` | throwing stub | | `tZCSL5ulnB4` | `sceGnmGetGpuInfoStatus` | throwing stub | | `iFirFzgYsvw` | `sceGnmGetLastWaitedAddress` | throwing stub | | `KnldROUkWJY` | `sceGnmGetNumTcaUnits` | throwing stub | | `fzJdEihTFV4` | `sceGnmGetProtectionFaultTimeStamp` | throwing stub | | `nEyFbYUloIM` | `sceGnmGetShaderProgramBaseAddress` | throwing stub | | `k7iGTvDQPLQ` | `sceGnmGetShaderStatus` | throwing stub | | `URDgJcXhQOs` | `sceGnmInsertThreadTraceMarker` | throwing stub | | `A+uGq+3KFtQ` | `sceGnmMapComputeQueueWithPriority` | throwing stub | | `6YRHhh5mHCs` | `sceGnmRequestFlipAndSubmitDoneForWorkload` | throwing stub | | `XiyzNZ9J4nQ` | `sceGnmSetWaveLimitMultipliers` | throwing stub | | `Ga6r7H6Y0RI` | `sceGnmSubmitAndFlipCommandBuffersForWorkload` | throwing stub | | `jRcI8VcgTz4` | `sceGnmSubmitCommandBuffersForWorkload` | throwing stub | </details> <details><summary>The local change to <code>tools/unwrap_self.py</code> used for the unwrap</summary> ```diff diff --git a/tools/unwrap_self.py b/tools/unwrap_self.py index e439420275d..8b60b4b6c35 100644 --- a/tools/unwrap_self.py +++ b/tools/unwrap_self.py @@ -172,6 +172,16 @@ def place_segments(data, headers, records): headers[target]["source"] = segment placed.add(target) used.add(index) + for header in headers: + if header["index"] in placed or header["type"] in (PT_LOAD, PT_NULL) or not header["size"]: + continue + containers = [other for other in headers if other["index"] in placed and other["size"] + and other["offset"] <= header["offset"] + and header["offset"] + header["size"] <= other["offset"] + other["size"]] + if containers: + container = min(containers, key=lambda other: other["size"]) + header["source"] = container["source"] + (header["offset"] - container["offset"]) + placed.add(header["index"]) recorded = [header for header in headers if header["index"] in placed and header["vaddr"] == 0 and header["type"] != PT_LOAD] if recorded: last = max(recorded, key=lambda header: header["offset"]) ``` </details> AI-assisted: yes. Claude Code unwrapped and converted the title, ran it and the import audits, read the code and drafted this issue; separate review agents checked it, and another argued against it.
Sign in to join this conversation.
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#17581
No description provided.