feat(libSceNpUtility): model the lookup and word filter requests offline #9887
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9887"
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 MarrasFederico on 2026-10-22T20:42:52Z.
What
The 14 lookup and word filter exports of libSceNpUtility threw. They now follow shadPS4's np_utility.cpp offline, the way #9009 modelled libSceNpTus:
INSUFFICIENT_ARGUMENT; more than 32 title contexts or 32 requests isTOO_MANY_OBJECTS; an unknown id isINVALID_ID; deleting a title context deletes its requests. Word filter ids start at0x01000001and0x02000001, as in shadPS4'snp_utility.h.sceNpWordFilterCreateAsyncRequestneeds a parameter whose size field is0x18.sceNpLookupNpIdchecks the option before the null arguments, the censor and sanitize calls check the null arguments, the option and the 0x400-byte comment limit, all in shadPS4's order. A request can be used once (INVALID_TYPEafter), and an aborted one answersABORTED. Then they finish withSCE_NP_ERROR_SIGNED_OUT: returned by a synchronous request, reported bysceNpWordFilterPollAsyncfor an asynchronous one. No NpId or sanitized comment is written.sceNpWordFilterPollAsyncrefuses a null result (INVALID_ARGUMENT) and a synchronous request (INVALID_ID);sceNpWordFilterAbortRequestfinishes an unstarted request withABORTEDand leaves a finished one's result.shadPS4's own word filter accepts every comment as a stand-in for the server, so only its argument checks are used here. Nothing is measured on a PS5; the new debt file says so.
sceNpBandwidthTestInitStartkeeps throwing.#8472 declares other libSceNpUtility exports between the bandwidth test calls and these, and creates the same debt file with an
Unknown function infosection; theExport.cpphunks do not touch each other, and whichever lands second keeps both debt sections.Tested
Ubuntu 26.04.1, kernel 7.0.0-38, GCC 15.2.0, Release, full build with
BUILD_TESTING=ON. Windows was not compiled. No title was run.guest_np_utility_offline(core/libs/tests/GuestNpUtilityOffline.cpp): both id bases and the 32-context and 32-request limits, every argument check and the check order insceNpLookupNpIdand both comment calls, the 0x400 and 0x401-byte comments, single use,SIGNED_OUTfrom synchronous requests and throughsceNpWordFilterPollAsync, polling a synchronous request, abort before and after the request finished, deleting a title context with its requests, and no NpId or comment written.main(sceNpLookupCreateTitleCtx not implemented) and passes with this change. 15 mutations of the new code (each check and its order, single use, both offline results, the limits, the async parameter size, the id base, the abort rule, polling a synchronous request, deleting a context's requests) each fail it.tools/check_conventions.py --base upstream/mainpasses;tools/pr_overlap.pylists only #8472, described above.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)