Skip to content

feat(npcppwebapi): implement ten leaderboard entry accessors - #15885

Open
JJenkx wants to merge 6 commits into
boykopovar:mainfrom
JJenkx:feat/npcpp-leaderboard-rank-accessors-20261104
Open

JJenkx wants to merge 6 commits into
boykopovar:mainfrom
JJenkx:feat/npcpp-leaderboard-rank-accessors-20261104

Conversation

@JJenkx

@JJenkx JJenkx commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Current integration (2026-11-05): head 1805540242dc0d0ef249687473ab440f879d209f includes pinned main dd6efc7f0cb33345df4ca3f8c597050181343f56. Resolved the debt-file conflict by retaining main's twelve implemented factories, iterator status and other gaps, this branch's measured ParameterTo layouts, and its own accessor/collection boundaries. Source, headers and CMake merged without conflict.

Rebuilt the actual NpCppWebApi library CMake owner and registered root CPU fixtures in isolated builds: 11/11 tests pass on main and on this head, zero skips. The same negative-control executable throws for all 3 selected new accessors on main and passes on this branch. Conventions and diff checks pass. This scoped qualification uses frozen main 080dbd08c6f83be5a1768af7d3342d701bf34d21 libc, SHA-256 1cf4ea0e65b2176081051ce4da6aebb3e90378c920d0d1049aec96eb03f6b41c; it is not a fresh full-SDK, Windows, GPU or title test. Initial setup with an older libc failed to link NotImplementedAt_nid_no_patch; that setup failure is preserved in the logs, and all final builds use the compatible pinned provider above. Older evidence below retains its original source pins.

Current source diffs, owner recipe, paired build/test/XML logs and negative controls, SHA-256 01cd9d2e5f67f397bd1f44cab7b2e936ff297f6fb075b3ccdc83028856f00aa4 (download verified).

What

Implement ten Leaderboards::V1::Entry accessors that currently throw:

Getter Entry offset Result
getHighestRank +0x3c uint32
getHighestSerialRank +0x40 uint32
getSerialRank +0x98 uint32
getPcId +0x80 stored signed 32-bit PcId value
commentIsSet +0x38 independent byte flag
objectIdIsSet +0x68 independent byte flag
smallDataIsSet +0xb8 independent byte flag
getComment +0x18 borrowed Common::String reference
getObjectId +0x48 borrowed Common::String reference
getSmallData +0xa0 borrowed Common::Binary reference

The two immutable SDK modules bundled with PPSA21564 and PPSA05347 agree on these offsets and widths. The three references return embedded object addresses even when the corresponding presence flag is clear; they do not copy, allocate or change reference counts. The string getter declarations return object pointers rather than character-buffer pointers. PcId retains the stored value; no additional meaning or enum-range validation is assumed.

This adds no online response construction or claimed title unblock. Incompatible RecordScore/BoardDefinition response layouts remain refusing and documented. getAccountId remains excluded because #14273 implements it. Activities collection getters remain excluded: backing reference-count offsets differ between the two SDKs, and one collection member moves too.

Tested

Linux x86-64 / GCC16.2.1. Base acac7c854182a1674162f5e623aa25a6469985ae, change 56c712ef280cd95a919de16a4498613230a019e0; linear branch without merge commits.

Rebuilt the library and all nine executable targets covering the complete root-registered NpCppWebApi owner suite. ctest --test-dir build-full -R '^guest_np_cpp_web_api_' --no-tests=error -V passes 12/12 on main and12/12 on the change, no failures/skips, with source and library hashes stable during each arm. The fixture checks three objects, five value patterns (including signed PcId bit patterns), all eight independent flag combinations, repeated mutation, borrowed-reference address identity and unchanged surrounding storage. Pointer checks prove aliases, not online object creation or server payload parsing.

Two linked public-export controls for the newly added commentIsSet and getPcId throw their named refusal on main and read the actual flag/signed field with the change. Public header audit, conventions and whitespace checks pass.

Current source patch, exact pins, complete logs/JUnit, negative controls, derived two-SDK reference summary and manual overlap review, SHA-256 df1712dc41ae7a630cf2ff606cf1247096fd5cfac8e3c40372b59c8d8688aa2c (download verified). No reference-module payload or disassembly is included. The previous eight-accessor validation retains its three borrowed-reference controls and the earlier five-accessor report retains its scalar/flag controls; current12/12 covers all ten accessors. This is an owner-suite rebuild in an existing full-project build, not a fresh whole-project build, GPU or title test. No new-head Windows result is claimed until its CI completes.

The previous official overlap scan and full manual debt review are retained. For the two added fields, all six checked peer stacks still refuse them; fresh live state/overlap was checked before publication. These fields introduce no implementation dependency.

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 Nov 4, 2026 •

Copy link
Copy Markdown

Progress report (edf71e7 → 25f9c05)

📈 System libraries: 30.0% (+0.03%, +10 implemented functions)

✅ 10 implemented
Library Name
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry10getCommentEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry11getObjectIdEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry12commentIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry12getSmallDataEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry13getSerialRankEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry13objectIdIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry14getHighestRankEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry14smallDataIsSetEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry20getHighestSerialRankEv
libSceNpCppWebApi _ZNK3sce2Np9CppWebApi12Leaderboards2V15Entry7getPcIdEv

Changed libraries (implemented exports)

Library Before After Change
libSceNpCppWebApi 1055/1430 (73.78%) 1065/1430 (74.48%) +0.70%

@JJenkx
JJenkx force-pushed the feat/npcpp-leaderboard-rank-accessors-20261104 branch from 488d39a to 210bbf1 Compare November 5, 2026 00:12
@JJenkx JJenkx changed the title feat(npcppwebapi): read leaderboard entry rank fields feat(npcppwebapi): read leaderboard entry ranks and presence flags Nov 5, 2026
@JJenkx
JJenkx force-pushed the feat/npcpp-leaderboard-rank-accessors-20261104 branch from 210bbf1 to 7aae575 Compare November 5, 2026 02:34
@JJenkx JJenkx changed the title feat(npcppwebapi): read leaderboard entry ranks and presence flags feat(npcppwebapi): implement eight leaderboard entry accessors Nov 5, 2026
@JJenkx JJenkx changed the title feat(npcppwebapi): implement eight leaderboard entry accessors feat(npcppwebapi): implement ten leaderboard entry accessors Nov 5, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 5, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ AMD GPU test: passed

PR head 56c712e merged onto main e772fb2 · tested 2026-11-05 17:29 UTC · 19 min

GPU AMD Radeon RX 6300 (RADV NAVI24), driver Mesa 25.2.8-0ubuntu0.24.04.4, Vulkan 1.4.318
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 1,276 passed · 5 failed (0 new, 4 also fail on main, 1 unstable on main) · 7 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 1,288 of 4,074 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (642 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_pipeline_journal 120.1 s, ⚠️ public_headers 49.8 s, ⚠️ agc_driver_image_sample_unnormalized 37.3 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_pipeline_journal: failed in 9 of the last 10 main runs
Failing on main too (4, not counted against this PR)
agc_driver_image_table
agc_driver_native_depth_bda_clear
agc_driver_native_multisample_depth
agc_driver_submit_progress
Validated but not compared (54, not in the main baseline's validation pass)
public_headers
public_headers_compile_1
public_headers_compile_11
public_headers_compile_13
public_headers_compile_15
public_headers_compile_17
public_headers_compile_19
public_headers_compile_21
public_headers_compile_22
public_headers_compile_23
public_headers_compile_24
public_headers_compile_25
public_headers_compile_26
public_headers_compile_27
public_headers_compile_28
public_headers_compile_29
public_headers_compile_3
public_headers_compile_30
public_headers_compile_31
public_headers_compile_32
public_headers_compile_33
public_headers_compile_34
public_headers_compile_35
public_headers_compile_36
public_headers_compile_37
public_headers_compile_38
public_headers_compile_39
public_headers_compile_40
public_headers_compile_41
public_headers_compile_42
public_headers_compile_43
public_headers_compile_44
public_headers_compile_45
public_headers_compile_46
public_headers_compile_47
public_headers_compile_48
public_headers_compile_49
public_headers_compile_5
public_headers_compile_50
public_headers_compile_51
public_headers_compile_52
public_headers_compile_53
public_headers_compile_54
public_headers_compile_55
public_headers_compile_56
public_headers_compile_57
public_headers_compile_58
public_headers_compile_59
public_headers_compile_60
public_headers_compile_61
public_headers_compile_62
public_headers_compile_63
public_headers_compile_7
public_headers_compile_9
Validation IDs already present on main (4 IDs in 501 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (501 tests): agc_driver_address_draw_space_reuse, agc_driver_address_passes, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, agc_driver_bc_block_copy, agc_driver_bda_anchor_reads, agc_driver_bda_span_reads, and 493 more
VUID-vkCmdCopyImage-srcImage-01548 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (4 tests): agc_driver_depth_clear_hle, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 (1 test): agc_driver_srgb8_color_target
Skipped (7)
agc_driver_copied_writer_label_order: skipped, the device reports a minStorageBufferOffsetAlignment of 4, so the dispatch binds its record at +0x1004 in place and nothing is written back; the test needs an alignment above 4
agc_driver_float16_unused_nan_payloads: skipped, the device has no native f16 conversions with RTE rounding and kept f16 denormals
agc_driver_gcn_display_present: skipped, no display: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
agc_driver_linear_target_direct_write_completion: skipped, the device does not keep host imports write-watched, so no completion stamp over the target is tracked
agc_driver_ngg_vertex_wave_reduction: skipped, s3 describes a 32-lane wave only on 32-lane subgroups, and the device has 64 lanes
agc_driver_scattered_runs: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_driver_sparse_dma_buf_import: skipped, host imports are unavailable: /dev/udmabuf is not accessible
Reproduce
git fetch origin 56c712ef280cd95a919de16a4498613230a019e0 e772fb25cc72ee5faf77847f06bbc69533016e82
git checkout e772fb25cc72ee5faf77847f06bbc69533016e82 && git merge --no-ff 56c712ef280cd95a919de16a4498613230a019e0
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 12 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 16 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@JJenkx

JJenkx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Current integration (2026-11-05): head 1805540242dc0d0ef249687473ab440f879d209f includes pinned main dd6efc7f0cb33345df4ca3f8c597050181343f56. Resolved the debt-file conflict by retaining main's twelve implemented factories, iterator status and other gaps, this branch's measured ParameterTo layouts, and its own accessor/collection boundaries. Source, headers and CMake merged without conflict.

Rebuilt the actual NpCppWebApi library CMake owner and registered root CPU fixtures in isolated builds: 11/11 tests pass on main and on this head, zero skips. The same negative-control executable throws for all 3 selected new accessors on main and passes on this branch. Conventions and diff checks pass. This scoped qualification uses frozen main 080dbd08c6f83be5a1768af7d3342d701bf34d21 libc, SHA-256 1cf4ea0e65b2176081051ce4da6aebb3e90378c920d0d1049aec96eb03f6b41c; it is not a fresh full-SDK, Windows, GPU or title test. Initial setup with an older libc failed to link NotImplementedAt_nid_no_patch; that setup failure is preserved in the logs, and all final builds use the compatible pinned provider above. Older evidence below retains its original source pins.

Current source diffs, owner recipe, paired build/test/XML logs and negative controls, SHA-256 01cd9d2e5f67f397bd1f44cab7b2e936ff297f6fb075b3ccdc83028856f00aa4 (download verified).

AI-assisted: yes.

@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
# Conflicts:
#	core/libs/prx/libSceNpCppWebApi/include/Api.hpp
@JJenkx

JJenkx commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged main into this branch as 25f9c0553c (no force-push). The conflict was in include/Api.hpp, on three adjacent accessor declarations: this PR changes getComment and getObjectId to return const CommonString*, and main changed getOnlineId to the form that returns through an out pointer (void* (void* out, const void* self)). Each side's change is kept. Export.cpp merged on its own and has a single getOnlineId definition, in main's form, which both test call sites use.

Re-checked on Arch Linux 7.2.11, Release, BUILD_TESTING=ON: the 14 guest_np_cpp* groups pass 3 of 3 (ctest --repeat until-fail:3). tools/check_conventions.py reports no errors; its two debt-length warnings are on entries this PR already had.

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 commented Nov 7, 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 16128 docs/dev/debt/libSceNpCppWebApi.md L49
PR 16505 docs/dev/debt/libSceNpCppWebApi.md L49

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 14212 docs/dev/debt/libSceNpCppWebApi.md
PR 15029 core/libs/prx/libSceNpCppWebApi/Export.cpp
docs/dev/debt/libSceNpCppWebApi.md
PR 16436 core/libs/prx/libSceNpCppWebApi/Export.cpp

This branch has not been deployed

No deployments
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