feat(libSceNpCppWebApi): implement the InGameCatalog and TitleCloudStorage IntrusivePtr members and const iterator destructors #8264

Merged
YossiYad merged 2 commits from upstream-pr/8264 into main 2026-10-24 10:39:48 +00:00
YossiYad commented 2026-10-20 07:37:55 +00:00 (Migrated from github.com)

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-> and operator* of the InGameCatalog::V5 (Product, Container, the Sku, Product and Container vectors) and TitleCloudStorage::V1 (Owner, DataStatus, GetMultiDataStatusesResponseBody, the DataStatus vector) instantiations use the existing CopyIntrusivePtr/ReleaseIntrusivePtr helpers with the pointee's reference-count offset from the documented layout: 0x00 for objects, 0x30 for Vector bodies.
  • Iterators (2): the ConstIterator destructors for Product and DataStatus return 0, like the existing ones.

The other 49 keep throwing. main has since rewritten the aerolib debt entry (#8143) to describe the remaining stubs by family without naming the 24, so the entry is left as main has 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 its Transaction members throw.

Tested

Linux (Fedora 44, GCC, Ninja, -DBUILD_TESTING=ON), based on main 3fd1cc393b, rebased onto 2abfb1beb4 (code diff unchanged; NpCppWebApi tests and full ctest rerun, same 8 failures as main on this machine):

  • guest_np_cpp_web_api_intrusive_ptr runs 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 a Vector destructor releases at 0x00 and when an accessor returns null.
  • New guest_np_cpp_web_api_offline: the two iterator destructors return 0 without writing. It aborts on main's Export.cpp.
  • Full 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 on main on this machine.
  • tools/progress.py --compare: 16 functions implemented. The copy constructors and destructors still count as not implemented because ReleaseIntrusivePtr throws on a pointer without a deleter, which this change leaves as it is.
  • tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py lists only PRs that conflict with main and share core/libs/CMakeLists.txt (#5021, #6044, #7201, #7332).

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4932569481 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8264). Originally posted by [YossiYad](https://github.com/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->` and `operator*` of the `InGameCatalog::V5` (`Product`, `Container`, the `Sku`, `Product` and `Container` vectors) and `TitleCloudStorage::V1` (`Owner`, `DataStatus`, `GetMultiDataStatusesResponseBody`, the `DataStatus` vector) instantiations use the existing `CopyIntrusivePtr`/`ReleaseIntrusivePtr` helpers with the pointee's reference-count offset from the documented layout: 0x00 for objects, 0x30 for `Vector` bodies. - **Iterators (2):** the `ConstIterator` destructors for `Product` and `DataStatus` return 0, like the existing ones. The other 49 keep throwing. `main` has since rewritten the aerolib debt entry (#8143) to describe the remaining stubs by family without naming the 24, so the entry is left as `main` has 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 its `Transaction` members throw. ### Tested Linux (Fedora 44, GCC, Ninja, `-DBUILD_TESTING=ON`), based on `main` `3fd1cc393b`, rebased onto `2abfb1beb4` (code diff unchanged; NpCppWebApi tests and full `ctest` rerun, same 8 failures as `main` on this machine): - `guest_np_cpp_web_api_intrusive_ptr` runs 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 a `Vector` destructor releases at 0x00 and when an accessor returns null. - New `guest_np_cpp_web_api_offline`: the two iterator destructors return 0 without writing. It aborts on `main`'s `Export.cpp`. - Full `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 on `main` on this machine. - `tools/progress.py --compare`: 16 functions implemented. The copy constructors and destructors still count as not implemented because `ReleaseIntrusivePtr` throws on a pointer without a deleter, which this change leaves as it is. - `tools/check_conventions.py --base upstream/main` passes. `tools/pr_overlap.py` lists only PRs that conflict with `main` and share `core/libs/CMakeLists.txt` (#5021, #6044, #7201, #7332). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-20 10:49:52 +00:00 (Migrated from github.com)

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 mangled entry exactly, and the corresponding demangled names 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6289197393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8264#issuecomment-6289197393). Originally posted by [MarcZX10](https://github.com/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 `mangled` entry exactly, and the corresponding `demangled` names 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.
YossiYad commented 2026-10-20 11:41:56 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290045518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8264#issuecomment-6290045518). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-20T11:41:56Z. --- @MarcZX10 thanks for checking the 37 names against the #8143 symbol list.
nikowolf123 commented 2026-10-20 20:40:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-20T20:40:35Z.


1. No title can reach the two request changes. getContainer and getMultiDataStatusesByUser take a Common::Transaction<...>&, so the caller has to construct the transaction first. Its constructor still throws (also L1573), and so do getResponse, the destructor, start and finish of 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 new SCE_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 Transaction instantiation in the file returns 0 from its constructor and destructor (e.g. L244), returns SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN from start and getResponse (L375, L681), and returns 0 from finish (L379). TestRequestsFailOffline calls 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 finish overrides 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 ParameterToGetContainer and ParameterToGetMultiDataStatusesByUser members and ParameterToDownloadData::setobjectId under Silent stubs. CONTRIBUTING.md allows a silent stub "only when it unblocks a title". The checklist says Unblocks: 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 its main text 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 IntrusivePtr and ConstIterator members, but this PR implements all of those. The 36 that still throw are:

  • 7 Vector, 6 Iterator, 6 Transaction and 4 TransactionBase members
  • ParameterToGetContainer::isInitialized
  • 12 accessors on Container, Product, DataStatus, GetMultiDataStatusesResponseBody and Owner

I'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):

- [libSceNpCppWebApi](../../../core/libs/prx/libSceNpCppWebApi/Export.cpp) (libSceNpCppWebApi) - 36 exports named from aerolib throw: the `Vector`, `Iterator`, `Transaction` and `TransactionBase` members over the `InGameCatalog::V5` and `TitleCloudStorage::V1` types, `ContainerApi::ParameterToGetContainer::isInitialized`, and the `Container`, `Product`, `DataStatus`, `GetMultiDataStatusesResponseBody` and `Owner` accessors. A mangled name gives the class, the method and the argument types, but the layout of the object the call is made on, the values the caller reads back and the console's errors are unknown. No call site is recorded for any of them
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6300997676 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8264#issuecomment-6300997676). Originally posted by [nikowolf123](https://github.com/nikowolf123) on 2026-10-20T20:40:35Z. --- **1. No title can reach the two request changes.** [`getContainer`](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L1675) and [`getMultiDataStatusesByUser`](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L1725) take a `Common::Transaction<...>&`, so the caller has to construct the transaction first. [Its constructor still throws](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L1558) (also [L1573](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L1573)), and so do `getResponse`, the destructor, `start` and `finish` of 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 new `SCE_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 `Transaction` instantiation in the file returns 0 from its constructor and destructor (e.g. [L244](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L244)), returns `SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN` from `start` and `getResponse` ([L375](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L375), [L681](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L681)), and returns 0 from `finish` ([L379](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/prx/libSceNpCppWebApi/Export.cpp#L379)). [`TestRequestsFailOffline`](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/core/libs/tests/GuestNpCppWebApiOffline.cpp#L58) calls 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 `finish` overrides 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](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/docs/dev/debt/libSceNpCppWebApi.md#L8) put the `ParameterToGetContainer` and `ParameterToGetMultiDataStatusesByUser` members and `ParameterToDownloadData::setobjectId` under Silent stubs. [CONTRIBUTING.md](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/CONTRIBUTING.md#L8) allows a silent stub "only when it unblocks a title". The checklist says `Unblocks: 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 its `main` text 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](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/CONTRIBUTING.md#L73) 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](https://github.com/boykopovar/AnyPS5/blob/a75b7dfc20c4acd33e259f0fab0f4ce2a98fd082/docs/dev/debt/libSceNpCppWebApi.md#L18) now opens with what the 37 exports do. It then says the other 36 include `IntrusivePtr` and `ConstIterator` members, but this PR implements all of those. The 36 that still throw are: - 7 `Vector`, 6 `Iterator`, 6 `Transaction` and 4 `TransactionBase` members - `ParameterToGetContainer::isInitialized` - 12 accessors on `Container`, `Product`, `DataStatus`, `GetMultiDataStatusesResponseBody` and `Owner` I'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): ```markdown - [libSceNpCppWebApi](../../../core/libs/prx/libSceNpCppWebApi/Export.cpp) (libSceNpCppWebApi) - 36 exports named from aerolib throw: the `Vector`, `Iterator`, `Transaction` and `TransactionBase` members over the `InGameCatalog::V5` and `TitleCloudStorage::V1` types, `ContainerApi::ParameterToGetContainer::isInitialized`, and the `Container`, `Product`, `DataStatus`, `GetMultiDataStatusesResponseBody` and `Owner` accessors. A mangled name gives the class, the method and the argument types, but the layout of the object the call is made on, the values the caller reads back and the console's errors are unknown. No call site is recorded for any of them ```
YossiYad commented 2026-10-21 06:38:59 +00:00 (Migrated from github.com)

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 Transaction members throw, I took the first option and dropped the whole commit (head 3570d6dd0):

  1. getContainer and getMultiDataStatusesByUser throw again, as on main.
  2. The 11 parameter members throw again. The TitleCloudStorage Silent stubs line is back to its main text and the InGameCatalog line is gone. They can come back with a title ID and a log line once a title reaches them.
  3. The aerolib entry now starts with the gap, using your text with the list widened to the 49 that still throw (your 36 plus the 13 above), and no longer describes what the implemented members do.

The PR is now the 22 IntrusivePtr members and the two ConstIterator destructors. guest_np_cpp_web_api_offline checks only those destructors now. The three guest_np_cpp_web_api tests pass 3 of 3, check_conventions has no findings, and progress.py --compare gives 16 functions implemented.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309768735 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8264#issuecomment-6309768735). Originally posted by [YossiYad](https://github.com/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 `Transaction` members throw, I took the first option and dropped the whole commit (head `3570d6dd0`): 1. `getContainer` and `getMultiDataStatusesByUser` throw again, as on `main`. 2. The 11 parameter members throw again. The TitleCloudStorage Silent stubs line is back to its `main` text and the InGameCatalog line is gone. They can come back with a title ID and a log line once a title reaches them. 3. The aerolib entry now starts with the gap, using your text with the list widened to the 49 that still throw (your 36 plus the 13 above), and no longer describes what the implemented members do. The PR is now the 22 `IntrusivePtr` members and the two `ConstIterator` destructors. `guest_np_cpp_web_api_offline` checks only those destructors now. The three `guest_np_cpp_web_api` tests pass 3 of 3, `check_conventions` has no findings, and `progress.py --compare` gives 16 functions implemented.
YossiYad commented 2026-10-22 05:34:42 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6333570381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8264#issuecomment-6333570381). Originally posted by [YossiYad](https://github.com/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.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!8264
No description provided.