feat(libSceNpCppWebApi): implement the InGameCatalog and TitleCloudStorage IntrusivePtr members and const iterator destructors #8264
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8264"
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 YossiYad on 2026-10-20T07:37:55Z.
What
Of the 73 libSceNpCppWebApi exports named from aerolib in
c136ffa1a9, 24 are members the library already has a measured rule for, and still threw. They now follow those rules:IntrusivePtr(22): the default constructors, copy constructors, destructors,operator->andoperator*of theInGameCatalog::V5(Product,Container, theSku,ProductandContainervectors) andTitleCloudStorage::V1(Owner,DataStatus,GetMultiDataStatusesResponseBody, theDataStatusvector) instantiations use the existingCopyIntrusivePtr/ReleaseIntrusivePtrhelpers with the pointee's reference-count offset from the documented layout: 0x00 for objects, 0x30 forVectorbodies.ConstIteratordestructors forProductandDataStatusreturn 0, like the existing ones.The other 49 keep throwing.
mainhas since rewritten the aerolib debt entry (#8143) to describe the remaining stubs by family without naming the 24, so the entry is left asmainhas it. That includes the parameter objects and the two requests: no title is known to call them, and a request can't be reached while itsTransactionmembers throw.Tested
Linux (Fedora 44, GCC, Ninja,
-DBUILD_TESTING=ON), based onmain3fd1cc393b, rebased onto2abfb1beb4(code diff unchanged; NpCppWebApi tests and fullctestrerun, same 8 failures asmainon this machine):guest_np_cpp_web_api_intrusive_ptrruns its existing construct, access, copy and destroy checks over the 22 new instantiations; each destructor is checked at its pointee's offset, including the last-reference deleter call and the throw without a deleter. It fails when aVectordestructor releases at 0x00 and when an accessor returns null.guest_np_cpp_web_api_offline: the two iterator destructors return 0 without writing. It aborts onmain'sExport.cpp.ctest: 1671 of 1676 pass. The 5 failures (application_heap_scripting,application_heap_lazy,agc_driver_bda_device,agc_driver_guest_memory_lifetime,agc_driver_tessellation) fail the same way onmainon this machine.tools/progress.py --compare: 16 functions implemented. The copy constructors and destructors still count as not implemented becauseReleaseIntrusivePtrthrows on a pointer without a deleter, which this change leaves as it is.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pylists only PRs that conflict withmainand sharecore/libs/CMakeLists.txt(#5021, #6044, #7201, #7332).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 MarcZX10 on 2026-10-20T10:49:52Z.
Cross-check against the symbol list attached to #8143: all 37 newly defined exported symbols in this PR match a
mangledentry exactly, and the correspondingdemanglednames agree with the API names. This corroborates the symbol identification for this subset. The list is PS4-derived NID evidence, so it does not independently establish runtime behavior; the implementation and tests in this PR remain the evidence for those semantics.Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-20T11:41:56Z.
@MarcZX10 thanks for checking the 37 names against the #8143 symbol list.
Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T20:40:35Z.
1. No title can reach the two request changes.
getContainerandgetMultiDataStatusesByUsertake aCommon::Transaction<...>&, so the caller has to construct the transaction first. Its constructor still throws (also L1573), and so dogetResponse, the destructor,startandfinishof both instantiations (L1563-L1606).Transaction<IntrusivePtr<Vector<IntrusivePtr<Container>>>> t; ContainerApi::getContainer(user, param, t);stops in the constructor with "not implemented", so a title never gets the newSCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN. These 73 exports come from PPSA03671's import list (#1033), so that title imports all ten of these members.The description says the 36 exports that keep throwing "act on response objects that a failed request never produces", but these ten are the transaction itself. Every other
Transactioninstantiation in the file returns 0 from its constructor and destructor (e.g. L244), returnsSCE_NP_WEBAPI_ERROR_NOT_SIGNED_INfromstartandgetResponse(L375, L681), and returns 0 fromfinish(L379).TestRequestsFailOfflinecalls the requests without a transaction, so it can't catch this.I'd either keep the two requests throwing in this PR, or give these ten members the same rule and test a request made with a constructed transaction. The second option adds two
finishoverrides to the Silent stubs entry, so point 2 applies to it.2. The 11 parameter members are silent stubs with no title. Debt lines 8-9 put the
ParameterToGetContainerandParameterToGetMultiDataStatusesByUsermembers andParameterToDownloadData::setobjectIdunder Silent stubs. CONTRIBUTING.md allows a silent stub "only when it unblocks a title". The checklist saysUnblocks: none, and the debt entry says no call site is recorded for these exports. #6281, another PPSA03671 import, was closed for this reason: no title calls it, and returning 0 would hide an unknown function. The parameter stubs already in this file came with a title (#6901). I'd keep these 11 throwing, put line 8 back to itsmaintext and drop line 9. Once a title reaches them, they can be added with its title ID and log line.3. The aerolib debt entry describes the new behaviour and names the wrong members as throwing. CONTRIBUTING.md says a PR that closes a gap "removes its entry, or cuts it to what is still open, instead of rewriting it to describe the corrected behaviour". The entry now opens with what the 37 exports do. It then says the other 36 include
IntrusivePtrandConstIteratormembers, but this PR implements all of those. The 36 that still throw are:Vector, 6Iterator, 6Transactionand 4TransactionBasemembersParameterToGetContainer::isInitializedContainer,Product,DataStatus,GetMultiDataStatusesResponseBodyandOwnerI'd cut the entry to what still throws, with the gap first. For the PR as it stands, it could read like this (adjust the list if points 1 or 2 change what throws):
Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-21T06:38:59Z.
@nikowolf123 thanks, all three hold. Since the parameter objects are only there to feed the two requests, and the requests can't be reached while the
Transactionmembers throw, I took the first option and dropped the whole commit (head3570d6dd0):getContainerandgetMultiDataStatusesByUserthrow again, as onmain.maintext and the InGameCatalog line is gone. They can come back with a title ID and a log line once a title reaches them.The PR is now the 22
IntrusivePtrmembers and the twoConstIteratordestructors.guest_np_cpp_web_api_offlinechecks only those destructors now. The threeguest_np_cpp_web_apitests pass 3 of 3,check_conventionshas no findings, andprogress.py --comparegives 16 functions implemented.Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-22T05:34:42Z.
@oneandonlydean @adriadam10 ready from my side: nikowolf123's change requests are done (the unreachable requests and parameter objects were dropped), CI is green, and MarcZX10 checked the symbol names against #8143.