Files
AnyPS5/docs/dev/debt/libSceUlt.md
T

5.6 KiB

libSceUlt technical debt

Unknown function info

  • Bound condition variables use the creation-time mutex, inferred from PPSA28061 callers of _sceUltConditionVariableCreate; the wait caller reloads only the condition argument. Error precedence, busy/state errors, FIFO signal selection and unsupported recursive waits have not been measured on PS5 hardware. Non-null options and waits at recursion depth above one throw. A live condition prevents destroying its bound mutex. Finalization follows the existing host mutex lifecycle: it invalidates conditions and wakes queued or reacquiring waiters with a state error. Scheduling priority and build-version validation are not implemented.

  • libSceUlt ulthreads - _sceUltUlthreadRuntimeOptParamInitialize, _sceUltUlthreadRuntimeCreate and _sceUltUlthreadCreate are assumed to take the same arguments as the existing exports without the underscore, including the trailing build version. Concurrent join ownership is not modeled: the native runtime distinguishes an ordinary running thread from one with another joiner. Host threads do not use the guest context or worker scheduler.

  • libSceUlt queues - the added sceUltQueuePop, sceUltQueueTryPush, sceUltQueueDestroy and sceUltQueueDataResourcePoolDestroy signatures are inferred from the existing push/pop and object APIs. Queue destruction is assumed to reject blocked callers with ULT_ERROR_BUSY and otherwise discard queued data; pool exhaustion returns ULT_ERROR_AGAIN. These rules, alignment checks and shared slot limits have not been confirmed on PS5 hardware or a title.

  • sceUltQueueCreate, sceUltQueueDataResourcePoolCreate - a non-null option parameter is accepted and ignored, as the other Ult create calls already do. OpenOrbis declares sceUltQueueOptParamInitialize and sceUltQueueDataResourcePoolOptParamInitialize without their structures; the PS Vita libult in RPCS3 defines both as a 16-byte reserved header followed by reserved fields, 128 bytes, with no settings, and fpPS4 keeps them as 128 opaque bytes. That the PS5 structures carry no settings either is assumed from these, not verified

  • _sceUltWaitingQueueResourcePoolCreate, _sceUltSemaphoreCreate, _sceUltMutexOptParamInitialize, _sceUltMutexCreate, _sceUltQueueDataResourcePoolCreate and _sceUltQueueCreate (libSceUlt) forward to the exports without the underscore; that their argument lists match is inferred from the other underscore Ult exports, not measured

  • Ult factory and creation exports without a leading underscore are absent from the supplied module; their signatures remain unresolved. Diagnostic signatures and synchronization argument lists are recovered. The nested context in UltUlthreadInfo still requires reconstruction.

  • sceUltMutexTryLock, the reader-writer lock and sceUltUlthreadGetSelf, sceUltUlthreadYield and sceUltUlthreadExit (libSceUlt) - the signatures follow the PS Vita libult in RPCS3 (a 256-byte lock and 128-byte option structures), not a PS5 binary. The rules are assumed: readers may take the lock while a writer waits, a thread that holds the write lock gets ULT_ERROR_STATE for any further lock instead of waiting on itself, a reader asking for the write lock waits on its own read lock, and the try forms return ULT_ERROR_BUSY. Outside an ulthread, sceUltUlthreadGetSelf, sceUltUlthreadYield and sceUltUlthreadExit return ULT_ERROR_STATE; inside one they act on the guest thread it runs on, since ulthreads are not scheduled cooperatively here

Functional

  • libSceUlt queues use preallocated host storage instead of the supplied guest work area; its existing size formula and the 512-byte object layouts remain unverified. Waiting-queue pool thread limits and waiter priority ordering are not implemented. Finalization wakes blocked queue callers with ULT_ERROR_STATE.

  • sceUltWaitingQueueResourcePoolDestroy refuses with ULT_ERROR_BUSY only when a thread is currently waiting on a pool-backed mutex, semaphore or queue, matching the PS5 libSceUlt disassembly (0x473a in or55417wcDk); bound but idle objects do not block pool destruction. Waiting-queue pool guest work area node accounting is not implemented.

  • sceUltMutexDestroy returns ULT_ERROR_BUSY when the mutex is held or has waiting threads, tracked via owner and waiter counts in UltMutexState. Prosper (hle_ult.cpp) logs a destroy of a held mutex and returns ULT_OK; AnyPS5 returns ULT_ERROR_BUSY to prevent destroying active mutexes.

  • The following pending declarations have unverified signatures and behavior; they are parameterless import-resolution declarations and throw through NotImplemented_nid_no_patch: _sceUltConditionVariableOptParamInitialize.