Repository navigation
feat(libSceNpEntitlementAccess): implement sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual - #13459
Conversation
…ddcontEntitlementInfoIndividual Take the user ID, service label, entitlement label and info of the runtime declaration in dlc_emu. A user ID of -1 returns the parameter error before any other check; any other ID returns what sceNpEntitlementAccessGetAddcontEntitlementInfo returns for the label, including the not-found error for a label the entitlements file does not list. Record the unverified prototype, the error order and the label checks dlc_emu makes that this export does not in the debt.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
The implementation and boundary tests are coherent on the inspected head, but this PR has an unresolved merge order with another open PR that changes the same debt entry.
What I ran
Reviewed head b08d773dd0aea73f94e2214d645aa168e41ba408 against base 9f748f4d8e36ce3714f3b95f3386316e110a9b22. The PR merges cleanly against current main; PR #8646 is still open at 17934e1576a4b299740e15c53d28ded579115570 and conflicts with current main, including the shared debt file. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5; GCC 12.2 is installed, but no compiler was invoked.
git diff --check refs/remotes/upstream/main...refs/remotes/review/pr-13459
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13459
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 9f748f4d8e36ce3714f3b95f3386316e110a9b22 --head b08d773dd0aea73f94e2214d645aa168e41ba408
python3 tools/pr_test_quality.py --root /marc/AnyPS5 --json core/libs/tests/GuestEntitlements.cpp
git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/review/pr-13459
git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/review/pr-8646Results
| Check | Result |
|---|---|
| Source review of the new export and boundary assertions | No functional defect found in the inspected diff. The new function checks user ID -1 before delegating to the existing add-on lookup; tests cover listed/unlisted labels, invalid pointers, output preservation, and several user IDs. |
git diff --check |
Passed (exit 0; no output). |
| Conventions and PR template | Passed. |
| ABI audit | Passed: the new export has one declaration and one definition, with no lexical NID mismatch. This does not verify the runtime ABI or firmware version table. |
| Test-quality heuristic and registration | The heuristic flagged a possible unregistered test because it searches for the full repository-relative path. I checked the exact PR tree: core/libs/CMakeLists.txt registers tests/GuestEntitlements.cpp as guest_entitlements and guest_entitlements_missing, so this is a false positive. |
| No-build precheck | Head and base stayed stable; diff, conventions/template, and live stack checks passed. The isolated worktree lacked the local-only ABI and test-quality helper scripts, so I reran both helpers from the main checkout. No C++ test/build was run locally. |
| Current-main merge previews | #13459 is clean against current main. #8646 conflicts with current main in core/libs/tests/GuestOfflineImports.cpp and docs/dev/debt/libSceNpEntitlementAccess.md. |
| Hosted CI | At the last refresh, intake, labels, conventions, eligibility, report, and library-portability were all queued for this head. |
Unedited command output
git diff --check produced no stdout or stderr and exited 0.
All conventions checks passed.
ABI audit: passed
sceNpEntitlementAccessAbortRequest: NID=HFcQl9TMcFQ declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessDeleteRequest: NID=Z0eQj8m7XA8 declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGenerateTransactionId: NID=IQtb-TaIjSM declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetAddcontEntitlementInfo: NID=xddD23+8TfQ declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual: NID=3Cy40mvJFyE declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetAddcontEntitlementInfoList: NID=TFyU+KFBv54 declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetEntitlementKey: NID=5LiMEPuW0DQ declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetGameTrialsFlag: NID=y7JD1gfwyfA declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetPftFlag: NID=eDXKe9FndlE declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessGetSkuFlag: NID=lPDO62PpJIA declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessInitialize: NID=jO8DM8oyego declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessPollConsumableEntitlementInfo: NID=41q4BQrLOyM declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessPollConsumeEntitlement: NID=69u+XqsoNd0 declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessPollServiceEntitlementInfo: NID=ShGBFuoSSsQ declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessPollServiceEntitlementInfoList: NID=aFv8qms6XTM declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessPollUnifiedEntitlementInfo: NID=M4XlLFnzQaQ declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessPollUnifiedEntitlementInfoList: NID=nAEqawEZG5s declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestConsumableEntitlementInfo: NID=RU6hHrrzpfc declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestConsumeEntitlement: NID=1c2E1ghXt90 declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestConsumeServiceEntitlement: NID=Aqae0TjLvQU declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestConsumeUnifiedEntitlement: NID=eOxGbG3sPb0 declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestServiceEntitlementInfo: NID=M8icY9OwkKs declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestServiceEntitlementInfoList: NID=brbRxzr7qyI declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestUnifiedEntitlementInfo: NID=jautSRs4OdQ declarations=1 definitions=1 aliases=0
sceNpEntitlementAccessRequestUnifiedEntitlementInfoList: NID=uCZf2L27th8 declarations=1 definitions=1 aliases=0
limit: This lexical audit does not parse C++ fully, prove calling-convention or binary ABI correctness, verify runtime version tables, or replace compilation.
limit: An absent source declaration or explicit alias can be intentional for assembly exports, conditional platform code, or generated interfaces; inspect findings before treating them as defects.
{
"findings": [
{
"path": "core/libs/tests/GuestEntitlements.cpp",
"line": 1,
"kind": "possible-unregistered-cpp-test",
"message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
}
],
"negative_control_candidates": [],
"limits": [
"Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
"A test that passes against base is not by itself proof that the PR test is inadequate.",
"Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
]
}
Current-main merge preview for #13459:
5afc26dea39f946a480068c3be1f67dbe2438ebe
exit=0
Current-main merge preview for #8646:
f5cb07e962cc32ca9cb9ee8645e55dacf43cf519
100644 32dcdd9acf24b139ea0a608fadfb9097133a2ab8 1\tcore/libs/tests/GuestOfflineImports.cpp
100644 9e441d4b0c57e8393d9a924bebf56699ea201f96 2\tcore/libs/tests/GuestOfflineImports.cpp
100644 46512aa95484e2c25213d319a83e2c76ba7b627d 3\tcore/libs/tests/GuestOfflineImports.cpp
100644 2a9d2f30893a4e9e28839d19c3621b3bcc9b8408 1\tdocs/dev/debt/libSceNpEntitlementAccess.md
100644 c0574df28ccf9030a1e7c834ae89822e7e85769e 2\tdocs/dev/debt/libSceNpEntitlementAccess.md
100644 131c1df5c6547a7992b8c98cf1563a2f85c14a84 3\tdocs/dev/debt/libSceNpEntitlementAccess.md
Auto-merging core/libs/prx/libSceNpEntitlementAccess/Export.cpp
Auto-merging core/libs/tests/GuestOfflineImports.cpp
CONFLICT (content): Merge conflict in core/libs/tests/GuestOfflineImports.cpp
Auto-merging docs/dev/debt/libSceNpEntitlementAccess.md
CONFLICT (content): Merge conflict in docs/dev/debt/libSceNpEntitlementAccess.md
exit=1
Negative control
| Assertion | Change used for the control | Result |
|---|---|---|
The new export succeeds for listed labels with non--1 user IDs and rejects the old stub |
The PR reports running the new test with the base stub and separately with the old library declaration | The author reports that the stub aborts with “not implemented” and that the old declaration fails compilation due to too many arguments; I did not run either control locally. |
Findings
Blocking
- PR #8646 is still open at head
17934e1576a4b299740e15c53d28ded579115570. Its debt-file change and this PR both rewrite the samesceNpEntitlementAccessGetAddcontEntitlementInfoIndividualentry. The PR body itself notes the debt-line conflict and says whichever merges second needs a rebase, while this PR's checklist saysDepends on: none. Repository policy requires the authors to agree which goes first and declare that order withDepends on. Please coordinate with #8646's author and update the dependency/order before this is ready. The overlap is visible in the pinned #13459 debt entry and #8646 debt entry; see the repository's overlap rule.
Non-blocking
No additional source-level blocker was found in the changed export or its tests. The PR notes that the prototype and behavior are based on a replacement module and have not been measured on a PS5 or confirmed from a title call site; those limits remain unverified here.
Sources
Not verified
- I did not build or run the C++ guest tests; the PR reports they passed in a Linux GitHub Codespace.
- The author-reported negative controls were not independently run.
- Native PS5 ABI, title call-site behavior, and console error precedence were not verified; the PR itself records those limitations.
- All six hosted checks were queued at the last status refresh.
To get this to a good state
Agree with the author of #8646 which PR should land first and declare the dependency/order in the checklist. I will rerun the same checks against the updated head.
|
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.
|
Progress report (9f748f4 → b08d773)📈 System libraries: 27.27% (+0.01%, +1 implemented functions) ✅ 1 implemented
Changed libraries (implemented exports)
|
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tree also carried the open PRs #13485, #13479, #13470, #13462, #13458, #13457, #13456, all merged cleanly, so the run is a joint one. AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
Checked the diff against the description, the sibling export it delegates to, the new |
Source of the behaviour
Not measured on a device, and no title call site was read.
-1check: dlc_emu,scenpentitlementaccess_exports.cppL102-L115, a replacementlibSceNpEntitlementAccessmodule (GPL-3.0, read for behaviour only, no code taken). Its export returns the parameter error for user ID-1before anything else.dlc_content.cppL2465-L2483. It returns the parameter error when its label check fails (a null label, nonzero padding, an empty label or no NUL indata) or wheninfois null, then does the same lookup as itssceNpEntitlementAccessGetAddcontEntitlementInfo. Its comment says the symbol is "omitted from the SDK 10 weak stub", so the prototype is that module's runtime declaration, not an SDK header.sceNpEntitlementAccessGetAddcontEntitlementInfoonmainand its error codes. The new export calls it, so the error values and the file lookup are the ones the tree already uses.main: the export, its declaration and its debt line.Where this PR and dlc_emu differ:
0x80558007(NOT_FOUND), which the sibling export uses here, not dlc_emu's no-entitlement error.dataand a label with nonzero padding. Here, as in the sibling, which only checks for null pointers, the first two return0x80558007and the padding is ignored.-1is rejected, because entitlements here are not per user.The debt entry records all of this.
What
sceNpEntitlementAccessGetAddcontEntitlementInfoIndividualnow looks up an add-on for a user instead of throwing. It takes(int32_t userId, uint32_t serviceLabel, const NpUnifiedEntitlementLabel* entitlementLabel, NpEntitlementAccessAddcontEntitlementInfo* info):-1returns the parameter error0x80558003before any other check;sceNpEntitlementAccessGetAddcontEntitlementInforeturns for the label: the parameter error for a null label or info, the add-on's info and 0 for a label listed inanyps5-entitlements.ini, and0x80558007for any other label, with*infountouched.The other three exports in the old debt line still throw. Their line keeps its provenance through a link to the entry on
main.Changes:
Export.cpp,Api.hpp: the prototype and the body.guest_entitlements:0x10000000andINT32_MIN;0x80558007, and*infostays untouched;-1returns0x80558003, even with null pointers, and*infostays untouched;0x80558003.docs/dev/debt/libSceNpEntitlementAccess.md: the export gets its own entry and leaves the four-name "no prototype" line.Tested
Linux (GitHub Codespace, 4 cores, native build of this branch applied on
9f748f4d8):guest_entitlementsandguest_entitlements_missingpass.main,guest_entitlementsaborts withsceNpEntitlementAccessGetAddcontEntitlementInfoIndividual not implemented.core/libs/prx/libSceNpEntitlementAccessfrommain, the test does not compile (too many arguments).Checks:
python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.py --branch feat/npentitlementaccess-addcont-info-individualcould not compare feat(libSceNpEntitlementAccess): report signed out from the consumable entitlement requests #8646, which already conflicts withmain. Compared by hand:Export.cppchange merges cleanly with this branch, but the debt line conflicts, as it already does withmain. Whichever merges second needs a one-line rebase.sceNpEntitlementAccessGetAddcontEntitlementInfoand merges cleanly. With both merged, the new export would log the same way.tools/progress.py --compare: +1 implemented function (libSceNpEntitlementAccess21/25 to 22/25).Checklist
main(9f748f4d8); 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)