Skip to content

feat(libSceNpCppWebApi): complete the InGameCatalog and Leaderboards offline surface - #13206

Merged
oneandonlydean merged 13 commits into
boykopovar:mainfrom
edubox:feat/npcpp-catalog-leaderboards
Nov 14, 2026
Merged

oneandonlydean merged 13 commits into
boykopovar:mainfrom
edubox:feat/npcpp-catalog-leaderboards

Conversation

@edubox

@edubox edubox commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Completes the remaining imported offline surface of sce::Np::CppWebApi::InGameCatalog::V5 and sce::Np::CppWebApi::Leaderboards::V1, 21 NIDs with no implementation:

Namespace Exports Behaviour
InGameCatalog::V5 14 the twelve Container/Sku accessors read the measured fields; the two ParameterToGetContainer setters store the value and an is-set flag through the implementation pointer
Leaderboards::V1 7 the four request setters store the value and an is-set flag; the three response accessors read the measured fields

The offsets and widths come from the module bundled with PPSA21564/PPSA23732 (builds J03093737/J03341606): Container::getId is the pointer at +0x38, skusIsSet is the byte at +0x220, GetRankingResponseBody::getTotalEntryCount is the 32-bit value at +0x58 and RecordScoreRequestBody::needsTmpRankIsSet is the byte at +0x42, plus the other offsets recorded in the debt. The two parameters now allocate a host implementation of the module layout so setfields and the Container setters can store through +0x8; setfields returns 0x80553502 before initialize and 0x80553503/0x80553504 when the string copy fails. The host allocator stands in for the module's LibContext allocator.

Tested

Linux x86-64, GCC 16.2.1, Release with BUILD_TESTING=ON, rebased on main ab6f5d32ed:

  • ctest --test-dir build -R '^guest_np_cpp_web_api': 11/11 passed, including the new guest_np_cpp_web_api_catalog_leaderboards. It pins the measured offsets, the is-set flags, the vector reference-count increment and the parameter lifecycle/error codes instead of asserting throws or null-self success.
  • python3 tools/check_conventions.py --base origin/main passes.
  • python3 tools/pr_overlap.py --branch feat/npcpp-catalog-leaderboards --jobs 32: no overlap with active open pull requests. The tool could not compare a set of stale pull requests that already conflict with main in core/libs/CMakeLists.txt.
  • No title run.

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 30, 2026 •

Copy link
Copy Markdown

Progress report (22e8cd0 → 4a85ad7)

📈 System libraries: 38.01% (+0.04%, +21 implemented functions)

✅ 21 implemented
Library Name
libSceNpCppWebApi _ZN3sce2Np9CppWebApi12Leaderboards2V121GetRankingRequestBody17setNpServiceLabelERKj
libSceNpCppWebApi _ZN3sce2Np9CppWebApi12Leaderboards2V122RecordScoreRequestBody15setWaitsForDataERKb
libSceNpCppWebApi _ZN3sce2Np9CppWebApi12Leaderboards2V122RecordScoreRequestBody17setNpServiceLabelERKj
libSceNpCppWebApi _ZN3sce2Np9CppWebApi12Leaderboards2V19BoardsApi29ParameterToGetBoardDefinition9setfieldsEPKc
libSceNpCppWebApi _ZN3sce2Np9CppWebApi13InGameCatalog2V512ContainerApi23ParameterToGetContainer14setkeepHtmlTagEb
libSceNpCppWebApi _ZN3sce2Np9CppWebApi13InGameCatalog2V512ContainerApi23ParameterToGetContainer20setuseCurrencySymbolEb
libSceNpCppWebApi _ZN3sce2Np9CppWebApi13InGameCatalog2V59Container7getSkusEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V122GetRankingResponseBody12entriesIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V122GetRankingResponseBody18getTotalEntryCountEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V122RecordScoreRequestBody17needsTmpRankIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V53Sku10getEndDateEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V53Sku12endDateIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container13childrenIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container14getDescriptionEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container14getDisplayNameEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container14getReleaseDateEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container16releaseDateIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container5getIdEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container7getTypeEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container8getLabelEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container9skusIsSetEv

Changed libraries (implemented exports)

Library Before After Change
libSceNpCppWebApi 1332/1778 (74.92%) 1353/1799 (75.21%) +0.29%

@JJenkx

JJenkx commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Windows run of this head (744f1938d5), merged onto main 7d4006607a (clean merge, local only). Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON, no Vulkan driver visible.

  • This PR: guest_np_cpp_web_api_catalog_leaderboards passes 3 of 3 (ctest --repeat until-fail:3).
  • Negative control: not possible. With this PR's source files (core/libs/prx/libSceNpCppWebApi/Export.cpp, core/libs/prx/libSceNpCppWebApi/include/Api.hpp) put back to main's version, the build fails against the rest of the PR, so there is no source-only control.

AI-assisted: yes (Claude Code).

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@edubox thanks. The 21 names all hash to the expected NIDs, but the bundled module (the libSceNpCppWebApi.prx shipped with PPSA21564, build J03093737, SHA-256 0666df3c...67c2) behaves differently from this PR for most of them:

  • The 15 accessors are plain field reads, not throws. For example Container::getId is lea rax,[rdi+0x38]; ret, Container::skusIsSet is movzx eax,byte [rdi+0x220]; ret, GetRankingResponseBody::getTotalEntryCount is mov eax,[rdi+0x58]; ret, and RecordScoreRequestBody::needsTmpRankIsSet is movzx eax,byte [rdi+0x42]; ret. That last one reads the title's own request object, so "only exists after a successful response" doesn't apply to it.
  • The setters store state. The request-body setters write the value plus an is-set flag (for example RecordScoreRequestBody::setWaitsForData stores to +0x79 and sets +0x7a). The two ParameterToGetContainer setters write through the implementation pointer at +0x8, and do nothing when it's null. ParameterToGetBoardDefinition::setfields returns 0x80553502 when the parameter isn't initialized or the copy fails, where this PR returns 0.
  • The test pins unfinished behaviour. It asserts that all 15 accessors throw and that every setter returns 0 for a null self. The project's tests shouldn't pin unimplemented calls to a throw, and a null self isn't a valid call. Please drop those assertions, and pin source-backed values instead (for example setfields before initialize returns 0x80553502).
  • Debt. docs/dev/debt/libSceNpCppWebApi.md isn't updated. Any setter that still returns success without storing needs a Silent stubs entry, plus the provenance line the other namespaces have.

The field reads and stores are small enough to implement directly on a matching layout. Where you'd rather not, please document the gap instead of pinning a throw.

@github-actions

github-actions Bot commented Oct 30, 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 19674 _ZN3sce2Np9CppWebApi13InGameCatalog2V59Container7getSkusEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V53Sku10getEndDateEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V53Sku12endDateIsSetEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container14getDisplayNameEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container14getReleaseDateEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container16releaseDateIsSetEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container8getLabelEv
_ZNK3sce2Np9CppWebApi13InGameCatalog2V59Container9skusIsSetEv

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 8650 core/libs/CMakeLists.txt
PR 9156 core/libs/CMakeLists.txt
PR 9293 core/libs/CMakeLists.txt
PR 9297 core/libs/CMakeLists.txt
PR 9302 core/libs/CMakeLists.txt
PR 9383 core/libs/CMakeLists.txt
PR 12642 core/libs/CMakeLists.txt
PR 16793 core/libs/CMakeLists.txt
PR 17452 core/libs/CMakeLists.txt
PR 17496 core/libs/CMakeLists.txt
PR 19484 core/libs/prx/libSceNpCppWebApi/Export.cpp
docs/dev/debt/libSceNpCppWebApi.md
PR 19503 core/libs/prx/libSceNpCppWebApi/Export.cpp
docs/dev/debt/libSceNpCppWebApi.md
PR 19526 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 19546 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md

@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (91db3f79f7); head is now 26623a0535 (was 744f1938d5). The commit reapplied cleanly with no code changes.

Verified on this exact head (Linux x86-64, GCC 16.2.1, Release):

  • ctest --test-dir build -R '^guest_np_cpp_web_api' passes 10/10, including guest_np_cpp_web_api_catalog_leaderboards.
  • python3 tools/check_conventions.py --base origin/main: All conventions checks passed.
  • git diff --check origin/main...HEAD: clean.

AI-assisted: yes

@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (73ffb45110); head is now 25ab63ee5a (was 26623a0535). The commit reapplied cleanly with no code changes.

Verified on this exact head (Linux x86-64, GCC 16.2.1, Release):

  • ctest --test-dir build -R '^guest_np_cpp_web_api' passes 10/10, including guest_np_cpp_web_api_catalog_leaderboards.
  • python3 tools/check_conventions.py --base origin/main: All conventions checks passed.
  • git diff --check origin/main...HEAD: clean.

AI-assisted: yes

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch 2 times, most recently from 25ab63e to a0bc673 Compare October 30, 2026 21:20
@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (e584b5a7eb); head is now a0bc6734b8 (was 25ab63ee5a). The commit reapplied cleanly with no code changes.

Verified on this exact head (Linux x86-64, GCC 16.2.1, Release):

  • ctest --test-dir build -R '^guest_np_cpp_web_api' passes 10/10, including guest_np_cpp_web_api_catalog_leaderboards.
  • python3 tools/check_conventions.py --base origin/main: All conventions checks passed.
  • git diff --check origin/main...HEAD: clean.

AI-assisted: yes

@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (9605300f29); head is now 807e3b8897a. No source changes in the rebase.

Focused tests pass: ctest --test-dir build -R '^guest_np_cpp_web_api' 10/10 (including the new guest_np_cpp_web_api_catalog_leaderboards). python3 tools/check_conventions.py --base origin/main and git diff --check origin/main...HEAD are clean. Pushed with --force-with-lease.

AI-assisted: yes (Claude Code).

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch from a0bc673 to 807e3b8 Compare October 30, 2026 22:22
@edubox

edubox commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (6b48aee) since the branch was 62 commits behind.

  • ctest --test-dir build -R '^guest_np_cpp_web_api': 10/10 passed.
  • python3 tools/check_conventions.py --base origin/main: passed.

Head is now 044e3fb783d.

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch 2 times, most recently from 044e3fb to 30208c7 Compare October 31, 2026 02:03
@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (4b7af94e1d); the branch was 213 commits behind.

  • ctest --test-dir build -R '^guest_np_cpp_web_api': 10/10 passed.
  • python3 tools/check_conventions.py --base origin/main: passed.

Head is now 30208c76c99.

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (2364892547); head is now 2609de9484. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch from 30208c7 to 2609de9 Compare October 31, 2026 04:01
@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (3d1330179a); head is now 990b0a0ff1. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch from 2609de9 to 990b0a0 Compare October 31, 2026 05:02
@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (de83e8f270); head is now 0423039423. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch 2 times, most recently from 0423039 to 68c7a3e Compare October 31, 2026 10:01
@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (45f4f82449); head is now 68c7a3edcc. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox

edubox commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased automatically onto current main (1847a6f9da); head is now 86bbf0c931. Focused tests pass; check_conventions.py --base origin/main and git diff --check are clean.

@edubox
edubox force-pushed the feat/npcpp-catalog-leaderboards branch from 68c7a3e to 86bbf0c Compare October 31, 2026 11:02
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 5, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
…merged from main

Co-authored-by: edubox <3165165+edubox@users.noreply.github.com>
@oneandonlydean

Copy link
Copy Markdown
Collaborator

Hi @edubox, main moved under this branch (#14136 gave the BasicPresence accountIdIsSet declaration a signature in Api.hpp), so I merged main into it. The one conflict was in libSceNpCppWebApi/include/Api.hpp: the merge keeps main's prototyped accountIdIsSet declaration and all of your Leaderboards and InGameCatalog declarations. #14136 also added four list-parser lines in Export.cpp that still used the old ParameterAllocationFailed name your branch renamed to ParameterOutOfMemory (same 0x80553504 value), so I switched those four to your name in a second commit. None of your own code changed, and the NpCppWebApi tests pass on the merged tree.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
…aderboards

# Conflicts:
#	core/libs/prx/libSceNpCppWebApi/Export.cpp
#	docs/dev/debt/libSceNpCppWebApi.md
@edubox

edubox commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (1da78eb048) to clear the conflict.

  • Export.cpp: kept main's newer vector-helper logic (direct-body/adopted-body handling) with this branch's ParameterOutOfMemory name, and dropped the reference-count constants main now defines once.
  • docs/dev/debt/libSceNpCppWebApi.md: kept main's wording for the DataStatus/header getters that main now implements, plus this branch's measured Container parameter/accessor detail.

Verified on the merge: guest_np_cpp_web_api* 15/15 pass, check_conventions.py --base origin/main reports 0 errors (2 debt-length warnings), and git diff --check is clean. AI-assisted: yes.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
…aderboards

# Conflicts:
#	core/libs/prx/libSceNpCppWebApi/Export.cpp
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 7, 2026
…aderboards

# Conflicts:
#	docs/dev/debt/libSceNpCppWebApi.md
@edubox

edubox commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Merged current origin/main (2abd124d07a) to clear the conflict. The only conflict was docs/dev/debt/libSceNpCppWebApi.md: kept this PR's measured TitleCloudStorage/InGameCatalog entry and added main's new ParameterToGetContainer::setserviceLabel entry. No code changed.

Verified on the merge (46d93b5169): all 18 guest_np_cpp_web_api* tests pass, including guest_np_cpp_web_api_catalog_leaderboards; python3 tools/check_conventions.py --base origin/main reports 0 errors. AI-assisted: yes.

@edubox

edubox commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Also merged current origin/main (eadb1edd1f) after that, clean. Same verification on 4a85ad7092a: all 18 guest_np_cpp_web_api* tests pass and check_conventions.py --base origin/main reports 0 errors. AI-assisted: yes.

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.

5 participants