Skip to content

feat(libkernel): deliver guest signals on Linux and keep signal masks per thread - #1

Open
Zaid-Talib wants to merge 2455 commits into
mainfrom
claude/focused-turing-ivfmjn
Open

Zaid-Talib wants to merge 2455 commits into
mainfrom
claude/focused-turing-ivfmjn

Conversation

@Zaid-Talib

@Zaid-Talib Zaid-Talib commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

What

Guest signal delivery in libkernel on Linux, and per-thread guest signal masks on both platforms. Based on current upstream main (311c049). Five commits; commits 2, 4 and 5 fix defects that adversarial reviews of the commit before each found and confirmed:

1. feat(libkernel): deliver sceKernelRaiseException on Linux

sceKernelRaiseException threw on Linux (NotImplemented), so a title whose garbage collector stops threads with it could not run there. Unity's PS5Util module does this: it installs a SIGUSR1 handler with sceKernelInstallExceptionHandler, raises SIGUSR1 on each thread and reads mc_rsp from the handler's context (see the existing TechnicalDebt entry). shadPS4 records that libkernel's install is a sigaction wrapper (SA_SIGINFO | SA_RESTART) and the raise a pthread_kill; this follows that model.

  • The raise sends the host SIGUSR1 to the target thread with pthread_kill. The host handler builds the FreeBSD-layout ucontext the Windows path already uses: general registers, rip, rsp, rflags, cs, ss and the 512-byte FXSAVE area. It calls the guest handler on the target's own stack and writes the registers back. Only the 416 bytes up to XMM15 are written back; the rest of the FXSAVE area holds the kernel's XSAVE frame marker, and overwriting it would make sigreturn drop the upper YMM halves.
  • errno is left as the handler leaves it. libthr does the same: handle_signal in lib/libthr/thread/thr_sig.c saves errno after the user handler.
  • A raise on another thread blocks the host signal, takes the target's join lock and returns ESRCH once the thread has finished, so a detached thread's pthread_t is never used after the thread exits. PthreadPrivate records the pthread_t at creation and adoption.
  • The handler table is lock-free (the host handler reads it). GuestUcontext is alignas(16) like FreeBSD's mcontext_t; its layout and size do not change.

2. fix(libkernel): keep raises off unregistered threads and clamp the handler's MXCSR

Three defects found by an adversarial review of commit 1, each reproduced before the fix:

  • A raise right after scePthreadCreate reached the thread before RunThread set currentThread. scePthreadSelf() in the handler then adopted a second handle (1997 of 2000 immediate raises), and could deadlock on glibc's per-thread lock when the signal interrupted pthread_getattr_np (gdb backtrace in the review). The creator now blocks all signals around the std::thread construction, so the child starts with them blocked. RunThread restores the creator's mask once the thread is registered, as libthr does.
  • A handler that set reserved MXCSR bits made rt_sigreturn fail with SIGSEGV. The MXCSR the handler leaves is masked with MXCSR_MASK (0xffbf when it reads 0), as FreeBSD's fpusetregs does. This applies on both platforms; Windows also keeps CONTEXT.MxCsr equal to FltSave.MxCsr.
  • The no-device pacing sleep of sceAudioOutOutput/sceAudioOutOutputs (sleepUs, since fix(audioout): keep ports without a device in real time boykopovar/AnyPS5#955) returned early when a raise interrupted it. It now sleeps the remaining time, as TimedWait::SleepNanos does.

3. fix(libkernel): keep guest signal masks per thread in FreeBSD's bit layout

sigprocmask kept one process-wide mask, read only its first word, and tested signal n at bit n. FreeBSD's sigset_t keeps signal n at bit n − 1 (_SIG_BIT), so blocking SIGTERM blocked SIGURG instead. A signal raised while blocked was dropped, and sceKernelRaiseException ignored the target's mask.

  • The mask is per thread, as libthr's sigprocmask is (it forwards to the kernel's per-thread mask). All 128 bits are kept in PthreadPrivate, a new thread starts with its creator's mask, and SIGKILL, SIGSTOP and SIGTHR cannot be blocked (SIG_CANTMASK, libthr's SIGCANCEL).
  • A signal raised while blocked stays pending and is delivered once, when it is unblocked, before sigprocmask returns.
  • On Linux the blocked mapped signals and SIGUSR1 are applied to the thread's host mask, which the kernel enforces and which a query reads back. A handler therefore sees its own signal blocked, as on FreeBSD.
  • On Windows the thread keeps its pending signals. raise and the CRT dispatcher record a blocked one, a raise on another thread checks the mask while the target is suspended, and sigprocmask delivers what it unblocks.

4. fix(libkernel): block a signal while its handler runs and restore the mask after it

  • Signal blocked during its handler: on Windows a handler did not run with its own signal blocked, so a raise during it ran the handler again inside itself. A raise now claims the signal's bit in the target's mask with one atomic fetch_or, while the target is suspended (or is the caller); a second raise finds the bit set and stays pending until the handler returns. The CRT dispatcher blocks the signal it delivers the same way.
  • Mask restored after the handler: FreeBSD's sigreturn installs uc_sigmask. The SIGUSR1 handler's context now carries the interrupted mask, and whatever mask the handler leaves there is installed when it returns. On Linux its mapped bits go to the host frame's uc_sigmask; the CRT dispatcher restores the mask the thread had before the handler.
  • Ignored signals: a raise of a signal set to SIG_IGN is discarded, as FreeBSD's tdsendsignal does. On Windows, installing SIG_IGN discards the calling thread's pending signal.
  • CRT dispatcher on Windows: it no longer adopts the thread it runs on (that leaked a handle per Ctrl+C), and it no longer defers a signal the CRT raises itself, such as abort()'s SIGABRT, which FreeBSD's abort() unblocks first.

5. fix(libkernel): make sigprocmask atomic and redeliver a pending raise in place

  • Atomic sigprocmask on Linux: a SIGUSR1 delivered between sigprocmask's store of the new mask and its host update wrote the handler's interrupted mask back over it. The call returned 0, but the change to a mapped signal was lost (about one call in 100000 under constant raises). sigprocmask now blocks the mapped host signals while it reads, changes and stores the mask, and installs the result with one pthread_sigmask, as the console's system call is atomic.
  • Atomic sigprocmask on Windows: it claims SIGUSR1's bit for the same span, so a raise in that span stays pending and is delivered when the call returns.
  • Redelivery in place (Windows): a raise that arrived during a handler was delivered afterwards through the self-raise path, so the second handler saw libkernel's context instead of the interrupted code, its register changes were dropped, and each such delivery nested another frame. Deliver now runs the pending raise itself, as FreeBSD delivers after sigreturn: with the interrupted context the previous handler left, the mask it claims, and the handler installed at that moment.
  • APC claim timing (Windows): the APC path claimed the signal when the raise was queued, while the target could still be running other code, so a stale interrupted mask could be installed later. The APC now claims when it runs.
  • TechnicalDebt records that guest setjmp/longjmp do not save the signal mask as FreeBSD's do.

TechnicalDebt: the "throws on Linux" and "does not consult the target thread's signal mask" lines are replaced by what still differs from the console. A new entry records that a SIGINT or SIGTERM sent from outside the process can run the handler on an emulator thread. On Linux, the handler runs wherever the thread was interrupted, emulator code included. On the console, kernel objects are syscalls and libthr defers signals while a thread holds its internal locks; here a host lock held by the interrupted code stays held. Host waits and sleeps resume after the handler, and the calls Linux does not restart return EINTR to the guest.

Tested

  • Ubuntu 24.04, GCC 13.3, Release, -DBUILD_TESTING=ON, after each commit: full build, then ctest with lavapipe and ANYPS5_REQUIRE_VULKAN=1: 409 passed, 0 failed. 23 GPU tests skipped themselves because they need host subgroups wider than lavapipe's 8 lanes.
  • After rebasing onto c8a2f06, and again onto 311c049: 415 of 416 passed. guest_sce_net aborts, and it aborts the same way with this branch's files reverted to main, so it is broken on main itself (the IPv6 change in fix(net): provide IPv6 unspecified address object boykopovar/AnyPS5#1248 is the likely cause), not by this branch.
  • guest_raise_exception, now registered on every platform, covers:
    • the thread states: self, busy, waiting in sceKernelWaitSema, blocked on a host mutex, leaving a wait;
    • a register round trip: r12, r13, xmm8 and MXCSR, including a reserved MXCSR bit;
    • 50 raises right after scePthreadCreate, each checking scePthreadSelf() in the handler;
    • SIGUSR1 blocked on itself and on another thread;
    • the handler's view of the mask, uc_sigmask round-tripping, and a raise inside the handler being deferred;
    • a raise during a handler patching r12 of the interrupted code after the handler returns;
    • two threads toggling a mapped signal for two seconds under constant raises, checking every query (the unfixed sigprocmask fails 4 runs in 5);
    • a finished thread → ESRCH.
  • Stress runs of the raise test, all passing: 150/150 serial and 100/100 with 5 in parallel on 4 cores (commit 1); 100/100 serial and 40/40 with 4 in parallel (commit 2); 60/60 serial together with guest_signals (commit 3); 80/80 serial and 32/32 in parallel, each together with guest_signals (commit 4); 40/40 serial with guest_signals and 24/24 in parallel (commit 5).
  • guest_signals covers:
    • the bit layout, and pending delivery with coalescing;
    • all four words, and the unblockable signals;
    • an aliased set/oset;
    • inheritance by a created thread, including a signal above 32;
    • handler mask scoping for CRT signals, and SIG_IGN discards.
  • Mutation check, all caught. The tests fail when any of these is removed or reverted: the register write-back, the FXSAVE write-back, the r13 read, the startup signal block, the MXCSR clamp, the bit layout, the host-mask update, the unblockable-signal filter, the creator-mask copy, the mask restore after a CRT handler, the SIG_IGN discard, or the uc_sigmask fill and write-back.
  • Windows: not run (no Windows host here). Every changed file compiles with x86_64-w64-mingw32-g++ (GCC 13, -fsyntax-only -Wall -Wextra); Thread.cpp hits the same three errors on main, from that toolchain's older headers (SetThreadDescription, EfficiencyClass). The Windows logic was reviewed by reading only. CI runs it.
  • No title tested.

Checklist

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwJx7AHrSUaMGSpEGhL1Kb

@Zaid-Talib Zaid-Talib changed the title feat(libkernel): deliver sceKernelRaiseException on Linux feat(libkernel): deliver guest signals on Linux and keep signal masks per thread Oct 8, 2026
@Zaid-Talib
Zaid-Talib force-pushed the claude/focused-turing-ivfmjn branch 3 times, most recently from 24f89cf to 7714301 Compare October 8, 2026 15:21
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Progress report (311c049 → c356112)

📈 System libraries: 85.6% (+0.48%, +321 implemented, +143 declared, -1 reverted, -45 removed functions)

✅ 321 implemented
Library Name
libSceAgc sceAgcBranchPatchSetElseTarget_0300
libSceAgc sceAgcBranchPatchSetThenTarget_0300
libSceAgc sceAgcCreateInterpolantMapping_0100
libSceAgc sceAgcDcbContextStateOp_0100
libSceAgc sceAgcDcbSetIndexSize_0600
libSceAgc sceAgcFuseShaderHalves_0200
libSceAgc sceAgcGetDataPacketPayloadAddress_0090
libSceAgc sceAgcGetFusedShaderSize_0080
libSceAgc sceAgcInit_0090
libSceAgc sceAgcJumpPatchSetTarget_0300
libSceAgcDriver sceAgcDriverGetTFRing
libSceAgcDriver sceAgcDriverRegisterMultipleResources
libSceAjm.native sceAjmBatchJobDecodeSplit
libSceAjm.native sceAjmBatchJobSetResampleParametersEx
libSceAmpr _Lock_shared_ptr_spin_lock_nid_postfix
libSceAmpr _Thrd_join_nid_postfix
libSceAmpr _Thrd_sleep_nid_postfix
libSceAmpr _Unlock_shared_ptr_spin_lock_nid_postfix
libSceAmpr wcstombs_s_nid_postfix
libSceAppContent sceAppContentTemporaryDataUnmount
libSceAudio3d sceAudio3dObjectSetAttributes
libSceAudio3d sceAudio3dPortFlush
libSceAudioIn sceAudioInInit
libSceAudioOut sceAudioOut2MasteringTerm
libSceCdlgG2P sceG2PDialogClose
libSceCdlgG2P sceG2PDialogGetResult
libSceCdlgG2P sceG2PDialogGetStatus
libSceCdlgG2P sceG2PDialogInitialize
libSceCdlgG2P sceG2PDialogOpen
libSceCdlgG2P sceG2PDialogTerminate
libSceCdlgG2P sceG2PDialogUpdateStatus
libSceFont sceFontDettachDeviceCacheBuffer
libSceFont sceFontGetScriptLanguage
libSceFont sceFontGetTypographicDesign
libSceFont sceFontSetScriptLanguage
libSceFont sceFontSetTypographicDesign
libSceGameLiveStreaming sceGameLiveStreamingGetCurrentStatus2
libSceHttp sceHttpSetAuthInfoCallback
libSceHttp sceHttpSetCookieRecvCallback
libSceHttp sceHttpSetRecvBlockSize
libSceHttp sceHttpSetRedirectCallback
libSceHttp sceHttpSetRequestStatusCallback
libSceHttp sceHttpsGetSslError
libSceHttp sceHttpsSetSslVersion
libSceHttp2 sceHttp2GetMemoryPoolStats
libSceHttp2 sceHttp2SetResolveRetry
libSceIme sceImeGetPanelPositionAndForm
libSceJobManager WorkerEntry
libSceJobManager _ZN3sce3Job10JobManager10initializeEPvmjjPKNS1_12ConfigParamsE
libSceJobManager _ZN3sce3Job10JobManager10initializeEPvmjjjmPKNS1_12ConfigParamsE
libSceJobManager _ZN3sce3Job10JobManager24setPersistentThreadCountEj
libSceJobManager _ZN3sce3Job10JobManager27getSequenceFactoryInterfaceENS1_8PriorityE
libSceJobManager _ZN3sce3Job10JobManager34getUnifiedSequenceFactoryInterfaceENS1_8PriorityE
libSceJobManager _ZN3sce3Job10JobManager8shutdownEv
libSceJobManager _ZN3sce3Job10JobManagerC1Ev
libSceJobManager _ZN3sce3Job10JobManagerC2Ev
libSceJobManager _ZN3sce3Job10JobManagerD1Ev
libSceJobManager _ZN3sce3Job10JobManagerD2Ev
libSceJson2 _ZN3sce4Json5Value5clearEv
libSceJson2 _ZNK3sce4Json6Object5emptyEv
libSceLibcInternal alarm_nid_postfix
libSceLibcInternal getprogname_nid_postfix
libSceLibcInternal utime_nid_postfix
libSceNet sceNetGetMemoryPoolStats
libSceNet sceNetResolverStartNtoaMultipleRecordsEx
libSceNgs2.native sceNgs2PanGetVolumeMatrix
libSceNgs2.native sceNgs2PanInit
libSceNpEntitlementAccess sceNpEntitlementAccessGetEntitlementKey
libSceNpEntitlementAccess sceNpEntitlementAccessPollServiceEntitlementInfoList
libSceNpEntitlementAccess sceNpEntitlementAccessPollUnifiedEntitlementInfoList
libSceNpEntitlementAccess sceNpEntitlementAccessRequestServiceEntitlementInfoList
libSceNpEntitlementAccess sceNpEntitlementAccessRequestUnifiedEntitlementInfoList
libSceNpManager sceNpCheckNpAvailability
libSceNpManager sceNpSetTimeout
libSceNpManager sceNpUnregisterNpReachabilityStateCallback
libSceNpWebApi2 sceNpWebApi2GetMemoryPoolStats
libSceOpusDec sceOpusDecCreateEx
libSceOpusDec sceOpusDecDecode
libSceOpusDec sceOpusDecDestroy
libSceOpusDec sceOpusDecGetSize
libSceOpusDec sceOpusDecInitialize
libSceOpusDec sceOpusDecTerminate
libScePosixForWebKit arc4random_buf_nid_postfix
libScePosixForWebKit gethostbyname_nid_postfix
libScePosixForWebKit isatty_nid_postfix
libScePosixForWebKit mkstemp_nid_postfix
libSceRtc sceRtcGetDosTime
libSceRtc sceRtcParseDateTime
libSceRudp sceRudpActivate
libSceRudp sceRudpGetStatus
libSceShare sceShareSetContentParamForApplicationTitle
libSceSharePlay sceSharePlayGetCurrentConnectionInfoA
libSceSsl sceSslFreeCaList
libSceSsl sceSslGetCaList
libSceSsl sceSslGetMemoryPoolStats
libSceSsl sceSslUnloadCert
libSceSysmodule sceSysmoduleGetModuleHandleInternal
libSceSystemGesture sceSystemGestureAppendTouchRecognizer
libSceSystemGesture sceSystemGestureGetPrimitiveTouchEventByIndex
libSceSystemGesture sceSystemGestureGetPrimitiveTouchEvents
... 221 more
🆕 143 declared as stubs
Library Name
libSceAgc sceAgcAcbAtomicGds_0900
libSceAgc sceAgcUpdateInterpolantMapping_0100
libSceAjm.native sceAjmDecWVorbisCreateHeaderPacket
libSceAjm.native sceAjmDecWVorbisCreateSetupPacket
libSceAmpr _Cnd_init_with_name_nid_postfix
libSceAmpr _Cnd_signal_nid_postfix
libSceAmpr _Thrd_id_nid_postfix
libSceAmpr _ZNKSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE3getES3_S3_RSt8ios_baseRNSt5_IosbIiE8_IostateEP2tmPKcSE__nid_postfix
libSceAmpr _ZNSt4_Pad7_LaunchEPP7pthread_nid_postfix
libSceAmpr _ZNSt4_Pad8_ReleaseEv_nid_postfix
libSceAmpr _ZNSt4_PadC2Ev_nid_postfix
libSceAmpr _ZNSt4_PadD2Ev_nid_postfix
libSceAmpr _ZNSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE_nid_postfix
libSceAmpr _ZNSt8ios_base7_AddstdEPS__nid_postfix
libSceAmpr _ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE_nid_postfix
libSceAmpr _ZNSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE7_GetcatEPPKNSt6locale5facetEPKS5__nid_postfix
libSceAmpr _ZSt16_Throw_Cpp_errori_nid_postfix
libSceAmpr _ZTVN10__cxxabiv119__pointer_type_infoE_nid_postfix
libSceAmpr _ZTVN10__cxxabiv120__function_type_infoE_nid_postfix
libSceAmpr _ZTVSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE_nid_postfix
libSceAmpr __cxa_call_unexpected_nid_postfix
libSceAppContent sceAppContentAddcontEnqueueDownload
libSceAppContent sceAppContentGetAddcontDownloadProgress
libSceAudioOut sceAudioOut2EnableChat
libSceAudioOut sceAudioOutExClose
libSceAudioOut sceAudioOutExConfigureOutput
libSceAudioOut sceAudioOutExGetMonitorInfo
libSceAudioOut sceAudioOutExOpen
libSceAudioOut sceAudioOutSysClose
libSceAudioOut sceAudioOutSysConfigureOutput
libSceAudioOut sceAudioOutSysGetHdmiMonitorInfo
libSceAudioOut sceAudioOutSysOpen
libSceAudioPropagation sceAudioPropagationSourceSetAudioPath
libSceContentDelete sceContentDeleteById
libSceContentExport sceContentExportCancel
libSceContentExport sceContentExportFromDataWithThumbnail
libSceContentExport sceContentExportGetProgress
libSceContentSearch sceContentSearchGetContentLastUpdateId
libSceContentSearch sceContentSearchGetNumOfContent
libSceContentSearch sceContentSearchGetTotalContentSize
libSceContentSearch sceContentSearchOpenMetadataByContentId
libSceHttp sceHttpAbortWaitRequest
libSceHttp sceHttpSetCookieEnabled
libSceHttp2 sceHttp2WebSocketCloseAsync
libSceHttp2 sceHttp2WebSocketCreateRequest
libSceHttp2 sceHttp2WebSocketSendDataMessageAsync
libSceHttp2 sceHttp2WebSocketSendTextMessageAsync
libSceHttp2 sceHttp2WebSocketSetPingInterval
libSceJobManager _ZN3sce3Job10JobManager27calculateRequiredMemorySizeEPKNS1_21MemorySizeQueryParamsE
libSceJson2 _ZN3sce4Json14InitParameter2C2Ev
libSceJson2 _ZN3sce4Json17InitParameterRttiC1EPNS0_14AllocParamRttiEPvm
libSceJson2 _ZN3sce4Json18InitParameterRtti216setAllocatorRttiEPNS0_14AllocParamRttiEPv
libSceNet sceNetShowNetstat
libSceNetCtlApDialog sceNetCtlApDialogClose
libSceNetCtlApDialog sceNetCtlApDialogGetResult
libSceNetCtlApDialog sceNetCtlApDialogInitialize
libSceNetCtlApDialog sceNetCtlApDialogOpen
libSceNetCtlApDialog sceNetCtlApDialogTerminate
libSceNetCtlApDialog sceNetCtlApDialogUpdateStatus
libSceNpManager sceNpGetSandboxInfo
libSceNpPartner001 sceNpEAAccessInitialize
libSceNpPartner001 sceNpEAAccessTerminate
libSceNpSessionSignaling sceNpSessionSignalingGetConnectionFromPeerAddress
libSceOpusCeltDec sceOpusCeltDecCreateEx
libSceOpusCeltDec sceOpusCeltDecDecode
libSceOpusCeltDec sceOpusCeltDecDestroy
libSceOpusCeltDec sceOpusCeltDecGetSize
libSceOpusCeltDec sceOpusCeltDecInitialize
libSceOpusCeltDec sceOpusCeltDecTerminate
libScePad scePadVrControllerReadState
libScePsml_debug scePsmlMfsr2CreateContext
libScePsml_debug scePsmlMfsr2CreateSharedResources
libScePsml_debug scePsmlMfsr2GetContextInitRequirement
libScePsml_debug scePsmlMfsr2GetDispatchPackets
libScePsml_debug scePsmlMfsr2GetDispatchPacketsSizeInDwords
libScePsml_debug scePsmlMfsr2GetSharedResourcesInitRequirement
libScePsml_debug scePsmlMfsr2Init
libScePsml_debug scePsmlMfsr2ReleaseContext
libScePsml_debug scePsmlMfsr2ReleaseSharedResources
libScePsml_debug scePsmlMfsrCreateContext1300
libScePsml_debug scePsmlMfsrGetDispatchMfsrPacket1000
libScePsml_debug scePsmlMfsrGetDispatchMfsrPacket1300
libSceSaveData.native sceSaveDataCancel
libSceSaveData.native sceSaveDataConvert
libSceSaveData.native sceSaveDataGetConvertProgress
libSceSystemService sceSystemServiceKillApp
libSceSystemService sceSystemServiceLaunchApp
libSceUsbd sceUsbdAllocTransfer
libSceUsbd sceUsbdAttachKernelDriver
libSceUsbd sceUsbdCancelTransfer
libSceUsbd sceUsbdCheckConnected
libSceUsbd sceUsbdClaimInterface
libSceUsbd sceUsbdClose
libSceUsbd sceUsbdControlTransfer
libSceUsbd sceUsbdEventHandlingOk
libSceUsbd sceUsbdFillInterruptTransfer
libSceUsbd sceUsbdFreeConfigDescriptor
libSceUsbd sceUsbdFreeTransfer
libSceUsbd sceUsbdGetActiveConfigDescriptor
libSceUsbd sceUsbdGetBusNumber
... 43 more
⚠️ 1 went back to stubs
Library Name
libSceHttp sceHttpWaitRequest
🗑️ 45 removed
Library Name
libSceAgc sceAgcAcb_gQkqkLttcpw
libSceAgc sceAgcCreateInterpolantMapping
libSceAgc sceAgcCreateInterpolantMappingVsPs
libSceAgc sceAgcDcbContextStateAnotherOp
libSceAgc sceAgcGetDataPacketPayloadAddressUnk
libSceAgc sceAgcUnknownFuseShaderHalves
libSceAgc sceAgcUnknownGetFusedShaderSize
libSceAgc sceAgcUnknownInitState
libSceAgc sceAgcUnknown_7Wa3aeJgeVU
libSceAgc sceAgcUnknown_Ikfdt_MrIqCE
libSceAgc sceAgcUnknown__MKRzWekV120
libSceAgc sceAgcUnknown_rP5xLdOf26k
libSceAjm.native sceAjmWVorbisUnknown00
libSceAjm.native sceAjmWVorbisUnknown01
libSceAppContent sceAppContentUnknown00
libSceJson2 sceJson2Unknown00
libSceNpPartner001 sceNpPartnerUnknown_7CxI50_MxlCk
libSceNpPartner001 sceNpPartnerUnknown_pMxXhNozUX8
libScePsml_debug scePsmlMfsr2Unknown_0GAw7SmkwII
libScePsml_debug scePsmlMfsr2Unknown_1ic5q_MkdOsc
libScePsml_debug scePsmlMfsr2Unknown_5z2gBlqxJ_P0
libScePsml_debug scePsmlMfsr2Unknown_Kyy1baXgaVU
libScePsml_debug scePsmlMfsr2Unknown_ZLL31lzzxr4
libScePsml_debug scePsmlMfsr2Unknown_gMduXCLYrNg
libScePsml_debug scePsmlMfsr2Unknown_lrJwpLjKXRc
libScePsml_debug scePsmlMfsr2Unknown_m9JLPc3wOQw
libScePsml_debug scePsmlMfsr2Unknown_o_PNM86gEwFE
libSceVideoOut sceVideoOutUnknown00
libSceVideoOut sceVideoOutUnknown01
libc LibcHeapErrorReportForGame_nid_postfix
libc libcCyberUnknown03
libc libcCyberUnknown05
libc libcCyberUnknown07
libc libcCyberUnknown09
libc libcCyberUnknown10
libc libcCyberUnknown11
libc libcCyberUnknown12
libc libcCyberUnknown13
libc libcCyberUnknown14
libc libcCyberUnknown16
libc libcCyberUnknown18
libc libcCyberUnknown19
libc libcUnknown_u2tMGOLaqnE
libc sceLibcUnknown_BnMAMrsfVWo
libkernel sceCoredumpUnknown01
🔗 1 now sharing sources
Library Name
libScePsml libScePsml_debug

📈 GPU shader instructions: 100.0% (+3.0%, +35 implemented instructions)

✅ 35 implemented
Encoding Name
DS DS_CONDXCHG32_RTN_B64
DS DS_GWS_BARRIER
DS DS_GWS_INIT
DS DS_GWS_SEMA_BR
DS DS_GWS_SEMA_P
DS DS_GWS_SEMA_RELEASE_ALL
DS DS_GWS_SEMA_V
DS DS_ORDERED_COUNT
MIMG IMAGE_GATHER4H_PCK
MIMG IMAGE_GATHER8H_PCK
MIMG IMAGE_LOAD_BY2
MIMG IMAGE_LOAD_BY4
MIMG IMAGE_LOAD_MIP_BY2
MIMG IMAGE_LOAD_MIP_BY4
MIMG IMAGE_LOAD_MIP_PCK2
MIMG IMAGE_LOAD_MIP_PCK4
MIMG IMAGE_LOAD_PCK2
MIMG IMAGE_LOAD_PCK4
MIMG IMAGE_STORE_BY2
MIMG IMAGE_STORE_BY4
MIMG IMAGE_STORE_MIP_BY2
MIMG IMAGE_STORE_MIP_BY4
MIMG IMAGE_STORE_MIP_PCK2
MIMG IMAGE_STORE_MIP_PCK4
MIMG IMAGE_STORE_PCK2
MIMG IMAGE_STORE_PCK4
SOP1 S_RFE_B64
SOP1 S_SWAPPC_B64
SOPK S_CALL_B64
SOPP S_CODE_END
SOPP S_SENDMSGHALT
SOPP S_SETHALT
VOP3 V_INTERP_P1LL_F16
VOP3 V_INTERP_P1LV_F16
VOP3 V_INTERP_P2_F16

husseinkad and others added 25 commits October 11, 2026 05:11
The original fix predates llroundf, which was added in boykopovar#2933. Use the same guest range and exception behavior for the fourth wrapper and include it in the edge-case checks.
…a16-float

feat(agc): present 16-bit float display buffers
…sse2

perf(agc): store write-back changes sixteen bytes at a time
…Int64Atomics

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tex-fetch-aliasing

fix(shader): preserve aliased embedded fetch attributes
fix(shader): convert f16 bits to f32 without UnpackHalf2x16
…s-programs

feat(agc): accept graphics programs without an AGC shader header
feat(libSceVideoOut): accept VRR peg and unpeg on a fixed-rate output
…ad-set-name-np

feat(libkernel): implement pthread_set_name_np
…odule-lifetime

fix(agc): keep a shader library part's modules until the part is destroyed
…ad-kill

feat(libkernel): implement pthread_kill
…ir-read-only-3049

fix(libkernel): remove read-only directories with rmdir on Windows
…ector-io

fix(libkernel): route vector I/O on guest sockets
pushkarreddyy and others added 29 commits October 11, 2026 14:12
Add standard quiet NaN generators nanf (DZU+K1wozGI) and nan (zck+6bVj5pA) to libc.

Resolves startup failure in VLC for PS5 (PPSA85300) where execution halts at nanf on Linux once strsep is available.
…lared-binding

fix(relinker): bind Linux guest imports by declared module identity
…-short

fix(libc): keep EINVAL from strerror_r for an unknown error with a short buffer
…etadata

perf(agc): write draw descriptors from retained CPU metadata
…-info-st-size

fix(libkernel): ignore the input st_size of sceKernelGetModuleInfoFromAddr
…y-pool-stats

feat(libSceNpWebApi2): implement sceNpWebApi2GetMemoryPoolStats
… third-party results

Drops the stale pending-dependency note (boykopovar#553 boykopovar#683 boykopovar#684 boykopovar#685 are merged), adds the
package source and the Linux, extended-gameplay, save/load and audio results
reported in the thread, and replaces the cold-start note with the measured cause.
The UCRT diagnostic note is removed: no report on current main.

Co-Authored-By: Claude <noreply@anthropic.com>
…-denorm-flush

fix(shader): flush v_ldexp_f16 denormals per the f16 denormal mode
…r-images

fix(agc): typed image heaps on devices without nullDescriptor
…getprogname

feat(libSceLibcInternal): implement getprogname
fix(libScePad): queue input states for scePadRead
…connection-info

fix(libSceSharePlay): export sceSharePlayGetCurrentConnectionInfoA with no Share Play session
…-2832

fix(agc): keep polling unsatisfied memory waits after diagnostics
…iteral-braces

fix(progress): ignore braces in literals and comments when scanning bodies
…red-compare-nvidia

fix(shader): emit unordered f32 relations as negated ordered ones
Add an optional input helper for test runs without desktop input injection. Preserve physical input and release injected buttons automatically.

Validation: guest_pad tests and Python helper CLI smoke checks passed. Written with AI assistance.
…ew-compatibility

docs: record DOOM homebrew integration compatibility
Map red and blue exports, write masks and constant-color blend factors together. Reject conflicting simultaneous target constants.

Semantics: Mesa 26.2.2 src/amd/common/ac_formats.c ac_translate_colorswap; console equivalence remains unverified. Graphics tests passed. Written with AI assistance.
feat(pad): accept timed controller pulses from a local command file
…-errors

fix(libkernel): translate scalar POSIX I/O errors
…order

fix(agc): support alternate channel order in 16-bit color targets
sceKernelRaiseException threw on Linux, so a title whose garbage
collector stops threads with it (Unity's PS5Util raises SIGUSR1 on each
thread and reads mc_rsp from the handler's context) could not run there.

The raise now sends the host SIGUSR1 to the target thread with
pthread_kill. The host handler, installed on first use with SA_SIGINFO
and SA_RESTART, builds the FreeBSD-layout ucontext from the interrupted
registers and the FXSAVE area, calls the guest handler on the target's
own stack and writes the registers back, so the handler's changes reach
the interrupted code, as they do on Windows. errno is left as the
handler leaves it, as libthr does.

A raise on another thread takes the target's join lock with the host
signal blocked and returns ESRCH once the thread has finished, so a
detached thread's pthread_t is never signalled after it exits. The
pthread_t is recorded when the thread is created or adopted. Handlers
are now lock-free atomics, as the host handler reads them.

guest_raise_exception now runs on every platform. It also checks that
r13 and xmm8 reach the handler and that r12 and xmm8 written by the
handler reach the interrupted code.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwJx7AHrSUaMGSpEGhL1Kb
…ndler's MXCSR

Two defects found in review of the Linux delivery:

A raise right after scePthreadCreate reached the new thread before
RunThread set currentThread, so scePthreadSelf() in the handler adopted
a second handle, and could deadlock on glibc's thread lock when the
signal interrupted pthread_getattr_np. The creator now blocks all
signals around the std::thread construction, so the child starts with
them blocked, and RunThread restores the creator's mask once the thread
is registered, as libthr does. A raise in that window stays pending and
is delivered just before the entry runs.

A handler that set reserved MXCSR bits made rt_sigreturn fail with
SIGSEGV. The MXCSR the handler leaves is now masked with the frame's
MXCSR_MASK (0xffbf when it reads 0), as FreeBSD's fpusetregs does, on
both platforms; Windows also keeps CONTEXT.MxCsr equal to
FltSave.MxCsr.

guest_raise_exception raises right after each of 50 thread creations and
checks scePthreadSelf() in the handler, and its context round trip sets
a reserved MXCSR bit and FZ and checks that only FZ is kept.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwJx7AHrSUaMGSpEGhL1Kb
@adriadam10
adriadam10 force-pushed the claude/focused-turing-ivfmjn branch from 7714301 to c356112 Compare October 11, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.