fix(np): expose a local account ID while offline #6990
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6990"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:15:32Z.
What
Give the initial emulator profile a fixed, emulator-local 64-bit account ID through both
sceNpGetAccountIdAandsceUserServiceGetNpAccountId. This models a locally linked profile whose cached account ID remains available without network access. Other user IDs still report signed out; NP state and online requests remain signed out. The ID is not persisted and does not represent a real PSN account.Adds tests for matching IDs, null output, an absent user, and the signed-out NP state. Documents the local-only account ID assumption in the user-service debt entry.
Offline account evidence
The reporter of #1794 says a real PS5, with an offline local profile linked to an account, returns that profile's cached 64-bit ID from
sceNpGetAccountIdA(USER_SERVICE_INITIAL_USER_ID, ...), while NP reachability is unavailable and NP state is signed out (report). Currentmainmodels the no-linked-account case as user-service ID 0 and NP signed out. This PR models the linked-profile case; the project has no persistent linked-profile data, so0x0100000000000001is a fixed emulator-local placeholder, not a measured or derived PSN ID.Dying Light 2 (PPSA02262) has not been run on this PR branch. The report on #1794 establishes the current-main stop and the reporter's console observation, but not that this change gets past sign-in or reaches gameplay. No title-unblock claim is made.
Tested
Linux x86-64, GCC 12.2.0, CMake Release,
BUILD_TESTING=ON, on head3d94c740a3rebased onto upstreammain352dbe751a:guest_np_manager_testsandguest_user_service_testsbuilt successfully.guest_np_managerandguest_user_servicestarted both executables, but each aborted at the project CPU guard before reaching test assertions. This Xeon E5-1620 v2 lacks LZCNT, BMI1, BMI2, MOVBE, AVX2 and FMA.python3 tools/check_conventions.py --base upstream/mainandgit diff upstream/main...HEAD --checkpassed.guest_np_managerandguest_user_serviceeach pass 3/3 on the PR head. With the two changed export files restored tomainwhile keeping the new tests, both fail 3/3 with exit0xc0000409, confirming the focused assertions detect the implementation. Not tested: a title run.Checklist
main; 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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:20:14Z.
The overlap report lists only
CMakeLists.txt, which is not among this PR’s six changed files. I manually checked #6044’s test moves: the assertions are preserved in the mergedservices/paths. The other listed PRs also do not touch this diff. GitHub reports this PR CLEAN.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T02:41:24Z.
Follow-up to the overlap bot report: I checked the current file lists for #6044 and #6447. #6044 does not modify the current
GuestNpManager.cpporGuestUserService.cpppaths; its test reorganization moved the assertions elsewhere. #6447 modifieslibSceNpManager/Export.cpponly in the game-presence callback, content restriction, and sandbox-info functions; this PR changes the offline account-ID function, so the hunks are disjoint. No dependency or duplicate implementation found.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-17T15:16:30Z.
Review: COMMENTED
First run of the new assertions on a CPU that passes the host guard (the description notes both tests abort at the guard on the author's Xeon).
Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release,
BUILD_TESTING=ON, full build.Head
be412cf05merged ontomain40315fcf8(clean merge).guest_np_managerandguest_user_servicepass with the PR. The other NP and user-service tests (ctest -R "np_|user_service|npmanager", 12 tests) also pass.main, since they use the newUSER_SERVICE_INITIAL_ACCOUNT_ID. With the PR merged but bothExport.cppfiles as onmain, both tests abort;guest_np_managerstops atNpManager: sceNpGetAccountIdA must reject a null output. So the tests cover the change.ctest -E "^agc|gpu|vulkan|video_out"): 682/682, same asmainon this machine.Not checked: Dying Light 2 (PPSA02262).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T20:36:12Z.
Thanks for running the new assertions on a host that passes the CPU guard, and for checking the negative control against the unchanged exports. The two focused targets and 12 related NP/user-service tests passing confirm the assertions exercise these changes; the 682-test non-GPU run is also useful regression coverage. I have kept Dying Light 2 runtime validation explicitly unclaimed in the PR description.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T12:44:52Z.
Review: CHANGES_REQUESTED
Thanks for the PR and the clear description. The main problem is the source of the behaviour:
sceNpGetAccountIdAnow returns success with an invented id (0x0100000000000001) whilesceNpGetStatestays signed out. KytyPS5 (NpGetAccountIdA), shadPS4 (sceNpGetAccountIdA) and prosper (s_np_accountid, with a test) all agree on the opposite: id0andSCE_NP_ERROR_SIGNED_OUTwhen there is no PSN sign-in. Nothing cited supports "a locally linked profile keeps a cached account id" on the console, and the value is not derived from anything.To move forward, please add one of: a measurement or reference showing that a real console returns a non-zero account id from these two calls with no PSN sign-in (with the value or its derivation), or a title log showing this change gets past the sign-in error. If the id is needed only by
sceUserServiceGetNpAccountId, keepsceNpGetAccountIdAsigned out and say so in the debt entry.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T14:09:14Z.
Thanks for spelling out the evidence needed. The latest current-main run in issue #1794 does confirm the observed stop: Dying Light 2 retries
sceNpGetAccountIdAafter0x80550006343 times in 20 seconds. It does not show that this PR's branch passes the sign-in step, and I do not have the title dump/runtime here to perform that check. I also do not have a PS5 measurement for the fixed account ID or its derivation. I can't claim the requested validation or that this unblocks the title; the branch's runtime behavior remains unverified.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T20:39:33Z.
I corrected the checklist to say “Unblocks: none claimed.” The current-main trace in #1794 confirms the reported failure, but it does not establish that this branch gets through sign-in, and I have no console measurement for the proposed account ID. I cannot satisfy the review's requested evidence yet, so I am leaving the title-unblock claim unresolved.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:16:36Z.
A new report on #1794 provides relevant console evidence: the issue reporter says a real PS5 with an offline linked local profile returns its cached 64-bit account ID from
sceNpGetAccountIdA, while NP reachability is unavailable and NP state is signed out (report). They also explain that Dying Light 2 treatsSCE_NP_ERROR_SIGNED_OUTas no local account and retries sign-in.That supports the nonzero offline behavior, but it does not establish the placeholder constant's actual value or prove this PR's branch reaches gameplay. The PR intentionally labels the ID emulator-local and makes no claim that it is a console-derived account ID. The requested title run is still outstanding. Would the issue reporter's first-hand behavior report address the API-semantics concern, leaving the exact value and title result as limitations, or do you need a console readout with the actual ID before this change is acceptable?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T18:23:27Z.
Rebased #6990 onto current
main352dbe751aas3d94c740a3. The conflict resolution keeps main's initialization-priority implementation and measured documentation, while preserving this PR's linked-profile account-ID behavior and tests. I updated the debt entry to distinguish the assumed unlinked case from the linked-profile model and to identify the fixed ID as an emulator-local placeholder.On this head, both focused test executables build successfully. CTest starts them but they abort at the host CPU guard before assertions on this Xeon E5-1620 v2 (missing LZCNT, BMI1/2, MOVBE, AVX2 and FMA). Conventions and
git diff upstream/main...HEAD --checkpass. Dying Light 2 has not been run on this head, so the PR still makes no title-unblock claim. The #1794 reporter's offline linked-profile observation is linked in the updated description; the placeholder value itself is not measured.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T18:50:22Z.
Picking this up for our testing: it addresses the stop we see in PPSA24003 on current main, one of the titles we're bringing up, and we'd like to move it into main. We'll review, test and merge it under the normal process. Your comments and review are still very welcome, @adriadam10.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:48:10Z.
Thanks for picking this up for PPSA24003 testing. That title evidence is useful context for review; I’ll keep the PR’s claims tied to the checks and runtime coverage reported on its head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:40:07Z.
Thanks for the detailed source comparison. I agree the current success path returns an invented account ID, and the available implementations and offline API behavior do not establish that this is correct on-console. I’ll keep that evidence gap explicit and won’t treat the passing host tests as behavioral proof. I saw the update that you are testing the PPSA24003 stop; I’ll wait for those results before deciding whether there is enough title evidence to retain or change this behavior.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-21T04:47:52Z.
Windows data point for
3d94c740amerged ontomainf47c85663(clean,git merge-treerc 0): Windows 10.0.19045, MinGW-w64 GCC 15.2.0, Release. For each ofguest_np_managerandguest_user_service,ctest -N -R '^<name>$'lists exactly that one test andctest --no-tests=error -R '^<name>$'was run three times per tree.core/libs/prx/libSceNpManager/Export.cppandcore/libs/prx/libSceUserService/Export.cpprestored tomain(the new test cases andUserService.hppkept so that the tests build): both fail 3 of 3, exit code0xc0000409(the test process aborts).Not tested: other platforms, a title run.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:03:03Z.
Thanks for the Windows run. The 3/3 PR pass and 3/3 negative-control failure on each focused target show the new assertions exercise both exports on this head. I tried to add this platform result to the Tested section, but the CLI edit failed on a deprecated Projects field; title behavior remains unverified.
Pull request closed