Skip to content

feat(libSceUlt): implement sceUltUlthreadTryJoin, sceUltUlthreadRuntimeDestroy and the underscore ulthread exports - #2153

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
EdouardSence:feat/ult-ulthread-runtime
Oct 9, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
EdouardSence:feat/ult-ulthread-runtime

Conversation

@EdouardSence

Copy link
Copy Markdown
Contributor

What

Rise of the Ronin (PPSA04540) imports these five libSceUlt functions, and none of them is exported:

  • _sceUltUlthreadRuntimeOptParamInitialize
  • _sceUltUlthreadRuntimeCreate
  • _sceUltUlthreadCreate
  • sceUltUlthreadTryJoin
  • sceUltUlthreadRuntimeDestroy

On main the relinked title doesn't start, because the loader reports them as undefined symbols. The title imports no libSceUlt function without the underscore except sceUltInitialize, sceUltFinalize, sceUltUlthreadJoin and sceUltUlthreadRuntimeGetWorkAreaSize. So the underscore names are the exported entry points the SDK calls.

  • Underscore exports: they forward to the existing sceUltUlthreadRuntimeOptParamInitialize, sceUltUlthreadRuntimeCreate and sceUltUlthreadCreate. Those already take the trailing build version argument.
  • sceUltUlthreadTryJoin: returns ULT_ERROR_BUSY while the ulthread's entry has not returned. Otherwise it joins like sceUltUlthreadJoin.
  • sceUltUlthreadRuntimeDestroy: returns ULT_ERROR_BUSY while an ulthread created on the runtime is not joined. Otherwise it forgets the runtime, so a later sceUltUlthreadCreate on it returns ULT_ERROR_STATE.

The shared signatures and both busy rules are inferred. They are recorded in TechnicalDebt.

Tested

Linux (CachyOS, GCC), RX 9070 XT.

  • New tests: guest_ult_thread_tryjoin and guest_ult_thread_destroy cover busy and joined TryJoin, busy and idle RuntimeDestroy, a destroyed runtime, and the null and unknown cases, all through the underscore exports. The existing guest_ult_* tests still pass (10/10).
  • tools/check_conventions.py: passes.
  • Rise of the Ronin, scripted and headless:
    • With this change, plus local placeholders that throw for the other missing imports (libSceJson2, libSceSaveData, libSceNgs2, libSceNet, libSceRazorCpu), the title gets through its ULT setup.
    • It then creates its swapchain, starts compiling shaders and stops at about 9 s on computed/data-dependent s_swappc_b64 call target at program counter 0x00000074 is not statically resolvable (Ghost of Yōtei: compute shader calls a user-data function pointer with s_swappc_b64 (not statically resolvable) #1817).
    • With throwing placeholders for the ULT functions instead, it stopped on the first call, _sceUltUlthreadRuntimeOptParamInitialize not implemented.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. The investigation, code, tests and this description were written by Claude (Claude Code) on my machine.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Progress report (54f28f2 → 04dda44)

📈 System libraries: 85.33% (+0.03%, +5 implemented functions)

✅ 5 implemented
Library Name
libSceUlt _sceUltUlthreadCreate
libSceUlt _sceUltUlthreadRuntimeCreate
libSceUlt _sceUltUlthreadRuntimeOptParamInitialize
libSceUlt sceUltUlthreadRuntimeDestroy
libSceUlt sceUltUlthreadTryJoin

@popcoder565

Copy link
Copy Markdown
Contributor

Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head fd7c096b, merged onto main d70b899 in one build with 38 other PRs that had no Windows run.

No title was run.

🤖 Addressed by Claude Code

…meDestroy and the underscore ulthread exports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10
adriadam10 force-pushed the feat/ult-ulthread-runtime branch from fd7c096 to 04dda44 Compare October 9, 2026 21:31
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked: the 3 underscore forwarders, TryJoin and RuntimeDestroy against the diff; guest_ult_thread_* pass locally (4/4) and the new tests don't link without the change. The BUSY returns are recorded as inferred in TechnicalDebt (prosper, the only reference, returns EAGAIN with MED confidence and no second source). Windows ctest confirmed by @popcoder565. The only red job (hardware_oracle on Windows) is unrelated; merging once CI is green.

@adriadam10
adriadam10 merged commit 2a42045 into boykopovar:main Oct 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants