feat(libSceSystemService): answer the rest of the running title's identity #10801

Merged
EagleBearerYS merged 6 commits from upstream-pr/10801 into main 2026-10-27 05:07:37 +00:00
EagleBearerYS commented 2026-10-25 01:44:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-25T01:44:42Z.


What

Answers the rest of the running title's identity in libSceSystemService, after #8354:

  • sceLncUtilGetAppId and sceLncUtilIsAppLaunched take the running title's ID as sceSystemServiceGetAppId does.
  • sceLncUtilGetAppIdOfRunningBigApp returns what sceSystemServiceGetAppIdOfRunningBigApp returns.
  • sceLncUtilGetAppIdListOfBigApp and sceSystemServiceGetAppIdListOfBigApp list the running title alone.
  • sceLncUtilGetAppLaunchedUser, sceSystemServiceGetAppLaunchedUser and sceShellCoreUtilGetUserFocus write the initial user, 0x10000000, which sceUserServiceGetInitialUser and sceUserServiceGetForegroundUser report. That is the emulator's own user, not a console measurement.
  • sceLncUtilIsAppSuspended, sceSystemServiceIsAppSuspended and sceLncUtilIsSpeculativeLaunch write false, from the emulator's own state, not a console measurement: it never suspends the running title, and it starts the title from the host, with no LncLaunchParam asking for a speculative launch.
  • sceLncUtilLoadExec forwards to sceSystemServiceLoadExec.

The arguments firmware 13.42's libSceSystemService.sprx checks before it makes a request give its results, as @BunnyFl measured (comment): a null or non-9-character title ID makes sceSystemServiceGetAppId and sceLncUtilGetAppId return -1 and sceLncUtilIsAppLaunched 0x80940005, a null output, list, count or user returns 0x80940005 (0x80e30003 from sceShellCoreUtilGetUserFocus) before the app ID is looked at, and a null sceLncUtilLoadExec path returns 0x80940005. What the module passes on as a request still throws, because the console's answers are unknown: another app ID or 9-character title ID, a list capacity of 0 and an empty sceLncUtilLoadExec path. sceShellCoreUtilGetAppEnterButtonAssign stays unimplemented: sceSystemServiceParamGetInt(1000) returns 0x80A10003, as measured on a PS5, so the tree has no enter-button assignment to report. The debt file has an entry for each group.

Related: #8354 (running title's app ID and title ID), #9586 (libSceSystemService suspend notifications and absent features; no shared lines, both merge cleanly).

Tested

  • GitHub's runners (run 40149425073): 15 tests, 10 runs each, pass on Linux and on Windows, 0 skipped: guest_system_service, guest_system_service_app_title_id_{known,long,missing}, the new guest_lnc_util_load_exec_exit, and the other 10 guest_system_exit tests (guest_system_exit, guest_system_exit_parameters, guest_requested_exit, guest_quick_exit, guest_immediate_exit, guest_immediate_exit_drain, guest_return_from_main, guest_system_relaunch, guest_nested_exit, guest_exit_finalizers_before_shutdown). With main's implementation the set fails. The libc and libkernel suites pass: Linux 143 and 206 tests run, Windows 170 and 222, 0 failed.
  • Red/green per commit (Linux, Ubuntu 24.04, gcc 13.3, CI flags): each commit's tests fail with its product change reverted and pass with it.
  • Full ctest on Linux: 2,097 passed, 90 skipped and 5 failed; the 5 are IPv6 tests that host cannot run.

No title tested.

  • 1928c54b4f, firmware 13.42's argument checks (run), after MarcZX10's review and @BunnyFl's emulator run of the 13.42 module. The tests now expect those results: the malformed title IDs PPSA0000, PPSA000000, PPSA00000 , PPSA00000 and the empty string, null pointers and null outputs, also for app IDs other than the running one, and null lists and counts, while a capacity of 0, another app ID and an empty sceLncUtilLoadExec path still throw. The guest_system_service and guest_system_exit tests, guest_system_service_app_title_id_{known,long,missing}, guest_lnc_util_load_exec_exit and public_headers pass 10 runs in a row. Linux: 18 run, 18 pass, 0 skip, 0 fail. Windows: 19 run, 19 pass, 0 skip, 0 fail. The before arm, the previous head 7a4b965d6f with these tests, doesn't build, since the tests use the new error constants. Suites: libc and libkernel pass on Linux (143 and 206) and on Windows (170 and 222). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 2c9d0ec646, following the rule that tests don't require a placeholder to throw (run). The tests no longer require the app list with no room, the running-app queries for another app ID, sceLncUtilIsAppLaunched for another title (three checks) or sceLncUtilGetAppId for another title to throw, since those answers aren't measured and such a check fails once the call is implemented; GetAppIdThrows is back to main's form. The calls still refuse those cases, as the debt entries say, and the running title's answers and firmware 13.42's argument checks stay. The guest_system_service tests pass 10 runs in a row. Linux: 6 run, 6 pass, 0 skip, 0 fail. Windows: 7 run, 7 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (143 and 206) and on Windows (170 and 222). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5000876936 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10801). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-25T01:44:42Z. --- ### What Answers the rest of the running title's identity in libSceSystemService, after #8354: - `sceLncUtilGetAppId` and `sceLncUtilIsAppLaunched` take the running title's ID as `sceSystemServiceGetAppId` does. - `sceLncUtilGetAppIdOfRunningBigApp` returns what `sceSystemServiceGetAppIdOfRunningBigApp` returns. - `sceLncUtilGetAppIdListOfBigApp` and `sceSystemServiceGetAppIdListOfBigApp` list the running title alone. - `sceLncUtilGetAppLaunchedUser`, `sceSystemServiceGetAppLaunchedUser` and `sceShellCoreUtilGetUserFocus` write the initial user, 0x10000000, which `sceUserServiceGetInitialUser` and `sceUserServiceGetForegroundUser` report. That is the emulator's own user, not a console measurement. - `sceLncUtilIsAppSuspended`, `sceSystemServiceIsAppSuspended` and `sceLncUtilIsSpeculativeLaunch` write false, from the emulator's own state, not a console measurement: it never suspends the running title, and it starts the title from the host, with no `LncLaunchParam` asking for a speculative launch. - `sceLncUtilLoadExec` forwards to `sceSystemServiceLoadExec`. The arguments firmware 13.42's `libSceSystemService.sprx` checks before it makes a request give its results, as @BunnyFl measured ([comment](https://github.com/boykopovar/AnyPS5/pull/10801#issuecomment-6403075212)): a null or non-9-character title ID makes `sceSystemServiceGetAppId` and `sceLncUtilGetAppId` return -1 and `sceLncUtilIsAppLaunched` 0x80940005, a null output, list, count or user returns 0x80940005 (0x80e30003 from `sceShellCoreUtilGetUserFocus`) before the app ID is looked at, and a null `sceLncUtilLoadExec` path returns 0x80940005. What the module passes on as a request still throws, because the console's answers are unknown: another app ID or 9-character title ID, a list capacity of 0 and an empty `sceLncUtilLoadExec` path. `sceShellCoreUtilGetAppEnterButtonAssign` stays unimplemented: `sceSystemServiceParamGetInt(1000)` returns 0x80A10003, as measured on a PS5, so the tree has no enter-button assignment to report. The debt file has an entry for each group. Related: #8354 (running title's app ID and title ID), #9586 (libSceSystemService suspend notifications and absent features; no shared lines, both merge cleanly). ### Tested - **GitHub's runners** ([run 40149425073](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40149425073)): 15 tests, 10 runs each, pass on Linux and on Windows, 0 skipped: `guest_system_service`, `guest_system_service_app_title_id_{known,long,missing}`, the new `guest_lnc_util_load_exec_exit`, and the other 10 `guest_system_exit` tests (`guest_system_exit`, `guest_system_exit_parameters`, `guest_requested_exit`, `guest_quick_exit`, `guest_immediate_exit`, `guest_immediate_exit_drain`, `guest_return_from_main`, `guest_system_relaunch`, `guest_nested_exit`, `guest_exit_finalizers_before_shutdown`). With main's implementation the set fails. The libc and libkernel suites pass: Linux 143 and 206 tests run, Windows 170 and 222, 0 failed. - **Red/green per commit** (Linux, Ubuntu 24.04, gcc 13.3, CI flags): each commit's tests fail with its product change reverted and pass with it. - Full ctest on Linux: 2,097 passed, 90 skipped and 5 failed; the 5 are IPv6 tests that host cannot run. No title tested. - **1928c54b4f, firmware 13.42's argument checks** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40234711527)), after MarcZX10's review and @BunnyFl's emulator run of the 13.42 module. The tests now expect those results: the malformed title IDs `PPSA0000`, `PPSA000000`, `PPSA00000 `, ` PPSA00000` and the empty string, null pointers and null outputs, also for app IDs other than the running one, and null lists and counts, while a capacity of 0, another app ID and an empty `sceLncUtilLoadExec` path still throw. The `guest_system_service` and `guest_system_exit` tests, `guest_system_service_app_title_id_{known,long,missing}`, `guest_lnc_util_load_exec_exit` and `public_headers` pass 10 runs in a row. Linux: 18 run, 18 pass, 0 skip, 0 fail. Windows: 19 run, 19 pass, 0 skip, 0 fail. The before arm, the previous head 7a4b965d6f with these tests, doesn't build, since the tests use the new error constants. Suites: libc and libkernel pass on Linux (143 and 206) and on Windows (170 and 222). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **2c9d0ec646, following the rule that tests don't require a placeholder to throw** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40355133803)). The tests no longer require the app list with no room, the running-app queries for another app ID, `sceLncUtilIsAppLaunched` for another title (three checks) or `sceLncUtilGetAppId` for another title to throw, since those answers aren't measured and such a check fails once the call is implemented; `GetAppIdThrows` is back to `main`'s form. The calls still refuse those cases, as the debt entries say, and the running title's answers and firmware 13.42's argument checks stay. The `guest_system_service` tests pass 10 runs in a row. Linux: 6 run, 6 pass, 0 skip, 0 fail. Windows: 7 run, 7 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (143 and 206) and on Windows (170 and 222). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-25 01:54:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T01:54:11Z.

Review: DISMISSED


I reviewed the current head 7a4b965d6fcf73ea1d45e46d78f00ff4c511daaa and found behavior that needs clarification or correction before these exports can be treated as implemented.\n\n1. sceLncUtilIsAppLaunched currently calls RunningAppId, which throws for every title ID other than the current one. The API is specifically a launched-state query, so a valid, non-running title should ordinarily be reportable as false; that case is distinct from malformed/null input. The new test IsAppLaunchedThrows asserts the opposite for every other title and does not validate an ordinary negative result. Please confirm the console contract from evidence or implement the supported false result and add a test.\n\n2. The three launched/focus user functions always return USER_SERVICE_INITIAL_USER_ID. The cited local evidence only establishes the initial user and foreground user in the simplest state. libSceUserService supports additional connected users, so this does not establish that the initial user launched every title or that it remains the focused user. Please add evidence/modeling for the relevant launch/focus state, or keep unsupported cases throwing rather than claim a general answer.\n\n3. The new running-app list writes one ID whenever capacity is nonzero, but has no evidence for the API’s capacity/count contract (including whether a zero-capacity query should return a required count). Likewise, list nulls/zero capacity currently throw via NotImplemented_nid_no_patch; please document a source or probe for these return semantics, or leave the export unsupported until known.\n\n4. The PR body’s detailed test run is from an older branch SHA, while the current head adds sceLncUtilLoadExec. The current-head hosted Build run passed its policy/eligibility steps but skipped the Linux and Windows product jobs due to path filters. Please run/report the focused guest exit test for the alias on this head (or update the test evidence); no current-head product test result is visible in CI.\n\nI did run the repository convention checker and git diff --check against current main; both pass. I also confirmed the local user service can represent secondary connected users, which is why the hardcoded launched/focus user needs a more precise basis.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5641013115 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10801#pullrequestreview-5641013115). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T01:54:11Z. **Review:** DISMISSED --- I reviewed the current head `7a4b965d6fcf73ea1d45e46d78f00ff4c511daaa` and found behavior that needs clarification or correction before these exports can be treated as implemented.\n\n1. `sceLncUtilIsAppLaunched` currently calls `RunningAppId`, which throws for every title ID other than the current one. The API is specifically a launched-state query, so a valid, non-running title should ordinarily be reportable as `false`; that case is distinct from malformed/null input. The new test `IsAppLaunchedThrows` asserts the opposite for every other title and does not validate an ordinary negative result. Please confirm the console contract from evidence or implement the supported false result and add a test.\n\n2. The three launched/focus user functions always return `USER_SERVICE_INITIAL_USER_ID`. The cited local evidence only establishes the initial user and foreground user in the simplest state. `libSceUserService` supports additional connected users, so this does not establish that the initial user launched every title or that it remains the focused user. Please add evidence/modeling for the relevant launch/focus state, or keep unsupported cases throwing rather than claim a general answer.\n\n3. The new running-app list writes one ID whenever capacity is nonzero, but has no evidence for the API’s capacity/count contract (including whether a zero-capacity query should return a required count). Likewise, list nulls/zero capacity currently throw via `NotImplemented_nid_no_patch`; please document a source or probe for these return semantics, or leave the export unsupported until known.\n\n4. The PR body’s detailed test run is from an older branch SHA, while the current head adds `sceLncUtilLoadExec`. The current-head hosted Build run passed its policy/eligibility steps but skipped the Linux and Windows product jobs due to path filters. Please run/report the focused guest exit test for the alias on this head (or update the test evidence); no current-head product test result is visible in CI.\n\nI did run the repository convention checker and `git diff --check` against current `main`; both pass. I also confirmed the local user service can represent secondary connected users, which is why the hardcoded launched/focus user needs a more precise basis.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!10801
No description provided.