feat(np-tus): add libSceNpTus with offline title user storage #6592
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6592"
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 LuisAguilarDev on 2026-10-15T21:40:21Z.
What
Add libSceNpTus. A title that imports it fails to load:
Failed to load module: libSceNpTus.prx GetLastError: 126.Implemented exports:
sceNpTusCreateNpTitleCtxA,sceNpTusCreateRequest,sceNpTusDeleteRequest,sceNpTusAbortRequest,sceNpTusPollAsync,sceNpTusGetMultiSlotVariableAAsync,sceNpTusSetMultiSlotVariableAAsync,sceNpTusDeleteMultiSlotVariableAAsync,sceNpTusAddAndGetVariableAAsync.PSN is not emulated, so the library follows libSceNpManager:
Title contexts and requests are tracked. An unknown ID returns
SCE_NP_COMMUNITY_ERROR_INVALID_ID. More than 32 contexts or 256 requests returnsTOO_MANY_OBJECTS.The async calls validate their arguments:
INSUFFICIENT_ARGUMENTarrayLen < 1, a negative slot ID or a non-null option returnsINVALID_ARGUMENTTOO_MANY_SLOTIDA valid call starts the request.
A started request finishes with
SCE_NP_ERROR_SIGNED_OUT, the same resultsceNpPollAsyncreports. An aborted request finishes withABORTED.sceNpTusPollAsyncreturns 1 while no operation has started. After one has, it returns 0 and writes that operation's result.Signatures and community error codes come from shadPS4 (
src/core/libraries/np/np_tus/,np_error.h), and fpPS4 agrees on the context and request calls. Two choices differ from shadPS4:sceNpTusCreateNpTitleCtxAcreates a context without checking sign-in. shadPS4 returns thesceNpGetNpIderror instead.The
SceNpTusVariableAlayout is not verified, so output arrays are never written andvariableArraySizeis not checked.Tested
guest_np_tustest passes in 0.11 s. It covers argument validation, the poll states, the signed-out and aborted results, and stale IDs after delete.tools/check_conventions.py --base origin/mainandgit diff --checkpass.stencil clear requires a writable stencil plane), which is a separate topic and not part of this PR. The title has not called the TUS functions yet.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T23:01:33Z.
Review: COMMENTED
Linux run: head
6f109b887merged ontomain5d9dcc42d(clean merge, CMake reconfigured for the new library), in one tree with seven other library PRs that share no files with this one. The description lists Windows only.Machine: Ubuntu 26.04, Intel i7-8700, GCC 15.2, full build, Release,
BUILD_TESTING=ON.libSceNpTusbuilds, andguest_np_tuspasses, 5/5 with--repeat until-fail:5.ctest -E "^agc|gpu|vulkan|video_out"): no regressions. The only failures arefile_writer_binaryandfile_writer_text, which also fail onmainon this machine.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T00:36:33Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)sceNpTusCreateRequestsceNpTusDeleteRequestcore/libs/prx/libSceNpTus/Export.cppSome comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceNpTus/Export.cppImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T06:26:24Z.
Progress report (
feb74b6→6093e8c)📈 System libraries: 91.42% (+0.02%, +9 implemented functions)
✅ 9 implemented
sceNpTusAbortRequestsceNpTusAddAndGetVariableAAsyncsceNpTusCreateNpTitleCtxAsceNpTusCreateRequestsceNpTusDeleteMultiSlotVariableAAsyncsceNpTusDeleteRequestsceNpTusGetMultiSlotVariableAAsyncsceNpTusPollAsyncsceNpTusSetMultiSlotVariableAAsyncImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T07:38:38Z.
Checked the error codes and the poll/abort/delete semantics against shadPS4; the test pins values that only the code produces.
Added by us (own commit on your branch):
docs/dev/debt/libSceNpTus.md, recording the unverifiedSceNpTusVariableAlayout, the context creation without a sign-in check (shadPS4 returns thesceNpGetNpIderror) and the always-signed-out request result.guest_np_tusand the scoped ctest pass on the rebased head.Merging through the queue once its Build run is green. Thanks @jotitadev for the Linux run.