Repository navigation
PAC-MAN WORLD Re-PAC (PPSA06399) Boots and plays with Audio #3443
billythemenace2
started this conversation in
Game bring-up
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
[Game bring-up] PAC-MAN WORLD Re-PAC (PPSA06399, Unity) on Windows, main
4f8d4017: boots and plays with four local changes; one relinker regression and one crash foundResult on main
4f8d4017(11 Oct) plus the attached patch: the title boots, the title screen, menus and levels render correctly, audio works, and I completed a level. The run ended with an abort on the level-complete transition (item 3). No debug switches were set.Short version for maintainers:
unresolved ELF import7755e1d05; small fix in the patchsceSysmoduleLoadModuleids 0x110 and 0x127 unknownlibSceNpTrophy2--module-dir), #3173 (pipeline library module lifetime)This is my second Unity IL2CPP title; the first was Silt (PPSA03306) in #2810.
Screenshots
Setup
UP0700-PPSA06399_00-PACMANWORLDRE008,4f8d4017c7a4ce112e967b320478ec5d4450276f+ the attached patch (10 files)Layout next to
eboot.elf:sce_module/with the title's six system modules,Media/Modules/(Il2CppUserAssemblies.prx,PS5Util.prx) andMedia/Plugins/(four Unity plugins).No
APS5_*variables were set.1. Relinker regression: a needed library is left out of the start-up load list
With an unmodified
4f8d4017relinker the title stops before the window opens:Gl6w5i0JokYissceAppContentDownloadDataGetAvailableSpaceKb.libSceAppContent.prxis not in the searched list, and neither arelibSceAudio3d.prx,libSceHmd.prxandlibSceJson2.prx, all four of which were loaded for this title on56fb1b3b.The registry written by
--registryshows 49 imports of the executable with no matched library:#g#gsceAjmBatchInitializelibSceAjm.native.prx(loaded)#W#WsceAvPlayerAddSourceExlibSceAvPlayer.native.prx(loaded)#V#VsceMsgDialogOpenlibSceMsgDialog.native.prx(loaded)#X#XsceAppContentInitializelibSceAppContent.prx(not loaded)My reading of
WindowsEntryStubBuilder.cpp: since87ca3a2cfa host library counts as imported from when its name up to the first dot equals a declared module name, and since7755e1d05a library that does not count is not loaded at all, where8ebf89284only skipped it when it was missing. The first three groups match by stem. The AppContent imports declare a module whose name is notlibSceAppContent(I believelibSceAppContentUtil, but I did not read it out of the ELF), so the file that holds them is dropped and the unnamed imports, which search every loaded library, find nothing. The commit message of87ca3a2cfmentions the same kind of mismatch forlibSceJsonandlibSceJson2.prx, so other titles should be affected.Change in the patch: if any declared module name matches no needed library by stem, every needed library is kept in the load list, because such an import may be in any of them. A missing library that nothing imports from is still skipped whenever all declared names do match. With the change the relinker-only build passes its 110 tests on Linux, and this title starts.
A better fix may be a table of module names that differ from their file names; I did not attempt that.
2. Start-up stall at 0 FPS (not on main)
Unchanged from what I measured on
56fb1b3b;Exception.cpphas not changed since. A timed all-thread dump showed the main thread insceKernelWaitSemainside IL2CPP's GC, waiting for the other threads to acknowledge signal 30, and one thread parked here:RaiseOnhad redirected another thread into its handler while that thread heldDirectories().mutex; the thread above then waited on that mutex in a non-alertable wait and never ran its own handler. Same shape as theWindowsMappings::mutexdeadlock in #2810, and the case #727 warns about.Local change (
libkernel/System/src/Exception.cpp): when the suspended target'sripis outside guest code (the exe, the*.guest.prximages and the guest arena),RaiseOnresumes it and retries instead of redirecting it, for up to 2 s; if the thread is still at the samerspafter that it is redirected as before and a[signal]line is printed. That line has never appeared. The Windows condition-variable wait inPthread/src/Cond.cppre-takes its mutex by polling.On
56fb1b3b: 4/5, 6/8 and 7/8 boots with earlier partial attempts, then 8/8 with this change. On main I have only booted with the change in place (both boots fine), so I have not re-measured the stall rate without it on main.This is probably not the design #727 wants (interruptible waits). I am reporting it as evidence, with a dump available, rather than as the fix.
3. Abort on the level-complete transition: R8 colour target on a freed stencil plane (not on main, not fixed here)
Unity's render-texture pool freed a D32S8 target and gave the memory of its stencil plane to a 1920x1080 R8_UNORM colour target. #3277 lets a view fall through when its texel is not one byte wide; this one is one byte wide with the plane's extent, so it is still taken for the stencil plane, first as a colour target (pushed to the non-resident path) and then as a sampled texture (fatal).
The patch has a smaller change in the same area:
cachedStorageTextureasks whether the view has the plane's extent and a texel the plane can hold (DepthSurfaceViewedBy) instead ofDepthSurfaceAt(address). On56fb1b3bthat removed a fatalcompute shader ...: storage image access to depth/stencil surfaceright after the menu. It does not help here, for the same reason #3277 does not.No format test can separate these two. What I am trying next, not in this patch and not yet run: the last binder owns the memory. Binding a colour target over a depth surface's depth or stencil plane retires that surface for lookups until it is bound as a depth target again. The branches of #454 and #2519 look like they address surface retirement more thoroughly; I could not check their state.
Related: depth surfaces are never released. On
56fb1b3ba run ended after two levels withvkAllocateMemory depth target: Vulkan result -2, and a capture after one level listed 34 live depth surfaces, 32 of them 1920x1080 D32S8. On main this run reached 4244 MiB on the device-local heap (1778 MiB sampled textures and 642 MiB cached storage images accounted for) before the abort above ended it. I have not measured the depth surfaces' share, so the link is likely, not proven.4. Unknown system module ids (not on main)
0x110 and 0x127. The call returns success and the title carries on. #2541 adds 0x110 as
libSceNpTrophy2; I do not know what 0x127 is.5. What worked on main without local help
56fb1b3bthis title rendered levels blown out to white with a missing sky, and black objects on the title screen, because it clears depth by zero-filling the HTILE with a toolkit fill kernel (0x30000bytes for 1920x1080,0x40000for its 2048x2048 shadow atlas) followed by a rect-list draw that writes no depth. On main the picture is correct with no local change.--module-dir.PSNCore.prxandSaveData.prxstart when the title loads them; no copying intoprx/and no local relinker change needed.56fb1b3bthe background optimized link crashed inamdvlk64.dll(0xc0000005,amdvlk64.dll+0x21ee870) on the loading screen unlessAPS5_NO_PIPELINE_LTO=1was set. On main, without the switch, this run went through eight level loads without it. One run, so encouraging rather than proven.Other observations from this run
/savedata0twice without an error. I did not verify the contents.Wanted to force a call to sce::Agc::suspendPoint but not safe...repeated for up to 5 seconds during start-up while the first 169 shaders compiled.libc,libSceFace,libSceFaceTracker,libSceJobManager,libSceNpCppWebApi,libScePfs,PS5Util,Il2CppUserAssembliesand four Unity plugins itself. The relinker reported 1750 external references; with the fix in item 1 none is unresolved at start-up.The attached patch
anyps5-pacman-repac-main-4f8d4017.patch, against4f8d4017, 10 files. It is what this run used. Each row would be its own pull request:relinker/elfpatcher/src/windows/WindowsEntryStubBuilder.cpplibkernel/System/src/Exception.cpp,libkernel/Pthread/src/Cond.cpplibc/include/WindowsMappings.hpp,libc/include/GuestArena.hpp,libc/src/GuestArena.cpp,libkernel/System/src/Exception.cppGraphics/src/DepthSurface.cpp,Graphics/include/DepthSurface.hpp,Graphics/src/ShaderResources.cpplibc/src/specifics/windows/CrashReport.cppNotes
anyps5-pacman-repac-main-4f8d4017.patch
All reactions