Skip to content

feat(prx): declare exports for 3 inventory-covered NP libraries - #9874

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
akkadbakkad89:feat/prx-declare-np-exports
Oct 27, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
akkadbakkad89:feat/prx-declare-np-exports

Conversation

@akkadbakkad89

@akkadbakkad89 akkadbakkad89 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What

Declares the PS5 3.20 export-inventory names for three NP libraries so titles importing them resolve:

All 159 declarations follow the unknown-signature convention: parameterless stubs that throw through NotImplemented_nid_no_patch, so imports resolve without claiming behavior or ABI correctness. Names/NIDs come from the PS5 3.20 export inventory. Each library's debt entry records that prototypes are unverified.

Tested

  • tools/check_conventions.py --base upstream/main: clean
  • tools/pr_overlap.py: no same-scope exports after deduplicating against open PRs
  • cmake --build build --target libSceNpTrophy libSceNpMatching2 libSceNpScoreRanking: all three link
  • Inventory gap for the three libraries is closed except sceNpTrophyAbortHandle (covered by feat(libSceNpTrophy): add sceNpTrophyAbortHandle #9871)

AI-assisted: yes

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

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Progress report (035ac96 → 72c6141)

📉 System libraries: 50.34% (-0.64%, +159 declared functions)

🆕 159 declared as stubs
Library Name
libSceNpMatching2 sceNpMatching2AbortContextStart
libSceNpMatching2 sceNpMatching2CreateContextA
libSceNpMatching2 sceNpMatching2CreateContextInternal
libSceNpMatching2 sceNpMatching2CreateJoinRoomA
libSceNpMatching2 sceNpMatching2GetLobbyInfoList
libSceNpMatching2 sceNpMatching2GetLobbyMemberDataInternal
libSceNpMatching2 sceNpMatching2GetLobbyMemberDataInternalList
libSceNpMatching2 sceNpMatching2GetMemoryInfo
libSceNpMatching2 sceNpMatching2GetRoomJoinedSlotMaskLocal
libSceNpMatching2 sceNpMatching2GetRoomMemberDataExternalList
libSceNpMatching2 sceNpMatching2GetRoomMemberIdListLocal
libSceNpMatching2 sceNpMatching2GetRoomPasswordLocal
libSceNpMatching2 sceNpMatching2GetSignalingOptParamLocal
libSceNpMatching2 sceNpMatching2GetSslMemoryInfo
libSceNpMatching2 sceNpMatching2GetUserInfoListA
libSceNpMatching2 sceNpMatching2GetWorldIdArrayForAllServers
libSceNpMatching2 sceNpMatching2GrantRoomOwner
libSceNpMatching2 sceNpMatching2JoinLobby
libSceNpMatching2 sceNpMatching2JoinRoomA
libSceNpMatching2 sceNpMatching2LeaveLobby
libSceNpMatching2 sceNpMatching2RegisterLobbyEventCallback
libSceNpMatching2 sceNpMatching2RegisterLobbyMessageCallback
libSceNpMatching2 sceNpMatching2RegisterManualUdpSignalingCallback
libSceNpMatching2 sceNpMatching2SendLobbyChatMessage
libSceNpMatching2 sceNpMatching2SetExtraInitParam
libSceNpMatching2 sceNpMatching2SetLobbyMemberDataInternal
libSceNpMatching2 sceNpMatching2SetRoomDataInternalExt
libSceNpMatching2 sceNpMatching2SetSignalingOptParam
libSceNpMatching2 sceNpMatching2SignalingAbortConnection
libSceNpMatching2 sceNpMatching2SignalingCancelPeerNetInfo
libSceNpMatching2 sceNpMatching2SignalingEnableManualUdpMode
libSceNpMatching2 sceNpMatching2SignalingEstablishConnection
libSceNpMatching2 sceNpMatching2SignalingGetConnectionInfoA
libSceNpMatching2 sceNpMatching2SignalingGetConnectionStatus
libSceNpMatching2 sceNpMatching2SignalingGetLocalNetInfo
libSceNpMatching2 sceNpMatching2SignalingGetPeerNetInfo
libSceNpMatching2 sceNpMatching2SignalingGetPeerNetInfoResult
libSceNpMatching2 sceNpMatching2SignalingGetPingInfo
libSceNpMatching2 sceNpMatching2SignalingGetPort
libSceNpMatching2 sceNpMatching2SignalingSetPort
libSceNpScoreRanking sceNpScoreCensorComment
libSceNpScoreRanking sceNpScoreCensorCommentAsync
libSceNpScoreRanking sceNpScoreChangeModeForOtherSaveDataOwners
libSceNpScoreRanking sceNpScoreCreateNpTitleCtxA
libSceNpScoreRanking sceNpScoreCreateTitleCtx
libSceNpScoreRanking sceNpScoreGetBoardInfoAsync
libSceNpScoreRanking sceNpScoreGetFriendsRankingA
libSceNpScoreRanking sceNpScoreGetFriendsRankingAAsync
libSceNpScoreRanking sceNpScoreGetFriendsRankingForCrossSave
libSceNpScoreRanking sceNpScoreGetFriendsRankingForCrossSaveAsync
libSceNpScoreRanking sceNpScoreGetGameData
libSceNpScoreRanking sceNpScoreGetGameDataAsync
libSceNpScoreRanking sceNpScoreGetGameDataByAccountId
libSceNpScoreRanking sceNpScoreGetGameDataByAccountIdAsync
libSceNpScoreRanking sceNpScoreGetRankingByAccountId
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdAsync
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdForCrossSave
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdForCrossSaveAsync
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdPcId
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdPcIdAsync
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdPcIdForCrossSave
libSceNpScoreRanking sceNpScoreGetRankingByAccountIdPcIdForCrossSaveAsync
libSceNpScoreRanking sceNpScoreGetRankingByNpIdPcId
libSceNpScoreRanking sceNpScoreGetRankingByNpIdPcIdAsync
libSceNpScoreRanking sceNpScoreGetRankingByRangeA
libSceNpScoreRanking sceNpScoreGetRankingByRangeAAsync
libSceNpScoreRanking sceNpScoreGetRankingByRangeForCrossSave
libSceNpScoreRanking sceNpScoreGetRankingByRangeForCrossSaveAsync
libSceNpScoreRanking sceNpScoreRecordGameData
libSceNpScoreRanking sceNpScoreRecordGameDataAsync
libSceNpScoreRanking sceNpScoreSanitizeComment
libSceNpScoreRanking sceNpScoreSanitizeCommentAsync
libSceNpScoreRanking sceNpScoreSetPlayerCharacterId
libSceNpScoreRanking sceNpScoreSetThreadParam
libSceNpScoreRanking sceNpScoreSetTimeout
libSceNpScoreRanking sceNpScoreWaitAsync
libSceNpTrophy sceNpTrophyCaptureScreenshot
libSceNpTrophy sceNpTrophyConfigGetTrophyDetails
libSceNpTrophy sceNpTrophyConfigGetTrophyFlagArray
libSceNpTrophy sceNpTrophyConfigGetTrophyGroupArray
libSceNpTrophy sceNpTrophyConfigGetTrophyGroupDetails
libSceNpTrophy sceNpTrophyConfigGetTrophySetInfo
libSceNpTrophy sceNpTrophyConfigGetTrophySetInfoInGroup
libSceNpTrophy sceNpTrophyConfigGetTrophySetVersion
libSceNpTrophy sceNpTrophyConfigGetTrophyTitleDetails
libSceNpTrophy sceNpTrophyConfigHasGroupFeature
libSceNpTrophy sceNpTrophyGroupArrayGetNum
libSceNpTrophy sceNpTrophyIntAbortHandle
libSceNpTrophy sceNpTrophyIntCheckNetSyncTitles
libSceNpTrophy sceNpTrophyIntCreateHandle
libSceNpTrophy sceNpTrophyIntDestroyHandle
libSceNpTrophy sceNpTrophyIntGetLocalTrophySummary
libSceNpTrophy sceNpTrophyIntGetProgress
libSceNpTrophy sceNpTrophyIntGetRunningTitle
libSceNpTrophy sceNpTrophyIntGetRunningTitles
libSceNpTrophy sceNpTrophyIntGetTrpIconByUri
libSceNpTrophy sceNpTrophyIntNetSyncTitle
libSceNpTrophy sceNpTrophyIntNetSyncTitles
libSceNpTrophy sceNpTrophyNumInfoGetTotal
libSceNpTrophy sceNpTrophySetInfoGetTrophyFlagArray
... 59 more

Changed libraries (implemented exports)

Library Before After Change
libSceNpMatching2 11/29 (37.93%) 11/69 (15.94%) -21.99 pp
libSceNpScoreRanking 15/15 (100.00%) 15/51 (29.41%) -70.59 pp
libSceNpTrophy 12/14 (85.71%) 12/97 (12.37%) -73.34 pp

@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.

The inventory scope is clearly bounded to 159 exports across three libraries, the existing trophy implementation sceNpTrophyAbortHandle is explicitly excluded, each added export throws through NotImplemented_nid_no_patch, and each library gets a debt entry explaining the unknown prototypes. Intake/eligibility/labels/report pass and the head is directly based on current main; the author reports the three library targets link.

The required Conventions check currently fails on this head: its log says the PR template's Checklist section is missing or empty. The PR body currently has What, Tested and AI-assisted text but no template checklist. Please copy the full current .github/pull_request_template.md, keep every line, fill all required fields, and rerun conventions. The hosted platform build jobs are skipped, so the local link report remains the only product build evidence.

@MarcZX10

Copy link
Copy Markdown
Contributor

The current hosted conventions check is failing with Fill in the pull request template: section Checklist is missing or empty, although the PR body reports the local convention check as clean. Please add the required Checklist section and rerun conventions on the final head. The PR head is based on a0900b9d, 18 commits behind current upstream main 7c900bbc; please also rebase and rerun the three library builds plus overlap checking so the export declarations are reviewed against the current inventory. Product jobs are skipped, so their link results remain author-reported.

@MarcZX10

Copy link
Copy Markdown
Contributor

Following up because the head and hosted result are unchanged since my earlier note: the current PR body still has no required Checklist section, and the latest hosted conventions run fails on that omission. The head fbc6bcbb is based on a0900b9d, which is 107 commits behind current main 8aa44cf3; please add the checklist and rebase, then rerun conventions and the three target library builds plus overlap checking on the resulting tree. The hosted product jobs are skipped, so I cannot treat the earlier link results as CI-verified.

@akkadbakkad89
akkadbakkad89 force-pushed the feat/prx-declare-np-exports branch from fbc6bcb to 6d343c6 Compare October 23, 2026 03:00
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

@MarcZX10 done — rebased, checklist added, all checks run.

Rebase: single commit 7efe8b3754 replayed clean onto main (a2d750122be); pushed as 6d343c64f6d9 — pushed tree verified byte-identical to the validated local tree (79b1ff7222b0). No conflicts; the PR-body Checklist section is now present and filled.

Checks:

  • tools/check_conventions.py --base origin/main: clean, 0 errors
  • Build (MinGW, cmake --build build --target libSceNpTrophy libSceNpMatching2 libSceNpScoreRanking): all three link — libSceNpTrophy.prx, libSceNpMatching2.prx, libSceNpScoreRanking.prx
  • tools/pr_overlap.py --branch: no open PR declares any of the same 159 exports — no same-scope duplication

Overlap detail worth flagging (file-level only, not semantic): three open PRs touch the same files, so whichever lands first will conflict the others —

All conflicts are mechanical (adjacent debt entries / appended declarations) — happy to rebase again after any of them merge.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@akkadbakkad89
akkadbakkad89 force-pushed the feat/prx-declare-np-exports branch from 6d343c6 to 872a969 Compare October 23, 2026 16:05
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Rebased onto main @ 15e71dbe1. The previous head was built on a stale tree and carried unintended reverts of already-merged work (the common-dialog state machines from #9192, the libSceCesCs single-byte/UTF-16/GBK series, the getrlimit WriteGuest + nproc locking, and their guest tests). The rebase drops all of it: the diff is now only the three intended payloads — libSceNpMatching2, libSceNpScoreRanking, libSceNpTrophy export declarations (+ their debt notes), 814 additions, no deletions.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@VakzOs

VakzOs commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Hi, I’m the author of boykopovar/AnyPS5#10214, which adds the code page 858 profile in libSceCesCs. A reviewer asked the PRs touching the CES files to agree on an order. After refreshing onto current main, boykopovar/AnyPS5#10214 and this PR merge cleanly in either order, and 14/14 guest_ces* tests pass on main + boykopovar/AnyPS5#9874 + boykopovar/AnyPS5#10214. Nothing to change on your side; this is just so the order is recorded. OK with you?

@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Yes, fine either order. One note for the record: after today's rebase this PR no longer touches libSceCesCs at all — the diff is only the three NP libraries' Export.cpp files plus their debt entries. So there's no ordering constraint between the two PRs on our side; #10214 can land independently.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 23, 2026
@akkadbakkad89
akkadbakkad89 force-pushed the feat/prx-declare-np-exports branch from 872a969 to ab76f6d Compare October 24, 2026 08:25
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 24, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 25, 2026
@BunnyFl

BunnyFl commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

A data point from firmware 13.42's libSceNpTrophy.sprx: five of the declarations that throw here are fixed returns there. sceNpTrophySystemDbgCtl, sceNpTrophySystemGetDbgParam, sceNpTrophySystemGetDbgParamInt, sceNpTrophySystemSetDbgParam and sceNpTrophySystemSetDbgParamInt each return 0x80551692 and do nothing else: no calls, and no memory written. I ran them in an emulator, twice, with null, small and all-ones arguments.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@akkadbakkad89 Thanks for the rebase that dropped the stale reverts. The diff is now only the three Export.cpp files and their debt entries, and none of the 159 names is defined anywhere on main yet.

One change before merge. Since main added a canonical header per library, every export has to be declared once in its library's include/Api.hpp. None of the 159 new stubs is, so public_headers fails on the merged tree with 159 errors like:

sceNpTrophyConfigGetTrophySetInfo: expected exactly one header declaration; found 0:
sceNpMatching2JoinLobby: expected exactly one header declaration; found 0:

Could you add the declarations, the same parameterless int APS5_VABI name(); form as the definitions, to core/libs/prx/libSceNpTrophy/include/Api.hpp, libSceNpMatching2/include/Api.hpp and libSceNpScoreRanking/include/Api.hpp? Then python3 core/libs/tests/test_public_headers.py --audit-only should pass.

Optional: @BunnyFl measured that on firmware 13.42 the five sceNpTrophySystem*Dbg* calls only return 0x80551692. You could implement those five as fixed returns instead of throws, or leave that for a follow-up.

@akkadbakkad89
akkadbakkad89 force-pushed the feat/prx-declare-np-exports branch from ab76f6d to 1109a3a Compare October 26, 2026 05:33
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Done — pushed 1109a3af54, rebased onto current main 5a2744c55e.

Verified the public_headers failure first: the 159 stubs are defined in the three Export.cpp files but had no canonical header declaration. Added int APS5_VABI <name>(); declarations for all of them — 83 in libSceNpTrophy/include/Api.hpp, 40 in libSceNpMatching2/include/Api.hpp, 36 in libSceNpScoreRanking/include/Api.hpp — matching the definitions' parameterless form.

python3 core/libs/tests/test_public_headers.py --audit-only now passes: "368 libraries, 12356 exports: unique declarations and umbrella coverage verified". check_conventions.py --base origin/main clean.

On @BunnyFl's 13.42 datapoint (the five sceNpTrophySystem*Dbg* fixed 0x80551692 returns): leaving as throws for now — I can't verify a 13.42 image locally (our dumps are 4.03/12.70 with modules in compressed inner packages), and implementing an unverified behavior would violate the evidence rule. Happy to take it as a follow-up if a 13.42 dump lands.

@babyhuey

Copy link
Copy Markdown
Contributor

The current head 1109a3af54 doesn't build (found on Windows, WinLibs GCC 15.2, merged onto main 9b197b6ce45, but it isn't Windows-specific). The new declarations in include/Api.hpp sit after the closing brace of the extern "C" { block, for example in libSceNpMatching2 the block runs from line 23 to line 55 and the new declarations start at line 57, while Export.cpp defines the functions inside extern "C":

error: conflicting declaration of 'int sceNpMatching2AbortContextStart()' with 'C' linkage
note: previous declaration with 'C++' linkage

That happens for every new export across libSceNpMatching2, libSceNpScoreRanking and libSceNpTrophy (159 errors). Moving the new declarations inside the extern "C" block should fix it. The previous head ab76f6d791 built, but public_headers failed there with "expected exactly one header declaration; found 0" for those same 159 exports, which is what this push addresses.

AI-assisted: yes (Claude Code)

@akkadbakkad89
akkadbakkad89 force-pushed the feat/prx-declare-np-exports branch from 1109a3a to e259eae Compare October 26, 2026 08:46
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Build break confirmed and fixed at e259eaec25. Verified babyhuey's claim first: my insertion anchored on the file's last } instead of the extern "C" close, so all 159 declarations (40+36+83) landed after the block in each of the three Api.hpp files — conflicting declaration ... with 'C' linkage on all of them. Moved the declarations inside the block; libSceNpMatching2/libSceNpScoreRanking/libSceNpTrophy now build, zero duplicate symbols, and test_public_headers.py --audit-only still verifies (368 libraries, 12356 exports).

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
akkadbakkad89 and others added 2 commits October 26, 2026 13:15
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/prx-declare-np-exports branch from e259eae to 72c6141 Compare October 26, 2026 13:15
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Rebased onto current main at 72c6141954 — the PR had gone mergeable-dirty after main landed the trophy abort-handle work (87468a6e3a, b4c1498dfe, 1309f3c63f). No functional overlap: those commits implement sceNpTrophyAbortHandle, a different symbol than this PR's sceNpTrophyIntAbortHandle/sceNpTrophySystemAbortHandle stubs, so the only conflict was the adjacent debt-file entry (kept both). test_public_headers.py --audit-only: 368 libraries, 12391 exports verified; all three libraries build; conventions clean.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 26, 2026
@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

On the conventions flag: the PR body now carries the full current template including the Checklist section with every item ticked (What / Tested / Depends on / Unblocks / GPUs tested / AI-assisted all filled). The head is 72c6141954 rebased onto current main after the trophy conflict resolution; all three libraries build and the public-header audit reports 368 libraries / 12391 exports verified.

@babyhuey

Copy link
Copy Markdown
Contributor

Follow-up to my build report: this head 72c6141954 merged onto main 27ad7244d22 (clean merge, local only) builds now on Windows 11 (WinLibs GCC 15.2, Release, BUILD_TESTING=ON, configured fresh after the merge). With the CI selection (select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --parallel 4 --timeout 120), 412 tests: 406 pass, 0 fail, 6 skip, including public_headers and every public_headers_compile_* test.

AI-assisted: yes (Claude Code)

@akkadbakkad89

Copy link
Copy Markdown
Contributor Author

Thanks for the merge-build verification — good to have the extern-block fix confirmed on your toolchain too.

@oneandonlydean
oneandonlydean merged commit a1f75ec into boykopovar:main Oct 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants