Skip to content

feat(libSceNpEntitlementAccess): implement sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual - #13459

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
KernelPanicNT:feat/npentitlementaccess-addcont-info-individual
Oct 30, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
KernelPanicNT:feat/npentitlementaccess-addcont-info-individual

Conversation

@KernelPanicNT

Copy link
Copy Markdown
Contributor

Source of the behaviour

Not measured on a device, and no title call site was read.

Where this PR and dlc_emu differ:

  • An unlisted label returns 0x80558007 (NOT_FOUND), which the sibling export uses here, not dlc_emu's no-entitlement error.
  • dlc_emu returns the parameter error for an empty label, a label with no NUL in data and a label with nonzero padding. Here, as in the sibling, which only checks for null pointers, the first two return 0x80558007 and the padding is ignored.
  • Like the sibling, the export ignores the service label and does not check that the library is initialized; dlc_emu checks both.
  • No user ID other than -1 is rejected, because entitlements here are not per user.

The debt entry records all of this.

What

sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual now looks up an add-on for a user instead of throwing. It takes (int32_t userId, uint32_t serviceLabel, const NpUnifiedEntitlementLabel* entitlementLabel, NpEntitlementAccessAddcontEntitlementInfo* info):

  • a user ID of -1 returns the parameter error 0x80558003 before any other check;
  • any other user ID returns what sceNpEntitlementAccessGetAddcontEntitlementInfo returns for the label: the parameter error for a null label or info, the add-on's info and 0 for a label listed in anyps5-entitlements.ini, and 0x80558007 for any other label, with *info untouched.

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:
    • a listed label returns the same info as the sibling for user IDs 1, 0x10000000 and INT32_MIN;
    • an unlisted, empty or unterminated label returns 0x80558007, and *info stays untouched;
    • a listed label with nonzero padding returns 0 and the same info;
    • user -1 returns 0x80558003, even with null pointers, and *info stays untouched;
    • a null label or info returns 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_entitlements and guest_entitlements_missing pass.
  • Negative control 1: with this signature and the body from main, guest_entitlements aborts with sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual not implemented.
  • Negative control 2: with core/libs/prx/libSceNpEntitlementAccess from main, the test does not compile (too many arguments).

Checks:

Checklist

  • Based on current main (9f748f4d8); 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

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

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-8646

Results

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 same sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual entry. The PR body itself notes the debt-line conflict and says whichever merges second needs a rebase, while this PR's checklist says Depends on: none. Repository policy requires the authors to agree which goes first and declare that order with Depends 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.

@github-actions

Copy link
Copy Markdown

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 8646 core/libs/prx/libSceNpEntitlementAccess/Export.cpp
docs/dev/debt/libSceNpEntitlementAccess.md

@github-actions

Copy link
Copy Markdown

Progress report (9f748f4 → b08d773)

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

✅ 1 implemented
Library Name
libSceNpEntitlementAccess sceNpEntitlementAccessGetAddcontEntitlementInfoIndividual

Changed libraries (implemented exports)

Library Before After Change
libSceNpEntitlementAccess 21/25 (84.00%) 22/25 (88.00%) +4.00%

@maskym

maskym commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Windows result for head b08d773dd0, merged into main 556547da71 (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

The tree also carried the open PRs #13485, #13479, #13470, #13462, #13458, #13457, #13456, all merged cleanly, so the run is a joint one. guest_entitlements and guest_entitlements_missing, the tests this PR extends, pass. Every test of the touched modules passes too (23/23, three runs). Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff against the description, the sibling export it delegates to, the new guest_entitlements cases (they fail without the change) and the debt entry, which records the differences from dlc_emu. Windows run by @maskym passes; the queue's Build covers Linux. The only overlap with #8646 is the shared debt line, a one-line rebase for whichever lands second; merged.

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.

4 participants