feat(libSceNpCppWebApi): fill audited Common/vector/model exports from bundled module #14122

Merged
akkadbakkad89 merged 3 commits from upstream-pr/14122 into main 2026-11-05 21:19:08 +00:00
akkadbakkad89 commented 2026-10-31 19:45:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-31T19:45:00Z.


What

Implements the 67 libSceNpCppWebApi exports that are imported by the audited titles, currently stubbed, and not covered by any open pull request, plus the construct/destruct/setter coherence ports those accessors need (BasicPresence, BasicProfile, Binary). Behaviour is ported from the libSceNpCppWebApi module bundled with PPSA13197 (Stellar Blade sce_module), unwrapped and disassembled — 79 definitions in all:

  • Common::Iterator operator++/operator*/operator!= over the audited IntrusivePtr element families and unsigned long: an iterator is a zero 32-bit tag plus the element pointer at +8; ++ advances by the element size (0x18 for IntrusivePtr, 8 for unsigned long), * returns the element address, != compares the stored pointers
  • Common::Vector begin/end/size/empty over the same families and Vector<IntrusivePtr<ResponsePlayerSessionPlayer>>::copyFrom: reads and writes host-created bodies; title-provided bodies throw, as before. copyFrom follows the module — releases the old elements through the element reference count, adopts the source context when unset, copies each handle with a lock inc, and returns 0x80553504 on allocation failure
  • TransactionBase<Vector<Container>, ResponseHeaderBase>::operator= (two-word copy) and start: the module's guard order — null context → 0x80553503, unset context → 0x80553502, then the request path, which stays SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN offline
  • Binary::getBinary/size (+8/+0x10), BasicPresence construct/destruct, set{AccountId,InContext,OnlineStatus} and the matching getters/IsSet bytes (0x10/0x18, 0x21/0x22, 0x1c/0x20)
  • BasicProfile construct/destruct — the destructor releases the members in the module's order: the Vector<String> at 0x90 (reference count at object+0x38), the vector at 0x70 (+0x30), the String at 0x48, the pointer at 0x28 (+0x00) — plus setOnlineId, setIsOfficiallyVerified and the onlineIdIsSet/personalDetailIsSet/isOfficiallyVerifiedIsSet bytes (0x24/0x40/0xaa)
  • Sku price/label fields and *IsSet bytes, Product getId/getType/getDisplayName/getDescription/getReleaseDate/releaseDateIsSet/skusIsSet/getSkus, Container::getChildren (vector handle at 0x228, reference count at +0x30), PlayerSession::getSessionId (string at 0x10), GetPublicProfilesResponse::getProfiles and PostPlayerSessionsResponseBody::getPlayerSessions (vector handle at 0x30), and CommunicationRestrictionStatusResponse::getRestricted (byte at 0x30)

The remaining unimplemented exports in the same families still throw, and the debt file now records which offsets were measured and which accessors remain unverified.

Tested

Windows 11 host, MinGW build. ctest -R np_cpp_web_api: all 9 tests pass (guest_np_cpp_web_api_{intrusive_ptr,signed_out,offline,matchmaking,string,title_cloud_storage} plus the three alias tests). The intrusive-pointer test now constructs real BasicProfile/BasicPresence objects and asserts the IsSet flags and getter round-trips. No title run: the accessors are exercised through unit tests only, matching how the surrounding machinery was validated. python3 tools/check_conventions.py --base origin/main clean; python3 tools/pr_overlap.py --branch feat-npcwa-common-fill reports no overlap with the 100 open PR heads.

Checklist

  • Based on current main; no other open PR implements the same functions except the already-disclosed overlaps: Common::Binary::size/getBinary also appear in #12808 (same audited offsets) and Vector<IntrusivePtr<BasicPresence>>::size in #11631 (with its own HostVectorSize helper) — whichever of those lands second reconciles the duplicate helper
  • 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: #11221, #12447
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5100946754 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14122). Originally posted by [akkadbakkad89](https://github.com/akkadbakkad89) on 2026-10-31T19:45:00Z. --- ### What Implements the 67 `libSceNpCppWebApi` exports that are imported by the audited titles, currently stubbed, and not covered by any open pull request, plus the construct/destruct/setter coherence ports those accessors need (`BasicPresence`, `BasicProfile`, `Binary`). Behaviour is ported from the `libSceNpCppWebApi` module bundled with PPSA13197 (Stellar Blade `sce_module`), unwrapped and disassembled — 79 definitions in all: - `Common::Iterator` `operator++`/`operator*`/`operator!=` over the audited `IntrusivePtr` element families and `unsigned long`: an iterator is a zero 32-bit tag plus the element pointer at +8; `++` advances by the element size (0x18 for `IntrusivePtr`, 8 for `unsigned long`), `*` returns the element address, `!=` compares the stored pointers - `Common::Vector` `begin`/`end`/`size`/`empty` over the same families and `Vector<IntrusivePtr<ResponsePlayerSessionPlayer>>::copyFrom`: reads and writes host-created bodies; title-provided bodies throw, as before. `copyFrom` follows the module — releases the old elements through the element reference count, adopts the source context when unset, copies each handle with a `lock inc`, and returns `0x80553504` on allocation failure - `TransactionBase<Vector<Container>, ResponseHeaderBase>::operator=` (two-word copy) and `start`: the module's guard order — null context → `0x80553503`, unset context → `0x80553502`, then the request path, which stays `SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN` offline - `Binary::getBinary`/`size` (+8/+0x10), `BasicPresence` construct/destruct, `set{AccountId,InContext,OnlineStatus}` and the matching getters/`IsSet` bytes (0x10/0x18, 0x21/0x22, 0x1c/0x20) - `BasicProfile` construct/destruct — the destructor releases the members in the module's order: the `Vector<String>` at 0x90 (reference count at object+0x38), the vector at 0x70 (+0x30), the `String` at 0x48, the pointer at 0x28 (+0x00) — plus `setOnlineId`, `setIsOfficiallyVerified` and the `onlineIdIsSet`/`personalDetailIsSet`/`isOfficiallyVerifiedIsSet` bytes (0x24/0x40/0xaa) - `Sku` price/label fields and `*IsSet` bytes, `Product` `getId`/`getType`/`getDisplayName`/`getDescription`/`getReleaseDate`/`releaseDateIsSet`/`skusIsSet`/`getSkus`, `Container::getChildren` (vector handle at 0x228, reference count at +0x30), `PlayerSession::getSessionId` (string at 0x10), `GetPublicProfilesResponse::getProfiles` and `PostPlayerSessionsResponseBody::getPlayerSessions` (vector handle at 0x30), and `CommunicationRestrictionStatusResponse::getRestricted` (byte at 0x30) The remaining unimplemented exports in the same families still throw, and the debt file now records which offsets were measured and which accessors remain unverified. ### Tested Windows 11 host, MinGW build. `ctest -R np_cpp_web_api`: all 9 tests pass (`guest_np_cpp_web_api_{intrusive_ptr,signed_out,offline,matchmaking,string,title_cloud_storage}` plus the three alias tests). The intrusive-pointer test now constructs real `BasicProfile`/`BasicPresence` objects and asserts the `IsSet` flags and getter round-trips. No title run: the accessors are exercised through unit tests only, matching how the surrounding machinery was validated. `python3 tools/check_conventions.py --base origin/main` clean; `python3 tools/pr_overlap.py --branch feat-npcwa-common-fill` reports no overlap with the 100 open PR heads. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions except the already-disclosed overlaps: `Common::Binary::size`/`getBinary` also appear in #12808 (same audited offsets) and `Vector<IntrusivePtr<BasicPresence>>::size` in #11631 (with its own `HostVectorSize` helper) — whichever of those lands second reconciles the duplicate helper - [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: #11221, #12447 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-31 20:11:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T20:11:31Z.

Review: APPROVED


Reviewed — looks good

I found no blocking issue in the reviewed exports at head 12776a9e90adc5c010ec1bc8891ceef7b652c261; the Windows run’s sole failure is guest_filesystem, a separate test executable that links only libkernel and libc.

What I ran

Reviewed the exact PR head against base 121b2e37af75278e3d84a2f43869730030b112ed; the fresh merge preview against current main (59bd3b677d67cb5cfdb4a0092ffe644d27cf1a56) was clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No local build or C++ tests were run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14122
python3 tools/pr_abi_audit.py --base 121b2e37af75278e3d84a2f43869730030b112ed --head 12776a9e90adc5c010ec1bc8891ceef7b652c261 --json
gh run view 41235664354 --repo boykopovar/AnyPS5 --log | grep -E 'guest_np_cpp_web_api|guest_filesystem|100% tests passed|99% tests passed|The following tests FAILED' | tail -n 35

Results

Check Result
Diff, conventions, dependency/merge preview Passed; the PR head merges cleanly
ABI source audit Passed with one warning for DestroyVectorBody; source inspection confirms it is a static implementation helper, not a public export
Hosted Windows Web API tests Changed guest_np_cpp_web_api test targets passed
Hosted Windows full suite 2,529/2,530 passed; guest_filesystem failed with exit 0xc0000409
Hosted Linux and specialized jobs Skipped
Local build and C++ tests Not run
Unedited hosted Windows test output
windows	Build and run changed guest core/libs tests	2026-10-31T19:53:47.6193586Z   86/2530 Test  #504: guest_np_cpp_web_api_intrusive_ptr .............................................   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:53:47.6360351Z   87/2530 Test  #505: guest_np_cpp_web_api_signed_out ................................................   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:53:47.6536348Z   88/2530 Test  #506: guest_np_cpp_web_api_offline ...................................................   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:54:45.2391999Z 1976/2530 Test #2428: guest_np_cpp_web_api_matchmaking ...............................................   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:54:45.2530784Z 1978/2530 Test #2429: guest_np_cpp_web_api_string ....................................................   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:54:45.2679240Z 1979/2530 Test #2430: guest_np_cpp_web_api_title_cloud_storage .......................................   Passed    0.02 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:54:56.3960982Z 2231/2530 Test #2687: guest_filesystem ...............................................................Exit code 0xc0000409***Exception:   0.35 sec
windows	Build and run changed guest core/libs tests	2026-10-31T19:55:55.4217452Z 99% tests passed, 1 tests failed out of 2530
windows	Build and run changed guest core/libs tests	2026-10-31T19:55:55.4595155Z The following tests FAILED:
windows	Build and run changed guest core/libs tests	2026-10-31T19:55:55.4595421Z 	2687 - guest_filesystem (Exit code 0xc0000409)

The author reports guest_filesystem passes locally 3/3; I did not independently reproduce that result.

Sources

Not verified

I did not rerun the author-reported differential/sanitizer fixtures, run Linux tests, or test the guest loader, a title, or console behavior. The source ABI audit is lexical and does not prove binary ABI compatibility.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5724742521 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14122#pullrequestreview-5724742521). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T20:11:31Z. **Review:** APPROVED --- # Reviewed — looks good I found no blocking issue in the reviewed exports at head `12776a9e90adc5c010ec1bc8891ceef7b652c261`; the Windows run’s sole failure is `guest_filesystem`, a separate test executable that links only `libkernel` and `libc`. ## What I ran Reviewed the exact PR head against base `121b2e37af75278e3d84a2f43869730030b112ed`; the fresh merge preview against current `main` (`59bd3b677d67cb5cfdb4a0092ffe644d27cf1a56`) was clean. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No local build or C++ tests were run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14122 python3 tools/pr_abi_audit.py --base 121b2e37af75278e3d84a2f43869730030b112ed --head 12776a9e90adc5c010ec1bc8891ceef7b652c261 --json gh run view 41235664354 --repo boykopovar/AnyPS5 --log | grep -E 'guest_np_cpp_web_api|guest_filesystem|100% tests passed|99% tests passed|The following tests FAILED' | tail -n 35 ``` ## Results | Check | Result | |---|---| | Diff, conventions, dependency/merge preview | Passed; the PR head merges cleanly | | ABI source audit | Passed with one warning for `DestroyVectorBody`; source inspection confirms it is a `static` implementation helper, not a public export | | Hosted Windows Web API tests | Changed `guest_np_cpp_web_api` test targets passed | | Hosted Windows full suite | 2,529/2,530 passed; `guest_filesystem` failed with exit `0xc0000409` | | Hosted Linux and specialized jobs | Skipped | | Local build and C++ tests | Not run | <details><summary>Unedited hosted Windows test output</summary> ```text windows Build and run changed guest core/libs tests 2026-10-31T19:53:47.6193586Z 86/2530 Test #504: guest_np_cpp_web_api_intrusive_ptr ............................................. Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-10-31T19:53:47.6360351Z 87/2530 Test #505: guest_np_cpp_web_api_signed_out ................................................ Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-10-31T19:53:47.6536348Z 88/2530 Test #506: guest_np_cpp_web_api_offline ................................................... Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-10-31T19:54:45.2391999Z 1976/2530 Test #2428: guest_np_cpp_web_api_matchmaking ............................................... Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-10-31T19:54:45.2530784Z 1978/2530 Test #2429: guest_np_cpp_web_api_string .................................................... Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-10-31T19:54:45.2679240Z 1979/2530 Test #2430: guest_np_cpp_web_api_title_cloud_storage ....................................... Passed 0.02 sec windows Build and run changed guest core/libs tests 2026-10-31T19:54:56.3960982Z 2231/2530 Test #2687: guest_filesystem ...............................................................Exit code 0xc0000409***Exception: 0.35 sec windows Build and run changed guest core/libs tests 2026-10-31T19:55:55.4217452Z 99% tests passed, 1 tests failed out of 2530 windows Build and run changed guest core/libs tests 2026-10-31T19:55:55.4595155Z The following tests FAILED: windows Build and run changed guest core/libs tests 2026-10-31T19:55:55.4595421Z 2687 - guest_filesystem (Exit code 0xc0000409) ``` </details> The author reports `guest_filesystem` passes locally 3/3; I did not independently reproduce that result. ## Sources - [Reviewed export implementation](https://github.com/boykopovar/AnyPS5/blob/12776a9e90adc5c010ec1bc8891ceef7b652c261/core/libs/prx/libSceNpCppWebApi/Export.cpp) - [Windows filesystem test links only libkernel and libc](https://github.com/boykopovar/AnyPS5/blob/12776a9e90adc5c010ec1bc8891ceef7b652c261/core/libs/prx/libkernel/CMakeLists.txt#L347-L355) - [Hosted Windows run](https://github.com/boykopovar/AnyPS5/actions/runs/41235664354) ## Not verified I did not rerun the author-reported differential/sanitizer fixtures, run Linux tests, or test the guest loader, a title, or console behavior. The source ABI audit is lexical and does not prove binary ABI compatibility.
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!14122
No description provided.