Repository navigation
feat(np-tus): add libSceNpTus with offline title user storage - #6592
Conversation
jotitadev
left a comment
There was a problem hiding this comment.
Linux run: head 6f109b887 merged onto main 5d9dcc42d (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.- Non-GPU suite (
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.
|
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.
Some 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.
|
Progress report (feb74b6 → 6093e8c)📈 System libraries: 91.42% (+0.02%, +9 implemented functions) ✅ 9 implemented
|
Titles that import libSceNpTus failed to load because the library did not exist. Title contexts and requests are tracked, arguments are validated, and every storage operation completes as signed out, matching how libSceNpManager reports PSN.
6f109b8 to
6093e8c
Compare
|
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): Merging through the queue once its Build run is green. Thanks @jotitadev for the Linux run. |
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)