Skip to content

feat(libSceNpWebApi2): implement sceNpWebApi2GetMemoryPoolStats - #3296

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
SynnZer0:feat/npwebapi2-memory-pool-stats
Oct 11, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
SynnZer0:feat/npwebapi2-memory-pool-stats

Conversation

@SynnZer0

Copy link
Copy Markdown
Contributor

What

Implements sceNpWebApi2GetMemoryPoolStats (Xweb+naPZ8Y). PPSA21703 (Vampire Survivors, Unity) imports it from its PSN plugin, and on Windows it did not start (FAIL: unresolved ELF import Xweb+naPZ8Y from libSceNpWebApi2.prx). tools/import_audit.py reported it as the title's only absent import. The name was identified by hashing candidate names with the NID formula.

  • sceNpWebApi2Initialize records the pool size of the returned context; sceNpWebApi2Terminate forgets it.
  • sceNpWebApi2GetMemoryPoolStats(int libCtxId, stats*) fills {pool_size, max_inuse_size, current_inuse_size, reserved} with the recorded size and 0 use, as sceHttp2GetMemoryPoolStats does, since nothing is allocated from the pool. A null output or an unknown context throws, because the error codes are unknown.
  • docs/dev/TechnicalDebt.md: the signature and layout are assumed from the Http2 statistics, not confirmed.
  • libSceNpWebApi2/CMakeLists.txt (new) builds the library exactly as the generic rule did, to register guest_np_web_api2.
  • tests/GuestNpWebApi2.cpp (new): two contexts report their own pool sizes, a null output throws, and a terminated context throws.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs 15.2.0posix-14.0.0-ucrt-r7), full build with BUILD_TESTING=ON:

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 in TechnicalDebt
  • 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
  • AI-assisted: yes

🤖 Generated with Claude Code

@github-actions github-actions Bot added the intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main label Oct 11, 2026
@github-actions

Copy link
Copy Markdown

Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

@github-actions github-actions Bot closed this Oct 11, 2026
@oneandonlydean oneandonlydean removed the intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main label Oct 11, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 11, 2026
@github-actions

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
#3337 sceNpWebApi2GetMemoryPoolStats

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Progress report (71dda5b → c5bcc08)

📈 System libraries: 85.55% (+0.01%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNpWebApi2 sceNpWebApi2GetMemoryPoolStats

PPSA21703's Unity PSN plugin imports sceNpWebApi2GetMemoryPoolStats
(Xweb+naPZ8Y), so the title did not start.

sceNpWebApi2Initialize now records the pool size of each context and
sceNpWebApi2Terminate forgets it. The statistics report that size with
no peak or current use, as sceHttp2GetMemoryPoolStats does, since nothing
is allocated from the pool. A null output or an unknown context throws.
The signature and layout follow the Http2 statistics and are recorded in
TechnicalDebt.

The library gets its own CMakeLists.txt, equivalent to the generic rule,
to register its test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main (single conflict in docs/dev/TechnicalDebt.md, adjacent to the Http2/Ssl/Net pool stats line that main now documents as measured on a PS5). I reworded your line to say the layout is assumed for NpWebApi2, not measured. No code changes.

Checked on the rebased tree: scoped build and ctest green, guest_np_web_api2 and guest_http2 pass, unknown signature/errors documented in TechnicalDebt, null output and unknown context throw. Merging once CI is green.

Note: #3337 declares the same export as an unimplemented stub; it should drop it after this lands.

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.

3 participants