libSceAmpr: the std::_Pad thread launch exports are stubs (Deathloop, Minecraft Legends); fix branch ready #3361
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 screamm on 2026-10-11T08:56:49Z.
The Dinkumware
std::_Padexports in libSceAmpr (Export.cpp) areNotImplemented_nid_no_patchstubs:_Pad::_Pad(),~_Pad(),_Pad::_Launch(pthread**)and_Pad::_Release(). They are what Dinkumware'sstd::threadconstructor uses to start a thread and wait for it to begin; Deathloop (PPSA01670) and Minecraft Legends import them.Fix branch ready:
screamm:feat/ampr-pad-launch(f2830d8c, one commit onmain0c617bae). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. It edits the sameExport.cppas the_Cnd_signalbranch in #3342 (independent hunks).src/thr/xthread(layout: vtable at 0, condition handle at 0x8, mutex handle at 0x10,bool _Launchedat 0x18, 32 bytes, checked at compile time) andsrc/thr/threadcall.cpp(_Padmethods) at ganboing/crt.vc12f1d47126, with the pointer-to-slot handle form of the merged libcThreads.cpp(#3079). The constructor runs_Cnd_init,_Mtx_init(plain), clears the flag and locks the mutex;_Launchcreates the guest thread through libkernel'spthread_create(the route_Thrd_joinalready uses) with an entry that reads_Gofrom vtable slot 0, calls it and returns its result as the exit code, then waits on the condition until released;_Releaselocks, sets the flag, wakes and unlocks; the destructor unlocks and destroys. Null pad or slot throwinvalid_argument; failed thread creation or primitive calls throw (VC12 would raise a guestsystem_errorthrough_Throw_Cpp_error, offered separately in #3346)._Releaseuses_Cnd_broadcastsince the pad's private condition has one waiter (_Cnd_signalis offered in #3342). TechnicalDebt records the header-only layout, Sony's extra named_Pad/_Launchoverloads that are not modelled, the default thread attributes and the skipped_Cnd_do_broadcast_at_thread_exit.guest_ampr_threadsgains a launch whose_Goreleases after 20 ms and keeps running after the pad is destroyed (exit code read back through_Thrd_join), four sequential pads, and every throw case.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_ampr_threads3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"513/513; withmain'sExport.cppthe extended test fails;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T09:52:42Z.
Independent verification on Linux (the gap noted in the report): CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.f2830d8conto currentmain(the branch was 142 commits behind): applies cleanly, no conflicts (including against the_Cnd_signalchanges from #3342's area, which landed in the meantime as separate hunks).tools/check_conventions.py --base origin/mainandgit diff --checkpass.guest_ampr_threadspasses.ctest -j8 -E "^agc_driver_|^video_out_flip"): 520/520 passed.The rebased branch is available at
blawesom:verify/3361for anyone carrying — the commit is otherwise unchanged.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T16:16:13Z.
Carried David’s ready
_Padcommit unchanged into #3742, preserving its author metadata. The current-main Linuxguest_ampr_threadstest passes locally; Linux full-suite and Windows evidence are summarized in the PR description.