Skip to content

feat(libSceNpCppWebApi): implement audited response accessors, iterators and String-vector copyFrom - #14136

Merged
oneandonlydean merged 5 commits into
boykopovar:mainfrom
akkadbakkad89:feat-npcwa-common-fill-2
Nov 6, 2026
Merged

oneandonlydean merged 5 commits into
boykopovar:mainfrom
akkadbakkad89:feat-npcwa-common-fill-2

Conversation

@akkadbakkad89

@akkadbakkad89 akkadbakkad89 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What

Ports 26 further libSceNpCppWebApi exports verified against the copy of the module bundled with PPSA13197 (sce_module), resolving each symbol through the SCE export table and disassembling its body before porting:

  • Model accessors: BasicProfile::getOnlineId (0x14-byte copy at +0x10/+0x20), getPersonalDetail (pointer member at +0x28), getIsOfficiallyVerified (byte at +0xa9); BasicPresence::accountIdIsSet (byte at +0x18); PersonalDetail::getDisplayName (member at +0x88).
  • SessionManager2 accessors: PlayerSession::getMember (pointer member at +0x30), PlayerSessionForRead getLeader (0xf8) / getCustomData1/getCustomData2 (strings at 0x1c8/0x1e8) / customData2IsSet (byte at 0x200) / getExclusiveLeaderPrivileges (pointer member at 0x188), ResponsePlayerSessionPlayer getPlatform (member at 0x18) / getAccountId (word at 0x10).
  • Response getters: GetFriendsResponse::getFriends, GetBlockingUsersResponse::getBlocks (member pointers at +0x30), GetBasicPresencesResponse::getBasicPresences (pointer member at +0x30), GetPlayerSessionsResponseBody::getPlayerSessions (0x30), ResponsePlayerSessionMemberPlayer::getPlayers (0x10), FilterProfanityResponse::getMessage (member at +0x38). Pointer-member getters copy the {object, deleter, LibContext} triple and bump the audited reference-count offset (0x00 for IntrusivePtr, 0x30 for Vector, 0x38 for Vector<String>).
  • Common machinery: Vector<IntrusivePtr<BasicProfile>>::begin, Iterator<IntrusivePtr<BasicProfile>>::operator!=, Iterator<IntrusivePtr<Sku>>::operator++, Vector<String>::copyFrom (releases old elements, adopts the source context when unset, deep-copies each String, returns 0x80553504 on allocation failure — matching the bundled body's assign helper), and the TransactionBase operator= for the CommunicationRestrictionStatus response (a plain 16-byte copy).
  • Gated paths: ResponseHeaderBase::getHeaderValue returns 0x80553512 when the header-store pointer at +0x08 is null (matching the bundled module) and throws past that gate — the real lookup needs response internals no offline call produces. DataApi::getMultiDataStatusesByUser returns SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN, the code signed-out consoles return from request entry points.

Tested

ctest -R np_cpp_web_api — 9/9 pass on Windows 11 (MinGW). GuestNpCppWebApiIntrusivePtr now round-trips BasicProfile/BasicPresence objects through the new getters, exercises the IntrusivePtr member-copy offsets (0x10/0x28/0x30/0xf8/0x188) with refcount and deleter bookkeeping, iterates a populated Vector<IntrusivePtr<…>> through begin/end/!=/++, checks the getHeaderValue 0x80553512 gate and the getMultiDataStatusesByUser offline code. GuestNpCppWebApiString adds Vector<String>::copyFrom coverage: deep-copied buffers, zeroed element reference counts, repeated-copy cleanup. tools/check_conventions.py --base origin/main passes.

Checklist

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Progress report (8ad0364 → c1226e8)

📈 System libraries: 27.67% (+0.06%, +23 implemented functions)

✅ 23 implemented
Library Name
libSceNpCppWebApi _ZN3sce2Np9CppWebApi11UserProfile2V118GetFriendsResponse10getFriendsEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi11UserProfile2V124GetBlockingUsersResponse9getBlocksEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi11UserProfile2V125GetBasicPresencesResponse17getBasicPresencesEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi14SessionManager2V120PlayerSessionForRead28getExclusiveLeaderPrivilegesEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi14SessionManager2V129GetPlayerSessionsResponseBody17getPlayerSessionsEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi14SessionManager2V133ResponsePlayerSessionMemberPlayer10getPlayersEv
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi26getMultiDataStatusesByUserEiRKNS4_37ParameterToGetMultiDataStatusesByUserERNS1_6Common11TransactionINS8_12IntrusivePtrINS3_32GetMultiDataStatusesResponseBodyEEENSA_INS8_18ResponseHeaderBaseEEEEE
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common15TransactionBaseINS2_12IntrusivePtrINS1_30CommunicationRestrictionStatus2V338CommunicationRestrictionStatusResponseEEENS4_INS2_18ResponseHeaderBaseEEEEaSERKSB_
libSceNpCppWebApi _ZN3sce2Np9CppWebApi6Common8IteratorINS2_12IntrusivePtrINS1_13InGameCatalog2V53SkuEEEEppEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi11UserProfile2V112BasicProfile11getOnlineIdEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi11UserProfile2V112BasicProfile17getPersonalDetailEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi11UserProfile2V112BasicProfile23getIsOfficiallyVerifiedEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi11UserProfile2V113BasicPresence14accountIdIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi11UserProfile2V114PersonalDetail14getDisplayNameEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V113PlayerSession9getMemberEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V120PlayerSessionForRead14getCustomData1Ev
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V120PlayerSessionForRead14getCustomData2Ev
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V120PlayerSessionForRead16customData2IsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V120PlayerSessionForRead9getLeaderEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V127ResponsePlayerSessionPlayer11getPlatformEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi14SessionManager2V127ResponsePlayerSessionPlayer12getAccountIdEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi15ProfanityFilter2V223FilterProfanityResponse10getMessageEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi6Common8IteratorINS2_12IntrusivePtrINS1_11UserProfile2V112BasicProfileEEEEneERKS9_
⚪ 1 behaviourally empty (constant return or throw)
Library Name
libSceNpCppWebApi _ZN3sce2Np9CppWebApi17TitleCloudStorage2V17DataApi26getMultiDataStatusesByUserEiRKNS4_37ParameterToGetMultiDataStatusesByUserERNS1_6Common11TransactionINS8_12IntrusivePtrINS3_32GetMultiDataStatusesResponseBodyEEENSA_INS8_18ResponseHeaderBaseEEEEE

Changed libraries (implemented exports)

Library Before After Change
libSceNpCppWebApi 1001/1430 (70.00%) 1024/1430 (71.61%) +1.61%

@MarcZX10

Copy link
Copy Markdown
Contributor

Tests run — template check finds unchecked fields

The no-build precheck against current main reports the Fixes: none and GPUs tested: n/a checklist lines as errors; please mark both boxes [x] to complete the required PR template while the hosted conventions job is still pending.

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line docs prx labels Oct 31, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

@akkadbakkad89 reviewed at 5922865c7a (the last commit; the first is #14122's). We compared the 26 functions with another title's bundled libSceNpCppWebApi module, and the offsets, reference-count offsets and return values match. Four points:

  1. The PR text says Vector<String>::copyFrom releases the old elements, matching the bundled body. In the module it allocates a fresh array of max(8, 2n) strings through the context allocator, overwrites its begin pointer and copies each string with its assign helper (strlen + 1 bytes, copied through the context allocator); it does not release the old elements. Releasing them is better behaviour, but it is a deviation, so please say so.
  2. In HostVectorCopyFromStrings the body size is set to 0 before the copy loop. If a malloc fails part way, the function returns 0x80553504 while the strings already copied own buffers that nothing frees. Please keep the size equal to the number of copied elements on that path, or free them before returning.
  3. The test calls Vector<BasicProfile>::begin, end and operator!= with the handle address on a vector filled through the RequestPlayerSessionPlayer instantiation, and steps it with the Iterator<Sku> operator++. Please use matching instantiations, and add a call through the result of IntrusivePtr<Vector>::operator-> (which returns the body), as asked on feat(libSceNpCppWebApi): fill audited Common/vector/model exports from bundled module #14122.
  4. The checklist says "Unblocks: PPSA20397 fix(tools): accept PT_DYNAMIC data after DT_NULL in import_audit #11499", but fix(tools): accept PT_DYNAMIC data after DT_NULL in import_audit #11499 is a merged tools PR about import_audit; please give the right number. The debt entry also still says "measured on the bundled module" without the title ID and build.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — changes requested

The new copyFrom helpers erase their contents on self-copy, and the required PR checklist still fails conventions.

What I ran

Reviewed head 5922865c7a6a4b65e1c9a798b51579e2001ed940 against base 0836dfdf4fecb1e0326100c490476e15d3a74da5; the dependency and current-base merge preview was clean. Environment: Debian Linux, GCC 12.2.0.

git diff --check upstream/main...refs/remotes/review/pr-14136
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14136
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 0836dfdf4fecb1e0326100c490476e15d3a74da5 --head 5922865c7a6a4b65e1c9a798b51579e2001ed940 --json
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestNpCppWebApiIntrusivePtr.cpp core/libs/tests/GuestNpCppWebApiString.cpp
git grep -n 'guest_np_cpp_web_api_\(intrusive_ptr\|string\)_tests' refs/remotes/review/pr-14136 -- core/libs/CMakeLists.txt core/libs/prx/libSceNpCppWebApi/CMakeLists.txt

Results

Check Result
Diff check Passed; exit 0.
Conventions and PR template Failed: unchecked Fixes: none and GPUs tested: n/a boxes.
Dependency and mergeability Passed; clean against current base, with #14122 included as declared.
ABI lexical audit Scanned 1,225 symbols; no export declaration/definition mismatch was reported. One warning is the private DestroyVectorBody helper, which is intentionally static.
Test-quality heuristic and registration The heuristic flagged both new test sources as possibly unregistered; manual CMake inspection confirms both are registered.
Hosted Windows CI Both changed tests passed: guest_np_cpp_web_api_intrusive_ptr and guest_np_cpp_web_api_string; the workflow reports 2,533 passed, 0 failed. Linux and specialized jobs were skipped.
Conventions check output
(pull request): error: [pr-template] Fill in the pull request template: unchecked: Fixes: none
(pull request): error: [pr-template] Fill in the pull request template: unchecked: GPUs tested: n/a
5 findings, 2 errors; GitHub shows at most 10 error annotations, the job summary lists all
ABI audit summary output
status: passed_with_warnings
symbols: 1225
findings: [{"symbol":"DestroyVectorBody","kind":"public-declaration-not-found","message":"No APS5_VABI declaration was found in a header; verify whether this is intentionally private or missing from the public interface."}]
Test-quality output
{
  "findings": [
    {
      "path": "core/libs/tests/GuestNpCppWebApiIntrusivePtr.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    },
    {
      "path": "core/libs/tests/GuestNpCppWebApiString.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}
Hosted Windows test output
windows Build and run changed guest core/libs tests 2026-10-31T20:34:30.4223839Z   86/2533 Test  #504: guest_np_cpp_web_api_intrusive_ptr .............................................   Passed    0.02 sec
windows Build and run changed guest core/libs tests 2026-10-31T20:35:27.2403771Z 1979/2533 Test #2431: guest_np_cpp_web_api_string ....................................................   Passed    0.02 sec
windows Build and run changed guest core/libs tests 2026-10-31T20:36:44.2078733Z 100% tests passed, 0 tests failed out of 2533

Findings

Blocking

  • Both HostVectorCopyFrom and HostVectorCopyFromStrings destroy or release the destination elements and set body->size = 0 before reading sourceBody->size. If source is the same vector, or a second intrusive-pointer wrapper to the same body, the source size becomes zero too; the function returns success after silently emptying the vector. Please handle body == sourceBody before mutating it and add a self-copy regression test for each helper.
  • HostVectorCopyFromStrings returns ParameterAllocationFailed if a string-buffer allocation fails, but it sets body->size only after the whole loop. If a later allocation fails after earlier elements were copied, those buffers are not counted and DestroyVectorBody will not free them. Track the number of successfully initialized elements or clean them up on this error path; add allocation-failure coverage if the test harness can inject it safely.
  • The required PR template remains incomplete: check the Fixes: none and GPUs tested: n/a boxes. The hosted conventions check fails on those two fields.

Non-blocking

  • The local test-quality heuristic's registration warnings are false positives; both new executables and their CTest entries are present in the respective CMake files.

Sources

Not verified

I did not build or run the tests locally. Windows CI passed the exact-head tests; Linux, console behavior, and an allocation-failure control were not verified.

To get this to a good state

Handle same-body copies before clearing elements, make partial string-copy failure cleanup leak-free, add regression coverage, and check the two required template boxes. I’ll rerun the same no-build checks and inspect the new head.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 12808 core/libs/prx/libSceNpCppWebApi/Export.cpp L1630-1633, L1636-1639
docs/dev/debt/libSceNpCppWebApi.md L20-21
PR 12834 core/libs/prx/libSceNpCppWebApi/Export.cpp L3335
core/libs/prx/libSceNpCppWebApi/include/Api.hpp L662
docs/dev/debt/libSceNpCppWebApi.md L23
_ZN3sce2Np9CppWebApi6Common18ResponseHeaderBase14getHeaderValueEPKcRNS2_12IntrusivePtrINS2_6StringEEE
PR 13194 core/libs/prx/libSceNpCppWebApi/Export.cpp L3770-3773
docs/dev/debt/libSceNpCppWebApi.md L25-31
PR 13206 core/libs/prx/libSceNpCppWebApi/Export.cpp L348-392
core/libs/prx/libSceNpCppWebApi/include/Api.hpp L871
docs/dev/debt/libSceNpCppWebApi.md L20-23

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.

Pull request Shared files not compared
PR 13255 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 14212 docs/dev/debt/libSceNpCppWebApi.md

@simnJS

simnJS commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

@akkadbakkad89 Heads-up on an overlap with #12447 (approved, opened Oct 28): a test merge of the two heads conflicts only on adjacent lines.

As CONTRIBUTING.md asks, I suggest #12447 lands first: it is approved and only waits for #11644. If you agree, could you add Depends on: #12447 to the checklist? Whichever lands second merges main, keeps both lines and drops nothing. If you'd rather go first, say so and I'll record the opposite order on #12447.

@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Addressed at 2d02a513c8:

  1. copyFrom deviation — you're right, the module allocates a fresh max(8, 2n) array through the context allocator and copies each string via its assign helper (0x11d60-family) without releasing the old elements. The debt entry now records this explicitly: the host releases the old elements first — the deviation is deliberate (it avoids the buffer orphan the module accepts) and is now stated as such.
  2. alloc-failure leak — fixed. On a malloc failure inside the copy loop the body size is now set to the number of elements already copied, so the vector destructor frees their buffers; 0x80553504 is still returned.
  3. Test instantiations — the step is now Iterator<IntrusivePtr<BasicProfile>>::operator++ (matching the begin/end/ne instantiation), and the test adds a call through IntrusivePtr<Vector<IntrusivePtr<Sku>>>::operator->, taking the returned object into Vector<...>::size. The fill still goes through Vector<RequestPlayerSessionPlayer> because that is the only instantiation that exports C1/pushBack — noted here since the layout is the identical kind-1 triple across families.
  4. Unblocks / debt source — Unblocks is now none (no tracking issue exists; same convention as feat(libSceNpCppWebApi): fill audited Common/vector/model exports from bundled module #14122). The debt entry now names the evidence: the sce_module copy of libSceNpCppWebApi.prx bundled with PPSA21564, build J03093737.

@simnJS Agreed — #12447 is approved and lands first; Depends on: #14122, #12447 is set, and whichever lands second keeps both adjacent lines. The template precheck items (Fixes, GPUs tested) are ticked too.

@github-actions github-actions Bot removed the unblocks title Names a title ID on the Unblocks line label Oct 31, 2026
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Fixed at 0d4888bb76 — verified: a copyFrom whose destination body is the source body released all elements/strings first, then copied from freed contents. Both helpers now return 0 early when body == sourceBody (covers copyFrom(&v, &v) and two handles sharing one body), before the release loop. Vector<String>::copyFrom regression added: after copyFrom(&v, &v) the size stays 3 and every copied buffer still reads back. The Fixes: none and GPUs tested: n/a boxes were already [x] on the pushed head — the precheck likely ran before that body update. All 9 np_cpp_web_api tests pass.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — new head, changes requested

The new head fixes the self-copy mutation and string-allocation cleanup, but the generic intrusive-pointer copyFrom path still lacks the requested self-copy regression test.

What I ran

Reviewed head 0d4888bb7684075667dfbfdfad3f1acf33667b4f against PR base 0836dfdf4fecb1e0326100c490476e15d3a74da5; the exact head has a clean merge preview against current main 1bc97b9527eaf6b56681cd3465bca67b75329161. Environment: Debian Linux, GCC 12.2.0. The hosted Windows workflow built this exact head.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14136
gh pr checks 14136 -R boykopovar/AnyPS5
gh run view 41246118340 -R boykopovar/AnyPS5 --job 124671176270 --log
gh api repos/boykopovar/AnyPS5/compare/5922865c7a6a4b65e1c9a798b51579e2001ed940...0d4888bb7684 --jq '.files[] | [.filename, .patch] | @tsv'

Results

Check Result
Diff and conventions/template Passed; precheck reports git diff --check passed and conventions/template exited successfully (three debt-length warnings only).
Windows build and CTest Passed on the exact head: both changed test targets built; full workflow CTest passed, 2,539 tests, 0 failures.
Current-base merge preview Passed for the exact PR head against current main. The stack helper also reports a dependency-cycle error because it parses stale prose in #11644; that PR's actual checklist says Depends on: none, while #12447 depends on #11644 and this PR depends on #14122/#12447.
ABI and test-quality helpers Could not run from the isolated PR snapshot; the workspace-only helper scripts are absent there.
Generic-vector self-copy test Not present: the new self-copy assertion exercises only Vector<String>; the intrusive-pointer test file contains no copyFrom call.
Raw check output
windows Build and run changed guest core/libs tests 2026-10-31T22:11:00.5006149Z guest_np_cpp_web_api_intrusive_ptr_tests
windows Build and run changed guest core/libs tests 2026-10-31T22:11:00.5006449Z guest_np_cpp_web_api_string_tests
windows Build and run changed guest core/libs tests 2026-10-31T22:13:17.7222346Z   87/2539 Test  #505: guest_np_cpp_web_api_intrusive_ptr .......................................   Passed    0.01 sec
windows Build and run changed guest core/libs tests 2026-10-31T22:14:07.8448072Z 1981/2539 Test #2434: guest_np_cpp_web_api_string ..............................................   Passed    0.01 sec
windows Build and run changed guest core/libs tests 2026-10-31T22:15:27.6046905Z 100% tests passed, 0 tests failed out of 2539
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14136-0d4888bb7684/head-0d4888bb7684-de7b899b/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-14136-0d4888bb7684/head-0d4888bb7684-de7b899b/tools/pr_test_quality.py': [Errno 2] No such file or directory

Negative control

Assertion Change to code under test Did the new test fail?
Self-copy preserves a populated Vector<IntrusivePtr<T>> body None; no test currently invokes the generic helper's self-copy path. Could not exercise. The current regression covers only Vector<String>.

Findings

Blocking

  • HostVectorCopyFrom now returns early when the source and destination share a body, but no test invokes this generic helper's copyFrom export. The prior bug released every element before reading the source count, so this path needs regression coverage as well as the string-specialized path. Please add a populated intrusive-pointer vector self-copy case, preferably also covering two handles sharing one body, and assert the size, element pointers, and reference counts remain intact.

Non-blocking

  • The stack precheck's cycle report is a parser false positive from stale prose in #11644; its actual dependency checklist is none. Individual exact-head merge previews are clean.

Sources

Not verified

No local build or CTest was run. Linux CI and console behavior were not tested. Allocation-failure injection was not run. The no-build precheck's ABI and test-quality helpers were unavailable in its isolated checkout.

To get this to a good state

Add the generic intrusive-pointer self-copy regression and verify it preserves contents and reference counts. I will rerun the same no-build checks and inspect the new head.

@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Added at 5b95f25e3d — TestVectorCopyFromSelfPreservesElements in GuestNpCppWebApiIntrusivePtr.cpp exercises the generic HostVectorCopyFrom path via Vector<IntrusivePtr<ResponsePlayerSessionPlayer>>::copyFrom:

  • A fabricated populated source body (two IntrusivePtr elements, elementKind == 1) is copied into a constructed vector; size 2, refcounts 1→2, element records verified (object/deleter/context, distinct backing array).
  • Same-handle self-copy copyFrom(&vector, &vector) returns 0: size stays 2, the elements array pointer is unchanged (no realloc/release), both element object pointers intact, refcounts still 2, zero deleter calls.
  • Two handles sharing one body: copyFrom(&alias, &vector) and copyFrom(&vector, &alias) both return 0 with the same size/pointer/refcount invariants.
  • Destructor then releases exactly once: refcounts back to 1, no delete calls; the fabricated source is freed by the test.

The early-out runs before the release loop, so the old defect (release-then-read-source) would have failed every invariant here. All 9 np_cpp_web_api tests pass; conventions 0 errors (three pre-existing debt-length warnings).

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — new head, no blocking findings

The only change since my CHANGES_REQUESTED review at 0d4888bb is a new populated intrusive-pointer self-copy test for the generic copyFrom path, which covers the case I asked for, and I found no blocking defect in it; no local build or CTest was run.

What I ran

  • Reviewed head: 5b95f25e3d6da79df5c37738a57c399551d2e1f8, the PR head at the start and end of this review. Base: PR base 0836dfdf4fecb1e0326100c490476e15d3a74da5. Current main used for the merge preview: eb5b2c13df0dd0ffed8f89643507f7a769c79a24; the exact head merges cleanly.
  • Delta since my last review: 0d4888bb7684075667dfbfdfad3f1acf33667b4f...5b95f25e3d6da79df5c37738a57c399551d2e1f8 changes only core/libs/tests/GuestNpCppWebApiIntrusivePtr.cpp (+65/-0).
  • Environment: Debian 12, Linux 6.1.0-54-amd64, Python 3.11.2, git 2.39.5, GCC 12.2.0 (not used for a build).
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14136 --output-dir /dev/shm/reviewer-14136
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 0836dfdf4fecb1e0326100c490476e15d3a74da5 --head 5b95f25e3d6da79df5c37738a57c399551d2e1f8 --json
git archive 5b95f25e3d6da79df5c37738a57c399551d2e1f8 core/libs/CMakeLists.txt core/libs/prx/libSceNpCppWebApi core/libs/tests docs/dev/debt | tar -x -C <scratch-dir>
python3 tools/pr_test_quality.py --root <scratch-dir> --json core/libs/tests/GuestNpCppWebApiIntrusivePtr.cpp core/libs/tests/GuestNpCppWebApiString.cpp
gh api repos/boykopovar/AnyPS5/actions/jobs/124757859215/logs

The precheck's ABI and test-quality steps could not run in its isolated checkout because the helper scripts are absent there, so I ran both helpers by hand from /marc/AnyPS5/tools.

Results

Check Result
git diff --check (precheck) Passed.
Conventions and PR template (precheck) Passed with three debt-length warnings and no errors.
Current-base mergeability (precheck stack check) Each PR head previews clean against current main. The stack helper's "dependency cycle" error comes from a misparse of #11644's prose; its checklist says Depends on: none.
ABI lexical audit (manual) passed_with_warnings: 1225 symbols. One lexical note for the static helper DestroyVectorBody, which is intentionally private.
Test-quality heuristic (manual) Both test sources are flagged as possibly unregistered. Both are registered: the intrusive-pointer target at core/libs/CMakeLists.txt:1020, and the String test has its own add_test_executable in core/libs/prx/libSceNpCppWebApi/CMakeLists.txt:24. Both flags are false positives.
Hosted Windows, this head (CI, not local) success. The log shows both changed test binaries passing and 100% tests passed, 0 tests failed out of 2568.
Linux, relinker, ASan, register-context, write-watch Skipped by CI for this head.
Local build and CTest Not run (no-build rule).
Precheck conventions output (unedited)
docs/dev/debt/libSceNpCppWebApi.md:23: warning: [debt-length] Technical debt entry over 1000 characters: state the gap first (what differs from the console, what is unverified, what throws) and keep only the behaviour it needs: 1183 characters
docs/dev/debt/libSceNpCppWebApi.md:24: warning: [debt-length] Technical debt entry over 1000 characters: state the gap first (what differs from the console, what is unverified, what throws) and keep only the behaviour it needs: 1798 characters
docs/dev/debt/libSceNpCppWebApi.md:25: warning: [debt-length] Technical debt entry over 1000 characters: state the gap first (what differs from the console, what is unverified, what throws) and keep only the behaviour it needs: 1106 characters
3 findings, 0 errors; GitHub shows at most 10 error annotations, the job summary lists all
ABI audit output (JSON summary fields; the symbol list of 1225 entries is omitted)
{
  "status": "passed_with_warnings",
  "findings": [
    {
      "symbol": "DestroyVectorBody",
      "kind": "public-declaration-not-found",
      "message": "No APS5_VABI declaration was found in a header; verify whether this is intentionally private or missing from the public interface."
    }
  ],
  "limitations": [
    "This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.",
    "An absent source declaration or explicit alias can be intentional for assembly exports, conditional platform code, or generated interfaces; inspect findings before treating them as defects."
  ],
  "symbols": "<1225 entries; list omitted>"
}
Test-quality output (unedited JSON)
{
  "findings": [
    {
      "path": "core/libs/tests/GuestNpCppWebApiIntrusivePtr.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    },
    {
      "path": "core/libs/tests/GuestNpCppWebApiString.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": []
}
Hosted Windows log lines for this head (unedited)
2026-11-01T05:21:14.6905620Z   89/2568 Test  #510: guest_np_cpp_web_api_intrusive_ptr ..........................................   Passed    0.01 sec
2026-11-01T05:22:00.2085575Z 2002/2568 Test #2461: guest_np_cpp_web_api_string .................................................   Passed    0.01 sec
2026-11-01T05:23:04.1574229Z 100% tests passed, 0 tests failed out of 2568

Negative control

Assertion Change to code under test Did the new test fail?
A populated Vector<IntrusivePtr<ResponsePlayerSessionPlayer>> keeps size 2, the same element array, and element refcounts of 2 after a self-copy and after an aliased-handle copy. Not run (no build). By source reading: removing the early return at Export.cpp line 1691 would release both elements (2 to 1), set size to 0, and read the source count as 0, so Require(size == 2) would abort. Not exercised.

Findings

Blocking

None.

Non-blocking

  • Three debt entries in docs/dev/debt/libSceNpCppWebApi.md (lines 23 to 25, 1183, 1798 and 1106 characters) trigger the debt-length warning. The base file had one entry over 1000 characters (line 9, 1167). Conventions reports warnings only, so this does not block. Trimming them to the gap and the behaviour it needs would clear the warnings.

Sources

Not verified

  • No local build or CTest was run. The new test's pass is taken from the hosted Windows log for this head, not from a local run.
  • The negative control was not run; the failure prediction above comes from reading the code.
  • Linux and the other skipped CI jobs did not run for this head.
  • Console behaviour of these exports is not verified.
  • Allocation-failure paths in HostVectorCopyFrom were not exercised.

@AlexFigas

Copy link
Copy Markdown
Contributor

@akkadbakkad89 Landing order with my #10925 and #11221, which Marc is holding on. #11221 (opened before this PR) implements the Vector<String> iteration this PR also adds: the CommonIterator struct and the begin, end, Iterator<String>::operator++, * and != exports, and it is stacked on #10925, which sets the Vector<String> count offset (0x38) that this PR's StringVectorReferenceCountOffset also defines. A merge of this head (5b95f25e3d) with #11221's (3760ab79c2) conflicts in Export.cpp, both test files and the debt file; both merge cleanly with main.

Could this PR declare Depends on: #10925, #11221 (it already depends on #14122) and rebase after them? If you would rather go first, say so and I will declare the dependency the other way and merge your head into mine.

@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

@AlexFigas Agreed — #11221 opened before this PR and already implements the Vector<String> iteration (CommonIterator, begin, end, Iterator<String>::operator++, *, !=), stacked on #10925 which owns the 0x38 count offset. Depends on: now reads #14122, #12447, #10925, #11221; this PR rebases after them and merges the conflicting Export.cpp, test and debt lines keeping both sides.

@simnJS Confirming #12447 stays in the dependency list — it is already declared in the checklist; whichever of us lands second keeps both Api.hpp lines and both debt edits as you described.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
@MarcZX10

MarcZX10 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Re-checked — dependency order recorded

Your updated dependency list matches the overlap discussion; the current head already has my review with no blocking findings, and this note does not change that result.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — same head, approved

The review request remains active; the previously reviewed head has now completed its hosted checks successfully, and the full review found no blocking issues.

What I ran

Confirmed open PR #14136 is still at head 5b95f25e3d6da79df5c37738a57c399551d2e1f8, based on 0836dfdf4fecb1e0326100c490476e15d3a74da5. The full source and test review is in my same-head review. This follow-up checked current hosted status; no local build or test was run.

gh pr checks 14136 --repo boykopovar/AnyPS5

Results

Check Result Note
Hosted Windows tests passed Exact head; workflow succeeded.
Conventions, labels, portability, report passed Exact head.
Linux and specialized jobs not applicable Skipped by workflow.
Hosted check output (unedited)
conventions	pass	18s	https://github.com/boykopovar/AnyPS5/actions/runs/41392244127/job/125105956967
labels	pass	10s	https://github.com/boykopovar/AnyPS5/actions/runs/41392244091/job/125105956921
windows	pass	7m36s	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757859215
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757860157
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757860073
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757860104
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757860062
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757860579
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41275667075/job/124757229949
library-portability	pass	1m41s	https://github.com/boykopovar/AnyPS5/actions/runs/41275667144/job/124757230130
report	pass	38s	https://github.com/boykopovar/AnyPS5/actions/runs/41275667072/job/124757229712

Findings

No blocking findings in the full review of this exact head.

Not verified

I did not run a local build or CTest. Linux, relinker, ASan, register-context, and write-watch jobs were skipped by CI; console behavior was not verified.

@akkadbakkad89
akkadbakkad89 force-pushed the feat-npcwa-common-fill-2 branch from 5b95f25 to 8d38c3c Compare November 2, 2026 12:53
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 2, 2026
@akkadbakkad89
akkadbakkad89 force-pushed the feat-npcwa-common-fill-2 branch from 8d38c3c to c2fe607 Compare November 2, 2026 16:17
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 3, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked — same head, approved

The previously reviewed head 606cb246ebeb568152002c526edbbffb441db563 now has all applicable hosted checks complete and successful, and the earlier source review found no blocking issue.

What I ran

Re-checked head 606cb246ebeb568152002c526edbbffb441db563 against base d1ae628bc2f62459cce1e9872ba5632c938c71f2; no new source diff since my review on this head. Environment: Debian Linux x86_64, Python 3.11.2, Git 2.39.5. No local build or CTest was run.

gh api repos/boykopovar/AnyPS5/pulls/14136
gh api repos/boykopovar/AnyPS5/commits/606cb246ebeb568152002c526edbbffb441db563/check-runs --jq '[.check_runs[] | {name,status,conclusion}]'

Results

Check Result Note
Previous exact-head source review Passed No blocking finding.
Hosted applicable checks Passed Windows, conventions, eligibility, labels, report and library portability.
Hosted specialized jobs Not applicable Linux and relinker-related jobs were skipped.
Local build and CTest Not run No local compilation was performed.
Hosted check API output
[{"conclusion":"success","name":"labels","status":"completed"},{"conclusion":"skipped","name":"relinker","status":"completed"},{"conclusion":"skipped","name":"linux","status":"completed"},{"conclusion":"skipped","name":"register-context","status":"completed"},{"conclusion":"skipped","name":"relinker-asan","status":"completed"},{"conclusion":"skipped","name":"write-watch","status":"completed"},{"conclusion":"skipped","name":"edge-watch","status":"completed"},{"conclusion":"success","name":"windows","status":"completed"},{"conclusion":"success","name":"eligibility","status":"completed"},{"conclusion":"success","name":"report","status":"completed"},{"conclusion":"success","name":"library-portability","status":"completed"},{"conclusion":"success","name":"conventions","status":"completed"}]

Negative control

Not applicable to this checks-only re-check; the PR's test code was reviewed previously, and no local build was run.

Findings

Blocking

None found in the previously reviewed source change.

Non-blocking

The PR lists #14122 and #12447 as dependencies, and both remain open. This approval covers the reviewed head; final integration remains subject to that dependency order.

Sources

Not verified

No local C++ build or CTest, Linux run, or console behavior was verified. Linux and specialized hosted jobs were skipped.

To get this to a good state

No change is required for this reviewed head. If the head changes, I will review the new diff and rerun the applicable checks.

@akkadbakkad89
akkadbakkad89 force-pushed the feat-npcwa-common-fill-2 branch from 606cb24 to cc3663e Compare November 3, 2026 09:20
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Restacked at cc3663eb49 on the new #14122 tip. Only ancestry moved — the diff is unchanged at +862/−455; mergeable=clean.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 4, 2026
@akkadbakkad89
akkadbakkad89 force-pushed the feat-npcwa-common-fill-2 branch from cc3663e to 41fc140 Compare November 4, 2026 09:07
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Restacked onto b11c7bf84f5d (on the updated #14122 head). One debt-file conflict resolved to match this commit's intent: the split Common::Vector/Vector audited members entries stay, upstream's Common::Binary entry (#12808) stays between them.

Verified locally: all 12 guest_np_cpp_web_api_* tests pass.

@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Restacked — head 8eafd12f0372.

Restacked on current main (e772fb25cc) over rebuilt #14122 and the #12447 base (596c792ce6). The previous head carried an embedded main-merge; the chain is now linear — same content, one merge base. Upstream's friends sessions family (a85386c6ac + fixes) touches disjoint exports; the only conflict was the SessionManager2V1 debt entry, resolved to this layer's rewrite describing the implemented accessors alongside the friends entries. libSceNpCppWebApi.prx rebuilds clean; all 13 guest_np_cpp_web_api_* tests pass including friends; conventions pass.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 5, 2026
@akkadbakkad89
akkadbakkad89 force-pushed the feat-npcwa-common-fill-2 branch from 8eafd12 to 92a37c0 Compare November 5, 2026 18:39
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Nov 5, 2026
…ors and String-vector copyFrom

Port 26 further exports verified against the bundled PPSA13197
module: BasicProfile/BasicPresence/PersonalDetail getters and IsSet
bytes, PlayerSessionForRead/PlayerSession/ResponsePlayerSessionPlayer
member accessors, Get*Response vector getters, Vector<String>::copyFrom
with deep string copies, BasicProfile/Sku iterator compare/advance,
the CRS TransactionBase operator=, the getHeaderValue missing-store
error path and the signed-out getMultiDataStatusesByUser entry point.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@akkadbakkad89
akkadbakkad89 force-pushed the feat-npcwa-common-fill-2 branch from 92a37c0 to c1226e8 Compare November 5, 2026 23:42
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@oneandonlydean
oneandonlydean merged commit 5714182 into boykopovar:main Nov 6, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants