feat(libSceNpCppWebApi): iterate Vector<String> with begin, end and the Iterator<String> operators #11221
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11221"
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 AlexFigas on 2026-10-25T22:06:36Z.
What
Vector<String>::begin,Vector<String>::endand theIterator<String>operators++,*and!=wereNotImplementedstubs with no parameters. They now walk aVector<String>built withpushBack, using the layout of the module that PPSA21564 bundles (sce_module/libSceNpCppWebApi.prx, the library's own code):Vector<String>::begin(0xaf60) /end(0xafe0)rdi(vector inrsi).RefObject::RefObjectwrites the 32-bit count at +0 (mov dword ptr [rdi], 0), the element pointer goes at +8, andraxreturns the iteratorpushBack. For a body with no elements,endreturns the element pointer unchanged, without adding to itIterator<String>::operator++(0xbb70)add qword ptr [rdi + 8], 0x20, returnsthisStringand returns the iteratorIterator<String>::operator*(0xbb50)[rdi + 8]Iterator<String>::operator!=(0xbbc0)The 0x10-byte iterator gets a
CommonIteratorstruct inApi.hpp. AsVector::empty,sizeandoperator[]already do,beginandendthrow on a body this library did not create (another magic, orIntrusivePtrelements), because its element layout is unknown.ConstIterator<String>::~ConstIteratoralready matched the module, which jumps to the no-opRefObject::~RefObject.The
Vectordebt entry now says these work, and the other element types' iterators andcopyFromstill throw. I left line 20's general "iterators ... throw" alone.This PR and my #10925 both edited debt line 16, so this branch was stacked on #10925. #10925 has merged and only this PR's commit is left; its debt line applies this PR's
begin/endsentence to #10925's version of the entry, trimmed to stay under 1000 characters.Tested
On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), head
4dce45f518merged intomaina4eca2a056(f6ed031241),ctest -R np_cpp_web_apipasses all 10 tests,main's alias, matchmaking, title cloud storage and activities tests included, 3 runs each.guest_np_cpp_web_api_stringgains two cases:beginandend. After threepushBacks, the iteration visits "first", "second" and "third" in order.*returns the pointer at +8,++returns the iterator itself, the count at +0 is 0,end - beginis 3 × 0x20, and nothing is written past the 0x10 bytes of either iterator.beginandendthrow on a host body holdingIntrusivePtrelements. A title-providedVector<String>body still throws as an unmodelled case, but the test does not require it.Also run:
python3 core/libs/tests/test_public_headers.py --audit-onlyverifies 405 libraries and 27873 exports.python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.py --branch feat/npcppwebapi-string-vector-iterationreports #12808 and #13255 indocs/dev/debt/libSceNpCppWebApi.md. #13255 also adds declarations next to this PR's inApi.hppand declaresDepends on: #11221. #12801, #11631, #14122 and #14136 merge with this head without conflicts. #12447 already conflicts withmainin the debt file and does not depend on this PR.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-25T22:24:30Z.
Review: CHANGES_REQUESTED
I found one correctness issue in the empty-vector
end()path: it performs pointer arithmetic on a null element pointer when the vector is valid but has no elements. I requested a small guard for that case. I reviewed the current diff and its added iteration coverage; hosted eligibility, conventions, intake, labels, and report checks pass. Product build/test jobs were skipped by path policy, and I did not run the reported WSL focused test locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T11:01:08Z.
Review: CHANGES_REQUESTED
The code and tests are tied to the bundled module's Vector layout, and the PR clearly limits unsupported host bodies by throwing. I am not approving this submitted stack yet: its merge-base is
74acfad65b, while current main is3fea2a937b. Main has since changed every path this PR edits: Export.cpp, Api.hpp, and docs/dev/debt/libSceNpCppWebApi.md. The branch also carries open dependency #10925.Please coordinate the rebase with #10925, update this stack onto current main, and rerun the focused np_cpp_web_api tests on the integrated head. The existing report is detailed, but it describes a branch based on main
74acfad65b, so it does not validate the current implementation and fixtures. I found no separate iterator defect in the submitted diff; current-tree integration is the remaining blocker.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T15:26:08Z.
Review: APPROVED
Reviewed exact head 3c357912c32bd22c7b17e320513d3c9565d9abb2. The empty-vector end path now returns the element pointer unchanged without adding to a null pointer, resolving the earlier correctness issue. The implementation limits iteration to host-created String vectors and rejects unsupported body layouts as documented.
Independent local check: applied the #10925/#11221 changes to the clean #11213-based Release checkout, built guest_np_cpp_web_api_string_tests, and ran it three times under qemu-x86_64 -cpu max; all passed. The tests cover empty and populated iteration, element order, iterator layout/guards, and rejection of another element type. I did not rerun the full four-test WebApi suite.
The current-main merge preview is clean, and the files changed by this stack have not changed since the
1089f2bbase. I approve the reviewed code and focused test evidence. #11221 depends on open #10925, which explicitly depends on #11631; preserve that landing order before merging.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T11:07:48Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The new report covers the exact
ad47eb210dhead and all seven WebApi tests, including the three alias tests, three times each. It also confirms the dependency on #10925. This branch still containsmainonly through1db077e876, while currentmainisba5b5330b3. Although current main has not changed this PR's source/test paths, the repository requires an up-to-date main base. Please merge current main and rerun the seven focused tests on the resulting head, preserving the #10925-before-#11221 order.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T11:41:45Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The reviewed iterator implementation and its author-reported seven-test run are unchanged, but this stack is behind current
mainand does not include the current head of declared dependency #11631.What I ran
Reviewed head
ded2bb61145ca7fb91d57d7afae92590b674a65bagainst PR base98ddd9c1792bbab016ceed5db267a93d1d61f00aon Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. The stack checker previewed #11221 cleanly against currentmain1c6b316cf762c7a8d34623907d62bc1cba2217b6; I did not build locally.Results
np_cpp_web_apitestsObserved stack and CI output
Negative control
Not applicable to this recheck: no new behavior assertion was added since the last focused test report.
Findings
Blocking
The current head contains
mainonly through98ddd9c1792bbab016ceed5db267a93d1d61f00a, while currentmainis1c6b316cf762c7a8d34623907d62bc1cba2217b6.CONTRIBUTING.mdrequires keeping branches up to date. Also, #11221 depends on #10925, which depends on #11631, but #10925 does not contain #11631's current head and #11631 currently conflicts withmain. The minimal next step is to resolve/update #11631, refresh #10925 on its current dependency andmain, then re-stack #11221 and rerun the seven focused tests on the resulting head.Non-blocking
The intervening
maincommits do not change the files touched by #11221, and the current-main merge preview is clean. The existing author-reported tests remain useful evidence for the unchanged iterator code, but they do not verify the refreshed dependency stack.Sources
Not verified
No local build or CTest run; the seven tests are author-reported. No PS5 console behavior. The current #11631 dependency branch's conflict resolution and the resulting refreshed stack have not been tested.
To get this to a good state
After the dependency and base are current, rerun
ctest --test-dir build -R np_cpp_web_apithree times on the final head and post the new SHA and output. I will re-run the no-build checks and review that exact head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T14:56:52Z.
Review: CHANGES_REQUESTED
Re-checked — new head, changes requested
The updated head resolves the dependency on #11631 and includes #10925's current head, but it still does not include current
mainas required by the repository's branch-up-to-date rule.What I ran
Reviewed head
211414f23538c201f70849a3f2ae91792710cad5against PR baseda026c70655a132031d45e2008c24f993870d801on Debian 12 x86_64, Python 3.11.2, GCC 12.2.0. Currentmainised1e0ed08fc2452192df91793a33dd0cc7ad5212; the merge preview is clean.Results
36b9cde63c55a652dce40e964510e917577154aa.3fdaafe5c346ba6640cb2afd0045e8139ac50c9eis included; stack order is #10925 → #11221.np_cpp_web_apitests passed three runs on this head and with #12801 merged; I did not run them locally.Selected unedited output
Negative control
Not exercised: this recheck adds no new behavior assertion, and I did not build an exact-head binary for a base-source control.
Findings
Blocking
The PR head contains
mainonly throughda026c70655a132031d45e2008c24f993870d801, while currentmainised1e0ed08fc2452192df91793a33dd0cc7ad5212.CONTRIBUTING.mdrequires keeping the branch up to date withmain. Although the merge preview is clean and intervening changes do not touch this PR's paths, the branch is still behind currentmain. Please merge currentmaininto this stacked branch and rerun the seven focused tests on the resulting head.Non-blocking
The stack checker reports a self-cycle for #10925 even though its own report confirms the intended #10925 → #11221 order and that #10925's head is included. The missing local-only precheck helpers also make those two automated checks unavailable in the isolated checkout.
Sources
Not verified
No local build or CTest run; the seven focused-test runs are author-reported. No PS5 console behavior or negative-control run was performed.
To get this to a good state
Merge current
maininto the branch while preserving the #10925 → #11221 stack, then rerunctest --test-dir build -R np_cpp_web_apion the resulting exact head. I will repeat the no-build checks and inspect that head before reviewing again.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T01:11:35Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The iterator changes and reported focused tests look consistent, but this stacked head also conflicts with #14122 and #14136 and their landing order is not agreed or declared.
What I ran
Reviewed head
1c163f759c3854e6c8b5c433d8bbbfcc566efd1bagainst basecc26ab44380db3cd7b53715b84f13945227ce28bon Debian 12 x86_64, Python 3.11.2 and GCC 12.2.0. Its preview onto currentmain(7c4dcf0ad84de7a473ce97bb21644c614f1c3bd3) is clean and it contains #10925 atb7ec1d9006b704cc84f98391ea566ee92844f68f.Results
6e040bd764964d69813e0519c61f7ee3bd8eaec8.Export.cpp,GuestNpCppWebApiIntrusivePtr.cpp, and the debt file; against #14136 the same paths plusGuestNpCppWebApiString.cppconflict.np_cpp_web_apitests pass three runs on this head and with #12801 merged; I did not run them locally.Selected unedited merge-preview output
Findings
Blocking
The live pairwise previews conflict with #14122 and #14136 in files changed by this PR and its #10925 dependency. The PR discussion leaves their landing order for the authors to agree, while the repository requires the order to be agreed and declared in
Depends on. See the current contribution rule. Please coordinate the order with the owners of #14122 and #14136 and update the affected checklists before this stack is ready.Non-blocking
The head is behind current
main, but its current-main preview is clean andmainhas not changed these PR paths since the base; I am not requesting a rebase for age alone. Windows CI was still pending at this snapshot.Sources
Not verified
No local build or CTest run. Windows checks are pending; no Linux product run or console run. The reported tests are author-provided.
To get this to a good state
Agree with the owners of #14122 and #14136 which branches land first, record the order in the affected
Depends onlines, then rerun the pairwise previews and currentmainpreview. I will repeat the same checks on the updated heads.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T10:58:14Z.
Review: APPROVED
Re-checked — new head, looks good
At head
3760ab79c2972a53deab18e994644fe5488c3d7a, the String iterator and vector reference-count changes match the recorded layout, and the current Windows test job passed.What I ran
Reviewed all five changed files against base
cc26ab44380db3cd7b53715b84f13945227ce28b. The no-build precheck reports a clean diff, passed conventions and a clean merge preview. Environment: Debian Linux 6.1, Python 3.11.2, GCC 12.2.0; I did not build or run CTest locally. Hosted Windows CI passed on this head; Linux and specialized jobs were skipped. The author also reports the nine relevant CTests passed three times on this head.Results
Precheck summary and audit output
The precheck's
changed_export_abi_auditandtest_quality_heuristicshelper launches fail because those workspace-only scripts are absent from the isolated PR snapshot. I ran the ABI audit from the workspace; its JSON status ispassed_with_warnings, with one lexical warning for private helperDestroyVectorBody. This is not an exported function. The precheck stack report says the merge preview is clean.Negative control
Not run locally. The change's C++ tests require the built target; no negative-control result is claimed.
Findings
Blocking
None found in the reviewed diff.
Non-blocking
Sources
Not verified
Linux, specialized CI jobs, console behavior, and a local build/CTest run were not verified. The author states console behavior is not independently measured.
To get this to a good state
No code changes are needed from this review. Keep the declared dependency on #10925 and coordinate the stated landing order with the overlapping PRs.